diff --git a/docs/_snowpack/env.js b/docs/_snowpack/env.js deleted file mode 100644 index 6cb0af6a..00000000 --- a/docs/_snowpack/env.js +++ /dev/null @@ -1,3 +0,0 @@ -export const MODE = "production"; -export const NODE_ENV = "production"; -export const SSR = false; \ No newline at end of file diff --git a/docs/_snowpack/link/fraction.js b/docs/_snowpack/link/fraction.js deleted file mode 100644 index 96aee096..00000000 --- a/docs/_snowpack/link/fraction.js +++ /dev/null @@ -1,45 +0,0 @@ -import Fraction from "../pkg/fractionjs.js"; -import {TimeSpan} from "./strudel.js"; -Fraction.prototype.sam = function() { - return this.floor(); -}; -Fraction.prototype.nextSam = function() { - return this.sam().add(1); -}; -Fraction.prototype.wholeCycle = function() { - return new TimeSpan(this.sam(), this.nextSam()); -}; -Fraction.prototype.lt = function(other) { - return this.compare(other) < 0; -}; -Fraction.prototype.gt = function(other) { - return this.compare(other) > 0; -}; -Fraction.prototype.lte = function(other) { - return this.compare(other) <= 0; -}; -Fraction.prototype.gte = function(other) { - return this.compare(other) >= 0; -}; -Fraction.prototype.eq = function(other) { - return this.compare(other) == 0; -}; -Fraction.prototype.max = function(other) { - return this.gt(other) ? this : other; -}; -Fraction.prototype.min = function(other) { - return this.lt(other) ? this : other; -}; -Fraction.prototype.show = function() { - return this.s * this.n + "/" + this.d; -}; -Fraction.prototype.or = function(other) { - return this.eq(0) ? other : this; -}; -const fraction = (n) => { - if (typeof n === "number") { - n = String(n); - } - return Fraction(n); -}; -export default fraction; diff --git a/docs/_snowpack/link/repl/krill-parser.js b/docs/_snowpack/link/repl/krill-parser.js deleted file mode 100644 index 2b307417..00000000 --- a/docs/_snowpack/link/repl/krill-parser.js +++ /dev/null @@ -1,1988 +0,0 @@ -// Generated by Peggy 1.2.0. -// -// https://peggyjs.org/ - -function peg$subclass(child, parent) { - function C() { this.constructor = child; } - C.prototype = parent.prototype; - child.prototype = new C(); -} - -function peg$SyntaxError(message, expected, found, location) { - var self = Error.call(this, message); - if (Object.setPrototypeOf) { - Object.setPrototypeOf(self, peg$SyntaxError.prototype); - } - self.expected = expected; - self.found = found; - self.location = location; - self.name = "SyntaxError"; - return self; -} - -peg$subclass(peg$SyntaxError, Error); - -function peg$padEnd(str, targetLength, padString) { - padString = padString || " "; - if (str.length > targetLength) { return str; } - targetLength -= str.length; - padString += padString.repeat(targetLength); - return str + padString.slice(0, targetLength); -} - -peg$SyntaxError.prototype.format = function(sources) { - var str = "Error: " + this.message; - if (this.location) { - var src = null; - var k; - for (k = 0; k < sources.length; k++) { - if (sources[k].source === this.location.source) { - src = sources[k].text.split(/\r\n|\n|\r/g); - break; - } - } - var s = this.location.start; - var loc = this.location.source + ":" + s.line + ":" + s.column; - if (src) { - var e = this.location.end; - var filler = peg$padEnd("", s.line.toString().length); - var line = src[s.line - 1]; - var last = s.line === e.line ? e.column : line.length + 1; - str += "\n --> " + loc + "\n" - + filler + " |\n" - + s.line + " | " + line + "\n" - + filler + " | " + peg$padEnd("", s.column - 1) - + peg$padEnd("", last - s.column, "^"); - } else { - str += "\n at " + loc; - } - } - return str; -}; - -peg$SyntaxError.buildMessage = function(expected, found) { - var DESCRIBE_EXPECTATION_FNS = { - literal: function(expectation) { - return "\"" + literalEscape(expectation.text) + "\""; - }, - - class: function(expectation) { - var escapedParts = expectation.parts.map(function(part) { - return Array.isArray(part) - ? classEscape(part[0]) + "-" + classEscape(part[1]) - : classEscape(part); - }); - - return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]"; - }, - - any: function() { - return "any character"; - }, - - end: function() { - return "end of input"; - }, - - other: function(expectation) { - return expectation.description; - } - }; - - function hex(ch) { - return ch.charCodeAt(0).toString(16).toUpperCase(); - } - - function literalEscape(s) { - return s - .replace(/\\/g, "\\\\") - .replace(/"/g, "\\\"") - .replace(/\0/g, "\\0") - .replace(/\t/g, "\\t") - .replace(/\n/g, "\\n") - .replace(/\r/g, "\\r") - .replace(/[\x00-\x0F]/g, function(ch) { return "\\x0" + hex(ch); }) - .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return "\\x" + hex(ch); }); - } - - function classEscape(s) { - return s - .replace(/\\/g, "\\\\") - .replace(/\]/g, "\\]") - .replace(/\^/g, "\\^") - .replace(/-/g, "\\-") - .replace(/\0/g, "\\0") - .replace(/\t/g, "\\t") - .replace(/\n/g, "\\n") - .replace(/\r/g, "\\r") - .replace(/[\x00-\x0F]/g, function(ch) { return "\\x0" + hex(ch); }) - .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return "\\x" + hex(ch); }); - } - - function describeExpectation(expectation) { - return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation); - } - - function describeExpected(expected) { - var descriptions = expected.map(describeExpectation); - var i, j; - - descriptions.sort(); - - if (descriptions.length > 0) { - for (i = 1, j = 1; i < descriptions.length; i++) { - if (descriptions[i - 1] !== descriptions[i]) { - descriptions[j] = descriptions[i]; - j++; - } - } - descriptions.length = j; - } - - switch (descriptions.length) { - case 1: - return descriptions[0]; - - case 2: - return descriptions[0] + " or " + descriptions[1]; - - default: - return descriptions.slice(0, -1).join(", ") - + ", or " - + descriptions[descriptions.length - 1]; - } - } - - function describeFound(found) { - return found ? "\"" + literalEscape(found) + "\"" : "end of input"; - } - - return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found."; -}; - -function peg$parse(input, options) { - options = options !== undefined ? options : {}; - - var peg$FAILED = {}; - var peg$source = options.grammarSource; - - var peg$startRuleFunctions = { start: peg$parsestart }; - var peg$startRuleFunction = peg$parsestart; - - var peg$c0 = "."; - var peg$c1 = "-"; - var peg$c2 = "+"; - var peg$c3 = "0"; - var peg$c4 = ","; - var peg$c5 = "\""; - var peg$c6 = "'"; - var peg$c7 = "#"; - var peg$c8 = "^"; - var peg$c9 = "_"; - var peg$c10 = "["; - var peg$c11 = "]"; - var peg$c12 = "<"; - var peg$c13 = ">"; - var peg$c14 = "@"; - var peg$c15 = "!"; - var peg$c16 = "("; - var peg$c17 = ")"; - var peg$c18 = "/"; - var peg$c19 = "*"; - var peg$c20 = "%"; - var peg$c21 = "struct"; - var peg$c22 = "target"; - var peg$c23 = "euclid"; - var peg$c24 = "slow"; - var peg$c25 = "rotL"; - var peg$c26 = "rotR"; - var peg$c27 = "fast"; - var peg$c28 = "scale"; - var peg$c29 = "//"; - var peg$c30 = "cat"; - var peg$c31 = "$"; - var peg$c32 = "setcps"; - var peg$c33 = "setbpm"; - var peg$c34 = "hush"; - - var peg$r0 = /^[1-9]/; - var peg$r1 = /^[eE]/; - var peg$r2 = /^[0-9]/; - var peg$r3 = /^[ \n\r\t]/; - var peg$r4 = /^[0-9a-zA-Z~]/; - var peg$r5 = /^[^\n]/; - - var peg$e0 = peg$otherExpectation("number"); - var peg$e1 = peg$literalExpectation(".", false); - var peg$e2 = peg$classExpectation([["1", "9"]], false, false); - var peg$e3 = peg$classExpectation(["e", "E"], false, false); - var peg$e4 = peg$literalExpectation("-", false); - var peg$e5 = peg$literalExpectation("+", false); - var peg$e6 = peg$literalExpectation("0", false); - var peg$e7 = peg$classExpectation([["0", "9"]], false, false); - var peg$e8 = peg$otherExpectation("whitespace"); - var peg$e9 = peg$classExpectation([" ", "\n", "\r", "\t"], false, false); - var peg$e10 = peg$literalExpectation(",", false); - var peg$e11 = peg$literalExpectation("\"", false); - var peg$e12 = peg$literalExpectation("'", false); - var peg$e13 = peg$classExpectation([["0", "9"], ["a", "z"], ["A", "Z"], "~"], false, false); - var peg$e14 = peg$literalExpectation("#", false); - var peg$e15 = peg$literalExpectation("^", false); - var peg$e16 = peg$literalExpectation("_", false); - var peg$e17 = peg$literalExpectation("[", false); - var peg$e18 = peg$literalExpectation("]", false); - var peg$e19 = peg$literalExpectation("<", false); - var peg$e20 = peg$literalExpectation(">", false); - var peg$e21 = peg$literalExpectation("@", false); - var peg$e22 = peg$literalExpectation("!", false); - var peg$e23 = peg$literalExpectation("(", false); - var peg$e24 = peg$literalExpectation(")", false); - var peg$e25 = peg$literalExpectation("/", false); - var peg$e26 = peg$literalExpectation("*", false); - var peg$e27 = peg$literalExpectation("%", false); - var peg$e28 = peg$literalExpectation("struct", false); - var peg$e29 = peg$literalExpectation("target", false); - var peg$e30 = peg$literalExpectation("euclid", false); - var peg$e31 = peg$literalExpectation("slow", false); - var peg$e32 = peg$literalExpectation("rotL", false); - var peg$e33 = peg$literalExpectation("rotR", false); - var peg$e34 = peg$literalExpectation("fast", false); - var peg$e35 = peg$literalExpectation("scale", false); - var peg$e36 = peg$literalExpectation("//", false); - var peg$e37 = peg$classExpectation(["\n"], true, false); - var peg$e38 = peg$literalExpectation("cat", false); - var peg$e39 = peg$literalExpectation("$", false); - var peg$e40 = peg$literalExpectation("setcps", false); - var peg$e41 = peg$literalExpectation("setbpm", false); - var peg$e42 = peg$literalExpectation("hush", false); - - var peg$f0 = function() { return parseFloat(text()); }; - var peg$f1 = function(chars) { return chars.join("") }; - var peg$f2 = function(s) { return s}; - var peg$f3 = function(sc) { sc.arguments_.alignment = "t"; return sc;}; - var peg$f4 = function(a) { return { weight: a} }; - var peg$f5 = function(a) { return { replicate: a } }; - var peg$f6 = function(p, s, r) { return { operator : { type_: "bjorklund", arguments_ :{ pulse: p, step:s, rotation:r || 0 } } } }; - var peg$f7 = function(a) { return { operator : { type_: "stretch", arguments_ :{ amount:a } } } }; - var peg$f8 = function(a) { return { operator : { type_: "stretch", arguments_ :{ amount:"1/"+a } } } }; - var peg$f9 = function(a) { return { operator : { type_: "fixed-step", arguments_ :{ amount:a } } } }; - var peg$f10 = function(s, o) { return new ElementStub(s, o);}; - var peg$f11 = function(s) { return new PatternStub(s,"h"); }; - var peg$f12 = function(c, v) { return v}; - var peg$f13 = function(c, cs) { if (cs.length == 0 && c instanceof Object) { return c;} else { cs.unshift(c); return new PatternStub(cs,"v");} }; - var peg$f14 = function(s) { return s; }; - var peg$f15 = function(s) { return { name: "struct", args: { sequence:s }}}; - var peg$f16 = function(s) { return { name: "target", args : { name:s}}}; - var peg$f17 = function(p, s, r) { return { name: "bjorklund", args :{ pulse: parseInt(p), step:parseInt(s) }}}; - var peg$f18 = function(a) { return { name: "stretch", args :{ amount: a}}}; - var peg$f19 = function(a) { return { name: "shift", args :{ amount: "-"+a}}}; - var peg$f20 = function(a) { return { name: "shift", args :{ amount: a}}}; - var peg$f21 = function(a) { return { name: "stretch", args :{ amount: "1/"+a}}}; - var peg$f22 = function(s) { return { name: "scale", args :{ scale: s.join("")}}}; - var peg$f23 = function(s, v) { return v}; - var peg$f24 = function(s, ss) { ss.unshift(s); return new PatternStub(ss,"t"); }; - var peg$f25 = function(sg) {return sg}; - var peg$f26 = function(o, soc) { return new OperatorStub(o.name,o.args,soc)}; - var peg$f27 = function(sc) { return sc }; - var peg$f28 = function(c) { return c }; - var peg$f29 = function(v) { return new CommandStub("setcps", { value: v})}; - var peg$f30 = function(v) { return new CommandStub("setcps", { value: (v/120/2)})}; - var peg$f31 = function() { return new CommandStub("hush")}; - - var peg$currPos = 0; - var peg$savedPos = 0; - var peg$posDetailsCache = [{ line: 1, column: 1 }]; - var peg$maxFailPos = 0; - var peg$maxFailExpected = []; - var peg$silentFails = 0; - - var peg$result; - - if ("startRule" in options) { - if (!(options.startRule in peg$startRuleFunctions)) { - throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); - } - - peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; - } - - function text() { - return input.substring(peg$savedPos, peg$currPos); - } - - function offset() { - return peg$savedPos; - } - - function range() { - return { - source: peg$source, - start: peg$savedPos, - end: peg$currPos - }; - } - - function location() { - return peg$computeLocation(peg$savedPos, peg$currPos); - } - - function expected(description, location) { - location = location !== undefined - ? location - : peg$computeLocation(peg$savedPos, peg$currPos); - - throw peg$buildStructuredError( - [peg$otherExpectation(description)], - input.substring(peg$savedPos, peg$currPos), - location - ); - } - - function error(message, location) { - location = location !== undefined - ? location - : peg$computeLocation(peg$savedPos, peg$currPos); - - throw peg$buildSimpleError(message, location); - } - - function peg$literalExpectation(text, ignoreCase) { - return { type: "literal", text: text, ignoreCase: ignoreCase }; - } - - function peg$classExpectation(parts, inverted, ignoreCase) { - return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase }; - } - - function peg$anyExpectation() { - return { type: "any" }; - } - - function peg$endExpectation() { - return { type: "end" }; - } - - function peg$otherExpectation(description) { - return { type: "other", description: description }; - } - - function peg$computePosDetails(pos) { - var details = peg$posDetailsCache[pos]; - var p; - - if (details) { - return details; - } else { - p = pos - 1; - while (!peg$posDetailsCache[p]) { - p--; - } - - details = peg$posDetailsCache[p]; - details = { - line: details.line, - column: details.column - }; - - while (p < pos) { - if (input.charCodeAt(p) === 10) { - details.line++; - details.column = 1; - } else { - details.column++; - } - - p++; - } - - peg$posDetailsCache[pos] = details; - - return details; - } - } - - function peg$computeLocation(startPos, endPos) { - var startPosDetails = peg$computePosDetails(startPos); - var endPosDetails = peg$computePosDetails(endPos); - - return { - source: peg$source, - start: { - offset: startPos, - line: startPosDetails.line, - column: startPosDetails.column - }, - end: { - offset: endPos, - line: endPosDetails.line, - column: endPosDetails.column - } - }; - } - - function peg$fail(expected) { - if (peg$currPos < peg$maxFailPos) { return; } - - if (peg$currPos > peg$maxFailPos) { - peg$maxFailPos = peg$currPos; - peg$maxFailExpected = []; - } - - peg$maxFailExpected.push(expected); - } - - function peg$buildSimpleError(message, location) { - return new peg$SyntaxError(message, null, null, location); - } - - function peg$buildStructuredError(expected, found, location) { - return new peg$SyntaxError( - peg$SyntaxError.buildMessage(expected, found), - expected, - found, - location - ); - } - - function peg$parsestart() { - var s0; - - s0 = peg$parsestatement(); - - return s0; - } - - function peg$parsenumber() { - var s0, s1, s2, s3, s4; - - peg$silentFails++; - s0 = peg$currPos; - s1 = peg$parseminus(); - if (s1 === peg$FAILED) { - s1 = null; - } - s2 = peg$parseint(); - if (s2 !== peg$FAILED) { - s3 = peg$parsefrac(); - if (s3 === peg$FAILED) { - s3 = null; - } - s4 = peg$parseexp(); - if (s4 === peg$FAILED) { - s4 = null; - } - peg$savedPos = s0; - s0 = peg$f0(); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e0); } - } - - return s0; - } - - function peg$parsedecimal_point() { - var s0; - - if (input.charCodeAt(peg$currPos) === 46) { - s0 = peg$c0; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e1); } - } - - return s0; - } - - function peg$parsedigit1_9() { - var s0; - - if (peg$r0.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e2); } - } - - return s0; - } - - function peg$parsee() { - var s0; - - if (peg$r1.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e3); } - } - - return s0; - } - - function peg$parseexp() { - var s0, s1, s2, s3, s4; - - s0 = peg$currPos; - s1 = peg$parsee(); - if (s1 !== peg$FAILED) { - s2 = peg$parseminus(); - if (s2 === peg$FAILED) { - s2 = peg$parseplus(); - } - if (s2 === peg$FAILED) { - s2 = null; - } - s3 = []; - s4 = peg$parseDIGIT(); - if (s4 !== peg$FAILED) { - while (s4 !== peg$FAILED) { - s3.push(s4); - s4 = peg$parseDIGIT(); - } - } else { - s3 = peg$FAILED; - } - if (s3 !== peg$FAILED) { - s1 = [s1, s2, s3]; - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsefrac() { - var s0, s1, s2, s3; - - s0 = peg$currPos; - s1 = peg$parsedecimal_point(); - if (s1 !== peg$FAILED) { - s2 = []; - s3 = peg$parseDIGIT(); - if (s3 !== peg$FAILED) { - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$parseDIGIT(); - } - } else { - s2 = peg$FAILED; - } - if (s2 !== peg$FAILED) { - s1 = [s1, s2]; - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parseint() { - var s0, s1, s2, s3; - - s0 = peg$parsezero(); - if (s0 === peg$FAILED) { - s0 = peg$currPos; - s1 = peg$parsedigit1_9(); - if (s1 !== peg$FAILED) { - s2 = []; - s3 = peg$parseDIGIT(); - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$parseDIGIT(); - } - s1 = [s1, s2]; - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } - - return s0; - } - - function peg$parseminus() { - var s0; - - if (input.charCodeAt(peg$currPos) === 45) { - s0 = peg$c1; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e4); } - } - - return s0; - } - - function peg$parseplus() { - var s0; - - if (input.charCodeAt(peg$currPos) === 43) { - s0 = peg$c2; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e5); } - } - - return s0; - } - - function peg$parsezero() { - var s0; - - if (input.charCodeAt(peg$currPos) === 48) { - s0 = peg$c3; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e6); } - } - - return s0; - } - - function peg$parseDIGIT() { - var s0; - - if (peg$r2.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e7); } - } - - return s0; - } - - function peg$parsews() { - var s0, s1; - - peg$silentFails++; - s0 = []; - if (peg$r3.test(input.charAt(peg$currPos))) { - s1 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e9); } - } - while (s1 !== peg$FAILED) { - s0.push(s1); - if (peg$r3.test(input.charAt(peg$currPos))) { - s1 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e9); } - } - } - peg$silentFails--; - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e8); } - - return s0; - } - - function peg$parsecomma() { - var s0, s1, s2, s3; - - s0 = peg$currPos; - s1 = peg$parsews(); - if (input.charCodeAt(peg$currPos) === 44) { - s2 = peg$c4; - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e10); } - } - if (s2 !== peg$FAILED) { - s3 = peg$parsews(); - s1 = [s1, s2, s3]; - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsequote() { - var s0; - - if (input.charCodeAt(peg$currPos) === 34) { - s0 = peg$c5; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e11); } - } - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 39) { - s0 = peg$c6; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e12); } - } - } - - return s0; - } - - function peg$parsestep_char() { - var s0; - - if (peg$r4.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e13); } - } - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 45) { - s0 = peg$c1; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e4); } - } - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 35) { - s0 = peg$c7; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e14); } - } - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 46) { - s0 = peg$c0; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e1); } - } - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 94) { - s0 = peg$c8; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e15); } - } - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 95) { - s0 = peg$c9; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e16); } - } - } - } - } - } - } - - return s0; - } - - function peg$parsestep() { - var s0, s1, s2, s3; - - s0 = peg$currPos; - s1 = peg$parsews(); - s2 = []; - s3 = peg$parsestep_char(); - if (s3 !== peg$FAILED) { - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$parsestep_char(); - } - } else { - s2 = peg$FAILED; - } - if (s2 !== peg$FAILED) { - s3 = peg$parsews(); - peg$savedPos = s0; - s0 = peg$f1(s2); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsesub_cycle() { - var s0, s1, s2, s3, s4, s5, s6, s7; - - s0 = peg$currPos; - s1 = peg$parsews(); - if (input.charCodeAt(peg$currPos) === 91) { - s2 = peg$c10; - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e17); } - } - if (s2 !== peg$FAILED) { - s3 = peg$parsews(); - s4 = peg$parsestack(); - if (s4 !== peg$FAILED) { - s5 = peg$parsews(); - if (input.charCodeAt(peg$currPos) === 93) { - s6 = peg$c11; - peg$currPos++; - } else { - s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e18); } - } - if (s6 !== peg$FAILED) { - s7 = peg$parsews(); - peg$savedPos = s0; - s0 = peg$f2(s4); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsetimeline() { - var s0, s1, s2, s3, s4, s5, s6, s7; - - s0 = peg$currPos; - s1 = peg$parsews(); - if (input.charCodeAt(peg$currPos) === 60) { - s2 = peg$c12; - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e19); } - } - if (s2 !== peg$FAILED) { - s3 = peg$parsews(); - s4 = peg$parsesingle_cycle(); - if (s4 !== peg$FAILED) { - s5 = peg$parsews(); - if (input.charCodeAt(peg$currPos) === 62) { - s6 = peg$c13; - peg$currPos++; - } else { - s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e20); } - } - if (s6 !== peg$FAILED) { - s7 = peg$parsews(); - peg$savedPos = s0; - s0 = peg$f3(s4); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parseslice() { - var s0; - - s0 = peg$parsestep(); - if (s0 === peg$FAILED) { - s0 = peg$parsesub_cycle(); - if (s0 === peg$FAILED) { - s0 = peg$parsetimeline(); - } - } - - return s0; - } - - function peg$parseslice_modifier() { - var s0; - - s0 = peg$parseslice_weight(); - if (s0 === peg$FAILED) { - s0 = peg$parseslice_bjorklund(); - if (s0 === peg$FAILED) { - s0 = peg$parseslice_slow(); - if (s0 === peg$FAILED) { - s0 = peg$parseslice_fast(); - if (s0 === peg$FAILED) { - s0 = peg$parseslice_fixed_step(); - if (s0 === peg$FAILED) { - s0 = peg$parseslice_replicate(); - } - } - } - } - } - - return s0; - } - - function peg$parseslice_weight() { - var s0, s1, s2; - - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 64) { - s1 = peg$c14; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e21); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parsenumber(); - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f4(s2); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parseslice_replicate() { - var s0, s1, s2; - - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 33) { - s1 = peg$c15; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e22); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parsenumber(); - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f5(s2); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parseslice_bjorklund() { - var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13; - - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 40) { - s1 = peg$c16; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e23); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parsews(); - s3 = peg$parsenumber(); - if (s3 !== peg$FAILED) { - s4 = peg$parsews(); - s5 = peg$parsecomma(); - if (s5 !== peg$FAILED) { - s6 = peg$parsews(); - s7 = peg$parsenumber(); - if (s7 !== peg$FAILED) { - s8 = peg$parsews(); - s9 = peg$parsecomma(); - if (s9 === peg$FAILED) { - s9 = null; - } - s10 = peg$parsews(); - s11 = peg$parsenumber(); - if (s11 === peg$FAILED) { - s11 = null; - } - s12 = peg$parsews(); - if (input.charCodeAt(peg$currPos) === 41) { - s13 = peg$c17; - peg$currPos++; - } else { - s13 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e24); } - } - if (s13 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f6(s3, s7, s11); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parseslice_slow() { - var s0, s1, s2; - - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 47) { - s1 = peg$c18; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e25); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parsenumber(); - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f7(s2); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parseslice_fast() { - var s0, s1, s2; - - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 42) { - s1 = peg$c19; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e26); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parsenumber(); - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f8(s2); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parseslice_fixed_step() { - var s0, s1, s2; - - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 37) { - s1 = peg$c20; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e27); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parsenumber(); - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f9(s2); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parseslice_with_modifier() { - var s0, s1, s2; - - s0 = peg$currPos; - s1 = peg$parseslice(); - if (s1 !== peg$FAILED) { - s2 = peg$parseslice_modifier(); - if (s2 === peg$FAILED) { - s2 = null; - } - peg$savedPos = s0; - s0 = peg$f10(s1, s2); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsesingle_cycle() { - var s0, s1, s2; - - s0 = peg$currPos; - s1 = []; - s2 = peg$parseslice_with_modifier(); - if (s2 !== peg$FAILED) { - while (s2 !== peg$FAILED) { - s1.push(s2); - s2 = peg$parseslice_with_modifier(); - } - } else { - s1 = peg$FAILED; - } - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$f11(s1); - } - s0 = s1; - - return s0; - } - - function peg$parsestack() { - var s0, s1, s2, s3, s4, s5; - - s0 = peg$currPos; - s1 = peg$parsesingle_cycle(); - if (s1 !== peg$FAILED) { - s2 = []; - s3 = peg$currPos; - s4 = peg$parsecomma(); - if (s4 !== peg$FAILED) { - s5 = peg$parsesingle_cycle(); - if (s5 !== peg$FAILED) { - peg$savedPos = s3; - s3 = peg$f12(s1, s5); - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$currPos; - s4 = peg$parsecomma(); - if (s4 !== peg$FAILED) { - s5 = peg$parsesingle_cycle(); - if (s5 !== peg$FAILED) { - peg$savedPos = s3; - s3 = peg$f12(s1, s5); - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } - peg$savedPos = s0; - s0 = peg$f13(s1, s2); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsesequence() { - var s0, s1, s2, s3, s4; - - s0 = peg$currPos; - s1 = peg$parsews(); - s2 = peg$parsequote(); - if (s2 !== peg$FAILED) { - s3 = peg$parsestack(); - if (s3 !== peg$FAILED) { - s4 = peg$parsequote(); - if (s4 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f14(s3); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parseoperator() { - var s0; - - s0 = peg$parsescale(); - if (s0 === peg$FAILED) { - s0 = peg$parseslow(); - if (s0 === peg$FAILED) { - s0 = peg$parsefast(); - if (s0 === peg$FAILED) { - s0 = peg$parsetarget(); - if (s0 === peg$FAILED) { - s0 = peg$parsebjorklund(); - if (s0 === peg$FAILED) { - s0 = peg$parsestruct(); - if (s0 === peg$FAILED) { - s0 = peg$parserotR(); - if (s0 === peg$FAILED) { - s0 = peg$parserotL(); - } - } - } - } - } - } - } - - return s0; - } - - function peg$parsestruct() { - var s0, s1, s2, s3; - - s0 = peg$currPos; - if (input.substr(peg$currPos, 6) === peg$c21) { - s1 = peg$c21; - peg$currPos += 6; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e28); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parsews(); - s3 = peg$parsesequence_or_operator(); - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f15(s3); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsetarget() { - var s0, s1, s2, s3, s4, s5; - - s0 = peg$currPos; - if (input.substr(peg$currPos, 6) === peg$c22) { - s1 = peg$c22; - peg$currPos += 6; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e29); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parsews(); - s3 = peg$parsequote(); - if (s3 !== peg$FAILED) { - s4 = peg$parsestep(); - if (s4 !== peg$FAILED) { - s5 = peg$parsequote(); - if (s5 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f16(s4); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsebjorklund() { - var s0, s1, s2, s3, s4, s5, s6, s7; - - s0 = peg$currPos; - if (input.substr(peg$currPos, 6) === peg$c23) { - s1 = peg$c23; - peg$currPos += 6; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e30); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parsews(); - s3 = peg$parseint(); - if (s3 !== peg$FAILED) { - s4 = peg$parsews(); - s5 = peg$parseint(); - if (s5 !== peg$FAILED) { - s6 = peg$parsews(); - s7 = peg$parseint(); - if (s7 === peg$FAILED) { - s7 = null; - } - peg$savedPos = s0; - s0 = peg$f17(s3, s5, s7); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parseslow() { - var s0, s1, s2, s3; - - s0 = peg$currPos; - if (input.substr(peg$currPos, 4) === peg$c24) { - s1 = peg$c24; - peg$currPos += 4; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e31); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parsews(); - s3 = peg$parsenumber(); - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f18(s3); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parserotL() { - var s0, s1, s2, s3; - - s0 = peg$currPos; - if (input.substr(peg$currPos, 4) === peg$c25) { - s1 = peg$c25; - peg$currPos += 4; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e32); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parsews(); - s3 = peg$parsenumber(); - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f19(s3); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parserotR() { - var s0, s1, s2, s3; - - s0 = peg$currPos; - if (input.substr(peg$currPos, 4) === peg$c26) { - s1 = peg$c26; - peg$currPos += 4; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e33); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parsews(); - s3 = peg$parsenumber(); - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f20(s3); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsefast() { - var s0, s1, s2, s3; - - s0 = peg$currPos; - if (input.substr(peg$currPos, 4) === peg$c27) { - s1 = peg$c27; - peg$currPos += 4; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e34); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parsews(); - s3 = peg$parsenumber(); - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f21(s3); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsescale() { - var s0, s1, s2, s3, s4, s5; - - s0 = peg$currPos; - if (input.substr(peg$currPos, 5) === peg$c28) { - s1 = peg$c28; - peg$currPos += 5; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e35); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parsews(); - s3 = peg$parsequote(); - if (s3 !== peg$FAILED) { - s4 = []; - s5 = peg$parsestep_char(); - if (s5 !== peg$FAILED) { - while (s5 !== peg$FAILED) { - s4.push(s5); - s5 = peg$parsestep_char(); - } - } else { - s4 = peg$FAILED; - } - if (s4 !== peg$FAILED) { - s5 = peg$parsequote(); - if (s5 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f22(s4); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsecomment() { - var s0, s1, s2, s3; - - s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c29) { - s1 = peg$c29; - peg$currPos += 2; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e36); } - } - if (s1 !== peg$FAILED) { - s2 = []; - if (peg$r5.test(input.charAt(peg$currPos))) { - s3 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e37); } - } - while (s3 !== peg$FAILED) { - s2.push(s3); - if (peg$r5.test(input.charAt(peg$currPos))) { - s3 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e37); } - } - } - s1 = [s1, s2]; - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsecat() { - var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; - - s0 = peg$currPos; - if (input.substr(peg$currPos, 3) === peg$c30) { - s1 = peg$c30; - peg$currPos += 3; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e38); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parsews(); - if (input.charCodeAt(peg$currPos) === 91) { - s3 = peg$c10; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e17); } - } - if (s3 !== peg$FAILED) { - s4 = peg$parsews(); - s5 = peg$parsesequence_or_operator(); - if (s5 !== peg$FAILED) { - s6 = []; - s7 = peg$currPos; - s8 = peg$parsecomma(); - if (s8 !== peg$FAILED) { - s9 = peg$parsesequence_or_operator(); - if (s9 !== peg$FAILED) { - peg$savedPos = s7; - s7 = peg$f23(s5, s9); - } else { - peg$currPos = s7; - s7 = peg$FAILED; - } - } else { - peg$currPos = s7; - s7 = peg$FAILED; - } - while (s7 !== peg$FAILED) { - s6.push(s7); - s7 = peg$currPos; - s8 = peg$parsecomma(); - if (s8 !== peg$FAILED) { - s9 = peg$parsesequence_or_operator(); - if (s9 !== peg$FAILED) { - peg$savedPos = s7; - s7 = peg$f23(s5, s9); - } else { - peg$currPos = s7; - s7 = peg$FAILED; - } - } else { - peg$currPos = s7; - s7 = peg$FAILED; - } - } - s7 = peg$parsews(); - if (input.charCodeAt(peg$currPos) === 93) { - s8 = peg$c11; - peg$currPos++; - } else { - s8 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e18); } - } - if (s8 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f24(s5, s6); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsesequence_or_group() { - var s0; - - s0 = peg$parsecat(); - if (s0 === peg$FAILED) { - s0 = peg$parsesequence(); - } - - return s0; - } - - function peg$parsesequence_or_operator() { - var s0, s1, s2, s3, s4, s5; - - s0 = peg$currPos; - s1 = peg$parsesequence_or_group(); - if (s1 !== peg$FAILED) { - s2 = peg$parsews(); - s3 = []; - s4 = peg$parsecomment(); - while (s4 !== peg$FAILED) { - s3.push(s4); - s4 = peg$parsecomment(); - } - peg$savedPos = s0; - s0 = peg$f25(s1); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - if (s0 === peg$FAILED) { - s0 = peg$currPos; - s1 = peg$parseoperator(); - if (s1 !== peg$FAILED) { - s2 = peg$parsews(); - if (input.charCodeAt(peg$currPos) === 36) { - s3 = peg$c31; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e39); } - } - if (s3 !== peg$FAILED) { - s4 = peg$parsews(); - s5 = peg$parsesequence_or_operator(); - if (s5 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f26(s1, s5); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } - - return s0; - } - - function peg$parsesequ_or_operator_or_comment() { - var s0, s1; - - s0 = peg$currPos; - s1 = peg$parsesequence_or_operator(); - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$f27(s1); - } - s0 = s1; - if (s0 === peg$FAILED) { - s0 = peg$parsecomment(); - } - - return s0; - } - - function peg$parsesequence_definition() { - var s0; - - s0 = peg$parsesequ_or_operator_or_comment(); - - return s0; - } - - function peg$parsecommand() { - var s0, s1, s2, s3; - - s0 = peg$currPos; - s1 = peg$parsews(); - s2 = peg$parsesetcps(); - if (s2 === peg$FAILED) { - s2 = peg$parsesetbpm(); - if (s2 === peg$FAILED) { - s2 = peg$parsehush(); - } - } - if (s2 !== peg$FAILED) { - s3 = peg$parsews(); - peg$savedPos = s0; - s0 = peg$f28(s2); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsesetcps() { - var s0, s1, s2, s3; - - s0 = peg$currPos; - if (input.substr(peg$currPos, 6) === peg$c32) { - s1 = peg$c32; - peg$currPos += 6; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e40); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parsews(); - s3 = peg$parsenumber(); - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f29(s3); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsesetbpm() { - var s0, s1, s2, s3; - - s0 = peg$currPos; - if (input.substr(peg$currPos, 6) === peg$c33) { - s1 = peg$c33; - peg$currPos += 6; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e41); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parsews(); - s3 = peg$parsenumber(); - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f30(s3); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsehush() { - var s0, s1; - - s0 = peg$currPos; - if (input.substr(peg$currPos, 4) === peg$c34) { - s1 = peg$c34; - peg$currPos += 4; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e42); } - } - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$f31(); - } - s0 = s1; - - return s0; - } - - function peg$parsestatement() { - var s0; - - s0 = peg$parsesequence_definition(); - if (s0 === peg$FAILED) { - s0 = peg$parsecommand(); - } - - return s0; - } - - - var PatternStub = function(source, alignment) - { - this.type_ = "pattern"; - this.arguments_ = { alignment : alignment}; - this.source_ = source; - } - - var OperatorStub = function(name, args, source) - { - this.type_ = name; - this.arguments_ = args; - this.source_ = source; - } - - var ElementStub = function(source, options) - { - this.type_ = "element"; - this.source_ = source; - this.options_ = options; - this.location_ = location(); - } - - var CommandStub = function(name, options) - { - this.type_ = "command"; - this.name_ = name; - this.options_ = options; - } - - - - peg$result = peg$startRuleFunction(); - - if (peg$result !== peg$FAILED && peg$currPos === input.length) { - return peg$result; - } else { - if (peg$result !== peg$FAILED && peg$currPos < input.length) { - peg$fail(peg$endExpectation()); - } - - throw peg$buildStructuredError( - peg$maxFailExpected, - peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, - peg$maxFailPos < input.length - ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) - : peg$computeLocation(peg$maxFailPos, peg$maxFailPos) - ); - } -} - -export { - peg$SyntaxError as SyntaxError, - peg$parse as parse -}; diff --git a/docs/_snowpack/link/strudel.js b/docs/_snowpack/link/strudel.js deleted file mode 100644 index 3db5396c..00000000 --- a/docs/_snowpack/link/strudel.js +++ /dev/null @@ -1,810 +0,0 @@ -import Fraction from "./fraction.js"; -import {compose} from "../pkg/ramda.js"; -import {isNote, toMidi} from "./util.js"; -const removeUndefineds = (xs) => xs.filter((x) => x != void 0); -const flatten = (arr) => [].concat(...arr); -const id = (a) => a; -const range = (min, max) => Array.from({length: max - min + 1}, (_, i) => i + min); -export function curry(func, overload) { - const fn = function curried(...args) { - if (args.length >= func.length) { - return func.apply(this, args); - } else { - const partial = function(...args2) { - return curried.apply(this, args.concat(args2)); - }; - if (overload) { - overload(partial, args); - } - return partial; - } - }; - if (overload) { - overload(fn, []); - } - return fn; -} -class TimeSpan { - constructor(begin, end) { - this.begin = Fraction(begin); - this.end = Fraction(end); - } - get spanCycles() { - const spans = []; - var begin = this.begin; - const end = this.end; - const end_sam = end.sam(); - while (end.gt(begin)) { - if (begin.sam().equals(end_sam)) { - spans.push(new TimeSpan(begin, this.end)); - break; - } - const next_begin = begin.nextSam(); - spans.push(new TimeSpan(begin, next_begin)); - begin = next_begin; - } - return spans; - } - withTime(func_time) { - return new TimeSpan(func_time(this.begin), func_time(this.end)); - } - withEnd(func_time) { - return new TimeSpan(this.begin, func_time(this.end)); - } - intersection(other) { - const intersect_begin = this.begin.max(other.begin); - const intersect_end = this.end.min(other.end); - if (intersect_begin.gt(intersect_end)) { - return void 0; - } - if (intersect_begin.equals(intersect_end)) { - if (intersect_begin.equals(this.end) && this.begin.lt(this.end)) { - return void 0; - } - if (intersect_begin.equals(other.end) && other.begin.lt(other.end)) { - return void 0; - } - } - return new TimeSpan(intersect_begin, intersect_end); - } - intersection_e(other) { - const result = this.intersection(other); - if (result == void 0) { - } - return result; - } - midpoint() { - return this.begin.add(this.end.sub(this.begin).div(Fraction(2))); - } - equals(other) { - return this.begin.equals(other.begin) && this.end.equals(other.end); - } - show() { - return this.begin.show() + " -> " + this.end.show(); - } -} -class Hap { - constructor(whole, part, value, context = {}, stateful = false) { - this.whole = whole; - this.part = part; - this.value = value; - this.context = context; - this.stateful = stateful; - if (stateful) { - console.assert(typeof this.value === "function", "Stateful values must be functions"); - } - } - withSpan(func) { - const whole = this.whole ? func(this.whole) : void 0; - return new Hap(whole, func(this.part), this.value, this.context); - } - withValue(func) { - return new Hap(this.whole, this.part, func(this.value), this.context); - } - hasOnset() { - return this.whole != void 0 && this.whole.begin.equals(this.part.begin); - } - resolveState(state) { - if (this.stateful && this.hasOnset()) { - console.log("stateful"); - const func = this.value; - const [newState, newValue] = func(state); - return [newState, new Hap(this.whole, this.part, newValue, this.context, false)]; - } - return [state, this]; - } - spanEquals(other) { - return this.whole == void 0 && other.whole == void 0 || this.whole.equals(other.whole); - } - equals(other) { - return this.spanEquals(other) && this.part.equals(other.part) && this.value === other.value; - } - show() { - return "(" + (this.whole == void 0 ? "~" : this.whole.show()) + ", " + this.part.show() + ", " + this.value + ")"; - } - setContext(context) { - return new Hap(this.whole, this.part, this.value, context); - } -} -export class State { - constructor(span, controls = {}) { - this.span = span; - this.controls = controls; - } - setSpan(span) { - return new State(span, this.controls); - } - withSpan(func) { - return this.setSpan(func(this.span)); - } - setControls(controls) { - return new State(this.span, controls); - } -} -class Pattern { - constructor(query) { - this.query = query; - } - _splitQueries() { - const pat = this; - const q = (state) => { - return flatten(state.span.spanCycles.map((subspan) => pat.query(state.setSpan(subspan)))); - }; - return new Pattern(q); - } - withQuerySpan(func) { - return new Pattern((state) => this.query(state.withSpan(func))); - } - withQueryTime(func) { - return new Pattern((state) => this.query(state.withSpan((span) => span.withTime(func)))); - } - withEventSpan(func) { - return new Pattern((state) => this.query(state).map((hap) => hap.withSpan(func))); - } - withEventTime(func) { - return this.withEventSpan((span) => span.withTime(func)); - } - _withEvents(func) { - return new Pattern((state) => func(this.query(state))); - } - _withEvent(func) { - return this._withEvents((events) => events.map(func)); - } - _setContext(context) { - return this._withEvent((event) => event.setContext(context)); - } - _withContext(func) { - return this._withEvent((event) => event.setContext(func(event.context))); - } - _stripContext() { - return this._withEvent((event) => event.setContext({})); - } - withLocation(start, end) { - const location = { - start: {line: start[0], column: start[1], offset: start[2]}, - end: {line: end[0], column: end[1], offset: end[2]} - }; - return this._withContext((context) => { - const locations = (context.locations || []).concat([location]); - return {...context, locations}; - }); - } - withMiniLocation(start, end) { - const offset = { - start: {line: start[0], column: start[1], offset: start[2]}, - end: {line: end[0], column: end[1], offset: end[2]} - }; - return this._withContext((context) => { - let locations = context.locations || []; - locations = locations.map(({start: start2, end: end2}) => { - const colOffset = start2.line === 1 ? offset.start.column : 0; - return { - start: { - ...start2, - line: start2.line - 1 + (offset.start.line - 1) + 1, - column: start2.column - 1 + colOffset - }, - end: { - ...end2, - line: end2.line - 1 + (offset.start.line - 1) + 1, - column: end2.column - 1 + colOffset - } - }; - }); - return {...context, locations}; - }); - } - withValue(func) { - return new Pattern((state) => this.query(state).map((hap) => hap.withValue(func))); - } - fmap(func) { - return this.withValue(func); - } - _filterEvents(event_test) { - return new Pattern((state) => this.query(state).filter(event_test)); - } - _filterValues(value_test) { - return new Pattern((state) => this.query(state).filter((hap) => value_test(hap.value))); - } - _removeUndefineds() { - return this._filterValues((val) => val != void 0); - } - onsetsOnly() { - return this._filterEvents((hap) => hap.hasOnset()); - } - _appWhole(whole_func, pat_val) { - const pat_func = this; - const query = function(state) { - const event_funcs = pat_func.query(state); - const event_vals = pat_val.query(state); - const apply = function(event_func, event_val) { - const s = event_func.part.intersection(event_val.part); - if (s == void 0) { - return void 0; - } - return new Hap(whole_func(event_func.whole, event_val.whole), s, event_func.value(event_val.value), event_val.context); - }; - return flatten(event_funcs.map((event_func) => removeUndefineds(event_vals.map((event_val) => apply(event_func, event_val))))); - }; - return new Pattern(query); - } - appBoth(pat_val) { - const whole_func = function(span_a, span_b) { - if (span_a == void 0 || span_b == void 0) { - return void 0; - } - return span_a.intersection_e(span_b); - }; - return this._appWhole(whole_func, pat_val); - } - appLeft(pat_val) { - const pat_func = this; - const query = function(state) { - const haps = []; - for (const hap_func of pat_func.query(state)) { - const event_vals = pat_val.query(state.setSpan(hap_func.part)); - for (const hap_val of event_vals) { - const new_whole = hap_func.whole; - const new_part = hap_func.part.intersection_e(hap_val.part); - const new_value = hap_func.value(hap_val.value); - const hap = new Hap(new_whole, new_part, new_value, { - ...hap_val.context, - ...hap_func.context, - locations: (hap_val.context.locations || []).concat(hap_func.context.locations || []) - }); - haps.push(hap); - } - } - return haps; - }; - return new Pattern(query); - } - appRight(pat_val) { - const pat_func = this; - const query = function(state) { - const haps = []; - for (const hap_val of pat_val.query(state)) { - const hap_funcs = pat_func.query(state.setSpan(hap_val.part)); - for (const hap_func of hap_funcs) { - const new_whole = hap_val.whole; - const new_part = hap_func.part.intersection_e(hap_val.part); - const new_value = hap_func.value(hap_val.value); - const hap = new Hap(new_whole, new_part, new_value, { - ...hap_func.context, - ...hap_val.context, - locations: (hap_val.context.locations || []).concat(hap_func.context.locations || []) - }); - haps.push(hap); - } - } - return haps; - }; - return new Pattern(query); - } - firstCycle(with_context = false) { - var self = this; - if (!with_context) { - self = self._stripContext(); - } - return self.query(new State(new TimeSpan(Fraction(0), Fraction(1)))); - } - _sortEventsByPart() { - return this._withEvents((events) => events.sort((a, b) => a.part.begin.sub(b.part.begin).or(a.part.end.sub(b.part.end)).or(a.whole.begin.sub(b.whole.begin).or(a.whole.end.sub(b.whole.end))))); - } - _opleft(other, func) { - return this.fmap(func).appLeft(reify(other)); - } - _asNumber(silent = false) { - return this._withEvent((event) => { - const asNumber = Number(event.value); - if (!isNaN(asNumber)) { - return event.withValue(() => asNumber); - } - const specialValue = { - e: Math.E, - pi: Math.PI - }[event.value]; - if (typeof specialValue !== "undefined") { - return event.withValue(() => specialValue); - } - if (isNote(event.value)) { - return new Hap(event.whole, event.part, toMidi(event.value), {...event.context, type: "midi"}); - } - if (!silent) { - throw new Error('cannot parse as number: "' + event.value + '"'); - } - return event.withValue(() => void 0); - })._removeUndefineds(); - } - add(other) { - return this._asNumber()._opleft(other, (a) => (b) => a + b); - } - sub(other) { - return this._asNumber()._opleft(other, (a) => (b) => a - b); - } - mul(other) { - return this._asNumber()._opleft(other, (a) => (b) => a * b); - } - div(other) { - return this._asNumber()._opleft(other, (a) => (b) => a / b); - } - round() { - return this._asNumber().fmap((v) => Math.round(v)); - } - floor() { - return this._asNumber().fmap((v) => Math.floor(v)); - } - ceil() { - return this._asNumber().fmap((v) => Math.ceil(v)); - } - union(other) { - return this._opleft(other, (a) => (b) => Object.assign({}, a, b)); - } - _bindWhole(choose_whole, func) { - const pat_val = this; - const query = function(state) { - const withWhole = function(a, b) { - return new Hap(choose_whole(a.whole, b.whole), b.part, b.value, Object.assign({}, a.context, b.context, { - locations: (a.context.locations || []).concat(b.context.locations || []) - })); - }; - const match = function(a) { - return func(a.value).query(state.setSpan(a.part)).map((b) => withWhole(a, b)); - }; - return flatten(pat_val.query(state).map((a) => match(a))); - }; - return new Pattern(query); - } - bind(func) { - const whole_func = function(a, b) { - if (a == void 0 || b == void 0) { - return void 0; - } - return a.intersection_e(b); - }; - return this._bindWhole(whole_func, func); - } - join() { - return this.bind(id); - } - innerBind(func) { - return this._bindWhole((a, _) => a, func); - } - innerJoin() { - return this.innerBind(id); - } - outerBind(func) { - return this._bindWhole((_, b) => b, func); - } - outerJoin() { - return this.outerBind(id); - } - _apply(func) { - return func(this); - } - layer(...funcs) { - return stack(...funcs.map((func) => func(this))); - } - _patternify(func) { - const pat = this; - const patterned = function(...args) { - args = args.map((arg) => arg.constructor?.name === "Pattern" ? arg.fmap((value) => value.value || value) : arg); - const pat_arg = sequence(...args); - return pat_arg.fmap((arg) => func.call(pat, arg)).outerJoin(); - }; - return patterned; - } - _fastGap(factor) { - const qf = function(span) { - const cycle = span.begin.sam(); - const begin = cycle.add(span.begin.sub(cycle).mul(factor).min(1)); - const end = cycle.add(span.end.sub(cycle).mul(factor).min(1)); - return new TimeSpan(begin, end); - }; - const ef = function(span) { - const cycle = span.begin.sam(); - const begin = cycle.add(span.begin.sub(cycle).div(factor).min(1)); - const end = cycle.add(span.end.sub(cycle).div(factor).min(1)); - return new TimeSpan(begin, end); - }; - return this.withQuerySpan(qf).withEventSpan(ef)._splitQueries(); - } - _compressSpan(span) { - const b = span.begin; - const e = span.end; - if (b > e || b > 1 || e > 1 || b < 0 || e < 0) { - return silence; - } - return this._fastGap(Fraction(1).div(e.sub(b)))._late(b); - } - _fast(factor) { - const fastQuery = this.withQueryTime((t) => t.mul(factor)); - return fastQuery.withEventTime((t) => t.div(factor)); - } - _slow(factor) { - return this._fast(Fraction(1).div(factor)); - } - _cpm(cpm) { - return this._fast(cpm / 60); - } - _early(offset) { - offset = Fraction(offset); - return this.withQueryTime((t) => t.add(offset)).withEventTime((t) => t.sub(offset)); - } - _late(offset) { - offset = Fraction(offset); - return this._early(Fraction(0).sub(offset)); - } - struct(...binary_pats) { - const binary_pat = sequence(binary_pats); - return binary_pat.fmap((b) => (val) => b ? val : void 0).appLeft(this)._removeUndefineds(); - } - mask(...binary_pats) { - const binary_pat = sequence(binary_pats); - return binary_pat.fmap((b) => (val) => b ? val : void 0).appRight(this)._removeUndefineds(); - } - _color(color) { - return this._withContext((context) => ({...context, color})); - } - _segment(rate) { - return this.struct(pure(true).fast(rate)); - } - invert() { - return this.fmap((x) => !x); - } - inv() { - return this.invert(); - } - when(binary_pat, func) { - const true_pat = binary_pat._filterValues(id); - const false_pat = binary_pat._filterValues((val) => !val); - const with_pat = true_pat.fmap((_) => (y) => y).appRight(func(this)); - const without_pat = false_pat.fmap((_) => (y) => y).appRight(this); - return stack(with_pat, without_pat); - } - off(time_pat, func) { - return stack(this, func(this.late(time_pat))); - } - every(n, func) { - const pat = this; - const pats = Array(n - 1).fill(pat); - pats.unshift(func(pat)); - return slowcatPrime(...pats); - } - append(other) { - return fastcat(...[this, other]); - } - rev() { - const pat = this; - const query = function(state) { - const span = state.span; - const cycle = span.begin.sam(); - const next_cycle = span.begin.nextSam(); - const reflect = function(to_reflect) { - const reflected = to_reflect.withTime((time) => cycle.add(next_cycle.sub(time))); - const tmp = reflected.begin; - reflected.begin = reflected.end; - reflected.end = tmp; - return reflected; - }; - const haps = pat.query(state.setSpan(reflect(span))); - return haps.map((hap) => hap.withSpan(reflect)); - }; - return new Pattern(query)._splitQueries(); - } - jux(func, by = 1) { - by /= 2; - const elem_or = function(dict, key, dflt) { - if (key in dict) { - return dict[key]; - } - return dflt; - }; - const left = this.withValue((val) => Object.assign({}, val, {pan: elem_or(val, "pan", 0.5) - by})); - const right = this.withValue((val) => Object.assign({}, val, {pan: elem_or(val, "pan", 0.5) + by})); - return stack(left, func(right)); - } - stack(...pats) { - return stack(this, ...pats); - } - sequence(...pats) { - return sequence(this, ...pats); - } - superimpose(...funcs) { - return this.stack(...funcs.map((func) => func(this))); - } - stutWith(times, time, func) { - return stack(...range(0, times - 1).map((i) => func(this.late(i * time), i))); - } - stut(times, feedback, time) { - return this.stutWith(times, time, (pat, i) => pat.velocity(Math.pow(feedback, i))); - } - _echoWith(times, time, func) { - return stack(...range(0, times - 1).map((i) => func(this.late(i * time), i))); - } - _echo(times, time, feedback) { - return this._echoWith(times, time, (pat, i) => pat.velocity(Math.pow(feedback, i))); - } - iter(times) { - return slowcat(...range(0, times - 1).map((i) => this.early(i / times))); - } - edit(...funcs) { - return stack(...funcs.map((func) => func(this))); - } - pipe(func) { - return func(this); - } - _bypass(on2) { - on2 = Boolean(parseInt(on2)); - return on2 ? silence : this; - } - hush() { - return silence; - } - _duration(value) { - return this.withEventSpan((span) => new TimeSpan(span.begin, span.begin.add(value))); - } - _legato(value) { - return this.withEventSpan((span) => new TimeSpan(span.begin, span.begin.add(span.end.sub(span.begin).mul(value)))); - } - _velocity(velocity) { - return this._withContext((context) => ({...context, velocity: (context.velocity || 1) * velocity})); - } -} -Pattern.prototype.patternified = ["apply", "fast", "slow", "cpm", "early", "late", "duration", "legato", "velocity", "segment", "color"]; -Pattern.prototype.factories = {pure, stack, slowcat, fastcat, cat, timeCat, sequence, polymeter, pm, polyrhythm, pr}; -const silence = new Pattern((_) => []); -function pure(value) { - function query(state) { - return state.span.spanCycles.map((subspan) => new Hap(Fraction(subspan.begin).wholeCycle(), subspan, value)); - } - return new Pattern(query); -} -function steady(value) { - return new Pattern((span) => Hap(void 0, span, value)); -} -export const signal = (func) => { - const query = (state) => [new Hap(void 0, state.span, func(state.span.midpoint()))]; - return new Pattern(query); -}; -const _toBipolar = (pat) => pat.fmap((x) => x * 2 - 1); -const _fromBipolar = (pat) => pat.fmap((x) => (x + 1) / 2); -export const sine2 = signal((t) => Math.sin(Math.PI * 2 * t)); -export const sine = _fromBipolar(sine2); -export const cosine2 = sine2._early(Fraction(1).div(4)); -export const cosine = sine._early(Fraction(1).div(4)); -export const saw = signal((t) => t % 1); -export const saw2 = _toBipolar(saw); -export const isaw = signal((t) => 1 - t % 1); -export const isaw2 = _toBipolar(isaw); -export const tri2 = fastcat(isaw2, saw2); -export const tri = fastcat(isaw, saw); -export const square = signal((t) => Math.floor(t * 2 % 2)); -export const square2 = _toBipolar(square); -function reify(thing) { - if (thing?.constructor?.name == "Pattern") { - return thing; - } - return pure(thing); -} -function stack(...pats) { - const reified = pats.map((pat) => reify(pat)); - const query = (state) => flatten(reified.map((pat) => pat.query(state))); - return new Pattern(query); -} -function slowcat(...pats) { - pats = pats.map(reify); - const query = function(state) { - const span = state.span; - const pat_n = Math.floor(span.begin) % pats.length; - const pat = pats[pat_n]; - if (!pat) { - return []; - } - const offset = span.begin.floor().sub(span.begin.div(pats.length).floor()); - return pat.withEventTime((t) => t.add(offset)).query(state.setSpan(span.withTime((t) => t.sub(offset)))); - }; - return new Pattern(query)._splitQueries(); -} -function slowcatPrime(...pats) { - pats = pats.map(reify); - const query = function(state) { - const pat_n = Math.floor(state.span.begin) % pats.length; - const pat = pats[pat_n]; - return pat.query(state); - }; - return new Pattern(query)._splitQueries(); -} -function fastcat(...pats) { - return slowcat(...pats)._fast(pats.length); -} -function cat(...pats) { - return fastcat(...pats); -} -function timeCat(...timepats) { - const total = timepats.map((a) => a[0]).reduce((a, b) => a.add(b), Fraction(0)); - let begin = Fraction(0); - const pats = []; - for (const [time, pat] of timepats) { - const end = begin.add(time); - pats.push(reify(pat)._compressSpan(new TimeSpan(begin.div(total), end.div(total)))); - begin = end; - } - return stack(...pats); -} -function _sequenceCount(x) { - if (Array.isArray(x)) { - if (x.length == 0) { - return [silence, 0]; - } - if (x.length == 1) { - return _sequenceCount(x[0]); - } - return [fastcat(...x.map((a) => _sequenceCount(a)[0])), x.length]; - } - return [reify(x), 1]; -} -function sequence(...xs) { - return _sequenceCount(xs)[0]; -} -function polymeter(steps = 0, ...args) { - const seqs = args.map((a) => _sequenceCount(a)); - if (seqs.length == 0) { - return silence; - } - if (steps == 0) { - steps = seqs[0][1]; - } - const pats = []; - for (const seq of seqs) { - if (seq[1] == 0) { - next; - } - if (steps == seq[1]) { - pats.push(seq[0]); - } else { - pats.push(seq[0]._fast(Fraction(steps).div(Fraction(seq[1])))); - } - } - return stack(pats); -} -function pm(args) { - polymeter(args); -} -function polyrhythm(...xs) { - const seqs = xs.map((a) => sequence(a)); - if (seqs.length == 0) { - return silence; - } - return stack(...seqs); -} -function pr(args) { - polyrhythm(args); -} -const fast = curry((a, pat) => pat.fast(a)); -const slow = curry((a, pat) => pat.slow(a)); -const early = curry((a, pat) => pat.early(a)); -const late = curry((a, pat) => pat.late(a)); -const rev = (pat) => pat.rev(); -const add = curry((a, pat) => pat.add(a)); -const sub = curry((a, pat) => pat.sub(a)); -const mul = curry((a, pat) => pat.mul(a)); -const div = curry((a, pat) => pat.div(a)); -const union = curry((a, pat) => pat.union(a)); -const every = curry((i, f, pat) => pat.every(i, f)); -const when = curry((binary, f, pat) => pat.when(binary, f)); -const off = curry((t, f, pat) => pat.off(t, f)); -const jux = curry((f, pat) => pat.jux(f)); -const append = curry((a, pat) => pat.append(a)); -const superimpose = curry((array, pat) => pat.superimpose(...array)); -const struct = curry((a, pat) => pat.struct(a)); -const mask = curry((a, pat) => pat.mask(a)); -const invert = (pat) => pat.invert(); -const inv = (pat) => pat.inv(); -Pattern.prototype.composable = {fast, slow, early, late, superimpose}; -export function makeComposable(func) { - Object.entries(Pattern.prototype.composable).forEach(([functionName, composable]) => { - func[functionName] = (...args) => { - const composition = compose(func, composable(...args)); - return makeComposable(composition); - }; - }); - return func; -} -const patternify2 = (f) => (pata, patb, pat) => pata.fmap((a) => (b) => f.call(pat, a, b)).appLeft(patb).outerJoin(); -const patternify3 = (f) => (pata, patb, patc, pat) => pata.fmap((a) => (b) => (c) => f.call(pat, a, b, c)).appLeft(patb).appLeft(patc).outerJoin(); -const patternify4 = (f) => (pata, patb, patc, patd, pat) => pata.fmap((a) => (b) => (c) => (d) => f.call(pat, a, b, c, d)).appLeft(patb).appLeft(patc).appLeft(patd).outerJoin(); -Pattern.prototype.echo = function(...args) { - args = args.map(reify); - return patternify3(Pattern.prototype._echo)(...args, this); -}; -Pattern.prototype.echoWith = function(...args) { - args = args.map(reify); - return patternify3(Pattern.prototype._echoWith)(...args, this); -}; -Pattern.prototype.bootstrap = function() { - const bootstrapped = Object.fromEntries(Object.entries(Pattern.prototype.composable).map(([functionName, composable]) => { - if (Pattern.prototype[functionName]) { - Pattern.prototype[functionName] = makeComposable(Pattern.prototype[functionName]); - } - return [functionName, curry(composable, makeComposable)]; - })); - this.patternified.forEach((prop) => { - Pattern.prototype[prop] = function(...args) { - return this._patternify(Pattern.prototype["_" + prop])(...args); - }; - }); - return bootstrapped; -}; -Pattern.prototype.define = (name, func, options = {}) => { - if (options.composable) { - Pattern.prototype.composable[name] = func; - } - if (options.patternified) { - Pattern.prototype.patternified = Pattern.prototype.patternified.concat([name]); - } - Pattern.prototype.bootstrap(); -}; -Pattern.prototype.define("hush", (pat) => pat.hush(), {patternified: false, composable: true}); -Pattern.prototype.define("bypass", (pat) => pat.bypass(on), {patternified: true, composable: true}); -export { - Fraction, - TimeSpan, - Hap, - Pattern, - pure, - stack, - slowcat, - fastcat, - cat, - timeCat, - sequence, - polymeter, - pm, - polyrhythm, - pr, - reify, - silence, - fast, - slow, - early, - late, - rev, - add, - sub, - mul, - div, - union, - every, - when, - off, - jux, - append, - superimpose, - struct, - mask, - invert, - inv, - id, - range -}; diff --git a/docs/_snowpack/link/util.js b/docs/_snowpack/link/util.js deleted file mode 100644 index 83685455..00000000 --- a/docs/_snowpack/link/util.js +++ /dev/null @@ -1,34 +0,0 @@ -export const isNote = (name) => /^[a-gA-G][#b]*[0-9]$/.test(name); -export const tokenizeNote = (note) => { - if (typeof note !== "string") { - return []; - } - const [pc, acc = "", oct] = note.match(/^([a-gA-G])([#b]*)([0-9])?$/)?.slice(1) || []; - if (!pc) { - return []; - } - return [pc, acc, oct ? Number(oct) : void 0]; -}; -export const toMidi = (note) => { - const [pc, acc, oct] = tokenizeNote(note); - if (!pc) { - throw new Error('not a note: "' + note + '"'); - } - const chroma = {c: 0, d: 2, e: 4, f: 5, g: 7, a: 9, b: 11}[pc.toLowerCase()]; - const offset = acc?.split("").reduce((o, char) => o + {"#": 1, b: -1}[char], 0) || 0; - return (Number(oct) + 1) * 12 + chroma + offset; -}; -export const fromMidi = (n) => { - return Math.pow(2, (n - 69) / 12) * 440; -}; -export const mod = (n, m) => n < 0 ? mod(n + m, m) : n % m; -export const getPlayableNoteValue = (event) => { - let {value: note, context} = event; - if (typeof note === "number" && context.type !== "frequency") { - note = fromMidi(event.value); - } else if (typeof note === "string" && !isNote(note)) { - throw new Error("not a note: " + note); - } - return note; -}; -export const rotate = (arr, n) => arr.slice(n).concat(arr.slice(0, n)); diff --git a/docs/_snowpack/pkg/@tonaljs/tonal.js b/docs/_snowpack/pkg/@tonaljs/tonal.js deleted file mode 100644 index 3f54353e..00000000 --- a/docs/_snowpack/pkg/@tonaljs/tonal.js +++ /dev/null @@ -1 +0,0 @@ -export { b as Interval, a as Note, i as Scale } from '../common/index.es-d2606df1.js'; diff --git a/docs/_snowpack/pkg/@tonejs/piano.js b/docs/_snowpack/pkg/@tonejs/piano.js deleted file mode 100644 index dbe0fff7..00000000 --- a/docs/_snowpack/pkg/@tonejs/piano.js +++ /dev/null @@ -1,538 +0,0 @@ -import { T as ToneAudioNode, V as Volume, F as Frequency, M as Midi, S as Sampler, a as ToneAudioBuffers, b as ToneBufferSource, o as optionsFromArguments, G as Gain, i as isString } from '../common/index-b6fc655f.js'; -import '../common/webmidi.min-97732fd4.js'; -import '../common/_commonjsHelpers-8c19dec8.js'; - -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -/** - * Base class for the other components - */ -class PianoComponent extends ToneAudioNode { - constructor(options) { - super(options); - this.name = 'PianoComponent'; - this.input = undefined; - this.output = new Volume({ context: this.context }); - /** - * If the component is enabled or not - */ - this._enabled = false; - /** - * The volume output of the component - */ - this.volume = this.output.volume; - /** - * Boolean indication of if the component is loaded or not - */ - this._loaded = false; - this.volume.value = options.volume; - this._enabled = options.enabled; - this.samples = options.samples; - } - /** - * If the samples are loaded or not - */ - get loaded() { - return this._loaded; - } - /** - * Load the samples - */ - load() { - return __awaiter(this, void 0, void 0, function* () { - if (this._enabled) { - yield this._internalLoad(); - this._loaded = true; - } - else { - return Promise.resolve(); - } - }); - } -} - -// import * as Tone from '../node_modules/tone/Tone' -function midiToNote(midi) { - const frequency = Frequency(midi, 'midi'); - const ret = frequency.toNote(); - return ret; -} -function randomBetween(low, high) { - return Math.random() * (high - low) + low; -} - -function getReleasesUrl(midi) { - return `rel${midi - 20}.[mp3|ogg]`; -} -function getHarmonicsUrl(midi) { - return `harmS${midiToNote(midi).replace('#', 's')}.[mp3|ogg]`; -} -function getNotesUrl(midi, vel) { - return `${midiToNote(midi).replace('#', 's')}v${vel}.[mp3|ogg]`; -} -/** - * Maps velocity depths to Salamander velocities - */ -const velocitiesMap = { - 1: [8], - 2: [6, 12], - 3: [1, 7, 15], - 4: [1, 5, 10, 15], - 5: [1, 4, 8, 12, 16], - 6: [1, 3, 7, 10, 13, 16], - 7: [1, 3, 6, 9, 11, 13, 16], - 8: [1, 3, 5, 7, 9, 11, 13, 16], - 9: [1, 3, 5, 7, 9, 11, 13, 15, 16], - 10: [1, 2, 3, 5, 7, 9, 11, 13, 15, 16], - 11: [1, 2, 3, 5, 7, 9, 11, 13, 14, 15, 16], - 12: [1, 2, 3, 4, 5, 7, 9, 11, 13, 14, 15, 16], - 13: [1, 2, 3, 4, 5, 7, 9, 11, 12, 13, 14, 15, 16], - 14: [1, 2, 3, 4, 5, 6, 7, 9, 11, 12, 13, 14, 15, 16], - 15: [1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16], - 16: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], -}; -/** - * All the notes of audio samples - */ -const allNotes = [ - 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, 54, - 57, 60, 63, 66, 69, 72, 75, 78, 81, 84, - 87, 90, 93, 96, 99, 102, 105, 108 -]; -function getNotesInRange(min, max) { - return allNotes.filter(note => min <= note && note <= max); -} -/** - * All the notes of audio samples - */ -const harmonics = [21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, 54, 57, 60, 63, 66, 69, 72, 75, 78, 81, 84, 87]; -function getHarmonicsInRange(min, max) { - return harmonics.filter(note => min <= note && note <= max); -} -function inHarmonicsRange(note) { - return harmonics[0] <= note && note <= harmonics[harmonics.length - 1]; -} - -class Harmonics extends PianoComponent { - constructor(options) { - super(options); - this._urls = {}; - const notes = getHarmonicsInRange(options.minNote, options.maxNote); - for (const n of notes) { - this._urls[n] = getHarmonicsUrl(n); - } - } - triggerAttack(note, time, velocity) { - if (this._enabled && inHarmonicsRange(note)) { - this._sampler.triggerAttack(Midi(note).toNote(), time, velocity * randomBetween(0.5, 1)); - } - } - _internalLoad() { - return new Promise(onload => { - this._sampler = new Sampler({ - baseUrl: this.samples, - onload, - urls: this._urls, - }).connect(this.output); - }); - } -} - -class Keybed extends PianoComponent { - constructor(options) { - super(options); - /** - * The urls to load - */ - this._urls = {}; - for (let i = options.minNote; i <= options.maxNote; i++) { - this._urls[i] = getReleasesUrl(i); - } - } - _internalLoad() { - return new Promise(success => { - this._buffers = new ToneAudioBuffers(this._urls, success, this.samples); - }); - } - start(note, time, velocity) { - if (this._enabled && this._buffers.has(note)) { - const source = new ToneBufferSource({ - url: this._buffers.get(note), - context: this.context, - }).connect(this.output); - // randomize the velocity slightly - source.start(time, 0, undefined, 0.015 * velocity * randomBetween(0.5, 1)); - } - } -} - -class Pedal extends PianoComponent { - constructor(options) { - super(options); - this._downTime = Infinity; - this._currentSound = null; - this._downTime = Infinity; - } - _internalLoad() { - return new Promise((success) => { - this._buffers = new ToneAudioBuffers({ - down1: 'pedalD1.mp3', - down2: 'pedalD2.mp3', - up1: 'pedalU1.mp3', - up2: 'pedalU2.mp3', - }, success, this.samples); - }); - } - /** - * Squash the current playing sound - */ - _squash(time) { - if (this._currentSound && this._currentSound.state !== 'stopped') { - this._currentSound.stop(time); - } - this._currentSound = null; - } - _playSample(time, dir) { - if (this._enabled) { - this._currentSound = new ToneBufferSource({ - url: this._buffers.get(`${dir}${Math.random() > 0.5 ? 1 : 2}`), - context: this.context, - curve: 'exponential', - fadeIn: 0.05, - fadeOut: 0.1, - }).connect(this.output); - this._currentSound.start(time, randomBetween(0, 0.01), undefined, 0.1 * randomBetween(0.5, 1)); - } - } - /** - * Put the pedal down - */ - down(time) { - this._squash(time); - this._downTime = time; - this._playSample(time, 'down'); - } - /** - * Put the pedal up - */ - up(time) { - this._squash(time); - this._downTime = Infinity; - this._playSample(time, 'up'); - } - /** - * Indicates if the pedal is down at the given time - */ - isDown(time) { - return time > this._downTime; - } -} - -/** - * A single velocity of strings - */ -class PianoString extends ToneAudioNode { - constructor(options) { - super(options); - this.name = 'PianoString'; - this._urls = {}; - // create the urls - options.notes.forEach(note => this._urls[note] = getNotesUrl(note, options.velocity)); - this.samples = options.samples; - } - load() { - return new Promise(onload => { - this._sampler = this.output = new Sampler({ - attack: 0, - baseUrl: this.samples, - curve: 'exponential', - onload, - release: 0.4, - urls: this._urls, - volume: 3, - }); - }); - } - triggerAttack(note, time, velocity) { - this._sampler.triggerAttack(note, time, velocity); - } - triggerRelease(note, time) { - this._sampler.triggerRelease(note, time); - } -} - -var __awaiter$1 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -/** - * Manages all of the hammered string sounds - */ -class PianoStrings extends PianoComponent { - constructor(options) { - super(options); - const notes = getNotesInRange(options.minNote, options.maxNote); - const velocities = velocitiesMap[options.velocities].slice(); - this._strings = velocities.map(velocity => { - const string = new PianoString(Object.assign(options, { - notes, velocity, - })); - return string; - }); - this._activeNotes = new Map(); - } - /** - * Scale a value between a given range - */ - scale(val, inMin, inMax, outMin, outMax) { - return ((val - inMin) / (inMax - inMin)) * (outMax - outMin) + outMin; - } - triggerAttack(note, time, velocity) { - const scaledVel = this.scale(velocity, 0, 1, -0.5, this._strings.length - 0.51); - const stringIndex = Math.max(Math.round(scaledVel), 0); - let gain = 1 + scaledVel - stringIndex; - if (this._strings.length === 1) { - gain = velocity; - } - const sampler = this._strings[stringIndex]; - if (this._activeNotes.has(note)) { - this.triggerRelease(note, time); - } - this._activeNotes.set(note, sampler); - sampler.triggerAttack(Midi(note).toNote(), time, gain); - } - triggerRelease(note, time) { - // trigger the release of all of the notes at that velociy - if (this._activeNotes.has(note)) { - this._activeNotes.get(note).triggerRelease(Midi(note).toNote(), time); - this._activeNotes.delete(note); - } - } - _internalLoad() { - return __awaiter$1(this, void 0, void 0, function* () { - yield Promise.all(this._strings.map((s) => __awaiter$1(this, void 0, void 0, function* () { - yield s.load(); - s.connect(this.output); - }))); - }); - } -} - -var __awaiter$2 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -/** - * The Piano - */ -class Piano extends ToneAudioNode { - constructor() { - super(optionsFromArguments(Piano.getDefaults(), arguments)); - this.name = 'Piano'; - this.input = undefined; - this.output = new Gain({ context: this.context }); - /** - * The currently held notes - */ - this._heldNotes = new Map(); - /** - * If it's loaded or not - */ - this._loaded = false; - const options = optionsFromArguments(Piano.getDefaults(), arguments); - // make sure it ends with a / - if (!options.url.endsWith('/')) { - options.url += '/'; - } - this.maxPolyphony = options.maxPolyphony; - this._heldNotes = new Map(); - this._sustainedNotes = new Map(); - this._strings = new PianoStrings(Object.assign({}, options, { - enabled: true, - samples: options.url, - volume: options.volume.strings, - })).connect(this.output); - this.strings = this._strings.volume; - this._pedal = new Pedal(Object.assign({}, options, { - enabled: options.pedal, - samples: options.url, - volume: options.volume.pedal, - })).connect(this.output); - this.pedal = this._pedal.volume; - this._keybed = new Keybed(Object.assign({}, options, { - enabled: options.release, - samples: options.url, - volume: options.volume.keybed, - })).connect(this.output); - this.keybed = this._keybed.volume; - this._harmonics = new Harmonics(Object.assign({}, options, { - enabled: options.release, - samples: options.url, - volume: options.volume.harmonics, - })).connect(this.output); - this.harmonics = this._harmonics.volume; - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - maxNote: 108, - minNote: 21, - pedal: true, - release: false, - url: 'https://tambien.github.io/Piano/audio/', - velocities: 1, - maxPolyphony: 32, - volume: { - harmonics: 0, - keybed: 0, - pedal: 0, - strings: 0, - }, - }); - } - /** - * Load all the samples - */ - load() { - return __awaiter$2(this, void 0, void 0, function* () { - yield Promise.all([ - this._strings.load(), - this._pedal.load(), - this._keybed.load(), - this._harmonics.load(), - ]); - this._loaded = true; - }); - } - /** - * If all the samples are loaded or not - */ - get loaded() { - return this._loaded; - } - /** - * Put the pedal down at the given time. Causes subsequent - * notes and currently held notes to sustain. - */ - pedalDown({ time = this.immediate() } = {}) { - if (this.loaded) { - time = this.toSeconds(time); - if (!this._pedal.isDown(time)) { - this._pedal.down(time); - } - } - return this; - } - /** - * Put the pedal up. Dampens sustained notes - */ - pedalUp({ time = this.immediate() } = {}) { - if (this.loaded) { - const seconds = this.toSeconds(time); - if (this._pedal.isDown(seconds)) { - this._pedal.up(seconds); - // dampen each of the notes - this._sustainedNotes.forEach((t, note) => { - if (!this._heldNotes.has(note)) { - this._strings.triggerRelease(note, seconds); - } - }); - this._sustainedNotes.clear(); - } - } - return this; - } - /** - * Play a note. - * @param note The note to play. If it is a number, it is assumed to be MIDI - * @param velocity The velocity to play the note - * @param time The time of the event - */ - keyDown({ note, midi, time = this.immediate(), velocity = 0.8 }) { - if (this.loaded && this.maxPolyphony > this._heldNotes.size + this._sustainedNotes.size) { - time = this.toSeconds(time); - if (isString(note)) { - midi = Math.round(Midi(note).toMidi()); - } - if (!this._heldNotes.has(midi)) { - // record the start time and velocity - this._heldNotes.set(midi, { time, velocity }); - this._strings.triggerAttack(midi, time, velocity); - } - } - else { - console.warn('samples not loaded'); - } - return this; - } - /** - * Release a held note. - */ - keyUp({ note, midi, time = this.immediate(), velocity = 0.8 }) { - if (this.loaded) { - time = this.toSeconds(time); - if (isString(note)) { - midi = Math.round(Midi(note).toMidi()); - } - if (this._heldNotes.has(midi)) { - const prevNote = this._heldNotes.get(midi); - this._heldNotes.delete(midi); - // compute the release velocity - const holdTime = Math.pow(Math.max(time - prevNote.time, 0.1), 0.7); - const prevVel = prevNote.velocity; - let dampenGain = (3 / holdTime) * prevVel * velocity; - dampenGain = Math.max(dampenGain, 0.4); - dampenGain = Math.min(dampenGain, 4); - if (this._pedal.isDown(time)) { - if (!this._sustainedNotes.has(midi)) { - this._sustainedNotes.set(midi, time); - } - } - else { - // release the string sound - this._strings.triggerRelease(midi, time); - // trigger the harmonics sound - this._harmonics.triggerAttack(midi, time, dampenGain); - } - // trigger the keybed release sound - this._keybed.start(midi, time, velocity); - } - } - return this; - } - stopAll() { - this.pedalUp(); - this._heldNotes.forEach((_, midi) => { - this.keyUp({ midi }); - }); - return this; - } -} - -var __awaiter$3 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - -export { Piano }; diff --git a/docs/_snowpack/pkg/bjork.js b/docs/_snowpack/pkg/bjork.js deleted file mode 100644 index 865cfbff..00000000 --- a/docs/_snowpack/pkg/bjork.js +++ /dev/null @@ -1,41 +0,0 @@ -function bjorklund(slots, pulses){ - var pattern = [], - count = [], - remainder = [pulses], - divisor = slots - pulses, - level = 0, - build_pattern = function(lv){ - if( lv == -1 ){ pattern.push(0); } - else if( lv == -2 ){ pattern.push(1); } - else { - for(var x=0; x 1){ - count.push(Math.floor(divisor/remainder[level])); - remainder.push(divisor%remainder[level]); - divisor = remainder[level]; - level++; - } - count.push(divisor); - - build_pattern(level); - - return pattern.reverse(); -} - - -var bjork = function(m, k){ - if(m > k) return bjorklund(m, k); - else return bjorklund(k, m); -}; - -export default bjork; diff --git a/docs/_snowpack/pkg/chord-voicings.js b/docs/_snowpack/pkg/chord-voicings.js deleted file mode 100644 index 243bf711..00000000 --- a/docs/_snowpack/pkg/chord-voicings.js +++ /dev/null @@ -1,828 +0,0 @@ -import { c as createCommonjsModule, a as commonjsGlobal, g as getDefaultExportFromCjs } from './common/_commonjsHelpers-8c19dec8.js'; -import { n as note, t as transpose$2, d as distance$1, m as modes, c as all, e as tokenizeNote, g as get$2, f as deprecate, h as isSupersetOf, j as all$1, k as isSubsetOf, l as get$3, o as interval, p as compact$1, q as toMidi, r as range$1, s as midiToNoteName, C as Core, u as index$5, v as index$1$1, w as index$1$2, x as index$6, y as index$7, b as index$8, z as index$9, A as index$a, B as index$1$3, a as index$b, D as index$c, i as index$d, E as accToAlt, F as altToAcc, G as coordToInterval, H as coordToNote, I as decode, J as encode, K as fillStr$1, L as isNamed, M as isPitch, N as stepToLetter, O as tokenizeInterval } from './common/index.es-d2606df1.js'; - -const fillStr = (character, times) => Array(times + 1).join(character); -const REGEX = /^(_{1,}|=|\^{1,}|)([abcdefgABCDEFG])([,']*)$/; -function tokenize(str) { - const m = REGEX.exec(str); - if (!m) { - return ["", "", ""]; - } - return [m[1], m[2], m[3]]; -} -/** - * Convert a (string) note in ABC notation into a (string) note in scientific notation - * - * @example - * abcToScientificNotation("c") // => "C5" - */ -function abcToScientificNotation(str) { - const [acc, letter, oct] = tokenize(str); - if (letter === "") { - return ""; - } - let o = 4; - for (let i = 0; i < oct.length; i++) { - o += oct.charAt(i) === "," ? -1 : 1; - } - const a = acc[0] === "_" - ? acc.replace(/_/g, "b") - : acc[0] === "^" - ? acc.replace(/\^/g, "#") - : ""; - return letter.charCodeAt(0) > 96 - ? letter.toUpperCase() + a + (o + 1) - : letter + a + o; -} -/** - * Convert a (string) note in scientific notation into a (string) note in ABC notation - * - * @example - * scientificToAbcNotation("C#4") // => "^C" - */ -function scientificToAbcNotation(str) { - const n = note(str); - if (n.empty || (!n.oct && n.oct !== 0)) { - return ""; - } - const { letter, acc, oct } = n; - const a = acc[0] === "b" ? acc.replace(/b/g, "_") : acc.replace(/#/g, "^"); - const l = oct > 4 ? letter.toLowerCase() : letter; - const o = oct === 5 ? "" : oct > 4 ? fillStr("'", oct - 5) : fillStr(",", 4 - oct); - return a + l + o; -} -function transpose(note, interval) { - return scientificToAbcNotation(transpose$2(abcToScientificNotation(note), interval)); -} -function distance(from, to) { - return distance$1(abcToScientificNotation(from), abcToScientificNotation(to)); -} -var index = { - abcToScientificNotation, - scientificToAbcNotation, - tokenize, - transpose, - distance, -}; - -// ascending range -function ascR(b, n) { - const a = []; - // tslint:disable-next-line:curly - for (; n--; a[n] = n + b) - ; - return a; -} -// descending range -function descR(b, n) { - const a = []; - // tslint:disable-next-line:curly - for (; n--; a[n] = b - n) - ; - return a; -} -/** - * Creates a numeric range - * - * @param {number} from - * @param {number} to - * @return {Array} - * - * @example - * range(-2, 2) // => [-2, -1, 0, 1, 2] - * range(2, -2) // => [2, 1, 0, -1, -2] - */ -function range(from, to) { - return from < to ? ascR(from, to - from + 1) : descR(from, from - to + 1); -} -/** - * Rotates a list a number of times. It"s completly agnostic about the - * contents of the list. - * - * @param {Integer} times - the number of rotations - * @param {Array} array - * @return {Array} the rotated array - * - * @example - * rotate(1, [1, 2, 3]) // => [2, 3, 1] - */ -function rotate(times, arr) { - const len = arr.length; - const n = ((times % len) + len) % len; - return arr.slice(n, len).concat(arr.slice(0, n)); -} -/** - * Return a copy of the array with the null values removed - * @function - * @param {Array} array - * @return {Array} - * - * @example - * compact(["a", "b", null, "c"]) // => ["a", "b", "c"] - */ -function compact(arr) { - return arr.filter((n) => n === 0 || n); -} -/** - * Sort an array of notes in ascending order. Pitch classes are listed - * before notes. Any string that is not a note is removed. - * - * @param {string[]} notes - * @return {string[]} sorted array of notes - * - * @example - * sortedNoteNames(['c2', 'c5', 'c1', 'c0', 'c6', 'c']) - * // => ['C', 'C0', 'C1', 'C2', 'C5', 'C6'] - * sortedNoteNames(['c', 'F', 'G', 'a', 'b', 'h', 'J']) - * // => ['C', 'F', 'G', 'A', 'B'] - */ -function sortedNoteNames(notes) { - const valid = notes.map((n) => note(n)).filter((n) => !n.empty); - return valid.sort((a, b) => a.height - b.height).map((n) => n.name); -} -/** - * Get sorted notes with duplicates removed. Pitch classes are listed - * before notes. - * - * @function - * @param {string[]} array - * @return {string[]} unique sorted notes - * - * @example - * Array.sortedUniqNoteNames(['a', 'b', 'c2', '1p', 'p2', 'c2', 'b', 'c', 'c3' ]) - * // => [ 'C', 'A', 'B', 'C2', 'C3' ] - */ -function sortedUniqNoteNames(arr) { - return sortedNoteNames(arr).filter((n, i, a) => i === 0 || n !== a[i - 1]); -} -/** - * Randomizes the order of the specified array in-place, using the Fisher–Yates shuffle. - * - * @function - * @param {Array} array - * @return {Array} the array shuffled - * - * @example - * shuffle(["C", "D", "E", "F"]) // => [...] - */ -function shuffle(arr, rnd = Math.random) { - let i; - let t; - let m = arr.length; - while (m) { - i = Math.floor(rnd() * m--); - t = arr[m]; - arr[m] = arr[i]; - arr[i] = t; - } - return arr; -} -/** - * Get all permutations of an array - * - * @param {Array} array - the array - * @return {Array} an array with all the permutations - * @example - * permutations(["a", "b", "c"])) // => - * [ - * ["a", "b", "c"], - * ["b", "a", "c"], - * ["b", "c", "a"], - * ["a", "c", "b"], - * ["c", "a", "b"], - * ["c", "b", "a"] - * ] - */ -function permutations(arr) { - if (arr.length === 0) { - return [[]]; - } - return permutations(arr.slice(1)).reduce((acc, perm) => { - return acc.concat(arr.map((e, pos) => { - const newPerm = perm.slice(); - newPerm.splice(pos, 0, arr[0]); - return newPerm; - })); - }, []); -} - -var index_es = /*#__PURE__*/Object.freeze({ - __proto__: null, - compact: compact, - permutations: permutations, - range: range, - rotate: rotate, - shuffle: shuffle, - sortedNoteNames: sortedNoteNames, - sortedUniqNoteNames: sortedUniqNoteNames -}); - -const namedSet = (notes) => { - const pcToName = notes.reduce((record, n) => { - const chroma = note(n).chroma; - if (chroma !== undefined) { - record[chroma] = record[chroma] || note(n).name; - } - return record; - }, {}); - return (chroma) => pcToName[chroma]; -}; -function detect(source) { - const notes = source.map((n) => note(n).pc).filter((x) => x); - if (note.length === 0) { - return []; - } - const found = findExactMatches(notes, 1); - return found - .filter((chord) => chord.weight) - .sort((a, b) => b.weight - a.weight) - .map((chord) => chord.name); -} -function findExactMatches(notes, weight) { - const tonic = notes[0]; - const tonicChroma = note(tonic).chroma; - const noteName = namedSet(notes); - // we need to test all chormas to get the correct baseNote - const allModes = modes(notes, false); - const found = []; - allModes.forEach((mode, index) => { - // some chords could have the same chroma but different interval spelling - const chordTypes = all().filter((chordType) => chordType.chroma === mode); - chordTypes.forEach((chordType) => { - const chordName = chordType.aliases[0]; - const baseNote = noteName(index); - const isInversion = index !== tonicChroma; - if (isInversion) { - found.push({ - weight: 0.5 * weight, - name: `${baseNote}${chordName}/${tonic}`, - }); - } - else { - found.push({ weight: 1 * weight, name: `${baseNote}${chordName}` }); - } - }); - }); - return found; -} - -const NoChord = { - empty: true, - name: "", - symbol: "", - root: "", - rootDegree: 0, - type: "", - tonic: null, - setNum: NaN, - quality: "Unknown", - chroma: "", - normalized: "", - aliases: [], - notes: [], - intervals: [], -}; -// 6, 64, 7, 9, 11 and 13 are consider part of the chord -// (see https://github.com/danigb/tonal/issues/55) -const NUM_TYPES = /^(6|64|7|9|11|13)$/; -/** - * Tokenize a chord name. It returns an array with the tonic and chord type - * If not tonic is found, all the name is considered the chord name. - * - * This function does NOT check if the chord type exists or not. It only tries - * to split the tonic and chord type. - * - * @function - * @param {string} name - the chord name - * @return {Array} an array with [tonic, type] - * @example - * tokenize("Cmaj7") // => [ "C", "maj7" ] - * tokenize("C7") // => [ "C", "7" ] - * tokenize("mMaj7") // => [ null, "mMaj7" ] - * tokenize("Cnonsense") // => [ null, "nonsense" ] - */ -function tokenize$1(name) { - const [letter, acc, oct, type] = tokenizeNote(name); - if (letter === "") { - return ["", name]; - } - // aug is augmented (see https://github.com/danigb/tonal/issues/55) - if (letter === "A" && type === "ug") { - return ["", "aug"]; - } - // see: https://github.com/tonaljs/tonal/issues/70 - if (!type && (oct === "4" || oct === "5")) { - return [letter + acc, oct]; - } - if (NUM_TYPES.test(oct)) { - return [letter + acc, oct + type]; - } - else { - return [letter + acc + oct, type]; - } -} -/** - * Get a Chord from a chord name. - */ -function get(src) { - if (src === "") { - return NoChord; - } - if (Array.isArray(src) && src.length === 2) { - return getChord(src[1], src[0]); - } - else { - const [tonic, type] = tokenize$1(src); - const chord = getChord(type, tonic); - return chord.empty ? getChord(src) : chord; - } -} -/** - * Get chord properties - * - * @param typeName - the chord type name - * @param [tonic] - Optional tonic - * @param [root] - Optional root (requires a tonic) - */ -function getChord(typeName, optionalTonic, optionalRoot) { - const type = get$2(typeName); - const tonic = note(optionalTonic || ""); - const root = note(optionalRoot || ""); - if (type.empty || - (optionalTonic && tonic.empty) || - (optionalRoot && root.empty)) { - return NoChord; - } - const rootInterval = distance$1(tonic.pc, root.pc); - const rootDegree = type.intervals.indexOf(rootInterval) + 1; - if (!root.empty && !rootDegree) { - return NoChord; - } - const intervals = Array.from(type.intervals); - for (let i = 1; i < rootDegree; i++) { - const num = intervals[0][0]; - const quality = intervals[0][1]; - const newNum = parseInt(num, 10) + 7; - intervals.push(`${newNum}${quality}`); - intervals.shift(); - } - const notes = tonic.empty - ? [] - : intervals.map((i) => transpose$2(tonic, i)); - typeName = type.aliases.indexOf(typeName) !== -1 ? typeName : type.aliases[0]; - const symbol = `${tonic.empty ? "" : tonic.pc}${typeName}${root.empty || rootDegree <= 1 ? "" : "/" + root.pc}`; - const name = `${optionalTonic ? tonic.pc + " " : ""}${type.name}${rootDegree > 1 && optionalRoot ? " over " + root.pc : ""}`; - return { - ...type, - name, - symbol, - type: type.name, - root: root.name, - intervals, - rootDegree, - tonic: tonic.name, - notes, - }; -} -const chord = deprecate("Chord.chord", "Chord.get", get); -/** - * Transpose a chord name - * - * @param {string} chordName - the chord name - * @return {string} the transposed chord - * - * @example - * transpose('Dm7', 'P4') // => 'Gm7 - */ -function transpose$1(chordName, interval) { - const [tonic, type] = tokenize$1(chordName); - if (!tonic) { - return chordName; - } - return transpose$2(tonic, interval) + type; -} -/** - * Get all scales where the given chord fits - * - * @example - * chordScales('C7b9') - * // => ["phrygian dominant", "flamenco", "spanish heptatonic", "half-whole diminished", "chromatic"] - */ -function chordScales(name) { - const s = get(name); - const isChordIncluded = isSupersetOf(s.chroma); - return all$1() - .filter((scale) => isChordIncluded(scale.chroma)) - .map((scale) => scale.name); -} -/** - * Get all chords names that are a superset of the given one - * (has the same notes and at least one more) - * - * @function - * @example - * extended("CMaj7") - * // => [ 'Cmaj#4', 'Cmaj7#9#11', 'Cmaj9', 'CM7add13', 'Cmaj13', 'Cmaj9#11', 'CM13#11', 'CM7b9' ] - */ -function extended(chordName) { - const s = get(chordName); - const isSuperset = isSupersetOf(s.chroma); - return all() - .filter((chord) => isSuperset(chord.chroma)) - .map((chord) => s.tonic + chord.aliases[0]); -} -/** - * Find all chords names that are a subset of the given one - * (has less notes but all from the given chord) - * - * @example - */ -function reduced(chordName) { - const s = get(chordName); - const isSubset = isSubsetOf(s.chroma); - return all() - .filter((chord) => isSubset(chord.chroma)) - .map((chord) => s.tonic + chord.aliases[0]); -} -var index$1 = { - getChord, - get, - detect, - chordScales, - extended, - reduced, - tokenize: tokenize$1, - transpose: transpose$1, - // deprecate - chord, -}; - -/** - * Given a tonic and a chord list expressed with roman numeral notation - * returns the progression expressed with leadsheet chords symbols notation - * @example - * fromRomanNumerals("C", ["I", "IIm7", "V7"]); - * // => ["C", "Dm7", "G7"] - */ -function fromRomanNumerals(tonic, chords) { - const romanNumerals = chords.map(get$3); - return romanNumerals.map((rn) => transpose$2(tonic, interval(rn)) + rn.chordType); -} -/** - * Given a tonic and a chord list with leadsheet symbols notation, - * return the chord list with roman numeral notation - * @example - * toRomanNumerals("C", ["CMaj7", "Dm7", "G7"]); - * // => ["IMaj7", "IIm7", "V7"] - */ -function toRomanNumerals(tonic, chords) { - return chords.map((chord) => { - const [note, chordType] = tokenize$1(chord); - const intervalName = distance$1(tonic, note); - const roman = get$3(interval(intervalName)); - return roman.name + chordType; - }); -} -var index$2 = { fromRomanNumerals, toRomanNumerals }; - -/** - * Create a numeric range. You supply a list of notes or numbers and it will - * be connected to create complex ranges. - * - * @param {Array} notes - the list of notes or midi numbers used - * @return {Array} an array of numbers or empty array if not valid parameters - * - * @example - * numeric(["C5", "C4"]) // => [ 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60 ] - * // it works midi notes - * numeric([10, 5]) // => [ 10, 9, 8, 7, 6, 5 ] - * // complex range - * numeric(["C4", "E4", "Bb3"]) // => [60, 61, 62, 63, 64, 63, 62, 61, 60, 59, 58] - */ -function numeric(notes) { - const midi = compact$1(notes.map(toMidi)); - if (!notes.length || midi.length !== notes.length) { - // there is no valid notes - return []; - } - return midi.reduce((result, note) => { - const last = result[result.length - 1]; - return result.concat(range$1(last, note).slice(1)); - }, [midi[0]]); -} -/** - * Create a range of chromatic notes. The altered notes will use flats. - * - * @function - * @param {Array} notes - the list of notes or midi note numbers to create a range from - * @param {Object} options - The same as `midiToNoteName` (`{ sharps: boolean, pitchClass: boolean }`) - * @return {Array} an array of note names - * - * @example - * Range.chromatic(["C2, "E2", "D2"]) // => ["C2", "Db2", "D2", "Eb2", "E2", "Eb2", "D2"] - * // with sharps - * Range.chromatic(["C2", "C3"], { sharps: true }) // => [ "C2", "C#2", "D2", "D#2", "E2", "F2", "F#2", "G2", "G#2", "A2", "A#2", "B2", "C3" ] - */ -function chromatic(notes, options) { - return numeric(notes).map((midi) => midiToNoteName(midi, options)); -} -var index$3 = { numeric, chromatic }; - -// CONSTANTS -const NONE = { - empty: true, - name: "", - upper: undefined, - lower: undefined, - type: undefined, - additive: [], -}; -const NAMES = ["4/4", "3/4", "2/4", "2/2", "12/8", "9/8", "6/8", "3/8"]; -// PUBLIC API -function names() { - return NAMES.slice(); -} -const REGEX$1 = /^(\d?\d(?:\+\d)*)\/(\d)$/; -const CACHE = new Map(); -function get$1(literal) { - const cached = CACHE.get(literal); - if (cached) { - return cached; - } - const ts = build(parse(literal)); - CACHE.set(literal, ts); - return ts; -} -function parse(literal) { - if (typeof literal === "string") { - const [_, up, low] = REGEX$1.exec(literal) || []; - return parse([up, low]); - } - const [up, down] = literal; - const denominator = +down; - if (typeof up === "number") { - return [up, denominator]; - } - const list = up.split("+").map((n) => +n); - return list.length === 1 ? [list[0], denominator] : [list, denominator]; -} -var index$4 = { names, parse, get: get$1 }; -// PRIVATE -function build([up, down]) { - const upper = Array.isArray(up) ? up.reduce((a, b) => a + b, 0) : up; - const lower = down; - if (upper === 0 || lower === 0) { - return NONE; - } - const name = Array.isArray(up) ? `${up.join("+")}/${down}` : `${up}/${down}`; - const additive = Array.isArray(up) ? up : []; - const type = lower === 4 || lower === 2 - ? "simple" - : lower === 8 && upper % 3 === 0 - ? "compound" - : "irregular"; - return { - empty: false, - name, - type, - upper, - lower, - additive, - }; -} - -// deprecated (backwards compatibility) -const Tonal = Core; -const PcSet = index$5; -const ChordDictionary = index$1$1; -const ScaleDictionary = index$1$2; - -var index_es$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - Array: index_es, - Core: Core, - ChordDictionary: ChordDictionary, - PcSet: PcSet, - ScaleDictionary: ScaleDictionary, - Tonal: Tonal, - AbcNotation: index, - Chord: index$1, - ChordType: index$1$1, - Collection: index$6, - DurationValue: index$7, - Interval: index$8, - Key: index$9, - Midi: index$a, - Mode: index$1$3, - Note: index$b, - Pcset: index$5, - Progression: index$2, - Range: index$3, - RomanNumeral: index$c, - Scale: index$d, - ScaleType: index$1$2, - TimeSignature: index$4, - accToAlt: accToAlt, - altToAcc: altToAcc, - coordToInterval: coordToInterval, - coordToNote: coordToNote, - decode: decode, - deprecate: deprecate, - distance: distance$1, - encode: encode, - fillStr: fillStr$1, - interval: interval, - isNamed: isNamed, - isPitch: isPitch, - note: note, - stepToLetter: stepToLetter, - tokenizeInterval: tokenizeInterval, - tokenizeNote: tokenizeNote, - transpose: transpose$2 -}); - -var getBestVoicing_1 = createCommonjsModule(function (module, exports) { -exports.__esModule = true; -exports.getBestVoicing = void 0; -function getBestVoicing(voicingOptions) { - var chord = voicingOptions.chord, range = voicingOptions.range, finder = voicingOptions.finder, picker = voicingOptions.picker, lastVoicing = voicingOptions.lastVoicing; - var voicings = finder(chord, range); - if (!voicings.length) { - return []; - } - return picker(voicings, lastVoicing); -} -exports.getBestVoicing = getBestVoicing; - -}); - -var tokenizeChord_1 = createCommonjsModule(function (module, exports) { -exports.__esModule = true; -exports.tokenizeChord = void 0; -function tokenizeChord(chord) { - var match = (chord || '').match(/^([A-G][b#]*)([^\/]*)[\/]?([A-G][b#]*)?$/); - if (!match) { - // console.warn('could not tokenize chord', chord); - return []; - } - return match.slice(1); -} -exports.tokenizeChord = tokenizeChord; - -}); - -var voicingsInRange_1 = createCommonjsModule(function (module, exports) { -exports.__esModule = true; -exports.voicingsInRange = void 0; - - - -function voicingsInRange(chord, dictionary, range) { - if (dictionary === void 0) { dictionary = dictionaryVoicing_1.lefthand; } - if (range === void 0) { range = ['D3', 'A4']; } - var _a = (0, tokenizeChord_1.tokenizeChord)(chord), tonic = _a[0], symbol = _a[1]; - if (!dictionary[symbol]) { - return []; - } - // resolve array of interval arrays for the wanted symbol - var voicings = dictionary[symbol].map(function (intervals) { return intervals.split(' '); }); - var notesInRange = index_es$1.Range.chromatic(range); // gives array of notes inside range - return voicings.reduce(function (voiced, voicing) { - // transpose intervals relative to first interval (e.g. 3m 5P > 1P 3M) - var relativeIntervals = voicing.map(function (interval) { return index_es$1.Interval.substract(interval, voicing[0]); }); - // get enharmonic correct pitch class the bottom note - var bottomPitchClass = index_es$1.Note.transpose(tonic, voicing[0]); - // get all possible start notes for voicing - var starts = notesInRange - // only get the start notes: - .filter(function (note) { return index_es$1.Note.chroma(note) === index_es$1.Note.chroma(bottomPitchClass); }) - // filter out start notes that will overshoot the top end of the range - .filter(function (note) { - return index_es$1.Note.midi(index_es$1.Note.transpose(note, relativeIntervals[relativeIntervals.length - 1])) <= index_es$1.Note.midi(range[1]); - }) - // replace Range.chromatic notes with the correct enharmonic equivalents - .map(function (note) { return index_es$1.Note.enharmonic(note, bottomPitchClass); }); - // render one voicing for each start note - var notes = starts.map(function (start) { return relativeIntervals.map(function (interval) { return index_es$1.Note.transpose(start, interval); }); }); - return voiced.concat(notes); - }, []); -} -exports.voicingsInRange = voicingsInRange; - -}); - -var dictionaryVoicing_1 = createCommonjsModule(function (module, exports) { -var __assign = (commonjsGlobal && commonjsGlobal.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __rest = (commonjsGlobal && commonjsGlobal.__rest) || function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; -}; -exports.__esModule = true; -exports.dictionaryVoicing = exports.dictionaryVoicingFinder = exports.triads = exports.guidetones = exports.lefthand = void 0; - - -exports.lefthand = { - m7: ['3m 5P 7m 9M', '7m 9M 10m 12P'], - '7': ['3M 6M 7m 9M', '7m 9M 10M 13M'], - '^7': ['3M 5P 7M 9M', '7M 9M 10M 12P'], - '69': ['3M 5P 6A 9M'], - m7b5: ['3m 5d 7m 8P', '7m 8P 10m 12d'], - '7b9': ['3M 6m 7m 9m', '7m 9m 10M 13m'], - '7b13': ['3M 6m 7m 9m', '7m 9m 10M 13m'], - o7: ['1P 3m 5d 6M', '5d 6M 8P 10m'], - '7#11': ['7m 9M 11A 13A'], - '7#9': ['3M 7m 9A'], - mM7: ['3m 5P 7M 9M', '7M 9M 10m 12P'], - m6: ['3m 5P 6M 9M', '6M 9M 10m 12P'] -}; -exports.guidetones = { - m7: ['3m 7m', '7m 10m'], - m9: ['3m 7m', '7m 10m'], - '7': ['3M 7m', '7m 10M'], - '^7': ['3M 7M', '7M 10M'], - '^9': ['3M 7M', '7M 10M'], - '69': ['3M 6M'], - '6': ['3M 6M', '6M 10M'], - m7b5: ['3m 7m', '7m 10m'], - '7b9': ['3M 7m', '7m 10M'], - '7b13': ['3M 7m', '7m 10M'], - o7: ['3m 6M', '6M 10m'], - '7#11': ['3M 7m', '7m 10M'], - '7#9': ['3M 7m', '7m 10M'], - mM7: ['3m 7M', '7M 10m'], - m6: ['3m 6M', '6M 10m'] -}; -exports.triads = { - M: ['1P 3M 5P', '3M 5P 8P', '5P 8P 10M'], - m: ['1P 3m 5P', '3m 5P 8P', '5P 8P 10m'], - o: ['1P 3m 5d', '3m 5d 8P', '5d 8P 10m'], - aug: ['1P 3m 5A', '3m 5A 8P', '5A 8P 10m'] -}; -var dictionaryVoicingFinder = function (dictionary) { return function (chordSymbol, range) { - return (0, voicingsInRange_1.voicingsInRange)(chordSymbol, dictionary, range); -}; }; -exports.dictionaryVoicingFinder = dictionaryVoicingFinder; -var dictionaryVoicing = function (props) { - var dictionary = props.dictionary, range = props.range, rest = __rest(props, ["dictionary", "range"]); - return (0, getBestVoicing_1.getBestVoicing)(__assign(__assign({}, rest), { range: range, finder: (0, exports.dictionaryVoicingFinder)(dictionary) })); -}; -exports.dictionaryVoicing = dictionaryVoicing; - -}); - -var minTopNoteDiff_1 = createCommonjsModule(function (module, exports) { -exports.__esModule = true; -exports.minTopNoteDiff = void 0; - -function minTopNoteDiff(voicings, lastVoicing) { - if (!lastVoicing) { - return voicings[0]; - } - var diff = function (voicing) { - return Math.abs(index_es$1.Note.midi(lastVoicing[lastVoicing.length - 1]) - index_es$1.Note.midi(voicing[voicing.length - 1])); - }; - return voicings.reduce(function (best, current) { return (diff(current) < diff(best) ? current : best); }, voicings[0]); -} -exports.minTopNoteDiff = minTopNoteDiff; - -}); - -var dist = createCommonjsModule(function (module, exports) { -exports.__esModule = true; - - - - -exports["default"] = { - tokenizeChord: tokenizeChord_1.tokenizeChord, - getBestVoicing: getBestVoicing_1.getBestVoicing, - dictionaryVoicing: dictionaryVoicing_1.dictionaryVoicing, - dictionaryVoicingFinder: dictionaryVoicing_1.dictionaryVoicingFinder, - lefthand: dictionaryVoicing_1.lefthand, - guidetones: dictionaryVoicing_1.guidetones, - triads: dictionaryVoicing_1.triads, - minTopNoteDiff: minTopNoteDiff_1.minTopNoteDiff -}; - -}); - -var __pika_web_default_export_for_treeshaking__ = /*@__PURE__*/getDefaultExportFromCjs(dist); - -export default __pika_web_default_export_for_treeshaking__; diff --git a/docs/_snowpack/pkg/codemirror/lib/codemirror.css b/docs/_snowpack/pkg/codemirror/lib/codemirror.css deleted file mode 100644 index f4d5718a..00000000 --- a/docs/_snowpack/pkg/codemirror/lib/codemirror.css +++ /dev/null @@ -1,344 +0,0 @@ -/* BASICS */ - -.CodeMirror { - /* Set height, width, borders, and global font properties here */ - font-family: monospace; - height: 300px; - color: black; - direction: ltr; -} - -/* PADDING */ - -.CodeMirror-lines { - padding: 4px 0; /* Vertical padding around content */ -} -.CodeMirror pre.CodeMirror-line, -.CodeMirror pre.CodeMirror-line-like { - padding: 0 4px; /* Horizontal padding of content */ -} - -.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { - background-color: white; /* The little square between H and V scrollbars */ -} - -/* GUTTER */ - -.CodeMirror-gutters { - border-right: 1px solid #ddd; - background-color: #f7f7f7; - white-space: nowrap; -} -.CodeMirror-linenumbers {} -.CodeMirror-linenumber { - padding: 0 3px 0 5px; - min-width: 20px; - text-align: right; - color: #999; - white-space: nowrap; -} - -.CodeMirror-guttermarker { color: black; } -.CodeMirror-guttermarker-subtle { color: #999; } - -/* CURSOR */ - -.CodeMirror-cursor { - border-left: 1px solid black; - border-right: none; - width: 0; -} -/* Shown when moving in bi-directional text */ -.CodeMirror div.CodeMirror-secondarycursor { - border-left: 1px solid silver; -} -.cm-fat-cursor .CodeMirror-cursor { - width: auto; - border: 0 !important; - background: #7e7; -} -.cm-fat-cursor div.CodeMirror-cursors { - z-index: 1; -} -.cm-fat-cursor .CodeMirror-line::selection, -.cm-fat-cursor .CodeMirror-line > span::selection, -.cm-fat-cursor .CodeMirror-line > span > span::selection { background: transparent; } -.cm-fat-cursor .CodeMirror-line::-moz-selection, -.cm-fat-cursor .CodeMirror-line > span::-moz-selection, -.cm-fat-cursor .CodeMirror-line > span > span::-moz-selection { background: transparent; } -.cm-fat-cursor { caret-color: transparent; } -@-moz-keyframes blink { - 0% {} - 50% { background-color: transparent; } - 100% {} -} -@-webkit-keyframes blink { - 0% {} - 50% { background-color: transparent; } - 100% {} -} -@keyframes blink { - 0% {} - 50% { background-color: transparent; } - 100% {} -} - -/* Can style cursor different in overwrite (non-insert) mode */ -.CodeMirror-overwrite .CodeMirror-cursor {} - -.cm-tab { display: inline-block; text-decoration: inherit; } - -.CodeMirror-rulers { - position: absolute; - left: 0; right: 0; top: -50px; bottom: 0; - overflow: hidden; -} -.CodeMirror-ruler { - border-left: 1px solid #ccc; - top: 0; bottom: 0; - position: absolute; -} - -/* DEFAULT THEME */ - -.cm-s-default .cm-header {color: blue;} -.cm-s-default .cm-quote {color: #090;} -.cm-negative {color: #d44;} -.cm-positive {color: #292;} -.cm-header, .cm-strong {font-weight: bold;} -.cm-em {font-style: italic;} -.cm-link {text-decoration: underline;} -.cm-strikethrough {text-decoration: line-through;} - -.cm-s-default .cm-keyword {color: #708;} -.cm-s-default .cm-atom {color: #219;} -.cm-s-default .cm-number {color: #164;} -.cm-s-default .cm-def {color: #00f;} -.cm-s-default .cm-variable, -.cm-s-default .cm-punctuation, -.cm-s-default .cm-property, -.cm-s-default .cm-operator {} -.cm-s-default .cm-variable-2 {color: #05a;} -.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;} -.cm-s-default .cm-comment {color: #a50;} -.cm-s-default .cm-string {color: #a11;} -.cm-s-default .cm-string-2 {color: #f50;} -.cm-s-default .cm-meta {color: #555;} -.cm-s-default .cm-qualifier {color: #555;} -.cm-s-default .cm-builtin {color: #30a;} -.cm-s-default .cm-bracket {color: #997;} -.cm-s-default .cm-tag {color: #170;} -.cm-s-default .cm-attribute {color: #00c;} -.cm-s-default .cm-hr {color: #999;} -.cm-s-default .cm-link {color: #00c;} - -.cm-s-default .cm-error {color: #f00;} -.cm-invalidchar {color: #f00;} - -.CodeMirror-composing { border-bottom: 2px solid; } - -/* Default styles for common addons */ - -div.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;} -div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;} -.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); } -.CodeMirror-activeline-background {background: #e8f2ff;} - -/* STOP */ - -/* The rest of this file contains styles related to the mechanics of - the editor. You probably shouldn't touch them. */ - -.CodeMirror { - position: relative; - overflow: hidden; - background: white; -} - -.CodeMirror-scroll { - overflow: scroll !important; /* Things will break if this is overridden */ - /* 50px is the magic margin used to hide the element's real scrollbars */ - /* See overflow: hidden in .CodeMirror */ - margin-bottom: -50px; margin-right: -50px; - padding-bottom: 50px; - height: 100%; - outline: none; /* Prevent dragging from highlighting the element */ - position: relative; - z-index: 0; -} -.CodeMirror-sizer { - position: relative; - border-right: 50px solid transparent; -} - -/* The fake, visible scrollbars. Used to force redraw during scrolling - before actual scrolling happens, thus preventing shaking and - flickering artifacts. */ -.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { - position: absolute; - z-index: 6; - display: none; - outline: none; -} -.CodeMirror-vscrollbar { - right: 0; top: 0; - overflow-x: hidden; - overflow-y: scroll; -} -.CodeMirror-hscrollbar { - bottom: 0; left: 0; - overflow-y: hidden; - overflow-x: scroll; -} -.CodeMirror-scrollbar-filler { - right: 0; bottom: 0; -} -.CodeMirror-gutter-filler { - left: 0; bottom: 0; -} - -.CodeMirror-gutters { - position: absolute; left: 0; top: 0; - min-height: 100%; - z-index: 3; -} -.CodeMirror-gutter { - white-space: normal; - height: 100%; - display: inline-block; - vertical-align: top; - margin-bottom: -50px; -} -.CodeMirror-gutter-wrapper { - position: absolute; - z-index: 4; - background: none !important; - border: none !important; -} -.CodeMirror-gutter-background { - position: absolute; - top: 0; bottom: 0; - z-index: 4; -} -.CodeMirror-gutter-elt { - position: absolute; - cursor: default; - z-index: 4; -} -.CodeMirror-gutter-wrapper ::selection { background-color: transparent } -.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent } - -.CodeMirror-lines { - cursor: text; - min-height: 1px; /* prevents collapsing before first draw */ -} -.CodeMirror pre.CodeMirror-line, -.CodeMirror pre.CodeMirror-line-like { - /* Reset some styles that the rest of the page might have set */ - -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; - border-width: 0; - background: transparent; - font-family: inherit; - font-size: inherit; - margin: 0; - white-space: pre; - word-wrap: normal; - line-height: inherit; - color: inherit; - z-index: 2; - position: relative; - overflow: visible; - -webkit-tap-highlight-color: transparent; - -webkit-font-variant-ligatures: contextual; - font-variant-ligatures: contextual; -} -.CodeMirror-wrap pre.CodeMirror-line, -.CodeMirror-wrap pre.CodeMirror-line-like { - word-wrap: break-word; - white-space: pre-wrap; - word-break: normal; -} - -.CodeMirror-linebackground { - position: absolute; - left: 0; right: 0; top: 0; bottom: 0; - z-index: 0; -} - -.CodeMirror-linewidget { - position: relative; - z-index: 2; - padding: 0.1px; /* Force widget margins to stay inside of the container */ -} - -.CodeMirror-widget {} - -.CodeMirror-rtl pre { direction: rtl; } - -.CodeMirror-code { - outline: none; -} - -/* Force content-box sizing for the elements where we expect it */ -.CodeMirror-scroll, -.CodeMirror-sizer, -.CodeMirror-gutter, -.CodeMirror-gutters, -.CodeMirror-linenumber { - -moz-box-sizing: content-box; - box-sizing: content-box; -} - -.CodeMirror-measure { - position: absolute; - width: 100%; - height: 0; - overflow: hidden; - visibility: hidden; -} - -.CodeMirror-cursor { - position: absolute; - pointer-events: none; -} -.CodeMirror-measure pre { position: static; } - -div.CodeMirror-cursors { - visibility: hidden; - position: relative; - z-index: 3; -} -div.CodeMirror-dragcursors { - visibility: visible; -} - -.CodeMirror-focused div.CodeMirror-cursors { - visibility: visible; -} - -.CodeMirror-selected { background: #d9d9d9; } -.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; } -.CodeMirror-crosshair { cursor: crosshair; } -.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; } -.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; } - -.cm-searching { - background-color: #ffa; - background-color: rgba(255, 255, 0, .4); -} - -/* Used to force a border model for a node */ -.cm-force-border { padding-right: .1px; } - -@media print { - /* Hide the cursor when printing */ - .CodeMirror div.CodeMirror-cursors { - visibility: hidden; - } -} - -/* See issue #2901 */ -.cm-tab-wrap-hack:after { content: ''; } - -/* Help users use markselection to safely style text background */ -span.CodeMirror-selectedtext { background: none; } diff --git a/docs/_snowpack/pkg/codemirror/lib/codemirror.css.proxy.js b/docs/_snowpack/pkg/codemirror/lib/codemirror.css.proxy.js deleted file mode 100644 index 29c52d50..00000000 --- a/docs/_snowpack/pkg/codemirror/lib/codemirror.css.proxy.js +++ /dev/null @@ -1,10 +0,0 @@ -// [snowpack] add styles to the page (skip if no document exists) -if (typeof document !== 'undefined') { - const code = "/* 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 .CodeMirror-line::selection,\n.cm-fat-cursor .CodeMirror-line > span::selection, \n.cm-fat-cursor .CodeMirror-line > span > span::selection { background: transparent; }\n.cm-fat-cursor .CodeMirror-line::-moz-selection,\n.cm-fat-cursor .CodeMirror-line > span::-moz-selection,\n.cm-fat-cursor .CodeMirror-line > span > span::-moz-selection { background: transparent; }\n.cm-fat-cursor { caret-color: transparent; }\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 z-index: 0;\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 outline: 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"; - - const styleEl = document.createElement("style"); - const codeEl = document.createTextNode(code); - styleEl.type = 'text/css'; - styleEl.appendChild(codeEl); - document.head.appendChild(styleEl); -} \ No newline at end of file diff --git a/docs/_snowpack/pkg/codemirror/mode/javascript/javascript.js b/docs/_snowpack/pkg/codemirror/mode/javascript/javascript.js deleted file mode 100644 index 865524eb..00000000 --- a/docs/_snowpack/pkg/codemirror/mode/javascript/javascript.js +++ /dev/null @@ -1,960 +0,0 @@ -import { c as createCommonjsModule } from '../../../common/_commonjsHelpers-8c19dec8.js'; -import { c as codemirror } from '../../../common/codemirror-d650d44d.js'; - -var javascript = createCommonjsModule(function (module, exports) { -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: https://codemirror.net/LICENSE - -(function(mod) { - mod(codemirror); -})(function(CodeMirror) { - -CodeMirror.defineMode("javascript", function(config, parserConfig) { - var indentUnit = config.indentUnit; - var statementIndent = parserConfig.statementIndent; - var jsonldMode = parserConfig.jsonld; - var jsonMode = parserConfig.json || jsonldMode; - var trackScope = parserConfig.trackScope !== false; - var isTS = parserConfig.typescript; - var wordRE = parserConfig.wordCharacters || /[\w$\xa1-\uffff]/; - - // Tokenizer - - var keywords = function(){ - function kw(type) {return {type: type, style: "keyword"};} - var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"), D = kw("keyword d"); - var operator = kw("operator"), atom = {type: "atom", style: "atom"}; - - return { - "if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B, - "return": D, "break": D, "continue": D, "new": kw("new"), "delete": C, "void": C, "throw": C, - "debugger": kw("debugger"), "var": kw("var"), "const": kw("var"), "let": kw("var"), - "function": kw("function"), "catch": kw("catch"), - "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), - "in": operator, "typeof": operator, "instanceof": operator, - "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom, - "this": kw("this"), "class": kw("class"), "super": kw("atom"), - "yield": C, "export": kw("export"), "import": kw("import"), "extends": C, - "await": C - }; - }(); - - var isOperatorChar = /[+\-*&%=<>!?|~^@]/; - var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/; - - function readRegexp(stream) { - var escaped = false, next, inSet = false; - while ((next = stream.next()) != null) { - if (!escaped) { - if (next == "/" && !inSet) return; - if (next == "[") inSet = true; - else if (inSet && next == "]") inSet = false; - } - escaped = !escaped && next == "\\"; - } - } - - // Used as scratch variables to communicate multiple values without - // consing up tons of objects. - var type, content; - function ret(tp, style, cont) { - type = tp; content = cont; - return style; - } - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == '"' || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } else if (ch == "." && stream.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/)) { - return ret("number", "number"); - } else if (ch == "." && stream.match("..")) { - return ret("spread", "meta"); - } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) { - return ret(ch); - } else if (ch == "=" && stream.eat(">")) { - return ret("=>", "operator"); - } else if (ch == "0" && stream.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)) { - return ret("number", "number"); - } else if (/\d/.test(ch)) { - stream.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/); - return ret("number", "number"); - } else if (ch == "/") { - if (stream.eat("*")) { - state.tokenize = tokenComment; - return tokenComment(stream, state); - } else if (stream.eat("/")) { - stream.skipToEnd(); - return ret("comment", "comment"); - } else if (expressionAllowed(stream, state, 1)) { - readRegexp(stream); - stream.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/); - return ret("regexp", "string-2"); - } else { - stream.eat("="); - return ret("operator", "operator", stream.current()); - } - } else if (ch == "`") { - state.tokenize = tokenQuasi; - return tokenQuasi(stream, state); - } else if (ch == "#" && stream.peek() == "!") { - stream.skipToEnd(); - return ret("meta", "meta"); - } else if (ch == "#" && stream.eatWhile(wordRE)) { - return ret("variable", "property") - } else if (ch == "<" && stream.match("!--") || - (ch == "-" && stream.match("->") && !/\S/.test(stream.string.slice(0, stream.start)))) { - stream.skipToEnd(); - return ret("comment", "comment") - } else if (isOperatorChar.test(ch)) { - if (ch != ">" || !state.lexical || state.lexical.type != ">") { - if (stream.eat("=")) { - if (ch == "!" || ch == "=") stream.eat("="); - } else if (/[<>*+\-|&?]/.test(ch)) { - stream.eat(ch); - if (ch == ">") stream.eat(ch); - } - } - if (ch == "?" && stream.eat(".")) return ret(".") - return ret("operator", "operator", stream.current()); - } else if (wordRE.test(ch)) { - stream.eatWhile(wordRE); - var word = stream.current(); - if (state.lastType != ".") { - if (keywords.propertyIsEnumerable(word)) { - var kw = keywords[word]; - return ret(kw.type, kw.style, word) - } - if (word == "async" && stream.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/, false)) - return ret("async", "keyword", word) - } - return ret("variable", "variable", word) - } - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next; - if (jsonldMode && stream.peek() == "@" && stream.match(isJsonldKeyword)){ - state.tokenize = tokenBase; - return ret("jsonld-keyword", "meta"); - } - while ((next = stream.next()) != null) { - if (next == quote && !escaped) break; - escaped = !escaped && next == "\\"; - } - if (!escaped) state.tokenize = tokenBase; - return ret("string", "string"); - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return ret("comment", "comment"); - } - - function tokenQuasi(stream, state) { - var escaped = false, next; - while ((next = stream.next()) != null) { - if (!escaped && (next == "`" || next == "$" && stream.eat("{"))) { - state.tokenize = tokenBase; - break; - } - escaped = !escaped && next == "\\"; - } - return ret("quasi", "string-2", stream.current()); - } - - var brackets = "([{}])"; - // This is a crude lookahead trick to try and notice that we're - // parsing the argument patterns for a fat-arrow function before we - // actually hit the arrow token. It only works if the arrow is on - // the same line as the arguments and there's no strange noise - // (comments) in between. Fallback is to only notice when we hit the - // arrow, and not declare the arguments as locals for the arrow - // body. - function findFatArrow(stream, state) { - if (state.fatArrowAt) state.fatArrowAt = null; - var arrow = stream.string.indexOf("=>", stream.start); - if (arrow < 0) return; - - if (isTS) { // Try to skip TypeScript return type declarations after the arguments - var m = /:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(stream.string.slice(stream.start, arrow)); - if (m) arrow = m.index; - } - - var depth = 0, sawSomething = false; - for (var pos = arrow - 1; pos >= 0; --pos) { - var ch = stream.string.charAt(pos); - var bracket = brackets.indexOf(ch); - if (bracket >= 0 && bracket < 3) { - if (!depth) { ++pos; break; } - if (--depth == 0) { if (ch == "(") sawSomething = true; break; } - } else if (bracket >= 3 && bracket < 6) { - ++depth; - } else if (wordRE.test(ch)) { - sawSomething = true; - } else if (/["'\/`]/.test(ch)) { - for (;; --pos) { - if (pos == 0) return - var next = stream.string.charAt(pos - 1); - if (next == ch && stream.string.charAt(pos - 2) != "\\") { pos--; break } - } - } else if (sawSomething && !depth) { - ++pos; - break; - } - } - if (sawSomething && !depth) state.fatArrowAt = pos; - } - - // Parser - - var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, - "regexp": true, "this": true, "import": true, "jsonld-keyword": true}; - - function JSLexical(indented, column, type, align, prev, info) { - this.indented = indented; - this.column = column; - this.type = type; - this.prev = prev; - this.info = info; - if (align != null) this.align = align; - } - - function inScope(state, varname) { - if (!trackScope) return false - for (var v = state.localVars; v; v = v.next) - if (v.name == varname) return true; - for (var cx = state.context; cx; cx = cx.prev) { - for (var v = cx.vars; v; v = v.next) - if (v.name == varname) return true; - } - } - - function parseJS(state, style, type, content, stream) { - var cc = state.cc; - // Communicate our context to the combinators. - // (Less wasteful than consing up a hundred closures on every call.) - cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style; - - if (!state.lexical.hasOwnProperty("align")) - state.lexical.align = true; - - while(true) { - var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement; - if (combinator(type, content)) { - while(cc.length && cc[cc.length - 1].lex) - cc.pop()(); - if (cx.marked) return cx.marked; - if (type == "variable" && inScope(state, content)) return "variable-2"; - return style; - } - } - } - - // Combinator utils - - var cx = {state: null, column: null, marked: null, cc: null}; - function pass() { - for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]); - } - function cont() { - pass.apply(null, arguments); - return true; - } - function inList(name, list) { - for (var v = list; v; v = v.next) if (v.name == name) return true - return false; - } - function register(varname) { - var state = cx.state; - cx.marked = "def"; - if (!trackScope) return - if (state.context) { - if (state.lexical.info == "var" && state.context && state.context.block) { - // FIXME function decls are also not block scoped - var newContext = registerVarScoped(varname, state.context); - if (newContext != null) { - state.context = newContext; - return - } - } else if (!inList(varname, state.localVars)) { - state.localVars = new Var(varname, state.localVars); - return - } - } - // Fall through means this is global - if (parserConfig.globalVars && !inList(varname, state.globalVars)) - state.globalVars = new Var(varname, state.globalVars); - } - function registerVarScoped(varname, context) { - if (!context) { - return null - } else if (context.block) { - var inner = registerVarScoped(varname, context.prev); - if (!inner) return null - if (inner == context.prev) return context - return new Context(inner, context.vars, true) - } else if (inList(varname, context.vars)) { - return context - } else { - return new Context(context.prev, new Var(varname, context.vars), false) - } - } - - function isModifier(name) { - return name == "public" || name == "private" || name == "protected" || name == "abstract" || name == "readonly" - } - - // Combinators - - function Context(prev, vars, block) { this.prev = prev; this.vars = vars; this.block = block; } - function Var(name, next) { this.name = name; this.next = next; } - - var defaultVars = new Var("this", new Var("arguments", null)); - function pushcontext() { - cx.state.context = new Context(cx.state.context, cx.state.localVars, false); - cx.state.localVars = defaultVars; - } - function pushblockcontext() { - cx.state.context = new Context(cx.state.context, cx.state.localVars, true); - cx.state.localVars = null; - } - pushcontext.lex = pushblockcontext.lex = true; - function popcontext() { - cx.state.localVars = cx.state.context.vars; - cx.state.context = cx.state.context.prev; - } - popcontext.lex = true; - function pushlex(type, info) { - var result = function() { - var state = cx.state, indent = state.indented; - if (state.lexical.type == "stat") indent = state.lexical.indented; - else for (var outer = state.lexical; outer && outer.type == ")" && outer.align; outer = outer.prev) - indent = outer.indented; - state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info); - }; - result.lex = true; - return result; - } - function poplex() { - var state = cx.state; - if (state.lexical.prev) { - if (state.lexical.type == ")") - state.indented = state.lexical.indented; - state.lexical = state.lexical.prev; - } - } - poplex.lex = true; - - function expect(wanted) { - function exp(type) { - if (type == wanted) return cont(); - else if (wanted == ";" || type == "}" || type == ")" || type == "]") return pass(); - else return cont(exp); - } return exp; - } - - function statement(type, value) { - if (type == "var") return cont(pushlex("vardef", value), vardef, expect(";"), poplex); - if (type == "keyword a") return cont(pushlex("form"), parenExpr, statement, poplex); - if (type == "keyword b") return cont(pushlex("form"), statement, poplex); - if (type == "keyword d") return cx.stream.match(/^\s*$/, false) ? cont() : cont(pushlex("stat"), maybeexpression, expect(";"), poplex); - if (type == "debugger") return cont(expect(";")); - if (type == "{") return cont(pushlex("}"), pushblockcontext, block, poplex, popcontext); - if (type == ";") return cont(); - if (type == "if") { - if (cx.state.lexical.info == "else" && cx.state.cc[cx.state.cc.length - 1] == poplex) - cx.state.cc.pop()(); - return cont(pushlex("form"), parenExpr, statement, poplex, maybeelse); - } - if (type == "function") return cont(functiondef); - if (type == "for") return cont(pushlex("form"), pushblockcontext, forspec, statement, popcontext, poplex); - if (type == "class" || (isTS && value == "interface")) { - cx.marked = "keyword"; - return cont(pushlex("form", type == "class" ? type : value), className, poplex) - } - if (type == "variable") { - if (isTS && value == "declare") { - cx.marked = "keyword"; - return cont(statement) - } else if (isTS && (value == "module" || value == "enum" || value == "type") && cx.stream.match(/^\s*\w/, false)) { - cx.marked = "keyword"; - if (value == "enum") return cont(enumdef); - else if (value == "type") return cont(typename, expect("operator"), typeexpr, expect(";")); - else return cont(pushlex("form"), pattern, expect("{"), pushlex("}"), block, poplex, poplex) - } else if (isTS && value == "namespace") { - cx.marked = "keyword"; - return cont(pushlex("form"), expression, statement, poplex) - } else if (isTS && value == "abstract") { - cx.marked = "keyword"; - return cont(statement) - } else { - return cont(pushlex("stat"), maybelabel); - } - } - if (type == "switch") return cont(pushlex("form"), parenExpr, expect("{"), pushlex("}", "switch"), pushblockcontext, - block, poplex, poplex, popcontext); - if (type == "case") return cont(expression, expect(":")); - if (type == "default") return cont(expect(":")); - if (type == "catch") return cont(pushlex("form"), pushcontext, maybeCatchBinding, statement, poplex, popcontext); - if (type == "export") return cont(pushlex("stat"), afterExport, poplex); - if (type == "import") return cont(pushlex("stat"), afterImport, poplex); - if (type == "async") return cont(statement) - if (value == "@") return cont(expression, statement) - return pass(pushlex("stat"), expression, expect(";"), poplex); - } - function maybeCatchBinding(type) { - if (type == "(") return cont(funarg, expect(")")) - } - function expression(type, value) { - return expressionInner(type, value, false); - } - function expressionNoComma(type, value) { - return expressionInner(type, value, true); - } - function parenExpr(type) { - if (type != "(") return pass() - return cont(pushlex(")"), maybeexpression, expect(")"), poplex) - } - function expressionInner(type, value, noComma) { - if (cx.state.fatArrowAt == cx.stream.start) { - var body = noComma ? arrowBodyNoComma : arrowBody; - if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, expect("=>"), body, popcontext); - else if (type == "variable") return pass(pushcontext, pattern, expect("=>"), body, popcontext); - } - - var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma; - if (atomicTypes.hasOwnProperty(type)) return cont(maybeop); - if (type == "function") return cont(functiondef, maybeop); - if (type == "class" || (isTS && value == "interface")) { cx.marked = "keyword"; return cont(pushlex("form"), classExpression, poplex); } - if (type == "keyword c" || type == "async") return cont(noComma ? expressionNoComma : expression); - if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeop); - if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression); - if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop); - if (type == "{") return contCommasep(objprop, "}", null, maybeop); - if (type == "quasi") return pass(quasi, maybeop); - if (type == "new") return cont(maybeTarget(noComma)); - return cont(); - } - function maybeexpression(type) { - if (type.match(/[;\}\)\],]/)) return pass(); - return pass(expression); - } - - function maybeoperatorComma(type, value) { - if (type == ",") return cont(maybeexpression); - return maybeoperatorNoComma(type, value, false); - } - function maybeoperatorNoComma(type, value, noComma) { - var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma; - var expr = noComma == false ? expression : expressionNoComma; - if (type == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext); - if (type == "operator") { - if (/\+\+|--/.test(value) || isTS && value == "!") return cont(me); - if (isTS && value == "<" && cx.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/, false)) - return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, me); - if (value == "?") return cont(expression, expect(":"), expr); - return cont(expr); - } - if (type == "quasi") { return pass(quasi, me); } - if (type == ";") return; - if (type == "(") return contCommasep(expressionNoComma, ")", "call", me); - if (type == ".") return cont(property, me); - if (type == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me); - if (isTS && value == "as") { cx.marked = "keyword"; return cont(typeexpr, me) } - if (type == "regexp") { - cx.state.lastType = cx.marked = "operator"; - cx.stream.backUp(cx.stream.pos - cx.stream.start - 1); - return cont(expr) - } - } - function quasi(type, value) { - if (type != "quasi") return pass(); - if (value.slice(value.length - 2) != "${") return cont(quasi); - return cont(maybeexpression, continueQuasi); - } - function continueQuasi(type) { - if (type == "}") { - cx.marked = "string-2"; - cx.state.tokenize = tokenQuasi; - return cont(quasi); - } - } - function arrowBody(type) { - findFatArrow(cx.stream, cx.state); - return pass(type == "{" ? statement : expression); - } - function arrowBodyNoComma(type) { - findFatArrow(cx.stream, cx.state); - return pass(type == "{" ? statement : expressionNoComma); - } - function maybeTarget(noComma) { - return function(type) { - if (type == ".") return cont(noComma ? targetNoComma : target); - else if (type == "variable" && isTS) return cont(maybeTypeArgs, noComma ? maybeoperatorNoComma : maybeoperatorComma) - else return pass(noComma ? expressionNoComma : expression); - }; - } - function target(_, value) { - if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorComma); } - } - function targetNoComma(_, value) { - if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorNoComma); } - } - function maybelabel(type) { - if (type == ":") return cont(poplex, statement); - return pass(maybeoperatorComma, expect(";"), poplex); - } - function property(type) { - if (type == "variable") {cx.marked = "property"; return cont();} - } - function objprop(type, value) { - if (type == "async") { - cx.marked = "property"; - return cont(objprop); - } else if (type == "variable" || cx.style == "keyword") { - cx.marked = "property"; - if (value == "get" || value == "set") return cont(getterSetter); - var m; // Work around fat-arrow-detection complication for detecting typescript typed arrow params - if (isTS && cx.state.fatArrowAt == cx.stream.start && (m = cx.stream.match(/^\s*:\s*/, false))) - cx.state.fatArrowAt = cx.stream.pos + m[0].length; - return cont(afterprop); - } else if (type == "number" || type == "string") { - cx.marked = jsonldMode ? "property" : (cx.style + " property"); - return cont(afterprop); - } else if (type == "jsonld-keyword") { - return cont(afterprop); - } else if (isTS && isModifier(value)) { - cx.marked = "keyword"; - return cont(objprop) - } else if (type == "[") { - return cont(expression, maybetype, expect("]"), afterprop); - } else if (type == "spread") { - return cont(expressionNoComma, afterprop); - } else if (value == "*") { - cx.marked = "keyword"; - return cont(objprop); - } else if (type == ":") { - return pass(afterprop) - } - } - function getterSetter(type) { - if (type != "variable") return pass(afterprop); - cx.marked = "property"; - return cont(functiondef); - } - function afterprop(type) { - if (type == ":") return cont(expressionNoComma); - if (type == "(") return pass(functiondef); - } - function commasep(what, end, sep) { - function proceed(type, value) { - if (sep ? sep.indexOf(type) > -1 : type == ",") { - var lex = cx.state.lexical; - if (lex.info == "call") lex.pos = (lex.pos || 0) + 1; - return cont(function(type, value) { - if (type == end || value == end) return pass() - return pass(what) - }, proceed); - } - if (type == end || value == end) return cont(); - if (sep && sep.indexOf(";") > -1) return pass(what) - return cont(expect(end)); - } - return function(type, value) { - if (type == end || value == end) return cont(); - return pass(what, proceed); - }; - } - function contCommasep(what, end, info) { - for (var i = 3; i < arguments.length; i++) - cx.cc.push(arguments[i]); - return cont(pushlex(end, info), commasep(what, end), poplex); - } - function block(type) { - if (type == "}") return cont(); - return pass(statement, block); - } - function maybetype(type, value) { - if (isTS) { - if (type == ":") return cont(typeexpr); - if (value == "?") return cont(maybetype); - } - } - function maybetypeOrIn(type, value) { - if (isTS && (type == ":" || value == "in")) return cont(typeexpr) - } - function mayberettype(type) { - if (isTS && type == ":") { - if (cx.stream.match(/^\s*\w+\s+is\b/, false)) return cont(expression, isKW, typeexpr) - else return cont(typeexpr) - } - } - function isKW(_, value) { - if (value == "is") { - cx.marked = "keyword"; - return cont() - } - } - function typeexpr(type, value) { - if (value == "keyof" || value == "typeof" || value == "infer" || value == "readonly") { - cx.marked = "keyword"; - return cont(value == "typeof" ? expressionNoComma : typeexpr) - } - if (type == "variable" || value == "void") { - cx.marked = "type"; - return cont(afterType) - } - if (value == "|" || value == "&") return cont(typeexpr) - if (type == "string" || type == "number" || type == "atom") return cont(afterType); - if (type == "[") return cont(pushlex("]"), commasep(typeexpr, "]", ","), poplex, afterType) - if (type == "{") return cont(pushlex("}"), typeprops, poplex, afterType) - if (type == "(") return cont(commasep(typearg, ")"), maybeReturnType, afterType) - if (type == "<") return cont(commasep(typeexpr, ">"), typeexpr) - if (type == "quasi") { return pass(quasiType, afterType); } - } - function maybeReturnType(type) { - if (type == "=>") return cont(typeexpr) - } - function typeprops(type) { - if (type.match(/[\}\)\]]/)) return cont() - if (type == "," || type == ";") return cont(typeprops) - return pass(typeprop, typeprops) - } - function typeprop(type, value) { - if (type == "variable" || cx.style == "keyword") { - cx.marked = "property"; - return cont(typeprop) - } else if (value == "?" || type == "number" || type == "string") { - return cont(typeprop) - } else if (type == ":") { - return cont(typeexpr) - } else if (type == "[") { - return cont(expect("variable"), maybetypeOrIn, expect("]"), typeprop) - } else if (type == "(") { - return pass(functiondecl, typeprop) - } else if (!type.match(/[;\}\)\],]/)) { - return cont() - } - } - function quasiType(type, value) { - if (type != "quasi") return pass(); - if (value.slice(value.length - 2) != "${") return cont(quasiType); - return cont(typeexpr, continueQuasiType); - } - function continueQuasiType(type) { - if (type == "}") { - cx.marked = "string-2"; - cx.state.tokenize = tokenQuasi; - return cont(quasiType); - } - } - function typearg(type, value) { - if (type == "variable" && cx.stream.match(/^\s*[?:]/, false) || value == "?") return cont(typearg) - if (type == ":") return cont(typeexpr) - if (type == "spread") return cont(typearg) - return pass(typeexpr) - } - function afterType(type, value) { - if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType) - if (value == "|" || type == "." || value == "&") return cont(typeexpr) - if (type == "[") return cont(typeexpr, expect("]"), afterType) - if (value == "extends" || value == "implements") { cx.marked = "keyword"; return cont(typeexpr) } - if (value == "?") return cont(typeexpr, expect(":"), typeexpr) - } - function maybeTypeArgs(_, value) { - if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType) - } - function typeparam() { - return pass(typeexpr, maybeTypeDefault) - } - function maybeTypeDefault(_, value) { - if (value == "=") return cont(typeexpr) - } - function vardef(_, value) { - if (value == "enum") {cx.marked = "keyword"; return cont(enumdef)} - return pass(pattern, maybetype, maybeAssign, vardefCont); - } - function pattern(type, value) { - if (isTS && isModifier(value)) { cx.marked = "keyword"; return cont(pattern) } - if (type == "variable") { register(value); return cont(); } - if (type == "spread") return cont(pattern); - if (type == "[") return contCommasep(eltpattern, "]"); - if (type == "{") return contCommasep(proppattern, "}"); - } - function proppattern(type, value) { - if (type == "variable" && !cx.stream.match(/^\s*:/, false)) { - register(value); - return cont(maybeAssign); - } - if (type == "variable") cx.marked = "property"; - if (type == "spread") return cont(pattern); - if (type == "}") return pass(); - if (type == "[") return cont(expression, expect(']'), expect(':'), proppattern); - return cont(expect(":"), pattern, maybeAssign); - } - function eltpattern() { - return pass(pattern, maybeAssign) - } - function maybeAssign(_type, value) { - if (value == "=") return cont(expressionNoComma); - } - function vardefCont(type) { - if (type == ",") return cont(vardef); - } - function maybeelse(type, value) { - if (type == "keyword b" && value == "else") return cont(pushlex("form", "else"), statement, poplex); - } - function forspec(type, value) { - if (value == "await") return cont(forspec); - if (type == "(") return cont(pushlex(")"), forspec1, poplex); - } - function forspec1(type) { - if (type == "var") return cont(vardef, forspec2); - if (type == "variable") return cont(forspec2); - return pass(forspec2) - } - function forspec2(type, value) { - if (type == ")") return cont() - if (type == ";") return cont(forspec2) - if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression, forspec2) } - return pass(expression, forspec2) - } - function functiondef(type, value) { - if (value == "*") {cx.marked = "keyword"; return cont(functiondef);} - if (type == "variable") {register(value); return cont(functiondef);} - if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, statement, popcontext); - if (isTS && value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondef) - } - function functiondecl(type, value) { - if (value == "*") {cx.marked = "keyword"; return cont(functiondecl);} - if (type == "variable") {register(value); return cont(functiondecl);} - if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, popcontext); - if (isTS && value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondecl) - } - function typename(type, value) { - if (type == "keyword" || type == "variable") { - cx.marked = "type"; - return cont(typename) - } else if (value == "<") { - return cont(pushlex(">"), commasep(typeparam, ">"), poplex) - } - } - function funarg(type, value) { - if (value == "@") cont(expression, funarg); - if (type == "spread") return cont(funarg); - if (isTS && isModifier(value)) { cx.marked = "keyword"; return cont(funarg); } - if (isTS && type == "this") return cont(maybetype, maybeAssign) - return pass(pattern, maybetype, maybeAssign); - } - function classExpression(type, value) { - // Class expressions may have an optional name. - if (type == "variable") return className(type, value); - return classNameAfter(type, value); - } - function className(type, value) { - if (type == "variable") {register(value); return cont(classNameAfter);} - } - function classNameAfter(type, value) { - if (value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, classNameAfter) - if (value == "extends" || value == "implements" || (isTS && type == ",")) { - if (value == "implements") cx.marked = "keyword"; - return cont(isTS ? typeexpr : expression, classNameAfter); - } - if (type == "{") return cont(pushlex("}"), classBody, poplex); - } - function classBody(type, value) { - if (type == "async" || - (type == "variable" && - (value == "static" || value == "get" || value == "set" || (isTS && isModifier(value))) && - cx.stream.match(/^\s+[\w$\xa1-\uffff]/, false))) { - cx.marked = "keyword"; - return cont(classBody); - } - if (type == "variable" || cx.style == "keyword") { - cx.marked = "property"; - return cont(classfield, classBody); - } - if (type == "number" || type == "string") return cont(classfield, classBody); - if (type == "[") - return cont(expression, maybetype, expect("]"), classfield, classBody) - if (value == "*") { - cx.marked = "keyword"; - return cont(classBody); - } - if (isTS && type == "(") return pass(functiondecl, classBody) - if (type == ";" || type == ",") return cont(classBody); - if (type == "}") return cont(); - if (value == "@") return cont(expression, classBody) - } - function classfield(type, value) { - if (value == "!") return cont(classfield) - if (value == "?") return cont(classfield) - if (type == ":") return cont(typeexpr, maybeAssign) - if (value == "=") return cont(expressionNoComma) - var context = cx.state.lexical.prev, isInterface = context && context.info == "interface"; - return pass(isInterface ? functiondecl : functiondef) - } - function afterExport(type, value) { - if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); } - if (value == "default") { cx.marked = "keyword"; return cont(expression, expect(";")); } - if (type == "{") return cont(commasep(exportField, "}"), maybeFrom, expect(";")); - return pass(statement); - } - function exportField(type, value) { - if (value == "as") { cx.marked = "keyword"; return cont(expect("variable")); } - if (type == "variable") return pass(expressionNoComma, exportField); - } - function afterImport(type) { - if (type == "string") return cont(); - if (type == "(") return pass(expression); - if (type == ".") return pass(maybeoperatorComma); - return pass(importSpec, maybeMoreImports, maybeFrom); - } - function importSpec(type, value) { - if (type == "{") return contCommasep(importSpec, "}"); - if (type == "variable") register(value); - if (value == "*") cx.marked = "keyword"; - return cont(maybeAs); - } - function maybeMoreImports(type) { - if (type == ",") return cont(importSpec, maybeMoreImports) - } - function maybeAs(_type, value) { - if (value == "as") { cx.marked = "keyword"; return cont(importSpec); } - } - function maybeFrom(_type, value) { - if (value == "from") { cx.marked = "keyword"; return cont(expression); } - } - function arrayLiteral(type) { - if (type == "]") return cont(); - return pass(commasep(expressionNoComma, "]")); - } - function enumdef() { - return pass(pushlex("form"), pattern, expect("{"), pushlex("}"), commasep(enummember, "}"), poplex, poplex) - } - function enummember() { - return pass(pattern, maybeAssign); - } - - function isContinuedStatement(state, textAfter) { - return state.lastType == "operator" || state.lastType == "," || - isOperatorChar.test(textAfter.charAt(0)) || - /[,.]/.test(textAfter.charAt(0)); - } - - function expressionAllowed(stream, state, backUp) { - return state.tokenize == tokenBase && - /^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(state.lastType) || - (state.lastType == "quasi" && /\{\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0)))) - } - - // Interface - - return { - startState: function(basecolumn) { - var state = { - tokenize: tokenBase, - lastType: "sof", - cc: [], - lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false), - localVars: parserConfig.localVars, - context: parserConfig.localVars && new Context(null, null, false), - indented: basecolumn || 0 - }; - if (parserConfig.globalVars && typeof parserConfig.globalVars == "object") - state.globalVars = parserConfig.globalVars; - return state; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (!state.lexical.hasOwnProperty("align")) - state.lexical.align = false; - state.indented = stream.indentation(); - findFatArrow(stream, state); - } - if (state.tokenize != tokenComment && stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - if (type == "comment") return style; - state.lastType = type == "operator" && (content == "++" || content == "--") ? "incdec" : type; - return parseJS(state, style, type, content, stream); - }, - - indent: function(state, textAfter) { - if (state.tokenize == tokenComment || state.tokenize == tokenQuasi) return CodeMirror.Pass; - if (state.tokenize != tokenBase) return 0; - var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, top; - // Kludge to prevent 'maybelse' from blocking lexical scope pops - if (!/^\s*else\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) { - var c = state.cc[i]; - if (c == poplex) lexical = lexical.prev; - else if (c != maybeelse && c != popcontext) break; - } - while ((lexical.type == "stat" || lexical.type == "form") && - (firstChar == "}" || ((top = state.cc[state.cc.length - 1]) && - (top == maybeoperatorComma || top == maybeoperatorNoComma) && - !/^[,\.=+\-*:?[\(]/.test(textAfter)))) - lexical = lexical.prev; - if (statementIndent && lexical.type == ")" && lexical.prev.type == "stat") - lexical = lexical.prev; - var type = lexical.type, closing = firstChar == type; - - if (type == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? lexical.info.length + 1 : 0); - else if (type == "form" && firstChar == "{") return lexical.indented; - else if (type == "form") return lexical.indented + indentUnit; - else if (type == "stat") - return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || indentUnit : 0); - else if (lexical.info == "switch" && !closing && parserConfig.doubleIndentSwitch != false) - return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit); - else if (lexical.align) return lexical.column + (closing ? 0 : 1); - else return lexical.indented + (closing ? 0 : indentUnit); - }, - - electricInput: /^\s*(?:case .*?:|default:|\{|\})$/, - blockCommentStart: jsonMode ? null : "/*", - blockCommentEnd: jsonMode ? null : "*/", - blockCommentContinue: jsonMode ? null : " * ", - lineComment: jsonMode ? null : "//", - fold: "brace", - closeBrackets: "()[]{}''\"\"``", - - helperType: jsonMode ? "json" : "javascript", - jsonldMode: jsonldMode, - jsonMode: jsonMode, - - expressionAllowed: expressionAllowed, - - skipExpression: function(state) { - parseJS(state, "atom", "atom", "true", new CodeMirror.StringStream("", 2, null)); - } - }; -}); - -CodeMirror.registerHelper("wordChars", "javascript", /[\w$]/); - -CodeMirror.defineMIME("text/javascript", "javascript"); -CodeMirror.defineMIME("text/ecmascript", "javascript"); -CodeMirror.defineMIME("application/javascript", "javascript"); -CodeMirror.defineMIME("application/x-javascript", "javascript"); -CodeMirror.defineMIME("application/ecmascript", "javascript"); -CodeMirror.defineMIME("application/json", { name: "javascript", json: true }); -CodeMirror.defineMIME("application/x-json", { name: "javascript", json: true }); -CodeMirror.defineMIME("application/manifest+json", { name: "javascript", json: true }); -CodeMirror.defineMIME("application/ld+json", { name: "javascript", jsonld: true }); -CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true }); -CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true }); - -}); -}); - -export default javascript; diff --git a/docs/_snowpack/pkg/codemirror/mode/pegjs/pegjs.js b/docs/_snowpack/pkg/codemirror/mode/pegjs/pegjs.js deleted file mode 100644 index 1d55e7d9..00000000 --- a/docs/_snowpack/pkg/codemirror/mode/pegjs/pegjs.js +++ /dev/null @@ -1,115 +0,0 @@ -import { c as createCommonjsModule } from '../../../common/_commonjsHelpers-8c19dec8.js'; -import { c as codemirror } from '../../../common/codemirror-d650d44d.js'; -import javascript from '../javascript/javascript.js'; - -var pegjs = createCommonjsModule(function (module, exports) { -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: https://codemirror.net/LICENSE - -(function(mod) { - mod(codemirror, javascript); -})(function(CodeMirror) { - -CodeMirror.defineMode("pegjs", function (config) { - var jsMode = CodeMirror.getMode(config, "javascript"); - - function identifier(stream) { - return stream.match(/^[a-zA-Z_][a-zA-Z0-9_]*/); - } - - return { - startState: function () { - return { - inString: false, - stringType: null, - inComment: false, - inCharacterClass: false, - braced: 0, - lhs: true, - localState: null - }; - }, - token: function (stream, state) { - if (stream) - - //check for state changes - if (!state.inString && !state.inComment && ((stream.peek() == '"') || (stream.peek() == "'"))) { - state.stringType = stream.peek(); - stream.next(); // Skip quote - state.inString = true; // Update state - } - if (!state.inString && !state.inComment && stream.match('/*')) { - state.inComment = true; - } - - //return state - if (state.inString) { - while (state.inString && !stream.eol()) { - if (stream.peek() === state.stringType) { - stream.next(); // Skip quote - state.inString = false; // Clear flag - } else if (stream.peek() === '\\') { - stream.next(); - stream.next(); - } else { - stream.match(/^.[^\\\"\']*/); - } - } - return state.lhs ? "property string" : "string"; // Token style - } else if (state.inComment) { - while (state.inComment && !stream.eol()) { - if (stream.match('*/')) { - state.inComment = false; // Clear flag - } else { - stream.match(/^.[^\*]*/); - } - } - return "comment"; - } else if (state.inCharacterClass) { - while (state.inCharacterClass && !stream.eol()) { - if (!(stream.match(/^[^\]\\]+/) || stream.match(/^\\./))) { - state.inCharacterClass = false; - } - } - } else if (stream.peek() === '[') { - stream.next(); - state.inCharacterClass = true; - return 'bracket'; - } else if (stream.match('//')) { - stream.skipToEnd(); - return "comment"; - } else if (state.braced || stream.peek() === '{') { - if (state.localState === null) { - state.localState = CodeMirror.startState(jsMode); - } - var token = jsMode.token(stream, state.localState); - var text = stream.current(); - if (!token) { - for (var i = 0; i < text.length; i++) { - if (text[i] === '{') { - state.braced++; - } else if (text[i] === '}') { - state.braced--; - } - } } - return token; - } else if (identifier(stream)) { - if (stream.peek() === ':') { - return 'variable'; - } - return 'variable-2'; - } else if (['[', ']', '(', ')'].indexOf(stream.peek()) != -1) { - stream.next(); - return 'bracket'; - } else if (!stream.eatSpace()) { - stream.next(); - } - return null; - } - }; -}, "javascript"); - -}); -}); - -export default pegjs; diff --git a/docs/_snowpack/pkg/codemirror/theme/material.css b/docs/_snowpack/pkg/codemirror/theme/material.css deleted file mode 100644 index a7848499..00000000 --- a/docs/_snowpack/pkg/codemirror/theme/material.css +++ /dev/null @@ -1,141 +0,0 @@ -/* - Name: material - Author: Mattia Astorino (http://github.com/equinusocio) - Website: https://material-theme.site/ -*/ - -.cm-s-material.CodeMirror { - background-color: #263238; - color: #EEFFFF; -} - -.cm-s-material .CodeMirror-gutters { - background: #263238; - color: #546E7A; - border: none; -} - -.cm-s-material .CodeMirror-guttermarker, -.cm-s-material .CodeMirror-guttermarker-subtle, -.cm-s-material .CodeMirror-linenumber { - color: #546E7A; -} - -.cm-s-material .CodeMirror-cursor { - border-left: 1px solid #FFCC00; -} -.cm-s-material.cm-fat-cursor .CodeMirror-cursor { - background-color: #5d6d5c80 !important; -} -.cm-s-material .cm-animate-fat-cursor { - background-color: #5d6d5c80 !important; -} - -.cm-s-material div.CodeMirror-selected { - background: rgba(128, 203, 196, 0.2); -} - -.cm-s-material.CodeMirror-focused div.CodeMirror-selected { - background: rgba(128, 203, 196, 0.2); -} - -.cm-s-material .CodeMirror-line::selection, -.cm-s-material .CodeMirror-line>span::selection, -.cm-s-material .CodeMirror-line>span>span::selection { - background: rgba(128, 203, 196, 0.2); -} - -.cm-s-material .CodeMirror-line::-moz-selection, -.cm-s-material .CodeMirror-line>span::-moz-selection, -.cm-s-material .CodeMirror-line>span>span::-moz-selection { - background: rgba(128, 203, 196, 0.2); -} - -.cm-s-material .CodeMirror-activeline-background { - background: rgba(0, 0, 0, 0.5); -} - -.cm-s-material .cm-keyword { - color: #C792EA; -} - -.cm-s-material .cm-operator { - color: #89DDFF; -} - -.cm-s-material .cm-variable-2 { - color: #EEFFFF; -} - -.cm-s-material .cm-variable-3, -.cm-s-material .cm-type { - color: #f07178; -} - -.cm-s-material .cm-builtin { - color: #FFCB6B; -} - -.cm-s-material .cm-atom { - color: #F78C6C; -} - -.cm-s-material .cm-number { - color: #FF5370; -} - -.cm-s-material .cm-def { - color: #82AAFF; -} - -.cm-s-material .cm-string { - color: #C3E88D; -} - -.cm-s-material .cm-string-2 { - color: #f07178; -} - -.cm-s-material .cm-comment { - color: #546E7A; -} - -.cm-s-material .cm-variable { - color: #f07178; -} - -.cm-s-material .cm-tag { - color: #FF5370; -} - -.cm-s-material .cm-meta { - color: #FFCB6B; -} - -.cm-s-material .cm-attribute { - color: #C792EA; -} - -.cm-s-material .cm-property { - color: #C792EA; -} - -.cm-s-material .cm-qualifier { - color: #DECB6B; -} - -.cm-s-material .cm-variable-3, -.cm-s-material .cm-type { - color: #DECB6B; -} - - -.cm-s-material .cm-error { - color: rgba(255, 255, 255, 1.0); - background-color: #FF5370; -} - -.cm-s-material .CodeMirror-matchingbracket { - text-decoration: underline; - color: white !important; -} diff --git a/docs/_snowpack/pkg/codemirror/theme/material.css.proxy.js b/docs/_snowpack/pkg/codemirror/theme/material.css.proxy.js deleted file mode 100644 index 1b1356aa..00000000 --- a/docs/_snowpack/pkg/codemirror/theme/material.css.proxy.js +++ /dev/null @@ -1,10 +0,0 @@ -// [snowpack] add styles to the page (skip if no document exists) -if (typeof document !== 'undefined') { - const code = "/*\n Name: material\n Author: Mattia Astorino (http://github.com/equinusocio)\n Website: https://material-theme.site/\n*/\n\n.cm-s-material.CodeMirror {\n background-color: #263238;\n color: #EEFFFF;\n}\n\n.cm-s-material .CodeMirror-gutters {\n background: #263238;\n color: #546E7A;\n border: none;\n}\n\n.cm-s-material .CodeMirror-guttermarker,\n.cm-s-material .CodeMirror-guttermarker-subtle,\n.cm-s-material .CodeMirror-linenumber {\n color: #546E7A;\n}\n\n.cm-s-material .CodeMirror-cursor {\n border-left: 1px solid #FFCC00;\n}\n.cm-s-material.cm-fat-cursor .CodeMirror-cursor {\n background-color: #5d6d5c80 !important;\n}\n.cm-s-material .cm-animate-fat-cursor {\n background-color: #5d6d5c80 !important;\n}\n\n.cm-s-material div.CodeMirror-selected {\n background: rgba(128, 203, 196, 0.2);\n}\n\n.cm-s-material.CodeMirror-focused div.CodeMirror-selected {\n background: rgba(128, 203, 196, 0.2);\n}\n\n.cm-s-material .CodeMirror-line::selection,\n.cm-s-material .CodeMirror-line>span::selection,\n.cm-s-material .CodeMirror-line>span>span::selection {\n background: rgba(128, 203, 196, 0.2);\n}\n\n.cm-s-material .CodeMirror-line::-moz-selection,\n.cm-s-material .CodeMirror-line>span::-moz-selection,\n.cm-s-material .CodeMirror-line>span>span::-moz-selection {\n background: rgba(128, 203, 196, 0.2);\n}\n\n.cm-s-material .CodeMirror-activeline-background {\n background: rgba(0, 0, 0, 0.5);\n}\n\n.cm-s-material .cm-keyword {\n color: #C792EA;\n}\n\n.cm-s-material .cm-operator {\n color: #89DDFF;\n}\n\n.cm-s-material .cm-variable-2 {\n color: #EEFFFF;\n}\n\n.cm-s-material .cm-variable-3,\n.cm-s-material .cm-type {\n color: #f07178;\n}\n\n.cm-s-material .cm-builtin {\n color: #FFCB6B;\n}\n\n.cm-s-material .cm-atom {\n color: #F78C6C;\n}\n\n.cm-s-material .cm-number {\n color: #FF5370;\n}\n\n.cm-s-material .cm-def {\n color: #82AAFF;\n}\n\n.cm-s-material .cm-string {\n color: #C3E88D;\n}\n\n.cm-s-material .cm-string-2 {\n color: #f07178;\n}\n\n.cm-s-material .cm-comment {\n color: #546E7A;\n}\n\n.cm-s-material .cm-variable {\n color: #f07178;\n}\n\n.cm-s-material .cm-tag {\n color: #FF5370;\n}\n\n.cm-s-material .cm-meta {\n color: #FFCB6B;\n}\n\n.cm-s-material .cm-attribute {\n color: #C792EA;\n}\n\n.cm-s-material .cm-property {\n color: #C792EA;\n}\n\n.cm-s-material .cm-qualifier {\n color: #DECB6B;\n}\n\n.cm-s-material .cm-variable-3,\n.cm-s-material .cm-type {\n color: #DECB6B;\n}\n\n\n.cm-s-material .cm-error {\n color: rgba(255, 255, 255, 1.0);\n background-color: #FF5370;\n}\n\n.cm-s-material .CodeMirror-matchingbracket {\n text-decoration: underline;\n color: white !important;\n}\n"; - - const styleEl = document.createElement("style"); - const codeEl = document.createTextNode(code); - styleEl.type = 'text/css'; - styleEl.appendChild(codeEl); - document.head.appendChild(styleEl); -} \ No newline at end of file diff --git a/docs/_snowpack/pkg/common/_commonjsHelpers-8c19dec8.js b/docs/_snowpack/pkg/common/_commonjsHelpers-8c19dec8.js deleted file mode 100644 index e88d96fb..00000000 --- a/docs/_snowpack/pkg/common/_commonjsHelpers-8c19dec8.js +++ /dev/null @@ -1,21 +0,0 @@ -var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; - -function getDefaultExportFromCjs (x) { - return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; -} - -function createCommonjsModule(fn, basedir, module) { - return module = { - path: basedir, - exports: {}, - require: function (path, base) { - return commonjsRequire(path, (base === undefined || base === null) ? module.path : base); - } - }, fn(module, module.exports), module.exports; -} - -function commonjsRequire () { - throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs'); -} - -export { commonjsGlobal as a, createCommonjsModule as c, getDefaultExportFromCjs as g }; diff --git a/docs/_snowpack/pkg/common/codemirror-d650d44d.js b/docs/_snowpack/pkg/common/codemirror-d650d44d.js deleted file mode 100644 index 36851ad2..00000000 --- a/docs/_snowpack/pkg/common/codemirror-d650d44d.js +++ /dev/null @@ -1,9852 +0,0 @@ -import { c as createCommonjsModule, a as commonjsGlobal } from './_commonjsHelpers-8c19dec8.js'; - -var codemirror = createCommonjsModule(function (module, exports) { -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: https://codemirror.net/LICENSE - -// This is CodeMirror (https://codemirror.net), a code editor -// implemented in JavaScript on top of the browser's DOM. -// -// You can find some technical background for some of the code below -// at http://marijnhaverbeke.nl/blog/#cm-internals . - -(function (global, factory) { - module.exports = factory() ; -}(commonjsGlobal, (function () { - // Kludges for bugs and behavior differences that can't be feature - // detected are enabled based on userAgent etc sniffing. - var userAgent = navigator.userAgent; - var platform = navigator.platform; - - var gecko = /gecko\/\d/i.test(userAgent); - var ie_upto10 = /MSIE \d/.test(userAgent); - var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent); - var edge = /Edge\/(\d+)/.exec(userAgent); - var ie = ie_upto10 || ie_11up || edge; - var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]); - var webkit = !edge && /WebKit\//.test(userAgent); - var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent); - var chrome = !edge && /Chrome\//.test(userAgent); - var presto = /Opera\//.test(userAgent); - var safari = /Apple Computer/.test(navigator.vendor); - var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent); - var phantom = /PhantomJS/.test(userAgent); - - var ios = safari && (/Mobile\/\w+/.test(userAgent) || navigator.maxTouchPoints > 2); - var android = /Android/.test(userAgent); - // This is woefully incomplete. Suggestions for alternative methods welcome. - var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent); - var mac = ios || /Mac/.test(platform); - var chromeOS = /\bCrOS\b/.test(userAgent); - var windows = /win/i.test(platform); - - var presto_version = presto && userAgent.match(/Version\/(\d*\.\d*)/); - if (presto_version) { presto_version = Number(presto_version[1]); } - if (presto_version && presto_version >= 15) { presto = false; webkit = true; } - // Some browsers use the wrong event properties to signal cmd/ctrl on OS X - var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11)); - var captureRightClick = gecko || (ie && ie_version >= 9); - - function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*") } - - var rmClass = function(node, cls) { - var current = node.className; - var match = classTest(cls).exec(current); - if (match) { - var after = current.slice(match.index + match[0].length); - node.className = current.slice(0, match.index) + (after ? match[1] + after : ""); - } - }; - - function removeChildren(e) { - for (var count = e.childNodes.length; count > 0; --count) - { e.removeChild(e.firstChild); } - return e - } - - function removeChildrenAndAdd(parent, e) { - return removeChildren(parent).appendChild(e) - } - - function elt(tag, content, className, style) { - var e = document.createElement(tag); - if (className) { e.className = className; } - if (style) { e.style.cssText = style; } - if (typeof content == "string") { e.appendChild(document.createTextNode(content)); } - else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } } - return e - } - // wrapper for elt, which removes the elt from the accessibility tree - function eltP(tag, content, className, style) { - var e = elt(tag, content, className, style); - e.setAttribute("role", "presentation"); - return e - } - - var range; - if (document.createRange) { range = function(node, start, end, endNode) { - var r = document.createRange(); - r.setEnd(endNode || node, end); - r.setStart(node, start); - return r - }; } - else { range = function(node, start, end) { - var r = document.body.createTextRange(); - try { r.moveToElementText(node.parentNode); } - catch(e) { return r } - r.collapse(true); - r.moveEnd("character", end); - r.moveStart("character", start); - return r - }; } - - function contains(parent, child) { - if (child.nodeType == 3) // Android browser always returns false when child is a textnode - { child = child.parentNode; } - if (parent.contains) - { return parent.contains(child) } - do { - if (child.nodeType == 11) { child = child.host; } - if (child == parent) { return true } - } while (child = child.parentNode) - } - - function activeElt() { - // IE and Edge may throw an "Unspecified Error" when accessing document.activeElement. - // IE < 10 will throw when accessed while the page is loading or in an iframe. - // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable. - var activeElement; - try { - activeElement = document.activeElement; - } catch(e) { - activeElement = document.body || null; - } - while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement) - { activeElement = activeElement.shadowRoot.activeElement; } - return activeElement - } - - function addClass(node, cls) { - var current = node.className; - if (!classTest(cls).test(current)) { node.className += (current ? " " : "") + cls; } - } - function joinClasses(a, b) { - var as = a.split(" "); - for (var i = 0; i < as.length; i++) - { if (as[i] && !classTest(as[i]).test(b)) { b += " " + as[i]; } } - return b - } - - var selectInput = function(node) { node.select(); }; - if (ios) // Mobile Safari apparently has a bug where select() is broken. - { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; } - else if (ie) // Suppress mysterious IE10 errors - { selectInput = function(node) { try { node.select(); } catch(_e) {} }; } - - function bind(f) { - var args = Array.prototype.slice.call(arguments, 1); - return function(){return f.apply(null, args)} - } - - function copyObj(obj, target, overwrite) { - if (!target) { target = {}; } - for (var prop in obj) - { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop))) - { target[prop] = obj[prop]; } } - return target - } - - // Counts the column offset in a string, taking tabs into account. - // Used mostly to find indentation. - function countColumn(string, end, tabSize, startIndex, startValue) { - if (end == null) { - end = string.search(/[^\s\u00a0]/); - if (end == -1) { end = string.length; } - } - for (var i = startIndex || 0, n = startValue || 0;;) { - var nextTab = string.indexOf("\t", i); - if (nextTab < 0 || nextTab >= end) - { return n + (end - i) } - n += nextTab - i; - n += tabSize - (n % tabSize); - i = nextTab + 1; - } - } - - var Delayed = function() { - this.id = null; - this.f = null; - this.time = 0; - this.handler = bind(this.onTimeout, this); - }; - Delayed.prototype.onTimeout = function (self) { - self.id = 0; - if (self.time <= +new Date) { - self.f(); - } else { - setTimeout(self.handler, self.time - +new Date); - } - }; - Delayed.prototype.set = function (ms, f) { - this.f = f; - var time = +new Date + ms; - if (!this.id || time < this.time) { - clearTimeout(this.id); - this.id = setTimeout(this.handler, ms); - this.time = time; - } - }; - - function indexOf(array, elt) { - for (var i = 0; i < array.length; ++i) - { if (array[i] == elt) { return i } } - return -1 - } - - // Number of pixels added to scroller and sizer to hide scrollbar - var scrollerGap = 50; - - // Returned or thrown by various protocols to signal 'I'm not - // handling this'. - var Pass = {toString: function(){return "CodeMirror.Pass"}}; - - // Reused option objects for setSelection & friends - var sel_dontScroll = {scroll: false}, sel_mouse = {origin: "*mouse"}, sel_move = {origin: "+move"}; - - // The inverse of countColumn -- find the offset that corresponds to - // a particular column. - function findColumn(string, goal, tabSize) { - for (var pos = 0, col = 0;;) { - var nextTab = string.indexOf("\t", pos); - if (nextTab == -1) { nextTab = string.length; } - var skipped = nextTab - pos; - if (nextTab == string.length || col + skipped >= goal) - { return pos + Math.min(skipped, goal - col) } - col += nextTab - pos; - col += tabSize - (col % tabSize); - pos = nextTab + 1; - if (col >= goal) { return pos } - } - } - - var spaceStrs = [""]; - function spaceStr(n) { - while (spaceStrs.length <= n) - { spaceStrs.push(lst(spaceStrs) + " "); } - return spaceStrs[n] - } - - function lst(arr) { return arr[arr.length-1] } - - function map(array, f) { - var out = []; - for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i); } - return out - } - - function insertSorted(array, value, score) { - var pos = 0, priority = score(value); - while (pos < array.length && score(array[pos]) <= priority) { pos++; } - array.splice(pos, 0, value); - } - - function nothing() {} - - function createObj(base, props) { - var inst; - if (Object.create) { - inst = Object.create(base); - } else { - nothing.prototype = base; - inst = new nothing(); - } - if (props) { copyObj(props, inst); } - return inst - } - - var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; - function isWordCharBasic(ch) { - return /\w/.test(ch) || ch > "\x80" && - (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)) - } - function isWordChar(ch, helper) { - if (!helper) { return isWordCharBasic(ch) } - if (helper.source.indexOf("\\w") > -1 && isWordCharBasic(ch)) { return true } - return helper.test(ch) - } - - function isEmpty(obj) { - for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } } - return true - } - - // Extending unicode characters. A series of a non-extending char + - // any number of extending chars is treated as a single unit as far - // as editing and measuring is concerned. This is not fully correct, - // since some scripts/fonts/browsers also treat other configurations - // of code points as a group. - var extendingChars = /[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/; - function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) } - - // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range. - function skipExtendingChars(str, pos, dir) { - while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; } - return pos - } - - // Returns the value from the range [`from`; `to`] that satisfies - // `pred` and is closest to `from`. Assumes that at least `to` - // satisfies `pred`. Supports `from` being greater than `to`. - function findFirst(pred, from, to) { - // At any point we are certain `to` satisfies `pred`, don't know - // whether `from` does. - var dir = from > to ? -1 : 1; - for (;;) { - if (from == to) { return from } - var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF); - if (mid == from) { return pred(mid) ? from : to } - if (pred(mid)) { to = mid; } - else { from = mid + dir; } - } - } - - // BIDI HELPERS - - function iterateBidiSections(order, from, to, f) { - if (!order) { return f(from, to, "ltr", 0) } - var found = false; - for (var i = 0; i < order.length; ++i) { - var part = order[i]; - if (part.from < to && part.to > from || from == to && part.to == from) { - f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr", i); - found = true; - } - } - if (!found) { f(from, to, "ltr"); } - } - - var bidiOther = null; - function getBidiPartAt(order, ch, sticky) { - var found; - bidiOther = null; - for (var i = 0; i < order.length; ++i) { - var cur = order[i]; - if (cur.from < ch && cur.to > ch) { return i } - if (cur.to == ch) { - if (cur.from != cur.to && sticky == "before") { found = i; } - else { bidiOther = i; } - } - if (cur.from == ch) { - if (cur.from != cur.to && sticky != "before") { found = i; } - else { bidiOther = i; } - } - } - return found != null ? found : bidiOther - } - - // Bidirectional ordering algorithm - // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm - // that this (partially) implements. - - // One-char codes used for character types: - // L (L): Left-to-Right - // R (R): Right-to-Left - // r (AL): Right-to-Left Arabic - // 1 (EN): European Number - // + (ES): European Number Separator - // % (ET): European Number Terminator - // n (AN): Arabic Number - // , (CS): Common Number Separator - // m (NSM): Non-Spacing Mark - // b (BN): Boundary Neutral - // s (B): Paragraph Separator - // t (S): Segment Separator - // w (WS): Whitespace - // N (ON): Other Neutrals - - // Returns null if characters are ordered as they appear - // (left-to-right), or an array of sections ({from, to, level} - // objects) in the order in which they occur visually. - var bidiOrdering = (function() { - // Character types for codepoints 0 to 0xff - var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN"; - // Character types for codepoints 0x600 to 0x6f9 - var arabicTypes = "nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111"; - function charType(code) { - if (code <= 0xf7) { return lowTypes.charAt(code) } - else if (0x590 <= code && code <= 0x5f4) { return "R" } - else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) } - else if (0x6ee <= code && code <= 0x8ac) { return "r" } - else if (0x2000 <= code && code <= 0x200b) { return "w" } - else if (code == 0x200c) { return "b" } - else { return "L" } - } - - var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/; - var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/; - - function BidiSpan(level, from, to) { - this.level = level; - this.from = from; this.to = to; - } - - return function(str, direction) { - var outerType = direction == "ltr" ? "L" : "R"; - - if (str.length == 0 || direction == "ltr" && !bidiRE.test(str)) { return false } - var len = str.length, types = []; - for (var i = 0; i < len; ++i) - { types.push(charType(str.charCodeAt(i))); } - - // W1. Examine each non-spacing mark (NSM) in the level run, and - // change the type of the NSM to the type of the previous - // character. If the NSM is at the start of the level run, it will - // get the type of sor. - for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) { - var type = types[i$1]; - if (type == "m") { types[i$1] = prev; } - else { prev = type; } - } - - // W2. Search backwards from each instance of a European number - // until the first strong type (R, L, AL, or sor) is found. If an - // AL is found, change the type of the European number to Arabic - // number. - // W3. Change all ALs to R. - for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) { - var type$1 = types[i$2]; - if (type$1 == "1" && cur == "r") { types[i$2] = "n"; } - else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == "r") { types[i$2] = "R"; } } - } - - // W4. A single European separator between two European numbers - // changes to a European number. A single common separator between - // two numbers of the same type changes to that type. - for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) { - var type$2 = types[i$3]; - if (type$2 == "+" && prev$1 == "1" && types[i$3+1] == "1") { types[i$3] = "1"; } - else if (type$2 == "," && prev$1 == types[i$3+1] && - (prev$1 == "1" || prev$1 == "n")) { types[i$3] = prev$1; } - prev$1 = type$2; - } - - // W5. A sequence of European terminators adjacent to European - // numbers changes to all European numbers. - // W6. Otherwise, separators and terminators change to Other - // Neutral. - for (var i$4 = 0; i$4 < len; ++i$4) { - var type$3 = types[i$4]; - if (type$3 == ",") { types[i$4] = "N"; } - else if (type$3 == "%") { - var end = (void 0); - for (end = i$4 + 1; end < len && types[end] == "%"; ++end) {} - var replace = (i$4 && types[i$4-1] == "!") || (end < len && types[end] == "1") ? "1" : "N"; - for (var j = i$4; j < end; ++j) { types[j] = replace; } - i$4 = end - 1; - } - } - - // W7. Search backwards from each instance of a European number - // until the first strong type (R, L, or sor) is found. If an L is - // found, then change the type of the European number to L. - for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) { - var type$4 = types[i$5]; - if (cur$1 == "L" && type$4 == "1") { types[i$5] = "L"; } - else if (isStrong.test(type$4)) { cur$1 = type$4; } - } - - // N1. A sequence of neutrals takes the direction of the - // surrounding strong text if the text on both sides has the same - // direction. European and Arabic numbers act as if they were R in - // terms of their influence on neutrals. Start-of-level-run (sor) - // and end-of-level-run (eor) are used at level run boundaries. - // N2. Any remaining neutrals take the embedding direction. - for (var i$6 = 0; i$6 < len; ++i$6) { - if (isNeutral.test(types[i$6])) { - var end$1 = (void 0); - for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {} - var before = (i$6 ? types[i$6-1] : outerType) == "L"; - var after = (end$1 < len ? types[end$1] : outerType) == "L"; - var replace$1 = before == after ? (before ? "L" : "R") : outerType; - for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1; } - i$6 = end$1 - 1; - } - } - - // Here we depart from the documented algorithm, in order to avoid - // building up an actual levels array. Since there are only three - // levels (0, 1, 2) in an implementation that doesn't take - // explicit embedding into account, we can build up the order on - // the fly, without following the level-based algorithm. - var order = [], m; - for (var i$7 = 0; i$7 < len;) { - if (countsAsLeft.test(types[i$7])) { - var start = i$7; - for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {} - order.push(new BidiSpan(0, start, i$7)); - } else { - var pos = i$7, at = order.length, isRTL = direction == "rtl" ? 1 : 0; - for (++i$7; i$7 < len && types[i$7] != "L"; ++i$7) {} - for (var j$2 = pos; j$2 < i$7;) { - if (countsAsNum.test(types[j$2])) { - if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); at += isRTL; } - var nstart = j$2; - for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {} - order.splice(at, 0, new BidiSpan(2, nstart, j$2)); - at += isRTL; - pos = j$2; - } else { ++j$2; } - } - if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)); } - } - } - if (direction == "ltr") { - if (order[0].level == 1 && (m = str.match(/^\s+/))) { - order[0].from = m[0].length; - order.unshift(new BidiSpan(0, 0, m[0].length)); - } - if (lst(order).level == 1 && (m = str.match(/\s+$/))) { - lst(order).to -= m[0].length; - order.push(new BidiSpan(0, len - m[0].length, len)); - } - } - - return direction == "rtl" ? order.reverse() : order - } - })(); - - // Get the bidi ordering for the given line (and cache it). Returns - // false for lines that are fully left-to-right, and an array of - // BidiSpan objects otherwise. - function getOrder(line, direction) { - var order = line.order; - if (order == null) { order = line.order = bidiOrdering(line.text, direction); } - return order - } - - // EVENT HANDLING - - // Lightweight event framework. on/off also work on DOM nodes, - // registering native DOM handlers. - - var noHandlers = []; - - var on = function(emitter, type, f) { - if (emitter.addEventListener) { - emitter.addEventListener(type, f, false); - } else if (emitter.attachEvent) { - emitter.attachEvent("on" + type, f); - } else { - var map = emitter._handlers || (emitter._handlers = {}); - map[type] = (map[type] || noHandlers).concat(f); - } - }; - - function getHandlers(emitter, type) { - return emitter._handlers && emitter._handlers[type] || noHandlers - } - - function off(emitter, type, f) { - if (emitter.removeEventListener) { - emitter.removeEventListener(type, f, false); - } else if (emitter.detachEvent) { - emitter.detachEvent("on" + type, f); - } else { - var map = emitter._handlers, arr = map && map[type]; - if (arr) { - var index = indexOf(arr, f); - if (index > -1) - { map[type] = arr.slice(0, index).concat(arr.slice(index + 1)); } - } - } - } - - function signal(emitter, type /*, values...*/) { - var handlers = getHandlers(emitter, type); - if (!handlers.length) { return } - var args = Array.prototype.slice.call(arguments, 2); - for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args); } - } - - // The DOM events that CodeMirror handles can be overridden by - // registering a (non-DOM) handler on the editor for the event name, - // and preventDefault-ing the event in that handler. - function signalDOMEvent(cm, e, override) { - if (typeof e == "string") - { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; } - signal(cm, override || e.type, cm, e); - return e_defaultPrevented(e) || e.codemirrorIgnore - } - - function signalCursorActivity(cm) { - var arr = cm._handlers && cm._handlers.cursorActivity; - if (!arr) { return } - var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []); - for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1) - { set.push(arr[i]); } } - } - - function hasHandler(emitter, type) { - return getHandlers(emitter, type).length > 0 - } - - // Add on and off methods to a constructor's prototype, to make - // registering events on such objects more convenient. - function eventMixin(ctor) { - ctor.prototype.on = function(type, f) {on(this, type, f);}; - ctor.prototype.off = function(type, f) {off(this, type, f);}; - } - - // Due to the fact that we still support jurassic IE versions, some - // compatibility wrappers are needed. - - function e_preventDefault(e) { - if (e.preventDefault) { e.preventDefault(); } - else { e.returnValue = false; } - } - function e_stopPropagation(e) { - if (e.stopPropagation) { e.stopPropagation(); } - else { e.cancelBubble = true; } - } - function e_defaultPrevented(e) { - return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false - } - function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);} - - function e_target(e) {return e.target || e.srcElement} - function e_button(e) { - var b = e.which; - if (b == null) { - if (e.button & 1) { b = 1; } - else if (e.button & 2) { b = 3; } - else if (e.button & 4) { b = 2; } - } - if (mac && e.ctrlKey && b == 1) { b = 3; } - return b - } - - // Detect drag-and-drop - var dragAndDrop = function() { - // There is *some* kind of drag-and-drop support in IE6-8, but I - // couldn't get it to work yet. - if (ie && ie_version < 9) { return false } - var div = elt('div'); - return "draggable" in div || "dragDrop" in div - }(); - - var zwspSupported; - function zeroWidthElement(measure) { - if (zwspSupported == null) { - var test = elt("span", "\u200b"); - removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")])); - if (measure.firstChild.offsetHeight != 0) - { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); } - } - var node = zwspSupported ? elt("span", "\u200b") : - elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px"); - node.setAttribute("cm-text", ""); - return node - } - - // Feature-detect IE's crummy client rect reporting for bidi text - var badBidiRects; - function hasBadBidiRects(measure) { - if (badBidiRects != null) { return badBidiRects } - var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA")); - var r0 = range(txt, 0, 1).getBoundingClientRect(); - var r1 = range(txt, 1, 2).getBoundingClientRect(); - removeChildren(measure); - if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780) - return badBidiRects = (r1.right - r0.right < 3) - } - - // See if "".split is the broken IE version, if so, provide an - // alternative way to split lines. - var splitLinesAuto = "\n\nb".split(/\n/).length != 3 ? function (string) { - var pos = 0, result = [], l = string.length; - while (pos <= l) { - var nl = string.indexOf("\n", pos); - if (nl == -1) { nl = string.length; } - var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl); - var rt = line.indexOf("\r"); - if (rt != -1) { - result.push(line.slice(0, rt)); - pos += rt + 1; - } else { - result.push(line); - pos = nl + 1; - } - } - return result - } : function (string) { return string.split(/\r\n?|\n/); }; - - var hasSelection = window.getSelection ? function (te) { - try { return te.selectionStart != te.selectionEnd } - catch(e) { return false } - } : function (te) { - var range; - try {range = te.ownerDocument.selection.createRange();} - catch(e) {} - if (!range || range.parentElement() != te) { return false } - return range.compareEndPoints("StartToEnd", range) != 0 - }; - - var hasCopyEvent = (function () { - var e = elt("div"); - if ("oncopy" in e) { return true } - e.setAttribute("oncopy", "return;"); - return typeof e.oncopy == "function" - })(); - - var badZoomedRects = null; - function hasBadZoomedRects(measure) { - if (badZoomedRects != null) { return badZoomedRects } - var node = removeChildrenAndAdd(measure, elt("span", "x")); - var normal = node.getBoundingClientRect(); - var fromRange = range(node, 0, 1).getBoundingClientRect(); - return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1 - } - - // Known modes, by name and by MIME - var modes = {}, mimeModes = {}; - - // Extra arguments are stored as the mode's dependencies, which is - // used by (legacy) mechanisms like loadmode.js to automatically - // load a mode. (Preferred mechanism is the require/define calls.) - function defineMode(name, mode) { - if (arguments.length > 2) - { mode.dependencies = Array.prototype.slice.call(arguments, 2); } - modes[name] = mode; - } - - function defineMIME(mime, spec) { - mimeModes[mime] = spec; - } - - // Given a MIME type, a {name, ...options} config object, or a name - // string, return a mode config object. - function resolveMode(spec) { - if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) { - spec = mimeModes[spec]; - } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) { - var found = mimeModes[spec.name]; - if (typeof found == "string") { found = {name: found}; } - spec = createObj(found, spec); - spec.name = found.name; - } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) { - return resolveMode("application/xml") - } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+json$/.test(spec)) { - return resolveMode("application/json") - } - if (typeof spec == "string") { return {name: spec} } - else { return spec || {name: "null"} } - } - - // Given a mode spec (anything that resolveMode accepts), find and - // initialize an actual mode object. - function getMode(options, spec) { - spec = resolveMode(spec); - var mfactory = modes[spec.name]; - if (!mfactory) { return getMode(options, "text/plain") } - var modeObj = mfactory(options, spec); - if (modeExtensions.hasOwnProperty(spec.name)) { - var exts = modeExtensions[spec.name]; - for (var prop in exts) { - if (!exts.hasOwnProperty(prop)) { continue } - if (modeObj.hasOwnProperty(prop)) { modeObj["_" + prop] = modeObj[prop]; } - modeObj[prop] = exts[prop]; - } - } - modeObj.name = spec.name; - if (spec.helperType) { modeObj.helperType = spec.helperType; } - if (spec.modeProps) { for (var prop$1 in spec.modeProps) - { modeObj[prop$1] = spec.modeProps[prop$1]; } } - - return modeObj - } - - // This can be used to attach properties to mode objects from - // outside the actual mode definition. - var modeExtensions = {}; - function extendMode(mode, properties) { - var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {}); - copyObj(properties, exts); - } - - function copyState(mode, state) { - if (state === true) { return state } - if (mode.copyState) { return mode.copyState(state) } - var nstate = {}; - for (var n in state) { - var val = state[n]; - if (val instanceof Array) { val = val.concat([]); } - nstate[n] = val; - } - return nstate - } - - // Given a mode and a state (for that mode), find the inner mode and - // state at the position that the state refers to. - function innerMode(mode, state) { - var info; - while (mode.innerMode) { - info = mode.innerMode(state); - if (!info || info.mode == mode) { break } - state = info.state; - mode = info.mode; - } - return info || {mode: mode, state: state} - } - - function startState(mode, a1, a2) { - return mode.startState ? mode.startState(a1, a2) : true - } - - // STRING STREAM - - // Fed to the mode parsers, provides helper functions to make - // parsers more succinct. - - var StringStream = function(string, tabSize, lineOracle) { - this.pos = this.start = 0; - this.string = string; - this.tabSize = tabSize || 8; - this.lastColumnPos = this.lastColumnValue = 0; - this.lineStart = 0; - this.lineOracle = lineOracle; - }; - - StringStream.prototype.eol = function () {return this.pos >= this.string.length}; - StringStream.prototype.sol = function () {return this.pos == this.lineStart}; - StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined}; - StringStream.prototype.next = function () { - if (this.pos < this.string.length) - { return this.string.charAt(this.pos++) } - }; - StringStream.prototype.eat = function (match) { - var ch = this.string.charAt(this.pos); - var ok; - if (typeof match == "string") { ok = ch == match; } - else { ok = ch && (match.test ? match.test(ch) : match(ch)); } - if (ok) {++this.pos; return ch} - }; - StringStream.prototype.eatWhile = function (match) { - var start = this.pos; - while (this.eat(match)){} - return this.pos > start - }; - StringStream.prototype.eatSpace = function () { - var start = this.pos; - while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) { ++this.pos; } - return this.pos > start - }; - StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;}; - StringStream.prototype.skipTo = function (ch) { - var found = this.string.indexOf(ch, this.pos); - if (found > -1) {this.pos = found; return true} - }; - StringStream.prototype.backUp = function (n) {this.pos -= n;}; - StringStream.prototype.column = function () { - if (this.lastColumnPos < this.start) { - this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue); - this.lastColumnPos = this.start; - } - return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0) - }; - StringStream.prototype.indentation = function () { - return countColumn(this.string, null, this.tabSize) - - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0) - }; - StringStream.prototype.match = function (pattern, consume, caseInsensitive) { - if (typeof pattern == "string") { - var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; }; - var substr = this.string.substr(this.pos, pattern.length); - if (cased(substr) == cased(pattern)) { - if (consume !== false) { this.pos += pattern.length; } - return true - } - } else { - var match = this.string.slice(this.pos).match(pattern); - if (match && match.index > 0) { return null } - if (match && consume !== false) { this.pos += match[0].length; } - return match - } - }; - StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)}; - StringStream.prototype.hideFirstChars = function (n, inner) { - this.lineStart += n; - try { return inner() } - finally { this.lineStart -= n; } - }; - StringStream.prototype.lookAhead = function (n) { - var oracle = this.lineOracle; - return oracle && oracle.lookAhead(n) - }; - StringStream.prototype.baseToken = function () { - var oracle = this.lineOracle; - return oracle && oracle.baseToken(this.pos) - }; - - // Find the line object corresponding to the given line number. - function getLine(doc, n) { - n -= doc.first; - if (n < 0 || n >= doc.size) { throw new Error("There is no line " + (n + doc.first) + " in the document.") } - var chunk = doc; - while (!chunk.lines) { - for (var i = 0;; ++i) { - var child = chunk.children[i], sz = child.chunkSize(); - if (n < sz) { chunk = child; break } - n -= sz; - } - } - return chunk.lines[n] - } - - // Get the part of a document between two positions, as an array of - // strings. - function getBetween(doc, start, end) { - var out = [], n = start.line; - doc.iter(start.line, end.line + 1, function (line) { - var text = line.text; - if (n == end.line) { text = text.slice(0, end.ch); } - if (n == start.line) { text = text.slice(start.ch); } - out.push(text); - ++n; - }); - return out - } - // Get the lines between from and to, as array of strings. - function getLines(doc, from, to) { - var out = []; - doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value - return out - } - - // Update the height of a line, propagating the height change - // upwards to parent nodes. - function updateLineHeight(line, height) { - var diff = height - line.height; - if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } } - } - - // Given a line object, find its line number by walking up through - // its parent links. - function lineNo(line) { - if (line.parent == null) { return null } - var cur = line.parent, no = indexOf(cur.lines, line); - for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) { - for (var i = 0;; ++i) { - if (chunk.children[i] == cur) { break } - no += chunk.children[i].chunkSize(); - } - } - return no + cur.first - } - - // Find the line at the given vertical position, using the height - // information in the document tree. - function lineAtHeight(chunk, h) { - var n = chunk.first; - outer: do { - for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) { - var child = chunk.children[i$1], ch = child.height; - if (h < ch) { chunk = child; continue outer } - h -= ch; - n += child.chunkSize(); - } - return n - } while (!chunk.lines) - var i = 0; - for (; i < chunk.lines.length; ++i) { - var line = chunk.lines[i], lh = line.height; - if (h < lh) { break } - h -= lh; - } - return n + i - } - - function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size} - - function lineNumberFor(options, i) { - return String(options.lineNumberFormatter(i + options.firstLineNumber)) - } - - // A Pos instance represents a position within the text. - function Pos(line, ch, sticky) { - if ( sticky === void 0 ) sticky = null; - - if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) } - this.line = line; - this.ch = ch; - this.sticky = sticky; - } - - // Compare two positions, return 0 if they are the same, a negative - // number when a is less, and a positive number otherwise. - function cmp(a, b) { return a.line - b.line || a.ch - b.ch } - - function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 } - - function copyPos(x) {return Pos(x.line, x.ch)} - function maxPos(a, b) { return cmp(a, b) < 0 ? b : a } - function minPos(a, b) { return cmp(a, b) < 0 ? a : b } - - // Most of the external API clips given positions to make sure they - // actually exist within the document. - function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))} - function clipPos(doc, pos) { - if (pos.line < doc.first) { return Pos(doc.first, 0) } - var last = doc.first + doc.size - 1; - if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) } - return clipToLen(pos, getLine(doc, pos.line).text.length) - } - function clipToLen(pos, linelen) { - var ch = pos.ch; - if (ch == null || ch > linelen) { return Pos(pos.line, linelen) } - else if (ch < 0) { return Pos(pos.line, 0) } - else { return pos } - } - function clipPosArray(doc, array) { - var out = []; - for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); } - return out - } - - var SavedContext = function(state, lookAhead) { - this.state = state; - this.lookAhead = lookAhead; - }; - - var Context = function(doc, state, line, lookAhead) { - this.state = state; - this.doc = doc; - this.line = line; - this.maxLookAhead = lookAhead || 0; - this.baseTokens = null; - this.baseTokenPos = 1; - }; - - Context.prototype.lookAhead = function (n) { - var line = this.doc.getLine(this.line + n); - if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; } - return line - }; - - Context.prototype.baseToken = function (n) { - if (!this.baseTokens) { return null } - while (this.baseTokens[this.baseTokenPos] <= n) - { this.baseTokenPos += 2; } - var type = this.baseTokens[this.baseTokenPos + 1]; - return {type: type && type.replace(/( |^)overlay .*/, ""), - size: this.baseTokens[this.baseTokenPos] - n} - }; - - Context.prototype.nextLine = function () { - this.line++; - if (this.maxLookAhead > 0) { this.maxLookAhead--; } - }; - - Context.fromSaved = function (doc, saved, line) { - if (saved instanceof SavedContext) - { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) } - else - { return new Context(doc, copyState(doc.mode, saved), line) } - }; - - Context.prototype.save = function (copy) { - var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state; - return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state - }; - - - // Compute a style array (an array starting with a mode generation - // -- for invalidation -- followed by pairs of end positions and - // style strings), which is used to highlight the tokens on the - // line. - function highlightLine(cm, line, context, forceToEnd) { - // A styles array always starts with a number identifying the - // mode/overlays that it is based on (for easy invalidation). - var st = [cm.state.modeGen], lineClasses = {}; - // Compute the base array of styles - runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); }, - lineClasses, forceToEnd); - var state = context.state; - - // Run overlays, adjust style array. - var loop = function ( o ) { - context.baseTokens = st; - var overlay = cm.state.overlays[o], i = 1, at = 0; - context.state = true; - runMode(cm, line.text, overlay.mode, context, function (end, style) { - var start = i; - // Ensure there's a token end at the current position, and that i points at it - while (at < end) { - var i_end = st[i]; - if (i_end > end) - { st.splice(i, 1, end, st[i+1], i_end); } - i += 2; - at = Math.min(end, i_end); - } - if (!style) { return } - if (overlay.opaque) { - st.splice(start, i - start, end, "overlay " + style); - i = start + 2; - } else { - for (; start < i; start += 2) { - var cur = st[start+1]; - st[start+1] = (cur ? cur + " " : "") + "overlay " + style; - } - } - }, lineClasses); - context.state = state; - context.baseTokens = null; - context.baseTokenPos = 1; - }; - - for (var o = 0; o < cm.state.overlays.length; ++o) loop( o ); - - return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null} - } - - function getLineStyles(cm, line, updateFrontier) { - if (!line.styles || line.styles[0] != cm.state.modeGen) { - var context = getContextBefore(cm, lineNo(line)); - var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state); - var result = highlightLine(cm, line, context); - if (resetState) { context.state = resetState; } - line.stateAfter = context.save(!resetState); - line.styles = result.styles; - if (result.classes) { line.styleClasses = result.classes; } - else if (line.styleClasses) { line.styleClasses = null; } - if (updateFrontier === cm.doc.highlightFrontier) - { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); } - } - return line.styles - } - - function getContextBefore(cm, n, precise) { - var doc = cm.doc, display = cm.display; - if (!doc.mode.startState) { return new Context(doc, true, n) } - var start = findStartLine(cm, n, precise); - var saved = start > doc.first && getLine(doc, start - 1).stateAfter; - var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start); - - doc.iter(start, n, function (line) { - processLine(cm, line.text, context); - var pos = context.line; - line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null; - context.nextLine(); - }); - if (precise) { doc.modeFrontier = context.line; } - return context - } - - // Lightweight form of highlight -- proceed over this line and - // update state, but don't save a style array. Used for lines that - // aren't currently visible. - function processLine(cm, text, context, startAt) { - var mode = cm.doc.mode; - var stream = new StringStream(text, cm.options.tabSize, context); - stream.start = stream.pos = startAt || 0; - if (text == "") { callBlankLine(mode, context.state); } - while (!stream.eol()) { - readToken(mode, stream, context.state); - stream.start = stream.pos; - } - } - - function callBlankLine(mode, state) { - if (mode.blankLine) { return mode.blankLine(state) } - if (!mode.innerMode) { return } - var inner = innerMode(mode, state); - if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) } - } - - function readToken(mode, stream, state, inner) { - for (var i = 0; i < 10; i++) { - if (inner) { inner[0] = innerMode(mode, state).mode; } - var style = mode.token(stream, state); - if (stream.pos > stream.start) { return style } - } - throw new Error("Mode " + mode.name + " failed to advance stream.") - } - - var Token = function(stream, type, state) { - this.start = stream.start; this.end = stream.pos; - this.string = stream.current(); - this.type = type || null; - this.state = state; - }; - - // Utility for getTokenAt and getLineTokens - function takeToken(cm, pos, precise, asArray) { - var doc = cm.doc, mode = doc.mode, style; - pos = clipPos(doc, pos); - var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise); - var stream = new StringStream(line.text, cm.options.tabSize, context), tokens; - if (asArray) { tokens = []; } - while ((asArray || stream.pos < pos.ch) && !stream.eol()) { - stream.start = stream.pos; - style = readToken(mode, stream, context.state); - if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); } - } - return asArray ? tokens : new Token(stream, style, context.state) - } - - function extractLineClasses(type, output) { - if (type) { for (;;) { - var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/); - if (!lineClass) { break } - type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length); - var prop = lineClass[1] ? "bgClass" : "textClass"; - if (output[prop] == null) - { output[prop] = lineClass[2]; } - else if (!(new RegExp("(?:^|\\s)" + lineClass[2] + "(?:$|\\s)")).test(output[prop])) - { output[prop] += " " + lineClass[2]; } - } } - return type - } - - // Run the given mode's parser over a line, calling f for each token. - function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) { - var flattenSpans = mode.flattenSpans; - if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; } - var curStart = 0, curStyle = null; - var stream = new StringStream(text, cm.options.tabSize, context), style; - var inner = cm.options.addModeClass && [null]; - if (text == "") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); } - while (!stream.eol()) { - if (stream.pos > cm.options.maxHighlightLength) { - flattenSpans = false; - if (forceToEnd) { processLine(cm, text, context, stream.pos); } - stream.pos = text.length; - style = null; - } else { - style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses); - } - if (inner) { - var mName = inner[0].name; - if (mName) { style = "m-" + (style ? mName + " " + style : mName); } - } - if (!flattenSpans || curStyle != style) { - while (curStart < stream.start) { - curStart = Math.min(stream.start, curStart + 5000); - f(curStart, curStyle); - } - curStyle = style; - } - stream.start = stream.pos; - } - while (curStart < stream.pos) { - // Webkit seems to refuse to render text nodes longer than 57444 - // characters, and returns inaccurate measurements in nodes - // starting around 5000 chars. - var pos = Math.min(stream.pos, curStart + 5000); - f(pos, curStyle); - curStart = pos; - } - } - - // Finds the line to start with when starting a parse. Tries to - // find a line with a stateAfter, so that it can start with a - // valid state. If that fails, it returns the line with the - // smallest indentation, which tends to need the least context to - // parse correctly. - function findStartLine(cm, n, precise) { - var minindent, minline, doc = cm.doc; - var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100); - for (var search = n; search > lim; --search) { - if (search <= doc.first) { return doc.first } - var line = getLine(doc, search - 1), after = line.stateAfter; - if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier)) - { return search } - var indented = countColumn(line.text, null, cm.options.tabSize); - if (minline == null || minindent > indented) { - minline = search - 1; - minindent = indented; - } - } - return minline - } - - function retreatFrontier(doc, n) { - doc.modeFrontier = Math.min(doc.modeFrontier, n); - if (doc.highlightFrontier < n - 10) { return } - var start = doc.first; - for (var line = n - 1; line > start; line--) { - var saved = getLine(doc, line).stateAfter; - // change is on 3 - // state on line 1 looked ahead 2 -- so saw 3 - // test 1 + 2 < 3 should cover this - if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) { - start = line + 1; - break - } - } - doc.highlightFrontier = Math.min(doc.highlightFrontier, start); - } - - // Optimize some code when these features are not used. - var sawReadOnlySpans = false, sawCollapsedSpans = false; - - function seeReadOnlySpans() { - sawReadOnlySpans = true; - } - - function seeCollapsedSpans() { - sawCollapsedSpans = true; - } - - // TEXTMARKER SPANS - - function MarkedSpan(marker, from, to) { - this.marker = marker; - this.from = from; this.to = to; - } - - // Search an array of spans for a span matching the given marker. - function getMarkedSpanFor(spans, marker) { - if (spans) { for (var i = 0; i < spans.length; ++i) { - var span = spans[i]; - if (span.marker == marker) { return span } - } } - } - - // Remove a span from an array, returning undefined if no spans are - // left (we don't store arrays for lines without spans). - function removeMarkedSpan(spans, span) { - var r; - for (var i = 0; i < spans.length; ++i) - { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } } - return r - } - - // Add a span to a line. - function addMarkedSpan(line, span, op) { - var inThisOp = op && window.WeakSet && (op.markedSpans || (op.markedSpans = new WeakSet)); - if (inThisOp && inThisOp.has(line.markedSpans)) { - line.markedSpans.push(span); - } else { - line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]; - if (inThisOp) { inThisOp.add(line.markedSpans); } - } - span.marker.attachLine(line); - } - - // Used for the algorithm that adjusts markers for a change in the - // document. These functions cut an array of spans at a given - // character position, returning an array of remaining chunks (or - // undefined if nothing remains). - function markedSpansBefore(old, startCh, isInsert) { - var nw; - if (old) { for (var i = 0; i < old.length; ++i) { - var span = old[i], marker = span.marker; - var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh); - if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) { - var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh) - ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to)); - } - } } - return nw - } - function markedSpansAfter(old, endCh, isInsert) { - var nw; - if (old) { for (var i = 0; i < old.length; ++i) { - var span = old[i], marker = span.marker; - var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh); - if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) { - var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh) - ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh, - span.to == null ? null : span.to - endCh)); - } - } } - return nw - } - - // Given a change object, compute the new set of marker spans that - // cover the line in which the change took place. Removes spans - // entirely within the change, reconnects spans belonging to the - // same marker that appear on both sides of the change, and cuts off - // spans partially within the change. Returns an array of span - // arrays with one element for each line in (after) the change. - function stretchSpansOverChange(doc, change) { - if (change.full) { return null } - var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans; - var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans; - if (!oldFirst && !oldLast) { return null } - - var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0; - // Get the spans that 'stick out' on both sides - var first = markedSpansBefore(oldFirst, startCh, isInsert); - var last = markedSpansAfter(oldLast, endCh, isInsert); - - // Next, merge those two ends - var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0); - if (first) { - // Fix up .to properties of first - for (var i = 0; i < first.length; ++i) { - var span = first[i]; - if (span.to == null) { - var found = getMarkedSpanFor(last, span.marker); - if (!found) { span.to = startCh; } - else if (sameLine) { span.to = found.to == null ? null : found.to + offset; } - } - } - } - if (last) { - // Fix up .from in last (or move them into first in case of sameLine) - for (var i$1 = 0; i$1 < last.length; ++i$1) { - var span$1 = last[i$1]; - if (span$1.to != null) { span$1.to += offset; } - if (span$1.from == null) { - var found$1 = getMarkedSpanFor(first, span$1.marker); - if (!found$1) { - span$1.from = offset; - if (sameLine) { (first || (first = [])).push(span$1); } - } - } else { - span$1.from += offset; - if (sameLine) { (first || (first = [])).push(span$1); } - } - } - } - // Make sure we didn't create any zero-length spans - if (first) { first = clearEmptySpans(first); } - if (last && last != first) { last = clearEmptySpans(last); } - - var newMarkers = [first]; - if (!sameLine) { - // Fill gap with whole-line-spans - var gap = change.text.length - 2, gapMarkers; - if (gap > 0 && first) - { for (var i$2 = 0; i$2 < first.length; ++i$2) - { if (first[i$2].to == null) - { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } } - for (var i$3 = 0; i$3 < gap; ++i$3) - { newMarkers.push(gapMarkers); } - newMarkers.push(last); - } - return newMarkers - } - - // Remove spans that are empty and don't have a clearWhenEmpty - // option of false. - function clearEmptySpans(spans) { - for (var i = 0; i < spans.length; ++i) { - var span = spans[i]; - if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false) - { spans.splice(i--, 1); } - } - if (!spans.length) { return null } - return spans - } - - // Used to 'clip' out readOnly ranges when making a change. - function removeReadOnlyRanges(doc, from, to) { - var markers = null; - doc.iter(from.line, to.line + 1, function (line) { - if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) { - var mark = line.markedSpans[i].marker; - if (mark.readOnly && (!markers || indexOf(markers, mark) == -1)) - { (markers || (markers = [])).push(mark); } - } } - }); - if (!markers) { return null } - var parts = [{from: from, to: to}]; - for (var i = 0; i < markers.length; ++i) { - var mk = markers[i], m = mk.find(0); - for (var j = 0; j < parts.length; ++j) { - var p = parts[j]; - if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue } - var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to); - if (dfrom < 0 || !mk.inclusiveLeft && !dfrom) - { newParts.push({from: p.from, to: m.from}); } - if (dto > 0 || !mk.inclusiveRight && !dto) - { newParts.push({from: m.to, to: p.to}); } - parts.splice.apply(parts, newParts); - j += newParts.length - 3; - } - } - return parts - } - - // Connect or disconnect spans from a line. - function detachMarkedSpans(line) { - var spans = line.markedSpans; - if (!spans) { return } - for (var i = 0; i < spans.length; ++i) - { spans[i].marker.detachLine(line); } - line.markedSpans = null; - } - function attachMarkedSpans(line, spans) { - if (!spans) { return } - for (var i = 0; i < spans.length; ++i) - { spans[i].marker.attachLine(line); } - line.markedSpans = spans; - } - - // Helpers used when computing which overlapping collapsed span - // counts as the larger one. - function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 } - function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 } - - // Returns a number indicating which of two overlapping collapsed - // spans is larger (and thus includes the other). Falls back to - // comparing ids when the spans cover exactly the same range. - function compareCollapsedMarkers(a, b) { - var lenDiff = a.lines.length - b.lines.length; - if (lenDiff != 0) { return lenDiff } - var aPos = a.find(), bPos = b.find(); - var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b); - if (fromCmp) { return -fromCmp } - var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b); - if (toCmp) { return toCmp } - return b.id - a.id - } - - // Find out whether a line ends or starts in a collapsed span. If - // so, return the marker for that span. - function collapsedSpanAtSide(line, start) { - var sps = sawCollapsedSpans && line.markedSpans, found; - if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) { - sp = sps[i]; - if (sp.marker.collapsed && (start ? sp.from : sp.to) == null && - (!found || compareCollapsedMarkers(found, sp.marker) < 0)) - { found = sp.marker; } - } } - return found - } - function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) } - function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) } - - function collapsedSpanAround(line, ch) { - var sps = sawCollapsedSpans && line.markedSpans, found; - if (sps) { for (var i = 0; i < sps.length; ++i) { - var sp = sps[i]; - if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) && - (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; } - } } - return found - } - - // Test whether there exists a collapsed span that partially - // overlaps (covers the start or end, but not both) of a new span. - // Such overlap is not allowed. - function conflictingCollapsedRange(doc, lineNo, from, to, marker) { - var line = getLine(doc, lineNo); - var sps = sawCollapsedSpans && line.markedSpans; - if (sps) { for (var i = 0; i < sps.length; ++i) { - var sp = sps[i]; - if (!sp.marker.collapsed) { continue } - var found = sp.marker.find(0); - var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker); - var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker); - if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue } - if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) || - fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0)) - { return true } - } } - } - - // A visual line is a line as drawn on the screen. Folding, for - // example, can cause multiple logical lines to appear on the same - // visual line. This finds the start of the visual line that the - // given line is part of (usually that is the line itself). - function visualLine(line) { - var merged; - while (merged = collapsedSpanAtStart(line)) - { line = merged.find(-1, true).line; } - return line - } - - function visualLineEnd(line) { - var merged; - while (merged = collapsedSpanAtEnd(line)) - { line = merged.find(1, true).line; } - return line - } - - // Returns an array of logical lines that continue the visual line - // started by the argument, or undefined if there are no such lines. - function visualLineContinued(line) { - var merged, lines; - while (merged = collapsedSpanAtEnd(line)) { - line = merged.find(1, true).line - ;(lines || (lines = [])).push(line); - } - return lines - } - - // Get the line number of the start of the visual line that the - // given line number is part of. - function visualLineNo(doc, lineN) { - var line = getLine(doc, lineN), vis = visualLine(line); - if (line == vis) { return lineN } - return lineNo(vis) - } - - // Get the line number of the start of the next visual line after - // the given line. - function visualLineEndNo(doc, lineN) { - if (lineN > doc.lastLine()) { return lineN } - var line = getLine(doc, lineN), merged; - if (!lineIsHidden(doc, line)) { return lineN } - while (merged = collapsedSpanAtEnd(line)) - { line = merged.find(1, true).line; } - return lineNo(line) + 1 - } - - // Compute whether a line is hidden. Lines count as hidden when they - // are part of a visual line that starts with another line, or when - // they are entirely covered by collapsed, non-widget span. - function lineIsHidden(doc, line) { - var sps = sawCollapsedSpans && line.markedSpans; - if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) { - sp = sps[i]; - if (!sp.marker.collapsed) { continue } - if (sp.from == null) { return true } - if (sp.marker.widgetNode) { continue } - if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp)) - { return true } - } } - } - function lineIsHiddenInner(doc, line, span) { - if (span.to == null) { - var end = span.marker.find(1, true); - return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker)) - } - if (span.marker.inclusiveRight && span.to == line.text.length) - { return true } - for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) { - sp = line.markedSpans[i]; - if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to && - (sp.to == null || sp.to != span.from) && - (sp.marker.inclusiveLeft || span.marker.inclusiveRight) && - lineIsHiddenInner(doc, line, sp)) { return true } - } - } - - // Find the height above the given line. - function heightAtLine(lineObj) { - lineObj = visualLine(lineObj); - - var h = 0, chunk = lineObj.parent; - for (var i = 0; i < chunk.lines.length; ++i) { - var line = chunk.lines[i]; - if (line == lineObj) { break } - else { h += line.height; } - } - for (var p = chunk.parent; p; chunk = p, p = chunk.parent) { - for (var i$1 = 0; i$1 < p.children.length; ++i$1) { - var cur = p.children[i$1]; - if (cur == chunk) { break } - else { h += cur.height; } - } - } - return h - } - - // Compute the character length of a line, taking into account - // collapsed ranges (see markText) that might hide parts, and join - // other lines onto it. - function lineLength(line) { - if (line.height == 0) { return 0 } - var len = line.text.length, merged, cur = line; - while (merged = collapsedSpanAtStart(cur)) { - var found = merged.find(0, true); - cur = found.from.line; - len += found.from.ch - found.to.ch; - } - cur = line; - while (merged = collapsedSpanAtEnd(cur)) { - var found$1 = merged.find(0, true); - len -= cur.text.length - found$1.from.ch; - cur = found$1.to.line; - len += cur.text.length - found$1.to.ch; - } - return len - } - - // Find the longest line in the document. - function findMaxLine(cm) { - var d = cm.display, doc = cm.doc; - d.maxLine = getLine(doc, doc.first); - d.maxLineLength = lineLength(d.maxLine); - d.maxLineChanged = true; - doc.iter(function (line) { - var len = lineLength(line); - if (len > d.maxLineLength) { - d.maxLineLength = len; - d.maxLine = line; - } - }); - } - - // LINE DATA STRUCTURE - - // Line objects. These hold state related to a line, including - // highlighting info (the styles array). - var Line = function(text, markedSpans, estimateHeight) { - this.text = text; - attachMarkedSpans(this, markedSpans); - this.height = estimateHeight ? estimateHeight(this) : 1; - }; - - Line.prototype.lineNo = function () { return lineNo(this) }; - eventMixin(Line); - - // Change the content (text, markers) of a line. Automatically - // invalidates cached information and tries to re-estimate the - // line's height. - function updateLine(line, text, markedSpans, estimateHeight) { - line.text = text; - if (line.stateAfter) { line.stateAfter = null; } - if (line.styles) { line.styles = null; } - if (line.order != null) { line.order = null; } - detachMarkedSpans(line); - attachMarkedSpans(line, markedSpans); - var estHeight = estimateHeight ? estimateHeight(line) : 1; - if (estHeight != line.height) { updateLineHeight(line, estHeight); } - } - - // Detach a line from the document tree and its markers. - function cleanUpLine(line) { - line.parent = null; - detachMarkedSpans(line); - } - - // Convert a style as returned by a mode (either null, or a string - // containing one or more styles) to a CSS style. This is cached, - // and also looks for line-wide styles. - var styleToClassCache = {}, styleToClassCacheWithMode = {}; - function interpretTokenStyle(style, options) { - if (!style || /^\s*$/.test(style)) { return null } - var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache; - return cache[style] || - (cache[style] = style.replace(/\S+/g, "cm-$&")) - } - - // Render the DOM representation of the text of a line. Also builds - // up a 'line map', which points at the DOM nodes that represent - // specific stretches of text, and is used by the measuring code. - // The returned object contains the DOM node, this map, and - // information about line-wide styles that were set by the mode. - function buildLineContent(cm, lineView) { - // The padding-right forces the element to have a 'border', which - // is needed on Webkit to be able to get line-level bounding - // rectangles for it (in measureChar). - var content = eltP("span", null, null, webkit ? "padding-right: .1px" : null); - var builder = {pre: eltP("pre", [content], "CodeMirror-line"), content: content, - col: 0, pos: 0, cm: cm, - trailingSpace: false, - splitSpaces: cm.getOption("lineWrapping")}; - lineView.measure = {}; - - // Iterate over the logical lines that make up this visual line. - for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) { - var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0); - builder.pos = 0; - builder.addToken = buildToken; - // Optionally wire in some hacks into the token-rendering - // algorithm, to deal with browser quirks. - if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction))) - { builder.addToken = buildTokenBadBidi(builder.addToken, order); } - builder.map = []; - var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line); - insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate)); - if (line.styleClasses) { - if (line.styleClasses.bgClass) - { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || ""); } - if (line.styleClasses.textClass) - { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || ""); } - } - - // Ensure at least a single node is present, for measuring. - if (builder.map.length == 0) - { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); } - - // Store the map and a cache object for the current logical line - if (i == 0) { - lineView.measure.map = builder.map; - lineView.measure.cache = {}; - } else { - (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map) - ;(lineView.measure.caches || (lineView.measure.caches = [])).push({}); - } - } - - // See issue #2901 - if (webkit) { - var last = builder.content.lastChild; - if (/\bcm-tab\b/.test(last.className) || (last.querySelector && last.querySelector(".cm-tab"))) - { builder.content.className = "cm-tab-wrap-hack"; } - } - - signal(cm, "renderLine", cm, lineView.line, builder.pre); - if (builder.pre.className) - { builder.textClass = joinClasses(builder.pre.className, builder.textClass || ""); } - - return builder - } - - function defaultSpecialCharPlaceholder(ch) { - var token = elt("span", "\u2022", "cm-invalidchar"); - token.title = "\\u" + ch.charCodeAt(0).toString(16); - token.setAttribute("aria-label", token.title); - return token - } - - // Build up the DOM representation for a single token, and add it to - // the line map. Takes care to render special characters separately. - function buildToken(builder, text, style, startStyle, endStyle, css, attributes) { - if (!text) { return } - var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text; - var special = builder.cm.state.specialChars, mustWrap = false; - var content; - if (!special.test(text)) { - builder.col += text.length; - content = document.createTextNode(displayText); - builder.map.push(builder.pos, builder.pos + text.length, content); - if (ie && ie_version < 9) { mustWrap = true; } - builder.pos += text.length; - } else { - content = document.createDocumentFragment(); - var pos = 0; - while (true) { - special.lastIndex = pos; - var m = special.exec(text); - var skipped = m ? m.index - pos : text.length - pos; - if (skipped) { - var txt = document.createTextNode(displayText.slice(pos, pos + skipped)); - if (ie && ie_version < 9) { content.appendChild(elt("span", [txt])); } - else { content.appendChild(txt); } - builder.map.push(builder.pos, builder.pos + skipped, txt); - builder.col += skipped; - builder.pos += skipped; - } - if (!m) { break } - pos += skipped + 1; - var txt$1 = (void 0); - if (m[0] == "\t") { - var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize; - txt$1 = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab")); - txt$1.setAttribute("role", "presentation"); - txt$1.setAttribute("cm-text", "\t"); - builder.col += tabWidth; - } else if (m[0] == "\r" || m[0] == "\n") { - txt$1 = content.appendChild(elt("span", m[0] == "\r" ? "\u240d" : "\u2424", "cm-invalidchar")); - txt$1.setAttribute("cm-text", m[0]); - builder.col += 1; - } else { - txt$1 = builder.cm.options.specialCharPlaceholder(m[0]); - txt$1.setAttribute("cm-text", m[0]); - if (ie && ie_version < 9) { content.appendChild(elt("span", [txt$1])); } - else { content.appendChild(txt$1); } - builder.col += 1; - } - builder.map.push(builder.pos, builder.pos + 1, txt$1); - builder.pos++; - } - } - builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32; - if (style || startStyle || endStyle || mustWrap || css || attributes) { - var fullStyle = style || ""; - if (startStyle) { fullStyle += startStyle; } - if (endStyle) { fullStyle += endStyle; } - var token = elt("span", [content], fullStyle, css); - if (attributes) { - for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != "style" && attr != "class") - { token.setAttribute(attr, attributes[attr]); } } - } - return builder.content.appendChild(token) - } - builder.content.appendChild(content); - } - - // Change some spaces to NBSP to prevent the browser from collapsing - // trailing spaces at the end of a line when rendering text (issue #1362). - function splitSpaces(text, trailingBefore) { - if (text.length > 1 && !/ /.test(text)) { return text } - var spaceBefore = trailingBefore, result = ""; - for (var i = 0; i < text.length; i++) { - var ch = text.charAt(i); - if (ch == " " && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32)) - { ch = "\u00a0"; } - result += ch; - spaceBefore = ch == " "; - } - return result - } - - // Work around nonsense dimensions being reported for stretches of - // right-to-left text. - function buildTokenBadBidi(inner, order) { - return function (builder, text, style, startStyle, endStyle, css, attributes) { - style = style ? style + " cm-force-border" : "cm-force-border"; - var start = builder.pos, end = start + text.length; - for (;;) { - // Find the part that overlaps with the start of this text - var part = (void 0); - for (var i = 0; i < order.length; i++) { - part = order[i]; - if (part.to > start && part.from <= start) { break } - } - if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) } - inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes); - startStyle = null; - text = text.slice(part.to - start); - start = part.to; - } - } - } - - function buildCollapsedSpan(builder, size, marker, ignoreWidget) { - var widget = !ignoreWidget && marker.widgetNode; - if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); } - if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) { - if (!widget) - { widget = builder.content.appendChild(document.createElement("span")); } - widget.setAttribute("cm-marker", marker.id); - } - if (widget) { - builder.cm.display.input.setUneditable(widget); - builder.content.appendChild(widget); - } - builder.pos += size; - builder.trailingSpace = false; - } - - // Outputs a number of spans to make up a line, taking highlighting - // and marked text into account. - function insertLineContent(line, builder, styles) { - var spans = line.markedSpans, allText = line.text, at = 0; - if (!spans) { - for (var i$1 = 1; i$1 < styles.length; i$1+=2) - { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); } - return - } - - var len = allText.length, pos = 0, i = 1, text = "", style, css; - var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes; - for (;;) { - if (nextChange == pos) { // Update current marker set - spanStyle = spanEndStyle = spanStartStyle = css = ""; - attributes = null; - collapsed = null; nextChange = Infinity; - var foundBookmarks = [], endStyles = (void 0); - for (var j = 0; j < spans.length; ++j) { - var sp = spans[j], m = sp.marker; - if (m.type == "bookmark" && sp.from == pos && m.widgetNode) { - foundBookmarks.push(m); - } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) { - if (sp.to != null && sp.to != pos && nextChange > sp.to) { - nextChange = sp.to; - spanEndStyle = ""; - } - if (m.className) { spanStyle += " " + m.className; } - if (m.css) { css = (css ? css + ";" : "") + m.css; } - if (m.startStyle && sp.from == pos) { spanStartStyle += " " + m.startStyle; } - if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); } - // support for the old title property - // https://github.com/codemirror/CodeMirror/pull/5673 - if (m.title) { (attributes || (attributes = {})).title = m.title; } - if (m.attributes) { - for (var attr in m.attributes) - { (attributes || (attributes = {}))[attr] = m.attributes[attr]; } - } - if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0)) - { collapsed = sp; } - } else if (sp.from > pos && nextChange > sp.from) { - nextChange = sp.from; - } - } - if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2) - { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += " " + endStyles[j$1]; } } } - - if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2) - { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } } - if (collapsed && (collapsed.from || 0) == pos) { - buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos, - collapsed.marker, collapsed.from == null); - if (collapsed.to == null) { return } - if (collapsed.to == pos) { collapsed = false; } - } - } - if (pos >= len) { break } - - var upto = Math.min(len, nextChange); - while (true) { - if (text) { - var end = pos + text.length; - if (!collapsed) { - var tokenText = end > upto ? text.slice(0, upto - pos) : text; - builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle, - spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", css, attributes); - } - if (end >= upto) {text = text.slice(upto - pos); pos = upto; break} - pos = end; - spanStartStyle = ""; - } - text = allText.slice(at, at = styles[i++]); - style = interpretTokenStyle(styles[i++], builder.cm.options); - } - } - } - - - // These objects are used to represent the visible (currently drawn) - // part of the document. A LineView may correspond to multiple - // logical lines, if those are connected by collapsed ranges. - function LineView(doc, line, lineN) { - // The starting line - this.line = line; - // Continuing lines, if any - this.rest = visualLineContinued(line); - // Number of logical lines in this visual line - this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1; - this.node = this.text = null; - this.hidden = lineIsHidden(doc, line); - } - - // Create a range of LineView objects for the given lines. - function buildViewArray(cm, from, to) { - var array = [], nextPos; - for (var pos = from; pos < to; pos = nextPos) { - var view = new LineView(cm.doc, getLine(cm.doc, pos), pos); - nextPos = pos + view.size; - array.push(view); - } - return array - } - - var operationGroup = null; - - function pushOperation(op) { - if (operationGroup) { - operationGroup.ops.push(op); - } else { - op.ownsGroup = operationGroup = { - ops: [op], - delayedCallbacks: [] - }; - } - } - - function fireCallbacksForOps(group) { - // Calls delayed callbacks and cursorActivity handlers until no - // new ones appear - var callbacks = group.delayedCallbacks, i = 0; - do { - for (; i < callbacks.length; i++) - { callbacks[i].call(null); } - for (var j = 0; j < group.ops.length; j++) { - var op = group.ops[j]; - if (op.cursorActivityHandlers) - { while (op.cursorActivityCalled < op.cursorActivityHandlers.length) - { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); } } - } - } while (i < callbacks.length) - } - - function finishOperation(op, endCb) { - var group = op.ownsGroup; - if (!group) { return } - - try { fireCallbacksForOps(group); } - finally { - operationGroup = null; - endCb(group); - } - } - - var orphanDelayedCallbacks = null; - - // Often, we want to signal events at a point where we are in the - // middle of some work, but don't want the handler to start calling - // other methods on the editor, which might be in an inconsistent - // state or simply not expect any other events to happen. - // signalLater looks whether there are any handlers, and schedules - // them to be executed when the last operation ends, or, if no - // operation is active, when a timeout fires. - function signalLater(emitter, type /*, values...*/) { - var arr = getHandlers(emitter, type); - if (!arr.length) { return } - var args = Array.prototype.slice.call(arguments, 2), list; - if (operationGroup) { - list = operationGroup.delayedCallbacks; - } else if (orphanDelayedCallbacks) { - list = orphanDelayedCallbacks; - } else { - list = orphanDelayedCallbacks = []; - setTimeout(fireOrphanDelayed, 0); - } - var loop = function ( i ) { - list.push(function () { return arr[i].apply(null, args); }); - }; - - for (var i = 0; i < arr.length; ++i) - loop( i ); - } - - function fireOrphanDelayed() { - var delayed = orphanDelayedCallbacks; - orphanDelayedCallbacks = null; - for (var i = 0; i < delayed.length; ++i) { delayed[i](); } - } - - // When an aspect of a line changes, a string is added to - // lineView.changes. This updates the relevant part of the line's - // DOM structure. - function updateLineForChanges(cm, lineView, lineN, dims) { - for (var j = 0; j < lineView.changes.length; j++) { - var type = lineView.changes[j]; - if (type == "text") { updateLineText(cm, lineView); } - else if (type == "gutter") { updateLineGutter(cm, lineView, lineN, dims); } - else if (type == "class") { updateLineClasses(cm, lineView); } - else if (type == "widget") { updateLineWidgets(cm, lineView, dims); } - } - lineView.changes = null; - } - - // Lines with gutter elements, widgets or a background class need to - // be wrapped, and have the extra elements added to the wrapper div - function ensureLineWrapped(lineView) { - if (lineView.node == lineView.text) { - lineView.node = elt("div", null, null, "position: relative"); - if (lineView.text.parentNode) - { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); } - lineView.node.appendChild(lineView.text); - if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; } - } - return lineView.node - } - - function updateLineBackground(cm, lineView) { - var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass; - if (cls) { cls += " CodeMirror-linebackground"; } - if (lineView.background) { - if (cls) { lineView.background.className = cls; } - else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; } - } else if (cls) { - var wrap = ensureLineWrapped(lineView); - lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild); - cm.display.input.setUneditable(lineView.background); - } - } - - // Wrapper around buildLineContent which will reuse the structure - // in display.externalMeasured when possible. - function getLineContent(cm, lineView) { - var ext = cm.display.externalMeasured; - if (ext && ext.line == lineView.line) { - cm.display.externalMeasured = null; - lineView.measure = ext.measure; - return ext.built - } - return buildLineContent(cm, lineView) - } - - // Redraw the line's text. Interacts with the background and text - // classes because the mode may output tokens that influence these - // classes. - function updateLineText(cm, lineView) { - var cls = lineView.text.className; - var built = getLineContent(cm, lineView); - if (lineView.text == lineView.node) { lineView.node = built.pre; } - lineView.text.parentNode.replaceChild(built.pre, lineView.text); - lineView.text = built.pre; - if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) { - lineView.bgClass = built.bgClass; - lineView.textClass = built.textClass; - updateLineClasses(cm, lineView); - } else if (cls) { - lineView.text.className = cls; - } - } - - function updateLineClasses(cm, lineView) { - updateLineBackground(cm, lineView); - if (lineView.line.wrapClass) - { ensureLineWrapped(lineView).className = lineView.line.wrapClass; } - else if (lineView.node != lineView.text) - { lineView.node.className = ""; } - var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass; - lineView.text.className = textClass || ""; - } - - function updateLineGutter(cm, lineView, lineN, dims) { - if (lineView.gutter) { - lineView.node.removeChild(lineView.gutter); - lineView.gutter = null; - } - if (lineView.gutterBackground) { - lineView.node.removeChild(lineView.gutterBackground); - lineView.gutterBackground = null; - } - if (lineView.line.gutterClass) { - var wrap = ensureLineWrapped(lineView); - lineView.gutterBackground = elt("div", null, "CodeMirror-gutter-background " + lineView.line.gutterClass, - ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px; width: " + (dims.gutterTotalWidth) + "px")); - cm.display.input.setUneditable(lineView.gutterBackground); - wrap.insertBefore(lineView.gutterBackground, lineView.text); - } - var markers = lineView.line.gutterMarkers; - if (cm.options.lineNumbers || markers) { - var wrap$1 = ensureLineWrapped(lineView); - var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px")); - gutterWrap.setAttribute("aria-hidden", "true"); - cm.display.input.setUneditable(gutterWrap); - wrap$1.insertBefore(gutterWrap, lineView.text); - if (lineView.line.gutterClass) - { gutterWrap.className += " " + lineView.line.gutterClass; } - if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"])) - { lineView.lineNumber = gutterWrap.appendChild( - elt("div", lineNumberFor(cm.options, lineN), - "CodeMirror-linenumber CodeMirror-gutter-elt", - ("left: " + (dims.gutterLeft["CodeMirror-linenumbers"]) + "px; width: " + (cm.display.lineNumInnerWidth) + "px"))); } - if (markers) { for (var k = 0; k < cm.display.gutterSpecs.length; ++k) { - var id = cm.display.gutterSpecs[k].className, found = markers.hasOwnProperty(id) && markers[id]; - if (found) - { gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", - ("left: " + (dims.gutterLeft[id]) + "px; width: " + (dims.gutterWidth[id]) + "px"))); } - } } - } - } - - function updateLineWidgets(cm, lineView, dims) { - if (lineView.alignable) { lineView.alignable = null; } - var isWidget = classTest("CodeMirror-linewidget"); - for (var node = lineView.node.firstChild, next = (void 0); node; node = next) { - next = node.nextSibling; - if (isWidget.test(node.className)) { lineView.node.removeChild(node); } - } - insertLineWidgets(cm, lineView, dims); - } - - // Build a line's DOM representation from scratch - function buildLineElement(cm, lineView, lineN, dims) { - var built = getLineContent(cm, lineView); - lineView.text = lineView.node = built.pre; - if (built.bgClass) { lineView.bgClass = built.bgClass; } - if (built.textClass) { lineView.textClass = built.textClass; } - - updateLineClasses(cm, lineView); - updateLineGutter(cm, lineView, lineN, dims); - insertLineWidgets(cm, lineView, dims); - return lineView.node - } - - // A lineView may contain multiple logical lines (when merged by - // collapsed spans). The widgets for all of them need to be drawn. - function insertLineWidgets(cm, lineView, dims) { - insertLineWidgetsFor(cm, lineView.line, lineView, dims, true); - if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++) - { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } } - } - - function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) { - if (!line.widgets) { return } - var wrap = ensureLineWrapped(lineView); - for (var i = 0, ws = line.widgets; i < ws.length; ++i) { - var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget" + (widget.className ? " " + widget.className : "")); - if (!widget.handleMouseEvents) { node.setAttribute("cm-ignore-events", "true"); } - positionLineWidget(widget, node, lineView, dims); - cm.display.input.setUneditable(node); - if (allowAbove && widget.above) - { wrap.insertBefore(node, lineView.gutter || lineView.text); } - else - { wrap.appendChild(node); } - signalLater(widget, "redraw"); - } - } - - function positionLineWidget(widget, node, lineView, dims) { - if (widget.noHScroll) { - (lineView.alignable || (lineView.alignable = [])).push(node); - var width = dims.wrapperWidth; - node.style.left = dims.fixedPos + "px"; - if (!widget.coverGutter) { - width -= dims.gutterTotalWidth; - node.style.paddingLeft = dims.gutterTotalWidth + "px"; - } - node.style.width = width + "px"; - } - if (widget.coverGutter) { - node.style.zIndex = 5; - node.style.position = "relative"; - if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + "px"; } - } - } - - function widgetHeight(widget) { - if (widget.height != null) { return widget.height } - var cm = widget.doc.cm; - if (!cm) { return 0 } - if (!contains(document.body, widget.node)) { - var parentStyle = "position: relative;"; - if (widget.coverGutter) - { parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;"; } - if (widget.noHScroll) - { parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;"; } - removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle)); - } - return widget.height = widget.node.parentNode.offsetHeight - } - - // Return true when the given mouse event happened in a widget - function eventInWidget(display, e) { - for (var n = e_target(e); n != display.wrapper; n = n.parentNode) { - if (!n || (n.nodeType == 1 && n.getAttribute("cm-ignore-events") == "true") || - (n.parentNode == display.sizer && n != display.mover)) - { return true } - } - } - - // POSITION MEASUREMENT - - function paddingTop(display) {return display.lineSpace.offsetTop} - function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight} - function paddingH(display) { - if (display.cachedPaddingH) { return display.cachedPaddingH } - var e = removeChildrenAndAdd(display.measure, elt("pre", "x", "CodeMirror-line-like")); - var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle; - var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)}; - if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data; } - return data - } - - function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth } - function displayWidth(cm) { - return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth - } - function displayHeight(cm) { - return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight - } - - // Ensure the lineView.wrapping.heights array is populated. This is - // an array of bottom offsets for the lines that make up a drawn - // line. When lineWrapping is on, there might be more than one - // height. - function ensureLineHeights(cm, lineView, rect) { - var wrapping = cm.options.lineWrapping; - var curWidth = wrapping && displayWidth(cm); - if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) { - var heights = lineView.measure.heights = []; - if (wrapping) { - lineView.measure.width = curWidth; - var rects = lineView.text.firstChild.getClientRects(); - for (var i = 0; i < rects.length - 1; i++) { - var cur = rects[i], next = rects[i + 1]; - if (Math.abs(cur.bottom - next.bottom) > 2) - { heights.push((cur.bottom + next.top) / 2 - rect.top); } - } - } - heights.push(rect.bottom - rect.top); - } - } - - // Find a line map (mapping character offsets to text nodes) and a - // measurement cache for the given line number. (A line view might - // contain multiple lines when collapsed ranges are present.) - function mapFromLineView(lineView, line, lineN) { - if (lineView.line == line) - { return {map: lineView.measure.map, cache: lineView.measure.cache} } - if (lineView.rest) { - for (var i = 0; i < lineView.rest.length; i++) - { if (lineView.rest[i] == line) - { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } } - for (var i$1 = 0; i$1 < lineView.rest.length; i$1++) - { if (lineNo(lineView.rest[i$1]) > lineN) - { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } } - } - } - - // Render a line into the hidden node display.externalMeasured. Used - // when measurement is needed for a line that's not in the viewport. - function updateExternalMeasurement(cm, line) { - line = visualLine(line); - var lineN = lineNo(line); - var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN); - view.lineN = lineN; - var built = view.built = buildLineContent(cm, view); - view.text = built.pre; - removeChildrenAndAdd(cm.display.lineMeasure, built.pre); - return view - } - - // Get a {top, bottom, left, right} box (in line-local coordinates) - // for a given character. - function measureChar(cm, line, ch, bias) { - return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias) - } - - // Find a line view that corresponds to the given line number. - function findViewForLine(cm, lineN) { - if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo) - { return cm.display.view[findViewIndex(cm, lineN)] } - var ext = cm.display.externalMeasured; - if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size) - { return ext } - } - - // Measurement can be split in two steps, the set-up work that - // applies to the whole line, and the measurement of the actual - // character. Functions like coordsChar, that need to do a lot of - // measurements in a row, can thus ensure that the set-up work is - // only done once. - function prepareMeasureForLine(cm, line) { - var lineN = lineNo(line); - var view = findViewForLine(cm, lineN); - if (view && !view.text) { - view = null; - } else if (view && view.changes) { - updateLineForChanges(cm, view, lineN, getDimensions(cm)); - cm.curOp.forceUpdate = true; - } - if (!view) - { view = updateExternalMeasurement(cm, line); } - - var info = mapFromLineView(view, line, lineN); - return { - line: line, view: view, rect: null, - map: info.map, cache: info.cache, before: info.before, - hasHeights: false - } - } - - // Given a prepared measurement object, measures the position of an - // actual character (or fetches it from the cache). - function measureCharPrepared(cm, prepared, ch, bias, varHeight) { - if (prepared.before) { ch = -1; } - var key = ch + (bias || ""), found; - if (prepared.cache.hasOwnProperty(key)) { - found = prepared.cache[key]; - } else { - if (!prepared.rect) - { prepared.rect = prepared.view.text.getBoundingClientRect(); } - if (!prepared.hasHeights) { - ensureLineHeights(cm, prepared.view, prepared.rect); - prepared.hasHeights = true; - } - found = measureCharInner(cm, prepared, ch, bias); - if (!found.bogus) { prepared.cache[key] = found; } - } - return {left: found.left, right: found.right, - top: varHeight ? found.rtop : found.top, - bottom: varHeight ? found.rbottom : found.bottom} - } - - var nullRect = {left: 0, right: 0, top: 0, bottom: 0}; - - function nodeAndOffsetInLineMap(map, ch, bias) { - var node, start, end, collapse, mStart, mEnd; - // First, search the line map for the text node corresponding to, - // or closest to, the target character. - for (var i = 0; i < map.length; i += 3) { - mStart = map[i]; - mEnd = map[i + 1]; - if (ch < mStart) { - start = 0; end = 1; - collapse = "left"; - } else if (ch < mEnd) { - start = ch - mStart; - end = start + 1; - } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) { - end = mEnd - mStart; - start = end - 1; - if (ch >= mEnd) { collapse = "right"; } - } - if (start != null) { - node = map[i + 2]; - if (mStart == mEnd && bias == (node.insertLeft ? "left" : "right")) - { collapse = bias; } - if (bias == "left" && start == 0) - { while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) { - node = map[(i -= 3) + 2]; - collapse = "left"; - } } - if (bias == "right" && start == mEnd - mStart) - { while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) { - node = map[(i += 3) + 2]; - collapse = "right"; - } } - break - } - } - return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd} - } - - function getUsefulRect(rects, bias) { - var rect = nullRect; - if (bias == "left") { for (var i = 0; i < rects.length; i++) { - if ((rect = rects[i]).left != rect.right) { break } - } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) { - if ((rect = rects[i$1]).left != rect.right) { break } - } } - return rect - } - - function measureCharInner(cm, prepared, ch, bias) { - var place = nodeAndOffsetInLineMap(prepared.map, ch, bias); - var node = place.node, start = place.start, end = place.end, collapse = place.collapse; - - var rect; - if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates. - for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned - while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start; } - while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end; } - if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart) - { rect = node.parentNode.getBoundingClientRect(); } - else - { rect = getUsefulRect(range(node, start, end).getClientRects(), bias); } - if (rect.left || rect.right || start == 0) { break } - end = start; - start = start - 1; - collapse = "right"; - } - if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect); } - } else { // If it is a widget, simply get the box for the whole widget. - if (start > 0) { collapse = bias = "right"; } - var rects; - if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1) - { rect = rects[bias == "right" ? rects.length - 1 : 0]; } - else - { rect = node.getBoundingClientRect(); } - } - if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) { - var rSpan = node.parentNode.getClientRects()[0]; - if (rSpan) - { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; } - else - { rect = nullRect; } - } - - var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top; - var mid = (rtop + rbot) / 2; - var heights = prepared.view.measure.heights; - var i = 0; - for (; i < heights.length - 1; i++) - { if (mid < heights[i]) { break } } - var top = i ? heights[i - 1] : 0, bot = heights[i]; - var result = {left: (collapse == "right" ? rect.right : rect.left) - prepared.rect.left, - right: (collapse == "left" ? rect.left : rect.right) - prepared.rect.left, - top: top, bottom: bot}; - if (!rect.left && !rect.right) { result.bogus = true; } - if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; } - - return result - } - - // Work around problem with bounding client rects on ranges being - // returned incorrectly when zoomed on IE10 and below. - function maybeUpdateRectForZooming(measure, rect) { - if (!window.screen || screen.logicalXDPI == null || - screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure)) - { return rect } - var scaleX = screen.logicalXDPI / screen.deviceXDPI; - var scaleY = screen.logicalYDPI / screen.deviceYDPI; - return {left: rect.left * scaleX, right: rect.right * scaleX, - top: rect.top * scaleY, bottom: rect.bottom * scaleY} - } - - function clearLineMeasurementCacheFor(lineView) { - if (lineView.measure) { - lineView.measure.cache = {}; - lineView.measure.heights = null; - if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++) - { lineView.measure.caches[i] = {}; } } - } - } - - function clearLineMeasurementCache(cm) { - cm.display.externalMeasure = null; - removeChildren(cm.display.lineMeasure); - for (var i = 0; i < cm.display.view.length; i++) - { clearLineMeasurementCacheFor(cm.display.view[i]); } - } - - function clearCaches(cm) { - clearLineMeasurementCache(cm); - cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null; - if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true; } - cm.display.lineNumChars = null; - } - - function pageScrollX() { - // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206 - // which causes page_Offset and bounding client rects to use - // different reference viewports and invalidate our calculations. - if (chrome && android) { return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) } - return window.pageXOffset || (document.documentElement || document.body).scrollLeft - } - function pageScrollY() { - if (chrome && android) { return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) } - return window.pageYOffset || (document.documentElement || document.body).scrollTop - } - - function widgetTopHeight(lineObj) { - var ref = visualLine(lineObj); - var widgets = ref.widgets; - var height = 0; - if (widgets) { for (var i = 0; i < widgets.length; ++i) { if (widgets[i].above) - { height += widgetHeight(widgets[i]); } } } - return height - } - - // Converts a {top, bottom, left, right} box from line-local - // coordinates into another coordinate system. Context may be one of - // "line", "div" (display.lineDiv), "local"./null (editor), "window", - // or "page". - function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) { - if (!includeWidgets) { - var height = widgetTopHeight(lineObj); - rect.top += height; rect.bottom += height; - } - if (context == "line") { return rect } - if (!context) { context = "local"; } - var yOff = heightAtLine(lineObj); - if (context == "local") { yOff += paddingTop(cm.display); } - else { yOff -= cm.display.viewOffset; } - if (context == "page" || context == "window") { - var lOff = cm.display.lineSpace.getBoundingClientRect(); - yOff += lOff.top + (context == "window" ? 0 : pageScrollY()); - var xOff = lOff.left + (context == "window" ? 0 : pageScrollX()); - rect.left += xOff; rect.right += xOff; - } - rect.top += yOff; rect.bottom += yOff; - return rect - } - - // Coverts a box from "div" coords to another coordinate system. - // Context may be "window", "page", "div", or "local"./null. - function fromCoordSystem(cm, coords, context) { - if (context == "div") { return coords } - var left = coords.left, top = coords.top; - // First move into "page" coordinate system - if (context == "page") { - left -= pageScrollX(); - top -= pageScrollY(); - } else if (context == "local" || !context) { - var localBox = cm.display.sizer.getBoundingClientRect(); - left += localBox.left; - top += localBox.top; - } - - var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect(); - return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top} - } - - function charCoords(cm, pos, context, lineObj, bias) { - if (!lineObj) { lineObj = getLine(cm.doc, pos.line); } - return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context) - } - - // Returns a box for a given cursor position, which may have an - // 'other' property containing the position of the secondary cursor - // on a bidi boundary. - // A cursor Pos(line, char, "before") is on the same visual line as `char - 1` - // and after `char - 1` in writing order of `char - 1` - // A cursor Pos(line, char, "after") is on the same visual line as `char` - // and before `char` in writing order of `char` - // Examples (upper-case letters are RTL, lower-case are LTR): - // Pos(0, 1, ...) - // before after - // ab a|b a|b - // aB a|B aB| - // Ab |Ab A|b - // AB B|A B|A - // Every position after the last character on a line is considered to stick - // to the last character on the line. - function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) { - lineObj = lineObj || getLine(cm.doc, pos.line); - if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); } - function get(ch, right) { - var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left", varHeight); - if (right) { m.left = m.right; } else { m.right = m.left; } - return intoCoordSystem(cm, lineObj, m, context) - } - var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky; - if (ch >= lineObj.text.length) { - ch = lineObj.text.length; - sticky = "before"; - } else if (ch <= 0) { - ch = 0; - sticky = "after"; - } - if (!order) { return get(sticky == "before" ? ch - 1 : ch, sticky == "before") } - - function getBidi(ch, partPos, invert) { - var part = order[partPos], right = part.level == 1; - return get(invert ? ch - 1 : ch, right != invert) - } - var partPos = getBidiPartAt(order, ch, sticky); - var other = bidiOther; - var val = getBidi(ch, partPos, sticky == "before"); - if (other != null) { val.other = getBidi(ch, other, sticky != "before"); } - return val - } - - // Used to cheaply estimate the coordinates for a position. Used for - // intermediate scroll updates. - function estimateCoords(cm, pos) { - var left = 0; - pos = clipPos(cm.doc, pos); - if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; } - var lineObj = getLine(cm.doc, pos.line); - var top = heightAtLine(lineObj) + paddingTop(cm.display); - return {left: left, right: left, top: top, bottom: top + lineObj.height} - } - - // Positions returned by coordsChar contain some extra information. - // xRel is the relative x position of the input coordinates compared - // to the found position (so xRel > 0 means the coordinates are to - // the right of the character position, for example). When outside - // is true, that means the coordinates lie outside the line's - // vertical range. - function PosWithInfo(line, ch, sticky, outside, xRel) { - var pos = Pos(line, ch, sticky); - pos.xRel = xRel; - if (outside) { pos.outside = outside; } - return pos - } - - // Compute the character position closest to the given coordinates. - // Input must be lineSpace-local ("div" coordinate system). - function coordsChar(cm, x, y) { - var doc = cm.doc; - y += cm.display.viewOffset; - if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) } - var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1; - if (lineN > last) - { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) } - if (x < 0) { x = 0; } - - var lineObj = getLine(doc, lineN); - for (;;) { - var found = coordsCharInner(cm, lineObj, lineN, x, y); - var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0)); - if (!collapsed) { return found } - var rangeEnd = collapsed.find(1); - if (rangeEnd.line == lineN) { return rangeEnd } - lineObj = getLine(doc, lineN = rangeEnd.line); - } - } - - function wrappedLineExtent(cm, lineObj, preparedMeasure, y) { - y -= widgetTopHeight(lineObj); - var end = lineObj.text.length; - var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0); - end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end); - return {begin: begin, end: end} - } - - function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) { - if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); } - var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), "line").top; - return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop) - } - - // Returns true if the given side of a box is after the given - // coordinates, in top-to-bottom, left-to-right order. - function boxIsAfter(box, x, y, left) { - return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x - } - - function coordsCharInner(cm, lineObj, lineNo, x, y) { - // Move y into line-local coordinate space - y -= heightAtLine(lineObj); - var preparedMeasure = prepareMeasureForLine(cm, lineObj); - // When directly calling `measureCharPrepared`, we have to adjust - // for the widgets at this line. - var widgetHeight = widgetTopHeight(lineObj); - var begin = 0, end = lineObj.text.length, ltr = true; - - var order = getOrder(lineObj, cm.doc.direction); - // If the line isn't plain left-to-right text, first figure out - // which bidi section the coordinates fall into. - if (order) { - var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart) - (cm, lineObj, lineNo, preparedMeasure, order, x, y); - ltr = part.level != 1; - // The awkward -1 offsets are needed because findFirst (called - // on these below) will treat its first bound as inclusive, - // second as exclusive, but we want to actually address the - // characters in the part's range - begin = ltr ? part.from : part.to - 1; - end = ltr ? part.to : part.from - 1; - } - - // A binary search to find the first character whose bounding box - // starts after the coordinates. If we run across any whose box wrap - // the coordinates, store that. - var chAround = null, boxAround = null; - var ch = findFirst(function (ch) { - var box = measureCharPrepared(cm, preparedMeasure, ch); - box.top += widgetHeight; box.bottom += widgetHeight; - if (!boxIsAfter(box, x, y, false)) { return false } - if (box.top <= y && box.left <= x) { - chAround = ch; - boxAround = box; - } - return true - }, begin, end); - - var baseX, sticky, outside = false; - // If a box around the coordinates was found, use that - if (boxAround) { - // Distinguish coordinates nearer to the left or right side of the box - var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr; - ch = chAround + (atStart ? 0 : 1); - sticky = atStart ? "after" : "before"; - baseX = atLeft ? boxAround.left : boxAround.right; - } else { - // (Adjust for extended bound, if necessary.) - if (!ltr && (ch == end || ch == begin)) { ch++; } - // To determine which side to associate with, get the box to the - // left of the character and compare it's vertical position to the - // coordinates - sticky = ch == 0 ? "after" : ch == lineObj.text.length ? "before" : - (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight <= y) == ltr ? - "after" : "before"; - // Now get accurate coordinates for this place, in order to get a - // base X position - var coords = cursorCoords(cm, Pos(lineNo, ch, sticky), "line", lineObj, preparedMeasure); - baseX = coords.left; - outside = y < coords.top ? -1 : y >= coords.bottom ? 1 : 0; - } - - ch = skipExtendingChars(lineObj.text, ch, 1); - return PosWithInfo(lineNo, ch, sticky, outside, x - baseX) - } - - function coordsBidiPart(cm, lineObj, lineNo, preparedMeasure, order, x, y) { - // Bidi parts are sorted left-to-right, and in a non-line-wrapping - // situation, we can take this ordering to correspond to the visual - // ordering. This finds the first part whose end is after the given - // coordinates. - var index = findFirst(function (i) { - var part = order[i], ltr = part.level != 1; - return boxIsAfter(cursorCoords(cm, Pos(lineNo, ltr ? part.to : part.from, ltr ? "before" : "after"), - "line", lineObj, preparedMeasure), x, y, true) - }, 0, order.length - 1); - var part = order[index]; - // If this isn't the first part, the part's start is also after - // the coordinates, and the coordinates aren't on the same line as - // that start, move one part back. - if (index > 0) { - var ltr = part.level != 1; - var start = cursorCoords(cm, Pos(lineNo, ltr ? part.from : part.to, ltr ? "after" : "before"), - "line", lineObj, preparedMeasure); - if (boxIsAfter(start, x, y, true) && start.top > y) - { part = order[index - 1]; } - } - return part - } - - function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) { - // In a wrapped line, rtl text on wrapping boundaries can do things - // that don't correspond to the ordering in our `order` array at - // all, so a binary search doesn't work, and we want to return a - // part that only spans one line so that the binary search in - // coordsCharInner is safe. As such, we first find the extent of the - // wrapped line, and then do a flat search in which we discard any - // spans that aren't on the line. - var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y); - var begin = ref.begin; - var end = ref.end; - if (/\s/.test(lineObj.text.charAt(end - 1))) { end--; } - var part = null, closestDist = null; - for (var i = 0; i < order.length; i++) { - var p = order[i]; - if (p.from >= end || p.to <= begin) { continue } - var ltr = p.level != 1; - var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right; - // Weigh against spans ending before this, so that they are only - // picked if nothing ends after - var dist = endX < x ? x - endX + 1e9 : endX - x; - if (!part || closestDist > dist) { - part = p; - closestDist = dist; - } - } - if (!part) { part = order[order.length - 1]; } - // Clip the part to the wrapped line. - if (part.from < begin) { part = {from: begin, to: part.to, level: part.level}; } - if (part.to > end) { part = {from: part.from, to: end, level: part.level}; } - return part - } - - var measureText; - // Compute the default text height. - function textHeight(display) { - if (display.cachedTextHeight != null) { return display.cachedTextHeight } - if (measureText == null) { - measureText = elt("pre", null, "CodeMirror-line-like"); - // Measure a bunch of lines, for browsers that compute - // fractional heights. - for (var i = 0; i < 49; ++i) { - measureText.appendChild(document.createTextNode("x")); - measureText.appendChild(elt("br")); - } - measureText.appendChild(document.createTextNode("x")); - } - removeChildrenAndAdd(display.measure, measureText); - var height = measureText.offsetHeight / 50; - if (height > 3) { display.cachedTextHeight = height; } - removeChildren(display.measure); - return height || 1 - } - - // Compute the default character width. - function charWidth(display) { - if (display.cachedCharWidth != null) { return display.cachedCharWidth } - var anchor = elt("span", "xxxxxxxxxx"); - var pre = elt("pre", [anchor], "CodeMirror-line-like"); - removeChildrenAndAdd(display.measure, pre); - var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10; - if (width > 2) { display.cachedCharWidth = width; } - return width || 10 - } - - // Do a bulk-read of the DOM positions and sizes needed to draw the - // view, so that we don't interleave reading and writing to the DOM. - function getDimensions(cm) { - var d = cm.display, left = {}, width = {}; - var gutterLeft = d.gutters.clientLeft; - for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) { - var id = cm.display.gutterSpecs[i].className; - left[id] = n.offsetLeft + n.clientLeft + gutterLeft; - width[id] = n.clientWidth; - } - return {fixedPos: compensateForHScroll(d), - gutterTotalWidth: d.gutters.offsetWidth, - gutterLeft: left, - gutterWidth: width, - wrapperWidth: d.wrapper.clientWidth} - } - - // Computes display.scroller.scrollLeft + display.gutters.offsetWidth, - // but using getBoundingClientRect to get a sub-pixel-accurate - // result. - function compensateForHScroll(display) { - return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left - } - - // Returns a function that estimates the height of a line, to use as - // first approximation until the line becomes visible (and is thus - // properly measurable). - function estimateHeight(cm) { - var th = textHeight(cm.display), wrapping = cm.options.lineWrapping; - var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3); - return function (line) { - if (lineIsHidden(cm.doc, line)) { return 0 } - - var widgetsHeight = 0; - if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) { - if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; } - } } - - if (wrapping) - { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th } - else - { return widgetsHeight + th } - } - } - - function estimateLineHeights(cm) { - var doc = cm.doc, est = estimateHeight(cm); - doc.iter(function (line) { - var estHeight = est(line); - if (estHeight != line.height) { updateLineHeight(line, estHeight); } - }); - } - - // Given a mouse event, find the corresponding position. If liberal - // is false, it checks whether a gutter or scrollbar was clicked, - // and returns null if it was. forRect is used by rectangular - // selections, and tries to estimate a character position even for - // coordinates beyond the right of the text. - function posFromMouse(cm, e, liberal, forRect) { - var display = cm.display; - if (!liberal && e_target(e).getAttribute("cm-not-content") == "true") { return null } - - var x, y, space = display.lineSpace.getBoundingClientRect(); - // Fails unpredictably on IE[67] when mouse is dragged around quickly. - try { x = e.clientX - space.left; y = e.clientY - space.top; } - catch (e$1) { return null } - var coords = coordsChar(cm, x, y), line; - if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) { - var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length; - coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff)); - } - return coords - } - - // Find the view element corresponding to a given line. Return null - // when the line isn't visible. - function findViewIndex(cm, n) { - if (n >= cm.display.viewTo) { return null } - n -= cm.display.viewFrom; - if (n < 0) { return null } - var view = cm.display.view; - for (var i = 0; i < view.length; i++) { - n -= view[i].size; - if (n < 0) { return i } - } - } - - // Updates the display.view data structure for a given change to the - // document. From and to are in pre-change coordinates. Lendiff is - // the amount of lines added or subtracted by the change. This is - // used for changes that span multiple lines, or change the way - // lines are divided into visual lines. regLineChange (below) - // registers single-line changes. - function regChange(cm, from, to, lendiff) { - if (from == null) { from = cm.doc.first; } - if (to == null) { to = cm.doc.first + cm.doc.size; } - if (!lendiff) { lendiff = 0; } - - var display = cm.display; - if (lendiff && to < display.viewTo && - (display.updateLineNumbers == null || display.updateLineNumbers > from)) - { display.updateLineNumbers = from; } - - cm.curOp.viewChanged = true; - - if (from >= display.viewTo) { // Change after - if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo) - { resetView(cm); } - } else if (to <= display.viewFrom) { // Change before - if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) { - resetView(cm); - } else { - display.viewFrom += lendiff; - display.viewTo += lendiff; - } - } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap - resetView(cm); - } else if (from <= display.viewFrom) { // Top overlap - var cut = viewCuttingPoint(cm, to, to + lendiff, 1); - if (cut) { - display.view = display.view.slice(cut.index); - display.viewFrom = cut.lineN; - display.viewTo += lendiff; - } else { - resetView(cm); - } - } else if (to >= display.viewTo) { // Bottom overlap - var cut$1 = viewCuttingPoint(cm, from, from, -1); - if (cut$1) { - display.view = display.view.slice(0, cut$1.index); - display.viewTo = cut$1.lineN; - } else { - resetView(cm); - } - } else { // Gap in the middle - var cutTop = viewCuttingPoint(cm, from, from, -1); - var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1); - if (cutTop && cutBot) { - display.view = display.view.slice(0, cutTop.index) - .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN)) - .concat(display.view.slice(cutBot.index)); - display.viewTo += lendiff; - } else { - resetView(cm); - } - } - - var ext = display.externalMeasured; - if (ext) { - if (to < ext.lineN) - { ext.lineN += lendiff; } - else if (from < ext.lineN + ext.size) - { display.externalMeasured = null; } - } - } - - // Register a change to a single line. Type must be one of "text", - // "gutter", "class", "widget" - function regLineChange(cm, line, type) { - cm.curOp.viewChanged = true; - var display = cm.display, ext = cm.display.externalMeasured; - if (ext && line >= ext.lineN && line < ext.lineN + ext.size) - { display.externalMeasured = null; } - - if (line < display.viewFrom || line >= display.viewTo) { return } - var lineView = display.view[findViewIndex(cm, line)]; - if (lineView.node == null) { return } - var arr = lineView.changes || (lineView.changes = []); - if (indexOf(arr, type) == -1) { arr.push(type); } - } - - // Clear the view. - function resetView(cm) { - cm.display.viewFrom = cm.display.viewTo = cm.doc.first; - cm.display.view = []; - cm.display.viewOffset = 0; - } - - function viewCuttingPoint(cm, oldN, newN, dir) { - var index = findViewIndex(cm, oldN), diff, view = cm.display.view; - if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size) - { return {index: index, lineN: newN} } - var n = cm.display.viewFrom; - for (var i = 0; i < index; i++) - { n += view[i].size; } - if (n != oldN) { - if (dir > 0) { - if (index == view.length - 1) { return null } - diff = (n + view[index].size) - oldN; - index++; - } else { - diff = n - oldN; - } - oldN += diff; newN += diff; - } - while (visualLineNo(cm.doc, newN) != newN) { - if (index == (dir < 0 ? 0 : view.length - 1)) { return null } - newN += dir * view[index - (dir < 0 ? 1 : 0)].size; - index += dir; - } - return {index: index, lineN: newN} - } - - // Force the view to cover a given range, adding empty view element - // or clipping off existing ones as needed. - function adjustView(cm, from, to) { - var display = cm.display, view = display.view; - if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) { - display.view = buildViewArray(cm, from, to); - display.viewFrom = from; - } else { - if (display.viewFrom > from) - { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); } - else if (display.viewFrom < from) - { display.view = display.view.slice(findViewIndex(cm, from)); } - display.viewFrom = from; - if (display.viewTo < to) - { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); } - else if (display.viewTo > to) - { display.view = display.view.slice(0, findViewIndex(cm, to)); } - } - display.viewTo = to; - } - - // Count the number of lines in the view whose DOM representation is - // out of date (or nonexistent). - function countDirtyView(cm) { - var view = cm.display.view, dirty = 0; - for (var i = 0; i < view.length; i++) { - var lineView = view[i]; - if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; } - } - return dirty - } - - function updateSelection(cm) { - cm.display.input.showSelection(cm.display.input.prepareSelection()); - } - - function prepareSelection(cm, primary) { - if ( primary === void 0 ) primary = true; - - var doc = cm.doc, result = {}; - var curFragment = result.cursors = document.createDocumentFragment(); - var selFragment = result.selection = document.createDocumentFragment(); - - var customCursor = cm.options.$customCursor; - if (customCursor) { primary = true; } - for (var i = 0; i < doc.sel.ranges.length; i++) { - if (!primary && i == doc.sel.primIndex) { continue } - var range = doc.sel.ranges[i]; - if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { continue } - var collapsed = range.empty(); - if (customCursor) { - var head = customCursor(cm, range); - if (head) { drawSelectionCursor(cm, head, curFragment); } - } else if (collapsed || cm.options.showCursorWhenSelecting) { - drawSelectionCursor(cm, range.head, curFragment); - } - if (!collapsed) - { drawSelectionRange(cm, range, selFragment); } - } - return result - } - - // Draws a cursor for the given range - function drawSelectionCursor(cm, head, output) { - var pos = cursorCoords(cm, head, "div", null, null, !cm.options.singleCursorHeightPerLine); - - var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor")); - cursor.style.left = pos.left + "px"; - cursor.style.top = pos.top + "px"; - cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"; - - if (/\bcm-fat-cursor\b/.test(cm.getWrapperElement().className)) { - var charPos = charCoords(cm, head, "div", null, null); - var width = charPos.right - charPos.left; - cursor.style.width = (width > 0 ? width : cm.defaultCharWidth()) + "px"; - } - - if (pos.other) { - // Secondary cursor, shown when on a 'jump' in bi-directional text - var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor")); - otherCursor.style.display = ""; - otherCursor.style.left = pos.other.left + "px"; - otherCursor.style.top = pos.other.top + "px"; - otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px"; - } - } - - function cmpCoords(a, b) { return a.top - b.top || a.left - b.left } - - // Draws the given range as a highlighted selection - function drawSelectionRange(cm, range, output) { - var display = cm.display, doc = cm.doc; - var fragment = document.createDocumentFragment(); - var padding = paddingH(cm.display), leftSide = padding.left; - var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right; - var docLTR = doc.direction == "ltr"; - - function add(left, top, width, bottom) { - if (top < 0) { top = 0; } - top = Math.round(top); - bottom = Math.round(bottom); - fragment.appendChild(elt("div", null, "CodeMirror-selected", ("position: absolute; left: " + left + "px;\n top: " + top + "px; width: " + (width == null ? rightSide - left : width) + "px;\n height: " + (bottom - top) + "px"))); - } - - function drawForLine(line, fromArg, toArg) { - var lineObj = getLine(doc, line); - var lineLen = lineObj.text.length; - var start, end; - function coords(ch, bias) { - return charCoords(cm, Pos(line, ch), "div", lineObj, bias) - } - - function wrapX(pos, dir, side) { - var extent = wrappedLineExtentChar(cm, lineObj, null, pos); - var prop = (dir == "ltr") == (side == "after") ? "left" : "right"; - var ch = side == "after" ? extent.begin : extent.end - (/\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1); - return coords(ch, prop)[prop] - } - - var order = getOrder(lineObj, doc.direction); - iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) { - var ltr = dir == "ltr"; - var fromPos = coords(from, ltr ? "left" : "right"); - var toPos = coords(to - 1, ltr ? "right" : "left"); - - var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen; - var first = i == 0, last = !order || i == order.length - 1; - if (toPos.top - fromPos.top <= 3) { // Single line - var openLeft = (docLTR ? openStart : openEnd) && first; - var openRight = (docLTR ? openEnd : openStart) && last; - var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left; - var right = openRight ? rightSide : (ltr ? toPos : fromPos).right; - add(left, fromPos.top, right - left, fromPos.bottom); - } else { // Multiple lines - var topLeft, topRight, botLeft, botRight; - if (ltr) { - topLeft = docLTR && openStart && first ? leftSide : fromPos.left; - topRight = docLTR ? rightSide : wrapX(from, dir, "before"); - botLeft = docLTR ? leftSide : wrapX(to, dir, "after"); - botRight = docLTR && openEnd && last ? rightSide : toPos.right; - } else { - topLeft = !docLTR ? leftSide : wrapX(from, dir, "before"); - topRight = !docLTR && openStart && first ? rightSide : fromPos.right; - botLeft = !docLTR && openEnd && last ? leftSide : toPos.left; - botRight = !docLTR ? rightSide : wrapX(to, dir, "after"); - } - add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom); - if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); } - add(botLeft, toPos.top, botRight - botLeft, toPos.bottom); - } - - if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; } - if (cmpCoords(toPos, start) < 0) { start = toPos; } - if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; } - if (cmpCoords(toPos, end) < 0) { end = toPos; } - }); - return {start: start, end: end} - } - - var sFrom = range.from(), sTo = range.to(); - if (sFrom.line == sTo.line) { - drawForLine(sFrom.line, sFrom.ch, sTo.ch); - } else { - var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line); - var singleVLine = visualLine(fromLine) == visualLine(toLine); - var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end; - var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start; - if (singleVLine) { - if (leftEnd.top < rightStart.top - 2) { - add(leftEnd.right, leftEnd.top, null, leftEnd.bottom); - add(leftSide, rightStart.top, rightStart.left, rightStart.bottom); - } else { - add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom); - } - } - if (leftEnd.bottom < rightStart.top) - { add(leftSide, leftEnd.bottom, null, rightStart.top); } - } - - output.appendChild(fragment); - } - - // Cursor-blinking - function restartBlink(cm) { - if (!cm.state.focused) { return } - var display = cm.display; - clearInterval(display.blinker); - var on = true; - display.cursorDiv.style.visibility = ""; - if (cm.options.cursorBlinkRate > 0) - { display.blinker = setInterval(function () { - if (!cm.hasFocus()) { onBlur(cm); } - display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden"; - }, cm.options.cursorBlinkRate); } - else if (cm.options.cursorBlinkRate < 0) - { display.cursorDiv.style.visibility = "hidden"; } - } - - function ensureFocus(cm) { - if (!cm.hasFocus()) { - cm.display.input.focus(); - if (!cm.state.focused) { onFocus(cm); } - } - } - - function delayBlurEvent(cm) { - cm.state.delayingBlurEvent = true; - setTimeout(function () { if (cm.state.delayingBlurEvent) { - cm.state.delayingBlurEvent = false; - if (cm.state.focused) { onBlur(cm); } - } }, 100); - } - - function onFocus(cm, e) { - if (cm.state.delayingBlurEvent && !cm.state.draggingText) { cm.state.delayingBlurEvent = false; } - - if (cm.options.readOnly == "nocursor") { return } - if (!cm.state.focused) { - signal(cm, "focus", cm, e); - cm.state.focused = true; - addClass(cm.display.wrapper, "CodeMirror-focused"); - // This test prevents this from firing when a context - // menu is closed (since the input reset would kill the - // select-all detection hack) - if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) { - cm.display.input.reset(); - if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730 - } - cm.display.input.receivedFocus(); - } - restartBlink(cm); - } - function onBlur(cm, e) { - if (cm.state.delayingBlurEvent) { return } - - if (cm.state.focused) { - signal(cm, "blur", cm, e); - cm.state.focused = false; - rmClass(cm.display.wrapper, "CodeMirror-focused"); - } - clearInterval(cm.display.blinker); - setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150); - } - - // Read the actual heights of the rendered lines, and update their - // stored heights to match. - function updateHeightsInViewport(cm) { - var display = cm.display; - var prevBottom = display.lineDiv.offsetTop; - var viewTop = Math.max(0, display.scroller.getBoundingClientRect().top); - var oldHeight = display.lineDiv.getBoundingClientRect().top; - var mustScroll = 0; - for (var i = 0; i < display.view.length; i++) { - var cur = display.view[i], wrapping = cm.options.lineWrapping; - var height = (void 0), width = 0; - if (cur.hidden) { continue } - oldHeight += cur.line.height; - if (ie && ie_version < 8) { - var bot = cur.node.offsetTop + cur.node.offsetHeight; - height = bot - prevBottom; - prevBottom = bot; - } else { - var box = cur.node.getBoundingClientRect(); - height = box.bottom - box.top; - // Check that lines don't extend past the right of the current - // editor width - if (!wrapping && cur.text.firstChild) - { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; } - } - var diff = cur.line.height - height; - if (diff > .005 || diff < -.005) { - if (oldHeight < viewTop) { mustScroll -= diff; } - updateLineHeight(cur.line, height); - updateWidgetHeight(cur.line); - if (cur.rest) { for (var j = 0; j < cur.rest.length; j++) - { updateWidgetHeight(cur.rest[j]); } } - } - if (width > cm.display.sizerWidth) { - var chWidth = Math.ceil(width / charWidth(cm.display)); - if (chWidth > cm.display.maxLineLength) { - cm.display.maxLineLength = chWidth; - cm.display.maxLine = cur.line; - cm.display.maxLineChanged = true; - } - } - } - if (Math.abs(mustScroll) > 2) { display.scroller.scrollTop += mustScroll; } - } - - // Read and store the height of line widgets associated with the - // given line. - function updateWidgetHeight(line) { - if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) { - var w = line.widgets[i], parent = w.node.parentNode; - if (parent) { w.height = parent.offsetHeight; } - } } - } - - // Compute the lines that are visible in a given viewport (defaults - // the the current scroll position). viewport may contain top, - // height, and ensure (see op.scrollToPos) properties. - function visibleLines(display, doc, viewport) { - var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop; - top = Math.floor(top - paddingTop(display)); - var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight; - - var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom); - // Ensure is a {from: {line, ch}, to: {line, ch}} object, and - // forces those lines into the viewport (if possible). - if (viewport && viewport.ensure) { - var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line; - if (ensureFrom < from) { - from = ensureFrom; - to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight); - } else if (Math.min(ensureTo, doc.lastLine()) >= to) { - from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight); - to = ensureTo; - } - } - return {from: from, to: Math.max(to, from + 1)} - } - - // SCROLLING THINGS INTO VIEW - - // If an editor sits on the top or bottom of the window, partially - // scrolled out of view, this ensures that the cursor is visible. - function maybeScrollWindow(cm, rect) { - if (signalDOMEvent(cm, "scrollCursorIntoView")) { return } - - var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null; - if (rect.top + box.top < 0) { doScroll = true; } - else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false; } - if (doScroll != null && !phantom) { - var scrollNode = elt("div", "\u200b", null, ("position: absolute;\n top: " + (rect.top - display.viewOffset - paddingTop(cm.display)) + "px;\n height: " + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + "px;\n left: " + (rect.left) + "px; width: " + (Math.max(2, rect.right - rect.left)) + "px;")); - cm.display.lineSpace.appendChild(scrollNode); - scrollNode.scrollIntoView(doScroll); - cm.display.lineSpace.removeChild(scrollNode); - } - } - - // Scroll a given position into view (immediately), verifying that - // it actually became visible (as line heights are accurately - // measured, the position of something may 'drift' during drawing). - function scrollPosIntoView(cm, pos, end, margin) { - if (margin == null) { margin = 0; } - var rect; - if (!cm.options.lineWrapping && pos == end) { - // Set pos and end to the cursor positions around the character pos sticks to - // If pos.sticky == "before", that is around pos.ch - 1, otherwise around pos.ch - // If pos == Pos(_, 0, "before"), pos and end are unchanged - end = pos.sticky == "before" ? Pos(pos.line, pos.ch + 1, "before") : pos; - pos = pos.ch ? Pos(pos.line, pos.sticky == "before" ? pos.ch - 1 : pos.ch, "after") : pos; - } - for (var limit = 0; limit < 5; limit++) { - var changed = false; - var coords = cursorCoords(cm, pos); - var endCoords = !end || end == pos ? coords : cursorCoords(cm, end); - rect = {left: Math.min(coords.left, endCoords.left), - top: Math.min(coords.top, endCoords.top) - margin, - right: Math.max(coords.left, endCoords.left), - bottom: Math.max(coords.bottom, endCoords.bottom) + margin}; - var scrollPos = calculateScrollPos(cm, rect); - var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft; - if (scrollPos.scrollTop != null) { - updateScrollTop(cm, scrollPos.scrollTop); - if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; } - } - if (scrollPos.scrollLeft != null) { - setScrollLeft(cm, scrollPos.scrollLeft); - if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; } - } - if (!changed) { break } - } - return rect - } - - // Scroll a given set of coordinates into view (immediately). - function scrollIntoView(cm, rect) { - var scrollPos = calculateScrollPos(cm, rect); - if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); } - if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); } - } - - // Calculate a new scroll position needed to scroll the given - // rectangle into view. Returns an object with scrollTop and - // scrollLeft properties. When these are undefined, the - // vertical/horizontal position does not need to be adjusted. - function calculateScrollPos(cm, rect) { - var display = cm.display, snapMargin = textHeight(cm.display); - if (rect.top < 0) { rect.top = 0; } - var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop; - var screen = displayHeight(cm), result = {}; - if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; } - var docBottom = cm.doc.height + paddingVert(display); - var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin; - if (rect.top < screentop) { - result.scrollTop = atTop ? 0 : rect.top; - } else if (rect.bottom > screentop + screen) { - var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen); - if (newTop != screentop) { result.scrollTop = newTop; } - } - - var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth; - var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace; - var screenw = displayWidth(cm) - display.gutters.offsetWidth; - var tooWide = rect.right - rect.left > screenw; - if (tooWide) { rect.right = rect.left + screenw; } - if (rect.left < 10) - { result.scrollLeft = 0; } - else if (rect.left < screenleft) - { result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); } - else if (rect.right > screenw + screenleft - 3) - { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; } - return result - } - - // Store a relative adjustment to the scroll position in the current - // operation (to be applied when the operation finishes). - function addToScrollTop(cm, top) { - if (top == null) { return } - resolveScrollToPos(cm); - cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top; - } - - // Make sure that at the end of the operation the current cursor is - // shown. - function ensureCursorVisible(cm) { - resolveScrollToPos(cm); - var cur = cm.getCursor(); - cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin}; - } - - function scrollToCoords(cm, x, y) { - if (x != null || y != null) { resolveScrollToPos(cm); } - if (x != null) { cm.curOp.scrollLeft = x; } - if (y != null) { cm.curOp.scrollTop = y; } - } - - function scrollToRange(cm, range) { - resolveScrollToPos(cm); - cm.curOp.scrollToPos = range; - } - - // When an operation has its scrollToPos property set, and another - // scroll action is applied before the end of the operation, this - // 'simulates' scrolling that position into view in a cheap way, so - // that the effect of intermediate scroll commands is not ignored. - function resolveScrollToPos(cm) { - var range = cm.curOp.scrollToPos; - if (range) { - cm.curOp.scrollToPos = null; - var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to); - scrollToCoordsRange(cm, from, to, range.margin); - } - } - - function scrollToCoordsRange(cm, from, to, margin) { - var sPos = calculateScrollPos(cm, { - left: Math.min(from.left, to.left), - top: Math.min(from.top, to.top) - margin, - right: Math.max(from.right, to.right), - bottom: Math.max(from.bottom, to.bottom) + margin - }); - scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop); - } - - // Sync the scrollable area and scrollbars, ensure the viewport - // covers the visible area. - function updateScrollTop(cm, val) { - if (Math.abs(cm.doc.scrollTop - val) < 2) { return } - if (!gecko) { updateDisplaySimple(cm, {top: val}); } - setScrollTop(cm, val, true); - if (gecko) { updateDisplaySimple(cm); } - startWorker(cm, 100); - } - - function setScrollTop(cm, val, forceScroll) { - val = Math.max(0, Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val)); - if (cm.display.scroller.scrollTop == val && !forceScroll) { return } - cm.doc.scrollTop = val; - cm.display.scrollbars.setScrollTop(val); - if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; } - } - - // Sync scroller and scrollbar, ensure the gutter elements are - // aligned. - function setScrollLeft(cm, val, isScroller, forceScroll) { - val = Math.max(0, Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth)); - if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return } - cm.doc.scrollLeft = val; - alignHorizontally(cm); - if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; } - cm.display.scrollbars.setScrollLeft(val); - } - - // SCROLLBARS - - // Prepare DOM reads needed to update the scrollbars. Done in one - // shot to minimize update/measure roundtrips. - function measureForScrollbars(cm) { - var d = cm.display, gutterW = d.gutters.offsetWidth; - var docH = Math.round(cm.doc.height + paddingVert(cm.display)); - return { - clientHeight: d.scroller.clientHeight, - viewHeight: d.wrapper.clientHeight, - scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth, - viewWidth: d.wrapper.clientWidth, - barLeft: cm.options.fixedGutter ? gutterW : 0, - docHeight: docH, - scrollHeight: docH + scrollGap(cm) + d.barHeight, - nativeBarWidth: d.nativeBarWidth, - gutterWidth: gutterW - } - } - - var NativeScrollbars = function(place, scroll, cm) { - this.cm = cm; - var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar"); - var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar"); - vert.tabIndex = horiz.tabIndex = -1; - place(vert); place(horiz); - - on(vert, "scroll", function () { - if (vert.clientHeight) { scroll(vert.scrollTop, "vertical"); } - }); - on(horiz, "scroll", function () { - if (horiz.clientWidth) { scroll(horiz.scrollLeft, "horizontal"); } - }); - - this.checkedZeroWidth = false; - // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8). - if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = "18px"; } - }; - - NativeScrollbars.prototype.update = function (measure) { - var needsH = measure.scrollWidth > measure.clientWidth + 1; - var needsV = measure.scrollHeight > measure.clientHeight + 1; - var sWidth = measure.nativeBarWidth; - - if (needsV) { - this.vert.style.display = "block"; - this.vert.style.bottom = needsH ? sWidth + "px" : "0"; - var totalHeight = measure.viewHeight - (needsH ? sWidth : 0); - // A bug in IE8 can cause this value to be negative, so guard it. - this.vert.firstChild.style.height = - Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px"; - } else { - this.vert.scrollTop = 0; - this.vert.style.display = ""; - this.vert.firstChild.style.height = "0"; - } - - if (needsH) { - this.horiz.style.display = "block"; - this.horiz.style.right = needsV ? sWidth + "px" : "0"; - this.horiz.style.left = measure.barLeft + "px"; - var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0); - this.horiz.firstChild.style.width = - Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + "px"; - } else { - this.horiz.style.display = ""; - this.horiz.firstChild.style.width = "0"; - } - - if (!this.checkedZeroWidth && measure.clientHeight > 0) { - if (sWidth == 0) { this.zeroWidthHack(); } - this.checkedZeroWidth = true; - } - - return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0} - }; - - NativeScrollbars.prototype.setScrollLeft = function (pos) { - if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; } - if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, "horiz"); } - }; - - NativeScrollbars.prototype.setScrollTop = function (pos) { - if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; } - if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, "vert"); } - }; - - NativeScrollbars.prototype.zeroWidthHack = function () { - var w = mac && !mac_geMountainLion ? "12px" : "18px"; - this.horiz.style.height = this.vert.style.width = w; - this.horiz.style.pointerEvents = this.vert.style.pointerEvents = "none"; - this.disableHoriz = new Delayed; - this.disableVert = new Delayed; - }; - - NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) { - bar.style.pointerEvents = "auto"; - function maybeDisable() { - // To find out whether the scrollbar is still visible, we - // check whether the element under the pixel in the bottom - // right corner of the scrollbar box is the scrollbar box - // itself (when the bar is still visible) or its filler child - // (when the bar is hidden). If it is still visible, we keep - // it enabled, if it's hidden, we disable pointer events. - var box = bar.getBoundingClientRect(); - var elt = type == "vert" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2) - : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1); - if (elt != bar) { bar.style.pointerEvents = "none"; } - else { delay.set(1000, maybeDisable); } - } - delay.set(1000, maybeDisable); - }; - - NativeScrollbars.prototype.clear = function () { - var parent = this.horiz.parentNode; - parent.removeChild(this.horiz); - parent.removeChild(this.vert); - }; - - var NullScrollbars = function () {}; - - NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} }; - NullScrollbars.prototype.setScrollLeft = function () {}; - NullScrollbars.prototype.setScrollTop = function () {}; - NullScrollbars.prototype.clear = function () {}; - - function updateScrollbars(cm, measure) { - if (!measure) { measure = measureForScrollbars(cm); } - var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight; - updateScrollbarsInner(cm, measure); - for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) { - if (startWidth != cm.display.barWidth && cm.options.lineWrapping) - { updateHeightsInViewport(cm); } - updateScrollbarsInner(cm, measureForScrollbars(cm)); - startWidth = cm.display.barWidth; startHeight = cm.display.barHeight; - } - } - - // Re-synchronize the fake scrollbars with the actual size of the - // content. - function updateScrollbarsInner(cm, measure) { - var d = cm.display; - var sizes = d.scrollbars.update(measure); - - d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px"; - d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px"; - d.heightForcer.style.borderBottom = sizes.bottom + "px solid transparent"; - - if (sizes.right && sizes.bottom) { - d.scrollbarFiller.style.display = "block"; - d.scrollbarFiller.style.height = sizes.bottom + "px"; - d.scrollbarFiller.style.width = sizes.right + "px"; - } else { d.scrollbarFiller.style.display = ""; } - if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) { - d.gutterFiller.style.display = "block"; - d.gutterFiller.style.height = sizes.bottom + "px"; - d.gutterFiller.style.width = measure.gutterWidth + "px"; - } else { d.gutterFiller.style.display = ""; } - } - - var scrollbarModel = {"native": NativeScrollbars, "null": NullScrollbars}; - - function initScrollbars(cm) { - if (cm.display.scrollbars) { - cm.display.scrollbars.clear(); - if (cm.display.scrollbars.addClass) - { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); } - } - - cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) { - cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller); - // Prevent clicks in the scrollbars from killing focus - on(node, "mousedown", function () { - if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); } - }); - node.setAttribute("cm-not-content", "true"); - }, function (pos, axis) { - if (axis == "horizontal") { setScrollLeft(cm, pos); } - else { updateScrollTop(cm, pos); } - }, cm); - if (cm.display.scrollbars.addClass) - { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); } - } - - // Operations are used to wrap a series of changes to the editor - // state in such a way that each change won't have to update the - // cursor and display (which would be awkward, slow, and - // error-prone). Instead, display updates are batched and then all - // combined and executed at once. - - var nextOpId = 0; - // Start a new operation. - function startOperation(cm) { - cm.curOp = { - cm: cm, - viewChanged: false, // Flag that indicates that lines might need to be redrawn - startHeight: cm.doc.height, // Used to detect need to update scrollbar - forceUpdate: false, // Used to force a redraw - updateInput: 0, // Whether to reset the input textarea - typing: false, // Whether this reset should be careful to leave existing text (for compositing) - changeObjs: null, // Accumulated changes, for firing change events - cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on - cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already - selectionChanged: false, // Whether the selection needs to be redrawn - updateMaxLine: false, // Set when the widest line needs to be determined anew - scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet - scrollToPos: null, // Used to scroll to a specific position - focus: false, - id: ++nextOpId, // Unique ID - markArrays: null // Used by addMarkedSpan - }; - pushOperation(cm.curOp); - } - - // Finish an operation, updating the display and signalling delayed events - function endOperation(cm) { - var op = cm.curOp; - if (op) { finishOperation(op, function (group) { - for (var i = 0; i < group.ops.length; i++) - { group.ops[i].cm.curOp = null; } - endOperations(group); - }); } - } - - // The DOM updates done when an operation finishes are batched so - // that the minimum number of relayouts are required. - function endOperations(group) { - var ops = group.ops; - for (var i = 0; i < ops.length; i++) // Read DOM - { endOperation_R1(ops[i]); } - for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe) - { endOperation_W1(ops[i$1]); } - for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM - { endOperation_R2(ops[i$2]); } - for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe) - { endOperation_W2(ops[i$3]); } - for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM - { endOperation_finish(ops[i$4]); } - } - - function endOperation_R1(op) { - var cm = op.cm, display = cm.display; - maybeClipScrollbars(cm); - if (op.updateMaxLine) { findMaxLine(cm); } - - op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null || - op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom || - op.scrollToPos.to.line >= display.viewTo) || - display.maxLineChanged && cm.options.lineWrapping; - op.update = op.mustUpdate && - new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate); - } - - function endOperation_W1(op) { - op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update); - } - - function endOperation_R2(op) { - var cm = op.cm, display = cm.display; - if (op.updatedDisplay) { updateHeightsInViewport(cm); } - - op.barMeasure = measureForScrollbars(cm); - - // If the max line changed since it was last measured, measure it, - // and ensure the document's width matches it. - // updateDisplay_W2 will use these properties to do the actual resizing - if (display.maxLineChanged && !cm.options.lineWrapping) { - op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3; - cm.display.sizerWidth = op.adjustWidthTo; - op.barMeasure.scrollWidth = - Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth); - op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm)); - } - - if (op.updatedDisplay || op.selectionChanged) - { op.preparedSelection = display.input.prepareSelection(); } - } - - function endOperation_W2(op) { - var cm = op.cm; - - if (op.adjustWidthTo != null) { - cm.display.sizer.style.minWidth = op.adjustWidthTo + "px"; - if (op.maxScrollLeft < cm.doc.scrollLeft) - { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); } - cm.display.maxLineChanged = false; - } - - var takeFocus = op.focus && op.focus == activeElt(); - if (op.preparedSelection) - { cm.display.input.showSelection(op.preparedSelection, takeFocus); } - if (op.updatedDisplay || op.startHeight != cm.doc.height) - { updateScrollbars(cm, op.barMeasure); } - if (op.updatedDisplay) - { setDocumentHeight(cm, op.barMeasure); } - - if (op.selectionChanged) { restartBlink(cm); } - - if (cm.state.focused && op.updateInput) - { cm.display.input.reset(op.typing); } - if (takeFocus) { ensureFocus(op.cm); } - } - - function endOperation_finish(op) { - var cm = op.cm, display = cm.display, doc = cm.doc; - - if (op.updatedDisplay) { postUpdateDisplay(cm, op.update); } - - // Abort mouse wheel delta measurement, when scrolling explicitly - if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos)) - { display.wheelStartX = display.wheelStartY = null; } - - // Propagate the scroll position to the actual DOM scroller - if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); } - - if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); } - // If we need to scroll a specific position into view, do so. - if (op.scrollToPos) { - var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from), - clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin); - maybeScrollWindow(cm, rect); - } - - // Fire events for markers that are hidden/unidden by editing or - // undoing - var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers; - if (hidden) { for (var i = 0; i < hidden.length; ++i) - { if (!hidden[i].lines.length) { signal(hidden[i], "hide"); } } } - if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1) - { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], "unhide"); } } } - - if (display.wrapper.offsetHeight) - { doc.scrollTop = cm.display.scroller.scrollTop; } - - // Fire change events, and delayed event handlers - if (op.changeObjs) - { signal(cm, "changes", cm, op.changeObjs); } - if (op.update) - { op.update.finish(); } - } - - // Run the given function in an operation - function runInOp(cm, f) { - if (cm.curOp) { return f() } - startOperation(cm); - try { return f() } - finally { endOperation(cm); } - } - // Wraps a function in an operation. Returns the wrapped function. - function operation(cm, f) { - return function() { - if (cm.curOp) { return f.apply(cm, arguments) } - startOperation(cm); - try { return f.apply(cm, arguments) } - finally { endOperation(cm); } - } - } - // Used to add methods to editor and doc instances, wrapping them in - // operations. - function methodOp(f) { - return function() { - if (this.curOp) { return f.apply(this, arguments) } - startOperation(this); - try { return f.apply(this, arguments) } - finally { endOperation(this); } - } - } - function docMethodOp(f) { - return function() { - var cm = this.cm; - if (!cm || cm.curOp) { return f.apply(this, arguments) } - startOperation(cm); - try { return f.apply(this, arguments) } - finally { endOperation(cm); } - } - } - - // HIGHLIGHT WORKER - - function startWorker(cm, time) { - if (cm.doc.highlightFrontier < cm.display.viewTo) - { cm.state.highlight.set(time, bind(highlightWorker, cm)); } - } - - function highlightWorker(cm) { - var doc = cm.doc; - if (doc.highlightFrontier >= cm.display.viewTo) { return } - var end = +new Date + cm.options.workTime; - var context = getContextBefore(cm, doc.highlightFrontier); - var changedLines = []; - - doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) { - if (context.line >= cm.display.viewFrom) { // Visible - var oldStyles = line.styles; - var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null; - var highlighted = highlightLine(cm, line, context, true); - if (resetState) { context.state = resetState; } - line.styles = highlighted.styles; - var oldCls = line.styleClasses, newCls = highlighted.classes; - if (newCls) { line.styleClasses = newCls; } - else if (oldCls) { line.styleClasses = null; } - var ischange = !oldStyles || oldStyles.length != line.styles.length || - oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass); - for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; } - if (ischange) { changedLines.push(context.line); } - line.stateAfter = context.save(); - context.nextLine(); - } else { - if (line.text.length <= cm.options.maxHighlightLength) - { processLine(cm, line.text, context); } - line.stateAfter = context.line % 5 == 0 ? context.save() : null; - context.nextLine(); - } - if (+new Date > end) { - startWorker(cm, cm.options.workDelay); - return true - } - }); - doc.highlightFrontier = context.line; - doc.modeFrontier = Math.max(doc.modeFrontier, context.line); - if (changedLines.length) { runInOp(cm, function () { - for (var i = 0; i < changedLines.length; i++) - { regLineChange(cm, changedLines[i], "text"); } - }); } - } - - // DISPLAY DRAWING - - var DisplayUpdate = function(cm, viewport, force) { - var display = cm.display; - - this.viewport = viewport; - // Store some values that we'll need later (but don't want to force a relayout for) - this.visible = visibleLines(display, cm.doc, viewport); - this.editorIsHidden = !display.wrapper.offsetWidth; - this.wrapperHeight = display.wrapper.clientHeight; - this.wrapperWidth = display.wrapper.clientWidth; - this.oldDisplayWidth = displayWidth(cm); - this.force = force; - this.dims = getDimensions(cm); - this.events = []; - }; - - DisplayUpdate.prototype.signal = function (emitter, type) { - if (hasHandler(emitter, type)) - { this.events.push(arguments); } - }; - DisplayUpdate.prototype.finish = function () { - for (var i = 0; i < this.events.length; i++) - { signal.apply(null, this.events[i]); } - }; - - function maybeClipScrollbars(cm) { - var display = cm.display; - if (!display.scrollbarsClipped && display.scroller.offsetWidth) { - display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth; - display.heightForcer.style.height = scrollGap(cm) + "px"; - display.sizer.style.marginBottom = -display.nativeBarWidth + "px"; - display.sizer.style.borderRightWidth = scrollGap(cm) + "px"; - display.scrollbarsClipped = true; - } - } - - function selectionSnapshot(cm) { - if (cm.hasFocus()) { return null } - var active = activeElt(); - if (!active || !contains(cm.display.lineDiv, active)) { return null } - var result = {activeElt: active}; - if (window.getSelection) { - var sel = window.getSelection(); - if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) { - result.anchorNode = sel.anchorNode; - result.anchorOffset = sel.anchorOffset; - result.focusNode = sel.focusNode; - result.focusOffset = sel.focusOffset; - } - } - return result - } - - function restoreSelection(snapshot) { - if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return } - snapshot.activeElt.focus(); - if (!/^(INPUT|TEXTAREA)$/.test(snapshot.activeElt.nodeName) && - snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) { - var sel = window.getSelection(), range = document.createRange(); - range.setEnd(snapshot.anchorNode, snapshot.anchorOffset); - range.collapse(false); - sel.removeAllRanges(); - sel.addRange(range); - sel.extend(snapshot.focusNode, snapshot.focusOffset); - } - } - - // Does the actual updating of the line display. Bails out - // (returning false) when there is nothing to be done and forced is - // false. - function updateDisplayIfNeeded(cm, update) { - var display = cm.display, doc = cm.doc; - - if (update.editorIsHidden) { - resetView(cm); - return false - } - - // Bail out if the visible area is already rendered and nothing changed. - if (!update.force && - update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo && - (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) && - display.renderedView == display.view && countDirtyView(cm) == 0) - { return false } - - if (maybeUpdateLineNumberWidth(cm)) { - resetView(cm); - update.dims = getDimensions(cm); - } - - // Compute a suitable new viewport (from & to) - var end = doc.first + doc.size; - var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first); - var to = Math.min(end, update.visible.to + cm.options.viewportMargin); - if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); } - if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); } - if (sawCollapsedSpans) { - from = visualLineNo(cm.doc, from); - to = visualLineEndNo(cm.doc, to); - } - - var different = from != display.viewFrom || to != display.viewTo || - display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth; - adjustView(cm, from, to); - - display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom)); - // Position the mover div to align with the current scroll position - cm.display.mover.style.top = display.viewOffset + "px"; - - var toUpdate = countDirtyView(cm); - if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view && - (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo)) - { return false } - - // For big changes, we hide the enclosing element during the - // update, since that speeds up the operations on most browsers. - var selSnapshot = selectionSnapshot(cm); - if (toUpdate > 4) { display.lineDiv.style.display = "none"; } - patchDisplay(cm, display.updateLineNumbers, update.dims); - if (toUpdate > 4) { display.lineDiv.style.display = ""; } - display.renderedView = display.view; - // There might have been a widget with a focused element that got - // hidden or updated, if so re-focus it. - restoreSelection(selSnapshot); - - // Prevent selection and cursors from interfering with the scroll - // width and height. - removeChildren(display.cursorDiv); - removeChildren(display.selectionDiv); - display.gutters.style.height = display.sizer.style.minHeight = 0; - - if (different) { - display.lastWrapHeight = update.wrapperHeight; - display.lastWrapWidth = update.wrapperWidth; - startWorker(cm, 400); - } - - display.updateLineNumbers = null; - - return true - } - - function postUpdateDisplay(cm, update) { - var viewport = update.viewport; - - for (var first = true;; first = false) { - if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) { - // Clip forced viewport to actual scrollable area. - if (viewport && viewport.top != null) - { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; } - // Updated line heights might result in the drawn area not - // actually covering the viewport. Keep looping until it does. - update.visible = visibleLines(cm.display, cm.doc, viewport); - if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo) - { break } - } else if (first) { - update.visible = visibleLines(cm.display, cm.doc, viewport); - } - if (!updateDisplayIfNeeded(cm, update)) { break } - updateHeightsInViewport(cm); - var barMeasure = measureForScrollbars(cm); - updateSelection(cm); - updateScrollbars(cm, barMeasure); - setDocumentHeight(cm, barMeasure); - update.force = false; - } - - update.signal(cm, "update", cm); - if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) { - update.signal(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo); - cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo; - } - } - - function updateDisplaySimple(cm, viewport) { - var update = new DisplayUpdate(cm, viewport); - if (updateDisplayIfNeeded(cm, update)) { - updateHeightsInViewport(cm); - postUpdateDisplay(cm, update); - var barMeasure = measureForScrollbars(cm); - updateSelection(cm); - updateScrollbars(cm, barMeasure); - setDocumentHeight(cm, barMeasure); - update.finish(); - } - } - - // Sync the actual display DOM structure with display.view, removing - // nodes for lines that are no longer in view, and creating the ones - // that are not there yet, and updating the ones that are out of - // date. - function patchDisplay(cm, updateNumbersFrom, dims) { - var display = cm.display, lineNumbers = cm.options.lineNumbers; - var container = display.lineDiv, cur = container.firstChild; - - function rm(node) { - var next = node.nextSibling; - // Works around a throw-scroll bug in OS X Webkit - if (webkit && mac && cm.display.currentWheelTarget == node) - { node.style.display = "none"; } - else - { node.parentNode.removeChild(node); } - return next - } - - var view = display.view, lineN = display.viewFrom; - // Loop over the elements in the view, syncing cur (the DOM nodes - // in display.lineDiv) with the view as we go. - for (var i = 0; i < view.length; i++) { - var lineView = view[i]; - if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet - var node = buildLineElement(cm, lineView, lineN, dims); - container.insertBefore(node, cur); - } else { // Already drawn - while (cur != lineView.node) { cur = rm(cur); } - var updateNumber = lineNumbers && updateNumbersFrom != null && - updateNumbersFrom <= lineN && lineView.lineNumber; - if (lineView.changes) { - if (indexOf(lineView.changes, "gutter") > -1) { updateNumber = false; } - updateLineForChanges(cm, lineView, lineN, dims); - } - if (updateNumber) { - removeChildren(lineView.lineNumber); - lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN))); - } - cur = lineView.node.nextSibling; - } - lineN += lineView.size; - } - while (cur) { cur = rm(cur); } - } - - function updateGutterSpace(display) { - var width = display.gutters.offsetWidth; - display.sizer.style.marginLeft = width + "px"; - // Send an event to consumers responding to changes in gutter width. - signalLater(display, "gutterChanged", display); - } - - function setDocumentHeight(cm, measure) { - cm.display.sizer.style.minHeight = measure.docHeight + "px"; - cm.display.heightForcer.style.top = measure.docHeight + "px"; - cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + "px"; - } - - // Re-align line numbers and gutter marks to compensate for - // horizontal scrolling. - function alignHorizontally(cm) { - var display = cm.display, view = display.view; - if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return } - var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft; - var gutterW = display.gutters.offsetWidth, left = comp + "px"; - for (var i = 0; i < view.length; i++) { if (!view[i].hidden) { - if (cm.options.fixedGutter) { - if (view[i].gutter) - { view[i].gutter.style.left = left; } - if (view[i].gutterBackground) - { view[i].gutterBackground.style.left = left; } - } - var align = view[i].alignable; - if (align) { for (var j = 0; j < align.length; j++) - { align[j].style.left = left; } } - } } - if (cm.options.fixedGutter) - { display.gutters.style.left = (comp + gutterW) + "px"; } - } - - // Used to ensure that the line number gutter is still the right - // size for the current document size. Returns true when an update - // is needed. - function maybeUpdateLineNumberWidth(cm) { - if (!cm.options.lineNumbers) { return false } - var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display; - if (last.length != display.lineNumChars) { - var test = display.measure.appendChild(elt("div", [elt("div", last)], - "CodeMirror-linenumber CodeMirror-gutter-elt")); - var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW; - display.lineGutter.style.width = ""; - display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1; - display.lineNumWidth = display.lineNumInnerWidth + padding; - display.lineNumChars = display.lineNumInnerWidth ? last.length : -1; - display.lineGutter.style.width = display.lineNumWidth + "px"; - updateGutterSpace(cm.display); - return true - } - return false - } - - function getGutters(gutters, lineNumbers) { - var result = [], sawLineNumbers = false; - for (var i = 0; i < gutters.length; i++) { - var name = gutters[i], style = null; - if (typeof name != "string") { style = name.style; name = name.className; } - if (name == "CodeMirror-linenumbers") { - if (!lineNumbers) { continue } - else { sawLineNumbers = true; } - } - result.push({className: name, style: style}); - } - if (lineNumbers && !sawLineNumbers) { result.push({className: "CodeMirror-linenumbers", style: null}); } - return result - } - - // Rebuild the gutter elements, ensure the margin to the left of the - // code matches their width. - function renderGutters(display) { - var gutters = display.gutters, specs = display.gutterSpecs; - removeChildren(gutters); - display.lineGutter = null; - for (var i = 0; i < specs.length; ++i) { - var ref = specs[i]; - var className = ref.className; - var style = ref.style; - var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + className)); - if (style) { gElt.style.cssText = style; } - if (className == "CodeMirror-linenumbers") { - display.lineGutter = gElt; - gElt.style.width = (display.lineNumWidth || 1) + "px"; - } - } - gutters.style.display = specs.length ? "" : "none"; - updateGutterSpace(display); - } - - function updateGutters(cm) { - renderGutters(cm.display); - regChange(cm); - alignHorizontally(cm); - } - - // The display handles the DOM integration, both for input reading - // and content drawing. It holds references to DOM nodes and - // display-related state. - - function Display(place, doc, input, options) { - var d = this; - this.input = input; - - // Covers bottom-right square when both scrollbars are present. - d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler"); - d.scrollbarFiller.setAttribute("cm-not-content", "true"); - // Covers bottom of gutter when coverGutterNextToScrollbar is on - // and h scrollbar is present. - d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler"); - d.gutterFiller.setAttribute("cm-not-content", "true"); - // Will contain the actual code, positioned to cover the viewport. - d.lineDiv = eltP("div", null, "CodeMirror-code"); - // Elements are added to these to represent selection and cursors. - d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1"); - d.cursorDiv = elt("div", null, "CodeMirror-cursors"); - // A visibility: hidden element used to find the size of things. - d.measure = elt("div", null, "CodeMirror-measure"); - // When lines outside of the viewport are measured, they are drawn in this. - d.lineMeasure = elt("div", null, "CodeMirror-measure"); - // Wraps everything that needs to exist inside the vertically-padded coordinate system - d.lineSpace = eltP("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv], - null, "position: relative; outline: none"); - var lines = eltP("div", [d.lineSpace], "CodeMirror-lines"); - // Moved around its parent to cover visible view. - d.mover = elt("div", [lines], null, "position: relative"); - // Set to the height of the document, allowing scrolling. - d.sizer = elt("div", [d.mover], "CodeMirror-sizer"); - d.sizerWidth = null; - // Behavior of elts with overflow: auto and padding is - // inconsistent across browsers. This is used to ensure the - // scrollable area is big enough. - d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;"); - // Will contain the gutters, if any. - d.gutters = elt("div", null, "CodeMirror-gutters"); - d.lineGutter = null; - // Actual scrollable element. - d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll"); - d.scroller.setAttribute("tabIndex", "-1"); - // The element in which the editor lives. - d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror"); - - // This attribute is respected by automatic translation systems such as Google Translate, - // and may also be respected by tools used by human translators. - d.wrapper.setAttribute('translate', 'no'); - - // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported) - if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; } - if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; } - - if (place) { - if (place.appendChild) { place.appendChild(d.wrapper); } - else { place(d.wrapper); } - } - - // Current rendered range (may be bigger than the view window). - d.viewFrom = d.viewTo = doc.first; - d.reportedViewFrom = d.reportedViewTo = doc.first; - // Information about the rendered lines. - d.view = []; - d.renderedView = null; - // Holds info about a single rendered line when it was rendered - // for measurement, while not in view. - d.externalMeasured = null; - // Empty space (in pixels) above the view - d.viewOffset = 0; - d.lastWrapHeight = d.lastWrapWidth = 0; - d.updateLineNumbers = null; - - d.nativeBarWidth = d.barHeight = d.barWidth = 0; - d.scrollbarsClipped = false; - - // Used to only resize the line number gutter when necessary (when - // the amount of lines crosses a boundary that makes its width change) - d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null; - // Set to true when a non-horizontal-scrolling line widget is - // added. As an optimization, line widget aligning is skipped when - // this is false. - d.alignWidgets = false; - - d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; - - // Tracks the maximum line length so that the horizontal scrollbar - // can be kept static when scrolling. - d.maxLine = null; - d.maxLineLength = 0; - d.maxLineChanged = false; - - // Used for measuring wheel scrolling granularity - d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null; - - // True when shift is held down. - d.shift = false; - - // Used to track whether anything happened since the context menu - // was opened. - d.selForContextMenu = null; - - d.activeTouch = null; - - d.gutterSpecs = getGutters(options.gutters, options.lineNumbers); - renderGutters(d); - - input.init(d); - } - - // Since the delta values reported on mouse wheel events are - // unstandardized between browsers and even browser versions, and - // generally horribly unpredictable, this code starts by measuring - // the scroll effect that the first few mouse wheel events have, - // and, from that, detects the way it can convert deltas to pixel - // offsets afterwards. - // - // The reason we want to know the amount a wheel event will scroll - // is that it gives us a chance to update the display before the - // actual scrolling happens, reducing flickering. - - var wheelSamples = 0, wheelPixelsPerUnit = null; - // Fill in a browser-detected starting value on browsers where we - // know one. These don't have to be accurate -- the result of them - // being wrong would just be a slight flicker on the first wheel - // scroll (if it is large enough). - if (ie) { wheelPixelsPerUnit = -.53; } - else if (gecko) { wheelPixelsPerUnit = 15; } - else if (chrome) { wheelPixelsPerUnit = -.7; } - else if (safari) { wheelPixelsPerUnit = -1/3; } - - function wheelEventDelta(e) { - var dx = e.wheelDeltaX, dy = e.wheelDeltaY; - if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; } - if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; } - else if (dy == null) { dy = e.wheelDelta; } - return {x: dx, y: dy} - } - function wheelEventPixels(e) { - var delta = wheelEventDelta(e); - delta.x *= wheelPixelsPerUnit; - delta.y *= wheelPixelsPerUnit; - return delta - } - - function onScrollWheel(cm, e) { - var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y; - var pixelsPerUnit = wheelPixelsPerUnit; - if (e.deltaMode === 0) { - dx = e.deltaX; - dy = e.deltaY; - pixelsPerUnit = 1; - } - - var display = cm.display, scroll = display.scroller; - // Quit if there's nothing to scroll here - var canScrollX = scroll.scrollWidth > scroll.clientWidth; - var canScrollY = scroll.scrollHeight > scroll.clientHeight; - if (!(dx && canScrollX || dy && canScrollY)) { return } - - // Webkit browsers on OS X abort momentum scrolls when the target - // of the scroll event is removed from the scrollable element. - // This hack (see related code in patchDisplay) makes sure the - // element is kept around. - if (dy && mac && webkit) { - outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) { - for (var i = 0; i < view.length; i++) { - if (view[i].node == cur) { - cm.display.currentWheelTarget = cur; - break outer - } - } - } - } - - // On some browsers, horizontal scrolling will cause redraws to - // happen before the gutter has been realigned, causing it to - // wriggle around in a most unseemly way. When we have an - // estimated pixels/delta value, we just handle horizontal - // scrolling entirely here. It'll be slightly off from native, but - // better than glitching out. - if (dx && !gecko && !presto && pixelsPerUnit != null) { - if (dy && canScrollY) - { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * pixelsPerUnit)); } - setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * pixelsPerUnit)); - // Only prevent default scrolling if vertical scrolling is - // actually possible. Otherwise, it causes vertical scroll - // jitter on OSX trackpads when deltaX is small and deltaY - // is large (issue #3579) - if (!dy || (dy && canScrollY)) - { e_preventDefault(e); } - display.wheelStartX = null; // Abort measurement, if in progress - return - } - - // 'Project' the visible viewport to cover the area that is being - // scrolled into view (if we know enough to estimate it). - if (dy && pixelsPerUnit != null) { - var pixels = dy * pixelsPerUnit; - var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight; - if (pixels < 0) { top = Math.max(0, top + pixels - 50); } - else { bot = Math.min(cm.doc.height, bot + pixels + 50); } - updateDisplaySimple(cm, {top: top, bottom: bot}); - } - - if (wheelSamples < 20 && e.deltaMode !== 0) { - if (display.wheelStartX == null) { - display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop; - display.wheelDX = dx; display.wheelDY = dy; - setTimeout(function () { - if (display.wheelStartX == null) { return } - var movedX = scroll.scrollLeft - display.wheelStartX; - var movedY = scroll.scrollTop - display.wheelStartY; - var sample = (movedY && display.wheelDY && movedY / display.wheelDY) || - (movedX && display.wheelDX && movedX / display.wheelDX); - display.wheelStartX = display.wheelStartY = null; - if (!sample) { return } - wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1); - ++wheelSamples; - }, 200); - } else { - display.wheelDX += dx; display.wheelDY += dy; - } - } - } - - // Selection objects are immutable. A new one is created every time - // the selection changes. A selection is one or more non-overlapping - // (and non-touching) ranges, sorted, and an integer that indicates - // which one is the primary selection (the one that's scrolled into - // view, that getCursor returns, etc). - var Selection = function(ranges, primIndex) { - this.ranges = ranges; - this.primIndex = primIndex; - }; - - Selection.prototype.primary = function () { return this.ranges[this.primIndex] }; - - Selection.prototype.equals = function (other) { - if (other == this) { return true } - if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false } - for (var i = 0; i < this.ranges.length; i++) { - var here = this.ranges[i], there = other.ranges[i]; - if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false } - } - return true - }; - - Selection.prototype.deepCopy = function () { - var out = []; - for (var i = 0; i < this.ranges.length; i++) - { out[i] = new Range(copyPos(this.ranges[i].anchor), copyPos(this.ranges[i].head)); } - return new Selection(out, this.primIndex) - }; - - Selection.prototype.somethingSelected = function () { - for (var i = 0; i < this.ranges.length; i++) - { if (!this.ranges[i].empty()) { return true } } - return false - }; - - Selection.prototype.contains = function (pos, end) { - if (!end) { end = pos; } - for (var i = 0; i < this.ranges.length; i++) { - var range = this.ranges[i]; - if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0) - { return i } - } - return -1 - }; - - var Range = function(anchor, head) { - this.anchor = anchor; this.head = head; - }; - - Range.prototype.from = function () { return minPos(this.anchor, this.head) }; - Range.prototype.to = function () { return maxPos(this.anchor, this.head) }; - Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch }; - - // Take an unsorted, potentially overlapping set of ranges, and - // build a selection out of it. 'Consumes' ranges array (modifying - // it). - function normalizeSelection(cm, ranges, primIndex) { - var mayTouch = cm && cm.options.selectionsMayTouch; - var prim = ranges[primIndex]; - ranges.sort(function (a, b) { return cmp(a.from(), b.from()); }); - primIndex = indexOf(ranges, prim); - for (var i = 1; i < ranges.length; i++) { - var cur = ranges[i], prev = ranges[i - 1]; - var diff = cmp(prev.to(), cur.from()); - if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) { - var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to()); - var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head; - if (i <= primIndex) { --primIndex; } - ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to)); - } - } - return new Selection(ranges, primIndex) - } - - function simpleSelection(anchor, head) { - return new Selection([new Range(anchor, head || anchor)], 0) - } - - // Compute the position of the end of a change (its 'to' property - // refers to the pre-change end). - function changeEnd(change) { - if (!change.text) { return change.to } - return Pos(change.from.line + change.text.length - 1, - lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0)) - } - - // Adjust a position to refer to the post-change position of the - // same text, or the end of the change if the change covers it. - function adjustForChange(pos, change) { - if (cmp(pos, change.from) < 0) { return pos } - if (cmp(pos, change.to) <= 0) { return changeEnd(change) } - - var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch; - if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; } - return Pos(line, ch) - } - - function computeSelAfterChange(doc, change) { - var out = []; - for (var i = 0; i < doc.sel.ranges.length; i++) { - var range = doc.sel.ranges[i]; - out.push(new Range(adjustForChange(range.anchor, change), - adjustForChange(range.head, change))); - } - return normalizeSelection(doc.cm, out, doc.sel.primIndex) - } - - function offsetPos(pos, old, nw) { - if (pos.line == old.line) - { return Pos(nw.line, pos.ch - old.ch + nw.ch) } - else - { return Pos(nw.line + (pos.line - old.line), pos.ch) } - } - - // Used by replaceSelections to allow moving the selection to the - // start or around the replaced test. Hint may be "start" or "around". - function computeReplacedSel(doc, changes, hint) { - var out = []; - var oldPrev = Pos(doc.first, 0), newPrev = oldPrev; - for (var i = 0; i < changes.length; i++) { - var change = changes[i]; - var from = offsetPos(change.from, oldPrev, newPrev); - var to = offsetPos(changeEnd(change), oldPrev, newPrev); - oldPrev = change.to; - newPrev = to; - if (hint == "around") { - var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0; - out[i] = new Range(inv ? to : from, inv ? from : to); - } else { - out[i] = new Range(from, from); - } - } - return new Selection(out, doc.sel.primIndex) - } - - // Used to get the editor into a consistent state again when options change. - - function loadMode(cm) { - cm.doc.mode = getMode(cm.options, cm.doc.modeOption); - resetModeState(cm); - } - - function resetModeState(cm) { - cm.doc.iter(function (line) { - if (line.stateAfter) { line.stateAfter = null; } - if (line.styles) { line.styles = null; } - }); - cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first; - startWorker(cm, 100); - cm.state.modeGen++; - if (cm.curOp) { regChange(cm); } - } - - // DOCUMENT DATA STRUCTURE - - // By default, updates that start and end at the beginning of a line - // are treated specially, in order to make the association of line - // widgets and marker elements with the text behave more intuitive. - function isWholeLineUpdate(doc, change) { - return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == "" && - (!doc.cm || doc.cm.options.wholeLineUpdateBefore) - } - - // Perform a change on the document data structure. - function updateDoc(doc, change, markedSpans, estimateHeight) { - function spansFor(n) {return markedSpans ? markedSpans[n] : null} - function update(line, text, spans) { - updateLine(line, text, spans, estimateHeight); - signalLater(line, "change", line, change); - } - function linesFor(start, end) { - var result = []; - for (var i = start; i < end; ++i) - { result.push(new Line(text[i], spansFor(i), estimateHeight)); } - return result - } - - var from = change.from, to = change.to, text = change.text; - var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line); - var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line; - - // Adjust the line structure - if (change.full) { - doc.insert(0, linesFor(0, text.length)); - doc.remove(text.length, doc.size - text.length); - } else if (isWholeLineUpdate(doc, change)) { - // This is a whole-line replace. Treated specially to make - // sure line objects move the way they are supposed to. - var added = linesFor(0, text.length - 1); - update(lastLine, lastLine.text, lastSpans); - if (nlines) { doc.remove(from.line, nlines); } - if (added.length) { doc.insert(from.line, added); } - } else if (firstLine == lastLine) { - if (text.length == 1) { - update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans); - } else { - var added$1 = linesFor(1, text.length - 1); - added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight)); - update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); - doc.insert(from.line + 1, added$1); - } - } else if (text.length == 1) { - update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0)); - doc.remove(from.line + 1, nlines); - } else { - update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); - update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans); - var added$2 = linesFor(1, text.length - 1); - if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); } - doc.insert(from.line + 1, added$2); - } - - signalLater(doc, "change", doc, change); - } - - // Call f for all linked documents. - function linkedDocs(doc, f, sharedHistOnly) { - function propagate(doc, skip, sharedHist) { - if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) { - var rel = doc.linked[i]; - if (rel.doc == skip) { continue } - var shared = sharedHist && rel.sharedHist; - if (sharedHistOnly && !shared) { continue } - f(rel.doc, shared); - propagate(rel.doc, doc, shared); - } } - } - propagate(doc, null, true); - } - - // Attach a document to an editor. - function attachDoc(cm, doc) { - if (doc.cm) { throw new Error("This document is already in use.") } - cm.doc = doc; - doc.cm = cm; - estimateLineHeights(cm); - loadMode(cm); - setDirectionClass(cm); - cm.options.direction = doc.direction; - if (!cm.options.lineWrapping) { findMaxLine(cm); } - cm.options.mode = doc.modeOption; - regChange(cm); - } - - function setDirectionClass(cm) { - (cm.doc.direction == "rtl" ? addClass : rmClass)(cm.display.lineDiv, "CodeMirror-rtl"); - } - - function directionChanged(cm) { - runInOp(cm, function () { - setDirectionClass(cm); - regChange(cm); - }); - } - - function History(prev) { - // Arrays of change events and selections. Doing something adds an - // event to done and clears undo. Undoing moves events from done - // to undone, redoing moves them in the other direction. - this.done = []; this.undone = []; - this.undoDepth = prev ? prev.undoDepth : Infinity; - // Used to track when changes can be merged into a single undo - // event - this.lastModTime = this.lastSelTime = 0; - this.lastOp = this.lastSelOp = null; - this.lastOrigin = this.lastSelOrigin = null; - // Used by the isClean() method - this.generation = this.maxGeneration = prev ? prev.maxGeneration : 1; - } - - // Create a history change event from an updateDoc-style change - // object. - function historyChangeFromChange(doc, change) { - var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)}; - attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); - linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true); - return histChange - } - - // Pop all selection events off the end of a history array. Stop at - // a change event. - function clearSelectionEvents(array) { - while (array.length) { - var last = lst(array); - if (last.ranges) { array.pop(); } - else { break } - } - } - - // Find the top change event in the history. Pop off selection - // events that are in the way. - function lastChangeEvent(hist, force) { - if (force) { - clearSelectionEvents(hist.done); - return lst(hist.done) - } else if (hist.done.length && !lst(hist.done).ranges) { - return lst(hist.done) - } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) { - hist.done.pop(); - return lst(hist.done) - } - } - - // Register a change in the history. Merges changes that are within - // a single operation, or are close together with an origin that - // allows merging (starting with "+") into a single event. - function addChangeToHistory(doc, change, selAfter, opId) { - var hist = doc.history; - hist.undone.length = 0; - var time = +new Date, cur; - var last; - - if ((hist.lastOp == opId || - hist.lastOrigin == change.origin && change.origin && - ((change.origin.charAt(0) == "+" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) || - change.origin.charAt(0) == "*")) && - (cur = lastChangeEvent(hist, hist.lastOp == opId))) { - // Merge this change into the last event - last = lst(cur.changes); - if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) { - // Optimized case for simple insertion -- don't want to add - // new changesets for every character typed - last.to = changeEnd(change); - } else { - // Add new sub-event - cur.changes.push(historyChangeFromChange(doc, change)); - } - } else { - // Can not be merged, start a new event. - var before = lst(hist.done); - if (!before || !before.ranges) - { pushSelectionToHistory(doc.sel, hist.done); } - cur = {changes: [historyChangeFromChange(doc, change)], - generation: hist.generation}; - hist.done.push(cur); - while (hist.done.length > hist.undoDepth) { - hist.done.shift(); - if (!hist.done[0].ranges) { hist.done.shift(); } - } - } - hist.done.push(selAfter); - hist.generation = ++hist.maxGeneration; - hist.lastModTime = hist.lastSelTime = time; - hist.lastOp = hist.lastSelOp = opId; - hist.lastOrigin = hist.lastSelOrigin = change.origin; - - if (!last) { signal(doc, "historyAdded"); } - } - - function selectionEventCanBeMerged(doc, origin, prev, sel) { - var ch = origin.charAt(0); - return ch == "*" || - ch == "+" && - prev.ranges.length == sel.ranges.length && - prev.somethingSelected() == sel.somethingSelected() && - new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500) - } - - // Called whenever the selection changes, sets the new selection as - // the pending selection in the history, and pushes the old pending - // selection into the 'done' array when it was significantly - // different (in number of selected ranges, emptiness, or time). - function addSelectionToHistory(doc, sel, opId, options) { - var hist = doc.history, origin = options && options.origin; - - // A new event is started when the previous origin does not match - // the current, or the origins don't allow matching. Origins - // starting with * are always merged, those starting with + are - // merged when similar and close together in time. - if (opId == hist.lastSelOp || - (origin && hist.lastSelOrigin == origin && - (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin || - selectionEventCanBeMerged(doc, origin, lst(hist.done), sel)))) - { hist.done[hist.done.length - 1] = sel; } - else - { pushSelectionToHistory(sel, hist.done); } - - hist.lastSelTime = +new Date; - hist.lastSelOrigin = origin; - hist.lastSelOp = opId; - if (options && options.clearRedo !== false) - { clearSelectionEvents(hist.undone); } - } - - function pushSelectionToHistory(sel, dest) { - var top = lst(dest); - if (!(top && top.ranges && top.equals(sel))) - { dest.push(sel); } - } - - // Used to store marked span information in the history. - function attachLocalSpans(doc, change, from, to) { - var existing = change["spans_" + doc.id], n = 0; - doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) { - if (line.markedSpans) - { (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans; } - ++n; - }); - } - - // When un/re-doing restores text containing marked spans, those - // that have been explicitly cleared should not be restored. - function removeClearedSpans(spans) { - if (!spans) { return null } - var out; - for (var i = 0; i < spans.length; ++i) { - if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } } - else if (out) { out.push(spans[i]); } - } - return !out ? spans : out.length ? out : null - } - - // Retrieve and filter the old marked spans stored in a change event. - function getOldSpans(doc, change) { - var found = change["spans_" + doc.id]; - if (!found) { return null } - var nw = []; - for (var i = 0; i < change.text.length; ++i) - { nw.push(removeClearedSpans(found[i])); } - return nw - } - - // Used for un/re-doing changes from the history. Combines the - // result of computing the existing spans with the set of spans that - // existed in the history (so that deleting around a span and then - // undoing brings back the span). - function mergeOldSpans(doc, change) { - var old = getOldSpans(doc, change); - var stretched = stretchSpansOverChange(doc, change); - if (!old) { return stretched } - if (!stretched) { return old } - - for (var i = 0; i < old.length; ++i) { - var oldCur = old[i], stretchCur = stretched[i]; - if (oldCur && stretchCur) { - spans: for (var j = 0; j < stretchCur.length; ++j) { - var span = stretchCur[j]; - for (var k = 0; k < oldCur.length; ++k) - { if (oldCur[k].marker == span.marker) { continue spans } } - oldCur.push(span); - } - } else if (stretchCur) { - old[i] = stretchCur; - } - } - return old - } - - // Used both to provide a JSON-safe object in .getHistory, and, when - // detaching a document, to split the history in two - function copyHistoryArray(events, newGroup, instantiateSel) { - var copy = []; - for (var i = 0; i < events.length; ++i) { - var event = events[i]; - if (event.ranges) { - copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event); - continue - } - var changes = event.changes, newChanges = []; - copy.push({changes: newChanges}); - for (var j = 0; j < changes.length; ++j) { - var change = changes[j], m = (void 0); - newChanges.push({from: change.from, to: change.to, text: change.text}); - if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\d+)$/)) { - if (indexOf(newGroup, Number(m[1])) > -1) { - lst(newChanges)[prop] = change[prop]; - delete change[prop]; - } - } } } - } - } - return copy - } - - // The 'scroll' parameter given to many of these indicated whether - // the new cursor position should be scrolled into view after - // modifying the selection. - - // If shift is held or the extend flag is set, extends a range to - // include a given position (and optionally a second position). - // Otherwise, simply returns the range between the given positions. - // Used for cursor motion and such. - function extendRange(range, head, other, extend) { - if (extend) { - var anchor = range.anchor; - if (other) { - var posBefore = cmp(head, anchor) < 0; - if (posBefore != (cmp(other, anchor) < 0)) { - anchor = head; - head = other; - } else if (posBefore != (cmp(head, other) < 0)) { - head = other; - } - } - return new Range(anchor, head) - } else { - return new Range(other || head, head) - } - } - - // Extend the primary selection range, discard the rest. - function extendSelection(doc, head, other, options, extend) { - if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); } - setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options); - } - - // Extend all selections (pos is an array of selections with length - // equal the number of selections) - function extendSelections(doc, heads, options) { - var out = []; - var extend = doc.cm && (doc.cm.display.shift || doc.extend); - for (var i = 0; i < doc.sel.ranges.length; i++) - { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); } - var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex); - setSelection(doc, newSel, options); - } - - // Updates a single range in the selection. - function replaceOneSelection(doc, i, range, options) { - var ranges = doc.sel.ranges.slice(0); - ranges[i] = range; - setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options); - } - - // Reset the selection to a single range. - function setSimpleSelection(doc, anchor, head, options) { - setSelection(doc, simpleSelection(anchor, head), options); - } - - // Give beforeSelectionChange handlers a change to influence a - // selection update. - function filterSelectionChange(doc, sel, options) { - var obj = { - ranges: sel.ranges, - update: function(ranges) { - this.ranges = []; - for (var i = 0; i < ranges.length; i++) - { this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor), - clipPos(doc, ranges[i].head)); } - }, - origin: options && options.origin - }; - signal(doc, "beforeSelectionChange", doc, obj); - if (doc.cm) { signal(doc.cm, "beforeSelectionChange", doc.cm, obj); } - if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) } - else { return sel } - } - - function setSelectionReplaceHistory(doc, sel, options) { - var done = doc.history.done, last = lst(done); - if (last && last.ranges) { - done[done.length - 1] = sel; - setSelectionNoUndo(doc, sel, options); - } else { - setSelection(doc, sel, options); - } - } - - // Set a new selection. - function setSelection(doc, sel, options) { - setSelectionNoUndo(doc, sel, options); - addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options); - } - - function setSelectionNoUndo(doc, sel, options) { - if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange")) - { sel = filterSelectionChange(doc, sel, options); } - - var bias = options && options.bias || - (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1); - setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true)); - - if (!(options && options.scroll === false) && doc.cm && doc.cm.getOption("readOnly") != "nocursor") - { ensureCursorVisible(doc.cm); } - } - - function setSelectionInner(doc, sel) { - if (sel.equals(doc.sel)) { return } - - doc.sel = sel; - - if (doc.cm) { - doc.cm.curOp.updateInput = 1; - doc.cm.curOp.selectionChanged = true; - signalCursorActivity(doc.cm); - } - signalLater(doc, "cursorActivity", doc); - } - - // Verify that the selection does not partially select any atomic - // marked ranges. - function reCheckSelection(doc) { - setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false)); - } - - // Return a selection that does not partially select any atomic - // ranges. - function skipAtomicInSelection(doc, sel, bias, mayClear) { - var out; - for (var i = 0; i < sel.ranges.length; i++) { - var range = sel.ranges[i]; - var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i]; - var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear); - var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear); - if (out || newAnchor != range.anchor || newHead != range.head) { - if (!out) { out = sel.ranges.slice(0, i); } - out[i] = new Range(newAnchor, newHead); - } - } - return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel - } - - function skipAtomicInner(doc, pos, oldPos, dir, mayClear) { - var line = getLine(doc, pos.line); - if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) { - var sp = line.markedSpans[i], m = sp.marker; - - // Determine if we should prevent the cursor being placed to the left/right of an atomic marker - // Historically this was determined using the inclusiveLeft/Right option, but the new way to control it - // is with selectLeft/Right - var preventCursorLeft = ("selectLeft" in m) ? !m.selectLeft : m.inclusiveLeft; - var preventCursorRight = ("selectRight" in m) ? !m.selectRight : m.inclusiveRight; - - if ((sp.from == null || (preventCursorLeft ? sp.from <= pos.ch : sp.from < pos.ch)) && - (sp.to == null || (preventCursorRight ? sp.to >= pos.ch : sp.to > pos.ch))) { - if (mayClear) { - signal(m, "beforeCursorEnter"); - if (m.explicitlyCleared) { - if (!line.markedSpans) { break } - else {--i; continue} - } - } - if (!m.atomic) { continue } - - if (oldPos) { - var near = m.find(dir < 0 ? 1 : -1), diff = (void 0); - if (dir < 0 ? preventCursorRight : preventCursorLeft) - { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); } - if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0)) - { return skipAtomicInner(doc, near, pos, dir, mayClear) } - } - - var far = m.find(dir < 0 ? -1 : 1); - if (dir < 0 ? preventCursorLeft : preventCursorRight) - { far = movePos(doc, far, dir, far.line == pos.line ? line : null); } - return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null - } - } } - return pos - } - - // Ensure a given position is not inside an atomic range. - function skipAtomic(doc, pos, oldPos, bias, mayClear) { - var dir = bias || 1; - var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) || - (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) || - skipAtomicInner(doc, pos, oldPos, -dir, mayClear) || - (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true)); - if (!found) { - doc.cantEdit = true; - return Pos(doc.first, 0) - } - return found - } - - function movePos(doc, pos, dir, line) { - if (dir < 0 && pos.ch == 0) { - if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) } - else { return null } - } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) { - if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) } - else { return null } - } else { - return new Pos(pos.line, pos.ch + dir) - } - } - - function selectAll(cm) { - cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll); - } - - // UPDATING - - // Allow "beforeChange" event handlers to influence a change - function filterChange(doc, change, update) { - var obj = { - canceled: false, - from: change.from, - to: change.to, - text: change.text, - origin: change.origin, - cancel: function () { return obj.canceled = true; } - }; - if (update) { obj.update = function (from, to, text, origin) { - if (from) { obj.from = clipPos(doc, from); } - if (to) { obj.to = clipPos(doc, to); } - if (text) { obj.text = text; } - if (origin !== undefined) { obj.origin = origin; } - }; } - signal(doc, "beforeChange", doc, obj); - if (doc.cm) { signal(doc.cm, "beforeChange", doc.cm, obj); } - - if (obj.canceled) { - if (doc.cm) { doc.cm.curOp.updateInput = 2; } - return null - } - return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin} - } - - // Apply a change to a document, and add it to the document's - // history, and propagating it to all linked documents. - function makeChange(doc, change, ignoreReadOnly) { - if (doc.cm) { - if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) } - if (doc.cm.state.suppressEdits) { return } - } - - if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) { - change = filterChange(doc, change, true); - if (!change) { return } - } - - // Possibly split or suppress the update based on the presence - // of read-only spans in its range. - var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to); - if (split) { - for (var i = split.length - 1; i >= 0; --i) - { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [""] : change.text, origin: change.origin}); } - } else { - makeChangeInner(doc, change); - } - } - - function makeChangeInner(doc, change) { - if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) { return } - var selAfter = computeSelAfterChange(doc, change); - addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN); - - makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change)); - var rebased = []; - - linkedDocs(doc, function (doc, sharedHist) { - if (!sharedHist && indexOf(rebased, doc.history) == -1) { - rebaseHist(doc.history, change); - rebased.push(doc.history); - } - makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change)); - }); - } - - // Revert a change stored in a document's history. - function makeChangeFromHistory(doc, type, allowSelectionOnly) { - var suppress = doc.cm && doc.cm.state.suppressEdits; - if (suppress && !allowSelectionOnly) { return } - - var hist = doc.history, event, selAfter = doc.sel; - var source = type == "undo" ? hist.done : hist.undone, dest = type == "undo" ? hist.undone : hist.done; - - // Verify that there is a useable event (so that ctrl-z won't - // needlessly clear selection events) - var i = 0; - for (; i < source.length; i++) { - event = source[i]; - if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges) - { break } - } - if (i == source.length) { return } - hist.lastOrigin = hist.lastSelOrigin = null; - - for (;;) { - event = source.pop(); - if (event.ranges) { - pushSelectionToHistory(event, dest); - if (allowSelectionOnly && !event.equals(doc.sel)) { - setSelection(doc, event, {clearRedo: false}); - return - } - selAfter = event; - } else if (suppress) { - source.push(event); - return - } else { break } - } - - // Build up a reverse change object to add to the opposite history - // stack (redo when undoing, and vice versa). - var antiChanges = []; - pushSelectionToHistory(selAfter, dest); - dest.push({changes: antiChanges, generation: hist.generation}); - hist.generation = event.generation || ++hist.maxGeneration; - - var filter = hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange"); - - var loop = function ( i ) { - var change = event.changes[i]; - change.origin = type; - if (filter && !filterChange(doc, change, false)) { - source.length = 0; - return {} - } - - antiChanges.push(historyChangeFromChange(doc, change)); - - var after = i ? computeSelAfterChange(doc, change) : lst(source); - makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change)); - if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); } - var rebased = []; - - // Propagate to the linked documents - linkedDocs(doc, function (doc, sharedHist) { - if (!sharedHist && indexOf(rebased, doc.history) == -1) { - rebaseHist(doc.history, change); - rebased.push(doc.history); - } - makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change)); - }); - }; - - for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) { - var returned = loop( i$1 ); - - if ( returned ) return returned.v; - } - } - - // Sub-views need their line numbers shifted when text is added - // above or below them in the parent document. - function shiftDoc(doc, distance) { - if (distance == 0) { return } - doc.first += distance; - doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range( - Pos(range.anchor.line + distance, range.anchor.ch), - Pos(range.head.line + distance, range.head.ch) - ); }), doc.sel.primIndex); - if (doc.cm) { - regChange(doc.cm, doc.first, doc.first - distance, distance); - for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++) - { regLineChange(doc.cm, l, "gutter"); } - } - } - - // More lower-level change function, handling only a single document - // (not linked ones). - function makeChangeSingleDoc(doc, change, selAfter, spans) { - if (doc.cm && !doc.cm.curOp) - { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) } - - if (change.to.line < doc.first) { - shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line)); - return - } - if (change.from.line > doc.lastLine()) { return } - - // Clip the change to the size of this doc - if (change.from.line < doc.first) { - var shift = change.text.length - 1 - (doc.first - change.from.line); - shiftDoc(doc, shift); - change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch), - text: [lst(change.text)], origin: change.origin}; - } - var last = doc.lastLine(); - if (change.to.line > last) { - change = {from: change.from, to: Pos(last, getLine(doc, last).text.length), - text: [change.text[0]], origin: change.origin}; - } - - change.removed = getBetween(doc, change.from, change.to); - - if (!selAfter) { selAfter = computeSelAfterChange(doc, change); } - if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans); } - else { updateDoc(doc, change, spans); } - setSelectionNoUndo(doc, selAfter, sel_dontScroll); - - if (doc.cantEdit && skipAtomic(doc, Pos(doc.firstLine(), 0))) - { doc.cantEdit = false; } - } - - // Handle the interaction of a change to a document with the editor - // that this document is part of. - function makeChangeSingleDocInEditor(cm, change, spans) { - var doc = cm.doc, display = cm.display, from = change.from, to = change.to; - - var recomputeMaxLength = false, checkWidthStart = from.line; - if (!cm.options.lineWrapping) { - checkWidthStart = lineNo(visualLine(getLine(doc, from.line))); - doc.iter(checkWidthStart, to.line + 1, function (line) { - if (line == display.maxLine) { - recomputeMaxLength = true; - return true - } - }); - } - - if (doc.sel.contains(change.from, change.to) > -1) - { signalCursorActivity(cm); } - - updateDoc(doc, change, spans, estimateHeight(cm)); - - if (!cm.options.lineWrapping) { - doc.iter(checkWidthStart, from.line + change.text.length, function (line) { - var len = lineLength(line); - if (len > display.maxLineLength) { - display.maxLine = line; - display.maxLineLength = len; - display.maxLineChanged = true; - recomputeMaxLength = false; - } - }); - if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; } - } - - retreatFrontier(doc, from.line); - startWorker(cm, 400); - - var lendiff = change.text.length - (to.line - from.line) - 1; - // Remember that these lines changed, for updating the display - if (change.full) - { regChange(cm); } - else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change)) - { regLineChange(cm, from.line, "text"); } - else - { regChange(cm, from.line, to.line + 1, lendiff); } - - var changesHandler = hasHandler(cm, "changes"), changeHandler = hasHandler(cm, "change"); - if (changeHandler || changesHandler) { - var obj = { - from: from, to: to, - text: change.text, - removed: change.removed, - origin: change.origin - }; - if (changeHandler) { signalLater(cm, "change", cm, obj); } - if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); } - } - cm.display.selForContextMenu = null; - } - - function replaceRange(doc, code, from, to, origin) { - var assign; - - if (!to) { to = from; } - if (cmp(to, from) < 0) { (assign = [to, from], from = assign[0], to = assign[1]); } - if (typeof code == "string") { code = doc.splitLines(code); } - makeChange(doc, {from: from, to: to, text: code, origin: origin}); - } - - // Rebasing/resetting history to deal with externally-sourced changes - - function rebaseHistSelSingle(pos, from, to, diff) { - if (to < pos.line) { - pos.line += diff; - } else if (from < pos.line) { - pos.line = from; - pos.ch = 0; - } - } - - // Tries to rebase an array of history events given a change in the - // document. If the change touches the same lines as the event, the - // event, and everything 'behind' it, is discarded. If the change is - // before the event, the event's positions are updated. Uses a - // copy-on-write scheme for the positions, to avoid having to - // reallocate them all on every rebase, but also avoid problems with - // shared position objects being unsafely updated. - function rebaseHistArray(array, from, to, diff) { - for (var i = 0; i < array.length; ++i) { - var sub = array[i], ok = true; - if (sub.ranges) { - if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; } - for (var j = 0; j < sub.ranges.length; j++) { - rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff); - rebaseHistSelSingle(sub.ranges[j].head, from, to, diff); - } - continue - } - for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) { - var cur = sub.changes[j$1]; - if (to < cur.from.line) { - cur.from = Pos(cur.from.line + diff, cur.from.ch); - cur.to = Pos(cur.to.line + diff, cur.to.ch); - } else if (from <= cur.to.line) { - ok = false; - break - } - } - if (!ok) { - array.splice(0, i + 1); - i = 0; - } - } - } - - function rebaseHist(hist, change) { - var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1; - rebaseHistArray(hist.done, from, to, diff); - rebaseHistArray(hist.undone, from, to, diff); - } - - // Utility for applying a change to a line by handle or number, - // returning the number and optionally registering the line as - // changed. - function changeLine(doc, handle, changeType, op) { - var no = handle, line = handle; - if (typeof handle == "number") { line = getLine(doc, clipLine(doc, handle)); } - else { no = lineNo(handle); } - if (no == null) { return null } - if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); } - return line - } - - // The document is represented as a BTree consisting of leaves, with - // chunk of lines in them, and branches, with up to ten leaves or - // other branch nodes below them. The top node is always a branch - // node, and is the document object itself (meaning it has - // additional methods and properties). - // - // All nodes have parent links. The tree is used both to go from - // line numbers to line objects, and to go from objects to numbers. - // It also indexes by height, and is used to convert between height - // and line object, and to find the total height of the document. - // - // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html - - function LeafChunk(lines) { - this.lines = lines; - this.parent = null; - var height = 0; - for (var i = 0; i < lines.length; ++i) { - lines[i].parent = this; - height += lines[i].height; - } - this.height = height; - } - - LeafChunk.prototype = { - chunkSize: function() { return this.lines.length }, - - // Remove the n lines at offset 'at'. - removeInner: function(at, n) { - for (var i = at, e = at + n; i < e; ++i) { - var line = this.lines[i]; - this.height -= line.height; - cleanUpLine(line); - signalLater(line, "delete"); - } - this.lines.splice(at, n); - }, - - // Helper used to collapse a small branch into a single leaf. - collapse: function(lines) { - lines.push.apply(lines, this.lines); - }, - - // Insert the given array of lines at offset 'at', count them as - // having the given height. - insertInner: function(at, lines, height) { - this.height += height; - this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at)); - for (var i = 0; i < lines.length; ++i) { lines[i].parent = this; } - }, - - // Used to iterate over a part of the tree. - iterN: function(at, n, op) { - for (var e = at + n; at < e; ++at) - { if (op(this.lines[at])) { return true } } - } - }; - - function BranchChunk(children) { - this.children = children; - var size = 0, height = 0; - for (var i = 0; i < children.length; ++i) { - var ch = children[i]; - size += ch.chunkSize(); height += ch.height; - ch.parent = this; - } - this.size = size; - this.height = height; - this.parent = null; - } - - BranchChunk.prototype = { - chunkSize: function() { return this.size }, - - removeInner: function(at, n) { - this.size -= n; - for (var i = 0; i < this.children.length; ++i) { - var child = this.children[i], sz = child.chunkSize(); - if (at < sz) { - var rm = Math.min(n, sz - at), oldHeight = child.height; - child.removeInner(at, rm); - this.height -= oldHeight - child.height; - if (sz == rm) { this.children.splice(i--, 1); child.parent = null; } - if ((n -= rm) == 0) { break } - at = 0; - } else { at -= sz; } - } - // If the result is smaller than 25 lines, ensure that it is a - // single leaf node. - if (this.size - n < 25 && - (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) { - var lines = []; - this.collapse(lines); - this.children = [new LeafChunk(lines)]; - this.children[0].parent = this; - } - }, - - collapse: function(lines) { - for (var i = 0; i < this.children.length; ++i) { this.children[i].collapse(lines); } - }, - - insertInner: function(at, lines, height) { - this.size += lines.length; - this.height += height; - for (var i = 0; i < this.children.length; ++i) { - var child = this.children[i], sz = child.chunkSize(); - if (at <= sz) { - child.insertInner(at, lines, height); - if (child.lines && child.lines.length > 50) { - // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced. - // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest. - var remaining = child.lines.length % 25 + 25; - for (var pos = remaining; pos < child.lines.length;) { - var leaf = new LeafChunk(child.lines.slice(pos, pos += 25)); - child.height -= leaf.height; - this.children.splice(++i, 0, leaf); - leaf.parent = this; - } - child.lines = child.lines.slice(0, remaining); - this.maybeSpill(); - } - break - } - at -= sz; - } - }, - - // When a node has grown, check whether it should be split. - maybeSpill: function() { - if (this.children.length <= 10) { return } - var me = this; - do { - var spilled = me.children.splice(me.children.length - 5, 5); - var sibling = new BranchChunk(spilled); - if (!me.parent) { // Become the parent node - var copy = new BranchChunk(me.children); - copy.parent = me; - me.children = [copy, sibling]; - me = copy; - } else { - me.size -= sibling.size; - me.height -= sibling.height; - var myIndex = indexOf(me.parent.children, me); - me.parent.children.splice(myIndex + 1, 0, sibling); - } - sibling.parent = me.parent; - } while (me.children.length > 10) - me.parent.maybeSpill(); - }, - - iterN: function(at, n, op) { - for (var i = 0; i < this.children.length; ++i) { - var child = this.children[i], sz = child.chunkSize(); - if (at < sz) { - var used = Math.min(n, sz - at); - if (child.iterN(at, used, op)) { return true } - if ((n -= used) == 0) { break } - at = 0; - } else { at -= sz; } - } - } - }; - - // Line widgets are block elements displayed above or below a line. - - var LineWidget = function(doc, node, options) { - if (options) { for (var opt in options) { if (options.hasOwnProperty(opt)) - { this[opt] = options[opt]; } } } - this.doc = doc; - this.node = node; - }; - - LineWidget.prototype.clear = function () { - var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line); - if (no == null || !ws) { return } - for (var i = 0; i < ws.length; ++i) { if (ws[i] == this) { ws.splice(i--, 1); } } - if (!ws.length) { line.widgets = null; } - var height = widgetHeight(this); - updateLineHeight(line, Math.max(0, line.height - height)); - if (cm) { - runInOp(cm, function () { - adjustScrollWhenAboveVisible(cm, line, -height); - regLineChange(cm, no, "widget"); - }); - signalLater(cm, "lineWidgetCleared", cm, this, no); - } - }; - - LineWidget.prototype.changed = function () { - var this$1 = this; - - var oldH = this.height, cm = this.doc.cm, line = this.line; - this.height = null; - var diff = widgetHeight(this) - oldH; - if (!diff) { return } - if (!lineIsHidden(this.doc, line)) { updateLineHeight(line, line.height + diff); } - if (cm) { - runInOp(cm, function () { - cm.curOp.forceUpdate = true; - adjustScrollWhenAboveVisible(cm, line, diff); - signalLater(cm, "lineWidgetChanged", cm, this$1, lineNo(line)); - }); - } - }; - eventMixin(LineWidget); - - function adjustScrollWhenAboveVisible(cm, line, diff) { - if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop)) - { addToScrollTop(cm, diff); } - } - - function addLineWidget(doc, handle, node, options) { - var widget = new LineWidget(doc, node, options); - var cm = doc.cm; - if (cm && widget.noHScroll) { cm.display.alignWidgets = true; } - changeLine(doc, handle, "widget", function (line) { - var widgets = line.widgets || (line.widgets = []); - if (widget.insertAt == null) { widgets.push(widget); } - else { widgets.splice(Math.min(widgets.length, Math.max(0, widget.insertAt)), 0, widget); } - widget.line = line; - if (cm && !lineIsHidden(doc, line)) { - var aboveVisible = heightAtLine(line) < doc.scrollTop; - updateLineHeight(line, line.height + widgetHeight(widget)); - if (aboveVisible) { addToScrollTop(cm, widget.height); } - cm.curOp.forceUpdate = true; - } - return true - }); - if (cm) { signalLater(cm, "lineWidgetAdded", cm, widget, typeof handle == "number" ? handle : lineNo(handle)); } - return widget - } - - // TEXTMARKERS - - // Created with markText and setBookmark methods. A TextMarker is a - // handle that can be used to clear or find a marked position in the - // document. Line objects hold arrays (markedSpans) containing - // {from, to, marker} object pointing to such marker objects, and - // indicating that such a marker is present on that line. Multiple - // lines may point to the same marker when it spans across lines. - // The spans will have null for their from/to properties when the - // marker continues beyond the start/end of the line. Markers have - // links back to the lines they currently touch. - - // Collapsed markers have unique ids, in order to be able to order - // them, which is needed for uniquely determining an outer marker - // when they overlap (they may nest, but not partially overlap). - var nextMarkerId = 0; - - var TextMarker = function(doc, type) { - this.lines = []; - this.type = type; - this.doc = doc; - this.id = ++nextMarkerId; - }; - - // Clear the marker. - TextMarker.prototype.clear = function () { - if (this.explicitlyCleared) { return } - var cm = this.doc.cm, withOp = cm && !cm.curOp; - if (withOp) { startOperation(cm); } - if (hasHandler(this, "clear")) { - var found = this.find(); - if (found) { signalLater(this, "clear", found.from, found.to); } - } - var min = null, max = null; - for (var i = 0; i < this.lines.length; ++i) { - var line = this.lines[i]; - var span = getMarkedSpanFor(line.markedSpans, this); - if (cm && !this.collapsed) { regLineChange(cm, lineNo(line), "text"); } - else if (cm) { - if (span.to != null) { max = lineNo(line); } - if (span.from != null) { min = lineNo(line); } - } - line.markedSpans = removeMarkedSpan(line.markedSpans, span); - if (span.from == null && this.collapsed && !lineIsHidden(this.doc, line) && cm) - { updateLineHeight(line, textHeight(cm.display)); } - } - if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) { - var visual = visualLine(this.lines[i$1]), len = lineLength(visual); - if (len > cm.display.maxLineLength) { - cm.display.maxLine = visual; - cm.display.maxLineLength = len; - cm.display.maxLineChanged = true; - } - } } - - if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1); } - this.lines.length = 0; - this.explicitlyCleared = true; - if (this.atomic && this.doc.cantEdit) { - this.doc.cantEdit = false; - if (cm) { reCheckSelection(cm.doc); } - } - if (cm) { signalLater(cm, "markerCleared", cm, this, min, max); } - if (withOp) { endOperation(cm); } - if (this.parent) { this.parent.clear(); } - }; - - // Find the position of the marker in the document. Returns a {from, - // to} object by default. Side can be passed to get a specific side - // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the - // Pos objects returned contain a line object, rather than a line - // number (used to prevent looking up the same line twice). - TextMarker.prototype.find = function (side, lineObj) { - if (side == null && this.type == "bookmark") { side = 1; } - var from, to; - for (var i = 0; i < this.lines.length; ++i) { - var line = this.lines[i]; - var span = getMarkedSpanFor(line.markedSpans, this); - if (span.from != null) { - from = Pos(lineObj ? line : lineNo(line), span.from); - if (side == -1) { return from } - } - if (span.to != null) { - to = Pos(lineObj ? line : lineNo(line), span.to); - if (side == 1) { return to } - } - } - return from && {from: from, to: to} - }; - - // Signals that the marker's widget changed, and surrounding layout - // should be recomputed. - TextMarker.prototype.changed = function () { - var this$1 = this; - - var pos = this.find(-1, true), widget = this, cm = this.doc.cm; - if (!pos || !cm) { return } - runInOp(cm, function () { - var line = pos.line, lineN = lineNo(pos.line); - var view = findViewForLine(cm, lineN); - if (view) { - clearLineMeasurementCacheFor(view); - cm.curOp.selectionChanged = cm.curOp.forceUpdate = true; - } - cm.curOp.updateMaxLine = true; - if (!lineIsHidden(widget.doc, line) && widget.height != null) { - var oldHeight = widget.height; - widget.height = null; - var dHeight = widgetHeight(widget) - oldHeight; - if (dHeight) - { updateLineHeight(line, line.height + dHeight); } - } - signalLater(cm, "markerChanged", cm, this$1); - }); - }; - - TextMarker.prototype.attachLine = function (line) { - if (!this.lines.length && this.doc.cm) { - var op = this.doc.cm.curOp; - if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1) - { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); } - } - this.lines.push(line); - }; - - TextMarker.prototype.detachLine = function (line) { - this.lines.splice(indexOf(this.lines, line), 1); - if (!this.lines.length && this.doc.cm) { - var op = this.doc.cm.curOp - ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this); - } - }; - eventMixin(TextMarker); - - // Create a marker, wire it up to the right lines, and - function markText(doc, from, to, options, type) { - // Shared markers (across linked documents) are handled separately - // (markTextShared will call out to this again, once per - // document). - if (options && options.shared) { return markTextShared(doc, from, to, options, type) } - // Ensure we are in an operation. - if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) } - - var marker = new TextMarker(doc, type), diff = cmp(from, to); - if (options) { copyObj(options, marker, false); } - // Don't connect empty markers unless clearWhenEmpty is false - if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false) - { return marker } - if (marker.replacedWith) { - // Showing up as a widget implies collapsed (widget replaces text) - marker.collapsed = true; - marker.widgetNode = eltP("span", [marker.replacedWith], "CodeMirror-widget"); - if (!options.handleMouseEvents) { marker.widgetNode.setAttribute("cm-ignore-events", "true"); } - if (options.insertLeft) { marker.widgetNode.insertLeft = true; } - } - if (marker.collapsed) { - if (conflictingCollapsedRange(doc, from.line, from, to, marker) || - from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker)) - { throw new Error("Inserting collapsed marker partially overlapping an existing one") } - seeCollapsedSpans(); - } - - if (marker.addToHistory) - { addChangeToHistory(doc, {from: from, to: to, origin: "markText"}, doc.sel, NaN); } - - var curLine = from.line, cm = doc.cm, updateMaxLine; - doc.iter(curLine, to.line + 1, function (line) { - if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine) - { updateMaxLine = true; } - if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); } - addMarkedSpan(line, new MarkedSpan(marker, - curLine == from.line ? from.ch : null, - curLine == to.line ? to.ch : null), doc.cm && doc.cm.curOp); - ++curLine; - }); - // lineIsHidden depends on the presence of the spans, so needs a second pass - if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) { - if (lineIsHidden(doc, line)) { updateLineHeight(line, 0); } - }); } - - if (marker.clearOnEnter) { on(marker, "beforeCursorEnter", function () { return marker.clear(); }); } - - if (marker.readOnly) { - seeReadOnlySpans(); - if (doc.history.done.length || doc.history.undone.length) - { doc.clearHistory(); } - } - if (marker.collapsed) { - marker.id = ++nextMarkerId; - marker.atomic = true; - } - if (cm) { - // Sync editor state - if (updateMaxLine) { cm.curOp.updateMaxLine = true; } - if (marker.collapsed) - { regChange(cm, from.line, to.line + 1); } - else if (marker.className || marker.startStyle || marker.endStyle || marker.css || - marker.attributes || marker.title) - { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, "text"); } } - if (marker.atomic) { reCheckSelection(cm.doc); } - signalLater(cm, "markerAdded", cm, marker); - } - return marker - } - - // SHARED TEXTMARKERS - - // A shared marker spans multiple linked documents. It is - // implemented as a meta-marker-object controlling multiple normal - // markers. - var SharedTextMarker = function(markers, primary) { - this.markers = markers; - this.primary = primary; - for (var i = 0; i < markers.length; ++i) - { markers[i].parent = this; } - }; - - SharedTextMarker.prototype.clear = function () { - if (this.explicitlyCleared) { return } - this.explicitlyCleared = true; - for (var i = 0; i < this.markers.length; ++i) - { this.markers[i].clear(); } - signalLater(this, "clear"); - }; - - SharedTextMarker.prototype.find = function (side, lineObj) { - return this.primary.find(side, lineObj) - }; - eventMixin(SharedTextMarker); - - function markTextShared(doc, from, to, options, type) { - options = copyObj(options); - options.shared = false; - var markers = [markText(doc, from, to, options, type)], primary = markers[0]; - var widget = options.widgetNode; - linkedDocs(doc, function (doc) { - if (widget) { options.widgetNode = widget.cloneNode(true); } - markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type)); - for (var i = 0; i < doc.linked.length; ++i) - { if (doc.linked[i].isParent) { return } } - primary = lst(markers); - }); - return new SharedTextMarker(markers, primary) - } - - function findSharedMarkers(doc) { - return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; }) - } - - function copySharedMarkers(doc, markers) { - for (var i = 0; i < markers.length; i++) { - var marker = markers[i], pos = marker.find(); - var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to); - if (cmp(mFrom, mTo)) { - var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type); - marker.markers.push(subMark); - subMark.parent = marker; - } - } - } - - function detachSharedMarkers(markers) { - var loop = function ( i ) { - var marker = markers[i], linked = [marker.primary.doc]; - linkedDocs(marker.primary.doc, function (d) { return linked.push(d); }); - for (var j = 0; j < marker.markers.length; j++) { - var subMarker = marker.markers[j]; - if (indexOf(linked, subMarker.doc) == -1) { - subMarker.parent = null; - marker.markers.splice(j--, 1); - } - } - }; - - for (var i = 0; i < markers.length; i++) loop( i ); - } - - var nextDocId = 0; - var Doc = function(text, mode, firstLine, lineSep, direction) { - if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) } - if (firstLine == null) { firstLine = 0; } - - BranchChunk.call(this, [new LeafChunk([new Line("", null)])]); - this.first = firstLine; - this.scrollTop = this.scrollLeft = 0; - this.cantEdit = false; - this.cleanGeneration = 1; - this.modeFrontier = this.highlightFrontier = firstLine; - var start = Pos(firstLine, 0); - this.sel = simpleSelection(start); - this.history = new History(null); - this.id = ++nextDocId; - this.modeOption = mode; - this.lineSep = lineSep; - this.direction = (direction == "rtl") ? "rtl" : "ltr"; - this.extend = false; - - if (typeof text == "string") { text = this.splitLines(text); } - updateDoc(this, {from: start, to: start, text: text}); - setSelection(this, simpleSelection(start), sel_dontScroll); - }; - - Doc.prototype = createObj(BranchChunk.prototype, { - constructor: Doc, - // Iterate over the document. Supports two forms -- with only one - // argument, it calls that for each line in the document. With - // three, it iterates over the range given by the first two (with - // the second being non-inclusive). - iter: function(from, to, op) { - if (op) { this.iterN(from - this.first, to - from, op); } - else { this.iterN(this.first, this.first + this.size, from); } - }, - - // Non-public interface for adding and removing lines. - insert: function(at, lines) { - var height = 0; - for (var i = 0; i < lines.length; ++i) { height += lines[i].height; } - this.insertInner(at - this.first, lines, height); - }, - remove: function(at, n) { this.removeInner(at - this.first, n); }, - - // From here, the methods are part of the public interface. Most - // are also available from CodeMirror (editor) instances. - - getValue: function(lineSep) { - var lines = getLines(this, this.first, this.first + this.size); - if (lineSep === false) { return lines } - return lines.join(lineSep || this.lineSeparator()) - }, - setValue: docMethodOp(function(code) { - var top = Pos(this.first, 0), last = this.first + this.size - 1; - makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length), - text: this.splitLines(code), origin: "setValue", full: true}, true); - if (this.cm) { scrollToCoords(this.cm, 0, 0); } - setSelection(this, simpleSelection(top), sel_dontScroll); - }), - replaceRange: function(code, from, to, origin) { - from = clipPos(this, from); - to = to ? clipPos(this, to) : from; - replaceRange(this, code, from, to, origin); - }, - getRange: function(from, to, lineSep) { - var lines = getBetween(this, clipPos(this, from), clipPos(this, to)); - if (lineSep === false) { return lines } - if (lineSep === '') { return lines.join('') } - return lines.join(lineSep || this.lineSeparator()) - }, - - getLine: function(line) {var l = this.getLineHandle(line); return l && l.text}, - - getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }}, - getLineNumber: function(line) {return lineNo(line)}, - - getLineHandleVisualStart: function(line) { - if (typeof line == "number") { line = getLine(this, line); } - return visualLine(line) - }, - - lineCount: function() {return this.size}, - firstLine: function() {return this.first}, - lastLine: function() {return this.first + this.size - 1}, - - clipPos: function(pos) {return clipPos(this, pos)}, - - getCursor: function(start) { - var range = this.sel.primary(), pos; - if (start == null || start == "head") { pos = range.head; } - else if (start == "anchor") { pos = range.anchor; } - else if (start == "end" || start == "to" || start === false) { pos = range.to(); } - else { pos = range.from(); } - return pos - }, - listSelections: function() { return this.sel.ranges }, - somethingSelected: function() {return this.sel.somethingSelected()}, - - setCursor: docMethodOp(function(line, ch, options) { - setSimpleSelection(this, clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line), null, options); - }), - setSelection: docMethodOp(function(anchor, head, options) { - setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options); - }), - extendSelection: docMethodOp(function(head, other, options) { - extendSelection(this, clipPos(this, head), other && clipPos(this, other), options); - }), - extendSelections: docMethodOp(function(heads, options) { - extendSelections(this, clipPosArray(this, heads), options); - }), - extendSelectionsBy: docMethodOp(function(f, options) { - var heads = map(this.sel.ranges, f); - extendSelections(this, clipPosArray(this, heads), options); - }), - setSelections: docMethodOp(function(ranges, primary, options) { - if (!ranges.length) { return } - var out = []; - for (var i = 0; i < ranges.length; i++) - { out[i] = new Range(clipPos(this, ranges[i].anchor), - clipPos(this, ranges[i].head || ranges[i].anchor)); } - if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); } - setSelection(this, normalizeSelection(this.cm, out, primary), options); - }), - addSelection: docMethodOp(function(anchor, head, options) { - var ranges = this.sel.ranges.slice(0); - ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor))); - setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options); - }), - - getSelection: function(lineSep) { - var ranges = this.sel.ranges, lines; - for (var i = 0; i < ranges.length; i++) { - var sel = getBetween(this, ranges[i].from(), ranges[i].to()); - lines = lines ? lines.concat(sel) : sel; - } - if (lineSep === false) { return lines } - else { return lines.join(lineSep || this.lineSeparator()) } - }, - getSelections: function(lineSep) { - var parts = [], ranges = this.sel.ranges; - for (var i = 0; i < ranges.length; i++) { - var sel = getBetween(this, ranges[i].from(), ranges[i].to()); - if (lineSep !== false) { sel = sel.join(lineSep || this.lineSeparator()); } - parts[i] = sel; - } - return parts - }, - replaceSelection: function(code, collapse, origin) { - var dup = []; - for (var i = 0; i < this.sel.ranges.length; i++) - { dup[i] = code; } - this.replaceSelections(dup, collapse, origin || "+input"); - }, - replaceSelections: docMethodOp(function(code, collapse, origin) { - var changes = [], sel = this.sel; - for (var i = 0; i < sel.ranges.length; i++) { - var range = sel.ranges[i]; - changes[i] = {from: range.from(), to: range.to(), text: this.splitLines(code[i]), origin: origin}; - } - var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse); - for (var i$1 = changes.length - 1; i$1 >= 0; i$1--) - { makeChange(this, changes[i$1]); } - if (newSel) { setSelectionReplaceHistory(this, newSel); } - else if (this.cm) { ensureCursorVisible(this.cm); } - }), - undo: docMethodOp(function() {makeChangeFromHistory(this, "undo");}), - redo: docMethodOp(function() {makeChangeFromHistory(this, "redo");}), - undoSelection: docMethodOp(function() {makeChangeFromHistory(this, "undo", true);}), - redoSelection: docMethodOp(function() {makeChangeFromHistory(this, "redo", true);}), - - setExtending: function(val) {this.extend = val;}, - getExtending: function() {return this.extend}, - - historySize: function() { - var hist = this.history, done = 0, undone = 0; - for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done; } } - for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } } - return {undo: done, redo: undone} - }, - clearHistory: function() { - var this$1 = this; - - this.history = new History(this.history); - linkedDocs(this, function (doc) { return doc.history = this$1.history; }, true); - }, - - markClean: function() { - this.cleanGeneration = this.changeGeneration(true); - }, - changeGeneration: function(forceSplit) { - if (forceSplit) - { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; } - return this.history.generation - }, - isClean: function (gen) { - return this.history.generation == (gen || this.cleanGeneration) - }, - - getHistory: function() { - return {done: copyHistoryArray(this.history.done), - undone: copyHistoryArray(this.history.undone)} - }, - setHistory: function(histData) { - var hist = this.history = new History(this.history); - hist.done = copyHistoryArray(histData.done.slice(0), null, true); - hist.undone = copyHistoryArray(histData.undone.slice(0), null, true); - }, - - setGutterMarker: docMethodOp(function(line, gutterID, value) { - return changeLine(this, line, "gutter", function (line) { - var markers = line.gutterMarkers || (line.gutterMarkers = {}); - markers[gutterID] = value; - if (!value && isEmpty(markers)) { line.gutterMarkers = null; } - return true - }) - }), - - clearGutter: docMethodOp(function(gutterID) { - var this$1 = this; - - this.iter(function (line) { - if (line.gutterMarkers && line.gutterMarkers[gutterID]) { - changeLine(this$1, line, "gutter", function () { - line.gutterMarkers[gutterID] = null; - if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; } - return true - }); - } - }); - }), - - lineInfo: function(line) { - var n; - if (typeof line == "number") { - if (!isLine(this, line)) { return null } - n = line; - line = getLine(this, line); - if (!line) { return null } - } else { - n = lineNo(line); - if (n == null) { return null } - } - return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers, - textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass, - widgets: line.widgets} - }, - - addLineClass: docMethodOp(function(handle, where, cls) { - return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) { - var prop = where == "text" ? "textClass" - : where == "background" ? "bgClass" - : where == "gutter" ? "gutterClass" : "wrapClass"; - if (!line[prop]) { line[prop] = cls; } - else if (classTest(cls).test(line[prop])) { return false } - else { line[prop] += " " + cls; } - return true - }) - }), - removeLineClass: docMethodOp(function(handle, where, cls) { - return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) { - var prop = where == "text" ? "textClass" - : where == "background" ? "bgClass" - : where == "gutter" ? "gutterClass" : "wrapClass"; - var cur = line[prop]; - if (!cur) { return false } - else if (cls == null) { line[prop] = null; } - else { - var found = cur.match(classTest(cls)); - if (!found) { return false } - var end = found.index + found[0].length; - line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null; - } - return true - }) - }), - - addLineWidget: docMethodOp(function(handle, node, options) { - return addLineWidget(this, handle, node, options) - }), - removeLineWidget: function(widget) { widget.clear(); }, - - markText: function(from, to, options) { - return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || "range") - }, - setBookmark: function(pos, options) { - var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options), - insertLeft: options && options.insertLeft, - clearWhenEmpty: false, shared: options && options.shared, - handleMouseEvents: options && options.handleMouseEvents}; - pos = clipPos(this, pos); - return markText(this, pos, pos, realOpts, "bookmark") - }, - findMarksAt: function(pos) { - pos = clipPos(this, pos); - var markers = [], spans = getLine(this, pos.line).markedSpans; - if (spans) { for (var i = 0; i < spans.length; ++i) { - var span = spans[i]; - if ((span.from == null || span.from <= pos.ch) && - (span.to == null || span.to >= pos.ch)) - { markers.push(span.marker.parent || span.marker); } - } } - return markers - }, - findMarks: function(from, to, filter) { - from = clipPos(this, from); to = clipPos(this, to); - var found = [], lineNo = from.line; - this.iter(from.line, to.line + 1, function (line) { - var spans = line.markedSpans; - if (spans) { for (var i = 0; i < spans.length; i++) { - var span = spans[i]; - if (!(span.to != null && lineNo == from.line && from.ch >= span.to || - span.from == null && lineNo != from.line || - span.from != null && lineNo == to.line && span.from >= to.ch) && - (!filter || filter(span.marker))) - { found.push(span.marker.parent || span.marker); } - } } - ++lineNo; - }); - return found - }, - getAllMarks: function() { - var markers = []; - this.iter(function (line) { - var sps = line.markedSpans; - if (sps) { for (var i = 0; i < sps.length; ++i) - { if (sps[i].from != null) { markers.push(sps[i].marker); } } } - }); - return markers - }, - - posFromIndex: function(off) { - var ch, lineNo = this.first, sepSize = this.lineSeparator().length; - this.iter(function (line) { - var sz = line.text.length + sepSize; - if (sz > off) { ch = off; return true } - off -= sz; - ++lineNo; - }); - return clipPos(this, Pos(lineNo, ch)) - }, - indexFromPos: function (coords) { - coords = clipPos(this, coords); - var index = coords.ch; - if (coords.line < this.first || coords.ch < 0) { return 0 } - var sepSize = this.lineSeparator().length; - this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value - index += line.text.length + sepSize; - }); - return index - }, - - copy: function(copyHistory) { - var doc = new Doc(getLines(this, this.first, this.first + this.size), - this.modeOption, this.first, this.lineSep, this.direction); - doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft; - doc.sel = this.sel; - doc.extend = false; - if (copyHistory) { - doc.history.undoDepth = this.history.undoDepth; - doc.setHistory(this.getHistory()); - } - return doc - }, - - linkedDoc: function(options) { - if (!options) { options = {}; } - var from = this.first, to = this.first + this.size; - if (options.from != null && options.from > from) { from = options.from; } - if (options.to != null && options.to < to) { to = options.to; } - var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction); - if (options.sharedHist) { copy.history = this.history - ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist}); - copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}]; - copySharedMarkers(copy, findSharedMarkers(this)); - return copy - }, - unlinkDoc: function(other) { - if (other instanceof CodeMirror) { other = other.doc; } - if (this.linked) { for (var i = 0; i < this.linked.length; ++i) { - var link = this.linked[i]; - if (link.doc != other) { continue } - this.linked.splice(i, 1); - other.unlinkDoc(this); - detachSharedMarkers(findSharedMarkers(this)); - break - } } - // If the histories were shared, split them again - if (other.history == this.history) { - var splitIds = [other.id]; - linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true); - other.history = new History(null); - other.history.done = copyHistoryArray(this.history.done, splitIds); - other.history.undone = copyHistoryArray(this.history.undone, splitIds); - } - }, - iterLinkedDocs: function(f) {linkedDocs(this, f);}, - - getMode: function() {return this.mode}, - getEditor: function() {return this.cm}, - - splitLines: function(str) { - if (this.lineSep) { return str.split(this.lineSep) } - return splitLinesAuto(str) - }, - lineSeparator: function() { return this.lineSep || "\n" }, - - setDirection: docMethodOp(function (dir) { - if (dir != "rtl") { dir = "ltr"; } - if (dir == this.direction) { return } - this.direction = dir; - this.iter(function (line) { return line.order = null; }); - if (this.cm) { directionChanged(this.cm); } - }) - }); - - // Public alias. - Doc.prototype.eachLine = Doc.prototype.iter; - - // Kludge to work around strange IE behavior where it'll sometimes - // re-fire a series of drag-related events right after the drop (#1551) - var lastDrop = 0; - - function onDrop(e) { - var cm = this; - clearDragCursor(cm); - if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) - { return } - e_preventDefault(e); - if (ie) { lastDrop = +new Date; } - var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files; - if (!pos || cm.isReadOnly()) { return } - // Might be a file drop, in which case we simply extract the text - // and insert it. - if (files && files.length && window.FileReader && window.File) { - var n = files.length, text = Array(n), read = 0; - var markAsReadAndPasteIfAllFilesAreRead = function () { - if (++read == n) { - operation(cm, function () { - pos = clipPos(cm.doc, pos); - var change = {from: pos, to: pos, - text: cm.doc.splitLines( - text.filter(function (t) { return t != null; }).join(cm.doc.lineSeparator())), - origin: "paste"}; - makeChange(cm.doc, change); - setSelectionReplaceHistory(cm.doc, simpleSelection(clipPos(cm.doc, pos), clipPos(cm.doc, changeEnd(change)))); - })(); - } - }; - var readTextFromFile = function (file, i) { - if (cm.options.allowDropFileTypes && - indexOf(cm.options.allowDropFileTypes, file.type) == -1) { - markAsReadAndPasteIfAllFilesAreRead(); - return - } - var reader = new FileReader; - reader.onerror = function () { return markAsReadAndPasteIfAllFilesAreRead(); }; - reader.onload = function () { - var content = reader.result; - if (/[\x00-\x08\x0e-\x1f]{2}/.test(content)) { - markAsReadAndPasteIfAllFilesAreRead(); - return - } - text[i] = content; - markAsReadAndPasteIfAllFilesAreRead(); - }; - reader.readAsText(file); - }; - for (var i = 0; i < files.length; i++) { readTextFromFile(files[i], i); } - } else { // Normal drop - // Don't do a replace if the drop happened inside of the selected text. - if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) { - cm.state.draggingText(e); - // Ensure the editor is re-focused - setTimeout(function () { return cm.display.input.focus(); }, 20); - return - } - try { - var text$1 = e.dataTransfer.getData("Text"); - if (text$1) { - var selected; - if (cm.state.draggingText && !cm.state.draggingText.copy) - { selected = cm.listSelections(); } - setSelectionNoUndo(cm.doc, simpleSelection(pos, pos)); - if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1) - { replaceRange(cm.doc, "", selected[i$1].anchor, selected[i$1].head, "drag"); } } - cm.replaceSelection(text$1, "around", "paste"); - cm.display.input.focus(); - } - } - catch(e$1){} - } - } - - function onDragStart(cm, e) { - if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return } - if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return } - - e.dataTransfer.setData("Text", cm.getSelection()); - e.dataTransfer.effectAllowed = "copyMove"; - - // Use dummy image instead of default browsers image. - // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there. - if (e.dataTransfer.setDragImage && !safari) { - var img = elt("img", null, null, "position: fixed; left: 0; top: 0;"); - img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; - if (presto) { - img.width = img.height = 1; - cm.display.wrapper.appendChild(img); - // Force a relayout, or Opera won't use our image for some obscure reason - img._top = img.offsetTop; - } - e.dataTransfer.setDragImage(img, 0, 0); - if (presto) { img.parentNode.removeChild(img); } - } - } - - function onDragOver(cm, e) { - var pos = posFromMouse(cm, e); - if (!pos) { return } - var frag = document.createDocumentFragment(); - drawSelectionCursor(cm, pos, frag); - if (!cm.display.dragCursor) { - cm.display.dragCursor = elt("div", null, "CodeMirror-cursors CodeMirror-dragcursors"); - cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv); - } - removeChildrenAndAdd(cm.display.dragCursor, frag); - } - - function clearDragCursor(cm) { - if (cm.display.dragCursor) { - cm.display.lineSpace.removeChild(cm.display.dragCursor); - cm.display.dragCursor = null; - } - } - - // These must be handled carefully, because naively registering a - // handler for each editor will cause the editors to never be - // garbage collected. - - function forEachCodeMirror(f) { - if (!document.getElementsByClassName) { return } - var byClass = document.getElementsByClassName("CodeMirror"), editors = []; - for (var i = 0; i < byClass.length; i++) { - var cm = byClass[i].CodeMirror; - if (cm) { editors.push(cm); } - } - if (editors.length) { editors[0].operation(function () { - for (var i = 0; i < editors.length; i++) { f(editors[i]); } - }); } - } - - var globalsRegistered = false; - function ensureGlobalHandlers() { - if (globalsRegistered) { return } - registerGlobalHandlers(); - globalsRegistered = true; - } - function registerGlobalHandlers() { - // When the window resizes, we need to refresh active editors. - var resizeTimer; - on(window, "resize", function () { - if (resizeTimer == null) { resizeTimer = setTimeout(function () { - resizeTimer = null; - forEachCodeMirror(onResize); - }, 100); } - }); - // When the window loses focus, we want to show the editor as blurred - on(window, "blur", function () { return forEachCodeMirror(onBlur); }); - } - // Called when the window resizes - function onResize(cm) { - var d = cm.display; - // Might be a text scaling operation, clear size caches. - d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; - d.scrollbarsClipped = false; - cm.setSize(); - } - - var keyNames = { - 3: "Pause", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", - 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", - 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert", - 46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod", - 106: "*", 107: "=", 109: "-", 110: ".", 111: "/", 145: "ScrollLock", - 173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", - 221: "]", 222: "'", 224: "Mod", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete", - 63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert" - }; - - // Number keys - for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i); } - // Alphabetic keys - for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1); } - // Function keys - for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = "F" + i$2; } - - var keyMap = {}; - - keyMap.basic = { - "Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown", - "End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown", - "Delete": "delCharAfter", "Backspace": "delCharBefore", "Shift-Backspace": "delCharBefore", - "Tab": "defaultTab", "Shift-Tab": "indentAuto", - "Enter": "newlineAndIndent", "Insert": "toggleOverwrite", - "Esc": "singleSelection" - }; - // Note that the save and find-related commands aren't defined by - // default. User code or addons can define them. Unknown commands - // are simply ignored. - keyMap.pcDefault = { - "Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo", - "Ctrl-Home": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Up": "goLineUp", "Ctrl-Down": "goLineDown", - "Ctrl-Left": "goGroupLeft", "Ctrl-Right": "goGroupRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd", - "Ctrl-Backspace": "delGroupBefore", "Ctrl-Delete": "delGroupAfter", "Ctrl-S": "save", "Ctrl-F": "find", - "Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll", - "Ctrl-[": "indentLess", "Ctrl-]": "indentMore", - "Ctrl-U": "undoSelection", "Shift-Ctrl-U": "redoSelection", "Alt-U": "redoSelection", - "fallthrough": "basic" - }; - // Very basic readline/emacs-style bindings, which are standard on Mac. - keyMap.emacsy = { - "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown", - "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", - "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", - "Ctrl-T": "transposeChars", "Ctrl-O": "openLine" - }; - keyMap.macDefault = { - "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo", - "Cmd-Home": "goDocStart", "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goGroupLeft", - "Alt-Right": "goGroupRight", "Cmd-Left": "goLineLeft", "Cmd-Right": "goLineRight", "Alt-Backspace": "delGroupBefore", - "Ctrl-Alt-Backspace": "delGroupAfter", "Alt-Delete": "delGroupAfter", "Cmd-S": "save", "Cmd-F": "find", - "Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll", - "Cmd-[": "indentLess", "Cmd-]": "indentMore", "Cmd-Backspace": "delWrappedLineLeft", "Cmd-Delete": "delWrappedLineRight", - "Cmd-U": "undoSelection", "Shift-Cmd-U": "redoSelection", "Ctrl-Up": "goDocStart", "Ctrl-Down": "goDocEnd", - "fallthrough": ["basic", "emacsy"] - }; - keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault; - - // KEYMAP DISPATCH - - function normalizeKeyName(name) { - var parts = name.split(/-(?!$)/); - name = parts[parts.length - 1]; - var alt, ctrl, shift, cmd; - for (var i = 0; i < parts.length - 1; i++) { - var mod = parts[i]; - if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true; } - else if (/^a(lt)?$/i.test(mod)) { alt = true; } - else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; } - else if (/^s(hift)?$/i.test(mod)) { shift = true; } - else { throw new Error("Unrecognized modifier name: " + mod) } - } - if (alt) { name = "Alt-" + name; } - if (ctrl) { name = "Ctrl-" + name; } - if (cmd) { name = "Cmd-" + name; } - if (shift) { name = "Shift-" + name; } - return name - } - - // This is a kludge to keep keymaps mostly working as raw objects - // (backwards compatibility) while at the same time support features - // like normalization and multi-stroke key bindings. It compiles a - // new normalized keymap, and then updates the old object to reflect - // this. - function normalizeKeyMap(keymap) { - var copy = {}; - for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) { - var value = keymap[keyname]; - if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue } - if (value == "...") { delete keymap[keyname]; continue } - - var keys = map(keyname.split(" "), normalizeKeyName); - for (var i = 0; i < keys.length; i++) { - var val = (void 0), name = (void 0); - if (i == keys.length - 1) { - name = keys.join(" "); - val = value; - } else { - name = keys.slice(0, i + 1).join(" "); - val = "..."; - } - var prev = copy[name]; - if (!prev) { copy[name] = val; } - else if (prev != val) { throw new Error("Inconsistent bindings for " + name) } - } - delete keymap[keyname]; - } } - for (var prop in copy) { keymap[prop] = copy[prop]; } - return keymap - } - - function lookupKey(key, map, handle, context) { - map = getKeyMap(map); - var found = map.call ? map.call(key, context) : map[key]; - if (found === false) { return "nothing" } - if (found === "...") { return "multi" } - if (found != null && handle(found)) { return "handled" } - - if (map.fallthrough) { - if (Object.prototype.toString.call(map.fallthrough) != "[object Array]") - { return lookupKey(key, map.fallthrough, handle, context) } - for (var i = 0; i < map.fallthrough.length; i++) { - var result = lookupKey(key, map.fallthrough[i], handle, context); - if (result) { return result } - } - } - } - - // Modifier key presses don't count as 'real' key presses for the - // purpose of keymap fallthrough. - function isModifierKey(value) { - var name = typeof value == "string" ? value : keyNames[value.keyCode]; - return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod" - } - - function addModifierNames(name, event, noShift) { - var base = name; - if (event.altKey && base != "Alt") { name = "Alt-" + name; } - if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != "Ctrl") { name = "Ctrl-" + name; } - if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Mod") { name = "Cmd-" + name; } - if (!noShift && event.shiftKey && base != "Shift") { name = "Shift-" + name; } - return name - } - - // Look up the name of a key as indicated by an event object. - function keyName(event, noShift) { - if (presto && event.keyCode == 34 && event["char"]) { return false } - var name = keyNames[event.keyCode]; - if (name == null || event.altGraphKey) { return false } - // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause, - // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+) - if (event.keyCode == 3 && event.code) { name = event.code; } - return addModifierNames(name, event, noShift) - } - - function getKeyMap(val) { - return typeof val == "string" ? keyMap[val] : val - } - - // Helper for deleting text near the selection(s), used to implement - // backspace, delete, and similar functionality. - function deleteNearSelection(cm, compute) { - var ranges = cm.doc.sel.ranges, kill = []; - // Build up a set of ranges to kill first, merging overlapping - // ranges. - for (var i = 0; i < ranges.length; i++) { - var toKill = compute(ranges[i]); - while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) { - var replaced = kill.pop(); - if (cmp(replaced.from, toKill.from) < 0) { - toKill.from = replaced.from; - break - } - } - kill.push(toKill); - } - // Next, remove those actual ranges. - runInOp(cm, function () { - for (var i = kill.length - 1; i >= 0; i--) - { replaceRange(cm.doc, "", kill[i].from, kill[i].to, "+delete"); } - ensureCursorVisible(cm); - }); - } - - function moveCharLogically(line, ch, dir) { - var target = skipExtendingChars(line.text, ch + dir, dir); - return target < 0 || target > line.text.length ? null : target - } - - function moveLogically(line, start, dir) { - var ch = moveCharLogically(line, start.ch, dir); - return ch == null ? null : new Pos(start.line, ch, dir < 0 ? "after" : "before") - } - - function endOfLine(visually, cm, lineObj, lineNo, dir) { - if (visually) { - if (cm.doc.direction == "rtl") { dir = -dir; } - var order = getOrder(lineObj, cm.doc.direction); - if (order) { - var part = dir < 0 ? lst(order) : order[0]; - var moveInStorageOrder = (dir < 0) == (part.level == 1); - var sticky = moveInStorageOrder ? "after" : "before"; - var ch; - // With a wrapped rtl chunk (possibly spanning multiple bidi parts), - // it could be that the last bidi part is not on the last visual line, - // since visual lines contain content order-consecutive chunks. - // Thus, in rtl, we are looking for the first (content-order) character - // in the rtl chunk that is on the last line (that is, the same line - // as the last (content-order) character). - if (part.level > 0 || cm.doc.direction == "rtl") { - var prep = prepareMeasureForLine(cm, lineObj); - ch = dir < 0 ? lineObj.text.length - 1 : 0; - var targetTop = measureCharPrepared(cm, prep, ch).top; - ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch); - if (sticky == "before") { ch = moveCharLogically(lineObj, ch, 1); } - } else { ch = dir < 0 ? part.to : part.from; } - return new Pos(lineNo, ch, sticky) - } - } - return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? "before" : "after") - } - - function moveVisually(cm, line, start, dir) { - var bidi = getOrder(line, cm.doc.direction); - if (!bidi) { return moveLogically(line, start, dir) } - if (start.ch >= line.text.length) { - start.ch = line.text.length; - start.sticky = "before"; - } else if (start.ch <= 0) { - start.ch = 0; - start.sticky = "after"; - } - var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos]; - if (cm.doc.direction == "ltr" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) { - // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines, - // nothing interesting happens. - return moveLogically(line, start, dir) - } - - var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); }; - var prep; - var getWrappedLineExtent = function (ch) { - if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} } - prep = prep || prepareMeasureForLine(cm, line); - return wrappedLineExtentChar(cm, line, prep, ch) - }; - var wrappedLineExtent = getWrappedLineExtent(start.sticky == "before" ? mv(start, -1) : start.ch); - - if (cm.doc.direction == "rtl" || part.level == 1) { - var moveInStorageOrder = (part.level == 1) == (dir < 0); - var ch = mv(start, moveInStorageOrder ? 1 : -1); - if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) { - // Case 2: We move within an rtl part or in an rtl editor on the same visual line - var sticky = moveInStorageOrder ? "before" : "after"; - return new Pos(start.line, ch, sticky) - } - } - - // Case 3: Could not move within this bidi part in this visual line, so leave - // the current bidi part - - var searchInVisualLine = function (partPos, dir, wrappedLineExtent) { - var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder - ? new Pos(start.line, mv(ch, 1), "before") - : new Pos(start.line, ch, "after"); }; - - for (; partPos >= 0 && partPos < bidi.length; partPos += dir) { - var part = bidi[partPos]; - var moveInStorageOrder = (dir > 0) == (part.level != 1); - var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1); - if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) } - ch = moveInStorageOrder ? part.from : mv(part.to, -1); - if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) } - } - }; - - // Case 3a: Look for other bidi parts on the same visual line - var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent); - if (res) { return res } - - // Case 3b: Look for other bidi parts on the next visual line - var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1); - if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) { - res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh)); - if (res) { return res } - } - - // Case 4: Nowhere to move - return null - } - - // Commands are parameter-less actions that can be performed on an - // editor, mostly used for keybindings. - var commands = { - selectAll: selectAll, - singleSelection: function (cm) { return cm.setSelection(cm.getCursor("anchor"), cm.getCursor("head"), sel_dontScroll); }, - killLine: function (cm) { return deleteNearSelection(cm, function (range) { - if (range.empty()) { - var len = getLine(cm.doc, range.head.line).text.length; - if (range.head.ch == len && range.head.line < cm.lastLine()) - { return {from: range.head, to: Pos(range.head.line + 1, 0)} } - else - { return {from: range.head, to: Pos(range.head.line, len)} } - } else { - return {from: range.from(), to: range.to()} - } - }); }, - deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({ - from: Pos(range.from().line, 0), - to: clipPos(cm.doc, Pos(range.to().line + 1, 0)) - }); }); }, - delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({ - from: Pos(range.from().line, 0), to: range.from() - }); }); }, - delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { - var top = cm.charCoords(range.head, "div").top + 5; - var leftPos = cm.coordsChar({left: 0, top: top}, "div"); - return {from: leftPos, to: range.from()} - }); }, - delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) { - var top = cm.charCoords(range.head, "div").top + 5; - var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div"); - return {from: range.from(), to: rightPos } - }); }, - undo: function (cm) { return cm.undo(); }, - redo: function (cm) { return cm.redo(); }, - undoSelection: function (cm) { return cm.undoSelection(); }, - redoSelection: function (cm) { return cm.redoSelection(); }, - goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); }, - goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); }, - goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); }, - {origin: "+move", bias: 1} - ); }, - goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); }, - {origin: "+move", bias: 1} - ); }, - goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); }, - {origin: "+move", bias: -1} - ); }, - goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) { - var top = cm.cursorCoords(range.head, "div").top + 5; - return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div") - }, sel_move); }, - goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) { - var top = cm.cursorCoords(range.head, "div").top + 5; - return cm.coordsChar({left: 0, top: top}, "div") - }, sel_move); }, - goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) { - var top = cm.cursorCoords(range.head, "div").top + 5; - var pos = cm.coordsChar({left: 0, top: top}, "div"); - if (pos.ch < cm.getLine(pos.line).search(/\S/)) { return lineStartSmart(cm, range.head) } - return pos - }, sel_move); }, - goLineUp: function (cm) { return cm.moveV(-1, "line"); }, - goLineDown: function (cm) { return cm.moveV(1, "line"); }, - goPageUp: function (cm) { return cm.moveV(-1, "page"); }, - goPageDown: function (cm) { return cm.moveV(1, "page"); }, - goCharLeft: function (cm) { return cm.moveH(-1, "char"); }, - goCharRight: function (cm) { return cm.moveH(1, "char"); }, - goColumnLeft: function (cm) { return cm.moveH(-1, "column"); }, - goColumnRight: function (cm) { return cm.moveH(1, "column"); }, - goWordLeft: function (cm) { return cm.moveH(-1, "word"); }, - goGroupRight: function (cm) { return cm.moveH(1, "group"); }, - goGroupLeft: function (cm) { return cm.moveH(-1, "group"); }, - goWordRight: function (cm) { return cm.moveH(1, "word"); }, - delCharBefore: function (cm) { return cm.deleteH(-1, "codepoint"); }, - delCharAfter: function (cm) { return cm.deleteH(1, "char"); }, - delWordBefore: function (cm) { return cm.deleteH(-1, "word"); }, - delWordAfter: function (cm) { return cm.deleteH(1, "word"); }, - delGroupBefore: function (cm) { return cm.deleteH(-1, "group"); }, - delGroupAfter: function (cm) { return cm.deleteH(1, "group"); }, - indentAuto: function (cm) { return cm.indentSelection("smart"); }, - indentMore: function (cm) { return cm.indentSelection("add"); }, - indentLess: function (cm) { return cm.indentSelection("subtract"); }, - insertTab: function (cm) { return cm.replaceSelection("\t"); }, - insertSoftTab: function (cm) { - var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize; - for (var i = 0; i < ranges.length; i++) { - var pos = ranges[i].from(); - var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize); - spaces.push(spaceStr(tabSize - col % tabSize)); - } - cm.replaceSelections(spaces); - }, - defaultTab: function (cm) { - if (cm.somethingSelected()) { cm.indentSelection("add"); } - else { cm.execCommand("insertTab"); } - }, - // Swap the two chars left and right of each selection's head. - // Move cursor behind the two swapped characters afterwards. - // - // Doesn't consider line feeds a character. - // Doesn't scan more than one line above to find a character. - // Doesn't do anything on an empty line. - // Doesn't do anything with non-empty selections. - transposeChars: function (cm) { return runInOp(cm, function () { - var ranges = cm.listSelections(), newSel = []; - for (var i = 0; i < ranges.length; i++) { - if (!ranges[i].empty()) { continue } - var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text; - if (line) { - if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1); } - if (cur.ch > 0) { - cur = new Pos(cur.line, cur.ch + 1); - cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2), - Pos(cur.line, cur.ch - 2), cur, "+transpose"); - } else if (cur.line > cm.doc.first) { - var prev = getLine(cm.doc, cur.line - 1).text; - if (prev) { - cur = new Pos(cur.line, 1); - cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() + - prev.charAt(prev.length - 1), - Pos(cur.line - 1, prev.length - 1), cur, "+transpose"); - } - } - } - newSel.push(new Range(cur, cur)); - } - cm.setSelections(newSel); - }); }, - newlineAndIndent: function (cm) { return runInOp(cm, function () { - var sels = cm.listSelections(); - for (var i = sels.length - 1; i >= 0; i--) - { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, "+input"); } - sels = cm.listSelections(); - for (var i$1 = 0; i$1 < sels.length; i$1++) - { cm.indentLine(sels[i$1].from().line, null, true); } - ensureCursorVisible(cm); - }); }, - openLine: function (cm) { return cm.replaceSelection("\n", "start"); }, - toggleOverwrite: function (cm) { return cm.toggleOverwrite(); } - }; - - - function lineStart(cm, lineN) { - var line = getLine(cm.doc, lineN); - var visual = visualLine(line); - if (visual != line) { lineN = lineNo(visual); } - return endOfLine(true, cm, visual, lineN, 1) - } - function lineEnd(cm, lineN) { - var line = getLine(cm.doc, lineN); - var visual = visualLineEnd(line); - if (visual != line) { lineN = lineNo(visual); } - return endOfLine(true, cm, line, lineN, -1) - } - function lineStartSmart(cm, pos) { - var start = lineStart(cm, pos.line); - var line = getLine(cm.doc, start.line); - var order = getOrder(line, cm.doc.direction); - if (!order || order[0].level == 0) { - var firstNonWS = Math.max(start.ch, line.text.search(/\S/)); - var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch; - return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky) - } - return start - } - - // Run a handler that was bound to a key. - function doHandleBinding(cm, bound, dropShift) { - if (typeof bound == "string") { - bound = commands[bound]; - if (!bound) { return false } - } - // Ensure previous input has been read, so that the handler sees a - // consistent view of the document - cm.display.input.ensurePolled(); - var prevShift = cm.display.shift, done = false; - try { - if (cm.isReadOnly()) { cm.state.suppressEdits = true; } - if (dropShift) { cm.display.shift = false; } - done = bound(cm) != Pass; - } finally { - cm.display.shift = prevShift; - cm.state.suppressEdits = false; - } - return done - } - - function lookupKeyForEditor(cm, name, handle) { - for (var i = 0; i < cm.state.keyMaps.length; i++) { - var result = lookupKey(name, cm.state.keyMaps[i], handle, cm); - if (result) { return result } - } - return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm)) - || lookupKey(name, cm.options.keyMap, handle, cm) - } - - // Note that, despite the name, this function is also used to check - // for bound mouse clicks. - - var stopSeq = new Delayed; - - function dispatchKey(cm, name, e, handle) { - var seq = cm.state.keySeq; - if (seq) { - if (isModifierKey(name)) { return "handled" } - if (/\'$/.test(name)) - { cm.state.keySeq = null; } - else - { stopSeq.set(50, function () { - if (cm.state.keySeq == seq) { - cm.state.keySeq = null; - cm.display.input.reset(); - } - }); } - if (dispatchKeyInner(cm, seq + " " + name, e, handle)) { return true } - } - return dispatchKeyInner(cm, name, e, handle) - } - - function dispatchKeyInner(cm, name, e, handle) { - var result = lookupKeyForEditor(cm, name, handle); - - if (result == "multi") - { cm.state.keySeq = name; } - if (result == "handled") - { signalLater(cm, "keyHandled", cm, name, e); } - - if (result == "handled" || result == "multi") { - e_preventDefault(e); - restartBlink(cm); - } - - return !!result - } - - // Handle a key from the keydown event. - function handleKeyBinding(cm, e) { - var name = keyName(e, true); - if (!name) { return false } - - if (e.shiftKey && !cm.state.keySeq) { - // First try to resolve full name (including 'Shift-'). Failing - // that, see if there is a cursor-motion command (starting with - // 'go') bound to the keyname without 'Shift-'. - return dispatchKey(cm, "Shift-" + name, e, function (b) { return doHandleBinding(cm, b, true); }) - || dispatchKey(cm, name, e, function (b) { - if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion) - { return doHandleBinding(cm, b) } - }) - } else { - return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); }) - } - } - - // Handle a key from the keypress event - function handleCharBinding(cm, e, ch) { - return dispatchKey(cm, "'" + ch + "'", e, function (b) { return doHandleBinding(cm, b, true); }) - } - - var lastStoppedKey = null; - function onKeyDown(e) { - var cm = this; - if (e.target && e.target != cm.display.input.getField()) { return } - cm.curOp.focus = activeElt(); - if (signalDOMEvent(cm, e)) { return } - // IE does strange things with escape. - if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; } - var code = e.keyCode; - cm.display.shift = code == 16 || e.shiftKey; - var handled = handleKeyBinding(cm, e); - if (presto) { - lastStoppedKey = handled ? code : null; - // Opera has no cut event... we try to at least catch the key combo - if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey)) - { cm.replaceSelection("", null, "cut"); } - } - if (gecko && !mac && !handled && code == 46 && e.shiftKey && !e.ctrlKey && document.execCommand) - { document.execCommand("cut"); } - - // Turn mouse into crosshair when Alt is held on Mac. - if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className)) - { showCrossHair(cm); } - } - - function showCrossHair(cm) { - var lineDiv = cm.display.lineDiv; - addClass(lineDiv, "CodeMirror-crosshair"); - - function up(e) { - if (e.keyCode == 18 || !e.altKey) { - rmClass(lineDiv, "CodeMirror-crosshair"); - off(document, "keyup", up); - off(document, "mouseover", up); - } - } - on(document, "keyup", up); - on(document, "mouseover", up); - } - - function onKeyUp(e) { - if (e.keyCode == 16) { this.doc.sel.shift = false; } - signalDOMEvent(this, e); - } - - function onKeyPress(e) { - var cm = this; - if (e.target && e.target != cm.display.input.getField()) { return } - if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return } - var keyCode = e.keyCode, charCode = e.charCode; - if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return} - if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return } - var ch = String.fromCharCode(charCode == null ? keyCode : charCode); - // Some browsers fire keypress events for backspace - if (ch == "\x08") { return } - if (handleCharBinding(cm, e, ch)) { return } - cm.display.input.onKeyPress(e); - } - - var DOUBLECLICK_DELAY = 400; - - var PastClick = function(time, pos, button) { - this.time = time; - this.pos = pos; - this.button = button; - }; - - PastClick.prototype.compare = function (time, pos, button) { - return this.time + DOUBLECLICK_DELAY > time && - cmp(pos, this.pos) == 0 && button == this.button - }; - - var lastClick, lastDoubleClick; - function clickRepeat(pos, button) { - var now = +new Date; - if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) { - lastClick = lastDoubleClick = null; - return "triple" - } else if (lastClick && lastClick.compare(now, pos, button)) { - lastDoubleClick = new PastClick(now, pos, button); - lastClick = null; - return "double" - } else { - lastClick = new PastClick(now, pos, button); - lastDoubleClick = null; - return "single" - } - } - - // A mouse down can be a single click, double click, triple click, - // start of selection drag, start of text drag, new cursor - // (ctrl-click), rectangle drag (alt-drag), or xwin - // middle-click-paste. Or it might be a click on something we should - // not interfere with, such as a scrollbar or widget. - function onMouseDown(e) { - var cm = this, display = cm.display; - if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return } - display.input.ensurePolled(); - display.shift = e.shiftKey; - - if (eventInWidget(display, e)) { - if (!webkit) { - // Briefly turn off draggability, to allow widgets to do - // normal dragging things. - display.scroller.draggable = false; - setTimeout(function () { return display.scroller.draggable = true; }, 100); - } - return - } - if (clickInGutter(cm, e)) { return } - var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : "single"; - window.focus(); - - // #3261: make sure, that we're not starting a second selection - if (button == 1 && cm.state.selectingText) - { cm.state.selectingText(e); } - - if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return } - - if (button == 1) { - if (pos) { leftButtonDown(cm, pos, repeat, e); } - else if (e_target(e) == display.scroller) { e_preventDefault(e); } - } else if (button == 2) { - if (pos) { extendSelection(cm.doc, pos); } - setTimeout(function () { return display.input.focus(); }, 20); - } else if (button == 3) { - if (captureRightClick) { cm.display.input.onContextMenu(e); } - else { delayBlurEvent(cm); } - } - } - - function handleMappedButton(cm, button, pos, repeat, event) { - var name = "Click"; - if (repeat == "double") { name = "Double" + name; } - else if (repeat == "triple") { name = "Triple" + name; } - name = (button == 1 ? "Left" : button == 2 ? "Middle" : "Right") + name; - - return dispatchKey(cm, addModifierNames(name, event), event, function (bound) { - if (typeof bound == "string") { bound = commands[bound]; } - if (!bound) { return false } - var done = false; - try { - if (cm.isReadOnly()) { cm.state.suppressEdits = true; } - done = bound(cm, pos) != Pass; - } finally { - cm.state.suppressEdits = false; - } - return done - }) - } - - function configureMouse(cm, repeat, event) { - var option = cm.getOption("configureMouse"); - var value = option ? option(cm, repeat, event) : {}; - if (value.unit == null) { - var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey; - value.unit = rect ? "rectangle" : repeat == "single" ? "char" : repeat == "double" ? "word" : "line"; - } - if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; } - if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; } - if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); } - return value - } - - function leftButtonDown(cm, pos, repeat, event) { - if (ie) { setTimeout(bind(ensureFocus, cm), 0); } - else { cm.curOp.focus = activeElt(); } - - var behavior = configureMouse(cm, repeat, event); - - var sel = cm.doc.sel, contained; - if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() && - repeat == "single" && (contained = sel.contains(pos)) > -1 && - (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) && - (cmp(contained.to(), pos) > 0 || pos.xRel < 0)) - { leftButtonStartDrag(cm, event, pos, behavior); } - else - { leftButtonSelect(cm, event, pos, behavior); } - } - - // Start a text drag. When it ends, see if any dragging actually - // happen, and treat as a click if it didn't. - function leftButtonStartDrag(cm, event, pos, behavior) { - var display = cm.display, moved = false; - var dragEnd = operation(cm, function (e) { - if (webkit) { display.scroller.draggable = false; } - cm.state.draggingText = false; - if (cm.state.delayingBlurEvent) { - if (cm.hasFocus()) { cm.state.delayingBlurEvent = false; } - else { delayBlurEvent(cm); } - } - off(display.wrapper.ownerDocument, "mouseup", dragEnd); - off(display.wrapper.ownerDocument, "mousemove", mouseMove); - off(display.scroller, "dragstart", dragStart); - off(display.scroller, "drop", dragEnd); - if (!moved) { - e_preventDefault(e); - if (!behavior.addNew) - { extendSelection(cm.doc, pos, null, null, behavior.extend); } - // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081) - if ((webkit && !safari) || ie && ie_version == 9) - { setTimeout(function () {display.wrapper.ownerDocument.body.focus({preventScroll: true}); display.input.focus();}, 20); } - else - { display.input.focus(); } - } - }); - var mouseMove = function(e2) { - moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10; - }; - var dragStart = function () { return moved = true; }; - // Let the drag handler handle this. - if (webkit) { display.scroller.draggable = true; } - cm.state.draggingText = dragEnd; - dragEnd.copy = !behavior.moveOnDrag; - on(display.wrapper.ownerDocument, "mouseup", dragEnd); - on(display.wrapper.ownerDocument, "mousemove", mouseMove); - on(display.scroller, "dragstart", dragStart); - on(display.scroller, "drop", dragEnd); - - cm.state.delayingBlurEvent = true; - setTimeout(function () { return display.input.focus(); }, 20); - // IE's approach to draggable - if (display.scroller.dragDrop) { display.scroller.dragDrop(); } - } - - function rangeForUnit(cm, pos, unit) { - if (unit == "char") { return new Range(pos, pos) } - if (unit == "word") { return cm.findWordAt(pos) } - if (unit == "line") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) } - var result = unit(cm, pos); - return new Range(result.from, result.to) - } - - // Normal selection, as opposed to text dragging. - function leftButtonSelect(cm, event, start, behavior) { - if (ie) { delayBlurEvent(cm); } - var display = cm.display, doc = cm.doc; - e_preventDefault(event); - - var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges; - if (behavior.addNew && !behavior.extend) { - ourIndex = doc.sel.contains(start); - if (ourIndex > -1) - { ourRange = ranges[ourIndex]; } - else - { ourRange = new Range(start, start); } - } else { - ourRange = doc.sel.primary(); - ourIndex = doc.sel.primIndex; - } - - if (behavior.unit == "rectangle") { - if (!behavior.addNew) { ourRange = new Range(start, start); } - start = posFromMouse(cm, event, true, true); - ourIndex = -1; - } else { - var range = rangeForUnit(cm, start, behavior.unit); - if (behavior.extend) - { ourRange = extendRange(ourRange, range.anchor, range.head, behavior.extend); } - else - { ourRange = range; } - } - - if (!behavior.addNew) { - ourIndex = 0; - setSelection(doc, new Selection([ourRange], 0), sel_mouse); - startSel = doc.sel; - } else if (ourIndex == -1) { - ourIndex = ranges.length; - setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex), - {scroll: false, origin: "*mouse"}); - } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == "char" && !behavior.extend) { - setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0), - {scroll: false, origin: "*mouse"}); - startSel = doc.sel; - } else { - replaceOneSelection(doc, ourIndex, ourRange, sel_mouse); - } - - var lastPos = start; - function extendTo(pos) { - if (cmp(lastPos, pos) == 0) { return } - lastPos = pos; - - if (behavior.unit == "rectangle") { - var ranges = [], tabSize = cm.options.tabSize; - var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize); - var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize); - var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol); - for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line)); - line <= end; line++) { - var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize); - if (left == right) - { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); } - else if (text.length > leftPos) - { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); } - } - if (!ranges.length) { ranges.push(new Range(start, start)); } - setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex), - {origin: "*mouse", scroll: false}); - cm.scrollIntoView(pos); - } else { - var oldRange = ourRange; - var range = rangeForUnit(cm, pos, behavior.unit); - var anchor = oldRange.anchor, head; - if (cmp(range.anchor, anchor) > 0) { - head = range.head; - anchor = minPos(oldRange.from(), range.anchor); - } else { - head = range.anchor; - anchor = maxPos(oldRange.to(), range.head); - } - var ranges$1 = startSel.ranges.slice(0); - ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head)); - setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse); - } - } - - var editorSize = display.wrapper.getBoundingClientRect(); - // Used to ensure timeout re-tries don't fire when another extend - // happened in the meantime (clearTimeout isn't reliable -- at - // least on Chrome, the timeouts still happen even when cleared, - // if the clear happens after their scheduled firing time). - var counter = 0; - - function extend(e) { - var curCount = ++counter; - var cur = posFromMouse(cm, e, true, behavior.unit == "rectangle"); - if (!cur) { return } - if (cmp(cur, lastPos) != 0) { - cm.curOp.focus = activeElt(); - extendTo(cur); - var visible = visibleLines(display, doc); - if (cur.line >= visible.to || cur.line < visible.from) - { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); } - } else { - var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0; - if (outside) { setTimeout(operation(cm, function () { - if (counter != curCount) { return } - display.scroller.scrollTop += outside; - extend(e); - }), 50); } - } - } - - function done(e) { - cm.state.selectingText = false; - counter = Infinity; - // If e is null or undefined we interpret this as someone trying - // to explicitly cancel the selection rather than the user - // letting go of the mouse button. - if (e) { - e_preventDefault(e); - display.input.focus(); - } - off(display.wrapper.ownerDocument, "mousemove", move); - off(display.wrapper.ownerDocument, "mouseup", up); - doc.history.lastSelOrigin = null; - } - - var move = operation(cm, function (e) { - if (e.buttons === 0 || !e_button(e)) { done(e); } - else { extend(e); } - }); - var up = operation(cm, done); - cm.state.selectingText = up; - on(display.wrapper.ownerDocument, "mousemove", move); - on(display.wrapper.ownerDocument, "mouseup", up); - } - - // Used when mouse-selecting to adjust the anchor to the proper side - // of a bidi jump depending on the visual position of the head. - function bidiSimplify(cm, range) { - var anchor = range.anchor; - var head = range.head; - var anchorLine = getLine(cm.doc, anchor.line); - if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range } - var order = getOrder(anchorLine); - if (!order) { return range } - var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index]; - if (part.from != anchor.ch && part.to != anchor.ch) { return range } - var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1); - if (boundary == 0 || boundary == order.length) { return range } - - // Compute the relative visual position of the head compared to the - // anchor (<0 is to the left, >0 to the right) - var leftSide; - if (head.line != anchor.line) { - leftSide = (head.line - anchor.line) * (cm.doc.direction == "ltr" ? 1 : -1) > 0; - } else { - var headIndex = getBidiPartAt(order, head.ch, head.sticky); - var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1); - if (headIndex == boundary - 1 || headIndex == boundary) - { leftSide = dir < 0; } - else - { leftSide = dir > 0; } - } - - var usePart = order[boundary + (leftSide ? -1 : 0)]; - var from = leftSide == (usePart.level == 1); - var ch = from ? usePart.from : usePart.to, sticky = from ? "after" : "before"; - return anchor.ch == ch && anchor.sticky == sticky ? range : new Range(new Pos(anchor.line, ch, sticky), head) - } - - - // Determines whether an event happened in the gutter, and fires the - // handlers for the corresponding event. - function gutterEvent(cm, e, type, prevent) { - var mX, mY; - if (e.touches) { - mX = e.touches[0].clientX; - mY = e.touches[0].clientY; - } else { - try { mX = e.clientX; mY = e.clientY; } - catch(e$1) { return false } - } - if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false } - if (prevent) { e_preventDefault(e); } - - var display = cm.display; - var lineBox = display.lineDiv.getBoundingClientRect(); - - if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) } - mY -= lineBox.top - display.viewOffset; - - for (var i = 0; i < cm.display.gutterSpecs.length; ++i) { - var g = display.gutters.childNodes[i]; - if (g && g.getBoundingClientRect().right >= mX) { - var line = lineAtHeight(cm.doc, mY); - var gutter = cm.display.gutterSpecs[i]; - signal(cm, type, cm, line, gutter.className, e); - return e_defaultPrevented(e) - } - } - } - - function clickInGutter(cm, e) { - return gutterEvent(cm, e, "gutterClick", true) - } - - // CONTEXT MENU HANDLING - - // To make the context menu work, we need to briefly unhide the - // textarea (making it as unobtrusive as possible) to let the - // right-click take effect on it. - function onContextMenu(cm, e) { - if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return } - if (signalDOMEvent(cm, e, "contextmenu")) { return } - if (!captureRightClick) { cm.display.input.onContextMenu(e); } - } - - function contextMenuInGutter(cm, e) { - if (!hasHandler(cm, "gutterContextMenu")) { return false } - return gutterEvent(cm, e, "gutterContextMenu", false) - } - - function themeChanged(cm) { - cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") + - cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-"); - clearCaches(cm); - } - - var Init = {toString: function(){return "CodeMirror.Init"}}; - - var defaults = {}; - var optionHandlers = {}; - - function defineOptions(CodeMirror) { - var optionHandlers = CodeMirror.optionHandlers; - - function option(name, deflt, handle, notOnInit) { - CodeMirror.defaults[name] = deflt; - if (handle) { optionHandlers[name] = - notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old); }} : handle; } - } - - CodeMirror.defineOption = option; - - // Passed to option handlers when there is no old value. - CodeMirror.Init = Init; - - // These two are, on init, called from the constructor because they - // have to be initialized before the editor can start at all. - option("value", "", function (cm, val) { return cm.setValue(val); }, true); - option("mode", null, function (cm, val) { - cm.doc.modeOption = val; - loadMode(cm); - }, true); - - option("indentUnit", 2, loadMode, true); - option("indentWithTabs", false); - option("smartIndent", true); - option("tabSize", 4, function (cm) { - resetModeState(cm); - clearCaches(cm); - regChange(cm); - }, true); - - option("lineSeparator", null, function (cm, val) { - cm.doc.lineSep = val; - if (!val) { return } - var newBreaks = [], lineNo = cm.doc.first; - cm.doc.iter(function (line) { - for (var pos = 0;;) { - var found = line.text.indexOf(val, pos); - if (found == -1) { break } - pos = found + val.length; - newBreaks.push(Pos(lineNo, found)); - } - lineNo++; - }); - for (var i = newBreaks.length - 1; i >= 0; i--) - { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); } - }); - option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g, function (cm, val, old) { - cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g"); - if (old != Init) { cm.refresh(); } - }); - option("specialCharPlaceholder", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true); - option("electricChars", true); - option("inputStyle", mobile ? "contenteditable" : "textarea", function () { - throw new Error("inputStyle can not (yet) be changed in a running editor") // FIXME - }, true); - option("spellcheck", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true); - option("autocorrect", false, function (cm, val) { return cm.getInputField().autocorrect = val; }, true); - option("autocapitalize", false, function (cm, val) { return cm.getInputField().autocapitalize = val; }, true); - option("rtlMoveVisually", !windows); - option("wholeLineUpdateBefore", true); - - option("theme", "default", function (cm) { - themeChanged(cm); - updateGutters(cm); - }, true); - option("keyMap", "default", function (cm, val, old) { - var next = getKeyMap(val); - var prev = old != Init && getKeyMap(old); - if (prev && prev.detach) { prev.detach(cm, next); } - if (next.attach) { next.attach(cm, prev || null); } - }); - option("extraKeys", null); - option("configureMouse", null); - - option("lineWrapping", false, wrappingChanged, true); - option("gutters", [], function (cm, val) { - cm.display.gutterSpecs = getGutters(val, cm.options.lineNumbers); - updateGutters(cm); - }, true); - option("fixedGutter", true, function (cm, val) { - cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + "px" : "0"; - cm.refresh(); - }, true); - option("coverGutterNextToScrollbar", false, function (cm) { return updateScrollbars(cm); }, true); - option("scrollbarStyle", "native", function (cm) { - initScrollbars(cm); - updateScrollbars(cm); - cm.display.scrollbars.setScrollTop(cm.doc.scrollTop); - cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft); - }, true); - option("lineNumbers", false, function (cm, val) { - cm.display.gutterSpecs = getGutters(cm.options.gutters, val); - updateGutters(cm); - }, true); - option("firstLineNumber", 1, updateGutters, true); - option("lineNumberFormatter", function (integer) { return integer; }, updateGutters, true); - option("showCursorWhenSelecting", false, updateSelection, true); - - option("resetSelectionOnContextMenu", true); - option("lineWiseCopyCut", true); - option("pasteLinesPerSelection", true); - option("selectionsMayTouch", false); - - option("readOnly", false, function (cm, val) { - if (val == "nocursor") { - onBlur(cm); - cm.display.input.blur(); - } - cm.display.input.readOnlyChanged(val); - }); - - option("screenReaderLabel", null, function (cm, val) { - val = (val === '') ? null : val; - cm.display.input.screenReaderLabelChanged(val); - }); - - option("disableInput", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true); - option("dragDrop", true, dragDropChanged); - option("allowDropFileTypes", null); - - option("cursorBlinkRate", 530); - option("cursorScrollMargin", 0); - option("cursorHeight", 1, updateSelection, true); - option("singleCursorHeightPerLine", true, updateSelection, true); - option("workTime", 100); - option("workDelay", 100); - option("flattenSpans", true, resetModeState, true); - option("addModeClass", false, resetModeState, true); - option("pollInterval", 100); - option("undoDepth", 200, function (cm, val) { return cm.doc.history.undoDepth = val; }); - option("historyEventDelay", 1250); - option("viewportMargin", 10, function (cm) { return cm.refresh(); }, true); - option("maxHighlightLength", 10000, resetModeState, true); - option("moveInputWithCursor", true, function (cm, val) { - if (!val) { cm.display.input.resetPosition(); } - }); - - option("tabindex", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || ""; }); - option("autofocus", null); - option("direction", "ltr", function (cm, val) { return cm.doc.setDirection(val); }, true); - option("phrases", null); - } - - function dragDropChanged(cm, value, old) { - var wasOn = old && old != Init; - if (!value != !wasOn) { - var funcs = cm.display.dragFunctions; - var toggle = value ? on : off; - toggle(cm.display.scroller, "dragstart", funcs.start); - toggle(cm.display.scroller, "dragenter", funcs.enter); - toggle(cm.display.scroller, "dragover", funcs.over); - toggle(cm.display.scroller, "dragleave", funcs.leave); - toggle(cm.display.scroller, "drop", funcs.drop); - } - } - - function wrappingChanged(cm) { - if (cm.options.lineWrapping) { - addClass(cm.display.wrapper, "CodeMirror-wrap"); - cm.display.sizer.style.minWidth = ""; - cm.display.sizerWidth = null; - } else { - rmClass(cm.display.wrapper, "CodeMirror-wrap"); - findMaxLine(cm); - } - estimateLineHeights(cm); - regChange(cm); - clearCaches(cm); - setTimeout(function () { return updateScrollbars(cm); }, 100); - } - - // A CodeMirror instance represents an editor. This is the object - // that user code is usually dealing with. - - function CodeMirror(place, options) { - var this$1 = this; - - if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) } - - this.options = options = options ? copyObj(options) : {}; - // Determine effective options based on given values and defaults. - copyObj(defaults, options, false); - - var doc = options.value; - if (typeof doc == "string") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); } - else if (options.mode) { doc.modeOption = options.mode; } - this.doc = doc; - - var input = new CodeMirror.inputStyles[options.inputStyle](this); - var display = this.display = new Display(place, doc, input, options); - display.wrapper.CodeMirror = this; - themeChanged(this); - if (options.lineWrapping) - { this.display.wrapper.className += " CodeMirror-wrap"; } - initScrollbars(this); - - this.state = { - keyMaps: [], // stores maps added by addKeyMap - overlays: [], // highlighting overlays, as added by addOverlay - modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info - overwrite: false, - delayingBlurEvent: false, - focused: false, - suppressEdits: false, // used to disable editing during key handlers when in readOnly mode - pasteIncoming: -1, cutIncoming: -1, // help recognize paste/cut edits in input.poll - selectingText: false, - draggingText: false, - highlight: new Delayed(), // stores highlight worker timeout - keySeq: null, // Unfinished key sequence - specialChars: null - }; - - if (options.autofocus && !mobile) { display.input.focus(); } - - // Override magic textarea content restore that IE sometimes does - // on our hidden textarea on reload - if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); } - - registerEventHandlers(this); - ensureGlobalHandlers(); - - startOperation(this); - this.curOp.forceUpdate = true; - attachDoc(this, doc); - - if ((options.autofocus && !mobile) || this.hasFocus()) - { setTimeout(function () { - if (this$1.hasFocus() && !this$1.state.focused) { onFocus(this$1); } - }, 20); } - else - { onBlur(this); } - - for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt)) - { optionHandlers[opt](this, options[opt], Init); } } - maybeUpdateLineNumberWidth(this); - if (options.finishInit) { options.finishInit(this); } - for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this); } - endOperation(this); - // Suppress optimizelegibility in Webkit, since it breaks text - // measuring on line wrapping boundaries. - if (webkit && options.lineWrapping && - getComputedStyle(display.lineDiv).textRendering == "optimizelegibility") - { display.lineDiv.style.textRendering = "auto"; } - } - - // The default configuration options. - CodeMirror.defaults = defaults; - // Functions to run when options are changed. - CodeMirror.optionHandlers = optionHandlers; - - // Attach the necessary event handlers when initializing the editor - function registerEventHandlers(cm) { - var d = cm.display; - on(d.scroller, "mousedown", operation(cm, onMouseDown)); - // Older IE's will not fire a second mousedown for a double click - if (ie && ie_version < 11) - { on(d.scroller, "dblclick", operation(cm, function (e) { - if (signalDOMEvent(cm, e)) { return } - var pos = posFromMouse(cm, e); - if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return } - e_preventDefault(e); - var word = cm.findWordAt(pos); - extendSelection(cm.doc, word.anchor, word.head); - })); } - else - { on(d.scroller, "dblclick", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); } - // Some browsers fire contextmenu *after* opening the menu, at - // which point we can't mess with it anymore. Context menu is - // handled in onMouseDown for these browsers. - on(d.scroller, "contextmenu", function (e) { return onContextMenu(cm, e); }); - on(d.input.getField(), "contextmenu", function (e) { - if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); } - }); - - // Used to suppress mouse event handling when a touch happens - var touchFinished, prevTouch = {end: 0}; - function finishTouch() { - if (d.activeTouch) { - touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000); - prevTouch = d.activeTouch; - prevTouch.end = +new Date; - } - } - function isMouseLikeTouchEvent(e) { - if (e.touches.length != 1) { return false } - var touch = e.touches[0]; - return touch.radiusX <= 1 && touch.radiusY <= 1 - } - function farAway(touch, other) { - if (other.left == null) { return true } - var dx = other.left - touch.left, dy = other.top - touch.top; - return dx * dx + dy * dy > 20 * 20 - } - on(d.scroller, "touchstart", function (e) { - if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) { - d.input.ensurePolled(); - clearTimeout(touchFinished); - var now = +new Date; - d.activeTouch = {start: now, moved: false, - prev: now - prevTouch.end <= 300 ? prevTouch : null}; - if (e.touches.length == 1) { - d.activeTouch.left = e.touches[0].pageX; - d.activeTouch.top = e.touches[0].pageY; - } - } - }); - on(d.scroller, "touchmove", function () { - if (d.activeTouch) { d.activeTouch.moved = true; } - }); - on(d.scroller, "touchend", function (e) { - var touch = d.activeTouch; - if (touch && !eventInWidget(d, e) && touch.left != null && - !touch.moved && new Date - touch.start < 300) { - var pos = cm.coordsChar(d.activeTouch, "page"), range; - if (!touch.prev || farAway(touch, touch.prev)) // Single tap - { range = new Range(pos, pos); } - else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap - { range = cm.findWordAt(pos); } - else // Triple tap - { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); } - cm.setSelection(range.anchor, range.head); - cm.focus(); - e_preventDefault(e); - } - finishTouch(); - }); - on(d.scroller, "touchcancel", finishTouch); - - // Sync scrolling between fake scrollbars and real scrollable - // area, ensure viewport is updated when scrolling. - on(d.scroller, "scroll", function () { - if (d.scroller.clientHeight) { - updateScrollTop(cm, d.scroller.scrollTop); - setScrollLeft(cm, d.scroller.scrollLeft, true); - signal(cm, "scroll", cm); - } - }); - - // Listen to wheel events in order to try and update the viewport on time. - on(d.scroller, "mousewheel", function (e) { return onScrollWheel(cm, e); }); - on(d.scroller, "DOMMouseScroll", function (e) { return onScrollWheel(cm, e); }); - - // Prevent wrapper from ever scrolling - on(d.wrapper, "scroll", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; }); - - d.dragFunctions = { - enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }}, - over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }}, - start: function (e) { return onDragStart(cm, e); }, - drop: operation(cm, onDrop), - leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }} - }; - - var inp = d.input.getField(); - on(inp, "keyup", function (e) { return onKeyUp.call(cm, e); }); - on(inp, "keydown", operation(cm, onKeyDown)); - on(inp, "keypress", operation(cm, onKeyPress)); - on(inp, "focus", function (e) { return onFocus(cm, e); }); - on(inp, "blur", function (e) { return onBlur(cm, e); }); - } - - var initHooks = []; - CodeMirror.defineInitHook = function (f) { return initHooks.push(f); }; - - // Indent the given line. The how parameter can be "smart", - // "add"/null, "subtract", or "prev". When aggressive is false - // (typically set to true for forced single-line indents), empty - // lines are not indented, and places where the mode returns Pass - // are left alone. - function indentLine(cm, n, how, aggressive) { - var doc = cm.doc, state; - if (how == null) { how = "add"; } - if (how == "smart") { - // Fall back to "prev" when the mode doesn't have an indentation - // method. - if (!doc.mode.indent) { how = "prev"; } - else { state = getContextBefore(cm, n).state; } - } - - var tabSize = cm.options.tabSize; - var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize); - if (line.stateAfter) { line.stateAfter = null; } - var curSpaceString = line.text.match(/^\s*/)[0], indentation; - if (!aggressive && !/\S/.test(line.text)) { - indentation = 0; - how = "not"; - } else if (how == "smart") { - indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text); - if (indentation == Pass || indentation > 150) { - if (!aggressive) { return } - how = "prev"; - } - } - if (how == "prev") { - if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); } - else { indentation = 0; } - } else if (how == "add") { - indentation = curSpace + cm.options.indentUnit; - } else if (how == "subtract") { - indentation = curSpace - cm.options.indentUnit; - } else if (typeof how == "number") { - indentation = curSpace + how; - } - indentation = Math.max(0, indentation); - - var indentString = "", pos = 0; - if (cm.options.indentWithTabs) - { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t";} } - if (pos < indentation) { indentString += spaceStr(indentation - pos); } - - if (indentString != curSpaceString) { - replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input"); - line.stateAfter = null; - return true - } else { - // Ensure that, if the cursor was in the whitespace at the start - // of the line, it is moved to the end of that space. - for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) { - var range = doc.sel.ranges[i$1]; - if (range.head.line == n && range.head.ch < curSpaceString.length) { - var pos$1 = Pos(n, curSpaceString.length); - replaceOneSelection(doc, i$1, new Range(pos$1, pos$1)); - break - } - } - } - } - - // This will be set to a {lineWise: bool, text: [string]} object, so - // that, when pasting, we know what kind of selections the copied - // text was made out of. - var lastCopied = null; - - function setLastCopied(newLastCopied) { - lastCopied = newLastCopied; - } - - function applyTextInput(cm, inserted, deleted, sel, origin) { - var doc = cm.doc; - cm.display.shift = false; - if (!sel) { sel = doc.sel; } - - var recent = +new Date - 200; - var paste = origin == "paste" || cm.state.pasteIncoming > recent; - var textLines = splitLinesAuto(inserted), multiPaste = null; - // When pasting N lines into N selections, insert one line per selection - if (paste && sel.ranges.length > 1) { - if (lastCopied && lastCopied.text.join("\n") == inserted) { - if (sel.ranges.length % lastCopied.text.length == 0) { - multiPaste = []; - for (var i = 0; i < lastCopied.text.length; i++) - { multiPaste.push(doc.splitLines(lastCopied.text[i])); } - } - } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) { - multiPaste = map(textLines, function (l) { return [l]; }); - } - } - - var updateInput = cm.curOp.updateInput; - // Normal behavior is to insert the new text into every selection - for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) { - var range = sel.ranges[i$1]; - var from = range.from(), to = range.to(); - if (range.empty()) { - if (deleted && deleted > 0) // Handle deletion - { from = Pos(from.line, from.ch - deleted); } - else if (cm.state.overwrite && !paste) // Handle overwrite - { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); } - else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == textLines.join("\n")) - { from = to = Pos(from.line, 0); } - } - var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines, - origin: origin || (paste ? "paste" : cm.state.cutIncoming > recent ? "cut" : "+input")}; - makeChange(cm.doc, changeEvent); - signalLater(cm, "inputRead", cm, changeEvent); - } - if (inserted && !paste) - { triggerElectric(cm, inserted); } - - ensureCursorVisible(cm); - if (cm.curOp.updateInput < 2) { cm.curOp.updateInput = updateInput; } - cm.curOp.typing = true; - cm.state.pasteIncoming = cm.state.cutIncoming = -1; - } - - function handlePaste(e, cm) { - var pasted = e.clipboardData && e.clipboardData.getData("Text"); - if (pasted) { - e.preventDefault(); - if (!cm.isReadOnly() && !cm.options.disableInput) - { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, "paste"); }); } - return true - } - } - - function triggerElectric(cm, inserted) { - // When an 'electric' character is inserted, immediately trigger a reindent - if (!cm.options.electricChars || !cm.options.smartIndent) { return } - var sel = cm.doc.sel; - - for (var i = sel.ranges.length - 1; i >= 0; i--) { - var range = sel.ranges[i]; - if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) { continue } - var mode = cm.getModeAt(range.head); - var indented = false; - if (mode.electricChars) { - for (var j = 0; j < mode.electricChars.length; j++) - { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) { - indented = indentLine(cm, range.head.line, "smart"); - break - } } - } else if (mode.electricInput) { - if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch))) - { indented = indentLine(cm, range.head.line, "smart"); } - } - if (indented) { signalLater(cm, "electricInput", cm, range.head.line); } - } - } - - function copyableRanges(cm) { - var text = [], ranges = []; - for (var i = 0; i < cm.doc.sel.ranges.length; i++) { - var line = cm.doc.sel.ranges[i].head.line; - var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)}; - ranges.push(lineRange); - text.push(cm.getRange(lineRange.anchor, lineRange.head)); - } - return {text: text, ranges: ranges} - } - - function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) { - field.setAttribute("autocorrect", autocorrect ? "" : "off"); - field.setAttribute("autocapitalize", autocapitalize ? "" : "off"); - field.setAttribute("spellcheck", !!spellcheck); - } - - function hiddenTextarea() { - var te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"); - var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;"); - // The textarea is kept positioned near the cursor to prevent the - // fact that it'll be scrolled into view on input from scrolling - // our fake cursor out of view. On webkit, when wrap=off, paste is - // very slow. So make the area wide instead. - if (webkit) { te.style.width = "1000px"; } - else { te.setAttribute("wrap", "off"); } - // If border: 0; -- iOS fails to open keyboard (issue #1287) - if (ios) { te.style.border = "1px solid black"; } - disableBrowserMagic(te); - return div - } - - // The publicly visible API. Note that methodOp(f) means - // 'wrap f in an operation, performed on its `this` parameter'. - - // This is not the complete set of editor methods. Most of the - // methods defined on the Doc type are also injected into - // CodeMirror.prototype, for backwards compatibility and - // convenience. - - function addEditorMethods(CodeMirror) { - var optionHandlers = CodeMirror.optionHandlers; - - var helpers = CodeMirror.helpers = {}; - - CodeMirror.prototype = { - constructor: CodeMirror, - focus: function(){window.focus(); this.display.input.focus();}, - - setOption: function(option, value) { - var options = this.options, old = options[option]; - if (options[option] == value && option != "mode") { return } - options[option] = value; - if (optionHandlers.hasOwnProperty(option)) - { operation(this, optionHandlers[option])(this, value, old); } - signal(this, "optionChange", this, option); - }, - - getOption: function(option) {return this.options[option]}, - getDoc: function() {return this.doc}, - - addKeyMap: function(map, bottom) { - this.state.keyMaps[bottom ? "push" : "unshift"](getKeyMap(map)); - }, - removeKeyMap: function(map) { - var maps = this.state.keyMaps; - for (var i = 0; i < maps.length; ++i) - { if (maps[i] == map || maps[i].name == map) { - maps.splice(i, 1); - return true - } } - }, - - addOverlay: methodOp(function(spec, options) { - var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec); - if (mode.startState) { throw new Error("Overlays may not be stateful.") } - insertSorted(this.state.overlays, - {mode: mode, modeSpec: spec, opaque: options && options.opaque, - priority: (options && options.priority) || 0}, - function (overlay) { return overlay.priority; }); - this.state.modeGen++; - regChange(this); - }), - removeOverlay: methodOp(function(spec) { - var overlays = this.state.overlays; - for (var i = 0; i < overlays.length; ++i) { - var cur = overlays[i].modeSpec; - if (cur == spec || typeof spec == "string" && cur.name == spec) { - overlays.splice(i, 1); - this.state.modeGen++; - regChange(this); - return - } - } - }), - - indentLine: methodOp(function(n, dir, aggressive) { - if (typeof dir != "string" && typeof dir != "number") { - if (dir == null) { dir = this.options.smartIndent ? "smart" : "prev"; } - else { dir = dir ? "add" : "subtract"; } - } - if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); } - }), - indentSelection: methodOp(function(how) { - var ranges = this.doc.sel.ranges, end = -1; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i]; - if (!range.empty()) { - var from = range.from(), to = range.to(); - var start = Math.max(end, from.line); - end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1; - for (var j = start; j < end; ++j) - { indentLine(this, j, how); } - var newRanges = this.doc.sel.ranges; - if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0) - { replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); } - } else if (range.head.line > end) { - indentLine(this, range.head.line, how, true); - end = range.head.line; - if (i == this.doc.sel.primIndex) { ensureCursorVisible(this); } - } - } - }), - - // Fetch the parser token for a given character. Useful for hacks - // that want to inspect the mode state (say, for completion). - getTokenAt: function(pos, precise) { - return takeToken(this, pos, precise) - }, - - getLineTokens: function(line, precise) { - return takeToken(this, Pos(line), precise, true) - }, - - getTokenTypeAt: function(pos) { - pos = clipPos(this.doc, pos); - var styles = getLineStyles(this, getLine(this.doc, pos.line)); - var before = 0, after = (styles.length - 1) / 2, ch = pos.ch; - var type; - if (ch == 0) { type = styles[2]; } - else { for (;;) { - var mid = (before + after) >> 1; - if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; } - else if (styles[mid * 2 + 1] < ch) { before = mid + 1; } - else { type = styles[mid * 2 + 2]; break } - } } - var cut = type ? type.indexOf("overlay ") : -1; - return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1) - }, - - getModeAt: function(pos) { - var mode = this.doc.mode; - if (!mode.innerMode) { return mode } - return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode - }, - - getHelper: function(pos, type) { - return this.getHelpers(pos, type)[0] - }, - - getHelpers: function(pos, type) { - var found = []; - if (!helpers.hasOwnProperty(type)) { return found } - var help = helpers[type], mode = this.getModeAt(pos); - if (typeof mode[type] == "string") { - if (help[mode[type]]) { found.push(help[mode[type]]); } - } else if (mode[type]) { - for (var i = 0; i < mode[type].length; i++) { - var val = help[mode[type][i]]; - if (val) { found.push(val); } - } - } else if (mode.helperType && help[mode.helperType]) { - found.push(help[mode.helperType]); - } else if (help[mode.name]) { - found.push(help[mode.name]); - } - for (var i$1 = 0; i$1 < help._global.length; i$1++) { - var cur = help._global[i$1]; - if (cur.pred(mode, this) && indexOf(found, cur.val) == -1) - { found.push(cur.val); } - } - return found - }, - - getStateAfter: function(line, precise) { - var doc = this.doc; - line = clipLine(doc, line == null ? doc.first + doc.size - 1: line); - return getContextBefore(this, line + 1, precise).state - }, - - cursorCoords: function(start, mode) { - var pos, range = this.doc.sel.primary(); - if (start == null) { pos = range.head; } - else if (typeof start == "object") { pos = clipPos(this.doc, start); } - else { pos = start ? range.from() : range.to(); } - return cursorCoords(this, pos, mode || "page") - }, - - charCoords: function(pos, mode) { - return charCoords(this, clipPos(this.doc, pos), mode || "page") - }, - - coordsChar: function(coords, mode) { - coords = fromCoordSystem(this, coords, mode || "page"); - return coordsChar(this, coords.left, coords.top) - }, - - lineAtHeight: function(height, mode) { - height = fromCoordSystem(this, {top: height, left: 0}, mode || "page").top; - return lineAtHeight(this.doc, height + this.display.viewOffset) - }, - heightAtLine: function(line, mode, includeWidgets) { - var end = false, lineObj; - if (typeof line == "number") { - var last = this.doc.first + this.doc.size - 1; - if (line < this.doc.first) { line = this.doc.first; } - else if (line > last) { line = last; end = true; } - lineObj = getLine(this.doc, line); - } else { - lineObj = line; - } - return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || "page", includeWidgets || end).top + - (end ? this.doc.height - heightAtLine(lineObj) : 0) - }, - - defaultTextHeight: function() { return textHeight(this.display) }, - defaultCharWidth: function() { return charWidth(this.display) }, - - getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}}, - - addWidget: function(pos, node, scroll, vert, horiz) { - var display = this.display; - pos = cursorCoords(this, clipPos(this.doc, pos)); - var top = pos.bottom, left = pos.left; - node.style.position = "absolute"; - node.setAttribute("cm-ignore-events", "true"); - this.display.input.setUneditable(node); - display.sizer.appendChild(node); - if (vert == "over") { - top = pos.top; - } else if (vert == "above" || vert == "near") { - var vspace = Math.max(display.wrapper.clientHeight, this.doc.height), - hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth); - // Default to positioning above (if specified and possible); otherwise default to positioning below - if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight) - { top = pos.top - node.offsetHeight; } - else if (pos.bottom + node.offsetHeight <= vspace) - { top = pos.bottom; } - if (left + node.offsetWidth > hspace) - { left = hspace - node.offsetWidth; } - } - node.style.top = top + "px"; - node.style.left = node.style.right = ""; - if (horiz == "right") { - left = display.sizer.clientWidth - node.offsetWidth; - node.style.right = "0px"; - } else { - if (horiz == "left") { left = 0; } - else if (horiz == "middle") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; } - node.style.left = left + "px"; - } - if (scroll) - { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); } - }, - - triggerOnKeyDown: methodOp(onKeyDown), - triggerOnKeyPress: methodOp(onKeyPress), - triggerOnKeyUp: onKeyUp, - triggerOnMouseDown: methodOp(onMouseDown), - - execCommand: function(cmd) { - if (commands.hasOwnProperty(cmd)) - { return commands[cmd].call(null, this) } - }, - - triggerElectric: methodOp(function(text) { triggerElectric(this, text); }), - - findPosH: function(from, amount, unit, visually) { - var dir = 1; - if (amount < 0) { dir = -1; amount = -amount; } - var cur = clipPos(this.doc, from); - for (var i = 0; i < amount; ++i) { - cur = findPosH(this.doc, cur, dir, unit, visually); - if (cur.hitSide) { break } - } - return cur - }, - - moveH: methodOp(function(dir, unit) { - var this$1 = this; - - this.extendSelectionsBy(function (range) { - if (this$1.display.shift || this$1.doc.extend || range.empty()) - { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) } - else - { return dir < 0 ? range.from() : range.to() } - }, sel_move); - }), - - deleteH: methodOp(function(dir, unit) { - var sel = this.doc.sel, doc = this.doc; - if (sel.somethingSelected()) - { doc.replaceSelection("", null, "+delete"); } - else - { deleteNearSelection(this, function (range) { - var other = findPosH(doc, range.head, dir, unit, false); - return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other} - }); } - }), - - findPosV: function(from, amount, unit, goalColumn) { - var dir = 1, x = goalColumn; - if (amount < 0) { dir = -1; amount = -amount; } - var cur = clipPos(this.doc, from); - for (var i = 0; i < amount; ++i) { - var coords = cursorCoords(this, cur, "div"); - if (x == null) { x = coords.left; } - else { coords.left = x; } - cur = findPosV(this, coords, dir, unit); - if (cur.hitSide) { break } - } - return cur - }, - - moveV: methodOp(function(dir, unit) { - var this$1 = this; - - var doc = this.doc, goals = []; - var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected(); - doc.extendSelectionsBy(function (range) { - if (collapse) - { return dir < 0 ? range.from() : range.to() } - var headPos = cursorCoords(this$1, range.head, "div"); - if (range.goalColumn != null) { headPos.left = range.goalColumn; } - goals.push(headPos.left); - var pos = findPosV(this$1, headPos, dir, unit); - if (unit == "page" && range == doc.sel.primary()) - { addToScrollTop(this$1, charCoords(this$1, pos, "div").top - headPos.top); } - return pos - }, sel_move); - if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++) - { doc.sel.ranges[i].goalColumn = goals[i]; } } - }), - - // Find the word at the given position (as returned by coordsChar). - findWordAt: function(pos) { - var doc = this.doc, line = getLine(doc, pos.line).text; - var start = pos.ch, end = pos.ch; - if (line) { - var helper = this.getHelper(pos, "wordChars"); - if ((pos.sticky == "before" || end == line.length) && start) { --start; } else { ++end; } - var startChar = line.charAt(start); - var check = isWordChar(startChar, helper) - ? function (ch) { return isWordChar(ch, helper); } - : /\s/.test(startChar) ? function (ch) { return /\s/.test(ch); } - : function (ch) { return (!/\s/.test(ch) && !isWordChar(ch)); }; - while (start > 0 && check(line.charAt(start - 1))) { --start; } - while (end < line.length && check(line.charAt(end))) { ++end; } - } - return new Range(Pos(pos.line, start), Pos(pos.line, end)) - }, - - toggleOverwrite: function(value) { - if (value != null && value == this.state.overwrite) { return } - if (this.state.overwrite = !this.state.overwrite) - { addClass(this.display.cursorDiv, "CodeMirror-overwrite"); } - else - { rmClass(this.display.cursorDiv, "CodeMirror-overwrite"); } - - signal(this, "overwriteToggle", this, this.state.overwrite); - }, - hasFocus: function() { return this.display.input.getField() == activeElt() }, - isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) }, - - scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }), - getScrollInfo: function() { - var scroller = this.display.scroller; - return {left: scroller.scrollLeft, top: scroller.scrollTop, - height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight, - width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth, - clientHeight: displayHeight(this), clientWidth: displayWidth(this)} - }, - - scrollIntoView: methodOp(function(range, margin) { - if (range == null) { - range = {from: this.doc.sel.primary().head, to: null}; - if (margin == null) { margin = this.options.cursorScrollMargin; } - } else if (typeof range == "number") { - range = {from: Pos(range, 0), to: null}; - } else if (range.from == null) { - range = {from: range, to: null}; - } - if (!range.to) { range.to = range.from; } - range.margin = margin || 0; - - if (range.from.line != null) { - scrollToRange(this, range); - } else { - scrollToCoordsRange(this, range.from, range.to, range.margin); - } - }), - - setSize: methodOp(function(width, height) { - var this$1 = this; - - var interpret = function (val) { return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; }; - if (width != null) { this.display.wrapper.style.width = interpret(width); } - if (height != null) { this.display.wrapper.style.height = interpret(height); } - if (this.options.lineWrapping) { clearLineMeasurementCache(this); } - var lineNo = this.display.viewFrom; - this.doc.iter(lineNo, this.display.viewTo, function (line) { - if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) - { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, "widget"); break } } } - ++lineNo; - }); - this.curOp.forceUpdate = true; - signal(this, "refresh", this); - }), - - operation: function(f){return runInOp(this, f)}, - startOperation: function(){return startOperation(this)}, - endOperation: function(){return endOperation(this)}, - - refresh: methodOp(function() { - var oldHeight = this.display.cachedTextHeight; - regChange(this); - this.curOp.forceUpdate = true; - clearCaches(this); - scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop); - updateGutterSpace(this.display); - if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5 || this.options.lineWrapping) - { estimateLineHeights(this); } - signal(this, "refresh", this); - }), - - swapDoc: methodOp(function(doc) { - var old = this.doc; - old.cm = null; - // Cancel the current text selection if any (#5821) - if (this.state.selectingText) { this.state.selectingText(); } - attachDoc(this, doc); - clearCaches(this); - this.display.input.reset(); - scrollToCoords(this, doc.scrollLeft, doc.scrollTop); - this.curOp.forceScroll = true; - signalLater(this, "swapDoc", this, old); - return old - }), - - phrase: function(phraseText) { - var phrases = this.options.phrases; - return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText - }, - - getInputField: function(){return this.display.input.getField()}, - getWrapperElement: function(){return this.display.wrapper}, - getScrollerElement: function(){return this.display.scroller}, - getGutterElement: function(){return this.display.gutters} - }; - eventMixin(CodeMirror); - - CodeMirror.registerHelper = function(type, name, value) { - if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; } - helpers[type][name] = value; - }; - CodeMirror.registerGlobalHelper = function(type, name, predicate, value) { - CodeMirror.registerHelper(type, name, value); - helpers[type]._global.push({pred: predicate, val: value}); - }; - } - - // Used for horizontal relative motion. Dir is -1 or 1 (left or - // right), unit can be "codepoint", "char", "column" (like char, but - // doesn't cross line boundaries), "word" (across next word), or - // "group" (to the start of next group of word or - // non-word-non-whitespace chars). The visually param controls - // whether, in right-to-left text, direction 1 means to move towards - // the next index in the string, or towards the character to the right - // of the current position. The resulting position will have a - // hitSide=true property if it reached the end of the document. - function findPosH(doc, pos, dir, unit, visually) { - var oldPos = pos; - var origDir = dir; - var lineObj = getLine(doc, pos.line); - var lineDir = visually && doc.direction == "rtl" ? -dir : dir; - function findNextLine() { - var l = pos.line + lineDir; - if (l < doc.first || l >= doc.first + doc.size) { return false } - pos = new Pos(l, pos.ch, pos.sticky); - return lineObj = getLine(doc, l) - } - function moveOnce(boundToLine) { - var next; - if (unit == "codepoint") { - var ch = lineObj.text.charCodeAt(pos.ch + (dir > 0 ? 0 : -1)); - if (isNaN(ch)) { - next = null; - } else { - var astral = dir > 0 ? ch >= 0xD800 && ch < 0xDC00 : ch >= 0xDC00 && ch < 0xDFFF; - next = new Pos(pos.line, Math.max(0, Math.min(lineObj.text.length, pos.ch + dir * (astral ? 2 : 1))), -dir); - } - } else if (visually) { - next = moveVisually(doc.cm, lineObj, pos, dir); - } else { - next = moveLogically(lineObj, pos, dir); - } - if (next == null) { - if (!boundToLine && findNextLine()) - { pos = endOfLine(visually, doc.cm, lineObj, pos.line, lineDir); } - else - { return false } - } else { - pos = next; - } - return true - } - - if (unit == "char" || unit == "codepoint") { - moveOnce(); - } else if (unit == "column") { - moveOnce(true); - } else if (unit == "word" || unit == "group") { - var sawType = null, group = unit == "group"; - var helper = doc.cm && doc.cm.getHelper(pos, "wordChars"); - for (var first = true;; first = false) { - if (dir < 0 && !moveOnce(!first)) { break } - var cur = lineObj.text.charAt(pos.ch) || "\n"; - var type = isWordChar(cur, helper) ? "w" - : group && cur == "\n" ? "n" - : !group || /\s/.test(cur) ? null - : "p"; - if (group && !first && !type) { type = "s"; } - if (sawType && sawType != type) { - if (dir < 0) {dir = 1; moveOnce(); pos.sticky = "after";} - break - } - - if (type) { sawType = type; } - if (dir > 0 && !moveOnce(!first)) { break } - } - } - var result = skipAtomic(doc, pos, oldPos, origDir, true); - if (equalCursorPos(oldPos, result)) { result.hitSide = true; } - return result - } - - // For relative vertical movement. Dir may be -1 or 1. Unit can be - // "page" or "line". The resulting position will have a hitSide=true - // property if it reached the end of the document. - function findPosV(cm, pos, dir, unit) { - var doc = cm.doc, x = pos.left, y; - if (unit == "page") { - var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight); - var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3); - y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount; - - } else if (unit == "line") { - y = dir > 0 ? pos.bottom + 3 : pos.top - 3; - } - var target; - for (;;) { - target = coordsChar(cm, x, y); - if (!target.outside) { break } - if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break } - y += dir * 5; - } - return target - } - - // CONTENTEDITABLE INPUT STYLE - - var ContentEditableInput = function(cm) { - this.cm = cm; - this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null; - this.polling = new Delayed(); - this.composing = null; - this.gracePeriod = false; - this.readDOMTimeout = null; - }; - - ContentEditableInput.prototype.init = function (display) { - var this$1 = this; - - var input = this, cm = input.cm; - var div = input.div = display.lineDiv; - div.contentEditable = true; - disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize); - - function belongsToInput(e) { - for (var t = e.target; t; t = t.parentNode) { - if (t == div) { return true } - if (/\bCodeMirror-(?:line)?widget\b/.test(t.className)) { break } - } - return false - } - - on(div, "paste", function (e) { - if (!belongsToInput(e) || signalDOMEvent(cm, e) || handlePaste(e, cm)) { return } - // IE doesn't fire input events, so we schedule a read for the pasted content in this way - if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); } - }); - - on(div, "compositionstart", function (e) { - this$1.composing = {data: e.data, done: false}; - }); - on(div, "compositionupdate", function (e) { - if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; } - }); - on(div, "compositionend", function (e) { - if (this$1.composing) { - if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); } - this$1.composing.done = true; - } - }); - - on(div, "touchstart", function () { return input.forceCompositionEnd(); }); - - on(div, "input", function () { - if (!this$1.composing) { this$1.readFromDOMSoon(); } - }); - - function onCopyCut(e) { - if (!belongsToInput(e) || signalDOMEvent(cm, e)) { return } - if (cm.somethingSelected()) { - setLastCopied({lineWise: false, text: cm.getSelections()}); - if (e.type == "cut") { cm.replaceSelection("", null, "cut"); } - } else if (!cm.options.lineWiseCopyCut) { - return - } else { - var ranges = copyableRanges(cm); - setLastCopied({lineWise: true, text: ranges.text}); - if (e.type == "cut") { - cm.operation(function () { - cm.setSelections(ranges.ranges, 0, sel_dontScroll); - cm.replaceSelection("", null, "cut"); - }); - } - } - if (e.clipboardData) { - e.clipboardData.clearData(); - var content = lastCopied.text.join("\n"); - // iOS exposes the clipboard API, but seems to discard content inserted into it - e.clipboardData.setData("Text", content); - if (e.clipboardData.getData("Text") == content) { - e.preventDefault(); - return - } - } - // Old-fashioned briefly-focus-a-textarea hack - var kludge = hiddenTextarea(), te = kludge.firstChild; - cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild); - te.value = lastCopied.text.join("\n"); - var hadFocus = activeElt(); - selectInput(te); - setTimeout(function () { - cm.display.lineSpace.removeChild(kludge); - hadFocus.focus(); - if (hadFocus == div) { input.showPrimarySelection(); } - }, 50); - } - on(div, "copy", onCopyCut); - on(div, "cut", onCopyCut); - }; - - ContentEditableInput.prototype.screenReaderLabelChanged = function (label) { - // Label for screenreaders, accessibility - if(label) { - this.div.setAttribute('aria-label', label); - } else { - this.div.removeAttribute('aria-label'); - } - }; - - ContentEditableInput.prototype.prepareSelection = function () { - var result = prepareSelection(this.cm, false); - result.focus = activeElt() == this.div; - return result - }; - - ContentEditableInput.prototype.showSelection = function (info, takeFocus) { - if (!info || !this.cm.display.view.length) { return } - if (info.focus || takeFocus) { this.showPrimarySelection(); } - this.showMultipleSelections(info); - }; - - ContentEditableInput.prototype.getSelection = function () { - return this.cm.display.wrapper.ownerDocument.getSelection() - }; - - ContentEditableInput.prototype.showPrimarySelection = function () { - var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary(); - var from = prim.from(), to = prim.to(); - - if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) { - sel.removeAllRanges(); - return - } - - var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset); - var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset); - if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad && - cmp(minPos(curAnchor, curFocus), from) == 0 && - cmp(maxPos(curAnchor, curFocus), to) == 0) - { return } - - var view = cm.display.view; - var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) || - {node: view[0].measure.map[2], offset: 0}; - var end = to.line < cm.display.viewTo && posToDOM(cm, to); - if (!end) { - var measure = view[view.length - 1].measure; - var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map; - end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]}; - } - - if (!start || !end) { - sel.removeAllRanges(); - return - } - - var old = sel.rangeCount && sel.getRangeAt(0), rng; - try { rng = range(start.node, start.offset, end.offset, end.node); } - catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible - if (rng) { - if (!gecko && cm.state.focused) { - sel.collapse(start.node, start.offset); - if (!rng.collapsed) { - sel.removeAllRanges(); - sel.addRange(rng); - } - } else { - sel.removeAllRanges(); - sel.addRange(rng); - } - if (old && sel.anchorNode == null) { sel.addRange(old); } - else if (gecko) { this.startGracePeriod(); } - } - this.rememberSelection(); - }; - - ContentEditableInput.prototype.startGracePeriod = function () { - var this$1 = this; - - clearTimeout(this.gracePeriod); - this.gracePeriod = setTimeout(function () { - this$1.gracePeriod = false; - if (this$1.selectionChanged()) - { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); } - }, 20); - }; - - ContentEditableInput.prototype.showMultipleSelections = function (info) { - removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors); - removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection); - }; - - ContentEditableInput.prototype.rememberSelection = function () { - var sel = this.getSelection(); - this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset; - this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset; - }; - - ContentEditableInput.prototype.selectionInEditor = function () { - var sel = this.getSelection(); - if (!sel.rangeCount) { return false } - var node = sel.getRangeAt(0).commonAncestorContainer; - return contains(this.div, node) - }; - - ContentEditableInput.prototype.focus = function () { - if (this.cm.options.readOnly != "nocursor") { - if (!this.selectionInEditor() || activeElt() != this.div) - { this.showSelection(this.prepareSelection(), true); } - this.div.focus(); - } - }; - ContentEditableInput.prototype.blur = function () { this.div.blur(); }; - ContentEditableInput.prototype.getField = function () { return this.div }; - - ContentEditableInput.prototype.supportsTouch = function () { return true }; - - ContentEditableInput.prototype.receivedFocus = function () { - var this$1 = this; - - var input = this; - if (this.selectionInEditor()) - { setTimeout(function () { return this$1.pollSelection(); }, 20); } - else - { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); } - - function poll() { - if (input.cm.state.focused) { - input.pollSelection(); - input.polling.set(input.cm.options.pollInterval, poll); - } - } - this.polling.set(this.cm.options.pollInterval, poll); - }; - - ContentEditableInput.prototype.selectionChanged = function () { - var sel = this.getSelection(); - return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset || - sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset - }; - - ContentEditableInput.prototype.pollSelection = function () { - if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return } - var sel = this.getSelection(), cm = this.cm; - // On Android Chrome (version 56, at least), backspacing into an - // uneditable block element will put the cursor in that element, - // and then, because it's not editable, hide the virtual keyboard. - // Because Android doesn't allow us to actually detect backspace - // presses in a sane way, this code checks for when that happens - // and simulates a backspace press in this case. - if (android && chrome && this.cm.display.gutterSpecs.length && isInGutter(sel.anchorNode)) { - this.cm.triggerOnKeyDown({type: "keydown", keyCode: 8, preventDefault: Math.abs}); - this.blur(); - this.focus(); - return - } - if (this.composing) { return } - this.rememberSelection(); - var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset); - var head = domToPos(cm, sel.focusNode, sel.focusOffset); - if (anchor && head) { runInOp(cm, function () { - setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll); - if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true; } - }); } - }; - - ContentEditableInput.prototype.pollContent = function () { - if (this.readDOMTimeout != null) { - clearTimeout(this.readDOMTimeout); - this.readDOMTimeout = null; - } - - var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary(); - var from = sel.from(), to = sel.to(); - if (from.ch == 0 && from.line > cm.firstLine()) - { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); } - if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine()) - { to = Pos(to.line + 1, 0); } - if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false } - - var fromIndex, fromLine, fromNode; - if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) { - fromLine = lineNo(display.view[0].line); - fromNode = display.view[0].node; - } else { - fromLine = lineNo(display.view[fromIndex].line); - fromNode = display.view[fromIndex - 1].node.nextSibling; - } - var toIndex = findViewIndex(cm, to.line); - var toLine, toNode; - if (toIndex == display.view.length - 1) { - toLine = display.viewTo - 1; - toNode = display.lineDiv.lastChild; - } else { - toLine = lineNo(display.view[toIndex + 1].line) - 1; - toNode = display.view[toIndex + 1].node.previousSibling; - } - - if (!fromNode) { return false } - var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine)); - var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length)); - while (newText.length > 1 && oldText.length > 1) { - if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; } - else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; } - else { break } - } - - var cutFront = 0, cutEnd = 0; - var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length); - while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront)) - { ++cutFront; } - var newBot = lst(newText), oldBot = lst(oldText); - var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0), - oldBot.length - (oldText.length == 1 ? cutFront : 0)); - while (cutEnd < maxCutEnd && - newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) - { ++cutEnd; } - // Try to move start of change to start of selection if ambiguous - if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) { - while (cutFront && cutFront > from.ch && - newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) { - cutFront--; - cutEnd++; - } - } - - newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\u200b+/, ""); - newText[0] = newText[0].slice(cutFront).replace(/\u200b+$/, ""); - - var chFrom = Pos(fromLine, cutFront); - var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0); - if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) { - replaceRange(cm.doc, newText, chFrom, chTo, "+input"); - return true - } - }; - - ContentEditableInput.prototype.ensurePolled = function () { - this.forceCompositionEnd(); - }; - ContentEditableInput.prototype.reset = function () { - this.forceCompositionEnd(); - }; - ContentEditableInput.prototype.forceCompositionEnd = function () { - if (!this.composing) { return } - clearTimeout(this.readDOMTimeout); - this.composing = null; - this.updateFromDOM(); - this.div.blur(); - this.div.focus(); - }; - ContentEditableInput.prototype.readFromDOMSoon = function () { - var this$1 = this; - - if (this.readDOMTimeout != null) { return } - this.readDOMTimeout = setTimeout(function () { - this$1.readDOMTimeout = null; - if (this$1.composing) { - if (this$1.composing.done) { this$1.composing = null; } - else { return } - } - this$1.updateFromDOM(); - }, 80); - }; - - ContentEditableInput.prototype.updateFromDOM = function () { - var this$1 = this; - - if (this.cm.isReadOnly() || !this.pollContent()) - { runInOp(this.cm, function () { return regChange(this$1.cm); }); } - }; - - ContentEditableInput.prototype.setUneditable = function (node) { - node.contentEditable = "false"; - }; - - ContentEditableInput.prototype.onKeyPress = function (e) { - if (e.charCode == 0 || this.composing) { return } - e.preventDefault(); - if (!this.cm.isReadOnly()) - { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); } - }; - - ContentEditableInput.prototype.readOnlyChanged = function (val) { - this.div.contentEditable = String(val != "nocursor"); - }; - - ContentEditableInput.prototype.onContextMenu = function () {}; - ContentEditableInput.prototype.resetPosition = function () {}; - - ContentEditableInput.prototype.needsContentAttribute = true; - - function posToDOM(cm, pos) { - var view = findViewForLine(cm, pos.line); - if (!view || view.hidden) { return null } - var line = getLine(cm.doc, pos.line); - var info = mapFromLineView(view, line, pos.line); - - var order = getOrder(line, cm.doc.direction), side = "left"; - if (order) { - var partPos = getBidiPartAt(order, pos.ch); - side = partPos % 2 ? "right" : "left"; - } - var result = nodeAndOffsetInLineMap(info.map, pos.ch, side); - result.offset = result.collapse == "right" ? result.end : result.start; - return result - } - - function isInGutter(node) { - for (var scan = node; scan; scan = scan.parentNode) - { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } } - return false - } - - function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos } - - function domTextBetween(cm, from, to, fromLine, toLine) { - var text = "", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false; - function recognizeMarker(id) { return function (marker) { return marker.id == id; } } - function close() { - if (closing) { - text += lineSep; - if (extraLinebreak) { text += lineSep; } - closing = extraLinebreak = false; - } - } - function addText(str) { - if (str) { - close(); - text += str; - } - } - function walk(node) { - if (node.nodeType == 1) { - var cmText = node.getAttribute("cm-text"); - if (cmText) { - addText(cmText); - return - } - var markerID = node.getAttribute("cm-marker"), range; - if (markerID) { - var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID)); - if (found.length && (range = found[0].find(0))) - { addText(getBetween(cm.doc, range.from, range.to).join(lineSep)); } - return - } - if (node.getAttribute("contenteditable") == "false") { return } - var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName); - if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return } - - if (isBlock) { close(); } - for (var i = 0; i < node.childNodes.length; i++) - { walk(node.childNodes[i]); } - - if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; } - if (isBlock) { closing = true; } - } else if (node.nodeType == 3) { - addText(node.nodeValue.replace(/\u200b/g, "").replace(/\u00a0/g, " ")); - } - } - for (;;) { - walk(from); - if (from == to) { break } - from = from.nextSibling; - extraLinebreak = false; - } - return text - } - - function domToPos(cm, node, offset) { - var lineNode; - if (node == cm.display.lineDiv) { - lineNode = cm.display.lineDiv.childNodes[offset]; - if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) } - node = null; offset = 0; - } else { - for (lineNode = node;; lineNode = lineNode.parentNode) { - if (!lineNode || lineNode == cm.display.lineDiv) { return null } - if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break } - } - } - for (var i = 0; i < cm.display.view.length; i++) { - var lineView = cm.display.view[i]; - if (lineView.node == lineNode) - { return locateNodeInLineView(lineView, node, offset) } - } - } - - function locateNodeInLineView(lineView, node, offset) { - var wrapper = lineView.text.firstChild, bad = false; - if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) } - if (node == wrapper) { - bad = true; - node = wrapper.childNodes[offset]; - offset = 0; - if (!node) { - var line = lineView.rest ? lst(lineView.rest) : lineView.line; - return badPos(Pos(lineNo(line), line.text.length), bad) - } - } - - var textNode = node.nodeType == 3 ? node : null, topNode = node; - if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) { - textNode = node.firstChild; - if (offset) { offset = textNode.nodeValue.length; } - } - while (topNode.parentNode != wrapper) { topNode = topNode.parentNode; } - var measure = lineView.measure, maps = measure.maps; - - function find(textNode, topNode, offset) { - for (var i = -1; i < (maps ? maps.length : 0); i++) { - var map = i < 0 ? measure.map : maps[i]; - for (var j = 0; j < map.length; j += 3) { - var curNode = map[j + 2]; - if (curNode == textNode || curNode == topNode) { - var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]); - var ch = map[j] + offset; - if (offset < 0 || curNode != textNode) { ch = map[j + (offset ? 1 : 0)]; } - return Pos(line, ch) - } - } - } - } - var found = find(textNode, topNode, offset); - if (found) { return badPos(found, bad) } - - // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems - for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) { - found = find(after, after.firstChild, 0); - if (found) - { return badPos(Pos(found.line, found.ch - dist), bad) } - else - { dist += after.textContent.length; } - } - for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) { - found = find(before, before.firstChild, -1); - if (found) - { return badPos(Pos(found.line, found.ch + dist$1), bad) } - else - { dist$1 += before.textContent.length; } - } - } - - // TEXTAREA INPUT STYLE - - var TextareaInput = function(cm) { - this.cm = cm; - // See input.poll and input.reset - this.prevInput = ""; - - // Flag that indicates whether we expect input to appear real soon - // now (after some event like 'keypress' or 'input') and are - // polling intensively. - this.pollingFast = false; - // Self-resetting timeout for the poller - this.polling = new Delayed(); - // Used to work around IE issue with selection being forgotten when focus moves away from textarea - this.hasSelection = false; - this.composing = null; - }; - - TextareaInput.prototype.init = function (display) { - var this$1 = this; - - var input = this, cm = this.cm; - this.createField(display); - var te = this.textarea; - - display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild); - - // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore) - if (ios) { te.style.width = "0px"; } - - on(te, "input", function () { - if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; } - input.poll(); - }); - - on(te, "paste", function (e) { - if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return } - - cm.state.pasteIncoming = +new Date; - input.fastPoll(); - }); - - function prepareCopyCut(e) { - if (signalDOMEvent(cm, e)) { return } - if (cm.somethingSelected()) { - setLastCopied({lineWise: false, text: cm.getSelections()}); - } else if (!cm.options.lineWiseCopyCut) { - return - } else { - var ranges = copyableRanges(cm); - setLastCopied({lineWise: true, text: ranges.text}); - if (e.type == "cut") { - cm.setSelections(ranges.ranges, null, sel_dontScroll); - } else { - input.prevInput = ""; - te.value = ranges.text.join("\n"); - selectInput(te); - } - } - if (e.type == "cut") { cm.state.cutIncoming = +new Date; } - } - on(te, "cut", prepareCopyCut); - on(te, "copy", prepareCopyCut); - - on(display.scroller, "paste", function (e) { - if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return } - if (!te.dispatchEvent) { - cm.state.pasteIncoming = +new Date; - input.focus(); - return - } - - // Pass the `paste` event to the textarea so it's handled by its event listener. - var event = new Event("paste"); - event.clipboardData = e.clipboardData; - te.dispatchEvent(event); - }); - - // Prevent normal selection in the editor (we handle our own) - on(display.lineSpace, "selectstart", function (e) { - if (!eventInWidget(display, e)) { e_preventDefault(e); } - }); - - on(te, "compositionstart", function () { - var start = cm.getCursor("from"); - if (input.composing) { input.composing.range.clear(); } - input.composing = { - start: start, - range: cm.markText(start, cm.getCursor("to"), {className: "CodeMirror-composing"}) - }; - }); - on(te, "compositionend", function () { - if (input.composing) { - input.poll(); - input.composing.range.clear(); - input.composing = null; - } - }); - }; - - TextareaInput.prototype.createField = function (_display) { - // Wraps and hides input textarea - this.wrapper = hiddenTextarea(); - // The semihidden textarea that is focused when the editor is - // focused, and receives input. - this.textarea = this.wrapper.firstChild; - }; - - TextareaInput.prototype.screenReaderLabelChanged = function (label) { - // Label for screenreaders, accessibility - if(label) { - this.textarea.setAttribute('aria-label', label); - } else { - this.textarea.removeAttribute('aria-label'); - } - }; - - TextareaInput.prototype.prepareSelection = function () { - // Redraw the selection and/or cursor - var cm = this.cm, display = cm.display, doc = cm.doc; - var result = prepareSelection(cm); - - // Move the hidden textarea near the cursor to prevent scrolling artifacts - if (cm.options.moveInputWithCursor) { - var headPos = cursorCoords(cm, doc.sel.primary().head, "div"); - var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect(); - result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10, - headPos.top + lineOff.top - wrapOff.top)); - result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10, - headPos.left + lineOff.left - wrapOff.left)); - } - - return result - }; - - TextareaInput.prototype.showSelection = function (drawn) { - var cm = this.cm, display = cm.display; - removeChildrenAndAdd(display.cursorDiv, drawn.cursors); - removeChildrenAndAdd(display.selectionDiv, drawn.selection); - if (drawn.teTop != null) { - this.wrapper.style.top = drawn.teTop + "px"; - this.wrapper.style.left = drawn.teLeft + "px"; - } - }; - - // Reset the input to correspond to the selection (or to be empty, - // when not typing and nothing is selected) - TextareaInput.prototype.reset = function (typing) { - if (this.contextMenuPending || this.composing) { return } - var cm = this.cm; - if (cm.somethingSelected()) { - this.prevInput = ""; - var content = cm.getSelection(); - this.textarea.value = content; - if (cm.state.focused) { selectInput(this.textarea); } - if (ie && ie_version >= 9) { this.hasSelection = content; } - } else if (!typing) { - this.prevInput = this.textarea.value = ""; - if (ie && ie_version >= 9) { this.hasSelection = null; } - } - }; - - TextareaInput.prototype.getField = function () { return this.textarea }; - - TextareaInput.prototype.supportsTouch = function () { return false }; - - TextareaInput.prototype.focus = function () { - if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt() != this.textarea)) { - try { this.textarea.focus(); } - catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM - } - }; - - TextareaInput.prototype.blur = function () { this.textarea.blur(); }; - - TextareaInput.prototype.resetPosition = function () { - this.wrapper.style.top = this.wrapper.style.left = 0; - }; - - TextareaInput.prototype.receivedFocus = function () { this.slowPoll(); }; - - // Poll for input changes, using the normal rate of polling. This - // runs as long as the editor is focused. - TextareaInput.prototype.slowPoll = function () { - var this$1 = this; - - if (this.pollingFast) { return } - this.polling.set(this.cm.options.pollInterval, function () { - this$1.poll(); - if (this$1.cm.state.focused) { this$1.slowPoll(); } - }); - }; - - // When an event has just come in that is likely to add or change - // something in the input textarea, we poll faster, to ensure that - // the change appears on the screen quickly. - TextareaInput.prototype.fastPoll = function () { - var missed = false, input = this; - input.pollingFast = true; - function p() { - var changed = input.poll(); - if (!changed && !missed) {missed = true; input.polling.set(60, p);} - else {input.pollingFast = false; input.slowPoll();} - } - input.polling.set(20, p); - }; - - // Read input from the textarea, and update the document to match. - // When something is selected, it is present in the textarea, and - // selected (unless it is huge, in which case a placeholder is - // used). When nothing is selected, the cursor sits after previously - // seen text (can be empty), which is stored in prevInput (we must - // not reset the textarea when typing, because that breaks IME). - TextareaInput.prototype.poll = function () { - var this$1 = this; - - var cm = this.cm, input = this.textarea, prevInput = this.prevInput; - // Since this is called a *lot*, try to bail out as cheaply as - // possible when it is clear that nothing happened. hasSelection - // will be the case when there is a lot of text in the textarea, - // in which case reading its value would be expensive. - if (this.contextMenuPending || !cm.state.focused || - (hasSelection(input) && !prevInput && !this.composing) || - cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq) - { return false } - - var text = input.value; - // If nothing changed, bail. - if (text == prevInput && !cm.somethingSelected()) { return false } - // Work around nonsensical selection resetting in IE9/10, and - // inexplicable appearance of private area unicode characters on - // some key combos in Mac (#2689). - if (ie && ie_version >= 9 && this.hasSelection === text || - mac && /[\uf700-\uf7ff]/.test(text)) { - cm.display.input.reset(); - return false - } - - if (cm.doc.sel == cm.display.selForContextMenu) { - var first = text.charCodeAt(0); - if (first == 0x200b && !prevInput) { prevInput = "\u200b"; } - if (first == 0x21da) { this.reset(); return this.cm.execCommand("undo") } - } - // Find the part of the input that is actually new - var same = 0, l = Math.min(prevInput.length, text.length); - while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same; } - - runInOp(cm, function () { - applyTextInput(cm, text.slice(same), prevInput.length - same, - null, this$1.composing ? "*compose" : null); - - // Don't leave long text in the textarea, since it makes further polling slow - if (text.length > 1000 || text.indexOf("\n") > -1) { input.value = this$1.prevInput = ""; } - else { this$1.prevInput = text; } - - if (this$1.composing) { - this$1.composing.range.clear(); - this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor("to"), - {className: "CodeMirror-composing"}); - } - }); - return true - }; - - TextareaInput.prototype.ensurePolled = function () { - if (this.pollingFast && this.poll()) { this.pollingFast = false; } - }; - - TextareaInput.prototype.onKeyPress = function () { - if (ie && ie_version >= 9) { this.hasSelection = null; } - this.fastPoll(); - }; - - TextareaInput.prototype.onContextMenu = function (e) { - var input = this, cm = input.cm, display = cm.display, te = input.textarea; - if (input.contextMenuPending) { input.contextMenuPending(); } - var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop; - if (!pos || presto) { return } // Opera is difficult. - - // Reset the current text selection only if the click is done outside of the selection - // and 'resetSelectionOnContextMenu' option is true. - var reset = cm.options.resetSelectionOnContextMenu; - if (reset && cm.doc.sel.contains(pos) == -1) - { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); } - - var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText; - var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect(); - input.wrapper.style.cssText = "position: static"; - te.style.cssText = "position: absolute; width: 30px; height: 30px;\n top: " + (e.clientY - wrapperBox.top - 5) + "px; left: " + (e.clientX - wrapperBox.left - 5) + "px;\n z-index: 1000; background: " + (ie ? "rgba(255, 255, 255, .05)" : "transparent") + ";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"; - var oldScrollY; - if (webkit) { oldScrollY = window.scrollY; } // Work around Chrome issue (#2712) - display.input.focus(); - if (webkit) { window.scrollTo(null, oldScrollY); } - display.input.reset(); - // Adds "Select all" to context menu in FF - if (!cm.somethingSelected()) { te.value = input.prevInput = " "; } - input.contextMenuPending = rehide; - display.selForContextMenu = cm.doc.sel; - clearTimeout(display.detectingSelectAll); - - // Select-all will be greyed out if there's nothing to select, so - // this adds a zero-width space so that we can later check whether - // it got selected. - function prepareSelectAllHack() { - if (te.selectionStart != null) { - var selected = cm.somethingSelected(); - var extval = "\u200b" + (selected ? te.value : ""); - te.value = "\u21da"; // Used to catch context-menu undo - te.value = extval; - input.prevInput = selected ? "" : "\u200b"; - te.selectionStart = 1; te.selectionEnd = extval.length; - // Re-set this, in case some other handler touched the - // selection in the meantime. - display.selForContextMenu = cm.doc.sel; - } - } - function rehide() { - if (input.contextMenuPending != rehide) { return } - input.contextMenuPending = false; - input.wrapper.style.cssText = oldWrapperCSS; - te.style.cssText = oldCSS; - if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); } - - // Try to detect the user choosing select-all - if (te.selectionStart != null) { - if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack(); } - var i = 0, poll = function () { - if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 && - te.selectionEnd > 0 && input.prevInput == "\u200b") { - operation(cm, selectAll)(cm); - } else if (i++ < 10) { - display.detectingSelectAll = setTimeout(poll, 500); - } else { - display.selForContextMenu = null; - display.input.reset(); - } - }; - display.detectingSelectAll = setTimeout(poll, 200); - } - } - - if (ie && ie_version >= 9) { prepareSelectAllHack(); } - if (captureRightClick) { - e_stop(e); - var mouseup = function () { - off(window, "mouseup", mouseup); - setTimeout(rehide, 20); - }; - on(window, "mouseup", mouseup); - } else { - setTimeout(rehide, 50); - } - }; - - TextareaInput.prototype.readOnlyChanged = function (val) { - if (!val) { this.reset(); } - this.textarea.disabled = val == "nocursor"; - this.textarea.readOnly = !!val; - }; - - TextareaInput.prototype.setUneditable = function () {}; - - TextareaInput.prototype.needsContentAttribute = false; - - function fromTextArea(textarea, options) { - options = options ? copyObj(options) : {}; - options.value = textarea.value; - if (!options.tabindex && textarea.tabIndex) - { options.tabindex = textarea.tabIndex; } - if (!options.placeholder && textarea.placeholder) - { options.placeholder = textarea.placeholder; } - // Set autofocus to true if this textarea is focused, or if it has - // autofocus and no other element is focused. - if (options.autofocus == null) { - var hasFocus = activeElt(); - options.autofocus = hasFocus == textarea || - textarea.getAttribute("autofocus") != null && hasFocus == document.body; - } - - function save() {textarea.value = cm.getValue();} - - var realSubmit; - if (textarea.form) { - on(textarea.form, "submit", save); - // Deplorable hack to make the submit method do the right thing. - if (!options.leaveSubmitMethodAlone) { - var form = textarea.form; - realSubmit = form.submit; - try { - var wrappedSubmit = form.submit = function () { - save(); - form.submit = realSubmit; - form.submit(); - form.submit = wrappedSubmit; - }; - } catch(e) {} - } - } - - options.finishInit = function (cm) { - cm.save = save; - cm.getTextArea = function () { return textarea; }; - cm.toTextArea = function () { - cm.toTextArea = isNaN; // Prevent this from being ran twice - save(); - textarea.parentNode.removeChild(cm.getWrapperElement()); - textarea.style.display = ""; - if (textarea.form) { - off(textarea.form, "submit", save); - if (!options.leaveSubmitMethodAlone && typeof textarea.form.submit == "function") - { textarea.form.submit = realSubmit; } - } - }; - }; - - textarea.style.display = "none"; - var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); }, - options); - return cm - } - - function addLegacyProps(CodeMirror) { - CodeMirror.off = off; - CodeMirror.on = on; - CodeMirror.wheelEventPixels = wheelEventPixels; - CodeMirror.Doc = Doc; - CodeMirror.splitLines = splitLinesAuto; - CodeMirror.countColumn = countColumn; - CodeMirror.findColumn = findColumn; - CodeMirror.isWordChar = isWordCharBasic; - CodeMirror.Pass = Pass; - CodeMirror.signal = signal; - CodeMirror.Line = Line; - CodeMirror.changeEnd = changeEnd; - CodeMirror.scrollbarModel = scrollbarModel; - CodeMirror.Pos = Pos; - CodeMirror.cmpPos = cmp; - CodeMirror.modes = modes; - CodeMirror.mimeModes = mimeModes; - CodeMirror.resolveMode = resolveMode; - CodeMirror.getMode = getMode; - CodeMirror.modeExtensions = modeExtensions; - CodeMirror.extendMode = extendMode; - CodeMirror.copyState = copyState; - CodeMirror.startState = startState; - CodeMirror.innerMode = innerMode; - CodeMirror.commands = commands; - CodeMirror.keyMap = keyMap; - CodeMirror.keyName = keyName; - CodeMirror.isModifierKey = isModifierKey; - CodeMirror.lookupKey = lookupKey; - CodeMirror.normalizeKeyMap = normalizeKeyMap; - CodeMirror.StringStream = StringStream; - CodeMirror.SharedTextMarker = SharedTextMarker; - CodeMirror.TextMarker = TextMarker; - CodeMirror.LineWidget = LineWidget; - CodeMirror.e_preventDefault = e_preventDefault; - CodeMirror.e_stopPropagation = e_stopPropagation; - CodeMirror.e_stop = e_stop; - CodeMirror.addClass = addClass; - CodeMirror.contains = contains; - CodeMirror.rmClass = rmClass; - CodeMirror.keyNames = keyNames; - } - - // EDITOR CONSTRUCTOR - - defineOptions(CodeMirror); - - addEditorMethods(CodeMirror); - - // Set up methods on CodeMirror's prototype to redirect to the editor's document. - var dontDelegate = "iter insert remove copy getEditor constructor".split(" "); - for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0) - { CodeMirror.prototype[prop] = (function(method) { - return function() {return method.apply(this.doc, arguments)} - })(Doc.prototype[prop]); } } - - eventMixin(Doc); - CodeMirror.inputStyles = {"textarea": TextareaInput, "contenteditable": ContentEditableInput}; - - // Extra arguments are stored as the mode's dependencies, which is - // used by (legacy) mechanisms like loadmode.js to automatically - // load a mode. (Preferred mechanism is the require/define calls.) - CodeMirror.defineMode = function(name/*, mode, …*/) { - if (!CodeMirror.defaults.mode && name != "null") { CodeMirror.defaults.mode = name; } - defineMode.apply(this, arguments); - }; - - CodeMirror.defineMIME = defineMIME; - - // Minimal default mode. - CodeMirror.defineMode("null", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); }); - CodeMirror.defineMIME("text/plain", "null"); - - // EXTENSIONS - - CodeMirror.defineExtension = function (name, func) { - CodeMirror.prototype[name] = func; - }; - CodeMirror.defineDocExtension = function (name, func) { - Doc.prototype[name] = func; - }; - - CodeMirror.fromTextArea = fromTextArea; - - addLegacyProps(CodeMirror); - - CodeMirror.version = "5.65.1"; - - return CodeMirror; - -}))); -}); - -export { codemirror as c }; diff --git a/docs/_snowpack/pkg/common/index-1e63141f.js b/docs/_snowpack/pkg/common/index-1e63141f.js deleted file mode 100644 index 15f53e79..00000000 --- a/docs/_snowpack/pkg/common/index-1e63141f.js +++ /dev/null @@ -1,1090 +0,0 @@ -import { g as getDefaultExportFromCjs, c as createCommonjsModule } from './_commonjsHelpers-8c19dec8.js'; - -var dist = createCommonjsModule(function (module, exports) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -// Generated by scripts/generate.js. - -/** - * Copyright 2016 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -var ArrayAssignmentTarget = exports.ArrayAssignmentTarget = function ArrayAssignmentTarget(_ref) { - var elements = _ref.elements, - rest = _ref.rest; - - _classCallCheck(this, ArrayAssignmentTarget); - - this.type = 'ArrayAssignmentTarget'; - this.elements = elements; - this.rest = rest; -}; - -var ArrayBinding = exports.ArrayBinding = function ArrayBinding(_ref2) { - var elements = _ref2.elements, - rest = _ref2.rest; - - _classCallCheck(this, ArrayBinding); - - this.type = 'ArrayBinding'; - this.elements = elements; - this.rest = rest; -}; - -var ArrayExpression = exports.ArrayExpression = function ArrayExpression(_ref3) { - var elements = _ref3.elements; - - _classCallCheck(this, ArrayExpression); - - this.type = 'ArrayExpression'; - this.elements = elements; -}; - -var ArrowExpression = exports.ArrowExpression = function ArrowExpression(_ref4) { - var isAsync = _ref4.isAsync, - params = _ref4.params, - body = _ref4.body; - - _classCallCheck(this, ArrowExpression); - - this.type = 'ArrowExpression'; - this.isAsync = isAsync; - this.params = params; - this.body = body; -}; - -var AssignmentExpression = exports.AssignmentExpression = function AssignmentExpression(_ref5) { - var binding = _ref5.binding, - expression = _ref5.expression; - - _classCallCheck(this, AssignmentExpression); - - this.type = 'AssignmentExpression'; - this.binding = binding; - this.expression = expression; -}; - -var AssignmentTargetIdentifier = exports.AssignmentTargetIdentifier = function AssignmentTargetIdentifier(_ref6) { - var name = _ref6.name; - - _classCallCheck(this, AssignmentTargetIdentifier); - - this.type = 'AssignmentTargetIdentifier'; - this.name = name; -}; - -var AssignmentTargetPropertyIdentifier = exports.AssignmentTargetPropertyIdentifier = function AssignmentTargetPropertyIdentifier(_ref7) { - var binding = _ref7.binding, - init = _ref7.init; - - _classCallCheck(this, AssignmentTargetPropertyIdentifier); - - this.type = 'AssignmentTargetPropertyIdentifier'; - this.binding = binding; - this.init = init; -}; - -var AssignmentTargetPropertyProperty = exports.AssignmentTargetPropertyProperty = function AssignmentTargetPropertyProperty(_ref8) { - var name = _ref8.name, - binding = _ref8.binding; - - _classCallCheck(this, AssignmentTargetPropertyProperty); - - this.type = 'AssignmentTargetPropertyProperty'; - this.name = name; - this.binding = binding; -}; - -var AssignmentTargetWithDefault = exports.AssignmentTargetWithDefault = function AssignmentTargetWithDefault(_ref9) { - var binding = _ref9.binding, - init = _ref9.init; - - _classCallCheck(this, AssignmentTargetWithDefault); - - this.type = 'AssignmentTargetWithDefault'; - this.binding = binding; - this.init = init; -}; - -var AwaitExpression = exports.AwaitExpression = function AwaitExpression(_ref10) { - var expression = _ref10.expression; - - _classCallCheck(this, AwaitExpression); - - this.type = 'AwaitExpression'; - this.expression = expression; -}; - -var BinaryExpression = exports.BinaryExpression = function BinaryExpression(_ref11) { - var left = _ref11.left, - operator = _ref11.operator, - right = _ref11.right; - - _classCallCheck(this, BinaryExpression); - - this.type = 'BinaryExpression'; - this.left = left; - this.operator = operator; - this.right = right; -}; - -var BindingIdentifier = exports.BindingIdentifier = function BindingIdentifier(_ref12) { - var name = _ref12.name; - - _classCallCheck(this, BindingIdentifier); - - this.type = 'BindingIdentifier'; - this.name = name; -}; - -var BindingPropertyIdentifier = exports.BindingPropertyIdentifier = function BindingPropertyIdentifier(_ref13) { - var binding = _ref13.binding, - init = _ref13.init; - - _classCallCheck(this, BindingPropertyIdentifier); - - this.type = 'BindingPropertyIdentifier'; - this.binding = binding; - this.init = init; -}; - -var BindingPropertyProperty = exports.BindingPropertyProperty = function BindingPropertyProperty(_ref14) { - var name = _ref14.name, - binding = _ref14.binding; - - _classCallCheck(this, BindingPropertyProperty); - - this.type = 'BindingPropertyProperty'; - this.name = name; - this.binding = binding; -}; - -var BindingWithDefault = exports.BindingWithDefault = function BindingWithDefault(_ref15) { - var binding = _ref15.binding, - init = _ref15.init; - - _classCallCheck(this, BindingWithDefault); - - this.type = 'BindingWithDefault'; - this.binding = binding; - this.init = init; -}; - -var Block = exports.Block = function Block(_ref16) { - var statements = _ref16.statements; - - _classCallCheck(this, Block); - - this.type = 'Block'; - this.statements = statements; -}; - -var BlockStatement = exports.BlockStatement = function BlockStatement(_ref17) { - var block = _ref17.block; - - _classCallCheck(this, BlockStatement); - - this.type = 'BlockStatement'; - this.block = block; -}; - -var BreakStatement = exports.BreakStatement = function BreakStatement(_ref18) { - var label = _ref18.label; - - _classCallCheck(this, BreakStatement); - - this.type = 'BreakStatement'; - this.label = label; -}; - -var CallExpression = exports.CallExpression = function CallExpression(_ref19) { - var callee = _ref19.callee, - _arguments = _ref19.arguments; - - _classCallCheck(this, CallExpression); - - this.type = 'CallExpression'; - this.callee = callee; - this.arguments = _arguments; -}; - -var CatchClause = exports.CatchClause = function CatchClause(_ref20) { - var binding = _ref20.binding, - body = _ref20.body; - - _classCallCheck(this, CatchClause); - - this.type = 'CatchClause'; - this.binding = binding; - this.body = body; -}; - -var ClassDeclaration = exports.ClassDeclaration = function ClassDeclaration(_ref21) { - var name = _ref21.name, - _super = _ref21.super, - elements = _ref21.elements; - - _classCallCheck(this, ClassDeclaration); - - this.type = 'ClassDeclaration'; - this.name = name; - this.super = _super; - this.elements = elements; -}; - -var ClassElement = exports.ClassElement = function ClassElement(_ref22) { - var isStatic = _ref22.isStatic, - method = _ref22.method; - - _classCallCheck(this, ClassElement); - - this.type = 'ClassElement'; - this.isStatic = isStatic; - this.method = method; -}; - -var ClassExpression = exports.ClassExpression = function ClassExpression(_ref23) { - var name = _ref23.name, - _super = _ref23.super, - elements = _ref23.elements; - - _classCallCheck(this, ClassExpression); - - this.type = 'ClassExpression'; - this.name = name; - this.super = _super; - this.elements = elements; -}; - -var CompoundAssignmentExpression = exports.CompoundAssignmentExpression = function CompoundAssignmentExpression(_ref24) { - var binding = _ref24.binding, - operator = _ref24.operator, - expression = _ref24.expression; - - _classCallCheck(this, CompoundAssignmentExpression); - - this.type = 'CompoundAssignmentExpression'; - this.binding = binding; - this.operator = operator; - this.expression = expression; -}; - -var ComputedMemberAssignmentTarget = exports.ComputedMemberAssignmentTarget = function ComputedMemberAssignmentTarget(_ref25) { - var object = _ref25.object, - expression = _ref25.expression; - - _classCallCheck(this, ComputedMemberAssignmentTarget); - - this.type = 'ComputedMemberAssignmentTarget'; - this.object = object; - this.expression = expression; -}; - -var ComputedMemberExpression = exports.ComputedMemberExpression = function ComputedMemberExpression(_ref26) { - var object = _ref26.object, - expression = _ref26.expression; - - _classCallCheck(this, ComputedMemberExpression); - - this.type = 'ComputedMemberExpression'; - this.object = object; - this.expression = expression; -}; - -var ComputedPropertyName = exports.ComputedPropertyName = function ComputedPropertyName(_ref27) { - var expression = _ref27.expression; - - _classCallCheck(this, ComputedPropertyName); - - this.type = 'ComputedPropertyName'; - this.expression = expression; -}; - -var ConditionalExpression = exports.ConditionalExpression = function ConditionalExpression(_ref28) { - var test = _ref28.test, - consequent = _ref28.consequent, - alternate = _ref28.alternate; - - _classCallCheck(this, ConditionalExpression); - - this.type = 'ConditionalExpression'; - this.test = test; - this.consequent = consequent; - this.alternate = alternate; -}; - -var ContinueStatement = exports.ContinueStatement = function ContinueStatement(_ref29) { - var label = _ref29.label; - - _classCallCheck(this, ContinueStatement); - - this.type = 'ContinueStatement'; - this.label = label; -}; - -var DataProperty = exports.DataProperty = function DataProperty(_ref30) { - var name = _ref30.name, - expression = _ref30.expression; - - _classCallCheck(this, DataProperty); - - this.type = 'DataProperty'; - this.name = name; - this.expression = expression; -}; - -var DebuggerStatement = exports.DebuggerStatement = function DebuggerStatement() { - _classCallCheck(this, DebuggerStatement); - - this.type = 'DebuggerStatement'; -}; - -var Directive = exports.Directive = function Directive(_ref31) { - var rawValue = _ref31.rawValue; - - _classCallCheck(this, Directive); - - this.type = 'Directive'; - this.rawValue = rawValue; -}; - -var DoWhileStatement = exports.DoWhileStatement = function DoWhileStatement(_ref32) { - var body = _ref32.body, - test = _ref32.test; - - _classCallCheck(this, DoWhileStatement); - - this.type = 'DoWhileStatement'; - this.body = body; - this.test = test; -}; - -var EmptyStatement = exports.EmptyStatement = function EmptyStatement() { - _classCallCheck(this, EmptyStatement); - - this.type = 'EmptyStatement'; -}; - -var Export = exports.Export = function Export(_ref33) { - var declaration = _ref33.declaration; - - _classCallCheck(this, Export); - - this.type = 'Export'; - this.declaration = declaration; -}; - -var ExportAllFrom = exports.ExportAllFrom = function ExportAllFrom(_ref34) { - var moduleSpecifier = _ref34.moduleSpecifier; - - _classCallCheck(this, ExportAllFrom); - - this.type = 'ExportAllFrom'; - this.moduleSpecifier = moduleSpecifier; -}; - -var ExportDefault = exports.ExportDefault = function ExportDefault(_ref35) { - var body = _ref35.body; - - _classCallCheck(this, ExportDefault); - - this.type = 'ExportDefault'; - this.body = body; -}; - -var ExportFrom = exports.ExportFrom = function ExportFrom(_ref36) { - var namedExports = _ref36.namedExports, - moduleSpecifier = _ref36.moduleSpecifier; - - _classCallCheck(this, ExportFrom); - - this.type = 'ExportFrom'; - this.namedExports = namedExports; - this.moduleSpecifier = moduleSpecifier; -}; - -var ExportFromSpecifier = exports.ExportFromSpecifier = function ExportFromSpecifier(_ref37) { - var name = _ref37.name, - exportedName = _ref37.exportedName; - - _classCallCheck(this, ExportFromSpecifier); - - this.type = 'ExportFromSpecifier'; - this.name = name; - this.exportedName = exportedName; -}; - -var ExportLocalSpecifier = exports.ExportLocalSpecifier = function ExportLocalSpecifier(_ref38) { - var name = _ref38.name, - exportedName = _ref38.exportedName; - - _classCallCheck(this, ExportLocalSpecifier); - - this.type = 'ExportLocalSpecifier'; - this.name = name; - this.exportedName = exportedName; -}; - -var ExportLocals = exports.ExportLocals = function ExportLocals(_ref39) { - var namedExports = _ref39.namedExports; - - _classCallCheck(this, ExportLocals); - - this.type = 'ExportLocals'; - this.namedExports = namedExports; -}; - -var ExpressionStatement = exports.ExpressionStatement = function ExpressionStatement(_ref40) { - var expression = _ref40.expression; - - _classCallCheck(this, ExpressionStatement); - - this.type = 'ExpressionStatement'; - this.expression = expression; -}; - -var ForAwaitStatement = exports.ForAwaitStatement = function ForAwaitStatement(_ref41) { - var left = _ref41.left, - right = _ref41.right, - body = _ref41.body; - - _classCallCheck(this, ForAwaitStatement); - - this.type = 'ForAwaitStatement'; - this.left = left; - this.right = right; - this.body = body; -}; - -var ForInStatement = exports.ForInStatement = function ForInStatement(_ref42) { - var left = _ref42.left, - right = _ref42.right, - body = _ref42.body; - - _classCallCheck(this, ForInStatement); - - this.type = 'ForInStatement'; - this.left = left; - this.right = right; - this.body = body; -}; - -var ForOfStatement = exports.ForOfStatement = function ForOfStatement(_ref43) { - var left = _ref43.left, - right = _ref43.right, - body = _ref43.body; - - _classCallCheck(this, ForOfStatement); - - this.type = 'ForOfStatement'; - this.left = left; - this.right = right; - this.body = body; -}; - -var ForStatement = exports.ForStatement = function ForStatement(_ref44) { - var init = _ref44.init, - test = _ref44.test, - update = _ref44.update, - body = _ref44.body; - - _classCallCheck(this, ForStatement); - - this.type = 'ForStatement'; - this.init = init; - this.test = test; - this.update = update; - this.body = body; -}; - -var FormalParameters = exports.FormalParameters = function FormalParameters(_ref45) { - var items = _ref45.items, - rest = _ref45.rest; - - _classCallCheck(this, FormalParameters); - - this.type = 'FormalParameters'; - this.items = items; - this.rest = rest; -}; - -var FunctionBody = exports.FunctionBody = function FunctionBody(_ref46) { - var directives = _ref46.directives, - statements = _ref46.statements; - - _classCallCheck(this, FunctionBody); - - this.type = 'FunctionBody'; - this.directives = directives; - this.statements = statements; -}; - -var FunctionDeclaration = exports.FunctionDeclaration = function FunctionDeclaration(_ref47) { - var isAsync = _ref47.isAsync, - isGenerator = _ref47.isGenerator, - name = _ref47.name, - params = _ref47.params, - body = _ref47.body; - - _classCallCheck(this, FunctionDeclaration); - - this.type = 'FunctionDeclaration'; - this.isAsync = isAsync; - this.isGenerator = isGenerator; - this.name = name; - this.params = params; - this.body = body; -}; - -var FunctionExpression = exports.FunctionExpression = function FunctionExpression(_ref48) { - var isAsync = _ref48.isAsync, - isGenerator = _ref48.isGenerator, - name = _ref48.name, - params = _ref48.params, - body = _ref48.body; - - _classCallCheck(this, FunctionExpression); - - this.type = 'FunctionExpression'; - this.isAsync = isAsync; - this.isGenerator = isGenerator; - this.name = name; - this.params = params; - this.body = body; -}; - -var Getter = exports.Getter = function Getter(_ref49) { - var name = _ref49.name, - body = _ref49.body; - - _classCallCheck(this, Getter); - - this.type = 'Getter'; - this.name = name; - this.body = body; -}; - -var IdentifierExpression = exports.IdentifierExpression = function IdentifierExpression(_ref50) { - var name = _ref50.name; - - _classCallCheck(this, IdentifierExpression); - - this.type = 'IdentifierExpression'; - this.name = name; -}; - -var IfStatement = exports.IfStatement = function IfStatement(_ref51) { - var test = _ref51.test, - consequent = _ref51.consequent, - alternate = _ref51.alternate; - - _classCallCheck(this, IfStatement); - - this.type = 'IfStatement'; - this.test = test; - this.consequent = consequent; - this.alternate = alternate; -}; - -var Import = exports.Import = function Import(_ref52) { - var defaultBinding = _ref52.defaultBinding, - namedImports = _ref52.namedImports, - moduleSpecifier = _ref52.moduleSpecifier; - - _classCallCheck(this, Import); - - this.type = 'Import'; - this.defaultBinding = defaultBinding; - this.namedImports = namedImports; - this.moduleSpecifier = moduleSpecifier; -}; - -var ImportNamespace = exports.ImportNamespace = function ImportNamespace(_ref53) { - var defaultBinding = _ref53.defaultBinding, - namespaceBinding = _ref53.namespaceBinding, - moduleSpecifier = _ref53.moduleSpecifier; - - _classCallCheck(this, ImportNamespace); - - this.type = 'ImportNamespace'; - this.defaultBinding = defaultBinding; - this.namespaceBinding = namespaceBinding; - this.moduleSpecifier = moduleSpecifier; -}; - -var ImportSpecifier = exports.ImportSpecifier = function ImportSpecifier(_ref54) { - var name = _ref54.name, - binding = _ref54.binding; - - _classCallCheck(this, ImportSpecifier); - - this.type = 'ImportSpecifier'; - this.name = name; - this.binding = binding; -}; - -var LabeledStatement = exports.LabeledStatement = function LabeledStatement(_ref55) { - var label = _ref55.label, - body = _ref55.body; - - _classCallCheck(this, LabeledStatement); - - this.type = 'LabeledStatement'; - this.label = label; - this.body = body; -}; - -var LiteralBooleanExpression = exports.LiteralBooleanExpression = function LiteralBooleanExpression(_ref56) { - var value = _ref56.value; - - _classCallCheck(this, LiteralBooleanExpression); - - this.type = 'LiteralBooleanExpression'; - this.value = value; -}; - -var LiteralInfinityExpression = exports.LiteralInfinityExpression = function LiteralInfinityExpression() { - _classCallCheck(this, LiteralInfinityExpression); - - this.type = 'LiteralInfinityExpression'; -}; - -var LiteralNullExpression = exports.LiteralNullExpression = function LiteralNullExpression() { - _classCallCheck(this, LiteralNullExpression); - - this.type = 'LiteralNullExpression'; -}; - -var LiteralNumericExpression = exports.LiteralNumericExpression = function LiteralNumericExpression(_ref57) { - var value = _ref57.value; - - _classCallCheck(this, LiteralNumericExpression); - - this.type = 'LiteralNumericExpression'; - this.value = value; -}; - -var LiteralRegExpExpression = exports.LiteralRegExpExpression = function LiteralRegExpExpression(_ref58) { - var pattern = _ref58.pattern, - global = _ref58.global, - ignoreCase = _ref58.ignoreCase, - multiLine = _ref58.multiLine, - dotAll = _ref58.dotAll, - unicode = _ref58.unicode, - sticky = _ref58.sticky; - - _classCallCheck(this, LiteralRegExpExpression); - - this.type = 'LiteralRegExpExpression'; - this.pattern = pattern; - this.global = global; - this.ignoreCase = ignoreCase; - this.multiLine = multiLine; - this.dotAll = dotAll; - this.unicode = unicode; - this.sticky = sticky; -}; - -var LiteralStringExpression = exports.LiteralStringExpression = function LiteralStringExpression(_ref59) { - var value = _ref59.value; - - _classCallCheck(this, LiteralStringExpression); - - this.type = 'LiteralStringExpression'; - this.value = value; -}; - -var Method = exports.Method = function Method(_ref60) { - var isAsync = _ref60.isAsync, - isGenerator = _ref60.isGenerator, - name = _ref60.name, - params = _ref60.params, - body = _ref60.body; - - _classCallCheck(this, Method); - - this.type = 'Method'; - this.isAsync = isAsync; - this.isGenerator = isGenerator; - this.name = name; - this.params = params; - this.body = body; -}; - -var Module = exports.Module = function Module(_ref61) { - var directives = _ref61.directives, - items = _ref61.items; - - _classCallCheck(this, Module); - - this.type = 'Module'; - this.directives = directives; - this.items = items; -}; - -var NewExpression = exports.NewExpression = function NewExpression(_ref62) { - var callee = _ref62.callee, - _arguments = _ref62.arguments; - - _classCallCheck(this, NewExpression); - - this.type = 'NewExpression'; - this.callee = callee; - this.arguments = _arguments; -}; - -var NewTargetExpression = exports.NewTargetExpression = function NewTargetExpression() { - _classCallCheck(this, NewTargetExpression); - - this.type = 'NewTargetExpression'; -}; - -var ObjectAssignmentTarget = exports.ObjectAssignmentTarget = function ObjectAssignmentTarget(_ref63) { - var properties = _ref63.properties, - rest = _ref63.rest; - - _classCallCheck(this, ObjectAssignmentTarget); - - this.type = 'ObjectAssignmentTarget'; - this.properties = properties; - this.rest = rest; -}; - -var ObjectBinding = exports.ObjectBinding = function ObjectBinding(_ref64) { - var properties = _ref64.properties, - rest = _ref64.rest; - - _classCallCheck(this, ObjectBinding); - - this.type = 'ObjectBinding'; - this.properties = properties; - this.rest = rest; -}; - -var ObjectExpression = exports.ObjectExpression = function ObjectExpression(_ref65) { - var properties = _ref65.properties; - - _classCallCheck(this, ObjectExpression); - - this.type = 'ObjectExpression'; - this.properties = properties; -}; - -var ReturnStatement = exports.ReturnStatement = function ReturnStatement(_ref66) { - var expression = _ref66.expression; - - _classCallCheck(this, ReturnStatement); - - this.type = 'ReturnStatement'; - this.expression = expression; -}; - -var Script = exports.Script = function Script(_ref67) { - var directives = _ref67.directives, - statements = _ref67.statements; - - _classCallCheck(this, Script); - - this.type = 'Script'; - this.directives = directives; - this.statements = statements; -}; - -var Setter = exports.Setter = function Setter(_ref68) { - var name = _ref68.name, - param = _ref68.param, - body = _ref68.body; - - _classCallCheck(this, Setter); - - this.type = 'Setter'; - this.name = name; - this.param = param; - this.body = body; -}; - -var ShorthandProperty = exports.ShorthandProperty = function ShorthandProperty(_ref69) { - var name = _ref69.name; - - _classCallCheck(this, ShorthandProperty); - - this.type = 'ShorthandProperty'; - this.name = name; -}; - -var SpreadElement = exports.SpreadElement = function SpreadElement(_ref70) { - var expression = _ref70.expression; - - _classCallCheck(this, SpreadElement); - - this.type = 'SpreadElement'; - this.expression = expression; -}; - -var SpreadProperty = exports.SpreadProperty = function SpreadProperty(_ref71) { - var expression = _ref71.expression; - - _classCallCheck(this, SpreadProperty); - - this.type = 'SpreadProperty'; - this.expression = expression; -}; - -var StaticMemberAssignmentTarget = exports.StaticMemberAssignmentTarget = function StaticMemberAssignmentTarget(_ref72) { - var object = _ref72.object, - property = _ref72.property; - - _classCallCheck(this, StaticMemberAssignmentTarget); - - this.type = 'StaticMemberAssignmentTarget'; - this.object = object; - this.property = property; -}; - -var StaticMemberExpression = exports.StaticMemberExpression = function StaticMemberExpression(_ref73) { - var object = _ref73.object, - property = _ref73.property; - - _classCallCheck(this, StaticMemberExpression); - - this.type = 'StaticMemberExpression'; - this.object = object; - this.property = property; -}; - -var StaticPropertyName = exports.StaticPropertyName = function StaticPropertyName(_ref74) { - var value = _ref74.value; - - _classCallCheck(this, StaticPropertyName); - - this.type = 'StaticPropertyName'; - this.value = value; -}; - -var Super = exports.Super = function Super() { - _classCallCheck(this, Super); - - this.type = 'Super'; -}; - -var SwitchCase = exports.SwitchCase = function SwitchCase(_ref75) { - var test = _ref75.test, - consequent = _ref75.consequent; - - _classCallCheck(this, SwitchCase); - - this.type = 'SwitchCase'; - this.test = test; - this.consequent = consequent; -}; - -var SwitchDefault = exports.SwitchDefault = function SwitchDefault(_ref76) { - var consequent = _ref76.consequent; - - _classCallCheck(this, SwitchDefault); - - this.type = 'SwitchDefault'; - this.consequent = consequent; -}; - -var SwitchStatement = exports.SwitchStatement = function SwitchStatement(_ref77) { - var discriminant = _ref77.discriminant, - cases = _ref77.cases; - - _classCallCheck(this, SwitchStatement); - - this.type = 'SwitchStatement'; - this.discriminant = discriminant; - this.cases = cases; -}; - -var SwitchStatementWithDefault = exports.SwitchStatementWithDefault = function SwitchStatementWithDefault(_ref78) { - var discriminant = _ref78.discriminant, - preDefaultCases = _ref78.preDefaultCases, - defaultCase = _ref78.defaultCase, - postDefaultCases = _ref78.postDefaultCases; - - _classCallCheck(this, SwitchStatementWithDefault); - - this.type = 'SwitchStatementWithDefault'; - this.discriminant = discriminant; - this.preDefaultCases = preDefaultCases; - this.defaultCase = defaultCase; - this.postDefaultCases = postDefaultCases; -}; - -var TemplateElement = exports.TemplateElement = function TemplateElement(_ref79) { - var rawValue = _ref79.rawValue; - - _classCallCheck(this, TemplateElement); - - this.type = 'TemplateElement'; - this.rawValue = rawValue; -}; - -var TemplateExpression = exports.TemplateExpression = function TemplateExpression(_ref80) { - var tag = _ref80.tag, - elements = _ref80.elements; - - _classCallCheck(this, TemplateExpression); - - this.type = 'TemplateExpression'; - this.tag = tag; - this.elements = elements; -}; - -var ThisExpression = exports.ThisExpression = function ThisExpression() { - _classCallCheck(this, ThisExpression); - - this.type = 'ThisExpression'; -}; - -var ThrowStatement = exports.ThrowStatement = function ThrowStatement(_ref81) { - var expression = _ref81.expression; - - _classCallCheck(this, ThrowStatement); - - this.type = 'ThrowStatement'; - this.expression = expression; -}; - -var TryCatchStatement = exports.TryCatchStatement = function TryCatchStatement(_ref82) { - var body = _ref82.body, - catchClause = _ref82.catchClause; - - _classCallCheck(this, TryCatchStatement); - - this.type = 'TryCatchStatement'; - this.body = body; - this.catchClause = catchClause; -}; - -var TryFinallyStatement = exports.TryFinallyStatement = function TryFinallyStatement(_ref83) { - var body = _ref83.body, - catchClause = _ref83.catchClause, - finalizer = _ref83.finalizer; - - _classCallCheck(this, TryFinallyStatement); - - this.type = 'TryFinallyStatement'; - this.body = body; - this.catchClause = catchClause; - this.finalizer = finalizer; -}; - -var UnaryExpression = exports.UnaryExpression = function UnaryExpression(_ref84) { - var operator = _ref84.operator, - operand = _ref84.operand; - - _classCallCheck(this, UnaryExpression); - - this.type = 'UnaryExpression'; - this.operator = operator; - this.operand = operand; -}; - -var UpdateExpression = exports.UpdateExpression = function UpdateExpression(_ref85) { - var isPrefix = _ref85.isPrefix, - operator = _ref85.operator, - operand = _ref85.operand; - - _classCallCheck(this, UpdateExpression); - - this.type = 'UpdateExpression'; - this.isPrefix = isPrefix; - this.operator = operator; - this.operand = operand; -}; - -var VariableDeclaration = exports.VariableDeclaration = function VariableDeclaration(_ref86) { - var kind = _ref86.kind, - declarators = _ref86.declarators; - - _classCallCheck(this, VariableDeclaration); - - this.type = 'VariableDeclaration'; - this.kind = kind; - this.declarators = declarators; -}; - -var VariableDeclarationStatement = exports.VariableDeclarationStatement = function VariableDeclarationStatement(_ref87) { - var declaration = _ref87.declaration; - - _classCallCheck(this, VariableDeclarationStatement); - - this.type = 'VariableDeclarationStatement'; - this.declaration = declaration; -}; - -var VariableDeclarator = exports.VariableDeclarator = function VariableDeclarator(_ref88) { - var binding = _ref88.binding, - init = _ref88.init; - - _classCallCheck(this, VariableDeclarator); - - this.type = 'VariableDeclarator'; - this.binding = binding; - this.init = init; -}; - -var WhileStatement = exports.WhileStatement = function WhileStatement(_ref89) { - var test = _ref89.test, - body = _ref89.body; - - _classCallCheck(this, WhileStatement); - - this.type = 'WhileStatement'; - this.test = test; - this.body = body; -}; - -var WithStatement = exports.WithStatement = function WithStatement(_ref90) { - var object = _ref90.object, - body = _ref90.body; - - _classCallCheck(this, WithStatement); - - this.type = 'WithStatement'; - this.object = object; - this.body = body; -}; - -var YieldExpression = exports.YieldExpression = function YieldExpression(_ref91) { - var expression = _ref91.expression; - - _classCallCheck(this, YieldExpression); - - this.type = 'YieldExpression'; - this.expression = expression; -}; - -var YieldGeneratorExpression = exports.YieldGeneratorExpression = function YieldGeneratorExpression(_ref92) { - var expression = _ref92.expression; - - _classCallCheck(this, YieldGeneratorExpression); - - this.type = 'YieldGeneratorExpression'; - this.expression = expression; -}; -}); - -var __pika_web_default_export_for_treeshaking__ = /*@__PURE__*/getDefaultExportFromCjs(dist); - -export { __pika_web_default_export_for_treeshaking__ as _, dist as d }; diff --git a/docs/_snowpack/pkg/common/index-67cfdec9.js b/docs/_snowpack/pkg/common/index-67cfdec9.js deleted file mode 100644 index 4b51ea73..00000000 --- a/docs/_snowpack/pkg/common/index-67cfdec9.js +++ /dev/null @@ -1,29 +0,0 @@ -import { c as createCommonjsModule } from './_commonjsHelpers-8c19dec8.js'; -import { o as objectAssign } from './index-d01087d6.js'; - -var react_production_min = createCommonjsModule(function (module, exports) { -var n=60103,p=60106;exports.Fragment=60107;exports.StrictMode=60108;exports.Profiler=60114;var q=60109,r=60110,t=60112;exports.Suspense=60113;var u=60115,v=60116; -if("function"===typeof Symbol&&Symbol.for){var w=Symbol.for;n=w("react.element");p=w("react.portal");exports.Fragment=w("react.fragment");exports.StrictMode=w("react.strict_mode");exports.Profiler=w("react.profiler");q=w("react.provider");r=w("react.context");t=w("react.forward_ref");exports.Suspense=w("react.suspense");u=w("react.memo");v=w("react.lazy");}var x="function"===typeof Symbol&&Symbol.iterator; -function y(a){if(null===a||"object"!==typeof a)return null;a=x&&a[x]||a["@@iterator"];return "function"===typeof a?a:null}function z(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c { - return { endTime, insertTime, type: 'exponentialRampToValue', value }; -}; - -const createExtendedLinearRampToValueAutomationEvent = (value, endTime, insertTime) => { - return { endTime, insertTime, type: 'linearRampToValue', value }; -}; - -const createSetValueAutomationEvent = (value, startTime) => { - return { startTime, type: 'setValue', value }; -}; - -const createSetValueCurveAutomationEvent = (values, startTime, duration) => { - return { duration, startTime, type: 'setValueCurve', values }; -}; - -const getTargetValueAtTime = (time, valueAtStartTime, { startTime, target, timeConstant }) => { - return target + (valueAtStartTime - target) * Math.exp((startTime - time) / timeConstant); -}; - -const isExponentialRampToValueAutomationEvent = (automationEvent) => { - return automationEvent.type === 'exponentialRampToValue'; -}; - -const isLinearRampToValueAutomationEvent = (automationEvent) => { - return automationEvent.type === 'linearRampToValue'; -}; - -const isAnyRampToValueAutomationEvent = (automationEvent) => { - return isExponentialRampToValueAutomationEvent(automationEvent) || isLinearRampToValueAutomationEvent(automationEvent); -}; - -const isSetValueAutomationEvent = (automationEvent) => { - return automationEvent.type === 'setValue'; -}; - -const isSetValueCurveAutomationEvent = (automationEvent) => { - return automationEvent.type === 'setValueCurve'; -}; - -const getValueOfAutomationEventAtIndexAtTime = (automationEvents, index, time, defaultValue) => { - const automationEvent = automationEvents[index]; - return automationEvent === undefined - ? defaultValue - : isAnyRampToValueAutomationEvent(automationEvent) || isSetValueAutomationEvent(automationEvent) - ? automationEvent.value - : isSetValueCurveAutomationEvent(automationEvent) - ? automationEvent.values[automationEvent.values.length - 1] - : getTargetValueAtTime(time, getValueOfAutomationEventAtIndexAtTime(automationEvents, index - 1, automationEvent.startTime, defaultValue), automationEvent); -}; - -const getEndTimeAndValueOfPreviousAutomationEvent = (automationEvents, index, currentAutomationEvent, nextAutomationEvent, defaultValue) => { - return currentAutomationEvent === undefined - ? [nextAutomationEvent.insertTime, defaultValue] - : isAnyRampToValueAutomationEvent(currentAutomationEvent) - ? [currentAutomationEvent.endTime, currentAutomationEvent.value] - : isSetValueAutomationEvent(currentAutomationEvent) - ? [currentAutomationEvent.startTime, currentAutomationEvent.value] - : isSetValueCurveAutomationEvent(currentAutomationEvent) - ? [ - currentAutomationEvent.startTime + currentAutomationEvent.duration, - currentAutomationEvent.values[currentAutomationEvent.values.length - 1] - ] - : [ - currentAutomationEvent.startTime, - getValueOfAutomationEventAtIndexAtTime(automationEvents, index - 1, currentAutomationEvent.startTime, defaultValue) - ]; -}; - -const isCancelAndHoldAutomationEvent = (automationEvent) => { - return automationEvent.type === 'cancelAndHold'; -}; - -const isCancelScheduledValuesAutomationEvent = (automationEvent) => { - return automationEvent.type === 'cancelScheduledValues'; -}; - -const getEventTime = (automationEvent) => { - if (isCancelAndHoldAutomationEvent(automationEvent) || isCancelScheduledValuesAutomationEvent(automationEvent)) { - return automationEvent.cancelTime; - } - if (isExponentialRampToValueAutomationEvent(automationEvent) || isLinearRampToValueAutomationEvent(automationEvent)) { - return automationEvent.endTime; - } - return automationEvent.startTime; -}; - -const getExponentialRampValueAtTime = (time, startTime, valueAtStartTime, { endTime, value }) => { - if (valueAtStartTime === value) { - return value; - } - if ((0 < valueAtStartTime && 0 < value) || (valueAtStartTime < 0 && value < 0)) { - return valueAtStartTime * (value / valueAtStartTime) ** ((time - startTime) / (endTime - startTime)); - } - return 0; -}; - -const getLinearRampValueAtTime = (time, startTime, valueAtStartTime, { endTime, value }) => { - return valueAtStartTime + ((time - startTime) / (endTime - startTime)) * (value - valueAtStartTime); -}; - -const interpolateValue = (values, theoreticIndex) => { - const lowerIndex = Math.floor(theoreticIndex); - const upperIndex = Math.ceil(theoreticIndex); - if (lowerIndex === upperIndex) { - return values[lowerIndex]; - } - return (1 - (theoreticIndex - lowerIndex)) * values[lowerIndex] + (1 - (upperIndex - theoreticIndex)) * values[upperIndex]; -}; - -const getValueCurveValueAtTime = (time, { duration, startTime, values }) => { - const theoreticIndex = ((time - startTime) / duration) * (values.length - 1); - return interpolateValue(values, theoreticIndex); -}; - -const isSetTargetAutomationEvent = (automationEvent) => { - return automationEvent.type === 'setTarget'; -}; - -class AutomationEventList { - constructor(defaultValue) { - this._automationEvents = []; - this._currenTime = 0; - this._defaultValue = defaultValue; - } - [Symbol.iterator]() { - return this._automationEvents[Symbol.iterator](); - } - add(automationEvent) { - const eventTime = getEventTime(automationEvent); - if (isCancelAndHoldAutomationEvent(automationEvent) || isCancelScheduledValuesAutomationEvent(automationEvent)) { - const index = this._automationEvents.findIndex((currentAutomationEvent) => { - if (isCancelScheduledValuesAutomationEvent(automationEvent) && isSetValueCurveAutomationEvent(currentAutomationEvent)) { - return currentAutomationEvent.startTime + currentAutomationEvent.duration >= eventTime; - } - return getEventTime(currentAutomationEvent) >= eventTime; - }); - const removedAutomationEvent = this._automationEvents[index]; - if (index !== -1) { - this._automationEvents = this._automationEvents.slice(0, index); - } - if (isCancelAndHoldAutomationEvent(automationEvent)) { - const lastAutomationEvent = this._automationEvents[this._automationEvents.length - 1]; - if (removedAutomationEvent !== undefined && isAnyRampToValueAutomationEvent(removedAutomationEvent)) { - if (isSetTargetAutomationEvent(lastAutomationEvent)) { - throw new Error('The internal list is malformed.'); - } - const startTime = isSetValueCurveAutomationEvent(lastAutomationEvent) - ? lastAutomationEvent.startTime + lastAutomationEvent.duration - : getEventTime(lastAutomationEvent); - const startValue = isSetValueCurveAutomationEvent(lastAutomationEvent) - ? lastAutomationEvent.values[lastAutomationEvent.values.length - 1] - : lastAutomationEvent.value; - const value = isExponentialRampToValueAutomationEvent(removedAutomationEvent) - ? getExponentialRampValueAtTime(eventTime, startTime, startValue, removedAutomationEvent) - : getLinearRampValueAtTime(eventTime, startTime, startValue, removedAutomationEvent); - const truncatedAutomationEvent = isExponentialRampToValueAutomationEvent(removedAutomationEvent) - ? createExtendedExponentialRampToValueAutomationEvent(value, eventTime, this._currenTime) - : createExtendedLinearRampToValueAutomationEvent(value, eventTime, this._currenTime); - this._automationEvents.push(truncatedAutomationEvent); - } - if (lastAutomationEvent !== undefined && isSetTargetAutomationEvent(lastAutomationEvent)) { - this._automationEvents.push(createSetValueAutomationEvent(this.getValue(eventTime), eventTime)); - } - if (lastAutomationEvent !== undefined && - isSetValueCurveAutomationEvent(lastAutomationEvent) && - lastAutomationEvent.startTime + lastAutomationEvent.duration > eventTime) { - this._automationEvents[this._automationEvents.length - 1] = createSetValueCurveAutomationEvent(new Float32Array([6, 7]), lastAutomationEvent.startTime, eventTime - lastAutomationEvent.startTime); - } - } - } - else { - const index = this._automationEvents.findIndex((currentAutomationEvent) => getEventTime(currentAutomationEvent) > eventTime); - const previousAutomationEvent = index === -1 ? this._automationEvents[this._automationEvents.length - 1] : this._automationEvents[index - 1]; - if (previousAutomationEvent !== undefined && - isSetValueCurveAutomationEvent(previousAutomationEvent) && - getEventTime(previousAutomationEvent) + previousAutomationEvent.duration > eventTime) { - return false; - } - const persistentAutomationEvent = isExponentialRampToValueAutomationEvent(automationEvent) - ? createExtendedExponentialRampToValueAutomationEvent(automationEvent.value, automationEvent.endTime, this._currenTime) - : isLinearRampToValueAutomationEvent(automationEvent) - ? createExtendedLinearRampToValueAutomationEvent(automationEvent.value, eventTime, this._currenTime) - : automationEvent; - if (index === -1) { - this._automationEvents.push(persistentAutomationEvent); - } - else { - if (isSetValueCurveAutomationEvent(automationEvent) && - eventTime + automationEvent.duration > getEventTime(this._automationEvents[index])) { - return false; - } - this._automationEvents.splice(index, 0, persistentAutomationEvent); - } - } - return true; - } - flush(time) { - const index = this._automationEvents.findIndex((currentAutomationEvent) => getEventTime(currentAutomationEvent) > time); - if (index > 1) { - const remainingAutomationEvents = this._automationEvents.slice(index - 1); - const firstRemainingAutomationEvent = remainingAutomationEvents[0]; - if (isSetTargetAutomationEvent(firstRemainingAutomationEvent)) { - remainingAutomationEvents.unshift(createSetValueAutomationEvent(getValueOfAutomationEventAtIndexAtTime(this._automationEvents, index - 2, firstRemainingAutomationEvent.startTime, this._defaultValue), firstRemainingAutomationEvent.startTime)); - } - this._automationEvents = remainingAutomationEvents; - } - } - getValue(time) { - if (this._automationEvents.length === 0) { - return this._defaultValue; - } - const indexOfNextEvent = this._automationEvents.findIndex((automationEvent) => getEventTime(automationEvent) > time); - const nextAutomationEvent = this._automationEvents[indexOfNextEvent]; - const indexOfCurrentEvent = (indexOfNextEvent === -1 ? this._automationEvents.length : indexOfNextEvent) - 1; - const currentAutomationEvent = this._automationEvents[indexOfCurrentEvent]; - if (currentAutomationEvent !== undefined && - isSetTargetAutomationEvent(currentAutomationEvent) && - (nextAutomationEvent === undefined || - !isAnyRampToValueAutomationEvent(nextAutomationEvent) || - nextAutomationEvent.insertTime > time)) { - return getTargetValueAtTime(time, getValueOfAutomationEventAtIndexAtTime(this._automationEvents, indexOfCurrentEvent - 1, currentAutomationEvent.startTime, this._defaultValue), currentAutomationEvent); - } - if (currentAutomationEvent !== undefined && - isSetValueAutomationEvent(currentAutomationEvent) && - (nextAutomationEvent === undefined || !isAnyRampToValueAutomationEvent(nextAutomationEvent))) { - return currentAutomationEvent.value; - } - if (currentAutomationEvent !== undefined && - isSetValueCurveAutomationEvent(currentAutomationEvent) && - (nextAutomationEvent === undefined || - !isAnyRampToValueAutomationEvent(nextAutomationEvent) || - currentAutomationEvent.startTime + currentAutomationEvent.duration > time)) { - if (time < currentAutomationEvent.startTime + currentAutomationEvent.duration) { - return getValueCurveValueAtTime(time, currentAutomationEvent); - } - return currentAutomationEvent.values[currentAutomationEvent.values.length - 1]; - } - if (currentAutomationEvent !== undefined && - isAnyRampToValueAutomationEvent(currentAutomationEvent) && - (nextAutomationEvent === undefined || !isAnyRampToValueAutomationEvent(nextAutomationEvent))) { - return currentAutomationEvent.value; - } - if (nextAutomationEvent !== undefined && isExponentialRampToValueAutomationEvent(nextAutomationEvent)) { - const [startTime, value] = getEndTimeAndValueOfPreviousAutomationEvent(this._automationEvents, indexOfCurrentEvent, currentAutomationEvent, nextAutomationEvent, this._defaultValue); - return getExponentialRampValueAtTime(time, startTime, value, nextAutomationEvent); - } - if (nextAutomationEvent !== undefined && isLinearRampToValueAutomationEvent(nextAutomationEvent)) { - const [startTime, value] = getEndTimeAndValueOfPreviousAutomationEvent(this._automationEvents, indexOfCurrentEvent, currentAutomationEvent, nextAutomationEvent, this._defaultValue); - return getLinearRampValueAtTime(time, startTime, value, nextAutomationEvent); - } - return this._defaultValue; - } -} - -const createCancelAndHoldAutomationEvent = (cancelTime) => { - return { cancelTime, type: 'cancelAndHold' }; -}; - -const createCancelScheduledValuesAutomationEvent = (cancelTime) => { - return { cancelTime, type: 'cancelScheduledValues' }; -}; - -const createExponentialRampToValueAutomationEvent = (value, endTime) => { - return { endTime, type: 'exponentialRampToValue', value }; -}; - -const createLinearRampToValueAutomationEvent = (value, endTime) => { - return { endTime, type: 'linearRampToValue', value }; -}; - -const createSetTargetAutomationEvent = (target, startTime, timeConstant) => { - return { startTime, target, timeConstant, type: 'setTarget' }; -}; - -const createAbortError = () => new DOMException('', 'AbortError'); - -const createAddActiveInputConnectionToAudioNode = (insertElementInSet) => { - return (activeInputs, source, [output, input, eventListener], ignoreDuplicates) => { - insertElementInSet(activeInputs[input], [source, output, eventListener], (activeInputConnection) => activeInputConnection[0] === source && activeInputConnection[1] === output, ignoreDuplicates); - }; -}; - -const createAddAudioNodeConnections = (audioNodeConnectionsStore) => { - return (audioNode, audioNodeRenderer, nativeAudioNode) => { - const activeInputs = []; - for (let i = 0; i < nativeAudioNode.numberOfInputs; i += 1) { - activeInputs.push(new Set()); - } - audioNodeConnectionsStore.set(audioNode, { - activeInputs, - outputs: new Set(), - passiveInputs: new WeakMap(), - renderer: audioNodeRenderer - }); - }; -}; - -const createAddAudioParamConnections = (audioParamConnectionsStore) => { - return (audioParam, audioParamRenderer) => { - audioParamConnectionsStore.set(audioParam, { activeInputs: new Set(), passiveInputs: new WeakMap(), renderer: audioParamRenderer }); - }; -}; - -const ACTIVE_AUDIO_NODE_STORE = new WeakSet(); -const AUDIO_NODE_CONNECTIONS_STORE = new WeakMap(); -const AUDIO_NODE_STORE = new WeakMap(); -const AUDIO_PARAM_CONNECTIONS_STORE = new WeakMap(); -const AUDIO_PARAM_STORE = new WeakMap(); -const CONTEXT_STORE = new WeakMap(); -const EVENT_LISTENERS = new WeakMap(); -const CYCLE_COUNTERS = new WeakMap(); -// This clunky name is borrowed from the spec. :-) -const NODE_NAME_TO_PROCESSOR_CONSTRUCTOR_MAPS = new WeakMap(); -const NODE_TO_PROCESSOR_MAPS = new WeakMap(); - -const handler = { - construct() { - return handler; - } -}; -const isConstructible = (constructible) => { - try { - const proxy = new Proxy(constructible, handler); - new proxy(); // tslint:disable-line:no-unused-expression - } - catch { - return false; - } - return true; -}; - -/* - * This massive regex tries to cover all the following cases. - * - * import './path'; - * import defaultImport from './path'; - * import { namedImport } from './path'; - * import { namedImport as renamendImport } from './path'; - * import * as namespaceImport from './path'; - * import defaultImport, { namedImport } from './path'; - * import defaultImport, { namedImport as renamendImport } from './path'; - * import defaultImport, * as namespaceImport from './path'; - */ -const IMPORT_STATEMENT_REGEX = /^import(?:(?:[\s]+[\w]+|(?:[\s]+[\w]+[\s]*,)?[\s]*\{[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?(?:[\s]*,[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?)*[\s]*}|(?:[\s]+[\w]+[\s]*,)?[\s]*\*[\s]+as[\s]+[\w]+)[\s]+from)?(?:[\s]*)("([^"\\]|\\.)+"|'([^'\\]|\\.)+')(?:[\s]*);?/; // tslint:disable-line:max-line-length -const splitImportStatements = (source, url) => { - const importStatements = []; - let sourceWithoutImportStatements = source.replace(/^[\s]+/, ''); - let result = sourceWithoutImportStatements.match(IMPORT_STATEMENT_REGEX); - while (result !== null) { - const unresolvedUrl = result[1].slice(1, -1); - const importStatementWithResolvedUrl = result[0] - .replace(/([\s]+)?;?$/, '') - .replace(unresolvedUrl, new URL(unresolvedUrl, url).toString()); - importStatements.push(importStatementWithResolvedUrl); - sourceWithoutImportStatements = sourceWithoutImportStatements.slice(result[0].length).replace(/^[\s]+/, ''); - result = sourceWithoutImportStatements.match(IMPORT_STATEMENT_REGEX); - } - return [importStatements.join(';'), sourceWithoutImportStatements]; -}; - -const verifyParameterDescriptors = (parameterDescriptors) => { - if (parameterDescriptors !== undefined && !Array.isArray(parameterDescriptors)) { - throw new TypeError('The parameterDescriptors property of given value for processorCtor is not an array.'); - } -}; -const verifyProcessorCtor = (processorCtor) => { - if (!isConstructible(processorCtor)) { - throw new TypeError('The given value for processorCtor should be a constructor.'); - } - if (processorCtor.prototype === null || typeof processorCtor.prototype !== 'object') { - throw new TypeError('The given value for processorCtor should have a prototype.'); - } -}; -const createAddAudioWorkletModule = (cacheTestResult, createNotSupportedError, evaluateSource, exposeCurrentFrameAndCurrentTime, fetchSource, getNativeContext, getOrCreateBackupOfflineAudioContext, isNativeOfflineAudioContext, nativeAudioWorkletNodeConstructor, ongoingRequests, resolvedRequests, testAudioWorkletProcessorPostMessageSupport, window) => { - let index = 0; - return (context, moduleURL, options = { credentials: 'omit' }) => { - const resolvedRequestsOfContext = resolvedRequests.get(context); - if (resolvedRequestsOfContext !== undefined && resolvedRequestsOfContext.has(moduleURL)) { - return Promise.resolve(); - } - const ongoingRequestsOfContext = ongoingRequests.get(context); - if (ongoingRequestsOfContext !== undefined) { - const promiseOfOngoingRequest = ongoingRequestsOfContext.get(moduleURL); - if (promiseOfOngoingRequest !== undefined) { - return promiseOfOngoingRequest; - } - } - const nativeContext = getNativeContext(context); - // Bug #59: Safari does not implement the audioWorklet property. - const promise = nativeContext.audioWorklet === undefined - ? fetchSource(moduleURL) - .then(([source, absoluteUrl]) => { - const [importStatements, sourceWithoutImportStatements] = splitImportStatements(source, absoluteUrl); - /* - * This is the unminified version of the code used below: - * - * ```js - * ${ importStatements }; - * ((a, b) => { - * (a[b] = a[b] || [ ]).push( - * (AudioWorkletProcessor, global, registerProcessor, sampleRate, self, window) => { - * ${ sourceWithoutImportStatements } - * } - * ); - * })(window, '_AWGS'); - * ``` - */ - // tslint:disable-next-line:max-line-length - const wrappedSource = `${importStatements};((a,b)=>{(a[b]=a[b]||[]).push((AudioWorkletProcessor,global,registerProcessor,sampleRate,self,window)=>{${sourceWithoutImportStatements} -})})(window,'_AWGS')`; - // @todo Evaluating the given source code is a possible security problem. - return evaluateSource(wrappedSource); - }) - .then(() => { - const evaluateAudioWorkletGlobalScope = window._AWGS.pop(); - if (evaluateAudioWorkletGlobalScope === undefined) { - // Bug #182 Chrome, Edge and Opera do throw an instance of a SyntaxError instead of a DOMException. - throw new SyntaxError(); - } - exposeCurrentFrameAndCurrentTime(nativeContext.currentTime, nativeContext.sampleRate, () => evaluateAudioWorkletGlobalScope(class AudioWorkletProcessor { - }, undefined, (name, processorCtor) => { - if (name.trim() === '') { - throw createNotSupportedError(); - } - const nodeNameToProcessorConstructorMap = NODE_NAME_TO_PROCESSOR_CONSTRUCTOR_MAPS.get(nativeContext); - if (nodeNameToProcessorConstructorMap !== undefined) { - if (nodeNameToProcessorConstructorMap.has(name)) { - throw createNotSupportedError(); - } - verifyProcessorCtor(processorCtor); - verifyParameterDescriptors(processorCtor.parameterDescriptors); - nodeNameToProcessorConstructorMap.set(name, processorCtor); - } - else { - verifyProcessorCtor(processorCtor); - verifyParameterDescriptors(processorCtor.parameterDescriptors); - NODE_NAME_TO_PROCESSOR_CONSTRUCTOR_MAPS.set(nativeContext, new Map([[name, processorCtor]])); - } - }, nativeContext.sampleRate, undefined, undefined)); - }) - : Promise.all([ - fetchSource(moduleURL), - Promise.resolve(cacheTestResult(testAudioWorkletProcessorPostMessageSupport, testAudioWorkletProcessorPostMessageSupport)) - ]).then(([[source, absoluteUrl], isSupportingPostMessage]) => { - const currentIndex = index + 1; - index = currentIndex; - const [importStatements, sourceWithoutImportStatements] = splitImportStatements(source, absoluteUrl); - /* - * Bug #179: Firefox does not allow to transfer any buffer which has been passed to the process() method as an argument. - * - * This is the unminified version of the code used below. - * - * ```js - * class extends AudioWorkletProcessor { - * - * __buffers = new WeakSet(); - * - * constructor () { - * super(); - * - * this.port.postMessage = ((postMessage) => { - * return (message, transferables) => { - * const filteredTransferables = (transferables) - * ? transferables.filter((transferable) => !this.__buffers.has(transferable)) - * : transferables; - * - * return postMessage.call(this.port, message, filteredTransferables); - * }; - * })(this.port.postMessage); - * } - * } - * ``` - */ - const patchedAudioWorkletProcessor = isSupportingPostMessage - ? 'AudioWorkletProcessor' - : 'class extends AudioWorkletProcessor {__b=new WeakSet();constructor(){super();(p=>p.postMessage=(q=>(m,t)=>q.call(p,m,t?t.filter(u=>!this.__b.has(u)):t))(p.postMessage))(this.port)}}'; - /* - * Bug #170: Chrome and Edge do call process() with an array with empty channelData for each input if no input is connected. - * - * Bug #179: Firefox does not allow to transfer any buffer which has been passed to the process() method as an argument. - * - * Bug #190: Safari doesn't throw an error when loading an unparsable module. - * - * This is the unminified version of the code used below: - * - * ```js - * `${ importStatements }; - * ((AudioWorkletProcessor, registerProcessor) => {${ sourceWithoutImportStatements } - * })( - * ${ patchedAudioWorkletProcessor }, - * (name, processorCtor) => registerProcessor(name, class extends processorCtor { - * - * __collectBuffers = (array) => { - * array.forEach((element) => this.__buffers.add(element.buffer)); - * }; - * - * process (inputs, outputs, parameters) { - * inputs.forEach(this.__collectBuffers); - * outputs.forEach(this.__collectBuffers); - * this.__collectBuffers(Object.values(parameters)); - * - * return super.process( - * (inputs.map((input) => input.some((channelData) => channelData.length === 0)) ? [ ] : input), - * outputs, - * parameters - * ); - * } - * - * }) - * ); - * - * registerProcessor(`__sac${currentIndex}`, class extends AudioWorkletProcessor{ - * - * process () { - * return false; - * } - * - * })` - * ``` - */ - const memberDefinition = isSupportingPostMessage ? '' : '__c = (a) => a.forEach(e=>this.__b.add(e.buffer));'; - const bufferRegistration = isSupportingPostMessage - ? '' - : 'i.forEach(this.__c);o.forEach(this.__c);this.__c(Object.values(p));'; - const wrappedSource = `${importStatements};((AudioWorkletProcessor,registerProcessor)=>{${sourceWithoutImportStatements} -})(${patchedAudioWorkletProcessor},(n,p)=>registerProcessor(n,class extends p{${memberDefinition}process(i,o,p){${bufferRegistration}return super.process(i.map(j=>j.some(k=>k.length===0)?[]:j),o,p)}}));registerProcessor('__sac${currentIndex}',class extends AudioWorkletProcessor{process(){return !1}})`; - const blob = new Blob([wrappedSource], { type: 'application/javascript; charset=utf-8' }); - const url = URL.createObjectURL(blob); - return nativeContext.audioWorklet - .addModule(url, options) - .then(() => { - if (isNativeOfflineAudioContext(nativeContext)) { - return nativeContext; - } - // Bug #186: Chrome, Edge and Opera do not allow to create an AudioWorkletNode on a closed AudioContext. - const backupOfflineAudioContext = getOrCreateBackupOfflineAudioContext(nativeContext); - return backupOfflineAudioContext.audioWorklet.addModule(url, options).then(() => backupOfflineAudioContext); - }) - .then((nativeContextOrBackupOfflineAudioContext) => { - if (nativeAudioWorkletNodeConstructor === null) { - throw new SyntaxError(); - } - try { - // Bug #190: Safari doesn't throw an error when loading an unparsable module. - new nativeAudioWorkletNodeConstructor(nativeContextOrBackupOfflineAudioContext, `__sac${currentIndex}`); // tslint:disable-line:no-unused-expression - } - catch { - throw new SyntaxError(); - } - }) - .finally(() => URL.revokeObjectURL(url)); - }); - if (ongoingRequestsOfContext === undefined) { - ongoingRequests.set(context, new Map([[moduleURL, promise]])); - } - else { - ongoingRequestsOfContext.set(moduleURL, promise); - } - promise - .then(() => { - const updatedResolvedRequestsOfContext = resolvedRequests.get(context); - if (updatedResolvedRequestsOfContext === undefined) { - resolvedRequests.set(context, new Set([moduleURL])); - } - else { - updatedResolvedRequestsOfContext.add(moduleURL); - } - }) - .finally(() => { - const updatedOngoingRequestsOfContext = ongoingRequests.get(context); - if (updatedOngoingRequestsOfContext !== undefined) { - updatedOngoingRequestsOfContext.delete(moduleURL); - } - }); - return promise; - }; -}; - -const getValueForKey = (map, key) => { - const value = map.get(key); - if (value === undefined) { - throw new Error('A value with the given key could not be found.'); - } - return value; -}; - -const pickElementFromSet = (set, predicate) => { - const matchingElements = Array.from(set).filter(predicate); - if (matchingElements.length > 1) { - throw Error('More than one element was found.'); - } - if (matchingElements.length === 0) { - throw Error('No element was found.'); - } - const [matchingElement] = matchingElements; - set.delete(matchingElement); - return matchingElement; -}; - -const deletePassiveInputConnectionToAudioNode = (passiveInputs, source, output, input) => { - const passiveInputConnections = getValueForKey(passiveInputs, source); - const matchingConnection = pickElementFromSet(passiveInputConnections, (passiveInputConnection) => passiveInputConnection[0] === output && passiveInputConnection[1] === input); - if (passiveInputConnections.size === 0) { - passiveInputs.delete(source); - } - return matchingConnection; -}; - -const getEventListenersOfAudioNode = (audioNode) => { - return getValueForKey(EVENT_LISTENERS, audioNode); -}; - -const setInternalStateToActive = (audioNode) => { - if (ACTIVE_AUDIO_NODE_STORE.has(audioNode)) { - throw new Error('The AudioNode is already stored.'); - } - ACTIVE_AUDIO_NODE_STORE.add(audioNode); - getEventListenersOfAudioNode(audioNode).forEach((eventListener) => eventListener(true)); -}; - -const isAudioWorkletNode = (audioNode) => { - return 'port' in audioNode; -}; - -const setInternalStateToPassive = (audioNode) => { - if (!ACTIVE_AUDIO_NODE_STORE.has(audioNode)) { - throw new Error('The AudioNode is not stored.'); - } - ACTIVE_AUDIO_NODE_STORE.delete(audioNode); - getEventListenersOfAudioNode(audioNode).forEach((eventListener) => eventListener(false)); -}; - -// Set the internalState of the audioNode to 'passive' if it is not an AudioWorkletNode and if it has no 'active' input connections. -const setInternalStateToPassiveWhenNecessary = (audioNode, activeInputs) => { - if (!isAudioWorkletNode(audioNode) && activeInputs.every((connections) => connections.size === 0)) { - setInternalStateToPassive(audioNode); - } -}; - -const createAddConnectionToAudioNode = (addActiveInputConnectionToAudioNode, addPassiveInputConnectionToAudioNode, connectNativeAudioNodeToNativeAudioNode, deleteActiveInputConnectionToAudioNode, disconnectNativeAudioNodeFromNativeAudioNode, getAudioNodeConnections, getAudioNodeTailTime, getEventListenersOfAudioNode, getNativeAudioNode, insertElementInSet, isActiveAudioNode, isPartOfACycle, isPassiveAudioNode) => { - const tailTimeTimeoutIds = new WeakMap(); - return (source, destination, output, input, isOffline) => { - const { activeInputs, passiveInputs } = getAudioNodeConnections(destination); - const { outputs } = getAudioNodeConnections(source); - const eventListeners = getEventListenersOfAudioNode(source); - const eventListener = (isActive) => { - const nativeDestinationAudioNode = getNativeAudioNode(destination); - const nativeSourceAudioNode = getNativeAudioNode(source); - if (isActive) { - const partialConnection = deletePassiveInputConnectionToAudioNode(passiveInputs, source, output, input); - addActiveInputConnectionToAudioNode(activeInputs, source, partialConnection, false); - if (!isOffline && !isPartOfACycle(source)) { - connectNativeAudioNodeToNativeAudioNode(nativeSourceAudioNode, nativeDestinationAudioNode, output, input); - } - if (isPassiveAudioNode(destination)) { - setInternalStateToActive(destination); - } - } - else { - const partialConnection = deleteActiveInputConnectionToAudioNode(activeInputs, source, output, input); - addPassiveInputConnectionToAudioNode(passiveInputs, input, partialConnection, false); - if (!isOffline && !isPartOfACycle(source)) { - disconnectNativeAudioNodeFromNativeAudioNode(nativeSourceAudioNode, nativeDestinationAudioNode, output, input); - } - const tailTime = getAudioNodeTailTime(destination); - if (tailTime === 0) { - if (isActiveAudioNode(destination)) { - setInternalStateToPassiveWhenNecessary(destination, activeInputs); - } - } - else { - const tailTimeTimeoutId = tailTimeTimeoutIds.get(destination); - if (tailTimeTimeoutId !== undefined) { - clearTimeout(tailTimeTimeoutId); - } - tailTimeTimeoutIds.set(destination, setTimeout(() => { - if (isActiveAudioNode(destination)) { - setInternalStateToPassiveWhenNecessary(destination, activeInputs); - } - }, tailTime * 1000)); - } - } - }; - if (insertElementInSet(outputs, [destination, output, input], (outputConnection) => outputConnection[0] === destination && outputConnection[1] === output && outputConnection[2] === input, true)) { - eventListeners.add(eventListener); - if (isActiveAudioNode(source)) { - addActiveInputConnectionToAudioNode(activeInputs, source, [output, input, eventListener], true); - } - else { - addPassiveInputConnectionToAudioNode(passiveInputs, input, [source, output, eventListener], true); - } - return true; - } - return false; - }; -}; - -const createAddPassiveInputConnectionToAudioNode = (insertElementInSet) => { - return (passiveInputs, input, [source, output, eventListener], ignoreDuplicates) => { - const passiveInputConnections = passiveInputs.get(source); - if (passiveInputConnections === undefined) { - passiveInputs.set(source, new Set([[output, input, eventListener]])); - } - else { - insertElementInSet(passiveInputConnections, [output, input, eventListener], (passiveInputConnection) => passiveInputConnection[0] === output && passiveInputConnection[1] === input, ignoreDuplicates); - } - }; -}; - -const createAddSilentConnection = (createNativeGainNode) => { - return (nativeContext, nativeAudioScheduledSourceNode) => { - const nativeGainNode = createNativeGainNode(nativeContext, { - channelCount: 1, - channelCountMode: 'explicit', - channelInterpretation: 'discrete', - gain: 0 - }); - nativeAudioScheduledSourceNode.connect(nativeGainNode).connect(nativeContext.destination); - const disconnect = () => { - nativeAudioScheduledSourceNode.removeEventListener('ended', disconnect); - nativeAudioScheduledSourceNode.disconnect(nativeGainNode); - nativeGainNode.disconnect(); - }; - nativeAudioScheduledSourceNode.addEventListener('ended', disconnect); - }; -}; - -const createAddUnrenderedAudioWorkletNode = (getUnrenderedAudioWorkletNodes) => { - return (nativeContext, audioWorkletNode) => { - getUnrenderedAudioWorkletNodes(nativeContext).add(audioWorkletNode); - }; -}; - -const DEFAULT_OPTIONS = { - channelCount: 2, - channelCountMode: 'max', - channelInterpretation: 'speakers', - fftSize: 2048, - maxDecibels: -30, - minDecibels: -100, - smoothingTimeConstant: 0.8 -}; -const createAnalyserNodeConstructor = (audionNodeConstructor, createAnalyserNodeRenderer, createIndexSizeError, createNativeAnalyserNode, getNativeContext, isNativeOfflineAudioContext) => { - return class AnalyserNode extends audionNodeConstructor { - constructor(context, options) { - const nativeContext = getNativeContext(context); - const mergedOptions = { ...DEFAULT_OPTIONS, ...options }; - const nativeAnalyserNode = createNativeAnalyserNode(nativeContext, mergedOptions); - const analyserNodeRenderer = ((isNativeOfflineAudioContext(nativeContext) ? createAnalyserNodeRenderer() : null)); - super(context, false, nativeAnalyserNode, analyserNodeRenderer); - this._nativeAnalyserNode = nativeAnalyserNode; - } - get fftSize() { - return this._nativeAnalyserNode.fftSize; - } - set fftSize(value) { - this._nativeAnalyserNode.fftSize = value; - } - get frequencyBinCount() { - return this._nativeAnalyserNode.frequencyBinCount; - } - get maxDecibels() { - return this._nativeAnalyserNode.maxDecibels; - } - set maxDecibels(value) { - // Bug #118: Safari does not throw an error if maxDecibels is not more than minDecibels. - const maxDecibels = this._nativeAnalyserNode.maxDecibels; - this._nativeAnalyserNode.maxDecibels = value; - if (!(value > this._nativeAnalyserNode.minDecibels)) { - this._nativeAnalyserNode.maxDecibels = maxDecibels; - throw createIndexSizeError(); - } - } - get minDecibels() { - return this._nativeAnalyserNode.minDecibels; - } - set minDecibels(value) { - // Bug #118: Safari does not throw an error if maxDecibels is not more than minDecibels. - const minDecibels = this._nativeAnalyserNode.minDecibels; - this._nativeAnalyserNode.minDecibels = value; - if (!(this._nativeAnalyserNode.maxDecibels > value)) { - this._nativeAnalyserNode.minDecibels = minDecibels; - throw createIndexSizeError(); - } - } - get smoothingTimeConstant() { - return this._nativeAnalyserNode.smoothingTimeConstant; - } - set smoothingTimeConstant(value) { - this._nativeAnalyserNode.smoothingTimeConstant = value; - } - getByteFrequencyData(array) { - this._nativeAnalyserNode.getByteFrequencyData(array); - } - getByteTimeDomainData(array) { - this._nativeAnalyserNode.getByteTimeDomainData(array); - } - getFloatFrequencyData(array) { - this._nativeAnalyserNode.getFloatFrequencyData(array); - } - getFloatTimeDomainData(array) { - this._nativeAnalyserNode.getFloatTimeDomainData(array); - } - }; -}; - -const isOwnedByContext = (nativeAudioNode, nativeContext) => { - return nativeAudioNode.context === nativeContext; -}; - -const createAnalyserNodeRendererFactory = (createNativeAnalyserNode, getNativeAudioNode, renderInputsOfAudioNode) => { - return () => { - const renderedNativeAnalyserNodes = new WeakMap(); - const createAnalyserNode = async (proxy, nativeOfflineAudioContext) => { - let nativeAnalyserNode = getNativeAudioNode(proxy); - // If the initially used nativeAnalyserNode was not constructed on the same OfflineAudioContext it needs to be created again. - const nativeAnalyserNodeIsOwnedByContext = isOwnedByContext(nativeAnalyserNode, nativeOfflineAudioContext); - if (!nativeAnalyserNodeIsOwnedByContext) { - const options = { - channelCount: nativeAnalyserNode.channelCount, - channelCountMode: nativeAnalyserNode.channelCountMode, - channelInterpretation: nativeAnalyserNode.channelInterpretation, - fftSize: nativeAnalyserNode.fftSize, - maxDecibels: nativeAnalyserNode.maxDecibels, - minDecibels: nativeAnalyserNode.minDecibels, - smoothingTimeConstant: nativeAnalyserNode.smoothingTimeConstant - }; - nativeAnalyserNode = createNativeAnalyserNode(nativeOfflineAudioContext, options); - } - renderedNativeAnalyserNodes.set(nativeOfflineAudioContext, nativeAnalyserNode); - await renderInputsOfAudioNode(proxy, nativeOfflineAudioContext, nativeAnalyserNode); - return nativeAnalyserNode; - }; - return { - render(proxy, nativeOfflineAudioContext) { - const renderedNativeAnalyserNode = renderedNativeAnalyserNodes.get(nativeOfflineAudioContext); - if (renderedNativeAnalyserNode !== undefined) { - return Promise.resolve(renderedNativeAnalyserNode); - } - return createAnalyserNode(proxy, nativeOfflineAudioContext); - } - }; - }; -}; - -const testAudioBufferCopyChannelMethodsOutOfBoundsSupport = (nativeAudioBuffer) => { - try { - nativeAudioBuffer.copyToChannel(new Float32Array(1), 0, -1); - } - catch { - return false; - } - return true; -}; - -const createIndexSizeError = () => new DOMException('', 'IndexSizeError'); - -const wrapAudioBufferGetChannelDataMethod = (audioBuffer) => { - audioBuffer.getChannelData = ((getChannelData) => { - return (channel) => { - try { - return getChannelData.call(audioBuffer, channel); - } - catch (err) { - if (err.code === 12) { - throw createIndexSizeError(); - } - throw err; - } - }; - })(audioBuffer.getChannelData); -}; - -const DEFAULT_OPTIONS$1 = { - numberOfChannels: 1 -}; -const createAudioBufferConstructor = (audioBufferStore, cacheTestResult, createNotSupportedError, nativeAudioBufferConstructor, nativeOfflineAudioContextConstructor, testNativeAudioBufferConstructorSupport, wrapAudioBufferCopyChannelMethods, wrapAudioBufferCopyChannelMethodsOutOfBounds) => { - let nativeOfflineAudioContext = null; - return class AudioBuffer { - constructor(options) { - if (nativeOfflineAudioContextConstructor === null) { - throw new Error('Missing the native OfflineAudioContext constructor.'); - } - const { length, numberOfChannels, sampleRate } = { ...DEFAULT_OPTIONS$1, ...options }; - if (nativeOfflineAudioContext === null) { - nativeOfflineAudioContext = new nativeOfflineAudioContextConstructor(1, 1, 44100); - } - /* - * Bug #99: Firefox does not throw a NotSupportedError when the numberOfChannels is zero. But it only does it when using the - * factory function. But since Firefox also supports the constructor everything should be fine. - */ - const audioBuffer = nativeAudioBufferConstructor !== null && - cacheTestResult(testNativeAudioBufferConstructorSupport, testNativeAudioBufferConstructorSupport) - ? new nativeAudioBufferConstructor({ length, numberOfChannels, sampleRate }) - : nativeOfflineAudioContext.createBuffer(numberOfChannels, length, sampleRate); - // Bug #99: Safari does not throw an error when the numberOfChannels is zero. - if (audioBuffer.numberOfChannels === 0) { - throw createNotSupportedError(); - } - // Bug #5: Safari does not support copyFromChannel() and copyToChannel(). - // Bug #100: Safari does throw a wrong error when calling getChannelData() with an out-of-bounds value. - if (typeof audioBuffer.copyFromChannel !== 'function') { - wrapAudioBufferCopyChannelMethods(audioBuffer); - wrapAudioBufferGetChannelDataMethod(audioBuffer); - // Bug #157: Firefox does not allow the bufferOffset to be out-of-bounds. - } - else if (!cacheTestResult(testAudioBufferCopyChannelMethodsOutOfBoundsSupport, () => testAudioBufferCopyChannelMethodsOutOfBoundsSupport(audioBuffer))) { - wrapAudioBufferCopyChannelMethodsOutOfBounds(audioBuffer); - } - audioBufferStore.add(audioBuffer); - /* - * This does violate all good pratices but it is necessary to allow this AudioBuffer to be used with native - * (Offline)AudioContexts. - */ - return audioBuffer; - } - static [Symbol.hasInstance](instance) { - return ((instance !== null && typeof instance === 'object' && Object.getPrototypeOf(instance) === AudioBuffer.prototype) || - audioBufferStore.has(instance)); - } - }; -}; - -const MOST_NEGATIVE_SINGLE_FLOAT = -3.4028234663852886e38; -const MOST_POSITIVE_SINGLE_FLOAT = -MOST_NEGATIVE_SINGLE_FLOAT; - -const isActiveAudioNode = (audioNode) => ACTIVE_AUDIO_NODE_STORE.has(audioNode); - -const DEFAULT_OPTIONS$2 = { - buffer: null, - channelCount: 2, - channelCountMode: 'max', - channelInterpretation: 'speakers', - // Bug #149: Safari does not yet support the detune AudioParam. - loop: false, - loopEnd: 0, - loopStart: 0, - playbackRate: 1 -}; -const createAudioBufferSourceNodeConstructor = (audioNodeConstructor, createAudioBufferSourceNodeRenderer, createAudioParam, createInvalidStateError, createNativeAudioBufferSourceNode, getNativeContext, isNativeOfflineAudioContext, wrapEventListener) => { - return class AudioBufferSourceNode extends audioNodeConstructor { - constructor(context, options) { - const nativeContext = getNativeContext(context); - const mergedOptions = { ...DEFAULT_OPTIONS$2, ...options }; - const nativeAudioBufferSourceNode = createNativeAudioBufferSourceNode(nativeContext, mergedOptions); - const isOffline = isNativeOfflineAudioContext(nativeContext); - const audioBufferSourceNodeRenderer = ((isOffline ? createAudioBufferSourceNodeRenderer() : null)); - super(context, false, nativeAudioBufferSourceNode, audioBufferSourceNodeRenderer); - this._audioBufferSourceNodeRenderer = audioBufferSourceNodeRenderer; - this._isBufferNullified = false; - this._isBufferSet = mergedOptions.buffer !== null; - this._nativeAudioBufferSourceNode = nativeAudioBufferSourceNode; - this._onended = null; - // Bug #73: Safari does not export the correct values for maxValue and minValue. - this._playbackRate = createAudioParam(this, isOffline, nativeAudioBufferSourceNode.playbackRate, MOST_POSITIVE_SINGLE_FLOAT, MOST_NEGATIVE_SINGLE_FLOAT); - } - get buffer() { - if (this._isBufferNullified) { - return null; - } - return this._nativeAudioBufferSourceNode.buffer; - } - set buffer(value) { - this._nativeAudioBufferSourceNode.buffer = value; - // Bug #72: Only Chrome, Edge & Opera do not allow to reassign the buffer yet. - if (value !== null) { - if (this._isBufferSet) { - throw createInvalidStateError(); - } - this._isBufferSet = true; - } - } - get loop() { - return this._nativeAudioBufferSourceNode.loop; - } - set loop(value) { - this._nativeAudioBufferSourceNode.loop = value; - } - get loopEnd() { - return this._nativeAudioBufferSourceNode.loopEnd; - } - set loopEnd(value) { - this._nativeAudioBufferSourceNode.loopEnd = value; - } - get loopStart() { - return this._nativeAudioBufferSourceNode.loopStart; - } - set loopStart(value) { - this._nativeAudioBufferSourceNode.loopStart = value; - } - get onended() { - return this._onended; - } - set onended(value) { - const wrappedListener = typeof value === 'function' ? wrapEventListener(this, value) : null; - this._nativeAudioBufferSourceNode.onended = wrappedListener; - const nativeOnEnded = this._nativeAudioBufferSourceNode.onended; - this._onended = nativeOnEnded !== null && nativeOnEnded === wrappedListener ? value : nativeOnEnded; - } - get playbackRate() { - return this._playbackRate; - } - start(when = 0, offset = 0, duration) { - this._nativeAudioBufferSourceNode.start(when, offset, duration); - if (this._audioBufferSourceNodeRenderer !== null) { - this._audioBufferSourceNodeRenderer.start = duration === undefined ? [when, offset] : [when, offset, duration]; - } - if (this.context.state !== 'closed') { - setInternalStateToActive(this); - const resetInternalStateToPassive = () => { - this._nativeAudioBufferSourceNode.removeEventListener('ended', resetInternalStateToPassive); - if (isActiveAudioNode(this)) { - setInternalStateToPassive(this); - } - }; - this._nativeAudioBufferSourceNode.addEventListener('ended', resetInternalStateToPassive); - } - } - stop(when = 0) { - this._nativeAudioBufferSourceNode.stop(when); - if (this._audioBufferSourceNodeRenderer !== null) { - this._audioBufferSourceNodeRenderer.stop = when; - } - } - }; -}; - -const createAudioBufferSourceNodeRendererFactory = (connectAudioParam, createNativeAudioBufferSourceNode, getNativeAudioNode, renderAutomation, renderInputsOfAudioNode) => { - return () => { - const renderedNativeAudioBufferSourceNodes = new WeakMap(); - let start = null; - let stop = null; - const createAudioBufferSourceNode = async (proxy, nativeOfflineAudioContext) => { - let nativeAudioBufferSourceNode = getNativeAudioNode(proxy); - /* - * If the initially used nativeAudioBufferSourceNode was not constructed on the same OfflineAudioContext it needs to be created - * again. - */ - const nativeAudioBufferSourceNodeIsOwnedByContext = isOwnedByContext(nativeAudioBufferSourceNode, nativeOfflineAudioContext); - if (!nativeAudioBufferSourceNodeIsOwnedByContext) { - const options = { - buffer: nativeAudioBufferSourceNode.buffer, - channelCount: nativeAudioBufferSourceNode.channelCount, - channelCountMode: nativeAudioBufferSourceNode.channelCountMode, - channelInterpretation: nativeAudioBufferSourceNode.channelInterpretation, - // Bug #149: Safari does not yet support the detune AudioParam. - loop: nativeAudioBufferSourceNode.loop, - loopEnd: nativeAudioBufferSourceNode.loopEnd, - loopStart: nativeAudioBufferSourceNode.loopStart, - playbackRate: nativeAudioBufferSourceNode.playbackRate.value - }; - nativeAudioBufferSourceNode = createNativeAudioBufferSourceNode(nativeOfflineAudioContext, options); - if (start !== null) { - nativeAudioBufferSourceNode.start(...start); - } - if (stop !== null) { - nativeAudioBufferSourceNode.stop(stop); - } - } - renderedNativeAudioBufferSourceNodes.set(nativeOfflineAudioContext, nativeAudioBufferSourceNode); - if (!nativeAudioBufferSourceNodeIsOwnedByContext) { - // Bug #149: Safari does not yet support the detune AudioParam. - await renderAutomation(nativeOfflineAudioContext, proxy.playbackRate, nativeAudioBufferSourceNode.playbackRate); - } - else { - // Bug #149: Safari does not yet support the detune AudioParam. - await connectAudioParam(nativeOfflineAudioContext, proxy.playbackRate, nativeAudioBufferSourceNode.playbackRate); - } - await renderInputsOfAudioNode(proxy, nativeOfflineAudioContext, nativeAudioBufferSourceNode); - return nativeAudioBufferSourceNode; - }; - return { - set start(value) { - start = value; - }, - set stop(value) { - stop = value; - }, - render(proxy, nativeOfflineAudioContext) { - const renderedNativeAudioBufferSourceNode = renderedNativeAudioBufferSourceNodes.get(nativeOfflineAudioContext); - if (renderedNativeAudioBufferSourceNode !== undefined) { - return Promise.resolve(renderedNativeAudioBufferSourceNode); - } - return createAudioBufferSourceNode(proxy, nativeOfflineAudioContext); - } - }; - }; -}; - -const isAudioBufferSourceNode = (audioNode) => { - return 'playbackRate' in audioNode; -}; - -const isBiquadFilterNode = (audioNode) => { - return 'frequency' in audioNode && 'gain' in audioNode; -}; - -const isConstantSourceNode = (audioNode) => { - return 'offset' in audioNode; -}; - -const isGainNode = (audioNode) => { - return !('frequency' in audioNode) && 'gain' in audioNode; -}; - -const isOscillatorNode = (audioNode) => { - return 'detune' in audioNode && 'frequency' in audioNode; -}; - -const isStereoPannerNode = (audioNode) => { - return 'pan' in audioNode; -}; - -const getAudioNodeConnections = (audioNode) => { - return getValueForKey(AUDIO_NODE_CONNECTIONS_STORE, audioNode); -}; - -const getAudioParamConnections = (audioParam) => { - return getValueForKey(AUDIO_PARAM_CONNECTIONS_STORE, audioParam); -}; - -const deactivateActiveAudioNodeInputConnections = (audioNode, trace) => { - const { activeInputs } = getAudioNodeConnections(audioNode); - activeInputs.forEach((connections) => connections.forEach(([source]) => { - if (!trace.includes(audioNode)) { - deactivateActiveAudioNodeInputConnections(source, [...trace, audioNode]); - } - })); - const audioParams = isAudioBufferSourceNode(audioNode) - ? [ - // Bug #149: Safari does not yet support the detune AudioParam. - audioNode.playbackRate - ] - : isAudioWorkletNode(audioNode) - ? Array.from(audioNode.parameters.values()) - : isBiquadFilterNode(audioNode) - ? [audioNode.Q, audioNode.detune, audioNode.frequency, audioNode.gain] - : isConstantSourceNode(audioNode) - ? [audioNode.offset] - : isGainNode(audioNode) - ? [audioNode.gain] - : isOscillatorNode(audioNode) - ? [audioNode.detune, audioNode.frequency] - : isStereoPannerNode(audioNode) - ? [audioNode.pan] - : []; - for (const audioParam of audioParams) { - const audioParamConnections = getAudioParamConnections(audioParam); - if (audioParamConnections !== undefined) { - audioParamConnections.activeInputs.forEach(([source]) => deactivateActiveAudioNodeInputConnections(source, trace)); - } - } - if (isActiveAudioNode(audioNode)) { - setInternalStateToPassive(audioNode); - } -}; - -const deactivateAudioGraph = (context) => { - deactivateActiveAudioNodeInputConnections(context.destination, []); -}; - -const isValidLatencyHint = (latencyHint) => { - return (latencyHint === undefined || - typeof latencyHint === 'number' || - (typeof latencyHint === 'string' && (latencyHint === 'balanced' || latencyHint === 'interactive' || latencyHint === 'playback'))); -}; - -const createAudioContextConstructor = (baseAudioContextConstructor, createInvalidStateError, createNotSupportedError, createUnknownError, mediaElementAudioSourceNodeConstructor, mediaStreamAudioDestinationNodeConstructor, mediaStreamAudioSourceNodeConstructor, mediaStreamTrackAudioSourceNodeConstructor, nativeAudioContextConstructor) => { - return class AudioContext extends baseAudioContextConstructor { - constructor(options = {}) { - if (nativeAudioContextConstructor === null) { - throw new Error('Missing the native AudioContext constructor.'); - } - let nativeAudioContext; - try { - nativeAudioContext = new nativeAudioContextConstructor(options); - } - catch (err) { - // Bug #192 Safari does throw a SyntaxError if the sampleRate is not supported. - if (err.code === 12 && err.message === 'sampleRate is not in range') { - throw createNotSupportedError(); - } - throw err; - } - // Bug #131 Safari returns null when there are four other AudioContexts running already. - if (nativeAudioContext === null) { - throw createUnknownError(); - } - // Bug #51 Only Chrome, Edge and Opera throw an error if the given latencyHint is invalid. - if (!isValidLatencyHint(options.latencyHint)) { - throw new TypeError(`The provided value '${options.latencyHint}' is not a valid enum value of type AudioContextLatencyCategory.`); - } - // Bug #150 Safari does not support setting the sampleRate. - if (options.sampleRate !== undefined && nativeAudioContext.sampleRate !== options.sampleRate) { - throw createNotSupportedError(); - } - super(nativeAudioContext, 2); - const { latencyHint } = options; - const { sampleRate } = nativeAudioContext; - // @todo The values for 'balanced', 'interactive' and 'playback' are just copied from Chrome's implementation. - this._baseLatency = - typeof nativeAudioContext.baseLatency === 'number' - ? nativeAudioContext.baseLatency - : latencyHint === 'balanced' - ? 512 / sampleRate - : latencyHint === 'interactive' || latencyHint === undefined - ? 256 / sampleRate - : latencyHint === 'playback' - ? 1024 / sampleRate - : /* - * @todo The min (256) and max (16384) values are taken from the allowed bufferSize values of a - * ScriptProcessorNode. - */ - (Math.max(2, Math.min(128, Math.round((latencyHint * sampleRate) / 128))) * 128) / sampleRate; - this._nativeAudioContext = nativeAudioContext; - // Bug #188: Safari will set the context's state to 'interrupted' in case the user switches tabs. - if (nativeAudioContextConstructor.name === 'webkitAudioContext') { - this._nativeGainNode = nativeAudioContext.createGain(); - this._nativeOscillatorNode = nativeAudioContext.createOscillator(); - this._nativeGainNode.gain.value = 1e-37; - this._nativeOscillatorNode.connect(this._nativeGainNode).connect(nativeAudioContext.destination); - this._nativeOscillatorNode.start(); - } - else { - this._nativeGainNode = null; - this._nativeOscillatorNode = null; - } - this._state = null; - /* - * Bug #34: Chrome, Edge and Opera pretend to be running right away, but fire an onstatechange event when the state actually - * changes to 'running'. - */ - if (nativeAudioContext.state === 'running') { - this._state = 'suspended'; - const revokeState = () => { - if (this._state === 'suspended') { - this._state = null; - } - nativeAudioContext.removeEventListener('statechange', revokeState); - }; - nativeAudioContext.addEventListener('statechange', revokeState); - } - } - get baseLatency() { - return this._baseLatency; - } - get state() { - return this._state !== null ? this._state : this._nativeAudioContext.state; - } - close() { - // Bug #35: Firefox does not throw an error if the AudioContext was closed before. - if (this.state === 'closed') { - return this._nativeAudioContext.close().then(() => { - throw createInvalidStateError(); - }); - } - // Bug #34: If the state was set to suspended before it should be revoked now. - if (this._state === 'suspended') { - this._state = null; - } - return this._nativeAudioContext.close().then(() => { - if (this._nativeGainNode !== null && this._nativeOscillatorNode !== null) { - this._nativeOscillatorNode.stop(); - this._nativeGainNode.disconnect(); - this._nativeOscillatorNode.disconnect(); - } - deactivateAudioGraph(this); - }); - } - createMediaElementSource(mediaElement) { - return new mediaElementAudioSourceNodeConstructor(this, { mediaElement }); - } - createMediaStreamDestination() { - return new mediaStreamAudioDestinationNodeConstructor(this); - } - createMediaStreamSource(mediaStream) { - return new mediaStreamAudioSourceNodeConstructor(this, { mediaStream }); - } - createMediaStreamTrackSource(mediaStreamTrack) { - return new mediaStreamTrackAudioSourceNodeConstructor(this, { mediaStreamTrack }); - } - resume() { - if (this._state === 'suspended') { - return new Promise((resolve, reject) => { - const resolvePromise = () => { - this._nativeAudioContext.removeEventListener('statechange', resolvePromise); - if (this._nativeAudioContext.state === 'running') { - resolve(); - } - else { - this.resume().then(resolve, reject); - } - }; - this._nativeAudioContext.addEventListener('statechange', resolvePromise); - }); - } - return this._nativeAudioContext.resume().catch((err) => { - // Bug #55: Chrome, Edge and Opera do throw an InvalidAccessError instead of an InvalidStateError. - // Bug #56: Safari invokes the catch handler but without an error. - if (err === undefined || err.code === 15) { - throw createInvalidStateError(); - } - throw err; - }); - } - suspend() { - return this._nativeAudioContext.suspend().catch((err) => { - // Bug #56: Safari invokes the catch handler but without an error. - if (err === undefined) { - throw createInvalidStateError(); - } - throw err; - }); - } - }; -}; - -const createAudioDestinationNodeConstructor = (audioNodeConstructor, createAudioDestinationNodeRenderer, createIndexSizeError, createInvalidStateError, createNativeAudioDestinationNode, getNativeContext, isNativeOfflineAudioContext, renderInputsOfAudioNode) => { - return class AudioDestinationNode extends audioNodeConstructor { - constructor(context, channelCount) { - const nativeContext = getNativeContext(context); - const isOffline = isNativeOfflineAudioContext(nativeContext); - const nativeAudioDestinationNode = createNativeAudioDestinationNode(nativeContext, channelCount, isOffline); - const audioDestinationNodeRenderer = ((isOffline ? createAudioDestinationNodeRenderer(renderInputsOfAudioNode) : null)); - super(context, false, nativeAudioDestinationNode, audioDestinationNodeRenderer); - this._isNodeOfNativeOfflineAudioContext = isOffline; - this._nativeAudioDestinationNode = nativeAudioDestinationNode; - } - get channelCount() { - return this._nativeAudioDestinationNode.channelCount; - } - set channelCount(value) { - // Bug #52: Chrome, Edge, Opera & Safari do not throw an exception at all. - // Bug #54: Firefox does throw an IndexSizeError. - if (this._isNodeOfNativeOfflineAudioContext) { - throw createInvalidStateError(); - } - // Bug #47: The AudioDestinationNode in Safari does not initialize the maxChannelCount property correctly. - if (value > this._nativeAudioDestinationNode.maxChannelCount) { - throw createIndexSizeError(); - } - this._nativeAudioDestinationNode.channelCount = value; - } - get channelCountMode() { - return this._nativeAudioDestinationNode.channelCountMode; - } - set channelCountMode(value) { - // Bug #53: No browser does throw an exception yet. - if (this._isNodeOfNativeOfflineAudioContext) { - throw createInvalidStateError(); - } - this._nativeAudioDestinationNode.channelCountMode = value; - } - get maxChannelCount() { - return this._nativeAudioDestinationNode.maxChannelCount; - } - }; -}; - -const createAudioDestinationNodeRenderer = (renderInputsOfAudioNode) => { - const renderedNativeAudioDestinationNodes = new WeakMap(); - const createAudioDestinationNode = async (proxy, nativeOfflineAudioContext) => { - const nativeAudioDestinationNode = nativeOfflineAudioContext.destination; - renderedNativeAudioDestinationNodes.set(nativeOfflineAudioContext, nativeAudioDestinationNode); - await renderInputsOfAudioNode(proxy, nativeOfflineAudioContext, nativeAudioDestinationNode); - return nativeAudioDestinationNode; - }; - return { - render(proxy, nativeOfflineAudioContext) { - const renderedNativeAudioDestinationNode = renderedNativeAudioDestinationNodes.get(nativeOfflineAudioContext); - if (renderedNativeAudioDestinationNode !== undefined) { - return Promise.resolve(renderedNativeAudioDestinationNode); - } - return createAudioDestinationNode(proxy, nativeOfflineAudioContext); - } - }; -}; - -const createAudioListenerFactory = (createAudioParam, createNativeChannelMergerNode, createNativeConstantSourceNode, createNativeScriptProcessorNode, createNotSupportedError, getFirstSample, isNativeOfflineAudioContext, overwriteAccessors) => { - return (context, nativeContext) => { - const nativeListener = nativeContext.listener; - // Bug #117: Only Chrome, Edge & Opera support the new interface already. - const createFakeAudioParams = () => { - const buffer = new Float32Array(1); - const channelMergerNode = createNativeChannelMergerNode(nativeContext, { - channelCount: 1, - channelCountMode: 'explicit', - channelInterpretation: 'speakers', - numberOfInputs: 9 - }); - const isOffline = isNativeOfflineAudioContext(nativeContext); - let isScriptProcessorNodeCreated = false; - let lastOrientation = [0, 0, -1, 0, 1, 0]; - let lastPosition = [0, 0, 0]; - const createScriptProcessorNode = () => { - if (isScriptProcessorNodeCreated) { - return; - } - isScriptProcessorNodeCreated = true; - const scriptProcessorNode = createNativeScriptProcessorNode(nativeContext, 256, 9, 0); - // tslint:disable-next-line:deprecation - scriptProcessorNode.onaudioprocess = ({ inputBuffer }) => { - const orientation = [ - getFirstSample(inputBuffer, buffer, 0), - getFirstSample(inputBuffer, buffer, 1), - getFirstSample(inputBuffer, buffer, 2), - getFirstSample(inputBuffer, buffer, 3), - getFirstSample(inputBuffer, buffer, 4), - getFirstSample(inputBuffer, buffer, 5) - ]; - if (orientation.some((value, index) => value !== lastOrientation[index])) { - nativeListener.setOrientation(...orientation); // tslint:disable-line:deprecation - lastOrientation = orientation; - } - const positon = [ - getFirstSample(inputBuffer, buffer, 6), - getFirstSample(inputBuffer, buffer, 7), - getFirstSample(inputBuffer, buffer, 8) - ]; - if (positon.some((value, index) => value !== lastPosition[index])) { - nativeListener.setPosition(...positon); // tslint:disable-line:deprecation - lastPosition = positon; - } - }; - channelMergerNode.connect(scriptProcessorNode); - }; - const createSetOrientation = (index) => (value) => { - if (value !== lastOrientation[index]) { - lastOrientation[index] = value; - nativeListener.setOrientation(...lastOrientation); // tslint:disable-line:deprecation - } - }; - const createSetPosition = (index) => (value) => { - if (value !== lastPosition[index]) { - lastPosition[index] = value; - nativeListener.setPosition(...lastPosition); // tslint:disable-line:deprecation - } - }; - const createFakeAudioParam = (input, initialValue, setValue) => { - const constantSourceNode = createNativeConstantSourceNode(nativeContext, { - channelCount: 1, - channelCountMode: 'explicit', - channelInterpretation: 'discrete', - offset: initialValue - }); - constantSourceNode.connect(channelMergerNode, 0, input); - // @todo This should be stopped when the context is closed. - constantSourceNode.start(); - Object.defineProperty(constantSourceNode.offset, 'defaultValue', { - get() { - return initialValue; - } - }); - /* - * Bug #62 & #74: Safari does not support ConstantSourceNodes and does not export the correct values for maxValue and - * minValue for GainNodes. - */ - const audioParam = createAudioParam({ context }, isOffline, constantSourceNode.offset, MOST_POSITIVE_SINGLE_FLOAT, MOST_NEGATIVE_SINGLE_FLOAT); - overwriteAccessors(audioParam, 'value', (get) => () => get.call(audioParam), (set) => (value) => { - try { - set.call(audioParam, value); - } - catch (err) { - if (err.code !== 9) { - throw err; - } - } - createScriptProcessorNode(); - if (isOffline) { - // Bug #117: Using setOrientation() and setPosition() doesn't work with an OfflineAudioContext. - setValue(value); - } - }); - audioParam.cancelAndHoldAtTime = ((cancelAndHoldAtTime) => { - if (isOffline) { - return () => { - throw createNotSupportedError(); - }; - } - return (...args) => { - const value = cancelAndHoldAtTime.apply(audioParam, args); - createScriptProcessorNode(); - return value; - }; - })(audioParam.cancelAndHoldAtTime); - audioParam.cancelScheduledValues = ((cancelScheduledValues) => { - if (isOffline) { - return () => { - throw createNotSupportedError(); - }; - } - return (...args) => { - const value = cancelScheduledValues.apply(audioParam, args); - createScriptProcessorNode(); - return value; - }; - })(audioParam.cancelScheduledValues); - audioParam.exponentialRampToValueAtTime = ((exponentialRampToValueAtTime) => { - if (isOffline) { - return () => { - throw createNotSupportedError(); - }; - } - return (...args) => { - const value = exponentialRampToValueAtTime.apply(audioParam, args); - createScriptProcessorNode(); - return value; - }; - })(audioParam.exponentialRampToValueAtTime); - audioParam.linearRampToValueAtTime = ((linearRampToValueAtTime) => { - if (isOffline) { - return () => { - throw createNotSupportedError(); - }; - } - return (...args) => { - const value = linearRampToValueAtTime.apply(audioParam, args); - createScriptProcessorNode(); - return value; - }; - })(audioParam.linearRampToValueAtTime); - audioParam.setTargetAtTime = ((setTargetAtTime) => { - if (isOffline) { - return () => { - throw createNotSupportedError(); - }; - } - return (...args) => { - const value = setTargetAtTime.apply(audioParam, args); - createScriptProcessorNode(); - return value; - }; - })(audioParam.setTargetAtTime); - audioParam.setValueAtTime = ((setValueAtTime) => { - if (isOffline) { - return () => { - throw createNotSupportedError(); - }; - } - return (...args) => { - const value = setValueAtTime.apply(audioParam, args); - createScriptProcessorNode(); - return value; - }; - })(audioParam.setValueAtTime); - audioParam.setValueCurveAtTime = ((setValueCurveAtTime) => { - if (isOffline) { - return () => { - throw createNotSupportedError(); - }; - } - return (...args) => { - const value = setValueCurveAtTime.apply(audioParam, args); - createScriptProcessorNode(); - return value; - }; - })(audioParam.setValueCurveAtTime); - return audioParam; - }; - return { - forwardX: createFakeAudioParam(0, 0, createSetOrientation(0)), - forwardY: createFakeAudioParam(1, 0, createSetOrientation(1)), - forwardZ: createFakeAudioParam(2, -1, createSetOrientation(2)), - positionX: createFakeAudioParam(6, 0, createSetPosition(0)), - positionY: createFakeAudioParam(7, 0, createSetPosition(1)), - positionZ: createFakeAudioParam(8, 0, createSetPosition(2)), - upX: createFakeAudioParam(3, 0, createSetOrientation(3)), - upY: createFakeAudioParam(4, 1, createSetOrientation(4)), - upZ: createFakeAudioParam(5, 0, createSetOrientation(5)) - }; - }; - const { forwardX, forwardY, forwardZ, positionX, positionY, positionZ, upX, upY, upZ } = nativeListener.forwardX === undefined ? createFakeAudioParams() : nativeListener; - return { - get forwardX() { - return forwardX; - }, - get forwardY() { - return forwardY; - }, - get forwardZ() { - return forwardZ; - }, - get positionX() { - return positionX; - }, - get positionY() { - return positionY; - }, - get positionZ() { - return positionZ; - }, - get upX() { - return upX; - }, - get upY() { - return upY; - }, - get upZ() { - return upZ; - } - }; - }; -}; - -const isAudioNode = (audioNodeOrAudioParam) => { - return 'context' in audioNodeOrAudioParam; -}; - -const isAudioNodeOutputConnection = (outputConnection) => { - return isAudioNode(outputConnection[0]); -}; - -const insertElementInSet = (set, element, predicate, ignoreDuplicates) => { - for (const lmnt of set) { - if (predicate(lmnt)) { - if (ignoreDuplicates) { - return false; - } - throw Error('The set contains at least one similar element.'); - } - } - set.add(element); - return true; -}; - -const addActiveInputConnectionToAudioParam = (activeInputs, source, [output, eventListener], ignoreDuplicates) => { - insertElementInSet(activeInputs, [source, output, eventListener], (activeInputConnection) => activeInputConnection[0] === source && activeInputConnection[1] === output, ignoreDuplicates); -}; - -const addPassiveInputConnectionToAudioParam = (passiveInputs, [source, output, eventListener], ignoreDuplicates) => { - const passiveInputConnections = passiveInputs.get(source); - if (passiveInputConnections === undefined) { - passiveInputs.set(source, new Set([[output, eventListener]])); - } - else { - insertElementInSet(passiveInputConnections, [output, eventListener], (passiveInputConnection) => passiveInputConnection[0] === output, ignoreDuplicates); - } -}; - -const isNativeAudioNodeFaker = (nativeAudioNodeOrNativeAudioNodeFaker) => { - return 'inputs' in nativeAudioNodeOrNativeAudioNodeFaker; -}; - -const connectNativeAudioNodeToNativeAudioNode = (nativeSourceAudioNode, nativeDestinationAudioNode, output, input) => { - if (isNativeAudioNodeFaker(nativeDestinationAudioNode)) { - const fakeNativeDestinationAudioNode = nativeDestinationAudioNode.inputs[input]; - nativeSourceAudioNode.connect(fakeNativeDestinationAudioNode, output, 0); - return [fakeNativeDestinationAudioNode, output, 0]; - } - nativeSourceAudioNode.connect(nativeDestinationAudioNode, output, input); - return [nativeDestinationAudioNode, output, input]; -}; - -const deleteActiveInputConnection = (activeInputConnections, source, output) => { - for (const activeInputConnection of activeInputConnections) { - if (activeInputConnection[0] === source && activeInputConnection[1] === output) { - activeInputConnections.delete(activeInputConnection); - return activeInputConnection; - } - } - return null; -}; - -const deleteActiveInputConnectionToAudioParam = (activeInputs, source, output) => { - return pickElementFromSet(activeInputs, (activeInputConnection) => activeInputConnection[0] === source && activeInputConnection[1] === output); -}; - -const deleteEventListenerOfAudioNode = (audioNode, eventListener) => { - const eventListeners = getEventListenersOfAudioNode(audioNode); - if (!eventListeners.delete(eventListener)) { - throw new Error('Missing the expected event listener.'); - } -}; - -const deletePassiveInputConnectionToAudioParam = (passiveInputs, source, output) => { - const passiveInputConnections = getValueForKey(passiveInputs, source); - const matchingConnection = pickElementFromSet(passiveInputConnections, (passiveInputConnection) => passiveInputConnection[0] === output); - if (passiveInputConnections.size === 0) { - passiveInputs.delete(source); - } - return matchingConnection; -}; - -const disconnectNativeAudioNodeFromNativeAudioNode = (nativeSourceAudioNode, nativeDestinationAudioNode, output, input) => { - if (isNativeAudioNodeFaker(nativeDestinationAudioNode)) { - nativeSourceAudioNode.disconnect(nativeDestinationAudioNode.inputs[input], output, 0); - } - else { - nativeSourceAudioNode.disconnect(nativeDestinationAudioNode, output, input); - } -}; - -const getNativeAudioNode = (audioNode) => { - return getValueForKey(AUDIO_NODE_STORE, audioNode); -}; - -const getNativeAudioParam = (audioParam) => { - return getValueForKey(AUDIO_PARAM_STORE, audioParam); -}; - -const isPartOfACycle = (audioNode) => { - return CYCLE_COUNTERS.has(audioNode); -}; - -const isPassiveAudioNode = (audioNode) => { - return !ACTIVE_AUDIO_NODE_STORE.has(audioNode); -}; - -const testAudioNodeDisconnectMethodSupport = (nativeAudioContext, nativeAudioWorkletNodeConstructor) => { - return new Promise((resolve) => { - /* - * This bug existed in Safari up until v14.0.2. Since AudioWorklets were not supported in Safari until v14.1 the presence of the - * constructor for an AudioWorkletNode can be used here to skip the test. - */ - if (nativeAudioWorkletNodeConstructor !== null) { - resolve(true); - } - else { - const analyzer = nativeAudioContext.createScriptProcessor(256, 1, 1); // tslint:disable-line deprecation - const dummy = nativeAudioContext.createGain(); - // Bug #95: Safari does not play one sample buffers. - const ones = nativeAudioContext.createBuffer(1, 2, 44100); - const channelData = ones.getChannelData(0); - channelData[0] = 1; - channelData[1] = 1; - const source = nativeAudioContext.createBufferSource(); - source.buffer = ones; - source.loop = true; - source.connect(analyzer).connect(nativeAudioContext.destination); - source.connect(dummy); - source.disconnect(dummy); - // tslint:disable-next-line:deprecation - analyzer.onaudioprocess = (event) => { - const chnnlDt = event.inputBuffer.getChannelData(0); // tslint:disable-line deprecation - if (Array.prototype.some.call(chnnlDt, (sample) => sample === 1)) { - resolve(true); - } - else { - resolve(false); - } - source.stop(); - analyzer.onaudioprocess = null; // tslint:disable-line:deprecation - source.disconnect(analyzer); - analyzer.disconnect(nativeAudioContext.destination); - }; - source.start(); - } - }); -}; - -const visitEachAudioNodeOnce = (cycles, visitor) => { - const counts = new Map(); - for (const cycle of cycles) { - for (const audioNode of cycle) { - const count = counts.get(audioNode); - counts.set(audioNode, count === undefined ? 1 : count + 1); - } - } - counts.forEach((count, audioNode) => visitor(audioNode, count)); -}; - -const isNativeAudioNode = (nativeAudioNodeOrAudioParam) => { - return 'context' in nativeAudioNodeOrAudioParam; -}; - -const wrapAudioNodeDisconnectMethod = (nativeAudioNode) => { - const connections = new Map(); - nativeAudioNode.connect = ((connect) => { - // tslint:disable-next-line:invalid-void no-inferrable-types - return (destination, output = 0, input = 0) => { - const returnValue = isNativeAudioNode(destination) ? connect(destination, output, input) : connect(destination, output); - // Save the new connection only if the calls to connect above didn't throw an error. - const connectionsToDestination = connections.get(destination); - if (connectionsToDestination === undefined) { - connections.set(destination, [{ input, output }]); - } - else { - if (connectionsToDestination.every((connection) => connection.input !== input || connection.output !== output)) { - connectionsToDestination.push({ input, output }); - } - } - return returnValue; - }; - })(nativeAudioNode.connect.bind(nativeAudioNode)); - nativeAudioNode.disconnect = ((disconnect) => { - return (destinationOrOutput, output, input) => { - disconnect.apply(nativeAudioNode); - if (destinationOrOutput === undefined) { - connections.clear(); - } - else if (typeof destinationOrOutput === 'number') { - for (const [destination, connectionsToDestination] of connections) { - const filteredConnections = connectionsToDestination.filter((connection) => connection.output !== destinationOrOutput); - if (filteredConnections.length === 0) { - connections.delete(destination); - } - else { - connections.set(destination, filteredConnections); - } - } - } - else if (connections.has(destinationOrOutput)) { - if (output === undefined) { - connections.delete(destinationOrOutput); - } - else { - const connectionsToDestination = connections.get(destinationOrOutput); - if (connectionsToDestination !== undefined) { - const filteredConnections = connectionsToDestination.filter((connection) => connection.output !== output && (connection.input !== input || input === undefined)); - if (filteredConnections.length === 0) { - connections.delete(destinationOrOutput); - } - else { - connections.set(destinationOrOutput, filteredConnections); - } - } - } - } - for (const [destination, connectionsToDestination] of connections) { - connectionsToDestination.forEach((connection) => { - if (isNativeAudioNode(destination)) { - nativeAudioNode.connect(destination, connection.output, connection.input); - } - else { - nativeAudioNode.connect(destination, connection.output); - } - }); - } - }; - })(nativeAudioNode.disconnect); -}; - -const addConnectionToAudioParamOfAudioContext = (source, destination, output, isOffline) => { - const { activeInputs, passiveInputs } = getAudioParamConnections(destination); - const { outputs } = getAudioNodeConnections(source); - const eventListeners = getEventListenersOfAudioNode(source); - const eventListener = (isActive) => { - const nativeAudioNode = getNativeAudioNode(source); - const nativeAudioParam = getNativeAudioParam(destination); - if (isActive) { - const partialConnection = deletePassiveInputConnectionToAudioParam(passiveInputs, source, output); - addActiveInputConnectionToAudioParam(activeInputs, source, partialConnection, false); - if (!isOffline && !isPartOfACycle(source)) { - nativeAudioNode.connect(nativeAudioParam, output); - } - } - else { - const partialConnection = deleteActiveInputConnectionToAudioParam(activeInputs, source, output); - addPassiveInputConnectionToAudioParam(passiveInputs, partialConnection, false); - if (!isOffline && !isPartOfACycle(source)) { - nativeAudioNode.disconnect(nativeAudioParam, output); - } - } - }; - if (insertElementInSet(outputs, [destination, output], (outputConnection) => outputConnection[0] === destination && outputConnection[1] === output, true)) { - eventListeners.add(eventListener); - if (isActiveAudioNode(source)) { - addActiveInputConnectionToAudioParam(activeInputs, source, [output, eventListener], true); - } - else { - addPassiveInputConnectionToAudioParam(passiveInputs, [source, output, eventListener], true); - } - return true; - } - return false; -}; -const deleteInputConnectionOfAudioNode = (source, destination, output, input) => { - const { activeInputs, passiveInputs } = getAudioNodeConnections(destination); - const activeInputConnection = deleteActiveInputConnection(activeInputs[input], source, output); - if (activeInputConnection === null) { - const passiveInputConnection = deletePassiveInputConnectionToAudioNode(passiveInputs, source, output, input); - return [passiveInputConnection[2], false]; - } - return [activeInputConnection[2], true]; -}; -const deleteInputConnectionOfAudioParam = (source, destination, output) => { - const { activeInputs, passiveInputs } = getAudioParamConnections(destination); - const activeInputConnection = deleteActiveInputConnection(activeInputs, source, output); - if (activeInputConnection === null) { - const passiveInputConnection = deletePassiveInputConnectionToAudioParam(passiveInputs, source, output); - return [passiveInputConnection[1], false]; - } - return [activeInputConnection[2], true]; -}; -const deleteInputsOfAudioNode = (source, isOffline, destination, output, input) => { - const [listener, isActive] = deleteInputConnectionOfAudioNode(source, destination, output, input); - if (listener !== null) { - deleteEventListenerOfAudioNode(source, listener); - if (isActive && !isOffline && !isPartOfACycle(source)) { - disconnectNativeAudioNodeFromNativeAudioNode(getNativeAudioNode(source), getNativeAudioNode(destination), output, input); - } - } - if (isActiveAudioNode(destination)) { - const { activeInputs } = getAudioNodeConnections(destination); - setInternalStateToPassiveWhenNecessary(destination, activeInputs); - } -}; -const deleteInputsOfAudioParam = (source, isOffline, destination, output) => { - const [listener, isActive] = deleteInputConnectionOfAudioParam(source, destination, output); - if (listener !== null) { - deleteEventListenerOfAudioNode(source, listener); - if (isActive && !isOffline && !isPartOfACycle(source)) { - getNativeAudioNode(source).disconnect(getNativeAudioParam(destination), output); - } - } -}; -const deleteAnyConnection = (source, isOffline) => { - const audioNodeConnectionsOfSource = getAudioNodeConnections(source); - const destinations = []; - for (const outputConnection of audioNodeConnectionsOfSource.outputs) { - if (isAudioNodeOutputConnection(outputConnection)) { - deleteInputsOfAudioNode(source, isOffline, ...outputConnection); - } - else { - deleteInputsOfAudioParam(source, isOffline, ...outputConnection); - } - destinations.push(outputConnection[0]); - } - audioNodeConnectionsOfSource.outputs.clear(); - return destinations; -}; -const deleteConnectionAtOutput = (source, isOffline, output) => { - const audioNodeConnectionsOfSource = getAudioNodeConnections(source); - const destinations = []; - for (const outputConnection of audioNodeConnectionsOfSource.outputs) { - if (outputConnection[1] === output) { - if (isAudioNodeOutputConnection(outputConnection)) { - deleteInputsOfAudioNode(source, isOffline, ...outputConnection); - } - else { - deleteInputsOfAudioParam(source, isOffline, ...outputConnection); - } - destinations.push(outputConnection[0]); - audioNodeConnectionsOfSource.outputs.delete(outputConnection); - } - } - return destinations; -}; -const deleteConnectionToDestination = (source, isOffline, destination, output, input) => { - const audioNodeConnectionsOfSource = getAudioNodeConnections(source); - return Array.from(audioNodeConnectionsOfSource.outputs) - .filter((outputConnection) => outputConnection[0] === destination && - (output === undefined || outputConnection[1] === output) && - (input === undefined || outputConnection[2] === input)) - .map((outputConnection) => { - if (isAudioNodeOutputConnection(outputConnection)) { - deleteInputsOfAudioNode(source, isOffline, ...outputConnection); - } - else { - deleteInputsOfAudioParam(source, isOffline, ...outputConnection); - } - audioNodeConnectionsOfSource.outputs.delete(outputConnection); - return outputConnection[0]; - }); -}; -const createAudioNodeConstructor = (addAudioNodeConnections, addConnectionToAudioNode, cacheTestResult, createIncrementCycleCounter, createIndexSizeError, createInvalidAccessError, createNotSupportedError, decrementCycleCounter, detectCycles, eventTargetConstructor, getNativeContext, isNativeAudioContext, isNativeAudioNode, isNativeAudioParam, isNativeOfflineAudioContext, nativeAudioWorkletNodeConstructor) => { - return class AudioNode extends eventTargetConstructor { - constructor(context, isActive, nativeAudioNode, audioNodeRenderer) { - super(nativeAudioNode); - this._context = context; - this._nativeAudioNode = nativeAudioNode; - const nativeContext = getNativeContext(context); - // Bug #12: Safari does not support to disconnect a specific destination. - if (isNativeAudioContext(nativeContext) && - true !== - cacheTestResult(testAudioNodeDisconnectMethodSupport, () => { - return testAudioNodeDisconnectMethodSupport(nativeContext, nativeAudioWorkletNodeConstructor); - })) { - wrapAudioNodeDisconnectMethod(nativeAudioNode); - } - AUDIO_NODE_STORE.set(this, nativeAudioNode); - EVENT_LISTENERS.set(this, new Set()); - if (context.state !== 'closed' && isActive) { - setInternalStateToActive(this); - } - addAudioNodeConnections(this, audioNodeRenderer, nativeAudioNode); - } - get channelCount() { - return this._nativeAudioNode.channelCount; - } - set channelCount(value) { - this._nativeAudioNode.channelCount = value; - } - get channelCountMode() { - return this._nativeAudioNode.channelCountMode; - } - set channelCountMode(value) { - this._nativeAudioNode.channelCountMode = value; - } - get channelInterpretation() { - return this._nativeAudioNode.channelInterpretation; - } - set channelInterpretation(value) { - this._nativeAudioNode.channelInterpretation = value; - } - get context() { - return this._context; - } - get numberOfInputs() { - return this._nativeAudioNode.numberOfInputs; - } - get numberOfOutputs() { - return this._nativeAudioNode.numberOfOutputs; - } - // tslint:disable-next-line:invalid-void - connect(destination, output = 0, input = 0) { - // Bug #174: Safari does expose a wrong numberOfOutputs for MediaStreamAudioDestinationNodes. - if (output < 0 || output >= this._nativeAudioNode.numberOfOutputs) { - throw createIndexSizeError(); - } - const nativeContext = getNativeContext(this._context); - const isOffline = isNativeOfflineAudioContext(nativeContext); - if (isNativeAudioNode(destination) || isNativeAudioParam(destination)) { - throw createInvalidAccessError(); - } - if (isAudioNode(destination)) { - const nativeDestinationAudioNode = getNativeAudioNode(destination); - try { - const connection = connectNativeAudioNodeToNativeAudioNode(this._nativeAudioNode, nativeDestinationAudioNode, output, input); - const isPassive = isPassiveAudioNode(this); - if (isOffline || isPassive) { - this._nativeAudioNode.disconnect(...connection); - } - if (this.context.state !== 'closed' && !isPassive && isPassiveAudioNode(destination)) { - setInternalStateToActive(destination); - } - } - catch (err) { - // Bug #41: Safari does not throw the correct exception so far. - if (err.code === 12) { - throw createInvalidAccessError(); - } - throw err; - } - const isNewConnectionToAudioNode = addConnectionToAudioNode(this, destination, output, input, isOffline); - // Bug #164: Only Firefox detects cycles so far. - if (isNewConnectionToAudioNode) { - const cycles = detectCycles([this], destination); - visitEachAudioNodeOnce(cycles, createIncrementCycleCounter(isOffline)); - } - return destination; - } - const nativeAudioParam = getNativeAudioParam(destination); - /* - * Bug #73, #147 & #153: Safari does not support to connect an input signal to the playbackRate AudioParam of an - * AudioBufferSourceNode. This can't be easily detected and that's why the outdated name property is used here to identify - * Safari. In addition to that the maxValue property is used to only detect the affected versions below v14.0.2. - */ - if (nativeAudioParam.name === 'playbackRate' && nativeAudioParam.maxValue === 1024) { - throw createNotSupportedError(); - } - try { - this._nativeAudioNode.connect(nativeAudioParam, output); - if (isOffline || isPassiveAudioNode(this)) { - this._nativeAudioNode.disconnect(nativeAudioParam, output); - } - } - catch (err) { - // Bug #58: Safari doesn't throw an InvalidAccessError yet. - if (err.code === 12) { - throw createInvalidAccessError(); - } - throw err; - } - const isNewConnectionToAudioParam = addConnectionToAudioParamOfAudioContext(this, destination, output, isOffline); - // Bug #164: Only Firefox detects cycles so far. - if (isNewConnectionToAudioParam) { - const cycles = detectCycles([this], destination); - visitEachAudioNodeOnce(cycles, createIncrementCycleCounter(isOffline)); - } - } - disconnect(destinationOrOutput, output, input) { - let destinations; - const nativeContext = getNativeContext(this._context); - const isOffline = isNativeOfflineAudioContext(nativeContext); - if (destinationOrOutput === undefined) { - destinations = deleteAnyConnection(this, isOffline); - } - else if (typeof destinationOrOutput === 'number') { - if (destinationOrOutput < 0 || destinationOrOutput >= this.numberOfOutputs) { - throw createIndexSizeError(); - } - destinations = deleteConnectionAtOutput(this, isOffline, destinationOrOutput); - } - else { - if (output !== undefined && (output < 0 || output >= this.numberOfOutputs)) { - throw createIndexSizeError(); - } - if (isAudioNode(destinationOrOutput) && input !== undefined && (input < 0 || input >= destinationOrOutput.numberOfInputs)) { - throw createIndexSizeError(); - } - destinations = deleteConnectionToDestination(this, isOffline, destinationOrOutput, output, input); - if (destinations.length === 0) { - throw createInvalidAccessError(); - } - } - // Bug #164: Only Firefox detects cycles so far. - for (const destination of destinations) { - const cycles = detectCycles([this], destination); - visitEachAudioNodeOnce(cycles, decrementCycleCounter); - } - } - }; -}; - -const createAudioParamFactory = (addAudioParamConnections, audioParamAudioNodeStore, audioParamStore, createAudioParamRenderer, createCancelAndHoldAutomationEvent, createCancelScheduledValuesAutomationEvent, createExponentialRampToValueAutomationEvent, createLinearRampToValueAutomationEvent, createSetTargetAutomationEvent, createSetValueAutomationEvent, createSetValueCurveAutomationEvent, nativeAudioContextConstructor, setValueAtTimeUntilPossible) => { - return (audioNode, isAudioParamOfOfflineAudioContext, nativeAudioParam, maxValue = null, minValue = null) => { - const automationEventList = new AutomationEventList(nativeAudioParam.defaultValue); - const audioParamRenderer = isAudioParamOfOfflineAudioContext ? createAudioParamRenderer(automationEventList) : null; - const audioParam = { - get defaultValue() { - return nativeAudioParam.defaultValue; - }, - get maxValue() { - return maxValue === null ? nativeAudioParam.maxValue : maxValue; - }, - get minValue() { - return minValue === null ? nativeAudioParam.minValue : minValue; - }, - get value() { - return nativeAudioParam.value; - }, - set value(value) { - nativeAudioParam.value = value; - // Bug #98: Firefox & Safari do not yet treat the value setter like a call to setValueAtTime(). - audioParam.setValueAtTime(value, audioNode.context.currentTime); - }, - cancelAndHoldAtTime(cancelTime) { - // Bug #28: Firefox & Safari do not yet implement cancelAndHoldAtTime(). - if (typeof nativeAudioParam.cancelAndHoldAtTime === 'function') { - if (audioParamRenderer === null) { - automationEventList.flush(audioNode.context.currentTime); - } - automationEventList.add(createCancelAndHoldAutomationEvent(cancelTime)); - nativeAudioParam.cancelAndHoldAtTime(cancelTime); - } - else { - const previousLastEvent = Array.from(automationEventList).pop(); - if (audioParamRenderer === null) { - automationEventList.flush(audioNode.context.currentTime); - } - automationEventList.add(createCancelAndHoldAutomationEvent(cancelTime)); - const currentLastEvent = Array.from(automationEventList).pop(); - nativeAudioParam.cancelScheduledValues(cancelTime); - if (previousLastEvent !== currentLastEvent && currentLastEvent !== undefined) { - if (currentLastEvent.type === 'exponentialRampToValue') { - nativeAudioParam.exponentialRampToValueAtTime(currentLastEvent.value, currentLastEvent.endTime); - } - else if (currentLastEvent.type === 'linearRampToValue') { - nativeAudioParam.linearRampToValueAtTime(currentLastEvent.value, currentLastEvent.endTime); - } - else if (currentLastEvent.type === 'setValue') { - nativeAudioParam.setValueAtTime(currentLastEvent.value, currentLastEvent.startTime); - } - else if (currentLastEvent.type === 'setValueCurve') { - nativeAudioParam.setValueCurveAtTime(currentLastEvent.values, currentLastEvent.startTime, currentLastEvent.duration); - } - } - } - return audioParam; - }, - cancelScheduledValues(cancelTime) { - if (audioParamRenderer === null) { - automationEventList.flush(audioNode.context.currentTime); - } - automationEventList.add(createCancelScheduledValuesAutomationEvent(cancelTime)); - nativeAudioParam.cancelScheduledValues(cancelTime); - return audioParam; - }, - exponentialRampToValueAtTime(value, endTime) { - // Bug #45: Safari does not throw an error yet. - if (value === 0) { - throw new RangeError(); - } - // Bug #187: Safari does not throw an error yet. - if (!Number.isFinite(endTime) || endTime < 0) { - throw new RangeError(); - } - if (audioParamRenderer === null) { - automationEventList.flush(audioNode.context.currentTime); - } - automationEventList.add(createExponentialRampToValueAutomationEvent(value, endTime)); - nativeAudioParam.exponentialRampToValueAtTime(value, endTime); - return audioParam; - }, - linearRampToValueAtTime(value, endTime) { - if (audioParamRenderer === null) { - automationEventList.flush(audioNode.context.currentTime); - } - automationEventList.add(createLinearRampToValueAutomationEvent(value, endTime)); - nativeAudioParam.linearRampToValueAtTime(value, endTime); - return audioParam; - }, - setTargetAtTime(target, startTime, timeConstant) { - if (audioParamRenderer === null) { - automationEventList.flush(audioNode.context.currentTime); - } - automationEventList.add(createSetTargetAutomationEvent(target, startTime, timeConstant)); - nativeAudioParam.setTargetAtTime(target, startTime, timeConstant); - return audioParam; - }, - setValueAtTime(value, startTime) { - if (audioParamRenderer === null) { - automationEventList.flush(audioNode.context.currentTime); - } - automationEventList.add(createSetValueAutomationEvent(value, startTime)); - nativeAudioParam.setValueAtTime(value, startTime); - return audioParam; - }, - setValueCurveAtTime(values, startTime, duration) { - // Bug 183: Safari only accepts a Float32Array. - const convertedValues = values instanceof Float32Array ? values : new Float32Array(values); - /* - * Bug #152: Safari does not correctly interpolate the values of the curve. - * @todo Unfortunately there is no way to test for this behavior in a synchronous fashion which is why testing for the - * existence of the webkitAudioContext is used as a workaround here. - */ - if (nativeAudioContextConstructor !== null && nativeAudioContextConstructor.name === 'webkitAudioContext') { - const endTime = startTime + duration; - const sampleRate = audioNode.context.sampleRate; - const firstSample = Math.ceil(startTime * sampleRate); - const lastSample = Math.floor(endTime * sampleRate); - const numberOfInterpolatedValues = lastSample - firstSample; - const interpolatedValues = new Float32Array(numberOfInterpolatedValues); - for (let i = 0; i < numberOfInterpolatedValues; i += 1) { - const theoreticIndex = ((convertedValues.length - 1) / duration) * ((firstSample + i) / sampleRate - startTime); - const lowerIndex = Math.floor(theoreticIndex); - const upperIndex = Math.ceil(theoreticIndex); - interpolatedValues[i] = - lowerIndex === upperIndex - ? convertedValues[lowerIndex] - : (1 - (theoreticIndex - lowerIndex)) * convertedValues[lowerIndex] + - (1 - (upperIndex - theoreticIndex)) * convertedValues[upperIndex]; - } - if (audioParamRenderer === null) { - automationEventList.flush(audioNode.context.currentTime); - } - automationEventList.add(createSetValueCurveAutomationEvent(interpolatedValues, startTime, duration)); - nativeAudioParam.setValueCurveAtTime(interpolatedValues, startTime, duration); - const timeOfLastSample = lastSample / sampleRate; - if (timeOfLastSample < endTime) { - setValueAtTimeUntilPossible(audioParam, interpolatedValues[interpolatedValues.length - 1], timeOfLastSample); - } - setValueAtTimeUntilPossible(audioParam, convertedValues[convertedValues.length - 1], endTime); - } - else { - if (audioParamRenderer === null) { - automationEventList.flush(audioNode.context.currentTime); - } - automationEventList.add(createSetValueCurveAutomationEvent(convertedValues, startTime, duration)); - nativeAudioParam.setValueCurveAtTime(convertedValues, startTime, duration); - } - return audioParam; - } - }; - audioParamStore.set(audioParam, nativeAudioParam); - audioParamAudioNodeStore.set(audioParam, audioNode); - addAudioParamConnections(audioParam, audioParamRenderer); - return audioParam; - }; -}; - -const createAudioParamRenderer = (automationEventList) => { - return { - replay(audioParam) { - for (const automationEvent of automationEventList) { - if (automationEvent.type === 'exponentialRampToValue') { - const { endTime, value } = automationEvent; - audioParam.exponentialRampToValueAtTime(value, endTime); - } - else if (automationEvent.type === 'linearRampToValue') { - const { endTime, value } = automationEvent; - audioParam.linearRampToValueAtTime(value, endTime); - } - else if (automationEvent.type === 'setTarget') { - const { startTime, target, timeConstant } = automationEvent; - audioParam.setTargetAtTime(target, startTime, timeConstant); - } - else if (automationEvent.type === 'setValue') { - const { startTime, value } = automationEvent; - audioParam.setValueAtTime(value, startTime); - } - else if (automationEvent.type === 'setValueCurve') { - const { duration, startTime, values } = automationEvent; - audioParam.setValueCurveAtTime(values, startTime, duration); - } - else { - throw new Error("Can't apply an unknown automation."); - } - } - } - }; -}; - -class ReadOnlyMap { - constructor(parameters) { - this._map = new Map(parameters); - } - get size() { - return this._map.size; - } - entries() { - return this._map.entries(); - } - forEach(callback, thisArg = null) { - return this._map.forEach((value, key) => callback.call(thisArg, value, key, this)); - } - get(name) { - return this._map.get(name); - } - has(name) { - return this._map.has(name); - } - keys() { - return this._map.keys(); - } - values() { - return this._map.values(); - } -} - -const DEFAULT_OPTIONS$3 = { - channelCount: 2, - // Bug #61: The channelCountMode should be 'max' according to the spec but is set to 'explicit' to achieve consistent behavior. - channelCountMode: 'explicit', - channelInterpretation: 'speakers', - numberOfInputs: 1, - numberOfOutputs: 1, - parameterData: {}, - processorOptions: {} -}; -const createAudioWorkletNodeConstructor = (addUnrenderedAudioWorkletNode, audioNodeConstructor, createAudioParam, createAudioWorkletNodeRenderer, createNativeAudioWorkletNode, getAudioNodeConnections, getBackupOfflineAudioContext, getNativeContext, isNativeOfflineAudioContext, nativeAudioWorkletNodeConstructor, sanitizeAudioWorkletNodeOptions, setActiveAudioWorkletNodeInputs, testAudioWorkletNodeOptionsClonability, wrapEventListener) => { - return class AudioWorkletNode extends audioNodeConstructor { - constructor(context, name, options) { - var _a; - const nativeContext = getNativeContext(context); - const isOffline = isNativeOfflineAudioContext(nativeContext); - const mergedOptions = sanitizeAudioWorkletNodeOptions({ ...DEFAULT_OPTIONS$3, ...options }); - // Bug #191: Safari doesn't throw an error if the options aren't clonable. - testAudioWorkletNodeOptionsClonability(mergedOptions); - const nodeNameToProcessorConstructorMap = NODE_NAME_TO_PROCESSOR_CONSTRUCTOR_MAPS.get(nativeContext); - const processorConstructor = nodeNameToProcessorConstructorMap === null || nodeNameToProcessorConstructorMap === void 0 ? void 0 : nodeNameToProcessorConstructorMap.get(name); - // Bug #186: Chrome, Edge and Opera do not allow to create an AudioWorkletNode on a closed AudioContext. - const nativeContextOrBackupOfflineAudioContext = isOffline || nativeContext.state !== 'closed' - ? nativeContext - : (_a = getBackupOfflineAudioContext(nativeContext)) !== null && _a !== void 0 ? _a : nativeContext; - const nativeAudioWorkletNode = createNativeAudioWorkletNode(nativeContextOrBackupOfflineAudioContext, isOffline ? null : context.baseLatency, nativeAudioWorkletNodeConstructor, name, processorConstructor, mergedOptions); - const audioWorkletNodeRenderer = ((isOffline ? createAudioWorkletNodeRenderer(name, mergedOptions, processorConstructor) : null)); - /* - * @todo Add a mechanism to switch an AudioWorkletNode to passive once the process() function of the AudioWorkletProcessor - * returns false. - */ - super(context, true, nativeAudioWorkletNode, audioWorkletNodeRenderer); - const parameters = []; - nativeAudioWorkletNode.parameters.forEach((nativeAudioParam, nm) => { - const audioParam = createAudioParam(this, isOffline, nativeAudioParam); - parameters.push([nm, audioParam]); - }); - this._nativeAudioWorkletNode = nativeAudioWorkletNode; - this._onprocessorerror = null; - this._parameters = new ReadOnlyMap(parameters); - /* - * Bug #86 & #87: Invoking the renderer of an AudioWorkletNode might be necessary if it has no direct or indirect connection to - * the destination. - */ - if (isOffline) { - addUnrenderedAudioWorkletNode(nativeContext, this); - } - const { activeInputs } = getAudioNodeConnections(this); - setActiveAudioWorkletNodeInputs(nativeAudioWorkletNode, activeInputs); - } - get onprocessorerror() { - return this._onprocessorerror; - } - set onprocessorerror(value) { - const wrappedListener = typeof value === 'function' ? wrapEventListener(this, value) : null; - this._nativeAudioWorkletNode.onprocessorerror = wrappedListener; - const nativeOnProcessorError = this._nativeAudioWorkletNode.onprocessorerror; - this._onprocessorerror = - nativeOnProcessorError !== null && nativeOnProcessorError === wrappedListener - ? value - : nativeOnProcessorError; - } - get parameters() { - if (this._parameters === null) { - // @todo The definition that TypeScript uses of the AudioParamMap is lacking many methods. - return this._nativeAudioWorkletNode.parameters; - } - return this._parameters; - } - get port() { - return this._nativeAudioWorkletNode.port; - } - }; -}; - -function copyFromChannel(audioBuffer, -// @todo There is currently no way to define something like { [ key: number | string ]: Float32Array } -parent, key, channelNumber, bufferOffset) { - if (typeof audioBuffer.copyFromChannel === 'function') { - // The byteLength will be 0 when the ArrayBuffer was transferred. - if (parent[key].byteLength === 0) { - parent[key] = new Float32Array(128); - } - audioBuffer.copyFromChannel(parent[key], channelNumber, bufferOffset); - // Bug #5: Safari does not support copyFromChannel(). - } - else { - const channelData = audioBuffer.getChannelData(channelNumber); - // The byteLength will be 0 when the ArrayBuffer was transferred. - if (parent[key].byteLength === 0) { - parent[key] = channelData.slice(bufferOffset, bufferOffset + 128); - } - else { - const slicedInput = new Float32Array(channelData.buffer, bufferOffset * Float32Array.BYTES_PER_ELEMENT, 128); - parent[key].set(slicedInput); - } - } -} - -const copyToChannel = (audioBuffer, parent, key, channelNumber, bufferOffset) => { - if (typeof audioBuffer.copyToChannel === 'function') { - // The byteLength will be 0 when the ArrayBuffer was transferred. - if (parent[key].byteLength !== 0) { - audioBuffer.copyToChannel(parent[key], channelNumber, bufferOffset); - } - // Bug #5: Safari does not support copyToChannel(). - } - else { - // The byteLength will be 0 when the ArrayBuffer was transferred. - if (parent[key].byteLength !== 0) { - audioBuffer.getChannelData(channelNumber).set(parent[key], bufferOffset); - } - } -}; - -const createNestedArrays = (x, y) => { - const arrays = []; - for (let i = 0; i < x; i += 1) { - const array = []; - const length = typeof y === 'number' ? y : y[i]; - for (let j = 0; j < length; j += 1) { - array.push(new Float32Array(128)); - } - arrays.push(array); - } - return arrays; -}; - -const getAudioWorkletProcessor = (nativeOfflineAudioContext, proxy) => { - const nodeToProcessorMap = getValueForKey(NODE_TO_PROCESSOR_MAPS, nativeOfflineAudioContext); - const nativeAudioWorkletNode = getNativeAudioNode(proxy); - return getValueForKey(nodeToProcessorMap, nativeAudioWorkletNode); -}; - -const processBuffer = async (proxy, renderedBuffer, nativeOfflineAudioContext, options, outputChannelCount, processorConstructor, exposeCurrentFrameAndCurrentTime) => { - // Ceil the length to the next full render quantum. - // Bug #17: Safari does not yet expose the length. - const length = renderedBuffer === null ? Math.ceil(proxy.context.length / 128) * 128 : renderedBuffer.length; - const numberOfInputChannels = options.channelCount * options.numberOfInputs; - const numberOfOutputChannels = outputChannelCount.reduce((sum, value) => sum + value, 0); - const processedBuffer = numberOfOutputChannels === 0 - ? null - : nativeOfflineAudioContext.createBuffer(numberOfOutputChannels, length, nativeOfflineAudioContext.sampleRate); - if (processorConstructor === undefined) { - throw new Error('Missing the processor constructor.'); - } - const audioNodeConnections = getAudioNodeConnections(proxy); - const audioWorkletProcessor = await getAudioWorkletProcessor(nativeOfflineAudioContext, proxy); - const inputs = createNestedArrays(options.numberOfInputs, options.channelCount); - const outputs = createNestedArrays(options.numberOfOutputs, outputChannelCount); - const parameters = Array.from(proxy.parameters.keys()).reduce((prmtrs, name) => ({ ...prmtrs, [name]: new Float32Array(128) }), {}); - for (let i = 0; i < length; i += 128) { - if (options.numberOfInputs > 0 && renderedBuffer !== null) { - for (let j = 0; j < options.numberOfInputs; j += 1) { - for (let k = 0; k < options.channelCount; k += 1) { - copyFromChannel(renderedBuffer, inputs[j], k, k, i); - } - } - } - if (processorConstructor.parameterDescriptors !== undefined && renderedBuffer !== null) { - processorConstructor.parameterDescriptors.forEach(({ name }, index) => { - copyFromChannel(renderedBuffer, parameters, name, numberOfInputChannels + index, i); - }); - } - for (let j = 0; j < options.numberOfInputs; j += 1) { - for (let k = 0; k < outputChannelCount[j]; k += 1) { - // The byteLength will be 0 when the ArrayBuffer was transferred. - if (outputs[j][k].byteLength === 0) { - outputs[j][k] = new Float32Array(128); - } - } - } - try { - const potentiallyEmptyInputs = inputs.map((input, index) => { - if (audioNodeConnections.activeInputs[index].size === 0) { - return []; - } - return input; - }); - const activeSourceFlag = exposeCurrentFrameAndCurrentTime(i / nativeOfflineAudioContext.sampleRate, nativeOfflineAudioContext.sampleRate, () => audioWorkletProcessor.process(potentiallyEmptyInputs, outputs, parameters)); - if (processedBuffer !== null) { - for (let j = 0, outputChannelSplitterNodeOutput = 0; j < options.numberOfOutputs; j += 1) { - for (let k = 0; k < outputChannelCount[j]; k += 1) { - copyToChannel(processedBuffer, outputs[j], k, outputChannelSplitterNodeOutput + k, i); - } - outputChannelSplitterNodeOutput += outputChannelCount[j]; - } - } - if (!activeSourceFlag) { - break; - } - } - catch (error) { - proxy.dispatchEvent(new ErrorEvent('processorerror', { - colno: error.colno, - filename: error.filename, - lineno: error.lineno, - message: error.message - })); - break; - } - } - return processedBuffer; -}; -const createAudioWorkletNodeRendererFactory = (connectAudioParam, connectMultipleOutputs, createNativeAudioBufferSourceNode, createNativeChannelMergerNode, createNativeChannelSplitterNode, createNativeConstantSourceNode, createNativeGainNode, deleteUnrenderedAudioWorkletNode, disconnectMultipleOutputs, exposeCurrentFrameAndCurrentTime, getNativeAudioNode, nativeAudioWorkletNodeConstructor, nativeOfflineAudioContextConstructor, renderAutomation, renderInputsOfAudioNode, renderNativeOfflineAudioContext) => { - return (name, options, processorConstructor) => { - const renderedNativeAudioNodes = new WeakMap(); - let processedBufferPromise = null; - const createAudioNode = async (proxy, nativeOfflineAudioContext) => { - let nativeAudioWorkletNode = getNativeAudioNode(proxy); - let nativeOutputNodes = null; - const nativeAudioWorkletNodeIsOwnedByContext = isOwnedByContext(nativeAudioWorkletNode, nativeOfflineAudioContext); - const outputChannelCount = Array.isArray(options.outputChannelCount) - ? options.outputChannelCount - : Array.from(options.outputChannelCount); - // Bug #61: Only Chrome, Edge, Firefox & Opera have an implementation of the AudioWorkletNode yet. - if (nativeAudioWorkletNodeConstructor === null) { - const numberOfOutputChannels = outputChannelCount.reduce((sum, value) => sum + value, 0); - const outputChannelSplitterNode = createNativeChannelSplitterNode(nativeOfflineAudioContext, { - channelCount: Math.max(1, numberOfOutputChannels), - channelCountMode: 'explicit', - channelInterpretation: 'discrete', - numberOfOutputs: Math.max(1, numberOfOutputChannels) - }); - const outputChannelMergerNodes = []; - for (let i = 0; i < proxy.numberOfOutputs; i += 1) { - outputChannelMergerNodes.push(createNativeChannelMergerNode(nativeOfflineAudioContext, { - channelCount: 1, - channelCountMode: 'explicit', - channelInterpretation: 'speakers', - numberOfInputs: outputChannelCount[i] - })); - } - const outputGainNode = createNativeGainNode(nativeOfflineAudioContext, { - channelCount: options.channelCount, - channelCountMode: options.channelCountMode, - channelInterpretation: options.channelInterpretation, - gain: 1 - }); - outputGainNode.connect = connectMultipleOutputs.bind(null, outputChannelMergerNodes); - outputGainNode.disconnect = disconnectMultipleOutputs.bind(null, outputChannelMergerNodes); - nativeOutputNodes = [outputChannelSplitterNode, outputChannelMergerNodes, outputGainNode]; - } - else if (!nativeAudioWorkletNodeIsOwnedByContext) { - nativeAudioWorkletNode = new nativeAudioWorkletNodeConstructor(nativeOfflineAudioContext, name); - } - renderedNativeAudioNodes.set(nativeOfflineAudioContext, nativeOutputNodes === null ? nativeAudioWorkletNode : nativeOutputNodes[2]); - if (nativeOutputNodes !== null) { - if (processedBufferPromise === null) { - if (processorConstructor === undefined) { - throw new Error('Missing the processor constructor.'); - } - if (nativeOfflineAudioContextConstructor === null) { - throw new Error('Missing the native OfflineAudioContext constructor.'); - } - // Bug #47: The AudioDestinationNode in Safari gets not initialized correctly. - const numberOfInputChannels = proxy.channelCount * proxy.numberOfInputs; - const numberOfParameters = processorConstructor.parameterDescriptors === undefined ? 0 : processorConstructor.parameterDescriptors.length; - const numberOfChannels = numberOfInputChannels + numberOfParameters; - const renderBuffer = async () => { - const partialOfflineAudioContext = new nativeOfflineAudioContextConstructor(numberOfChannels, - // Ceil the length to the next full render quantum. - // Bug #17: Safari does not yet expose the length. - Math.ceil(proxy.context.length / 128) * 128, nativeOfflineAudioContext.sampleRate); - const gainNodes = []; - const inputChannelSplitterNodes = []; - for (let i = 0; i < options.numberOfInputs; i += 1) { - gainNodes.push(createNativeGainNode(partialOfflineAudioContext, { - channelCount: options.channelCount, - channelCountMode: options.channelCountMode, - channelInterpretation: options.channelInterpretation, - gain: 1 - })); - inputChannelSplitterNodes.push(createNativeChannelSplitterNode(partialOfflineAudioContext, { - channelCount: options.channelCount, - channelCountMode: 'explicit', - channelInterpretation: 'discrete', - numberOfOutputs: options.channelCount - })); - } - const constantSourceNodes = await Promise.all(Array.from(proxy.parameters.values()).map(async (audioParam) => { - const constantSourceNode = createNativeConstantSourceNode(partialOfflineAudioContext, { - channelCount: 1, - channelCountMode: 'explicit', - channelInterpretation: 'discrete', - offset: audioParam.value - }); - await renderAutomation(partialOfflineAudioContext, audioParam, constantSourceNode.offset); - return constantSourceNode; - })); - const inputChannelMergerNode = createNativeChannelMergerNode(partialOfflineAudioContext, { - channelCount: 1, - channelCountMode: 'explicit', - channelInterpretation: 'speakers', - numberOfInputs: Math.max(1, numberOfInputChannels + numberOfParameters) - }); - for (let i = 0; i < options.numberOfInputs; i += 1) { - gainNodes[i].connect(inputChannelSplitterNodes[i]); - for (let j = 0; j < options.channelCount; j += 1) { - inputChannelSplitterNodes[i].connect(inputChannelMergerNode, j, i * options.channelCount + j); - } - } - for (const [index, constantSourceNode] of constantSourceNodes.entries()) { - constantSourceNode.connect(inputChannelMergerNode, 0, numberOfInputChannels + index); - constantSourceNode.start(0); - } - inputChannelMergerNode.connect(partialOfflineAudioContext.destination); - await Promise.all(gainNodes.map((gainNode) => renderInputsOfAudioNode(proxy, partialOfflineAudioContext, gainNode))); - return renderNativeOfflineAudioContext(partialOfflineAudioContext); - }; - processedBufferPromise = processBuffer(proxy, numberOfChannels === 0 ? null : await renderBuffer(), nativeOfflineAudioContext, options, outputChannelCount, processorConstructor, exposeCurrentFrameAndCurrentTime); - } - const processedBuffer = await processedBufferPromise; - const audioBufferSourceNode = createNativeAudioBufferSourceNode(nativeOfflineAudioContext, { - buffer: null, - channelCount: 2, - channelCountMode: 'max', - channelInterpretation: 'speakers', - loop: false, - loopEnd: 0, - loopStart: 0, - playbackRate: 1 - }); - const [outputChannelSplitterNode, outputChannelMergerNodes, outputGainNode] = nativeOutputNodes; - if (processedBuffer !== null) { - audioBufferSourceNode.buffer = processedBuffer; - audioBufferSourceNode.start(0); - } - audioBufferSourceNode.connect(outputChannelSplitterNode); - for (let i = 0, outputChannelSplitterNodeOutput = 0; i < proxy.numberOfOutputs; i += 1) { - const outputChannelMergerNode = outputChannelMergerNodes[i]; - for (let j = 0; j < outputChannelCount[i]; j += 1) { - outputChannelSplitterNode.connect(outputChannelMergerNode, outputChannelSplitterNodeOutput + j, j); - } - outputChannelSplitterNodeOutput += outputChannelCount[i]; - } - return outputGainNode; - } - if (!nativeAudioWorkletNodeIsOwnedByContext) { - for (const [nm, audioParam] of proxy.parameters.entries()) { - await renderAutomation(nativeOfflineAudioContext, audioParam, - // @todo The definition that TypeScript uses of the AudioParamMap is lacking many methods. - nativeAudioWorkletNode.parameters.get(nm)); - } - } - else { - for (const [nm, audioParam] of proxy.parameters.entries()) { - await connectAudioParam(nativeOfflineAudioContext, audioParam, - // @todo The definition that TypeScript uses of the AudioParamMap is lacking many methods. - nativeAudioWorkletNode.parameters.get(nm)); - } - } - await renderInputsOfAudioNode(proxy, nativeOfflineAudioContext, nativeAudioWorkletNode); - return nativeAudioWorkletNode; - }; - return { - render(proxy, nativeOfflineAudioContext) { - deleteUnrenderedAudioWorkletNode(nativeOfflineAudioContext, proxy); - const renderedNativeAudioWorkletNodeOrGainNode = renderedNativeAudioNodes.get(nativeOfflineAudioContext); - if (renderedNativeAudioWorkletNodeOrGainNode !== undefined) { - return Promise.resolve(renderedNativeAudioWorkletNodeOrGainNode); - } - return createAudioNode(proxy, nativeOfflineAudioContext); - } - }; - }; -}; - -const createBaseAudioContextConstructor = (addAudioWorkletModule, analyserNodeConstructor, audioBufferConstructor, audioBufferSourceNodeConstructor, biquadFilterNodeConstructor, channelMergerNodeConstructor, channelSplitterNodeConstructor, constantSourceNodeConstructor, convolverNodeConstructor, decodeAudioData, delayNodeConstructor, dynamicsCompressorNodeConstructor, gainNodeConstructor, iIRFilterNodeConstructor, minimalBaseAudioContextConstructor, oscillatorNodeConstructor, pannerNodeConstructor, periodicWaveConstructor, stereoPannerNodeConstructor, waveShaperNodeConstructor) => { - return class BaseAudioContext extends minimalBaseAudioContextConstructor { - constructor(_nativeContext, numberOfChannels) { - super(_nativeContext, numberOfChannels); - this._nativeContext = _nativeContext; - this._audioWorklet = - addAudioWorkletModule === undefined - ? undefined - : { - addModule: (moduleURL, options) => { - return addAudioWorkletModule(this, moduleURL, options); - } - }; - } - get audioWorklet() { - return this._audioWorklet; - } - createAnalyser() { - return new analyserNodeConstructor(this); - } - createBiquadFilter() { - return new biquadFilterNodeConstructor(this); - } - createBuffer(numberOfChannels, length, sampleRate) { - return new audioBufferConstructor({ length, numberOfChannels, sampleRate }); - } - createBufferSource() { - return new audioBufferSourceNodeConstructor(this); - } - createChannelMerger(numberOfInputs = 6) { - return new channelMergerNodeConstructor(this, { numberOfInputs }); - } - createChannelSplitter(numberOfOutputs = 6) { - return new channelSplitterNodeConstructor(this, { numberOfOutputs }); - } - createConstantSource() { - return new constantSourceNodeConstructor(this); - } - createConvolver() { - return new convolverNodeConstructor(this); - } - createDelay(maxDelayTime = 1) { - return new delayNodeConstructor(this, { maxDelayTime }); - } - createDynamicsCompressor() { - return new dynamicsCompressorNodeConstructor(this); - } - createGain() { - return new gainNodeConstructor(this); - } - createIIRFilter(feedforward, feedback) { - return new iIRFilterNodeConstructor(this, { feedback, feedforward }); - } - createOscillator() { - return new oscillatorNodeConstructor(this); - } - createPanner() { - return new pannerNodeConstructor(this); - } - createPeriodicWave(real, imag, constraints = { disableNormalization: false }) { - return new periodicWaveConstructor(this, { ...constraints, imag, real }); - } - createStereoPanner() { - return new stereoPannerNodeConstructor(this); - } - createWaveShaper() { - return new waveShaperNodeConstructor(this); - } - decodeAudioData(audioData, successCallback, errorCallback) { - return decodeAudioData(this._nativeContext, audioData).then((audioBuffer) => { - if (typeof successCallback === 'function') { - successCallback(audioBuffer); - } - return audioBuffer; - }, (err) => { - if (typeof errorCallback === 'function') { - errorCallback(err); - } - throw err; - }); - } - }; -}; - -const DEFAULT_OPTIONS$4 = { - Q: 1, - channelCount: 2, - channelCountMode: 'max', - channelInterpretation: 'speakers', - detune: 0, - frequency: 350, - gain: 0, - type: 'lowpass' -}; -const createBiquadFilterNodeConstructor = (audioNodeConstructor, createAudioParam, createBiquadFilterNodeRenderer, createInvalidAccessError, createNativeBiquadFilterNode, getNativeContext, isNativeOfflineAudioContext, setAudioNodeTailTime) => { - return class BiquadFilterNode extends audioNodeConstructor { - constructor(context, options) { - const nativeContext = getNativeContext(context); - const mergedOptions = { ...DEFAULT_OPTIONS$4, ...options }; - const nativeBiquadFilterNode = createNativeBiquadFilterNode(nativeContext, mergedOptions); - const isOffline = isNativeOfflineAudioContext(nativeContext); - const biquadFilterNodeRenderer = (isOffline ? createBiquadFilterNodeRenderer() : null); - super(context, false, nativeBiquadFilterNode, biquadFilterNodeRenderer); - // Bug #80: Safari does not export the correct values for maxValue and minValue. - this._Q = createAudioParam(this, isOffline, nativeBiquadFilterNode.Q, MOST_POSITIVE_SINGLE_FLOAT, MOST_NEGATIVE_SINGLE_FLOAT); - // Bug #78: Firefox & Safari do not export the correct values for maxValue and minValue. - this._detune = createAudioParam(this, isOffline, nativeBiquadFilterNode.detune, 1200 * Math.log2(MOST_POSITIVE_SINGLE_FLOAT), -1200 * Math.log2(MOST_POSITIVE_SINGLE_FLOAT)); - // Bug #77: Firefox & Safari do not export the correct value for minValue. - this._frequency = createAudioParam(this, isOffline, nativeBiquadFilterNode.frequency, context.sampleRate / 2, 0); - // Bug #79: Firefox & Safari do not export the correct values for maxValue and minValue. - this._gain = createAudioParam(this, isOffline, nativeBiquadFilterNode.gain, 40 * Math.log10(MOST_POSITIVE_SINGLE_FLOAT), MOST_NEGATIVE_SINGLE_FLOAT); - this._nativeBiquadFilterNode = nativeBiquadFilterNode; - // @todo Determine a meaningful tail-time instead of just using one second. - setAudioNodeTailTime(this, 1); - } - get detune() { - return this._detune; - } - get frequency() { - return this._frequency; - } - get gain() { - return this._gain; - } - get Q() { - return this._Q; - } - get type() { - return this._nativeBiquadFilterNode.type; - } - set type(value) { - this._nativeBiquadFilterNode.type = value; - } - getFrequencyResponse(frequencyHz, magResponse, phaseResponse) { - // Bug #189: Safari does throw an InvalidStateError. - try { - this._nativeBiquadFilterNode.getFrequencyResponse(frequencyHz, magResponse, phaseResponse); - } - catch (err) { - if (err.code === 11) { - throw createInvalidAccessError(); - } - throw err; - } - // Bug #68: Safari does not throw an error if the parameters differ in their length. - if (frequencyHz.length !== magResponse.length || magResponse.length !== phaseResponse.length) { - throw createInvalidAccessError(); - } - } - }; -}; - -const createBiquadFilterNodeRendererFactory = (connectAudioParam, createNativeBiquadFilterNode, getNativeAudioNode, renderAutomation, renderInputsOfAudioNode) => { - return () => { - const renderedNativeBiquadFilterNodes = new WeakMap(); - const createBiquadFilterNode = async (proxy, nativeOfflineAudioContext) => { - let nativeBiquadFilterNode = getNativeAudioNode(proxy); - /* - * If the initially used nativeBiquadFilterNode was not constructed on the same OfflineAudioContext it needs to be created - * again. - */ - const nativeBiquadFilterNodeIsOwnedByContext = isOwnedByContext(nativeBiquadFilterNode, nativeOfflineAudioContext); - if (!nativeBiquadFilterNodeIsOwnedByContext) { - const options = { - Q: nativeBiquadFilterNode.Q.value, - channelCount: nativeBiquadFilterNode.channelCount, - channelCountMode: nativeBiquadFilterNode.channelCountMode, - channelInterpretation: nativeBiquadFilterNode.channelInterpretation, - detune: nativeBiquadFilterNode.detune.value, - frequency: nativeBiquadFilterNode.frequency.value, - gain: nativeBiquadFilterNode.gain.value, - type: nativeBiquadFilterNode.type - }; - nativeBiquadFilterNode = createNativeBiquadFilterNode(nativeOfflineAudioContext, options); - } - renderedNativeBiquadFilterNodes.set(nativeOfflineAudioContext, nativeBiquadFilterNode); - if (!nativeBiquadFilterNodeIsOwnedByContext) { - await renderAutomation(nativeOfflineAudioContext, proxy.Q, nativeBiquadFilterNode.Q); - await renderAutomation(nativeOfflineAudioContext, proxy.detune, nativeBiquadFilterNode.detune); - await renderAutomation(nativeOfflineAudioContext, proxy.frequency, nativeBiquadFilterNode.frequency); - await renderAutomation(nativeOfflineAudioContext, proxy.gain, nativeBiquadFilterNode.gain); - } - else { - await connectAudioParam(nativeOfflineAudioContext, proxy.Q, nativeBiquadFilterNode.Q); - await connectAudioParam(nativeOfflineAudioContext, proxy.detune, nativeBiquadFilterNode.detune); - await connectAudioParam(nativeOfflineAudioContext, proxy.frequency, nativeBiquadFilterNode.frequency); - await connectAudioParam(nativeOfflineAudioContext, proxy.gain, nativeBiquadFilterNode.gain); - } - await renderInputsOfAudioNode(proxy, nativeOfflineAudioContext, nativeBiquadFilterNode); - return nativeBiquadFilterNode; - }; - return { - render(proxy, nativeOfflineAudioContext) { - const renderedNativeBiquadFilterNode = renderedNativeBiquadFilterNodes.get(nativeOfflineAudioContext); - if (renderedNativeBiquadFilterNode !== undefined) { - return Promise.resolve(renderedNativeBiquadFilterNode); - } - return createBiquadFilterNode(proxy, nativeOfflineAudioContext); - } - }; - }; -}; - -const createCacheTestResult = (ongoingTests, testResults) => { - return (tester, test) => { - const cachedTestResult = testResults.get(tester); - if (cachedTestResult !== undefined) { - return cachedTestResult; - } - const ongoingTest = ongoingTests.get(tester); - if (ongoingTest !== undefined) { - return ongoingTest; - } - try { - const synchronousTestResult = test(); - if (synchronousTestResult instanceof Promise) { - ongoingTests.set(tester, synchronousTestResult); - return synchronousTestResult - .catch(() => false) - .then((finalTestResult) => { - ongoingTests.delete(tester); - testResults.set(tester, finalTestResult); - return finalTestResult; - }); - } - testResults.set(tester, synchronousTestResult); - return synchronousTestResult; - } - catch { - testResults.set(tester, false); - return false; - } - }; -}; - -const DEFAULT_OPTIONS$5 = { - channelCount: 1, - channelCountMode: 'explicit', - channelInterpretation: 'speakers', - numberOfInputs: 6 -}; -const createChannelMergerNodeConstructor = (audioNodeConstructor, createChannelMergerNodeRenderer, createNativeChannelMergerNode, getNativeContext, isNativeOfflineAudioContext) => { - return class ChannelMergerNode extends audioNodeConstructor { - constructor(context, options) { - const nativeContext = getNativeContext(context); - const mergedOptions = { ...DEFAULT_OPTIONS$5, ...options }; - const nativeChannelMergerNode = createNativeChannelMergerNode(nativeContext, mergedOptions); - const channelMergerNodeRenderer = ((isNativeOfflineAudioContext(nativeContext) ? createChannelMergerNodeRenderer() : null)); - super(context, false, nativeChannelMergerNode, channelMergerNodeRenderer); - } - }; -}; - -const createChannelMergerNodeRendererFactory = (createNativeChannelMergerNode, getNativeAudioNode, renderInputsOfAudioNode) => { - return () => { - const renderedNativeAudioNodes = new WeakMap(); - const createAudioNode = async (proxy, nativeOfflineAudioContext) => { - let nativeAudioNode = getNativeAudioNode(proxy); - // If the initially used nativeAudioNode was not constructed on the same OfflineAudioContext it needs to be created again. - const nativeAudioNodeIsOwnedByContext = isOwnedByContext(nativeAudioNode, nativeOfflineAudioContext); - if (!nativeAudioNodeIsOwnedByContext) { - const options = { - channelCount: nativeAudioNode.channelCount, - channelCountMode: nativeAudioNode.channelCountMode, - channelInterpretation: nativeAudioNode.channelInterpretation, - numberOfInputs: nativeAudioNode.numberOfInputs - }; - nativeAudioNode = createNativeChannelMergerNode(nativeOfflineAudioContext, options); - } - renderedNativeAudioNodes.set(nativeOfflineAudioContext, nativeAudioNode); - await renderInputsOfAudioNode(proxy, nativeOfflineAudioContext, nativeAudioNode); - return nativeAudioNode; - }; - return { - render(proxy, nativeOfflineAudioContext) { - const renderedNativeAudioNode = renderedNativeAudioNodes.get(nativeOfflineAudioContext); - if (renderedNativeAudioNode !== undefined) { - return Promise.resolve(renderedNativeAudioNode); - } - return createAudioNode(proxy, nativeOfflineAudioContext); - } - }; - }; -}; - -const DEFAULT_OPTIONS$6 = { - channelCount: 6, - channelCountMode: 'explicit', - channelInterpretation: 'discrete', - numberOfOutputs: 6 -}; -const createChannelSplitterNodeConstructor = (audioNodeConstructor, createChannelSplitterNodeRenderer, createNativeChannelSplitterNode, getNativeContext, isNativeOfflineAudioContext, sanitizeChannelSplitterOptions) => { - return class ChannelSplitterNode extends audioNodeConstructor { - constructor(context, options) { - const nativeContext = getNativeContext(context); - const mergedOptions = sanitizeChannelSplitterOptions({ ...DEFAULT_OPTIONS$6, ...options }); - const nativeChannelSplitterNode = createNativeChannelSplitterNode(nativeContext, mergedOptions); - const channelSplitterNodeRenderer = ((isNativeOfflineAudioContext(nativeContext) ? createChannelSplitterNodeRenderer() : null)); - super(context, false, nativeChannelSplitterNode, channelSplitterNodeRenderer); - } - }; -}; - -const createChannelSplitterNodeRendererFactory = (createNativeChannelSplitterNode, getNativeAudioNode, renderInputsOfAudioNode) => { - return () => { - const renderedNativeAudioNodes = new WeakMap(); - const createAudioNode = async (proxy, nativeOfflineAudioContext) => { - let nativeAudioNode = getNativeAudioNode(proxy); - // If the initially used nativeAudioNode was not constructed on the same OfflineAudioContext it needs to be created again. - const nativeAudioNodeIsOwnedByContext = isOwnedByContext(nativeAudioNode, nativeOfflineAudioContext); - if (!nativeAudioNodeIsOwnedByContext) { - const options = { - channelCount: nativeAudioNode.channelCount, - channelCountMode: nativeAudioNode.channelCountMode, - channelInterpretation: nativeAudioNode.channelInterpretation, - numberOfOutputs: nativeAudioNode.numberOfOutputs - }; - nativeAudioNode = createNativeChannelSplitterNode(nativeOfflineAudioContext, options); - } - renderedNativeAudioNodes.set(nativeOfflineAudioContext, nativeAudioNode); - await renderInputsOfAudioNode(proxy, nativeOfflineAudioContext, nativeAudioNode); - return nativeAudioNode; - }; - return { - render(proxy, nativeOfflineAudioContext) { - const renderedNativeAudioNode = renderedNativeAudioNodes.get(nativeOfflineAudioContext); - if (renderedNativeAudioNode !== undefined) { - return Promise.resolve(renderedNativeAudioNode); - } - return createAudioNode(proxy, nativeOfflineAudioContext); - } - }; - }; -}; - -const createConnectAudioParam = (renderInputsOfAudioParam) => { - return (nativeOfflineAudioContext, audioParam, nativeAudioParam) => { - return renderInputsOfAudioParam(audioParam, nativeOfflineAudioContext, nativeAudioParam); - }; -}; - -const createConnectMultipleOutputs = (createIndexSizeError) => { - return (outputAudioNodes, destination, output = 0, input = 0) => { - const outputAudioNode = outputAudioNodes[output]; - if (outputAudioNode === undefined) { - throw createIndexSizeError(); - } - if (isNativeAudioNode(destination)) { - return outputAudioNode.connect(destination, 0, input); - } - return outputAudioNode.connect(destination, 0); - }; -}; - -const createConnectedNativeAudioBufferSourceNodeFactory = (createNativeAudioBufferSourceNode) => { - return (nativeContext, nativeAudioNode) => { - const nativeAudioBufferSourceNode = createNativeAudioBufferSourceNode(nativeContext, { - buffer: null, - channelCount: 2, - channelCountMode: 'max', - channelInterpretation: 'speakers', - loop: false, - loopEnd: 0, - loopStart: 0, - playbackRate: 1 - }); - const nativeAudioBuffer = nativeContext.createBuffer(1, 2, 44100); - nativeAudioBufferSourceNode.buffer = nativeAudioBuffer; - nativeAudioBufferSourceNode.loop = true; - nativeAudioBufferSourceNode.connect(nativeAudioNode); - nativeAudioBufferSourceNode.start(); - return () => { - nativeAudioBufferSourceNode.stop(); - nativeAudioBufferSourceNode.disconnect(nativeAudioNode); - }; - }; -}; - -const DEFAULT_OPTIONS$7 = { - channelCount: 2, - channelCountMode: 'max', - channelInterpretation: 'speakers', - offset: 1 -}; -const createConstantSourceNodeConstructor = (audioNodeConstructor, createAudioParam, createConstantSourceNodeRendererFactory, createNativeConstantSourceNode, getNativeContext, isNativeOfflineAudioContext, wrapEventListener) => { - return class ConstantSourceNode extends audioNodeConstructor { - constructor(context, options) { - const nativeContext = getNativeContext(context); - const mergedOptions = { ...DEFAULT_OPTIONS$7, ...options }; - const nativeConstantSourceNode = createNativeConstantSourceNode(nativeContext, mergedOptions); - const isOffline = isNativeOfflineAudioContext(nativeContext); - const constantSourceNodeRenderer = ((isOffline ? createConstantSourceNodeRendererFactory() : null)); - super(context, false, nativeConstantSourceNode, constantSourceNodeRenderer); - this._constantSourceNodeRenderer = constantSourceNodeRenderer; - this._nativeConstantSourceNode = nativeConstantSourceNode; - /* - * Bug #62 & #74: Safari does not support ConstantSourceNodes and does not export the correct values for maxValue and minValue - * for GainNodes. - */ - this._offset = createAudioParam(this, isOffline, nativeConstantSourceNode.offset, MOST_POSITIVE_SINGLE_FLOAT, MOST_NEGATIVE_SINGLE_FLOAT); - this._onended = null; - } - get offset() { - return this._offset; - } - get onended() { - return this._onended; - } - set onended(value) { - const wrappedListener = typeof value === 'function' ? wrapEventListener(this, value) : null; - this._nativeConstantSourceNode.onended = wrappedListener; - const nativeOnEnded = this._nativeConstantSourceNode.onended; - this._onended = nativeOnEnded !== null && nativeOnEnded === wrappedListener ? value : nativeOnEnded; - } - start(when = 0) { - this._nativeConstantSourceNode.start(when); - if (this._constantSourceNodeRenderer !== null) { - this._constantSourceNodeRenderer.start = when; - } - if (this.context.state !== 'closed') { - setInternalStateToActive(this); - const resetInternalStateToPassive = () => { - this._nativeConstantSourceNode.removeEventListener('ended', resetInternalStateToPassive); - if (isActiveAudioNode(this)) { - setInternalStateToPassive(this); - } - }; - this._nativeConstantSourceNode.addEventListener('ended', resetInternalStateToPassive); - } - } - stop(when = 0) { - this._nativeConstantSourceNode.stop(when); - if (this._constantSourceNodeRenderer !== null) { - this._constantSourceNodeRenderer.stop = when; - } - } - }; -}; - -const createConstantSourceNodeRendererFactory = (connectAudioParam, createNativeConstantSourceNode, getNativeAudioNode, renderAutomation, renderInputsOfAudioNode) => { - return () => { - const renderedNativeConstantSourceNodes = new WeakMap(); - let start = null; - let stop = null; - const createConstantSourceNode = async (proxy, nativeOfflineAudioContext) => { - let nativeConstantSourceNode = getNativeAudioNode(proxy); - /* - * If the initially used nativeConstantSourceNode was not constructed on the same OfflineAudioContext it needs to be created - * again. - */ - const nativeConstantSourceNodeIsOwnedByContext = isOwnedByContext(nativeConstantSourceNode, nativeOfflineAudioContext); - if (!nativeConstantSourceNodeIsOwnedByContext) { - const options = { - channelCount: nativeConstantSourceNode.channelCount, - channelCountMode: nativeConstantSourceNode.channelCountMode, - channelInterpretation: nativeConstantSourceNode.channelInterpretation, - offset: nativeConstantSourceNode.offset.value - }; - nativeConstantSourceNode = createNativeConstantSourceNode(nativeOfflineAudioContext, options); - if (start !== null) { - nativeConstantSourceNode.start(start); - } - if (stop !== null) { - nativeConstantSourceNode.stop(stop); - } - } - renderedNativeConstantSourceNodes.set(nativeOfflineAudioContext, nativeConstantSourceNode); - if (!nativeConstantSourceNodeIsOwnedByContext) { - await renderAutomation(nativeOfflineAudioContext, proxy.offset, nativeConstantSourceNode.offset); - } - else { - await connectAudioParam(nativeOfflineAudioContext, proxy.offset, nativeConstantSourceNode.offset); - } - await renderInputsOfAudioNode(proxy, nativeOfflineAudioContext, nativeConstantSourceNode); - return nativeConstantSourceNode; - }; - return { - set start(value) { - start = value; - }, - set stop(value) { - stop = value; - }, - render(proxy, nativeOfflineAudioContext) { - const renderedNativeConstantSourceNode = renderedNativeConstantSourceNodes.get(nativeOfflineAudioContext); - if (renderedNativeConstantSourceNode !== undefined) { - return Promise.resolve(renderedNativeConstantSourceNode); - } - return createConstantSourceNode(proxy, nativeOfflineAudioContext); - } - }; - }; -}; - -const createConvertNumberToUnsignedLong = (unit32Array) => { - return (value) => { - unit32Array[0] = value; - return unit32Array[0]; - }; -}; - -const DEFAULT_OPTIONS$8 = { - buffer: null, - channelCount: 2, - channelCountMode: 'clamped-max', - channelInterpretation: 'speakers', - disableNormalization: false -}; -const createConvolverNodeConstructor = (audioNodeConstructor, createConvolverNodeRenderer, createNativeConvolverNode, getNativeContext, isNativeOfflineAudioContext, setAudioNodeTailTime) => { - return class ConvolverNode extends audioNodeConstructor { - constructor(context, options) { - const nativeContext = getNativeContext(context); - const mergedOptions = { ...DEFAULT_OPTIONS$8, ...options }; - const nativeConvolverNode = createNativeConvolverNode(nativeContext, mergedOptions); - const isOffline = isNativeOfflineAudioContext(nativeContext); - const convolverNodeRenderer = (isOffline ? createConvolverNodeRenderer() : null); - super(context, false, nativeConvolverNode, convolverNodeRenderer); - this._isBufferNullified = false; - this._nativeConvolverNode = nativeConvolverNode; - if (mergedOptions.buffer !== null) { - setAudioNodeTailTime(this, mergedOptions.buffer.duration); - } - } - get buffer() { - if (this._isBufferNullified) { - return null; - } - return this._nativeConvolverNode.buffer; - } - set buffer(value) { - this._nativeConvolverNode.buffer = value; - // Bug #115: Safari does not allow to set the buffer to null. - if (value === null && this._nativeConvolverNode.buffer !== null) { - const nativeContext = this._nativeConvolverNode.context; - this._nativeConvolverNode.buffer = nativeContext.createBuffer(1, 1, 44100); - this._isBufferNullified = true; - setAudioNodeTailTime(this, 0); - } - else { - this._isBufferNullified = false; - setAudioNodeTailTime(this, this._nativeConvolverNode.buffer === null ? 0 : this._nativeConvolverNode.buffer.duration); - } - } - get normalize() { - return this._nativeConvolverNode.normalize; - } - set normalize(value) { - this._nativeConvolverNode.normalize = value; - } - }; -}; - -const createConvolverNodeRendererFactory = (createNativeConvolverNode, getNativeAudioNode, renderInputsOfAudioNode) => { - return () => { - const renderedNativeConvolverNodes = new WeakMap(); - const createConvolverNode = async (proxy, nativeOfflineAudioContext) => { - let nativeConvolverNode = getNativeAudioNode(proxy); - // If the initially used nativeConvolverNode was not constructed on the same OfflineAudioContext it needs to be created again. - const nativeConvolverNodeIsOwnedByContext = isOwnedByContext(nativeConvolverNode, nativeOfflineAudioContext); - if (!nativeConvolverNodeIsOwnedByContext) { - const options = { - buffer: nativeConvolverNode.buffer, - channelCount: nativeConvolverNode.channelCount, - channelCountMode: nativeConvolverNode.channelCountMode, - channelInterpretation: nativeConvolverNode.channelInterpretation, - disableNormalization: !nativeConvolverNode.normalize - }; - nativeConvolverNode = createNativeConvolverNode(nativeOfflineAudioContext, options); - } - renderedNativeConvolverNodes.set(nativeOfflineAudioContext, nativeConvolverNode); - if (isNativeAudioNodeFaker(nativeConvolverNode)) { - await renderInputsOfAudioNode(proxy, nativeOfflineAudioContext, nativeConvolverNode.inputs[0]); - } - else { - await renderInputsOfAudioNode(proxy, nativeOfflineAudioContext, nativeConvolverNode); - } - return nativeConvolverNode; - }; - return { - render(proxy, nativeOfflineAudioContext) { - const renderedNativeConvolverNode = renderedNativeConvolverNodes.get(nativeOfflineAudioContext); - if (renderedNativeConvolverNode !== undefined) { - return Promise.resolve(renderedNativeConvolverNode); - } - return createConvolverNode(proxy, nativeOfflineAudioContext); - } - }; - }; -}; - -const createCreateNativeOfflineAudioContext = (createNotSupportedError, nativeOfflineAudioContextConstructor) => { - return (numberOfChannels, length, sampleRate) => { - if (nativeOfflineAudioContextConstructor === null) { - throw new Error('Missing the native OfflineAudioContext constructor.'); - } - try { - return new nativeOfflineAudioContextConstructor(numberOfChannels, length, sampleRate); - } - catch (err) { - // Bug #143, #144 & #146: Safari throws a SyntaxError when numberOfChannels, length or sampleRate are invalid. - if (err.name === 'SyntaxError') { - throw createNotSupportedError(); - } - throw err; - } - }; -}; - -const createDataCloneError = () => new DOMException('', 'DataCloneError'); - -const detachArrayBuffer = (arrayBuffer) => { - const { port1, port2 } = new MessageChannel(); - return new Promise((resolve) => { - const closeAndResolve = () => { - port2.onmessage = null; - port1.close(); - port2.close(); - resolve(); - }; - port2.onmessage = () => closeAndResolve(); - try { - port1.postMessage(arrayBuffer, [arrayBuffer]); - } - finally { - closeAndResolve(); - } - }); -}; - -const createDecodeAudioData = (audioBufferStore, cacheTestResult, createDataCloneError, createEncodingError, detachedArrayBuffers, getNativeContext, isNativeContext, testAudioBufferCopyChannelMethodsOutOfBoundsSupport, testPromiseSupport, wrapAudioBufferCopyChannelMethods, wrapAudioBufferCopyChannelMethodsOutOfBounds) => { - return (anyContext, audioData) => { - const nativeContext = isNativeContext(anyContext) ? anyContext : getNativeContext(anyContext); - // Bug #43: Only Chrome, Edge and Opera do throw a DataCloneError. - if (detachedArrayBuffers.has(audioData)) { - const err = createDataCloneError(); - return Promise.reject(err); - } - // The audioData parameter maybe of a type which can't be added to a WeakSet. - try { - detachedArrayBuffers.add(audioData); - } - catch { - // Ignore errors. - } - // Bug #21: Safari does not support promises yet. - if (cacheTestResult(testPromiseSupport, () => testPromiseSupport(nativeContext))) { - return nativeContext.decodeAudioData(audioData).then((audioBuffer) => { - // Bug #133: Safari does neuter the ArrayBuffer. - detachArrayBuffer(audioData).catch(() => { - // Ignore errors. - }); - // Bug #157: Firefox does not allow the bufferOffset to be out-of-bounds. - if (!cacheTestResult(testAudioBufferCopyChannelMethodsOutOfBoundsSupport, () => testAudioBufferCopyChannelMethodsOutOfBoundsSupport(audioBuffer))) { - wrapAudioBufferCopyChannelMethodsOutOfBounds(audioBuffer); - } - audioBufferStore.add(audioBuffer); - return audioBuffer; - }); - } - // Bug #21: Safari does not return a Promise yet. - return new Promise((resolve, reject) => { - const complete = async () => { - // Bug #133: Safari does neuter the ArrayBuffer. - try { - await detachArrayBuffer(audioData); - } - catch { - // Ignore errors. - } - }; - const fail = (err) => { - reject(err); - complete(); - }; - // Bug #26: Safari throws a synchronous error. - try { - // Bug #1: Safari requires a successCallback. - nativeContext.decodeAudioData(audioData, (audioBuffer) => { - // Bug #5: Safari does not support copyFromChannel() and copyToChannel(). - // Bug #100: Safari does throw a wrong error when calling getChannelData() with an out-of-bounds value. - if (typeof audioBuffer.copyFromChannel !== 'function') { - wrapAudioBufferCopyChannelMethods(audioBuffer); - wrapAudioBufferGetChannelDataMethod(audioBuffer); - } - audioBufferStore.add(audioBuffer); - complete().then(() => resolve(audioBuffer)); - }, (err) => { - // Bug #4: Safari returns null instead of an error. - if (err === null) { - fail(createEncodingError()); - } - else { - fail(err); - } - }); - } - catch (err) { - fail(err); - } - }); - }; -}; - -const createDecrementCycleCounter = (connectNativeAudioNodeToNativeAudioNode, cycleCounters, getAudioNodeConnections, getNativeAudioNode, getNativeAudioParam, getNativeContext, isActiveAudioNode, isNativeOfflineAudioContext) => { - return (audioNode, count) => { - const cycleCounter = cycleCounters.get(audioNode); - if (cycleCounter === undefined) { - throw new Error('Missing the expected cycle count.'); - } - const nativeContext = getNativeContext(audioNode.context); - const isOffline = isNativeOfflineAudioContext(nativeContext); - if (cycleCounter === count) { - cycleCounters.delete(audioNode); - if (!isOffline && isActiveAudioNode(audioNode)) { - const nativeSourceAudioNode = getNativeAudioNode(audioNode); - const { outputs } = getAudioNodeConnections(audioNode); - for (const output of outputs) { - if (isAudioNodeOutputConnection(output)) { - const nativeDestinationAudioNode = getNativeAudioNode(output[0]); - connectNativeAudioNodeToNativeAudioNode(nativeSourceAudioNode, nativeDestinationAudioNode, output[1], output[2]); - } - else { - const nativeDestinationAudioParam = getNativeAudioParam(output[0]); - nativeSourceAudioNode.connect(nativeDestinationAudioParam, output[1]); - } - } - } - } - else { - cycleCounters.set(audioNode, cycleCounter - count); - } - }; -}; - -const DEFAULT_OPTIONS$9 = { - channelCount: 2, - channelCountMode: 'max', - channelInterpretation: 'speakers', - delayTime: 0, - maxDelayTime: 1 -}; -const createDelayNodeConstructor = (audioNodeConstructor, createAudioParam, createDelayNodeRenderer, createNativeDelayNode, getNativeContext, isNativeOfflineAudioContext, setAudioNodeTailTime) => { - return class DelayNode extends audioNodeConstructor { - constructor(context, options) { - const nativeContext = getNativeContext(context); - const mergedOptions = { ...DEFAULT_OPTIONS$9, ...options }; - const nativeDelayNode = createNativeDelayNode(nativeContext, mergedOptions); - const isOffline = isNativeOfflineAudioContext(nativeContext); - const delayNodeRenderer = (isOffline ? createDelayNodeRenderer(mergedOptions.maxDelayTime) : null); - super(context, false, nativeDelayNode, delayNodeRenderer); - this._delayTime = createAudioParam(this, isOffline, nativeDelayNode.delayTime); - setAudioNodeTailTime(this, mergedOptions.maxDelayTime); - } - get delayTime() { - return this._delayTime; - } - }; -}; - -const createDelayNodeRendererFactory = (connectAudioParam, createNativeDelayNode, getNativeAudioNode, renderAutomation, renderInputsOfAudioNode) => { - return (maxDelayTime) => { - const renderedNativeDelayNodes = new WeakMap(); - const createDelayNode = async (proxy, nativeOfflineAudioContext) => { - let nativeDelayNode = getNativeAudioNode(proxy); - // If the initially used nativeDelayNode was not constructed on the same OfflineAudioContext it needs to be created again. - const nativeDelayNodeIsOwnedByContext = isOwnedByContext(nativeDelayNode, nativeOfflineAudioContext); - if (!nativeDelayNodeIsOwnedByContext) { - const options = { - channelCount: nativeDelayNode.channelCount, - channelCountMode: nativeDelayNode.channelCountMode, - channelInterpretation: nativeDelayNode.channelInterpretation, - delayTime: nativeDelayNode.delayTime.value, - maxDelayTime - }; - nativeDelayNode = createNativeDelayNode(nativeOfflineAudioContext, options); - } - renderedNativeDelayNodes.set(nativeOfflineAudioContext, nativeDelayNode); - if (!nativeDelayNodeIsOwnedByContext) { - await renderAutomation(nativeOfflineAudioContext, proxy.delayTime, nativeDelayNode.delayTime); - } - else { - await connectAudioParam(nativeOfflineAudioContext, proxy.delayTime, nativeDelayNode.delayTime); - } - await renderInputsOfAudioNode(proxy, nativeOfflineAudioContext, nativeDelayNode); - return nativeDelayNode; - }; - return { - render(proxy, nativeOfflineAudioContext) { - const renderedNativeDelayNode = renderedNativeDelayNodes.get(nativeOfflineAudioContext); - if (renderedNativeDelayNode !== undefined) { - return Promise.resolve(renderedNativeDelayNode); - } - return createDelayNode(proxy, nativeOfflineAudioContext); - } - }; - }; -}; - -const createDeleteActiveInputConnectionToAudioNode = (pickElementFromSet) => { - return (activeInputs, source, output, input) => { - return pickElementFromSet(activeInputs[input], (activeInputConnection) => activeInputConnection[0] === source && activeInputConnection[1] === output); - }; -}; - -const createDeleteUnrenderedAudioWorkletNode = (getUnrenderedAudioWorkletNodes) => { - return (nativeContext, audioWorkletNode) => { - getUnrenderedAudioWorkletNodes(nativeContext).delete(audioWorkletNode); - }; -}; - -const isDelayNode = (audioNode) => { - return 'delayTime' in audioNode; -}; - -const createDetectCycles = (audioParamAudioNodeStore, getAudioNodeConnections, getValueForKey) => { - return function detectCycles(chain, nextLink) { - const audioNode = isAudioNode(nextLink) ? nextLink : getValueForKey(audioParamAudioNodeStore, nextLink); - if (isDelayNode(audioNode)) { - return []; - } - if (chain[0] === audioNode) { - return [chain]; - } - if (chain.includes(audioNode)) { - return []; - } - const { outputs } = getAudioNodeConnections(audioNode); - return Array.from(outputs) - .map((outputConnection) => detectCycles([...chain, audioNode], outputConnection[0])) - .reduce((mergedCycles, nestedCycles) => mergedCycles.concat(nestedCycles), []); - }; -}; - -const getOutputAudioNodeAtIndex = (createIndexSizeError, outputAudioNodes, output) => { - const outputAudioNode = outputAudioNodes[output]; - if (outputAudioNode === undefined) { - throw createIndexSizeError(); - } - return outputAudioNode; -}; -const createDisconnectMultipleOutputs = (createIndexSizeError) => { - return (outputAudioNodes, destinationOrOutput = undefined, output = undefined, input = 0) => { - if (destinationOrOutput === undefined) { - return outputAudioNodes.forEach((outputAudioNode) => outputAudioNode.disconnect()); - } - if (typeof destinationOrOutput === 'number') { - return getOutputAudioNodeAtIndex(createIndexSizeError, outputAudioNodes, destinationOrOutput).disconnect(); - } - if (isNativeAudioNode(destinationOrOutput)) { - if (output === undefined) { - return outputAudioNodes.forEach((outputAudioNode) => outputAudioNode.disconnect(destinationOrOutput)); - } - if (input === undefined) { - return getOutputAudioNodeAtIndex(createIndexSizeError, outputAudioNodes, output).disconnect(destinationOrOutput, 0); - } - return getOutputAudioNodeAtIndex(createIndexSizeError, outputAudioNodes, output).disconnect(destinationOrOutput, 0, input); - } - if (output === undefined) { - return outputAudioNodes.forEach((outputAudioNode) => outputAudioNode.disconnect(destinationOrOutput)); - } - return getOutputAudioNodeAtIndex(createIndexSizeError, outputAudioNodes, output).disconnect(destinationOrOutput, 0); - }; -}; - -const DEFAULT_OPTIONS$a = { - attack: 0.003, - channelCount: 2, - channelCountMode: 'clamped-max', - channelInterpretation: 'speakers', - knee: 30, - ratio: 12, - release: 0.25, - threshold: -24 -}; -const createDynamicsCompressorNodeConstructor = (audioNodeConstructor, createAudioParam, createDynamicsCompressorNodeRenderer, createNativeDynamicsCompressorNode, createNotSupportedError, getNativeContext, isNativeOfflineAudioContext, setAudioNodeTailTime) => { - return class DynamicsCompressorNode extends audioNodeConstructor { - constructor(context, options) { - const nativeContext = getNativeContext(context); - const mergedOptions = { ...DEFAULT_OPTIONS$a, ...options }; - const nativeDynamicsCompressorNode = createNativeDynamicsCompressorNode(nativeContext, mergedOptions); - const isOffline = isNativeOfflineAudioContext(nativeContext); - const dynamicsCompressorNodeRenderer = (isOffline ? createDynamicsCompressorNodeRenderer() : null); - super(context, false, nativeDynamicsCompressorNode, dynamicsCompressorNodeRenderer); - this._attack = createAudioParam(this, isOffline, nativeDynamicsCompressorNode.attack); - this._knee = createAudioParam(this, isOffline, nativeDynamicsCompressorNode.knee); - this._nativeDynamicsCompressorNode = nativeDynamicsCompressorNode; - this._ratio = createAudioParam(this, isOffline, nativeDynamicsCompressorNode.ratio); - this._release = createAudioParam(this, isOffline, nativeDynamicsCompressorNode.release); - this._threshold = createAudioParam(this, isOffline, nativeDynamicsCompressorNode.threshold); - setAudioNodeTailTime(this, 0.006); - } - get attack() { - return this._attack; - } - // Bug #108: Safari allows a channelCount of three and above which is why the getter and setter needs to be overwritten here. - get channelCount() { - return this._nativeDynamicsCompressorNode.channelCount; - } - set channelCount(value) { - const previousChannelCount = this._nativeDynamicsCompressorNode.channelCount; - this._nativeDynamicsCompressorNode.channelCount = value; - if (value > 2) { - this._nativeDynamicsCompressorNode.channelCount = previousChannelCount; - throw createNotSupportedError(); - } - } - /* - * Bug #109: Only Chrome, Firefox and Opera disallow a channelCountMode of 'max' yet which is why the getter and setter needs to be - * overwritten here. - */ - get channelCountMode() { - return this._nativeDynamicsCompressorNode.channelCountMode; - } - set channelCountMode(value) { - const previousChannelCount = this._nativeDynamicsCompressorNode.channelCountMode; - this._nativeDynamicsCompressorNode.channelCountMode = value; - if (value === 'max') { - this._nativeDynamicsCompressorNode.channelCountMode = previousChannelCount; - throw createNotSupportedError(); - } - } - get knee() { - return this._knee; - } - get ratio() { - return this._ratio; - } - get reduction() { - // Bug #111: Safari returns an AudioParam instead of a number. - if (typeof this._nativeDynamicsCompressorNode.reduction.value === 'number') { - return this._nativeDynamicsCompressorNode.reduction.value; - } - return this._nativeDynamicsCompressorNode.reduction; - } - get release() { - return this._release; - } - get threshold() { - return this._threshold; - } - }; -}; - -const createDynamicsCompressorNodeRendererFactory = (connectAudioParam, createNativeDynamicsCompressorNode, getNativeAudioNode, renderAutomation, renderInputsOfAudioNode) => { - return () => { - const renderedNativeDynamicsCompressorNodes = new WeakMap(); - const createDynamicsCompressorNode = async (proxy, nativeOfflineAudioContext) => { - let nativeDynamicsCompressorNode = getNativeAudioNode(proxy); - /* - * If the initially used nativeDynamicsCompressorNode was not constructed on the same OfflineAudioContext it needs to be - * created again. - */ - const nativeDynamicsCompressorNodeIsOwnedByContext = isOwnedByContext(nativeDynamicsCompressorNode, nativeOfflineAudioContext); - if (!nativeDynamicsCompressorNodeIsOwnedByContext) { - const options = { - attack: nativeDynamicsCompressorNode.attack.value, - channelCount: nativeDynamicsCompressorNode.channelCount, - channelCountMode: nativeDynamicsCompressorNode.channelCountMode, - channelInterpretation: nativeDynamicsCompressorNode.channelInterpretation, - knee: nativeDynamicsCompressorNode.knee.value, - ratio: nativeDynamicsCompressorNode.ratio.value, - release: nativeDynamicsCompressorNode.release.value, - threshold: nativeDynamicsCompressorNode.threshold.value - }; - nativeDynamicsCompressorNode = createNativeDynamicsCompressorNode(nativeOfflineAudioContext, options); - } - renderedNativeDynamicsCompressorNodes.set(nativeOfflineAudioContext, nativeDynamicsCompressorNode); - if (!nativeDynamicsCompressorNodeIsOwnedByContext) { - await renderAutomation(nativeOfflineAudioContext, proxy.attack, nativeDynamicsCompressorNode.attack); - await renderAutomation(nativeOfflineAudioContext, proxy.knee, nativeDynamicsCompressorNode.knee); - await renderAutomation(nativeOfflineAudioContext, proxy.ratio, nativeDynamicsCompressorNode.ratio); - await renderAutomation(nativeOfflineAudioContext, proxy.release, nativeDynamicsCompressorNode.release); - await renderAutomation(nativeOfflineAudioContext, proxy.threshold, nativeDynamicsCompressorNode.threshold); - } - else { - await connectAudioParam(nativeOfflineAudioContext, proxy.attack, nativeDynamicsCompressorNode.attack); - await connectAudioParam(nativeOfflineAudioContext, proxy.knee, nativeDynamicsCompressorNode.knee); - await connectAudioParam(nativeOfflineAudioContext, proxy.ratio, nativeDynamicsCompressorNode.ratio); - await connectAudioParam(nativeOfflineAudioContext, proxy.release, nativeDynamicsCompressorNode.release); - await connectAudioParam(nativeOfflineAudioContext, proxy.threshold, nativeDynamicsCompressorNode.threshold); - } - await renderInputsOfAudioNode(proxy, nativeOfflineAudioContext, nativeDynamicsCompressorNode); - return nativeDynamicsCompressorNode; - }; - return { - render(proxy, nativeOfflineAudioContext) { - const renderedNativeDynamicsCompressorNode = renderedNativeDynamicsCompressorNodes.get(nativeOfflineAudioContext); - if (renderedNativeDynamicsCompressorNode !== undefined) { - return Promise.resolve(renderedNativeDynamicsCompressorNode); - } - return createDynamicsCompressorNode(proxy, nativeOfflineAudioContext); - } - }; - }; -}; - -const createEncodingError = () => new DOMException('', 'EncodingError'); - -const createEvaluateSource = (window) => { - return (source) => new Promise((resolve, reject) => { - if (window === null) { - // Bug #182 Chrome, Edge and Opera do throw an instance of a SyntaxError instead of a DOMException. - reject(new SyntaxError()); - return; - } - const head = window.document.head; - if (head === null) { - // Bug #182 Chrome, Edge and Opera do throw an instance of a SyntaxError instead of a DOMException. - reject(new SyntaxError()); - } - else { - const script = window.document.createElement('script'); - // @todo Safari doesn't like URLs with a type of 'application/javascript; charset=utf-8'. - const blob = new Blob([source], { type: 'application/javascript' }); - const url = URL.createObjectURL(blob); - const originalOnErrorHandler = window.onerror; - const removeErrorEventListenerAndRevokeUrl = () => { - window.onerror = originalOnErrorHandler; - URL.revokeObjectURL(url); - }; - window.onerror = (message, src, lineno, colno, error) => { - // @todo Edge thinks the source is the one of the html document. - if (src === url || (src === window.location.href && lineno === 1 && colno === 1)) { - removeErrorEventListenerAndRevokeUrl(); - reject(error); - return false; - } - if (originalOnErrorHandler !== null) { - return originalOnErrorHandler(message, src, lineno, colno, error); - } - }; - script.onerror = () => { - removeErrorEventListenerAndRevokeUrl(); - // Bug #182 Chrome, Edge and Opera do throw an instance of a SyntaxError instead of a DOMException. - reject(new SyntaxError()); - }; - script.onload = () => { - removeErrorEventListenerAndRevokeUrl(); - resolve(); - }; - script.src = url; - script.type = 'module'; - head.appendChild(script); - } - }); -}; - -const createEventTargetConstructor = (wrapEventListener) => { - return class EventTarget { - constructor(_nativeEventTarget) { - this._nativeEventTarget = _nativeEventTarget; - this._listeners = new WeakMap(); - } - addEventListener(type, listener, options) { - if (listener !== null) { - let wrappedEventListener = this._listeners.get(listener); - if (wrappedEventListener === undefined) { - wrappedEventListener = wrapEventListener(this, listener); - if (typeof listener === 'function') { - this._listeners.set(listener, wrappedEventListener); - } - } - this._nativeEventTarget.addEventListener(type, wrappedEventListener, options); - } - } - dispatchEvent(event) { - return this._nativeEventTarget.dispatchEvent(event); - } - removeEventListener(type, listener, options) { - const wrappedEventListener = listener === null ? undefined : this._listeners.get(listener); - this._nativeEventTarget.removeEventListener(type, wrappedEventListener === undefined ? null : wrappedEventListener, options); - } - }; -}; - -const createExposeCurrentFrameAndCurrentTime = (window) => { - return (currentTime, sampleRate, fn) => { - Object.defineProperties(window, { - currentFrame: { - configurable: true, - get() { - return Math.round(currentTime * sampleRate); - } - }, - currentTime: { - configurable: true, - get() { - return currentTime; - } - } - }); - try { - return fn(); - } - finally { - if (window !== null) { - delete window.currentFrame; - delete window.currentTime; - } - } - }; -}; - -const createFetchSource = (createAbortError) => { - return async (url) => { - try { - const response = await fetch(url); - if (response.ok) { - return [await response.text(), response.url]; - } - } - catch { - // Ignore errors. - } // tslint:disable-line:no-empty - throw createAbortError(); - }; -}; - -const DEFAULT_OPTIONS$b = { - channelCount: 2, - channelCountMode: 'max', - channelInterpretation: 'speakers', - gain: 1 -}; -const createGainNodeConstructor = (audioNodeConstructor, createAudioParam, createGainNodeRenderer, createNativeGainNode, getNativeContext, isNativeOfflineAudioContext) => { - return class GainNode extends audioNodeConstructor { - constructor(context, options) { - const nativeContext = getNativeContext(context); - const mergedOptions = { ...DEFAULT_OPTIONS$b, ...options }; - const nativeGainNode = createNativeGainNode(nativeContext, mergedOptions); - const isOffline = isNativeOfflineAudioContext(nativeContext); - const gainNodeRenderer = (isOffline ? createGainNodeRenderer() : null); - super(context, false, nativeGainNode, gainNodeRenderer); - // Bug #74: Safari does not export the correct values for maxValue and minValue. - this._gain = createAudioParam(this, isOffline, nativeGainNode.gain, MOST_POSITIVE_SINGLE_FLOAT, MOST_NEGATIVE_SINGLE_FLOAT); - } - get gain() { - return this._gain; - } - }; -}; - -const createGainNodeRendererFactory = (connectAudioParam, createNativeGainNode, getNativeAudioNode, renderAutomation, renderInputsOfAudioNode) => { - return () => { - const renderedNativeGainNodes = new WeakMap(); - const createGainNode = async (proxy, nativeOfflineAudioContext) => { - let nativeGainNode = getNativeAudioNode(proxy); - // If the initially used nativeGainNode was not constructed on the same OfflineAudioContext it needs to be created again. - const nativeGainNodeIsOwnedByContext = isOwnedByContext(nativeGainNode, nativeOfflineAudioContext); - if (!nativeGainNodeIsOwnedByContext) { - const options = { - channelCount: nativeGainNode.channelCount, - channelCountMode: nativeGainNode.channelCountMode, - channelInterpretation: nativeGainNode.channelInterpretation, - gain: nativeGainNode.gain.value - }; - nativeGainNode = createNativeGainNode(nativeOfflineAudioContext, options); - } - renderedNativeGainNodes.set(nativeOfflineAudioContext, nativeGainNode); - if (!nativeGainNodeIsOwnedByContext) { - await renderAutomation(nativeOfflineAudioContext, proxy.gain, nativeGainNode.gain); - } - else { - await connectAudioParam(nativeOfflineAudioContext, proxy.gain, nativeGainNode.gain); - } - await renderInputsOfAudioNode(proxy, nativeOfflineAudioContext, nativeGainNode); - return nativeGainNode; - }; - return { - render(proxy, nativeOfflineAudioContext) { - const renderedNativeGainNode = renderedNativeGainNodes.get(nativeOfflineAudioContext); - if (renderedNativeGainNode !== undefined) { - return Promise.resolve(renderedNativeGainNode); - } - return createGainNode(proxy, nativeOfflineAudioContext); - } - }; - }; -}; - -const createGetActiveAudioWorkletNodeInputs = (activeAudioWorkletNodeInputsStore, getValueForKey) => { - return (nativeAudioWorkletNode) => getValueForKey(activeAudioWorkletNodeInputsStore, nativeAudioWorkletNode); -}; - -const createGetAudioNodeRenderer = (getAudioNodeConnections) => { - return (audioNode) => { - const audioNodeConnections = getAudioNodeConnections(audioNode); - if (audioNodeConnections.renderer === null) { - throw new Error('Missing the renderer of the given AudioNode in the audio graph.'); - } - return audioNodeConnections.renderer; - }; -}; - -const createGetAudioNodeTailTime = (audioNodeTailTimeStore) => { - return (audioNode) => { var _a; return (_a = audioNodeTailTimeStore.get(audioNode)) !== null && _a !== void 0 ? _a : 0; }; -}; - -const createGetAudioParamRenderer = (getAudioParamConnections) => { - return (audioParam) => { - const audioParamConnections = getAudioParamConnections(audioParam); - if (audioParamConnections.renderer === null) { - throw new Error('Missing the renderer of the given AudioParam in the audio graph.'); - } - return audioParamConnections.renderer; - }; -}; - -const createGetBackupOfflineAudioContext = (backupOfflineAudioContextStore) => { - return (nativeContext) => { - return backupOfflineAudioContextStore.get(nativeContext); - }; -}; - -const createInvalidStateError = () => new DOMException('', 'InvalidStateError'); - -const createGetNativeContext = (contextStore) => { - return (context) => { - const nativeContext = contextStore.get(context); - if (nativeContext === undefined) { - throw createInvalidStateError(); - } - return (nativeContext); - }; -}; - -const createGetOrCreateBackupOfflineAudioContext = (backupOfflineAudioContextStore, nativeOfflineAudioContextConstructor) => { - return (nativeContext) => { - let backupOfflineAudioContext = backupOfflineAudioContextStore.get(nativeContext); - if (backupOfflineAudioContext !== undefined) { - return backupOfflineAudioContext; - } - if (nativeOfflineAudioContextConstructor === null) { - throw new Error('Missing the native OfflineAudioContext constructor.'); - } - // Bug #141: Safari does not support creating an OfflineAudioContext with less than 44100 Hz. - backupOfflineAudioContext = new nativeOfflineAudioContextConstructor(1, 1, 44100); - backupOfflineAudioContextStore.set(nativeContext, backupOfflineAudioContext); - return backupOfflineAudioContext; - }; -}; - -const createGetUnrenderedAudioWorkletNodes = (unrenderedAudioWorkletNodeStore) => { - return (nativeContext) => { - const unrenderedAudioWorkletNodes = unrenderedAudioWorkletNodeStore.get(nativeContext); - if (unrenderedAudioWorkletNodes === undefined) { - throw new Error('The context has no set of AudioWorkletNodes.'); - } - return unrenderedAudioWorkletNodes; - }; -}; - -const createInvalidAccessError = () => new DOMException('', 'InvalidAccessError'); - -const wrapIIRFilterNodeGetFrequencyResponseMethod = (nativeIIRFilterNode) => { - nativeIIRFilterNode.getFrequencyResponse = ((getFrequencyResponse) => { - return (frequencyHz, magResponse, phaseResponse) => { - if (frequencyHz.length !== magResponse.length || magResponse.length !== phaseResponse.length) { - throw createInvalidAccessError(); - } - return getFrequencyResponse.call(nativeIIRFilterNode, frequencyHz, magResponse, phaseResponse); - }; - })(nativeIIRFilterNode.getFrequencyResponse); -}; - -const DEFAULT_OPTIONS$c = { - channelCount: 2, - channelCountMode: 'max', - channelInterpretation: 'speakers' -}; -const createIIRFilterNodeConstructor = (audioNodeConstructor, createNativeIIRFilterNode, createIIRFilterNodeRenderer, getNativeContext, isNativeOfflineAudioContext, setAudioNodeTailTime) => { - return class IIRFilterNode extends audioNodeConstructor { - constructor(context, options) { - const nativeContext = getNativeContext(context); - const isOffline = isNativeOfflineAudioContext(nativeContext); - const mergedOptions = { ...DEFAULT_OPTIONS$c, ...options }; - const nativeIIRFilterNode = createNativeIIRFilterNode(nativeContext, isOffline ? null : context.baseLatency, mergedOptions); - const iirFilterNodeRenderer = ((isOffline ? createIIRFilterNodeRenderer(mergedOptions.feedback, mergedOptions.feedforward) : null)); - super(context, false, nativeIIRFilterNode, iirFilterNodeRenderer); - // Bug #23 & #24: FirefoxDeveloper does not throw an InvalidAccessError. - // @todo Write a test which allows other browsers to remain unpatched. - wrapIIRFilterNodeGetFrequencyResponseMethod(nativeIIRFilterNode); - this._nativeIIRFilterNode = nativeIIRFilterNode; - // @todo Determine a meaningful tail-time instead of just using one second. - setAudioNodeTailTime(this, 1); - } - getFrequencyResponse(frequencyHz, magResponse, phaseResponse) { - return this._nativeIIRFilterNode.getFrequencyResponse(frequencyHz, magResponse, phaseResponse); - } - }; -}; - -// This implementation as shamelessly inspired by source code of -// tslint:disable-next-line:max-line-length -// {@link https://chromium.googlesource.com/chromium/src.git/+/master/third_party/WebKit/Source/platform/audio/IIRFilter.cpp|Chromium's IIRFilter}. -const filterBuffer = (feedback, feedbackLength, feedforward, feedforwardLength, minLength, xBuffer, yBuffer, bufferIndex, bufferLength, input, output) => { - const inputLength = input.length; - let i = bufferIndex; - for (let j = 0; j < inputLength; j += 1) { - let y = feedforward[0] * input[j]; - for (let k = 1; k < minLength; k += 1) { - const x = (i - k) & (bufferLength - 1); // tslint:disable-line:no-bitwise - y += feedforward[k] * xBuffer[x]; - y -= feedback[k] * yBuffer[x]; - } - for (let k = minLength; k < feedforwardLength; k += 1) { - y += feedforward[k] * xBuffer[(i - k) & (bufferLength - 1)]; // tslint:disable-line:no-bitwise - } - for (let k = minLength; k < feedbackLength; k += 1) { - y -= feedback[k] * yBuffer[(i - k) & (bufferLength - 1)]; // tslint:disable-line:no-bitwise - } - xBuffer[i] = input[j]; - yBuffer[i] = y; - i = (i + 1) & (bufferLength - 1); // tslint:disable-line:no-bitwise - output[j] = y; - } - return i; -}; - -const filterFullBuffer = (renderedBuffer, nativeOfflineAudioContext, feedback, feedforward) => { - const convertedFeedback = feedback instanceof Float64Array ? feedback : new Float64Array(feedback); - const convertedFeedforward = feedforward instanceof Float64Array ? feedforward : new Float64Array(feedforward); - const feedbackLength = convertedFeedback.length; - const feedforwardLength = convertedFeedforward.length; - const minLength = Math.min(feedbackLength, feedforwardLength); - if (convertedFeedback[0] !== 1) { - for (let i = 0; i < feedbackLength; i += 1) { - convertedFeedforward[i] /= convertedFeedback[0]; - } - for (let i = 1; i < feedforwardLength; i += 1) { - convertedFeedback[i] /= convertedFeedback[0]; - } - } - const bufferLength = 32; - const xBuffer = new Float32Array(bufferLength); - const yBuffer = new Float32Array(bufferLength); - const filteredBuffer = nativeOfflineAudioContext.createBuffer(renderedBuffer.numberOfChannels, renderedBuffer.length, renderedBuffer.sampleRate); - const numberOfChannels = renderedBuffer.numberOfChannels; - for (let i = 0; i < numberOfChannels; i += 1) { - const input = renderedBuffer.getChannelData(i); - const output = filteredBuffer.getChannelData(i); - xBuffer.fill(0); - yBuffer.fill(0); - filterBuffer(convertedFeedback, feedbackLength, convertedFeedforward, feedforwardLength, minLength, xBuffer, yBuffer, 0, bufferLength, input, output); - } - return filteredBuffer; -}; -const createIIRFilterNodeRendererFactory = (createNativeAudioBufferSourceNode, getNativeAudioNode, nativeOfflineAudioContextConstructor, renderInputsOfAudioNode, renderNativeOfflineAudioContext) => { - return (feedback, feedforward) => { - const renderedNativeAudioNodes = new WeakMap(); - let filteredBufferPromise = null; - const createAudioNode = async (proxy, nativeOfflineAudioContext) => { - let nativeAudioBufferSourceNode = null; - let nativeIIRFilterNode = getNativeAudioNode(proxy); - // If the initially used nativeIIRFilterNode was not constructed on the same OfflineAudioContext it needs to be created again. - const nativeIIRFilterNodeIsOwnedByContext = isOwnedByContext(nativeIIRFilterNode, nativeOfflineAudioContext); - // Bug #9: Safari does not support IIRFilterNodes. - if (nativeOfflineAudioContext.createIIRFilter === undefined) { - nativeAudioBufferSourceNode = createNativeAudioBufferSourceNode(nativeOfflineAudioContext, { - buffer: null, - channelCount: 2, - channelCountMode: 'max', - channelInterpretation: 'speakers', - loop: false, - loopEnd: 0, - loopStart: 0, - playbackRate: 1 - }); - } - else if (!nativeIIRFilterNodeIsOwnedByContext) { - // @todo TypeScript defines the parameters of createIIRFilter() as arrays of numbers. - nativeIIRFilterNode = nativeOfflineAudioContext.createIIRFilter(feedforward, feedback); - } - renderedNativeAudioNodes.set(nativeOfflineAudioContext, nativeAudioBufferSourceNode === null ? nativeIIRFilterNode : nativeAudioBufferSourceNode); - if (nativeAudioBufferSourceNode !== null) { - if (filteredBufferPromise === null) { - if (nativeOfflineAudioContextConstructor === null) { - throw new Error('Missing the native OfflineAudioContext constructor.'); - } - const partialOfflineAudioContext = new nativeOfflineAudioContextConstructor( - // Bug #47: The AudioDestinationNode in Safari gets not initialized correctly. - proxy.context.destination.channelCount, - // Bug #17: Safari does not yet expose the length. - proxy.context.length, nativeOfflineAudioContext.sampleRate); - filteredBufferPromise = (async () => { - await renderInputsOfAudioNode(proxy, partialOfflineAudioContext, partialOfflineAudioContext.destination); - const renderedBuffer = await renderNativeOfflineAudioContext(partialOfflineAudioContext); - return filterFullBuffer(renderedBuffer, nativeOfflineAudioContext, feedback, feedforward); - })(); - } - const filteredBuffer = await filteredBufferPromise; - nativeAudioBufferSourceNode.buffer = filteredBuffer; - nativeAudioBufferSourceNode.start(0); - return nativeAudioBufferSourceNode; - } - await renderInputsOfAudioNode(proxy, nativeOfflineAudioContext, nativeIIRFilterNode); - return nativeIIRFilterNode; - }; - return { - render(proxy, nativeOfflineAudioContext) { - const renderedNativeAudioNode = renderedNativeAudioNodes.get(nativeOfflineAudioContext); - if (renderedNativeAudioNode !== undefined) { - return Promise.resolve(renderedNativeAudioNode); - } - return createAudioNode(proxy, nativeOfflineAudioContext); - } - }; - }; -}; - -const createIncrementCycleCounterFactory = (cycleCounters, disconnectNativeAudioNodeFromNativeAudioNode, getAudioNodeConnections, getNativeAudioNode, getNativeAudioParam, isActiveAudioNode) => { - return (isOffline) => { - return (audioNode, count) => { - const cycleCounter = cycleCounters.get(audioNode); - if (cycleCounter === undefined) { - if (!isOffline && isActiveAudioNode(audioNode)) { - const nativeSourceAudioNode = getNativeAudioNode(audioNode); - const { outputs } = getAudioNodeConnections(audioNode); - for (const output of outputs) { - if (isAudioNodeOutputConnection(output)) { - const nativeDestinationAudioNode = getNativeAudioNode(output[0]); - disconnectNativeAudioNodeFromNativeAudioNode(nativeSourceAudioNode, nativeDestinationAudioNode, output[1], output[2]); - } - else { - const nativeDestinationAudioParam = getNativeAudioParam(output[0]); - nativeSourceAudioNode.disconnect(nativeDestinationAudioParam, output[1]); - } - } - } - cycleCounters.set(audioNode, count); - } - else { - cycleCounters.set(audioNode, cycleCounter + count); - } - }; - }; -}; - -const createIsAnyAudioContext = (contextStore, isNativeAudioContext) => { - return (anything) => { - const nativeContext = contextStore.get(anything); - return isNativeAudioContext(nativeContext) || isNativeAudioContext(anything); - }; -}; - -const createIsAnyAudioNode = (audioNodeStore, isNativeAudioNode) => { - return (anything) => audioNodeStore.has(anything) || isNativeAudioNode(anything); -}; - -const createIsAnyAudioParam = (audioParamStore, isNativeAudioParam) => { - return (anything) => audioParamStore.has(anything) || isNativeAudioParam(anything); -}; - -const createIsAnyOfflineAudioContext = (contextStore, isNativeOfflineAudioContext) => { - return (anything) => { - const nativeContext = contextStore.get(anything); - return isNativeOfflineAudioContext(nativeContext) || isNativeOfflineAudioContext(anything); - }; -}; - -const createIsNativeAudioContext = (nativeAudioContextConstructor) => { - return (anything) => { - return nativeAudioContextConstructor !== null && anything instanceof nativeAudioContextConstructor; - }; -}; - -const createIsNativeAudioNode = (window) => { - return (anything) => { - return window !== null && typeof window.AudioNode === 'function' && anything instanceof window.AudioNode; - }; -}; - -const createIsNativeAudioParam = (window) => { - return (anything) => { - return window !== null && typeof window.AudioParam === 'function' && anything instanceof window.AudioParam; - }; -}; - -const createIsNativeContext = (isNativeAudioContext, isNativeOfflineAudioContext) => { - return (anything) => { - return isNativeAudioContext(anything) || isNativeOfflineAudioContext(anything); - }; -}; - -const createIsNativeOfflineAudioContext = (nativeOfflineAudioContextConstructor) => { - return (anything) => { - return nativeOfflineAudioContextConstructor !== null && anything instanceof nativeOfflineAudioContextConstructor; - }; -}; - -const createIsSecureContext = (window) => window !== null && window.isSecureContext; - -const createIsSupportedPromise = async (cacheTestResult, testAudioBufferCopyChannelMethodsSubarraySupport, testAudioContextCloseMethodSupport, testAudioContextDecodeAudioDataMethodTypeErrorSupport, testAudioContextOptionsSupport, testAudioNodeConnectMethodSupport, testAudioWorkletProcessorNoOutputsSupport, testChannelMergerNodeChannelCountSupport, testConstantSourceNodeAccurateSchedulingSupport, testConvolverNodeBufferReassignabilitySupport, testConvolverNodeChannelCountSupport, testDomExceptionContrucorSupport, testIsSecureContextSupport, testMediaStreamAudioSourceNodeMediaStreamWithoutAudioTrackSupport, testStereoPannerNodeDefaultValueSupport, testTransferablesSupport) => { - if (cacheTestResult(testAudioBufferCopyChannelMethodsSubarraySupport, testAudioBufferCopyChannelMethodsSubarraySupport) && - cacheTestResult(testAudioContextCloseMethodSupport, testAudioContextCloseMethodSupport) && - cacheTestResult(testAudioContextOptionsSupport, testAudioContextOptionsSupport) && - cacheTestResult(testAudioNodeConnectMethodSupport, testAudioNodeConnectMethodSupport) && - cacheTestResult(testChannelMergerNodeChannelCountSupport, testChannelMergerNodeChannelCountSupport) && - cacheTestResult(testConstantSourceNodeAccurateSchedulingSupport, testConstantSourceNodeAccurateSchedulingSupport) && - cacheTestResult(testConvolverNodeBufferReassignabilitySupport, testConvolverNodeBufferReassignabilitySupport) && - cacheTestResult(testConvolverNodeChannelCountSupport, testConvolverNodeChannelCountSupport) && - cacheTestResult(testDomExceptionContrucorSupport, testDomExceptionContrucorSupport) && - cacheTestResult(testIsSecureContextSupport, testIsSecureContextSupport) && - cacheTestResult(testMediaStreamAudioSourceNodeMediaStreamWithoutAudioTrackSupport, testMediaStreamAudioSourceNodeMediaStreamWithoutAudioTrackSupport)) { - const results = await Promise.all([ - cacheTestResult(testAudioContextDecodeAudioDataMethodTypeErrorSupport, testAudioContextDecodeAudioDataMethodTypeErrorSupport), - cacheTestResult(testAudioWorkletProcessorNoOutputsSupport, testAudioWorkletProcessorNoOutputsSupport), - cacheTestResult(testStereoPannerNodeDefaultValueSupport, testStereoPannerNodeDefaultValueSupport), - cacheTestResult(testTransferablesSupport, testTransferablesSupport) - ]); - return results.every((result) => result); - } - return false; -}; - -const createMediaElementAudioSourceNodeConstructor = (audioNodeConstructor, createNativeMediaElementAudioSourceNode, getNativeContext, isNativeOfflineAudioContext) => { - return class MediaElementAudioSourceNode extends audioNodeConstructor { - constructor(context, options) { - const nativeContext = getNativeContext(context); - const nativeMediaElementAudioSourceNode = createNativeMediaElementAudioSourceNode(nativeContext, options); - // Bug #171: Safari allows to create a MediaElementAudioSourceNode with an OfflineAudioContext. - if (isNativeOfflineAudioContext(nativeContext)) { - throw TypeError(); - } - super(context, true, nativeMediaElementAudioSourceNode, null); - this._nativeMediaElementAudioSourceNode = nativeMediaElementAudioSourceNode; - } - get mediaElement() { - return this._nativeMediaElementAudioSourceNode.mediaElement; - } - }; -}; - -const DEFAULT_OPTIONS$d = { - channelCount: 2, - channelCountMode: 'explicit', - channelInterpretation: 'speakers' -}; -const createMediaStreamAudioDestinationNodeConstructor = (audioNodeConstructor, createNativeMediaStreamAudioDestinationNode, getNativeContext, isNativeOfflineAudioContext) => { - return class MediaStreamAudioDestinationNode extends audioNodeConstructor { - constructor(context, options) { - const nativeContext = getNativeContext(context); - // Bug #173: Safari allows to create a MediaStreamAudioDestinationNode with an OfflineAudioContext. - if (isNativeOfflineAudioContext(nativeContext)) { - throw new TypeError(); - } - const mergedOptions = { ...DEFAULT_OPTIONS$d, ...options }; - const nativeMediaStreamAudioDestinationNode = createNativeMediaStreamAudioDestinationNode(nativeContext, mergedOptions); - super(context, false, nativeMediaStreamAudioDestinationNode, null); - this._nativeMediaStreamAudioDestinationNode = nativeMediaStreamAudioDestinationNode; - } - get stream() { - return this._nativeMediaStreamAudioDestinationNode.stream; - } - }; -}; - -const createMediaStreamAudioSourceNodeConstructor = (audioNodeConstructor, createNativeMediaStreamAudioSourceNode, getNativeContext, isNativeOfflineAudioContext) => { - return class MediaStreamAudioSourceNode extends audioNodeConstructor { - constructor(context, options) { - const nativeContext = getNativeContext(context); - const nativeMediaStreamAudioSourceNode = createNativeMediaStreamAudioSourceNode(nativeContext, options); - // Bug #172: Safari allows to create a MediaStreamAudioSourceNode with an OfflineAudioContext. - if (isNativeOfflineAudioContext(nativeContext)) { - throw new TypeError(); - } - super(context, true, nativeMediaStreamAudioSourceNode, null); - this._nativeMediaStreamAudioSourceNode = nativeMediaStreamAudioSourceNode; - } - get mediaStream() { - return this._nativeMediaStreamAudioSourceNode.mediaStream; - } - }; -}; - -const createMediaStreamTrackAudioSourceNodeConstructor = (audioNodeConstructor, createNativeMediaStreamTrackAudioSourceNode, getNativeContext) => { - return class MediaStreamTrackAudioSourceNode extends audioNodeConstructor { - constructor(context, options) { - const nativeContext = getNativeContext(context); - const nativeMediaStreamTrackAudioSourceNode = createNativeMediaStreamTrackAudioSourceNode(nativeContext, options); - super(context, true, nativeMediaStreamTrackAudioSourceNode, null); - } - }; -}; - -const createMinimalBaseAudioContextConstructor = (audioDestinationNodeConstructor, createAudioListener, eventTargetConstructor, isNativeOfflineAudioContext, unrenderedAudioWorkletNodeStore, wrapEventListener) => { - return class MinimalBaseAudioContext extends eventTargetConstructor { - constructor(_nativeContext, numberOfChannels) { - super(_nativeContext); - this._nativeContext = _nativeContext; - CONTEXT_STORE.set(this, _nativeContext); - if (isNativeOfflineAudioContext(_nativeContext)) { - unrenderedAudioWorkletNodeStore.set(_nativeContext, new Set()); - } - this._destination = new audioDestinationNodeConstructor(this, numberOfChannels); - this._listener = createAudioListener(this, _nativeContext); - this._onstatechange = null; - } - get currentTime() { - return this._nativeContext.currentTime; - } - get destination() { - return this._destination; - } - get listener() { - return this._listener; - } - get onstatechange() { - return this._onstatechange; - } - set onstatechange(value) { - const wrappedListener = typeof value === 'function' ? wrapEventListener(this, value) : null; - this._nativeContext.onstatechange = wrappedListener; - const nativeOnStateChange = this._nativeContext.onstatechange; - this._onstatechange = nativeOnStateChange !== null && nativeOnStateChange === wrappedListener ? value : nativeOnStateChange; - } - get sampleRate() { - return this._nativeContext.sampleRate; - } - get state() { - return this._nativeContext.state; - } - }; -}; - -const testPromiseSupport = (nativeContext) => { - // This 12 numbers represent the 48 bytes of an empty WAVE file with a single sample. - const uint32Array = new Uint32Array([1179011410, 40, 1163280727, 544501094, 16, 131073, 44100, 176400, 1048580, 1635017060, 4, 0]); - try { - // Bug #1: Safari requires a successCallback. - const promise = nativeContext.decodeAudioData(uint32Array.buffer, () => { - // Ignore the success callback. - }); - if (promise === undefined) { - return false; - } - promise.catch(() => { - // Ignore rejected errors. - }); - return true; - } - catch { - // Ignore errors. - } - return false; -}; - -const createMonitorConnections = (insertElementInSet, isNativeAudioNode) => { - return (nativeAudioNode, whenConnected, whenDisconnected) => { - const connections = new Set(); - nativeAudioNode.connect = ((connect) => { - // tslint:disable-next-line:invalid-void no-inferrable-types - return (destination, output = 0, input = 0) => { - const wasDisconnected = connections.size === 0; - if (isNativeAudioNode(destination)) { - // @todo TypeScript cannot infer the overloaded signature with 3 arguments yet. - connect.call(nativeAudioNode, destination, output, input); - insertElementInSet(connections, [destination, output, input], (connection) => connection[0] === destination && connection[1] === output && connection[2] === input, true); - if (wasDisconnected) { - whenConnected(); - } - return destination; - } - connect.call(nativeAudioNode, destination, output); - insertElementInSet(connections, [destination, output], (connection) => connection[0] === destination && connection[1] === output, true); - if (wasDisconnected) { - whenConnected(); - } - return; - }; - })(nativeAudioNode.connect); - nativeAudioNode.disconnect = ((disconnect) => { - return (destinationOrOutput, output, input) => { - const wasConnected = connections.size > 0; - if (destinationOrOutput === undefined) { - disconnect.apply(nativeAudioNode); - connections.clear(); - } - else if (typeof destinationOrOutput === 'number') { - // @todo TypeScript cannot infer the overloaded signature with 1 argument yet. - disconnect.call(nativeAudioNode, destinationOrOutput); - for (const connection of connections) { - if (connection[1] === destinationOrOutput) { - connections.delete(connection); - } - } - } - else { - if (isNativeAudioNode(destinationOrOutput)) { - // @todo TypeScript cannot infer the overloaded signature with 3 arguments yet. - disconnect.call(nativeAudioNode, destinationOrOutput, output, input); - } - else { - // @todo TypeScript cannot infer the overloaded signature with 2 arguments yet. - disconnect.call(nativeAudioNode, destinationOrOutput, output); - } - for (const connection of connections) { - if (connection[0] === destinationOrOutput && - (output === undefined || connection[1] === output) && - (input === undefined || connection[2] === input)) { - connections.delete(connection); - } - } - } - const isDisconnected = connections.size === 0; - if (wasConnected && isDisconnected) { - whenDisconnected(); - } - }; - })(nativeAudioNode.disconnect); - return nativeAudioNode; - }; -}; - -const assignNativeAudioNodeOption = (nativeAudioNode, options, option) => { - const value = options[option]; - if (value !== undefined && value !== nativeAudioNode[option]) { - nativeAudioNode[option] = value; - } -}; - -const assignNativeAudioNodeOptions = (nativeAudioNode, options) => { - assignNativeAudioNodeOption(nativeAudioNode, options, 'channelCount'); - assignNativeAudioNodeOption(nativeAudioNode, options, 'channelCountMode'); - assignNativeAudioNodeOption(nativeAudioNode, options, 'channelInterpretation'); -}; - -const testAnalyserNodeGetFloatTimeDomainDataMethodSupport = (nativeAnalyserNode) => { - return typeof nativeAnalyserNode.getFloatTimeDomainData === 'function'; -}; - -const wrapAnalyserNodeGetFloatTimeDomainDataMethod = (nativeAnalyserNode) => { - nativeAnalyserNode.getFloatTimeDomainData = (array) => { - const byteTimeDomainData = new Uint8Array(array.length); - nativeAnalyserNode.getByteTimeDomainData(byteTimeDomainData); - const length = Math.max(byteTimeDomainData.length, nativeAnalyserNode.fftSize); - for (let i = 0; i < length; i += 1) { - array[i] = (byteTimeDomainData[i] - 128) * 0.0078125; - } - return array; - }; -}; - -const createNativeAnalyserNodeFactory = (cacheTestResult, createIndexSizeError) => { - return (nativeContext, options) => { - const nativeAnalyserNode = nativeContext.createAnalyser(); - // Bug #37: Firefox does not create an AnalyserNode with the default properties. - assignNativeAudioNodeOptions(nativeAnalyserNode, options); - // Bug #118: Safari does not throw an error if maxDecibels is not more than minDecibels. - if (!(options.maxDecibels > options.minDecibels)) { - throw createIndexSizeError(); - } - assignNativeAudioNodeOption(nativeAnalyserNode, options, 'fftSize'); - assignNativeAudioNodeOption(nativeAnalyserNode, options, 'maxDecibels'); - assignNativeAudioNodeOption(nativeAnalyserNode, options, 'minDecibels'); - assignNativeAudioNodeOption(nativeAnalyserNode, options, 'smoothingTimeConstant'); - // Bug #36: Safari does not support getFloatTimeDomainData() yet. - if (!cacheTestResult(testAnalyserNodeGetFloatTimeDomainDataMethodSupport, () => testAnalyserNodeGetFloatTimeDomainDataMethodSupport(nativeAnalyserNode))) { - wrapAnalyserNodeGetFloatTimeDomainDataMethod(nativeAnalyserNode); - } - return nativeAnalyserNode; - }; -}; - -const createNativeAudioBufferConstructor = (window) => { - if (window === null) { - return null; - } - if (window.hasOwnProperty('AudioBuffer')) { - return window.AudioBuffer; - } - return null; -}; - -const assignNativeAudioNodeAudioParamValue = (nativeAudioNode, options, audioParam) => { - const value = options[audioParam]; - if (value !== undefined && value !== nativeAudioNode[audioParam].value) { - nativeAudioNode[audioParam].value = value; - } -}; - -const wrapAudioBufferSourceNodeStartMethodConsecutiveCalls = (nativeAudioBufferSourceNode) => { - nativeAudioBufferSourceNode.start = ((start) => { - let isScheduled = false; - return (when = 0, offset = 0, duration) => { - if (isScheduled) { - throw createInvalidStateError(); - } - start.call(nativeAudioBufferSourceNode, when, offset, duration); - isScheduled = true; - }; - })(nativeAudioBufferSourceNode.start); -}; - -const wrapAudioScheduledSourceNodeStartMethodNegativeParameters = (nativeAudioScheduledSourceNode) => { - nativeAudioScheduledSourceNode.start = ((start) => { - return (when = 0, offset = 0, duration) => { - if ((typeof duration === 'number' && duration < 0) || offset < 0 || when < 0) { - throw new RangeError("The parameters can't be negative."); - } - // @todo TypeScript cannot infer the overloaded signature with 3 arguments yet. - start.call(nativeAudioScheduledSourceNode, when, offset, duration); - }; - })(nativeAudioScheduledSourceNode.start); -}; - -const wrapAudioScheduledSourceNodeStopMethodNegativeParameters = (nativeAudioScheduledSourceNode) => { - nativeAudioScheduledSourceNode.stop = ((stop) => { - return (when = 0) => { - if (when < 0) { - throw new RangeError("The parameter can't be negative."); - } - stop.call(nativeAudioScheduledSourceNode, when); - }; - })(nativeAudioScheduledSourceNode.stop); -}; - -const createNativeAudioBufferSourceNodeFactory = (addSilentConnection, cacheTestResult, testAudioBufferSourceNodeStartMethodConsecutiveCallsSupport, testAudioBufferSourceNodeStartMethodOffsetClampingSupport, testAudioBufferSourceNodeStopMethodNullifiedBufferSupport, testAudioScheduledSourceNodeStartMethodNegativeParametersSupport, testAudioScheduledSourceNodeStopMethodConsecutiveCallsSupport, testAudioScheduledSourceNodeStopMethodNegativeParametersSupport, wrapAudioBufferSourceNodeStartMethodOffsetClampling, wrapAudioBufferSourceNodeStopMethodNullifiedBuffer, wrapAudioScheduledSourceNodeStopMethodConsecutiveCalls) => { - return (nativeContext, options) => { - const nativeAudioBufferSourceNode = nativeContext.createBufferSource(); - assignNativeAudioNodeOptions(nativeAudioBufferSourceNode, options); - assignNativeAudioNodeAudioParamValue(nativeAudioBufferSourceNode, options, 'playbackRate'); - assignNativeAudioNodeOption(nativeAudioBufferSourceNode, options, 'buffer'); - // Bug #149: Safari does not yet support the detune AudioParam. - assignNativeAudioNodeOption(nativeAudioBufferSourceNode, options, 'loop'); - assignNativeAudioNodeOption(nativeAudioBufferSourceNode, options, 'loopEnd'); - assignNativeAudioNodeOption(nativeAudioBufferSourceNode, options, 'loopStart'); - // Bug #69: Safari does allow calls to start() of an already scheduled AudioBufferSourceNode. - if (!cacheTestResult(testAudioBufferSourceNodeStartMethodConsecutiveCallsSupport, () => testAudioBufferSourceNodeStartMethodConsecutiveCallsSupport(nativeContext))) { - wrapAudioBufferSourceNodeStartMethodConsecutiveCalls(nativeAudioBufferSourceNode); - } - // Bug #154 & #155: Safari does not handle offsets which are equal to or greater than the duration of the buffer. - if (!cacheTestResult(testAudioBufferSourceNodeStartMethodOffsetClampingSupport, () => testAudioBufferSourceNodeStartMethodOffsetClampingSupport(nativeContext))) { - wrapAudioBufferSourceNodeStartMethodOffsetClampling(nativeAudioBufferSourceNode); - } - // Bug #162: Safari does throw an error when stop() is called on an AudioBufferSourceNode which has no buffer assigned to it. - if (!cacheTestResult(testAudioBufferSourceNodeStopMethodNullifiedBufferSupport, () => testAudioBufferSourceNodeStopMethodNullifiedBufferSupport(nativeContext))) { - wrapAudioBufferSourceNodeStopMethodNullifiedBuffer(nativeAudioBufferSourceNode, nativeContext); - } - // Bug #44: Safari does not throw a RangeError yet. - if (!cacheTestResult(testAudioScheduledSourceNodeStartMethodNegativeParametersSupport, () => testAudioScheduledSourceNodeStartMethodNegativeParametersSupport(nativeContext))) { - wrapAudioScheduledSourceNodeStartMethodNegativeParameters(nativeAudioBufferSourceNode); - } - // Bug #19: Safari does not ignore calls to stop() of an already stopped AudioBufferSourceNode. - if (!cacheTestResult(testAudioScheduledSourceNodeStopMethodConsecutiveCallsSupport, () => testAudioScheduledSourceNodeStopMethodConsecutiveCallsSupport(nativeContext))) { - wrapAudioScheduledSourceNodeStopMethodConsecutiveCalls(nativeAudioBufferSourceNode, nativeContext); - } - // Bug #44: Only Firefox does not throw a RangeError yet. - if (!cacheTestResult(testAudioScheduledSourceNodeStopMethodNegativeParametersSupport, () => testAudioScheduledSourceNodeStopMethodNegativeParametersSupport(nativeContext))) { - wrapAudioScheduledSourceNodeStopMethodNegativeParameters(nativeAudioBufferSourceNode); - } - // Bug #175: Safari will not fire an ended event if the AudioBufferSourceNode is unconnected. - addSilentConnection(nativeContext, nativeAudioBufferSourceNode); - return nativeAudioBufferSourceNode; - }; -}; - -const createNativeAudioContextConstructor = (window) => { - if (window === null) { - return null; - } - if (window.hasOwnProperty('AudioContext')) { - return window.AudioContext; - } - return window.hasOwnProperty('webkitAudioContext') ? window.webkitAudioContext : null; -}; - -const createNativeAudioDestinationNodeFactory = (createNativeGainNode, overwriteAccessors) => { - return (nativeContext, channelCount, isNodeOfNativeOfflineAudioContext) => { - const nativeAudioDestinationNode = nativeContext.destination; - // Bug #132: Safari does not have the correct channelCount. - if (nativeAudioDestinationNode.channelCount !== channelCount) { - try { - nativeAudioDestinationNode.channelCount = channelCount; - } - catch { - // Bug #169: Safari throws an error on each attempt to change the channelCount. - } - } - // Bug #83: Safari does not have the correct channelCountMode. - if (isNodeOfNativeOfflineAudioContext && nativeAudioDestinationNode.channelCountMode !== 'explicit') { - nativeAudioDestinationNode.channelCountMode = 'explicit'; - } - // Bug #47: The AudioDestinationNode in Safari does not initialize the maxChannelCount property correctly. - if (nativeAudioDestinationNode.maxChannelCount === 0) { - Object.defineProperty(nativeAudioDestinationNode, 'maxChannelCount', { - value: channelCount - }); - } - // Bug #168: No browser does yet have an AudioDestinationNode with an output. - const gainNode = createNativeGainNode(nativeContext, { - channelCount, - channelCountMode: nativeAudioDestinationNode.channelCountMode, - channelInterpretation: nativeAudioDestinationNode.channelInterpretation, - gain: 1 - }); - overwriteAccessors(gainNode, 'channelCount', (get) => () => get.call(gainNode), (set) => (value) => { - set.call(gainNode, value); - try { - nativeAudioDestinationNode.channelCount = value; - } - catch (err) { - // Bug #169: Safari throws an error on each attempt to change the channelCount. - if (value > nativeAudioDestinationNode.maxChannelCount) { - throw err; - } - } - }); - overwriteAccessors(gainNode, 'channelCountMode', (get) => () => get.call(gainNode), (set) => (value) => { - set.call(gainNode, value); - nativeAudioDestinationNode.channelCountMode = value; - }); - overwriteAccessors(gainNode, 'channelInterpretation', (get) => () => get.call(gainNode), (set) => (value) => { - set.call(gainNode, value); - nativeAudioDestinationNode.channelInterpretation = value; - }); - Object.defineProperty(gainNode, 'maxChannelCount', { - get: () => nativeAudioDestinationNode.maxChannelCount - }); - // @todo This should be disconnected when the context is closed. - gainNode.connect(nativeAudioDestinationNode); - return gainNode; - }; -}; - -const createNativeAudioWorkletNodeConstructor = (window) => { - if (window === null) { - return null; - } - return window.hasOwnProperty('AudioWorkletNode') ? window.AudioWorkletNode : null; -}; - -const testClonabilityOfAudioWorkletNodeOptions = (audioWorkletNodeOptions) => { - const { port1 } = new MessageChannel(); - try { - // This will throw an error if the audioWorkletNodeOptions are not clonable. - port1.postMessage(audioWorkletNodeOptions); - } - finally { - port1.close(); - } -}; - -const createNativeAudioWorkletNodeFactory = (createInvalidStateError, createNativeAudioWorkletNodeFaker, createNativeGainNode, createNotSupportedError, monitorConnections) => { - return (nativeContext, baseLatency, nativeAudioWorkletNodeConstructor, name, processorConstructor, options) => { - if (nativeAudioWorkletNodeConstructor !== null) { - try { - const nativeAudioWorkletNode = new nativeAudioWorkletNodeConstructor(nativeContext, name, options); - const patchedEventListeners = new Map(); - let onprocessorerror = null; - Object.defineProperties(nativeAudioWorkletNode, { - /* - * Bug #61: Overwriting the property accessors for channelCount and channelCountMode is necessary as long as some - * browsers have no native implementation to achieve a consistent behavior. - */ - channelCount: { - get: () => options.channelCount, - set: () => { - throw createInvalidStateError(); - } - }, - channelCountMode: { - get: () => 'explicit', - set: () => { - throw createInvalidStateError(); - } - }, - // Bug #156: Chrome and Edge do not yet fire an ErrorEvent. - onprocessorerror: { - get: () => onprocessorerror, - set: (value) => { - if (typeof onprocessorerror === 'function') { - nativeAudioWorkletNode.removeEventListener('processorerror', onprocessorerror); - } - onprocessorerror = typeof value === 'function' ? value : null; - if (typeof onprocessorerror === 'function') { - nativeAudioWorkletNode.addEventListener('processorerror', onprocessorerror); - } - } - } - }); - nativeAudioWorkletNode.addEventListener = ((addEventListener) => { - return (...args) => { - if (args[0] === 'processorerror') { - const unpatchedEventListener = typeof args[1] === 'function' - ? args[1] - : typeof args[1] === 'object' && args[1] !== null && typeof args[1].handleEvent === 'function' - ? args[1].handleEvent - : null; - if (unpatchedEventListener !== null) { - const patchedEventListener = patchedEventListeners.get(args[1]); - if (patchedEventListener !== undefined) { - args[1] = patchedEventListener; - } - else { - args[1] = (event) => { - // Bug #178: Chrome, Edge and Opera do fire an event of type error. - if (event.type === 'error') { - Object.defineProperties(event, { - type: { value: 'processorerror' } - }); - unpatchedEventListener(event); - } - else { - unpatchedEventListener(new ErrorEvent(args[0], { ...event })); - } - }; - patchedEventListeners.set(unpatchedEventListener, args[1]); - } - } - } - // Bug #178: Chrome, Edge and Opera do fire an event of type error. - addEventListener.call(nativeAudioWorkletNode, 'error', args[1], args[2]); - return addEventListener.call(nativeAudioWorkletNode, ...args); - }; - })(nativeAudioWorkletNode.addEventListener); - nativeAudioWorkletNode.removeEventListener = ((removeEventListener) => { - return (...args) => { - if (args[0] === 'processorerror') { - const patchedEventListener = patchedEventListeners.get(args[1]); - if (patchedEventListener !== undefined) { - patchedEventListeners.delete(args[1]); - args[1] = patchedEventListener; - } - } - // Bug #178: Chrome, Edge and Opera do fire an event of type error. - removeEventListener.call(nativeAudioWorkletNode, 'error', args[1], args[2]); - return removeEventListener.call(nativeAudioWorkletNode, args[0], args[1], args[2]); - }; - })(nativeAudioWorkletNode.removeEventListener); - /* - * Bug #86: Chrome and Edge do not invoke the process() function if the corresponding AudioWorkletNode is unconnected but - * has an output. - */ - if (options.numberOfOutputs !== 0) { - const nativeGainNode = createNativeGainNode(nativeContext, { - channelCount: 1, - channelCountMode: 'explicit', - channelInterpretation: 'discrete', - gain: 0 - }); - nativeAudioWorkletNode.connect(nativeGainNode).connect(nativeContext.destination); - const whenConnected = () => nativeGainNode.disconnect(); - const whenDisconnected = () => nativeGainNode.connect(nativeContext.destination); - // @todo Disconnect the connection when the process() function of the AudioWorkletNode returns false. - return monitorConnections(nativeAudioWorkletNode, whenConnected, whenDisconnected); - } - return nativeAudioWorkletNode; - } - catch (err) { - // Bug #60: Chrome, Edge & Opera throw an InvalidStateError instead of a NotSupportedError. - if (err.code === 11) { - throw createNotSupportedError(); - } - throw err; - } - } - // Bug #61: Only Chrome & Opera have an implementation of the AudioWorkletNode yet. - if (processorConstructor === undefined) { - throw createNotSupportedError(); - } - testClonabilityOfAudioWorkletNodeOptions(options); - return createNativeAudioWorkletNodeFaker(nativeContext, baseLatency, processorConstructor, options); - }; -}; - -const computeBufferSize = (baseLatency, sampleRate) => { - if (baseLatency === null) { - return 512; - } - return Math.max(512, Math.min(16384, Math.pow(2, Math.round(Math.log2(baseLatency * sampleRate))))); -}; - -const cloneAudioWorkletNodeOptions = (audioWorkletNodeOptions) => { - return new Promise((resolve, reject) => { - const { port1, port2 } = new MessageChannel(); - port1.onmessage = ({ data }) => { - port1.close(); - port2.close(); - resolve(data); - }; - port1.onmessageerror = ({ data }) => { - port1.close(); - port2.close(); - reject(data); - }; - // This will throw an error if the audioWorkletNodeOptions are not clonable. - port2.postMessage(audioWorkletNodeOptions); - }); -}; - -const createAudioWorkletProcessorPromise = async (processorConstructor, audioWorkletNodeOptions) => { - const clonedAudioWorkletNodeOptions = await cloneAudioWorkletNodeOptions(audioWorkletNodeOptions); - return new processorConstructor(clonedAudioWorkletNodeOptions); -}; - -const createAudioWorkletProcessor = (nativeContext, nativeAudioWorkletNode, processorConstructor, audioWorkletNodeOptions) => { - let nodeToProcessorMap = NODE_TO_PROCESSOR_MAPS.get(nativeContext); - if (nodeToProcessorMap === undefined) { - nodeToProcessorMap = new WeakMap(); - NODE_TO_PROCESSOR_MAPS.set(nativeContext, nodeToProcessorMap); - } - const audioWorkletProcessorPromise = createAudioWorkletProcessorPromise(processorConstructor, audioWorkletNodeOptions); - nodeToProcessorMap.set(nativeAudioWorkletNode, audioWorkletProcessorPromise); - return audioWorkletProcessorPromise; -}; - -const createNativeAudioWorkletNodeFakerFactory = (connectMultipleOutputs, createIndexSizeError, createInvalidStateError, createNativeChannelMergerNode, createNativeChannelSplitterNode, createNativeConstantSourceNode, createNativeGainNode, createNativeScriptProcessorNode, createNotSupportedError, disconnectMultipleOutputs, exposeCurrentFrameAndCurrentTime, getActiveAudioWorkletNodeInputs, monitorConnections) => { - return (nativeContext, baseLatency, processorConstructor, options) => { - if (options.numberOfInputs === 0 && options.numberOfOutputs === 0) { - throw createNotSupportedError(); - } - const outputChannelCount = Array.isArray(options.outputChannelCount) - ? options.outputChannelCount - : Array.from(options.outputChannelCount); - // @todo Check if any of the channelCount values is greater than the implementation's maximum number of channels. - if (outputChannelCount.some((channelCount) => channelCount < 1)) { - throw createNotSupportedError(); - } - if (outputChannelCount.length !== options.numberOfOutputs) { - throw createIndexSizeError(); - } - // Bug #61: This is not part of the standard but required for the faker to work. - if (options.channelCountMode !== 'explicit') { - throw createNotSupportedError(); - } - const numberOfInputChannels = options.channelCount * options.numberOfInputs; - const numberOfOutputChannels = outputChannelCount.reduce((sum, value) => sum + value, 0); - const numberOfParameters = processorConstructor.parameterDescriptors === undefined ? 0 : processorConstructor.parameterDescriptors.length; - // Bug #61: This is not part of the standard but required for the faker to work. - if (numberOfInputChannels + numberOfParameters > 6 || numberOfOutputChannels > 6) { - throw createNotSupportedError(); - } - const messageChannel = new MessageChannel(); - const gainNodes = []; - const inputChannelSplitterNodes = []; - for (let i = 0; i < options.numberOfInputs; i += 1) { - gainNodes.push(createNativeGainNode(nativeContext, { - channelCount: options.channelCount, - channelCountMode: options.channelCountMode, - channelInterpretation: options.channelInterpretation, - gain: 1 - })); - inputChannelSplitterNodes.push(createNativeChannelSplitterNode(nativeContext, { - channelCount: options.channelCount, - channelCountMode: 'explicit', - channelInterpretation: 'discrete', - numberOfOutputs: options.channelCount - })); - } - const constantSourceNodes = []; - if (processorConstructor.parameterDescriptors !== undefined) { - for (const { defaultValue, maxValue, minValue, name } of processorConstructor.parameterDescriptors) { - const constantSourceNode = createNativeConstantSourceNode(nativeContext, { - channelCount: 1, - channelCountMode: 'explicit', - channelInterpretation: 'discrete', - offset: options.parameterData[name] !== undefined - ? options.parameterData[name] - : defaultValue === undefined - ? 0 - : defaultValue - }); - Object.defineProperties(constantSourceNode.offset, { - defaultValue: { - get: () => (defaultValue === undefined ? 0 : defaultValue) - }, - maxValue: { - get: () => (maxValue === undefined ? MOST_POSITIVE_SINGLE_FLOAT : maxValue) - }, - minValue: { - get: () => (minValue === undefined ? MOST_NEGATIVE_SINGLE_FLOAT : minValue) - } - }); - constantSourceNodes.push(constantSourceNode); - } - } - const inputChannelMergerNode = createNativeChannelMergerNode(nativeContext, { - channelCount: 1, - channelCountMode: 'explicit', - channelInterpretation: 'speakers', - numberOfInputs: Math.max(1, numberOfInputChannels + numberOfParameters) - }); - const bufferSize = computeBufferSize(baseLatency, nativeContext.sampleRate); - const scriptProcessorNode = createNativeScriptProcessorNode(nativeContext, bufferSize, numberOfInputChannels + numberOfParameters, - // Bug #87: Only Firefox will fire an AudioProcessingEvent if there is no connected output. - Math.max(1, numberOfOutputChannels)); - const outputChannelSplitterNode = createNativeChannelSplitterNode(nativeContext, { - channelCount: Math.max(1, numberOfOutputChannels), - channelCountMode: 'explicit', - channelInterpretation: 'discrete', - numberOfOutputs: Math.max(1, numberOfOutputChannels) - }); - const outputChannelMergerNodes = []; - for (let i = 0; i < options.numberOfOutputs; i += 1) { - outputChannelMergerNodes.push(createNativeChannelMergerNode(nativeContext, { - channelCount: 1, - channelCountMode: 'explicit', - channelInterpretation: 'speakers', - numberOfInputs: outputChannelCount[i] - })); - } - for (let i = 0; i < options.numberOfInputs; i += 1) { - gainNodes[i].connect(inputChannelSplitterNodes[i]); - for (let j = 0; j < options.channelCount; j += 1) { - inputChannelSplitterNodes[i].connect(inputChannelMergerNode, j, i * options.channelCount + j); - } - } - const parameterMap = new ReadOnlyMap(processorConstructor.parameterDescriptors === undefined - ? [] - : processorConstructor.parameterDescriptors.map(({ name }, index) => { - const constantSourceNode = constantSourceNodes[index]; - constantSourceNode.connect(inputChannelMergerNode, 0, numberOfInputChannels + index); - constantSourceNode.start(0); - return [name, constantSourceNode.offset]; - })); - inputChannelMergerNode.connect(scriptProcessorNode); - let channelInterpretation = options.channelInterpretation; - let onprocessorerror = null; - // Bug #87: Expose at least one output to make this node connectable. - const outputAudioNodes = options.numberOfOutputs === 0 ? [scriptProcessorNode] : outputChannelMergerNodes; - const nativeAudioWorkletNodeFaker = { - get bufferSize() { - return bufferSize; - }, - get channelCount() { - return options.channelCount; - }, - set channelCount(_) { - // Bug #61: This is not part of the standard but required for the faker to work. - throw createInvalidStateError(); - }, - get channelCountMode() { - return options.channelCountMode; - }, - set channelCountMode(_) { - // Bug #61: This is not part of the standard but required for the faker to work. - throw createInvalidStateError(); - }, - get channelInterpretation() { - return channelInterpretation; - }, - set channelInterpretation(value) { - for (const gainNode of gainNodes) { - gainNode.channelInterpretation = value; - } - channelInterpretation = value; - }, - get context() { - return scriptProcessorNode.context; - }, - get inputs() { - return gainNodes; - }, - get numberOfInputs() { - return options.numberOfInputs; - }, - get numberOfOutputs() { - return options.numberOfOutputs; - }, - get onprocessorerror() { - return onprocessorerror; - }, - set onprocessorerror(value) { - if (typeof onprocessorerror === 'function') { - nativeAudioWorkletNodeFaker.removeEventListener('processorerror', onprocessorerror); - } - onprocessorerror = typeof value === 'function' ? value : null; - if (typeof onprocessorerror === 'function') { - nativeAudioWorkletNodeFaker.addEventListener('processorerror', onprocessorerror); - } - }, - get parameters() { - return parameterMap; - }, - get port() { - return messageChannel.port2; - }, - addEventListener(...args) { - return scriptProcessorNode.addEventListener(args[0], args[1], args[2]); - }, - connect: connectMultipleOutputs.bind(null, outputAudioNodes), - disconnect: disconnectMultipleOutputs.bind(null, outputAudioNodes), - dispatchEvent(...args) { - return scriptProcessorNode.dispatchEvent(args[0]); - }, - removeEventListener(...args) { - return scriptProcessorNode.removeEventListener(args[0], args[1], args[2]); - } - }; - const patchedEventListeners = new Map(); - messageChannel.port1.addEventListener = ((addEventListener) => { - return (...args) => { - if (args[0] === 'message') { - const unpatchedEventListener = typeof args[1] === 'function' - ? args[1] - : typeof args[1] === 'object' && args[1] !== null && typeof args[1].handleEvent === 'function' - ? args[1].handleEvent - : null; - if (unpatchedEventListener !== null) { - const patchedEventListener = patchedEventListeners.get(args[1]); - if (patchedEventListener !== undefined) { - args[1] = patchedEventListener; - } - else { - args[1] = (event) => { - exposeCurrentFrameAndCurrentTime(nativeContext.currentTime, nativeContext.sampleRate, () => unpatchedEventListener(event)); - }; - patchedEventListeners.set(unpatchedEventListener, args[1]); - } - } - } - return addEventListener.call(messageChannel.port1, args[0], args[1], args[2]); - }; - })(messageChannel.port1.addEventListener); - messageChannel.port1.removeEventListener = ((removeEventListener) => { - return (...args) => { - if (args[0] === 'message') { - const patchedEventListener = patchedEventListeners.get(args[1]); - if (patchedEventListener !== undefined) { - patchedEventListeners.delete(args[1]); - args[1] = patchedEventListener; - } - } - return removeEventListener.call(messageChannel.port1, args[0], args[1], args[2]); - }; - })(messageChannel.port1.removeEventListener); - let onmessage = null; - Object.defineProperty(messageChannel.port1, 'onmessage', { - get: () => onmessage, - set: (value) => { - if (typeof onmessage === 'function') { - messageChannel.port1.removeEventListener('message', onmessage); - } - onmessage = typeof value === 'function' ? value : null; - if (typeof onmessage === 'function') { - messageChannel.port1.addEventListener('message', onmessage); - messageChannel.port1.start(); - } - } - }); - processorConstructor.prototype.port = messageChannel.port1; - let audioWorkletProcessor = null; - const audioWorkletProcessorPromise = createAudioWorkletProcessor(nativeContext, nativeAudioWorkletNodeFaker, processorConstructor, options); - audioWorkletProcessorPromise.then((dWrkltPrcssr) => (audioWorkletProcessor = dWrkltPrcssr)); - const inputs = createNestedArrays(options.numberOfInputs, options.channelCount); - const outputs = createNestedArrays(options.numberOfOutputs, outputChannelCount); - const parameters = processorConstructor.parameterDescriptors === undefined - ? [] - : processorConstructor.parameterDescriptors.reduce((prmtrs, { name }) => ({ ...prmtrs, [name]: new Float32Array(128) }), {}); - let isActive = true; - const disconnectOutputsGraph = () => { - if (options.numberOfOutputs > 0) { - scriptProcessorNode.disconnect(outputChannelSplitterNode); - } - for (let i = 0, outputChannelSplitterNodeOutput = 0; i < options.numberOfOutputs; i += 1) { - const outputChannelMergerNode = outputChannelMergerNodes[i]; - for (let j = 0; j < outputChannelCount[i]; j += 1) { - outputChannelSplitterNode.disconnect(outputChannelMergerNode, outputChannelSplitterNodeOutput + j, j); - } - outputChannelSplitterNodeOutput += outputChannelCount[i]; - } - }; - const activeInputIndexes = new Map(); - // tslint:disable-next-line:deprecation - scriptProcessorNode.onaudioprocess = ({ inputBuffer, outputBuffer }) => { - if (audioWorkletProcessor !== null) { - const activeInputs = getActiveAudioWorkletNodeInputs(nativeAudioWorkletNodeFaker); - for (let i = 0; i < bufferSize; i += 128) { - for (let j = 0; j < options.numberOfInputs; j += 1) { - for (let k = 0; k < options.channelCount; k += 1) { - copyFromChannel(inputBuffer, inputs[j], k, k, i); - } - } - if (processorConstructor.parameterDescriptors !== undefined) { - processorConstructor.parameterDescriptors.forEach(({ name }, index) => { - copyFromChannel(inputBuffer, parameters, name, numberOfInputChannels + index, i); - }); - } - for (let j = 0; j < options.numberOfInputs; j += 1) { - for (let k = 0; k < outputChannelCount[j]; k += 1) { - // The byteLength will be 0 when the ArrayBuffer was transferred. - if (outputs[j][k].byteLength === 0) { - outputs[j][k] = new Float32Array(128); - } - } - } - try { - const potentiallyEmptyInputs = inputs.map((input, index) => { - const activeInput = activeInputs[index]; - if (activeInput.size > 0) { - activeInputIndexes.set(index, bufferSize / 128); - return input; - } - const count = activeInputIndexes.get(index); - if (count === undefined) { - return []; - } - if (input.every((channelData) => channelData.every((sample) => sample === 0))) { - if (count === 1) { - activeInputIndexes.delete(index); - } - else { - activeInputIndexes.set(index, count - 1); - } - } - return input; - }); - const activeSourceFlag = exposeCurrentFrameAndCurrentTime(nativeContext.currentTime + i / nativeContext.sampleRate, nativeContext.sampleRate, () => audioWorkletProcessor.process(potentiallyEmptyInputs, outputs, parameters)); - isActive = activeSourceFlag; - for (let j = 0, outputChannelSplitterNodeOutput = 0; j < options.numberOfOutputs; j += 1) { - for (let k = 0; k < outputChannelCount[j]; k += 1) { - copyToChannel(outputBuffer, outputs[j], k, outputChannelSplitterNodeOutput + k, i); - } - outputChannelSplitterNodeOutput += outputChannelCount[j]; - } - } - catch (error) { - isActive = false; - nativeAudioWorkletNodeFaker.dispatchEvent(new ErrorEvent('processorerror', { - colno: error.colno, - filename: error.filename, - lineno: error.lineno, - message: error.message - })); - } - if (!isActive) { - for (let j = 0; j < options.numberOfInputs; j += 1) { - gainNodes[j].disconnect(inputChannelSplitterNodes[j]); - for (let k = 0; k < options.channelCount; k += 1) { - inputChannelSplitterNodes[i].disconnect(inputChannelMergerNode, k, j * options.channelCount + k); - } - } - if (processorConstructor.parameterDescriptors !== undefined) { - const length = processorConstructor.parameterDescriptors.length; - for (let j = 0; j < length; j += 1) { - const constantSourceNode = constantSourceNodes[j]; - constantSourceNode.disconnect(inputChannelMergerNode, 0, numberOfInputChannels + j); - constantSourceNode.stop(); - } - } - inputChannelMergerNode.disconnect(scriptProcessorNode); - scriptProcessorNode.onaudioprocess = null; // tslint:disable-line:deprecation - if (isConnected) { - disconnectOutputsGraph(); - } - else { - disconnectFakeGraph(); - } - break; - } - } - } - }; - let isConnected = false; - // Bug #87: Only Firefox will fire an AudioProcessingEvent if there is no connected output. - const nativeGainNode = createNativeGainNode(nativeContext, { - channelCount: 1, - channelCountMode: 'explicit', - channelInterpretation: 'discrete', - gain: 0 - }); - const connectFakeGraph = () => scriptProcessorNode.connect(nativeGainNode).connect(nativeContext.destination); - const disconnectFakeGraph = () => { - scriptProcessorNode.disconnect(nativeGainNode); - nativeGainNode.disconnect(); - }; - const whenConnected = () => { - if (isActive) { - disconnectFakeGraph(); - if (options.numberOfOutputs > 0) { - scriptProcessorNode.connect(outputChannelSplitterNode); - } - for (let i = 0, outputChannelSplitterNodeOutput = 0; i < options.numberOfOutputs; i += 1) { - const outputChannelMergerNode = outputChannelMergerNodes[i]; - for (let j = 0; j < outputChannelCount[i]; j += 1) { - outputChannelSplitterNode.connect(outputChannelMergerNode, outputChannelSplitterNodeOutput + j, j); - } - outputChannelSplitterNodeOutput += outputChannelCount[i]; - } - } - isConnected = true; - }; - const whenDisconnected = () => { - if (isActive) { - connectFakeGraph(); - disconnectOutputsGraph(); - } - isConnected = false; - }; - connectFakeGraph(); - return monitorConnections(nativeAudioWorkletNodeFaker, whenConnected, whenDisconnected); - }; -}; - -const createNativeBiquadFilterNode = (nativeContext, options) => { - const nativeBiquadFilterNode = nativeContext.createBiquadFilter(); - assignNativeAudioNodeOptions(nativeBiquadFilterNode, options); - assignNativeAudioNodeAudioParamValue(nativeBiquadFilterNode, options, 'Q'); - assignNativeAudioNodeAudioParamValue(nativeBiquadFilterNode, options, 'detune'); - assignNativeAudioNodeAudioParamValue(nativeBiquadFilterNode, options, 'frequency'); - assignNativeAudioNodeAudioParamValue(nativeBiquadFilterNode, options, 'gain'); - assignNativeAudioNodeOption(nativeBiquadFilterNode, options, 'type'); - return nativeBiquadFilterNode; -}; - -const createNativeChannelMergerNodeFactory = (nativeAudioContextConstructor, wrapChannelMergerNode) => { - return (nativeContext, options) => { - const nativeChannelMergerNode = nativeContext.createChannelMerger(options.numberOfInputs); - /* - * Bug #20: Safari requires a connection of any kind to treat the input signal correctly. - * @todo Unfortunately there is no way to test for this behavior in a synchronous fashion which is why testing for the existence of - * the webkitAudioContext is used as a workaround here. - */ - if (nativeAudioContextConstructor !== null && nativeAudioContextConstructor.name === 'webkitAudioContext') { - wrapChannelMergerNode(nativeContext, nativeChannelMergerNode); - } - assignNativeAudioNodeOptions(nativeChannelMergerNode, options); - return nativeChannelMergerNode; - }; -}; - -const wrapChannelSplitterNode = (channelSplitterNode) => { - const channelCount = channelSplitterNode.numberOfOutputs; - // Bug #97: Safari does not throw an error when attempting to change the channelCount to something other than its initial value. - Object.defineProperty(channelSplitterNode, 'channelCount', { - get: () => channelCount, - set: (value) => { - if (value !== channelCount) { - throw createInvalidStateError(); - } - } - }); - // Bug #30: Safari does not throw an error when attempting to change the channelCountMode to something other than explicit. - Object.defineProperty(channelSplitterNode, 'channelCountMode', { - get: () => 'explicit', - set: (value) => { - if (value !== 'explicit') { - throw createInvalidStateError(); - } - } - }); - // Bug #32: Safari does not throw an error when attempting to change the channelInterpretation to something other than discrete. - Object.defineProperty(channelSplitterNode, 'channelInterpretation', { - get: () => 'discrete', - set: (value) => { - if (value !== 'discrete') { - throw createInvalidStateError(); - } - } - }); -}; - -const createNativeChannelSplitterNode = (nativeContext, options) => { - const nativeChannelSplitterNode = nativeContext.createChannelSplitter(options.numberOfOutputs); - // Bug #96: Safari does not have the correct channelCount. - // Bug #29: Safari does not have the correct channelCountMode. - // Bug #31: Safari does not have the correct channelInterpretation. - assignNativeAudioNodeOptions(nativeChannelSplitterNode, options); - // Bug #29, #30, #31, #32, #96 & #97: Only Chrome, Edge, Firefox & Opera partially support the spec yet. - wrapChannelSplitterNode(nativeChannelSplitterNode); - return nativeChannelSplitterNode; -}; - -const createNativeConstantSourceNodeFactory = (addSilentConnection, cacheTestResult, createNativeConstantSourceNodeFaker, testAudioScheduledSourceNodeStartMethodNegativeParametersSupport, testAudioScheduledSourceNodeStopMethodNegativeParametersSupport) => { - return (nativeContext, options) => { - // Bug #62: Safari does not support ConstantSourceNodes. - if (nativeContext.createConstantSource === undefined) { - return createNativeConstantSourceNodeFaker(nativeContext, options); - } - const nativeConstantSourceNode = nativeContext.createConstantSource(); - assignNativeAudioNodeOptions(nativeConstantSourceNode, options); - assignNativeAudioNodeAudioParamValue(nativeConstantSourceNode, options, 'offset'); - // Bug #44: Safari does not throw a RangeError yet. - if (!cacheTestResult(testAudioScheduledSourceNodeStartMethodNegativeParametersSupport, () => testAudioScheduledSourceNodeStartMethodNegativeParametersSupport(nativeContext))) { - wrapAudioScheduledSourceNodeStartMethodNegativeParameters(nativeConstantSourceNode); - } - // Bug #44: Only Firefox does not throw a RangeError yet. - if (!cacheTestResult(testAudioScheduledSourceNodeStopMethodNegativeParametersSupport, () => testAudioScheduledSourceNodeStopMethodNegativeParametersSupport(nativeContext))) { - wrapAudioScheduledSourceNodeStopMethodNegativeParameters(nativeConstantSourceNode); - } - // Bug #175: Safari will not fire an ended event if the ConstantSourceNode is unconnected. - addSilentConnection(nativeContext, nativeConstantSourceNode); - return nativeConstantSourceNode; - }; -}; - -const interceptConnections = (original, interceptor) => { - original.connect = interceptor.connect.bind(interceptor); - original.disconnect = interceptor.disconnect.bind(interceptor); - return original; -}; - -const createNativeConstantSourceNodeFakerFactory = (addSilentConnection, createNativeAudioBufferSourceNode, createNativeGainNode, monitorConnections) => { - return (nativeContext, { offset, ...audioNodeOptions }) => { - const audioBuffer = nativeContext.createBuffer(1, 2, 44100); - const audioBufferSourceNode = createNativeAudioBufferSourceNode(nativeContext, { - buffer: null, - channelCount: 2, - channelCountMode: 'max', - channelInterpretation: 'speakers', - loop: false, - loopEnd: 0, - loopStart: 0, - playbackRate: 1 - }); - const gainNode = createNativeGainNode(nativeContext, { ...audioNodeOptions, gain: offset }); - // Bug #5: Safari does not support copyFromChannel() and copyToChannel(). - const channelData = audioBuffer.getChannelData(0); - // Bug #95: Safari does not play or loop one sample buffers. - channelData[0] = 1; - channelData[1] = 1; - audioBufferSourceNode.buffer = audioBuffer; - audioBufferSourceNode.loop = true; - const nativeConstantSourceNodeFaker = { - get bufferSize() { - return undefined; - }, - get channelCount() { - return gainNode.channelCount; - }, - set channelCount(value) { - gainNode.channelCount = value; - }, - get channelCountMode() { - return gainNode.channelCountMode; - }, - set channelCountMode(value) { - gainNode.channelCountMode = value; - }, - get channelInterpretation() { - return gainNode.channelInterpretation; - }, - set channelInterpretation(value) { - gainNode.channelInterpretation = value; - }, - get context() { - return gainNode.context; - }, - get inputs() { - return []; - }, - get numberOfInputs() { - return audioBufferSourceNode.numberOfInputs; - }, - get numberOfOutputs() { - return gainNode.numberOfOutputs; - }, - get offset() { - return gainNode.gain; - }, - get onended() { - return audioBufferSourceNode.onended; - }, - set onended(value) { - audioBufferSourceNode.onended = value; - }, - addEventListener(...args) { - return audioBufferSourceNode.addEventListener(args[0], args[1], args[2]); - }, - dispatchEvent(...args) { - return audioBufferSourceNode.dispatchEvent(args[0]); - }, - removeEventListener(...args) { - return audioBufferSourceNode.removeEventListener(args[0], args[1], args[2]); - }, - start(when = 0) { - audioBufferSourceNode.start.call(audioBufferSourceNode, when); - }, - stop(when = 0) { - audioBufferSourceNode.stop.call(audioBufferSourceNode, when); - } - }; - const whenConnected = () => audioBufferSourceNode.connect(gainNode); - const whenDisconnected = () => audioBufferSourceNode.disconnect(gainNode); - // Bug #175: Safari will not fire an ended event if the AudioBufferSourceNode is unconnected. - addSilentConnection(nativeContext, audioBufferSourceNode); - return monitorConnections(interceptConnections(nativeConstantSourceNodeFaker, gainNode), whenConnected, whenDisconnected); - }; -}; - -const createNativeConvolverNodeFactory = (createNotSupportedError, overwriteAccessors) => { - return (nativeContext, options) => { - const nativeConvolverNode = nativeContext.createConvolver(); - assignNativeAudioNodeOptions(nativeConvolverNode, options); - // The normalize property needs to be set before setting the buffer. - if (options.disableNormalization === nativeConvolverNode.normalize) { - nativeConvolverNode.normalize = !options.disableNormalization; - } - assignNativeAudioNodeOption(nativeConvolverNode, options, 'buffer'); - // Bug #113: Safari does allow to set the channelCount to a value larger than 2. - if (options.channelCount > 2) { - throw createNotSupportedError(); - } - overwriteAccessors(nativeConvolverNode, 'channelCount', (get) => () => get.call(nativeConvolverNode), (set) => (value) => { - if (value > 2) { - throw createNotSupportedError(); - } - return set.call(nativeConvolverNode, value); - }); - // Bug #114: Safari allows to set the channelCountMode to 'max'. - if (options.channelCountMode === 'max') { - throw createNotSupportedError(); - } - overwriteAccessors(nativeConvolverNode, 'channelCountMode', (get) => () => get.call(nativeConvolverNode), (set) => (value) => { - if (value === 'max') { - throw createNotSupportedError(); - } - return set.call(nativeConvolverNode, value); - }); - return nativeConvolverNode; - }; -}; - -const createNativeDelayNode = (nativeContext, options) => { - const nativeDelayNode = nativeContext.createDelay(options.maxDelayTime); - assignNativeAudioNodeOptions(nativeDelayNode, options); - assignNativeAudioNodeAudioParamValue(nativeDelayNode, options, 'delayTime'); - return nativeDelayNode; -}; - -const createNativeDynamicsCompressorNodeFactory = (createNotSupportedError) => { - return (nativeContext, options) => { - const nativeDynamicsCompressorNode = nativeContext.createDynamicsCompressor(); - assignNativeAudioNodeOptions(nativeDynamicsCompressorNode, options); - // Bug #108: Safari allows a channelCount of three and above. - if (options.channelCount > 2) { - throw createNotSupportedError(); - } - // Bug #109: Only Chrome, Firefox and Opera disallow a channelCountMode of 'max'. - if (options.channelCountMode === 'max') { - throw createNotSupportedError(); - } - assignNativeAudioNodeAudioParamValue(nativeDynamicsCompressorNode, options, 'attack'); - assignNativeAudioNodeAudioParamValue(nativeDynamicsCompressorNode, options, 'knee'); - assignNativeAudioNodeAudioParamValue(nativeDynamicsCompressorNode, options, 'ratio'); - assignNativeAudioNodeAudioParamValue(nativeDynamicsCompressorNode, options, 'release'); - assignNativeAudioNodeAudioParamValue(nativeDynamicsCompressorNode, options, 'threshold'); - return nativeDynamicsCompressorNode; - }; -}; - -const createNativeGainNode = (nativeContext, options) => { - const nativeGainNode = nativeContext.createGain(); - assignNativeAudioNodeOptions(nativeGainNode, options); - assignNativeAudioNodeAudioParamValue(nativeGainNode, options, 'gain'); - return nativeGainNode; -}; - -const createNativeIIRFilterNodeFactory = (createNativeIIRFilterNodeFaker) => { - return (nativeContext, baseLatency, options) => { - // Bug #9: Safari does not support IIRFilterNodes. - if (nativeContext.createIIRFilter === undefined) { - return createNativeIIRFilterNodeFaker(nativeContext, baseLatency, options); - } - // @todo TypeScript defines the parameters of createIIRFilter() as arrays of numbers. - const nativeIIRFilterNode = nativeContext.createIIRFilter(options.feedforward, options.feedback); - assignNativeAudioNodeOptions(nativeIIRFilterNode, options); - return nativeIIRFilterNode; - }; -}; - -function divide(a, b) { - const denominator = b[0] * b[0] + b[1] * b[1]; - return [(a[0] * b[0] + a[1] * b[1]) / denominator, (a[1] * b[0] - a[0] * b[1]) / denominator]; -} -function multiply(a, b) { - return [a[0] * b[0] - a[1] * b[1], a[0] * b[1] + a[1] * b[0]]; -} -function evaluatePolynomial(coefficient, z) { - let result = [0, 0]; - for (let i = coefficient.length - 1; i >= 0; i -= 1) { - result = multiply(result, z); - result[0] += coefficient[i]; - } - return result; -} -const createNativeIIRFilterNodeFakerFactory = (createInvalidAccessError, createInvalidStateError, createNativeScriptProcessorNode, createNotSupportedError) => { - return (nativeContext, baseLatency, { channelCount, channelCountMode, channelInterpretation, feedback, feedforward }) => { - const bufferSize = computeBufferSize(baseLatency, nativeContext.sampleRate); - const convertedFeedback = feedback instanceof Float64Array ? feedback : new Float64Array(feedback); - const convertedFeedforward = feedforward instanceof Float64Array ? feedforward : new Float64Array(feedforward); - const feedbackLength = convertedFeedback.length; - const feedforwardLength = convertedFeedforward.length; - const minLength = Math.min(feedbackLength, feedforwardLength); - if (feedbackLength === 0 || feedbackLength > 20) { - throw createNotSupportedError(); - } - if (convertedFeedback[0] === 0) { - throw createInvalidStateError(); - } - if (feedforwardLength === 0 || feedforwardLength > 20) { - throw createNotSupportedError(); - } - if (convertedFeedforward[0] === 0) { - throw createInvalidStateError(); - } - if (convertedFeedback[0] !== 1) { - for (let i = 0; i < feedforwardLength; i += 1) { - convertedFeedforward[i] /= convertedFeedback[0]; - } - for (let i = 1; i < feedbackLength; i += 1) { - convertedFeedback[i] /= convertedFeedback[0]; - } - } - const scriptProcessorNode = createNativeScriptProcessorNode(nativeContext, bufferSize, channelCount, channelCount); - scriptProcessorNode.channelCount = channelCount; - scriptProcessorNode.channelCountMode = channelCountMode; - scriptProcessorNode.channelInterpretation = channelInterpretation; - const bufferLength = 32; - const bufferIndexes = []; - const xBuffers = []; - const yBuffers = []; - for (let i = 0; i < channelCount; i += 1) { - bufferIndexes.push(0); - const xBuffer = new Float32Array(bufferLength); - const yBuffer = new Float32Array(bufferLength); - xBuffer.fill(0); - yBuffer.fill(0); - xBuffers.push(xBuffer); - yBuffers.push(yBuffer); - } - // tslint:disable-next-line:deprecation - scriptProcessorNode.onaudioprocess = (event) => { - const inputBuffer = event.inputBuffer; - const outputBuffer = event.outputBuffer; - const numberOfChannels = inputBuffer.numberOfChannels; - for (let i = 0; i < numberOfChannels; i += 1) { - const input = inputBuffer.getChannelData(i); - const output = outputBuffer.getChannelData(i); - bufferIndexes[i] = filterBuffer(convertedFeedback, feedbackLength, convertedFeedforward, feedforwardLength, minLength, xBuffers[i], yBuffers[i], bufferIndexes[i], bufferLength, input, output); - } - }; - const nyquist = nativeContext.sampleRate / 2; - const nativeIIRFilterNodeFaker = { - get bufferSize() { - return bufferSize; - }, - get channelCount() { - return scriptProcessorNode.channelCount; - }, - set channelCount(value) { - scriptProcessorNode.channelCount = value; - }, - get channelCountMode() { - return scriptProcessorNode.channelCountMode; - }, - set channelCountMode(value) { - scriptProcessorNode.channelCountMode = value; - }, - get channelInterpretation() { - return scriptProcessorNode.channelInterpretation; - }, - set channelInterpretation(value) { - scriptProcessorNode.channelInterpretation = value; - }, - get context() { - return scriptProcessorNode.context; - }, - get inputs() { - return [scriptProcessorNode]; - }, - get numberOfInputs() { - return scriptProcessorNode.numberOfInputs; - }, - get numberOfOutputs() { - return scriptProcessorNode.numberOfOutputs; - }, - addEventListener(...args) { - // @todo Dissallow adding an audioprocess listener. - return scriptProcessorNode.addEventListener(args[0], args[1], args[2]); - }, - dispatchEvent(...args) { - return scriptProcessorNode.dispatchEvent(args[0]); - }, - getFrequencyResponse(frequencyHz, magResponse, phaseResponse) { - if (frequencyHz.length !== magResponse.length || magResponse.length !== phaseResponse.length) { - throw createInvalidAccessError(); - } - const length = frequencyHz.length; - for (let i = 0; i < length; i += 1) { - const omega = -Math.PI * (frequencyHz[i] / nyquist); - const z = [Math.cos(omega), Math.sin(omega)]; - const numerator = evaluatePolynomial(convertedFeedforward, z); - const denominator = evaluatePolynomial(convertedFeedback, z); - const response = divide(numerator, denominator); - magResponse[i] = Math.sqrt(response[0] * response[0] + response[1] * response[1]); - phaseResponse[i] = Math.atan2(response[1], response[0]); - } - }, - removeEventListener(...args) { - return scriptProcessorNode.removeEventListener(args[0], args[1], args[2]); - } - }; - return interceptConnections(nativeIIRFilterNodeFaker, scriptProcessorNode); - }; -}; - -const createNativeMediaElementAudioSourceNode = (nativeAudioContext, options) => { - return nativeAudioContext.createMediaElementSource(options.mediaElement); -}; - -const createNativeMediaStreamAudioDestinationNode = (nativeAudioContext, options) => { - const nativeMediaStreamAudioDestinationNode = nativeAudioContext.createMediaStreamDestination(); - assignNativeAudioNodeOptions(nativeMediaStreamAudioDestinationNode, options); - // Bug #174: Safari does expose a wrong numberOfOutputs. - if (nativeMediaStreamAudioDestinationNode.numberOfOutputs === 1) { - Object.defineProperty(nativeMediaStreamAudioDestinationNode, 'numberOfOutputs', { get: () => 0 }); - } - return nativeMediaStreamAudioDestinationNode; -}; - -const createNativeMediaStreamAudioSourceNode = (nativeAudioContext, { mediaStream }) => { - const audioStreamTracks = mediaStream.getAudioTracks(); - /* - * Bug #151: Safari does not use the audio track as input anymore if it gets removed from the mediaStream after construction. - * Bug #159: Safari picks the first audio track if the MediaStream has more than one audio track. - */ - audioStreamTracks.sort((a, b) => (a.id < b.id ? -1 : a.id > b.id ? 1 : 0)); - const filteredAudioStreamTracks = audioStreamTracks.slice(0, 1); - const nativeMediaStreamAudioSourceNode = nativeAudioContext.createMediaStreamSource(new MediaStream(filteredAudioStreamTracks)); - /* - * Bug #151 & #159: The given mediaStream gets reconstructed before it gets passed to the native node which is why the accessor needs - * to be overwritten as it would otherwise expose the reconstructed version. - */ - Object.defineProperty(nativeMediaStreamAudioSourceNode, 'mediaStream', { value: mediaStream }); - return nativeMediaStreamAudioSourceNode; -}; - -const createNativeMediaStreamTrackAudioSourceNodeFactory = (createInvalidStateError, isNativeOfflineAudioContext) => { - return (nativeAudioContext, { mediaStreamTrack }) => { - // Bug #121: Only Firefox does yet support the MediaStreamTrackAudioSourceNode. - if (typeof nativeAudioContext.createMediaStreamTrackSource === 'function') { - return nativeAudioContext.createMediaStreamTrackSource(mediaStreamTrack); - } - const mediaStream = new MediaStream([mediaStreamTrack]); - const nativeMediaStreamAudioSourceNode = nativeAudioContext.createMediaStreamSource(mediaStream); - // Bug #120: Firefox does not throw an error if the mediaStream has no audio track. - if (mediaStreamTrack.kind !== 'audio') { - throw createInvalidStateError(); - } - // Bug #172: Safari allows to create a MediaStreamAudioSourceNode with an OfflineAudioContext. - if (isNativeOfflineAudioContext(nativeAudioContext)) { - throw new TypeError(); - } - return nativeMediaStreamAudioSourceNode; - }; -}; - -const createNativeOfflineAudioContextConstructor = (window) => { - if (window === null) { - return null; - } - if (window.hasOwnProperty('OfflineAudioContext')) { - return window.OfflineAudioContext; - } - return window.hasOwnProperty('webkitOfflineAudioContext') ? window.webkitOfflineAudioContext : null; -}; - -const createNativeOscillatorNodeFactory = (addSilentConnection, cacheTestResult, testAudioScheduledSourceNodeStartMethodNegativeParametersSupport, testAudioScheduledSourceNodeStopMethodConsecutiveCallsSupport, testAudioScheduledSourceNodeStopMethodNegativeParametersSupport, wrapAudioScheduledSourceNodeStopMethodConsecutiveCalls) => { - return (nativeContext, options) => { - const nativeOscillatorNode = nativeContext.createOscillator(); - assignNativeAudioNodeOptions(nativeOscillatorNode, options); - assignNativeAudioNodeAudioParamValue(nativeOscillatorNode, options, 'detune'); - assignNativeAudioNodeAudioParamValue(nativeOscillatorNode, options, 'frequency'); - if (options.periodicWave !== undefined) { - nativeOscillatorNode.setPeriodicWave(options.periodicWave); - } - else { - assignNativeAudioNodeOption(nativeOscillatorNode, options, 'type'); - } - // Bug #44: Only Chrome, Edge & Opera throw a RangeError yet. - if (!cacheTestResult(testAudioScheduledSourceNodeStartMethodNegativeParametersSupport, () => testAudioScheduledSourceNodeStartMethodNegativeParametersSupport(nativeContext))) { - wrapAudioScheduledSourceNodeStartMethodNegativeParameters(nativeOscillatorNode); - } - // Bug #19: Safari does not ignore calls to stop() of an already stopped AudioBufferSourceNode. - if (!cacheTestResult(testAudioScheduledSourceNodeStopMethodConsecutiveCallsSupport, () => testAudioScheduledSourceNodeStopMethodConsecutiveCallsSupport(nativeContext))) { - wrapAudioScheduledSourceNodeStopMethodConsecutiveCalls(nativeOscillatorNode, nativeContext); - } - // Bug #44: Only Firefox does not throw a RangeError yet. - if (!cacheTestResult(testAudioScheduledSourceNodeStopMethodNegativeParametersSupport, () => testAudioScheduledSourceNodeStopMethodNegativeParametersSupport(nativeContext))) { - wrapAudioScheduledSourceNodeStopMethodNegativeParameters(nativeOscillatorNode); - } - // Bug #175: Safari will not fire an ended event if the OscillatorNode is unconnected. - addSilentConnection(nativeContext, nativeOscillatorNode); - return nativeOscillatorNode; - }; -}; - -const createNativePannerNodeFactory = (createNativePannerNodeFaker) => { - return (nativeContext, options) => { - const nativePannerNode = nativeContext.createPanner(); - // Bug #124: Safari does not support modifying the orientation and the position with AudioParams. - if (nativePannerNode.orientationX === undefined) { - return createNativePannerNodeFaker(nativeContext, options); - } - assignNativeAudioNodeOptions(nativePannerNode, options); - assignNativeAudioNodeAudioParamValue(nativePannerNode, options, 'orientationX'); - assignNativeAudioNodeAudioParamValue(nativePannerNode, options, 'orientationY'); - assignNativeAudioNodeAudioParamValue(nativePannerNode, options, 'orientationZ'); - assignNativeAudioNodeAudioParamValue(nativePannerNode, options, 'positionX'); - assignNativeAudioNodeAudioParamValue(nativePannerNode, options, 'positionY'); - assignNativeAudioNodeAudioParamValue(nativePannerNode, options, 'positionZ'); - assignNativeAudioNodeOption(nativePannerNode, options, 'coneInnerAngle'); - assignNativeAudioNodeOption(nativePannerNode, options, 'coneOuterAngle'); - assignNativeAudioNodeOption(nativePannerNode, options, 'coneOuterGain'); - assignNativeAudioNodeOption(nativePannerNode, options, 'distanceModel'); - assignNativeAudioNodeOption(nativePannerNode, options, 'maxDistance'); - assignNativeAudioNodeOption(nativePannerNode, options, 'panningModel'); - assignNativeAudioNodeOption(nativePannerNode, options, 'refDistance'); - assignNativeAudioNodeOption(nativePannerNode, options, 'rolloffFactor'); - return nativePannerNode; - }; -}; - -const createNativePannerNodeFakerFactory = (connectNativeAudioNodeToNativeAudioNode, createInvalidStateError, createNativeChannelMergerNode, createNativeGainNode, createNativeScriptProcessorNode, createNativeWaveShaperNode, createNotSupportedError, disconnectNativeAudioNodeFromNativeAudioNode, getFirstSample, monitorConnections) => { - return (nativeContext, { coneInnerAngle, coneOuterAngle, coneOuterGain, distanceModel, maxDistance, orientationX, orientationY, orientationZ, panningModel, positionX, positionY, positionZ, refDistance, rolloffFactor, ...audioNodeOptions }) => { - const pannerNode = nativeContext.createPanner(); - // Bug #125: Safari does not throw an error yet. - if (audioNodeOptions.channelCount > 2) { - throw createNotSupportedError(); - } - // Bug #126: Safari does not throw an error yet. - if (audioNodeOptions.channelCountMode === 'max') { - throw createNotSupportedError(); - } - assignNativeAudioNodeOptions(pannerNode, audioNodeOptions); - const SINGLE_CHANNEL_OPTIONS = { - channelCount: 1, - channelCountMode: 'explicit', - channelInterpretation: 'discrete' - }; - const channelMergerNode = createNativeChannelMergerNode(nativeContext, { - ...SINGLE_CHANNEL_OPTIONS, - channelInterpretation: 'speakers', - numberOfInputs: 6 - }); - const inputGainNode = createNativeGainNode(nativeContext, { ...audioNodeOptions, gain: 1 }); - const orientationXGainNode = createNativeGainNode(nativeContext, { ...SINGLE_CHANNEL_OPTIONS, gain: 1 }); - const orientationYGainNode = createNativeGainNode(nativeContext, { ...SINGLE_CHANNEL_OPTIONS, gain: 0 }); - const orientationZGainNode = createNativeGainNode(nativeContext, { ...SINGLE_CHANNEL_OPTIONS, gain: 0 }); - const positionXGainNode = createNativeGainNode(nativeContext, { ...SINGLE_CHANNEL_OPTIONS, gain: 0 }); - const positionYGainNode = createNativeGainNode(nativeContext, { ...SINGLE_CHANNEL_OPTIONS, gain: 0 }); - const positionZGainNode = createNativeGainNode(nativeContext, { ...SINGLE_CHANNEL_OPTIONS, gain: 0 }); - const scriptProcessorNode = createNativeScriptProcessorNode(nativeContext, 256, 6, 1); - const waveShaperNode = createNativeWaveShaperNode(nativeContext, { - ...SINGLE_CHANNEL_OPTIONS, - curve: new Float32Array([1, 1]), - oversample: 'none' - }); - let lastOrientation = [orientationX, orientationY, orientationZ]; - let lastPosition = [positionX, positionY, positionZ]; - const buffer = new Float32Array(1); - // tslint:disable-next-line:deprecation - scriptProcessorNode.onaudioprocess = ({ inputBuffer }) => { - const orientation = [ - getFirstSample(inputBuffer, buffer, 0), - getFirstSample(inputBuffer, buffer, 1), - getFirstSample(inputBuffer, buffer, 2) - ]; - if (orientation.some((value, index) => value !== lastOrientation[index])) { - pannerNode.setOrientation(...orientation); // tslint:disable-line:deprecation - lastOrientation = orientation; - } - const positon = [ - getFirstSample(inputBuffer, buffer, 3), - getFirstSample(inputBuffer, buffer, 4), - getFirstSample(inputBuffer, buffer, 5) - ]; - if (positon.some((value, index) => value !== lastPosition[index])) { - pannerNode.setPosition(...positon); // tslint:disable-line:deprecation - lastPosition = positon; - } - }; - Object.defineProperty(orientationYGainNode.gain, 'defaultValue', { get: () => 0 }); - Object.defineProperty(orientationZGainNode.gain, 'defaultValue', { get: () => 0 }); - Object.defineProperty(positionXGainNode.gain, 'defaultValue', { get: () => 0 }); - Object.defineProperty(positionYGainNode.gain, 'defaultValue', { get: () => 0 }); - Object.defineProperty(positionZGainNode.gain, 'defaultValue', { get: () => 0 }); - const nativePannerNodeFaker = { - get bufferSize() { - return undefined; - }, - get channelCount() { - return pannerNode.channelCount; - }, - set channelCount(value) { - // Bug #125: Safari does not throw an error yet. - if (value > 2) { - throw createNotSupportedError(); - } - inputGainNode.channelCount = value; - pannerNode.channelCount = value; - }, - get channelCountMode() { - return pannerNode.channelCountMode; - }, - set channelCountMode(value) { - // Bug #126: Safari does not throw an error yet. - if (value === 'max') { - throw createNotSupportedError(); - } - inputGainNode.channelCountMode = value; - pannerNode.channelCountMode = value; - }, - get channelInterpretation() { - return pannerNode.channelInterpretation; - }, - set channelInterpretation(value) { - inputGainNode.channelInterpretation = value; - pannerNode.channelInterpretation = value; - }, - get coneInnerAngle() { - return pannerNode.coneInnerAngle; - }, - set coneInnerAngle(value) { - pannerNode.coneInnerAngle = value; - }, - get coneOuterAngle() { - return pannerNode.coneOuterAngle; - }, - set coneOuterAngle(value) { - pannerNode.coneOuterAngle = value; - }, - get coneOuterGain() { - return pannerNode.coneOuterGain; - }, - set coneOuterGain(value) { - // Bug #127: Safari does not throw an InvalidStateError yet. - if (value < 0 || value > 1) { - throw createInvalidStateError(); - } - pannerNode.coneOuterGain = value; - }, - get context() { - return pannerNode.context; - }, - get distanceModel() { - return pannerNode.distanceModel; - }, - set distanceModel(value) { - pannerNode.distanceModel = value; - }, - get inputs() { - return [inputGainNode]; - }, - get maxDistance() { - return pannerNode.maxDistance; - }, - set maxDistance(value) { - // Bug #128: Safari does not throw an error yet. - if (value < 0) { - throw new RangeError(); - } - pannerNode.maxDistance = value; - }, - get numberOfInputs() { - return pannerNode.numberOfInputs; - }, - get numberOfOutputs() { - return pannerNode.numberOfOutputs; - }, - get orientationX() { - return orientationXGainNode.gain; - }, - get orientationY() { - return orientationYGainNode.gain; - }, - get orientationZ() { - return orientationZGainNode.gain; - }, - get panningModel() { - return pannerNode.panningModel; - }, - set panningModel(value) { - pannerNode.panningModel = value; - }, - get positionX() { - return positionXGainNode.gain; - }, - get positionY() { - return positionYGainNode.gain; - }, - get positionZ() { - return positionZGainNode.gain; - }, - get refDistance() { - return pannerNode.refDistance; - }, - set refDistance(value) { - // Bug #129: Safari does not throw an error yet. - if (value < 0) { - throw new RangeError(); - } - pannerNode.refDistance = value; - }, - get rolloffFactor() { - return pannerNode.rolloffFactor; - }, - set rolloffFactor(value) { - // Bug #130: Safari does not throw an error yet. - if (value < 0) { - throw new RangeError(); - } - pannerNode.rolloffFactor = value; - }, - addEventListener(...args) { - return inputGainNode.addEventListener(args[0], args[1], args[2]); - }, - dispatchEvent(...args) { - return inputGainNode.dispatchEvent(args[0]); - }, - removeEventListener(...args) { - return inputGainNode.removeEventListener(args[0], args[1], args[2]); - } - }; - if (coneInnerAngle !== nativePannerNodeFaker.coneInnerAngle) { - nativePannerNodeFaker.coneInnerAngle = coneInnerAngle; - } - if (coneOuterAngle !== nativePannerNodeFaker.coneOuterAngle) { - nativePannerNodeFaker.coneOuterAngle = coneOuterAngle; - } - if (coneOuterGain !== nativePannerNodeFaker.coneOuterGain) { - nativePannerNodeFaker.coneOuterGain = coneOuterGain; - } - if (distanceModel !== nativePannerNodeFaker.distanceModel) { - nativePannerNodeFaker.distanceModel = distanceModel; - } - if (maxDistance !== nativePannerNodeFaker.maxDistance) { - nativePannerNodeFaker.maxDistance = maxDistance; - } - if (orientationX !== nativePannerNodeFaker.orientationX.value) { - nativePannerNodeFaker.orientationX.value = orientationX; - } - if (orientationY !== nativePannerNodeFaker.orientationY.value) { - nativePannerNodeFaker.orientationY.value = orientationY; - } - if (orientationZ !== nativePannerNodeFaker.orientationZ.value) { - nativePannerNodeFaker.orientationZ.value = orientationZ; - } - if (panningModel !== nativePannerNodeFaker.panningModel) { - nativePannerNodeFaker.panningModel = panningModel; - } - if (positionX !== nativePannerNodeFaker.positionX.value) { - nativePannerNodeFaker.positionX.value = positionX; - } - if (positionY !== nativePannerNodeFaker.positionY.value) { - nativePannerNodeFaker.positionY.value = positionY; - } - if (positionZ !== nativePannerNodeFaker.positionZ.value) { - nativePannerNodeFaker.positionZ.value = positionZ; - } - if (refDistance !== nativePannerNodeFaker.refDistance) { - nativePannerNodeFaker.refDistance = refDistance; - } - if (rolloffFactor !== nativePannerNodeFaker.rolloffFactor) { - nativePannerNodeFaker.rolloffFactor = rolloffFactor; - } - if (lastOrientation[0] !== 1 || lastOrientation[1] !== 0 || lastOrientation[2] !== 0) { - pannerNode.setOrientation(...lastOrientation); // tslint:disable-line:deprecation - } - if (lastPosition[0] !== 0 || lastPosition[1] !== 0 || lastPosition[2] !== 0) { - pannerNode.setPosition(...lastPosition); // tslint:disable-line:deprecation - } - const whenConnected = () => { - inputGainNode.connect(pannerNode); - // Bug #119: Safari does not fully support the WaveShaperNode. - connectNativeAudioNodeToNativeAudioNode(inputGainNode, waveShaperNode, 0, 0); - waveShaperNode.connect(orientationXGainNode).connect(channelMergerNode, 0, 0); - waveShaperNode.connect(orientationYGainNode).connect(channelMergerNode, 0, 1); - waveShaperNode.connect(orientationZGainNode).connect(channelMergerNode, 0, 2); - waveShaperNode.connect(positionXGainNode).connect(channelMergerNode, 0, 3); - waveShaperNode.connect(positionYGainNode).connect(channelMergerNode, 0, 4); - waveShaperNode.connect(positionZGainNode).connect(channelMergerNode, 0, 5); - channelMergerNode.connect(scriptProcessorNode).connect(nativeContext.destination); - }; - const whenDisconnected = () => { - inputGainNode.disconnect(pannerNode); - // Bug #119: Safari does not fully support the WaveShaperNode. - disconnectNativeAudioNodeFromNativeAudioNode(inputGainNode, waveShaperNode, 0, 0); - waveShaperNode.disconnect(orientationXGainNode); - orientationXGainNode.disconnect(channelMergerNode); - waveShaperNode.disconnect(orientationYGainNode); - orientationYGainNode.disconnect(channelMergerNode); - waveShaperNode.disconnect(orientationZGainNode); - orientationZGainNode.disconnect(channelMergerNode); - waveShaperNode.disconnect(positionXGainNode); - positionXGainNode.disconnect(channelMergerNode); - waveShaperNode.disconnect(positionYGainNode); - positionYGainNode.disconnect(channelMergerNode); - waveShaperNode.disconnect(positionZGainNode); - positionZGainNode.disconnect(channelMergerNode); - channelMergerNode.disconnect(scriptProcessorNode); - scriptProcessorNode.disconnect(nativeContext.destination); - }; - return monitorConnections(interceptConnections(nativePannerNodeFaker, pannerNode), whenConnected, whenDisconnected); - }; -}; - -const createNativePeriodicWaveFactory = (createIndexSizeError) => { - return (nativeContext, { disableNormalization, imag, real }) => { - // Bug #180: Safari does not allow to use ordinary arrays. - const convertedImag = imag instanceof Float32Array ? imag : new Float32Array(imag); - const convertedReal = real instanceof Float32Array ? real : new Float32Array(real); - const nativePeriodicWave = nativeContext.createPeriodicWave(convertedReal, convertedImag, { disableNormalization }); - // Bug #181: Safari does not throw an IndexSizeError so far if the given arrays have less than two values. - if (Array.from(imag).length < 2) { - throw createIndexSizeError(); - } - return nativePeriodicWave; - }; -}; - -const createNativeScriptProcessorNode = (nativeContext, bufferSize, numberOfInputChannels, numberOfOutputChannels) => { - return nativeContext.createScriptProcessor(bufferSize, numberOfInputChannels, numberOfOutputChannels); // tslint:disable-line deprecation -}; - -const createNativeStereoPannerNodeFactory = (createNativeStereoPannerNodeFaker, createNotSupportedError) => { - return (nativeContext, options) => { - const channelCountMode = options.channelCountMode; - /* - * Bug #105: The channelCountMode of 'clamped-max' should be supported. However it is not possible to write a polyfill for Safari - * which supports it and therefore it can't be supported at all. - */ - if (channelCountMode === 'clamped-max') { - throw createNotSupportedError(); - } - // Bug #105: Safari does not support the StereoPannerNode. - if (nativeContext.createStereoPanner === undefined) { - return createNativeStereoPannerNodeFaker(nativeContext, options); - } - const nativeStereoPannerNode = nativeContext.createStereoPanner(); - assignNativeAudioNodeOptions(nativeStereoPannerNode, options); - assignNativeAudioNodeAudioParamValue(nativeStereoPannerNode, options, 'pan'); - /* - * Bug #105: The channelCountMode of 'clamped-max' should be supported. However it is not possible to write a polyfill for Safari - * which supports it and therefore it can't be supported at all. - */ - Object.defineProperty(nativeStereoPannerNode, 'channelCountMode', { - get: () => channelCountMode, - set: (value) => { - if (value !== channelCountMode) { - throw createNotSupportedError(); - } - } - }); - return nativeStereoPannerNode; - }; -}; - -const createNativeStereoPannerNodeFakerFactory = (createNativeChannelMergerNode, createNativeChannelSplitterNode, createNativeGainNode, createNativeWaveShaperNode, createNotSupportedError, monitorConnections) => { - // The curve has a size of 14bit plus 1 value to have an exact representation for zero. This value has been determined experimentally. - const CURVE_SIZE = 16385; - const DC_CURVE = new Float32Array([1, 1]); - const HALF_PI = Math.PI / 2; - const SINGLE_CHANNEL_OPTIONS = { channelCount: 1, channelCountMode: 'explicit', channelInterpretation: 'discrete' }; - const SINGLE_CHANNEL_WAVE_SHAPER_OPTIONS = { ...SINGLE_CHANNEL_OPTIONS, oversample: 'none' }; - const buildInternalGraphForMono = (nativeContext, inputGainNode, panGainNode, channelMergerNode) => { - const leftWaveShaperCurve = new Float32Array(CURVE_SIZE); - const rightWaveShaperCurve = new Float32Array(CURVE_SIZE); - for (let i = 0; i < CURVE_SIZE; i += 1) { - const x = (i / (CURVE_SIZE - 1)) * HALF_PI; - leftWaveShaperCurve[i] = Math.cos(x); - rightWaveShaperCurve[i] = Math.sin(x); - } - const leftGainNode = createNativeGainNode(nativeContext, { ...SINGLE_CHANNEL_OPTIONS, gain: 0 }); - // Bug #119: Safari does not fully support the WaveShaperNode. - const leftWaveShaperNode = (createNativeWaveShaperNode(nativeContext, { ...SINGLE_CHANNEL_WAVE_SHAPER_OPTIONS, curve: leftWaveShaperCurve })); - // Bug #119: Safari does not fully support the WaveShaperNode. - const panWaveShaperNode = (createNativeWaveShaperNode(nativeContext, { ...SINGLE_CHANNEL_WAVE_SHAPER_OPTIONS, curve: DC_CURVE })); - const rightGainNode = createNativeGainNode(nativeContext, { ...SINGLE_CHANNEL_OPTIONS, gain: 0 }); - // Bug #119: Safari does not fully support the WaveShaperNode. - const rightWaveShaperNode = (createNativeWaveShaperNode(nativeContext, { ...SINGLE_CHANNEL_WAVE_SHAPER_OPTIONS, curve: rightWaveShaperCurve })); - return { - connectGraph() { - inputGainNode.connect(leftGainNode); - inputGainNode.connect(panWaveShaperNode.inputs === undefined ? panWaveShaperNode : panWaveShaperNode.inputs[0]); - inputGainNode.connect(rightGainNode); - panWaveShaperNode.connect(panGainNode); - panGainNode.connect(leftWaveShaperNode.inputs === undefined ? leftWaveShaperNode : leftWaveShaperNode.inputs[0]); - panGainNode.connect(rightWaveShaperNode.inputs === undefined ? rightWaveShaperNode : rightWaveShaperNode.inputs[0]); - leftWaveShaperNode.connect(leftGainNode.gain); - rightWaveShaperNode.connect(rightGainNode.gain); - leftGainNode.connect(channelMergerNode, 0, 0); - rightGainNode.connect(channelMergerNode, 0, 1); - }, - disconnectGraph() { - inputGainNode.disconnect(leftGainNode); - inputGainNode.disconnect(panWaveShaperNode.inputs === undefined ? panWaveShaperNode : panWaveShaperNode.inputs[0]); - inputGainNode.disconnect(rightGainNode); - panWaveShaperNode.disconnect(panGainNode); - panGainNode.disconnect(leftWaveShaperNode.inputs === undefined ? leftWaveShaperNode : leftWaveShaperNode.inputs[0]); - panGainNode.disconnect(rightWaveShaperNode.inputs === undefined ? rightWaveShaperNode : rightWaveShaperNode.inputs[0]); - leftWaveShaperNode.disconnect(leftGainNode.gain); - rightWaveShaperNode.disconnect(rightGainNode.gain); - leftGainNode.disconnect(channelMergerNode, 0, 0); - rightGainNode.disconnect(channelMergerNode, 0, 1); - } - }; - }; - const buildInternalGraphForStereo = (nativeContext, inputGainNode, panGainNode, channelMergerNode) => { - const leftInputForLeftOutputWaveShaperCurve = new Float32Array(CURVE_SIZE); - const leftInputForRightOutputWaveShaperCurve = new Float32Array(CURVE_SIZE); - const rightInputForLeftOutputWaveShaperCurve = new Float32Array(CURVE_SIZE); - const rightInputForRightOutputWaveShaperCurve = new Float32Array(CURVE_SIZE); - const centerIndex = Math.floor(CURVE_SIZE / 2); - for (let i = 0; i < CURVE_SIZE; i += 1) { - if (i > centerIndex) { - const x = ((i - centerIndex) / (CURVE_SIZE - 1 - centerIndex)) * HALF_PI; - leftInputForLeftOutputWaveShaperCurve[i] = Math.cos(x); - leftInputForRightOutputWaveShaperCurve[i] = Math.sin(x); - rightInputForLeftOutputWaveShaperCurve[i] = 0; - rightInputForRightOutputWaveShaperCurve[i] = 1; - } - else { - const x = (i / (CURVE_SIZE - 1 - centerIndex)) * HALF_PI; - leftInputForLeftOutputWaveShaperCurve[i] = 1; - leftInputForRightOutputWaveShaperCurve[i] = 0; - rightInputForLeftOutputWaveShaperCurve[i] = Math.cos(x); - rightInputForRightOutputWaveShaperCurve[i] = Math.sin(x); - } - } - const channelSplitterNode = createNativeChannelSplitterNode(nativeContext, { - channelCount: 2, - channelCountMode: 'explicit', - channelInterpretation: 'discrete', - numberOfOutputs: 2 - }); - const leftInputForLeftOutputGainNode = createNativeGainNode(nativeContext, { ...SINGLE_CHANNEL_OPTIONS, gain: 0 }); - // Bug #119: Safari does not fully support the WaveShaperNode. - const leftInputForLeftOutputWaveShaperNode = createNativeWaveShaperNode(nativeContext, { - ...SINGLE_CHANNEL_WAVE_SHAPER_OPTIONS, - curve: leftInputForLeftOutputWaveShaperCurve - }); - const leftInputForRightOutputGainNode = createNativeGainNode(nativeContext, { ...SINGLE_CHANNEL_OPTIONS, gain: 0 }); - // Bug #119: Safari does not fully support the WaveShaperNode. - const leftInputForRightOutputWaveShaperNode = createNativeWaveShaperNode(nativeContext, { - ...SINGLE_CHANNEL_WAVE_SHAPER_OPTIONS, - curve: leftInputForRightOutputWaveShaperCurve - }); - // Bug #119: Safari does not fully support the WaveShaperNode. - const panWaveShaperNode = (createNativeWaveShaperNode(nativeContext, { ...SINGLE_CHANNEL_WAVE_SHAPER_OPTIONS, curve: DC_CURVE })); - const rightInputForLeftOutputGainNode = createNativeGainNode(nativeContext, { ...SINGLE_CHANNEL_OPTIONS, gain: 0 }); - // Bug #119: Safari does not fully support the WaveShaperNode. - const rightInputForLeftOutputWaveShaperNode = createNativeWaveShaperNode(nativeContext, { - ...SINGLE_CHANNEL_WAVE_SHAPER_OPTIONS, - curve: rightInputForLeftOutputWaveShaperCurve - }); - const rightInputForRightOutputGainNode = createNativeGainNode(nativeContext, { ...SINGLE_CHANNEL_OPTIONS, gain: 0 }); - // Bug #119: Safari does not fully support the WaveShaperNode. - const rightInputForRightOutputWaveShaperNode = createNativeWaveShaperNode(nativeContext, { - ...SINGLE_CHANNEL_WAVE_SHAPER_OPTIONS, - curve: rightInputForRightOutputWaveShaperCurve - }); - return { - connectGraph() { - inputGainNode.connect(channelSplitterNode); - inputGainNode.connect(panWaveShaperNode.inputs === undefined ? panWaveShaperNode : panWaveShaperNode.inputs[0]); - channelSplitterNode.connect(leftInputForLeftOutputGainNode, 0); - channelSplitterNode.connect(leftInputForRightOutputGainNode, 0); - channelSplitterNode.connect(rightInputForLeftOutputGainNode, 1); - channelSplitterNode.connect(rightInputForRightOutputGainNode, 1); - panWaveShaperNode.connect(panGainNode); - panGainNode.connect(leftInputForLeftOutputWaveShaperNode.inputs === undefined - ? leftInputForLeftOutputWaveShaperNode - : leftInputForLeftOutputWaveShaperNode.inputs[0]); - panGainNode.connect(leftInputForRightOutputWaveShaperNode.inputs === undefined - ? leftInputForRightOutputWaveShaperNode - : leftInputForRightOutputWaveShaperNode.inputs[0]); - panGainNode.connect(rightInputForLeftOutputWaveShaperNode.inputs === undefined - ? rightInputForLeftOutputWaveShaperNode - : rightInputForLeftOutputWaveShaperNode.inputs[0]); - panGainNode.connect(rightInputForRightOutputWaveShaperNode.inputs === undefined - ? rightInputForRightOutputWaveShaperNode - : rightInputForRightOutputWaveShaperNode.inputs[0]); - leftInputForLeftOutputWaveShaperNode.connect(leftInputForLeftOutputGainNode.gain); - leftInputForRightOutputWaveShaperNode.connect(leftInputForRightOutputGainNode.gain); - rightInputForLeftOutputWaveShaperNode.connect(rightInputForLeftOutputGainNode.gain); - rightInputForRightOutputWaveShaperNode.connect(rightInputForRightOutputGainNode.gain); - leftInputForLeftOutputGainNode.connect(channelMergerNode, 0, 0); - rightInputForLeftOutputGainNode.connect(channelMergerNode, 0, 0); - leftInputForRightOutputGainNode.connect(channelMergerNode, 0, 1); - rightInputForRightOutputGainNode.connect(channelMergerNode, 0, 1); - }, - disconnectGraph() { - inputGainNode.disconnect(channelSplitterNode); - inputGainNode.disconnect(panWaveShaperNode.inputs === undefined ? panWaveShaperNode : panWaveShaperNode.inputs[0]); - channelSplitterNode.disconnect(leftInputForLeftOutputGainNode, 0); - channelSplitterNode.disconnect(leftInputForRightOutputGainNode, 0); - channelSplitterNode.disconnect(rightInputForLeftOutputGainNode, 1); - channelSplitterNode.disconnect(rightInputForRightOutputGainNode, 1); - panWaveShaperNode.disconnect(panGainNode); - panGainNode.disconnect(leftInputForLeftOutputWaveShaperNode.inputs === undefined - ? leftInputForLeftOutputWaveShaperNode - : leftInputForLeftOutputWaveShaperNode.inputs[0]); - panGainNode.disconnect(leftInputForRightOutputWaveShaperNode.inputs === undefined - ? leftInputForRightOutputWaveShaperNode - : leftInputForRightOutputWaveShaperNode.inputs[0]); - panGainNode.disconnect(rightInputForLeftOutputWaveShaperNode.inputs === undefined - ? rightInputForLeftOutputWaveShaperNode - : rightInputForLeftOutputWaveShaperNode.inputs[0]); - panGainNode.disconnect(rightInputForRightOutputWaveShaperNode.inputs === undefined - ? rightInputForRightOutputWaveShaperNode - : rightInputForRightOutputWaveShaperNode.inputs[0]); - leftInputForLeftOutputWaveShaperNode.disconnect(leftInputForLeftOutputGainNode.gain); - leftInputForRightOutputWaveShaperNode.disconnect(leftInputForRightOutputGainNode.gain); - rightInputForLeftOutputWaveShaperNode.disconnect(rightInputForLeftOutputGainNode.gain); - rightInputForRightOutputWaveShaperNode.disconnect(rightInputForRightOutputGainNode.gain); - leftInputForLeftOutputGainNode.disconnect(channelMergerNode, 0, 0); - rightInputForLeftOutputGainNode.disconnect(channelMergerNode, 0, 0); - leftInputForRightOutputGainNode.disconnect(channelMergerNode, 0, 1); - rightInputForRightOutputGainNode.disconnect(channelMergerNode, 0, 1); - } - }; - }; - const buildInternalGraph = (nativeContext, channelCount, inputGainNode, panGainNode, channelMergerNode) => { - if (channelCount === 1) { - return buildInternalGraphForMono(nativeContext, inputGainNode, panGainNode, channelMergerNode); - } - if (channelCount === 2) { - return buildInternalGraphForStereo(nativeContext, inputGainNode, panGainNode, channelMergerNode); - } - throw createNotSupportedError(); - }; - return (nativeContext, { channelCount, channelCountMode, pan, ...audioNodeOptions }) => { - if (channelCountMode === 'max') { - throw createNotSupportedError(); - } - const channelMergerNode = createNativeChannelMergerNode(nativeContext, { - ...audioNodeOptions, - channelCount: 1, - channelCountMode, - numberOfInputs: 2 - }); - const inputGainNode = createNativeGainNode(nativeContext, { ...audioNodeOptions, channelCount, channelCountMode, gain: 1 }); - const panGainNode = createNativeGainNode(nativeContext, { - channelCount: 1, - channelCountMode: 'explicit', - channelInterpretation: 'discrete', - gain: pan - }); - let { connectGraph, disconnectGraph } = buildInternalGraph(nativeContext, channelCount, inputGainNode, panGainNode, channelMergerNode); - Object.defineProperty(panGainNode.gain, 'defaultValue', { get: () => 0 }); - Object.defineProperty(panGainNode.gain, 'maxValue', { get: () => 1 }); - Object.defineProperty(panGainNode.gain, 'minValue', { get: () => -1 }); - const nativeStereoPannerNodeFakerFactory = { - get bufferSize() { - return undefined; - }, - get channelCount() { - return inputGainNode.channelCount; - }, - set channelCount(value) { - if (inputGainNode.channelCount !== value) { - if (isConnected) { - disconnectGraph(); - } - ({ connectGraph, disconnectGraph } = buildInternalGraph(nativeContext, value, inputGainNode, panGainNode, channelMergerNode)); - if (isConnected) { - connectGraph(); - } - } - inputGainNode.channelCount = value; - }, - get channelCountMode() { - return inputGainNode.channelCountMode; - }, - set channelCountMode(value) { - if (value === 'clamped-max' || value === 'max') { - throw createNotSupportedError(); - } - inputGainNode.channelCountMode = value; - }, - get channelInterpretation() { - return inputGainNode.channelInterpretation; - }, - set channelInterpretation(value) { - inputGainNode.channelInterpretation = value; - }, - get context() { - return inputGainNode.context; - }, - get inputs() { - return [inputGainNode]; - }, - get numberOfInputs() { - return inputGainNode.numberOfInputs; - }, - get numberOfOutputs() { - return inputGainNode.numberOfOutputs; - }, - get pan() { - return panGainNode.gain; - }, - addEventListener(...args) { - return inputGainNode.addEventListener(args[0], args[1], args[2]); - }, - dispatchEvent(...args) { - return inputGainNode.dispatchEvent(args[0]); - }, - removeEventListener(...args) { - return inputGainNode.removeEventListener(args[0], args[1], args[2]); - } - }; - let isConnected = false; - const whenConnected = () => { - connectGraph(); - isConnected = true; - }; - const whenDisconnected = () => { - disconnectGraph(); - isConnected = false; - }; - return monitorConnections(interceptConnections(nativeStereoPannerNodeFakerFactory, channelMergerNode), whenConnected, whenDisconnected); - }; -}; - -const createNativeWaveShaperNodeFactory = (createConnectedNativeAudioBufferSourceNode, createInvalidStateError, createNativeWaveShaperNodeFaker, isDCCurve, monitorConnections, nativeAudioContextConstructor, overwriteAccessors) => { - return (nativeContext, options) => { - const nativeWaveShaperNode = nativeContext.createWaveShaper(); - /* - * Bug #119: Safari does not correctly map the values. - * @todo Unfortunately there is no way to test for this behavior in a synchronous fashion which is why testing for the existence of - * the webkitAudioContext is used as a workaround here. Testing for the automationRate property is necessary because this workaround - * isn't necessary anymore since v14.0.2 of Safari. - */ - if (nativeAudioContextConstructor !== null && - nativeAudioContextConstructor.name === 'webkitAudioContext' && - nativeContext.createGain().gain.automationRate === undefined) { - return createNativeWaveShaperNodeFaker(nativeContext, options); - } - assignNativeAudioNodeOptions(nativeWaveShaperNode, options); - const curve = options.curve === null || options.curve instanceof Float32Array ? options.curve : new Float32Array(options.curve); - // Bug #104: Chrome, Edge and Opera will throw an InvalidAccessError when the curve has less than two samples. - if (curve !== null && curve.length < 2) { - throw createInvalidStateError(); - } - // Only values of type Float32Array can be assigned to the curve property. - assignNativeAudioNodeOption(nativeWaveShaperNode, { curve }, 'curve'); - assignNativeAudioNodeOption(nativeWaveShaperNode, options, 'oversample'); - let disconnectNativeAudioBufferSourceNode = null; - let isConnected = false; - overwriteAccessors(nativeWaveShaperNode, 'curve', (get) => () => get.call(nativeWaveShaperNode), (set) => (value) => { - set.call(nativeWaveShaperNode, value); - if (isConnected) { - if (isDCCurve(value) && disconnectNativeAudioBufferSourceNode === null) { - disconnectNativeAudioBufferSourceNode = createConnectedNativeAudioBufferSourceNode(nativeContext, nativeWaveShaperNode); - } - else if (!isDCCurve(value) && disconnectNativeAudioBufferSourceNode !== null) { - disconnectNativeAudioBufferSourceNode(); - disconnectNativeAudioBufferSourceNode = null; - } - } - return value; - }); - const whenConnected = () => { - isConnected = true; - if (isDCCurve(nativeWaveShaperNode.curve)) { - disconnectNativeAudioBufferSourceNode = createConnectedNativeAudioBufferSourceNode(nativeContext, nativeWaveShaperNode); - } - }; - const whenDisconnected = () => { - isConnected = false; - if (disconnectNativeAudioBufferSourceNode !== null) { - disconnectNativeAudioBufferSourceNode(); - disconnectNativeAudioBufferSourceNode = null; - } - }; - return monitorConnections(nativeWaveShaperNode, whenConnected, whenDisconnected); - }; -}; - -const createNativeWaveShaperNodeFakerFactory = (createConnectedNativeAudioBufferSourceNode, createInvalidStateError, createNativeGainNode, isDCCurve, monitorConnections) => { - return (nativeContext, { curve, oversample, ...audioNodeOptions }) => { - const negativeWaveShaperNode = nativeContext.createWaveShaper(); - const positiveWaveShaperNode = nativeContext.createWaveShaper(); - assignNativeAudioNodeOptions(negativeWaveShaperNode, audioNodeOptions); - assignNativeAudioNodeOptions(positiveWaveShaperNode, audioNodeOptions); - const inputGainNode = createNativeGainNode(nativeContext, { ...audioNodeOptions, gain: 1 }); - const invertGainNode = createNativeGainNode(nativeContext, { ...audioNodeOptions, gain: -1 }); - const outputGainNode = createNativeGainNode(nativeContext, { ...audioNodeOptions, gain: 1 }); - const revertGainNode = createNativeGainNode(nativeContext, { ...audioNodeOptions, gain: -1 }); - let disconnectNativeAudioBufferSourceNode = null; - let isConnected = false; - let unmodifiedCurve = null; - const nativeWaveShaperNodeFaker = { - get bufferSize() { - return undefined; - }, - get channelCount() { - return negativeWaveShaperNode.channelCount; - }, - set channelCount(value) { - inputGainNode.channelCount = value; - invertGainNode.channelCount = value; - negativeWaveShaperNode.channelCount = value; - outputGainNode.channelCount = value; - positiveWaveShaperNode.channelCount = value; - revertGainNode.channelCount = value; - }, - get channelCountMode() { - return negativeWaveShaperNode.channelCountMode; - }, - set channelCountMode(value) { - inputGainNode.channelCountMode = value; - invertGainNode.channelCountMode = value; - negativeWaveShaperNode.channelCountMode = value; - outputGainNode.channelCountMode = value; - positiveWaveShaperNode.channelCountMode = value; - revertGainNode.channelCountMode = value; - }, - get channelInterpretation() { - return negativeWaveShaperNode.channelInterpretation; - }, - set channelInterpretation(value) { - inputGainNode.channelInterpretation = value; - invertGainNode.channelInterpretation = value; - negativeWaveShaperNode.channelInterpretation = value; - outputGainNode.channelInterpretation = value; - positiveWaveShaperNode.channelInterpretation = value; - revertGainNode.channelInterpretation = value; - }, - get context() { - return negativeWaveShaperNode.context; - }, - get curve() { - return unmodifiedCurve; - }, - set curve(value) { - // Bug #102: Safari does not throw an InvalidStateError when the curve has less than two samples. - if (value !== null && value.length < 2) { - throw createInvalidStateError(); - } - if (value === null) { - negativeWaveShaperNode.curve = value; - positiveWaveShaperNode.curve = value; - } - else { - const curveLength = value.length; - const negativeCurve = new Float32Array(curveLength + 2 - (curveLength % 2)); - const positiveCurve = new Float32Array(curveLength + 2 - (curveLength % 2)); - negativeCurve[0] = value[0]; - positiveCurve[0] = -value[curveLength - 1]; - const length = Math.ceil((curveLength + 1) / 2); - const centerIndex = (curveLength + 1) / 2 - 1; - for (let i = 1; i < length; i += 1) { - const theoreticIndex = (i / length) * centerIndex; - const lowerIndex = Math.floor(theoreticIndex); - const upperIndex = Math.ceil(theoreticIndex); - negativeCurve[i] = - lowerIndex === upperIndex - ? value[lowerIndex] - : (1 - (theoreticIndex - lowerIndex)) * value[lowerIndex] + - (1 - (upperIndex - theoreticIndex)) * value[upperIndex]; - positiveCurve[i] = - lowerIndex === upperIndex - ? -value[curveLength - 1 - lowerIndex] - : -((1 - (theoreticIndex - lowerIndex)) * value[curveLength - 1 - lowerIndex]) - - (1 - (upperIndex - theoreticIndex)) * value[curveLength - 1 - upperIndex]; - } - negativeCurve[length] = curveLength % 2 === 1 ? value[length - 1] : (value[length - 2] + value[length - 1]) / 2; - negativeWaveShaperNode.curve = negativeCurve; - positiveWaveShaperNode.curve = positiveCurve; - } - unmodifiedCurve = value; - if (isConnected) { - if (isDCCurve(unmodifiedCurve) && disconnectNativeAudioBufferSourceNode === null) { - disconnectNativeAudioBufferSourceNode = createConnectedNativeAudioBufferSourceNode(nativeContext, inputGainNode); - } - else if (disconnectNativeAudioBufferSourceNode !== null) { - disconnectNativeAudioBufferSourceNode(); - disconnectNativeAudioBufferSourceNode = null; - } - } - }, - get inputs() { - return [inputGainNode]; - }, - get numberOfInputs() { - return negativeWaveShaperNode.numberOfInputs; - }, - get numberOfOutputs() { - return negativeWaveShaperNode.numberOfOutputs; - }, - get oversample() { - return negativeWaveShaperNode.oversample; - }, - set oversample(value) { - negativeWaveShaperNode.oversample = value; - positiveWaveShaperNode.oversample = value; - }, - addEventListener(...args) { - return inputGainNode.addEventListener(args[0], args[1], args[2]); - }, - dispatchEvent(...args) { - return inputGainNode.dispatchEvent(args[0]); - }, - removeEventListener(...args) { - return inputGainNode.removeEventListener(args[0], args[1], args[2]); - } - }; - if (curve !== null) { - // Only values of type Float32Array can be assigned to the curve property. - nativeWaveShaperNodeFaker.curve = curve instanceof Float32Array ? curve : new Float32Array(curve); - } - if (oversample !== nativeWaveShaperNodeFaker.oversample) { - nativeWaveShaperNodeFaker.oversample = oversample; - } - const whenConnected = () => { - inputGainNode.connect(negativeWaveShaperNode).connect(outputGainNode); - inputGainNode.connect(invertGainNode).connect(positiveWaveShaperNode).connect(revertGainNode).connect(outputGainNode); - isConnected = true; - if (isDCCurve(unmodifiedCurve)) { - disconnectNativeAudioBufferSourceNode = createConnectedNativeAudioBufferSourceNode(nativeContext, inputGainNode); - } - }; - const whenDisconnected = () => { - inputGainNode.disconnect(negativeWaveShaperNode); - negativeWaveShaperNode.disconnect(outputGainNode); - inputGainNode.disconnect(invertGainNode); - invertGainNode.disconnect(positiveWaveShaperNode); - positiveWaveShaperNode.disconnect(revertGainNode); - revertGainNode.disconnect(outputGainNode); - isConnected = false; - if (disconnectNativeAudioBufferSourceNode !== null) { - disconnectNativeAudioBufferSourceNode(); - disconnectNativeAudioBufferSourceNode = null; - } - }; - return monitorConnections(interceptConnections(nativeWaveShaperNodeFaker, outputGainNode), whenConnected, whenDisconnected); - }; -}; - -const createNotSupportedError = () => new DOMException('', 'NotSupportedError'); - -const DEFAULT_OPTIONS$e = { - numberOfChannels: 1 -}; -const createOfflineAudioContextConstructor = (baseAudioContextConstructor, cacheTestResult, createInvalidStateError, createNativeOfflineAudioContext, startRendering) => { - return class OfflineAudioContext extends baseAudioContextConstructor { - constructor(a, b, c) { - let options; - if (typeof a === 'number' && b !== undefined && c !== undefined) { - options = { length: b, numberOfChannels: a, sampleRate: c }; - } - else if (typeof a === 'object') { - options = a; - } - else { - throw new Error('The given parameters are not valid.'); - } - const { length, numberOfChannels, sampleRate } = { ...DEFAULT_OPTIONS$e, ...options }; - const nativeOfflineAudioContext = createNativeOfflineAudioContext(numberOfChannels, length, sampleRate); - // #21 Safari does not support promises and therefore would fire the statechange event before the promise can be resolved. - if (!cacheTestResult(testPromiseSupport, () => testPromiseSupport(nativeOfflineAudioContext))) { - nativeOfflineAudioContext.addEventListener('statechange', (() => { - let i = 0; - const delayStateChangeEvent = (event) => { - if (this._state === 'running') { - if (i > 0) { - nativeOfflineAudioContext.removeEventListener('statechange', delayStateChangeEvent); - event.stopImmediatePropagation(); - this._waitForThePromiseToSettle(event); - } - else { - i += 1; - } - } - }; - return delayStateChangeEvent; - })()); - } - super(nativeOfflineAudioContext, numberOfChannels); - this._length = length; - this._nativeOfflineAudioContext = nativeOfflineAudioContext; - this._state = null; - } - get length() { - // Bug #17: Safari does not yet expose the length. - if (this._nativeOfflineAudioContext.length === undefined) { - return this._length; - } - return this._nativeOfflineAudioContext.length; - } - get state() { - return this._state === null ? this._nativeOfflineAudioContext.state : this._state; - } - startRendering() { - /* - * Bug #9 & #59: It is theoretically possible that startRendering() will first render a partialOfflineAudioContext. Therefore - * the state of the nativeOfflineAudioContext might no transition to running immediately. - */ - if (this._state === 'running') { - return Promise.reject(createInvalidStateError()); - } - this._state = 'running'; - return startRendering(this.destination, this._nativeOfflineAudioContext).finally(() => { - this._state = null; - deactivateAudioGraph(this); - }); - } - _waitForThePromiseToSettle(event) { - if (this._state === null) { - this._nativeOfflineAudioContext.dispatchEvent(event); - } - else { - setTimeout(() => this._waitForThePromiseToSettle(event)); - } - } - }; -}; - -const DEFAULT_OPTIONS$f = { - channelCount: 2, - channelCountMode: 'max', - channelInterpretation: 'speakers', - detune: 0, - frequency: 440, - periodicWave: undefined, - type: 'sine' -}; -const createOscillatorNodeConstructor = (audioNodeConstructor, createAudioParam, createNativeOscillatorNode, createOscillatorNodeRenderer, getNativeContext, isNativeOfflineAudioContext, wrapEventListener) => { - return class OscillatorNode extends audioNodeConstructor { - constructor(context, options) { - const nativeContext = getNativeContext(context); - const mergedOptions = { ...DEFAULT_OPTIONS$f, ...options }; - const nativeOscillatorNode = createNativeOscillatorNode(nativeContext, mergedOptions); - const isOffline = isNativeOfflineAudioContext(nativeContext); - const oscillatorNodeRenderer = (isOffline ? createOscillatorNodeRenderer() : null); - const nyquist = context.sampleRate / 2; - super(context, false, nativeOscillatorNode, oscillatorNodeRenderer); - // Bug #81: Firefox & Safari do not export the correct values for maxValue and minValue. - this._detune = createAudioParam(this, isOffline, nativeOscillatorNode.detune, 153600, -153600); - // Bug #76: Safari does not export the correct values for maxValue and minValue. - this._frequency = createAudioParam(this, isOffline, nativeOscillatorNode.frequency, nyquist, -nyquist); - this._nativeOscillatorNode = nativeOscillatorNode; - this._onended = null; - this._oscillatorNodeRenderer = oscillatorNodeRenderer; - if (this._oscillatorNodeRenderer !== null && mergedOptions.periodicWave !== undefined) { - this._oscillatorNodeRenderer.periodicWave = - mergedOptions.periodicWave; - } - } - get detune() { - return this._detune; - } - get frequency() { - return this._frequency; - } - get onended() { - return this._onended; - } - set onended(value) { - const wrappedListener = typeof value === 'function' ? wrapEventListener(this, value) : null; - this._nativeOscillatorNode.onended = wrappedListener; - const nativeOnEnded = this._nativeOscillatorNode.onended; - this._onended = nativeOnEnded !== null && nativeOnEnded === wrappedListener ? value : nativeOnEnded; - } - get type() { - return this._nativeOscillatorNode.type; - } - set type(value) { - this._nativeOscillatorNode.type = value; - if (this._oscillatorNodeRenderer !== null) { - this._oscillatorNodeRenderer.periodicWave = null; - } - } - setPeriodicWave(periodicWave) { - this._nativeOscillatorNode.setPeriodicWave(periodicWave); - if (this._oscillatorNodeRenderer !== null) { - this._oscillatorNodeRenderer.periodicWave = periodicWave; - } - } - start(when = 0) { - this._nativeOscillatorNode.start(when); - if (this._oscillatorNodeRenderer !== null) { - this._oscillatorNodeRenderer.start = when; - } - if (this.context.state !== 'closed') { - setInternalStateToActive(this); - const resetInternalStateToPassive = () => { - this._nativeOscillatorNode.removeEventListener('ended', resetInternalStateToPassive); - if (isActiveAudioNode(this)) { - setInternalStateToPassive(this); - } - }; - this._nativeOscillatorNode.addEventListener('ended', resetInternalStateToPassive); - } - } - stop(when = 0) { - this._nativeOscillatorNode.stop(when); - if (this._oscillatorNodeRenderer !== null) { - this._oscillatorNodeRenderer.stop = when; - } - } - }; -}; - -const createOscillatorNodeRendererFactory = (connectAudioParam, createNativeOscillatorNode, getNativeAudioNode, renderAutomation, renderInputsOfAudioNode) => { - return () => { - const renderedNativeOscillatorNodes = new WeakMap(); - let periodicWave = null; - let start = null; - let stop = null; - const createOscillatorNode = async (proxy, nativeOfflineAudioContext) => { - let nativeOscillatorNode = getNativeAudioNode(proxy); - // If the initially used nativeOscillatorNode was not constructed on the same OfflineAudioContext it needs to be created again. - const nativeOscillatorNodeIsOwnedByContext = isOwnedByContext(nativeOscillatorNode, nativeOfflineAudioContext); - if (!nativeOscillatorNodeIsOwnedByContext) { - const options = { - channelCount: nativeOscillatorNode.channelCount, - channelCountMode: nativeOscillatorNode.channelCountMode, - channelInterpretation: nativeOscillatorNode.channelInterpretation, - detune: nativeOscillatorNode.detune.value, - frequency: nativeOscillatorNode.frequency.value, - periodicWave: periodicWave === null ? undefined : periodicWave, - type: nativeOscillatorNode.type - }; - nativeOscillatorNode = createNativeOscillatorNode(nativeOfflineAudioContext, options); - if (start !== null) { - nativeOscillatorNode.start(start); - } - if (stop !== null) { - nativeOscillatorNode.stop(stop); - } - } - renderedNativeOscillatorNodes.set(nativeOfflineAudioContext, nativeOscillatorNode); - if (!nativeOscillatorNodeIsOwnedByContext) { - await renderAutomation(nativeOfflineAudioContext, proxy.detune, nativeOscillatorNode.detune); - await renderAutomation(nativeOfflineAudioContext, proxy.frequency, nativeOscillatorNode.frequency); - } - else { - await connectAudioParam(nativeOfflineAudioContext, proxy.detune, nativeOscillatorNode.detune); - await connectAudioParam(nativeOfflineAudioContext, proxy.frequency, nativeOscillatorNode.frequency); - } - await renderInputsOfAudioNode(proxy, nativeOfflineAudioContext, nativeOscillatorNode); - return nativeOscillatorNode; - }; - return { - set periodicWave(value) { - periodicWave = value; - }, - set start(value) { - start = value; - }, - set stop(value) { - stop = value; - }, - render(proxy, nativeOfflineAudioContext) { - const renderedNativeOscillatorNode = renderedNativeOscillatorNodes.get(nativeOfflineAudioContext); - if (renderedNativeOscillatorNode !== undefined) { - return Promise.resolve(renderedNativeOscillatorNode); - } - return createOscillatorNode(proxy, nativeOfflineAudioContext); - } - }; - }; -}; - -const DEFAULT_OPTIONS$g = { - channelCount: 2, - channelCountMode: 'clamped-max', - channelInterpretation: 'speakers', - coneInnerAngle: 360, - coneOuterAngle: 360, - coneOuterGain: 0, - distanceModel: 'inverse', - maxDistance: 10000, - orientationX: 1, - orientationY: 0, - orientationZ: 0, - panningModel: 'equalpower', - positionX: 0, - positionY: 0, - positionZ: 0, - refDistance: 1, - rolloffFactor: 1 -}; -const createPannerNodeConstructor = (audioNodeConstructor, createAudioParam, createNativePannerNode, createPannerNodeRenderer, getNativeContext, isNativeOfflineAudioContext, setAudioNodeTailTime) => { - return class PannerNode extends audioNodeConstructor { - constructor(context, options) { - const nativeContext = getNativeContext(context); - const mergedOptions = { ...DEFAULT_OPTIONS$g, ...options }; - const nativePannerNode = createNativePannerNode(nativeContext, mergedOptions); - const isOffline = isNativeOfflineAudioContext(nativeContext); - const pannerNodeRenderer = (isOffline ? createPannerNodeRenderer() : null); - super(context, false, nativePannerNode, pannerNodeRenderer); - this._nativePannerNode = nativePannerNode; - // Bug #74: Safari does not export the correct values for maxValue and minValue. - this._orientationX = createAudioParam(this, isOffline, nativePannerNode.orientationX, MOST_POSITIVE_SINGLE_FLOAT, MOST_NEGATIVE_SINGLE_FLOAT); - this._orientationY = createAudioParam(this, isOffline, nativePannerNode.orientationY, MOST_POSITIVE_SINGLE_FLOAT, MOST_NEGATIVE_SINGLE_FLOAT); - this._orientationZ = createAudioParam(this, isOffline, nativePannerNode.orientationZ, MOST_POSITIVE_SINGLE_FLOAT, MOST_NEGATIVE_SINGLE_FLOAT); - this._positionX = createAudioParam(this, isOffline, nativePannerNode.positionX, MOST_POSITIVE_SINGLE_FLOAT, MOST_NEGATIVE_SINGLE_FLOAT); - this._positionY = createAudioParam(this, isOffline, nativePannerNode.positionY, MOST_POSITIVE_SINGLE_FLOAT, MOST_NEGATIVE_SINGLE_FLOAT); - this._positionZ = createAudioParam(this, isOffline, nativePannerNode.positionZ, MOST_POSITIVE_SINGLE_FLOAT, MOST_NEGATIVE_SINGLE_FLOAT); - // @todo Determine a meaningful tail-time instead of just using one second. - setAudioNodeTailTime(this, 1); - } - get coneInnerAngle() { - return this._nativePannerNode.coneInnerAngle; - } - set coneInnerAngle(value) { - this._nativePannerNode.coneInnerAngle = value; - } - get coneOuterAngle() { - return this._nativePannerNode.coneOuterAngle; - } - set coneOuterAngle(value) { - this._nativePannerNode.coneOuterAngle = value; - } - get coneOuterGain() { - return this._nativePannerNode.coneOuterGain; - } - set coneOuterGain(value) { - this._nativePannerNode.coneOuterGain = value; - } - get distanceModel() { - return this._nativePannerNode.distanceModel; - } - set distanceModel(value) { - this._nativePannerNode.distanceModel = value; - } - get maxDistance() { - return this._nativePannerNode.maxDistance; - } - set maxDistance(value) { - this._nativePannerNode.maxDistance = value; - } - get orientationX() { - return this._orientationX; - } - get orientationY() { - return this._orientationY; - } - get orientationZ() { - return this._orientationZ; - } - get panningModel() { - return this._nativePannerNode.panningModel; - } - set panningModel(value) { - this._nativePannerNode.panningModel = value; - } - get positionX() { - return this._positionX; - } - get positionY() { - return this._positionY; - } - get positionZ() { - return this._positionZ; - } - get refDistance() { - return this._nativePannerNode.refDistance; - } - set refDistance(value) { - this._nativePannerNode.refDistance = value; - } - get rolloffFactor() { - return this._nativePannerNode.rolloffFactor; - } - set rolloffFactor(value) { - this._nativePannerNode.rolloffFactor = value; - } - }; -}; - -const createPannerNodeRendererFactory = (connectAudioParam, createNativeChannelMergerNode, createNativeConstantSourceNode, createNativeGainNode, createNativePannerNode, getNativeAudioNode, nativeOfflineAudioContextConstructor, renderAutomation, renderInputsOfAudioNode, renderNativeOfflineAudioContext) => { - return () => { - const renderedNativeAudioNodes = new WeakMap(); - let renderedBufferPromise = null; - const createAudioNode = async (proxy, nativeOfflineAudioContext) => { - let nativeGainNode = null; - let nativePannerNode = getNativeAudioNode(proxy); - const commonAudioNodeOptions = { - channelCount: nativePannerNode.channelCount, - channelCountMode: nativePannerNode.channelCountMode, - channelInterpretation: nativePannerNode.channelInterpretation - }; - const commonNativePannerNodeOptions = { - ...commonAudioNodeOptions, - coneInnerAngle: nativePannerNode.coneInnerAngle, - coneOuterAngle: nativePannerNode.coneOuterAngle, - coneOuterGain: nativePannerNode.coneOuterGain, - distanceModel: nativePannerNode.distanceModel, - maxDistance: nativePannerNode.maxDistance, - panningModel: nativePannerNode.panningModel, - refDistance: nativePannerNode.refDistance, - rolloffFactor: nativePannerNode.rolloffFactor - }; - // If the initially used nativePannerNode was not constructed on the same OfflineAudioContext it needs to be created again. - const nativePannerNodeIsOwnedByContext = isOwnedByContext(nativePannerNode, nativeOfflineAudioContext); - // Bug #124: Safari does not support modifying the orientation and the position with AudioParams. - if ('bufferSize' in nativePannerNode) { - nativeGainNode = createNativeGainNode(nativeOfflineAudioContext, { ...commonAudioNodeOptions, gain: 1 }); - } - else if (!nativePannerNodeIsOwnedByContext) { - const options = { - ...commonNativePannerNodeOptions, - orientationX: nativePannerNode.orientationX.value, - orientationY: nativePannerNode.orientationY.value, - orientationZ: nativePannerNode.orientationZ.value, - positionX: nativePannerNode.positionX.value, - positionY: nativePannerNode.positionY.value, - positionZ: nativePannerNode.positionZ.value - }; - nativePannerNode = createNativePannerNode(nativeOfflineAudioContext, options); - } - renderedNativeAudioNodes.set(nativeOfflineAudioContext, nativeGainNode === null ? nativePannerNode : nativeGainNode); - if (nativeGainNode !== null) { - if (renderedBufferPromise === null) { - if (nativeOfflineAudioContextConstructor === null) { - throw new Error('Missing the native OfflineAudioContext constructor.'); - } - const partialOfflineAudioContext = new nativeOfflineAudioContextConstructor(6, - // Bug #17: Safari does not yet expose the length. - proxy.context.length, nativeOfflineAudioContext.sampleRate); - const nativeChannelMergerNode = createNativeChannelMergerNode(partialOfflineAudioContext, { - channelCount: 1, - channelCountMode: 'explicit', - channelInterpretation: 'speakers', - numberOfInputs: 6 - }); - nativeChannelMergerNode.connect(partialOfflineAudioContext.destination); - renderedBufferPromise = (async () => { - const nativeConstantSourceNodes = await Promise.all([ - proxy.orientationX, - proxy.orientationY, - proxy.orientationZ, - proxy.positionX, - proxy.positionY, - proxy.positionZ - ].map(async (audioParam, index) => { - const nativeConstantSourceNode = createNativeConstantSourceNode(partialOfflineAudioContext, { - channelCount: 1, - channelCountMode: 'explicit', - channelInterpretation: 'discrete', - offset: index === 0 ? 1 : 0 - }); - await renderAutomation(partialOfflineAudioContext, audioParam, nativeConstantSourceNode.offset); - return nativeConstantSourceNode; - })); - for (let i = 0; i < 6; i += 1) { - nativeConstantSourceNodes[i].connect(nativeChannelMergerNode, 0, i); - nativeConstantSourceNodes[i].start(0); - } - return renderNativeOfflineAudioContext(partialOfflineAudioContext); - })(); - } - const renderedBuffer = await renderedBufferPromise; - const inputGainNode = createNativeGainNode(nativeOfflineAudioContext, { ...commonAudioNodeOptions, gain: 1 }); - await renderInputsOfAudioNode(proxy, nativeOfflineAudioContext, inputGainNode); - const channelDatas = []; - for (let i = 0; i < renderedBuffer.numberOfChannels; i += 1) { - channelDatas.push(renderedBuffer.getChannelData(i)); - } - let lastOrientation = [channelDatas[0][0], channelDatas[1][0], channelDatas[2][0]]; - let lastPosition = [channelDatas[3][0], channelDatas[4][0], channelDatas[5][0]]; - let gateGainNode = createNativeGainNode(nativeOfflineAudioContext, { ...commonAudioNodeOptions, gain: 1 }); - let partialPannerNode = createNativePannerNode(nativeOfflineAudioContext, { - ...commonNativePannerNodeOptions, - orientationX: lastOrientation[0], - orientationY: lastOrientation[1], - orientationZ: lastOrientation[2], - positionX: lastPosition[0], - positionY: lastPosition[1], - positionZ: lastPosition[2] - }); - inputGainNode.connect(gateGainNode).connect(partialPannerNode.inputs[0]); - partialPannerNode.connect(nativeGainNode); - for (let i = 128; i < renderedBuffer.length; i += 128) { - const orientation = [channelDatas[0][i], channelDatas[1][i], channelDatas[2][i]]; - const positon = [channelDatas[3][i], channelDatas[4][i], channelDatas[5][i]]; - if (orientation.some((value, index) => value !== lastOrientation[index]) || - positon.some((value, index) => value !== lastPosition[index])) { - lastOrientation = orientation; - lastPosition = positon; - const currentTime = i / nativeOfflineAudioContext.sampleRate; - gateGainNode.gain.setValueAtTime(0, currentTime); - gateGainNode = createNativeGainNode(nativeOfflineAudioContext, { ...commonAudioNodeOptions, gain: 0 }); - partialPannerNode = createNativePannerNode(nativeOfflineAudioContext, { - ...commonNativePannerNodeOptions, - orientationX: lastOrientation[0], - orientationY: lastOrientation[1], - orientationZ: lastOrientation[2], - positionX: lastPosition[0], - positionY: lastPosition[1], - positionZ: lastPosition[2] - }); - gateGainNode.gain.setValueAtTime(1, currentTime); - inputGainNode.connect(gateGainNode).connect(partialPannerNode.inputs[0]); - partialPannerNode.connect(nativeGainNode); - } - } - return nativeGainNode; - } - if (!nativePannerNodeIsOwnedByContext) { - await renderAutomation(nativeOfflineAudioContext, proxy.orientationX, nativePannerNode.orientationX); - await renderAutomation(nativeOfflineAudioContext, proxy.orientationY, nativePannerNode.orientationY); - await renderAutomation(nativeOfflineAudioContext, proxy.orientationZ, nativePannerNode.orientationZ); - await renderAutomation(nativeOfflineAudioContext, proxy.positionX, nativePannerNode.positionX); - await renderAutomation(nativeOfflineAudioContext, proxy.positionY, nativePannerNode.positionY); - await renderAutomation(nativeOfflineAudioContext, proxy.positionZ, nativePannerNode.positionZ); - } - else { - await connectAudioParam(nativeOfflineAudioContext, proxy.orientationX, nativePannerNode.orientationX); - await connectAudioParam(nativeOfflineAudioContext, proxy.orientationY, nativePannerNode.orientationY); - await connectAudioParam(nativeOfflineAudioContext, proxy.orientationZ, nativePannerNode.orientationZ); - await connectAudioParam(nativeOfflineAudioContext, proxy.positionX, nativePannerNode.positionX); - await connectAudioParam(nativeOfflineAudioContext, proxy.positionY, nativePannerNode.positionY); - await connectAudioParam(nativeOfflineAudioContext, proxy.positionZ, nativePannerNode.positionZ); - } - if (isNativeAudioNodeFaker(nativePannerNode)) { - await renderInputsOfAudioNode(proxy, nativeOfflineAudioContext, nativePannerNode.inputs[0]); - } - else { - await renderInputsOfAudioNode(proxy, nativeOfflineAudioContext, nativePannerNode); - } - return nativePannerNode; - }; - return { - render(proxy, nativeOfflineAudioContext) { - const renderedNativeGainNodeOrNativePannerNode = renderedNativeAudioNodes.get(nativeOfflineAudioContext); - if (renderedNativeGainNodeOrNativePannerNode !== undefined) { - return Promise.resolve(renderedNativeGainNodeOrNativePannerNode); - } - return createAudioNode(proxy, nativeOfflineAudioContext); - } - }; - }; -}; - -const DEFAULT_OPTIONS$h = { - disableNormalization: false -}; -const createPeriodicWaveConstructor = (createNativePeriodicWave, getNativeContext, periodicWaveStore, sanitizePeriodicWaveOptions) => { - return class PeriodicWave { - constructor(context, options) { - const nativeContext = getNativeContext(context); - const mergedOptions = sanitizePeriodicWaveOptions({ ...DEFAULT_OPTIONS$h, ...options }); - const periodicWave = createNativePeriodicWave(nativeContext, mergedOptions); - periodicWaveStore.add(periodicWave); - // This does violate all good pratices but it is used here to simplify the handling of periodic waves. - return periodicWave; - } - static [Symbol.hasInstance](instance) { - return ((instance !== null && typeof instance === 'object' && Object.getPrototypeOf(instance) === PeriodicWave.prototype) || - periodicWaveStore.has(instance)); - } - }; -}; - -const createRenderAutomation = (getAudioParamRenderer, renderInputsOfAudioParam) => { - return (nativeOfflineAudioContext, audioParam, nativeAudioParam) => { - const audioParamRenderer = getAudioParamRenderer(audioParam); - audioParamRenderer.replay(nativeAudioParam); - return renderInputsOfAudioParam(audioParam, nativeOfflineAudioContext, nativeAudioParam); - }; -}; - -const createRenderInputsOfAudioNode = (getAudioNodeConnections, getAudioNodeRenderer, isPartOfACycle) => { - return async (audioNode, nativeOfflineAudioContext, nativeAudioNode) => { - const audioNodeConnections = getAudioNodeConnections(audioNode); - await Promise.all(audioNodeConnections.activeInputs - .map((connections, input) => Array.from(connections).map(async ([source, output]) => { - const audioNodeRenderer = getAudioNodeRenderer(source); - const renderedNativeAudioNode = await audioNodeRenderer.render(source, nativeOfflineAudioContext); - const destination = audioNode.context.destination; - if (!isPartOfACycle(source) && (audioNode !== destination || !isPartOfACycle(audioNode))) { - renderedNativeAudioNode.connect(nativeAudioNode, output, input); - } - })) - .reduce((allRenderingPromises, renderingPromises) => [...allRenderingPromises, ...renderingPromises], [])); - }; -}; - -const createRenderInputsOfAudioParam = (getAudioNodeRenderer, getAudioParamConnections, isPartOfACycle) => { - return async (audioParam, nativeOfflineAudioContext, nativeAudioParam) => { - const audioParamConnections = getAudioParamConnections(audioParam); - await Promise.all(Array.from(audioParamConnections.activeInputs).map(async ([source, output]) => { - const audioNodeRenderer = getAudioNodeRenderer(source); - const renderedNativeAudioNode = await audioNodeRenderer.render(source, nativeOfflineAudioContext); - if (!isPartOfACycle(source)) { - renderedNativeAudioNode.connect(nativeAudioParam, output); - } - })); - }; -}; - -const createRenderNativeOfflineAudioContext = (cacheTestResult, createNativeGainNode, createNativeScriptProcessorNode, testOfflineAudioContextCurrentTimeSupport) => { - return (nativeOfflineAudioContext) => { - // Bug #21: Safari does not support promises yet. - if (cacheTestResult(testPromiseSupport, () => testPromiseSupport(nativeOfflineAudioContext))) { - // Bug #158: Chrome and Edge do not advance currentTime if it is not accessed while rendering the audio. - return Promise.resolve(cacheTestResult(testOfflineAudioContextCurrentTimeSupport, testOfflineAudioContextCurrentTimeSupport)).then((isOfflineAudioContextCurrentTimeSupported) => { - if (!isOfflineAudioContextCurrentTimeSupported) { - const scriptProcessorNode = createNativeScriptProcessorNode(nativeOfflineAudioContext, 512, 0, 1); - nativeOfflineAudioContext.oncomplete = () => { - scriptProcessorNode.onaudioprocess = null; // tslint:disable-line:deprecation - scriptProcessorNode.disconnect(); - }; - scriptProcessorNode.onaudioprocess = () => nativeOfflineAudioContext.currentTime; // tslint:disable-line:deprecation - scriptProcessorNode.connect(nativeOfflineAudioContext.destination); - } - return nativeOfflineAudioContext.startRendering(); - }); - } - return new Promise((resolve) => { - // Bug #48: Safari does not render an OfflineAudioContext without any connected node. - const gainNode = createNativeGainNode(nativeOfflineAudioContext, { - channelCount: 1, - channelCountMode: 'explicit', - channelInterpretation: 'discrete', - gain: 0 - }); - nativeOfflineAudioContext.oncomplete = (event) => { - gainNode.disconnect(); - resolve(event.renderedBuffer); - }; - gainNode.connect(nativeOfflineAudioContext.destination); - nativeOfflineAudioContext.startRendering(); - }); - }; -}; - -const createSetActiveAudioWorkletNodeInputs = (activeAudioWorkletNodeInputsStore) => { - return (nativeAudioWorkletNode, activeInputs) => { - activeAudioWorkletNodeInputsStore.set(nativeAudioWorkletNode, activeInputs); - }; -}; - -const createSetAudioNodeTailTime = (audioNodeTailTimeStore) => { - return (audioNode, tailTime) => audioNodeTailTimeStore.set(audioNode, tailTime); -}; - -const createStartRendering = (audioBufferStore, cacheTestResult, getAudioNodeRenderer, getUnrenderedAudioWorkletNodes, renderNativeOfflineAudioContext, testAudioBufferCopyChannelMethodsOutOfBoundsSupport, wrapAudioBufferCopyChannelMethods, wrapAudioBufferCopyChannelMethodsOutOfBounds) => { - return (destination, nativeOfflineAudioContext) => getAudioNodeRenderer(destination) - .render(destination, nativeOfflineAudioContext) - /* - * Bug #86 & #87: Invoking the renderer of an AudioWorkletNode might be necessary if it has no direct or indirect connection to the - * destination. - */ - .then(() => Promise.all(Array.from(getUnrenderedAudioWorkletNodes(nativeOfflineAudioContext)).map((audioWorkletNode) => getAudioNodeRenderer(audioWorkletNode).render(audioWorkletNode, nativeOfflineAudioContext)))) - .then(() => renderNativeOfflineAudioContext(nativeOfflineAudioContext)) - .then((audioBuffer) => { - // Bug #5: Safari does not support copyFromChannel() and copyToChannel(). - // Bug #100: Safari does throw a wrong error when calling getChannelData() with an out-of-bounds value. - if (typeof audioBuffer.copyFromChannel !== 'function') { - wrapAudioBufferCopyChannelMethods(audioBuffer); - wrapAudioBufferGetChannelDataMethod(audioBuffer); - // Bug #157: Firefox does not allow the bufferOffset to be out-of-bounds. - } - else if (!cacheTestResult(testAudioBufferCopyChannelMethodsOutOfBoundsSupport, () => testAudioBufferCopyChannelMethodsOutOfBoundsSupport(audioBuffer))) { - wrapAudioBufferCopyChannelMethodsOutOfBounds(audioBuffer); - } - audioBufferStore.add(audioBuffer); - return audioBuffer; - }); -}; - -const DEFAULT_OPTIONS$i = { - channelCount: 2, - /* - * Bug #105: The channelCountMode should be 'clamped-max' according to the spec but is set to 'explicit' to achieve consistent - * behavior. - */ - channelCountMode: 'explicit', - channelInterpretation: 'speakers', - pan: 0 -}; -const createStereoPannerNodeConstructor = (audioNodeConstructor, createAudioParam, createNativeStereoPannerNode, createStereoPannerNodeRenderer, getNativeContext, isNativeOfflineAudioContext) => { - return class StereoPannerNode extends audioNodeConstructor { - constructor(context, options) { - const nativeContext = getNativeContext(context); - const mergedOptions = { ...DEFAULT_OPTIONS$i, ...options }; - const nativeStereoPannerNode = createNativeStereoPannerNode(nativeContext, mergedOptions); - const isOffline = isNativeOfflineAudioContext(nativeContext); - const stereoPannerNodeRenderer = (isOffline ? createStereoPannerNodeRenderer() : null); - super(context, false, nativeStereoPannerNode, stereoPannerNodeRenderer); - this._pan = createAudioParam(this, isOffline, nativeStereoPannerNode.pan); - } - get pan() { - return this._pan; - } - }; -}; - -const createStereoPannerNodeRendererFactory = (connectAudioParam, createNativeStereoPannerNode, getNativeAudioNode, renderAutomation, renderInputsOfAudioNode) => { - return () => { - const renderedNativeStereoPannerNodes = new WeakMap(); - const createStereoPannerNode = async (proxy, nativeOfflineAudioContext) => { - let nativeStereoPannerNode = getNativeAudioNode(proxy); - /* - * If the initially used nativeStereoPannerNode was not constructed on the same OfflineAudioContext it needs to be created - * again. - */ - const nativeStereoPannerNodeIsOwnedByContext = isOwnedByContext(nativeStereoPannerNode, nativeOfflineAudioContext); - if (!nativeStereoPannerNodeIsOwnedByContext) { - const options = { - channelCount: nativeStereoPannerNode.channelCount, - channelCountMode: nativeStereoPannerNode.channelCountMode, - channelInterpretation: nativeStereoPannerNode.channelInterpretation, - pan: nativeStereoPannerNode.pan.value - }; - nativeStereoPannerNode = createNativeStereoPannerNode(nativeOfflineAudioContext, options); - } - renderedNativeStereoPannerNodes.set(nativeOfflineAudioContext, nativeStereoPannerNode); - if (!nativeStereoPannerNodeIsOwnedByContext) { - await renderAutomation(nativeOfflineAudioContext, proxy.pan, nativeStereoPannerNode.pan); - } - else { - await connectAudioParam(nativeOfflineAudioContext, proxy.pan, nativeStereoPannerNode.pan); - } - if (isNativeAudioNodeFaker(nativeStereoPannerNode)) { - await renderInputsOfAudioNode(proxy, nativeOfflineAudioContext, nativeStereoPannerNode.inputs[0]); - } - else { - await renderInputsOfAudioNode(proxy, nativeOfflineAudioContext, nativeStereoPannerNode); - } - return nativeStereoPannerNode; - }; - return { - render(proxy, nativeOfflineAudioContext) { - const renderedNativeStereoPannerNode = renderedNativeStereoPannerNodes.get(nativeOfflineAudioContext); - if (renderedNativeStereoPannerNode !== undefined) { - return Promise.resolve(renderedNativeStereoPannerNode); - } - return createStereoPannerNode(proxy, nativeOfflineAudioContext); - } - }; - }; -}; - -// Bug #33: Safari exposes an AudioBuffer but it can't be used as a constructor. -const createTestAudioBufferConstructorSupport = (nativeAudioBufferConstructor) => { - return () => { - if (nativeAudioBufferConstructor === null) { - return false; - } - try { - new nativeAudioBufferConstructor({ length: 1, sampleRate: 44100 }); // tslint:disable-line:no-unused-expression - } - catch { - return false; - } - return true; - }; -}; - -/* - * Firefox up to version 67 didn't fully support the copyFromChannel() and copyToChannel() methods. Therefore testing one of those methods - * is enough to know if the other one is supported as well. - */ -const createTestAudioBufferCopyChannelMethodsSubarraySupport = (nativeOfflineAudioContextConstructor) => { - return () => { - if (nativeOfflineAudioContextConstructor === null) { - return false; - } - const nativeOfflineAudioContext = new nativeOfflineAudioContextConstructor(1, 1, 44100); - const nativeAudioBuffer = nativeOfflineAudioContext.createBuffer(1, 1, 44100); - // Bug #5: Safari does not support copyFromChannel() and copyToChannel(). - if (nativeAudioBuffer.copyToChannel === undefined) { - return true; - } - const source = new Float32Array(2); - try { - nativeAudioBuffer.copyFromChannel(source, 0, 0); - } - catch { - return false; - } - return true; - }; -}; - -const createTestAudioContextCloseMethodSupport = (nativeAudioContextConstructor) => { - return () => { - if (nativeAudioContextConstructor === null) { - return false; - } - // Try to check the prototype before constructing the AudioContext. - if (nativeAudioContextConstructor.prototype !== undefined && nativeAudioContextConstructor.prototype.close !== undefined) { - return true; - } - const audioContext = new nativeAudioContextConstructor(); - const isAudioContextClosable = audioContext.close !== undefined; - try { - audioContext.close(); - } - catch { - // Ignore errors. - } - return isAudioContextClosable; - }; -}; - -/** - * Edge up to version 14, Firefox up to version 52, Safari up to version 9 and maybe other browsers - * did not refuse to decode invalid parameters with a TypeError. - */ -const createTestAudioContextDecodeAudioDataMethodTypeErrorSupport = (nativeOfflineAudioContextConstructor) => { - return () => { - if (nativeOfflineAudioContextConstructor === null) { - return Promise.resolve(false); - } - const offlineAudioContext = new nativeOfflineAudioContextConstructor(1, 1, 44100); - // Bug #21: Safari does not support promises yet. - return new Promise((resolve) => { - let isPending = true; - const resolvePromise = (err) => { - if (isPending) { - isPending = false; - offlineAudioContext.startRendering(); - resolve(err instanceof TypeError); - } - }; - let promise; - // Bug #26: Safari throws a synchronous error. - try { - promise = offlineAudioContext - // Bug #1: Safari requires a successCallback. - .decodeAudioData(null, () => { - // Ignore the success callback. - }, resolvePromise); - } - catch (err) { - resolvePromise(err); - } - // Bug #21: Safari does not support promises yet. - if (promise !== undefined) { - // Bug #6: Chrome, Edge, Firefox and Opera do not call the errorCallback. - promise.catch(resolvePromise); - } - }); - }; -}; - -const createTestAudioContextOptionsSupport = (nativeAudioContextConstructor) => { - return () => { - if (nativeAudioContextConstructor === null) { - return false; - } - let audioContext; - try { - audioContext = new nativeAudioContextConstructor({ latencyHint: 'balanced' }); - } - catch { - return false; - } - audioContext.close(); - return true; - }; -}; - -// Safari up to version 12.0 (but not v12.1) didn't return the destination in case it was an AudioNode. -const createTestAudioNodeConnectMethodSupport = (nativeOfflineAudioContextConstructor) => { - return () => { - if (nativeOfflineAudioContextConstructor === null) { - return false; - } - const nativeOfflineAudioContext = new nativeOfflineAudioContextConstructor(1, 1, 44100); - const nativeGainNode = nativeOfflineAudioContext.createGain(); - const isSupported = nativeGainNode.connect(nativeGainNode) === nativeGainNode; - nativeGainNode.disconnect(nativeGainNode); - return isSupported; - }; -}; - -/** - * Chrome version 66 and 67 did not call the process() function of an AudioWorkletProcessor if it had no outputs. AudioWorklet support was - * enabled by default in version 66. - */ -const createTestAudioWorkletProcessorNoOutputsSupport = (nativeAudioWorkletNodeConstructor, nativeOfflineAudioContextConstructor) => { - return async () => { - // Bug #61: If there is no native AudioWorkletNode it gets faked and therefore it is no problem if the it doesn't exist. - if (nativeAudioWorkletNodeConstructor === null) { - return true; - } - if (nativeOfflineAudioContextConstructor === null) { - return false; - } - const blob = new Blob([ - 'let c,p;class A extends AudioWorkletProcessor{constructor(){super();this.port.onmessage=(e)=>{p=e.data;p.onmessage=()=>{p.postMessage(c);p.close()};this.port.postMessage(0)}}process(){c=1}}registerProcessor("a",A)' - ], { - type: 'application/javascript; charset=utf-8' - }); - const messageChannel = new MessageChannel(); - // Bug #141: Safari does not support creating an OfflineAudioContext with less than 44100 Hz. - const offlineAudioContext = new nativeOfflineAudioContextConstructor(1, 128, 44100); - const url = URL.createObjectURL(blob); - let isCallingProcess = false; - try { - await offlineAudioContext.audioWorklet.addModule(url); - const audioWorkletNode = new nativeAudioWorkletNodeConstructor(offlineAudioContext, 'a', { numberOfOutputs: 0 }); - const oscillator = offlineAudioContext.createOscillator(); - await new Promise((resolve) => { - audioWorkletNode.port.onmessage = () => resolve(); - audioWorkletNode.port.postMessage(messageChannel.port2, [messageChannel.port2]); - }); - audioWorkletNode.port.onmessage = () => (isCallingProcess = true); - oscillator.connect(audioWorkletNode); - oscillator.start(0); - await offlineAudioContext.startRendering(); - isCallingProcess = await new Promise((resolve) => { - messageChannel.port1.onmessage = ({ data }) => resolve(data === 1); - messageChannel.port1.postMessage(0); - }); - } - catch { - // Ignore errors. - } - finally { - messageChannel.port1.close(); - URL.revokeObjectURL(url); - } - return isCallingProcess; - }; -}; - -// Bug #179: Firefox does not allow to transfer any buffer which has been passed to the process() method as an argument. -const createTestAudioWorkletProcessorPostMessageSupport = (nativeAudioWorkletNodeConstructor, nativeOfflineAudioContextConstructor) => { - return async () => { - // Bug #61: If there is no native AudioWorkletNode it gets faked and therefore it is no problem if the it doesn't exist. - if (nativeAudioWorkletNodeConstructor === null) { - return true; - } - if (nativeOfflineAudioContextConstructor === null) { - return false; - } - const blob = new Blob(['class A extends AudioWorkletProcessor{process(i){this.port.postMessage(i,[i[0][0].buffer])}}registerProcessor("a",A)'], { - type: 'application/javascript; charset=utf-8' - }); - // Bug #141: Safari does not support creating an OfflineAudioContext with less than 44100 Hz. - const offlineAudioContext = new nativeOfflineAudioContextConstructor(1, 128, 44100); - const url = URL.createObjectURL(blob); - let isEmittingMessageEvents = false; - let isEmittingProcessorErrorEvents = false; - try { - await offlineAudioContext.audioWorklet.addModule(url); - const audioWorkletNode = new nativeAudioWorkletNodeConstructor(offlineAudioContext, 'a', { numberOfOutputs: 0 }); - const oscillator = offlineAudioContext.createOscillator(); - audioWorkletNode.port.onmessage = () => (isEmittingMessageEvents = true); - audioWorkletNode.onprocessorerror = () => (isEmittingProcessorErrorEvents = true); - oscillator.connect(audioWorkletNode); - oscillator.start(0); - await offlineAudioContext.startRendering(); - } - catch { - // Ignore errors. - } - finally { - URL.revokeObjectURL(url); - } - return isEmittingMessageEvents && !isEmittingProcessorErrorEvents; - }; -}; - -/** - * Firefox up to version 69 did not throw an error when setting a different channelCount or channelCountMode. - */ -const createTestChannelMergerNodeChannelCountSupport = (nativeOfflineAudioContextConstructor) => { - return () => { - if (nativeOfflineAudioContextConstructor === null) { - return false; - } - const offlineAudioContext = new nativeOfflineAudioContextConstructor(1, 1, 44100); - const nativeChannelMergerNode = offlineAudioContext.createChannelMerger(); - /** - * Bug #15: Safari does not return the default properties. It still needs to be patched. This test is supposed to test the support - * in other browsers. - */ - if (nativeChannelMergerNode.channelCountMode === 'max') { - return true; - } - try { - nativeChannelMergerNode.channelCount = 2; - } - catch { - return true; - } - return false; - }; -}; - -const createTestConstantSourceNodeAccurateSchedulingSupport = (nativeOfflineAudioContextConstructor) => { - return () => { - if (nativeOfflineAudioContextConstructor === null) { - return false; - } - const nativeOfflineAudioContext = new nativeOfflineAudioContextConstructor(1, 1, 44100); - // Bug #62: Safari does not support ConstantSourceNodes. - if (nativeOfflineAudioContext.createConstantSource === undefined) { - return true; - } - const nativeConstantSourceNode = nativeOfflineAudioContext.createConstantSource(); - /* - * @todo This is using bug #75 to detect bug #70. That works because both bugs were unique to - * the implementation of Firefox right now, but it could probably be done in a better way. - */ - return nativeConstantSourceNode.offset.maxValue !== Number.POSITIVE_INFINITY; - }; -}; - -// Opera up to version 57 did not allow to reassign the buffer of a ConvolverNode. -const createTestConvolverNodeBufferReassignabilitySupport = (nativeOfflineAudioContextConstructor) => { - return () => { - if (nativeOfflineAudioContextConstructor === null) { - return false; - } - const offlineAudioContext = new nativeOfflineAudioContextConstructor(1, 1, 44100); - const nativeConvolverNode = offlineAudioContext.createConvolver(); - nativeConvolverNode.buffer = offlineAudioContext.createBuffer(1, 1, offlineAudioContext.sampleRate); - try { - nativeConvolverNode.buffer = offlineAudioContext.createBuffer(1, 1, offlineAudioContext.sampleRate); - } - catch { - return false; - } - return true; - }; -}; - -// Chrome up to version v80, Edge up to version v80 and Opera up to version v67 did not allow to set the channelCount property of a ConvolverNode to 1. They also did not allow to set the channelCountMode to 'explicit'. -const createTestConvolverNodeChannelCountSupport = (nativeOfflineAudioContextConstructor) => { - return () => { - if (nativeOfflineAudioContextConstructor === null) { - return false; - } - const offlineAudioContext = new nativeOfflineAudioContextConstructor(1, 1, 44100); - const nativeConvolverNode = offlineAudioContext.createConvolver(); - try { - nativeConvolverNode.channelCount = 1; - } - catch { - return false; - } - return true; - }; -}; - -const createTestIsSecureContextSupport = (window) => { - return () => window !== null && window.hasOwnProperty('isSecureContext'); -}; - -// Firefox up to version 68 did not throw an error when creating a MediaStreamAudioSourceNode with a mediaStream that had no audio track. -const createTestMediaStreamAudioSourceNodeMediaStreamWithoutAudioTrackSupport = (nativeAudioContextConstructor) => { - return () => { - if (nativeAudioContextConstructor === null) { - return false; - } - const audioContext = new nativeAudioContextConstructor(); - try { - audioContext.createMediaStreamSource(new MediaStream()); - return false; - } - catch (err) { - return true; - } - finally { - audioContext.close(); - } - }; -}; - -const createTestOfflineAudioContextCurrentTimeSupport = (createNativeGainNode, nativeOfflineAudioContextConstructor) => { - return () => { - if (nativeOfflineAudioContextConstructor === null) { - return Promise.resolve(false); - } - const nativeOfflineAudioContext = new nativeOfflineAudioContextConstructor(1, 1, 44100); - // Bug #48: Safari does not render an OfflineAudioContext without any connected node. - const gainNode = createNativeGainNode(nativeOfflineAudioContext, { - channelCount: 1, - channelCountMode: 'explicit', - channelInterpretation: 'discrete', - gain: 0 - }); - // Bug #21: Safari does not support promises yet. - return new Promise((resolve) => { - nativeOfflineAudioContext.oncomplete = () => { - gainNode.disconnect(); - resolve(nativeOfflineAudioContext.currentTime !== 0); - }; - nativeOfflineAudioContext.startRendering(); - }); - }; -}; - -/** - * Firefox up to version 62 did not kick off the processing of the StereoPannerNode if the value of pan was zero. - */ -const createTestStereoPannerNodeDefaultValueSupport = (nativeOfflineAudioContextConstructor) => { - return () => { - if (nativeOfflineAudioContextConstructor === null) { - return Promise.resolve(false); - } - const nativeOfflineAudioContext = new nativeOfflineAudioContextConstructor(1, 1, 44100); - /* - * Bug #105: Safari does not support the StereoPannerNode. Therefore the returned value should normally be false but the faker does - * support the tested behaviour. - */ - if (nativeOfflineAudioContext.createStereoPanner === undefined) { - return Promise.resolve(true); - } - // Bug #62: Safari does not support ConstantSourceNodes. - if (nativeOfflineAudioContext.createConstantSource === undefined) { - return Promise.resolve(true); - } - const constantSourceNode = nativeOfflineAudioContext.createConstantSource(); - const stereoPanner = nativeOfflineAudioContext.createStereoPanner(); - constantSourceNode.channelCount = 1; - constantSourceNode.offset.value = 1; - stereoPanner.channelCount = 1; - constantSourceNode.start(); - constantSourceNode.connect(stereoPanner).connect(nativeOfflineAudioContext.destination); - return nativeOfflineAudioContext.startRendering().then((buffer) => buffer.getChannelData(0)[0] !== 1); - }; -}; - -const createUnknownError = () => new DOMException('', 'UnknownError'); - -const DEFAULT_OPTIONS$j = { - channelCount: 2, - channelCountMode: 'max', - channelInterpretation: 'speakers', - curve: null, - oversample: 'none' -}; -const createWaveShaperNodeConstructor = (audioNodeConstructor, createInvalidStateError, createNativeWaveShaperNode, createWaveShaperNodeRenderer, getNativeContext, isNativeOfflineAudioContext, setAudioNodeTailTime) => { - return class WaveShaperNode extends audioNodeConstructor { - constructor(context, options) { - const nativeContext = getNativeContext(context); - const mergedOptions = { ...DEFAULT_OPTIONS$j, ...options }; - const nativeWaveShaperNode = createNativeWaveShaperNode(nativeContext, mergedOptions); - const isOffline = isNativeOfflineAudioContext(nativeContext); - const waveShaperNodeRenderer = (isOffline ? createWaveShaperNodeRenderer() : null); - // @todo Add a mechanism to only switch a WaveShaperNode to active while it is connected. - super(context, true, nativeWaveShaperNode, waveShaperNodeRenderer); - this._isCurveNullified = false; - this._nativeWaveShaperNode = nativeWaveShaperNode; - // @todo Determine a meaningful tail-time instead of just using one second. - setAudioNodeTailTime(this, 1); - } - get curve() { - if (this._isCurveNullified) { - return null; - } - return this._nativeWaveShaperNode.curve; - } - set curve(value) { - // Bug #103: Safari does not allow to set the curve to null. - if (value === null) { - this._isCurveNullified = true; - this._nativeWaveShaperNode.curve = new Float32Array([0, 0]); - } - else { - // Bug #102: Safari does not throw an InvalidStateError when the curve has less than two samples. - // Bug #104: Chrome, Edge and Opera will throw an InvalidAccessError when the curve has less than two samples. - if (value.length < 2) { - throw createInvalidStateError(); - } - this._isCurveNullified = false; - this._nativeWaveShaperNode.curve = value; - } - } - get oversample() { - return this._nativeWaveShaperNode.oversample; - } - set oversample(value) { - this._nativeWaveShaperNode.oversample = value; - } - }; -}; - -const createWaveShaperNodeRendererFactory = (createNativeWaveShaperNode, getNativeAudioNode, renderInputsOfAudioNode) => { - return () => { - const renderedNativeWaveShaperNodes = new WeakMap(); - const createWaveShaperNode = async (proxy, nativeOfflineAudioContext) => { - let nativeWaveShaperNode = getNativeAudioNode(proxy); - // If the initially used nativeWaveShaperNode was not constructed on the same OfflineAudioContext it needs to be created again. - const nativeWaveShaperNodeIsOwnedByContext = isOwnedByContext(nativeWaveShaperNode, nativeOfflineAudioContext); - if (!nativeWaveShaperNodeIsOwnedByContext) { - const options = { - channelCount: nativeWaveShaperNode.channelCount, - channelCountMode: nativeWaveShaperNode.channelCountMode, - channelInterpretation: nativeWaveShaperNode.channelInterpretation, - curve: nativeWaveShaperNode.curve, - oversample: nativeWaveShaperNode.oversample - }; - nativeWaveShaperNode = createNativeWaveShaperNode(nativeOfflineAudioContext, options); - } - renderedNativeWaveShaperNodes.set(nativeOfflineAudioContext, nativeWaveShaperNode); - if (isNativeAudioNodeFaker(nativeWaveShaperNode)) { - await renderInputsOfAudioNode(proxy, nativeOfflineAudioContext, nativeWaveShaperNode.inputs[0]); - } - else { - await renderInputsOfAudioNode(proxy, nativeOfflineAudioContext, nativeWaveShaperNode); - } - return nativeWaveShaperNode; - }; - return { - render(proxy, nativeOfflineAudioContext) { - const renderedNativeWaveShaperNode = renderedNativeWaveShaperNodes.get(nativeOfflineAudioContext); - if (renderedNativeWaveShaperNode !== undefined) { - return Promise.resolve(renderedNativeWaveShaperNode); - } - return createWaveShaperNode(proxy, nativeOfflineAudioContext); - } - }; - }; -}; - -const createWindow = () => (typeof window === 'undefined' ? null : window); - -const createWrapAudioBufferCopyChannelMethods = (convertNumberToUnsignedLong, createIndexSizeError) => { - return (audioBuffer) => { - audioBuffer.copyFromChannel = (destination, channelNumberAsNumber, bufferOffsetAsNumber = 0) => { - const bufferOffset = convertNumberToUnsignedLong(bufferOffsetAsNumber); - const channelNumber = convertNumberToUnsignedLong(channelNumberAsNumber); - if (channelNumber >= audioBuffer.numberOfChannels) { - throw createIndexSizeError(); - } - const audioBufferLength = audioBuffer.length; - const channelData = audioBuffer.getChannelData(channelNumber); - const destinationLength = destination.length; - for (let i = bufferOffset < 0 ? -bufferOffset : 0; i + bufferOffset < audioBufferLength && i < destinationLength; i += 1) { - destination[i] = channelData[i + bufferOffset]; - } - }; - audioBuffer.copyToChannel = (source, channelNumberAsNumber, bufferOffsetAsNumber = 0) => { - const bufferOffset = convertNumberToUnsignedLong(bufferOffsetAsNumber); - const channelNumber = convertNumberToUnsignedLong(channelNumberAsNumber); - if (channelNumber >= audioBuffer.numberOfChannels) { - throw createIndexSizeError(); - } - const audioBufferLength = audioBuffer.length; - const channelData = audioBuffer.getChannelData(channelNumber); - const sourceLength = source.length; - for (let i = bufferOffset < 0 ? -bufferOffset : 0; i + bufferOffset < audioBufferLength && i < sourceLength; i += 1) { - channelData[i + bufferOffset] = source[i]; - } - }; - }; -}; - -const createWrapAudioBufferCopyChannelMethodsOutOfBounds = (convertNumberToUnsignedLong) => { - return (audioBuffer) => { - audioBuffer.copyFromChannel = ((copyFromChannel) => { - return (destination, channelNumberAsNumber, bufferOffsetAsNumber = 0) => { - const bufferOffset = convertNumberToUnsignedLong(bufferOffsetAsNumber); - const channelNumber = convertNumberToUnsignedLong(channelNumberAsNumber); - if (bufferOffset < audioBuffer.length) { - return copyFromChannel.call(audioBuffer, destination, channelNumber, bufferOffset); - } - }; - })(audioBuffer.copyFromChannel); - audioBuffer.copyToChannel = ((copyToChannel) => { - return (source, channelNumberAsNumber, bufferOffsetAsNumber = 0) => { - const bufferOffset = convertNumberToUnsignedLong(bufferOffsetAsNumber); - const channelNumber = convertNumberToUnsignedLong(channelNumberAsNumber); - if (bufferOffset < audioBuffer.length) { - return copyToChannel.call(audioBuffer, source, channelNumber, bufferOffset); - } - }; - })(audioBuffer.copyToChannel); - }; -}; - -const createWrapAudioBufferSourceNodeStopMethodNullifiedBuffer = (overwriteAccessors) => { - return (nativeAudioBufferSourceNode, nativeContext) => { - const nullifiedBuffer = nativeContext.createBuffer(1, 1, 44100); - if (nativeAudioBufferSourceNode.buffer === null) { - nativeAudioBufferSourceNode.buffer = nullifiedBuffer; - } - overwriteAccessors(nativeAudioBufferSourceNode, 'buffer', (get) => () => { - const value = get.call(nativeAudioBufferSourceNode); - return value === nullifiedBuffer ? null : value; - }, (set) => (value) => { - return set.call(nativeAudioBufferSourceNode, value === null ? nullifiedBuffer : value); - }); - }; -}; - -const createWrapChannelMergerNode = (createInvalidStateError, monitorConnections) => { - return (nativeContext, channelMergerNode) => { - // Bug #15: Safari does not return the default properties. - channelMergerNode.channelCount = 1; - channelMergerNode.channelCountMode = 'explicit'; - // Bug #16: Safari does not throw an error when setting a different channelCount or channelCountMode. - Object.defineProperty(channelMergerNode, 'channelCount', { - get: () => 1, - set: () => { - throw createInvalidStateError(); - } - }); - Object.defineProperty(channelMergerNode, 'channelCountMode', { - get: () => 'explicit', - set: () => { - throw createInvalidStateError(); - } - }); - // Bug #20: Safari requires a connection of any kind to treat the input signal correctly. - const audioBufferSourceNode = nativeContext.createBufferSource(); - const whenConnected = () => { - const length = channelMergerNode.numberOfInputs; - for (let i = 0; i < length; i += 1) { - audioBufferSourceNode.connect(channelMergerNode, 0, i); - } - }; - const whenDisconnected = () => audioBufferSourceNode.disconnect(channelMergerNode); - monitorConnections(channelMergerNode, whenConnected, whenDisconnected); - }; -}; - -const getFirstSample = (audioBuffer, buffer, channelNumber) => { - // Bug #5: Safari does not support copyFromChannel() and copyToChannel(). - if (audioBuffer.copyFromChannel === undefined) { - return audioBuffer.getChannelData(channelNumber)[0]; - } - audioBuffer.copyFromChannel(buffer, channelNumber); - return buffer[0]; -}; - -const isDCCurve = (curve) => { - if (curve === null) { - return false; - } - const length = curve.length; - if (length % 2 !== 0) { - return curve[Math.floor(length / 2)] !== 0; - } - return curve[length / 2 - 1] + curve[length / 2] !== 0; -}; - -const overwriteAccessors = (object, property, createGetter, createSetter) => { - let prototype = object; - while (!prototype.hasOwnProperty(property)) { - prototype = Object.getPrototypeOf(prototype); - } - const { get, set } = Object.getOwnPropertyDescriptor(prototype, property); - Object.defineProperty(object, property, { get: createGetter(get), set: createSetter(set) }); -}; - -const sanitizeAudioWorkletNodeOptions = (options) => { - return { - ...options, - outputChannelCount: options.outputChannelCount !== undefined - ? options.outputChannelCount - : options.numberOfInputs === 1 && options.numberOfOutputs === 1 - ? /* - * Bug #61: This should be the computedNumberOfChannels, but unfortunately that is almost impossible to fake. That's why - * the channelCountMode is required to be 'explicit' as long as there is not a native implementation in every browser. That - * makes sure the computedNumberOfChannels is equivilant to the channelCount which makes it much easier to compute. - */ - [options.channelCount] - : Array.from({ length: options.numberOfOutputs }, () => 1) - }; -}; - -const sanitizeChannelSplitterOptions = (options) => { - return { ...options, channelCount: options.numberOfOutputs }; -}; - -const sanitizePeriodicWaveOptions = (options) => { - const { imag, real } = options; - if (imag === undefined) { - if (real === undefined) { - return { ...options, imag: [0, 0], real: [0, 0] }; - } - return { ...options, imag: Array.from(real, () => 0), real }; - } - if (real === undefined) { - return { ...options, imag, real: Array.from(imag, () => 0) }; - } - return { ...options, imag, real }; -}; - -const setValueAtTimeUntilPossible = (audioParam, value, startTime) => { - try { - audioParam.setValueAtTime(value, startTime); - } - catch (err) { - if (err.code !== 9) { - throw err; - } - setValueAtTimeUntilPossible(audioParam, value, startTime + 1e-7); - } -}; - -const testAudioBufferSourceNodeStartMethodConsecutiveCallsSupport = (nativeContext) => { - const nativeAudioBufferSourceNode = nativeContext.createBufferSource(); - nativeAudioBufferSourceNode.start(); - try { - nativeAudioBufferSourceNode.start(); - } - catch { - return true; - } - return false; -}; - -const testAudioBufferSourceNodeStartMethodOffsetClampingSupport = (nativeContext) => { - const nativeAudioBufferSourceNode = nativeContext.createBufferSource(); - const nativeAudioBuffer = nativeContext.createBuffer(1, 1, 44100); - nativeAudioBufferSourceNode.buffer = nativeAudioBuffer; - try { - nativeAudioBufferSourceNode.start(0, 1); - } - catch { - return false; - } - return true; -}; - -const testAudioBufferSourceNodeStopMethodNullifiedBufferSupport = (nativeContext) => { - const nativeAudioBufferSourceNode = nativeContext.createBufferSource(); - nativeAudioBufferSourceNode.start(); - try { - nativeAudioBufferSourceNode.stop(); - } - catch { - return false; - } - return true; -}; - -const testAudioScheduledSourceNodeStartMethodNegativeParametersSupport = (nativeContext) => { - const nativeAudioBufferSourceNode = nativeContext.createOscillator(); - try { - nativeAudioBufferSourceNode.start(-1); - } - catch (err) { - return err instanceof RangeError; - } - return false; -}; - -const testAudioScheduledSourceNodeStopMethodConsecutiveCallsSupport = (nativeContext) => { - const nativeAudioBuffer = nativeContext.createBuffer(1, 1, 44100); - const nativeAudioBufferSourceNode = nativeContext.createBufferSource(); - nativeAudioBufferSourceNode.buffer = nativeAudioBuffer; - nativeAudioBufferSourceNode.start(); - nativeAudioBufferSourceNode.stop(); - try { - nativeAudioBufferSourceNode.stop(); - return true; - } - catch { - return false; - } -}; - -const testAudioScheduledSourceNodeStopMethodNegativeParametersSupport = (nativeContext) => { - const nativeAudioBufferSourceNode = nativeContext.createOscillator(); - try { - nativeAudioBufferSourceNode.stop(-1); - } - catch (err) { - return err instanceof RangeError; - } - return false; -}; - -const testAudioWorkletNodeOptionsClonability = (audioWorkletNodeOptions) => { - const { port1, port2 } = new MessageChannel(); - try { - // This will throw an error if the audioWorkletNodeOptions are not clonable. - port1.postMessage(audioWorkletNodeOptions); - } - finally { - port1.close(); - port2.close(); - } -}; - -/* - * Bug #122: Edge up to version v18 did not allow to construct a DOMException'. It also had a couple more bugs but since this is easy to - * test it's used here as a placeholder. - * - * Bug #27: Edge up to version v18 did reject an invalid arrayBuffer passed to decodeAudioData() with a DOMException. - * - * Bug #50: Edge up to version v18 did not allow to create AudioNodes on a closed context. - * - * Bug #57: Edge up to version v18 did not throw an error when assigning the type of an OscillatorNode to 'custom'. - * - * Bug #63: Edge up to version v18 did not expose the mediaElement property of a MediaElementAudioSourceNode. - * - * Bug #64: Edge up to version v18 did not support the MediaStreamAudioDestinationNode. - * - * Bug #71: Edge up to version v18 did not allow to set the buffer of an AudioBufferSourceNode to null. - * - * Bug #93: Edge up to version v18 did set the sampleRate of an AudioContext to zero when it was closed. - * - * Bug #101: Edge up to version v18 refused to execute decodeAudioData() on a closed context. - * - * Bug #106: Edge up to version v18 did not expose the maxValue and minValue properties of the pan AudioParam of a StereoPannerNode. - * - * Bug #110: Edge up to version v18 did not expose the maxValue and minValue properties of the attack, knee, ratio, release and threshold AudioParams of a DynamicsCompressorNode. - * - * Bug #123: Edge up to version v18 did not support HRTF as the panningModel for a PannerNode. - * - * Bug #145: Edge up to version v18 did throw an IndexSizeError when an OfflineAudioContext was created with a sampleRate of zero. - * - * Bug #161: Edge up to version v18 did not expose the maxValue and minValue properties of the delayTime AudioParam of a DelayNode. - */ -const testDomExceptionConstructorSupport = () => { - try { - new DOMException(); // tslint:disable-line:no-unused-expression - } - catch { - return false; - } - return true; -}; - -// Safari at version 11 did not support transferables. -const testTransferablesSupport = () => new Promise((resolve) => { - const arrayBuffer = new ArrayBuffer(0); - const { port1, port2 } = new MessageChannel(); - port1.onmessage = ({ data }) => resolve(data !== null); - port2.postMessage(arrayBuffer, [arrayBuffer]); -}); - -const wrapAudioBufferSourceNodeStartMethodOffsetClamping = (nativeAudioBufferSourceNode) => { - nativeAudioBufferSourceNode.start = ((start) => { - return (when = 0, offset = 0, duration) => { - const buffer = nativeAudioBufferSourceNode.buffer; - // Bug #154: Safari does not clamp the offset if it is equal to or greater than the duration of the buffer. - const clampedOffset = buffer === null ? offset : Math.min(buffer.duration, offset); - // Bug #155: Safari does not handle the offset correctly if it would cause the buffer to be not be played at all. - if (buffer !== null && clampedOffset > buffer.duration - 0.5 / nativeAudioBufferSourceNode.context.sampleRate) { - start.call(nativeAudioBufferSourceNode, when, 0, 0); - } - else { - start.call(nativeAudioBufferSourceNode, when, clampedOffset, duration); - } - }; - })(nativeAudioBufferSourceNode.start); -}; - -const wrapAudioScheduledSourceNodeStopMethodConsecutiveCalls = (nativeAudioScheduledSourceNode, nativeContext) => { - const nativeGainNode = nativeContext.createGain(); - nativeAudioScheduledSourceNode.connect(nativeGainNode); - const disconnectGainNode = ((disconnect) => { - return () => { - // @todo TypeScript cannot infer the overloaded signature with 1 argument yet. - disconnect.call(nativeAudioScheduledSourceNode, nativeGainNode); - nativeAudioScheduledSourceNode.removeEventListener('ended', disconnectGainNode); - }; - })(nativeAudioScheduledSourceNode.disconnect); - nativeAudioScheduledSourceNode.addEventListener('ended', disconnectGainNode); - interceptConnections(nativeAudioScheduledSourceNode, nativeGainNode); - nativeAudioScheduledSourceNode.stop = ((stop) => { - let isStopped = false; - return (when = 0) => { - if (isStopped) { - try { - stop.call(nativeAudioScheduledSourceNode, when); - } - catch { - nativeGainNode.gain.setValueAtTime(0, when); - } - } - else { - stop.call(nativeAudioScheduledSourceNode, when); - isStopped = true; - } - }; - })(nativeAudioScheduledSourceNode.stop); -}; - -const wrapEventListener = (target, eventListener) => { - return (event) => { - const descriptor = { value: target }; - Object.defineProperties(event, { - currentTarget: descriptor, - target: descriptor - }); - if (typeof eventListener === 'function') { - return eventListener.call(target, event); - } - return eventListener.handleEvent.call(target, event); - }; -}; - -const addActiveInputConnectionToAudioNode = createAddActiveInputConnectionToAudioNode(insertElementInSet); -const addPassiveInputConnectionToAudioNode = createAddPassiveInputConnectionToAudioNode(insertElementInSet); -const deleteActiveInputConnectionToAudioNode = createDeleteActiveInputConnectionToAudioNode(pickElementFromSet); -const audioNodeTailTimeStore = new WeakMap(); -const getAudioNodeTailTime = createGetAudioNodeTailTime(audioNodeTailTimeStore); -const cacheTestResult = createCacheTestResult(new Map(), new WeakMap()); -const window$1 = createWindow(); -const createNativeAnalyserNode = createNativeAnalyserNodeFactory(cacheTestResult, createIndexSizeError); -const getAudioNodeRenderer = createGetAudioNodeRenderer(getAudioNodeConnections); -const renderInputsOfAudioNode = createRenderInputsOfAudioNode(getAudioNodeConnections, getAudioNodeRenderer, isPartOfACycle); -const createAnalyserNodeRenderer = createAnalyserNodeRendererFactory(createNativeAnalyserNode, getNativeAudioNode, renderInputsOfAudioNode); -const getNativeContext = createGetNativeContext(CONTEXT_STORE); -const nativeOfflineAudioContextConstructor = createNativeOfflineAudioContextConstructor(window$1); -const isNativeOfflineAudioContext = createIsNativeOfflineAudioContext(nativeOfflineAudioContextConstructor); -const audioParamAudioNodeStore = new WeakMap(); -const eventTargetConstructor = createEventTargetConstructor(wrapEventListener); -const nativeAudioContextConstructor = createNativeAudioContextConstructor(window$1); -const isNativeAudioContext = createIsNativeAudioContext(nativeAudioContextConstructor); -const isNativeAudioNode$1 = createIsNativeAudioNode(window$1); -const isNativeAudioParam = createIsNativeAudioParam(window$1); -const nativeAudioWorkletNodeConstructor = createNativeAudioWorkletNodeConstructor(window$1); -const audioNodeConstructor = createAudioNodeConstructor(createAddAudioNodeConnections(AUDIO_NODE_CONNECTIONS_STORE), createAddConnectionToAudioNode(addActiveInputConnectionToAudioNode, addPassiveInputConnectionToAudioNode, connectNativeAudioNodeToNativeAudioNode, deleteActiveInputConnectionToAudioNode, disconnectNativeAudioNodeFromNativeAudioNode, getAudioNodeConnections, getAudioNodeTailTime, getEventListenersOfAudioNode, getNativeAudioNode, insertElementInSet, isActiveAudioNode, isPartOfACycle, isPassiveAudioNode), cacheTestResult, createIncrementCycleCounterFactory(CYCLE_COUNTERS, disconnectNativeAudioNodeFromNativeAudioNode, getAudioNodeConnections, getNativeAudioNode, getNativeAudioParam, isActiveAudioNode), createIndexSizeError, createInvalidAccessError, createNotSupportedError, createDecrementCycleCounter(connectNativeAudioNodeToNativeAudioNode, CYCLE_COUNTERS, getAudioNodeConnections, getNativeAudioNode, getNativeAudioParam, getNativeContext, isActiveAudioNode, isNativeOfflineAudioContext), createDetectCycles(audioParamAudioNodeStore, getAudioNodeConnections, getValueForKey), eventTargetConstructor, getNativeContext, isNativeAudioContext, isNativeAudioNode$1, isNativeAudioParam, isNativeOfflineAudioContext, nativeAudioWorkletNodeConstructor); -const analyserNodeConstructor = createAnalyserNodeConstructor(audioNodeConstructor, createAnalyserNodeRenderer, createIndexSizeError, createNativeAnalyserNode, getNativeContext, isNativeOfflineAudioContext); -const audioBufferStore = new WeakSet(); -const nativeAudioBufferConstructor = createNativeAudioBufferConstructor(window$1); -const convertNumberToUnsignedLong = createConvertNumberToUnsignedLong(new Uint32Array(1)); -const wrapAudioBufferCopyChannelMethods = createWrapAudioBufferCopyChannelMethods(convertNumberToUnsignedLong, createIndexSizeError); -const wrapAudioBufferCopyChannelMethodsOutOfBounds = createWrapAudioBufferCopyChannelMethodsOutOfBounds(convertNumberToUnsignedLong); -const audioBufferConstructor = createAudioBufferConstructor(audioBufferStore, cacheTestResult, createNotSupportedError, nativeAudioBufferConstructor, nativeOfflineAudioContextConstructor, createTestAudioBufferConstructorSupport(nativeAudioBufferConstructor), wrapAudioBufferCopyChannelMethods, wrapAudioBufferCopyChannelMethodsOutOfBounds); -const addSilentConnection = createAddSilentConnection(createNativeGainNode); -const renderInputsOfAudioParam = createRenderInputsOfAudioParam(getAudioNodeRenderer, getAudioParamConnections, isPartOfACycle); -const connectAudioParam = createConnectAudioParam(renderInputsOfAudioParam); -const createNativeAudioBufferSourceNode = createNativeAudioBufferSourceNodeFactory(addSilentConnection, cacheTestResult, testAudioBufferSourceNodeStartMethodConsecutiveCallsSupport, testAudioBufferSourceNodeStartMethodOffsetClampingSupport, testAudioBufferSourceNodeStopMethodNullifiedBufferSupport, testAudioScheduledSourceNodeStartMethodNegativeParametersSupport, testAudioScheduledSourceNodeStopMethodConsecutiveCallsSupport, testAudioScheduledSourceNodeStopMethodNegativeParametersSupport, wrapAudioBufferSourceNodeStartMethodOffsetClamping, createWrapAudioBufferSourceNodeStopMethodNullifiedBuffer(overwriteAccessors), wrapAudioScheduledSourceNodeStopMethodConsecutiveCalls); -const renderAutomation = createRenderAutomation(createGetAudioParamRenderer(getAudioParamConnections), renderInputsOfAudioParam); -const createAudioBufferSourceNodeRenderer = createAudioBufferSourceNodeRendererFactory(connectAudioParam, createNativeAudioBufferSourceNode, getNativeAudioNode, renderAutomation, renderInputsOfAudioNode); -const createAudioParam = createAudioParamFactory(createAddAudioParamConnections(AUDIO_PARAM_CONNECTIONS_STORE), audioParamAudioNodeStore, AUDIO_PARAM_STORE, createAudioParamRenderer, createCancelAndHoldAutomationEvent, createCancelScheduledValuesAutomationEvent, createExponentialRampToValueAutomationEvent, createLinearRampToValueAutomationEvent, createSetTargetAutomationEvent, createSetValueAutomationEvent, createSetValueCurveAutomationEvent, nativeAudioContextConstructor, setValueAtTimeUntilPossible); -const audioBufferSourceNodeConstructor = createAudioBufferSourceNodeConstructor(audioNodeConstructor, createAudioBufferSourceNodeRenderer, createAudioParam, createInvalidStateError, createNativeAudioBufferSourceNode, getNativeContext, isNativeOfflineAudioContext, wrapEventListener); -const audioDestinationNodeConstructor = createAudioDestinationNodeConstructor(audioNodeConstructor, createAudioDestinationNodeRenderer, createIndexSizeError, createInvalidStateError, createNativeAudioDestinationNodeFactory(createNativeGainNode, overwriteAccessors), getNativeContext, isNativeOfflineAudioContext, renderInputsOfAudioNode); -const createBiquadFilterNodeRenderer = createBiquadFilterNodeRendererFactory(connectAudioParam, createNativeBiquadFilterNode, getNativeAudioNode, renderAutomation, renderInputsOfAudioNode); -const setAudioNodeTailTime = createSetAudioNodeTailTime(audioNodeTailTimeStore); -const biquadFilterNodeConstructor = createBiquadFilterNodeConstructor(audioNodeConstructor, createAudioParam, createBiquadFilterNodeRenderer, createInvalidAccessError, createNativeBiquadFilterNode, getNativeContext, isNativeOfflineAudioContext, setAudioNodeTailTime); -const monitorConnections = createMonitorConnections(insertElementInSet, isNativeAudioNode$1); -const wrapChannelMergerNode = createWrapChannelMergerNode(createInvalidStateError, monitorConnections); -const createNativeChannelMergerNode = createNativeChannelMergerNodeFactory(nativeAudioContextConstructor, wrapChannelMergerNode); -const createChannelMergerNodeRenderer = createChannelMergerNodeRendererFactory(createNativeChannelMergerNode, getNativeAudioNode, renderInputsOfAudioNode); -const channelMergerNodeConstructor = createChannelMergerNodeConstructor(audioNodeConstructor, createChannelMergerNodeRenderer, createNativeChannelMergerNode, getNativeContext, isNativeOfflineAudioContext); -const createChannelSplitterNodeRenderer = createChannelSplitterNodeRendererFactory(createNativeChannelSplitterNode, getNativeAudioNode, renderInputsOfAudioNode); -const channelSplitterNodeConstructor = createChannelSplitterNodeConstructor(audioNodeConstructor, createChannelSplitterNodeRenderer, createNativeChannelSplitterNode, getNativeContext, isNativeOfflineAudioContext, sanitizeChannelSplitterOptions); -const createNativeConstantSourceNodeFaker = createNativeConstantSourceNodeFakerFactory(addSilentConnection, createNativeAudioBufferSourceNode, createNativeGainNode, monitorConnections); -const createNativeConstantSourceNode = createNativeConstantSourceNodeFactory(addSilentConnection, cacheTestResult, createNativeConstantSourceNodeFaker, testAudioScheduledSourceNodeStartMethodNegativeParametersSupport, testAudioScheduledSourceNodeStopMethodNegativeParametersSupport); -const createConstantSourceNodeRenderer = createConstantSourceNodeRendererFactory(connectAudioParam, createNativeConstantSourceNode, getNativeAudioNode, renderAutomation, renderInputsOfAudioNode); -const constantSourceNodeConstructor = createConstantSourceNodeConstructor(audioNodeConstructor, createAudioParam, createConstantSourceNodeRenderer, createNativeConstantSourceNode, getNativeContext, isNativeOfflineAudioContext, wrapEventListener); -const createNativeConvolverNode = createNativeConvolverNodeFactory(createNotSupportedError, overwriteAccessors); -const createConvolverNodeRenderer = createConvolverNodeRendererFactory(createNativeConvolverNode, getNativeAudioNode, renderInputsOfAudioNode); -const convolverNodeConstructor = createConvolverNodeConstructor(audioNodeConstructor, createConvolverNodeRenderer, createNativeConvolverNode, getNativeContext, isNativeOfflineAudioContext, setAudioNodeTailTime); -const createDelayNodeRenderer = createDelayNodeRendererFactory(connectAudioParam, createNativeDelayNode, getNativeAudioNode, renderAutomation, renderInputsOfAudioNode); -const delayNodeConstructor = createDelayNodeConstructor(audioNodeConstructor, createAudioParam, createDelayNodeRenderer, createNativeDelayNode, getNativeContext, isNativeOfflineAudioContext, setAudioNodeTailTime); -const createNativeDynamicsCompressorNode = createNativeDynamicsCompressorNodeFactory(createNotSupportedError); -const createDynamicsCompressorNodeRenderer = createDynamicsCompressorNodeRendererFactory(connectAudioParam, createNativeDynamicsCompressorNode, getNativeAudioNode, renderAutomation, renderInputsOfAudioNode); -const dynamicsCompressorNodeConstructor = createDynamicsCompressorNodeConstructor(audioNodeConstructor, createAudioParam, createDynamicsCompressorNodeRenderer, createNativeDynamicsCompressorNode, createNotSupportedError, getNativeContext, isNativeOfflineAudioContext, setAudioNodeTailTime); -const createGainNodeRenderer = createGainNodeRendererFactory(connectAudioParam, createNativeGainNode, getNativeAudioNode, renderAutomation, renderInputsOfAudioNode); -const gainNodeConstructor = createGainNodeConstructor(audioNodeConstructor, createAudioParam, createGainNodeRenderer, createNativeGainNode, getNativeContext, isNativeOfflineAudioContext); -const createNativeIIRFilterNodeFaker = createNativeIIRFilterNodeFakerFactory(createInvalidAccessError, createInvalidStateError, createNativeScriptProcessorNode, createNotSupportedError); -const renderNativeOfflineAudioContext = createRenderNativeOfflineAudioContext(cacheTestResult, createNativeGainNode, createNativeScriptProcessorNode, createTestOfflineAudioContextCurrentTimeSupport(createNativeGainNode, nativeOfflineAudioContextConstructor)); -const createIIRFilterNodeRenderer = createIIRFilterNodeRendererFactory(createNativeAudioBufferSourceNode, getNativeAudioNode, nativeOfflineAudioContextConstructor, renderInputsOfAudioNode, renderNativeOfflineAudioContext); -const createNativeIIRFilterNode = createNativeIIRFilterNodeFactory(createNativeIIRFilterNodeFaker); -const iIRFilterNodeConstructor = createIIRFilterNodeConstructor(audioNodeConstructor, createNativeIIRFilterNode, createIIRFilterNodeRenderer, getNativeContext, isNativeOfflineAudioContext, setAudioNodeTailTime); -const createAudioListener = createAudioListenerFactory(createAudioParam, createNativeChannelMergerNode, createNativeConstantSourceNode, createNativeScriptProcessorNode, createNotSupportedError, getFirstSample, isNativeOfflineAudioContext, overwriteAccessors); -const unrenderedAudioWorkletNodeStore = new WeakMap(); -const minimalBaseAudioContextConstructor = createMinimalBaseAudioContextConstructor(audioDestinationNodeConstructor, createAudioListener, eventTargetConstructor, isNativeOfflineAudioContext, unrenderedAudioWorkletNodeStore, wrapEventListener); -const createNativeOscillatorNode = createNativeOscillatorNodeFactory(addSilentConnection, cacheTestResult, testAudioScheduledSourceNodeStartMethodNegativeParametersSupport, testAudioScheduledSourceNodeStopMethodConsecutiveCallsSupport, testAudioScheduledSourceNodeStopMethodNegativeParametersSupport, wrapAudioScheduledSourceNodeStopMethodConsecutiveCalls); -const createOscillatorNodeRenderer = createOscillatorNodeRendererFactory(connectAudioParam, createNativeOscillatorNode, getNativeAudioNode, renderAutomation, renderInputsOfAudioNode); -const oscillatorNodeConstructor = createOscillatorNodeConstructor(audioNodeConstructor, createAudioParam, createNativeOscillatorNode, createOscillatorNodeRenderer, getNativeContext, isNativeOfflineAudioContext, wrapEventListener); -const createConnectedNativeAudioBufferSourceNode = createConnectedNativeAudioBufferSourceNodeFactory(createNativeAudioBufferSourceNode); -const createNativeWaveShaperNodeFaker = createNativeWaveShaperNodeFakerFactory(createConnectedNativeAudioBufferSourceNode, createInvalidStateError, createNativeGainNode, isDCCurve, monitorConnections); -const createNativeWaveShaperNode = createNativeWaveShaperNodeFactory(createConnectedNativeAudioBufferSourceNode, createInvalidStateError, createNativeWaveShaperNodeFaker, isDCCurve, monitorConnections, nativeAudioContextConstructor, overwriteAccessors); -const createNativePannerNodeFaker = createNativePannerNodeFakerFactory(connectNativeAudioNodeToNativeAudioNode, createInvalidStateError, createNativeChannelMergerNode, createNativeGainNode, createNativeScriptProcessorNode, createNativeWaveShaperNode, createNotSupportedError, disconnectNativeAudioNodeFromNativeAudioNode, getFirstSample, monitorConnections); -const createNativePannerNode = createNativePannerNodeFactory(createNativePannerNodeFaker); -const createPannerNodeRenderer = createPannerNodeRendererFactory(connectAudioParam, createNativeChannelMergerNode, createNativeConstantSourceNode, createNativeGainNode, createNativePannerNode, getNativeAudioNode, nativeOfflineAudioContextConstructor, renderAutomation, renderInputsOfAudioNode, renderNativeOfflineAudioContext); -const pannerNodeConstructor = createPannerNodeConstructor(audioNodeConstructor, createAudioParam, createNativePannerNode, createPannerNodeRenderer, getNativeContext, isNativeOfflineAudioContext, setAudioNodeTailTime); -const createNativePeriodicWave = createNativePeriodicWaveFactory(createIndexSizeError); -const periodicWaveConstructor = createPeriodicWaveConstructor(createNativePeriodicWave, getNativeContext, new WeakSet(), sanitizePeriodicWaveOptions); -const nativeStereoPannerNodeFakerFactory = createNativeStereoPannerNodeFakerFactory(createNativeChannelMergerNode, createNativeChannelSplitterNode, createNativeGainNode, createNativeWaveShaperNode, createNotSupportedError, monitorConnections); -const createNativeStereoPannerNode = createNativeStereoPannerNodeFactory(nativeStereoPannerNodeFakerFactory, createNotSupportedError); -const createStereoPannerNodeRenderer = createStereoPannerNodeRendererFactory(connectAudioParam, createNativeStereoPannerNode, getNativeAudioNode, renderAutomation, renderInputsOfAudioNode); -const stereoPannerNodeConstructor = createStereoPannerNodeConstructor(audioNodeConstructor, createAudioParam, createNativeStereoPannerNode, createStereoPannerNodeRenderer, getNativeContext, isNativeOfflineAudioContext); -const createWaveShaperNodeRenderer = createWaveShaperNodeRendererFactory(createNativeWaveShaperNode, getNativeAudioNode, renderInputsOfAudioNode); -const waveShaperNodeConstructor = createWaveShaperNodeConstructor(audioNodeConstructor, createInvalidStateError, createNativeWaveShaperNode, createWaveShaperNodeRenderer, getNativeContext, isNativeOfflineAudioContext, setAudioNodeTailTime); -const isSecureContext = createIsSecureContext(window$1); -const exposeCurrentFrameAndCurrentTime = createExposeCurrentFrameAndCurrentTime(window$1); -const backupOfflineAudioContextStore = new WeakMap(); -const getOrCreateBackupOfflineAudioContext = createGetOrCreateBackupOfflineAudioContext(backupOfflineAudioContextStore, nativeOfflineAudioContextConstructor); -// The addAudioWorkletModule() function is only available in a SecureContext. -const addAudioWorkletModule = isSecureContext - ? createAddAudioWorkletModule(cacheTestResult, createNotSupportedError, createEvaluateSource(window$1), exposeCurrentFrameAndCurrentTime, createFetchSource(createAbortError), getNativeContext, getOrCreateBackupOfflineAudioContext, isNativeOfflineAudioContext, nativeAudioWorkletNodeConstructor, new WeakMap(), new WeakMap(), createTestAudioWorkletProcessorPostMessageSupport(nativeAudioWorkletNodeConstructor, nativeOfflineAudioContextConstructor), - // @todo window is guaranteed to be defined because isSecureContext checks that as well. - window$1) - : undefined; -const isNativeContext = createIsNativeContext(isNativeAudioContext, isNativeOfflineAudioContext); -const decodeAudioData = createDecodeAudioData(audioBufferStore, cacheTestResult, createDataCloneError, createEncodingError, new WeakSet(), getNativeContext, isNativeContext, testAudioBufferCopyChannelMethodsOutOfBoundsSupport, testPromiseSupport, wrapAudioBufferCopyChannelMethods, wrapAudioBufferCopyChannelMethodsOutOfBounds); -const baseAudioContextConstructor = createBaseAudioContextConstructor(addAudioWorkletModule, analyserNodeConstructor, audioBufferConstructor, audioBufferSourceNodeConstructor, biquadFilterNodeConstructor, channelMergerNodeConstructor, channelSplitterNodeConstructor, constantSourceNodeConstructor, convolverNodeConstructor, decodeAudioData, delayNodeConstructor, dynamicsCompressorNodeConstructor, gainNodeConstructor, iIRFilterNodeConstructor, minimalBaseAudioContextConstructor, oscillatorNodeConstructor, pannerNodeConstructor, periodicWaveConstructor, stereoPannerNodeConstructor, waveShaperNodeConstructor); -const mediaElementAudioSourceNodeConstructor = createMediaElementAudioSourceNodeConstructor(audioNodeConstructor, createNativeMediaElementAudioSourceNode, getNativeContext, isNativeOfflineAudioContext); -const mediaStreamAudioDestinationNodeConstructor = createMediaStreamAudioDestinationNodeConstructor(audioNodeConstructor, createNativeMediaStreamAudioDestinationNode, getNativeContext, isNativeOfflineAudioContext); -const mediaStreamAudioSourceNodeConstructor = createMediaStreamAudioSourceNodeConstructor(audioNodeConstructor, createNativeMediaStreamAudioSourceNode, getNativeContext, isNativeOfflineAudioContext); -const createNativeMediaStreamTrackAudioSourceNode = createNativeMediaStreamTrackAudioSourceNodeFactory(createInvalidStateError, isNativeOfflineAudioContext); -const mediaStreamTrackAudioSourceNodeConstructor = createMediaStreamTrackAudioSourceNodeConstructor(audioNodeConstructor, createNativeMediaStreamTrackAudioSourceNode, getNativeContext); -const audioContextConstructor = createAudioContextConstructor(baseAudioContextConstructor, createInvalidStateError, createNotSupportedError, createUnknownError, mediaElementAudioSourceNodeConstructor, mediaStreamAudioDestinationNodeConstructor, mediaStreamAudioSourceNodeConstructor, mediaStreamTrackAudioSourceNodeConstructor, nativeAudioContextConstructor); -const getUnrenderedAudioWorkletNodes = createGetUnrenderedAudioWorkletNodes(unrenderedAudioWorkletNodeStore); -const addUnrenderedAudioWorkletNode = createAddUnrenderedAudioWorkletNode(getUnrenderedAudioWorkletNodes); -const connectMultipleOutputs = createConnectMultipleOutputs(createIndexSizeError); -const deleteUnrenderedAudioWorkletNode = createDeleteUnrenderedAudioWorkletNode(getUnrenderedAudioWorkletNodes); -const disconnectMultipleOutputs = createDisconnectMultipleOutputs(createIndexSizeError); -const activeAudioWorkletNodeInputsStore = new WeakMap(); -const getActiveAudioWorkletNodeInputs = createGetActiveAudioWorkletNodeInputs(activeAudioWorkletNodeInputsStore, getValueForKey); -const createNativeAudioWorkletNodeFaker = createNativeAudioWorkletNodeFakerFactory(connectMultipleOutputs, createIndexSizeError, createInvalidStateError, createNativeChannelMergerNode, createNativeChannelSplitterNode, createNativeConstantSourceNode, createNativeGainNode, createNativeScriptProcessorNode, createNotSupportedError, disconnectMultipleOutputs, exposeCurrentFrameAndCurrentTime, getActiveAudioWorkletNodeInputs, monitorConnections); -const createNativeAudioWorkletNode = createNativeAudioWorkletNodeFactory(createInvalidStateError, createNativeAudioWorkletNodeFaker, createNativeGainNode, createNotSupportedError, monitorConnections); -const createAudioWorkletNodeRenderer = createAudioWorkletNodeRendererFactory(connectAudioParam, connectMultipleOutputs, createNativeAudioBufferSourceNode, createNativeChannelMergerNode, createNativeChannelSplitterNode, createNativeConstantSourceNode, createNativeGainNode, deleteUnrenderedAudioWorkletNode, disconnectMultipleOutputs, exposeCurrentFrameAndCurrentTime, getNativeAudioNode, nativeAudioWorkletNodeConstructor, nativeOfflineAudioContextConstructor, renderAutomation, renderInputsOfAudioNode, renderNativeOfflineAudioContext); -const getBackupOfflineAudioContext = createGetBackupOfflineAudioContext(backupOfflineAudioContextStore); -const setActiveAudioWorkletNodeInputs = createSetActiveAudioWorkletNodeInputs(activeAudioWorkletNodeInputsStore); -// The AudioWorkletNode constructor is only available in a SecureContext. -const audioWorkletNodeConstructor = isSecureContext - ? createAudioWorkletNodeConstructor(addUnrenderedAudioWorkletNode, audioNodeConstructor, createAudioParam, createAudioWorkletNodeRenderer, createNativeAudioWorkletNode, getAudioNodeConnections, getBackupOfflineAudioContext, getNativeContext, isNativeOfflineAudioContext, nativeAudioWorkletNodeConstructor, sanitizeAudioWorkletNodeOptions, setActiveAudioWorkletNodeInputs, testAudioWorkletNodeOptionsClonability, wrapEventListener) - : undefined; -const createNativeOfflineAudioContext = createCreateNativeOfflineAudioContext(createNotSupportedError, nativeOfflineAudioContextConstructor); -const startRendering = createStartRendering(audioBufferStore, cacheTestResult, getAudioNodeRenderer, getUnrenderedAudioWorkletNodes, renderNativeOfflineAudioContext, testAudioBufferCopyChannelMethodsOutOfBoundsSupport, wrapAudioBufferCopyChannelMethods, wrapAudioBufferCopyChannelMethodsOutOfBounds); -const offlineAudioContextConstructor = createOfflineAudioContextConstructor(baseAudioContextConstructor, cacheTestResult, createInvalidStateError, createNativeOfflineAudioContext, startRendering); -const isAnyAudioContext = createIsAnyAudioContext(CONTEXT_STORE, isNativeAudioContext); -const isAnyAudioNode = createIsAnyAudioNode(AUDIO_NODE_STORE, isNativeAudioNode$1); -const isAnyAudioParam = createIsAnyAudioParam(AUDIO_PARAM_STORE, isNativeAudioParam); -const isAnyOfflineAudioContext = createIsAnyOfflineAudioContext(CONTEXT_STORE, isNativeOfflineAudioContext); -const isSupported = () => createIsSupportedPromise(cacheTestResult, createTestAudioBufferCopyChannelMethodsSubarraySupport(nativeOfflineAudioContextConstructor), createTestAudioContextCloseMethodSupport(nativeAudioContextConstructor), createTestAudioContextDecodeAudioDataMethodTypeErrorSupport(nativeOfflineAudioContextConstructor), createTestAudioContextOptionsSupport(nativeAudioContextConstructor), createTestAudioNodeConnectMethodSupport(nativeOfflineAudioContextConstructor), createTestAudioWorkletProcessorNoOutputsSupport(nativeAudioWorkletNodeConstructor, nativeOfflineAudioContextConstructor), createTestChannelMergerNodeChannelCountSupport(nativeOfflineAudioContextConstructor), createTestConstantSourceNodeAccurateSchedulingSupport(nativeOfflineAudioContextConstructor), createTestConvolverNodeBufferReassignabilitySupport(nativeOfflineAudioContextConstructor), createTestConvolverNodeChannelCountSupport(nativeOfflineAudioContextConstructor), testDomExceptionConstructorSupport, createTestIsSecureContextSupport(window$1), createTestMediaStreamAudioSourceNodeMediaStreamWithoutAudioTrackSupport(nativeAudioContextConstructor), createTestStereoPannerNodeDefaultValueSupport(nativeOfflineAudioContextConstructor), testTransferablesSupport); - -/** - * Assert that the statement is true, otherwise invoke the error. - * @param statement - * @param error The message which is passed into an Error - */ -function assert(statement, error) { - if (!statement) { - throw new Error(error); - } -} -/** - * Make sure that the given value is within the range - */ -function assertRange(value, gte, lte = Infinity) { - if (!(gte <= value && value <= lte)) { - throw new RangeError(`Value must be within [${gte}, ${lte}], got: ${value}`); - } -} -/** - * Make sure that the given value is within the range - */ -function assertContextRunning(context) { - // add a warning if the context is not started - if (!context.isOffline && context.state !== "running") { - warn("The AudioContext is \"suspended\". Invoke Tone.start() from a user action to start the audio."); - } -} -/** - * The default logger is the console - */ -let defaultLogger = console; -/** - * Set the logging interface - */ -function setLogger(logger) { - defaultLogger = logger; -} -/** - * Log anything - */ -function log(...args) { - defaultLogger.log(...args); -} -/** - * Warn anything - */ -function warn(...args) { - defaultLogger.warn(...args); -} - -var Debug = /*#__PURE__*/Object.freeze({ - __proto__: null, - assert: assert, - assertRange: assertRange, - assertContextRunning: assertContextRunning, - setLogger: setLogger, - log: log, - warn: warn -}); - -/** - * Test if the arg is undefined - */ -function isUndef(arg) { - return typeof arg === "undefined"; -} -/** - * Test if the arg is not undefined - */ -function isDefined(arg) { - return !isUndef(arg); -} -/** - * Test if the arg is a function - */ -function isFunction(arg) { - return typeof arg === "function"; -} -/** - * Test if the argument is a number. - */ -function isNumber(arg) { - return (typeof arg === "number"); -} -/** - * Test if the given argument is an object literal (i.e. `{}`); - */ -function isObject(arg) { - return (Object.prototype.toString.call(arg) === "[object Object]" && arg.constructor === Object); -} -/** - * Test if the argument is a boolean. - */ -function isBoolean(arg) { - return (typeof arg === "boolean"); -} -/** - * Test if the argument is an Array - */ -function isArray(arg) { - return (Array.isArray(arg)); -} -/** - * Test if the argument is a string. - */ -function isString(arg) { - return (typeof arg === "string"); -} -/** - * Test if the argument is in the form of a note in scientific pitch notation. - * e.g. "C4" - */ -function isNote(arg) { - return isString(arg) && /^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i.test(arg); -} - -/** - * Create a new AudioContext - */ -function createAudioContext(options) { - return new audioContextConstructor(options); -} -/** - * Create a new OfflineAudioContext - */ -function createOfflineAudioContext(channels, length, sampleRate) { - return new offlineAudioContextConstructor(channels, length, sampleRate); -} -/** - * A reference to the window object - * @hidden - */ -const theWindow = typeof self === "object" ? self : null; -/** - * If the browser has a window object which has an AudioContext - * @hidden - */ -const hasAudioContext = theWindow && - (theWindow.hasOwnProperty("AudioContext") || theWindow.hasOwnProperty("webkitAudioContext")); -function createAudioWorkletNode(context, name, options) { - assert(isDefined(audioWorkletNodeConstructor), "This node only works in a secure context (https or localhost)"); - // @ts-ignore - return new audioWorkletNodeConstructor(context, name, options); -} - -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ - -function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} - -function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} - -/** - * A class which provides a reliable callback using either - * a Web Worker, or if that isn't supported, falls back to setTimeout. - */ -class Ticker { - constructor(callback, type, updateInterval) { - this._callback = callback; - this._type = type; - this._updateInterval = updateInterval; - // create the clock source for the first time - this._createClock(); - } - /** - * Generate a web worker - */ - _createWorker() { - const blob = new Blob([ - /* javascript */ ` - // the initial timeout time - let timeoutTime = ${(this._updateInterval * 1000).toFixed(1)}; - // onmessage callback - self.onmessage = function(msg){ - timeoutTime = parseInt(msg.data); - }; - // the tick function which posts a message - // and schedules a new tick - function tick(){ - setTimeout(tick, timeoutTime); - self.postMessage('tick'); - } - // call tick initially - tick(); - ` - ], { type: "text/javascript" }); - const blobUrl = URL.createObjectURL(blob); - const worker = new Worker(blobUrl); - worker.onmessage = this._callback.bind(this); - this._worker = worker; - } - /** - * Create a timeout loop - */ - _createTimeout() { - this._timeout = setTimeout(() => { - this._createTimeout(); - this._callback(); - }, this._updateInterval * 1000); - } - /** - * Create the clock source. - */ - _createClock() { - if (this._type === "worker") { - try { - this._createWorker(); - } - catch (e) { - // workers not supported, fallback to timeout - this._type = "timeout"; - this._createClock(); - } - } - else if (this._type === "timeout") { - this._createTimeout(); - } - } - /** - * Clean up the current clock source - */ - _disposeClock() { - if (this._timeout) { - clearTimeout(this._timeout); - this._timeout = 0; - } - if (this._worker) { - this._worker.terminate(); - this._worker.onmessage = null; - } - } - /** - * The rate in seconds the ticker will update - */ - get updateInterval() { - return this._updateInterval; - } - set updateInterval(interval) { - this._updateInterval = Math.max(interval, 128 / 44100); - if (this._type === "worker") { - this._worker.postMessage(Math.max(interval * 1000, 1)); - } - } - /** - * The type of the ticker, either a worker or a timeout - */ - get type() { - return this._type; - } - set type(type) { - this._disposeClock(); - this._type = type; - this._createClock(); - } - /** - * Clean up - */ - dispose() { - this._disposeClock(); - } -} - -/** - * Test if the given value is an instanceof AudioParam - */ -function isAudioParam(arg) { - return isAnyAudioParam(arg); -} -/** - * Test if the given value is an instanceof AudioNode - */ -function isAudioNode$1(arg) { - return isAnyAudioNode(arg); -} -/** - * Test if the arg is instanceof an OfflineAudioContext - */ -function isOfflineAudioContext(arg) { - return isAnyOfflineAudioContext(arg); -} -/** - * Test if the arg is an instanceof AudioContext - */ -function isAudioContext(arg) { - return isAnyAudioContext(arg); -} -/** - * Test if the arg is instanceof an AudioBuffer - */ -function isAudioBuffer(arg) { - return arg instanceof AudioBuffer; -} - -/** - * Some objects should not be merged - */ -function noCopy(key, arg) { - return key === "value" || isAudioParam(arg) || isAudioNode$1(arg) || isAudioBuffer(arg); -} -function deepMerge(target, ...sources) { - if (!sources.length) { - return target; - } - const source = sources.shift(); - if (isObject(target) && isObject(source)) { - for (const key in source) { - if (noCopy(key, source[key])) { - target[key] = source[key]; - } - else if (isObject(source[key])) { - if (!target[key]) { - Object.assign(target, { [key]: {} }); - } - deepMerge(target[key], source[key]); - } - else { - Object.assign(target, { [key]: source[key] }); - } - } - } - // @ts-ignore - return deepMerge(target, ...sources); -} -/** - * Returns true if the two arrays have the same value for each of the elements - */ -function deepEquals(arrayA, arrayB) { - return arrayA.length === arrayB.length && arrayA.every((element, index) => arrayB[index] === element); -} -/** - * Convert an args array into an object. - */ -function optionsFromArguments(defaults, argsArray, keys = [], objKey) { - const opts = {}; - const args = Array.from(argsArray); - // if the first argument is an object and has an object key - if (isObject(args[0]) && objKey && !Reflect.has(args[0], objKey)) { - // if it's not part of the defaults - const partOfDefaults = Object.keys(args[0]).some(key => Reflect.has(defaults, key)); - if (!partOfDefaults) { - // merge that key - deepMerge(opts, { [objKey]: args[0] }); - // remove the obj key from the keys - keys.splice(keys.indexOf(objKey), 1); - // shift the first argument off - args.shift(); - } - } - if (args.length === 1 && isObject(args[0])) { - deepMerge(opts, args[0]); - } - else { - for (let i = 0; i < keys.length; i++) { - if (isDefined(args[i])) { - opts[keys[i]] = args[i]; - } - } - } - return deepMerge(defaults, opts); -} -/** - * Return this instances default values by calling Constructor.getDefaults() - */ -function getDefaultsFromInstance(instance) { - return instance.constructor.getDefaults(); -} -/** - * Returns the fallback if the given object is undefined. - * Take an array of arguments and return a formatted options object. - */ -function defaultArg(given, fallback) { - if (isUndef(given)) { - return fallback; - } - else { - return given; - } -} -/** - * Remove all of the properties belonging to omit from obj. - */ -function omitFromObject(obj, omit) { - omit.forEach(prop => { - if (Reflect.has(obj, prop)) { - delete obj[prop]; - } - }); - return obj; -} - -/** - * Tone.js - * @author Yotam Mann - * @license http://opensource.org/licenses/MIT MIT License - * @copyright 2014-2019 Yotam Mann - */ -/** - * @class Tone is the base class of all other classes. - * @category Core - * @constructor - */ -class Tone { - constructor() { - //------------------------------------- - // DEBUGGING - //------------------------------------- - /** - * Set this debug flag to log all events that happen in this class. - */ - this.debug = false; - //------------------------------------- - // DISPOSING - //------------------------------------- - /** - * Indicates if the instance was disposed - */ - this._wasDisposed = false; - } - /** - * Returns all of the default options belonging to the class. - */ - static getDefaults() { - return {}; - } - /** - * Prints the outputs to the console log for debugging purposes. - * Prints the contents only if either the object has a property - * called `debug` set to true, or a variable called TONE_DEBUG_CLASS - * is set to the name of the class. - * @example - * const osc = new Tone.Oscillator(); - * // prints all logs originating from this oscillator - * osc.debug = true; - * // calls to start/stop will print in the console - * osc.start(); - */ - log(...args) { - // if the object is either set to debug = true - // or if there is a string on the Tone.global.with the class name - if (this.debug || (theWindow && this.toString() === theWindow.TONE_DEBUG_CLASS)) { - log(this, ...args); - } - } - /** - * disconnect and dispose. - */ - dispose() { - this._wasDisposed = true; - return this; - } - /** - * Indicates if the instance was disposed. 'Disposing' an - * instance means that all of the Web Audio nodes that were - * created for the instance are disconnected and freed for garbage collection. - */ - get disposed() { - return this._wasDisposed; - } - /** - * Convert the class to a string - * @example - * const osc = new Tone.Oscillator(); - * console.log(osc.toString()); - */ - toString() { - return this.name; - } -} -/** - * The version number semver - */ -Tone.version = version; - -/** - * The threshold for correctness for operators. Less than one sample even - * at very high sampling rates (e.g. `1e-6 < 1 / 192000`). - */ -const EPSILON = 1e-6; -/** - * Test if A is greater than B - */ -function GT(a, b) { - return a > b + EPSILON; -} -/** - * Test if A is greater than or equal to B - */ -function GTE(a, b) { - return GT(a, b) || EQ(a, b); -} -/** - * Test if A is less than B - */ -function LT(a, b) { - return a + EPSILON < b; -} -/** - * Test if A is less than B - */ -function EQ(a, b) { - return Math.abs(a - b) < EPSILON; -} -/** - * Clamp the value within the given range - */ -function clamp(value, min, max) { - return Math.max(Math.min(value, max), min); -} - -/** - * A Timeline class for scheduling and maintaining state - * along a timeline. All events must have a "time" property. - * Internally, events are stored in time order for fast - * retrieval. - */ -class Timeline extends Tone { - constructor() { - super(); - this.name = "Timeline"; - /** - * The array of scheduled timeline events - */ - this._timeline = []; - const options = optionsFromArguments(Timeline.getDefaults(), arguments, ["memory"]); - this.memory = options.memory; - this.increasing = options.increasing; - } - static getDefaults() { - return { - memory: Infinity, - increasing: false, - }; - } - /** - * The number of items in the timeline. - */ - get length() { - return this._timeline.length; - } - /** - * Insert an event object onto the timeline. Events must have a "time" attribute. - * @param event The event object to insert into the timeline. - */ - add(event) { - // the event needs to have a time attribute - assert(Reflect.has(event, "time"), "Timeline: events must have a time attribute"); - event.time = event.time.valueOf(); - if (this.increasing && this.length) { - const lastValue = this._timeline[this.length - 1]; - assert(GTE(event.time, lastValue.time), "The time must be greater than or equal to the last scheduled time"); - this._timeline.push(event); - } - else { - const index = this._search(event.time); - this._timeline.splice(index + 1, 0, event); - } - // if the length is more than the memory, remove the previous ones - if (this.length > this.memory) { - const diff = this.length - this.memory; - this._timeline.splice(0, diff); - } - return this; - } - /** - * Remove an event from the timeline. - * @param {Object} event The event object to remove from the list. - * @returns {Timeline} this - */ - remove(event) { - const index = this._timeline.indexOf(event); - if (index !== -1) { - this._timeline.splice(index, 1); - } - return this; - } - /** - * Get the nearest event whose time is less than or equal to the given time. - * @param time The time to query. - */ - get(time, param = "time") { - const index = this._search(time, param); - if (index !== -1) { - return this._timeline[index]; - } - else { - return null; - } - } - /** - * Return the first event in the timeline without removing it - * @returns {Object} The first event object - */ - peek() { - return this._timeline[0]; - } - /** - * Return the first event in the timeline and remove it - */ - shift() { - return this._timeline.shift(); - } - /** - * Get the event which is scheduled after the given time. - * @param time The time to query. - */ - getAfter(time, param = "time") { - const index = this._search(time, param); - if (index + 1 < this._timeline.length) { - return this._timeline[index + 1]; - } - else { - return null; - } - } - /** - * Get the event before the event at the given time. - * @param time The time to query. - */ - getBefore(time) { - const len = this._timeline.length; - // if it's after the last item, return the last item - if (len > 0 && this._timeline[len - 1].time < time) { - return this._timeline[len - 1]; - } - const index = this._search(time); - if (index - 1 >= 0) { - return this._timeline[index - 1]; - } - else { - return null; - } - } - /** - * Cancel events at and after the given time - * @param after The time to query. - */ - cancel(after) { - if (this._timeline.length > 1) { - let index = this._search(after); - if (index >= 0) { - if (EQ(this._timeline[index].time, after)) { - // get the first item with that time - for (let i = index; i >= 0; i--) { - if (EQ(this._timeline[i].time, after)) { - index = i; - } - else { - break; - } - } - this._timeline = this._timeline.slice(0, index); - } - else { - this._timeline = this._timeline.slice(0, index + 1); - } - } - else { - this._timeline = []; - } - } - else if (this._timeline.length === 1) { - // the first item's time - if (GTE(this._timeline[0].time, after)) { - this._timeline = []; - } - } - return this; - } - /** - * Cancel events before or equal to the given time. - * @param time The time to cancel before. - */ - cancelBefore(time) { - const index = this._search(time); - if (index >= 0) { - this._timeline = this._timeline.slice(index + 1); - } - return this; - } - /** - * Returns the previous event if there is one. null otherwise - * @param event The event to find the previous one of - * @return The event right before the given event - */ - previousEvent(event) { - const index = this._timeline.indexOf(event); - if (index > 0) { - return this._timeline[index - 1]; - } - else { - return null; - } - } - /** - * Does a binary search on the timeline array and returns the - * nearest event index whose time is after or equal to the given time. - * If a time is searched before the first index in the timeline, -1 is returned. - * If the time is after the end, the index of the last item is returned. - */ - _search(time, param = "time") { - if (this._timeline.length === 0) { - return -1; - } - let beginning = 0; - const len = this._timeline.length; - let end = len; - if (len > 0 && this._timeline[len - 1][param] <= time) { - return len - 1; - } - while (beginning < end) { - // calculate the midpoint for roughly equal partition - let midPoint = Math.floor(beginning + (end - beginning) / 2); - const event = this._timeline[midPoint]; - const nextEvent = this._timeline[midPoint + 1]; - if (EQ(event[param], time)) { - // choose the last one that has the same time - for (let i = midPoint; i < this._timeline.length; i++) { - const testEvent = this._timeline[i]; - if (EQ(testEvent[param], time)) { - midPoint = i; - } - else { - break; - } - } - return midPoint; - } - else if (LT(event[param], time) && GT(nextEvent[param], time)) { - return midPoint; - } - else if (GT(event[param], time)) { - // search lower - end = midPoint; - } - else { - // search upper - beginning = midPoint + 1; - } - } - return -1; - } - /** - * Internal iterator. Applies extra safety checks for - * removing items from the array. - */ - _iterate(callback, lowerBound = 0, upperBound = this._timeline.length - 1) { - this._timeline.slice(lowerBound, upperBound + 1).forEach(callback); - } - /** - * Iterate over everything in the array - * @param callback The callback to invoke with every item - */ - forEach(callback) { - this._iterate(callback); - return this; - } - /** - * Iterate over everything in the array at or before the given time. - * @param time The time to check if items are before - * @param callback The callback to invoke with every item - */ - forEachBefore(time, callback) { - // iterate over the items in reverse so that removing an item doesn't break things - const upperBound = this._search(time); - if (upperBound !== -1) { - this._iterate(callback, 0, upperBound); - } - return this; - } - /** - * Iterate over everything in the array after the given time. - * @param time The time to check if items are before - * @param callback The callback to invoke with every item - */ - forEachAfter(time, callback) { - // iterate over the items in reverse so that removing an item doesn't break things - const lowerBound = this._search(time); - this._iterate(callback, lowerBound + 1); - return this; - } - /** - * Iterate over everything in the array between the startTime and endTime. - * The timerange is inclusive of the startTime, but exclusive of the endTime. - * range = [startTime, endTime). - * @param startTime The time to check if items are before - * @param endTime The end of the test interval. - * @param callback The callback to invoke with every item - */ - forEachBetween(startTime, endTime, callback) { - let lowerBound = this._search(startTime); - let upperBound = this._search(endTime); - if (lowerBound !== -1 && upperBound !== -1) { - if (this._timeline[lowerBound].time !== startTime) { - lowerBound += 1; - } - // exclusive of the end time - if (this._timeline[upperBound].time === endTime) { - upperBound -= 1; - } - this._iterate(callback, lowerBound, upperBound); - } - else if (lowerBound === -1) { - this._iterate(callback, 0, upperBound); - } - return this; - } - /** - * Iterate over everything in the array at or after the given time. Similar to - * forEachAfter, but includes the item(s) at the given time. - * @param time The time to check if items are before - * @param callback The callback to invoke with every item - */ - forEachFrom(time, callback) { - // iterate over the items in reverse so that removing an item doesn't break things - let lowerBound = this._search(time); - // work backwards until the event time is less than time - while (lowerBound >= 0 && this._timeline[lowerBound].time >= time) { - lowerBound--; - } - this._iterate(callback, lowerBound + 1); - return this; - } - /** - * Iterate over everything in the array at the given time - * @param time The time to check if items are before - * @param callback The callback to invoke with every item - */ - forEachAtTime(time, callback) { - // iterate over the items in reverse so that removing an item doesn't break things - const upperBound = this._search(time); - if (upperBound !== -1 && EQ(this._timeline[upperBound].time, time)) { - let lowerBound = upperBound; - for (let i = upperBound; i >= 0; i--) { - if (EQ(this._timeline[i].time, time)) { - lowerBound = i; - } - else { - break; - } - } - this._iterate(event => { - callback(event); - }, lowerBound, upperBound); - } - return this; - } - /** - * Clean up. - */ - dispose() { - super.dispose(); - this._timeline = []; - return this; - } -} - -//------------------------------------- -// INITIALIZING NEW CONTEXT -//------------------------------------- -/** - * Array of callbacks to invoke when a new context is created - */ -const notifyNewContext = []; -/** - * Used internally to setup a new Context - */ -function onContextInit(cb) { - notifyNewContext.push(cb); -} -/** - * Invoke any classes which need to also be initialized when a new context is created. - */ -function initializeContext(ctx) { - // add any additional modules - notifyNewContext.forEach(cb => cb(ctx)); -} -/** - * Array of callbacks to invoke when a new context is created - */ -const notifyCloseContext = []; -/** - * Used internally to tear down a Context - */ -function onContextClose(cb) { - notifyCloseContext.push(cb); -} -function closeContext(ctx) { - // add any additional modules - notifyCloseContext.forEach(cb => cb(ctx)); -} - -/** - * Emitter gives classes which extend it - * the ability to listen for and emit events. - * Inspiration and reference from Jerome Etienne's [MicroEvent](https://github.com/jeromeetienne/microevent.js). - * MIT (c) 2011 Jerome Etienne. - * @category Core - */ -class Emitter extends Tone { - constructor() { - super(...arguments); - this.name = "Emitter"; - } - /** - * Bind a callback to a specific event. - * @param event The name of the event to listen for. - * @param callback The callback to invoke when the event is emitted - */ - on(event, callback) { - // split the event - const events = event.split(/\W+/); - events.forEach(eventName => { - if (isUndef(this._events)) { - this._events = {}; - } - if (!this._events.hasOwnProperty(eventName)) { - this._events[eventName] = []; - } - this._events[eventName].push(callback); - }); - return this; - } - /** - * Bind a callback which is only invoked once - * @param event The name of the event to listen for. - * @param callback The callback to invoke when the event is emitted - */ - once(event, callback) { - const boundCallback = (...args) => { - // invoke the callback - callback(...args); - // remove the event - this.off(event, boundCallback); - }; - this.on(event, boundCallback); - return this; - } - /** - * Remove the event listener. - * @param event The event to stop listening to. - * @param callback The callback which was bound to the event with Emitter.on. - * If no callback is given, all callbacks events are removed. - */ - off(event, callback) { - const events = event.split(/\W+/); - events.forEach(eventName => { - if (isUndef(this._events)) { - this._events = {}; - } - if (this._events.hasOwnProperty(event)) { - if (isUndef(callback)) { - this._events[event] = []; - } - else { - const eventList = this._events[event]; - for (let i = eventList.length - 1; i >= 0; i--) { - if (eventList[i] === callback) { - eventList.splice(i, 1); - } - } - } - } - }); - return this; - } - /** - * Invoke all of the callbacks bound to the event - * with any arguments passed in. - * @param event The name of the event. - * @param args The arguments to pass to the functions listening. - */ - emit(event, ...args) { - if (this._events) { - if (this._events.hasOwnProperty(event)) { - const eventList = this._events[event].slice(0); - for (let i = 0, len = eventList.length; i < len; i++) { - eventList[i].apply(this, args); - } - } - } - return this; - } - /** - * Add Emitter functions (on/off/emit) to the object - */ - static mixin(constr) { - // instance._events = {}; - ["on", "once", "off", "emit"].forEach(name => { - const property = Object.getOwnPropertyDescriptor(Emitter.prototype, name); - Object.defineProperty(constr.prototype, name, property); - }); - } - /** - * Clean up - */ - dispose() { - super.dispose(); - this._events = undefined; - return this; - } -} - -class BaseContext extends Emitter { - constructor() { - super(...arguments); - this.isOffline = false; - } - /* - * This is a placeholder so that JSON.stringify does not throw an error - * This matches what JSON.stringify(audioContext) returns on a native - * audioContext instance. - */ - toJSON() { - return {}; - } -} - -/** - * Wrapper around the native AudioContext. - * @category Core - */ -class Context extends BaseContext { - constructor() { - super(); - this.name = "Context"; - /** - * An object containing all of the constants AudioBufferSourceNodes - */ - this._constants = new Map(); - /** - * All of the setTimeout events. - */ - this._timeouts = new Timeline(); - /** - * The timeout id counter - */ - this._timeoutIds = 0; - /** - * Private indicator if the context has been initialized - */ - this._initialized = false; - /** - * Indicates if the context is an OfflineAudioContext or an AudioContext - */ - this.isOffline = false; - //-------------------------------------------- - // AUDIO WORKLET - //-------------------------------------------- - /** - * Maps a module name to promise of the addModule method - */ - this._workletModules = new Map(); - const options = optionsFromArguments(Context.getDefaults(), arguments, [ - "context", - ]); - if (options.context) { - this._context = options.context; - } - else { - this._context = createAudioContext({ - latencyHint: options.latencyHint, - }); - } - this._ticker = new Ticker(this.emit.bind(this, "tick"), options.clockSource, options.updateInterval); - this.on("tick", this._timeoutLoop.bind(this)); - // fwd events from the context - this._context.onstatechange = () => { - this.emit("statechange", this.state); - }; - this._setLatencyHint(options.latencyHint); - this.lookAhead = options.lookAhead; - } - static getDefaults() { - return { - clockSource: "worker", - latencyHint: "interactive", - lookAhead: 0.1, - updateInterval: 0.05, - }; - } - /** - * Finish setting up the context. **You usually do not need to do this manually.** - */ - initialize() { - if (!this._initialized) { - // add any additional modules - initializeContext(this); - this._initialized = true; - } - return this; - } - //--------------------------- - // BASE AUDIO CONTEXT METHODS - //--------------------------- - createAnalyser() { - return this._context.createAnalyser(); - } - createOscillator() { - return this._context.createOscillator(); - } - createBufferSource() { - return this._context.createBufferSource(); - } - createBiquadFilter() { - return this._context.createBiquadFilter(); - } - createBuffer(numberOfChannels, length, sampleRate) { - return this._context.createBuffer(numberOfChannels, length, sampleRate); - } - createChannelMerger(numberOfInputs) { - return this._context.createChannelMerger(numberOfInputs); - } - createChannelSplitter(numberOfOutputs) { - return this._context.createChannelSplitter(numberOfOutputs); - } - createConstantSource() { - return this._context.createConstantSource(); - } - createConvolver() { - return this._context.createConvolver(); - } - createDelay(maxDelayTime) { - return this._context.createDelay(maxDelayTime); - } - createDynamicsCompressor() { - return this._context.createDynamicsCompressor(); - } - createGain() { - return this._context.createGain(); - } - createIIRFilter(feedForward, feedback) { - // @ts-ignore - return this._context.createIIRFilter(feedForward, feedback); - } - createPanner() { - return this._context.createPanner(); - } - createPeriodicWave(real, imag, constraints) { - return this._context.createPeriodicWave(real, imag, constraints); - } - createStereoPanner() { - return this._context.createStereoPanner(); - } - createWaveShaper() { - return this._context.createWaveShaper(); - } - createMediaStreamSource(stream) { - assert(isAudioContext(this._context), "Not available if OfflineAudioContext"); - const context = this._context; - return context.createMediaStreamSource(stream); - } - createMediaElementSource(element) { - assert(isAudioContext(this._context), "Not available if OfflineAudioContext"); - const context = this._context; - return context.createMediaElementSource(element); - } - createMediaStreamDestination() { - assert(isAudioContext(this._context), "Not available if OfflineAudioContext"); - const context = this._context; - return context.createMediaStreamDestination(); - } - decodeAudioData(audioData) { - return this._context.decodeAudioData(audioData); - } - /** - * The current time in seconds of the AudioContext. - */ - get currentTime() { - return this._context.currentTime; - } - /** - * The current time in seconds of the AudioContext. - */ - get state() { - return this._context.state; - } - /** - * The current time in seconds of the AudioContext. - */ - get sampleRate() { - return this._context.sampleRate; - } - /** - * The listener - */ - get listener() { - this.initialize(); - return this._listener; - } - set listener(l) { - assert(!this._initialized, "The listener cannot be set after initialization."); - this._listener = l; - } - /** - * There is only one Transport per Context. It is created on initialization. - */ - get transport() { - this.initialize(); - return this._transport; - } - set transport(t) { - assert(!this._initialized, "The transport cannot be set after initialization."); - this._transport = t; - } - /** - * This is the Draw object for the context which is useful for synchronizing the draw frame with the Tone.js clock. - */ - get draw() { - this.initialize(); - return this._draw; - } - set draw(d) { - assert(!this._initialized, "Draw cannot be set after initialization."); - this._draw = d; - } - /** - * A reference to the Context's destination node. - */ - get destination() { - this.initialize(); - return this._destination; - } - set destination(d) { - assert(!this._initialized, "The destination cannot be set after initialization."); - this._destination = d; - } - /** - * Create an audio worklet node from a name and options. The module - * must first be loaded using [[addAudioWorkletModule]]. - */ - createAudioWorkletNode(name, options) { - return createAudioWorkletNode(this.rawContext, name, options); - } - /** - * Add an AudioWorkletProcessor module - * @param url The url of the module - * @param name The name of the module - */ - addAudioWorkletModule(url, name) { - return __awaiter(this, void 0, void 0, function* () { - assert(isDefined(this.rawContext.audioWorklet), "AudioWorkletNode is only available in a secure context (https or localhost)"); - if (!this._workletModules.has(name)) { - this._workletModules.set(name, this.rawContext.audioWorklet.addModule(url)); - } - yield this._workletModules.get(name); - }); - } - /** - * Returns a promise which resolves when all of the worklets have been loaded on this context - */ - workletsAreReady() { - return __awaiter(this, void 0, void 0, function* () { - const promises = []; - this._workletModules.forEach((promise) => promises.push(promise)); - yield Promise.all(promises); - }); - } - //--------------------------- - // TICKER - //--------------------------- - /** - * How often the interval callback is invoked. - * This number corresponds to how responsive the scheduling - * can be. context.updateInterval + context.lookAhead gives you the - * total latency between scheduling an event and hearing it. - */ - get updateInterval() { - return this._ticker.updateInterval; - } - set updateInterval(interval) { - this._ticker.updateInterval = interval; - } - /** - * What the source of the clock is, either "worker" (default), - * "timeout", or "offline" (none). - */ - get clockSource() { - return this._ticker.type; - } - set clockSource(type) { - this._ticker.type = type; - } - /** - * The type of playback, which affects tradeoffs between audio - * output latency and responsiveness. - * In addition to setting the value in seconds, the latencyHint also - * accepts the strings "interactive" (prioritizes low latency), - * "playback" (prioritizes sustained playback), "balanced" (balances - * latency and performance). - * @example - * // prioritize sustained playback - * const context = new Tone.Context({ latencyHint: "playback" }); - * // set this context as the global Context - * Tone.setContext(context); - * // the global context is gettable with Tone.getContext() - * console.log(Tone.getContext().latencyHint); - */ - get latencyHint() { - return this._latencyHint; - } - /** - * Update the lookAhead and updateInterval based on the latencyHint - */ - _setLatencyHint(hint) { - let lookAheadValue = 0; - this._latencyHint = hint; - if (isString(hint)) { - switch (hint) { - case "interactive": - lookAheadValue = 0.1; - break; - case "playback": - lookAheadValue = 0.5; - break; - case "balanced": - lookAheadValue = 0.25; - break; - } - } - this.lookAhead = lookAheadValue; - this.updateInterval = lookAheadValue / 2; - } - /** - * The unwrapped AudioContext or OfflineAudioContext - */ - get rawContext() { - return this._context; - } - /** - * The current audio context time plus a short [[lookAhead]]. - */ - now() { - return this._context.currentTime + this.lookAhead; - } - /** - * The current audio context time without the [[lookAhead]]. - * In most cases it is better to use [[now]] instead of [[immediate]] since - * with [[now]] the [[lookAhead]] is applied equally to _all_ components including internal components, - * to making sure that everything is scheduled in sync. Mixing [[now]] and [[immediate]] - * can cause some timing issues. If no lookAhead is desired, you can set the [[lookAhead]] to `0`. - */ - immediate() { - return this._context.currentTime; - } - /** - * Starts the audio context from a suspended state. This is required - * to initially start the AudioContext. See [[Tone.start]] - */ - resume() { - if (isAudioContext(this._context)) { - return this._context.resume(); - } - else { - return Promise.resolve(); - } - } - /** - * Close the context. Once closed, the context can no longer be used and - * any AudioNodes created from the context will be silent. - */ - close() { - return __awaiter(this, void 0, void 0, function* () { - if (isAudioContext(this._context)) { - yield this._context.close(); - } - if (this._initialized) { - closeContext(this); - } - }); - } - /** - * **Internal** Generate a looped buffer at some constant value. - */ - getConstant(val) { - if (this._constants.has(val)) { - return this._constants.get(val); - } - else { - const buffer = this._context.createBuffer(1, 128, this._context.sampleRate); - const arr = buffer.getChannelData(0); - for (let i = 0; i < arr.length; i++) { - arr[i] = val; - } - const constant = this._context.createBufferSource(); - constant.channelCount = 1; - constant.channelCountMode = "explicit"; - constant.buffer = buffer; - constant.loop = true; - constant.start(0); - this._constants.set(val, constant); - return constant; - } - } - /** - * Clean up. Also closes the audio context. - */ - dispose() { - super.dispose(); - this._ticker.dispose(); - this._timeouts.dispose(); - Object.keys(this._constants).map((val) => this._constants[val].disconnect()); - return this; - } - //--------------------------- - // TIMEOUTS - //--------------------------- - /** - * The private loop which keeps track of the context scheduled timeouts - * Is invoked from the clock source - */ - _timeoutLoop() { - const now = this.now(); - let firstEvent = this._timeouts.peek(); - while (this._timeouts.length && firstEvent && firstEvent.time <= now) { - // invoke the callback - firstEvent.callback(); - // shift the first event off - this._timeouts.shift(); - // get the next one - firstEvent = this._timeouts.peek(); - } - } - /** - * A setTimeout which is guaranteed by the clock source. - * Also runs in the offline context. - * @param fn The callback to invoke - * @param timeout The timeout in seconds - * @returns ID to use when invoking Context.clearTimeout - */ - setTimeout(fn, timeout) { - this._timeoutIds++; - const now = this.now(); - this._timeouts.add({ - callback: fn, - id: this._timeoutIds, - time: now + timeout, - }); - return this._timeoutIds; - } - /** - * Clears a previously scheduled timeout with Tone.context.setTimeout - * @param id The ID returned from setTimeout - */ - clearTimeout(id) { - this._timeouts.forEach((event) => { - if (event.id === id) { - this._timeouts.remove(event); - } - }); - return this; - } - /** - * Clear the function scheduled by [[setInterval]] - */ - clearInterval(id) { - return this.clearTimeout(id); - } - /** - * Adds a repeating event to the context's callback clock - */ - setInterval(fn, interval) { - const id = ++this._timeoutIds; - const intervalFn = () => { - const now = this.now(); - this._timeouts.add({ - callback: () => { - // invoke the callback - fn(); - // invoke the event to repeat it - intervalFn(); - }, - id, - time: now + interval, - }); - }; - // kick it off - intervalFn(); - return id; - } -} - -class DummyContext extends BaseContext { - constructor() { - super(...arguments); - this.lookAhead = 0; - this.latencyHint = 0; - this.isOffline = false; - } - //--------------------------- - // BASE AUDIO CONTEXT METHODS - //--------------------------- - createAnalyser() { - return {}; - } - createOscillator() { - return {}; - } - createBufferSource() { - return {}; - } - createBiquadFilter() { - return {}; - } - createBuffer(_numberOfChannels, _length, _sampleRate) { - return {}; - } - createChannelMerger(_numberOfInputs) { - return {}; - } - createChannelSplitter(_numberOfOutputs) { - return {}; - } - createConstantSource() { - return {}; - } - createConvolver() { - return {}; - } - createDelay(_maxDelayTime) { - return {}; - } - createDynamicsCompressor() { - return {}; - } - createGain() { - return {}; - } - createIIRFilter(_feedForward, _feedback) { - return {}; - } - createPanner() { - return {}; - } - createPeriodicWave(_real, _imag, _constraints) { - return {}; - } - createStereoPanner() { - return {}; - } - createWaveShaper() { - return {}; - } - createMediaStreamSource(_stream) { - return {}; - } - createMediaElementSource(_element) { - return {}; - } - createMediaStreamDestination() { - return {}; - } - decodeAudioData(_audioData) { - return Promise.resolve({}); - } - //--------------------------- - // TONE AUDIO CONTEXT METHODS - //--------------------------- - createAudioWorkletNode(_name, _options) { - return {}; - } - get rawContext() { - return {}; - } - addAudioWorkletModule(_url, _name) { - return __awaiter(this, void 0, void 0, function* () { - return Promise.resolve(); - }); - } - resume() { - return Promise.resolve(); - } - setTimeout(_fn, _timeout) { - return 0; - } - clearTimeout(_id) { - return this; - } - setInterval(_fn, _interval) { - return 0; - } - clearInterval(_id) { - return this; - } - getConstant(_val) { - return {}; - } - get currentTime() { - return 0; - } - get state() { - return {}; - } - get sampleRate() { - return 0; - } - get listener() { - return {}; - } - get transport() { - return {}; - } - get draw() { - return {}; - } - set draw(_d) { } - get destination() { - return {}; - } - set destination(_d) { } - now() { - return 0; - } - immediate() { - return 0; - } -} - -/** - * Make the property not writable using `defineProperty`. Internal use only. - */ -function readOnly(target, property) { - if (isArray(property)) { - property.forEach(str => readOnly(target, str)); - } - else { - Object.defineProperty(target, property, { - enumerable: true, - writable: false, - }); - } -} -/** - * Make an attribute writeable. Internal use only. - */ -function writable(target, property) { - if (isArray(property)) { - property.forEach(str => writable(target, str)); - } - else { - Object.defineProperty(target, property, { - writable: true, - }); - } -} -const noOp = () => { - // no operation here! -}; - -/** - * AudioBuffer loading and storage. ToneAudioBuffer is used internally by all - * classes that make requests for audio files such as Tone.Player, - * Tone.Sampler and Tone.Convolver. - * @example - * const buffer = new Tone.ToneAudioBuffer("https://tonejs.github.io/audio/casio/A1.mp3", () => { - * console.log("loaded"); - * }); - * @category Core - */ -class ToneAudioBuffer extends Tone { - constructor() { - super(); - this.name = "ToneAudioBuffer"; - /** - * Callback when the buffer is loaded. - */ - this.onload = noOp; - const options = optionsFromArguments(ToneAudioBuffer.getDefaults(), arguments, ["url", "onload", "onerror"]); - this.reverse = options.reverse; - this.onload = options.onload; - if (options.url && isAudioBuffer(options.url) || options.url instanceof ToneAudioBuffer) { - this.set(options.url); - } - else if (isString(options.url)) { - // initiate the download - this.load(options.url).catch(options.onerror); - } - } - static getDefaults() { - return { - onerror: noOp, - onload: noOp, - reverse: false, - }; - } - /** - * The sample rate of the AudioBuffer - */ - get sampleRate() { - if (this._buffer) { - return this._buffer.sampleRate; - } - else { - return getContext().sampleRate; - } - } - /** - * Pass in an AudioBuffer or ToneAudioBuffer to set the value of this buffer. - */ - set(buffer) { - if (buffer instanceof ToneAudioBuffer) { - // if it's loaded, set it - if (buffer.loaded) { - this._buffer = buffer.get(); - } - else { - // otherwise when it's loaded, invoke it's callback - buffer.onload = () => { - this.set(buffer); - this.onload(this); - }; - } - } - else { - this._buffer = buffer; - } - // reverse it initially - if (this._reversed) { - this._reverse(); - } - return this; - } - /** - * The audio buffer stored in the object. - */ - get() { - return this._buffer; - } - /** - * Makes an fetch request for the selected url then decodes the file as an audio buffer. - * Invokes the callback once the audio buffer loads. - * @param url The url of the buffer to load. filetype support depends on the browser. - * @returns A Promise which resolves with this ToneAudioBuffer - */ - load(url) { - return __awaiter(this, void 0, void 0, function* () { - const doneLoading = ToneAudioBuffer.load(url).then(audioBuffer => { - this.set(audioBuffer); - // invoke the onload method - this.onload(this); - }); - ToneAudioBuffer.downloads.push(doneLoading); - try { - yield doneLoading; - } - finally { - // remove the downloaded file - const index = ToneAudioBuffer.downloads.indexOf(doneLoading); - ToneAudioBuffer.downloads.splice(index, 1); - } - return this; - }); - } - /** - * clean up - */ - dispose() { - super.dispose(); - this._buffer = undefined; - return this; - } - /** - * Set the audio buffer from the array. - * To create a multichannel AudioBuffer, pass in a multidimensional array. - * @param array The array to fill the audio buffer - */ - fromArray(array) { - const isMultidimensional = isArray(array) && array[0].length > 0; - const channels = isMultidimensional ? array.length : 1; - const len = isMultidimensional ? array[0].length : array.length; - const context = getContext(); - const buffer = context.createBuffer(channels, len, context.sampleRate); - const multiChannelArray = !isMultidimensional && channels === 1 ? - [array] : array; - for (let c = 0; c < channels; c++) { - buffer.copyToChannel(multiChannelArray[c], c); - } - this._buffer = buffer; - return this; - } - /** - * Sums multiple channels into 1 channel - * @param chanNum Optionally only copy a single channel from the array. - */ - toMono(chanNum) { - if (isNumber(chanNum)) { - this.fromArray(this.toArray(chanNum)); - } - else { - let outputArray = new Float32Array(this.length); - const numChannels = this.numberOfChannels; - for (let channel = 0; channel < numChannels; channel++) { - const channelArray = this.toArray(channel); - for (let i = 0; i < channelArray.length; i++) { - outputArray[i] += channelArray[i]; - } - } - // divide by the number of channels - outputArray = outputArray.map(sample => sample / numChannels); - this.fromArray(outputArray); - } - return this; - } - /** - * Get the buffer as an array. Single channel buffers will return a 1-dimensional - * Float32Array, and multichannel buffers will return multidimensional arrays. - * @param channel Optionally only copy a single channel from the array. - */ - toArray(channel) { - if (isNumber(channel)) { - return this.getChannelData(channel); - } - else if (this.numberOfChannels === 1) { - return this.toArray(0); - } - else { - const ret = []; - for (let c = 0; c < this.numberOfChannels; c++) { - ret[c] = this.getChannelData(c); - } - return ret; - } - } - /** - * Returns the Float32Array representing the PCM audio data for the specific channel. - * @param channel The channel number to return - * @return The audio as a TypedArray - */ - getChannelData(channel) { - if (this._buffer) { - return this._buffer.getChannelData(channel); - } - else { - return new Float32Array(0); - } - } - /** - * Cut a subsection of the array and return a buffer of the - * subsection. Does not modify the original buffer - * @param start The time to start the slice - * @param end The end time to slice. If none is given will default to the end of the buffer - */ - slice(start, end = this.duration) { - const startSamples = Math.floor(start * this.sampleRate); - const endSamples = Math.floor(end * this.sampleRate); - assert(startSamples < endSamples, "The start time must be less than the end time"); - const length = endSamples - startSamples; - const retBuffer = getContext().createBuffer(this.numberOfChannels, length, this.sampleRate); - for (let channel = 0; channel < this.numberOfChannels; channel++) { - retBuffer.copyToChannel(this.getChannelData(channel).subarray(startSamples, endSamples), channel); - } - return new ToneAudioBuffer(retBuffer); - } - /** - * Reverse the buffer. - */ - _reverse() { - if (this.loaded) { - for (let i = 0; i < this.numberOfChannels; i++) { - this.getChannelData(i).reverse(); - } - } - return this; - } - /** - * If the buffer is loaded or not - */ - get loaded() { - return this.length > 0; - } - /** - * The duration of the buffer in seconds. - */ - get duration() { - if (this._buffer) { - return this._buffer.duration; - } - else { - return 0; - } - } - /** - * The length of the buffer in samples - */ - get length() { - if (this._buffer) { - return this._buffer.length; - } - else { - return 0; - } - } - /** - * The number of discrete audio channels. Returns 0 if no buffer is loaded. - */ - get numberOfChannels() { - if (this._buffer) { - return this._buffer.numberOfChannels; - } - else { - return 0; - } - } - /** - * Reverse the buffer. - */ - get reverse() { - return this._reversed; - } - set reverse(rev) { - if (this._reversed !== rev) { - this._reversed = rev; - this._reverse(); - } - } - /** - * Create a ToneAudioBuffer from the array. To create a multichannel AudioBuffer, - * pass in a multidimensional array. - * @param array The array to fill the audio buffer - * @return A ToneAudioBuffer created from the array - */ - static fromArray(array) { - return (new ToneAudioBuffer()).fromArray(array); - } - /** - * Creates a ToneAudioBuffer from a URL, returns a promise which resolves to a ToneAudioBuffer - * @param url The url to load. - * @return A promise which resolves to a ToneAudioBuffer - */ - static fromUrl(url) { - return __awaiter(this, void 0, void 0, function* () { - const buffer = new ToneAudioBuffer(); - return yield buffer.load(url); - }); - } - /** - * Loads a url using fetch and returns the AudioBuffer. - */ - static load(url) { - return __awaiter(this, void 0, void 0, function* () { - // test if the url contains multiple extensions - const matches = url.match(/\[([^\]\[]+\|.+)\]$/); - if (matches) { - const extensions = matches[1].split("|"); - let extension = extensions[0]; - for (const ext of extensions) { - if (ToneAudioBuffer.supportsType(ext)) { - extension = ext; - break; - } - } - url = url.replace(matches[0], extension); - } - // make sure there is a slash between the baseUrl and the url - const baseUrl = ToneAudioBuffer.baseUrl === "" || ToneAudioBuffer.baseUrl.endsWith("/") ? ToneAudioBuffer.baseUrl : ToneAudioBuffer.baseUrl + "/"; - const response = yield fetch(baseUrl + url); - if (!response.ok) { - throw new Error(`could not load url: ${url}`); - } - const arrayBuffer = yield response.arrayBuffer(); - const audioBuffer = yield getContext().decodeAudioData(arrayBuffer); - return audioBuffer; - }); - } - /** - * Checks a url's extension to see if the current browser can play that file type. - * @param url The url/extension to test - * @return If the file extension can be played - * @static - * @example - * Tone.ToneAudioBuffer.supportsType("wav"); // returns true - * Tone.ToneAudioBuffer.supportsType("path/to/file.wav"); // returns true - */ - static supportsType(url) { - const extensions = url.split("."); - const extension = extensions[extensions.length - 1]; - const response = document.createElement("audio").canPlayType("audio/" + extension); - return response !== ""; - } - /** - * Returns a Promise which resolves when all of the buffers have loaded - */ - static loaded() { - return __awaiter(this, void 0, void 0, function* () { - // this makes sure that the function is always async - yield Promise.resolve(); - while (ToneAudioBuffer.downloads.length) { - yield ToneAudioBuffer.downloads[0]; - } - }); - } -} -//------------------------------------- -// STATIC METHODS -//------------------------------------- -/** - * A path which is prefixed before every url. - */ -ToneAudioBuffer.baseUrl = ""; -/** - * All of the downloads - */ -ToneAudioBuffer.downloads = []; - -/** - * Wrapper around the OfflineAudioContext - * @category Core - * @example - * // generate a single channel, 0.5 second buffer - * const context = new Tone.OfflineContext(1, 0.5, 44100); - * const osc = new Tone.Oscillator({ context }); - * context.render().then(buffer => { - * console.log(buffer.numberOfChannels, buffer.duration); - * }); - */ -class OfflineContext extends Context { - constructor() { - super({ - clockSource: "offline", - context: isOfflineAudioContext(arguments[0]) ? - arguments[0] : createOfflineAudioContext(arguments[0], arguments[1] * arguments[2], arguments[2]), - lookAhead: 0, - updateInterval: isOfflineAudioContext(arguments[0]) ? - 128 / arguments[0].sampleRate : 128 / arguments[2], - }); - this.name = "OfflineContext"; - /** - * An artificial clock source - */ - this._currentTime = 0; - this.isOffline = true; - this._duration = isOfflineAudioContext(arguments[0]) ? - arguments[0].length / arguments[0].sampleRate : arguments[1]; - } - /** - * Override the now method to point to the internal clock time - */ - now() { - return this._currentTime; - } - /** - * Same as this.now() - */ - get currentTime() { - return this._currentTime; - } - /** - * Render just the clock portion of the audio context. - */ - _renderClock(asynchronous) { - return __awaiter(this, void 0, void 0, function* () { - let index = 0; - while (this._duration - this._currentTime >= 0) { - // invoke all the callbacks on that time - this.emit("tick"); - // increment the clock in block-sized chunks - this._currentTime += 128 / this.sampleRate; - // yield once a second of audio - index++; - const yieldEvery = Math.floor(this.sampleRate / 128); - if (asynchronous && index % yieldEvery === 0) { - yield new Promise(done => setTimeout(done, 1)); - } - } - }); - } - /** - * Render the output of the OfflineContext - * @param asynchronous If the clock should be rendered asynchronously, which will not block the main thread, but be slightly slower. - */ - render(asynchronous = true) { - return __awaiter(this, void 0, void 0, function* () { - yield this.workletsAreReady(); - yield this._renderClock(asynchronous); - const buffer = yield this._context.startRendering(); - return new ToneAudioBuffer(buffer); - }); - } - /** - * Close the context - */ - close() { - return Promise.resolve(); - } -} - -/** - * This dummy context is used to avoid throwing immediate errors when importing in Node.js - */ -const dummyContext = new DummyContext(); -/** - * The global audio context which is getable and assignable through - * getContext and setContext - */ -let globalContext = dummyContext; -/** - * Returns the default system-wide [[Context]] - * @category Core - */ -function getContext() { - if (globalContext === dummyContext && hasAudioContext) { - setContext(new Context()); - } - return globalContext; -} -/** - * Set the default audio context - * @category Core - */ -function setContext(context) { - if (isAudioContext(context)) { - globalContext = new Context(context); - } - else if (isOfflineAudioContext(context)) { - globalContext = new OfflineContext(context); - } - else { - globalContext = context; - } -} -/** - * Most browsers will not play _any_ audio until a user - * clicks something (like a play button). Invoke this method - * on a click or keypress event handler to start the audio context. - * More about the Autoplay policy - * [here](https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#webaudio) - * @example - * document.querySelector("button").addEventListener("click", async () => { - * await Tone.start(); - * console.log("context started"); - * }); - * @category Core - */ -function start() { - return globalContext.resume(); -} -/** - * Log Tone.js + version in the console. - */ -if (theWindow && !theWindow.TONE_SILENCE_LOGGING) { - let prefix = "v"; - const printString = ` * Tone.js ${prefix}${version} * `; - // eslint-disable-next-line no-console - console.log(`%c${printString}`, "background: #000; color: #fff"); -} - -/** - * Equal power gain scale. Good for cross-fading. - * @param percent (0-1) - */ -/** - * Convert decibels into gain. - */ -function dbToGain(db) { - return Math.pow(10, db / 20); -} -/** - * Convert gain to decibels. - */ -function gainToDb(gain) { - return 20 * (Math.log(gain) / Math.LN10); -} -/** - * Convert an interval (in semitones) to a frequency ratio. - * @param interval the number of semitones above the base note - * @example - * Tone.intervalToFrequencyRatio(0); // 1 - * Tone.intervalToFrequencyRatio(12); // 2 - * Tone.intervalToFrequencyRatio(-12); // 0.5 - */ -function intervalToFrequencyRatio(interval) { - return Math.pow(2, (interval / 12)); -} -/** - * The Global [concert tuning pitch](https://en.wikipedia.org/wiki/Concert_pitch) which is used - * to generate all the other pitch values from notes. A4's values in Hertz. - */ -let A4 = 440; -function getA4() { - return A4; -} -function setA4(freq) { - A4 = freq; -} -/** - * Convert a frequency value to a MIDI note. - * @param frequency The value to frequency value to convert. - * @example - * Tone.ftom(440); // returns 69 - */ -function ftom(frequency) { - return Math.round(ftomf(frequency)); -} -/** - * Convert a frequency to a floating point midi value - */ -function ftomf(frequency) { - return 69 + 12 * Math.log2(frequency / A4); -} -/** - * Convert a MIDI note to frequency value. - * @param midi The midi number to convert. - * @return The corresponding frequency value - * @example - * Tone.mtof(69); // 440 - */ -function mtof(midi) { - return A4 * Math.pow(2, (midi - 69) / 12); -} - -/** - * TimeBase is a flexible encoding of time which can be evaluated to and from a string. - */ -class TimeBaseClass extends Tone { - /** - * @param context The context associated with the time value. Used to compute - * Transport and context-relative timing. - * @param value The time value as a number, string or object - * @param units Unit values - */ - constructor(context, value, units) { - super(); - /** - * The default units - */ - this.defaultUnits = "s"; - this._val = value; - this._units = units; - this.context = context; - this._expressions = this._getExpressions(); - } - /** - * All of the time encoding expressions - */ - _getExpressions() { - return { - hz: { - method: (value) => { - return this._frequencyToUnits(parseFloat(value)); - }, - regexp: /^(\d+(?:\.\d+)?)hz$/i, - }, - i: { - method: (value) => { - return this._ticksToUnits(parseInt(value, 10)); - }, - regexp: /^(\d+)i$/i, - }, - m: { - method: (value) => { - return this._beatsToUnits(parseInt(value, 10) * this._getTimeSignature()); - }, - regexp: /^(\d+)m$/i, - }, - n: { - method: (value, dot) => { - const numericValue = parseInt(value, 10); - const scalar = dot === "." ? 1.5 : 1; - if (numericValue === 1) { - return this._beatsToUnits(this._getTimeSignature()) * scalar; - } - else { - return this._beatsToUnits(4 / numericValue) * scalar; - } - }, - regexp: /^(\d+)n(\.?)$/i, - }, - number: { - method: (value) => { - return this._expressions[this.defaultUnits].method.call(this, value); - }, - regexp: /^(\d+(?:\.\d+)?)$/, - }, - s: { - method: (value) => { - return this._secondsToUnits(parseFloat(value)); - }, - regexp: /^(\d+(?:\.\d+)?)s$/, - }, - samples: { - method: (value) => { - return parseInt(value, 10) / this.context.sampleRate; - }, - regexp: /^(\d+)samples$/, - }, - t: { - method: (value) => { - const numericValue = parseInt(value, 10); - return this._beatsToUnits(8 / (Math.floor(numericValue) * 3)); - }, - regexp: /^(\d+)t$/i, - }, - tr: { - method: (m, q, s) => { - let total = 0; - if (m && m !== "0") { - total += this._beatsToUnits(this._getTimeSignature() * parseFloat(m)); - } - if (q && q !== "0") { - total += this._beatsToUnits(parseFloat(q)); - } - if (s && s !== "0") { - total += this._beatsToUnits(parseFloat(s) / 4); - } - return total; - }, - regexp: /^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?$/, - }, - }; - } - //------------------------------------- - // VALUE OF - //------------------------------------- - /** - * Evaluate the time value. Returns the time in seconds. - */ - valueOf() { - if (this._val instanceof TimeBaseClass) { - this.fromType(this._val); - } - if (isUndef(this._val)) { - return this._noArg(); - } - else if (isString(this._val) && isUndef(this._units)) { - for (const units in this._expressions) { - if (this._expressions[units].regexp.test(this._val.trim())) { - this._units = units; - break; - } - } - } - else if (isObject(this._val)) { - let total = 0; - for (const typeName in this._val) { - if (isDefined(this._val[typeName])) { - const quantity = this._val[typeName]; - // @ts-ignore - const time = (new this.constructor(this.context, typeName)).valueOf() * quantity; - total += time; - } - } - return total; - } - if (isDefined(this._units)) { - const expr = this._expressions[this._units]; - const matching = this._val.toString().trim().match(expr.regexp); - if (matching) { - return expr.method.apply(this, matching.slice(1)); - } - else { - return expr.method.call(this, this._val); - } - } - else if (isString(this._val)) { - return parseFloat(this._val); - } - else { - return this._val; - } - } - //------------------------------------- - // UNIT CONVERSIONS - //------------------------------------- - /** - * Returns the value of a frequency in the current units - */ - _frequencyToUnits(freq) { - return 1 / freq; - } - /** - * Return the value of the beats in the current units - */ - _beatsToUnits(beats) { - return (60 / this._getBpm()) * beats; - } - /** - * Returns the value of a second in the current units - */ - _secondsToUnits(seconds) { - return seconds; - } - /** - * Returns the value of a tick in the current time units - */ - _ticksToUnits(ticks) { - return (ticks * (this._beatsToUnits(1)) / this._getPPQ()); - } - /** - * With no arguments, return 'now' - */ - _noArg() { - return this._now(); - } - //------------------------------------- - // TEMPO CONVERSIONS - //------------------------------------- - /** - * Return the bpm - */ - _getBpm() { - return this.context.transport.bpm.value; - } - /** - * Return the timeSignature - */ - _getTimeSignature() { - return this.context.transport.timeSignature; - } - /** - * Return the PPQ or 192 if Transport is not available - */ - _getPPQ() { - return this.context.transport.PPQ; - } - //------------------------------------- - // CONVERSION INTERFACE - //------------------------------------- - /** - * Coerce a time type into this units type. - * @param type Any time type units - */ - fromType(type) { - this._units = undefined; - switch (this.defaultUnits) { - case "s": - this._val = type.toSeconds(); - break; - case "i": - this._val = type.toTicks(); - break; - case "hz": - this._val = type.toFrequency(); - break; - case "midi": - this._val = type.toMidi(); - break; - } - return this; - } - /** - * Return the value in hertz - */ - toFrequency() { - return 1 / this.toSeconds(); - } - /** - * Return the time in samples - */ - toSamples() { - return this.toSeconds() * this.context.sampleRate; - } - /** - * Return the time in milliseconds. - */ - toMilliseconds() { - return this.toSeconds() * 1000; - } -} - -/** - * TimeClass is a primitive type for encoding and decoding Time values. - * TimeClass can be passed into the parameter of any method which takes time as an argument. - * @param val The time value. - * @param units The units of the value. - * @example - * const time = Tone.Time("4n"); // a quarter note - * @category Unit - */ -class TimeClass extends TimeBaseClass { - constructor() { - super(...arguments); - this.name = "TimeClass"; - } - _getExpressions() { - return Object.assign(super._getExpressions(), { - now: { - method: (capture) => { - return this._now() + new this.constructor(this.context, capture).valueOf(); - }, - regexp: /^\+(.+)/, - }, - quantize: { - method: (capture) => { - const quantTo = new TimeClass(this.context, capture).valueOf(); - return this._secondsToUnits(this.context.transport.nextSubdivision(quantTo)); - }, - regexp: /^@(.+)/, - }, - }); - } - /** - * Quantize the time by the given subdivision. Optionally add a - * percentage which will move the time value towards the ideal - * quantized value by that percentage. - * @param subdiv The subdivision to quantize to - * @param percent Move the time value towards the quantized value by a percentage. - * @example - * Tone.Time(21).quantize(2); // returns 22 - * Tone.Time(0.6).quantize("4n", 0.5); // returns 0.55 - */ - quantize(subdiv, percent = 1) { - const subdivision = new this.constructor(this.context, subdiv).valueOf(); - const value = this.valueOf(); - const multiple = Math.round(value / subdivision); - const ideal = multiple * subdivision; - const diff = ideal - value; - return value + diff * percent; - } - //------------------------------------- - // CONVERSIONS - //------------------------------------- - /** - * Convert a Time to Notation. The notation values are will be the - * closest representation between 1m to 128th note. - * @return {Notation} - * @example - * // if the Transport is at 120bpm: - * Tone.Time(2).toNotation(); // returns "1m" - */ - toNotation() { - const time = this.toSeconds(); - const testNotations = ["1m"]; - for (let power = 1; power < 9; power++) { - const subdiv = Math.pow(2, power); - testNotations.push(subdiv + "n."); - testNotations.push(subdiv + "n"); - testNotations.push(subdiv + "t"); - } - testNotations.push("0"); - // find the closets notation representation - let closest = testNotations[0]; - let closestSeconds = new TimeClass(this.context, testNotations[0]).toSeconds(); - testNotations.forEach(notation => { - const notationSeconds = new TimeClass(this.context, notation).toSeconds(); - if (Math.abs(notationSeconds - time) < Math.abs(closestSeconds - time)) { - closest = notation; - closestSeconds = notationSeconds; - } - }); - return closest; - } - /** - * Return the time encoded as Bars:Beats:Sixteenths. - */ - toBarsBeatsSixteenths() { - const quarterTime = this._beatsToUnits(1); - let quarters = this.valueOf() / quarterTime; - quarters = parseFloat(quarters.toFixed(4)); - const measures = Math.floor(quarters / this._getTimeSignature()); - let sixteenths = (quarters % 1) * 4; - quarters = Math.floor(quarters) % this._getTimeSignature(); - const sixteenthString = sixteenths.toString(); - if (sixteenthString.length > 3) { - // the additional parseFloat removes insignificant trailing zeroes - sixteenths = parseFloat(parseFloat(sixteenthString).toFixed(3)); - } - const progress = [measures, quarters, sixteenths]; - return progress.join(":"); - } - /** - * Return the time in ticks. - */ - toTicks() { - const quarterTime = this._beatsToUnits(1); - const quarters = this.valueOf() / quarterTime; - return Math.round(quarters * this._getPPQ()); - } - /** - * Return the time in seconds. - */ - toSeconds() { - return this.valueOf(); - } - /** - * Return the value as a midi note. - */ - toMidi() { - return ftom(this.toFrequency()); - } - _now() { - return this.context.now(); - } -} -/** - * Create a TimeClass from a time string or number. The time is computed against the - * global Tone.Context. To use a specific context, use [[TimeClass]] - * @param value A value which represents time - * @param units The value's units if they can't be inferred by the value. - * @category Unit - * @example - * const time = Tone.Time("4n").toSeconds(); - * console.log(time); - * @example - * const note = Tone.Time(1).toNotation(); - * console.log(note); - * @example - * const freq = Tone.Time(0.5).toFrequency(); - * console.log(freq); - */ -function Time(value, units) { - return new TimeClass(getContext(), value, units); -} - -/** - * Frequency is a primitive type for encoding Frequency values. - * Eventually all time values are evaluated to hertz using the `valueOf` method. - * @example - * Tone.Frequency("C3"); // 261 - * Tone.Frequency(38, "midi"); - * Tone.Frequency("C3").transpose(4); - * @category Unit - */ -class FrequencyClass extends TimeClass { - constructor() { - super(...arguments); - this.name = "Frequency"; - this.defaultUnits = "hz"; - } - /** - * The [concert tuning pitch](https://en.wikipedia.org/wiki/Concert_pitch) which is used - * to generate all the other pitch values from notes. A4's values in Hertz. - */ - static get A4() { - return getA4(); - } - static set A4(freq) { - setA4(freq); - } - //------------------------------------- - // AUGMENT BASE EXPRESSIONS - //------------------------------------- - _getExpressions() { - return Object.assign({}, super._getExpressions(), { - midi: { - regexp: /^(\d+(?:\.\d+)?midi)/, - method(value) { - if (this.defaultUnits === "midi") { - return value; - } - else { - return FrequencyClass.mtof(value); - } - }, - }, - note: { - regexp: /^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i, - method(pitch, octave) { - const index = noteToScaleIndex[pitch.toLowerCase()]; - const noteNumber = index + (parseInt(octave, 10) + 1) * 12; - if (this.defaultUnits === "midi") { - return noteNumber; - } - else { - return FrequencyClass.mtof(noteNumber); - } - }, - }, - tr: { - regexp: /^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?/, - method(m, q, s) { - let total = 1; - if (m && m !== "0") { - total *= this._beatsToUnits(this._getTimeSignature() * parseFloat(m)); - } - if (q && q !== "0") { - total *= this._beatsToUnits(parseFloat(q)); - } - if (s && s !== "0") { - total *= this._beatsToUnits(parseFloat(s) / 4); - } - return total; - }, - }, - }); - } - //------------------------------------- - // EXPRESSIONS - //------------------------------------- - /** - * Transposes the frequency by the given number of semitones. - * @return A new transposed frequency - * @example - * Tone.Frequency("A4").transpose(3); // "C5" - */ - transpose(interval) { - return new FrequencyClass(this.context, this.valueOf() * intervalToFrequencyRatio(interval)); - } - /** - * Takes an array of semitone intervals and returns - * an array of frequencies transposed by those intervals. - * @return Returns an array of Frequencies - * @example - * Tone.Frequency("A4").harmonize([0, 3, 7]); // ["A4", "C5", "E5"] - */ - harmonize(intervals) { - return intervals.map(interval => { - return this.transpose(interval); - }); - } - //------------------------------------- - // UNIT CONVERSIONS - //------------------------------------- - /** - * Return the value of the frequency as a MIDI note - * @example - * Tone.Frequency("C4").toMidi(); // 60 - */ - toMidi() { - return ftom(this.valueOf()); - } - /** - * Return the value of the frequency in Scientific Pitch Notation - * @example - * Tone.Frequency(69, "midi").toNote(); // "A4" - */ - toNote() { - const freq = this.toFrequency(); - const log = Math.log2(freq / FrequencyClass.A4); - let noteNumber = Math.round(12 * log) + 57; - const octave = Math.floor(noteNumber / 12); - if (octave < 0) { - noteNumber += -12 * octave; - } - const noteName = scaleIndexToNote[noteNumber % 12]; - return noteName + octave.toString(); - } - /** - * Return the duration of one cycle in seconds. - */ - toSeconds() { - return 1 / super.toSeconds(); - } - /** - * Return the duration of one cycle in ticks - */ - toTicks() { - const quarterTime = this._beatsToUnits(1); - const quarters = this.valueOf() / quarterTime; - return Math.floor(quarters * this._getPPQ()); - } - //------------------------------------- - // UNIT CONVERSIONS HELPERS - //------------------------------------- - /** - * With no arguments, return 0 - */ - _noArg() { - return 0; - } - /** - * Returns the value of a frequency in the current units - */ - _frequencyToUnits(freq) { - return freq; - } - /** - * Returns the value of a tick in the current time units - */ - _ticksToUnits(ticks) { - return 1 / ((ticks * 60) / (this._getBpm() * this._getPPQ())); - } - /** - * Return the value of the beats in the current units - */ - _beatsToUnits(beats) { - return 1 / super._beatsToUnits(beats); - } - /** - * Returns the value of a second in the current units - */ - _secondsToUnits(seconds) { - return 1 / seconds; - } - /** - * Convert a MIDI note to frequency value. - * @param midi The midi number to convert. - * @return The corresponding frequency value - */ - static mtof(midi) { - return mtof(midi); - } - /** - * Convert a frequency value to a MIDI note. - * @param frequency The value to frequency value to convert. - */ - static ftom(frequency) { - return ftom(frequency); - } -} -//------------------------------------- -// FREQUENCY CONVERSIONS -//------------------------------------- -/** - * Note to scale index. - * @hidden - */ -const noteToScaleIndex = { - cbb: -2, cb: -1, c: 0, "c#": 1, cx: 2, - dbb: 0, db: 1, d: 2, "d#": 3, dx: 4, - ebb: 2, eb: 3, e: 4, "e#": 5, ex: 6, - fbb: 3, fb: 4, f: 5, "f#": 6, fx: 7, - gbb: 5, gb: 6, g: 7, "g#": 8, gx: 9, - abb: 7, ab: 8, a: 9, "a#": 10, ax: 11, - bbb: 9, bb: 10, b: 11, "b#": 12, bx: 13, -}; -/** - * scale index to note (sharps) - * @hidden - */ -const scaleIndexToNote = ["C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"]; -/** - * Convert a value into a FrequencyClass object. - * @category Unit - * @example - * const midi = Tone.Frequency("C3").toMidi(); - * console.log(midi); - * @example - * const hertz = Tone.Frequency(38, "midi").toFrequency(); - * console.log(hertz); - */ -function Frequency(value, units) { - return new FrequencyClass(getContext(), value, units); -} - -/** - * TransportTime is a the time along the Transport's - * timeline. It is similar to Tone.Time, but instead of evaluating - * against the AudioContext's clock, it is evaluated against - * the Transport's position. See [TransportTime wiki](https://github.com/Tonejs/Tone.js/wiki/TransportTime). - * @category Unit - */ -class TransportTimeClass extends TimeClass { - constructor() { - super(...arguments); - this.name = "TransportTime"; - } - /** - * Return the current time in whichever context is relevant - */ - _now() { - return this.context.transport.seconds; - } -} -/** - * TransportTime is a the time along the Transport's - * timeline. It is similar to [[Time]], but instead of evaluating - * against the AudioContext's clock, it is evaluated against - * the Transport's position. See [TransportTime wiki](https://github.com/Tonejs/Tone.js/wiki/TransportTime). - * @category Unit - */ -function TransportTime(value, units) { - return new TransportTimeClass(getContext(), value, units); -} - -/** - * The Base class for all nodes that have an AudioContext. - */ -class ToneWithContext extends Tone { - constructor() { - super(); - const options = optionsFromArguments(ToneWithContext.getDefaults(), arguments, ["context"]); - if (this.defaultContext) { - this.context = this.defaultContext; - } - else { - this.context = options.context; - } - } - static getDefaults() { - return { - context: getContext(), - }; - } - /** - * Return the current time of the Context clock plus the lookAhead. - * @example - * setInterval(() => { - * console.log(Tone.now()); - * }, 100); - */ - now() { - return this.context.currentTime + this.context.lookAhead; - } - /** - * Return the current time of the Context clock without any lookAhead. - * @example - * setInterval(() => { - * console.log(Tone.immediate()); - * }, 100); - */ - immediate() { - return this.context.currentTime; - } - /** - * The duration in seconds of one sample. - * @example - * console.log(Tone.Transport.sampleTime); - */ - get sampleTime() { - return 1 / this.context.sampleRate; - } - /** - * The number of seconds of 1 processing block (128 samples) - * @example - * console.log(Tone.Destination.blockTime); - */ - get blockTime() { - return 128 / this.context.sampleRate; - } - /** - * Convert the incoming time to seconds. - * This is calculated against the current [[Tone.Transport]] bpm - * @example - * const gain = new Tone.Gain(); - * setInterval(() => console.log(gain.toSeconds("4n")), 100); - * // ramp the tempo to 60 bpm over 30 seconds - * Tone.getTransport().bpm.rampTo(60, 30); - */ - toSeconds(time) { - return new TimeClass(this.context, time).toSeconds(); - } - /** - * Convert the input to a frequency number - * @example - * const gain = new Tone.Gain(); - * console.log(gain.toFrequency("4n")); - */ - toFrequency(freq) { - return new FrequencyClass(this.context, freq).toFrequency(); - } - /** - * Convert the input time into ticks - * @example - * const gain = new Tone.Gain(); - * console.log(gain.toTicks("4n")); - */ - toTicks(time) { - return new TransportTimeClass(this.context, time).toTicks(); - } - //------------------------------------- - // GET/SET - //------------------------------------- - /** - * Get a subset of the properties which are in the partial props - */ - _getPartialProperties(props) { - const options = this.get(); - // remove attributes from the prop that are not in the partial - Object.keys(options).forEach(name => { - if (isUndef(props[name])) { - delete options[name]; - } - }); - return options; - } - /** - * Get the object's attributes. - * @example - * const osc = new Tone.Oscillator(); - * console.log(osc.get()); - */ - get() { - const defaults = getDefaultsFromInstance(this); - Object.keys(defaults).forEach(attribute => { - if (Reflect.has(this, attribute)) { - const member = this[attribute]; - if (isDefined(member) && isDefined(member.value) && isDefined(member.setValueAtTime)) { - defaults[attribute] = member.value; - } - else if (member instanceof ToneWithContext) { - defaults[attribute] = member._getPartialProperties(defaults[attribute]); - // otherwise make sure it's a serializable type - } - else if (isArray(member) || isNumber(member) || isString(member) || isBoolean(member)) { - defaults[attribute] = member; - } - else { - // remove all undefined and unserializable attributes - delete defaults[attribute]; - } - } - }); - return defaults; - } - /** - * Set multiple properties at once with an object. - * @example - * const filter = new Tone.Filter().toDestination(); - * // set values using an object - * filter.set({ - * frequency: "C6", - * type: "highpass" - * }); - * const player = new Tone.Player("https://tonejs.github.io/audio/berklee/Analogsynth_octaves_highmid.mp3").connect(filter); - * player.autostart = true; - */ - set(props) { - Object.keys(props).forEach(attribute => { - if (Reflect.has(this, attribute) && isDefined(this[attribute])) { - if (this[attribute] && isDefined(this[attribute].value) && isDefined(this[attribute].setValueAtTime)) { - // small optimization - if (this[attribute].value !== props[attribute]) { - this[attribute].value = props[attribute]; - } - } - else if (this[attribute] instanceof ToneWithContext) { - this[attribute].set(props[attribute]); - } - else { - this[attribute] = props[attribute]; - } - } - }); - return this; - } -} - -/** - * A Timeline State. Provides the methods: `setStateAtTime("state", time)` and `getValueAtTime(time)` - * @param initial The initial state of the StateTimeline. Defaults to `undefined` - */ -class StateTimeline extends Timeline { - constructor(initial = "stopped") { - super(); - this.name = "StateTimeline"; - this._initial = initial; - this.setStateAtTime(this._initial, 0); - } - /** - * Returns the scheduled state scheduled before or at - * the given time. - * @param time The time to query. - * @return The name of the state input in setStateAtTime. - */ - getValueAtTime(time) { - const event = this.get(time); - if (event !== null) { - return event.state; - } - else { - return this._initial; - } - } - /** - * Add a state to the timeline. - * @param state The name of the state to set. - * @param time The time to query. - * @param options Any additional options that are needed in the timeline. - */ - setStateAtTime(state, time, options) { - assertRange(time, 0); - this.add(Object.assign({}, options, { - state, - time, - })); - return this; - } - /** - * Return the event before the time with the given state - * @param state The state to look for - * @param time When to check before - * @return The event with the given state before the time - */ - getLastState(state, time) { - // time = this.toSeconds(time); - const index = this._search(time); - for (let i = index; i >= 0; i--) { - const event = this._timeline[i]; - if (event.state === state) { - return event; - } - } - } - /** - * Return the event after the time with the given state - * @param state The state to look for - * @param time When to check from - * @return The event with the given state after the time - */ - getNextState(state, time) { - // time = this.toSeconds(time); - const index = this._search(time); - if (index !== -1) { - for (let i = index; i < this._timeline.length; i++) { - const event = this._timeline[i]; - if (event.state === state) { - return event; - } - } - } - } -} - -/** - * Param wraps the native Web Audio's AudioParam to provide - * additional unit conversion functionality. It also - * serves as a base-class for classes which have a single, - * automatable parameter. - * @category Core - */ -class Param extends ToneWithContext { - constructor() { - super(optionsFromArguments(Param.getDefaults(), arguments, ["param", "units", "convert"])); - this.name = "Param"; - this.overridden = false; - /** - * The minimum output value - */ - this._minOutput = 1e-7; - const options = optionsFromArguments(Param.getDefaults(), arguments, ["param", "units", "convert"]); - assert(isDefined(options.param) && - (isAudioParam(options.param) || options.param instanceof Param), "param must be an AudioParam"); - while (!isAudioParam(options.param)) { - options.param = options.param._param; - } - this._swappable = isDefined(options.swappable) ? options.swappable : false; - if (this._swappable) { - this.input = this.context.createGain(); - // initialize - this._param = options.param; - this.input.connect(this._param); - } - else { - this._param = this.input = options.param; - } - this._events = new Timeline(1000); - this._initialValue = this._param.defaultValue; - this.units = options.units; - this.convert = options.convert; - this._minValue = options.minValue; - this._maxValue = options.maxValue; - // if the value is defined, set it immediately - if (isDefined(options.value) && options.value !== this._toType(this._initialValue)) { - this.setValueAtTime(options.value, 0); - } - } - static getDefaults() { - return Object.assign(ToneWithContext.getDefaults(), { - convert: true, - units: "number", - }); - } - get value() { - const now = this.now(); - return this.getValueAtTime(now); - } - set value(value) { - this.cancelScheduledValues(this.now()); - this.setValueAtTime(value, this.now()); - } - get minValue() { - // if it's not the default minValue, return it - if (isDefined(this._minValue)) { - return this._minValue; - } - else if (this.units === "time" || this.units === "frequency" || - this.units === "normalRange" || this.units === "positive" || - this.units === "transportTime" || this.units === "ticks" || - this.units === "bpm" || this.units === "hertz" || this.units === "samples") { - return 0; - } - else if (this.units === "audioRange") { - return -1; - } - else if (this.units === "decibels") { - return -Infinity; - } - else { - return this._param.minValue; - } - } - get maxValue() { - if (isDefined(this._maxValue)) { - return this._maxValue; - } - else if (this.units === "normalRange" || - this.units === "audioRange") { - return 1; - } - else { - return this._param.maxValue; - } - } - /** - * Type guard based on the unit name - */ - _is(arg, type) { - return this.units === type; - } - /** - * Make sure the value is always in the defined range - */ - _assertRange(value) { - if (isDefined(this.maxValue) && isDefined(this.minValue)) { - assertRange(value, this._fromType(this.minValue), this._fromType(this.maxValue)); - } - return value; - } - /** - * Convert the given value from the type specified by Param.units - * into the destination value (such as Gain or Frequency). - */ - _fromType(val) { - if (this.convert && !this.overridden) { - if (this._is(val, "time")) { - return this.toSeconds(val); - } - else if (this._is(val, "decibels")) { - return dbToGain(val); - } - else if (this._is(val, "frequency")) { - return this.toFrequency(val); - } - else { - return val; - } - } - else if (this.overridden) { - // if it's overridden, should only schedule 0s - return 0; - } - else { - return val; - } - } - /** - * Convert the parameters value into the units specified by Param.units. - */ - _toType(val) { - if (this.convert && this.units === "decibels") { - return gainToDb(val); - } - else { - return val; - } - } - //------------------------------------- - // ABSTRACT PARAM INTERFACE - // all docs are generated from ParamInterface.ts - //------------------------------------- - setValueAtTime(value, time) { - const computedTime = this.toSeconds(time); - const numericValue = this._fromType(value); - assert(isFinite(numericValue) && isFinite(computedTime), `Invalid argument(s) to setValueAtTime: ${JSON.stringify(value)}, ${JSON.stringify(time)}`); - this._assertRange(numericValue); - this.log(this.units, "setValueAtTime", value, computedTime); - this._events.add({ - time: computedTime, - type: "setValueAtTime", - value: numericValue, - }); - this._param.setValueAtTime(numericValue, computedTime); - return this; - } - getValueAtTime(time) { - const computedTime = Math.max(this.toSeconds(time), 0); - const after = this._events.getAfter(computedTime); - const before = this._events.get(computedTime); - let value = this._initialValue; - // if it was set by - if (before === null) { - value = this._initialValue; - } - else if (before.type === "setTargetAtTime" && (after === null || after.type === "setValueAtTime")) { - const previous = this._events.getBefore(before.time); - let previousVal; - if (previous === null) { - previousVal = this._initialValue; - } - else { - previousVal = previous.value; - } - if (before.type === "setTargetAtTime") { - value = this._exponentialApproach(before.time, previousVal, before.value, before.constant, computedTime); - } - } - else if (after === null) { - value = before.value; - } - else if (after.type === "linearRampToValueAtTime" || after.type === "exponentialRampToValueAtTime") { - let beforeValue = before.value; - if (before.type === "setTargetAtTime") { - const previous = this._events.getBefore(before.time); - if (previous === null) { - beforeValue = this._initialValue; - } - else { - beforeValue = previous.value; - } - } - if (after.type === "linearRampToValueAtTime") { - value = this._linearInterpolate(before.time, beforeValue, after.time, after.value, computedTime); - } - else { - value = this._exponentialInterpolate(before.time, beforeValue, after.time, after.value, computedTime); - } - } - else { - value = before.value; - } - return this._toType(value); - } - setRampPoint(time) { - time = this.toSeconds(time); - let currentVal = this.getValueAtTime(time); - this.cancelAndHoldAtTime(time); - if (this._fromType(currentVal) === 0) { - currentVal = this._toType(this._minOutput); - } - this.setValueAtTime(currentVal, time); - return this; - } - linearRampToValueAtTime(value, endTime) { - const numericValue = this._fromType(value); - const computedTime = this.toSeconds(endTime); - assert(isFinite(numericValue) && isFinite(computedTime), `Invalid argument(s) to linearRampToValueAtTime: ${JSON.stringify(value)}, ${JSON.stringify(endTime)}`); - this._assertRange(numericValue); - this._events.add({ - time: computedTime, - type: "linearRampToValueAtTime", - value: numericValue, - }); - this.log(this.units, "linearRampToValueAtTime", value, computedTime); - this._param.linearRampToValueAtTime(numericValue, computedTime); - return this; - } - exponentialRampToValueAtTime(value, endTime) { - let numericValue = this._fromType(value); - // the value can't be 0 - numericValue = EQ(numericValue, 0) ? this._minOutput : numericValue; - this._assertRange(numericValue); - const computedTime = this.toSeconds(endTime); - assert(isFinite(numericValue) && isFinite(computedTime), `Invalid argument(s) to exponentialRampToValueAtTime: ${JSON.stringify(value)}, ${JSON.stringify(endTime)}`); - // store the event - this._events.add({ - time: computedTime, - type: "exponentialRampToValueAtTime", - value: numericValue, - }); - this.log(this.units, "exponentialRampToValueAtTime", value, computedTime); - this._param.exponentialRampToValueAtTime(numericValue, computedTime); - return this; - } - exponentialRampTo(value, rampTime, startTime) { - startTime = this.toSeconds(startTime); - this.setRampPoint(startTime); - this.exponentialRampToValueAtTime(value, startTime + this.toSeconds(rampTime)); - return this; - } - linearRampTo(value, rampTime, startTime) { - startTime = this.toSeconds(startTime); - this.setRampPoint(startTime); - this.linearRampToValueAtTime(value, startTime + this.toSeconds(rampTime)); - return this; - } - targetRampTo(value, rampTime, startTime) { - startTime = this.toSeconds(startTime); - this.setRampPoint(startTime); - this.exponentialApproachValueAtTime(value, startTime, rampTime); - return this; - } - exponentialApproachValueAtTime(value, time, rampTime) { - time = this.toSeconds(time); - rampTime = this.toSeconds(rampTime); - const timeConstant = Math.log(rampTime + 1) / Math.log(200); - this.setTargetAtTime(value, time, timeConstant); - // at 90% start a linear ramp to the final value - this.cancelAndHoldAtTime(time + rampTime * 0.9); - this.linearRampToValueAtTime(value, time + rampTime); - return this; - } - setTargetAtTime(value, startTime, timeConstant) { - const numericValue = this._fromType(value); - // The value will never be able to approach without timeConstant > 0. - assert(isFinite(timeConstant) && timeConstant > 0, "timeConstant must be a number greater than 0"); - const computedTime = this.toSeconds(startTime); - this._assertRange(numericValue); - assert(isFinite(numericValue) && isFinite(computedTime), `Invalid argument(s) to setTargetAtTime: ${JSON.stringify(value)}, ${JSON.stringify(startTime)}`); - this._events.add({ - constant: timeConstant, - time: computedTime, - type: "setTargetAtTime", - value: numericValue, - }); - this.log(this.units, "setTargetAtTime", value, computedTime, timeConstant); - this._param.setTargetAtTime(numericValue, computedTime, timeConstant); - return this; - } - setValueCurveAtTime(values, startTime, duration, scaling = 1) { - duration = this.toSeconds(duration); - startTime = this.toSeconds(startTime); - const startingValue = this._fromType(values[0]) * scaling; - this.setValueAtTime(this._toType(startingValue), startTime); - const segTime = duration / (values.length - 1); - for (let i = 1; i < values.length; i++) { - const numericValue = this._fromType(values[i]) * scaling; - this.linearRampToValueAtTime(this._toType(numericValue), startTime + i * segTime); - } - return this; - } - cancelScheduledValues(time) { - const computedTime = this.toSeconds(time); - assert(isFinite(computedTime), `Invalid argument to cancelScheduledValues: ${JSON.stringify(time)}`); - this._events.cancel(computedTime); - this._param.cancelScheduledValues(computedTime); - this.log(this.units, "cancelScheduledValues", computedTime); - return this; - } - cancelAndHoldAtTime(time) { - const computedTime = this.toSeconds(time); - const valueAtTime = this._fromType(this.getValueAtTime(computedTime)); - // remove the schedule events - assert(isFinite(computedTime), `Invalid argument to cancelAndHoldAtTime: ${JSON.stringify(time)}`); - this.log(this.units, "cancelAndHoldAtTime", computedTime, "value=" + valueAtTime); - // if there is an event at the given computedTime - // and that even is not a "set" - const before = this._events.get(computedTime); - const after = this._events.getAfter(computedTime); - if (before && EQ(before.time, computedTime)) { - // remove everything after - if (after) { - this._param.cancelScheduledValues(after.time); - this._events.cancel(after.time); - } - else { - this._param.cancelAndHoldAtTime(computedTime); - this._events.cancel(computedTime + this.sampleTime); - } - } - else if (after) { - this._param.cancelScheduledValues(after.time); - // cancel the next event(s) - this._events.cancel(after.time); - if (after.type === "linearRampToValueAtTime") { - this.linearRampToValueAtTime(this._toType(valueAtTime), computedTime); - } - else if (after.type === "exponentialRampToValueAtTime") { - this.exponentialRampToValueAtTime(this._toType(valueAtTime), computedTime); - } - } - // set the value at the given time - this._events.add({ - time: computedTime, - type: "setValueAtTime", - value: valueAtTime, - }); - this._param.setValueAtTime(valueAtTime, computedTime); - return this; - } - rampTo(value, rampTime = 0.1, startTime) { - if (this.units === "frequency" || this.units === "bpm" || this.units === "decibels") { - this.exponentialRampTo(value, rampTime, startTime); - } - else { - this.linearRampTo(value, rampTime, startTime); - } - return this; - } - /** - * Apply all of the previously scheduled events to the passed in Param or AudioParam. - * The applied values will start at the context's current time and schedule - * all of the events which are scheduled on this Param onto the passed in param. - */ - apply(param) { - const now = this.context.currentTime; - // set the param's value at the current time and schedule everything else - param.setValueAtTime(this.getValueAtTime(now), now); - // if the previous event was a curve, then set the rest of it - const previousEvent = this._events.get(now); - if (previousEvent && previousEvent.type === "setTargetAtTime") { - // approx it until the next event with linear ramps - const nextEvent = this._events.getAfter(previousEvent.time); - // or for 2 seconds if there is no event - const endTime = nextEvent ? nextEvent.time : now + 2; - const subdivisions = (endTime - now) / 10; - for (let i = now; i < endTime; i += subdivisions) { - param.linearRampToValueAtTime(this.getValueAtTime(i), i); - } - } - this._events.forEachAfter(this.context.currentTime, event => { - if (event.type === "cancelScheduledValues") { - param.cancelScheduledValues(event.time); - } - else if (event.type === "setTargetAtTime") { - param.setTargetAtTime(event.value, event.time, event.constant); - } - else { - param[event.type](event.value, event.time); - } - }); - return this; - } - /** - * Replace the Param's internal AudioParam. Will apply scheduled curves - * onto the parameter and replace the connections. - */ - setParam(param) { - assert(this._swappable, "The Param must be assigned as 'swappable' in the constructor"); - const input = this.input; - input.disconnect(this._param); - this.apply(param); - this._param = param; - input.connect(this._param); - return this; - } - dispose() { - super.dispose(); - this._events.dispose(); - return this; - } - get defaultValue() { - return this._toType(this._param.defaultValue); - } - //------------------------------------- - // AUTOMATION CURVE CALCULATIONS - // MIT License, copyright (c) 2014 Jordan Santell - //------------------------------------- - // Calculates the the value along the curve produced by setTargetAtTime - _exponentialApproach(t0, v0, v1, timeConstant, t) { - return v1 + (v0 - v1) * Math.exp(-(t - t0) / timeConstant); - } - // Calculates the the value along the curve produced by linearRampToValueAtTime - _linearInterpolate(t0, v0, t1, v1, t) { - return v0 + (v1 - v0) * ((t - t0) / (t1 - t0)); - } - // Calculates the the value along the curve produced by exponentialRampToValueAtTime - _exponentialInterpolate(t0, v0, t1, v1, t) { - return v0 * Math.pow(v1 / v0, (t - t0) / (t1 - t0)); - } -} - -/** - * ToneAudioNode is the base class for classes which process audio. - */ -class ToneAudioNode extends ToneWithContext { - constructor() { - super(...arguments); - /** - * The name of the class - */ - this.name = "ToneAudioNode"; - /** - * List all of the node that must be set to match the ChannelProperties - */ - this._internalChannels = []; - } - /** - * The number of inputs feeding into the AudioNode. - * For source nodes, this will be 0. - * @example - * const node = new Tone.Gain(); - * console.log(node.numberOfInputs); - */ - get numberOfInputs() { - if (isDefined(this.input)) { - if (isAudioParam(this.input) || this.input instanceof Param) { - return 1; - } - else { - return this.input.numberOfInputs; - } - } - else { - return 0; - } - } - /** - * The number of outputs of the AudioNode. - * @example - * const node = new Tone.Gain(); - * console.log(node.numberOfOutputs); - */ - get numberOfOutputs() { - if (isDefined(this.output)) { - return this.output.numberOfOutputs; - } - else { - return 0; - } - } - //------------------------------------- - // AUDIO PROPERTIES - //------------------------------------- - /** - * Used to decide which nodes to get/set properties on - */ - _isAudioNode(node) { - return isDefined(node) && (node instanceof ToneAudioNode || isAudioNode$1(node)); - } - /** - * Get all of the audio nodes (either internal or input/output) which together - * make up how the class node responds to channel input/output - */ - _getInternalNodes() { - const nodeList = this._internalChannels.slice(0); - if (this._isAudioNode(this.input)) { - nodeList.push(this.input); - } - if (this._isAudioNode(this.output)) { - if (this.input !== this.output) { - nodeList.push(this.output); - } - } - return nodeList; - } - /** - * Set the audio options for this node such as channelInterpretation - * channelCount, etc. - * @param options - */ - _setChannelProperties(options) { - const nodeList = this._getInternalNodes(); - nodeList.forEach(node => { - node.channelCount = options.channelCount; - node.channelCountMode = options.channelCountMode; - node.channelInterpretation = options.channelInterpretation; - }); - } - /** - * Get the current audio options for this node such as channelInterpretation - * channelCount, etc. - */ - _getChannelProperties() { - const nodeList = this._getInternalNodes(); - assert(nodeList.length > 0, "ToneAudioNode does not have any internal nodes"); - // use the first node to get properties - // they should all be the same - const node = nodeList[0]; - return { - channelCount: node.channelCount, - channelCountMode: node.channelCountMode, - channelInterpretation: node.channelInterpretation, - }; - } - /** - * channelCount is the number of channels used when up-mixing and down-mixing - * connections to any inputs to the node. The default value is 2 except for - * specific nodes where its value is specially determined. - */ - get channelCount() { - return this._getChannelProperties().channelCount; - } - set channelCount(channelCount) { - const props = this._getChannelProperties(); - // merge it with the other properties - this._setChannelProperties(Object.assign(props, { channelCount })); - } - /** - * channelCountMode determines how channels will be counted when up-mixing and - * down-mixing connections to any inputs to the node. - * The default value is "max". This attribute has no effect for nodes with no inputs. - * * "max" - computedNumberOfChannels is the maximum of the number of channels of all connections to an input. In this mode channelCount is ignored. - * * "clamped-max" - computedNumberOfChannels is determined as for "max" and then clamped to a maximum value of the given channelCount. - * * "explicit" - computedNumberOfChannels is the exact value as specified by the channelCount. - */ - get channelCountMode() { - return this._getChannelProperties().channelCountMode; - } - set channelCountMode(channelCountMode) { - const props = this._getChannelProperties(); - // merge it with the other properties - this._setChannelProperties(Object.assign(props, { channelCountMode })); - } - /** - * channelInterpretation determines how individual channels will be treated - * when up-mixing and down-mixing connections to any inputs to the node. - * The default value is "speakers". - */ - get channelInterpretation() { - return this._getChannelProperties().channelInterpretation; - } - set channelInterpretation(channelInterpretation) { - const props = this._getChannelProperties(); - // merge it with the other properties - this._setChannelProperties(Object.assign(props, { channelInterpretation })); - } - //------------------------------------- - // CONNECTIONS - //------------------------------------- - /** - * connect the output of a ToneAudioNode to an AudioParam, AudioNode, or ToneAudioNode - * @param destination The output to connect to - * @param outputNum The output to connect from - * @param inputNum The input to connect to - */ - connect(destination, outputNum = 0, inputNum = 0) { - connect(this, destination, outputNum, inputNum); - return this; - } - /** - * Connect the output to the context's destination node. - * @example - * const osc = new Tone.Oscillator("C2").start(); - * osc.toDestination(); - */ - toDestination() { - this.connect(this.context.destination); - return this; - } - /** - * Connect the output to the context's destination node. - * See [[toDestination]] - * @deprecated - */ - toMaster() { - warn("toMaster() has been renamed toDestination()"); - return this.toDestination(); - } - /** - * disconnect the output - */ - disconnect(destination, outputNum = 0, inputNum = 0) { - disconnect(this, destination, outputNum, inputNum); - return this; - } - /** - * Connect the output of this node to the rest of the nodes in series. - * @example - * const player = new Tone.Player("https://tonejs.github.io/audio/drum-samples/handdrum-loop.mp3"); - * player.autostart = true; - * const filter = new Tone.AutoFilter(4).start(); - * const distortion = new Tone.Distortion(0.5); - * // connect the player to the filter, distortion and then to the master output - * player.chain(filter, distortion, Tone.Destination); - */ - chain(...nodes) { - connectSeries(this, ...nodes); - return this; - } - /** - * connect the output of this node to the rest of the nodes in parallel. - * @example - * const player = new Tone.Player("https://tonejs.github.io/audio/drum-samples/conga-rhythm.mp3"); - * player.autostart = true; - * const pitchShift = new Tone.PitchShift(4).toDestination(); - * const filter = new Tone.Filter("G5").toDestination(); - * // connect a node to the pitch shift and filter in parallel - * player.fan(pitchShift, filter); - */ - fan(...nodes) { - nodes.forEach(node => this.connect(node)); - return this; - } - /** - * Dispose and disconnect - */ - dispose() { - super.dispose(); - if (isDefined(this.input)) { - if (this.input instanceof ToneAudioNode) { - this.input.dispose(); - } - else if (isAudioNode$1(this.input)) { - this.input.disconnect(); - } - } - if (isDefined(this.output)) { - if (this.output instanceof ToneAudioNode) { - this.output.dispose(); - } - else if (isAudioNode$1(this.output)) { - this.output.disconnect(); - } - } - this._internalChannels = []; - return this; - } -} -//------------------------------------- -// CONNECTIONS -//------------------------------------- -/** - * connect together all of the arguments in series - * @param nodes - */ -function connectSeries(...nodes) { - const first = nodes.shift(); - nodes.reduce((prev, current) => { - if (prev instanceof ToneAudioNode) { - prev.connect(current); - } - else if (isAudioNode$1(prev)) { - connect(prev, current); - } - return current; - }, first); -} -/** - * Connect two nodes together so that signal flows from the - * first node to the second. Optionally specify the input and output channels. - * @param srcNode The source node - * @param dstNode The destination node - * @param outputNumber The output channel of the srcNode - * @param inputNumber The input channel of the dstNode - */ -function connect(srcNode, dstNode, outputNumber = 0, inputNumber = 0) { - assert(isDefined(srcNode), "Cannot connect from undefined node"); - assert(isDefined(dstNode), "Cannot connect to undefined node"); - if (dstNode instanceof ToneAudioNode || isAudioNode$1(dstNode)) { - assert(dstNode.numberOfInputs > 0, "Cannot connect to node with no inputs"); - } - assert(srcNode.numberOfOutputs > 0, "Cannot connect from node with no outputs"); - // resolve the input of the dstNode - while ((dstNode instanceof ToneAudioNode || dstNode instanceof Param)) { - if (isDefined(dstNode.input)) { - dstNode = dstNode.input; - } - } - while (srcNode instanceof ToneAudioNode) { - if (isDefined(srcNode.output)) { - srcNode = srcNode.output; - } - } - // make the connection - if (isAudioParam(dstNode)) { - srcNode.connect(dstNode, outputNumber); - } - else { - srcNode.connect(dstNode, outputNumber, inputNumber); - } -} -/** - * Disconnect a node from all nodes or optionally include a destination node and input/output channels. - * @param srcNode The source node - * @param dstNode The destination node - * @param outputNumber The output channel of the srcNode - * @param inputNumber The input channel of the dstNode - */ -function disconnect(srcNode, dstNode, outputNumber = 0, inputNumber = 0) { - // resolve the destination node - if (isDefined(dstNode)) { - while (dstNode instanceof ToneAudioNode) { - dstNode = dstNode.input; - } - } - // resolve the src node - while (!(isAudioNode$1(srcNode))) { - if (isDefined(srcNode.output)) { - srcNode = srcNode.output; - } - } - if (isAudioParam(dstNode)) { - srcNode.disconnect(dstNode, outputNumber); - } - else if (isAudioNode$1(dstNode)) { - srcNode.disconnect(dstNode, outputNumber, inputNumber); - } - else { - srcNode.disconnect(); - } -} - -/** - * A thin wrapper around the Native Web Audio GainNode. - * The GainNode is a basic building block of the Web Audio - * API and is useful for routing audio and adjusting gains. - * @category Core - * @example - * return Tone.Offline(() => { - * const gainNode = new Tone.Gain(0).toDestination(); - * const osc = new Tone.Oscillator(30).connect(gainNode).start(); - * gainNode.gain.rampTo(1, 0.1); - * gainNode.gain.rampTo(0, 0.4, 0.2); - * }, 0.7, 1); - */ -class Gain extends ToneAudioNode { - constructor() { - super(optionsFromArguments(Gain.getDefaults(), arguments, ["gain", "units"])); - this.name = "Gain"; - /** - * The wrapped GainNode. - */ - this._gainNode = this.context.createGain(); - // input = output - this.input = this._gainNode; - this.output = this._gainNode; - const options = optionsFromArguments(Gain.getDefaults(), arguments, ["gain", "units"]); - this.gain = new Param({ - context: this.context, - convert: options.convert, - param: this._gainNode.gain, - units: options.units, - value: options.gain, - minValue: options.minValue, - maxValue: options.maxValue, - }); - readOnly(this, "gain"); - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - convert: true, - gain: 1, - units: "gain", - }); - } - /** - * Clean up. - */ - dispose() { - super.dispose(); - this._gainNode.disconnect(); - this.gain.dispose(); - return this; - } -} - -/** - * Base class for fire-and-forget nodes - */ -class OneShotSource extends ToneAudioNode { - constructor(options) { - super(options); - /** - * The callback to invoke after the - * source is done playing. - */ - this.onended = noOp; - /** - * The start time - */ - this._startTime = -1; - /** - * The stop time - */ - this._stopTime = -1; - /** - * The id of the timeout - */ - this._timeout = -1; - /** - * The public output node - */ - this.output = new Gain({ - context: this.context, - gain: 0, - }); - /** - * The output gain node. - */ - this._gainNode = this.output; - /** - * Get the playback state at the given time - */ - this.getStateAtTime = function (time) { - const computedTime = this.toSeconds(time); - if (this._startTime !== -1 && - computedTime >= this._startTime && - (this._stopTime === -1 || computedTime <= this._stopTime)) { - return "started"; - } - else { - return "stopped"; - } - }; - this._fadeIn = options.fadeIn; - this._fadeOut = options.fadeOut; - this._curve = options.curve; - this.onended = options.onended; - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - curve: "linear", - fadeIn: 0, - fadeOut: 0, - onended: noOp, - }); - } - /** - * Start the source at the given time - * @param time When to start the source - */ - _startGain(time, gain = 1) { - assert(this._startTime === -1, "Source cannot be started more than once"); - // apply a fade in envelope - const fadeInTime = this.toSeconds(this._fadeIn); - // record the start time - this._startTime = time + fadeInTime; - this._startTime = Math.max(this._startTime, this.context.currentTime); - // schedule the envelope - if (fadeInTime > 0) { - this._gainNode.gain.setValueAtTime(0, time); - if (this._curve === "linear") { - this._gainNode.gain.linearRampToValueAtTime(gain, time + fadeInTime); - } - else { - this._gainNode.gain.exponentialApproachValueAtTime(gain, time, fadeInTime); - } - } - else { - this._gainNode.gain.setValueAtTime(gain, time); - } - return this; - } - /** - * Stop the source node at the given time. - * @param time When to stop the source - */ - stop(time) { - this.log("stop", time); - this._stopGain(this.toSeconds(time)); - return this; - } - /** - * Stop the source at the given time - * @param time When to stop the source - */ - _stopGain(time) { - assert(this._startTime !== -1, "'start' must be called before 'stop'"); - // cancel the previous stop - this.cancelStop(); - // the fadeOut time - const fadeOutTime = this.toSeconds(this._fadeOut); - // schedule the stop callback - this._stopTime = this.toSeconds(time) + fadeOutTime; - this._stopTime = Math.max(this._stopTime, this.context.currentTime); - if (fadeOutTime > 0) { - // start the fade out curve at the given time - if (this._curve === "linear") { - this._gainNode.gain.linearRampTo(0, fadeOutTime, time); - } - else { - this._gainNode.gain.targetRampTo(0, fadeOutTime, time); - } - } - else { - // stop any ongoing ramps, and set the value to 0 - this._gainNode.gain.cancelAndHoldAtTime(time); - this._gainNode.gain.setValueAtTime(0, time); - } - this.context.clearTimeout(this._timeout); - this._timeout = this.context.setTimeout(() => { - // allow additional time for the exponential curve to fully decay - const additionalTail = this._curve === "exponential" ? fadeOutTime * 2 : 0; - this._stopSource(this.now() + additionalTail); - this._onended(); - }, this._stopTime - this.context.currentTime); - return this; - } - /** - * Invoke the onended callback - */ - _onended() { - if (this.onended !== noOp) { - this.onended(this); - // overwrite onended to make sure it only is called once - this.onended = noOp; - // dispose when it's ended to free up for garbage collection only in the online context - if (!this.context.isOffline) { - const disposeCallback = () => this.dispose(); - // @ts-ignore - if (typeof window.requestIdleCallback !== "undefined") { - // @ts-ignore - window.requestIdleCallback(disposeCallback); - } - else { - setTimeout(disposeCallback, 1000); - } - } - } - } - /** - * Get the playback state at the current time - */ - get state() { - return this.getStateAtTime(this.now()); - } - /** - * Cancel a scheduled stop event - */ - cancelStop() { - this.log("cancelStop"); - assert(this._startTime !== -1, "Source is not started"); - // cancel the stop envelope - this._gainNode.gain.cancelScheduledValues(this._startTime + this.sampleTime); - this.context.clearTimeout(this._timeout); - this._stopTime = -1; - return this; - } - dispose() { - super.dispose(); - this._gainNode.disconnect(); - return this; - } -} - -/** - * Wrapper around the native fire-and-forget ConstantSource. - * Adds the ability to reschedule the stop method. - * @category Signal - */ -class ToneConstantSource extends OneShotSource { - constructor() { - super(optionsFromArguments(ToneConstantSource.getDefaults(), arguments, ["offset"])); - this.name = "ToneConstantSource"; - /** - * The signal generator - */ - this._source = this.context.createConstantSource(); - const options = optionsFromArguments(ToneConstantSource.getDefaults(), arguments, ["offset"]); - connect(this._source, this._gainNode); - this.offset = new Param({ - context: this.context, - convert: options.convert, - param: this._source.offset, - units: options.units, - value: options.offset, - minValue: options.minValue, - maxValue: options.maxValue, - }); - } - static getDefaults() { - return Object.assign(OneShotSource.getDefaults(), { - convert: true, - offset: 1, - units: "number", - }); - } - /** - * Start the source node at the given time - * @param time When to start the source - */ - start(time) { - const computedTime = this.toSeconds(time); - this.log("start", computedTime); - this._startGain(computedTime); - this._source.start(computedTime); - return this; - } - _stopSource(time) { - this._source.stop(time); - } - dispose() { - super.dispose(); - if (this.state === "started") { - this.stop(); - } - this._source.disconnect(); - this.offset.dispose(); - return this; - } -} - -/** - * A signal is an audio-rate value. Tone.Signal is a core component of the library. - * Unlike a number, Signals can be scheduled with sample-level accuracy. Tone.Signal - * has all of the methods available to native Web Audio - * [AudioParam](http://webaudio.github.io/web-audio-api/#the-audioparam-interface) - * as well as additional conveniences. Read more about working with signals - * [here](https://github.com/Tonejs/Tone.js/wiki/Signals). - * - * @example - * const osc = new Tone.Oscillator().toDestination().start(); - * // a scheduleable signal which can be connected to control an AudioParam or another Signal - * const signal = new Tone.Signal({ - * value: "C4", - * units: "frequency" - * }).connect(osc.frequency); - * // the scheduled ramp controls the connected signal - * signal.rampTo("C2", 4, "+0.5"); - * @category Signal - */ -class Signal extends ToneAudioNode { - constructor() { - super(optionsFromArguments(Signal.getDefaults(), arguments, ["value", "units"])); - this.name = "Signal"; - /** - * Indicates if the value should be overridden on connection. - */ - this.override = true; - const options = optionsFromArguments(Signal.getDefaults(), arguments, ["value", "units"]); - this.output = this._constantSource = new ToneConstantSource({ - context: this.context, - convert: options.convert, - offset: options.value, - units: options.units, - minValue: options.minValue, - maxValue: options.maxValue, - }); - this._constantSource.start(0); - this.input = this._param = this._constantSource.offset; - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - convert: true, - units: "number", - value: 0, - }); - } - connect(destination, outputNum = 0, inputNum = 0) { - // start it only when connected to something - connectSignal(this, destination, outputNum, inputNum); - return this; - } - dispose() { - super.dispose(); - this._param.dispose(); - this._constantSource.dispose(); - return this; - } - //------------------------------------- - // ABSTRACT PARAM INTERFACE - // just a proxy for the ConstantSourceNode's offset AudioParam - // all docs are generated from AbstractParam.ts - //------------------------------------- - setValueAtTime(value, time) { - this._param.setValueAtTime(value, time); - return this; - } - getValueAtTime(time) { - return this._param.getValueAtTime(time); - } - setRampPoint(time) { - this._param.setRampPoint(time); - return this; - } - linearRampToValueAtTime(value, time) { - this._param.linearRampToValueAtTime(value, time); - return this; - } - exponentialRampToValueAtTime(value, time) { - this._param.exponentialRampToValueAtTime(value, time); - return this; - } - exponentialRampTo(value, rampTime, startTime) { - this._param.exponentialRampTo(value, rampTime, startTime); - return this; - } - linearRampTo(value, rampTime, startTime) { - this._param.linearRampTo(value, rampTime, startTime); - return this; - } - targetRampTo(value, rampTime, startTime) { - this._param.targetRampTo(value, rampTime, startTime); - return this; - } - exponentialApproachValueAtTime(value, time, rampTime) { - this._param.exponentialApproachValueAtTime(value, time, rampTime); - return this; - } - setTargetAtTime(value, startTime, timeConstant) { - this._param.setTargetAtTime(value, startTime, timeConstant); - return this; - } - setValueCurveAtTime(values, startTime, duration, scaling) { - this._param.setValueCurveAtTime(values, startTime, duration, scaling); - return this; - } - cancelScheduledValues(time) { - this._param.cancelScheduledValues(time); - return this; - } - cancelAndHoldAtTime(time) { - this._param.cancelAndHoldAtTime(time); - return this; - } - rampTo(value, rampTime, startTime) { - this._param.rampTo(value, rampTime, startTime); - return this; - } - get value() { - return this._param.value; - } - set value(value) { - this._param.value = value; - } - get convert() { - return this._param.convert; - } - set convert(convert) { - this._param.convert = convert; - } - get units() { - return this._param.units; - } - get overridden() { - return this._param.overridden; - } - set overridden(overridden) { - this._param.overridden = overridden; - } - get maxValue() { - return this._param.maxValue; - } - get minValue() { - return this._param.minValue; - } - /** - * See [[Param.apply]]. - */ - apply(param) { - this._param.apply(param); - return this; - } -} -/** - * When connecting from a signal, it's necessary to zero out the node destination - * node if that node is also a signal. If the destination is not 0, then the values - * will be summed. This method insures that the output of the destination signal will - * be the same as the source signal, making the destination signal a pass through node. - * @param signal The output signal to connect from - * @param destination the destination to connect to - * @param outputNum the optional output number - * @param inputNum the input number - */ -function connectSignal(signal, destination, outputNum, inputNum) { - if (destination instanceof Param || isAudioParam(destination) || - (destination instanceof Signal && destination.override)) { - // cancel changes - destination.cancelScheduledValues(0); - // reset the value - destination.setValueAtTime(0, 0); - // mark the value as overridden - if (destination instanceof Signal) { - destination.overridden = true; - } - } - connect(signal, destination, outputNum, inputNum); -} - -/** - * A Param class just for computing ticks. Similar to the [[Param]] class, - * but offers conversion to BPM values as well as ability to compute tick - * duration and elapsed ticks - */ -class TickParam extends Param { - constructor() { - super(optionsFromArguments(TickParam.getDefaults(), arguments, ["value"])); - this.name = "TickParam"; - /** - * The timeline which tracks all of the automations. - */ - this._events = new Timeline(Infinity); - /** - * The internal holder for the multiplier value - */ - this._multiplier = 1; - const options = optionsFromArguments(TickParam.getDefaults(), arguments, ["value"]); - // set the multiplier - this._multiplier = options.multiplier; - // clear the ticks from the beginning - this._events.cancel(0); - // set an initial event - this._events.add({ - ticks: 0, - time: 0, - type: "setValueAtTime", - value: this._fromType(options.value), - }); - this.setValueAtTime(options.value, 0); - } - static getDefaults() { - return Object.assign(Param.getDefaults(), { - multiplier: 1, - units: "hertz", - value: 1, - }); - } - setTargetAtTime(value, time, constant) { - // approximate it with multiple linear ramps - time = this.toSeconds(time); - this.setRampPoint(time); - const computedValue = this._fromType(value); - // start from previously scheduled value - const prevEvent = this._events.get(time); - const segments = Math.round(Math.max(1 / constant, 1)); - for (let i = 0; i <= segments; i++) { - const segTime = constant * i + time; - const rampVal = this._exponentialApproach(prevEvent.time, prevEvent.value, computedValue, constant, segTime); - this.linearRampToValueAtTime(this._toType(rampVal), segTime); - } - return this; - } - setValueAtTime(value, time) { - const computedTime = this.toSeconds(time); - super.setValueAtTime(value, time); - const event = this._events.get(computedTime); - const previousEvent = this._events.previousEvent(event); - const ticksUntilTime = this._getTicksUntilEvent(previousEvent, computedTime); - event.ticks = Math.max(ticksUntilTime, 0); - return this; - } - linearRampToValueAtTime(value, time) { - const computedTime = this.toSeconds(time); - super.linearRampToValueAtTime(value, time); - const event = this._events.get(computedTime); - const previousEvent = this._events.previousEvent(event); - const ticksUntilTime = this._getTicksUntilEvent(previousEvent, computedTime); - event.ticks = Math.max(ticksUntilTime, 0); - return this; - } - exponentialRampToValueAtTime(value, time) { - // aproximate it with multiple linear ramps - time = this.toSeconds(time); - const computedVal = this._fromType(value); - // start from previously scheduled value - const prevEvent = this._events.get(time); - // approx 10 segments per second - const segments = Math.round(Math.max((time - prevEvent.time) * 10, 1)); - const segmentDur = ((time - prevEvent.time) / segments); - for (let i = 0; i <= segments; i++) { - const segTime = segmentDur * i + prevEvent.time; - const rampVal = this._exponentialInterpolate(prevEvent.time, prevEvent.value, time, computedVal, segTime); - this.linearRampToValueAtTime(this._toType(rampVal), segTime); - } - return this; - } - /** - * Returns the tick value at the time. Takes into account - * any automation curves scheduled on the signal. - * @param event The time to get the tick count at - * @return The number of ticks which have elapsed at the time given any automations. - */ - _getTicksUntilEvent(event, time) { - if (event === null) { - event = { - ticks: 0, - time: 0, - type: "setValueAtTime", - value: 0, - }; - } - else if (isUndef(event.ticks)) { - const previousEvent = this._events.previousEvent(event); - event.ticks = this._getTicksUntilEvent(previousEvent, event.time); - } - const val0 = this._fromType(this.getValueAtTime(event.time)); - let val1 = this._fromType(this.getValueAtTime(time)); - // if it's right on the line, take the previous value - const onTheLineEvent = this._events.get(time); - if (onTheLineEvent && onTheLineEvent.time === time && onTheLineEvent.type === "setValueAtTime") { - val1 = this._fromType(this.getValueAtTime(time - this.sampleTime)); - } - return 0.5 * (time - event.time) * (val0 + val1) + event.ticks; - } - /** - * Returns the tick value at the time. Takes into account - * any automation curves scheduled on the signal. - * @param time The time to get the tick count at - * @return The number of ticks which have elapsed at the time given any automations. - */ - getTicksAtTime(time) { - const computedTime = this.toSeconds(time); - const event = this._events.get(computedTime); - return Math.max(this._getTicksUntilEvent(event, computedTime), 0); - } - /** - * Return the elapsed time of the number of ticks from the given time - * @param ticks The number of ticks to calculate - * @param time The time to get the next tick from - * @return The duration of the number of ticks from the given time in seconds - */ - getDurationOfTicks(ticks, time) { - const computedTime = this.toSeconds(time); - const currentTick = this.getTicksAtTime(time); - return this.getTimeOfTick(currentTick + ticks) - computedTime; - } - /** - * Given a tick, returns the time that tick occurs at. - * @return The time that the tick occurs. - */ - getTimeOfTick(tick) { - const before = this._events.get(tick, "ticks"); - const after = this._events.getAfter(tick, "ticks"); - if (before && before.ticks === tick) { - return before.time; - } - else if (before && after && - after.type === "linearRampToValueAtTime" && - before.value !== after.value) { - const val0 = this._fromType(this.getValueAtTime(before.time)); - const val1 = this._fromType(this.getValueAtTime(after.time)); - const delta = (val1 - val0) / (after.time - before.time); - const k = Math.sqrt(Math.pow(val0, 2) - 2 * delta * (before.ticks - tick)); - const sol1 = (-val0 + k) / delta; - const sol2 = (-val0 - k) / delta; - return (sol1 > 0 ? sol1 : sol2) + before.time; - } - else if (before) { - if (before.value === 0) { - return Infinity; - } - else { - return before.time + (tick - before.ticks) / before.value; - } - } - else { - return tick / this._initialValue; - } - } - /** - * Convert some number of ticks their the duration in seconds accounting - * for any automation curves starting at the given time. - * @param ticks The number of ticks to convert to seconds. - * @param when When along the automation timeline to convert the ticks. - * @return The duration in seconds of the ticks. - */ - ticksToTime(ticks, when) { - return this.getDurationOfTicks(ticks, when); - } - /** - * The inverse of [[ticksToTime]]. Convert a duration in - * seconds to the corresponding number of ticks accounting for any - * automation curves starting at the given time. - * @param duration The time interval to convert to ticks. - * @param when When along the automation timeline to convert the ticks. - * @return The duration in ticks. - */ - timeToTicks(duration, when) { - const computedTime = this.toSeconds(when); - const computedDuration = this.toSeconds(duration); - const startTicks = this.getTicksAtTime(computedTime); - const endTicks = this.getTicksAtTime(computedTime + computedDuration); - return endTicks - startTicks; - } - /** - * Convert from the type when the unit value is BPM - */ - _fromType(val) { - if (this.units === "bpm" && this.multiplier) { - return 1 / (60 / val / this.multiplier); - } - else { - return super._fromType(val); - } - } - /** - * Special case of type conversion where the units === "bpm" - */ - _toType(val) { - if (this.units === "bpm" && this.multiplier) { - return (val / this.multiplier) * 60; - } - else { - return super._toType(val); - } - } - /** - * A multiplier on the bpm value. Useful for setting a PPQ relative to the base frequency value. - */ - get multiplier() { - return this._multiplier; - } - set multiplier(m) { - // get and reset the current value with the new multiplier - // might be necessary to clear all the previous values - const currentVal = this.value; - this._multiplier = m; - this.cancelScheduledValues(0); - this.setValueAtTime(currentVal, 0); - } -} - -/** - * TickSignal extends Tone.Signal, but adds the capability - * to calculate the number of elapsed ticks. exponential and target curves - * are approximated with multiple linear ramps. - * - * Thank you Bruno Dias, H. Sofia Pinto, and David M. Matos, - * for your [WAC paper](https://smartech.gatech.edu/bitstream/handle/1853/54588/WAC2016-49.pdf) - * describing integrating timing functions for tempo calculations. - */ -class TickSignal extends Signal { - constructor() { - super(optionsFromArguments(TickSignal.getDefaults(), arguments, ["value"])); - this.name = "TickSignal"; - const options = optionsFromArguments(TickSignal.getDefaults(), arguments, ["value"]); - this.input = this._param = new TickParam({ - context: this.context, - convert: options.convert, - multiplier: options.multiplier, - param: this._constantSource.offset, - units: options.units, - value: options.value, - }); - } - static getDefaults() { - return Object.assign(Signal.getDefaults(), { - multiplier: 1, - units: "hertz", - value: 1, - }); - } - ticksToTime(ticks, when) { - return this._param.ticksToTime(ticks, when); - } - timeToTicks(duration, when) { - return this._param.timeToTicks(duration, when); - } - getTimeOfTick(tick) { - return this._param.getTimeOfTick(tick); - } - getDurationOfTicks(ticks, time) { - return this._param.getDurationOfTicks(ticks, time); - } - getTicksAtTime(time) { - return this._param.getTicksAtTime(time); - } - /** - * A multiplier on the bpm value. Useful for setting a PPQ relative to the base frequency value. - */ - get multiplier() { - return this._param.multiplier; - } - set multiplier(m) { - this._param.multiplier = m; - } - dispose() { - super.dispose(); - this._param.dispose(); - return this; - } -} - -/** - * Uses [TickSignal](TickSignal) to track elapsed ticks with complex automation curves. - */ -class TickSource extends ToneWithContext { - constructor() { - super(optionsFromArguments(TickSource.getDefaults(), arguments, ["frequency"])); - this.name = "TickSource"; - /** - * The state timeline - */ - this._state = new StateTimeline(); - /** - * The offset values of the ticks - */ - this._tickOffset = new Timeline(); - const options = optionsFromArguments(TickSource.getDefaults(), arguments, ["frequency"]); - this.frequency = new TickSignal({ - context: this.context, - units: options.units, - value: options.frequency, - }); - readOnly(this, "frequency"); - // set the initial state - this._state.setStateAtTime("stopped", 0); - // add the first event - this.setTicksAtTime(0, 0); - } - static getDefaults() { - return Object.assign({ - frequency: 1, - units: "hertz", - }, ToneWithContext.getDefaults()); - } - /** - * Returns the playback state of the source, either "started", "stopped" or "paused". - */ - get state() { - return this.getStateAtTime(this.now()); - } - /** - * Start the clock at the given time. Optionally pass in an offset - * of where to start the tick counter from. - * @param time The time the clock should start - * @param offset The number of ticks to start the source at - */ - start(time, offset) { - const computedTime = this.toSeconds(time); - if (this._state.getValueAtTime(computedTime) !== "started") { - this._state.setStateAtTime("started", computedTime); - if (isDefined(offset)) { - this.setTicksAtTime(offset, computedTime); - } - } - return this; - } - /** - * Stop the clock. Stopping the clock resets the tick counter to 0. - * @param time The time when the clock should stop. - */ - stop(time) { - const computedTime = this.toSeconds(time); - // cancel the previous stop - if (this._state.getValueAtTime(computedTime) === "stopped") { - const event = this._state.get(computedTime); - if (event && event.time > 0) { - this._tickOffset.cancel(event.time); - this._state.cancel(event.time); - } - } - this._state.cancel(computedTime); - this._state.setStateAtTime("stopped", computedTime); - this.setTicksAtTime(0, computedTime); - return this; - } - /** - * Pause the clock. Pausing does not reset the tick counter. - * @param time The time when the clock should stop. - */ - pause(time) { - const computedTime = this.toSeconds(time); - if (this._state.getValueAtTime(computedTime) === "started") { - this._state.setStateAtTime("paused", computedTime); - } - return this; - } - /** - * Cancel start/stop/pause and setTickAtTime events scheduled after the given time. - * @param time When to clear the events after - */ - cancel(time) { - time = this.toSeconds(time); - this._state.cancel(time); - this._tickOffset.cancel(time); - return this; - } - /** - * Get the elapsed ticks at the given time - * @param time When to get the tick value - * @return The number of ticks - */ - getTicksAtTime(time) { - const computedTime = this.toSeconds(time); - const stopEvent = this._state.getLastState("stopped", computedTime); - // this event allows forEachBetween to iterate until the current time - const tmpEvent = { state: "paused", time: computedTime }; - this._state.add(tmpEvent); - // keep track of the previous offset event - let lastState = stopEvent; - let elapsedTicks = 0; - // iterate through all the events since the last stop - this._state.forEachBetween(stopEvent.time, computedTime + this.sampleTime, e => { - let periodStartTime = lastState.time; - // if there is an offset event in this period use that - const offsetEvent = this._tickOffset.get(e.time); - if (offsetEvent && offsetEvent.time >= lastState.time) { - elapsedTicks = offsetEvent.ticks; - periodStartTime = offsetEvent.time; - } - if (lastState.state === "started" && e.state !== "started") { - elapsedTicks += this.frequency.getTicksAtTime(e.time) - this.frequency.getTicksAtTime(periodStartTime); - } - lastState = e; - }); - // remove the temporary event - this._state.remove(tmpEvent); - // return the ticks - return elapsedTicks; - } - /** - * The number of times the callback was invoked. Starts counting at 0 - * and increments after the callback was invoked. Returns -1 when stopped. - */ - get ticks() { - return this.getTicksAtTime(this.now()); - } - set ticks(t) { - this.setTicksAtTime(t, this.now()); - } - /** - * The time since ticks=0 that the TickSource has been running. Accounts - * for tempo curves - */ - get seconds() { - return this.getSecondsAtTime(this.now()); - } - set seconds(s) { - const now = this.now(); - const ticks = this.frequency.timeToTicks(s, now); - this.setTicksAtTime(ticks, now); - } - /** - * Return the elapsed seconds at the given time. - * @param time When to get the elapsed seconds - * @return The number of elapsed seconds - */ - getSecondsAtTime(time) { - time = this.toSeconds(time); - const stopEvent = this._state.getLastState("stopped", time); - // this event allows forEachBetween to iterate until the current time - const tmpEvent = { state: "paused", time }; - this._state.add(tmpEvent); - // keep track of the previous offset event - let lastState = stopEvent; - let elapsedSeconds = 0; - // iterate through all the events since the last stop - this._state.forEachBetween(stopEvent.time, time + this.sampleTime, e => { - let periodStartTime = lastState.time; - // if there is an offset event in this period use that - const offsetEvent = this._tickOffset.get(e.time); - if (offsetEvent && offsetEvent.time >= lastState.time) { - elapsedSeconds = offsetEvent.seconds; - periodStartTime = offsetEvent.time; - } - if (lastState.state === "started" && e.state !== "started") { - elapsedSeconds += e.time - periodStartTime; - } - lastState = e; - }); - // remove the temporary event - this._state.remove(tmpEvent); - // return the ticks - return elapsedSeconds; - } - /** - * Set the clock's ticks at the given time. - * @param ticks The tick value to set - * @param time When to set the tick value - */ - setTicksAtTime(ticks, time) { - time = this.toSeconds(time); - this._tickOffset.cancel(time); - this._tickOffset.add({ - seconds: this.frequency.getDurationOfTicks(ticks, time), - ticks, - time, - }); - return this; - } - /** - * Returns the scheduled state at the given time. - * @param time The time to query. - */ - getStateAtTime(time) { - time = this.toSeconds(time); - return this._state.getValueAtTime(time); - } - /** - * Get the time of the given tick. The second argument - * is when to test before. Since ticks can be set (with setTicksAtTime) - * there may be multiple times for a given tick value. - * @param tick The tick number. - * @param before When to measure the tick value from. - * @return The time of the tick - */ - getTimeOfTick(tick, before = this.now()) { - const offset = this._tickOffset.get(before); - const event = this._state.get(before); - const startTime = Math.max(offset.time, event.time); - const absoluteTicks = this.frequency.getTicksAtTime(startTime) + tick - offset.ticks; - return this.frequency.getTimeOfTick(absoluteTicks); - } - /** - * Invoke the callback event at all scheduled ticks between the - * start time and the end time - * @param startTime The beginning of the search range - * @param endTime The end of the search range - * @param callback The callback to invoke with each tick - */ - forEachTickBetween(startTime, endTime, callback) { - // only iterate through the sections where it is "started" - let lastStateEvent = this._state.get(startTime); - this._state.forEachBetween(startTime, endTime, event => { - if (lastStateEvent && lastStateEvent.state === "started" && event.state !== "started") { - this.forEachTickBetween(Math.max(lastStateEvent.time, startTime), event.time - this.sampleTime, callback); - } - lastStateEvent = event; - }); - let error = null; - if (lastStateEvent && lastStateEvent.state === "started") { - const maxStartTime = Math.max(lastStateEvent.time, startTime); - // figure out the difference between the frequency ticks and the - const startTicks = this.frequency.getTicksAtTime(maxStartTime); - const ticksAtStart = this.frequency.getTicksAtTime(lastStateEvent.time); - const diff = startTicks - ticksAtStart; - let offset = Math.ceil(diff) - diff; - // guard against floating point issues - offset = EQ(offset, 1) ? 0 : offset; - let nextTickTime = this.frequency.getTimeOfTick(startTicks + offset); - while (nextTickTime < endTime) { - try { - callback(nextTickTime, Math.round(this.getTicksAtTime(nextTickTime))); - } - catch (e) { - error = e; - break; - } - nextTickTime += this.frequency.getDurationOfTicks(1, nextTickTime); - } - } - if (error) { - throw error; - } - return this; - } - /** - * Clean up - */ - dispose() { - super.dispose(); - this._state.dispose(); - this._tickOffset.dispose(); - this.frequency.dispose(); - return this; - } -} - -/** - * A sample accurate clock which provides a callback at the given rate. - * While the callback is not sample-accurate (it is still susceptible to - * loose JS timing), the time passed in as the argument to the callback - * is precise. For most applications, it is better to use Tone.Transport - * instead of the Clock by itself since you can synchronize multiple callbacks. - * @example - * // the callback will be invoked approximately once a second - * // and will print the time exactly once a second apart. - * const clock = new Tone.Clock(time => { - * console.log(time); - * }, 1); - * clock.start(); - * @category Core - */ -class Clock extends ToneWithContext { - constructor() { - super(optionsFromArguments(Clock.getDefaults(), arguments, ["callback", "frequency"])); - this.name = "Clock"; - /** - * The callback function to invoke at the scheduled tick. - */ - this.callback = noOp; - /** - * The last time the loop callback was invoked - */ - this._lastUpdate = 0; - /** - * Keep track of the playback state - */ - this._state = new StateTimeline("stopped"); - /** - * Context bound reference to the _loop method - * This is necessary to remove the event in the end. - */ - this._boundLoop = this._loop.bind(this); - const options = optionsFromArguments(Clock.getDefaults(), arguments, ["callback", "frequency"]); - this.callback = options.callback; - this._tickSource = new TickSource({ - context: this.context, - frequency: options.frequency, - units: options.units, - }); - this._lastUpdate = 0; - this.frequency = this._tickSource.frequency; - readOnly(this, "frequency"); - // add an initial state - this._state.setStateAtTime("stopped", 0); - // bind a callback to the worker thread - this.context.on("tick", this._boundLoop); - } - static getDefaults() { - return Object.assign(ToneWithContext.getDefaults(), { - callback: noOp, - frequency: 1, - units: "hertz", - }); - } - /** - * Returns the playback state of the source, either "started", "stopped" or "paused". - */ - get state() { - return this._state.getValueAtTime(this.now()); - } - /** - * Start the clock at the given time. Optionally pass in an offset - * of where to start the tick counter from. - * @param time The time the clock should start - * @param offset Where the tick counter starts counting from. - */ - start(time, offset) { - // make sure the context is running - assertContextRunning(this.context); - // start the loop - const computedTime = this.toSeconds(time); - this.log("start", computedTime); - if (this._state.getValueAtTime(computedTime) !== "started") { - this._state.setStateAtTime("started", computedTime); - this._tickSource.start(computedTime, offset); - if (computedTime < this._lastUpdate) { - this.emit("start", computedTime, offset); - } - } - return this; - } - /** - * Stop the clock. Stopping the clock resets the tick counter to 0. - * @param time The time when the clock should stop. - * @example - * const clock = new Tone.Clock(time => { - * console.log(time); - * }, 1); - * clock.start(); - * // stop the clock after 10 seconds - * clock.stop("+10"); - */ - stop(time) { - const computedTime = this.toSeconds(time); - this.log("stop", computedTime); - this._state.cancel(computedTime); - this._state.setStateAtTime("stopped", computedTime); - this._tickSource.stop(computedTime); - if (computedTime < this._lastUpdate) { - this.emit("stop", computedTime); - } - return this; - } - /** - * Pause the clock. Pausing does not reset the tick counter. - * @param time The time when the clock should stop. - */ - pause(time) { - const computedTime = this.toSeconds(time); - if (this._state.getValueAtTime(computedTime) === "started") { - this._state.setStateAtTime("paused", computedTime); - this._tickSource.pause(computedTime); - if (computedTime < this._lastUpdate) { - this.emit("pause", computedTime); - } - } - return this; - } - /** - * The number of times the callback was invoked. Starts counting at 0 - * and increments after the callback was invoked. - */ - get ticks() { - return Math.ceil(this.getTicksAtTime(this.now())); - } - set ticks(t) { - this._tickSource.ticks = t; - } - /** - * The time since ticks=0 that the Clock has been running. Accounts for tempo curves - */ - get seconds() { - return this._tickSource.seconds; - } - set seconds(s) { - this._tickSource.seconds = s; - } - /** - * Return the elapsed seconds at the given time. - * @param time When to get the elapsed seconds - * @return The number of elapsed seconds - */ - getSecondsAtTime(time) { - return this._tickSource.getSecondsAtTime(time); - } - /** - * Set the clock's ticks at the given time. - * @param ticks The tick value to set - * @param time When to set the tick value - */ - setTicksAtTime(ticks, time) { - this._tickSource.setTicksAtTime(ticks, time); - return this; - } - /** - * Get the time of the given tick. The second argument - * is when to test before. Since ticks can be set (with setTicksAtTime) - * there may be multiple times for a given tick value. - * @param tick The tick number. - * @param before When to measure the tick value from. - * @return The time of the tick - */ - getTimeOfTick(tick, before = this.now()) { - return this._tickSource.getTimeOfTick(tick, before); - } - /** - * Get the clock's ticks at the given time. - * @param time When to get the tick value - * @return The tick value at the given time. - */ - getTicksAtTime(time) { - return this._tickSource.getTicksAtTime(time); - } - /** - * Get the time of the next tick - * @param offset The tick number. - */ - nextTickTime(offset, when) { - const computedTime = this.toSeconds(when); - const currentTick = this.getTicksAtTime(computedTime); - return this._tickSource.getTimeOfTick(currentTick + offset, computedTime); - } - /** - * The scheduling loop. - */ - _loop() { - const startTime = this._lastUpdate; - const endTime = this.now(); - this._lastUpdate = endTime; - this.log("loop", startTime, endTime); - if (startTime !== endTime) { - // the state change events - this._state.forEachBetween(startTime, endTime, e => { - switch (e.state) { - case "started": - const offset = this._tickSource.getTicksAtTime(e.time); - this.emit("start", e.time, offset); - break; - case "stopped": - if (e.time !== 0) { - this.emit("stop", e.time); - } - break; - case "paused": - this.emit("pause", e.time); - break; - } - }); - // the tick callbacks - this._tickSource.forEachTickBetween(startTime, endTime, (time, ticks) => { - this.callback(time, ticks); - }); - } - } - /** - * Returns the scheduled state at the given time. - * @param time The time to query. - * @return The name of the state input in setStateAtTime. - * @example - * const clock = new Tone.Clock(); - * clock.start("+0.1"); - * clock.getStateAtTime("+0.1"); // returns "started" - */ - getStateAtTime(time) { - const computedTime = this.toSeconds(time); - return this._state.getValueAtTime(computedTime); - } - /** - * Clean up - */ - dispose() { - super.dispose(); - this.context.off("tick", this._boundLoop); - this._tickSource.dispose(); - this._state.dispose(); - return this; - } -} -Emitter.mixin(Clock); - -/** - * A data structure for holding multiple buffers in a Map-like datastructure. - * - * @example - * const pianoSamples = new Tone.ToneAudioBuffers({ - * A1: "https://tonejs.github.io/audio/casio/A1.mp3", - * A2: "https://tonejs.github.io/audio/casio/A2.mp3", - * }, () => { - * const player = new Tone.Player().toDestination(); - * // play one of the samples when they all load - * player.buffer = pianoSamples.get("A2"); - * player.start(); - * }); - * @example - * // To pass in additional parameters in the second parameter - * const buffers = new Tone.ToneAudioBuffers({ - * urls: { - * A1: "A1.mp3", - * A2: "A2.mp3", - * }, - * onload: () => console.log("loaded"), - * baseUrl: "https://tonejs.github.io/audio/casio/" - * }); - * @category Core - */ -class ToneAudioBuffers extends Tone { - constructor() { - super(); - this.name = "ToneAudioBuffers"; - /** - * All of the buffers - */ - this._buffers = new Map(); - /** - * Keep track of the number of loaded buffers - */ - this._loadingCount = 0; - const options = optionsFromArguments(ToneAudioBuffers.getDefaults(), arguments, ["urls", "onload", "baseUrl"], "urls"); - this.baseUrl = options.baseUrl; - // add each one - Object.keys(options.urls).forEach(name => { - this._loadingCount++; - const url = options.urls[name]; - this.add(name, url, this._bufferLoaded.bind(this, options.onload), options.onerror); - }); - } - static getDefaults() { - return { - baseUrl: "", - onerror: noOp, - onload: noOp, - urls: {}, - }; - } - /** - * True if the buffers object has a buffer by that name. - * @param name The key or index of the buffer. - */ - has(name) { - return this._buffers.has(name.toString()); - } - /** - * Get a buffer by name. If an array was loaded, - * then use the array index. - * @param name The key or index of the buffer. - */ - get(name) { - assert(this.has(name), `ToneAudioBuffers has no buffer named: ${name}`); - return this._buffers.get(name.toString()); - } - /** - * A buffer was loaded. decrement the counter. - */ - _bufferLoaded(callback) { - this._loadingCount--; - if (this._loadingCount === 0 && callback) { - callback(); - } - } - /** - * If the buffers are loaded or not - */ - get loaded() { - return Array.from(this._buffers).every(([_, buffer]) => buffer.loaded); - } - /** - * Add a buffer by name and url to the Buffers - * @param name A unique name to give the buffer - * @param url Either the url of the bufer, or a buffer which will be added with the given name. - * @param callback The callback to invoke when the url is loaded. - * @param onerror Invoked if the buffer can't be loaded - */ - add(name, url, callback = noOp, onerror = noOp) { - if (isString(url)) { - this._buffers.set(name.toString(), new ToneAudioBuffer(this.baseUrl + url, callback, onerror)); - } - else { - this._buffers.set(name.toString(), new ToneAudioBuffer(url, callback, onerror)); - } - return this; - } - dispose() { - super.dispose(); - this._buffers.forEach(buffer => buffer.dispose()); - this._buffers.clear(); - return this; - } -} - -/** - * Midi is a primitive type for encoding Time values. - * Midi can be constructed with or without the `new` keyword. Midi can be passed - * into the parameter of any method which takes time as an argument. - * @category Unit - */ -class MidiClass extends FrequencyClass { - constructor() { - super(...arguments); - this.name = "MidiClass"; - this.defaultUnits = "midi"; - } - /** - * Returns the value of a frequency in the current units - */ - _frequencyToUnits(freq) { - return ftom(super._frequencyToUnits(freq)); - } - /** - * Returns the value of a tick in the current time units - */ - _ticksToUnits(ticks) { - return ftom(super._ticksToUnits(ticks)); - } - /** - * Return the value of the beats in the current units - */ - _beatsToUnits(beats) { - return ftom(super._beatsToUnits(beats)); - } - /** - * Returns the value of a second in the current units - */ - _secondsToUnits(seconds) { - return ftom(super._secondsToUnits(seconds)); - } - /** - * Return the value of the frequency as a MIDI note - * @example - * Tone.Midi(60).toMidi(); // 60 - */ - toMidi() { - return this.valueOf(); - } - /** - * Return the value of the frequency as a MIDI note - * @example - * Tone.Midi(60).toFrequency(); // 261.6255653005986 - */ - toFrequency() { - return mtof(this.toMidi()); - } - /** - * Transposes the frequency by the given number of semitones. - * @return A new transposed MidiClass - * @example - * Tone.Midi("A4").transpose(3); // "C5" - */ - transpose(interval) { - return new MidiClass(this.context, this.toMidi() + interval); - } -} -/** - * Convert a value into a FrequencyClass object. - * @category Unit - */ -function Midi(value, units) { - return new MidiClass(getContext(), value, units); -} - -/** - * Ticks is a primitive type for encoding Time values. - * Ticks can be constructed with or without the `new` keyword. Ticks can be passed - * into the parameter of any method which takes time as an argument. - * @example - * const t = Tone.Ticks("4n"); // a quarter note as ticks - * @category Unit - */ -class TicksClass extends TransportTimeClass { - constructor() { - super(...arguments); - this.name = "Ticks"; - this.defaultUnits = "i"; - } - /** - * Get the current time in the given units - */ - _now() { - return this.context.transport.ticks; - } - /** - * Return the value of the beats in the current units - */ - _beatsToUnits(beats) { - return this._getPPQ() * beats; - } - /** - * Returns the value of a second in the current units - */ - _secondsToUnits(seconds) { - return Math.floor(seconds / (60 / this._getBpm()) * this._getPPQ()); - } - /** - * Returns the value of a tick in the current time units - */ - _ticksToUnits(ticks) { - return ticks; - } - /** - * Return the time in ticks - */ - toTicks() { - return this.valueOf(); - } - /** - * Return the time in seconds - */ - toSeconds() { - return (this.valueOf() / this._getPPQ()) * (60 / this._getBpm()); - } -} -/** - * Convert a time representation to ticks - * @category Unit - */ -function Ticks(value, units) { - return new TicksClass(getContext(), value, units); -} - -/** - * Draw is useful for synchronizing visuals and audio events. - * Callbacks from Tone.Transport or any of the Tone.Event classes - * always happen _before_ the scheduled time and are not synchronized - * to the animation frame so they are not good for triggering tightly - * synchronized visuals and sound. Draw makes it easy to schedule - * callbacks using the AudioContext time and uses requestAnimationFrame. - * @example - * Tone.Transport.schedule((time) => { - * // use the time argument to schedule a callback with Draw - * Tone.Draw.schedule(() => { - * // do drawing or DOM manipulation here - * console.log(time); - * }, time); - * }, "+0.5"); - * Tone.Transport.start(); - * @category Core - */ -class Draw extends ToneWithContext { - constructor() { - super(...arguments); - this.name = "Draw"; - /** - * The duration after which events are not invoked. - */ - this.expiration = 0.25; - /** - * The amount of time before the scheduled time - * that the callback can be invoked. Default is - * half the time of an animation frame (0.008 seconds). - */ - this.anticipation = 0.008; - /** - * All of the events. - */ - this._events = new Timeline(); - /** - * The draw loop - */ - this._boundDrawLoop = this._drawLoop.bind(this); - /** - * The animation frame id - */ - this._animationFrame = -1; - } - /** - * Schedule a function at the given time to be invoked - * on the nearest animation frame. - * @param callback Callback is invoked at the given time. - * @param time The time relative to the AudioContext time to invoke the callback. - * @example - * Tone.Transport.scheduleRepeat(time => { - * Tone.Draw.schedule(() => console.log(time), time); - * }, 1); - * Tone.Transport.start(); - */ - schedule(callback, time) { - this._events.add({ - callback, - time: this.toSeconds(time), - }); - // start the draw loop on the first event - if (this._events.length === 1) { - this._animationFrame = requestAnimationFrame(this._boundDrawLoop); - } - return this; - } - /** - * Cancel events scheduled after the given time - * @param after Time after which scheduled events will be removed from the scheduling timeline. - */ - cancel(after) { - this._events.cancel(this.toSeconds(after)); - return this; - } - /** - * The draw loop - */ - _drawLoop() { - const now = this.context.currentTime; - while (this._events.length && this._events.peek().time - this.anticipation <= now) { - const event = this._events.shift(); - if (event && now - event.time <= this.expiration) { - event.callback(); - } - } - if (this._events.length > 0) { - this._animationFrame = requestAnimationFrame(this._boundDrawLoop); - } - } - dispose() { - super.dispose(); - this._events.dispose(); - cancelAnimationFrame(this._animationFrame); - return this; - } -} -//------------------------------------- -// INITIALIZATION -//------------------------------------- -onContextInit(context => { - context.draw = new Draw({ context }); -}); -onContextClose(context => { - context.draw.dispose(); -}); - -/** - * Similar to Tone.Timeline, but all events represent - * intervals with both "time" and "duration" times. The - * events are placed in a tree structure optimized - * for querying an intersection point with the timeline - * events. Internally uses an [Interval Tree](https://en.wikipedia.org/wiki/Interval_tree) - * to represent the data. - */ -class IntervalTimeline extends Tone { - constructor() { - super(...arguments); - this.name = "IntervalTimeline"; - /** - * The root node of the inteval tree - */ - this._root = null; - /** - * Keep track of the length of the timeline. - */ - this._length = 0; - } - /** - * The event to add to the timeline. All events must - * have a time and duration value - * @param event The event to add to the timeline - */ - add(event) { - assert(isDefined(event.time), "Events must have a time property"); - assert(isDefined(event.duration), "Events must have a duration parameter"); - event.time = event.time.valueOf(); - let node = new IntervalNode(event.time, event.time + event.duration, event); - if (this._root === null) { - this._root = node; - } - else { - this._root.insert(node); - } - this._length++; - // Restructure tree to be balanced - while (node !== null) { - node.updateHeight(); - node.updateMax(); - this._rebalance(node); - node = node.parent; - } - return this; - } - /** - * Remove an event from the timeline. - * @param event The event to remove from the timeline - */ - remove(event) { - if (this._root !== null) { - const results = []; - this._root.search(event.time, results); - for (const node of results) { - if (node.event === event) { - this._removeNode(node); - this._length--; - break; - } - } - } - return this; - } - /** - * The number of items in the timeline. - * @readOnly - */ - get length() { - return this._length; - } - /** - * Remove events whose time time is after the given time - * @param after The time to query. - */ - cancel(after) { - this.forEachFrom(after, event => this.remove(event)); - return this; - } - /** - * Set the root node as the given node - */ - _setRoot(node) { - this._root = node; - if (this._root !== null) { - this._root.parent = null; - } - } - /** - * Replace the references to the node in the node's parent - * with the replacement node. - */ - _replaceNodeInParent(node, replacement) { - if (node.parent !== null) { - if (node.isLeftChild()) { - node.parent.left = replacement; - } - else { - node.parent.right = replacement; - } - this._rebalance(node.parent); - } - else { - this._setRoot(replacement); - } - } - /** - * Remove the node from the tree and replace it with - * a successor which follows the schema. - */ - _removeNode(node) { - if (node.left === null && node.right === null) { - this._replaceNodeInParent(node, null); - } - else if (node.right === null) { - this._replaceNodeInParent(node, node.left); - } - else if (node.left === null) { - this._replaceNodeInParent(node, node.right); - } - else { - const balance = node.getBalance(); - let replacement; - let temp = null; - if (balance > 0) { - if (node.left.right === null) { - replacement = node.left; - replacement.right = node.right; - temp = replacement; - } - else { - replacement = node.left.right; - while (replacement.right !== null) { - replacement = replacement.right; - } - if (replacement.parent) { - replacement.parent.right = replacement.left; - temp = replacement.parent; - replacement.left = node.left; - replacement.right = node.right; - } - } - } - else if (node.right.left === null) { - replacement = node.right; - replacement.left = node.left; - temp = replacement; - } - else { - replacement = node.right.left; - while (replacement.left !== null) { - replacement = replacement.left; - } - if (replacement.parent) { - replacement.parent.left = replacement.right; - temp = replacement.parent; - replacement.left = node.left; - replacement.right = node.right; - } - } - if (node.parent !== null) { - if (node.isLeftChild()) { - node.parent.left = replacement; - } - else { - node.parent.right = replacement; - } - } - else { - this._setRoot(replacement); - } - if (temp) { - this._rebalance(temp); - } - } - node.dispose(); - } - /** - * Rotate the tree to the left - */ - _rotateLeft(node) { - const parent = node.parent; - const isLeftChild = node.isLeftChild(); - // Make node.right the new root of this sub tree (instead of node) - const pivotNode = node.right; - if (pivotNode) { - node.right = pivotNode.left; - pivotNode.left = node; - } - if (parent !== null) { - if (isLeftChild) { - parent.left = pivotNode; - } - else { - parent.right = pivotNode; - } - } - else { - this._setRoot(pivotNode); - } - } - /** - * Rotate the tree to the right - */ - _rotateRight(node) { - const parent = node.parent; - const isLeftChild = node.isLeftChild(); - // Make node.left the new root of this sub tree (instead of node) - const pivotNode = node.left; - if (pivotNode) { - node.left = pivotNode.right; - pivotNode.right = node; - } - if (parent !== null) { - if (isLeftChild) { - parent.left = pivotNode; - } - else { - parent.right = pivotNode; - } - } - else { - this._setRoot(pivotNode); - } - } - /** - * Balance the BST - */ - _rebalance(node) { - const balance = node.getBalance(); - if (balance > 1 && node.left) { - if (node.left.getBalance() < 0) { - this._rotateLeft(node.left); - } - else { - this._rotateRight(node); - } - } - else if (balance < -1 && node.right) { - if (node.right.getBalance() > 0) { - this._rotateRight(node.right); - } - else { - this._rotateLeft(node); - } - } - } - /** - * Get an event whose time and duration span the give time. Will - * return the match whose "time" value is closest to the given time. - * @return The event which spans the desired time - */ - get(time) { - if (this._root !== null) { - const results = []; - this._root.search(time, results); - if (results.length > 0) { - let max = results[0]; - for (let i = 1; i < results.length; i++) { - if (results[i].low > max.low) { - max = results[i]; - } - } - return max.event; - } - } - return null; - } - /** - * Iterate over everything in the timeline. - * @param callback The callback to invoke with every item - */ - forEach(callback) { - if (this._root !== null) { - const allNodes = []; - this._root.traverse(node => allNodes.push(node)); - allNodes.forEach(node => { - if (node.event) { - callback(node.event); - } - }); - } - return this; - } - /** - * Iterate over everything in the array in which the given time - * overlaps with the time and duration time of the event. - * @param time The time to check if items are overlapping - * @param callback The callback to invoke with every item - */ - forEachAtTime(time, callback) { - if (this._root !== null) { - const results = []; - this._root.search(time, results); - results.forEach(node => { - if (node.event) { - callback(node.event); - } - }); - } - return this; - } - /** - * Iterate over everything in the array in which the time is greater - * than or equal to the given time. - * @param time The time to check if items are before - * @param callback The callback to invoke with every item - */ - forEachFrom(time, callback) { - if (this._root !== null) { - const results = []; - this._root.searchAfter(time, results); - results.forEach(node => { - if (node.event) { - callback(node.event); - } - }); - } - return this; - } - /** - * Clean up - */ - dispose() { - super.dispose(); - if (this._root !== null) { - this._root.traverse(node => node.dispose()); - } - this._root = null; - return this; - } -} -//------------------------------------- -// INTERVAL NODE HELPER -//------------------------------------- -/** - * Represents a node in the binary search tree, with the addition - * of a "high" value which keeps track of the highest value of - * its children. - * References: - * https://brooknovak.wordpress.com/2013/12/07/augmented-interval-tree-in-c/ - * http://www.mif.vu.lt/~valdas/ALGORITMAI/LITERATURA/Cormen/Cormen.pdf - * @param low - * @param high - */ -class IntervalNode { - constructor(low, high, event) { - // the nodes to the left - this._left = null; - // the nodes to the right - this._right = null; - // the parent node - this.parent = null; - // the number of child nodes - this.height = 0; - this.event = event; - // the low value - this.low = low; - // the high value - this.high = high; - // the high value for this and all child nodes - this.max = this.high; - } - /** - * Insert a node into the correct spot in the tree - */ - insert(node) { - if (node.low <= this.low) { - if (this.left === null) { - this.left = node; - } - else { - this.left.insert(node); - } - } - else if (this.right === null) { - this.right = node; - } - else { - this.right.insert(node); - } - } - /** - * Search the tree for nodes which overlap - * with the given point - * @param point The point to query - * @param results The array to put the results - */ - search(point, results) { - // If p is to the right of the rightmost point of any interval - // in this node and all children, there won't be any matches. - if (point > this.max) { - return; - } - // Search left children - if (this.left !== null) { - this.left.search(point, results); - } - // Check this node - if (this.low <= point && this.high > point) { - results.push(this); - } - // If p is to the left of the time of this interval, - // then it can't be in any child to the right. - if (this.low > point) { - return; - } - // Search right children - if (this.right !== null) { - this.right.search(point, results); - } - } - /** - * Search the tree for nodes which are less - * than the given point - * @param point The point to query - * @param results The array to put the results - */ - searchAfter(point, results) { - // Check this node - if (this.low >= point) { - results.push(this); - if (this.left !== null) { - this.left.searchAfter(point, results); - } - } - // search the right side - if (this.right !== null) { - this.right.searchAfter(point, results); - } - } - /** - * Invoke the callback on this element and both it's branches - * @param {Function} callback - */ - traverse(callback) { - callback(this); - if (this.left !== null) { - this.left.traverse(callback); - } - if (this.right !== null) { - this.right.traverse(callback); - } - } - /** - * Update the height of the node - */ - updateHeight() { - if (this.left !== null && this.right !== null) { - this.height = Math.max(this.left.height, this.right.height) + 1; - } - else if (this.right !== null) { - this.height = this.right.height + 1; - } - else if (this.left !== null) { - this.height = this.left.height + 1; - } - else { - this.height = 0; - } - } - /** - * Update the height of the node - */ - updateMax() { - this.max = this.high; - if (this.left !== null) { - this.max = Math.max(this.max, this.left.max); - } - if (this.right !== null) { - this.max = Math.max(this.max, this.right.max); - } - } - /** - * The balance is how the leafs are distributed on the node - * @return Negative numbers are balanced to the right - */ - getBalance() { - let balance = 0; - if (this.left !== null && this.right !== null) { - balance = this.left.height - this.right.height; - } - else if (this.left !== null) { - balance = this.left.height + 1; - } - else if (this.right !== null) { - balance = -(this.right.height + 1); - } - return balance; - } - /** - * @returns true if this node is the left child of its parent - */ - isLeftChild() { - return this.parent !== null && this.parent.left === this; - } - /** - * get/set the left node - */ - get left() { - return this._left; - } - set left(node) { - this._left = node; - if (node !== null) { - node.parent = this; - } - this.updateHeight(); - this.updateMax(); - } - /** - * get/set the right node - */ - get right() { - return this._right; - } - set right(node) { - this._right = node; - if (node !== null) { - node.parent = this; - } - this.updateHeight(); - this.updateMax(); - } - /** - * null out references. - */ - dispose() { - this.parent = null; - this._left = null; - this._right = null; - this.event = null; - } -} - -/** - * Volume is a simple volume node, useful for creating a volume fader. - * - * @example - * const vol = new Tone.Volume(-12).toDestination(); - * const osc = new Tone.Oscillator().connect(vol).start(); - * @category Component - */ -class Volume extends ToneAudioNode { - constructor() { - super(optionsFromArguments(Volume.getDefaults(), arguments, ["volume"])); - this.name = "Volume"; - const options = optionsFromArguments(Volume.getDefaults(), arguments, ["volume"]); - this.input = this.output = new Gain({ - context: this.context, - gain: options.volume, - units: "decibels", - }); - this.volume = this.output.gain; - readOnly(this, "volume"); - this._unmutedVolume = options.volume; - // set the mute initially - this.mute = options.mute; - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - mute: false, - volume: 0, - }); - } - /** - * Mute the output. - * @example - * const vol = new Tone.Volume(-12).toDestination(); - * const osc = new Tone.Oscillator().connect(vol).start(); - * // mute the output - * vol.mute = true; - */ - get mute() { - return this.volume.value === -Infinity; - } - set mute(mute) { - if (!this.mute && mute) { - this._unmutedVolume = this.volume.value; - // maybe it should ramp here? - this.volume.value = -Infinity; - } - else if (this.mute && !mute) { - this.volume.value = this._unmutedVolume; - } - } - /** - * clean up - */ - dispose() { - super.dispose(); - this.input.dispose(); - this.volume.dispose(); - return this; - } -} - -/** - * A single master output which is connected to the - * AudioDestinationNode (aka your speakers). - * It provides useful conveniences such as the ability - * to set the volume and mute the entire application. - * It also gives you the ability to apply master effects to your application. - * - * @example - * const oscillator = new Tone.Oscillator().start(); - * // the audio will go from the oscillator to the speakers - * oscillator.connect(Tone.getDestination()); - * // a convenience for connecting to the master output is also provided: - * oscillator.toDestination(); - * @category Core - */ -class Destination extends ToneAudioNode { - constructor() { - super(optionsFromArguments(Destination.getDefaults(), arguments)); - this.name = "Destination"; - this.input = new Volume({ context: this.context }); - this.output = new Gain({ context: this.context }); - /** - * The volume of the master output in decibels. -Infinity is silent, and 0 is no change. - * @example - * const osc = new Tone.Oscillator().toDestination(); - * osc.start(); - * // ramp the volume down to silent over 10 seconds - * Tone.getDestination().volume.rampTo(-Infinity, 10); - */ - this.volume = this.input.volume; - const options = optionsFromArguments(Destination.getDefaults(), arguments); - connectSeries(this.input, this.output, this.context.rawContext.destination); - this.mute = options.mute; - this._internalChannels = [this.input, this.context.rawContext.destination, this.output]; - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - mute: false, - volume: 0, - }); - } - /** - * Mute the output. - * @example - * const oscillator = new Tone.Oscillator().start().toDestination(); - * setTimeout(() => { - * // mute the output - * Tone.Destination.mute = true; - * }, 1000); - */ - get mute() { - return this.input.mute; - } - set mute(mute) { - this.input.mute = mute; - } - /** - * Add a master effects chain. NOTE: this will disconnect any nodes which were previously - * chained in the master effects chain. - * @param args All arguments will be connected in a row and the Master will be routed through it. - * @example - * // route all audio through a filter and compressor - * const lowpass = new Tone.Filter(800, "lowpass"); - * const compressor = new Tone.Compressor(-18); - * Tone.Destination.chain(lowpass, compressor); - */ - chain(...args) { - this.input.disconnect(); - args.unshift(this.input); - args.push(this.output); - connectSeries(...args); - return this; - } - /** - * The maximum number of channels the system can output - * @example - * console.log(Tone.Destination.maxChannelCount); - */ - get maxChannelCount() { - return this.context.rawContext.destination.maxChannelCount; - } - /** - * Clean up - */ - dispose() { - super.dispose(); - this.volume.dispose(); - return this; - } -} -//------------------------------------- -// INITIALIZATION -//------------------------------------- -onContextInit(context => { - context.destination = new Destination({ context }); -}); -onContextClose(context => { - context.destination.dispose(); -}); - -/** - * Represents a single value which is gettable and settable in a timed way - */ -class TimelineValue extends Tone { - /** - * @param initialValue The value to return if there is no scheduled values - */ - constructor(initialValue) { - super(); - this.name = "TimelineValue"; - /** - * The timeline which stores the values - */ - this._timeline = new Timeline({ memory: 10 }); - this._initialValue = initialValue; - } - /** - * Set the value at the given time - */ - set(value, time) { - this._timeline.add({ - value, time - }); - return this; - } - /** - * Get the value at the given time - */ - get(time) { - const event = this._timeline.get(time); - if (event) { - return event.value; - } - else { - return this._initialValue; - } - } -} - -/** - * TransportEvent is an internal class used by [[Transport]] - * to schedule events. Do no invoke this class directly, it is - * handled from within Tone.Transport. - */ -class TransportEvent { - /** - * @param transport The transport object which the event belongs to - */ - constructor(transport, opts) { - /** - * The unique id of the event - */ - this.id = TransportEvent._eventId++; - const options = Object.assign(TransportEvent.getDefaults(), opts); - this.transport = transport; - this.callback = options.callback; - this._once = options.once; - this.time = options.time; - } - static getDefaults() { - return { - callback: noOp, - once: false, - time: 0, - }; - } - /** - * Invoke the event callback. - * @param time The AudioContext time in seconds of the event - */ - invoke(time) { - if (this.callback) { - this.callback(time); - if (this._once) { - this.transport.clear(this.id); - } - } - } - /** - * Clean up - */ - dispose() { - this.callback = undefined; - return this; - } -} -/** - * Current ID counter - */ -TransportEvent._eventId = 0; - -/** - * TransportRepeatEvent is an internal class used by Tone.Transport - * to schedule repeat events. This class should not be instantiated directly. - */ -class TransportRepeatEvent extends TransportEvent { - /** - * @param transport The transport object which the event belongs to - */ - constructor(transport, opts) { - super(transport, opts); - /** - * The ID of the current timeline event - */ - this._currentId = -1; - /** - * The ID of the next timeline event - */ - this._nextId = -1; - /** - * The time of the next event - */ - this._nextTick = this.time; - /** - * a reference to the bound start method - */ - this._boundRestart = this._restart.bind(this); - const options = Object.assign(TransportRepeatEvent.getDefaults(), opts); - this.duration = new TicksClass(transport.context, options.duration).valueOf(); - this._interval = new TicksClass(transport.context, options.interval).valueOf(); - this._nextTick = options.time; - this.transport.on("start", this._boundRestart); - this.transport.on("loopStart", this._boundRestart); - this.context = this.transport.context; - this._restart(); - } - static getDefaults() { - return Object.assign({}, TransportEvent.getDefaults(), { - duration: Infinity, - interval: 1, - once: false, - }); - } - /** - * Invoke the callback. Returns the tick time which - * the next event should be scheduled at. - * @param time The AudioContext time in seconds of the event - */ - invoke(time) { - // create more events if necessary - this._createEvents(time); - // call the super class - super.invoke(time); - } - /** - * Push more events onto the timeline to keep up with the position of the timeline - */ - _createEvents(time) { - // schedule the next event - const ticks = this.transport.getTicksAtTime(time); - if (ticks >= this.time && ticks >= this._nextTick && this._nextTick + this._interval < this.time + this.duration) { - this._nextTick += this._interval; - this._currentId = this._nextId; - this._nextId = this.transport.scheduleOnce(this.invoke.bind(this), new TicksClass(this.context, this._nextTick).toSeconds()); - } - } - /** - * Push more events onto the timeline to keep up with the position of the timeline - */ - _restart(time) { - this.transport.clear(this._currentId); - this.transport.clear(this._nextId); - this._nextTick = this.time; - const ticks = this.transport.getTicksAtTime(time); - if (ticks > this.time) { - this._nextTick = this.time + Math.ceil((ticks - this.time) / this._interval) * this._interval; - } - this._currentId = this.transport.scheduleOnce(this.invoke.bind(this), new TicksClass(this.context, this._nextTick).toSeconds()); - this._nextTick += this._interval; - this._nextId = this.transport.scheduleOnce(this.invoke.bind(this), new TicksClass(this.context, this._nextTick).toSeconds()); - } - /** - * Clean up - */ - dispose() { - super.dispose(); - this.transport.clear(this._currentId); - this.transport.clear(this._nextId); - this.transport.off("start", this._boundRestart); - this.transport.off("loopStart", this._boundRestart); - return this; - } -} - -/** - * Transport for timing musical events. - * Supports tempo curves and time changes. Unlike browser-based timing (setInterval, requestAnimationFrame) - * Transport timing events pass in the exact time of the scheduled event - * in the argument of the callback function. Pass that time value to the object - * you're scheduling.

- * A single transport is created for you when the library is initialized. - *

- * The transport emits the events: "start", "stop", "pause", and "loop" which are - * called with the time of that event as the argument. - * - * @example - * const osc = new Tone.Oscillator().toDestination(); - * // repeated event every 8th note - * Tone.Transport.scheduleRepeat((time) => { - * // use the callback time to schedule events - * osc.start(time).stop(time + 0.1); - * }, "8n"); - * // transport must be started before it starts invoking events - * Tone.Transport.start(); - * @category Core - */ -class Transport extends ToneWithContext { - constructor() { - super(optionsFromArguments(Transport.getDefaults(), arguments)); - this.name = "Transport"; - //------------------------------------- - // LOOPING - //------------------------------------- - /** - * If the transport loops or not. - */ - this._loop = new TimelineValue(false); - /** - * The loop start position in ticks - */ - this._loopStart = 0; - /** - * The loop end position in ticks - */ - this._loopEnd = 0; - //------------------------------------- - // TIMELINE EVENTS - //------------------------------------- - /** - * All the events in an object to keep track by ID - */ - this._scheduledEvents = {}; - /** - * The scheduled events. - */ - this._timeline = new Timeline(); - /** - * Repeated events - */ - this._repeatedEvents = new IntervalTimeline(); - /** - * All of the synced Signals - */ - this._syncedSignals = []; - /** - * The swing amount - */ - this._swingAmount = 0; - const options = optionsFromArguments(Transport.getDefaults(), arguments); - // CLOCK/TEMPO - this._ppq = options.ppq; - this._clock = new Clock({ - callback: this._processTick.bind(this), - context: this.context, - frequency: 0, - units: "bpm", - }); - this._bindClockEvents(); - this.bpm = this._clock.frequency; - this._clock.frequency.multiplier = options.ppq; - this.bpm.setValueAtTime(options.bpm, 0); - readOnly(this, "bpm"); - this._timeSignature = options.timeSignature; - // SWING - this._swingTicks = options.ppq / 2; // 8n - } - static getDefaults() { - return Object.assign(ToneWithContext.getDefaults(), { - bpm: 120, - loopEnd: "4m", - loopStart: 0, - ppq: 192, - swing: 0, - swingSubdivision: "8n", - timeSignature: 4, - }); - } - //------------------------------------- - // TICKS - //------------------------------------- - /** - * called on every tick - * @param tickTime clock relative tick time - */ - _processTick(tickTime, ticks) { - // do the loop test - if (this._loop.get(tickTime)) { - if (ticks >= this._loopEnd) { - this.emit("loopEnd", tickTime); - this._clock.setTicksAtTime(this._loopStart, tickTime); - ticks = this._loopStart; - this.emit("loopStart", tickTime, this._clock.getSecondsAtTime(tickTime)); - this.emit("loop", tickTime); - } - } - // handle swing - if (this._swingAmount > 0 && - ticks % this._ppq !== 0 && // not on a downbeat - ticks % (this._swingTicks * 2) !== 0) { - // add some swing - const progress = (ticks % (this._swingTicks * 2)) / (this._swingTicks * 2); - const amount = Math.sin((progress) * Math.PI) * this._swingAmount; - tickTime += new TicksClass(this.context, this._swingTicks * 2 / 3).toSeconds() * amount; - } - // invoke the timeline events scheduled on this tick - this._timeline.forEachAtTime(ticks, event => event.invoke(tickTime)); - } - //------------------------------------- - // SCHEDULABLE EVENTS - //------------------------------------- - /** - * Schedule an event along the timeline. - * @param callback The callback to be invoked at the time. - * @param time The time to invoke the callback at. - * @return The id of the event which can be used for canceling the event. - * @example - * // schedule an event on the 16th measure - * Tone.Transport.schedule((time) => { - * // invoked on measure 16 - * console.log("measure 16!"); - * }, "16:0:0"); - */ - schedule(callback, time) { - const event = new TransportEvent(this, { - callback, - time: new TransportTimeClass(this.context, time).toTicks(), - }); - return this._addEvent(event, this._timeline); - } - /** - * Schedule a repeated event along the timeline. The event will fire - * at the `interval` starting at the `startTime` and for the specified - * `duration`. - * @param callback The callback to invoke. - * @param interval The duration between successive callbacks. Must be a positive number. - * @param startTime When along the timeline the events should start being invoked. - * @param duration How long the event should repeat. - * @return The ID of the scheduled event. Use this to cancel the event. - * @example - * const osc = new Tone.Oscillator().toDestination().start(); - * // a callback invoked every eighth note after the first measure - * Tone.Transport.scheduleRepeat((time) => { - * osc.start(time).stop(time + 0.1); - * }, "8n", "1m"); - */ - scheduleRepeat(callback, interval, startTime, duration = Infinity) { - const event = new TransportRepeatEvent(this, { - callback, - duration: new TimeClass(this.context, duration).toTicks(), - interval: new TimeClass(this.context, interval).toTicks(), - time: new TransportTimeClass(this.context, startTime).toTicks(), - }); - // kick it off if the Transport is started - // @ts-ignore - return this._addEvent(event, this._repeatedEvents); - } - /** - * Schedule an event that will be removed after it is invoked. - * @param callback The callback to invoke once. - * @param time The time the callback should be invoked. - * @returns The ID of the scheduled event. - */ - scheduleOnce(callback, time) { - const event = new TransportEvent(this, { - callback, - once: true, - time: new TransportTimeClass(this.context, time).toTicks(), - }); - return this._addEvent(event, this._timeline); - } - /** - * Clear the passed in event id from the timeline - * @param eventId The id of the event. - */ - clear(eventId) { - if (this._scheduledEvents.hasOwnProperty(eventId)) { - const item = this._scheduledEvents[eventId.toString()]; - item.timeline.remove(item.event); - item.event.dispose(); - delete this._scheduledEvents[eventId.toString()]; - } - return this; - } - /** - * Add an event to the correct timeline. Keep track of the - * timeline it was added to. - * @returns the event id which was just added - */ - _addEvent(event, timeline) { - this._scheduledEvents[event.id.toString()] = { - event, - timeline, - }; - timeline.add(event); - return event.id; - } - /** - * Remove scheduled events from the timeline after - * the given time. Repeated events will be removed - * if their startTime is after the given time - * @param after Clear all events after this time. - */ - cancel(after = 0) { - const computedAfter = this.toTicks(after); - this._timeline.forEachFrom(computedAfter, event => this.clear(event.id)); - this._repeatedEvents.forEachFrom(computedAfter, event => this.clear(event.id)); - return this; - } - //------------------------------------- - // START/STOP/PAUSE - //------------------------------------- - /** - * Bind start/stop/pause events from the clock and emit them. - */ - _bindClockEvents() { - this._clock.on("start", (time, offset) => { - offset = new TicksClass(this.context, offset).toSeconds(); - this.emit("start", time, offset); - }); - this._clock.on("stop", (time) => { - this.emit("stop", time); - }); - this._clock.on("pause", (time) => { - this.emit("pause", time); - }); - } - /** - * Returns the playback state of the source, either "started", "stopped", or "paused" - */ - get state() { - return this._clock.getStateAtTime(this.now()); - } - /** - * Start the transport and all sources synced to the transport. - * @param time The time when the transport should start. - * @param offset The timeline offset to start the transport. - * @example - * // start the transport in one second starting at beginning of the 5th measure. - * Tone.Transport.start("+1", "4:0:0"); - */ - start(time, offset) { - let offsetTicks; - if (isDefined(offset)) { - offsetTicks = this.toTicks(offset); - } - // start the clock - this._clock.start(time, offsetTicks); - return this; - } - /** - * Stop the transport and all sources synced to the transport. - * @param time The time when the transport should stop. - * @example - * Tone.Transport.stop(); - */ - stop(time) { - this._clock.stop(time); - return this; - } - /** - * Pause the transport and all sources synced to the transport. - */ - pause(time) { - this._clock.pause(time); - return this; - } - /** - * Toggle the current state of the transport. If it is - * started, it will stop it, otherwise it will start the Transport. - * @param time The time of the event - */ - toggle(time) { - time = this.toSeconds(time); - if (this._clock.getStateAtTime(time) !== "started") { - this.start(time); - } - else { - this.stop(time); - } - return this; - } - //------------------------------------- - // SETTERS/GETTERS - //------------------------------------- - /** - * The time signature as just the numerator over 4. - * For example 4/4 would be just 4 and 6/8 would be 3. - * @example - * // common time - * Tone.Transport.timeSignature = 4; - * // 7/8 - * Tone.Transport.timeSignature = [7, 8]; - * // this will be reduced to a single number - * Tone.Transport.timeSignature; // returns 3.5 - */ - get timeSignature() { - return this._timeSignature; - } - set timeSignature(timeSig) { - if (isArray(timeSig)) { - timeSig = (timeSig[0] / timeSig[1]) * 4; - } - this._timeSignature = timeSig; - } - /** - * When the Transport.loop = true, this is the starting position of the loop. - */ - get loopStart() { - return new TimeClass(this.context, this._loopStart, "i").toSeconds(); - } - set loopStart(startPosition) { - this._loopStart = this.toTicks(startPosition); - } - /** - * When the Transport.loop = true, this is the ending position of the loop. - */ - get loopEnd() { - return new TimeClass(this.context, this._loopEnd, "i").toSeconds(); - } - set loopEnd(endPosition) { - this._loopEnd = this.toTicks(endPosition); - } - /** - * If the transport loops or not. - */ - get loop() { - return this._loop.get(this.now()); - } - set loop(loop) { - this._loop.set(loop, this.now()); - } - /** - * Set the loop start and stop at the same time. - * @example - * // loop over the first measure - * Tone.Transport.setLoopPoints(0, "1m"); - * Tone.Transport.loop = true; - */ - setLoopPoints(startPosition, endPosition) { - this.loopStart = startPosition; - this.loopEnd = endPosition; - return this; - } - /** - * The swing value. Between 0-1 where 1 equal to the note + half the subdivision. - */ - get swing() { - return this._swingAmount; - } - set swing(amount) { - // scale the values to a normal range - this._swingAmount = amount; - } - /** - * Set the subdivision which the swing will be applied to. - * The default value is an 8th note. Value must be less - * than a quarter note. - */ - get swingSubdivision() { - return new TicksClass(this.context, this._swingTicks).toNotation(); - } - set swingSubdivision(subdivision) { - this._swingTicks = this.toTicks(subdivision); - } - /** - * The Transport's position in Bars:Beats:Sixteenths. - * Setting the value will jump to that position right away. - */ - get position() { - const now = this.now(); - const ticks = this._clock.getTicksAtTime(now); - return new TicksClass(this.context, ticks).toBarsBeatsSixteenths(); - } - set position(progress) { - const ticks = this.toTicks(progress); - this.ticks = ticks; - } - /** - * The Transport's position in seconds - * Setting the value will jump to that position right away. - */ - get seconds() { - return this._clock.seconds; - } - set seconds(s) { - const now = this.now(); - const ticks = this._clock.frequency.timeToTicks(s, now); - this.ticks = ticks; - } - /** - * The Transport's loop position as a normalized value. Always - * returns 0 if the transport if loop is not true. - */ - get progress() { - if (this.loop) { - const now = this.now(); - const ticks = this._clock.getTicksAtTime(now); - return (ticks - this._loopStart) / (this._loopEnd - this._loopStart); - } - else { - return 0; - } - } - /** - * The transports current tick position. - */ - get ticks() { - return this._clock.ticks; - } - set ticks(t) { - if (this._clock.ticks !== t) { - const now = this.now(); - // stop everything synced to the transport - if (this.state === "started") { - const ticks = this._clock.getTicksAtTime(now); - // schedule to start on the next tick, #573 - const remainingTick = this._clock.frequency.getDurationOfTicks(Math.ceil(ticks) - ticks, now); - const time = now + remainingTick; - this.emit("stop", time); - this._clock.setTicksAtTime(t, time); - // restart it with the new time - this.emit("start", time, this._clock.getSecondsAtTime(time)); - } - else { - this._clock.setTicksAtTime(t, now); - } - } - } - /** - * Get the clock's ticks at the given time. - * @param time When to get the tick value - * @return The tick value at the given time. - */ - getTicksAtTime(time) { - return Math.round(this._clock.getTicksAtTime(time)); - } - /** - * Return the elapsed seconds at the given time. - * @param time When to get the elapsed seconds - * @return The number of elapsed seconds - */ - getSecondsAtTime(time) { - return this._clock.getSecondsAtTime(time); - } - /** - * Pulses Per Quarter note. This is the smallest resolution - * the Transport timing supports. This should be set once - * on initialization and not set again. Changing this value - * after other objects have been created can cause problems. - */ - get PPQ() { - return this._clock.frequency.multiplier; - } - set PPQ(ppq) { - this._clock.frequency.multiplier = ppq; - } - //------------------------------------- - // SYNCING - //------------------------------------- - /** - * Returns the time aligned to the next subdivision - * of the Transport. If the Transport is not started, - * it will return 0. - * Note: this will not work precisely during tempo ramps. - * @param subdivision The subdivision to quantize to - * @return The context time of the next subdivision. - * @example - * // the transport must be started, otherwise returns 0 - * Tone.Transport.start(); - * Tone.Transport.nextSubdivision("4n"); - */ - nextSubdivision(subdivision) { - subdivision = this.toTicks(subdivision); - if (this.state !== "started") { - // if the transport's not started, return 0 - return 0; - } - else { - const now = this.now(); - // the remainder of the current ticks and the subdivision - const transportPos = this.getTicksAtTime(now); - const remainingTicks = subdivision - transportPos % subdivision; - return this._clock.nextTickTime(remainingTicks, now); - } - } - /** - * Attaches the signal to the tempo control signal so that - * any changes in the tempo will change the signal in the same - * ratio. - * - * @param signal - * @param ratio Optionally pass in the ratio between the two signals. - * Otherwise it will be computed based on their current values. - */ - syncSignal(signal, ratio) { - if (!ratio) { - // get the sync ratio - const now = this.now(); - if (signal.getValueAtTime(now) !== 0) { - const bpm = this.bpm.getValueAtTime(now); - const computedFreq = 1 / (60 / bpm / this.PPQ); - ratio = signal.getValueAtTime(now) / computedFreq; - } - else { - ratio = 0; - } - } - const ratioSignal = new Gain(ratio); - // @ts-ignore - this.bpm.connect(ratioSignal); - // @ts-ignore - ratioSignal.connect(signal._param); - this._syncedSignals.push({ - initial: signal.value, - ratio: ratioSignal, - signal, - }); - signal.value = 0; - return this; - } - /** - * Unsyncs a previously synced signal from the transport's control. - * See Transport.syncSignal. - */ - unsyncSignal(signal) { - for (let i = this._syncedSignals.length - 1; i >= 0; i--) { - const syncedSignal = this._syncedSignals[i]; - if (syncedSignal.signal === signal) { - syncedSignal.ratio.dispose(); - syncedSignal.signal.value = syncedSignal.initial; - this._syncedSignals.splice(i, 1); - } - } - return this; - } - /** - * Clean up. - */ - dispose() { - super.dispose(); - this._clock.dispose(); - writable(this, "bpm"); - this._timeline.dispose(); - this._repeatedEvents.dispose(); - return this; - } -} -Emitter.mixin(Transport); -//------------------------------------- -// INITIALIZATION -//------------------------------------- -onContextInit(context => { - context.transport = new Transport({ context }); -}); -onContextClose(context => { - context.transport.dispose(); -}); - -/** - * Base class for sources. - * start/stop of this.context.transport. - * - * ``` - * // Multiple state change events can be chained together, - * // but must be set in the correct order and with ascending times - * // OK - * state.start().stop("+0.2"); - * // OK - * state.start().stop("+0.2").start("+0.4").stop("+0.7") - * // BAD - * state.stop("+0.2").start(); - * // BAD - * state.start("+0.3").stop("+0.2"); - * ``` - */ -class Source extends ToneAudioNode { - constructor(options) { - super(options); - /** - * Sources have no inputs - */ - this.input = undefined; - /** - * Keep track of the scheduled state. - */ - this._state = new StateTimeline("stopped"); - /** - * The synced `start` callback function from the transport - */ - this._synced = false; - /** - * Keep track of all of the scheduled event ids - */ - this._scheduled = []; - /** - * Placeholder functions for syncing/unsyncing to transport - */ - this._syncedStart = noOp; - this._syncedStop = noOp; - this._state.memory = 100; - this._state.increasing = true; - this._volume = this.output = new Volume({ - context: this.context, - mute: options.mute, - volume: options.volume, - }); - this.volume = this._volume.volume; - readOnly(this, "volume"); - this.onstop = options.onstop; - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - mute: false, - onstop: noOp, - volume: 0, - }); - } - /** - * Returns the playback state of the source, either "started" or "stopped". - * @example - * const player = new Tone.Player("https://tonejs.github.io/audio/berklee/ahntone_c3.mp3", () => { - * player.start(); - * console.log(player.state); - * }).toDestination(); - */ - get state() { - if (this._synced) { - if (this.context.transport.state === "started") { - return this._state.getValueAtTime(this.context.transport.seconds); - } - else { - return "stopped"; - } - } - else { - return this._state.getValueAtTime(this.now()); - } - } - /** - * Mute the output. - * @example - * const osc = new Tone.Oscillator().toDestination().start(); - * // mute the output - * osc.mute = true; - */ - get mute() { - return this._volume.mute; - } - set mute(mute) { - this._volume.mute = mute; - } - /** - * Ensure that the scheduled time is not before the current time. - * Should only be used when scheduled unsynced. - */ - _clampToCurrentTime(time) { - if (this._synced) { - return time; - } - else { - return Math.max(time, this.context.currentTime); - } - } - /** - * Start the source at the specified time. If no time is given, - * start the source now. - * @param time When the source should be started. - * @example - * const source = new Tone.Oscillator().toDestination(); - * source.start("+0.5"); // starts the source 0.5 seconds from now - */ - start(time, offset, duration) { - let computedTime = isUndef(time) && this._synced ? this.context.transport.seconds : this.toSeconds(time); - computedTime = this._clampToCurrentTime(computedTime); - // if it's started, stop it and restart it - if (!this._synced && this._state.getValueAtTime(computedTime) === "started") { - // time should be strictly greater than the previous start time - assert(GT(computedTime, this._state.get(computedTime).time), "Start time must be strictly greater than previous start time"); - this._state.cancel(computedTime); - this._state.setStateAtTime("started", computedTime); - this.log("restart", computedTime); - this.restart(computedTime, offset, duration); - } - else { - this.log("start", computedTime); - this._state.setStateAtTime("started", computedTime); - if (this._synced) { - // add the offset time to the event - const event = this._state.get(computedTime); - if (event) { - event.offset = this.toSeconds(defaultArg(offset, 0)); - event.duration = duration ? this.toSeconds(duration) : undefined; - } - const sched = this.context.transport.schedule(t => { - this._start(t, offset, duration); - }, computedTime); - this._scheduled.push(sched); - // if the transport is already started - // and the time is greater than where the transport is - if (this.context.transport.state === "started" && - this.context.transport.getSecondsAtTime(this.immediate()) > computedTime) { - this._syncedStart(this.now(), this.context.transport.seconds); - } - } - else { - assertContextRunning(this.context); - this._start(computedTime, offset, duration); - } - } - return this; - } - /** - * Stop the source at the specified time. If no time is given, - * stop the source now. - * @param time When the source should be stopped. - * @example - * const source = new Tone.Oscillator().toDestination(); - * source.start(); - * source.stop("+0.5"); // stops the source 0.5 seconds from now - */ - stop(time) { - let computedTime = isUndef(time) && this._synced ? this.context.transport.seconds : this.toSeconds(time); - computedTime = this._clampToCurrentTime(computedTime); - if (this._state.getValueAtTime(computedTime) === "started" || isDefined(this._state.getNextState("started", computedTime))) { - this.log("stop", computedTime); - if (!this._synced) { - this._stop(computedTime); - } - else { - const sched = this.context.transport.schedule(this._stop.bind(this), computedTime); - this._scheduled.push(sched); - } - this._state.cancel(computedTime); - this._state.setStateAtTime("stopped", computedTime); - } - return this; - } - /** - * Restart the source. - */ - restart(time, offset, duration) { - time = this.toSeconds(time); - if (this._state.getValueAtTime(time) === "started") { - this._state.cancel(time); - this._restart(time, offset, duration); - } - return this; - } - /** - * Sync the source to the Transport so that all subsequent - * calls to `start` and `stop` are synced to the TransportTime - * instead of the AudioContext time. - * - * @example - * const osc = new Tone.Oscillator().toDestination(); - * // sync the source so that it plays between 0 and 0.3 on the Transport's timeline - * osc.sync().start(0).stop(0.3); - * // start the transport. - * Tone.Transport.start(); - * // set it to loop once a second - * Tone.Transport.loop = true; - * Tone.Transport.loopEnd = 1; - */ - sync() { - if (!this._synced) { - this._synced = true; - this._syncedStart = (time, offset) => { - if (offset > 0) { - // get the playback state at that time - const stateEvent = this._state.get(offset); - // listen for start events which may occur in the middle of the sync'ed time - if (stateEvent && stateEvent.state === "started" && stateEvent.time !== offset) { - // get the offset - const startOffset = offset - this.toSeconds(stateEvent.time); - let duration; - if (stateEvent.duration) { - duration = this.toSeconds(stateEvent.duration) - startOffset; - } - this._start(time, this.toSeconds(stateEvent.offset) + startOffset, duration); - } - } - }; - this._syncedStop = time => { - const seconds = this.context.transport.getSecondsAtTime(Math.max(time - this.sampleTime, 0)); - if (this._state.getValueAtTime(seconds) === "started") { - this._stop(time); - } - }; - this.context.transport.on("start", this._syncedStart); - this.context.transport.on("loopStart", this._syncedStart); - this.context.transport.on("stop", this._syncedStop); - this.context.transport.on("pause", this._syncedStop); - this.context.transport.on("loopEnd", this._syncedStop); - } - return this; - } - /** - * Unsync the source to the Transport. See Source.sync - */ - unsync() { - if (this._synced) { - this.context.transport.off("stop", this._syncedStop); - this.context.transport.off("pause", this._syncedStop); - this.context.transport.off("loopEnd", this._syncedStop); - this.context.transport.off("start", this._syncedStart); - this.context.transport.off("loopStart", this._syncedStart); - } - this._synced = false; - // clear all of the scheduled ids - this._scheduled.forEach(id => this.context.transport.clear(id)); - this._scheduled = []; - this._state.cancel(0); - // stop it also - this._stop(0); - return this; - } - /** - * Clean up. - */ - dispose() { - super.dispose(); - this.onstop = noOp; - this.unsync(); - this._volume.dispose(); - this._state.dispose(); - return this; - } -} - -/** - * Wrapper around the native BufferSourceNode. - * @category Source - */ -class ToneBufferSource extends OneShotSource { - constructor() { - super(optionsFromArguments(ToneBufferSource.getDefaults(), arguments, ["url", "onload"])); - this.name = "ToneBufferSource"; - /** - * The oscillator - */ - this._source = this.context.createBufferSource(); - this._internalChannels = [this._source]; - /** - * indicators if the source has started/stopped - */ - this._sourceStarted = false; - this._sourceStopped = false; - const options = optionsFromArguments(ToneBufferSource.getDefaults(), arguments, ["url", "onload"]); - connect(this._source, this._gainNode); - this._source.onended = () => this._stopSource(); - /** - * The playbackRate of the buffer - */ - this.playbackRate = new Param({ - context: this.context, - param: this._source.playbackRate, - units: "positive", - value: options.playbackRate, - }); - // set some values initially - this.loop = options.loop; - this.loopStart = options.loopStart; - this.loopEnd = options.loopEnd; - this._buffer = new ToneAudioBuffer(options.url, options.onload, options.onerror); - this._internalChannels.push(this._source); - } - static getDefaults() { - return Object.assign(OneShotSource.getDefaults(), { - url: new ToneAudioBuffer(), - loop: false, - loopEnd: 0, - loopStart: 0, - onload: noOp, - onerror: noOp, - playbackRate: 1, - }); - } - /** - * The fadeIn time of the amplitude envelope. - */ - get fadeIn() { - return this._fadeIn; - } - set fadeIn(t) { - this._fadeIn = t; - } - /** - * The fadeOut time of the amplitude envelope. - */ - get fadeOut() { - return this._fadeOut; - } - set fadeOut(t) { - this._fadeOut = t; - } - /** - * The curve applied to the fades, either "linear" or "exponential" - */ - get curve() { - return this._curve; - } - set curve(t) { - this._curve = t; - } - /** - * Start the buffer - * @param time When the player should start. - * @param offset The offset from the beginning of the sample to start at. - * @param duration How long the sample should play. If no duration is given, it will default to the full length of the sample (minus any offset) - * @param gain The gain to play the buffer back at. - */ - start(time, offset, duration, gain = 1) { - assert(this.buffer.loaded, "buffer is either not set or not loaded"); - const computedTime = this.toSeconds(time); - // apply the gain envelope - this._startGain(computedTime, gain); - // if it's a loop the default offset is the loopstart point - if (this.loop) { - offset = defaultArg(offset, this.loopStart); - } - else { - // otherwise the default offset is 0 - offset = defaultArg(offset, 0); - } - // make sure the offset is not less than 0 - let computedOffset = Math.max(this.toSeconds(offset), 0); - // start the buffer source - if (this.loop) { - // modify the offset if it's greater than the loop time - const loopEnd = this.toSeconds(this.loopEnd) || this.buffer.duration; - const loopStart = this.toSeconds(this.loopStart); - const loopDuration = loopEnd - loopStart; - // move the offset back - if (GTE(computedOffset, loopEnd)) { - computedOffset = ((computedOffset - loopStart) % loopDuration) + loopStart; - } - // when the offset is very close to the duration, set it to 0 - if (EQ(computedOffset, this.buffer.duration)) { - computedOffset = 0; - } - } - // this.buffer.loaded would have return false if the AudioBuffer was undefined - this._source.buffer = this.buffer.get(); - this._source.loopEnd = this.toSeconds(this.loopEnd) || this.buffer.duration; - if (LT(computedOffset, this.buffer.duration)) { - this._sourceStarted = true; - this._source.start(computedTime, computedOffset); - } - // if a duration is given, schedule a stop - if (isDefined(duration)) { - let computedDur = this.toSeconds(duration); - // make sure it's never negative - computedDur = Math.max(computedDur, 0); - this.stop(computedTime + computedDur); - } - return this; - } - _stopSource(time) { - if (!this._sourceStopped && this._sourceStarted) { - this._sourceStopped = true; - this._source.stop(this.toSeconds(time)); - this._onended(); - } - } - /** - * If loop is true, the loop will start at this position. - */ - get loopStart() { - return this._source.loopStart; - } - set loopStart(loopStart) { - this._source.loopStart = this.toSeconds(loopStart); - } - /** - * If loop is true, the loop will end at this position. - */ - get loopEnd() { - return this._source.loopEnd; - } - set loopEnd(loopEnd) { - this._source.loopEnd = this.toSeconds(loopEnd); - } - /** - * The audio buffer belonging to the player. - */ - get buffer() { - return this._buffer; - } - set buffer(buffer) { - this._buffer.set(buffer); - } - /** - * If the buffer should loop once it's over. - */ - get loop() { - return this._source.loop; - } - set loop(loop) { - this._source.loop = loop; - if (this._sourceStarted) { - this.cancelStop(); - } - } - /** - * Clean up. - */ - dispose() { - super.dispose(); - this._source.onended = null; - this._source.disconnect(); - this._buffer.dispose(); - this.playbackRate.dispose(); - return this; - } -} - -/** - * Render a segment of the oscillator to an offline context and return the results as an array - */ -function generateWaveform(instance, length) { - return __awaiter(this, void 0, void 0, function* () { - const duration = length / instance.context.sampleRate; - const context = new OfflineContext(1, duration, instance.context.sampleRate); - const clone = new instance.constructor(Object.assign(instance.get(), { - // should do 2 iterations - frequency: 2 / duration, - // zero out the detune - detune: 0, - context - })).toDestination(); - clone.start(0); - const buffer = yield context.render(); - return buffer.getChannelData(0); - }); -} - -/** - * Wrapper around the native fire-and-forget OscillatorNode. - * Adds the ability to reschedule the stop method. - * ***[[Oscillator]] is better for most use-cases*** - * @category Source - */ -class ToneOscillatorNode extends OneShotSource { - constructor() { - super(optionsFromArguments(ToneOscillatorNode.getDefaults(), arguments, ["frequency", "type"])); - this.name = "ToneOscillatorNode"; - /** - * The oscillator - */ - this._oscillator = this.context.createOscillator(); - this._internalChannels = [this._oscillator]; - const options = optionsFromArguments(ToneOscillatorNode.getDefaults(), arguments, ["frequency", "type"]); - connect(this._oscillator, this._gainNode); - this.type = options.type; - this.frequency = new Param({ - context: this.context, - param: this._oscillator.frequency, - units: "frequency", - value: options.frequency, - }); - this.detune = new Param({ - context: this.context, - param: this._oscillator.detune, - units: "cents", - value: options.detune, - }); - readOnly(this, ["frequency", "detune"]); - } - static getDefaults() { - return Object.assign(OneShotSource.getDefaults(), { - detune: 0, - frequency: 440, - type: "sine", - }); - } - /** - * Start the oscillator node at the given time - * @param time When to start the oscillator - */ - start(time) { - const computedTime = this.toSeconds(time); - this.log("start", computedTime); - this._startGain(computedTime); - this._oscillator.start(computedTime); - return this; - } - _stopSource(time) { - this._oscillator.stop(time); - } - /** - * Sets an arbitrary custom periodic waveform given a PeriodicWave. - * @param periodicWave PeriodicWave should be created with context.createPeriodicWave - */ - setPeriodicWave(periodicWave) { - this._oscillator.setPeriodicWave(periodicWave); - return this; - } - /** - * The oscillator type. Either 'sine', 'sawtooth', 'square', or 'triangle' - */ - get type() { - return this._oscillator.type; - } - set type(type) { - this._oscillator.type = type; - } - /** - * Clean up. - */ - dispose() { - super.dispose(); - if (this.state === "started") { - this.stop(); - } - this._oscillator.disconnect(); - this.frequency.dispose(); - this.detune.dispose(); - return this; - } -} - -/** - * Oscillator supports a number of features including - * phase rotation, multiple oscillator types (see Oscillator.type), - * and Transport syncing (see Oscillator.syncFrequency). - * - * @example - * // make and start a 440hz sine tone - * const osc = new Tone.Oscillator(440, "sine").toDestination().start(); - * @category Source - */ -class Oscillator extends Source { - constructor() { - super(optionsFromArguments(Oscillator.getDefaults(), arguments, ["frequency", "type"])); - this.name = "Oscillator"; - /** - * the main oscillator - */ - this._oscillator = null; - const options = optionsFromArguments(Oscillator.getDefaults(), arguments, ["frequency", "type"]); - this.frequency = new Signal({ - context: this.context, - units: "frequency", - value: options.frequency, - }); - readOnly(this, "frequency"); - this.detune = new Signal({ - context: this.context, - units: "cents", - value: options.detune, - }); - readOnly(this, "detune"); - this._partials = options.partials; - this._partialCount = options.partialCount; - this._type = options.type; - if (options.partialCount && options.type !== "custom") { - this._type = this.baseType + options.partialCount.toString(); - } - this.phase = options.phase; - } - static getDefaults() { - return Object.assign(Source.getDefaults(), { - detune: 0, - frequency: 440, - partialCount: 0, - partials: [], - phase: 0, - type: "sine", - }); - } - /** - * start the oscillator - */ - _start(time) { - const computedTime = this.toSeconds(time); - // new oscillator with previous values - const oscillator = new ToneOscillatorNode({ - context: this.context, - onended: () => this.onstop(this), - }); - this._oscillator = oscillator; - if (this._wave) { - this._oscillator.setPeriodicWave(this._wave); - } - else { - this._oscillator.type = this._type; - } - // connect the control signal to the oscillator frequency & detune - this._oscillator.connect(this.output); - this.frequency.connect(this._oscillator.frequency); - this.detune.connect(this._oscillator.detune); - // start the oscillator - this._oscillator.start(computedTime); - } - /** - * stop the oscillator - */ - _stop(time) { - const computedTime = this.toSeconds(time); - if (this._oscillator) { - this._oscillator.stop(computedTime); - } - } - /** - * Restart the oscillator. Does not stop the oscillator, but instead - * just cancels any scheduled 'stop' from being invoked. - */ - _restart(time) { - const computedTime = this.toSeconds(time); - this.log("restart", computedTime); - if (this._oscillator) { - this._oscillator.cancelStop(); - } - this._state.cancel(computedTime); - return this; - } - /** - * Sync the signal to the Transport's bpm. Any changes to the transports bpm, - * will also affect the oscillators frequency. - * @example - * const osc = new Tone.Oscillator().toDestination().start(); - * osc.frequency.value = 440; - * // the ratio between the bpm and the frequency will be maintained - * osc.syncFrequency(); - * // double the tempo - * Tone.Transport.bpm.value *= 2; - * // the frequency of the oscillator is doubled to 880 - */ - syncFrequency() { - this.context.transport.syncSignal(this.frequency); - return this; - } - /** - * Unsync the oscillator's frequency from the Transport. - * See Oscillator.syncFrequency - */ - unsyncFrequency() { - this.context.transport.unsyncSignal(this.frequency); - return this; - } - /** - * Get a cached periodic wave. Avoids having to recompute - * the oscillator values when they have already been computed - * with the same values. - */ - _getCachedPeriodicWave() { - if (this._type === "custom") { - const oscProps = Oscillator._periodicWaveCache.find(description => { - return description.phase === this._phase && - deepEquals(description.partials, this._partials); - }); - return oscProps; - } - else { - const oscProps = Oscillator._periodicWaveCache.find(description => { - return description.type === this._type && - description.phase === this._phase; - }); - this._partialCount = oscProps ? oscProps.partialCount : this._partialCount; - return oscProps; - } - } - get type() { - return this._type; - } - set type(type) { - this._type = type; - const isBasicType = ["sine", "square", "sawtooth", "triangle"].indexOf(type) !== -1; - if (this._phase === 0 && isBasicType) { - this._wave = undefined; - this._partialCount = 0; - // just go with the basic approach - if (this._oscillator !== null) { - // already tested that it's a basic type - this._oscillator.type = type; - } - } - else { - // first check if the value is cached - const cache = this._getCachedPeriodicWave(); - if (isDefined(cache)) { - const { partials, wave } = cache; - this._wave = wave; - this._partials = partials; - if (this._oscillator !== null) { - this._oscillator.setPeriodicWave(this._wave); - } - } - else { - const [real, imag] = this._getRealImaginary(type, this._phase); - const periodicWave = this.context.createPeriodicWave(real, imag); - this._wave = periodicWave; - if (this._oscillator !== null) { - this._oscillator.setPeriodicWave(this._wave); - } - // set the cache - Oscillator._periodicWaveCache.push({ - imag, - partialCount: this._partialCount, - partials: this._partials, - phase: this._phase, - real, - type: this._type, - wave: this._wave, - }); - if (Oscillator._periodicWaveCache.length > 100) { - Oscillator._periodicWaveCache.shift(); - } - } - } - } - get baseType() { - return this._type.replace(this.partialCount.toString(), ""); - } - set baseType(baseType) { - if (this.partialCount && this._type !== "custom" && baseType !== "custom") { - this.type = baseType + this.partialCount; - } - else { - this.type = baseType; - } - } - get partialCount() { - return this._partialCount; - } - set partialCount(p) { - assertRange(p, 0); - let type = this._type; - const partial = /^(sine|triangle|square|sawtooth)(\d+)$/.exec(this._type); - if (partial) { - type = partial[1]; - } - if (this._type !== "custom") { - if (p === 0) { - this.type = type; - } - else { - this.type = type + p.toString(); - } - } - else { - // extend or shorten the partials array - const fullPartials = new Float32Array(p); - // copy over the partials array - this._partials.forEach((v, i) => fullPartials[i] = v); - this._partials = Array.from(fullPartials); - this.type = this._type; - } - } - /** - * Returns the real and imaginary components based - * on the oscillator type. - * @returns [real: Float32Array, imaginary: Float32Array] - */ - _getRealImaginary(type, phase) { - const fftSize = 4096; - let periodicWaveSize = fftSize / 2; - const real = new Float32Array(periodicWaveSize); - const imag = new Float32Array(periodicWaveSize); - let partialCount = 1; - if (type === "custom") { - partialCount = this._partials.length + 1; - this._partialCount = this._partials.length; - periodicWaveSize = partialCount; - // if the partial count is 0, don't bother doing any computation - if (this._partials.length === 0) { - return [real, imag]; - } - } - else { - const partial = /^(sine|triangle|square|sawtooth)(\d+)$/.exec(type); - if (partial) { - partialCount = parseInt(partial[2], 10) + 1; - this._partialCount = parseInt(partial[2], 10); - type = partial[1]; - partialCount = Math.max(partialCount, 2); - periodicWaveSize = partialCount; - } - else { - this._partialCount = 0; - } - this._partials = []; - } - for (let n = 1; n < periodicWaveSize; ++n) { - const piFactor = 2 / (n * Math.PI); - let b; - switch (type) { - case "sine": - b = (n <= partialCount) ? 1 : 0; - this._partials[n - 1] = b; - break; - case "square": - b = (n & 1) ? 2 * piFactor : 0; - this._partials[n - 1] = b; - break; - case "sawtooth": - b = piFactor * ((n & 1) ? 1 : -1); - this._partials[n - 1] = b; - break; - case "triangle": - if (n & 1) { - b = 2 * (piFactor * piFactor) * ((((n - 1) >> 1) & 1) ? -1 : 1); - } - else { - b = 0; - } - this._partials[n - 1] = b; - break; - case "custom": - b = this._partials[n - 1]; - break; - default: - throw new TypeError("Oscillator: invalid type: " + type); - } - if (b !== 0) { - real[n] = -b * Math.sin(phase * n); - imag[n] = b * Math.cos(phase * n); - } - else { - real[n] = 0; - imag[n] = 0; - } - } - return [real, imag]; - } - /** - * Compute the inverse FFT for a given phase. - */ - _inverseFFT(real, imag, phase) { - let sum = 0; - const len = real.length; - for (let i = 0; i < len; i++) { - sum += real[i] * Math.cos(i * phase) + imag[i] * Math.sin(i * phase); - } - return sum; - } - /** - * Returns the initial value of the oscillator when stopped. - * E.g. a "sine" oscillator with phase = 90 would return an initial value of -1. - */ - getInitialValue() { - const [real, imag] = this._getRealImaginary(this._type, 0); - let maxValue = 0; - const twoPi = Math.PI * 2; - const testPositions = 32; - // check for peaks in 16 places - for (let i = 0; i < testPositions; i++) { - maxValue = Math.max(this._inverseFFT(real, imag, (i / testPositions) * twoPi), maxValue); - } - return clamp(-this._inverseFFT(real, imag, this._phase) / maxValue, -1, 1); - } - get partials() { - return this._partials.slice(0, this.partialCount); - } - set partials(partials) { - this._partials = partials; - this._partialCount = this._partials.length; - if (partials.length) { - this.type = "custom"; - } - } - get phase() { - return this._phase * (180 / Math.PI); - } - set phase(phase) { - this._phase = phase * Math.PI / 180; - // reset the type - this.type = this._type; - } - asArray(length = 1024) { - return __awaiter(this, void 0, void 0, function* () { - return generateWaveform(this, length); - }); - } - dispose() { - super.dispose(); - if (this._oscillator !== null) { - this._oscillator.dispose(); - } - this._wave = undefined; - this.frequency.dispose(); - this.detune.dispose(); - return this; - } -} -/** - * Cache the periodic waves to avoid having to redo computations - */ -Oscillator._periodicWaveCache = []; - -/** - * A signal operator has an input and output and modifies the signal. - */ -class SignalOperator extends ToneAudioNode { - constructor() { - super(Object.assign(optionsFromArguments(SignalOperator.getDefaults(), arguments, ["context"]))); - } - connect(destination, outputNum = 0, inputNum = 0) { - connectSignal(this, destination, outputNum, inputNum); - return this; - } -} - -/** - * Wraps the native Web Audio API - * [WaveShaperNode](http://webaudio.github.io/web-audio-api/#the-waveshapernode-interface). - * - * @example - * const osc = new Tone.Oscillator().toDestination().start(); - * // multiply the output of the signal by 2 using the waveshaper's function - * const timesTwo = new Tone.WaveShaper((val) => val * 2, 2048).connect(osc.frequency); - * const signal = new Tone.Signal(440).connect(timesTwo); - * @category Signal - */ -class WaveShaper extends SignalOperator { - constructor() { - super(Object.assign(optionsFromArguments(WaveShaper.getDefaults(), arguments, ["mapping", "length"]))); - this.name = "WaveShaper"; - /** - * the waveshaper node - */ - this._shaper = this.context.createWaveShaper(); - /** - * The input to the waveshaper node. - */ - this.input = this._shaper; - /** - * The output from the waveshaper node - */ - this.output = this._shaper; - const options = optionsFromArguments(WaveShaper.getDefaults(), arguments, ["mapping", "length"]); - if (isArray(options.mapping) || options.mapping instanceof Float32Array) { - this.curve = Float32Array.from(options.mapping); - } - else if (isFunction(options.mapping)) { - this.setMap(options.mapping, options.length); - } - } - static getDefaults() { - return Object.assign(Signal.getDefaults(), { - length: 1024, - }); - } - /** - * Uses a mapping function to set the value of the curve. - * @param mapping The function used to define the values. - * The mapping function take two arguments: - * the first is the value at the current position - * which goes from -1 to 1 over the number of elements - * in the curve array. The second argument is the array position. - * @example - * const shaper = new Tone.WaveShaper(); - * // map the input signal from [-1, 1] to [0, 10] - * shaper.setMap((val, index) => (val + 1) * 5); - */ - setMap(mapping, length = 1024) { - const array = new Float32Array(length); - for (let i = 0, len = length; i < len; i++) { - const normalized = (i / (len - 1)) * 2 - 1; - array[i] = mapping(normalized, i); - } - this.curve = array; - return this; - } - /** - * The array to set as the waveshaper curve. For linear curves - * array length does not make much difference, but for complex curves - * longer arrays will provide smoother interpolation. - */ - get curve() { - return this._shaper.curve; - } - set curve(mapping) { - this._shaper.curve = mapping; - } - /** - * Specifies what type of oversampling (if any) should be used when - * applying the shaping curve. Can either be "none", "2x" or "4x". - */ - get oversample() { - return this._shaper.oversample; - } - set oversample(oversampling) { - const isOverSampleType = ["none", "2x", "4x"].some(str => str.includes(oversampling)); - assert(isOverSampleType, "oversampling must be either 'none', '2x', or '4x'"); - this._shaper.oversample = oversampling; - } - /** - * Clean up. - */ - dispose() { - super.dispose(); - this._shaper.disconnect(); - return this; - } -} - -/** - * AudioToGain converts an input in AudioRange [-1,1] to NormalRange [0,1]. - * See [[GainToAudio]]. - * @category Signal - */ -class AudioToGain extends SignalOperator { - constructor() { - super(...arguments); - this.name = "AudioToGain"; - /** - * The node which converts the audio ranges - */ - this._norm = new WaveShaper({ - context: this.context, - mapping: x => (x + 1) / 2, - }); - /** - * The AudioRange input [-1, 1] - */ - this.input = this._norm; - /** - * The GainRange output [0, 1] - */ - this.output = this._norm; - } - /** - * clean up - */ - dispose() { - super.dispose(); - this._norm.dispose(); - return this; - } -} - -/** - * Multiply two incoming signals. Or, if a number is given in the constructor, - * multiplies the incoming signal by that value. - * - * @example - * // multiply two signals - * const mult = new Tone.Multiply(); - * const sigA = new Tone.Signal(3); - * const sigB = new Tone.Signal(4); - * sigA.connect(mult); - * sigB.connect(mult.factor); - * // output of mult is 12. - * @example - * // multiply a signal and a number - * const mult = new Tone.Multiply(10); - * const sig = new Tone.Signal(2).connect(mult); - * // the output of mult is 20. - * @category Signal - */ -class Multiply extends Signal { - constructor() { - super(Object.assign(optionsFromArguments(Multiply.getDefaults(), arguments, ["value"]))); - this.name = "Multiply"; - /** - * Indicates if the value should be overridden on connection - */ - this.override = false; - const options = optionsFromArguments(Multiply.getDefaults(), arguments, ["value"]); - this._mult = this.input = this.output = new Gain({ - context: this.context, - minValue: options.minValue, - maxValue: options.maxValue, - }); - this.factor = this._param = this._mult.gain; - this.factor.setValueAtTime(options.value, 0); - } - static getDefaults() { - return Object.assign(Signal.getDefaults(), { - value: 0, - }); - } - dispose() { - super.dispose(); - this._mult.dispose(); - return this; - } -} - -/** - * An amplitude modulated oscillator node. It is implemented with - * two oscillators, one which modulators the other's amplitude - * through a gain node. - * ``` - * +-------------+ +----------+ - * | Carrier Osc +>------> GainNode | - * +-------------+ | +--->Output - * +---> gain | - * +---------------+ | +----------+ - * | Modulator Osc +>---+ - * +---------------+ - * ``` - * @example - * return Tone.Offline(() => { - * const amOsc = new Tone.AMOscillator(30, "sine", "square").toDestination().start(); - * }, 0.2, 1); - * @category Source - */ -class AMOscillator extends Source { - constructor() { - super(optionsFromArguments(AMOscillator.getDefaults(), arguments, ["frequency", "type", "modulationType"])); - this.name = "AMOscillator"; - /** - * convert the -1,1 output to 0,1 - */ - this._modulationScale = new AudioToGain({ context: this.context }); - /** - * the node where the modulation happens - */ - this._modulationNode = new Gain({ - context: this.context, - }); - const options = optionsFromArguments(AMOscillator.getDefaults(), arguments, ["frequency", "type", "modulationType"]); - this._carrier = new Oscillator({ - context: this.context, - detune: options.detune, - frequency: options.frequency, - onstop: () => this.onstop(this), - phase: options.phase, - type: options.type, - }); - this.frequency = this._carrier.frequency, - this.detune = this._carrier.detune; - this._modulator = new Oscillator({ - context: this.context, - phase: options.phase, - type: options.modulationType, - }); - this.harmonicity = new Multiply({ - context: this.context, - units: "positive", - value: options.harmonicity, - }); - // connections - this.frequency.chain(this.harmonicity, this._modulator.frequency); - this._modulator.chain(this._modulationScale, this._modulationNode.gain); - this._carrier.chain(this._modulationNode, this.output); - readOnly(this, ["frequency", "detune", "harmonicity"]); - } - static getDefaults() { - return Object.assign(Oscillator.getDefaults(), { - harmonicity: 1, - modulationType: "square", - }); - } - /** - * start the oscillator - */ - _start(time) { - this._modulator.start(time); - this._carrier.start(time); - } - /** - * stop the oscillator - */ - _stop(time) { - this._modulator.stop(time); - this._carrier.stop(time); - } - _restart(time) { - this._modulator.restart(time); - this._carrier.restart(time); - } - /** - * The type of the carrier oscillator - */ - get type() { - return this._carrier.type; - } - set type(type) { - this._carrier.type = type; - } - get baseType() { - return this._carrier.baseType; - } - set baseType(baseType) { - this._carrier.baseType = baseType; - } - get partialCount() { - return this._carrier.partialCount; - } - set partialCount(partialCount) { - this._carrier.partialCount = partialCount; - } - /** - * The type of the modulator oscillator - */ - get modulationType() { - return this._modulator.type; - } - set modulationType(type) { - this._modulator.type = type; - } - get phase() { - return this._carrier.phase; - } - set phase(phase) { - this._carrier.phase = phase; - this._modulator.phase = phase; - } - get partials() { - return this._carrier.partials; - } - set partials(partials) { - this._carrier.partials = partials; - } - asArray(length = 1024) { - return __awaiter(this, void 0, void 0, function* () { - return generateWaveform(this, length); - }); - } - /** - * Clean up. - */ - dispose() { - super.dispose(); - this.frequency.dispose(); - this.detune.dispose(); - this.harmonicity.dispose(); - this._carrier.dispose(); - this._modulator.dispose(); - this._modulationNode.dispose(); - this._modulationScale.dispose(); - return this; - } -} - -/** - * FMOscillator implements a frequency modulation synthesis - * ``` - * +-------------+ - * +---------------+ +-------------+ | Carrier Osc | - * | Modulator Osc +>-------> GainNode | | +--->Output - * +---------------+ | +>----> frequency | - * +--> gain | +-------------+ - * | +-------------+ - * +-----------------+ | - * | modulationIndex +>--+ - * +-----------------+ - * ``` - * - * @example - * return Tone.Offline(() => { - * const fmOsc = new Tone.FMOscillator({ - * frequency: 200, - * type: "square", - * modulationType: "triangle", - * harmonicity: 0.2, - * modulationIndex: 3 - * }).toDestination().start(); - * }, 0.1, 1); - * @category Source - */ -class FMOscillator extends Source { - constructor() { - super(optionsFromArguments(FMOscillator.getDefaults(), arguments, ["frequency", "type", "modulationType"])); - this.name = "FMOscillator"; - /** - * the node where the modulation happens - */ - this._modulationNode = new Gain({ - context: this.context, - gain: 0, - }); - const options = optionsFromArguments(FMOscillator.getDefaults(), arguments, ["frequency", "type", "modulationType"]); - this._carrier = new Oscillator({ - context: this.context, - detune: options.detune, - frequency: 0, - onstop: () => this.onstop(this), - phase: options.phase, - type: options.type, - }); - this.detune = this._carrier.detune; - this.frequency = new Signal({ - context: this.context, - units: "frequency", - value: options.frequency, - }); - this._modulator = new Oscillator({ - context: this.context, - phase: options.phase, - type: options.modulationType, - }); - this.harmonicity = new Multiply({ - context: this.context, - units: "positive", - value: options.harmonicity, - }); - this.modulationIndex = new Multiply({ - context: this.context, - units: "positive", - value: options.modulationIndex, - }); - // connections - this.frequency.connect(this._carrier.frequency); - this.frequency.chain(this.harmonicity, this._modulator.frequency); - this.frequency.chain(this.modulationIndex, this._modulationNode); - this._modulator.connect(this._modulationNode.gain); - this._modulationNode.connect(this._carrier.frequency); - this._carrier.connect(this.output); - this.detune.connect(this._modulator.detune); - readOnly(this, ["modulationIndex", "frequency", "detune", "harmonicity"]); - } - static getDefaults() { - return Object.assign(Oscillator.getDefaults(), { - harmonicity: 1, - modulationIndex: 2, - modulationType: "square", - }); - } - /** - * start the oscillator - */ - _start(time) { - this._modulator.start(time); - this._carrier.start(time); - } - /** - * stop the oscillator - */ - _stop(time) { - this._modulator.stop(time); - this._carrier.stop(time); - } - _restart(time) { - this._modulator.restart(time); - this._carrier.restart(time); - return this; - } - get type() { - return this._carrier.type; - } - set type(type) { - this._carrier.type = type; - } - get baseType() { - return this._carrier.baseType; - } - set baseType(baseType) { - this._carrier.baseType = baseType; - } - get partialCount() { - return this._carrier.partialCount; - } - set partialCount(partialCount) { - this._carrier.partialCount = partialCount; - } - /** - * The type of the modulator oscillator - */ - get modulationType() { - return this._modulator.type; - } - set modulationType(type) { - this._modulator.type = type; - } - get phase() { - return this._carrier.phase; - } - set phase(phase) { - this._carrier.phase = phase; - this._modulator.phase = phase; - } - get partials() { - return this._carrier.partials; - } - set partials(partials) { - this._carrier.partials = partials; - } - asArray(length = 1024) { - return __awaiter(this, void 0, void 0, function* () { - return generateWaveform(this, length); - }); - } - /** - * Clean up. - */ - dispose() { - super.dispose(); - this.frequency.dispose(); - this.harmonicity.dispose(); - this._carrier.dispose(); - this._modulator.dispose(); - this._modulationNode.dispose(); - this.modulationIndex.dispose(); - return this; - } -} - -/** - * PulseOscillator is an oscillator with control over pulse width, - * also known as the duty cycle. At 50% duty cycle (width = 0) the wave is - * a square wave. - * [Read more](https://wigglewave.wordpress.com/2014/08/16/pulse-waveforms-and-harmonics/). - * ``` - * width = -0.25 width = 0.0 width = 0.25 - * - * +-----+ +-------+ + +-------+ +-+ - * | | | | | | | - * | | | | | | | - * +-+ +-------+ + +-------+ +-----+ - * - * - * width = -0.5 width = 0.5 - * - * +---+ +-------+ +---+ - * | | | | - * | | | | - * +---+ +-------+ +---+ - * - * - * width = -0.75 width = 0.75 - * - * +-+ +-------+ +-----+ - * | | | | - * | | | | - * +-----+ +-------+ +-+ - * ``` - * @example - * return Tone.Offline(() => { - * const pulse = new Tone.PulseOscillator(50, 0.4).toDestination().start(); - * }, 0.1, 1); - * @category Source - */ -class PulseOscillator extends Source { - constructor() { - super(optionsFromArguments(PulseOscillator.getDefaults(), arguments, ["frequency", "width"])); - this.name = "PulseOscillator"; - /** - * gate the width amount - */ - this._widthGate = new Gain({ - context: this.context, - gain: 0, - }); - /** - * Threshold the signal to turn it into a square - */ - this._thresh = new WaveShaper({ - context: this.context, - mapping: val => val <= 0 ? -1 : 1, - }); - const options = optionsFromArguments(PulseOscillator.getDefaults(), arguments, ["frequency", "width"]); - this.width = new Signal({ - context: this.context, - units: "audioRange", - value: options.width, - }); - this._triangle = new Oscillator({ - context: this.context, - detune: options.detune, - frequency: options.frequency, - onstop: () => this.onstop(this), - phase: options.phase, - type: "triangle", - }); - this.frequency = this._triangle.frequency; - this.detune = this._triangle.detune; - // connections - this._triangle.chain(this._thresh, this.output); - this.width.chain(this._widthGate, this._thresh); - readOnly(this, ["width", "frequency", "detune"]); - } - static getDefaults() { - return Object.assign(Source.getDefaults(), { - detune: 0, - frequency: 440, - phase: 0, - type: "pulse", - width: 0.2, - }); - } - /** - * start the oscillator - */ - _start(time) { - time = this.toSeconds(time); - this._triangle.start(time); - this._widthGate.gain.setValueAtTime(1, time); - } - /** - * stop the oscillator - */ - _stop(time) { - time = this.toSeconds(time); - this._triangle.stop(time); - // the width is still connected to the output. - // that needs to be stopped also - this._widthGate.gain.cancelScheduledValues(time); - this._widthGate.gain.setValueAtTime(0, time); - } - _restart(time) { - this._triangle.restart(time); - this._widthGate.gain.cancelScheduledValues(time); - this._widthGate.gain.setValueAtTime(1, time); - } - /** - * The phase of the oscillator in degrees. - */ - get phase() { - return this._triangle.phase; - } - set phase(phase) { - this._triangle.phase = phase; - } - /** - * The type of the oscillator. Always returns "pulse". - */ - get type() { - return "pulse"; - } - /** - * The baseType of the oscillator. Always returns "pulse". - */ - get baseType() { - return "pulse"; - } - /** - * The partials of the waveform. Cannot set partials for this waveform type - */ - get partials() { - return []; - } - /** - * No partials for this waveform type. - */ - get partialCount() { - return 0; - } - /** - * *Internal use* The carrier oscillator type is fed through the - * waveshaper node to create the pulse. Using different carrier oscillators - * changes oscillator's behavior. - */ - set carrierType(type) { - this._triangle.type = type; - } - asArray(length = 1024) { - return __awaiter(this, void 0, void 0, function* () { - return generateWaveform(this, length); - }); - } - /** - * Clean up method. - */ - dispose() { - super.dispose(); - this._triangle.dispose(); - this.width.dispose(); - this._widthGate.dispose(); - this._thresh.dispose(); - return this; - } -} - -/** - * FatOscillator is an array of oscillators with detune spread between the oscillators - * @example - * const fatOsc = new Tone.FatOscillator("Ab3", "sawtooth", 40).toDestination().start(); - * @category Source - */ -class FatOscillator extends Source { - constructor() { - super(optionsFromArguments(FatOscillator.getDefaults(), arguments, ["frequency", "type", "spread"])); - this.name = "FatOscillator"; - /** - * The array of oscillators - */ - this._oscillators = []; - const options = optionsFromArguments(FatOscillator.getDefaults(), arguments, ["frequency", "type", "spread"]); - this.frequency = new Signal({ - context: this.context, - units: "frequency", - value: options.frequency, - }); - this.detune = new Signal({ - context: this.context, - units: "cents", - value: options.detune, - }); - this._spread = options.spread; - this._type = options.type; - this._phase = options.phase; - this._partials = options.partials; - this._partialCount = options.partialCount; - // set the count initially - this.count = options.count; - readOnly(this, ["frequency", "detune"]); - } - static getDefaults() { - return Object.assign(Oscillator.getDefaults(), { - count: 3, - spread: 20, - type: "sawtooth", - }); - } - /** - * start the oscillator - */ - _start(time) { - time = this.toSeconds(time); - this._forEach(osc => osc.start(time)); - } - /** - * stop the oscillator - */ - _stop(time) { - time = this.toSeconds(time); - this._forEach(osc => osc.stop(time)); - } - _restart(time) { - this._forEach(osc => osc.restart(time)); - } - /** - * Iterate over all of the oscillators - */ - _forEach(iterator) { - for (let i = 0; i < this._oscillators.length; i++) { - iterator(this._oscillators[i], i); - } - } - /** - * The type of the oscillator - */ - get type() { - return this._type; - } - set type(type) { - this._type = type; - this._forEach(osc => osc.type = type); - } - /** - * The detune spread between the oscillators. If "count" is - * set to 3 oscillators and the "spread" is set to 40, - * the three oscillators would be detuned like this: [-20, 0, 20] - * for a total detune spread of 40 cents. - * @example - * const fatOsc = new Tone.FatOscillator().toDestination().start(); - * fatOsc.spread = 70; - */ - get spread() { - return this._spread; - } - set spread(spread) { - this._spread = spread; - if (this._oscillators.length > 1) { - const start = -spread / 2; - const step = spread / (this._oscillators.length - 1); - this._forEach((osc, i) => osc.detune.value = start + step * i); - } - } - /** - * The number of detuned oscillators. Must be an integer greater than 1. - * @example - * const fatOsc = new Tone.FatOscillator("C#3", "sawtooth").toDestination().start(); - * // use 4 sawtooth oscillators - * fatOsc.count = 4; - */ - get count() { - return this._oscillators.length; - } - set count(count) { - assertRange(count, 1); - if (this._oscillators.length !== count) { - // dispose the previous oscillators - this._forEach(osc => osc.dispose()); - this._oscillators = []; - for (let i = 0; i < count; i++) { - const osc = new Oscillator({ - context: this.context, - volume: -6 - count * 1.1, - type: this._type, - phase: this._phase + (i / count) * 360, - partialCount: this._partialCount, - onstop: i === 0 ? () => this.onstop(this) : noOp, - }); - if (this.type === "custom") { - osc.partials = this._partials; - } - this.frequency.connect(osc.frequency); - this.detune.connect(osc.detune); - osc.detune.overridden = false; - osc.connect(this.output); - this._oscillators[i] = osc; - } - // set the spread - this.spread = this._spread; - if (this.state === "started") { - this._forEach(osc => osc.start()); - } - } - } - get phase() { - return this._phase; - } - set phase(phase) { - this._phase = phase; - this._forEach((osc, i) => osc.phase = this._phase + (i / this.count) * 360); - } - get baseType() { - return this._oscillators[0].baseType; - } - set baseType(baseType) { - this._forEach(osc => osc.baseType = baseType); - this._type = this._oscillators[0].type; - } - get partials() { - return this._oscillators[0].partials; - } - set partials(partials) { - this._partials = partials; - this._partialCount = this._partials.length; - if (partials.length) { - this._type = "custom"; - this._forEach(osc => osc.partials = partials); - } - } - get partialCount() { - return this._oscillators[0].partialCount; - } - set partialCount(partialCount) { - this._partialCount = partialCount; - this._forEach(osc => osc.partialCount = partialCount); - this._type = this._oscillators[0].type; - } - asArray(length = 1024) { - return __awaiter(this, void 0, void 0, function* () { - return generateWaveform(this, length); - }); - } - /** - * Clean up. - */ - dispose() { - super.dispose(); - this.frequency.dispose(); - this.detune.dispose(); - this._forEach(osc => osc.dispose()); - return this; - } -} - -/** - * PWMOscillator modulates the width of a Tone.PulseOscillator - * at the modulationFrequency. This has the effect of continuously - * changing the timbre of the oscillator by altering the harmonics - * generated. - * @example - * return Tone.Offline(() => { - * const pwm = new Tone.PWMOscillator(60, 0.3).toDestination().start(); - * }, 0.1, 1); - * @category Source - */ -class PWMOscillator extends Source { - constructor() { - super(optionsFromArguments(PWMOscillator.getDefaults(), arguments, ["frequency", "modulationFrequency"])); - this.name = "PWMOscillator"; - this.sourceType = "pwm"; - /** - * Scale the oscillator so it doesn't go silent - * at the extreme values. - */ - this._scale = new Multiply({ - context: this.context, - value: 2, - }); - const options = optionsFromArguments(PWMOscillator.getDefaults(), arguments, ["frequency", "modulationFrequency"]); - this._pulse = new PulseOscillator({ - context: this.context, - frequency: options.modulationFrequency, - }); - // change the pulse oscillator type - this._pulse.carrierType = "sine"; - this.modulationFrequency = this._pulse.frequency; - this._modulator = new Oscillator({ - context: this.context, - detune: options.detune, - frequency: options.frequency, - onstop: () => this.onstop(this), - phase: options.phase, - }); - this.frequency = this._modulator.frequency; - this.detune = this._modulator.detune; - // connections - this._modulator.chain(this._scale, this._pulse.width); - this._pulse.connect(this.output); - readOnly(this, ["modulationFrequency", "frequency", "detune"]); - } - static getDefaults() { - return Object.assign(Source.getDefaults(), { - detune: 0, - frequency: 440, - modulationFrequency: 0.4, - phase: 0, - type: "pwm", - }); - } - /** - * start the oscillator - */ - _start(time) { - time = this.toSeconds(time); - this._modulator.start(time); - this._pulse.start(time); - } - /** - * stop the oscillator - */ - _stop(time) { - time = this.toSeconds(time); - this._modulator.stop(time); - this._pulse.stop(time); - } - /** - * restart the oscillator - */ - _restart(time) { - this._modulator.restart(time); - this._pulse.restart(time); - } - /** - * The type of the oscillator. Always returns "pwm". - */ - get type() { - return "pwm"; - } - /** - * The baseType of the oscillator. Always returns "pwm". - */ - get baseType() { - return "pwm"; - } - /** - * The partials of the waveform. Cannot set partials for this waveform type - */ - get partials() { - return []; - } - /** - * No partials for this waveform type. - */ - get partialCount() { - return 0; - } - /** - * The phase of the oscillator in degrees. - */ - get phase() { - return this._modulator.phase; - } - set phase(phase) { - this._modulator.phase = phase; - } - asArray(length = 1024) { - return __awaiter(this, void 0, void 0, function* () { - return generateWaveform(this, length); - }); - } - /** - * Clean up. - */ - dispose() { - super.dispose(); - this._pulse.dispose(); - this._scale.dispose(); - this._modulator.dispose(); - return this; - } -} - -const OmniOscillatorSourceMap = { - am: AMOscillator, - fat: FatOscillator, - fm: FMOscillator, - oscillator: Oscillator, - pulse: PulseOscillator, - pwm: PWMOscillator, -}; -/** - * OmniOscillator aggregates all of the oscillator types into one. - * @example - * return Tone.Offline(() => { - * const omniOsc = new Tone.OmniOscillator("C#4", "pwm").toDestination().start(); - * }, 0.1, 1); - * @category Source - */ -class OmniOscillator extends Source { - constructor() { - super(optionsFromArguments(OmniOscillator.getDefaults(), arguments, ["frequency", "type"])); - this.name = "OmniOscillator"; - const options = optionsFromArguments(OmniOscillator.getDefaults(), arguments, ["frequency", "type"]); - this.frequency = new Signal({ - context: this.context, - units: "frequency", - value: options.frequency, - }); - this.detune = new Signal({ - context: this.context, - units: "cents", - value: options.detune, - }); - readOnly(this, ["frequency", "detune"]); - // set the options - this.set(options); - } - static getDefaults() { - return Object.assign(Oscillator.getDefaults(), FMOscillator.getDefaults(), AMOscillator.getDefaults(), FatOscillator.getDefaults(), PulseOscillator.getDefaults(), PWMOscillator.getDefaults()); - } - /** - * start the oscillator - */ - _start(time) { - this._oscillator.start(time); - } - /** - * start the oscillator - */ - _stop(time) { - this._oscillator.stop(time); - } - _restart(time) { - this._oscillator.restart(time); - return this; - } - /** - * The type of the oscillator. Can be any of the basic types: sine, square, triangle, sawtooth. Or - * prefix the basic types with "fm", "am", or "fat" to use the FMOscillator, AMOscillator or FatOscillator - * types. The oscillator could also be set to "pwm" or "pulse". All of the parameters of the - * oscillator's class are accessible when the oscillator is set to that type, but throws an error - * when it's not. - * @example - * const omniOsc = new Tone.OmniOscillator().toDestination().start(); - * omniOsc.type = "pwm"; - * // modulationFrequency is parameter which is available - * // only when the type is "pwm". - * omniOsc.modulationFrequency.value = 0.5; - */ - get type() { - let prefix = ""; - if (["am", "fm", "fat"].some(p => this._sourceType === p)) { - prefix = this._sourceType; - } - return prefix + this._oscillator.type; - } - set type(type) { - if (type.substr(0, 2) === "fm") { - this._createNewOscillator("fm"); - this._oscillator = this._oscillator; - this._oscillator.type = type.substr(2); - } - else if (type.substr(0, 2) === "am") { - this._createNewOscillator("am"); - this._oscillator = this._oscillator; - this._oscillator.type = type.substr(2); - } - else if (type.substr(0, 3) === "fat") { - this._createNewOscillator("fat"); - this._oscillator = this._oscillator; - this._oscillator.type = type.substr(3); - } - else if (type === "pwm") { - this._createNewOscillator("pwm"); - this._oscillator = this._oscillator; - } - else if (type === "pulse") { - this._createNewOscillator("pulse"); - } - else { - this._createNewOscillator("oscillator"); - this._oscillator = this._oscillator; - this._oscillator.type = type; - } - } - /** - * The value is an empty array when the type is not "custom". - * This is not available on "pwm" and "pulse" oscillator types. - * See [[Oscillator.partials]] - */ - get partials() { - return this._oscillator.partials; - } - set partials(partials) { - if (!this._getOscType(this._oscillator, "pulse") && !this._getOscType(this._oscillator, "pwm")) { - this._oscillator.partials = partials; - } - } - get partialCount() { - return this._oscillator.partialCount; - } - set partialCount(partialCount) { - if (!this._getOscType(this._oscillator, "pulse") && !this._getOscType(this._oscillator, "pwm")) { - this._oscillator.partialCount = partialCount; - } - } - set(props) { - // make sure the type is set first - if (Reflect.has(props, "type") && props.type) { - this.type = props.type; - } - // then set the rest - super.set(props); - return this; - } - /** - * connect the oscillator to the frequency and detune signals - */ - _createNewOscillator(oscType) { - if (oscType !== this._sourceType) { - this._sourceType = oscType; - const OscConstructor = OmniOscillatorSourceMap[oscType]; - // short delay to avoid clicks on the change - const now = this.now(); - if (this._oscillator) { - const oldOsc = this._oscillator; - oldOsc.stop(now); - // dispose the old one - this.context.setTimeout(() => oldOsc.dispose(), this.blockTime); - } - this._oscillator = new OscConstructor({ - context: this.context, - }); - this.frequency.connect(this._oscillator.frequency); - this.detune.connect(this._oscillator.detune); - this._oscillator.connect(this.output); - this._oscillator.onstop = () => this.onstop(this); - if (this.state === "started") { - this._oscillator.start(now); - } - } - } - get phase() { - return this._oscillator.phase; - } - set phase(phase) { - this._oscillator.phase = phase; - } - /** - * The source type of the oscillator. - * @example - * const omniOsc = new Tone.OmniOscillator(440, "fmsquare"); - * console.log(omniOsc.sourceType); // 'fm' - */ - get sourceType() { - return this._sourceType; - } - set sourceType(sType) { - // the basetype defaults to sine - let baseType = "sine"; - if (this._oscillator.type !== "pwm" && this._oscillator.type !== "pulse") { - baseType = this._oscillator.type; - } - // set the type - if (sType === "fm") { - this.type = "fm" + baseType; - } - else if (sType === "am") { - this.type = "am" + baseType; - } - else if (sType === "fat") { - this.type = "fat" + baseType; - } - else if (sType === "oscillator") { - this.type = baseType; - } - else if (sType === "pulse") { - this.type = "pulse"; - } - else if (sType === "pwm") { - this.type = "pwm"; - } - } - _getOscType(osc, sourceType) { - return osc instanceof OmniOscillatorSourceMap[sourceType]; - } - /** - * The base type of the oscillator. See [[Oscillator.baseType]] - * @example - * const omniOsc = new Tone.OmniOscillator(440, "fmsquare4"); - * console.log(omniOsc.sourceType, omniOsc.baseType, omniOsc.partialCount); - */ - get baseType() { - return this._oscillator.baseType; - } - set baseType(baseType) { - if (!this._getOscType(this._oscillator, "pulse") && - !this._getOscType(this._oscillator, "pwm") && - baseType !== "pulse" && baseType !== "pwm") { - this._oscillator.baseType = baseType; - } - } - /** - * The width of the oscillator when sourceType === "pulse". - * See [[PWMOscillator.width]] - */ - get width() { - if (this._getOscType(this._oscillator, "pulse")) { - return this._oscillator.width; - } - else { - return undefined; - } - } - /** - * The number of detuned oscillators when sourceType === "fat". - * See [[FatOscillator.count]] - */ - get count() { - if (this._getOscType(this._oscillator, "fat")) { - return this._oscillator.count; - } - else { - return undefined; - } - } - set count(count) { - if (this._getOscType(this._oscillator, "fat") && isNumber(count)) { - this._oscillator.count = count; - } - } - /** - * The detune spread between the oscillators when sourceType === "fat". - * See [[FatOscillator.count]] - */ - get spread() { - if (this._getOscType(this._oscillator, "fat")) { - return this._oscillator.spread; - } - else { - return undefined; - } - } - set spread(spread) { - if (this._getOscType(this._oscillator, "fat") && isNumber(spread)) { - this._oscillator.spread = spread; - } - } - /** - * The type of the modulator oscillator. Only if the oscillator is set to "am" or "fm" types. - * See [[AMOscillator]] or [[FMOscillator]] - */ - get modulationType() { - if (this._getOscType(this._oscillator, "fm") || this._getOscType(this._oscillator, "am")) { - return this._oscillator.modulationType; - } - else { - return undefined; - } - } - set modulationType(mType) { - if ((this._getOscType(this._oscillator, "fm") || this._getOscType(this._oscillator, "am")) && isString(mType)) { - this._oscillator.modulationType = mType; - } - } - /** - * The modulation index when the sourceType === "fm" - * See [[FMOscillator]]. - */ - get modulationIndex() { - if (this._getOscType(this._oscillator, "fm")) { - return this._oscillator.modulationIndex; - } - else { - return undefined; - } - } - /** - * Harmonicity is the frequency ratio between the carrier and the modulator oscillators. - * See [[AMOscillator]] or [[FMOscillator]] - */ - get harmonicity() { - if (this._getOscType(this._oscillator, "fm") || this._getOscType(this._oscillator, "am")) { - return this._oscillator.harmonicity; - } - else { - return undefined; - } - } - /** - * The modulationFrequency Signal of the oscillator when sourceType === "pwm" - * see [[PWMOscillator]] - * @min 0.1 - * @max 5 - */ - get modulationFrequency() { - if (this._getOscType(this._oscillator, "pwm")) { - return this._oscillator.modulationFrequency; - } - else { - return undefined; - } - } - asArray(length = 1024) { - return __awaiter(this, void 0, void 0, function* () { - return generateWaveform(this, length); - }); - } - dispose() { - super.dispose(); - this.detune.dispose(); - this.frequency.dispose(); - this._oscillator.dispose(); - return this; - } -} - -/** - * Assert that the number is in the given range. - */ -function range(min, max = Infinity) { - const valueMap = new WeakMap(); - return function (target, propertyKey) { - Reflect.defineProperty(target, propertyKey, { - configurable: true, - enumerable: true, - get: function () { - return valueMap.get(this); - }, - set: function (newValue) { - assertRange(newValue, min, max); - valueMap.set(this, newValue); - } - }); - }; -} -/** - * Convert the time to seconds and assert that the time is in between the two - * values when being set. - */ -function timeRange(min, max = Infinity) { - const valueMap = new WeakMap(); - return function (target, propertyKey) { - Reflect.defineProperty(target, propertyKey, { - configurable: true, - enumerable: true, - get: function () { - return valueMap.get(this); - }, - set: function (newValue) { - assertRange(this.toSeconds(newValue), min, max); - valueMap.set(this, newValue); - } - }); - }; -} - -/** - * Player is an audio file player with start, loop, and stop functions. - * @example - * const player = new Tone.Player("https://tonejs.github.io/audio/berklee/gong_1.mp3").toDestination(); - * // play as soon as the buffer is loaded - * player.autostart = true; - * @category Source - */ -class Player extends Source { - constructor() { - super(optionsFromArguments(Player.getDefaults(), arguments, ["url", "onload"])); - this.name = "Player"; - /** - * All of the active buffer source nodes - */ - this._activeSources = new Set(); - const options = optionsFromArguments(Player.getDefaults(), arguments, ["url", "onload"]); - this._buffer = new ToneAudioBuffer({ - onload: this._onload.bind(this, options.onload), - onerror: options.onerror, - reverse: options.reverse, - url: options.url, - }); - this.autostart = options.autostart; - this._loop = options.loop; - this._loopStart = options.loopStart; - this._loopEnd = options.loopEnd; - this._playbackRate = options.playbackRate; - this.fadeIn = options.fadeIn; - this.fadeOut = options.fadeOut; - } - static getDefaults() { - return Object.assign(Source.getDefaults(), { - autostart: false, - fadeIn: 0, - fadeOut: 0, - loop: false, - loopEnd: 0, - loopStart: 0, - onload: noOp, - onerror: noOp, - playbackRate: 1, - reverse: false, - }); - } - /** - * Load the audio file as an audio buffer. - * Decodes the audio asynchronously and invokes - * the callback once the audio buffer loads. - * Note: this does not need to be called if a url - * was passed in to the constructor. Only use this - * if you want to manually load a new url. - * @param url The url of the buffer to load. Filetype support depends on the browser. - */ - load(url) { - return __awaiter(this, void 0, void 0, function* () { - yield this._buffer.load(url); - this._onload(); - return this; - }); - } - /** - * Internal callback when the buffer is loaded. - */ - _onload(callback = noOp) { - callback(); - if (this.autostart) { - this.start(); - } - } - /** - * Internal callback when the buffer is done playing. - */ - _onSourceEnd(source) { - // invoke the onstop function - this.onstop(this); - // delete the source from the active sources - this._activeSources.delete(source); - if (this._activeSources.size === 0 && !this._synced && - this._state.getValueAtTime(this.now()) === "started") { - // remove the 'implicitEnd' event and replace with an explicit end - this._state.cancel(this.now()); - this._state.setStateAtTime("stopped", this.now()); - } - } - /** - * Play the buffer at the given startTime. Optionally add an offset - * and/or duration which will play the buffer from a position - * within the buffer for the given duration. - * - * @param time When the player should start. - * @param offset The offset from the beginning of the sample to start at. - * @param duration How long the sample should play. If no duration is given, it will default to the full length of the sample (minus any offset) - */ - start(time, offset, duration) { - super.start(time, offset, duration); - return this; - } - /** - * Internal start method - */ - _start(startTime, offset, duration) { - // if it's a loop the default offset is the loopStart point - if (this._loop) { - offset = defaultArg(offset, this._loopStart); - } - else { - // otherwise the default offset is 0 - offset = defaultArg(offset, 0); - } - // compute the values in seconds - const computedOffset = this.toSeconds(offset); - // compute the duration which is either the passed in duration of the buffer.duration - offset - const origDuration = duration; - duration = defaultArg(duration, Math.max(this._buffer.duration - computedOffset, 0)); - let computedDuration = this.toSeconds(duration); - // scale it by the playback rate - computedDuration = computedDuration / this._playbackRate; - // get the start time - startTime = this.toSeconds(startTime); - // make the source - const source = new ToneBufferSource({ - url: this._buffer, - context: this.context, - fadeIn: this.fadeIn, - fadeOut: this.fadeOut, - loop: this._loop, - loopEnd: this._loopEnd, - loopStart: this._loopStart, - onended: this._onSourceEnd.bind(this), - playbackRate: this._playbackRate, - }).connect(this.output); - // set the looping properties - if (!this._loop && !this._synced) { - // cancel the previous stop - this._state.cancel(startTime + computedDuration); - // if it's not looping, set the state change at the end of the sample - this._state.setStateAtTime("stopped", startTime + computedDuration, { - implicitEnd: true, - }); - } - // add it to the array of active sources - this._activeSources.add(source); - // start it - if (this._loop && isUndef(origDuration)) { - source.start(startTime, computedOffset); - } - else { - // subtract the fade out time - source.start(startTime, computedOffset, computedDuration - this.toSeconds(this.fadeOut)); - } - } - /** - * Stop playback. - */ - _stop(time) { - const computedTime = this.toSeconds(time); - this._activeSources.forEach(source => source.stop(computedTime)); - } - /** - * Stop and then restart the player from the beginning (or offset) - * @param time When the player should start. - * @param offset The offset from the beginning of the sample to start at. - * @param duration How long the sample should play. If no duration is given, - * it will default to the full length of the sample (minus any offset) - */ - restart(time, offset, duration) { - super.restart(time, offset, duration); - return this; - } - _restart(time, offset, duration) { - this._stop(time); - this._start(time, offset, duration); - } - /** - * Seek to a specific time in the player's buffer. If the - * source is no longer playing at that time, it will stop. - * @param offset The time to seek to. - * @param when The time for the seek event to occur. - * @example - * const player = new Tone.Player("https://tonejs.github.io/audio/berklee/gurgling_theremin_1.mp3", () => { - * player.start(); - * // seek to the offset in 1 second from now - * player.seek(0.4, "+1"); - * }).toDestination(); - */ - seek(offset, when) { - const computedTime = this.toSeconds(when); - if (this._state.getValueAtTime(computedTime) === "started") { - const computedOffset = this.toSeconds(offset); - // if it's currently playing, stop it - this._stop(computedTime); - // restart it at the given time - this._start(computedTime, computedOffset); - } - return this; - } - /** - * Set the loop start and end. Will only loop if loop is set to true. - * @param loopStart The loop start time - * @param loopEnd The loop end time - * @example - * const player = new Tone.Player("https://tonejs.github.io/audio/berklee/malevoices_aa2_F3.mp3").toDestination(); - * // loop between the given points - * player.setLoopPoints(0.2, 0.3); - * player.loop = true; - * player.autostart = true; - */ - setLoopPoints(loopStart, loopEnd) { - this.loopStart = loopStart; - this.loopEnd = loopEnd; - return this; - } - /** - * If loop is true, the loop will start at this position. - */ - get loopStart() { - return this._loopStart; - } - set loopStart(loopStart) { - this._loopStart = loopStart; - if (this.buffer.loaded) { - assertRange(this.toSeconds(loopStart), 0, this.buffer.duration); - } - // get the current source - this._activeSources.forEach(source => { - source.loopStart = loopStart; - }); - } - /** - * If loop is true, the loop will end at this position. - */ - get loopEnd() { - return this._loopEnd; - } - set loopEnd(loopEnd) { - this._loopEnd = loopEnd; - if (this.buffer.loaded) { - assertRange(this.toSeconds(loopEnd), 0, this.buffer.duration); - } - // get the current source - this._activeSources.forEach(source => { - source.loopEnd = loopEnd; - }); - } - /** - * The audio buffer belonging to the player. - */ - get buffer() { - return this._buffer; - } - set buffer(buffer) { - this._buffer.set(buffer); - } - /** - * If the buffer should loop once it's over. - * @example - * const player = new Tone.Player("https://tonejs.github.io/audio/drum-samples/breakbeat.mp3").toDestination(); - * player.loop = true; - * player.autostart = true; - */ - get loop() { - return this._loop; - } - set loop(loop) { - // if no change, do nothing - if (this._loop === loop) { - return; - } - this._loop = loop; - // set the loop of all of the sources - this._activeSources.forEach(source => { - source.loop = loop; - }); - if (loop) { - // remove the next stopEvent - const stopEvent = this._state.getNextState("stopped", this.now()); - if (stopEvent) { - this._state.cancel(stopEvent.time); - } - } - } - /** - * Normal speed is 1. The pitch will change with the playback rate. - * @example - * const player = new Tone.Player("https://tonejs.github.io/audio/berklee/femalevoices_aa2_A5.mp3").toDestination(); - * // play at 1/4 speed - * player.playbackRate = 0.25; - * // play as soon as the buffer is loaded - * player.autostart = true; - */ - get playbackRate() { - return this._playbackRate; - } - set playbackRate(rate) { - this._playbackRate = rate; - const now = this.now(); - // cancel the stop event since it's at a different time now - const stopEvent = this._state.getNextState("stopped", now); - if (stopEvent && stopEvent.implicitEnd) { - this._state.cancel(stopEvent.time); - this._activeSources.forEach(source => source.cancelStop()); - } - // set all the sources - this._activeSources.forEach(source => { - source.playbackRate.setValueAtTime(rate, now); - }); - } - /** - * If the buffer should be reversed - * @example - * const player = new Tone.Player("https://tonejs.github.io/audio/berklee/chime_1.mp3").toDestination(); - * player.autostart = true; - * player.reverse = true; - */ - get reverse() { - return this._buffer.reverse; - } - set reverse(rev) { - this._buffer.reverse = rev; - } - /** - * If the buffer is loaded - */ - get loaded() { - return this._buffer.loaded; - } - dispose() { - super.dispose(); - // disconnect all of the players - this._activeSources.forEach(source => source.dispose()); - this._activeSources.clear(); - this._buffer.dispose(); - return this; - } -} -__decorate([ - timeRange(0) -], Player.prototype, "fadeIn", void 0); -__decorate([ - timeRange(0) -], Player.prototype, "fadeOut", void 0); - -/** - * Envelope is an [ADSR](https://en.wikipedia.org/wiki/Synthesizer#ADSR_envelope) - * envelope generator. Envelope outputs a signal which - * can be connected to an AudioParam or Tone.Signal. - * ``` - * /\ - * / \ - * / \ - * / \ - * / \___________ - * / \ - * / \ - * / \ - * / \ - * ``` - * @example - * return Tone.Offline(() => { - * const env = new Tone.Envelope({ - * attack: 0.1, - * decay: 0.2, - * sustain: 0.5, - * release: 0.8, - * }).toDestination(); - * env.triggerAttackRelease(0.5); - * }, 1.5, 1); - * @category Component - */ -class Envelope extends ToneAudioNode { - constructor() { - super(optionsFromArguments(Envelope.getDefaults(), arguments, ["attack", "decay", "sustain", "release"])); - this.name = "Envelope"; - /** - * the signal which is output. - */ - this._sig = new Signal({ - context: this.context, - value: 0, - }); - /** - * The output signal of the envelope - */ - this.output = this._sig; - /** - * Envelope has no input - */ - this.input = undefined; - const options = optionsFromArguments(Envelope.getDefaults(), arguments, ["attack", "decay", "sustain", "release"]); - this.attack = options.attack; - this.decay = options.decay; - this.sustain = options.sustain; - this.release = options.release; - this.attackCurve = options.attackCurve; - this.releaseCurve = options.releaseCurve; - this.decayCurve = options.decayCurve; - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - attack: 0.01, - attackCurve: "linear", - decay: 0.1, - decayCurve: "exponential", - release: 1, - releaseCurve: "exponential", - sustain: 0.5, - }); - } - /** - * Read the current value of the envelope. Useful for - * synchronizing visual output to the envelope. - */ - get value() { - return this.getValueAtTime(this.now()); - } - /** - * Get the curve - * @param curve - * @param direction In/Out - * @return The curve name - */ - _getCurve(curve, direction) { - if (isString(curve)) { - return curve; - } - else { - // look up the name in the curves array - let curveName; - for (curveName in EnvelopeCurves) { - if (EnvelopeCurves[curveName][direction] === curve) { - return curveName; - } - } - // return the custom curve - return curve; - } - } - /** - * Assign a the curve to the given name using the direction - * @param name - * @param direction In/Out - * @param curve - */ - _setCurve(name, direction, curve) { - // check if it's a valid type - if (isString(curve) && Reflect.has(EnvelopeCurves, curve)) { - const curveDef = EnvelopeCurves[curve]; - if (isObject(curveDef)) { - if (name !== "_decayCurve") { - this[name] = curveDef[direction]; - } - } - else { - this[name] = curveDef; - } - } - else if (isArray(curve) && name !== "_decayCurve") { - this[name] = curve; - } - else { - throw new Error("Envelope: invalid curve: " + curve); - } - } - /** - * The shape of the attack. - * Can be any of these strings: - * * "linear" - * * "exponential" - * * "sine" - * * "cosine" - * * "bounce" - * * "ripple" - * * "step" - * - * Can also be an array which describes the curve. Values - * in the array are evenly subdivided and linearly - * interpolated over the duration of the attack. - * @example - * return Tone.Offline(() => { - * const env = new Tone.Envelope(0.4).toDestination(); - * env.attackCurve = "linear"; - * env.triggerAttack(); - * }, 1, 1); - */ - get attackCurve() { - return this._getCurve(this._attackCurve, "In"); - } - set attackCurve(curve) { - this._setCurve("_attackCurve", "In", curve); - } - /** - * The shape of the release. See the attack curve types. - * @example - * return Tone.Offline(() => { - * const env = new Tone.Envelope({ - * release: 0.8 - * }).toDestination(); - * env.triggerAttack(); - * // release curve could also be defined by an array - * env.releaseCurve = [1, 0.3, 0.4, 0.2, 0.7, 0]; - * env.triggerRelease(0.2); - * }, 1, 1); - */ - get releaseCurve() { - return this._getCurve(this._releaseCurve, "Out"); - } - set releaseCurve(curve) { - this._setCurve("_releaseCurve", "Out", curve); - } - /** - * The shape of the decay either "linear" or "exponential" - * @example - * return Tone.Offline(() => { - * const env = new Tone.Envelope({ - * sustain: 0.1, - * decay: 0.5 - * }).toDestination(); - * env.decayCurve = "linear"; - * env.triggerAttack(); - * }, 1, 1); - */ - get decayCurve() { - return this._decayCurve; - } - set decayCurve(curve) { - assert(["linear", "exponential"].some(c => c === curve), `Invalid envelope curve: ${curve}`); - this._decayCurve = curve; - } - /** - * Trigger the attack/decay portion of the ADSR envelope. - * @param time When the attack should start. - * @param velocity The velocity of the envelope scales the vales. - * number between 0-1 - * @example - * const env = new Tone.AmplitudeEnvelope().toDestination(); - * const osc = new Tone.Oscillator().connect(env).start(); - * // trigger the attack 0.5 seconds from now with a velocity of 0.2 - * env.triggerAttack("+0.5", 0.2); - */ - triggerAttack(time, velocity = 1) { - this.log("triggerAttack", time, velocity); - time = this.toSeconds(time); - const originalAttack = this.toSeconds(this.attack); - let attack = originalAttack; - const decay = this.toSeconds(this.decay); - // check if it's not a complete attack - const currentValue = this.getValueAtTime(time); - if (currentValue > 0) { - // subtract the current value from the attack time - const attackRate = 1 / attack; - const remainingDistance = 1 - currentValue; - // the attack is now the remaining time - attack = remainingDistance / attackRate; - } - // attack - if (attack < this.sampleTime) { - this._sig.cancelScheduledValues(time); - // case where the attack time is 0 should set instantly - this._sig.setValueAtTime(velocity, time); - } - else if (this._attackCurve === "linear") { - this._sig.linearRampTo(velocity, attack, time); - } - else if (this._attackCurve === "exponential") { - this._sig.targetRampTo(velocity, attack, time); - } - else { - this._sig.cancelAndHoldAtTime(time); - let curve = this._attackCurve; - // find the starting position in the curve - for (let i = 1; i < curve.length; i++) { - // the starting index is between the two values - if (curve[i - 1] <= currentValue && currentValue <= curve[i]) { - curve = this._attackCurve.slice(i); - // the first index is the current value - curve[0] = currentValue; - break; - } - } - this._sig.setValueCurveAtTime(curve, time, attack, velocity); - } - // decay - if (decay && this.sustain < 1) { - const decayValue = velocity * this.sustain; - const decayStart = time + attack; - this.log("decay", decayStart); - if (this._decayCurve === "linear") { - this._sig.linearRampToValueAtTime(decayValue, decay + decayStart); - } - else { - this._sig.exponentialApproachValueAtTime(decayValue, decayStart, decay); - } - } - return this; - } - /** - * Triggers the release of the envelope. - * @param time When the release portion of the envelope should start. - * @example - * const env = new Tone.AmplitudeEnvelope().toDestination(); - * const osc = new Tone.Oscillator({ - * type: "sawtooth" - * }).connect(env).start(); - * env.triggerAttack(); - * // trigger the release half a second after the attack - * env.triggerRelease("+0.5"); - */ - triggerRelease(time) { - this.log("triggerRelease", time); - time = this.toSeconds(time); - const currentValue = this.getValueAtTime(time); - if (currentValue > 0) { - const release = this.toSeconds(this.release); - if (release < this.sampleTime) { - this._sig.setValueAtTime(0, time); - } - else if (this._releaseCurve === "linear") { - this._sig.linearRampTo(0, release, time); - } - else if (this._releaseCurve === "exponential") { - this._sig.targetRampTo(0, release, time); - } - else { - assert(isArray(this._releaseCurve), "releaseCurve must be either 'linear', 'exponential' or an array"); - this._sig.cancelAndHoldAtTime(time); - this._sig.setValueCurveAtTime(this._releaseCurve, time, release, currentValue); - } - } - return this; - } - /** - * Get the scheduled value at the given time. This will - * return the unconverted (raw) value. - * @example - * const env = new Tone.Envelope(0.5, 1, 0.4, 2); - * env.triggerAttackRelease(2); - * setInterval(() => console.log(env.getValueAtTime(Tone.now())), 100); - */ - getValueAtTime(time) { - return this._sig.getValueAtTime(time); - } - /** - * triggerAttackRelease is shorthand for triggerAttack, then waiting - * some duration, then triggerRelease. - * @param duration The duration of the sustain. - * @param time When the attack should be triggered. - * @param velocity The velocity of the envelope. - * @example - * const env = new Tone.AmplitudeEnvelope().toDestination(); - * const osc = new Tone.Oscillator().connect(env).start(); - * // trigger the release 0.5 seconds after the attack - * env.triggerAttackRelease(0.5); - */ - triggerAttackRelease(duration, time, velocity = 1) { - time = this.toSeconds(time); - this.triggerAttack(time, velocity); - this.triggerRelease(time + this.toSeconds(duration)); - return this; - } - /** - * Cancels all scheduled envelope changes after the given time. - */ - cancel(after) { - this._sig.cancelScheduledValues(this.toSeconds(after)); - return this; - } - /** - * Connect the envelope to a destination node. - */ - connect(destination, outputNumber = 0, inputNumber = 0) { - connectSignal(this, destination, outputNumber, inputNumber); - return this; - } - /** - * Render the envelope curve to an array of the given length. - * Good for visualizing the envelope curve. Rescales the duration of the - * envelope to fit the length. - */ - asArray(length = 1024) { - return __awaiter(this, void 0, void 0, function* () { - const duration = length / this.context.sampleRate; - const context = new OfflineContext(1, duration, this.context.sampleRate); - // normalize the ADSR for the given duration with 20% sustain time - const attackPortion = this.toSeconds(this.attack) + this.toSeconds(this.decay); - const envelopeDuration = attackPortion + this.toSeconds(this.release); - const sustainTime = envelopeDuration * 0.1; - const totalDuration = envelopeDuration + sustainTime; - // @ts-ignore - const clone = new this.constructor(Object.assign(this.get(), { - attack: duration * this.toSeconds(this.attack) / totalDuration, - decay: duration * this.toSeconds(this.decay) / totalDuration, - release: duration * this.toSeconds(this.release) / totalDuration, - context - })); - clone._sig.toDestination(); - clone.triggerAttackRelease(duration * (attackPortion + sustainTime) / totalDuration, 0); - const buffer = yield context.render(); - return buffer.getChannelData(0); - }); - } - dispose() { - super.dispose(); - this._sig.dispose(); - return this; - } -} -__decorate([ - timeRange(0) -], Envelope.prototype, "attack", void 0); -__decorate([ - timeRange(0) -], Envelope.prototype, "decay", void 0); -__decorate([ - range(0, 1) -], Envelope.prototype, "sustain", void 0); -__decorate([ - timeRange(0) -], Envelope.prototype, "release", void 0); -/** - * Generate some complex envelope curves. - */ -const EnvelopeCurves = (() => { - const curveLen = 128; - let i; - let k; - // cosine curve - const cosineCurve = []; - for (i = 0; i < curveLen; i++) { - cosineCurve[i] = Math.sin((i / (curveLen - 1)) * (Math.PI / 2)); - } - // ripple curve - const rippleCurve = []; - const rippleCurveFreq = 6.4; - for (i = 0; i < curveLen - 1; i++) { - k = (i / (curveLen - 1)); - const sineWave = Math.sin(k * (Math.PI * 2) * rippleCurveFreq - Math.PI / 2) + 1; - rippleCurve[i] = sineWave / 10 + k * 0.83; - } - rippleCurve[curveLen - 1] = 1; - // stairs curve - const stairsCurve = []; - const steps = 5; - for (i = 0; i < curveLen; i++) { - stairsCurve[i] = Math.ceil((i / (curveLen - 1)) * steps) / steps; - } - // in-out easing curve - const sineCurve = []; - for (i = 0; i < curveLen; i++) { - k = i / (curveLen - 1); - sineCurve[i] = 0.5 * (1 - Math.cos(Math.PI * k)); - } - // a bounce curve - const bounceCurve = []; - for (i = 0; i < curveLen; i++) { - k = i / (curveLen - 1); - const freq = Math.pow(k, 3) * 4 + 0.2; - const val = Math.cos(freq * Math.PI * 2 * k); - bounceCurve[i] = Math.abs(val * (1 - k)); - } - /** - * Invert a value curve to make it work for the release - */ - function invertCurve(curve) { - const out = new Array(curve.length); - for (let j = 0; j < curve.length; j++) { - out[j] = 1 - curve[j]; - } - return out; - } - /** - * reverse the curve - */ - function reverseCurve(curve) { - return curve.slice(0).reverse(); - } - /** - * attack and release curve arrays - */ - return { - bounce: { - In: invertCurve(bounceCurve), - Out: bounceCurve, - }, - cosine: { - In: cosineCurve, - Out: reverseCurve(cosineCurve), - }, - exponential: "exponential", - linear: "linear", - ripple: { - In: rippleCurve, - Out: invertCurve(rippleCurve), - }, - sine: { - In: sineCurve, - Out: invertCurve(sineCurve), - }, - step: { - In: stairsCurve, - Out: invertCurve(stairsCurve), - }, - }; -})(); - -/** - * Base-class for all instruments - */ -class Instrument extends ToneAudioNode { - constructor() { - super(optionsFromArguments(Instrument.getDefaults(), arguments)); - /** - * Keep track of all events scheduled to the transport - * when the instrument is 'synced' - */ - this._scheduledEvents = []; - /** - * If the instrument is currently synced - */ - this._synced = false; - this._original_triggerAttack = this.triggerAttack; - this._original_triggerRelease = this.triggerRelease; - const options = optionsFromArguments(Instrument.getDefaults(), arguments); - this._volume = this.output = new Volume({ - context: this.context, - volume: options.volume, - }); - this.volume = this._volume.volume; - readOnly(this, "volume"); - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - volume: 0, - }); - } - /** - * Sync the instrument to the Transport. All subsequent calls of - * [[triggerAttack]] and [[triggerRelease]] will be scheduled along the transport. - * @example - * const fmSynth = new Tone.FMSynth().toDestination(); - * fmSynth.volume.value = -6; - * fmSynth.sync(); - * // schedule 3 notes when the transport first starts - * fmSynth.triggerAttackRelease("C4", "8n", 0); - * fmSynth.triggerAttackRelease("E4", "8n", "8n"); - * fmSynth.triggerAttackRelease("G4", "8n", "4n"); - * // start the transport to hear the notes - * Tone.Transport.start(); - */ - sync() { - if (this._syncState()) { - this._syncMethod("triggerAttack", 1); - this._syncMethod("triggerRelease", 0); - } - return this; - } - /** - * set _sync - */ - _syncState() { - let changed = false; - if (!this._synced) { - this._synced = true; - changed = true; - } - return changed; - } - /** - * Wrap the given method so that it can be synchronized - * @param method Which method to wrap and sync - * @param timePosition What position the time argument appears in - */ - _syncMethod(method, timePosition) { - const originalMethod = this["_original_" + method] = this[method]; - this[method] = (...args) => { - const time = args[timePosition]; - const id = this.context.transport.schedule((t) => { - args[timePosition] = t; - originalMethod.apply(this, args); - }, time); - this._scheduledEvents.push(id); - }; - } - /** - * Unsync the instrument from the Transport - */ - unsync() { - this._scheduledEvents.forEach(id => this.context.transport.clear(id)); - this._scheduledEvents = []; - if (this._synced) { - this._synced = false; - this.triggerAttack = this._original_triggerAttack; - this.triggerRelease = this._original_triggerRelease; - } - return this; - } - /** - * Trigger the attack and then the release after the duration. - * @param note The note to trigger. - * @param duration How long the note should be held for before - * triggering the release. This value must be greater than 0. - * @param time When the note should be triggered. - * @param velocity The velocity the note should be triggered at. - * @example - * const synth = new Tone.Synth().toDestination(); - * // trigger "C4" for the duration of an 8th note - * synth.triggerAttackRelease("C4", "8n"); - */ - triggerAttackRelease(note, duration, time, velocity) { - const computedTime = this.toSeconds(time); - const computedDuration = this.toSeconds(duration); - this.triggerAttack(note, computedTime, velocity); - this.triggerRelease(computedTime + computedDuration); - return this; - } - /** - * clean up - * @returns {Instrument} this - */ - dispose() { - super.dispose(); - this._volume.dispose(); - this.unsync(); - this._scheduledEvents = []; - return this; - } -} - -/** - * Abstract base class for other monophonic instruments to extend. - */ -class Monophonic extends Instrument { - constructor() { - super(optionsFromArguments(Monophonic.getDefaults(), arguments)); - const options = optionsFromArguments(Monophonic.getDefaults(), arguments); - this.portamento = options.portamento; - this.onsilence = options.onsilence; - } - static getDefaults() { - return Object.assign(Instrument.getDefaults(), { - detune: 0, - onsilence: noOp, - portamento: 0, - }); - } - /** - * Trigger the attack of the note optionally with a given velocity. - * @param note The note to trigger. - * @param time When the note should start. - * @param velocity The velocity scaler determines how "loud" the note will be triggered. - * @example - * const synth = new Tone.Synth().toDestination(); - * // trigger the note a half second from now at half velocity - * synth.triggerAttack("C4", "+0.5", 0.5); - */ - triggerAttack(note, time, velocity = 1) { - this.log("triggerAttack", note, time, velocity); - const seconds = this.toSeconds(time); - this._triggerEnvelopeAttack(seconds, velocity); - this.setNote(note, seconds); - return this; - } - /** - * Trigger the release portion of the envelope - * @param time If no time is given, the release happens immediatly - * @example - * const synth = new Tone.Synth().toDestination(); - * synth.triggerAttack("C4"); - * // trigger the release a second from now - * synth.triggerRelease("+1"); - */ - triggerRelease(time) { - this.log("triggerRelease", time); - const seconds = this.toSeconds(time); - this._triggerEnvelopeRelease(seconds); - return this; - } - /** - * Set the note at the given time. If no time is given, the note - * will set immediately. - * @param note The note to change to. - * @param time The time when the note should be set. - * @example - * const synth = new Tone.Synth().toDestination(); - * synth.triggerAttack("C4"); - * // change to F#6 in one quarter note from now. - * synth.setNote("F#6", "+4n"); - */ - setNote(note, time) { - const computedTime = this.toSeconds(time); - const computedFrequency = note instanceof FrequencyClass ? note.toFrequency() : note; - if (this.portamento > 0 && this.getLevelAtTime(computedTime) > 0.05) { - const portTime = this.toSeconds(this.portamento); - this.frequency.exponentialRampTo(computedFrequency, portTime, computedTime); - } - else { - this.frequency.setValueAtTime(computedFrequency, computedTime); - } - return this; - } -} -__decorate([ - timeRange(0) -], Monophonic.prototype, "portamento", void 0); - -/** - * AmplitudeEnvelope is a Tone.Envelope connected to a gain node. - * Unlike Tone.Envelope, which outputs the envelope's value, AmplitudeEnvelope accepts - * an audio signal as the input and will apply the envelope to the amplitude - * of the signal. - * Read more about ADSR Envelopes on [Wikipedia](https://en.wikipedia.org/wiki/Synthesizer#ADSR_envelope). - * - * @example - * return Tone.Offline(() => { - * const ampEnv = new Tone.AmplitudeEnvelope({ - * attack: 0.1, - * decay: 0.2, - * sustain: 1.0, - * release: 0.8 - * }).toDestination(); - * // create an oscillator and connect it - * const osc = new Tone.Oscillator().connect(ampEnv).start(); - * // trigger the envelopes attack and release "8t" apart - * ampEnv.triggerAttackRelease("8t"); - * }, 1.5, 1); - * @category Component - */ -class AmplitudeEnvelope extends Envelope { - constructor() { - super(optionsFromArguments(AmplitudeEnvelope.getDefaults(), arguments, ["attack", "decay", "sustain", "release"])); - this.name = "AmplitudeEnvelope"; - this._gainNode = new Gain({ - context: this.context, - gain: 0, - }); - this.output = this._gainNode; - this.input = this._gainNode; - this._sig.connect(this._gainNode.gain); - this.output = this._gainNode; - this.input = this._gainNode; - } - /** - * Clean up - */ - dispose() { - super.dispose(); - this._gainNode.dispose(); - return this; - } -} - -/** - * Synth is composed simply of a [[OmniOscillator]] routed through an [[AmplitudeEnvelope]]. - * ``` - * +----------------+ +-------------------+ - * | OmniOscillator +>--> AmplitudeEnvelope +>--> Output - * +----------------+ +-------------------+ - * ``` - * @example - * const synth = new Tone.Synth().toDestination(); - * synth.triggerAttackRelease("C4", "8n"); - * @category Instrument - */ -class Synth extends Monophonic { - constructor() { - super(optionsFromArguments(Synth.getDefaults(), arguments)); - this.name = "Synth"; - const options = optionsFromArguments(Synth.getDefaults(), arguments); - this.oscillator = new OmniOscillator(Object.assign({ - context: this.context, - detune: options.detune, - onstop: () => this.onsilence(this), - }, options.oscillator)); - this.frequency = this.oscillator.frequency; - this.detune = this.oscillator.detune; - this.envelope = new AmplitudeEnvelope(Object.assign({ - context: this.context, - }, options.envelope)); - // connect the oscillators to the output - this.oscillator.chain(this.envelope, this.output); - readOnly(this, ["oscillator", "frequency", "detune", "envelope"]); - } - static getDefaults() { - return Object.assign(Monophonic.getDefaults(), { - envelope: Object.assign(omitFromObject(Envelope.getDefaults(), Object.keys(ToneAudioNode.getDefaults())), { - attack: 0.005, - decay: 0.1, - release: 1, - sustain: 0.3, - }), - oscillator: Object.assign(omitFromObject(OmniOscillator.getDefaults(), [...Object.keys(Source.getDefaults()), "frequency", "detune"]), { - type: "triangle", - }), - }); - } - /** - * start the attack portion of the envelope - * @param time the time the attack should start - * @param velocity the velocity of the note (0-1) - */ - _triggerEnvelopeAttack(time, velocity) { - // the envelopes - this.envelope.triggerAttack(time, velocity); - this.oscillator.start(time); - // if there is no release portion, stop the oscillator - if (this.envelope.sustain === 0) { - const computedAttack = this.toSeconds(this.envelope.attack); - const computedDecay = this.toSeconds(this.envelope.decay); - this.oscillator.stop(time + computedAttack + computedDecay); - } - } - /** - * start the release portion of the envelope - * @param time the time the release should start - */ - _triggerEnvelopeRelease(time) { - this.envelope.triggerRelease(time); - this.oscillator.stop(time + this.toSeconds(this.envelope.release)); - } - getLevelAtTime(time) { - time = this.toSeconds(time); - return this.envelope.getValueAtTime(time); - } - /** - * clean up - */ - dispose() { - super.dispose(); - this.oscillator.dispose(); - this.envelope.dispose(); - return this; - } -} - -/** - * MembraneSynth makes kick and tom sounds using a single oscillator - * with an amplitude envelope and frequency ramp. A Tone.OmniOscillator - * is routed through a Tone.AmplitudeEnvelope to the output. The drum - * quality of the sound comes from the frequency envelope applied - * during MembraneSynth.triggerAttack(note). The frequency envelope - * starts at note * .octaves and ramps to note - * over the duration of .pitchDecay. - * @example - * const synth = new Tone.MembraneSynth().toDestination(); - * synth.triggerAttackRelease("C2", "8n"); - * @category Instrument - */ -class MembraneSynth extends Synth { - constructor() { - super(optionsFromArguments(MembraneSynth.getDefaults(), arguments)); - this.name = "MembraneSynth"; - /** - * Portamento is ignored in this synth. use pitch decay instead. - */ - this.portamento = 0; - const options = optionsFromArguments(MembraneSynth.getDefaults(), arguments); - this.pitchDecay = options.pitchDecay; - this.octaves = options.octaves; - readOnly(this, ["oscillator", "envelope"]); - } - static getDefaults() { - return deepMerge(Monophonic.getDefaults(), Synth.getDefaults(), { - envelope: { - attack: 0.001, - attackCurve: "exponential", - decay: 0.4, - release: 1.4, - sustain: 0.01, - }, - octaves: 10, - oscillator: { - type: "sine", - }, - pitchDecay: 0.05, - }); - } - setNote(note, time) { - const seconds = this.toSeconds(time); - const hertz = this.toFrequency(note instanceof FrequencyClass ? note.toFrequency() : note); - const maxNote = hertz * this.octaves; - this.oscillator.frequency.setValueAtTime(maxNote, seconds); - this.oscillator.frequency.exponentialRampToValueAtTime(hertz, seconds + this.toSeconds(this.pitchDecay)); - return this; - } - dispose() { - super.dispose(); - return this; - } -} -__decorate([ - range(0) -], MembraneSynth.prototype, "octaves", void 0); -__decorate([ - timeRange(0) -], MembraneSynth.prototype, "pitchDecay", void 0); - -/** - * All of the classes or functions which are loaded into the AudioWorkletGlobalScope - */ -const workletContext = new Set(); -/** - * Add a class to the AudioWorkletGlobalScope - */ -function addToWorklet(classOrFunction) { - workletContext.add(classOrFunction); -} -/** - * Register a processor in the AudioWorkletGlobalScope with the given name - */ -function registerProcessor(name, classDesc) { - const processor = /* javascript */ `registerProcessor("${name}", ${classDesc})`; - workletContext.add(processor); -} -/** - * Get all of the modules which have been registered to the AudioWorkletGlobalScope - */ -function getWorkletGlobalScope() { - return Array.from(workletContext).join("\n"); -} - -const toneAudioWorkletProcessor = /* javascript */ ` - /** - * The base AudioWorkletProcessor for use in Tone.js. Works with the [[ToneAudioWorklet]]. - */ - class ToneAudioWorkletProcessor extends AudioWorkletProcessor { - - constructor(options) { - - super(options); - /** - * If the processor was disposed or not. Keep alive until it's disposed. - */ - this.disposed = false; - /** - * The number of samples in the processing block - */ - this.blockSize = 128; - /** - * the sample rate - */ - this.sampleRate = sampleRate; - - this.port.onmessage = (event) => { - // when it receives a dispose - if (event.data === "dispose") { - this.disposed = true; - } - }; - } - } -`; -addToWorklet(toneAudioWorkletProcessor); - -const singleIOProcess = /* javascript */ ` - /** - * Abstract class for a single input/output processor. - * has a 'generate' function which processes one sample at a time - */ - class SingleIOProcessor extends ToneAudioWorkletProcessor { - - constructor(options) { - super(Object.assign(options, { - numberOfInputs: 1, - numberOfOutputs: 1 - })); - /** - * Holds the name of the parameter and a single value of that - * parameter at the current sample - * @type { [name: string]: number } - */ - this.params = {} - } - - /** - * Generate an output sample from the input sample and parameters - * @abstract - * @param input number - * @param channel number - * @param parameters { [name: string]: number } - * @returns number - */ - generate(){} - - /** - * Update the private params object with the - * values of the parameters at the given index - * @param parameters { [name: string]: Float32Array }, - * @param index number - */ - updateParams(parameters, index) { - for (const paramName in parameters) { - const param = parameters[paramName]; - if (param.length > 1) { - this.params[paramName] = parameters[paramName][index]; - } else { - this.params[paramName] = parameters[paramName][0]; - } - } - } - - /** - * Process a single frame of the audio - * @param inputs Float32Array[][] - * @param outputs Float32Array[][] - */ - process(inputs, outputs, parameters) { - const input = inputs[0]; - const output = outputs[0]; - // get the parameter values - const channelCount = Math.max(input && input.length || 0, output.length); - for (let sample = 0; sample < this.blockSize; sample++) { - this.updateParams(parameters, sample); - for (let channel = 0; channel < channelCount; channel++) { - const inputSample = input && input.length ? input[channel][sample] : 0; - output[channel][sample] = this.generate(inputSample, channel, this.params); - } - } - return !this.disposed; - } - }; -`; -addToWorklet(singleIOProcess); - -const delayLine = /* javascript */ ` - /** - * A multichannel buffer for use within an AudioWorkletProcessor as a delay line - */ - class DelayLine { - - constructor(size, channels) { - this.buffer = []; - this.writeHead = [] - this.size = size; - - // create the empty channels - for (let i = 0; i < channels; i++) { - this.buffer[i] = new Float32Array(this.size); - this.writeHead[i] = 0; - } - } - - /** - * Push a value onto the end - * @param channel number - * @param value number - */ - push(channel, value) { - this.writeHead[channel] += 1; - if (this.writeHead[channel] > this.size) { - this.writeHead[channel] = 0; - } - this.buffer[channel][this.writeHead[channel]] = value; - } - - /** - * Get the recorded value of the channel given the delay - * @param channel number - * @param delay number delay samples - */ - get(channel, delay) { - let readHead = this.writeHead[channel] - Math.floor(delay); - if (readHead < 0) { - readHead += this.size; - } - return this.buffer[channel][readHead]; - } - } -`; -addToWorklet(delayLine); - -const workletName = "feedback-comb-filter"; -const feedbackCombFilter = /* javascript */ ` - class FeedbackCombFilterWorklet extends SingleIOProcessor { - - constructor(options) { - super(options); - this.delayLine = new DelayLine(this.sampleRate, options.channelCount || 2); - } - - static get parameterDescriptors() { - return [{ - name: "delayTime", - defaultValue: 0.1, - minValue: 0, - maxValue: 1, - automationRate: "k-rate" - }, { - name: "feedback", - defaultValue: 0.5, - minValue: 0, - maxValue: 0.9999, - automationRate: "k-rate" - }]; - } - - generate(input, channel, parameters) { - const delayedSample = this.delayLine.get(channel, parameters.delayTime * this.sampleRate); - this.delayLine.push(channel, input + delayedSample * parameters.feedback); - return delayedSample; - } - } -`; -registerProcessor(workletName, feedbackCombFilter); - -/** - * Pass in an object which maps the note's pitch or midi value to the url, - * then you can trigger the attack and release of that note like other instruments. - * By automatically repitching the samples, it is possible to play pitches which - * were not explicitly included which can save loading time. - * - * For sample or buffer playback where repitching is not necessary, - * use [[Player]]. - * @example - * const sampler = new Tone.Sampler({ - * urls: { - * A1: "A1.mp3", - * A2: "A2.mp3", - * }, - * baseUrl: "https://tonejs.github.io/audio/casio/", - * onload: () => { - * sampler.triggerAttackRelease(["C1", "E1", "G1", "B1"], 0.5); - * } - * }).toDestination(); - * @category Instrument - */ -class Sampler extends Instrument { - constructor() { - super(optionsFromArguments(Sampler.getDefaults(), arguments, ["urls", "onload", "baseUrl"], "urls")); - this.name = "Sampler"; - /** - * The object of all currently playing BufferSources - */ - this._activeSources = new Map(); - const options = optionsFromArguments(Sampler.getDefaults(), arguments, ["urls", "onload", "baseUrl"], "urls"); - const urlMap = {}; - Object.keys(options.urls).forEach((note) => { - const noteNumber = parseInt(note, 10); - assert(isNote(note) - || (isNumber(noteNumber) && isFinite(noteNumber)), `url key is neither a note or midi pitch: ${note}`); - if (isNote(note)) { - // convert the note name to MIDI - const mid = new FrequencyClass(this.context, note).toMidi(); - urlMap[mid] = options.urls[note]; - } - else if (isNumber(noteNumber) && isFinite(noteNumber)) { - // otherwise if it's numbers assume it's midi - urlMap[noteNumber] = options.urls[noteNumber]; - } - }); - this._buffers = new ToneAudioBuffers({ - urls: urlMap, - onload: options.onload, - baseUrl: options.baseUrl, - onerror: options.onerror, - }); - this.attack = options.attack; - this.release = options.release; - this.curve = options.curve; - // invoke the callback if it's already loaded - if (this._buffers.loaded) { - // invoke onload deferred - Promise.resolve().then(options.onload); - } - } - static getDefaults() { - return Object.assign(Instrument.getDefaults(), { - attack: 0, - baseUrl: "", - curve: "exponential", - onload: noOp, - onerror: noOp, - release: 0.1, - urls: {}, - }); - } - /** - * Returns the difference in steps between the given midi note at the closets sample. - */ - _findClosest(midi) { - // searches within 8 octaves of the given midi note - const MAX_INTERVAL = 96; - let interval = 0; - while (interval < MAX_INTERVAL) { - // check above and below - if (this._buffers.has(midi + interval)) { - return -interval; - } - else if (this._buffers.has(midi - interval)) { - return interval; - } - interval++; - } - throw new Error(`No available buffers for note: ${midi}`); - } - /** - * @param notes The note to play, or an array of notes. - * @param time When to play the note - * @param velocity The velocity to play the sample back. - */ - triggerAttack(notes, time, velocity = 1) { - this.log("triggerAttack", notes, time, velocity); - if (!Array.isArray(notes)) { - notes = [notes]; - } - notes.forEach(note => { - const midiFloat = ftomf(new FrequencyClass(this.context, note).toFrequency()); - const midi = Math.round(midiFloat); - const remainder = midiFloat - midi; - // find the closest note pitch - const difference = this._findClosest(midi); - const closestNote = midi - difference; - const buffer = this._buffers.get(closestNote); - const playbackRate = intervalToFrequencyRatio(difference + remainder); - // play that note - const source = new ToneBufferSource({ - url: buffer, - context: this.context, - curve: this.curve, - fadeIn: this.attack, - fadeOut: this.release, - playbackRate, - }).connect(this.output); - source.start(time, 0, buffer.duration / playbackRate, velocity); - // add it to the active sources - if (!isArray(this._activeSources.get(midi))) { - this._activeSources.set(midi, []); - } - this._activeSources.get(midi).push(source); - // remove it when it's done - source.onended = () => { - if (this._activeSources && this._activeSources.has(midi)) { - const sources = this._activeSources.get(midi); - const index = sources.indexOf(source); - if (index !== -1) { - sources.splice(index, 1); - } - } - }; - }); - return this; - } - /** - * @param notes The note to release, or an array of notes. - * @param time When to release the note. - */ - triggerRelease(notes, time) { - this.log("triggerRelease", notes, time); - if (!Array.isArray(notes)) { - notes = [notes]; - } - notes.forEach(note => { - const midi = new FrequencyClass(this.context, note).toMidi(); - // find the note - if (this._activeSources.has(midi) && this._activeSources.get(midi).length) { - const sources = this._activeSources.get(midi); - time = this.toSeconds(time); - sources.forEach(source => { - source.stop(time); - }); - this._activeSources.set(midi, []); - } - }); - return this; - } - /** - * Release all currently active notes. - * @param time When to release the notes. - */ - releaseAll(time) { - const computedTime = this.toSeconds(time); - this._activeSources.forEach(sources => { - while (sources.length) { - const source = sources.shift(); - source.stop(computedTime); - } - }); - return this; - } - sync() { - if (this._syncState()) { - this._syncMethod("triggerAttack", 1); - this._syncMethod("triggerRelease", 1); - } - return this; - } - /** - * Invoke the attack phase, then after the duration, invoke the release. - * @param notes The note to play and release, or an array of notes. - * @param duration The time the note should be held - * @param time When to start the attack - * @param velocity The velocity of the attack - */ - triggerAttackRelease(notes, duration, time, velocity = 1) { - const computedTime = this.toSeconds(time); - this.triggerAttack(notes, computedTime, velocity); - if (isArray(duration)) { - assert(isArray(notes), "notes must be an array when duration is array"); - notes.forEach((note, index) => { - const d = duration[Math.min(index, duration.length - 1)]; - this.triggerRelease(note, computedTime + this.toSeconds(d)); - }); - } - else { - this.triggerRelease(notes, computedTime + this.toSeconds(duration)); - } - return this; - } - /** - * Add a note to the sampler. - * @param note The buffer's pitch. - * @param url Either the url of the buffer, or a buffer which will be added with the given name. - * @param callback The callback to invoke when the url is loaded. - */ - add(note, url, callback) { - assert(isNote(note) || isFinite(note), `note must be a pitch or midi: ${note}`); - if (isNote(note)) { - // convert the note name to MIDI - const mid = new FrequencyClass(this.context, note).toMidi(); - this._buffers.add(mid, url, callback); - } - else { - // otherwise if it's numbers assume it's midi - this._buffers.add(note, url, callback); - } - return this; - } - /** - * If the buffers are loaded or not - */ - get loaded() { - return this._buffers.loaded; - } - /** - * Clean up - */ - dispose() { - super.dispose(); - this._buffers.dispose(); - this._activeSources.forEach(sources => { - sources.forEach(source => source.dispose()); - }); - this._activeSources.clear(); - return this; - } -} -__decorate([ - timeRange(0) -], Sampler.prototype, "attack", void 0); -__decorate([ - timeRange(0) -], Sampler.prototype, "release", void 0); - -/** - * Panner is an equal power Left/Right Panner. It is a wrapper around the StereoPannerNode. - * @example - * return Tone.Offline(() => { - * // move the input signal from right to left - * const panner = new Tone.Panner(1).toDestination(); - * panner.pan.rampTo(-1, 0.5); - * const osc = new Tone.Oscillator(100).connect(panner).start(); - * }, 0.5, 2); - * @category Component - */ -class Panner extends ToneAudioNode { - constructor() { - super(Object.assign(optionsFromArguments(Panner.getDefaults(), arguments, ["pan"]))); - this.name = "Panner"; - /** - * the panner node - */ - this._panner = this.context.createStereoPanner(); - this.input = this._panner; - this.output = this._panner; - const options = optionsFromArguments(Panner.getDefaults(), arguments, ["pan"]); - this.pan = new Param({ - context: this.context, - param: this._panner.pan, - value: options.pan, - minValue: -1, - maxValue: 1, - }); - // this is necessary for standardized-audio-context - // doesn't make any difference for the native AudioContext - // https://github.com/chrisguttandin/standardized-audio-context/issues/647 - this._panner.channelCount = options.channelCount; - this._panner.channelCountMode = "explicit"; - // initial value - readOnly(this, "pan"); - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - pan: 0, - channelCount: 1, - }); - } - dispose() { - super.dispose(); - this._panner.disconnect(); - this.pan.dispose(); - return this; - } -} - -const workletName$1 = "bit-crusher"; -const bitCrusherWorklet = /* javascript */ ` - class BitCrusherWorklet extends SingleIOProcessor { - - static get parameterDescriptors() { - return [{ - name: "bits", - defaultValue: 12, - minValue: 1, - maxValue: 16, - automationRate: 'k-rate' - }]; - } - - generate(input, _channel, parameters) { - const step = Math.pow(0.5, parameters.bits - 1); - const val = step * Math.floor(input / step + 0.5); - return val; - } - } -`; -registerProcessor(workletName$1, bitCrusherWorklet); - -/** - * Solo lets you isolate a specific audio stream. When an instance is set to `solo=true`, - * it will mute all other instances of Solo. - * @example - * const soloA = new Tone.Solo().toDestination(); - * const oscA = new Tone.Oscillator("C4", "sawtooth").connect(soloA); - * const soloB = new Tone.Solo().toDestination(); - * const oscB = new Tone.Oscillator("E4", "square").connect(soloB); - * soloA.solo = true; - * // no audio will pass through soloB - * @category Component - */ -class Solo extends ToneAudioNode { - constructor() { - super(optionsFromArguments(Solo.getDefaults(), arguments, ["solo"])); - this.name = "Solo"; - const options = optionsFromArguments(Solo.getDefaults(), arguments, ["solo"]); - this.input = this.output = new Gain({ - context: this.context, - }); - if (!Solo._allSolos.has(this.context)) { - Solo._allSolos.set(this.context, new Set()); - } - Solo._allSolos.get(this.context).add(this); - // set initially - this.solo = options.solo; - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - solo: false, - }); - } - /** - * Isolates this instance and mutes all other instances of Solo. - * Only one instance can be soloed at a time. A soloed - * instance will report `solo=false` when another instance is soloed. - */ - get solo() { - return this._isSoloed(); - } - set solo(solo) { - if (solo) { - this._addSolo(); - } - else { - this._removeSolo(); - } - Solo._allSolos.get(this.context).forEach(instance => instance._updateSolo()); - } - /** - * If the current instance is muted, i.e. another instance is soloed - */ - get muted() { - return this.input.gain.value === 0; - } - /** - * Add this to the soloed array - */ - _addSolo() { - if (!Solo._soloed.has(this.context)) { - Solo._soloed.set(this.context, new Set()); - } - Solo._soloed.get(this.context).add(this); - } - /** - * Remove this from the soloed array - */ - _removeSolo() { - if (Solo._soloed.has(this.context)) { - Solo._soloed.get(this.context).delete(this); - } - } - /** - * Is this on the soloed array - */ - _isSoloed() { - return Solo._soloed.has(this.context) && Solo._soloed.get(this.context).has(this); - } - /** - * Returns true if no one is soloed - */ - _noSolos() { - // either does not have any soloed added - return !Solo._soloed.has(this.context) || - // or has a solo set but doesn't include any items - (Solo._soloed.has(this.context) && Solo._soloed.get(this.context).size === 0); - } - /** - * Solo the current instance and unsolo all other instances. - */ - _updateSolo() { - if (this._isSoloed()) { - this.input.gain.value = 1; - } - else if (this._noSolos()) { - // no one is soloed - this.input.gain.value = 1; - } - else { - this.input.gain.value = 0; - } - } - dispose() { - super.dispose(); - Solo._allSolos.get(this.context).delete(this); - this._removeSolo(); - return this; - } -} -/** - * Hold all of the solo'ed tracks belonging to a specific context - */ -Solo._allSolos = new Map(); -/** - * Hold the currently solo'ed instance(s) - */ -Solo._soloed = new Map(); - -/** - * PanVol is a Tone.Panner and Tone.Volume in one. - * @example - * // pan the incoming signal left and drop the volume - * const panVol = new Tone.PanVol(-0.25, -12).toDestination(); - * const osc = new Tone.Oscillator().connect(panVol).start(); - * @category Component - */ -class PanVol extends ToneAudioNode { - constructor() { - super(optionsFromArguments(PanVol.getDefaults(), arguments, ["pan", "volume"])); - this.name = "PanVol"; - const options = optionsFromArguments(PanVol.getDefaults(), arguments, ["pan", "volume"]); - this._panner = this.input = new Panner({ - context: this.context, - pan: options.pan, - channelCount: options.channelCount, - }); - this.pan = this._panner.pan; - this._volume = this.output = new Volume({ - context: this.context, - volume: options.volume, - }); - this.volume = this._volume.volume; - // connections - this._panner.connect(this._volume); - this.mute = options.mute; - readOnly(this, ["pan", "volume"]); - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - mute: false, - pan: 0, - volume: 0, - channelCount: 1, - }); - } - /** - * Mute/unmute the volume - */ - get mute() { - return this._volume.mute; - } - set mute(mute) { - this._volume.mute = mute; - } - dispose() { - super.dispose(); - this._panner.dispose(); - this.pan.dispose(); - this._volume.dispose(); - this.volume.dispose(); - return this; - } -} - -/** - * Channel provides a channel strip interface with volume, pan, solo and mute controls. - * See [[PanVol]] and [[Solo]] - * @example - * // pan the incoming signal left and drop the volume 12db - * const channel = new Tone.Channel(-0.25, -12); - * @category Component - */ -class Channel extends ToneAudioNode { - constructor() { - super(optionsFromArguments(Channel.getDefaults(), arguments, ["volume", "pan"])); - this.name = "Channel"; - const options = optionsFromArguments(Channel.getDefaults(), arguments, ["volume", "pan"]); - this._solo = this.input = new Solo({ - solo: options.solo, - context: this.context, - }); - this._panVol = this.output = new PanVol({ - context: this.context, - pan: options.pan, - volume: options.volume, - mute: options.mute, - channelCount: options.channelCount - }); - this.pan = this._panVol.pan; - this.volume = this._panVol.volume; - this._solo.connect(this._panVol); - readOnly(this, ["pan", "volume"]); - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - pan: 0, - volume: 0, - mute: false, - solo: false, - channelCount: 1, - }); - } - /** - * Solo/unsolo the channel. Soloing is only relative to other [[Channels]] and [[Solo]] instances - */ - get solo() { - return this._solo.solo; - } - set solo(solo) { - this._solo.solo = solo; - } - /** - * If the current instance is muted, i.e. another instance is soloed, - * or the channel is muted - */ - get muted() { - return this._solo.muted || this.mute; - } - /** - * Mute/unmute the volume - */ - get mute() { - return this._panVol.mute; - } - set mute(mute) { - this._panVol.mute = mute; - } - /** - * Get the gain node belonging to the bus name. Create it if - * it doesn't exist - * @param name The bus name - */ - _getBus(name) { - if (!Channel.buses.has(name)) { - Channel.buses.set(name, new Gain({ context: this.context })); - } - return Channel.buses.get(name); - } - /** - * Send audio to another channel using a string. `send` is a lot like - * [[connect]], except it uses a string instead of an object. This can - * be useful in large applications to decouple sections since [[send]] - * and [[receive]] can be invoked separately in order to connect an object - * @param name The channel name to send the audio - * @param volume The amount of the signal to send. - * Defaults to 0db, i.e. send the entire signal - * @returns Returns the gain node of this connection. - */ - send(name, volume = 0) { - const bus = this._getBus(name); - const sendKnob = new Gain({ - context: this.context, - units: "decibels", - gain: volume, - }); - this.connect(sendKnob); - sendKnob.connect(bus); - return sendKnob; - } - /** - * Receive audio from a channel which was connected with [[send]]. - * @param name The channel name to receive audio from. - */ - receive(name) { - const bus = this._getBus(name); - bus.connect(this); - return this; - } - dispose() { - super.dispose(); - this._panVol.dispose(); - this.pan.dispose(); - this.volume.dispose(); - this._solo.dispose(); - return this; - } -} -/** - * Store the send/receive channels by name. - */ -Channel.buses = new Map(); - -/** - * Tone.Listener is a thin wrapper around the AudioListener. Listener combined - * with [[Panner3D]] makes up the Web Audio API's 3D panning system. Panner3D allows you - * to place sounds in 3D and Listener allows you to navigate the 3D sound environment from - * a first-person perspective. There is only one listener per audio context. - */ -class Listener extends ToneAudioNode { - constructor() { - super(...arguments); - this.name = "Listener"; - this.positionX = new Param({ - context: this.context, - param: this.context.rawContext.listener.positionX, - }); - this.positionY = new Param({ - context: this.context, - param: this.context.rawContext.listener.positionY, - }); - this.positionZ = new Param({ - context: this.context, - param: this.context.rawContext.listener.positionZ, - }); - this.forwardX = new Param({ - context: this.context, - param: this.context.rawContext.listener.forwardX, - }); - this.forwardY = new Param({ - context: this.context, - param: this.context.rawContext.listener.forwardY, - }); - this.forwardZ = new Param({ - context: this.context, - param: this.context.rawContext.listener.forwardZ, - }); - this.upX = new Param({ - context: this.context, - param: this.context.rawContext.listener.upX, - }); - this.upY = new Param({ - context: this.context, - param: this.context.rawContext.listener.upY, - }); - this.upZ = new Param({ - context: this.context, - param: this.context.rawContext.listener.upZ, - }); - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - positionX: 0, - positionY: 0, - positionZ: 0, - forwardX: 0, - forwardY: 0, - forwardZ: -1, - upX: 0, - upY: 1, - upZ: 0, - }); - } - dispose() { - super.dispose(); - this.positionX.dispose(); - this.positionY.dispose(); - this.positionZ.dispose(); - this.forwardX.dispose(); - this.forwardY.dispose(); - this.forwardZ.dispose(); - this.upX.dispose(); - this.upY.dispose(); - this.upZ.dispose(); - return this; - } -} -//------------------------------------- -// INITIALIZATION -//------------------------------------- -onContextInit(context => { - context.listener = new Listener({ context }); -}); -onContextClose(context => { - context.listener.dispose(); -}); - -/** - * The current audio context time of the global [[Context]]. - * See [[Context.now]] - * @category Core - */ -function now() { - return getContext().now(); -} -/** - * The current audio context time of the global [[Context]] without the [[Context.lookAhead]] - * See [[Context.immediate]] - * @category Core - */ -function immediate() { - return getContext().immediate(); -} -/** - * The Transport object belonging to the global Tone.js Context. - * See [[Transport]] - * @category Core - */ -const Transport$1 = getContext().transport; -/** - * The Transport object belonging to the global Tone.js Context. - * See [[Transport]] - * @category Core - */ -function getTransport() { - return getContext().transport; -} -/** - * The Destination (output) belonging to the global Tone.js Context. - * See [[Destination]] - * @category Core - */ -const Destination$1 = getContext().destination; -/** - * @deprecated Use [[Destination]] - */ -const Master = getContext().destination; -/** - * The Destination (output) belonging to the global Tone.js Context. - * See [[Destination]] - * @category Core - */ -function getDestination() { - return getContext().destination; -} -/** - * The [[Listener]] belonging to the global Tone.js Context. - * @category Core - */ -const Listener$1 = getContext().listener; -/** - * The [[Listener]] belonging to the global Tone.js Context. - * @category Core - */ -function getListener() { - return getContext().listener; -} -/** - * Draw is used to synchronize the draw frame with the Transport's callbacks. - * See [[Draw]] - * @category Core - */ -const Draw$1 = getContext().draw; -/** - * Get the singleton attached to the global context. - * Draw is used to synchronize the draw frame with the Transport's callbacks. - * See [[Draw]] - * @category Core - */ -function getDraw() { - return getContext().draw; -} -/** - * A reference to the global context - * See [[Context]] - */ -const context = getContext(); -/** - * Promise which resolves when all of the loading promises are resolved. - * Alias for static [[ToneAudioBuffer.loaded]] method. - * @category Core - */ -function loaded() { - return ToneAudioBuffer.loaded(); -} -const Buffer = ToneAudioBuffer; -const Buffers = ToneAudioBuffers; -const BufferSource = ToneBufferSource; - -export { isArray as $, AudioToGain as A, TransportTimeClass as B, Clock as C, Monophonic as D, Synth as E, Frequency as F, Gain as G, omitFromObject as H, OmniOscillator as I, Envelope as J, writable as K, AmplitudeEnvelope as L, Midi as M, deepMerge as N, OfflineContext as O, Param as P, FMOscillator as Q, Instrument as R, Sampler as S, ToneAudioNode as T, getWorkletGlobalScope as U, Volume as V, WaveShaper as W, workletName as X, warn as Y, MidiClass as Z, __awaiter as _, ToneAudioBuffers as a, ToneWithContext as a0, StateTimeline as a1, TicksClass as a2, isBoolean as a3, isObject as a4, isUndef as a5, clamp as a6, Panner as a7, gainToDb as a8, dbToGain as a9, Context as aA, BaseContext as aB, FrequencyClass as aC, TimeClass as aD, Time as aE, Ticks as aF, TransportTime as aG, Emitter as aH, IntervalTimeline as aI, Timeline as aJ, isFunction as aK, AMOscillator as aL, PulseOscillator as aM, FatOscillator as aN, PWMOscillator as aO, Channel as aP, PanVol as aQ, Solo as aR, version as aS, workletName$1 as aa, ToneOscillatorNode as ab, theWindow as ac, isNote as ad, MembraneSynth as ae, getDestination as af, now as ag, immediate as ah, Transport$1 as ai, getTransport as aj, Destination$1 as ak, Master as al, Listener$1 as am, getListener as an, Draw$1 as ao, getDraw as ap, context as aq, loaded as ar, Buffer as as, Buffers as at, BufferSource as au, start as av, isSupported as aw, Debug as ax, ftom as ay, mtof as az, ToneBufferSource as b, ToneAudioBuffer as c, Source as d, assert as e, isNumber as f, getContext as g, isDefined as h, isString as i, connect as j, Signal as k, connectSeries as l, SignalOperator as m, Multiply as n, optionsFromArguments as o, disconnect as p, Oscillator as q, readOnly as r, setContext as s, connectSignal as t, noOp as u, Player as v, intervalToFrequencyRatio as w, assertRange as x, defaultArg as y, ToneConstantSource as z }; diff --git a/docs/_snowpack/pkg/common/index-d01087d6.js b/docs/_snowpack/pkg/common/index-d01087d6.js deleted file mode 100644 index 01ea043c..00000000 --- a/docs/_snowpack/pkg/common/index-d01087d6.js +++ /dev/null @@ -1,90 +0,0 @@ -/* -object-assign -(c) Sindre Sorhus -@license MIT -*/ -/* eslint-disable no-unused-vars */ -var getOwnPropertySymbols = Object.getOwnPropertySymbols; -var hasOwnProperty = Object.prototype.hasOwnProperty; -var propIsEnumerable = Object.prototype.propertyIsEnumerable; - -function toObject(val) { - if (val === null || val === undefined) { - throw new TypeError('Object.assign cannot be called with null or undefined'); - } - - return Object(val); -} - -function shouldUseNative() { - try { - if (!Object.assign) { - return false; - } - - // Detect buggy property enumeration order in older V8 versions. - - // https://bugs.chromium.org/p/v8/issues/detail?id=4118 - var test1 = new String('abc'); // eslint-disable-line no-new-wrappers - test1[5] = 'de'; - if (Object.getOwnPropertyNames(test1)[0] === '5') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test2 = {}; - for (var i = 0; i < 10; i++) { - test2['_' + String.fromCharCode(i)] = i; - } - var order2 = Object.getOwnPropertyNames(test2).map(function (n) { - return test2[n]; - }); - if (order2.join('') !== '0123456789') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test3 = {}; - 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { - test3[letter] = letter; - }); - if (Object.keys(Object.assign({}, test3)).join('') !== - 'abcdefghijklmnopqrst') { - return false; - } - - return true; - } catch (err) { - // We don't expect any of the above to throw, but better to be safe. - return false; - } -} - -var objectAssign = shouldUseNative() ? Object.assign : function (target, source) { - var from; - var to = toObject(target); - var symbols; - - for (var s = 1; s < arguments.length; s++) { - from = Object(arguments[s]); - - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; - } - } - - if (getOwnPropertySymbols) { - symbols = getOwnPropertySymbols(from); - for (var i = 0; i < symbols.length; i++) { - if (propIsEnumerable.call(from, symbols[i])) { - to[symbols[i]] = from[symbols[i]]; - } - } - } - } - - return to; -}; - -export { objectAssign as o }; diff --git a/docs/_snowpack/pkg/common/index.es-d2606df1.js b/docs/_snowpack/pkg/common/index.es-d2606df1.js deleted file mode 100644 index f2ed81ea..00000000 --- a/docs/_snowpack/pkg/common/index.es-d2606df1.js +++ /dev/null @@ -1,2364 +0,0 @@ -/** - * Fill a string with a repeated character - * - * @param character - * @param repetition - */ -const fillStr = (s, n) => Array(Math.abs(n) + 1).join(s); -function deprecate(original, alternative, fn) { - return function (...args) { - // tslint:disable-next-line - console.warn(`${original} is deprecated. Use ${alternative}.`); - return fn.apply(this, args); - }; -} - -function isNamed(src) { - return src !== null && typeof src === "object" && typeof src.name === "string" - ? true - : false; -} - -function isPitch(pitch) { - return pitch !== null && - typeof pitch === "object" && - typeof pitch.step === "number" && - typeof pitch.alt === "number" - ? true - : false; -} -// The number of fifths of [C, D, E, F, G, A, B] -const FIFTHS = [0, 2, 4, -1, 1, 3, 5]; -// The number of octaves it span each step -const STEPS_TO_OCTS = FIFTHS.map((fifths) => Math.floor((fifths * 7) / 12)); -function encode(pitch) { - const { step, alt, oct, dir = 1 } = pitch; - const f = FIFTHS[step] + 7 * alt; - if (oct === undefined) { - return [dir * f]; - } - const o = oct - STEPS_TO_OCTS[step] - 4 * alt; - return [dir * f, dir * o]; -} -// We need to get the steps from fifths -// Fifths for CDEFGAB are [ 0, 2, 4, -1, 1, 3, 5 ] -// We add 1 to fifths to avoid negative numbers, so: -// for ["F", "C", "G", "D", "A", "E", "B"] we have: -const FIFTHS_TO_STEPS = [3, 0, 4, 1, 5, 2, 6]; -function decode(coord) { - const [f, o, dir] = coord; - const step = FIFTHS_TO_STEPS[unaltered(f)]; - const alt = Math.floor((f + 1) / 7); - if (o === undefined) { - return { step, alt, dir }; - } - const oct = o + 4 * alt + STEPS_TO_OCTS[step]; - return { step, alt, oct, dir }; -} -// Return the number of fifths as if it were unaltered -function unaltered(f) { - const i = (f + 1) % 7; - return i < 0 ? 7 + i : i; -} - -const NoNote = { empty: true, name: "", pc: "", acc: "" }; -const cache$1 = new Map(); -const stepToLetter = (step) => "CDEFGAB".charAt(step); -const altToAcc = (alt) => alt < 0 ? fillStr("b", -alt) : fillStr("#", alt); -const accToAlt = (acc) => acc[0] === "b" ? -acc.length : acc.length; -/** - * Given a note literal (a note name or a note object), returns the Note object - * @example - * note('Bb4') // => { name: "Bb4", midi: 70, chroma: 10, ... } - */ -function note(src) { - const cached = cache$1.get(src); - if (cached) { - return cached; - } - const value = typeof src === "string" - ? parse$1(src) - : isPitch(src) - ? note(pitchName$1(src)) - : isNamed(src) - ? note(src.name) - : NoNote; - cache$1.set(src, value); - return value; -} -const REGEX$1 = /^([a-gA-G]?)(#{1,}|b{1,}|x{1,}|)(-?\d*)\s*(.*)$/; -/** - * @private - */ -function tokenizeNote(str) { - const m = REGEX$1.exec(str); - return [m[1].toUpperCase(), m[2].replace(/x/g, "##"), m[3], m[4]]; -} -/** - * @private - */ -function coordToNote(noteCoord) { - return note(decode(noteCoord)); -} -const mod = (n, m) => ((n % m) + m) % m; -const SEMI = [0, 2, 4, 5, 7, 9, 11]; -function parse$1(noteName) { - const tokens = tokenizeNote(noteName); - if (tokens[0] === "" || tokens[3] !== "") { - return NoNote; - } - const letter = tokens[0]; - const acc = tokens[1]; - const octStr = tokens[2]; - const step = (letter.charCodeAt(0) + 3) % 7; - const alt = accToAlt(acc); - const oct = octStr.length ? +octStr : undefined; - const coord = encode({ step, alt, oct }); - const name = letter + acc + octStr; - const pc = letter + acc; - const chroma = (SEMI[step] + alt + 120) % 12; - const height = oct === undefined - ? mod(SEMI[step] + alt, 12) - 12 * 99 - : SEMI[step] + alt + 12 * (oct + 1); - const midi = height >= 0 && height <= 127 ? height : null; - const freq = oct === undefined ? null : Math.pow(2, (height - 69) / 12) * 440; - return { - empty: false, - acc, - alt, - chroma, - coord, - freq, - height, - letter, - midi, - name, - oct, - pc, - step, - }; -} -function pitchName$1(props) { - const { step, alt, oct } = props; - const letter = stepToLetter(step); - if (!letter) { - return ""; - } - const pc = letter + altToAcc(alt); - return oct || oct === 0 ? pc + oct : pc; -} - -const NoInterval = { empty: true, name: "", acc: "" }; -// shorthand tonal notation (with quality after number) -const INTERVAL_TONAL_REGEX = "([-+]?\\d+)(d{1,4}|m|M|P|A{1,4})"; -// standard shorthand notation (with quality before number) -const INTERVAL_SHORTHAND_REGEX = "(AA|A|P|M|m|d|dd)([-+]?\\d+)"; -const REGEX = new RegExp("^" + INTERVAL_TONAL_REGEX + "|" + INTERVAL_SHORTHAND_REGEX + "$"); -/** - * @private - */ -function tokenizeInterval(str) { - const m = REGEX.exec(`${str}`); - if (m === null) { - return ["", ""]; - } - return m[1] ? [m[1], m[2]] : [m[4], m[3]]; -} -const cache = {}; -/** - * Get interval properties. It returns an object with: - * - * - name: the interval name - * - num: the interval number - * - type: 'perfectable' or 'majorable' - * - q: the interval quality (d, m, M, A) - * - dir: interval direction (1 ascending, -1 descending) - * - simple: the simplified number - * - semitones: the size in semitones - * - chroma: the interval chroma - * - * @param {string} interval - the interval name - * @return {Object} the interval properties - * - * @example - * import { interval } from '@tonaljs/core' - * interval('P5').semitones // => 7 - * interval('m3').type // => 'majorable' - */ -function interval(src) { - return typeof src === "string" - ? cache[src] || (cache[src] = parse(src)) - : isPitch(src) - ? interval(pitchName(src)) - : isNamed(src) - ? interval(src.name) - : NoInterval; -} -const SIZES = [0, 2, 4, 5, 7, 9, 11]; -const TYPES = "PMMPPMM"; -function parse(str) { - const tokens = tokenizeInterval(str); - if (tokens[0] === "") { - return NoInterval; - } - const num = +tokens[0]; - const q = tokens[1]; - const step = (Math.abs(num) - 1) % 7; - const t = TYPES[step]; - if (t === "M" && q === "P") { - return NoInterval; - } - const type = t === "M" ? "majorable" : "perfectable"; - const name = "" + num + q; - const dir = num < 0 ? -1 : 1; - const simple = num === 8 || num === -8 ? num : dir * (step + 1); - const alt = qToAlt(type, q); - const oct = Math.floor((Math.abs(num) - 1) / 7); - const semitones = dir * (SIZES[step] + alt + 12 * oct); - const chroma = (((dir * (SIZES[step] + alt)) % 12) + 12) % 12; - const coord = encode({ step, alt, oct, dir }); - return { - empty: false, - name, - num, - q, - step, - alt, - dir, - type, - simple, - semitones, - chroma, - coord, - oct, - }; -} -/** - * @private - * - * forceDescending is used in the case of unison (#243) - */ -function coordToInterval(coord, forceDescending) { - const [f, o = 0] = coord; - const isDescending = f * 7 + o * 12 < 0; - const ivl = forceDescending || isDescending ? [-f, -o, -1] : [f, o, 1]; - return interval(decode(ivl)); -} -function qToAlt(type, q) { - return (q === "M" && type === "majorable") || - (q === "P" && type === "perfectable") - ? 0 - : q === "m" && type === "majorable" - ? -1 - : /^A+$/.test(q) - ? q.length - : /^d+$/.test(q) - ? -1 * (type === "perfectable" ? q.length : q.length + 1) - : 0; -} -// return the interval name of a pitch -function pitchName(props) { - const { step, alt, oct = 0, dir } = props; - if (!dir) { - return ""; - } - const calcNum = step + 1 + 7 * oct; - // this is an edge case: descending pitch class unison (see #243) - const num = calcNum === 0 ? step + 1 : calcNum; - const d = dir < 0 ? "-" : ""; - const type = TYPES[step] === "M" ? "majorable" : "perfectable"; - const name = d + num + altToQ(type, alt); - return name; -} -function altToQ(type, alt) { - if (alt === 0) { - return type === "majorable" ? "M" : "P"; - } - else if (alt === -1 && type === "majorable") { - return "m"; - } - else if (alt > 0) { - return fillStr("A", alt); - } - else { - return fillStr("d", type === "perfectable" ? alt : alt + 1); - } -} - -/** - * Transpose a note by an interval. - * - * @param {string} note - the note or note name - * @param {string} interval - the interval or interval name - * @return {string} the transposed note name or empty string if not valid notes - * @example - * import { tranpose } from "@tonaljs/core" - * transpose("d3", "3M") // => "F#3" - * transpose("D", "3M") // => "F#" - * ["C", "D", "E", "F", "G"].map(pc => transpose(pc, "M3)) // => ["E", "F#", "G#", "A", "B"] - */ -function transpose(noteName, intervalName) { - const note$1 = note(noteName); - const interval$1 = interval(intervalName); - if (note$1.empty || interval$1.empty) { - return ""; - } - const noteCoord = note$1.coord; - const intervalCoord = interval$1.coord; - const tr = noteCoord.length === 1 - ? [noteCoord[0] + intervalCoord[0]] - : [noteCoord[0] + intervalCoord[0], noteCoord[1] + intervalCoord[1]]; - return coordToNote(tr).name; -} -/** - * Find the interval distance between two notes or coord classes. - * - * To find distance between coord classes, both notes must be coord classes and - * the interval is always ascending - * - * @param {Note|string} from - the note or note name to calculate distance from - * @param {Note|string} to - the note or note name to calculate distance to - * @return {string} the interval name or empty string if not valid notes - * - */ -function distance(fromNote, toNote) { - const from = note(fromNote); - const to = note(toNote); - if (from.empty || to.empty) { - return ""; - } - const fcoord = from.coord; - const tcoord = to.coord; - const fifths = tcoord[0] - fcoord[0]; - const octs = fcoord.length === 2 && tcoord.length === 2 - ? tcoord[1] - fcoord[1] - : -Math.floor((fifths * 7) / 12); - // If it's unison and not pitch class, it can be descending interval (#243) - const forceDescending = to.height === from.height && - to.midi !== null && - from.midi !== null && - from.step > to.step; - return coordToInterval([fifths, octs], forceDescending).name; -} - -var Core = /*#__PURE__*/Object.freeze({ - __proto__: null, - accToAlt: accToAlt, - altToAcc: altToAcc, - coordToInterval: coordToInterval, - coordToNote: coordToNote, - decode: decode, - deprecate: deprecate, - distance: distance, - encode: encode, - fillStr: fillStr, - interval: interval, - isNamed: isNamed, - isPitch: isPitch, - note: note, - stepToLetter: stepToLetter, - tokenizeInterval: tokenizeInterval, - tokenizeNote: tokenizeNote, - transpose: transpose -}); - -// ascending range -function ascR(b, n) { - const a = []; - // tslint:disable-next-line:curly - for (; n--; a[n] = n + b) - ; - return a; -} -// descending range -function descR(b, n) { - const a = []; - // tslint:disable-next-line:curly - for (; n--; a[n] = b - n) - ; - return a; -} -/** - * Creates a numeric range - * - * @param {number} from - * @param {number} to - * @return {Array} - * - * @example - * range(-2, 2) // => [-2, -1, 0, 1, 2] - * range(2, -2) // => [2, 1, 0, -1, -2] - */ -function range(from, to) { - return from < to ? ascR(from, to - from + 1) : descR(from, from - to + 1); -} -/** - * Rotates a list a number of times. It"s completly agnostic about the - * contents of the list. - * - * @param {Integer} times - the number of rotations - * @param {Array} collection - * @return {Array} the rotated collection - * - * @example - * rotate(1, [1, 2, 3]) // => [2, 3, 1] - */ -function rotate(times, arr) { - const len = arr.length; - const n = ((times % len) + len) % len; - return arr.slice(n, len).concat(arr.slice(0, n)); -} -/** - * Return a copy of the collection with the null values removed - * @function - * @param {Array} collection - * @return {Array} - * - * @example - * compact(["a", "b", null, "c"]) // => ["a", "b", "c"] - */ -function compact(arr) { - return arr.filter((n) => n === 0 || n); -} -/** - * Randomizes the order of the specified collection in-place, using the Fisher–Yates shuffle. - * - * @function - * @param {Array} collection - * @return {Array} the collection shuffled - * - * @example - * shuffle(["C", "D", "E", "F"]) // => [...] - */ -function shuffle(arr, rnd = Math.random) { - let i; - let t; - let m = arr.length; - while (m) { - i = Math.floor(rnd() * m--); - t = arr[m]; - arr[m] = arr[i]; - arr[i] = t; - } - return arr; -} -/** - * Get all permutations of an collection - * - * @param {Array} collection - the collection - * @return {Array} an collection with all the permutations - * @example - * permutations(["a", "b", "c"])) // => - * [ - * ["a", "b", "c"], - * ["b", "a", "c"], - * ["b", "c", "a"], - * ["a", "c", "b"], - * ["c", "a", "b"], - * ["c", "b", "a"] - * ] - */ -function permutations(arr) { - if (arr.length === 0) { - return [[]]; - } - return permutations(arr.slice(1)).reduce((acc, perm) => { - return acc.concat(arr.map((e, pos) => { - const newPerm = perm.slice(); - newPerm.splice(pos, 0, arr[0]); - return newPerm; - })); - }, []); -} -var index = { - compact, - permutations, - range, - rotate, - shuffle, -}; - -const EmptyPcset = { - empty: true, - name: "", - setNum: 0, - chroma: "000000000000", - normalized: "000000000000", - intervals: [], -}; -// UTILITIES -const setNumToChroma = (num) => Number(num).toString(2); -const chromaToNumber = (chroma) => parseInt(chroma, 2); -const REGEX$2 = /^[01]{12}$/; -function isChroma(set) { - return REGEX$2.test(set); -} -const isPcsetNum = (set) => typeof set === "number" && set >= 0 && set <= 4095; -const isPcset = (set) => set && isChroma(set.chroma); -const cache$2 = { [EmptyPcset.chroma]: EmptyPcset }; -/** - * Get the pitch class set of a collection of notes or set number or chroma - */ -function get(src) { - const chroma = isChroma(src) - ? src - : isPcsetNum(src) - ? setNumToChroma(src) - : Array.isArray(src) - ? listToChroma(src) - : isPcset(src) - ? src.chroma - : EmptyPcset.chroma; - return (cache$2[chroma] = cache$2[chroma] || chromaToPcset(chroma)); -} -/** - * Use Pcset.properties - * @function - * @deprecated - */ -const pcset = deprecate("Pcset.pcset", "Pcset.get", get); -/** - * Get pitch class set chroma - * @function - * @example - * Pcset.chroma(["c", "d", "e"]); //=> "101010000000" - */ -const chroma = (set) => get(set).chroma; -/** - * Get intervals (from C) of a set - * @function - * @example - * Pcset.intervals(["c", "d", "e"]); //=> - */ -const intervals = (set) => get(set).intervals; -/** - * Get pitch class set number - * @function - * @example - * Pcset.num(["c", "d", "e"]); //=> 2192 - */ -const num = (set) => get(set).setNum; -const IVLS = [ - "1P", - "2m", - "2M", - "3m", - "3M", - "4P", - "5d", - "5P", - "6m", - "6M", - "7m", - "7M", -]; -/** - * @private - * Get the intervals of a pcset *starting from C* - * @param {Set} set - the pitch class set - * @return {IntervalName[]} an array of interval names or an empty array - * if not a valid pitch class set - */ -function chromaToIntervals(chroma) { - const intervals = []; - for (let i = 0; i < 12; i++) { - // tslint:disable-next-line:curly - if (chroma.charAt(i) === "1") - intervals.push(IVLS[i]); - } - return intervals; -} -/** - * Get a list of all possible pitch class sets (all possible chromas) *having - * C as root*. There are 2048 different chromas. If you want them with another - * note you have to transpose it - * - * @see http://allthescales.org/ - * @return {Array} an array of possible chromas from '10000000000' to '11111111111' - */ -function chromas() { - return range(2048, 4095).map(setNumToChroma); -} -/** - * Given a a list of notes or a pcset chroma, produce the rotations - * of the chroma discarding the ones that starts with "0" - * - * This is used, for example, to get all the modes of a scale. - * - * @param {Array|string} set - the list of notes or pitchChr of the set - * @param {boolean} normalize - (Optional, true by default) remove all - * the rotations that starts with "0" - * @return {Array} an array with all the modes of the chroma - * - * @example - * Pcset.modes(["C", "D", "E"]).map(Pcset.intervals) - */ -function modes(set, normalize = true) { - const pcs = get(set); - const binary = pcs.chroma.split(""); - return compact(binary.map((_, i) => { - const r = rotate(i, binary); - return normalize && r[0] === "0" ? null : r.join(""); - })); -} -/** - * Test if two pitch class sets are numentical - * - * @param {Array|string} set1 - one of the pitch class sets - * @param {Array|string} set2 - the other pitch class set - * @return {boolean} true if they are equal - * @example - * Pcset.isEqual(["c2", "d3"], ["c5", "d2"]) // => true - */ -function isEqual(s1, s2) { - return get(s1).setNum === get(s2).setNum; -} -/** - * Create a function that test if a collection of notes is a - * subset of a given set - * - * The function is curryfied. - * - * @param {PcsetChroma|NoteName[]} set - the superset to test against (chroma or - * list of notes) - * @return{function(PcsetChroma|NoteNames[]): boolean} a function accepting a set - * to test against (chroma or list of notes) - * @example - * const inCMajor = Pcset.isSubsetOf(["C", "E", "G"]) - * inCMajor(["e6", "c4"]) // => true - * inCMajor(["e6", "c4", "d3"]) // => false - */ -function isSubsetOf(set) { - const s = get(set).setNum; - return (notes) => { - const o = get(notes).setNum; - // tslint:disable-next-line: no-bitwise - return s && s !== o && (o & s) === o; - }; -} -/** - * Create a function that test if a collection of notes is a - * superset of a given set (it contains all notes and at least one more) - * - * @param {Set} set - an array of notes or a chroma set string to test against - * @return {(subset: Set): boolean} a function that given a set - * returns true if is a subset of the first one - * @example - * const extendsCMajor = Pcset.isSupersetOf(["C", "E", "G"]) - * extendsCMajor(["e6", "a", "c4", "g2"]) // => true - * extendsCMajor(["c6", "e4", "g3"]) // => false - */ -function isSupersetOf(set) { - const s = get(set).setNum; - return (notes) => { - const o = get(notes).setNum; - // tslint:disable-next-line: no-bitwise - return s && s !== o && (o | s) === o; - }; -} -/** - * Test if a given pitch class set includes a note - * - * @param {Array} set - the base set to test against - * @param {string} note - the note to test - * @return {boolean} true if the note is included in the pcset - * - * Can be partially applied - * - * @example - * const isNoteInCMajor = isNoteIncludedIn(['C', 'E', 'G']) - * isNoteInCMajor('C4') // => true - * isNoteInCMajor('C#4') // => false - */ -function isNoteIncludedIn(set) { - const s = get(set); - return (noteName) => { - const n = note(noteName); - return s && !n.empty && s.chroma.charAt(n.chroma) === "1"; - }; -} -/** - * Filter a list with a pitch class set - * - * @param {Array|string} set - the pitch class set notes - * @param {Array|string} notes - the note list to be filtered - * @return {Array} the filtered notes - * - * @example - * Pcset.filter(["C", "D", "E"], ["c2", "c#2", "d2", "c3", "c#3", "d3"]) // => [ "c2", "d2", "c3", "d3" ]) - * Pcset.filter(["C2"], ["c2", "c#2", "d2", "c3", "c#3", "d3"]) // => [ "c2", "c3" ]) - */ -function filter(set) { - const isIncluded = isNoteIncludedIn(set); - return (notes) => { - return notes.filter(isIncluded); - }; -} -var index$1 = { - get, - chroma, - num, - intervals, - chromas, - isSupersetOf, - isSubsetOf, - isNoteIncludedIn, - isEqual, - filter, - modes, - // deprecated - pcset, -}; -//// PRIVATE //// -function chromaRotations(chroma) { - const binary = chroma.split(""); - return binary.map((_, i) => rotate(i, binary).join("")); -} -function chromaToPcset(chroma) { - const setNum = chromaToNumber(chroma); - const normalizedNum = chromaRotations(chroma) - .map(chromaToNumber) - .filter((n) => n >= 2048) - .sort()[0]; - const normalized = setNumToChroma(normalizedNum); - const intervals = chromaToIntervals(chroma); - return { - empty: false, - name: "", - setNum, - chroma, - normalized, - intervals, - }; -} -function listToChroma(set) { - if (set.length === 0) { - return EmptyPcset.chroma; - } - let pitch; - const binary = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; - // tslint:disable-next-line:prefer-for-of - for (let i = 0; i < set.length; i++) { - pitch = note(set[i]); - // tslint:disable-next-line: curly - if (pitch.empty) - pitch = interval(set[i]); - // tslint:disable-next-line: curly - if (!pitch.empty) - binary[pitch.chroma] = 1; - } - return binary.join(""); -} - -/** - * @private - * Chord List - * Source: https://en.wikibooks.org/wiki/Music_Theory/Complete_List_of_Chord_Patterns - * Format: ["intervals", "full name", "abrv1 abrv2"] - */ -const CHORDS = [ - // ==Major== - ["1P 3M 5P", "major", "M ^ "], - ["1P 3M 5P 7M", "major seventh", "maj7 Δ ma7 M7 Maj7 ^7"], - ["1P 3M 5P 7M 9M", "major ninth", "maj9 Δ9 ^9"], - ["1P 3M 5P 7M 9M 13M", "major thirteenth", "maj13 Maj13 ^13"], - ["1P 3M 5P 6M", "sixth", "6 add6 add13 M6"], - ["1P 3M 5P 6M 9M", "sixth/ninth", "6/9 69 M69"], - ["1P 3M 6m 7M", "major seventh flat sixth", "M7b6 ^7b6"], - [ - "1P 3M 5P 7M 11A", - "major seventh sharp eleventh", - "maj#4 Δ#4 Δ#11 M7#11 ^7#11 maj7#11", - ], - // ==Minor== - // '''Normal''' - ["1P 3m 5P", "minor", "m min -"], - ["1P 3m 5P 7m", "minor seventh", "m7 min7 mi7 -7"], - [ - "1P 3m 5P 7M", - "minor/major seventh", - "m/ma7 m/maj7 mM7 mMaj7 m/M7 -Δ7 mΔ -^7", - ], - ["1P 3m 5P 6M", "minor sixth", "m6 -6"], - ["1P 3m 5P 7m 9M", "minor ninth", "m9 -9"], - ["1P 3m 5P 7M 9M", "minor/major ninth", "mM9 mMaj9 -^9"], - ["1P 3m 5P 7m 9M 11P", "minor eleventh", "m11 -11"], - ["1P 3m 5P 7m 9M 13M", "minor thirteenth", "m13 -13"], - // '''Diminished''' - ["1P 3m 5d", "diminished", "dim ° o"], - ["1P 3m 5d 7d", "diminished seventh", "dim7 °7 o7"], - ["1P 3m 5d 7m", "half-diminished", "m7b5 ø -7b5 h7 h"], - // ==Dominant/Seventh== - // '''Normal''' - ["1P 3M 5P 7m", "dominant seventh", "7 dom"], - ["1P 3M 5P 7m 9M", "dominant ninth", "9"], - ["1P 3M 5P 7m 9M 13M", "dominant thirteenth", "13"], - ["1P 3M 5P 7m 11A", "lydian dominant seventh", "7#11 7#4"], - // '''Altered''' - ["1P 3M 5P 7m 9m", "dominant flat ninth", "7b9"], - ["1P 3M 5P 7m 9A", "dominant sharp ninth", "7#9"], - ["1P 3M 7m 9m", "altered", "alt7"], - // '''Suspended''' - ["1P 4P 5P", "suspended fourth", "sus4 sus"], - ["1P 2M 5P", "suspended second", "sus2"], - ["1P 4P 5P 7m", "suspended fourth seventh", "7sus4 7sus"], - ["1P 5P 7m 9M 11P", "eleventh", "11"], - [ - "1P 4P 5P 7m 9m", - "suspended fourth flat ninth", - "b9sus phryg 7b9sus 7b9sus4", - ], - // ==Other== - ["1P 5P", "fifth", "5"], - ["1P 3M 5A", "augmented", "aug + +5 ^#5"], - ["1P 3m 5A", "minor augmented", "m#5 -#5 m+"], - ["1P 3M 5A 7M", "augmented seventh", "maj7#5 maj7+5 +maj7 ^7#5"], - [ - "1P 3M 5P 7M 9M 11A", - "major sharp eleventh (lydian)", - "maj9#11 Δ9#11 ^9#11", - ], - // ==Legacy== - ["1P 2M 4P 5P", "", "sus24 sus4add9"], - ["1P 3M 5A 7M 9M", "", "maj9#5 Maj9#5"], - ["1P 3M 5A 7m", "", "7#5 +7 7+ 7aug aug7"], - ["1P 3M 5A 7m 9A", "", "7#5#9 7#9#5 7alt"], - ["1P 3M 5A 7m 9M", "", "9#5 9+"], - ["1P 3M 5A 7m 9M 11A", "", "9#5#11"], - ["1P 3M 5A 7m 9m", "", "7#5b9 7b9#5"], - ["1P 3M 5A 7m 9m 11A", "", "7#5b9#11"], - ["1P 3M 5A 9A", "", "+add#9"], - ["1P 3M 5A 9M", "", "M#5add9 +add9"], - ["1P 3M 5P 6M 11A", "", "M6#11 M6b5 6#11 6b5"], - ["1P 3M 5P 6M 7M 9M", "", "M7add13"], - ["1P 3M 5P 6M 9M 11A", "", "69#11"], - ["1P 3m 5P 6M 9M", "", "m69 -69"], - ["1P 3M 5P 6m 7m", "", "7b6"], - ["1P 3M 5P 7M 9A 11A", "", "maj7#9#11"], - ["1P 3M 5P 7M 9M 11A 13M", "", "M13#11 maj13#11 M13+4 M13#4"], - ["1P 3M 5P 7M 9m", "", "M7b9"], - ["1P 3M 5P 7m 11A 13m", "", "7#11b13 7b5b13"], - ["1P 3M 5P 7m 13M", "", "7add6 67 7add13"], - ["1P 3M 5P 7m 9A 11A", "", "7#9#11 7b5#9 7#9b5"], - ["1P 3M 5P 7m 9A 11A 13M", "", "13#9#11"], - ["1P 3M 5P 7m 9A 11A 13m", "", "7#9#11b13"], - ["1P 3M 5P 7m 9A 13M", "", "13#9"], - ["1P 3M 5P 7m 9A 13m", "", "7#9b13"], - ["1P 3M 5P 7m 9M 11A", "", "9#11 9+4 9#4"], - ["1P 3M 5P 7m 9M 11A 13M", "", "13#11 13+4 13#4"], - ["1P 3M 5P 7m 9M 11A 13m", "", "9#11b13 9b5b13"], - ["1P 3M 5P 7m 9m 11A", "", "7b9#11 7b5b9 7b9b5"], - ["1P 3M 5P 7m 9m 11A 13M", "", "13b9#11"], - ["1P 3M 5P 7m 9m 11A 13m", "", "7b9b13#11 7b9#11b13 7b5b9b13"], - ["1P 3M 5P 7m 9m 13M", "", "13b9"], - ["1P 3M 5P 7m 9m 13m", "", "7b9b13"], - ["1P 3M 5P 7m 9m 9A", "", "7b9#9"], - ["1P 3M 5P 9M", "", "Madd9 2 add9 add2"], - ["1P 3M 5P 9m", "", "Maddb9"], - ["1P 3M 5d", "", "Mb5"], - ["1P 3M 5d 6M 7m 9M", "", "13b5"], - ["1P 3M 5d 7M", "", "M7b5"], - ["1P 3M 5d 7M 9M", "", "M9b5"], - ["1P 3M 5d 7m", "", "7b5"], - ["1P 3M 5d 7m 9M", "", "9b5"], - ["1P 3M 7m", "", "7no5"], - ["1P 3M 7m 13m", "", "7b13"], - ["1P 3M 7m 9M", "", "9no5"], - ["1P 3M 7m 9M 13M", "", "13no5"], - ["1P 3M 7m 9M 13m", "", "9b13"], - ["1P 3m 4P 5P", "", "madd4"], - ["1P 3m 5P 6m 7M", "", "mMaj7b6"], - ["1P 3m 5P 6m 7M 9M", "", "mMaj9b6"], - ["1P 3m 5P 7m 11P", "", "m7add11 m7add4"], - ["1P 3m 5P 9M", "", "madd9"], - ["1P 3m 5d 6M 7M", "", "o7M7"], - ["1P 3m 5d 7M", "", "oM7"], - ["1P 3m 6m 7M", "", "mb6M7"], - ["1P 3m 6m 7m", "", "m7#5"], - ["1P 3m 6m 7m 9M", "", "m9#5"], - ["1P 3m 5A 7m 9M 11P", "", "m11A"], - ["1P 3m 6m 9m", "", "mb6b9"], - ["1P 2M 3m 5d 7m", "", "m9b5"], - ["1P 4P 5A 7M", "", "M7#5sus4"], - ["1P 4P 5A 7M 9M", "", "M9#5sus4"], - ["1P 4P 5A 7m", "", "7#5sus4"], - ["1P 4P 5P 7M", "", "M7sus4"], - ["1P 4P 5P 7M 9M", "", "M9sus4"], - ["1P 4P 5P 7m 9M", "", "9sus4 9sus"], - ["1P 4P 5P 7m 9M 13M", "", "13sus4 13sus"], - ["1P 4P 5P 7m 9m 13m", "", "7sus4b9b13 7b9b13sus4"], - ["1P 4P 7m 10m", "", "4 quartal"], - ["1P 5P 7m 9m 11P", "", "11b9"], -]; - -const NoChordType = { - ...EmptyPcset, - name: "", - quality: "Unknown", - intervals: [], - aliases: [], -}; -let dictionary = []; -let index$2 = {}; -/** - * Given a chord name or chroma, return the chord properties - * @param {string} source - chord name or pitch class set chroma - * @example - * import { get } from 'tonaljs/chord-type' - * get('major') // => { name: 'major', ... } - */ -function get$1(type) { - return index$2[type] || NoChordType; -} -const chordType = deprecate("ChordType.chordType", "ChordType.get", get$1); -/** - * Get all chord (long) names - */ -function names() { - return dictionary.map((chord) => chord.name).filter((x) => x); -} -/** - * Get all chord symbols - */ -function symbols() { - return dictionary.map((chord) => chord.aliases[0]).filter((x) => x); -} -/** - * Keys used to reference chord types - */ -function keys() { - return Object.keys(index$2); -} -/** - * Return a list of all chord types - */ -function all() { - return dictionary.slice(); -} -const entries = deprecate("ChordType.entries", "ChordType.all", all); -/** - * Clear the dictionary - */ -function removeAll() { - dictionary = []; - index$2 = {}; -} -/** - * Add a chord to the dictionary. - * @param intervals - * @param aliases - * @param [fullName] - */ -function add(intervals, aliases, fullName) { - const quality = getQuality(intervals); - const chord = { - ...get(intervals), - name: fullName || "", - quality, - intervals, - aliases, - }; - dictionary.push(chord); - if (chord.name) { - index$2[chord.name] = chord; - } - index$2[chord.setNum] = chord; - index$2[chord.chroma] = chord; - chord.aliases.forEach((alias) => addAlias(chord, alias)); -} -function addAlias(chord, alias) { - index$2[alias] = chord; -} -function getQuality(intervals) { - const has = (interval) => intervals.indexOf(interval) !== -1; - return has("5A") - ? "Augmented" - : has("3M") - ? "Major" - : has("5d") - ? "Diminished" - : has("3m") - ? "Minor" - : "Unknown"; -} -CHORDS.forEach(([ivls, fullName, names]) => add(ivls.split(" "), names.split(" "), fullName)); -dictionary.sort((a, b) => a.setNum - b.setNum); -var index$1$1 = { - names, - symbols, - get: get$1, - all, - add, - removeAll, - keys, - // deprecated - entries, - chordType, -}; - -// SCALES -// Format: ["intervals", "name", "alias1", "alias2", ...] -const SCALES = [ - // 5-note scales - ["1P 2M 3M 5P 6M", "major pentatonic", "pentatonic"], - ["1P 3M 4P 5P 7M", "ionian pentatonic"], - ["1P 3M 4P 5P 7m", "mixolydian pentatonic", "indian"], - ["1P 2M 4P 5P 6M", "ritusen"], - ["1P 2M 4P 5P 7m", "egyptian"], - ["1P 3M 4P 5d 7m", "neopolitan major pentatonic"], - ["1P 3m 4P 5P 6m", "vietnamese 1"], - ["1P 2m 3m 5P 6m", "pelog"], - ["1P 2m 4P 5P 6m", "kumoijoshi"], - ["1P 2M 3m 5P 6m", "hirajoshi"], - ["1P 2m 4P 5d 7m", "iwato"], - ["1P 2m 4P 5P 7m", "in-sen"], - ["1P 3M 4A 5P 7M", "lydian pentatonic", "chinese"], - ["1P 3m 4P 6m 7m", "malkos raga"], - ["1P 3m 4P 5d 7m", "locrian pentatonic", "minor seven flat five pentatonic"], - ["1P 3m 4P 5P 7m", "minor pentatonic", "vietnamese 2"], - ["1P 3m 4P 5P 6M", "minor six pentatonic"], - ["1P 2M 3m 5P 6M", "flat three pentatonic", "kumoi"], - ["1P 2M 3M 5P 6m", "flat six pentatonic"], - ["1P 2m 3M 5P 6M", "scriabin"], - ["1P 3M 5d 6m 7m", "whole tone pentatonic"], - ["1P 3M 4A 5A 7M", "lydian #5P pentatonic"], - ["1P 3M 4A 5P 7m", "lydian dominant pentatonic"], - ["1P 3m 4P 5P 7M", "minor #7M pentatonic"], - ["1P 3m 4d 5d 7m", "super locrian pentatonic"], - // 6-note scales - ["1P 2M 3m 4P 5P 7M", "minor hexatonic"], - ["1P 2A 3M 5P 5A 7M", "augmented"], - ["1P 2M 3m 3M 5P 6M", "major blues"], - ["1P 2M 4P 5P 6M 7m", "piongio"], - ["1P 2m 3M 4A 6M 7m", "prometheus neopolitan"], - ["1P 2M 3M 4A 6M 7m", "prometheus"], - ["1P 2m 3M 5d 6m 7m", "mystery #1"], - ["1P 2m 3M 4P 5A 6M", "six tone symmetric"], - ["1P 2M 3M 4A 5A 7m", "whole tone", "messiaen's mode #1"], - ["1P 2m 4P 4A 5P 7M", "messiaen's mode #5"], - ["1P 3m 4P 5d 5P 7m", "minor blues", "blues"], - // 7-note scales - ["1P 2M 3M 4P 5d 6m 7m", "locrian major", "arabian"], - ["1P 2m 3M 4A 5P 6m 7M", "double harmonic lydian"], - ["1P 2M 3m 4P 5P 6m 7M", "harmonic minor"], - [ - "1P 2m 2A 3M 4A 6m 7m", - "altered", - "super locrian", - "diminished whole tone", - "pomeroy", - ], - ["1P 2M 3m 4P 5d 6m 7m", "locrian #2", "half-diminished", "aeolian b5"], - [ - "1P 2M 3M 4P 5P 6m 7m", - "mixolydian b6", - "melodic minor fifth mode", - "hindu", - ], - ["1P 2M 3M 4A 5P 6M 7m", "lydian dominant", "lydian b7", "overtone"], - ["1P 2M 3M 4A 5P 6M 7M", "lydian"], - ["1P 2M 3M 4A 5A 6M 7M", "lydian augmented"], - [ - "1P 2m 3m 4P 5P 6M 7m", - "dorian b2", - "phrygian #6", - "melodic minor second mode", - ], - ["1P 2M 3m 4P 5P 6M 7M", "melodic minor"], - ["1P 2m 3m 4P 5d 6m 7m", "locrian"], - [ - "1P 2m 3m 4d 5d 6m 7d", - "ultralocrian", - "superlocrian bb7", - "superlocrian diminished", - ], - ["1P 2m 3m 4P 5d 6M 7m", "locrian 6", "locrian natural 6", "locrian sharp 6"], - ["1P 2A 3M 4P 5P 5A 7M", "augmented heptatonic"], - // Source https://en.wikipedia.org/wiki/Ukrainian_Dorian_scale - [ - "1P 2M 3m 4A 5P 6M 7m", - "dorian #4", - "ukrainian dorian", - "romanian minor", - "altered dorian", - ], - ["1P 2M 3m 4A 5P 6M 7M", "lydian diminished"], - ["1P 2m 3m 4P 5P 6m 7m", "phrygian"], - ["1P 2M 3M 4A 5A 7m 7M", "leading whole tone"], - ["1P 2M 3M 4A 5P 6m 7m", "lydian minor"], - ["1P 2m 3M 4P 5P 6m 7m", "phrygian dominant", "spanish", "phrygian major"], - ["1P 2m 3m 4P 5P 6m 7M", "balinese"], - ["1P 2m 3m 4P 5P 6M 7M", "neopolitan major"], - ["1P 2M 3m 4P 5P 6m 7m", "aeolian", "minor"], - ["1P 2M 3M 4P 5P 6m 7M", "harmonic major"], - ["1P 2m 3M 4P 5P 6m 7M", "double harmonic major", "gypsy"], - ["1P 2M 3m 4P 5P 6M 7m", "dorian"], - ["1P 2M 3m 4A 5P 6m 7M", "hungarian minor"], - ["1P 2A 3M 4A 5P 6M 7m", "hungarian major"], - ["1P 2m 3M 4P 5d 6M 7m", "oriental"], - ["1P 2m 3m 3M 4A 5P 7m", "flamenco"], - ["1P 2m 3m 4A 5P 6m 7M", "todi raga"], - ["1P 2M 3M 4P 5P 6M 7m", "mixolydian", "dominant"], - ["1P 2m 3M 4P 5d 6m 7M", "persian"], - ["1P 2M 3M 4P 5P 6M 7M", "major", "ionian"], - ["1P 2m 3M 5d 6m 7m 7M", "enigmatic"], - [ - "1P 2M 3M 4P 5A 6M 7M", - "major augmented", - "major #5", - "ionian augmented", - "ionian #5", - ], - ["1P 2A 3M 4A 5P 6M 7M", "lydian #9"], - // 8-note scales - ["1P 2m 2M 4P 4A 5P 6m 7M", "messiaen's mode #4"], - ["1P 2m 3M 4P 4A 5P 6m 7M", "purvi raga"], - ["1P 2m 3m 3M 4P 5P 6m 7m", "spanish heptatonic"], - ["1P 2M 3M 4P 5P 6M 7m 7M", "bebop"], - ["1P 2M 3m 3M 4P 5P 6M 7m", "bebop minor"], - ["1P 2M 3M 4P 5P 5A 6M 7M", "bebop major"], - ["1P 2m 3m 4P 5d 5P 6m 7m", "bebop locrian"], - ["1P 2M 3m 4P 5P 6m 7m 7M", "minor bebop"], - ["1P 2M 3m 4P 5d 6m 6M 7M", "diminished", "whole-half diminished"], - ["1P 2M 3M 4P 5d 5P 6M 7M", "ichikosucho"], - ["1P 2M 3m 4P 5P 6m 6M 7M", "minor six diminished"], - [ - "1P 2m 3m 3M 4A 5P 6M 7m", - "half-whole diminished", - "dominant diminished", - "messiaen's mode #2", - ], - ["1P 3m 3M 4P 5P 6M 7m 7M", "kafi raga"], - ["1P 2M 3M 4P 4A 5A 6A 7M", "messiaen's mode #6"], - // 9-note scales - ["1P 2M 3m 3M 4P 5d 5P 6M 7m", "composite blues"], - ["1P 2M 3m 3M 4A 5P 6m 7m 7M", "messiaen's mode #3"], - // 10-note scales - ["1P 2m 2M 3m 4P 4A 5P 6m 6M 7M", "messiaen's mode #7"], - // 12-note scales - ["1P 2m 2M 3m 3M 4P 5d 5P 6m 6M 7m 7M", "chromatic"], -]; - -const NoScaleType = { - ...EmptyPcset, - intervals: [], - aliases: [], -}; -let dictionary$1 = []; -let index$3 = {}; -function names$1() { - return dictionary$1.map((scale) => scale.name); -} -/** - * Given a scale name or chroma, return the scale properties - * - * @param {string} type - scale name or pitch class set chroma - * @example - * import { get } from 'tonaljs/scale-type' - * get('major') // => { name: 'major', ... } - */ -function get$2(type) { - return index$3[type] || NoScaleType; -} -const scaleType = deprecate("ScaleDictionary.scaleType", "ScaleType.get", get$2); -/** - * Return a list of all scale types - */ -function all$1() { - return dictionary$1.slice(); -} -const entries$1 = deprecate("ScaleDictionary.entries", "ScaleType.all", all$1); -/** - * Keys used to reference scale types - */ -function keys$1() { - return Object.keys(index$3); -} -/** - * Clear the dictionary - */ -function removeAll$1() { - dictionary$1 = []; - index$3 = {}; -} -/** - * Add a scale into dictionary - * @param intervals - * @param name - * @param aliases - */ -function add$1(intervals, name, aliases = []) { - const scale = { ...get(intervals), name, intervals, aliases }; - dictionary$1.push(scale); - index$3[scale.name] = scale; - index$3[scale.setNum] = scale; - index$3[scale.chroma] = scale; - scale.aliases.forEach((alias) => addAlias$1(scale, alias)); - return scale; -} -function addAlias$1(scale, alias) { - index$3[alias] = scale; -} -SCALES.forEach(([ivls, name, ...aliases]) => add$1(ivls.split(" "), name, aliases)); -var index$1$2 = { - names: names$1, - get: get$2, - all: all$1, - add: add$1, - removeAll: removeAll$1, - keys: keys$1, - // deprecated - entries: entries$1, - scaleType, -}; - -// source: https://en.wikipedia.org/wiki/Note_value -const DATA = [ - [ - 0.125, - "dl", - ["large", "duplex longa", "maxima", "octuple", "octuple whole"], - ], - [0.25, "l", ["long", "longa"]], - [0.5, "d", ["double whole", "double", "breve"]], - [1, "w", ["whole", "semibreve"]], - [2, "h", ["half", "minim"]], - [4, "q", ["quarter", "crotchet"]], - [8, "e", ["eighth", "quaver"]], - [16, "s", ["sixteenth", "semiquaver"]], - [32, "t", ["thirty-second", "demisemiquaver"]], - [64, "sf", ["sixty-fourth", "hemidemisemiquaver"]], - [128, "h", ["hundred twenty-eighth"]], - [256, "th", ["two hundred fifty-sixth"]], -]; - -const VALUES = []; -DATA.forEach(([denominator, shorthand, names]) => add$2(denominator, shorthand, names)); -const NoDuration = { - empty: true, - name: "", - value: 0, - fraction: [0, 0], - shorthand: "", - dots: "", - names: [], -}; -function names$2() { - return VALUES.reduce((names, duration) => { - duration.names.forEach((name) => names.push(name)); - return names; - }, []); -} -function shorthands() { - return VALUES.map((dur) => dur.shorthand); -} -const REGEX$3 = /^([^.]+)(\.*)$/; -function get$3(name) { - const [_, simple, dots] = REGEX$3.exec(name) || []; - const base = VALUES.find((dur) => dur.shorthand === simple || dur.names.includes(simple)); - if (!base) { - return NoDuration; - } - const fraction = calcDots(base.fraction, dots.length); - const value = fraction[0] / fraction[1]; - return { ...base, name, dots, value, fraction }; -} -const value = (name) => get$3(name).value; -const fraction = (name) => get$3(name).fraction; -var index$4 = { names: names$2, shorthands, get: get$3, value, fraction }; -//// PRIVATE //// -function add$2(denominator, shorthand, names) { - VALUES.push({ - empty: false, - dots: "", - name: "", - value: 1 / denominator, - fraction: denominator < 1 ? [1 / denominator, 1] : [1, denominator], - shorthand, - names, - }); -} -function calcDots(fraction, dots) { - const pow = Math.pow(2, dots); - let numerator = fraction[0] * pow; - let denominator = fraction[1] * pow; - const base = numerator; - // add fractions - for (let i = 0; i < dots; i++) { - numerator += base / Math.pow(2, i + 1); - } - // simplify - while (numerator % 2 === 0 && denominator % 2 === 0) { - numerator /= 2; - denominator /= 2; - } - return [numerator, denominator]; -} - -/** - * Get the natural list of names - */ -function names$3() { - return "1P 2M 3M 4P 5P 6m 7m".split(" "); -} -/** - * Get properties of an interval - * - * @function - * @example - * Interval.get('P4') // => {"alt": 0, "dir": 1, "name": "4P", "num": 4, "oct": 0, "q": "P", "semitones": 5, "simple": 4, "step": 3, "type": "perfectable"} - */ -const get$4 = interval; -/** - * Get name of an interval - * - * @function - * @example - * Interval.name('4P') // => "4P" - * Interval.name('P4') // => "4P" - * Interval.name('C4') // => "" - */ -const name = (name) => interval(name).name; -/** - * Get semitones of an interval - * @function - * @example - * Interval.semitones('P4') // => 5 - */ -const semitones = (name) => interval(name).semitones; -/** - * Get quality of an interval - * @function - * @example - * Interval.quality('P4') // => "P" - */ -const quality = (name) => interval(name).q; -/** - * Get number of an interval - * @function - * @example - * Interval.num('P4') // => 4 - */ -const num$1 = (name) => interval(name).num; -/** - * Get the simplified version of an interval. - * - * @function - * @param {string} interval - the interval to simplify - * @return {string} the simplified interval - * - * @example - * Interval.simplify("9M") // => "2M" - * Interval.simplify("2M") // => "2M" - * Interval.simplify("-2M") // => "7m" - * ["8P", "9M", "10M", "11P", "12P", "13M", "14M", "15P"].map(Interval.simplify) - * // => [ "8P", "2M", "3M", "4P", "5P", "6M", "7M", "8P" ] - */ -function simplify(name) { - const i = interval(name); - return i.empty ? "" : i.simple + i.q; -} -/** - * Get the inversion (https://en.wikipedia.org/wiki/Inversion_(music)#Intervals) - * of an interval. - * - * @function - * @param {string} interval - the interval to invert in interval shorthand - * notation or interval array notation - * @return {string} the inverted interval - * - * @example - * Interval.invert("3m") // => "6M" - * Interval.invert("2M") // => "7m" - */ -function invert(name) { - const i = interval(name); - if (i.empty) { - return ""; - } - const step = (7 - i.step) % 7; - const alt = i.type === "perfectable" ? -i.alt : -(i.alt + 1); - return interval({ step, alt, oct: i.oct, dir: i.dir }).name; -} -// interval numbers -const IN = [1, 2, 2, 3, 3, 4, 5, 5, 6, 6, 7, 7]; -// interval qualities -const IQ = "P m M m M P d P m M m M".split(" "); -/** - * Get interval name from semitones number. Since there are several interval - * names for the same number, the name it's arbitrary, but deterministic. - * - * @param {Integer} num - the number of semitones (can be negative) - * @return {string} the interval name - * @example - * Interval.fromSemitones(7) // => "5P" - * Interval.fromSemitones(-7) // => "-5P" - */ -function fromSemitones(semitones) { - const d = semitones < 0 ? -1 : 1; - const n = Math.abs(semitones); - const c = n % 12; - const o = Math.floor(n / 12); - return d * (IN[c] + 7 * o) + IQ[c]; -} -/** - * Find interval between two notes - * - * @example - * Interval.distance("C4", "G4"); // => "5P" - */ -const distance$1 = distance; -/** - * Adds two intervals - * - * @function - * @param {string} interval1 - * @param {string} interval2 - * @return {string} the added interval name - * @example - * Interval.add("3m", "5P") // => "7m" - */ -const add$3 = combinator((a, b) => [a[0] + b[0], a[1] + b[1]]); -/** - * Returns a function that adds an interval - * - * @function - * @example - * ['1P', '2M', '3M'].map(Interval.addTo('5P')) // => ["5P", "6M", "7M"] - */ -const addTo = (interval) => (other) => add$3(interval, other); -/** - * Subtracts two intervals - * - * @function - * @param {string} minuendInterval - * @param {string} subtrahendInterval - * @return {string} the substracted interval name - * @example - * Interval.substract('5P', '3M') // => '3m' - * Interval.substract('3M', '5P') // => '-3m' - */ -const substract = combinator((a, b) => [a[0] - b[0], a[1] - b[1]]); -function transposeFifths(interval, fifths) { - const ivl = get$4(interval); - if (ivl.empty) - return ""; - const [nFifths, nOcts, dir] = ivl.coord; - return coordToInterval([nFifths + fifths, nOcts, dir]).name; -} -var index$5 = { - names: names$3, - get: get$4, - name, - num: num$1, - semitones, - quality, - fromSemitones, - distance: distance$1, - invert, - simplify, - add: add$3, - addTo, - substract, - transposeFifths, -}; -function combinator(fn) { - return (a, b) => { - const coordA = interval(a).coord; - const coordB = interval(b).coord; - if (coordA && coordB) { - const coord = fn(coordA, coordB); - return coordToInterval(coord).name; - } - }; -} - -function isMidi(arg) { - return +arg >= 0 && +arg <= 127; -} -/** - * Get the note midi number (a number between 0 and 127) - * - * It returns undefined if not valid note name - * - * @function - * @param {string|number} note - the note name or midi number - * @return {Integer} the midi number or undefined if not valid note - * @example - * import { toMidi } from '@tonaljs/midi' - * toMidi("C4") // => 60 - * toMidi(60) // => 60 - * toMidi('60') // => 60 - */ -function toMidi(note$1) { - if (isMidi(note$1)) { - return +note$1; - } - const n = note(note$1); - return n.empty ? null : n.midi; -} -/** - * Get the frequency in hertzs from midi number - * - * @param {number} midi - the note midi number - * @param {number} [tuning = 440] - A4 tuning frequency in Hz (440 by default) - * @return {number} the frequency or null if not valid note midi - * @example - * import { midiToFreq} from '@tonaljs/midi' - * midiToFreq(69) // => 440 - */ -function midiToFreq(midi, tuning = 440) { - return Math.pow(2, (midi - 69) / 12) * tuning; -} -const L2 = Math.log(2); -const L440 = Math.log(440); -/** - * Get the midi number from a frequency in hertz. The midi number can - * contain decimals (with two digits precission) - * - * @param {number} frequency - * @return {number} - * @example - * import { freqToMidi} from '@tonaljs/midi' - * freqToMidi(220)); //=> 57 - * freqToMidi(261.62)); //=> 60 - * freqToMidi(261)); //=> 59.96 - */ -function freqToMidi(freq) { - const v = (12 * (Math.log(freq) - L440)) / L2 + 69; - return Math.round(v * 100) / 100; -} -const SHARPS = "C C# D D# E F F# G G# A A# B".split(" "); -const FLATS = "C Db D Eb E F Gb G Ab A Bb B".split(" "); -/** - * Given a midi number, returns a note name. The altered notes will have - * flats unless explicitly set with the optional `useSharps` parameter. - * - * @function - * @param {number} midi - the midi note number - * @param {Object} options = default: `{ sharps: false, pitchClass: false }` - * @param {boolean} useSharps - (Optional) set to true to use sharps instead of flats - * @return {string} the note name - * @example - * import { midiToNoteName } from '@tonaljs/midi' - * midiToNoteName(61) // => "Db4" - * midiToNoteName(61, { pitchClass: true }) // => "Db" - * midiToNoteName(61, { sharps: true }) // => "C#4" - * midiToNoteName(61, { pitchClass: true, sharps: true }) // => "C#" - * // it rounds to nearest note - * midiToNoteName(61.7) // => "D4" - */ -function midiToNoteName(midi, options = {}) { - if (isNaN(midi) || midi === -Infinity || midi === Infinity) - return ""; - midi = Math.round(midi); - const pcs = options.sharps === true ? SHARPS : FLATS; - const pc = pcs[midi % 12]; - if (options.pitchClass) { - return pc; - } - const o = Math.floor(midi / 12) - 1; - return pc + o; -} -var index$6 = { isMidi, toMidi, midiToFreq, midiToNoteName, freqToMidi }; - -const NAMES = ["C", "D", "E", "F", "G", "A", "B"]; -const toName = (n) => n.name; -const onlyNotes = (array) => array.map(note).filter((n) => !n.empty); -/** - * Return the natural note names without octave - * @function - * @example - * Note.names(); // => ["C", "D", "E", "F", "G", "A", "B"] - */ -function names$4(array) { - if (array === undefined) { - return NAMES.slice(); - } - else if (!Array.isArray(array)) { - return []; - } - else { - return onlyNotes(array).map(toName); - } -} -/** - * Get a note from a note name - * - * @function - * @example - * Note.get('Bb4') // => { name: "Bb4", midi: 70, chroma: 10, ... } - */ -const get$5 = note; -/** - * Get the note name - * @function - */ -const name$1 = (note) => get$5(note).name; -/** - * Get the note pitch class name - * @function - */ -const pitchClass = (note) => get$5(note).pc; -/** - * Get the note accidentals - * @function - */ -const accidentals = (note) => get$5(note).acc; -/** - * Get the note octave - * @function - */ -const octave = (note) => get$5(note).oct; -/** - * Get the note midi - * @function - */ -const midi = (note) => get$5(note).midi; -/** - * Get the note midi - * @function - */ -const freq = (note) => get$5(note).freq; -/** - * Get the note chroma - * @function - */ -const chroma$1 = (note) => get$5(note).chroma; -/** - * Given a midi number, returns a note name. Uses flats for altered notes. - * - * @function - * @param {number} midi - the midi note number - * @return {string} the note name - * @example - * Note.fromMidi(61) // => "Db4" - * Note.fromMidi(61.7) // => "D4" - */ -function fromMidi(midi) { - return midiToNoteName(midi); -} -/** - * Given a midi number, returns a note name. Uses flats for altered notes. - */ -function fromFreq(freq) { - return midiToNoteName(freqToMidi(freq)); -} -/** - * Given a midi number, returns a note name. Uses flats for altered notes. - */ -function fromFreqSharps(freq) { - return midiToNoteName(freqToMidi(freq), { sharps: true }); -} -/** - * Given a midi number, returns a note name. Uses flats for altered notes. - * - * @function - * @param {number} midi - the midi note number - * @return {string} the note name - * @example - * Note.fromMidiSharps(61) // => "C#4" - */ -function fromMidiSharps(midi) { - return midiToNoteName(midi, { sharps: true }); -} -/** - * Transpose a note by an interval - */ -const transpose$1 = transpose; -const tr = transpose; -/** - * Transpose by an interval. - * @function - * @param {string} interval - * @return {function} a function that transposes by the given interval - * @example - * ["C", "D", "E"].map(Note.transposeBy("5P")); - * // => ["G", "A", "B"] - */ -const transposeBy = (interval) => (note) => transpose$1(note, interval); -const trBy = transposeBy; -/** - * Transpose from a note - * @function - * @param {string} note - * @return {function} a function that transposes the the note by an interval - * ["1P", "3M", "5P"].map(Note.transposeFrom("C")); - * // => ["C", "E", "G"] - */ -const transposeFrom = (note) => (interval) => transpose$1(note, interval); -const trFrom = transposeFrom; -/** - * Transpose a note by a number of perfect fifths. - * - * @function - * @param {string} note - the note name - * @param {number} fifhts - the number of fifths - * @return {string} the transposed note name - * - * @example - * import { transposeFifths } from "@tonaljs/note" - * transposeFifths("G4", 1) // => "D" - * [0, 1, 2, 3, 4].map(fifths => transposeFifths("C", fifths)) // => ["C", "G", "D", "A", "E"] - */ -function transposeFifths$1(noteName, fifths) { - const note = get$5(noteName); - if (note.empty) { - return ""; - } - const [nFifths, nOcts] = note.coord; - const transposed = nOcts === undefined - ? coordToNote([nFifths + fifths]) - : coordToNote([nFifths + fifths, nOcts]); - return transposed.name; -} -const trFifths = transposeFifths$1; -const ascending = (a, b) => a.height - b.height; -const descending = (a, b) => b.height - a.height; -function sortedNames(notes, comparator) { - comparator = comparator || ascending; - return onlyNotes(notes).sort(comparator).map(toName); -} -function sortedUniqNames(notes) { - return sortedNames(notes, ascending).filter((n, i, a) => i === 0 || n !== a[i - 1]); -} -/** - * Simplify a note - * - * @function - * @param {string} note - the note to be simplified - * - sameAccType: default true. Use same kind of accidentals that source - * @return {string} the simplified note or '' if not valid note - * @example - * simplify("C##") // => "D" - * simplify("C###") // => "D#" - * simplify("C###") - * simplify("B#4") // => "C5" - */ -const simplify$1 = (noteName) => { - const note = get$5(noteName); - if (note.empty) { - return ""; - } - return midiToNoteName(note.midi || note.chroma, { - sharps: note.alt > 0, - pitchClass: note.midi === null, - }); -}; -/** - * Get enharmonic of a note - * - * @function - * @param {string} note - * @param [string] - [optional] Destination pitch class - * @return {string} the enharmonic note name or '' if not valid note - * @example - * Note.enharmonic("Db") // => "C#" - * Note.enharmonic("C") // => "C" - * Note.enharmonic("F2","E#") // => "E#2" - */ -function enharmonic(noteName, destName) { - const src = get$5(noteName); - if (src.empty) { - return ""; - } - // destination: use given or generate one - const dest = get$5(destName || - midiToNoteName(src.midi || src.chroma, { - sharps: src.alt < 0, - pitchClass: true, - })); - // ensure destination is valid - if (dest.empty || dest.chroma !== src.chroma) { - return ""; - } - // if src has no octave, no need to calculate anything else - if (src.oct === undefined) { - return dest.pc; - } - // detect any octave overflow - const srcChroma = src.chroma - src.alt; - const destChroma = dest.chroma - dest.alt; - const destOctOffset = srcChroma > 11 || destChroma < 0 - ? -1 - : srcChroma < 0 || destChroma > 11 - ? +1 - : 0; - // calculate the new octave - const destOct = src.oct + destOctOffset; - return dest.pc + destOct; -} -var index$7 = { - names: names$4, - get: get$5, - name: name$1, - pitchClass, - accidentals, - octave, - midi, - ascending, - descending, - sortedNames, - sortedUniqNames, - fromMidi, - fromMidiSharps, - freq, - fromFreq, - fromFreqSharps, - chroma: chroma$1, - transpose: transpose$1, - tr, - transposeBy, - trBy, - transposeFrom, - trFrom, - transposeFifths: transposeFifths$1, - trFifths, - simplify: simplify$1, - enharmonic, -}; - -const NoRomanNumeral = { empty: true, name: "", chordType: "" }; -const cache$3 = {}; -/** - * Get properties of a roman numeral string - * - * @function - * @param {string} - the roman numeral string (can have type, like: Imaj7) - * @return {Object} - the roman numeral properties - * @param {string} name - the roman numeral (tonic) - * @param {string} type - the chord type - * @param {string} num - the number (1 = I, 2 = II...) - * @param {boolean} major - major or not - * - * @example - * romanNumeral("VIIb5") // => { name: "VII", type: "b5", num: 7, major: true } - */ -function get$6(src) { - return typeof src === "string" - ? cache$3[src] || (cache$3[src] = parse$2(src)) - : typeof src === "number" - ? get$6(NAMES$1[src] || "") - : isPitch(src) - ? fromPitch(src) - : isNamed(src) - ? get$6(src.name) - : NoRomanNumeral; -} -const romanNumeral = deprecate("RomanNumeral.romanNumeral", "RomanNumeral.get", get$6); -/** - * Get roman numeral names - * - * @function - * @param {boolean} [isMajor=true] - * @return {Array} - * - * @example - * names() // => ["I", "II", "III", "IV", "V", "VI", "VII"] - */ -function names$5(major = true) { - return (major ? NAMES$1 : NAMES_MINOR).slice(); -} -function fromPitch(pitch) { - return get$6(altToAcc(pitch.alt) + NAMES$1[pitch.step]); -} -const REGEX$4 = /^(#{1,}|b{1,}|x{1,}|)(IV|I{1,3}|VI{0,2}|iv|i{1,3}|vi{0,2})([^IViv]*)$/; -function tokenize(str) { - return (REGEX$4.exec(str) || ["", "", "", ""]); -} -const ROMANS = "I II III IV V VI VII"; -const NAMES$1 = ROMANS.split(" "); -const NAMES_MINOR = ROMANS.toLowerCase().split(" "); -function parse$2(src) { - const [name, acc, roman, chordType] = tokenize(src); - if (!roman) { - return NoRomanNumeral; - } - const upperRoman = roman.toUpperCase(); - const step = NAMES$1.indexOf(upperRoman); - const alt = accToAlt(acc); - const dir = 1; - return { - empty: false, - name, - roman, - interval: interval({ step, alt, dir }).name, - acc, - chordType, - alt, - step, - major: roman === upperRoman, - oct: 0, - dir, - }; -} -var index$8 = { - names: names$5, - get: get$6, - // deprecated - romanNumeral, -}; - -const Empty = Object.freeze([]); -const NoKey = { - type: "major", - tonic: "", - alteration: 0, - keySignature: "", -}; -const NoKeyScale = { - tonic: "", - grades: Empty, - intervals: Empty, - scale: Empty, - chords: Empty, - chordsHarmonicFunction: Empty, - chordScales: Empty, -}; -const NoMajorKey = { - ...NoKey, - ...NoKeyScale, - type: "major", - minorRelative: "", - scale: Empty, - secondaryDominants: Empty, - secondaryDominantsMinorRelative: Empty, - substituteDominants: Empty, - substituteDominantsMinorRelative: Empty, -}; -const NoMinorKey = { - ...NoKey, - type: "minor", - relativeMajor: "", - natural: NoKeyScale, - harmonic: NoKeyScale, - melodic: NoKeyScale, -}; -const mapScaleToType = (scale, list, sep = "") => list.map((type, i) => `${scale[i]}${sep}${type}`); -function keyScale(grades, chords, harmonicFunctions, chordScales) { - return (tonic) => { - const intervals = grades.map((gr) => get$6(gr).interval || ""); - const scale = intervals.map((interval) => transpose(tonic, interval)); - return { - tonic, - grades, - intervals, - scale, - chords: mapScaleToType(scale, chords), - chordsHarmonicFunction: harmonicFunctions.slice(), - chordScales: mapScaleToType(scale, chordScales, " "), - }; - }; -} -const distInFifths = (from, to) => { - const f = note(from); - const t = note(to); - return f.empty || t.empty ? 0 : t.coord[0] - f.coord[0]; -}; -const MajorScale = keyScale("I II III IV V VI VII".split(" "), "maj7 m7 m7 maj7 7 m7 m7b5".split(" "), "T SD T SD D T D".split(" "), "major,dorian,phrygian,lydian,mixolydian,minor,locrian".split(",")); -const NaturalScale = keyScale("I II bIII IV V bVI bVII".split(" "), "m7 m7b5 maj7 m7 m7 maj7 7".split(" "), "T SD T SD D SD SD".split(" "), "minor,locrian,major,dorian,phrygian,lydian,mixolydian".split(",")); -const HarmonicScale = keyScale("I II bIII IV V bVI VII".split(" "), "mMaj7 m7b5 +maj7 m7 7 maj7 o7".split(" "), "T SD T SD D SD D".split(" "), "harmonic minor,locrian 6,major augmented,lydian diminished,phrygian dominant,lydian #9,ultralocrian".split(",")); -const MelodicScale = keyScale("I II bIII IV V VI VII".split(" "), "m6 m7 +maj7 7 7 m7b5 m7b5".split(" "), "T SD T SD D ".split(" "), "melodic minor,dorian b2,lydian augmented,lydian dominant,mixolydian b6,locrian #2,altered".split(",")); -/** - * Get a major key properties in a given tonic - * @param tonic - */ -function majorKey(tonic) { - const pc = note(tonic).pc; - if (!pc) - return NoMajorKey; - const keyScale = MajorScale(pc); - const alteration = distInFifths("C", pc); - const romanInTonic = (src) => { - const r = get$6(src); - if (r.empty) - return ""; - return transpose(tonic, r.interval) + r.chordType; - }; - return { - ...keyScale, - type: "major", - minorRelative: transpose(pc, "-3m"), - alteration, - keySignature: altToAcc(alteration), - secondaryDominants: "- VI7 VII7 I7 II7 III7 -".split(" ").map(romanInTonic), - secondaryDominantsMinorRelative: "- IIIm7b5 IV#m7 Vm7 VIm7 VIIm7b5 -" - .split(" ") - .map(romanInTonic), - substituteDominants: "- bIII7 IV7 bV7 bVI7 bVII7 -" - .split(" ") - .map(romanInTonic), - substituteDominantsMinorRelative: "- IIIm7 Im7 IIbm7 VIm7 IVm7 -" - .split(" ") - .map(romanInTonic), - }; -} -/** - * Get minor key properties in a given tonic - * @param tonic - */ -function minorKey(tnc) { - const pc = note(tnc).pc; - if (!pc) - return NoMinorKey; - const alteration = distInFifths("C", pc) - 3; - return { - type: "minor", - tonic: pc, - relativeMajor: transpose(pc, "3m"), - alteration, - keySignature: altToAcc(alteration), - natural: NaturalScale(pc), - harmonic: HarmonicScale(pc), - melodic: MelodicScale(pc), - }; -} -/** - * Given a key signature, returns the tonic of the major key - * @param sigature - * @example - * majorTonicFromKeySignature('###') // => 'A' - */ -function majorTonicFromKeySignature(sig) { - if (typeof sig === "number") { - return transposeFifths$1("C", sig); - } - else if (typeof sig === "string" && /^b+|#+$/.test(sig)) { - return transposeFifths$1("C", accToAlt(sig)); - } - return null; -} -var index$9 = { majorKey, majorTonicFromKeySignature, minorKey }; - -const MODES = [ - [0, 2773, 0, "ionian", "", "Maj7", "major"], - [1, 2902, 2, "dorian", "m", "m7"], - [2, 3418, 4, "phrygian", "m", "m7"], - [3, 2741, -1, "lydian", "", "Maj7"], - [4, 2774, 1, "mixolydian", "", "7"], - [5, 2906, 3, "aeolian", "m", "m7", "minor"], - [6, 3434, 5, "locrian", "dim", "m7b5"], -]; -const NoMode = { - ...EmptyPcset, - name: "", - alt: 0, - modeNum: NaN, - triad: "", - seventh: "", - aliases: [], -}; -const modes$1 = MODES.map(toMode); -const index$a = {}; -modes$1.forEach((mode) => { - index$a[mode.name] = mode; - mode.aliases.forEach((alias) => { - index$a[alias] = mode; - }); -}); -/** - * Get a Mode by it's name - * - * @example - * get('dorian') - * // => - * // { - * // intervals: [ '1P', '2M', '3m', '4P', '5P', '6M', '7m' ], - * // modeNum: 1, - * // chroma: '101101010110', - * // normalized: '101101010110', - * // name: 'dorian', - * // setNum: 2902, - * // alt: 2, - * // triad: 'm', - * // seventh: 'm7', - * // aliases: [] - * // } - */ -function get$7(name) { - return typeof name === "string" - ? index$a[name.toLowerCase()] || NoMode - : name && name.name - ? get$7(name.name) - : NoMode; -} -const mode = deprecate("Mode.mode", "Mode.get", get$7); -/** - * Get a list of all modes - */ -function all$2() { - return modes$1.slice(); -} -const entries$2 = deprecate("Mode.mode", "Mode.all", all$2); -/** - * Get a list of all mode names - */ -function names$6() { - return modes$1.map((mode) => mode.name); -} -function toMode(mode) { - const [modeNum, setNum, alt, name, triad, seventh, alias] = mode; - const aliases = alias ? [alias] : []; - const chroma = Number(setNum).toString(2); - const intervals = get$2(name).intervals; - return { - empty: false, - intervals, - modeNum, - chroma, - normalized: chroma, - name, - setNum, - alt, - triad, - seventh, - aliases, - }; -} -function notes(modeName, tonic) { - return get$7(modeName).intervals.map((ivl) => transpose(tonic, ivl)); -} -function chords(chords) { - return (modeName, tonic) => { - const mode = get$7(modeName); - if (mode.empty) - return []; - const triads = rotate(mode.modeNum, chords); - const tonics = mode.intervals.map((i) => transpose(tonic, i)); - return triads.map((triad, i) => tonics[i] + triad); - }; -} -const triads = chords(MODES.map((x) => x[4])); -const seventhChords = chords(MODES.map((x) => x[5])); -function distance$2(destination, source) { - const from = get$7(source); - const to = get$7(destination); - if (from.empty || to.empty) - return ""; - return simplify(transposeFifths("1P", to.alt - from.alt)); -} -function relativeTonic(destination, source, tonic) { - return transpose(tonic, distance$2(destination, source)); -} -var index$1$3 = { - get: get$7, - names: names$6, - all: all$2, - distance: distance$2, - relativeTonic, - notes, - triads, - seventhChords, - // deprecated - entries: entries$2, - mode, -}; - -/** - * References: - * - https://www.researchgate.net/publication/327567188_An_Algorithm_for_Spelling_the_Pitches_of_Any_Musical_Scale - * @module scale - */ -const NoScale = { - empty: true, - name: "", - type: "", - tonic: null, - setNum: NaN, - chroma: "", - normalized: "", - aliases: [], - notes: [], - intervals: [], -}; -/** - * Given a string with a scale name and (optionally) a tonic, split - * that components. - * - * It retuns an array with the form [ name, tonic ] where tonic can be a - * note name or null and name can be any arbitrary string - * (this function doesn"t check if that scale name exists) - * - * @function - * @param {string} name - the scale name - * @return {Array} an array [tonic, name] - * @example - * tokenize("C mixolydean") // => ["C", "mixolydean"] - * tokenize("anything is valid") // => ["", "anything is valid"] - * tokenize() // => ["", ""] - */ -function tokenize$1(name) { - if (typeof name !== "string") { - return ["", ""]; - } - const i = name.indexOf(" "); - const tonic = note(name.substring(0, i)); - if (tonic.empty) { - const n = note(name); - return n.empty ? ["", name] : [n.name, ""]; - } - const type = name.substring(tonic.name.length + 1); - return [tonic.name, type.length ? type : ""]; -} -/** - * Get all scale names - * @function - */ -const names$7 = names$1; -/** - * Get a Scale from a scale name. - */ -function get$8(src) { - const tokens = Array.isArray(src) ? src : tokenize$1(src); - const tonic = note(tokens[0]).name; - const st = get$2(tokens[1]); - if (st.empty) { - return NoScale; - } - const type = st.name; - const notes = tonic - ? st.intervals.map((i) => transpose(tonic, i)) - : []; - const name = tonic ? tonic + " " + type : type; - return { ...st, name, type, tonic, notes }; -} -const scale = deprecate("Scale.scale", "Scale.get", get$8); -/** - * Get all chords that fits a given scale - * - * @function - * @param {string} name - the scale name - * @return {Array} - the chord names - * - * @example - * scaleChords("pentatonic") // => ["5", "64", "M", "M6", "Madd9", "Msus2"] - */ -function scaleChords(name) { - const s = get$8(name); - const inScale = isSubsetOf(s.chroma); - return all() - .filter((chord) => inScale(chord.chroma)) - .map((chord) => chord.aliases[0]); -} -/** - * Get all scales names that are a superset of the given one - * (has the same notes and at least one more) - * - * @function - * @param {string} name - * @return {Array} a list of scale names - * @example - * extended("major") // => ["bebop", "bebop dominant", "bebop major", "chromatic", "ichikosucho"] - */ -function extended(name) { - const s = get$8(name); - const isSuperset = isSupersetOf(s.chroma); - return all$1() - .filter((scale) => isSuperset(scale.chroma)) - .map((scale) => scale.name); -} -/** - * Find all scales names that are a subset of the given one - * (has less notes but all from the given scale) - * - * @function - * @param {string} name - * @return {Array} a list of scale names - * - * @example - * reduced("major") // => ["ionian pentatonic", "major pentatonic", "ritusen"] - */ -function reduced(name) { - const isSubset = isSubsetOf(get$8(name).chroma); - return all$1() - .filter((scale) => isSubset(scale.chroma)) - .map((scale) => scale.name); -} -/** - * Given an array of notes, return the scale: a pitch class set starting from - * the first note of the array - * - * @function - * @param {string[]} notes - * @return {string[]} pitch classes with same tonic - * @example - * scaleNotes(['C4', 'c3', 'C5', 'C4', 'c4']) // => ["C"] - * scaleNotes(['D4', 'c#5', 'A5', 'F#6']) // => ["D", "F#", "A", "C#"] - */ -function scaleNotes(notes) { - const pcset = notes.map((n) => note(n).pc).filter((x) => x); - const tonic = pcset[0]; - const scale = sortedUniqNames(pcset); - return rotate(scale.indexOf(tonic), scale); -} -/** - * Find mode names of a scale - * - * @function - * @param {string} name - scale name - * @example - * modeNames("C pentatonic") // => [ - * ["C", "major pentatonic"], - * ["D", "egyptian"], - * ["E", "malkos raga"], - * ["G", "ritusen"], - * ["A", "minor pentatonic"] - * ] - */ -function modeNames(name) { - const s = get$8(name); - if (s.empty) { - return []; - } - const tonics = s.tonic ? s.notes : s.intervals; - return modes(s.chroma) - .map((chroma, i) => { - const modeName = get$8(chroma).name; - return modeName ? [tonics[i], modeName] : ["", ""]; - }) - .filter((x) => x[0]); -} -function getNoteNameOf(scale) { - const names = Array.isArray(scale) ? scaleNotes(scale) : get$8(scale).notes; - const chromas = names.map((name) => note(name).chroma); - return (noteOrMidi) => { - const currNote = typeof noteOrMidi === "number" - ? note(fromMidi(noteOrMidi)) - : note(noteOrMidi); - const height = currNote.height; - if (height === undefined) - return undefined; - const chroma = height % 12; - const position = chromas.indexOf(chroma); - if (position === -1) - return undefined; - return enharmonic(currNote.name, names[position]); - }; -} -function rangeOf(scale) { - const getName = getNoteNameOf(scale); - return (fromNote, toNote) => { - const from = note(fromNote).height; - const to = note(toNote).height; - if (from === undefined || to === undefined) - return []; - return range(from, to) - .map(getName) - .filter((x) => x); - }; -} -var index$b = { - get: get$8, - names: names$7, - extended, - modeNames, - reduced, - scaleChords, - scaleNotes, - tokenize: tokenize$1, - rangeOf, - // deprecated - scale, -}; - -export { index$6 as A, index$1$3 as B, Core as C, index$8 as D, accToAlt as E, altToAcc as F, coordToInterval as G, coordToNote as H, decode as I, encode as J, fillStr as K, isNamed as L, isPitch as M, stepToLetter as N, tokenizeInterval as O, index$7 as a, index$5 as b, all as c, distance as d, tokenizeNote as e, deprecate as f, get$1 as g, isSupersetOf as h, index$b as i, all$1 as j, isSubsetOf as k, get$6 as l, modes as m, note as n, interval as o, compact as p, toMidi as q, range as r, midiToNoteName as s, transpose as t, index$1 as u, index$1$1 as v, index$1$2 as w, index as x, index$4 as y, index$9 as z }; diff --git a/docs/_snowpack/pkg/common/webmidi.min-97732fd4.js b/docs/_snowpack/pkg/common/webmidi.min-97732fd4.js deleted file mode 100644 index f58b4b13..00000000 --- a/docs/_snowpack/pkg/common/webmidi.min-97732fd4.js +++ /dev/null @@ -1,37 +0,0 @@ -import { c as createCommonjsModule, a as commonjsGlobal } from './_commonjsHelpers-8c19dec8.js'; - -var webmidi_min = createCommonjsModule(function (module) { -/* - -WebMidi v2.5.3 - -WebMidi.js helps you tame the Web MIDI API. Send and receive MIDI messages with ease. Control instruments with user-friendly functions (playNote, sendPitchBend, etc.). React to MIDI input with simple event listeners (noteon, pitchbend, controlchange, etc.). -https://github.com/djipco/webmidi - - -The MIT License (MIT) - -Copyright (c) 2015-2019, Jean-Philippe Côté - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and -associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial -portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT -NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES -OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -*/ - - -!function(scope){function WebMidi(){if(WebMidi.prototype._singleton)throw new Error("WebMidi is a singleton, it cannot be instantiated directly.");(WebMidi.prototype._singleton=this)._inputs=[],this._outputs=[],this._userHandlers={},this._stateChangeQueue=[],this._processingStateChange=!1,this._midiInterfaceEvents=["connected","disconnected"],this._nrpnBuffer=[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],this._nrpnEventsEnabled=!0,this._nrpnTypes=["entry","increment","decrement"],this._notes=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],this._semitones={C:0,D:2,E:4,F:5,G:7,A:9,B:11},Object.defineProperties(this,{MIDI_SYSTEM_MESSAGES:{value:{sysex:240,timecode:241,songposition:242,songselect:243,tuningrequest:246,sysexend:247,clock:248,start:250,continue:251,stop:252,activesensing:254,reset:255,midimessage:0,unknownsystemmessage:-1},writable:!1,enumerable:!0,configurable:!1},MIDI_CHANNEL_MESSAGES:{value:{noteoff:8,noteon:9,keyaftertouch:10,controlchange:11,channelmode:11,nrpn:11,programchange:12,channelaftertouch:13,pitchbend:14},writable:!1,enumerable:!0,configurable:!1},MIDI_REGISTERED_PARAMETER:{value:{pitchbendrange:[0,0],channelfinetuning:[0,1],channelcoarsetuning:[0,2],tuningprogram:[0,3],tuningbank:[0,4],modulationrange:[0,5],azimuthangle:[61,0],elevationangle:[61,1],gain:[61,2],distanceratio:[61,3],maximumdistance:[61,4],maximumdistancegain:[61,5],referencedistanceratio:[61,6],panspreadangle:[61,7],rollangle:[61,8]},writable:!1,enumerable:!0,configurable:!1},MIDI_CONTROL_CHANGE_MESSAGES:{value:{bankselectcoarse:0,modulationwheelcoarse:1,breathcontrollercoarse:2,footcontrollercoarse:4,portamentotimecoarse:5,dataentrycoarse:6,volumecoarse:7,balancecoarse:8,pancoarse:10,expressioncoarse:11,effectcontrol1coarse:12,effectcontrol2coarse:13,generalpurposeslider1:16,generalpurposeslider2:17,generalpurposeslider3:18,generalpurposeslider4:19,bankselectfine:32,modulationwheelfine:33,breathcontrollerfine:34,footcontrollerfine:36,portamentotimefine:37,dataentryfine:38,volumefine:39,balancefine:40,panfine:42,expressionfine:43,effectcontrol1fine:44,effectcontrol2fine:45,holdpedal:64,portamento:65,sustenutopedal:66,softpedal:67,legatopedal:68,hold2pedal:69,soundvariation:70,resonance:71,soundreleasetime:72,soundattacktime:73,brightness:74,soundcontrol6:75,soundcontrol7:76,soundcontrol8:77,soundcontrol9:78,soundcontrol10:79,generalpurposebutton1:80,generalpurposebutton2:81,generalpurposebutton3:82,generalpurposebutton4:83,reverblevel:91,tremololevel:92,choruslevel:93,celestelevel:94,phaserlevel:95,databuttonincrement:96,databuttondecrement:97,nonregisteredparametercoarse:98,nonregisteredparameterfine:99,registeredparametercoarse:100,registeredparameterfine:101},writable:!1,enumerable:!0,configurable:!1},MIDI_NRPN_MESSAGES:{value:{entrymsb:6,entrylsb:38,increment:96,decrement:97,paramlsb:98,parammsb:99,nullactiveparameter:127},writable:!1,enumerable:!0,configurable:!1},MIDI_CHANNEL_MODE_MESSAGES:{value:{allsoundoff:120,resetallcontrollers:121,localcontrol:122,allnotesoff:123,omnimodeoff:124,omnimodeon:125,monomodeon:126,polymodeon:127},writable:!1,enumerable:!0,configurable:!1},octaveOffset:{value:0,writable:!0,enumerable:!0,configurable:!1}}),Object.defineProperties(this,{supported:{enumerable:!0,get:function(){return "requestMIDIAccess"in navigator}},enabled:{enumerable:!0,get:function(){return void 0!==this.interface}.bind(this)},inputs:{enumerable:!0,get:function(){return this._inputs}.bind(this)},outputs:{enumerable:!0,get:function(){return this._outputs}.bind(this)},sysexEnabled:{enumerable:!0,get:function(){return !(!this.interface||!this.interface.sysexEnabled)}.bind(this)},nrpnEventsEnabled:{enumerable:!0,get:function(){return !!this._nrpnEventsEnabled}.bind(this),set:function(enabled){return this._nrpnEventsEnabled=enabled,this._nrpnEventsEnabled}},nrpnTypes:{enumerable:!0,get:function(){return this._nrpnTypes}.bind(this)},time:{enumerable:!0,get:function(){return performance.now()}}});}var wm=new WebMidi;function Input(midiInput){var that=this;this._userHandlers={channel:{},system:{}},this._midiInput=midiInput,Object.defineProperties(this,{connection:{enumerable:!0,get:function(){return that._midiInput.connection}},id:{enumerable:!0,get:function(){return that._midiInput.id}},manufacturer:{enumerable:!0,get:function(){return that._midiInput.manufacturer}},name:{enumerable:!0,get:function(){return that._midiInput.name}},state:{enumerable:!0,get:function(){return that._midiInput.state}},type:{enumerable:!0,get:function(){return that._midiInput.type}}}),this._initializeUserHandlers(),this._midiInput.onmidimessage=this._onMidiMessage.bind(this);}function Output(midiOutput){var that=this;this._midiOutput=midiOutput,Object.defineProperties(this,{connection:{enumerable:!0,get:function(){return that._midiOutput.connection}},id:{enumerable:!0,get:function(){return that._midiOutput.id}},manufacturer:{enumerable:!0,get:function(){return that._midiOutput.manufacturer}},name:{enumerable:!0,get:function(){return that._midiOutput.name}},state:{enumerable:!0,get:function(){return that._midiOutput.state}},type:{enumerable:!0,get:function(){return that._midiOutput.type}}});}WebMidi.prototype.enable=function(callback,sysex){this.enabled||(this.supported?navigator.requestMIDIAccess({sysex:sysex}).then(function(midiAccess){var promiseTimeout,events=[],promises=[];this.interface=midiAccess,this._resetInterfaceUserHandlers(),this.interface.onstatechange=function(e){events.push(e);};for(var inputs=midiAccess.inputs.values(),input=inputs.next();input&&!input.done;input=inputs.next())promises.push(input.value.open());for(var outputs=midiAccess.outputs.values(),output=outputs.next();output&&!output.done;output=outputs.next())promises.push(output.value.open());function onPortsOpen(){clearTimeout(promiseTimeout),this._updateInputsAndOutputs(),this.interface.onstatechange=this._onInterfaceStateChange.bind(this),"function"==typeof callback&&callback.call(this),events.forEach(function(event){this._onInterfaceStateChange(event);}.bind(this));}promiseTimeout=setTimeout(onPortsOpen.bind(this),200),Promise&&Promise.all(promises).catch(function(err){}).then(onPortsOpen.bind(this));}.bind(this),function(err){"function"==typeof callback&&callback.call(this,err);}.bind(this)):"function"==typeof callback&&callback(new Error("The Web MIDI API is not supported by your browser.")));},WebMidi.prototype.disable=function(){if(!this.supported)throw new Error("The Web MIDI API is not supported by your browser.");this.enabled&&(this.removeListener(),this.inputs.forEach(function(input){input.removeListener();})),this.interface&&(this.interface.onstatechange=void 0),this.interface=void 0,this._inputs=[],this._outputs=[],this._nrpnEventsEnabled=!0,this._resetInterfaceUserHandlers();},WebMidi.prototype.addListener=function(type,listener){if(!this.enabled)throw new Error("WebMidi must be enabled before adding event listeners.");if("function"!=typeof listener)throw new TypeError("The 'listener' parameter must be a function.");if(!(0<=this._midiInterfaceEvents.indexOf(type)))throw new TypeError("The specified event type is not supported.");return this._userHandlers[type].push(listener),this},WebMidi.prototype.hasListener=function(type,listener){if(!this.enabled)throw new Error("WebMidi must be enabled before checking event listeners.");if("function"!=typeof listener)throw new TypeError("The 'listener' parameter must be a function.");if(!(0<=this._midiInterfaceEvents.indexOf(type)))throw new TypeError("The specified event type is not supported.");for(var o=0;o>4,channelBufferIndex=15&e.data[0],channel=1+channelBufferIndex;if(1=wm.MIDI_NRPN_MESSAGES.increment&&data1<=wm.MIDI_NRPN_MESSAGES.parammsb||data1===wm.MIDI_NRPN_MESSAGES.entrymsb||data1===wm.MIDI_NRPN_MESSAGES.entrylsb)){var ccEvent={target:this,type:"controlchange",data:e.data,timestamp:e.timeStamp,channel:channel,controller:{number:data1,name:this.getCcNameByNumber(data1)},value:data2};if(ccEvent.controller.number===wm.MIDI_NRPN_MESSAGES.parammsb&&ccEvent.value!=wm.MIDI_NRPN_MESSAGES.nullactiveparameter)wm._nrpnBuffer[channelBufferIndex]=[],wm._nrpnBuffer[channelBufferIndex][0]=ccEvent;else if(1===wm._nrpnBuffer[channelBufferIndex].length&&ccEvent.controller.number===wm.MIDI_NRPN_MESSAGES.paramlsb)wm._nrpnBuffer[channelBufferIndex].push(ccEvent);else if(2!==wm._nrpnBuffer[channelBufferIndex].length||ccEvent.controller.number!==wm.MIDI_NRPN_MESSAGES.increment&&ccEvent.controller.number!==wm.MIDI_NRPN_MESSAGES.decrement&&ccEvent.controller.number!==wm.MIDI_NRPN_MESSAGES.entrymsb)if(3===wm._nrpnBuffer[channelBufferIndex].length&&wm._nrpnBuffer[channelBufferIndex][2].number===wm.MIDI_NRPN_MESSAGES.entrymsb&&ccEvent.controller.number===wm.MIDI_NRPN_MESSAGES.entrylsb)wm._nrpnBuffer[channelBufferIndex].push(ccEvent);else if(3<=wm._nrpnBuffer[channelBufferIndex].length&&wm._nrpnBuffer[channelBufferIndex].length<=4&&ccEvent.controller.number===wm.MIDI_NRPN_MESSAGES.parammsb&&ccEvent.value===wm.MIDI_NRPN_MESSAGES.nullactiveparameter)wm._nrpnBuffer[channelBufferIndex].push(ccEvent);else if(4<=wm._nrpnBuffer[channelBufferIndex].length&&wm._nrpnBuffer[channelBufferIndex].length<=5&&ccEvent.controller.number===wm.MIDI_NRPN_MESSAGES.paramlsb&&ccEvent.value===wm.MIDI_NRPN_MESSAGES.nullactiveparameter){wm._nrpnBuffer[channelBufferIndex].push(ccEvent);var rawData=[];wm._nrpnBuffer[channelBufferIndex].forEach(function(ev){rawData.push(ev.data);});var nrpnNumber=wm._nrpnBuffer[channelBufferIndex][0].value<<7|wm._nrpnBuffer[channelBufferIndex][1].value,nrpnValue=wm._nrpnBuffer[channelBufferIndex][2].value;6===wm._nrpnBuffer[channelBufferIndex].length&&(nrpnValue=wm._nrpnBuffer[channelBufferIndex][2].value<<7|wm._nrpnBuffer[channelBufferIndex][3].value);var nrpnControllerType="";switch(wm._nrpnBuffer[channelBufferIndex][2].controller.number){case wm.MIDI_NRPN_MESSAGES.entrymsb:nrpnControllerType=wm._nrpnTypes[0];break;case wm.MIDI_NRPN_MESSAGES.increment:nrpnControllerType=wm._nrpnTypes[1];break;case wm.MIDI_NRPN_MESSAGES.decrement:nrpnControllerType=wm._nrpnTypes[2];break;default:throw new Error("The NPRN type was unidentifiable.")}var nrpnEvent={timestamp:ccEvent.timestamp,channel:ccEvent.channel,type:"nrpn",data:rawData,controller:{number:nrpnNumber,type:nrpnControllerType,name:"Non-Registered Parameter "+nrpnNumber},value:nrpnValue};wm._nrpnBuffer[channelBufferIndex]=[],this._userHandlers.channel[nrpnEvent.type]&&this._userHandlers.channel[nrpnEvent.type][nrpnEvent.channel]&&this._userHandlers.channel[nrpnEvent.type][nrpnEvent.channel].forEach(function(callback){callback(nrpnEvent);});}else wm._nrpnBuffer[channelBufferIndex]=[];else wm._nrpnBuffer[channelBufferIndex].push(ccEvent);}},Input.prototype._parseChannelEvent=function(e){var data1,data2,command=e.data[0]>>4,channel=1+(15&e.data[0]);1>7&127,lsb=127&value;return this.send(wm.MIDI_SYSTEM_MESSAGES.songposition,[msb,lsb],this._parseTimeParameter(options.time)),this},Output.prototype.sendSongSelect=function(value,options){if(options=options||{},!(0<=(value=Math.floor(value))&&value<=127))throw new RangeError("The song number must be between 0 and 127.");return this.send(wm.MIDI_SYSTEM_MESSAGES.songselect,[value],this._parseTimeParameter(options.time)),this},Output.prototype.sendTuningRequest=function(options){return options=options||{},this.send(wm.MIDI_SYSTEM_MESSAGES.tuningrequest,void 0,this._parseTimeParameter(options.time)),this},Output.prototype.sendClock=function(options){return options=options||{},this.send(wm.MIDI_SYSTEM_MESSAGES.clock,void 0,this._parseTimeParameter(options.time)),this},Output.prototype.sendStart=function(options){return options=options||{},this.send(wm.MIDI_SYSTEM_MESSAGES.start,void 0,this._parseTimeParameter(options.time)),this},Output.prototype.sendContinue=function(options){return options=options||{},this.send(wm.MIDI_SYSTEM_MESSAGES.continue,void 0,this._parseTimeParameter(options.time)),this},Output.prototype.sendStop=function(options){return options=options||{},this.send(wm.MIDI_SYSTEM_MESSAGES.stop,void 0,this._parseTimeParameter(options.time)),this},Output.prototype.sendActiveSensing=function(options){return options=options||{},this.send(wm.MIDI_SYSTEM_MESSAGES.activesensing,[],this._parseTimeParameter(options.time)),this},Output.prototype.sendReset=function(options){return options=options||{},this.send(wm.MIDI_SYSTEM_MESSAGES.reset,void 0,this._parseTimeParameter(options.time)),this},Output.prototype.stopNote=function(note,channel,options){if("all"===note)return this.sendChannelMode("allnotesoff",0,channel,options);var nVelocity=64;return (options=options||{}).rawVelocity?!isNaN(options.velocity)&&0<=options.velocity&&options.velocity<=127&&(nVelocity=options.velocity):!isNaN(options.velocity)&&0<=options.velocity&&options.velocity<=1&&(nVelocity=127*options.velocity),this._convertNoteToArray(note).forEach(function(item){wm.toMIDIChannels(channel).forEach(function(ch){this.send((wm.MIDI_CHANNEL_MESSAGES.noteoff<<4)+(ch-1),[item,Math.round(nVelocity)],this._parseTimeParameter(options.time));}.bind(this));}.bind(this)),this},Output.prototype.playNote=function(note,channel,options){var time,nVelocity=64;if((options=options||{}).rawVelocity?!isNaN(options.velocity)&&0<=options.velocity&&options.velocity<=127&&(nVelocity=options.velocity):!isNaN(options.velocity)&&0<=options.velocity&&options.velocity<=1&&(nVelocity=127*options.velocity),time=this._parseTimeParameter(options.time),this._convertNoteToArray(note).forEach(function(item){wm.toMIDIChannels(channel).forEach(function(ch){this.send((wm.MIDI_CHANNEL_MESSAGES.noteon<<4)+(ch-1),[item,Math.round(nVelocity)],time);}.bind(this));}.bind(this)),!isNaN(options.duration)){options.duration<=0&&(options.duration=0);var nRelease=64;options.rawVelocity?!isNaN(options.release)&&0<=options.release&&options.release<=127&&(nRelease=options.release):!isNaN(options.release)&&0<=options.release&&options.release<=1&&(nRelease=127*options.release),this._convertNoteToArray(note).forEach(function(item){wm.toMIDIChannels(channel).forEach(function(ch){this.send((wm.MIDI_CHANNEL_MESSAGES.noteoff<<4)+(ch-1),[item,Math.round(nRelease)],(time||wm.time)+options.duration);}.bind(this));}.bind(this));}return this},Output.prototype.sendKeyAftertouch=function(note,channel,pressure,options){var that=this;if(options=options||{},channel<1||16>7&127,lsb=127&fine;return wm.toMIDIChannels(channel).forEach(function(){that.setRegisteredParameter("channelcoarsetuning",coarse,channel,{time:options.time}),that.setRegisteredParameter("channelfinetuning",[msb,lsb],channel,{time:options.time});}),this},Output.prototype.setTuningProgram=function(value,channel,options){var that=this;if(options=options||{},!(0<=(value=Math.floor(value))&&value<=127))throw new RangeError("The program value must be between 0 and 127");return wm.toMIDIChannels(channel).forEach(function(){that.setRegisteredParameter("tuningprogram",value,channel,{time:options.time});}),this},Output.prototype.setTuningBank=function(value,channel,options){var that=this;if(options=options||{},!(0<=(value=Math.floor(value)||0)&&value<=127))throw new RangeError("The bank value must be between 0 and 127");return wm.toMIDIChannels(channel).forEach(function(){that.setRegisteredParameter("tuningbank",value,channel,{time:options.time});}),this},Output.prototype.sendChannelMode=function(command,value,channel,options){if(options=options||{},"string"==typeof command){if(!(command=wm.MIDI_CHANNEL_MODE_MESSAGES[command]))throw new TypeError("Invalid channel mode message name.")}else if(!(120<=(command=Math.floor(command))&&command<=127))throw new RangeError("Channel mode numerical identifiers must be between 120 and 127.");if((value=Math.floor(value)||0)<0||127>7&127,lsb=127&nLevel;return wm.toMIDIChannels(channel).forEach(function(ch){that.send((wm.MIDI_CHANNEL_MESSAGES.pitchbend<<4)+(ch-1),[lsb,msb],that._parseTimeParameter(options.time));}),this},Output.prototype._parseTimeParameter=function(time){var value,parsed=parseFloat(time);return "string"==typeof time&&"+"===time.substring(0,1)?parsed&&0wm.time&&(value=parsed),value},Output.prototype._convertNoteToArray=function(note){var notes=[];return Array.isArray(note)||(note=[note]),note.forEach(function(item){notes.push(wm.guessNoteNumber(item));}),notes},module.exports?module.exports=wm:scope.WebMidi||(scope.WebMidi=wm);}(commonjsGlobal); -}); - -export { webmidi_min as w }; diff --git a/docs/_snowpack/pkg/estraverse.js b/docs/_snowpack/pkg/estraverse.js deleted file mode 100644 index 82acb8b0..00000000 --- a/docs/_snowpack/pkg/estraverse.js +++ /dev/null @@ -1,810 +0,0 @@ -import { c as createCommonjsModule } from './common/_commonjsHelpers-8c19dec8.js'; - -var estraverse = createCommonjsModule(function (module, exports) { -/* - Copyright (C) 2012-2013 Yusuke Suzuki - Copyright (C) 2012 Ariya Hidayat - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/*jslint vars:false, bitwise:true*/ -/*jshint indent:4*/ -/*global exports:true*/ -(function clone(exports) { - - var Syntax, - VisitorOption, - VisitorKeys, - BREAK, - SKIP, - REMOVE; - - function deepCopy(obj) { - var ret = {}, key, val; - for (key in obj) { - if (obj.hasOwnProperty(key)) { - val = obj[key]; - if (typeof val === 'object' && val !== null) { - ret[key] = deepCopy(val); - } else { - ret[key] = val; - } - } - } - return ret; - } - - // based on LLVM libc++ upper_bound / lower_bound - // MIT License - - function upperBound(array, func) { - var diff, len, i, current; - - len = array.length; - i = 0; - - while (len) { - diff = len >>> 1; - current = i + diff; - if (func(array[current])) { - len = diff; - } else { - i = current + 1; - len -= diff + 1; - } - } - return i; - } - - Syntax = { - AssignmentExpression: 'AssignmentExpression', - AssignmentPattern: 'AssignmentPattern', - ArrayExpression: 'ArrayExpression', - ArrayPattern: 'ArrayPattern', - ArrowFunctionExpression: 'ArrowFunctionExpression', - AwaitExpression: 'AwaitExpression', // CAUTION: It's deferred to ES7. - BlockStatement: 'BlockStatement', - BinaryExpression: 'BinaryExpression', - BreakStatement: 'BreakStatement', - CallExpression: 'CallExpression', - CatchClause: 'CatchClause', - ChainExpression: 'ChainExpression', - ClassBody: 'ClassBody', - ClassDeclaration: 'ClassDeclaration', - ClassExpression: 'ClassExpression', - ComprehensionBlock: 'ComprehensionBlock', // CAUTION: It's deferred to ES7. - ComprehensionExpression: 'ComprehensionExpression', // CAUTION: It's deferred to ES7. - ConditionalExpression: 'ConditionalExpression', - ContinueStatement: 'ContinueStatement', - DebuggerStatement: 'DebuggerStatement', - DirectiveStatement: 'DirectiveStatement', - DoWhileStatement: 'DoWhileStatement', - EmptyStatement: 'EmptyStatement', - ExportAllDeclaration: 'ExportAllDeclaration', - ExportDefaultDeclaration: 'ExportDefaultDeclaration', - ExportNamedDeclaration: 'ExportNamedDeclaration', - ExportSpecifier: 'ExportSpecifier', - ExpressionStatement: 'ExpressionStatement', - ForStatement: 'ForStatement', - ForInStatement: 'ForInStatement', - ForOfStatement: 'ForOfStatement', - FunctionDeclaration: 'FunctionDeclaration', - FunctionExpression: 'FunctionExpression', - GeneratorExpression: 'GeneratorExpression', // CAUTION: It's deferred to ES7. - Identifier: 'Identifier', - IfStatement: 'IfStatement', - ImportExpression: 'ImportExpression', - ImportDeclaration: 'ImportDeclaration', - ImportDefaultSpecifier: 'ImportDefaultSpecifier', - ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', - ImportSpecifier: 'ImportSpecifier', - Literal: 'Literal', - LabeledStatement: 'LabeledStatement', - LogicalExpression: 'LogicalExpression', - MemberExpression: 'MemberExpression', - MetaProperty: 'MetaProperty', - MethodDefinition: 'MethodDefinition', - ModuleSpecifier: 'ModuleSpecifier', - NewExpression: 'NewExpression', - ObjectExpression: 'ObjectExpression', - ObjectPattern: 'ObjectPattern', - PrivateIdentifier: 'PrivateIdentifier', - Program: 'Program', - Property: 'Property', - PropertyDefinition: 'PropertyDefinition', - RestElement: 'RestElement', - ReturnStatement: 'ReturnStatement', - SequenceExpression: 'SequenceExpression', - SpreadElement: 'SpreadElement', - Super: 'Super', - SwitchStatement: 'SwitchStatement', - SwitchCase: 'SwitchCase', - TaggedTemplateExpression: 'TaggedTemplateExpression', - TemplateElement: 'TemplateElement', - TemplateLiteral: 'TemplateLiteral', - ThisExpression: 'ThisExpression', - ThrowStatement: 'ThrowStatement', - TryStatement: 'TryStatement', - UnaryExpression: 'UnaryExpression', - UpdateExpression: 'UpdateExpression', - VariableDeclaration: 'VariableDeclaration', - VariableDeclarator: 'VariableDeclarator', - WhileStatement: 'WhileStatement', - WithStatement: 'WithStatement', - YieldExpression: 'YieldExpression' - }; - - VisitorKeys = { - AssignmentExpression: ['left', 'right'], - AssignmentPattern: ['left', 'right'], - ArrayExpression: ['elements'], - ArrayPattern: ['elements'], - ArrowFunctionExpression: ['params', 'body'], - AwaitExpression: ['argument'], // CAUTION: It's deferred to ES7. - BlockStatement: ['body'], - BinaryExpression: ['left', 'right'], - BreakStatement: ['label'], - CallExpression: ['callee', 'arguments'], - CatchClause: ['param', 'body'], - ChainExpression: ['expression'], - ClassBody: ['body'], - ClassDeclaration: ['id', 'superClass', 'body'], - ClassExpression: ['id', 'superClass', 'body'], - ComprehensionBlock: ['left', 'right'], // CAUTION: It's deferred to ES7. - ComprehensionExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7. - ConditionalExpression: ['test', 'consequent', 'alternate'], - ContinueStatement: ['label'], - DebuggerStatement: [], - DirectiveStatement: [], - DoWhileStatement: ['body', 'test'], - EmptyStatement: [], - ExportAllDeclaration: ['source'], - ExportDefaultDeclaration: ['declaration'], - ExportNamedDeclaration: ['declaration', 'specifiers', 'source'], - ExportSpecifier: ['exported', 'local'], - ExpressionStatement: ['expression'], - ForStatement: ['init', 'test', 'update', 'body'], - ForInStatement: ['left', 'right', 'body'], - ForOfStatement: ['left', 'right', 'body'], - FunctionDeclaration: ['id', 'params', 'body'], - FunctionExpression: ['id', 'params', 'body'], - GeneratorExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7. - Identifier: [], - IfStatement: ['test', 'consequent', 'alternate'], - ImportExpression: ['source'], - ImportDeclaration: ['specifiers', 'source'], - ImportDefaultSpecifier: ['local'], - ImportNamespaceSpecifier: ['local'], - ImportSpecifier: ['imported', 'local'], - Literal: [], - LabeledStatement: ['label', 'body'], - LogicalExpression: ['left', 'right'], - MemberExpression: ['object', 'property'], - MetaProperty: ['meta', 'property'], - MethodDefinition: ['key', 'value'], - ModuleSpecifier: [], - NewExpression: ['callee', 'arguments'], - ObjectExpression: ['properties'], - ObjectPattern: ['properties'], - PrivateIdentifier: [], - Program: ['body'], - Property: ['key', 'value'], - PropertyDefinition: ['key', 'value'], - RestElement: [ 'argument' ], - ReturnStatement: ['argument'], - SequenceExpression: ['expressions'], - SpreadElement: ['argument'], - Super: [], - SwitchStatement: ['discriminant', 'cases'], - SwitchCase: ['test', 'consequent'], - TaggedTemplateExpression: ['tag', 'quasi'], - TemplateElement: [], - TemplateLiteral: ['quasis', 'expressions'], - ThisExpression: [], - ThrowStatement: ['argument'], - TryStatement: ['block', 'handler', 'finalizer'], - UnaryExpression: ['argument'], - UpdateExpression: ['argument'], - VariableDeclaration: ['declarations'], - VariableDeclarator: ['id', 'init'], - WhileStatement: ['test', 'body'], - WithStatement: ['object', 'body'], - YieldExpression: ['argument'] - }; - - // unique id - BREAK = {}; - SKIP = {}; - REMOVE = {}; - - VisitorOption = { - Break: BREAK, - Skip: SKIP, - Remove: REMOVE - }; - - function Reference(parent, key) { - this.parent = parent; - this.key = key; - } - - Reference.prototype.replace = function replace(node) { - this.parent[this.key] = node; - }; - - Reference.prototype.remove = function remove() { - if (Array.isArray(this.parent)) { - this.parent.splice(this.key, 1); - return true; - } else { - this.replace(null); - return false; - } - }; - - function Element(node, path, wrap, ref) { - this.node = node; - this.path = path; - this.wrap = wrap; - this.ref = ref; - } - - function Controller() { } - - // API: - // return property path array from root to current node - Controller.prototype.path = function path() { - var i, iz, j, jz, result, element; - - function addToPath(result, path) { - if (Array.isArray(path)) { - for (j = 0, jz = path.length; j < jz; ++j) { - result.push(path[j]); - } - } else { - result.push(path); - } - } - - // root node - if (!this.__current.path) { - return null; - } - - // first node is sentinel, second node is root element - result = []; - for (i = 2, iz = this.__leavelist.length; i < iz; ++i) { - element = this.__leavelist[i]; - addToPath(result, element.path); - } - addToPath(result, this.__current.path); - return result; - }; - - // API: - // return type of current node - Controller.prototype.type = function () { - var node = this.current(); - return node.type || this.__current.wrap; - }; - - // API: - // return array of parent elements - Controller.prototype.parents = function parents() { - var i, iz, result; - - // first node is sentinel - result = []; - for (i = 1, iz = this.__leavelist.length; i < iz; ++i) { - result.push(this.__leavelist[i].node); - } - - return result; - }; - - // API: - // return current node - Controller.prototype.current = function current() { - return this.__current.node; - }; - - Controller.prototype.__execute = function __execute(callback, element) { - var previous, result; - - result = undefined; - - previous = this.__current; - this.__current = element; - this.__state = null; - if (callback) { - result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node); - } - this.__current = previous; - - return result; - }; - - // API: - // notify control skip / break - Controller.prototype.notify = function notify(flag) { - this.__state = flag; - }; - - // API: - // skip child nodes of current node - Controller.prototype.skip = function () { - this.notify(SKIP); - }; - - // API: - // break traversals - Controller.prototype['break'] = function () { - this.notify(BREAK); - }; - - // API: - // remove node - Controller.prototype.remove = function () { - this.notify(REMOVE); - }; - - Controller.prototype.__initialize = function(root, visitor) { - this.visitor = visitor; - this.root = root; - this.__worklist = []; - this.__leavelist = []; - this.__current = null; - this.__state = null; - this.__fallback = null; - if (visitor.fallback === 'iteration') { - this.__fallback = Object.keys; - } else if (typeof visitor.fallback === 'function') { - this.__fallback = visitor.fallback; - } - - this.__keys = VisitorKeys; - if (visitor.keys) { - this.__keys = Object.assign(Object.create(this.__keys), visitor.keys); - } - }; - - function isNode(node) { - if (node == null) { - return false; - } - return typeof node === 'object' && typeof node.type === 'string'; - } - - function isProperty(nodeType, key) { - return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key; - } - - function candidateExistsInLeaveList(leavelist, candidate) { - for (var i = leavelist.length - 1; i >= 0; --i) { - if (leavelist[i].node === candidate) { - return true; - } - } - return false; - } - - Controller.prototype.traverse = function traverse(root, visitor) { - var worklist, - leavelist, - element, - node, - nodeType, - ret, - key, - current, - current2, - candidates, - candidate, - sentinel; - - this.__initialize(root, visitor); - - sentinel = {}; - - // reference - worklist = this.__worklist; - leavelist = this.__leavelist; - - // initialize - worklist.push(new Element(root, null, null, null)); - leavelist.push(new Element(null, null, null, null)); - - while (worklist.length) { - element = worklist.pop(); - - if (element === sentinel) { - element = leavelist.pop(); - - ret = this.__execute(visitor.leave, element); - - if (this.__state === BREAK || ret === BREAK) { - return; - } - continue; - } - - if (element.node) { - - ret = this.__execute(visitor.enter, element); - - if (this.__state === BREAK || ret === BREAK) { - return; - } - - worklist.push(sentinel); - leavelist.push(element); - - if (this.__state === SKIP || ret === SKIP) { - continue; - } - - node = element.node; - nodeType = node.type || element.wrap; - candidates = this.__keys[nodeType]; - if (!candidates) { - if (this.__fallback) { - candidates = this.__fallback(node); - } else { - throw new Error('Unknown node type ' + nodeType + '.'); - } - } - - current = candidates.length; - while ((current -= 1) >= 0) { - key = candidates[current]; - candidate = node[key]; - if (!candidate) { - continue; - } - - if (Array.isArray(candidate)) { - current2 = candidate.length; - while ((current2 -= 1) >= 0) { - if (!candidate[current2]) { - continue; - } - - if (candidateExistsInLeaveList(leavelist, candidate[current2])) { - continue; - } - - if (isProperty(nodeType, candidates[current])) { - element = new Element(candidate[current2], [key, current2], 'Property', null); - } else if (isNode(candidate[current2])) { - element = new Element(candidate[current2], [key, current2], null, null); - } else { - continue; - } - worklist.push(element); - } - } else if (isNode(candidate)) { - if (candidateExistsInLeaveList(leavelist, candidate)) { - continue; - } - - worklist.push(new Element(candidate, key, null, null)); - } - } - } - } - }; - - Controller.prototype.replace = function replace(root, visitor) { - var worklist, - leavelist, - node, - nodeType, - target, - element, - current, - current2, - candidates, - candidate, - sentinel, - outer, - key; - - function removeElem(element) { - var i, - key, - nextElem, - parent; - - if (element.ref.remove()) { - // When the reference is an element of an array. - key = element.ref.key; - parent = element.ref.parent; - - // If removed from array, then decrease following items' keys. - i = worklist.length; - while (i--) { - nextElem = worklist[i]; - if (nextElem.ref && nextElem.ref.parent === parent) { - if (nextElem.ref.key < key) { - break; - } - --nextElem.ref.key; - } - } - } - } - - this.__initialize(root, visitor); - - sentinel = {}; - - // reference - worklist = this.__worklist; - leavelist = this.__leavelist; - - // initialize - outer = { - root: root - }; - element = new Element(root, null, null, new Reference(outer, 'root')); - worklist.push(element); - leavelist.push(element); - - while (worklist.length) { - element = worklist.pop(); - - if (element === sentinel) { - element = leavelist.pop(); - - target = this.__execute(visitor.leave, element); - - // node may be replaced with null, - // so distinguish between undefined and null in this place - if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { - // replace - element.ref.replace(target); - } - - if (this.__state === REMOVE || target === REMOVE) { - removeElem(element); - } - - if (this.__state === BREAK || target === BREAK) { - return outer.root; - } - continue; - } - - target = this.__execute(visitor.enter, element); - - // node may be replaced with null, - // so distinguish between undefined and null in this place - if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { - // replace - element.ref.replace(target); - element.node = target; - } - - if (this.__state === REMOVE || target === REMOVE) { - removeElem(element); - element.node = null; - } - - if (this.__state === BREAK || target === BREAK) { - return outer.root; - } - - // node may be null - node = element.node; - if (!node) { - continue; - } - - worklist.push(sentinel); - leavelist.push(element); - - if (this.__state === SKIP || target === SKIP) { - continue; - } - - nodeType = node.type || element.wrap; - candidates = this.__keys[nodeType]; - if (!candidates) { - if (this.__fallback) { - candidates = this.__fallback(node); - } else { - throw new Error('Unknown node type ' + nodeType + '.'); - } - } - - current = candidates.length; - while ((current -= 1) >= 0) { - key = candidates[current]; - candidate = node[key]; - if (!candidate) { - continue; - } - - if (Array.isArray(candidate)) { - current2 = candidate.length; - while ((current2 -= 1) >= 0) { - if (!candidate[current2]) { - continue; - } - if (isProperty(nodeType, candidates[current])) { - element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2)); - } else if (isNode(candidate[current2])) { - element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2)); - } else { - continue; - } - worklist.push(element); - } - } else if (isNode(candidate)) { - worklist.push(new Element(candidate, key, null, new Reference(node, key))); - } - } - } - - return outer.root; - }; - - function traverse(root, visitor) { - var controller = new Controller(); - return controller.traverse(root, visitor); - } - - function replace(root, visitor) { - var controller = new Controller(); - return controller.replace(root, visitor); - } - - function extendCommentRange(comment, tokens) { - var target; - - target = upperBound(tokens, function search(token) { - return token.range[0] > comment.range[0]; - }); - - comment.extendedRange = [comment.range[0], comment.range[1]]; - - if (target !== tokens.length) { - comment.extendedRange[1] = tokens[target].range[0]; - } - - target -= 1; - if (target >= 0) { - comment.extendedRange[0] = tokens[target].range[1]; - } - - return comment; - } - - function attachComments(tree, providedComments, tokens) { - // At first, we should calculate extended comment ranges. - var comments = [], comment, len, i, cursor; - - if (!tree.range) { - throw new Error('attachComments needs range information'); - } - - // tokens array is empty, we attach comments to tree as 'leadingComments' - if (!tokens.length) { - if (providedComments.length) { - for (i = 0, len = providedComments.length; i < len; i += 1) { - comment = deepCopy(providedComments[i]); - comment.extendedRange = [0, tree.range[0]]; - comments.push(comment); - } - tree.leadingComments = comments; - } - return tree; - } - - for (i = 0, len = providedComments.length; i < len; i += 1) { - comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens)); - } - - // This is based on John Freeman's implementation. - cursor = 0; - traverse(tree, { - enter: function (node) { - var comment; - - while (cursor < comments.length) { - comment = comments[cursor]; - if (comment.extendedRange[1] > node.range[0]) { - break; - } - - if (comment.extendedRange[1] === node.range[0]) { - if (!node.leadingComments) { - node.leadingComments = []; - } - node.leadingComments.push(comment); - comments.splice(cursor, 1); - } else { - cursor += 1; - } - } - - // already out of owned node - if (cursor === comments.length) { - return VisitorOption.Break; - } - - if (comments[cursor].extendedRange[0] > node.range[1]) { - return VisitorOption.Skip; - } - } - }); - - cursor = 0; - traverse(tree, { - leave: function (node) { - var comment; - - while (cursor < comments.length) { - comment = comments[cursor]; - if (node.range[1] < comment.extendedRange[0]) { - break; - } - - if (node.range[1] === comment.extendedRange[0]) { - if (!node.trailingComments) { - node.trailingComments = []; - } - node.trailingComments.push(comment); - comments.splice(cursor, 1); - } else { - cursor += 1; - } - } - - // already out of owned node - if (cursor === comments.length) { - return VisitorOption.Break; - } - - if (comments[cursor].extendedRange[0] > node.range[1]) { - return VisitorOption.Skip; - } - } - }); - - return tree; - } - - exports.Syntax = Syntax; - exports.traverse = traverse; - exports.replace = replace; - exports.attachComments = attachComments; - exports.VisitorKeys = VisitorKeys; - exports.VisitorOption = VisitorOption; - exports.Controller = Controller; - exports.cloneEnvironment = function () { return clone({}); }; - - return exports; -}(exports)); -/* vim: set sw=4 ts=4 et tw=80 : */ -}); - -export default estraverse; diff --git a/docs/_snowpack/pkg/fractionjs.js b/docs/_snowpack/pkg/fractionjs.js deleted file mode 100644 index c42e3b5b..00000000 --- a/docs/_snowpack/pkg/fractionjs.js +++ /dev/null @@ -1,890 +0,0 @@ -import { g as getDefaultExportFromCjs, c as createCommonjsModule } from './common/_commonjsHelpers-8c19dec8.js'; - -var fraction = createCommonjsModule(function (module, exports) { -/** - * @license Fraction.js v4.1.2 23/05/2021 - * https://www.xarg.org/2014/03/rational-numbers-in-javascript/ - * - * Copyright (c) 2021, Robert Eisele (robert@xarg.org) - * Dual licensed under the MIT or GPL Version 2 licenses. - **/ - - -/** - * - * This class offers the possibility to calculate fractions. - * You can pass a fraction in different formats. Either as array, as double, as string or as an integer. - * - * Array/Object form - * [ 0 => , 1 => ] - * [ n => , d => ] - * - * Integer form - * - Single integer value - * - * Double form - * - Single double value - * - * String form - * 123.456 - a simple double - * 123/456 - a string fraction - * 123.'456' - a double with repeating decimal places - * 123.(456) - synonym - * 123.45'6' - a double with repeating last place - * 123.45(6) - synonym - * - * Example: - * - * var f = new Fraction("9.4'31'"); - * f.mul([-4, 3]).div(4.9); - * - */ - -(function(root) { - - // Maximum search depth for cyclic rational numbers. 2000 should be more than enough. - // Example: 1/7 = 0.(142857) has 6 repeating decimal places. - // If MAX_CYCLE_LEN gets reduced, long cycles will not be detected and toString() only gets the first 10 digits - var MAX_CYCLE_LEN = 2000; - - // Parsed data to avoid calling "new" all the time - var P = { - "s": 1, - "n": 0, - "d": 1 - }; - - function createError(name) { - - function errorConstructor() { - var temp = Error.apply(this, arguments); - temp['name'] = this['name'] = name; - this['stack'] = temp['stack']; - this['message'] = temp['message']; - } - - /** - * Error constructor - * - * @constructor - */ - function IntermediateInheritor() { } - IntermediateInheritor.prototype = Error.prototype; - errorConstructor.prototype = new IntermediateInheritor(); - - return errorConstructor; - } - - var DivisionByZero = Fraction['DivisionByZero'] = createError('DivisionByZero'); - var InvalidParameter = Fraction['InvalidParameter'] = createError('InvalidParameter'); - - function assign(n, s) { - - if (isNaN(n = parseInt(n, 10))) { - throwInvalidParam(); - } - return n * s; - } - - function throwInvalidParam() { - throw new InvalidParameter(); - } - - function factorize(num) { - - var factors = {}; - - var n = num; - var i = 2; - var s = 4; - - while (s <= n) { - - while (n % i === 0) { - n /= i; - factors[i] = (factors[i] || 0) + 1; - } - s += 1 + 2 * i++; - } - - if (n !== num) { - if (n > 1) - factors[n] = (factors[n] || 0) + 1; - } else { - factors[num] = (factors[num] || 0) + 1; - } - return factors; - } - - var parse = function(p1, p2) { - - var n = 0, d = 1, s = 1; - var v = 0, w = 0, x = 0, y = 1, z = 1; - - var A = 0, B = 1; - var C = 1, D = 1; - - var N = 10000000; - var M; - - if (p1 === undefined || p1 === null) ; else if (p2 !== undefined) { - n = p1; - d = p2; - s = n * d; - } else - switch (typeof p1) { - - case "object": - { - if ("d" in p1 && "n" in p1) { - n = p1["n"]; - d = p1["d"]; - if ("s" in p1) - n *= p1["s"]; - } else if (0 in p1) { - n = p1[0]; - if (1 in p1) - d = p1[1]; - } else { - throwInvalidParam(); - } - s = n * d; - break; - } - case "number": - { - if (p1 < 0) { - s = p1; - p1 = -p1; - } - - if (p1 % 1 === 0) { - n = p1; - } else if (p1 > 0) { // check for != 0, scale would become NaN (log(0)), which converges really slow - - if (p1 >= 1) { - z = Math.pow(10, Math.floor(1 + Math.log(p1) / Math.LN10)); - p1 /= z; - } - - // Using Farey Sequences - // http://www.johndcook.com/blog/2010/10/20/best-rational-approximation/ - - while (B <= N && D <= N) { - M = (A + C) / (B + D); - - if (p1 === M) { - if (B + D <= N) { - n = A + C; - d = B + D; - } else if (D > B) { - n = C; - d = D; - } else { - n = A; - d = B; - } - break; - - } else { - - if (p1 > M) { - A += C; - B += D; - } else { - C += A; - D += B; - } - - if (B > N) { - n = C; - d = D; - } else { - n = A; - d = B; - } - } - } - n *= z; - } else if (isNaN(p1) || isNaN(p2)) { - d = n = NaN; - } - break; - } - case "string": - { - B = p1.match(/\d+|./g); - - if (B === null) - throwInvalidParam(); - - if (B[A] === '-') {// Check for minus sign at the beginning - s = -1; - A++; - } else if (B[A] === '+') {// Check for plus sign at the beginning - A++; - } - - if (B.length === A + 1) { // Check if it's just a simple number "1234" - w = assign(B[A++], s); - } else if (B[A + 1] === '.' || B[A] === '.') { // Check if it's a decimal number - - if (B[A] !== '.') { // Handle 0.5 and .5 - v = assign(B[A++], s); - } - A++; - - // Check for decimal places - if (A + 1 === B.length || B[A + 1] === '(' && B[A + 3] === ')' || B[A + 1] === "'" && B[A + 3] === "'") { - w = assign(B[A], s); - y = Math.pow(10, B[A].length); - A++; - } - - // Check for repeating places - if (B[A] === '(' && B[A + 2] === ')' || B[A] === "'" && B[A + 2] === "'") { - x = assign(B[A + 1], s); - z = Math.pow(10, B[A + 1].length) - 1; - A += 3; - } - - } else if (B[A + 1] === '/' || B[A + 1] === ':') { // Check for a simple fraction "123/456" or "123:456" - w = assign(B[A], s); - y = assign(B[A + 2], 1); - A += 3; - } else if (B[A + 3] === '/' && B[A + 1] === ' ') { // Check for a complex fraction "123 1/2" - v = assign(B[A], s); - w = assign(B[A + 2], s); - y = assign(B[A + 4], 1); - A += 5; - } - - if (B.length <= A) { // Check for more tokens on the stack - d = y * z; - s = /* void */ - n = x + d * v + z * w; - break; - } - - /* Fall through on error */ - } - default: - throwInvalidParam(); - } - - if (d === 0) { - throw new DivisionByZero(); - } - - P["s"] = s < 0 ? -1 : 1; - P["n"] = Math.abs(n); - P["d"] = Math.abs(d); - }; - - function modpow(b, e, m) { - - var r = 1; - for (; e > 0; b = (b * b) % m, e >>= 1) { - - if (e & 1) { - r = (r * b) % m; - } - } - return r; - } - - - function cycleLen(n, d) { - - for (; d % 2 === 0; - d /= 2) { - } - - for (; d % 5 === 0; - d /= 5) { - } - - if (d === 1) // Catch non-cyclic numbers - return 0; - - // If we would like to compute really large numbers quicker, we could make use of Fermat's little theorem: - // 10^(d-1) % d == 1 - // However, we don't need such large numbers and MAX_CYCLE_LEN should be the capstone, - // as we want to translate the numbers to strings. - - var rem = 10 % d; - var t = 1; - - for (; rem !== 1; t++) { - rem = rem * 10 % d; - - if (t > MAX_CYCLE_LEN) - return 0; // Returning 0 here means that we don't print it as a cyclic number. It's likely that the answer is `d-1` - } - return t; - } - - - function cycleStart(n, d, len) { - - var rem1 = 1; - var rem2 = modpow(10, len, d); - - for (var t = 0; t < 300; t++) { // s < ~log10(Number.MAX_VALUE) - // Solve 10^s == 10^(s+t) (mod d) - - if (rem1 === rem2) - return t; - - rem1 = rem1 * 10 % d; - rem2 = rem2 * 10 % d; - } - return 0; - } - - function gcd(a, b) { - - if (!a) - return b; - if (!b) - return a; - - while (1) { - a %= b; - if (!a) - return b; - b %= a; - if (!b) - return a; - } - } - /** - * Module constructor - * - * @constructor - * @param {number|Fraction=} a - * @param {number=} b - */ - function Fraction(a, b) { - - if (!(this instanceof Fraction)) { - return new Fraction(a, b); - } - - parse(a, b); - - a = gcd(P["d"], P["n"]); // Abuse variable a - - this["s"] = P["s"]; - this["n"] = P["n"] / a; - this["d"] = P["d"] / a; - } - - Fraction.prototype = { - - "s": 1, - "n": 0, - "d": 1, - - /** - * Calculates the absolute value - * - * Ex: new Fraction(-4).abs() => 4 - **/ - "abs": function() { - - return new Fraction(this["n"], this["d"]); - }, - - /** - * Inverts the sign of the current fraction - * - * Ex: new Fraction(-4).neg() => 4 - **/ - "neg": function() { - - return new Fraction(-this["s"] * this["n"], this["d"]); - }, - - /** - * Adds two rational numbers - * - * Ex: new Fraction({n: 2, d: 3}).add("14.9") => 467 / 30 - **/ - "add": function(a, b) { - - parse(a, b); - return new Fraction( - this["s"] * this["n"] * P["d"] + P["s"] * this["d"] * P["n"], - this["d"] * P["d"] - ); - }, - - /** - * Subtracts two rational numbers - * - * Ex: new Fraction({n: 2, d: 3}).add("14.9") => -427 / 30 - **/ - "sub": function(a, b) { - - parse(a, b); - return new Fraction( - this["s"] * this["n"] * P["d"] - P["s"] * this["d"] * P["n"], - this["d"] * P["d"] - ); - }, - - /** - * Multiplies two rational numbers - * - * Ex: new Fraction("-17.(345)").mul(3) => 5776 / 111 - **/ - "mul": function(a, b) { - - parse(a, b); - return new Fraction( - this["s"] * P["s"] * this["n"] * P["n"], - this["d"] * P["d"] - ); - }, - - /** - * Divides two rational numbers - * - * Ex: new Fraction("-17.(345)").inverse().div(3) - **/ - "div": function(a, b) { - - parse(a, b); - return new Fraction( - this["s"] * P["s"] * this["n"] * P["d"], - this["d"] * P["n"] - ); - }, - - /** - * Clones the actual object - * - * Ex: new Fraction("-17.(345)").clone() - **/ - "clone": function() { - return new Fraction(this); - }, - - /** - * Calculates the modulo of two rational numbers - a more precise fmod - * - * Ex: new Fraction('4.(3)').mod([7, 8]) => (13/3) % (7/8) = (5/6) - **/ - "mod": function(a, b) { - - if (isNaN(this['n']) || isNaN(this['d'])) { - return new Fraction(NaN); - } - - if (a === undefined) { - return new Fraction(this["s"] * this["n"] % this["d"], 1); - } - - parse(a, b); - if (0 === P["n"] && 0 === this["d"]) { - Fraction(0, 0); // Throw DivisionByZero - } - - /* - * First silly attempt, kinda slow - * - return that["sub"]({ - "n": num["n"] * Math.floor((this.n / this.d) / (num.n / num.d)), - "d": num["d"], - "s": this["s"] - });*/ - - /* - * New attempt: a1 / b1 = a2 / b2 * q + r - * => b2 * a1 = a2 * b1 * q + b1 * b2 * r - * => (b2 * a1 % a2 * b1) / (b1 * b2) - */ - return new Fraction( - this["s"] * (P["d"] * this["n"]) % (P["n"] * this["d"]), - P["d"] * this["d"] - ); - }, - - /** - * Calculates the fractional gcd of two rational numbers - * - * Ex: new Fraction(5,8).gcd(3,7) => 1/56 - */ - "gcd": function(a, b) { - - parse(a, b); - - // gcd(a / b, c / d) = gcd(a, c) / lcm(b, d) - - return new Fraction(gcd(P["n"], this["n"]) * gcd(P["d"], this["d"]), P["d"] * this["d"]); - }, - - /** - * Calculates the fractional lcm of two rational numbers - * - * Ex: new Fraction(5,8).lcm(3,7) => 15 - */ - "lcm": function(a, b) { - - parse(a, b); - - // lcm(a / b, c / d) = lcm(a, c) / gcd(b, d) - - if (P["n"] === 0 && this["n"] === 0) { - return new Fraction; - } - return new Fraction(P["n"] * this["n"], gcd(P["n"], this["n"]) * gcd(P["d"], this["d"])); - }, - - /** - * Calculates the ceil of a rational number - * - * Ex: new Fraction('4.(3)').ceil() => (5 / 1) - **/ - "ceil": function(places) { - - places = Math.pow(10, places || 0); - - if (isNaN(this["n"]) || isNaN(this["d"])) { - return new Fraction(NaN); - } - return new Fraction(Math.ceil(places * this["s"] * this["n"] / this["d"]), places); - }, - - /** - * Calculates the floor of a rational number - * - * Ex: new Fraction('4.(3)').floor() => (4 / 1) - **/ - "floor": function(places) { - - places = Math.pow(10, places || 0); - - if (isNaN(this["n"]) || isNaN(this["d"])) { - return new Fraction(NaN); - } - return new Fraction(Math.floor(places * this["s"] * this["n"] / this["d"]), places); - }, - - /** - * Rounds a rational numbers - * - * Ex: new Fraction('4.(3)').round() => (4 / 1) - **/ - "round": function(places) { - - places = Math.pow(10, places || 0); - - if (isNaN(this["n"]) || isNaN(this["d"])) { - return new Fraction(NaN); - } - return new Fraction(Math.round(places * this["s"] * this["n"] / this["d"]), places); - }, - - /** - * Gets the inverse of the fraction, means numerator and denominator are exchanged - * - * Ex: new Fraction([-3, 4]).inverse() => -4 / 3 - **/ - "inverse": function() { - - return new Fraction(this["s"] * this["d"], this["n"]); - }, - - /** - * Calculates the fraction to some rational exponent, if possible - * - * Ex: new Fraction(-1,2).pow(-3) => -8 - */ - "pow": function(a, b) { - - parse(a, b); - - // Trivial case when exp is an integer - - if (P['d'] === 1) { - - if (P['s'] < 0) { - return new Fraction(Math.pow(this['s'] * this["d"], P['n']), Math.pow(this["n"], P['n'])); - } else { - return new Fraction(Math.pow(this['s'] * this["n"], P['n']), Math.pow(this["d"], P['n'])); - } - } - - // Negative roots become complex - // (-a/b)^(c/d) = x - // <=> (-1)^(c/d) * (a/b)^(c/d) = x - // <=> (cos(pi) + i*sin(pi))^(c/d) * (a/b)^(c/d) = x # rotate 1 by 180° - // <=> (cos(c*pi/d) + i*sin(c*pi/d)) * (a/b)^(c/d) = x # DeMoivre's formula in Q ( https://proofwiki.org/wiki/De_Moivre%27s_Formula/Rational_Index ) - // From which follows that only for c=0 the root is non-complex. c/d is a reduced fraction, so that sin(c/dpi)=0 occurs for d=1, which is handled by our trivial case. - if (this['s'] < 0) return null; - - // Now prime factor n and d - var N = factorize(this['n']); - var D = factorize(this['d']); - - // Exponentiate and take root for n and d individually - var n = 1; - var d = 1; - for (var k in N) { - if (k === '1') continue; - if (k === '0') { - n = 0; - break; - } - N[k]*= P['n']; - - if (N[k] % P['d'] === 0) { - N[k]/= P['d']; - } else return null; - n*= Math.pow(k, N[k]); - } - - for (var k in D) { - if (k === '1') continue; - D[k]*= P['n']; - - if (D[k] % P['d'] === 0) { - D[k]/= P['d']; - } else return null; - d*= Math.pow(k, D[k]); - } - - if (P['s'] < 0) { - return new Fraction(d, n); - } - return new Fraction(n, d); - }, - - /** - * Check if two rational numbers are the same - * - * Ex: new Fraction(19.6).equals([98, 5]); - **/ - "equals": function(a, b) { - - parse(a, b); - return this["s"] * this["n"] * P["d"] === P["s"] * P["n"] * this["d"]; // Same as compare() === 0 - }, - - /** - * Check if two rational numbers are the same - * - * Ex: new Fraction(19.6).equals([98, 5]); - **/ - "compare": function(a, b) { - - parse(a, b); - var t = (this["s"] * this["n"] * P["d"] - P["s"] * P["n"] * this["d"]); - return (0 < t) - (t < 0); - }, - - "simplify": function(eps) { - - // First naive implementation, needs improvement - - if (isNaN(this['n']) || isNaN(this['d'])) { - return this; - } - - var cont = this['abs']()['toContinued'](); - - eps = eps || 0.001; - - function rec(a) { - if (a.length === 1) - return new Fraction(a[0]); - return rec(a.slice(1))['inverse']()['add'](a[0]); - } - - for (var i = 0; i < cont.length; i++) { - var tmp = rec(cont.slice(0, i + 1)); - if (tmp['sub'](this['abs']())['abs']().valueOf() < eps) { - return tmp['mul'](this['s']); - } - } - return this; - }, - - /** - * Check if two rational numbers are divisible - * - * Ex: new Fraction(19.6).divisible(1.5); - */ - "divisible": function(a, b) { - - parse(a, b); - return !(!(P["n"] * this["d"]) || ((this["n"] * P["d"]) % (P["n"] * this["d"]))); - }, - - /** - * Returns a decimal representation of the fraction - * - * Ex: new Fraction("100.'91823'").valueOf() => 100.91823918239183 - **/ - 'valueOf': function() { - - return this["s"] * this["n"] / this["d"]; - }, - - /** - * Returns a string-fraction representation of a Fraction object - * - * Ex: new Fraction("1.'3'").toFraction() => "4 1/3" - **/ - 'toFraction': function(excludeWhole) { - - var whole, str = ""; - var n = this["n"]; - var d = this["d"]; - if (this["s"] < 0) { - str += '-'; - } - - if (d === 1) { - str += n; - } else { - - if (excludeWhole && (whole = Math.floor(n / d)) > 0) { - str += whole; - str += " "; - n %= d; - } - - str += n; - str += '/'; - str += d; - } - return str; - }, - - /** - * Returns a latex representation of a Fraction object - * - * Ex: new Fraction("1.'3'").toLatex() => "\frac{4}{3}" - **/ - 'toLatex': function(excludeWhole) { - - var whole, str = ""; - var n = this["n"]; - var d = this["d"]; - if (this["s"] < 0) { - str += '-'; - } - - if (d === 1) { - str += n; - } else { - - if (excludeWhole && (whole = Math.floor(n / d)) > 0) { - str += whole; - n %= d; - } - - str += "\\frac{"; - str += n; - str += '}{'; - str += d; - str += '}'; - } - return str; - }, - - /** - * Returns an array of continued fraction elements - * - * Ex: new Fraction("7/8").toContinued() => [0,1,7] - */ - 'toContinued': function() { - - var t; - var a = this['n']; - var b = this['d']; - var res = []; - - if (isNaN(a) || isNaN(b)) { - return res; - } - - do { - res.push(Math.floor(a / b)); - t = a % b; - a = b; - b = t; - } while (a !== 1); - - return res; - }, - - /** - * Creates a string representation of a fraction with all digits - * - * Ex: new Fraction("100.'91823'").toString() => "100.(91823)" - **/ - 'toString': function(dec) { - var N = this["n"]; - var D = this["d"]; - - if (isNaN(N) || isNaN(D)) { - return "NaN"; - } - - dec = dec || 15; // 15 = decimal places when no repetation - - var cycLen = cycleLen(N, D); // Cycle length - var cycOff = cycleStart(N, D, cycLen); // Cycle start - - var str = this['s'] === -1 ? "-" : ""; - - str += N / D | 0; - - N %= D; - N *= 10; - - if (N) - str += "."; - - if (cycLen) { - - for (var i = cycOff; i--;) { - str += N / D | 0; - N %= D; - N *= 10; - } - str += "("; - for (var i = cycLen; i--;) { - str += N / D | 0; - N %= D; - N *= 10; - } - str += ")"; - } else { - for (var i = dec; N && i--;) { - str += N / D | 0; - N %= D; - N *= 10; - } - } - return str; - } - }; - - { - Object.defineProperty(Fraction, "__esModule", { 'value': true }); - Fraction['default'] = Fraction; - Fraction['Fraction'] = Fraction; - module['exports'] = Fraction; - } - -})(); -}); - -var __pika_web_default_export_for_treeshaking__ = /*@__PURE__*/getDefaultExportFromCjs(fraction); - -export default __pika_web_default_export_for_treeshaking__; diff --git a/docs/_snowpack/pkg/import-map.json b/docs/_snowpack/pkg/import-map.json deleted file mode 100644 index de797864..00000000 --- a/docs/_snowpack/pkg/import-map.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "imports": { - "@tonaljs/tonal": "./@tonaljs/tonal.js", - "@tonejs/piano": "./@tonejs/piano.js", - "bjork": "./bjork.js", - "chord-voicings": "./chord-voicings.js", - "codemirror/lib/codemirror.css": "./codemirror/lib/codemirror.css", - "codemirror/mode/javascript/javascript.js": "./codemirror/mode/javascript/javascript.js", - "codemirror/mode/pegjs/pegjs.js": "./codemirror/mode/pegjs/pegjs.js", - "codemirror/theme/material.css": "./codemirror/theme/material.css", - "estraverse": "./estraverse.js", - "fraction.js": "./fractionjs.js", - "multimap": "./multimap.js", - "ramda": "./ramda.js", - "react": "./react.js", - "react-codemirror2": "./react-codemirror2.js", - "react-dom": "./react-dom.js", - "shift-ast": "./shift-ast.js", - "shift-codegen": "./shift-codegen.js", - "shift-regexp-acceptor": "./shift-regexp-acceptor.js", - "shift-spec": "./shift-spec.js", - "tone": "./tone.js", - "webmidi": "./webmidi.js" - } -} \ No newline at end of file diff --git a/docs/_snowpack/pkg/multimap.js b/docs/_snowpack/pkg/multimap.js deleted file mode 100644 index ec0d90bb..00000000 --- a/docs/_snowpack/pkg/multimap.js +++ /dev/null @@ -1,229 +0,0 @@ -import { c as createCommonjsModule } from './common/_commonjsHelpers-8c19dec8.js'; - -var multimap = createCommonjsModule(function (module, exports) { - -/* global module, define */ - -function mapEach(map, operation){ - var keys = map.keys(); - var next; - while(!(next = keys.next()).done) { - operation(map.get(next.value), next.value, map); - } -} - -var Multimap = (function() { - var mapCtor; - if (typeof Map !== 'undefined') { - mapCtor = Map; - - if (!Map.prototype.keys) { - Map.prototype.keys = function() { - var keys = []; - this.forEach(function(item, key) { - keys.push(key); - }); - return keys; - }; - } - } - - function Multimap(iterable) { - var self = this; - - self._map = mapCtor; - - if (Multimap.Map) { - self._map = Multimap.Map; - } - - self._ = self._map ? new self._map() : {}; - - if (iterable) { - iterable.forEach(function(i) { - self.set(i[0], i[1]); - }); - } - } - - /** - * @param {Object} key - * @return {Array} An array of values, undefined if no such a key; - */ - Multimap.prototype.get = function(key) { - return this._map ? this._.get(key) : this._[key]; - }; - - /** - * @param {Object} key - * @param {Object} val... - */ - Multimap.prototype.set = function(key, val) { - var args = Array.prototype.slice.call(arguments); - - key = args.shift(); - - var entry = this.get(key); - if (!entry) { - entry = []; - if (this._map) - this._.set(key, entry); - else - this._[key] = entry; - } - - Array.prototype.push.apply(entry, args); - return this; - }; - - /** - * @param {Object} key - * @param {Object=} val - * @return {boolean} true if any thing changed - */ - Multimap.prototype.delete = function(key, val) { - if (!this.has(key)) - return false; - - if (arguments.length == 1) { - this._map ? (this._.delete(key)) : (delete this._[key]); - return true; - } else { - var entry = this.get(key); - var idx = entry.indexOf(val); - if (idx != -1) { - entry.splice(idx, 1); - return true; - } - } - - return false; - }; - - /** - * @param {Object} key - * @param {Object=} val - * @return {boolean} whether the map contains 'key' or 'key=>val' pair - */ - Multimap.prototype.has = function(key, val) { - var hasKey = this._map ? this._.has(key) : this._.hasOwnProperty(key); - - if (arguments.length == 1 || !hasKey) - return hasKey; - - var entry = this.get(key) || []; - return entry.indexOf(val) != -1; - }; - - - /** - * @return {Array} all the keys in the map - */ - Multimap.prototype.keys = function() { - if (this._map) - return makeIterator(this._.keys()); - - return makeIterator(Object.keys(this._)); - }; - - /** - * @return {Array} all the values in the map - */ - Multimap.prototype.values = function() { - var vals = []; - this.forEachEntry(function(entry) { - Array.prototype.push.apply(vals, entry); - }); - - return makeIterator(vals); - }; - - /** - * - */ - Multimap.prototype.forEachEntry = function(iter) { - mapEach(this, iter); - }; - - Multimap.prototype.forEach = function(iter) { - var self = this; - self.forEachEntry(function(entry, key) { - entry.forEach(function(item) { - iter(item, key, self); - }); - }); - }; - - - Multimap.prototype.clear = function() { - if (this._map) { - this._.clear(); - } else { - this._ = {}; - } - }; - - Object.defineProperty( - Multimap.prototype, - "size", { - configurable: false, - enumerable: true, - get: function() { - var total = 0; - - mapEach(this, function(value){ - total += value.length; - }); - - return total; - } - }); - - Object.defineProperty( - Multimap.prototype, - "count", { - configurable: false, - enumerable: true, - get: function() { - return this._.size; - } - }); - - var safariNext; - - try{ - safariNext = new Function('iterator', 'makeIterator', 'var keysArray = []; for(var key of iterator){keysArray.push(key);} return makeIterator(keysArray).next;'); - }catch(error){ - // for of not implemented; - } - - function makeIterator(iterator){ - if(Array.isArray(iterator)){ - var nextIndex = 0; - - return { - next: function(){ - return nextIndex < iterator.length ? - {value: iterator[nextIndex++], done: false} : - {done: true}; - } - }; - } - - // Only an issue in safari - if(!iterator.next && safariNext){ - iterator.next = safariNext(iterator, makeIterator); - } - - return iterator; - } - - return Multimap; -})(); - - -if( module && module.exports) - module.exports = Multimap; -}); - -export default multimap; diff --git a/docs/_snowpack/pkg/ramda.js b/docs/_snowpack/pkg/ramda.js deleted file mode 100644 index 4ddeeb90..00000000 --- a/docs/_snowpack/pkg/ramda.js +++ /dev/null @@ -1,606 +0,0 @@ -function _isPlaceholder(a) { - return a != null && typeof a === 'object' && a['@@functional/placeholder'] === true; -} - -/** - * Optimized internal one-arity curry function. - * - * @private - * @category Function - * @param {Function} fn The function to curry. - * @return {Function} The curried function. - */ - -function _curry1(fn) { - return function f1(a) { - if (arguments.length === 0 || _isPlaceholder(a)) { - return f1; - } else { - return fn.apply(this, arguments); - } - }; -} - -/** - * Optimized internal two-arity curry function. - * - * @private - * @category Function - * @param {Function} fn The function to curry. - * @return {Function} The curried function. - */ - -function _curry2(fn) { - return function f2(a, b) { - switch (arguments.length) { - case 0: - return f2; - - case 1: - return _isPlaceholder(a) ? f2 : _curry1(function (_b) { - return fn(a, _b); - }); - - default: - return _isPlaceholder(a) && _isPlaceholder(b) ? f2 : _isPlaceholder(a) ? _curry1(function (_a) { - return fn(_a, b); - }) : _isPlaceholder(b) ? _curry1(function (_b) { - return fn(a, _b); - }) : fn(a, b); - } - }; -} - -function _arity(n, fn) { - /* eslint-disable no-unused-vars */ - switch (n) { - case 0: - return function () { - return fn.apply(this, arguments); - }; - - case 1: - return function (a0) { - return fn.apply(this, arguments); - }; - - case 2: - return function (a0, a1) { - return fn.apply(this, arguments); - }; - - case 3: - return function (a0, a1, a2) { - return fn.apply(this, arguments); - }; - - case 4: - return function (a0, a1, a2, a3) { - return fn.apply(this, arguments); - }; - - case 5: - return function (a0, a1, a2, a3, a4) { - return fn.apply(this, arguments); - }; - - case 6: - return function (a0, a1, a2, a3, a4, a5) { - return fn.apply(this, arguments); - }; - - case 7: - return function (a0, a1, a2, a3, a4, a5, a6) { - return fn.apply(this, arguments); - }; - - case 8: - return function (a0, a1, a2, a3, a4, a5, a6, a7) { - return fn.apply(this, arguments); - }; - - case 9: - return function (a0, a1, a2, a3, a4, a5, a6, a7, a8) { - return fn.apply(this, arguments); - }; - - case 10: - return function (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) { - return fn.apply(this, arguments); - }; - - default: - throw new Error('First argument to _arity must be a non-negative integer no greater than ten'); - } -} - -/** - * Optimized internal three-arity curry function. - * - * @private - * @category Function - * @param {Function} fn The function to curry. - * @return {Function} The curried function. - */ - -function _curry3(fn) { - return function f3(a, b, c) { - switch (arguments.length) { - case 0: - return f3; - - case 1: - return _isPlaceholder(a) ? f3 : _curry2(function (_b, _c) { - return fn(a, _b, _c); - }); - - case 2: - return _isPlaceholder(a) && _isPlaceholder(b) ? f3 : _isPlaceholder(a) ? _curry2(function (_a, _c) { - return fn(_a, b, _c); - }) : _isPlaceholder(b) ? _curry2(function (_b, _c) { - return fn(a, _b, _c); - }) : _curry1(function (_c) { - return fn(a, b, _c); - }); - - default: - return _isPlaceholder(a) && _isPlaceholder(b) && _isPlaceholder(c) ? f3 : _isPlaceholder(a) && _isPlaceholder(b) ? _curry2(function (_a, _b) { - return fn(_a, _b, c); - }) : _isPlaceholder(a) && _isPlaceholder(c) ? _curry2(function (_a, _c) { - return fn(_a, b, _c); - }) : _isPlaceholder(b) && _isPlaceholder(c) ? _curry2(function (_b, _c) { - return fn(a, _b, _c); - }) : _isPlaceholder(a) ? _curry1(function (_a) { - return fn(_a, b, c); - }) : _isPlaceholder(b) ? _curry1(function (_b) { - return fn(a, _b, c); - }) : _isPlaceholder(c) ? _curry1(function (_c) { - return fn(a, b, _c); - }) : fn(a, b, c); - } - }; -} - -/** - * Tests whether or not an object is an array. - * - * @private - * @param {*} val The object to test. - * @return {Boolean} `true` if `val` is an array, `false` otherwise. - * @example - * - * _isArray([]); //=> true - * _isArray(null); //=> false - * _isArray({}); //=> false - */ -var _isArray = Array.isArray || function _isArray(val) { - return val != null && val.length >= 0 && Object.prototype.toString.call(val) === '[object Array]'; -}; - -function _isString(x) { - return Object.prototype.toString.call(x) === '[object String]'; -} - -/** - * Tests whether or not an object is similar to an array. - * - * @private - * @category Type - * @category List - * @sig * -> Boolean - * @param {*} x The object to test. - * @return {Boolean} `true` if `x` has a numeric length property and extreme indices defined; `false` otherwise. - * @example - * - * _isArrayLike([]); //=> true - * _isArrayLike(true); //=> false - * _isArrayLike({}); //=> false - * _isArrayLike({length: 10}); //=> false - * _isArrayLike({0: 'zero', 9: 'nine', length: 10}); //=> true - * _isArrayLike({nodeType: 1, length: 1}) // => false - */ - -var _isArrayLike = -/*#__PURE__*/ -_curry1(function isArrayLike(x) { - if (_isArray(x)) { - return true; - } - - if (!x) { - return false; - } - - if (typeof x !== 'object') { - return false; - } - - if (_isString(x)) { - return false; - } - - if (x.length === 0) { - return true; - } - - if (x.length > 0) { - return x.hasOwnProperty(0) && x.hasOwnProperty(x.length - 1); - } - - return false; -}); - -var XWrap = -/*#__PURE__*/ -function () { - function XWrap(fn) { - this.f = fn; - } - - XWrap.prototype['@@transducer/init'] = function () { - throw new Error('init not implemented on XWrap'); - }; - - XWrap.prototype['@@transducer/result'] = function (acc) { - return acc; - }; - - XWrap.prototype['@@transducer/step'] = function (acc, x) { - return this.f(acc, x); - }; - - return XWrap; -}(); - -function _xwrap(fn) { - return new XWrap(fn); -} - -/** - * Creates a function that is bound to a context. - * Note: `R.bind` does not provide the additional argument-binding capabilities of - * [Function.prototype.bind](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind). - * - * @func - * @memberOf R - * @since v0.6.0 - * @category Function - * @category Object - * @sig (* -> *) -> {*} -> (* -> *) - * @param {Function} fn The function to bind to context - * @param {Object} thisObj The context to bind `fn` to - * @return {Function} A function that will execute in the context of `thisObj`. - * @see R.partial - * @example - * - * const log = R.bind(console.log, console); - * R.pipe(R.assoc('a', 2), R.tap(log), R.assoc('a', 3))({a: 1}); //=> {a: 3} - * // logs {a: 2} - * @symb R.bind(f, o)(a, b) = f.call(o, a, b) - */ - -var bind = -/*#__PURE__*/ -_curry2(function bind(fn, thisObj) { - return _arity(fn.length, function () { - return fn.apply(thisObj, arguments); - }); -}); - -function _arrayReduce(xf, acc, list) { - var idx = 0; - var len = list.length; - - while (idx < len) { - acc = xf['@@transducer/step'](acc, list[idx]); - - if (acc && acc['@@transducer/reduced']) { - acc = acc['@@transducer/value']; - break; - } - - idx += 1; - } - - return xf['@@transducer/result'](acc); -} - -function _iterableReduce(xf, acc, iter) { - var step = iter.next(); - - while (!step.done) { - acc = xf['@@transducer/step'](acc, step.value); - - if (acc && acc['@@transducer/reduced']) { - acc = acc['@@transducer/value']; - break; - } - - step = iter.next(); - } - - return xf['@@transducer/result'](acc); -} - -function _methodReduce(xf, acc, obj, methodName) { - return xf['@@transducer/result'](obj[methodName](bind(xf['@@transducer/step'], xf), acc)); -} - -var symIterator = typeof Symbol !== 'undefined' ? Symbol.iterator : '@@iterator'; -function _reduce(fn, acc, list) { - if (typeof fn === 'function') { - fn = _xwrap(fn); - } - - if (_isArrayLike(list)) { - return _arrayReduce(fn, acc, list); - } - - if (typeof list['fantasy-land/reduce'] === 'function') { - return _methodReduce(fn, acc, list, 'fantasy-land/reduce'); - } - - if (list[symIterator] != null) { - return _iterableReduce(fn, acc, list[symIterator]()); - } - - if (typeof list.next === 'function') { - return _iterableReduce(fn, acc, list); - } - - if (typeof list.reduce === 'function') { - return _methodReduce(fn, acc, list, 'reduce'); - } - - throw new TypeError('reduce: list must be array or iterable'); -} - -/** - * Returns a single item by iterating through the list, successively calling - * the iterator function and passing it an accumulator value and the current - * value from the array, and then passing the result to the next call. - * - * The iterator function receives two values: *(acc, value)*. It may use - * [`R.reduced`](#reduced) to shortcut the iteration. - * - * The arguments' order of [`reduceRight`](#reduceRight)'s iterator function - * is *(value, acc)*. - * - * Note: `R.reduce` does not skip deleted or unassigned indices (sparse - * arrays), unlike the native `Array.prototype.reduce` method. For more details - * on this behavior, see: - * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce#Description - * - * Dispatches to the `reduce` method of the third argument, if present. When - * doing so, it is up to the user to handle the [`R.reduced`](#reduced) - * shortcuting, as this is not implemented by `reduce`. - * - * @func - * @memberOf R - * @since v0.1.0 - * @category List - * @sig ((a, b) -> a) -> a -> [b] -> a - * @param {Function} fn The iterator function. Receives two values, the accumulator and the - * current element from the array. - * @param {*} acc The accumulator value. - * @param {Array} list The list to iterate over. - * @return {*} The final, accumulated value. - * @see R.reduced, R.addIndex, R.reduceRight - * @example - * - * R.reduce(R.subtract, 0, [1, 2, 3, 4]) // => ((((0 - 1) - 2) - 3) - 4) = -10 - * // - -10 - * // / \ / \ - * // - 4 -6 4 - * // / \ / \ - * // - 3 ==> -3 3 - * // / \ / \ - * // - 2 -1 2 - * // / \ / \ - * // 0 1 0 1 - * - * @symb R.reduce(f, a, [b, c, d]) = f(f(f(a, b), c), d) - */ - -var reduce = -/*#__PURE__*/ -_curry3(_reduce); - -function _pipe(f, g) { - return function () { - return g.call(this, f.apply(this, arguments)); - }; -} - -/** - * This checks whether a function has a [methodname] function. If it isn't an - * array it will execute that function otherwise it will default to the ramda - * implementation. - * - * @private - * @param {Function} fn ramda implementation - * @param {String} methodname property to check for a custom implementation - * @return {Object} Whatever the return value of the method is. - */ - -function _checkForMethod(methodname, fn) { - return function () { - var length = arguments.length; - - if (length === 0) { - return fn(); - } - - var obj = arguments[length - 1]; - return _isArray(obj) || typeof obj[methodname] !== 'function' ? fn.apply(this, arguments) : obj[methodname].apply(obj, Array.prototype.slice.call(arguments, 0, length - 1)); - }; -} - -/** - * Returns the elements of the given list or string (or object with a `slice` - * method) from `fromIndex` (inclusive) to `toIndex` (exclusive). - * - * Dispatches to the `slice` method of the third argument, if present. - * - * @func - * @memberOf R - * @since v0.1.4 - * @category List - * @sig Number -> Number -> [a] -> [a] - * @sig Number -> Number -> String -> String - * @param {Number} fromIndex The start index (inclusive). - * @param {Number} toIndex The end index (exclusive). - * @param {*} list - * @return {*} - * @example - * - * R.slice(1, 3, ['a', 'b', 'c', 'd']); //=> ['b', 'c'] - * R.slice(1, Infinity, ['a', 'b', 'c', 'd']); //=> ['b', 'c', 'd'] - * R.slice(0, -1, ['a', 'b', 'c', 'd']); //=> ['a', 'b', 'c'] - * R.slice(-3, -1, ['a', 'b', 'c', 'd']); //=> ['b', 'c'] - * R.slice(0, 3, 'ramda'); //=> 'ram' - */ - -var slice = -/*#__PURE__*/ -_curry3( -/*#__PURE__*/ -_checkForMethod('slice', function slice(fromIndex, toIndex, list) { - return Array.prototype.slice.call(list, fromIndex, toIndex); -})); - -/** - * Returns all but the first element of the given list or string (or object - * with a `tail` method). - * - * Dispatches to the `slice` method of the first argument, if present. - * - * @func - * @memberOf R - * @since v0.1.0 - * @category List - * @sig [a] -> [a] - * @sig String -> String - * @param {*} list - * @return {*} - * @see R.head, R.init, R.last - * @example - * - * R.tail([1, 2, 3]); //=> [2, 3] - * R.tail([1, 2]); //=> [2] - * R.tail([1]); //=> [] - * R.tail([]); //=> [] - * - * R.tail('abc'); //=> 'bc' - * R.tail('ab'); //=> 'b' - * R.tail('a'); //=> '' - * R.tail(''); //=> '' - */ - -var tail = -/*#__PURE__*/ -_curry1( -/*#__PURE__*/ -_checkForMethod('tail', -/*#__PURE__*/ -slice(1, Infinity))); - -/** - * Performs left-to-right function composition. The first argument may have - * any arity; the remaining arguments must be unary. - * - * In some libraries this function is named `sequence`. - * - * **Note:** The result of pipe is not automatically curried. - * - * @func - * @memberOf R - * @since v0.1.0 - * @category Function - * @sig (((a, b, ..., n) -> o), (o -> p), ..., (x -> y), (y -> z)) -> ((a, b, ..., n) -> z) - * @param {...Function} functions - * @return {Function} - * @see R.compose - * @example - * - * const f = R.pipe(Math.pow, R.negate, R.inc); - * - * f(3, 4); // -(3^4) + 1 - * @symb R.pipe(f, g, h)(a, b) = h(g(f(a, b))) - * @symb R.pipe(f, g, h)(a)(b) = h(g(f(a)))(b) - */ - -function pipe() { - if (arguments.length === 0) { - throw new Error('pipe requires at least one argument'); - } - - return _arity(arguments[0].length, reduce(_pipe, arguments[0], tail(arguments))); -} - -/** - * Returns a new list or string with the elements or characters in reverse - * order. - * - * @func - * @memberOf R - * @since v0.1.0 - * @category List - * @sig [a] -> [a] - * @sig String -> String - * @param {Array|String} list - * @return {Array|String} - * @example - * - * R.reverse([1, 2, 3]); //=> [3, 2, 1] - * R.reverse([1, 2]); //=> [2, 1] - * R.reverse([1]); //=> [1] - * R.reverse([]); //=> [] - * - * R.reverse('abc'); //=> 'cba' - * R.reverse('ab'); //=> 'ba' - * R.reverse('a'); //=> 'a' - * R.reverse(''); //=> '' - */ - -var reverse = -/*#__PURE__*/ -_curry1(function reverse(list) { - return _isString(list) ? list.split('').reverse().join('') : Array.prototype.slice.call(list, 0).reverse(); -}); - -/** - * Performs right-to-left function composition. The last argument may have - * any arity; the remaining arguments must be unary. - * - * **Note:** The result of compose is not automatically curried. - * - * @func - * @memberOf R - * @since v0.1.0 - * @category Function - * @sig ((y -> z), (x -> y), ..., (o -> p), ((a, b, ..., n) -> o)) -> ((a, b, ..., n) -> z) - * @param {...Function} ...functions The functions to compose - * @return {Function} - * @see R.pipe - * @example - * - * const classyGreeting = (firstName, lastName) => "The name's " + lastName + ", " + firstName + " " + lastName - * const yellGreeting = R.compose(R.toUpper, classyGreeting); - * yellGreeting('James', 'Bond'); //=> "THE NAME'S BOND, JAMES BOND" - * - * R.compose(Math.abs, R.add(1), R.multiply(2))(-4) //=> 7 - * - * @symb R.compose(f, g, h)(a, b) = f(g(h(a, b))) - * @symb R.compose(f, g, h)(a)(b) = f(g(h(a)))(b) - */ - -function compose() { - if (arguments.length === 0) { - throw new Error('compose requires at least one argument'); - } - - return pipe.apply(this, reverse(arguments)); -} - -export { compose }; diff --git a/docs/_snowpack/pkg/react-codemirror2.js b/docs/_snowpack/pkg/react-codemirror2.js deleted file mode 100644 index eb301641..00000000 --- a/docs/_snowpack/pkg/react-codemirror2.js +++ /dev/null @@ -1,789 +0,0 @@ -import { c as createCommonjsModule, a as commonjsGlobal } from './common/_commonjsHelpers-8c19dec8.js'; -import { r as react } from './common/index-67cfdec9.js'; -import { c as codemirror } from './common/codemirror-d650d44d.js'; -import './common/index-d01087d6.js'; - -var reactCodemirror2 = createCommonjsModule(function (module, exports) { - -function _extends() { - _extends = Object.assign || function(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - return target; - }; - return _extends.apply(this, arguments); -} - -function _typeof(obj) { - "@babel/helpers - typeof"; - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - return _typeof(obj); -} - -var __extends = function() { - var _extendStatics = function extendStatics(d, b) { - _extendStatics = Object.setPrototypeOf || { - __proto__: [] - } - instanceof Array && function(d, b) { - d.__proto__ = b; - } || function(d, b) { - for (var p in b) { - if (b.hasOwnProperty(p)) d[p] = b[p]; - } - }; - - return _extendStatics(d, b); - }; - - return function(d, b) { - _extendStatics(d, b); - - function __() { - this.constructor = d; - } - - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -}(); - -Object.defineProperty(exports, '__esModule', { - value: true -}); -exports.UnControlled = exports.Controlled = void 0; - - - -var SERVER_RENDERED = typeof navigator === 'undefined' || commonjsGlobal['PREVENT_CODEMIRROR_RENDER'] === true; -var cm; - -if (!SERVER_RENDERED) { - cm = codemirror; -} - -var Helper = function() { - function Helper() {} - - Helper.equals = function(x, y) { - var _this = this; - - var ok = Object.keys, - tx = _typeof(x), - ty = _typeof(y); - - return x && y && tx === 'object' && tx === ty ? ok(x).length === ok(y).length && ok(x).every(function(key) { - return _this.equals(x[key], y[key]); - }) : x === y; - }; - - return Helper; -}(); - -var Shared = function() { - function Shared(editor, props) { - this.editor = editor; - this.props = props; - } - - Shared.prototype.delegateCursor = function(position, scroll, focus) { - var doc = this.editor.getDoc(); - - if (focus) { - this.editor.focus(); - } - - scroll ? doc.setCursor(position) : doc.setCursor(position, null, { - scroll: false - }); - }; - - Shared.prototype.delegateScroll = function(coordinates) { - this.editor.scrollTo(coordinates.x, coordinates.y); - }; - - Shared.prototype.delegateSelection = function(ranges, focus) { - var doc = this.editor.getDoc(); - doc.setSelections(ranges); - - if (focus) { - this.editor.focus(); - } - }; - - Shared.prototype.apply = function(props) { - if (props && props.selection && props.selection.ranges) { - this.delegateSelection(props.selection.ranges, props.selection.focus || false); - } - - if (props && props.cursor) { - this.delegateCursor(props.cursor, props.autoScroll || false, this.editor.getOption('autofocus') || false); - } - - if (props && props.scroll) { - this.delegateScroll(props.scroll); - } - }; - - Shared.prototype.applyNext = function(props, next, preserved) { - if (props && props.selection && props.selection.ranges) { - if (next && next.selection && next.selection.ranges && !Helper.equals(props.selection.ranges, next.selection.ranges)) { - this.delegateSelection(next.selection.ranges, next.selection.focus || false); - } - } - - if (props && props.cursor) { - if (next && next.cursor && !Helper.equals(props.cursor, next.cursor)) { - this.delegateCursor(preserved.cursor || next.cursor, next.autoScroll || false, next.autoCursor || false); - } - } - - if (props && props.scroll) { - if (next && next.scroll && !Helper.equals(props.scroll, next.scroll)) { - this.delegateScroll(next.scroll); - } - } - }; - - Shared.prototype.applyUserDefined = function(props, preserved) { - if (preserved && preserved.cursor) { - this.delegateCursor(preserved.cursor, props.autoScroll || false, this.editor.getOption('autofocus') || false); - } - }; - - Shared.prototype.wire = function(props) { - var _this = this; - - Object.keys(props || {}).filter(function(p) { - return /^on/.test(p); - }).forEach(function(prop) { - switch (prop) { - case 'onBlur': { - _this.editor.on('blur', function(cm, event) { - _this.props.onBlur(_this.editor, event); - }); - } - break; - - case 'onContextMenu': { - _this.editor.on('contextmenu', function(cm, event) { - _this.props.onContextMenu(_this.editor, event); - }); - - break; - } - - case 'onCopy': { - _this.editor.on('copy', function(cm, event) { - _this.props.onCopy(_this.editor, event); - }); - - break; - } - - case 'onCursor': { - _this.editor.on('cursorActivity', function(cm) { - _this.props.onCursor(_this.editor, _this.editor.getDoc().getCursor()); - }); - } - break; - - case 'onCursorActivity': { - _this.editor.on('cursorActivity', function(cm) { - _this.props.onCursorActivity(_this.editor); - }); - } - break; - - case 'onCut': { - _this.editor.on('cut', function(cm, event) { - _this.props.onCut(_this.editor, event); - }); - - break; - } - - case 'onDblClick': { - _this.editor.on('dblclick', function(cm, event) { - _this.props.onDblClick(_this.editor, event); - }); - - break; - } - - case 'onDragEnter': { - _this.editor.on('dragenter', function(cm, event) { - _this.props.onDragEnter(_this.editor, event); - }); - } - break; - - case 'onDragLeave': { - _this.editor.on('dragleave', function(cm, event) { - _this.props.onDragLeave(_this.editor, event); - }); - - break; - } - - case 'onDragOver': { - _this.editor.on('dragover', function(cm, event) { - _this.props.onDragOver(_this.editor, event); - }); - } - break; - - case 'onDragStart': { - _this.editor.on('dragstart', function(cm, event) { - _this.props.onDragStart(_this.editor, event); - }); - - break; - } - - case 'onDrop': { - _this.editor.on('drop', function(cm, event) { - _this.props.onDrop(_this.editor, event); - }); - } - break; - - case 'onFocus': { - _this.editor.on('focus', function(cm, event) { - _this.props.onFocus(_this.editor, event); - }); - } - break; - - case 'onGutterClick': { - _this.editor.on('gutterClick', function(cm, lineNumber, gutter, event) { - _this.props.onGutterClick(_this.editor, lineNumber, gutter, event); - }); - } - break; - - case 'onInputRead': { - _this.editor.on('inputRead', function(cm, EditorChangeEvent) { - _this.props.onInputRead(_this.editor, EditorChangeEvent); - }); - } - break; - - case 'onKeyDown': { - _this.editor.on('keydown', function(cm, event) { - _this.props.onKeyDown(_this.editor, event); - }); - } - break; - - case 'onKeyHandled': { - _this.editor.on('keyHandled', function(cm, key, event) { - _this.props.onKeyHandled(_this.editor, key, event); - }); - } - break; - - case 'onKeyPress': { - _this.editor.on('keypress', function(cm, event) { - _this.props.onKeyPress(_this.editor, event); - }); - } - break; - - case 'onKeyUp': { - _this.editor.on('keyup', function(cm, event) { - _this.props.onKeyUp(_this.editor, event); - }); - } - break; - - case 'onMouseDown': { - _this.editor.on('mousedown', function(cm, event) { - _this.props.onMouseDown(_this.editor, event); - }); - - break; - } - - case 'onPaste': { - _this.editor.on('paste', function(cm, event) { - _this.props.onPaste(_this.editor, event); - }); - - break; - } - - case 'onRenderLine': { - _this.editor.on('renderLine', function(cm, line, element) { - _this.props.onRenderLine(_this.editor, line, element); - }); - - break; - } - - case 'onScroll': { - _this.editor.on('scroll', function(cm) { - _this.props.onScroll(_this.editor, _this.editor.getScrollInfo()); - }); - } - break; - - case 'onSelection': { - _this.editor.on('beforeSelectionChange', function(cm, data) { - _this.props.onSelection(_this.editor, data); - }); - } - break; - - case 'onTouchStart': { - _this.editor.on('touchstart', function(cm, event) { - _this.props.onTouchStart(_this.editor, event); - }); - - break; - } - - case 'onUpdate': { - _this.editor.on('update', function(cm) { - _this.props.onUpdate(_this.editor); - }); - } - break; - - case 'onViewportChange': { - _this.editor.on('viewportChange', function(cm, from, to) { - _this.props.onViewportChange(_this.editor, from, to); - }); - } - break; - } - }); - }; - - return Shared; -}(); - -var Controlled = function(_super) { - __extends(Controlled, _super); - - function Controlled(props) { - var _this = _super.call(this, props) || this; - - if (SERVER_RENDERED) return _this; - _this.applied = false; - _this.appliedNext = false; - _this.appliedUserDefined = false; - _this.deferred = null; - _this.emulating = false; - _this.hydrated = false; - - _this.initCb = function() { - if (_this.props.editorDidConfigure) { - _this.props.editorDidConfigure(_this.editor); - } - }; - - _this.mounted = false; - return _this; - } - - Controlled.prototype.hydrate = function(props) { - var _this = this; - - var _options = props && props.options ? props.options : {}; - - var userDefinedOptions = _extends({}, cm.defaults, this.editor.options, _options); - - var optionDelta = Object.keys(userDefinedOptions).some(function(key) { - return _this.editor.getOption(key) !== userDefinedOptions[key]; - }); - - if (optionDelta) { - Object.keys(userDefinedOptions).forEach(function(key) { - if (_options.hasOwnProperty(key)) { - if (_this.editor.getOption(key) !== userDefinedOptions[key]) { - _this.editor.setOption(key, userDefinedOptions[key]); - - _this.mirror.setOption(key, userDefinedOptions[key]); - } - } - }); - } - - if (!this.hydrated) { - this.deferred ? this.resolveChange(props.value) : this.initChange(props.value || ''); - } - - this.hydrated = true; - }; - - Controlled.prototype.initChange = function(value) { - this.emulating = true; - var doc = this.editor.getDoc(); - var lastLine = doc.lastLine(); - var lastChar = doc.getLine(doc.lastLine()).length; - doc.replaceRange(value || '', { - line: 0, - ch: 0 - }, { - line: lastLine, - ch: lastChar - }); - this.mirror.setValue(value); - doc.clearHistory(); - this.mirror.clearHistory(); - this.emulating = false; - }; - - Controlled.prototype.resolveChange = function(value) { - this.emulating = true; - var doc = this.editor.getDoc(); - - if (this.deferred.origin === 'undo') { - doc.undo(); - } else if (this.deferred.origin === 'redo') { - doc.redo(); - } else { - doc.replaceRange(this.deferred.text, this.deferred.from, this.deferred.to, this.deferred.origin); - } - - if (value && value !== doc.getValue()) { - var cursor = doc.getCursor(); - doc.setValue(value); - doc.setCursor(cursor); - } - - this.emulating = false; - this.deferred = null; - }; - - Controlled.prototype.mirrorChange = function(deferred) { - var doc = this.editor.getDoc(); - - if (deferred.origin === 'undo') { - doc.setHistory(this.mirror.getHistory()); - this.mirror.undo(); - } else if (deferred.origin === 'redo') { - doc.setHistory(this.mirror.getHistory()); - this.mirror.redo(); - } else { - this.mirror.replaceRange(deferred.text, deferred.from, deferred.to, deferred.origin); - } - - return this.mirror.getValue(); - }; - - Controlled.prototype.componentDidMount = function() { - var _this = this; - - if (SERVER_RENDERED) return; - - if (this.props.defineMode) { - if (this.props.defineMode.name && this.props.defineMode.fn) { - cm.defineMode(this.props.defineMode.name, this.props.defineMode.fn); - } - } - - this.editor = cm(this.ref, this.props.options); - this.shared = new Shared(this.editor, this.props); - this.mirror = cm(function() {}, this.props.options); - this.editor.on('electricInput', function() { - _this.mirror.setHistory(_this.editor.getDoc().getHistory()); - }); - this.editor.on('cursorActivity', function() { - _this.mirror.setCursor(_this.editor.getDoc().getCursor()); - }); - this.editor.on('beforeChange', function(cm, data) { - if (_this.emulating) { - return; - } - - data.cancel(); - _this.deferred = data; - - var phantomChange = _this.mirrorChange(_this.deferred); - - if (_this.props.onBeforeChange) _this.props.onBeforeChange(_this.editor, _this.deferred, phantomChange); - }); - this.editor.on('change', function(cm, data) { - if (!_this.mounted) { - return; - } - - if (_this.props.onChange) { - _this.props.onChange(_this.editor, data, _this.editor.getValue()); - } - }); - this.hydrate(this.props); - this.shared.apply(this.props); - this.applied = true; - this.mounted = true; - this.shared.wire(this.props); - - if (this.editor.getOption('autofocus')) { - this.editor.focus(); - } - - if (this.props.editorDidMount) { - this.props.editorDidMount(this.editor, this.editor.getValue(), this.initCb); - } - }; - - Controlled.prototype.componentDidUpdate = function(prevProps) { - if (SERVER_RENDERED) return; - var preserved = { - cursor: null - }; - - if (this.props.value !== prevProps.value) { - this.hydrated = false; - } - - if (!this.props.autoCursor && this.props.autoCursor !== undefined) { - preserved.cursor = this.editor.getDoc().getCursor(); - } - - this.hydrate(this.props); - - if (!this.appliedNext) { - this.shared.applyNext(prevProps, this.props, preserved); - this.appliedNext = true; - } - - this.shared.applyUserDefined(prevProps, preserved); - this.appliedUserDefined = true; - }; - - Controlled.prototype.componentWillUnmount = function() { - if (SERVER_RENDERED) return; - - if (this.props.editorWillUnmount) { - this.props.editorWillUnmount(cm); - } - }; - - Controlled.prototype.shouldComponentUpdate = function(nextProps, nextState) { - return !SERVER_RENDERED; - }; - - Controlled.prototype.render = function() { - var _this = this; - - if (SERVER_RENDERED) return null; - var className = this.props.className ? 'react-codemirror2 ' + this.props.className : 'react-codemirror2'; - return react.createElement('div', { - className: className, - ref: function ref(self) { - return _this.ref = self; - } - }); - }; - - return Controlled; -}(react.Component); - -exports.Controlled = Controlled; - -var UnControlled = function(_super) { - __extends(UnControlled, _super); - - function UnControlled(props) { - var _this = _super.call(this, props) || this; - - if (SERVER_RENDERED) return _this; - _this.applied = false; - _this.appliedUserDefined = false; - _this.continueChange = false; - _this.detached = false; - _this.hydrated = false; - - _this.initCb = function() { - if (_this.props.editorDidConfigure) { - _this.props.editorDidConfigure(_this.editor); - } - }; - - _this.mounted = false; - - _this.onBeforeChangeCb = function() { - _this.continueChange = true; - }; - - return _this; - } - - UnControlled.prototype.hydrate = function(props) { - var _this = this; - - var _options = props && props.options ? props.options : {}; - - var userDefinedOptions = _extends({}, cm.defaults, this.editor.options, _options); - - var optionDelta = Object.keys(userDefinedOptions).some(function(key) { - return _this.editor.getOption(key) !== userDefinedOptions[key]; - }); - - if (optionDelta) { - Object.keys(userDefinedOptions).forEach(function(key) { - if (_options.hasOwnProperty(key)) { - if (_this.editor.getOption(key) !== userDefinedOptions[key]) { - _this.editor.setOption(key, userDefinedOptions[key]); - } - } - }); - } - - if (!this.hydrated) { - var doc = this.editor.getDoc(); - var lastLine = doc.lastLine(); - var lastChar = doc.getLine(doc.lastLine()).length; - doc.replaceRange(props.value || '', { - line: 0, - ch: 0 - }, { - line: lastLine, - ch: lastChar - }); - } - - this.hydrated = true; - }; - - UnControlled.prototype.componentDidMount = function() { - var _this = this; - - if (SERVER_RENDERED) return; - this.detached = this.props.detach === true; - - if (this.props.defineMode) { - if (this.props.defineMode.name && this.props.defineMode.fn) { - cm.defineMode(this.props.defineMode.name, this.props.defineMode.fn); - } - } - - this.editor = cm(this.ref, this.props.options); - this.shared = new Shared(this.editor, this.props); - this.editor.on('beforeChange', function(cm, data) { - if (_this.props.onBeforeChange) { - _this.props.onBeforeChange(_this.editor, data, _this.editor.getValue(), _this.onBeforeChangeCb); - } - }); - this.editor.on('change', function(cm, data) { - if (!_this.mounted || !_this.props.onChange) { - return; - } - - if (_this.props.onBeforeChange) { - if (_this.continueChange) { - _this.props.onChange(_this.editor, data, _this.editor.getValue()); - } - } else { - _this.props.onChange(_this.editor, data, _this.editor.getValue()); - } - }); - this.hydrate(this.props); - this.shared.apply(this.props); - this.applied = true; - this.mounted = true; - this.shared.wire(this.props); - this.editor.getDoc().clearHistory(); - - if (this.props.editorDidMount) { - this.props.editorDidMount(this.editor, this.editor.getValue(), this.initCb); - } - }; - - UnControlled.prototype.componentDidUpdate = function(prevProps) { - if (this.detached && this.props.detach === false) { - this.detached = false; - - if (prevProps.editorDidAttach) { - prevProps.editorDidAttach(this.editor); - } - } - - if (!this.detached && this.props.detach === true) { - this.detached = true; - - if (prevProps.editorDidDetach) { - prevProps.editorDidDetach(this.editor); - } - } - - if (SERVER_RENDERED || this.detached) return; - var preserved = { - cursor: null - }; - - if (this.props.value !== prevProps.value) { - this.hydrated = false; - this.applied = false; - this.appliedUserDefined = false; - } - - if (!prevProps.autoCursor && prevProps.autoCursor !== undefined) { - preserved.cursor = this.editor.getDoc().getCursor(); - } - - this.hydrate(this.props); - - if (!this.applied) { - this.shared.apply(prevProps); - this.applied = true; - } - - if (!this.appliedUserDefined) { - this.shared.applyUserDefined(prevProps, preserved); - this.appliedUserDefined = true; - } - }; - - UnControlled.prototype.componentWillUnmount = function() { - if (SERVER_RENDERED) return; - - if (this.props.editorWillUnmount) { - this.props.editorWillUnmount(cm); - } - }; - - UnControlled.prototype.shouldComponentUpdate = function(nextProps, nextState) { - var update = true; - if (SERVER_RENDERED) update = false; - if (this.detached && nextProps.detach) update = false; - return update; - }; - - UnControlled.prototype.render = function() { - var _this = this; - - if (SERVER_RENDERED) return null; - var className = this.props.className ? 'react-codemirror2 ' + this.props.className : 'react-codemirror2'; - return react.createElement('div', { - className: className, - ref: function ref(self) { - return _this.ref = self; - } - }); - }; - - return UnControlled; -}(react.Component); - -exports.UnControlled = UnControlled; -}); - -var Controlled = reactCodemirror2.Controlled; -export { Controlled }; diff --git a/docs/_snowpack/pkg/react-dom.js b/docs/_snowpack/pkg/react-dom.js deleted file mode 100644 index cb70c7d3..00000000 --- a/docs/_snowpack/pkg/react-dom.js +++ /dev/null @@ -1,356 +0,0 @@ -import { c as createCommonjsModule } from './common/_commonjsHelpers-8c19dec8.js'; -import { r as react } from './common/index-67cfdec9.js'; -import { o as objectAssign } from './common/index-d01087d6.js'; - -var scheduler_production_min = createCommonjsModule(function (module, exports) { -var f,g,h,k;if("object"===typeof performance&&"function"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()};}else {var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q};} -if("undefined"===typeof window||"function"!==typeof MessageChannel){var t=null,u=null,w=function(){if(null!==t)try{var a=exports.unstable_now();t(!0,a);t=null;}catch(b){throw setTimeout(w,0),b;}};f=function(a){null!==t?setTimeout(f,0,a):(t=a,setTimeout(w,0));};g=function(a,b){u=setTimeout(a,b);};h=function(){clearTimeout(u);};exports.unstable_shouldYield=function(){return !1};k=exports.unstable_forceFrameRate=function(){};}else {var x=window.setTimeout,y=window.clearTimeout;if("undefined"!==typeof console){var z= -window.cancelAnimationFrame;"function"!==typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills");"function"!==typeof z&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills");}var A=!1,B=null,C=-1,D=5,E=0;exports.unstable_shouldYield=function(){return exports.unstable_now()>= -E};k=function(){};exports.unstable_forceFrameRate=function(a){0>a||125>>1,e=a[d];if(void 0!==e&&0I(n,c))void 0!==r&&0>I(r,n)?(a[d]=r,a[v]=c,d=v):(a[d]=n,a[m]=c,d=m);else if(void 0!==r&&0>I(r,c))a[d]=r,a[v]=c,d=v;else break a}}return b}return null}function I(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}var L=[],M=[],N=1,O=null,P=3,Q=!1,R=!1,S=!1; -function T(a){for(var b=J(M);null!==b;){if(null===b.callback)K(M);else if(b.startTime<=a)K(M),b.sortIndex=b.expirationTime,H(L,b);else break;b=J(M);}}function U(a){S=!1;T(a);if(!R)if(null!==J(L))R=!0,f(V);else {var b=J(M);null!==b&&g(U,b.startTime-a);}} -function V(a,b){R=!1;S&&(S=!1,h());Q=!0;var c=P;try{T(b);for(O=J(L);null!==O&&(!(O.expirationTime>b)||a&&!exports.unstable_shouldYield());){var d=O.callback;if("function"===typeof d){O.callback=null;P=O.priorityLevel;var e=d(O.expirationTime<=b);b=exports.unstable_now();"function"===typeof e?O.callback=e:O===J(L)&&K(L);T(b);}else K(L);O=J(L);}if(null!==O)var m=!0;else {var n=J(M);null!==n&&g(U,n.startTime-b);m=!1;}return m}finally{O=null,P=c,Q=!1;}}var W=k;exports.unstable_IdlePriority=5; -exports.unstable_ImmediatePriority=1;exports.unstable_LowPriority=4;exports.unstable_NormalPriority=3;exports.unstable_Profiling=null;exports.unstable_UserBlockingPriority=2;exports.unstable_cancelCallback=function(a){a.callback=null;};exports.unstable_continueExecution=function(){R||Q||(R=!0,f(V));};exports.unstable_getCurrentPriorityLevel=function(){return P};exports.unstable_getFirstCallbackNode=function(){return J(L)}; -exports.unstable_next=function(a){switch(P){case 1:case 2:case 3:var b=3;break;default:b=P;}var c=P;P=b;try{return a()}finally{P=c;}};exports.unstable_pauseExecution=function(){};exports.unstable_requestPaint=W;exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3;}var c=P;P=a;try{return b()}finally{P=c;}}; -exports.unstable_scheduleCallback=function(a,b,c){var d=exports.unstable_now();"object"===typeof c&&null!==c?(c=c.delay,c="number"===typeof c&&0d?(a.sortIndex=c,H(M,a),null===J(L)&&a===J(M)&&(S?h():S=!0,g(U,c-d))):(a.sortIndex=e,H(L,a),R||Q||(R=!0,f(V)));return a}; -exports.unstable_wrapCallback=function(a){var b=P;return function(){var c=P;P=b;try{return a.apply(this,arguments)}finally{P=c;}}}; -}); - -var scheduler = createCommonjsModule(function (module) { - -{ - module.exports = scheduler_production_min; -} -}); - -function y(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;cb}return !1}function B(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g;}var D={}; -"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){D[a]=new B(a,0,!1,a,null,!1,!1);});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];D[b]=new B(b,1,!1,a[1],null,!1,!1);});["contentEditable","draggable","spellCheck","value"].forEach(function(a){D[a]=new B(a,2,!1,a.toLowerCase(),null,!1,!1);}); -["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){D[a]=new B(a,2,!1,a,null,!1,!1);});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){D[a]=new B(a,3,!1,a.toLowerCase(),null,!1,!1);}); -["checked","multiple","muted","selected"].forEach(function(a){D[a]=new B(a,3,!0,a,null,!1,!1);});["capture","download"].forEach(function(a){D[a]=new B(a,4,!1,a,null,!1,!1);});["cols","rows","size","span"].forEach(function(a){D[a]=new B(a,6,!1,a,null,!1,!1);});["rowSpan","start"].forEach(function(a){D[a]=new B(a,5,!1,a.toLowerCase(),null,!1,!1);});var oa=/[\-:]([a-z])/g;function pa(a){return a[1].toUpperCase()} -"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var b=a.replace(oa, -pa);D[b]=new B(b,1,!1,a,null,!1,!1);});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var b=a.replace(oa,pa);D[b]=new B(b,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1);});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(oa,pa);D[b]=new B(b,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1);});["tabIndex","crossOrigin"].forEach(function(a){D[a]=new B(a,1,!1,a.toLowerCase(),null,!1,!1);}); -D.xlinkHref=new B("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(a){D[a]=new B(a,1,!1,a.toLowerCase(),null,!0,!0);}); -function qa(a,b,c,d){var e=D.hasOwnProperty(b)?D[b]:null;var f=null!==e?0===e.type:d?!1:!(2h||e[g]!==f[h])return "\n"+e[g].replace(" at new "," at ");while(1<=g&&0<=h)}break}}}finally{Oa=!1,Error.prepareStackTrace=c;}return (a=a?a.displayName||a.name:"")?Na(a):""} -function Qa(a){switch(a.tag){case 5:return Na(a.type);case 16:return Na("Lazy");case 13:return Na("Suspense");case 19:return Na("SuspenseList");case 0:case 2:case 15:return a=Pa(a.type,!1),a;case 11:return a=Pa(a.type.render,!1),a;case 22:return a=Pa(a.type._render,!1),a;case 1:return a=Pa(a.type,!0),a;default:return ""}} -function Ra(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case ua:return "Fragment";case ta:return "Portal";case xa:return "Profiler";case wa:return "StrictMode";case Ba:return "Suspense";case Ca:return "SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case za:return (a.displayName||"Context")+".Consumer";case ya:return (a._context.displayName||"Context")+".Provider";case Aa:var b=a.render;b=b.displayName||b.name||""; -return a.displayName||(""!==b?"ForwardRef("+b+")":"ForwardRef");case Da:return Ra(a.type);case Fa:return Ra(a._render);case Ea:b=a._payload;a=a._init;try{return Ra(a(b))}catch(c){}}return null}function Sa(a){switch(typeof a){case "boolean":case "number":case "object":case "string":case "undefined":return a;default:return ""}}function Ta(a){var b=a.type;return (a=a.nodeName)&&"input"===a.toLowerCase()&&("checkbox"===b||"radio"===b)} -function Ua(a){var b=Ta(a)?"checked":"value",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=""+a[b];if(!a.hasOwnProperty(b)&&"undefined"!==typeof c&&"function"===typeof c.get&&"function"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=""+a;f.call(this,a);}});Object.defineProperty(a,b,{enumerable:c.enumerable});return {getValue:function(){return d},setValue:function(a){d=""+a;},stopTracking:function(){a._valueTracker= -null;delete a[b];}}}}function Va(a){a._valueTracker||(a._valueTracker=Ua(a));}function Wa(a){if(!a)return !1;var b=a._valueTracker;if(!b)return !0;var c=b.getValue();var d="";a&&(d=Ta(a)?a.checked?"true":"false":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Xa(a){a=a||("undefined"!==typeof document?document:void 0);if("undefined"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}} -function Ya(a,b){var c=b.checked;return objectAssign({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function Za(a,b){var c=null==b.defaultValue?"":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=Sa(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:"checkbox"===b.type||"radio"===b.type?null!=b.checked:null!=b.value};}function $a(a,b){b=b.checked;null!=b&&qa(a,"checked",b,!1);} -function ab(a,b){$a(a,b);var c=Sa(b.value),d=b.type;if(null!=c)if("number"===d){if(0===c&&""===a.value||a.value!=c)a.value=""+c;}else a.value!==""+c&&(a.value=""+c);else if("submit"===d||"reset"===d){a.removeAttribute("value");return}b.hasOwnProperty("value")?bb(a,b.type,c):b.hasOwnProperty("defaultValue")&&bb(a,b.type,Sa(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked);} -function cb(a,b,c){if(b.hasOwnProperty("value")||b.hasOwnProperty("defaultValue")){var d=b.type;if(!("submit"!==d&&"reset"!==d||void 0!==b.value&&null!==b.value))return;b=""+a._wrapperState.initialValue;c||b===a.value||(a.value=b);a.defaultValue=b;}c=a.name;""!==c&&(a.name="");a.defaultChecked=!!a._wrapperState.initialChecked;""!==c&&(a.name=c);} -function bb(a,b,c){if("number"!==b||Xa(a.ownerDocument)!==a)null==c?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+c&&(a.defaultValue=""+c);}function db(a){var b="";react.Children.forEach(a,function(a){null!=a&&(b+=a);});return b}function eb(a,b){a=objectAssign({children:void 0},b);if(b=db(b.children))a.children=b;return a} -function fb(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e=c.length))throw Error(y(93));c=c[0];}b=c;}null==b&&(b="");c=b;}a._wrapperState={initialValue:Sa(c)};} -function ib(a,b){var c=Sa(b.value),d=Sa(b.defaultValue);null!=c&&(c=""+c,c!==a.value&&(a.value=c),null==b.defaultValue&&a.defaultValue!==c&&(a.defaultValue=c));null!=d&&(a.defaultValue=""+d);}function jb(a){var b=a.textContent;b===a._wrapperState.initialValue&&""!==b&&null!==b&&(a.value=b);}var kb={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"}; -function lb(a){switch(a){case "svg":return "http://www.w3.org/2000/svg";case "math":return "http://www.w3.org/1998/Math/MathML";default:return "http://www.w3.org/1999/xhtml"}}function mb(a,b){return null==a||"http://www.w3.org/1999/xhtml"===a?lb(b):"http://www.w3.org/2000/svg"===a&&"foreignObject"===b?"http://www.w3.org/1999/xhtml":a} -var nb,ob=function(a){return "undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(b,c,d,e){MSApp.execUnsafeLocalFunction(function(){return a(b,c,d,e)});}:a}(function(a,b){if(a.namespaceURI!==kb.svg||"innerHTML"in a)a.innerHTML=b;else {nb=nb||document.createElement("div");nb.innerHTML=""+b.valueOf().toString()+"";for(b=nb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild);}}); -function pb(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b;} -var qb={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0, -floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},rb=["Webkit","ms","Moz","O"];Object.keys(qb).forEach(function(a){rb.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);qb[b]=qb[a];});});function sb(a,b,c){return null==b||"boolean"===typeof b||""===b?"":c||"number"!==typeof b||0===b||qb.hasOwnProperty(a)&&qb[a]?(""+b).trim():b+"px"} -function tb(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf("--"),e=sb(c,b[c],d);"float"===c&&(c="cssFloat");d?a.setProperty(c,e):a[c]=e;}}var ub=objectAssign({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}); -function vb(a,b){if(b){if(ub[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML))throw Error(y(137,a));if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw Error(y(60));if(!("object"===typeof b.dangerouslySetInnerHTML&&"__html"in b.dangerouslySetInnerHTML))throw Error(y(61));}if(null!=b.style&&"object"!==typeof b.style)throw Error(y(62));}} -function wb(a,b){if(-1===a.indexOf("-"))return "string"===typeof b.is;switch(a){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":return !1;default:return !0}}function xb(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}var yb=null,zb=null,Ab=null; -function Bb(a){if(a=Cb(a)){if("function"!==typeof yb)throw Error(y(280));var b=a.stateNode;b&&(b=Db(b),yb(a.stateNode,a.type,b));}}function Eb(a){zb?Ab?Ab.push(a):Ab=[a]:zb=a;}function Fb(){if(zb){var a=zb,b=Ab;Ab=zb=null;Bb(a);if(b)for(a=0;ad?0:1<c;c++)b.push(a);return b} -function $c(a,b,c){a.pendingLanes|=b;var d=b-1;a.suspendedLanes&=d;a.pingedLanes&=d;a=a.eventTimes;b=31-Vc(b);a[b]=c;}var Vc=Math.clz32?Math.clz32:ad,bd=Math.log,cd=Math.LN2;function ad(a){return 0===a?32:31-(bd(a)/cd|0)|0}var dd=scheduler.unstable_UserBlockingPriority,ed=scheduler.unstable_runWithPriority,fd=!0;function gd(a,b,c,d){Kb||Ib();var e=hd,f=Kb;Kb=!0;try{Hb(e,a,b,c,d);}finally{(Kb=f)||Mb();}}function id(a,b,c,d){ed(dd,hd.bind(null,a,b,c,d));} -function hd(a,b,c,d){if(fd){var e;if((e=0===(b&4))&&0=be),ee=String.fromCharCode(32),fe=!1; -function ge(a,b){switch(a){case "keyup":return -1!==$d.indexOf(b.keyCode);case "keydown":return 229!==b.keyCode;case "keypress":case "mousedown":case "focusout":return !0;default:return !1}}function he(a){a=a.detail;return "object"===typeof a&&"data"in a?a.data:null}var ie=!1;function je(a,b){switch(a){case "compositionend":return he(b);case "keypress":if(32!==b.which)return null;fe=!0;return ee;case "textInput":return a=b.data,a===ee&&fe?null:a;default:return null}} -function ke(a,b){if(ie)return "compositionend"===a||!ae&&ge(a,b)?(a=nd(),md=ld=kd=null,ie=!1,a):null;switch(a){case "paste":return null;case "keypress":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1=b)return {node:c,offset:b-a};a=d;}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode;}c=void 0;}c=Ke(c);}}function Me(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Me(a,b.parentNode):"contains"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1} -function Ne(){for(var a=window,b=Xa();b instanceof a.HTMLIFrameElement;){try{var c="string"===typeof b.contentWindow.location.href;}catch(d){c=!1;}if(c)a=b.contentWindow;else break;b=Xa(a.document);}return b}function Oe(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&("text"===a.type||"search"===a.type||"tel"===a.type||"url"===a.type||"password"===a.type)||"textarea"===b||"true"===a.contentEditable)} -var Pe=fa&&"documentMode"in document&&11>=document.documentMode,Qe=null,Re=null,Se=null,Te=!1; -function Ue(a,b,c){var d=c.window===c?c.document:9===c.nodeType?c:c.ownerDocument;Te||null==Qe||Qe!==Xa(d)||(d=Qe,"selectionStart"in d&&Oe(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Se&&Je(Se,d)||(Se=d,d=oe(Re,"onSelect"),0Af||(a.current=zf[Af],zf[Af]=null,Af--);}function I(a,b){Af++;zf[Af]=a.current;a.current=b;}var Cf={},M=Bf(Cf),N=Bf(!1),Df=Cf; -function Ef(a,b){var c=a.type.contextTypes;if(!c)return Cf;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function Ff(a){a=a.childContextTypes;return null!==a&&void 0!==a}function Gf(){H(N);H(M);}function Hf(a,b,c){if(M.current!==Cf)throw Error(y(168));I(M,b);I(N,c);} -function If(a,b,c){var d=a.stateNode;a=b.childContextTypes;if("function"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in a))throw Error(y(108,Ra(b)||"Unknown",e));return objectAssign({},c,d)}function Jf(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Cf;Df=M.current;I(M,a);I(N,N.current);return !0}function Kf(a,b,c){var d=a.stateNode;if(!d)throw Error(y(169));c?(a=If(a,b,Df),d.__reactInternalMemoizedMergedChildContext=a,H(N),H(M),I(M,a)):H(N);I(N,c);} -var Lf=null,Mf=null,Nf=scheduler.unstable_runWithPriority,Of=scheduler.unstable_scheduleCallback,Pf=scheduler.unstable_cancelCallback,Qf=scheduler.unstable_shouldYield,Rf=scheduler.unstable_requestPaint,Sf=scheduler.unstable_now,Tf=scheduler.unstable_getCurrentPriorityLevel,Uf=scheduler.unstable_ImmediatePriority,Vf=scheduler.unstable_UserBlockingPriority,Wf=scheduler.unstable_NormalPriority,Xf=scheduler.unstable_LowPriority,Yf=scheduler.unstable_IdlePriority,Zf={},$f=void 0!==Rf?Rf:function(){},ag=null,bg=null,cg=!1,dg=Sf(),O=1E4>dg?Sf:function(){return Sf()-dg}; -function eg(){switch(Tf()){case Uf:return 99;case Vf:return 98;case Wf:return 97;case Xf:return 96;case Yf:return 95;default:throw Error(y(332));}}function fg(a){switch(a){case 99:return Uf;case 98:return Vf;case 97:return Wf;case 96:return Xf;case 95:return Yf;default:throw Error(y(332));}}function gg(a,b){a=fg(a);return Nf(a,b)}function hg(a,b,c){a=fg(a);return Of(a,b,c)}function ig(){if(null!==bg){var a=bg;bg=null;Pf(a);}jg();} -function jg(){if(!cg&&null!==ag){cg=!0;var a=0;try{var b=ag;gg(99,function(){for(;az?(q=u,u=null):q=u.sibling;var n=p(e,u,h[z],k);if(null===n){null===u&&(u=q);break}a&&u&&null=== -n.alternate&&b(e,u);g=f(n,g,z);null===t?l=n:t.sibling=n;t=n;u=q;}if(z===h.length)return c(e,u),l;if(null===u){for(;zz?(q=u,u=null):q=u.sibling;var w=p(e,u,n.value,k);if(null===w){null===u&&(u=q);break}a&&u&&null===w.alternate&&b(e,u);g=f(w,g,z);null===t?l=w:t.sibling=w;t=w;u=q;}if(n.done)return c(e,u),l;if(null===u){for(;!n.done;z++,n=h.next())n=A(e,n.value,k),null!==n&&(g=f(n,g,z),null===t?l=n:t.sibling=n,t=n);return l}for(u=d(e,u);!n.done;z++,n=h.next())n=C(u,e,z,n.value,k),null!==n&&(a&&null!==n.alternate&& -u.delete(null===n.key?z:n.key),g=f(n,g,z),null===t?l=n:t.sibling=n,t=n);a&&u.forEach(function(a){return b(e,a)});return l}return function(a,d,f,h){var k="object"===typeof f&&null!==f&&f.type===ua&&null===f.key;k&&(f=f.props.children);var l="object"===typeof f&&null!==f;if(l)switch(f.$$typeof){case sa:a:{l=f.key;for(k=d;null!==k;){if(k.key===l){switch(k.tag){case 7:if(f.type===ua){c(a,k.sibling);d=e(k,f.props.children);d.return=a;a=d;break a}break;default:if(k.elementType===f.type){c(a,k.sibling); -d=e(k,f.props);d.ref=Qg(a,k,f);d.return=a;a=d;break a}}c(a,k);break}else b(a,k);k=k.sibling;}f.type===ua?(d=Xg(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=Vg(f.type,f.key,f.props,null,a.mode,h),h.ref=Qg(a,d,f),h.return=a,a=h);}return g(a);case ta:a:{for(k=f.key;null!==d;){if(d.key===k)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else {c(a,d);break}else b(a,d);d=d.sibling;}d= -Wg(f,a.mode,h);d.return=a;a=d;}return g(a)}if("string"===typeof f||"number"===typeof f)return f=""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):(c(a,d),d=Ug(f,a.mode,h),d.return=a,a=d),g(a);if(Pg(f))return x(a,d,f,h);if(La(f))return w(a,d,f,h);l&&Rg(a,f);if("undefined"===typeof f&&!k)switch(a.tag){case 1:case 22:case 0:case 11:case 15:throw Error(y(152,Ra(a.type)||"Component"));}return c(a,d)}}var Yg=Sg(!0),Zg=Sg(!1),$g={},ah=Bf($g),bh=Bf($g),ch=Bf($g); -function dh(a){if(a===$g)throw Error(y(174));return a}function eh(a,b){I(ch,b);I(bh,a);I(ah,$g);a=b.nodeType;switch(a){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:mb(null,"");break;default:a=8===a?b.parentNode:b,b=a.namespaceURI||null,a=a.tagName,b=mb(b,a);}H(ah);I(ah,b);}function fh(){H(ah);H(bh);H(ch);}function gh(a){dh(ch.current);var b=dh(ah.current);var c=mb(b,a.type);b!==c&&(I(bh,a),I(ah,c));}function hh(a){bh.current===a&&(H(ah),H(bh));}var P=Bf(0); -function ih(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||"$?"===c.data||"$!"===c.data))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.flags&64))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return;}b.sibling.return=b.return;b=b.sibling;}return null}var jh=null,kh=null,lh=!1; -function mh(a,b){var c=nh(5,null,null,0);c.elementType="DELETED";c.type="DELETED";c.stateNode=b;c.return=a;c.flags=8;null!==a.lastEffect?(a.lastEffect.nextEffect=c,a.lastEffect=c):a.firstEffect=a.lastEffect=c;}function oh(a,b){switch(a.tag){case 5:var c=a.type;b=1!==b.nodeType||c.toLowerCase()!==b.nodeName.toLowerCase()?null:b;return null!==b?(a.stateNode=b,!0):!1;case 6:return b=""===a.pendingProps||3!==b.nodeType?null:b,null!==b?(a.stateNode=b,!0):!1;case 13:return !1;default:return !1}} -function ph(a){if(lh){var b=kh;if(b){var c=b;if(!oh(a,b)){b=rf(c.nextSibling);if(!b||!oh(a,b)){a.flags=a.flags&-1025|2;lh=!1;jh=a;return}mh(jh,c);}jh=a;kh=rf(b.firstChild);}else a.flags=a.flags&-1025|2,lh=!1,jh=a;}}function qh(a){for(a=a.return;null!==a&&5!==a.tag&&3!==a.tag&&13!==a.tag;)a=a.return;jh=a;} -function rh(a){if(a!==jh)return !1;if(!lh)return qh(a),lh=!0,!1;var b=a.type;if(5!==a.tag||"head"!==b&&"body"!==b&&!nf(b,a.memoizedProps))for(b=kh;b;)mh(a,b),b=rf(b.nextSibling);qh(a);if(13===a.tag){a=a.memoizedState;a=null!==a?a.dehydrated:null;if(!a)throw Error(y(317));a:{a=a.nextSibling;for(b=0;a;){if(8===a.nodeType){var c=a.data;if("/$"===c){if(0===b){kh=rf(a.nextSibling);break a}b--;}else "$"!==c&&"$!"!==c&&"$?"!==c||b++;}a=a.nextSibling;}kh=null;}}else kh=jh?rf(a.stateNode.nextSibling):null;return !0} -function sh(){kh=jh=null;lh=!1;}var th=[];function uh(){for(var a=0;af))throw Error(y(301));f+=1;T=S=null;b.updateQueue=null;vh.current=Fh;a=c(d,e);}while(zh)}vh.current=Gh;b=null!==S&&null!==S.next;xh=0;T=S=R=null;yh=!1;if(b)throw Error(y(300));return a}function Hh(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};null===T?R.memoizedState=T=a:T=T.next=a;return T} -function Ih(){if(null===S){var a=R.alternate;a=null!==a?a.memoizedState:null;}else a=S.next;var b=null===T?R.memoizedState:T.next;if(null!==b)T=b,S=a;else {if(null===a)throw Error(y(310));S=a;a={memoizedState:S.memoizedState,baseState:S.baseState,baseQueue:S.baseQueue,queue:S.queue,next:null};null===T?R.memoizedState=T=a:T=T.next=a;}return T}function Jh(a,b){return "function"===typeof b?b(a):b} -function Kh(a){var b=Ih(),c=b.queue;if(null===c)throw Error(y(311));c.lastRenderedReducer=a;var d=S,e=d.baseQueue,f=c.pending;if(null!==f){if(null!==e){var g=e.next;e.next=f.next;f.next=g;}d.baseQueue=e=f;c.pending=null;}if(null!==e){e=e.next;d=d.baseState;var h=g=f=null,k=e;do{var l=k.lane;if((xh&l)===l)null!==h&&(h=h.next={lane:0,action:k.action,eagerReducer:k.eagerReducer,eagerState:k.eagerState,next:null}),d=k.eagerReducer===a?k.eagerState:a(d,k.action);else {var n={lane:l,action:k.action,eagerReducer:k.eagerReducer, -eagerState:k.eagerState,next:null};null===h?(g=h=n,f=d):h=h.next=n;R.lanes|=l;Dg|=l;}k=k.next;}while(null!==k&&k!==e);null===h?f=d:h.next=g;He(d,b.memoizedState)||(ug=!0);b.memoizedState=d;b.baseState=f;b.baseQueue=h;c.lastRenderedState=d;}return [b.memoizedState,c.dispatch]} -function Lh(a){var b=Ih(),c=b.queue;if(null===c)throw Error(y(311));c.lastRenderedReducer=a;var d=c.dispatch,e=c.pending,f=b.memoizedState;if(null!==e){c.pending=null;var g=e=e.next;do f=a(f,g.action),g=g.next;while(g!==e);He(f,b.memoizedState)||(ug=!0);b.memoizedState=f;null===b.baseQueue&&(b.baseState=f);c.lastRenderedState=f;}return [f,d]} -function Mh(a,b,c){var d=b._getVersion;d=d(b._source);var e=b._workInProgressVersionPrimary;if(null!==e)a=e===d;else if(a=a.mutableReadLanes,a=(xh&a)===a)b._workInProgressVersionPrimary=d,th.push(b);if(a)return c(b._source);th.push(b);throw Error(y(350));} -function Nh(a,b,c,d){var e=U;if(null===e)throw Error(y(349));var f=b._getVersion,g=f(b._source),h=vh.current,k=h.useState(function(){return Mh(e,b,c)}),l=k[1],n=k[0];k=T;var A=a.memoizedState,p=A.refs,C=p.getSnapshot,x=A.source;A=A.subscribe;var w=R;a.memoizedState={refs:p,source:b,subscribe:d};h.useEffect(function(){p.getSnapshot=c;p.setSnapshot=l;var a=f(b._source);if(!He(g,a)){a=c(b._source);He(n,a)||(l(a),a=Ig(w),e.mutableReadLanes|=a&e.pendingLanes);a=e.mutableReadLanes;e.entangledLanes|=a;for(var d= -e.entanglements,h=a;0c?98:c,function(){a(!0);});gg(97\x3c/script>",a=a.removeChild(a.firstChild)):"string"===typeof d.is?a=g.createElement(c,{is:d.is}):(a=g.createElement(c),"select"===c&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,c);a[wf]=b;a[xf]=d;Bi(a,b,!1,!1);b.stateNode=a;g=wb(c,d);switch(c){case "dialog":G("cancel",a);G("close",a); -e=d;break;case "iframe":case "object":case "embed":G("load",a);e=d;break;case "video":case "audio":for(e=0;eJi&&(b.flags|=64,f=!0,Fi(d,!1),b.lanes=33554432);}else {if(!f)if(a=ih(g),null!==a){if(b.flags|=64,f=!0,c=a.updateQueue,null!==c&&(b.updateQueue=c,b.flags|=4),Fi(d,!0),null===d.tail&&"hidden"===d.tailMode&&!g.alternate&&!lh)return b=b.lastEffect=d.lastEffect,null!==b&&(b.nextEffect=null),null}else 2*O()-d.renderingStartTime>Ji&&1073741824!==c&&(b.flags|= -64,f=!0,Fi(d,!1),b.lanes=33554432);d.isBackwards?(g.sibling=b.child,b.child=g):(c=d.last,null!==c?c.sibling=g:b.child=g,d.last=g);}return null!==d.tail?(c=d.tail,d.rendering=c,d.tail=c.sibling,d.lastEffect=b.lastEffect,d.renderingStartTime=O(),c.sibling=null,b=P.current,I(P,f?b&1|2:b&1),c):null;case 23:case 24:return Ki(),null!==a&&null!==a.memoizedState!==(null!==b.memoizedState)&&"unstable-defer-without-hiding"!==d.mode&&(b.flags|=4),null}throw Error(y(156,b.tag));} -function Li(a){switch(a.tag){case 1:Ff(a.type)&&Gf();var b=a.flags;return b&4096?(a.flags=b&-4097|64,a):null;case 3:fh();H(N);H(M);uh();b=a.flags;if(0!==(b&64))throw Error(y(285));a.flags=b&-4097|64;return a;case 5:return hh(a),null;case 13:return H(P),b=a.flags,b&4096?(a.flags=b&-4097|64,a):null;case 19:return H(P),null;case 4:return fh(),null;case 10:return rg(a),null;case 23:case 24:return Ki(),null;default:return null}} -function Mi(a,b){try{var c="",d=b;do c+=Qa(d),d=d.return;while(d);var e=c;}catch(f){e="\nError generating stack: "+f.message+"\n"+f.stack;}return {value:a,source:b,stack:e}}function Ni(a,b){try{console.error(b.value);}catch(c){setTimeout(function(){throw c;});}}var Oi="function"===typeof WeakMap?WeakMap:Map;function Pi(a,b,c){c=zg(-1,c);c.tag=3;c.payload={element:null};var d=b.value;c.callback=function(){Qi||(Qi=!0,Ri=d);Ni(a,b);};return c} -function Si(a,b,c){c=zg(-1,c);c.tag=3;var d=a.type.getDerivedStateFromError;if("function"===typeof d){var e=b.value;c.payload=function(){Ni(a,b);return d(e)};}var f=a.stateNode;null!==f&&"function"===typeof f.componentDidCatch&&(c.callback=function(){"function"!==typeof d&&(null===Ti?Ti=new Set([this]):Ti.add(this),Ni(a,b));var c=b.stack;this.componentDidCatch(b.value,{componentStack:null!==c?c:""});});return c}var Ui="function"===typeof WeakSet?WeakSet:Set; -function Vi(a){var b=a.ref;if(null!==b)if("function"===typeof b)try{b(null);}catch(c){Wi(a,c);}else b.current=null;}function Xi(a,b){switch(b.tag){case 0:case 11:case 15:case 22:return;case 1:if(b.flags&256&&null!==a){var c=a.memoizedProps,d=a.memoizedState;a=b.stateNode;b=a.getSnapshotBeforeUpdate(b.elementType===b.type?c:lg(b.type,c),d);a.__reactInternalSnapshotBeforeUpdate=b;}return;case 3:b.flags&256&&qf(b.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(y(163));} -function Yi(a,b,c){switch(c.tag){case 0:case 11:case 15:case 22:b=c.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){a=b=b.next;do{if(3===(a.tag&3)){var d=a.create;a.destroy=d();}a=a.next;}while(a!==b)}b=c.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){a=b=b.next;do{var e=a;d=e.next;e=e.tag;0!==(e&4)&&0!==(e&1)&&(Zi(c,a),$i(c,a));a=d;}while(a!==b)}return;case 1:a=c.stateNode;c.flags&4&&(null===b?a.componentDidMount():(d=c.elementType===c.type?b.memoizedProps:lg(c.type,b.memoizedProps),a.componentDidUpdate(d, -b.memoizedState,a.__reactInternalSnapshotBeforeUpdate)));b=c.updateQueue;null!==b&&Eg(c,b,a);return;case 3:b=c.updateQueue;if(null!==b){a=null;if(null!==c.child)switch(c.child.tag){case 5:a=c.child.stateNode;break;case 1:a=c.child.stateNode;}Eg(c,b,a);}return;case 5:a=c.stateNode;null===b&&c.flags&4&&mf(c.type,c.memoizedProps)&&a.focus();return;case 6:return;case 4:return;case 12:return;case 13:null===c.memoizedState&&(c=c.alternate,null!==c&&(c=c.memoizedState,null!==c&&(c=c.dehydrated,null!==c&&Cc(c)))); -return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(y(163));} -function aj(a,b){for(var c=a;;){if(5===c.tag){var d=c.stateNode;if(b)d=d.style,"function"===typeof d.setProperty?d.setProperty("display","none","important"):d.display="none";else {d=c.stateNode;var e=c.memoizedProps.style;e=void 0!==e&&null!==e&&e.hasOwnProperty("display")?e.display:null;d.style.display=sb("display",e);}}else if(6===c.tag)c.stateNode.nodeValue=b?"":c.memoizedProps;else if((23!==c.tag&&24!==c.tag||null===c.memoizedState||c===a)&&null!==c.child){c.child.return=c;c=c.child;continue}if(c=== -a)break;for(;null===c.sibling;){if(null===c.return||c.return===a)return;c=c.return;}c.sibling.return=c.return;c=c.sibling;}} -function bj(a,b){if(Mf&&"function"===typeof Mf.onCommitFiberUnmount)try{Mf.onCommitFiberUnmount(Lf,b);}catch(f){}switch(b.tag){case 0:case 11:case 14:case 15:case 22:a=b.updateQueue;if(null!==a&&(a=a.lastEffect,null!==a)){var c=a=a.next;do{var d=c,e=d.destroy;d=d.tag;if(void 0!==e)if(0!==(d&4))Zi(b,c);else {d=b;try{e();}catch(f){Wi(d,f);}}c=c.next;}while(c!==a)}break;case 1:Vi(b);a=b.stateNode;if("function"===typeof a.componentWillUnmount)try{a.props=b.memoizedProps,a.state=b.memoizedState,a.componentWillUnmount();}catch(f){Wi(b, -f);}break;case 5:Vi(b);break;case 4:cj(a,b);}}function dj(a){a.alternate=null;a.child=null;a.dependencies=null;a.firstEffect=null;a.lastEffect=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.return=null;a.updateQueue=null;}function ej(a){return 5===a.tag||3===a.tag||4===a.tag} -function fj(a){a:{for(var b=a.return;null!==b;){if(ej(b))break a;b=b.return;}throw Error(y(160));}var c=b;b=c.stateNode;switch(c.tag){case 5:var d=!1;break;case 3:b=b.containerInfo;d=!0;break;case 4:b=b.containerInfo;d=!0;break;default:throw Error(y(161));}c.flags&16&&(pb(b,""),c.flags&=-17);a:b:for(c=a;;){for(;null===c.sibling;){if(null===c.return||ej(c.return)){c=null;break a}c=c.return;}c.sibling.return=c.return;for(c=c.sibling;5!==c.tag&&6!==c.tag&&18!==c.tag;){if(c.flags&2)continue b;if(null=== -c.child||4===c.tag)continue b;else c.child.return=c,c=c.child;}if(!(c.flags&2)){c=c.stateNode;break a}}d?gj(a,c,b):hj(a,c,b);} -function gj(a,b,c){var d=a.tag,e=5===d||6===d;if(e)a=e?a.stateNode:a.stateNode.instance,b?8===c.nodeType?c.parentNode.insertBefore(a,b):c.insertBefore(a,b):(8===c.nodeType?(b=c.parentNode,b.insertBefore(a,c)):(b=c,b.appendChild(a)),c=c._reactRootContainer,null!==c&&void 0!==c||null!==b.onclick||(b.onclick=jf));else if(4!==d&&(a=a.child,null!==a))for(gj(a,b,c),a=a.sibling;null!==a;)gj(a,b,c),a=a.sibling;} -function hj(a,b,c){var d=a.tag,e=5===d||6===d;if(e)a=e?a.stateNode:a.stateNode.instance,b?c.insertBefore(a,b):c.appendChild(a);else if(4!==d&&(a=a.child,null!==a))for(hj(a,b,c),a=a.sibling;null!==a;)hj(a,b,c),a=a.sibling;} -function cj(a,b){for(var c=b,d=!1,e,f;;){if(!d){d=c.return;a:for(;;){if(null===d)throw Error(y(160));e=d.stateNode;switch(d.tag){case 5:f=!1;break a;case 3:e=e.containerInfo;f=!0;break a;case 4:e=e.containerInfo;f=!0;break a}d=d.return;}d=!0;}if(5===c.tag||6===c.tag){a:for(var g=a,h=c,k=h;;)if(bj(g,k),null!==k.child&&4!==k.tag)k.child.return=k,k=k.child;else {if(k===h)break a;for(;null===k.sibling;){if(null===k.return||k.return===h)break a;k=k.return;}k.sibling.return=k.return;k=k.sibling;}f?(g=e,h=c.stateNode, -8===g.nodeType?g.parentNode.removeChild(h):g.removeChild(h)):e.removeChild(c.stateNode);}else if(4===c.tag){if(null!==c.child){e=c.stateNode.containerInfo;f=!0;c.child.return=c;c=c.child;continue}}else if(bj(a,c),null!==c.child){c.child.return=c;c=c.child;continue}if(c===b)break;for(;null===c.sibling;){if(null===c.return||c.return===b)return;c=c.return;4===c.tag&&(d=!1);}c.sibling.return=c.return;c=c.sibling;}} -function ij(a,b){switch(b.tag){case 0:case 11:case 14:case 15:case 22:var c=b.updateQueue;c=null!==c?c.lastEffect:null;if(null!==c){var d=c=c.next;do 3===(d.tag&3)&&(a=d.destroy,d.destroy=void 0,void 0!==a&&a()),d=d.next;while(d!==c)}return;case 1:return;case 5:c=b.stateNode;if(null!=c){d=b.memoizedProps;var e=null!==a?a.memoizedProps:d;a=b.type;var f=b.updateQueue;b.updateQueue=null;if(null!==f){c[xf]=d;"input"===a&&"radio"===d.type&&null!=d.name&&$a(c,d);wb(a,e);b=wb(a,d);for(e=0;ee&&(e=g);c&=~f;}c=e;c=O()-c;c=(120>c?120:480>c?480:1080>c?1080:1920>c?1920:3E3>c?3E3:4320> -c?4320:1960*nj(c/1960))-c;if(10 component higher in the tree to provide a loading indicator or placeholder to display.");}5!==V&&(V=2);k=Mi(k,h);p= -g;do{switch(p.tag){case 3:f=k;p.flags|=4096;b&=-b;p.lanes|=b;var J=Pi(p,f,b);Bg(p,J);break a;case 1:f=k;var K=p.type,Q=p.stateNode;if(0===(p.flags&64)&&("function"===typeof K.getDerivedStateFromError||null!==Q&&"function"===typeof Q.componentDidCatch&&(null===Ti||!Ti.has(Q)))){p.flags|=4096;b&=-b;p.lanes|=b;var L=Si(p,f,b);Bg(p,L);break a}}p=p.return;}while(null!==p)}Zj(c);}catch(va){b=va;Y===c&&null!==c&&(Y=c=c.return);continue}break}while(1)} -function Pj(){var a=oj.current;oj.current=Gh;return null===a?Gh:a}function Tj(a,b){var c=X;X|=16;var d=Pj();U===a&&W===b||Qj(a,b);do try{ak();break}catch(e){Sj(a,e);}while(1);qg();X=c;oj.current=d;if(null!==Y)throw Error(y(261));U=null;W=0;return V}function ak(){for(;null!==Y;)bk(Y);}function Rj(){for(;null!==Y&&!Qf();)bk(Y);}function bk(a){var b=ck(a.alternate,a,qj);a.memoizedProps=a.pendingProps;null===b?Zj(a):Y=b;pj.current=null;} -function Zj(a){var b=a;do{var c=b.alternate;a=b.return;if(0===(b.flags&2048)){c=Gi(c,b,qj);if(null!==c){Y=c;return}c=b;if(24!==c.tag&&23!==c.tag||null===c.memoizedState||0!==(qj&1073741824)||0===(c.mode&4)){for(var d=0,e=c.child;null!==e;)d|=e.lanes|e.childLanes,e=e.sibling;c.childLanes=d;}null!==a&&0===(a.flags&2048)&&(null===a.firstEffect&&(a.firstEffect=b.firstEffect),null!==b.lastEffect&&(null!==a.lastEffect&&(a.lastEffect.nextEffect=b.firstEffect),a.lastEffect=b.lastEffect),1g&&(h=g,g=J,J=h),h=Le(t,J),f=Le(t,g),h&&f&&(1!==v.rangeCount||v.anchorNode!==h.node||v.anchorOffset!==h.offset||v.focusNode!==f.node||v.focusOffset!==f.offset)&&(q=q.createRange(),q.setStart(h.node,h.offset),v.removeAllRanges(),J>g?(v.addRange(q),v.extend(f.node,f.offset)):(q.setEnd(f.node,f.offset),v.addRange(q))))));q=[];for(v=t;v=v.parentNode;)1===v.nodeType&&q.push({element:v,left:v.scrollLeft,top:v.scrollTop});"function"===typeof t.focus&&t.focus();for(t= -0;tO()-jj?Qj(a,0):uj|=c);Mj(a,b);}function lj(a,b){var c=a.stateNode;null!==c&&c.delete(b);b=0;0===b&&(b=a.mode,0===(b&2)?b=1:0===(b&4)?b=99===eg()?1:2:(0===Gj&&(Gj=tj),b=Yc(62914560&~Gj),0===b&&(b=4194304)));c=Hg();a=Kj(a,b);null!==a&&($c(a,b,c),Mj(a,c));}var ck; -ck=function(a,b,c){var d=b.lanes;if(null!==a)if(a.memoizedProps!==b.pendingProps||N.current)ug=!0;else if(0!==(c&d))ug=0!==(a.flags&16384)?!0:!1;else {ug=!1;switch(b.tag){case 3:ri(b);sh();break;case 5:gh(b);break;case 1:Ff(b.type)&&Jf(b);break;case 4:eh(b,b.stateNode.containerInfo);break;case 10:d=b.memoizedProps.value;var e=b.type._context;I(mg,e._currentValue);e._currentValue=d;break;case 13:if(null!==b.memoizedState){if(0!==(c&b.child.childLanes))return ti(a,b,c);I(P,P.current&1);b=hi(a,b,c);return null!== -b?b.sibling:null}I(P,P.current&1);break;case 19:d=0!==(c&b.childLanes);if(0!==(a.flags&64)){if(d)return Ai(a,b,c);b.flags|=64;}e=b.memoizedState;null!==e&&(e.rendering=null,e.tail=null,e.lastEffect=null);I(P,P.current);if(d)break;else return null;case 23:case 24:return b.lanes=0,mi(a,b,c)}return hi(a,b,c)}else ug=!1;b.lanes=0;switch(b.tag){case 2:d=b.type;null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2);a=b.pendingProps;e=Ef(b,M.current);tg(b,c);e=Ch(null,b,d,a,e,c);b.flags|=1;if("object"=== -typeof e&&null!==e&&"function"===typeof e.render&&void 0===e.$$typeof){b.tag=1;b.memoizedState=null;b.updateQueue=null;if(Ff(d)){var f=!0;Jf(b);}else f=!1;b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null;xg(b);var g=d.getDerivedStateFromProps;"function"===typeof g&&Gg(b,d,g,a);e.updater=Kg;b.stateNode=e;e._reactInternals=b;Og(b,d,a,c);b=qi(null,b,d,!0,f,c);}else b.tag=0,fi(null,b,e,c),b=b.child;return b;case 16:e=b.elementType;a:{null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2); -a=b.pendingProps;f=e._init;e=f(e._payload);b.type=e;f=b.tag=hk(e);a=lg(e,a);switch(f){case 0:b=li(null,b,e,a,c);break a;case 1:b=pi(null,b,e,a,c);break a;case 11:b=gi(null,b,e,a,c);break a;case 14:b=ii(null,b,e,lg(e.type,a),d,c);break a}throw Error(y(306,e,""));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:lg(d,e),li(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:lg(d,e),pi(a,b,d,e,c);case 3:ri(b);d=b.updateQueue;if(null===a||null===d)throw Error(y(282)); -d=b.pendingProps;e=b.memoizedState;e=null!==e?e.element:null;yg(a,b);Cg(b,d,null,c);d=b.memoizedState.element;if(d===e)sh(),b=hi(a,b,c);else {e=b.stateNode;if(f=e.hydrate)kh=rf(b.stateNode.containerInfo.firstChild),jh=b,f=lh=!0;if(f){a=e.mutableSourceEagerHydrationData;if(null!=a)for(e=0;e - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -(function () { - - function isExpression(node) { - if (node == null) { return false; } - switch (node.type) { - case 'ArrayExpression': - case 'AssignmentExpression': - case 'BinaryExpression': - case 'CallExpression': - case 'ConditionalExpression': - case 'FunctionExpression': - case 'Identifier': - case 'Literal': - case 'LogicalExpression': - case 'MemberExpression': - case 'NewExpression': - case 'ObjectExpression': - case 'SequenceExpression': - case 'ThisExpression': - case 'UnaryExpression': - case 'UpdateExpression': - return true; - } - return false; - } - - function isIterationStatement(node) { - if (node == null) { return false; } - switch (node.type) { - case 'DoWhileStatement': - case 'ForInStatement': - case 'ForStatement': - case 'WhileStatement': - return true; - } - return false; - } - - function isStatement(node) { - if (node == null) { return false; } - switch (node.type) { - case 'BlockStatement': - case 'BreakStatement': - case 'ContinueStatement': - case 'DebuggerStatement': - case 'DoWhileStatement': - case 'EmptyStatement': - case 'ExpressionStatement': - case 'ForInStatement': - case 'ForStatement': - case 'IfStatement': - case 'LabeledStatement': - case 'ReturnStatement': - case 'SwitchStatement': - case 'ThrowStatement': - case 'TryStatement': - case 'VariableDeclaration': - case 'WhileStatement': - case 'WithStatement': - return true; - } - return false; - } - - function isSourceElement(node) { - return isStatement(node) || node != null && node.type === 'FunctionDeclaration'; - } - - function trailingStatement(node) { - switch (node.type) { - case 'IfStatement': - if (node.alternate != null) { - return node.alternate; - } - return node.consequent; - - case 'LabeledStatement': - case 'ForStatement': - case 'ForInStatement': - case 'WhileStatement': - case 'WithStatement': - return node.body; - } - return null; - } - - function isProblematicIfStatement(node) { - var current; - - if (node.type !== 'IfStatement') { - return false; - } - if (node.alternate == null) { - return false; - } - current = node.consequent; - do { - if (current.type === 'IfStatement') { - if (current.alternate == null) { - return true; - } - } - current = trailingStatement(current); - } while (current); - - return false; - } - - module.exports = { - isExpression: isExpression, - isStatement: isStatement, - isIterationStatement: isIterationStatement, - isSourceElement: isSourceElement, - isProblematicIfStatement: isProblematicIfStatement, - - trailingStatement: trailingStatement - }; -}()); -/* vim: set sw=4 ts=4 et tw=80 : */ -}); - -var code = createCommonjsModule(function (module) { -/* - Copyright (C) 2013-2014 Yusuke Suzuki - Copyright (C) 2014 Ivan Nikulin - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -(function () { - - var ES6Regex, ES5Regex, NON_ASCII_WHITESPACES, IDENTIFIER_START, IDENTIFIER_PART, ch; - - // See `tools/generate-identifier-regex.js`. - ES5Regex = { - // ECMAScript 5.1/Unicode v9.0.0 NonAsciiIdentifierStart: - NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/, - // ECMAScript 5.1/Unicode v9.0.0 NonAsciiIdentifierPart: - NonAsciiIdentifierPart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/ - }; - - ES6Regex = { - // ECMAScript 6/Unicode v9.0.0 NonAsciiIdentifierStart: - NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/, - // ECMAScript 6/Unicode v9.0.0 NonAsciiIdentifierPart: - NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ - }; - - function isDecimalDigit(ch) { - return 0x30 <= ch && ch <= 0x39; // 0..9 - } - - function isHexDigit(ch) { - return 0x30 <= ch && ch <= 0x39 || // 0..9 - 0x61 <= ch && ch <= 0x66 || // a..f - 0x41 <= ch && ch <= 0x46; // A..F - } - - function isOctalDigit(ch) { - return ch >= 0x30 && ch <= 0x37; // 0..7 - } - - // 7.2 White Space - - NON_ASCII_WHITESPACES = [ - 0x1680, - 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, - 0x202F, 0x205F, - 0x3000, - 0xFEFF - ]; - - function isWhiteSpace(ch) { - return ch === 0x20 || ch === 0x09 || ch === 0x0B || ch === 0x0C || ch === 0xA0 || - ch >= 0x1680 && NON_ASCII_WHITESPACES.indexOf(ch) >= 0; - } - - // 7.3 Line Terminators - - function isLineTerminator(ch) { - return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029; - } - - // 7.6 Identifier Names and Identifiers - - function fromCodePoint(cp) { - if (cp <= 0xFFFF) { return String.fromCharCode(cp); } - var cu1 = String.fromCharCode(Math.floor((cp - 0x10000) / 0x400) + 0xD800); - var cu2 = String.fromCharCode(((cp - 0x10000) % 0x400) + 0xDC00); - return cu1 + cu2; - } - - IDENTIFIER_START = new Array(0x80); - for(ch = 0; ch < 0x80; ++ch) { - IDENTIFIER_START[ch] = - ch >= 0x61 && ch <= 0x7A || // a..z - ch >= 0x41 && ch <= 0x5A || // A..Z - ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore) - } - - IDENTIFIER_PART = new Array(0x80); - for(ch = 0; ch < 0x80; ++ch) { - IDENTIFIER_PART[ch] = - ch >= 0x61 && ch <= 0x7A || // a..z - ch >= 0x41 && ch <= 0x5A || // A..Z - ch >= 0x30 && ch <= 0x39 || // 0..9 - ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore) - } - - function isIdentifierStartES5(ch) { - return ch < 0x80 ? IDENTIFIER_START[ch] : ES5Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch)); - } - - function isIdentifierPartES5(ch) { - return ch < 0x80 ? IDENTIFIER_PART[ch] : ES5Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch)); - } - - function isIdentifierStartES6(ch) { - return ch < 0x80 ? IDENTIFIER_START[ch] : ES6Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch)); - } - - function isIdentifierPartES6(ch) { - return ch < 0x80 ? IDENTIFIER_PART[ch] : ES6Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch)); - } - - module.exports = { - isDecimalDigit: isDecimalDigit, - isHexDigit: isHexDigit, - isOctalDigit: isOctalDigit, - isWhiteSpace: isWhiteSpace, - isLineTerminator: isLineTerminator, - isIdentifierStartES5: isIdentifierStartES5, - isIdentifierPartES5: isIdentifierPartES5, - isIdentifierStartES6: isIdentifierStartES6, - isIdentifierPartES6: isIdentifierPartES6 - }; -}()); -/* vim: set sw=4 ts=4 et tw=80 : */ -}); - -var keyword = createCommonjsModule(function (module) { -/* - Copyright (C) 2013 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -(function () { - - var code$1 = code; - - function isStrictModeReservedWordES6(id) { - switch (id) { - case 'implements': - case 'interface': - case 'package': - case 'private': - case 'protected': - case 'public': - case 'static': - case 'let': - return true; - default: - return false; - } - } - - function isKeywordES5(id, strict) { - // yield should not be treated as keyword under non-strict mode. - if (!strict && id === 'yield') { - return false; - } - return isKeywordES6(id, strict); - } - - function isKeywordES6(id, strict) { - if (strict && isStrictModeReservedWordES6(id)) { - return true; - } - - switch (id.length) { - case 2: - return (id === 'if') || (id === 'in') || (id === 'do'); - case 3: - return (id === 'var') || (id === 'for') || (id === 'new') || (id === 'try'); - case 4: - return (id === 'this') || (id === 'else') || (id === 'case') || - (id === 'void') || (id === 'with') || (id === 'enum'); - case 5: - return (id === 'while') || (id === 'break') || (id === 'catch') || - (id === 'throw') || (id === 'const') || (id === 'yield') || - (id === 'class') || (id === 'super'); - case 6: - return (id === 'return') || (id === 'typeof') || (id === 'delete') || - (id === 'switch') || (id === 'export') || (id === 'import'); - case 7: - return (id === 'default') || (id === 'finally') || (id === 'extends'); - case 8: - return (id === 'function') || (id === 'continue') || (id === 'debugger'); - case 10: - return (id === 'instanceof'); - default: - return false; - } - } - - function isReservedWordES5(id, strict) { - return id === 'null' || id === 'true' || id === 'false' || isKeywordES5(id, strict); - } - - function isReservedWordES6(id, strict) { - return id === 'null' || id === 'true' || id === 'false' || isKeywordES6(id, strict); - } - - function isRestrictedWord(id) { - return id === 'eval' || id === 'arguments'; - } - - function isIdentifierNameES5(id) { - var i, iz, ch; - - if (id.length === 0) { return false; } - - ch = id.charCodeAt(0); - if (!code$1.isIdentifierStartES5(ch)) { - return false; - } - - for (i = 1, iz = id.length; i < iz; ++i) { - ch = id.charCodeAt(i); - if (!code$1.isIdentifierPartES5(ch)) { - return false; - } - } - return true; - } - - function decodeUtf16(lead, trail) { - return (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; - } - - function isIdentifierNameES6(id) { - var i, iz, ch, lowCh, check; - - if (id.length === 0) { return false; } - - check = code$1.isIdentifierStartES6; - for (i = 0, iz = id.length; i < iz; ++i) { - ch = id.charCodeAt(i); - if (0xD800 <= ch && ch <= 0xDBFF) { - ++i; - if (i >= iz) { return false; } - lowCh = id.charCodeAt(i); - if (!(0xDC00 <= lowCh && lowCh <= 0xDFFF)) { - return false; - } - ch = decodeUtf16(ch, lowCh); - } - if (!check(ch)) { - return false; - } - check = code$1.isIdentifierPartES6; - } - return true; - } - - function isIdentifierES5(id, strict) { - return isIdentifierNameES5(id) && !isReservedWordES5(id, strict); - } - - function isIdentifierES6(id, strict) { - return isIdentifierNameES6(id) && !isReservedWordES6(id, strict); - } - - module.exports = { - isKeywordES5: isKeywordES5, - isKeywordES6: isKeywordES6, - isReservedWordES5: isReservedWordES5, - isReservedWordES6: isReservedWordES6, - isRestrictedWord: isRestrictedWord, - isIdentifierNameES5: isIdentifierNameES5, - isIdentifierNameES6: isIdentifierNameES6, - isIdentifierES5: isIdentifierES5, - isIdentifierES6: isIdentifierES6 - }; -}()); -/* vim: set sw=4 ts=4 et tw=80 : */ -}); - -var utils = createCommonjsModule(function (module, exports) { -/* - Copyright (C) 2013 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -(function () { - - exports.ast = ast; - exports.code = code; - exports.keyword = keyword; -}()); -/* vim: set sw=4 ts=4 et tw=80 : */ -}); - -var coderep = createCommonjsModule(function (module, exports) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -exports.getPrecedence = getPrecedence; -exports.escapeStringLiteral = escapeStringLiteral; - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var Precedence = { - Sequence: 0, - Yield: 1, - Assignment: 1, - Conditional: 2, - ArrowFunction: 2, - LogicalOR: 3, - LogicalAND: 4, - BitwiseOR: 5, - BitwiseXOR: 6, - BitwiseAND: 7, - Equality: 8, - Relational: 9, - BitwiseSHIFT: 10, - Additive: 11, - Multiplicative: 12, - Exponential: 13, - Prefix: 14, - Postfix: 15, - New: 16, - Call: 17, - TaggedTemplate: 18, - Member: 19, - Primary: 20 -}; - -exports.Precedence = Precedence; - - -var BinaryPrecedence = { - ',': Precedence.Sequence, - '||': Precedence.LogicalOR, - '&&': Precedence.LogicalAND, - '|': Precedence.BitwiseOR, - '^': Precedence.BitwiseXOR, - '&': Precedence.BitwiseAND, - '==': Precedence.Equality, - '!=': Precedence.Equality, - '===': Precedence.Equality, - '!==': Precedence.Equality, - '<': Precedence.Relational, - '>': Precedence.Relational, - '<=': Precedence.Relational, - '>=': Precedence.Relational, - 'in': Precedence.Relational, - 'instanceof': Precedence.Relational, - '<<': Precedence.BitwiseSHIFT, - '>>': Precedence.BitwiseSHIFT, - '>>>': Precedence.BitwiseSHIFT, - '+': Precedence.Additive, - '-': Precedence.Additive, - '*': Precedence.Multiplicative, - '%': Precedence.Multiplicative, - '/': Precedence.Multiplicative, - '**': Precedence.Exponential -}; - -function getPrecedence(node) { - switch (node.type) { - case 'ArrayExpression': - case 'FunctionExpression': - case 'ClassExpression': - case 'IdentifierExpression': - case 'AssignmentTargetIdentifier': - case 'NewTargetExpression': - case 'Super': - case 'LiteralBooleanExpression': - case 'LiteralNullExpression': - case 'LiteralNumericExpression': - case 'LiteralInfinityExpression': - case 'LiteralRegExpExpression': - case 'LiteralStringExpression': - case 'ObjectExpression': - case 'ThisExpression': - case 'SpreadElement': - case 'FunctionBody': - return Precedence.Primary; - - case 'ArrowExpression': - case 'AssignmentExpression': - case 'CompoundAssignmentExpression': - case 'YieldExpression': - case 'YieldGeneratorExpression': - return Precedence.Assignment; - - case 'ConditionalExpression': - return Precedence.Conditional; - - case 'ComputedMemberExpression': - case 'StaticMemberExpression': - case 'ComputedMemberAssignmentTarget': - case 'StaticMemberAssignmentTarget': - switch (node.object.type) { - case 'CallExpression': - case 'ComputedMemberExpression': - case 'StaticMemberExpression': - case 'TemplateExpression': - return getPrecedence(node.object); - default: - return Precedence.Member; - } - - case 'TemplateExpression': - if (node.tag == null) return Precedence.Member; - switch (node.tag.type) { - case 'CallExpression': - case 'ComputedMemberExpression': - case 'StaticMemberExpression': - case 'TemplateExpression': - return getPrecedence(node.tag); - default: - return Precedence.Member; - } - - case 'BinaryExpression': - return BinaryPrecedence[node.operator]; - - case 'CallExpression': - return Precedence.Call; - case 'NewExpression': - return node.arguments.length === 0 ? Precedence.New : Precedence.Member; - case 'UpdateExpression': - return node.isPrefix ? Precedence.Prefix : Precedence.Postfix; - case 'AwaitExpression': - case 'UnaryExpression': - return Precedence.Prefix; - default: - throw new Error('unreachable: ' + node.type); - } -} - -function escapeStringLiteral(stringValue) { - var result = ''; - var nSingle = 0, - nDouble = 0; - for (var i = 0, l = stringValue.length; i < l; ++i) { - var ch = stringValue[i]; - if (ch === '"') { - ++nDouble; - } else if (ch === '\'') { - ++nSingle; - } - } - var delim = nDouble > nSingle ? '\'' : '"'; - result += delim; - for (var _i = 0; _i < stringValue.length; _i++) { - var _ch = stringValue.charAt(_i); - switch (_ch) { - case delim: - result += '\\' + delim; - break; - case '\n': - result += '\\n'; - break; - case '\r': - result += '\\r'; - break; - case '\\': - result += '\\\\'; - break; - case '\u2028': - result += '\\u2028'; - break; - case '\u2029': - result += '\\u2029'; - break; - default: - result += _ch; - break; - } - } - result += delim; - return result; -} - -var CodeRep = exports.CodeRep = function () { - function CodeRep() { - _classCallCheck(this, CodeRep); - - this.containsIn = false; - this.containsGroup = false; - // restricted lookaheads: {, function, class, let, let [ - this.startsWithCurly = false; - this.startsWithFunctionOrClass = false; - this.startsWithLet = false; - this.startsWithLetSquareBracket = false; - this.endsWithMissingElse = false; - } - - _createClass(CodeRep, [{ - key: 'forEach', - value: function forEach(f) { - // Call a function on every CodeRep represented by this node. Always calls f on a node and then its children, so if you're careful you can modify a node's children online. - f(this); - } - }]); - - return CodeRep; -}(); - -var Empty = exports.Empty = function (_CodeRep) { - _inherits(Empty, _CodeRep); - - function Empty() { - _classCallCheck(this, Empty); - - return _possibleConstructorReturn(this, (Empty.__proto__ || Object.getPrototypeOf(Empty)).call(this)); - } - - _createClass(Empty, [{ - key: 'emit', - value: function emit() {} - }]); - - return Empty; -}(CodeRep); - -var Token = exports.Token = function (_CodeRep2) { - _inherits(Token, _CodeRep2); - - function Token(token) { - var isRegExp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - _classCallCheck(this, Token); - - var _this2 = _possibleConstructorReturn(this, (Token.__proto__ || Object.getPrototypeOf(Token)).call(this)); - - _this2.token = token; - _this2.isRegExp = isRegExp; - return _this2; - } - - _createClass(Token, [{ - key: 'emit', - value: function emit(ts) { - ts.put(this.token, this.isRegExp); - } - }]); - - return Token; -}(CodeRep); - -var RawToken = exports.RawToken = function (_CodeRep3) { - _inherits(RawToken, _CodeRep3); - - function RawToken(token) { - _classCallCheck(this, RawToken); - - var _this3 = _possibleConstructorReturn(this, (RawToken.__proto__ || Object.getPrototypeOf(RawToken)).call(this)); - - _this3.token = token; - return _this3; - } - - _createClass(RawToken, [{ - key: 'emit', - value: function emit(ts) { - ts.putRaw(this.token); - } - }]); - - return RawToken; -}(CodeRep); - -var NumberCodeRep = exports.NumberCodeRep = function (_CodeRep4) { - _inherits(NumberCodeRep, _CodeRep4); - - function NumberCodeRep(number) { - _classCallCheck(this, NumberCodeRep); - - var _this4 = _possibleConstructorReturn(this, (NumberCodeRep.__proto__ || Object.getPrototypeOf(NumberCodeRep)).call(this)); - - _this4.number = number; - return _this4; - } - - _createClass(NumberCodeRep, [{ - key: 'emit', - value: function emit(ts) { - ts.putNumber(this.number); - } - }]); - - return NumberCodeRep; -}(CodeRep); - -var Paren = exports.Paren = function (_CodeRep5) { - _inherits(Paren, _CodeRep5); - - function Paren(expr) { - _classCallCheck(this, Paren); - - var _this5 = _possibleConstructorReturn(this, (Paren.__proto__ || Object.getPrototypeOf(Paren)).call(this)); - - _this5.expr = expr; - return _this5; - } - - _createClass(Paren, [{ - key: 'emit', - value: function emit(ts) { - ts.put('('); - this.expr.emit(ts, false); - ts.put(')'); - } - }, { - key: 'forEach', - value: function forEach(f) { - f(this); - this.expr.forEach(f); - } - }]); - - return Paren; -}(CodeRep); - -var Bracket = exports.Bracket = function (_CodeRep6) { - _inherits(Bracket, _CodeRep6); - - function Bracket(expr) { - _classCallCheck(this, Bracket); - - var _this6 = _possibleConstructorReturn(this, (Bracket.__proto__ || Object.getPrototypeOf(Bracket)).call(this)); - - _this6.expr = expr; - return _this6; - } - - _createClass(Bracket, [{ - key: 'emit', - value: function emit(ts) { - ts.put('['); - this.expr.emit(ts, false); - ts.put(']'); - } - }, { - key: 'forEach', - value: function forEach(f) { - f(this); - this.expr.forEach(f); - } - }]); - - return Bracket; -}(CodeRep); - -var Brace = exports.Brace = function (_CodeRep7) { - _inherits(Brace, _CodeRep7); - - function Brace(expr) { - _classCallCheck(this, Brace); - - var _this7 = _possibleConstructorReturn(this, (Brace.__proto__ || Object.getPrototypeOf(Brace)).call(this)); - - _this7.expr = expr; - return _this7; - } - - _createClass(Brace, [{ - key: 'emit', - value: function emit(ts) { - ts.put('{'); - this.expr.emit(ts, false); - ts.put('}'); - } - }, { - key: 'forEach', - value: function forEach(f) { - f(this); - this.expr.forEach(f); - } - }]); - - return Brace; -}(CodeRep); - -var NoIn = exports.NoIn = function (_CodeRep8) { - _inherits(NoIn, _CodeRep8); - - function NoIn(expr) { - _classCallCheck(this, NoIn); - - var _this8 = _possibleConstructorReturn(this, (NoIn.__proto__ || Object.getPrototypeOf(NoIn)).call(this)); - - _this8.expr = expr; - return _this8; - } - - _createClass(NoIn, [{ - key: 'emit', - value: function emit(ts) { - this.expr.emit(ts, true); - } - }, { - key: 'forEach', - value: function forEach(f) { - f(this); - this.expr.forEach(f); - } - }]); - - return NoIn; -}(CodeRep); - -var ContainsIn = exports.ContainsIn = function (_CodeRep9) { - _inherits(ContainsIn, _CodeRep9); - - function ContainsIn(expr) { - _classCallCheck(this, ContainsIn); - - var _this9 = _possibleConstructorReturn(this, (ContainsIn.__proto__ || Object.getPrototypeOf(ContainsIn)).call(this)); - - _this9.expr = expr; - return _this9; - } - - _createClass(ContainsIn, [{ - key: 'emit', - value: function emit(ts, noIn) { - if (noIn) { - ts.put('('); - this.expr.emit(ts, false); - ts.put(')'); - } else { - this.expr.emit(ts, false); - } - } - }, { - key: 'forEach', - value: function forEach(f) { - f(this); - this.expr.forEach(f); - } - }]); - - return ContainsIn; -}(CodeRep); - -var Seq = exports.Seq = function (_CodeRep10) { - _inherits(Seq, _CodeRep10); - - function Seq(children) { - _classCallCheck(this, Seq); - - var _this10 = _possibleConstructorReturn(this, (Seq.__proto__ || Object.getPrototypeOf(Seq)).call(this)); - - _this10.children = children; - return _this10; - } - - _createClass(Seq, [{ - key: 'emit', - value: function emit(ts, noIn) { - this.children.forEach(function (cr) { - return cr.emit(ts, noIn); - }); - } - }, { - key: 'forEach', - value: function forEach(f) { - f(this); - this.children.forEach(function (x) { - return x.forEach(f); - }); - } - }]); - - return Seq; -}(CodeRep); - -var Semi = exports.Semi = function (_Token) { - _inherits(Semi, _Token); - - function Semi() { - _classCallCheck(this, Semi); - - return _possibleConstructorReturn(this, (Semi.__proto__ || Object.getPrototypeOf(Semi)).call(this, ';')); - } - - return Semi; -}(Token); - -var CommaSep = exports.CommaSep = function (_CodeRep11) { - _inherits(CommaSep, _CodeRep11); - - function CommaSep(children) { - _classCallCheck(this, CommaSep); - - var _this12 = _possibleConstructorReturn(this, (CommaSep.__proto__ || Object.getPrototypeOf(CommaSep)).call(this)); - - _this12.children = children; - return _this12; - } - - _createClass(CommaSep, [{ - key: 'emit', - value: function emit(ts, noIn) { - var first = true; - this.children.forEach(function (cr) { - if (first) { - first = false; - } else { - ts.put(','); - } - cr.emit(ts, noIn); - }); - } - }, { - key: 'forEach', - value: function forEach(f) { - f(this); - this.children.forEach(function (x) { - return x.forEach(f); - }); - } - }]); - - return CommaSep; -}(CodeRep); - -var SemiOp = exports.SemiOp = function (_CodeRep12) { - _inherits(SemiOp, _CodeRep12); - - function SemiOp() { - _classCallCheck(this, SemiOp); - - return _possibleConstructorReturn(this, (SemiOp.__proto__ || Object.getPrototypeOf(SemiOp)).call(this)); - } - - _createClass(SemiOp, [{ - key: 'emit', - value: function emit(ts) { - ts.putOptionalSemi(); - } - }]); - - return SemiOp; -}(CodeRep); -}); - -var minimalCodegen = createCommonjsModule(function (module, exports) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - - -var _objectAssign2 = _interopRequireDefault(objectAssign); - - - - - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function p(node, precedence, a) { - return (0, coderep.getPrecedence)(node) < precedence ? paren(a) : a; -} - -function t(token) { - var isRegExp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - return new coderep.Token(token, isRegExp); -} - -function paren(rep) { - return new coderep.Paren(rep); -} - -function brace(rep) { - return new coderep.Brace(rep); -} - -function bracket(rep) { - return new coderep.Bracket(rep); -} - -function noIn(rep) { - return new coderep.NoIn(rep); -} - -function markContainsIn(state) { - return state.containsIn ? new coderep.ContainsIn(state) : state; -} - -function seq() { - for (var _len = arguments.length, reps = Array(_len), _key = 0; _key < _len; _key++) { - reps[_key] = arguments[_key]; - } - - return new coderep.Seq(reps); -} - -function semi() { - return new coderep.Semi(); -} - -function semiOp() { - return new coderep.SemiOp(); -} - -function empty() { - return new coderep.Empty(); -} - -function commaSep(pieces) { - return new coderep.CommaSep(pieces); -} - -function getAssignmentExpr(state) { - return state ? state.containsGroup ? paren(state) : state : empty(); -} - -var MinimalCodeGen = function () { - function MinimalCodeGen() { - _classCallCheck(this, MinimalCodeGen); - } - - _createClass(MinimalCodeGen, [{ - key: 'parenToAvoidBeingDirective', - value: function parenToAvoidBeingDirective(element, original) { - if (element && element.type === 'ExpressionStatement' && element.expression.type === 'LiteralStringExpression') { - return seq(paren(original.children[0]), semiOp()); - } - return original; - } - }, { - key: 'regenerateArrowParams', - value: function regenerateArrowParams(element, original) { - if (element.rest == null && element.items.length === 1 && element.items[0].type === 'BindingIdentifier') { - // FormalParameters unconditionally include parentheses, but they're not necessary here - return this.reduceBindingIdentifier(element.items[0]); - } - return original; - } - }, { - key: 'reduceArrayExpression', - value: function reduceArrayExpression(node, _ref) { - var elements = _ref.elements; - - if (elements.length === 0) { - return bracket(empty()); - } - - var content = commaSep(elements.map(getAssignmentExpr)); - if (elements.length > 0 && elements[elements.length - 1] == null) { - content = seq(content, t(',')); - } - return bracket(content); - } - }, { - key: 'reduceAwaitExpression', - value: function reduceAwaitExpression(node, _ref2) { - var expression = _ref2.expression; - - return seq(t('await'), p(node.expression, (0, coderep.getPrecedence)(node), expression)); - } - }, { - key: 'reduceSpreadElement', - value: function reduceSpreadElement(node, _ref3) { - var expression = _ref3.expression; - - return seq(t('...'), p(node.expression, coderep.Precedence.Assignment, expression)); - } - }, { - key: 'reduceSpreadProperty', - value: function reduceSpreadProperty(node, _ref4) { - var expression = _ref4.expression; - - return seq(t('...'), getAssignmentExpr(expression)); - } - }, { - key: 'reduceAssignmentExpression', - value: function reduceAssignmentExpression(node, _ref5) { - var binding = _ref5.binding, - expression = _ref5.expression; - - var leftCode = binding; - var rightCode = expression; - var containsIn = expression.containsIn; - var startsWithCurly = binding.startsWithCurly; - var startsWithLetSquareBracket = binding.startsWithLetSquareBracket; - var startsWithFunctionOrClass = binding.startsWithFunctionOrClass; - if ((0, coderep.getPrecedence)(node.expression) < (0, coderep.getPrecedence)(node)) { - rightCode = paren(rightCode); - containsIn = false; - } - return (0, _objectAssign2.default)(seq(leftCode, t('='), rightCode), { containsIn: containsIn, startsWithCurly: startsWithCurly, startsWithLetSquareBracket: startsWithLetSquareBracket, startsWithFunctionOrClass: startsWithFunctionOrClass }); - } - }, { - key: 'reduceAssignmentTargetIdentifier', - value: function reduceAssignmentTargetIdentifier(node) { - var a = t(node.name); - if (node.name === 'let') { - a.startsWithLet = true; - } - return a; - } - }, { - key: 'reduceAssignmentTargetWithDefault', - value: function reduceAssignmentTargetWithDefault(node, _ref6) { - var binding = _ref6.binding, - init = _ref6.init; - - return seq(binding, t('='), p(node.init, coderep.Precedence.Assignment, init)); - } - }, { - key: 'reduceCompoundAssignmentExpression', - value: function reduceCompoundAssignmentExpression(node, _ref7) { - var binding = _ref7.binding, - expression = _ref7.expression; - - var leftCode = binding; - var rightCode = expression; - var containsIn = expression.containsIn; - var startsWithCurly = binding.startsWithCurly; - var startsWithLetSquareBracket = binding.startsWithLetSquareBracket; - var startsWithFunctionOrClass = binding.startsWithFunctionOrClass; - if ((0, coderep.getPrecedence)(node.expression) < (0, coderep.getPrecedence)(node)) { - rightCode = paren(rightCode); - containsIn = false; - } - return (0, _objectAssign2.default)(seq(leftCode, t(node.operator), rightCode), { containsIn: containsIn, startsWithCurly: startsWithCurly, startsWithLetSquareBracket: startsWithLetSquareBracket, startsWithFunctionOrClass: startsWithFunctionOrClass }); - } - }, { - key: 'reduceBinaryExpression', - value: function reduceBinaryExpression(node, _ref8) { - var left = _ref8.left, - right = _ref8.right; - - var leftCode = left; - var startsWithCurly = left.startsWithCurly; - var startsWithLetSquareBracket = left.startsWithLetSquareBracket; - var startsWithFunctionOrClass = left.startsWithFunctionOrClass; - var leftContainsIn = left.containsIn; - var isRightAssociative = node.operator === '**'; - if ((0, coderep.getPrecedence)(node.left) < (0, coderep.getPrecedence)(node) || isRightAssociative && ((0, coderep.getPrecedence)(node.left) === (0, coderep.getPrecedence)(node) || node.left.type === 'UnaryExpression')) { - leftCode = paren(leftCode); - startsWithCurly = false; - startsWithLetSquareBracket = false; - startsWithFunctionOrClass = false; - leftContainsIn = false; - } - var rightCode = right; - var rightContainsIn = right.containsIn; - if ((0, coderep.getPrecedence)(node.right) < (0, coderep.getPrecedence)(node) || !isRightAssociative && (0, coderep.getPrecedence)(node.right) === (0, coderep.getPrecedence)(node)) { - rightCode = paren(rightCode); - rightContainsIn = false; - } - return (0, _objectAssign2.default)(seq(leftCode, t(node.operator), rightCode), { - containsIn: leftContainsIn || rightContainsIn || node.operator === 'in', - containsGroup: node.operator === ',', - startsWithCurly: startsWithCurly, - startsWithLetSquareBracket: startsWithLetSquareBracket, - startsWithFunctionOrClass: startsWithFunctionOrClass - }); - } - }, { - key: 'reduceBindingWithDefault', - value: function reduceBindingWithDefault(node, _ref9) { - var binding = _ref9.binding, - init = _ref9.init; - - return seq(binding, t('='), p(node.init, coderep.Precedence.Assignment, init)); - } - }, { - key: 'reduceBindingIdentifier', - value: function reduceBindingIdentifier(node) { - var a = t(node.name); - if (node.name === 'let') { - a.startsWithLet = true; - } - return a; - } - }, { - key: 'reduceArrayAssignmentTarget', - value: function reduceArrayAssignmentTarget(node, _ref10) { - var elements = _ref10.elements, - rest = _ref10.rest; - - var content = void 0; - if (elements.length === 0) { - content = rest == null ? empty() : seq(t('...'), rest); - } else { - elements = elements.concat(rest == null ? [] : [seq(t('...'), rest)]); - content = commaSep(elements.map(getAssignmentExpr)); - if (elements.length > 0 && elements[elements.length - 1] == null) { - content = seq(content, t(',')); - } - } - return bracket(content); - } - }, { - key: 'reduceArrayBinding', - value: function reduceArrayBinding(node, _ref11) { - var elements = _ref11.elements, - rest = _ref11.rest; - - var content = void 0; - if (elements.length === 0) { - content = rest == null ? empty() : seq(t('...'), rest); - } else { - elements = elements.concat(rest == null ? [] : [seq(t('...'), rest)]); - content = commaSep(elements.map(getAssignmentExpr)); - if (elements.length > 0 && elements[elements.length - 1] == null) { - content = seq(content, t(',')); - } - } - return bracket(content); - } - }, { - key: 'reduceObjectAssignmentTarget', - value: function reduceObjectAssignmentTarget(node, _ref12) { - var properties = _ref12.properties, - rest = _ref12.rest; - - var content = commaSep(properties); - if (properties.length === 0) { - content = rest == null ? empty() : seq(t('...'), rest); - } else { - content = rest == null ? content : seq(content, t(','), t('...'), rest); - } - var state = brace(content); - state.startsWithCurly = true; - return state; - } - }, { - key: 'reduceObjectBinding', - value: function reduceObjectBinding(node, _ref13) { - var properties = _ref13.properties, - rest = _ref13.rest; - - var content = commaSep(properties); - if (properties.length === 0) { - content = rest == null ? empty() : seq(t('...'), rest); - } else { - content = rest == null ? content : seq(content, t(','), t('...'), rest); - } - var state = brace(content); - state.startsWithCurly = true; - return state; - } - }, { - key: 'reduceAssignmentTargetPropertyIdentifier', - value: function reduceAssignmentTargetPropertyIdentifier(node, _ref14) { - var binding = _ref14.binding, - init = _ref14.init; - - if (node.init == null) return binding; - return seq(binding, t('='), p(node.init, coderep.Precedence.Assignment, init)); - } - }, { - key: 'reduceAssignmentTargetPropertyProperty', - value: function reduceAssignmentTargetPropertyProperty(node, _ref15) { - var name = _ref15.name, - binding = _ref15.binding; - - return seq(name, t(':'), binding); - } - }, { - key: 'reduceBindingPropertyIdentifier', - value: function reduceBindingPropertyIdentifier(node, _ref16) { - var binding = _ref16.binding, - init = _ref16.init; - - if (node.init == null) return binding; - return seq(binding, t('='), p(node.init, coderep.Precedence.Assignment, init)); - } - }, { - key: 'reduceBindingPropertyProperty', - value: function reduceBindingPropertyProperty(node, _ref17) { - var name = _ref17.name, - binding = _ref17.binding; - - return seq(name, t(':'), binding); - } - }, { - key: 'reduceBlock', - value: function reduceBlock(node, _ref18) { - var statements = _ref18.statements; - - return brace(seq.apply(undefined, _toConsumableArray(statements))); - } - }, { - key: 'reduceBlockStatement', - value: function reduceBlockStatement(node, _ref19) { - var block = _ref19.block; - - return block; - } - }, { - key: 'reduceBreakStatement', - value: function reduceBreakStatement(node) { - return seq(t('break'), node.label ? t(node.label) : empty(), semiOp()); - } - }, { - key: 'reduceCallExpression', - value: function reduceCallExpression(node, _ref20) { - var callee = _ref20.callee, - args = _ref20.arguments; - - var parenthizedArgs = args.map(function (a, i) { - return p(node.arguments[i], coderep.Precedence.Assignment, a); - }); - return (0, _objectAssign2.default)(seq(p(node.callee, (0, coderep.getPrecedence)(node), callee), paren(commaSep(parenthizedArgs))), { - startsWithCurly: callee.startsWithCurly, - startsWithLet: callee.startsWithLet, - startsWithLetSquareBracket: callee.startsWithLetSquareBracket, - startsWithFunctionOrClass: callee.startsWithFunctionOrClass - }); - } - }, { - key: 'reduceCatchClause', - value: function reduceCatchClause(node, _ref21) { - var binding = _ref21.binding, - body = _ref21.body; - - return seq(t('catch'), paren(binding), body); - } - }, { - key: 'reduceClassDeclaration', - value: function reduceClassDeclaration(node, _ref22) { - var name = _ref22.name, - _super = _ref22.super, - elements = _ref22.elements; - - var state = seq(t('class'), node.name.name === '*default*' ? empty() : name); - if (_super != null) { - state = seq(state, t('extends'), p(node.super, coderep.Precedence.New, _super)); - } - state = seq.apply(undefined, [state, t('{')].concat(_toConsumableArray(elements), [t('}')])); - return state; - } - }, { - key: 'reduceClassExpression', - value: function reduceClassExpression(node, _ref23) { - var name = _ref23.name, - _super = _ref23.super, - elements = _ref23.elements; - - var state = t('class'); - if (name != null) { - state = seq(state, name); - } - if (_super != null) { - state = seq(state, t('extends'), p(node.super, coderep.Precedence.New, _super)); - } - state = seq.apply(undefined, [state, t('{')].concat(_toConsumableArray(elements), [t('}')])); - state.startsWithFunctionOrClass = true; - return state; - } - }, { - key: 'reduceClassElement', - value: function reduceClassElement(node, _ref24) { - var method = _ref24.method; - - if (!node.isStatic) return method; - return seq(t('static'), method); - } - }, { - key: 'reduceComputedMemberAssignmentTarget', - value: function reduceComputedMemberAssignmentTarget(node, _ref25) { - var object = _ref25.object, - expression = _ref25.expression; - - var startsWithLetSquareBracket = object.startsWithLetSquareBracket || node.object.type === 'IdentifierExpression' && node.object.name === 'let'; - return (0, _objectAssign2.default)(seq(p(node.object, (0, coderep.getPrecedence)(node), object), bracket(expression)), { - startsWithLet: object.startsWithLet, - startsWithLetSquareBracket: startsWithLetSquareBracket, - startsWithCurly: object.startsWithCurly, - startsWithFunctionOrClass: object.startsWithFunctionOrClass - }); - } - }, { - key: 'reduceComputedMemberExpression', - value: function reduceComputedMemberExpression(node, _ref26) { - var object = _ref26.object, - expression = _ref26.expression; - - var startsWithLetSquareBracket = object.startsWithLetSquareBracket || node.object.type === 'IdentifierExpression' && node.object.name === 'let'; - return (0, _objectAssign2.default)(seq(p(node.object, (0, coderep.getPrecedence)(node), object), bracket(expression)), { - startsWithLet: object.startsWithLet, - startsWithLetSquareBracket: startsWithLetSquareBracket, - startsWithCurly: object.startsWithCurly, - startsWithFunctionOrClass: object.startsWithFunctionOrClass - }); - } - }, { - key: 'reduceComputedPropertyName', - value: function reduceComputedPropertyName(node, _ref27) { - var expression = _ref27.expression; - - return bracket(p(node.expression, coderep.Precedence.Assignment, expression)); - } - }, { - key: 'reduceConditionalExpression', - value: function reduceConditionalExpression(node, _ref28) { - var test = _ref28.test, - consequent = _ref28.consequent, - alternate = _ref28.alternate; - - var containsIn = test.containsIn || alternate.containsIn; - var startsWithCurly = test.startsWithCurly; - var startsWithLetSquareBracket = test.startsWithLetSquareBracket; - var startsWithFunctionOrClass = test.startsWithFunctionOrClass; - return (0, _objectAssign2.default)(seq(p(node.test, coderep.Precedence.LogicalOR, test), t('?'), p(node.consequent, coderep.Precedence.Assignment, consequent), t(':'), p(node.alternate, coderep.Precedence.Assignment, alternate)), { - containsIn: containsIn, - startsWithCurly: startsWithCurly, - startsWithLetSquareBracket: startsWithLetSquareBracket, - startsWithFunctionOrClass: startsWithFunctionOrClass - }); - } - }, { - key: 'reduceContinueStatement', - value: function reduceContinueStatement(node) { - return seq(t('continue'), node.label ? t(node.label) : empty(), semiOp()); - } - }, { - key: 'reduceDataProperty', - value: function reduceDataProperty(node, _ref29) { - var name = _ref29.name, - expression = _ref29.expression; - - return seq(name, t(':'), getAssignmentExpr(expression)); - } - }, { - key: 'reduceDebuggerStatement', - value: function reduceDebuggerStatement() /* node */{ - return seq(t('debugger'), semiOp()); - } - }, { - key: 'reduceDoWhileStatement', - value: function reduceDoWhileStatement(node, _ref30) { - var body = _ref30.body, - test = _ref30.test; - - return seq(t('do'), body, t('while'), paren(test), semiOp()); - } - }, { - key: 'reduceEmptyStatement', - value: function reduceEmptyStatement() /* node */{ - return semi(); - } - }, { - key: 'reduceExpressionStatement', - value: function reduceExpressionStatement(node, _ref31) { - var expression = _ref31.expression; - - var needsParens = expression.startsWithCurly || expression.startsWithLetSquareBracket || expression.startsWithFunctionOrClass; - return seq(needsParens ? paren(expression) : expression, semiOp()); - } - }, { - key: 'reduceForInStatement', - value: function reduceForInStatement(node, _ref32) { - var left = _ref32.left, - right = _ref32.right, - body = _ref32.body; - - left = node.left.type === 'VariableDeclaration' ? noIn(markContainsIn(left)) : left; - return (0, _objectAssign2.default)(seq(t('for'), paren(seq(left.startsWithLet ? paren(left) : left, t('in'), right)), body), { endsWithMissingElse: body.endsWithMissingElse }); - } - }, { - key: 'reduceForOfStatement', - value: function reduceForOfStatement(node, _ref33) { - var left = _ref33.left, - right = _ref33.right, - body = _ref33.body; - - left = node.left.type === 'VariableDeclaration' ? noIn(markContainsIn(left)) : left; - return (0, _objectAssign2.default)(seq(t('for'), paren(seq(left.startsWithLet ? paren(left) : left, t('of'), p(node.right, coderep.Precedence.Assignment, right))), body), { endsWithMissingElse: body.endsWithMissingElse }); - } - }, { - key: 'reduceForStatement', - value: function reduceForStatement(node, _ref34) { - var init = _ref34.init, - test = _ref34.test, - update = _ref34.update, - body = _ref34.body; - - if (init) { - if (init.startsWithLetSquareBracket) { - init = paren(init); - } - init = noIn(markContainsIn(init)); - } - return (0, _objectAssign2.default)(seq(t('for'), paren(seq(init ? init : empty(), semi(), test || empty(), semi(), update || empty())), body), { - endsWithMissingElse: body.endsWithMissingElse - }); - } - }, { - key: 'reduceForAwaitStatement', - value: function reduceForAwaitStatement(node, _ref35) { - var left = _ref35.left, - right = _ref35.right, - body = _ref35.body; - - left = node.left.type === 'VariableDeclaration' ? noIn(markContainsIn(left)) : left; - return (0, _objectAssign2.default)(seq(t('for'), t('await'), paren(seq(left.startsWithLet ? paren(left) : left, t('of'), p(node.right, coderep.Precedence.Assignment, right))), body), { endsWithMissingElse: body.endsWithMissingElse }); - } - }, { - key: 'reduceFunctionBody', - value: function reduceFunctionBody(node, _ref36) { - var directives = _ref36.directives, - statements = _ref36.statements; - - if (statements.length) { - statements[0] = this.parenToAvoidBeingDirective(node.statements[0], statements[0]); - } - return brace(seq.apply(undefined, _toConsumableArray(directives).concat(_toConsumableArray(statements)))); - } - }, { - key: 'reduceFunctionDeclaration', - value: function reduceFunctionDeclaration(node, _ref37) { - var name = _ref37.name, - params = _ref37.params, - body = _ref37.body; - - return seq(node.isAsync ? t('async') : empty(), t('function'), node.isGenerator ? t('*') : empty(), node.name.name === '*default*' ? empty() : name, params, body); - } - }, { - key: 'reduceFunctionExpression', - value: function reduceFunctionExpression(node, _ref38) { - var name = _ref38.name, - params = _ref38.params, - body = _ref38.body; - - var state = seq(node.isAsync ? t('async') : empty(), t('function'), node.isGenerator ? t('*') : empty(), name ? name : empty(), params, body); - state.startsWithFunctionOrClass = true; - return state; - } - }, { - key: 'reduceFormalParameters', - value: function reduceFormalParameters(node, _ref39) { - var items = _ref39.items, - rest = _ref39.rest; - - return paren(commaSep(items.concat(rest == null ? [] : [seq(t('...'), rest)]))); - } - }, { - key: 'reduceArrowExpression', - value: function reduceArrowExpression(node, _ref40) { - var params = _ref40.params, - body = _ref40.body; - - params = this.regenerateArrowParams(node.params, params); - var containsIn = false; - if (node.body.type !== 'FunctionBody') { - if (body.startsWithCurly) { - body = paren(body); - } else if (body.containsIn) { - containsIn = true; - } - } - return (0, _objectAssign2.default)(seq(node.isAsync ? t('async') : empty(), params, t('=>'), p(node.body, coderep.Precedence.Assignment, body)), { containsIn: containsIn }); - } - }, { - key: 'reduceGetter', - value: function reduceGetter(node, _ref41) { - var name = _ref41.name, - body = _ref41.body; - - return seq(t('get'), name, paren(empty()), body); - } - }, { - key: 'reduceIdentifierExpression', - value: function reduceIdentifierExpression(node) { - var a = t(node.name); - if (node.name === 'let') { - a.startsWithLet = true; - } - return a; - } - }, { - key: 'reduceIfStatement', - value: function reduceIfStatement(node, _ref42) { - var test = _ref42.test, - consequent = _ref42.consequent, - alternate = _ref42.alternate; - - if (alternate && consequent.endsWithMissingElse) { - consequent = brace(consequent); - } - return (0, _objectAssign2.default)(seq(t('if'), paren(test), consequent, alternate ? seq(t('else'), alternate) : empty()), { endsWithMissingElse: alternate ? alternate.endsWithMissingElse : true }); - } - }, { - key: 'reduceImport', - value: function reduceImport(node, _ref43) { - var defaultBinding = _ref43.defaultBinding, - namedImports = _ref43.namedImports; - - var bindings = []; - if (defaultBinding != null) { - bindings.push(defaultBinding); - } - if (namedImports.length > 0) { - bindings.push(brace(commaSep(namedImports))); - } - if (bindings.length === 0) { - return seq(t('import'), t((0, coderep.escapeStringLiteral)(node.moduleSpecifier)), semiOp()); - } - return seq(t('import'), commaSep(bindings), t('from'), t((0, coderep.escapeStringLiteral)(node.moduleSpecifier)), semiOp()); - } - }, { - key: 'reduceImportNamespace', - value: function reduceImportNamespace(node, _ref44) { - var defaultBinding = _ref44.defaultBinding, - namespaceBinding = _ref44.namespaceBinding; - - return seq(t('import'), defaultBinding == null ? empty() : seq(defaultBinding, t(',')), t('*'), t('as'), namespaceBinding, t('from'), t((0, coderep.escapeStringLiteral)(node.moduleSpecifier)), semiOp()); - } - }, { - key: 'reduceImportSpecifier', - value: function reduceImportSpecifier(node, _ref45) { - var binding = _ref45.binding; - - if (node.name == null) return binding; - return seq(t(node.name), t('as'), binding); - } - }, { - key: 'reduceExportAllFrom', - value: function reduceExportAllFrom(node) { - return seq(t('export'), t('*'), t('from'), t((0, coderep.escapeStringLiteral)(node.moduleSpecifier)), semiOp()); - } - }, { - key: 'reduceExportFrom', - value: function reduceExportFrom(node, _ref46) { - var namedExports = _ref46.namedExports; - - return seq(t('export'), brace(commaSep(namedExports)), t('from'), t((0, coderep.escapeStringLiteral)(node.moduleSpecifier)), semiOp()); - } - }, { - key: 'reduceExportLocals', - value: function reduceExportLocals(node, _ref47) { - var namedExports = _ref47.namedExports; - - return seq(t('export'), brace(commaSep(namedExports)), semiOp()); - } - }, { - key: 'reduceExport', - value: function reduceExport(node, _ref48) { - var declaration = _ref48.declaration; - - switch (node.declaration.type) { - case 'FunctionDeclaration': - case 'ClassDeclaration': - break; - default: - declaration = seq(declaration, semiOp()); - } - return seq(t('export'), declaration); - } - }, { - key: 'reduceExportDefault', - value: function reduceExportDefault(node, _ref49) { - var body = _ref49.body; - - body = body.startsWithFunctionOrClass ? paren(body) : body; - switch (node.body.type) { - case 'FunctionDeclaration': - case 'ClassDeclaration': - return seq(t('export default'), body); - default: - return seq(t('export default'), p(node.body, coderep.Precedence.Assignment, body), semiOp()); - } - } - }, { - key: 'reduceExportFromSpecifier', - value: function reduceExportFromSpecifier(node) { - if (node.exportedName == null) return t(node.name); - return seq(t(node.name), t('as'), t(node.exportedName)); - } - }, { - key: 'reduceExportLocalSpecifier', - value: function reduceExportLocalSpecifier(node, _ref50) { - var name = _ref50.name; - - if (node.exportedName == null) return name; - return seq(name, t('as'), t(node.exportedName)); - } - }, { - key: 'reduceLabeledStatement', - value: function reduceLabeledStatement(node, _ref51) { - var body = _ref51.body; - - return (0, _objectAssign2.default)(seq(t(node.label + ':'), body), { endsWithMissingElse: body.endsWithMissingElse }); - } - }, { - key: 'reduceLiteralBooleanExpression', - value: function reduceLiteralBooleanExpression(node) { - return t(node.value.toString()); - } - }, { - key: 'reduceLiteralNullExpression', - value: function reduceLiteralNullExpression() /* node */{ - return t('null'); - } - }, { - key: 'reduceLiteralInfinityExpression', - value: function reduceLiteralInfinityExpression() /* node */{ - return t('2e308'); - } - }, { - key: 'reduceLiteralNumericExpression', - value: function reduceLiteralNumericExpression(node) { - return new coderep.NumberCodeRep(node.value); - } - }, { - key: 'reduceLiteralRegExpExpression', - value: function reduceLiteralRegExpExpression(node) { - return t('/' + node.pattern + '/' + (node.global ? 'g' : '') + (node.ignoreCase ? 'i' : '') + (node.multiLine ? 'm' : '') + (node.dotAll ? 's' : '') + (node.unicode ? 'u' : '') + (node.sticky ? 'y' : ''), true); - } - }, { - key: 'reduceLiteralStringExpression', - value: function reduceLiteralStringExpression(node) { - return t((0, coderep.escapeStringLiteral)(node.value)); - } - }, { - key: 'reduceMethod', - value: function reduceMethod(node, _ref52) { - var name = _ref52.name, - params = _ref52.params, - body = _ref52.body; - - return seq(node.isAsync ? t('async') : empty(), node.isGenerator ? t('*') : empty(), name, params, body); - } - }, { - key: 'reduceModule', - value: function reduceModule(node, _ref53) { - var directives = _ref53.directives, - items = _ref53.items; - - if (items.length) { - items[0] = this.parenToAvoidBeingDirective(node.items[0], items[0]); - } - return seq.apply(undefined, _toConsumableArray(directives).concat(_toConsumableArray(items))); - } - }, { - key: 'reduceNewExpression', - value: function reduceNewExpression(node, _ref54) { - var callee = _ref54.callee, - args = _ref54.arguments; - - var parenthizedArgs = args.map(function (a, i) { - return p(node.arguments[i], coderep.Precedence.Assignment, a); - }); - var calleeRep = (0, coderep.getPrecedence)(node.callee) === coderep.Precedence.Call ? paren(callee) : p(node.callee, (0, coderep.getPrecedence)(node), callee); - return seq(t('new'), calleeRep, args.length === 0 ? empty() : paren(commaSep(parenthizedArgs))); - } - }, { - key: 'reduceNewTargetExpression', - value: function reduceNewTargetExpression() { - return t('new.target'); - } - }, { - key: 'reduceObjectExpression', - value: function reduceObjectExpression(node, _ref55) { - var properties = _ref55.properties; - - var state = brace(commaSep(properties)); - state.startsWithCurly = true; - return state; - } - }, { - key: 'reduceUpdateExpression', - value: function reduceUpdateExpression(node, _ref56) { - var operand = _ref56.operand; - - if (node.isPrefix) { - return this.reduceUnaryExpression.apply(this, arguments); - } - return (0, _objectAssign2.default)(seq(p(node.operand, coderep.Precedence.New, operand), t(node.operator)), { - startsWithCurly: operand.startsWithCurly, - startsWithLetSquareBracket: operand.startsWithLetSquareBracket, - startsWithFunctionOrClass: operand.startsWithFunctionOrClass - }); - } - }, { - key: 'reduceUnaryExpression', - value: function reduceUnaryExpression(node, _ref57) { - var operand = _ref57.operand; - - return seq(t(node.operator), p(node.operand, (0, coderep.getPrecedence)(node), operand)); - } - }, { - key: 'reduceReturnStatement', - value: function reduceReturnStatement(node, _ref58) { - var expression = _ref58.expression; - - return seq(t('return'), expression || empty(), semiOp()); - } - }, { - key: 'reduceScript', - value: function reduceScript(node, _ref59) { - var directives = _ref59.directives, - statements = _ref59.statements; - - if (statements.length) { - statements[0] = this.parenToAvoidBeingDirective(node.statements[0], statements[0]); - } - return seq.apply(undefined, _toConsumableArray(directives).concat(_toConsumableArray(statements))); - } - }, { - key: 'reduceSetter', - value: function reduceSetter(node, _ref60) { - var name = _ref60.name, - param = _ref60.param, - body = _ref60.body; - - return seq(t('set'), name, paren(param), body); - } - }, { - key: 'reduceShorthandProperty', - value: function reduceShorthandProperty(node, _ref61) { - var name = _ref61.name; - - return name; - } - }, { - key: 'reduceStaticMemberAssignmentTarget', - value: function reduceStaticMemberAssignmentTarget(node, _ref62) { - var object = _ref62.object; - - var state = seq(p(node.object, (0, coderep.getPrecedence)(node), object), t('.'), t(node.property)); - state.startsWithLet = object.startsWithLet; - state.startsWithCurly = object.startsWithCurly; - state.startsWithLetSquareBracket = object.startsWithLetSquareBracket; - state.startsWithFunctionOrClass = object.startsWithFunctionOrClass; - return state; - } - }, { - key: 'reduceStaticMemberExpression', - value: function reduceStaticMemberExpression(node, _ref63) { - var object = _ref63.object; - - var state = seq(p(node.object, (0, coderep.getPrecedence)(node), object), t('.'), t(node.property)); - state.startsWithLet = object.startsWithLet; - state.startsWithCurly = object.startsWithCurly; - state.startsWithLetSquareBracket = object.startsWithLetSquareBracket; - state.startsWithFunctionOrClass = object.startsWithFunctionOrClass; - return state; - } - }, { - key: 'reduceStaticPropertyName', - value: function reduceStaticPropertyName(node) { - if (utils.keyword.isIdentifierNameES6(node.value)) { - return t(node.value); - } - var n = parseFloat(node.value); - if (n >= 0 && n.toString() === node.value) { - return new coderep.NumberCodeRep(n); - } - return t((0, coderep.escapeStringLiteral)(node.value)); - } - }, { - key: 'reduceSuper', - value: function reduceSuper() { - return t('super'); - } - }, { - key: 'reduceSwitchCase', - value: function reduceSwitchCase(node, _ref64) { - var test = _ref64.test, - consequent = _ref64.consequent; - - return seq(t('case'), test, t(':'), seq.apply(undefined, _toConsumableArray(consequent))); - } - }, { - key: 'reduceSwitchDefault', - value: function reduceSwitchDefault(node, _ref65) { - var consequent = _ref65.consequent; - - return seq(t('default:'), seq.apply(undefined, _toConsumableArray(consequent))); - } - }, { - key: 'reduceSwitchStatement', - value: function reduceSwitchStatement(node, _ref66) { - var discriminant = _ref66.discriminant, - cases = _ref66.cases; - - return seq(t('switch'), paren(discriminant), brace(seq.apply(undefined, _toConsumableArray(cases)))); - } - }, { - key: 'reduceSwitchStatementWithDefault', - value: function reduceSwitchStatementWithDefault(node, _ref67) { - var discriminant = _ref67.discriminant, - preDefaultCases = _ref67.preDefaultCases, - defaultCase = _ref67.defaultCase, - postDefaultCases = _ref67.postDefaultCases; - - return seq(t('switch'), paren(discriminant), brace(seq.apply(undefined, _toConsumableArray(preDefaultCases).concat([defaultCase], _toConsumableArray(postDefaultCases))))); - } - }, { - key: 'reduceTemplateExpression', - value: function reduceTemplateExpression(node, _ref68) { - var tag = _ref68.tag, - elements = _ref68.elements; - - var state = node.tag == null ? empty() : p(node.tag, (0, coderep.getPrecedence)(node), tag); - state = seq(state, t('`')); - for (var i = 0, l = node.elements.length; i < l; ++i) { - if (node.elements[i].type === 'TemplateElement') { - state = seq(state, i > 0 ? t('}') : empty(), elements[i], i < l - 1 ? t('${') : empty()); - } else { - state = seq(state, elements[i]); - } - } - state = seq(state, t('`')); - if (node.tag != null) { - state.startsWithCurly = tag.startsWithCurly; - state.startsWithLet = tag.startsWithLet; - state.startsWithLetSquareBracket = tag.startsWithLetSquareBracket; - state.startsWithFunctionOrClass = tag.startsWithFunctionOrClass; - } - return state; - } - }, { - key: 'reduceTemplateElement', - value: function reduceTemplateElement(node) { - return new coderep.RawToken(node.rawValue); - } - }, { - key: 'reduceThisExpression', - value: function reduceThisExpression() /* node */{ - return t('this'); - } - }, { - key: 'reduceThrowStatement', - value: function reduceThrowStatement(node, _ref69) { - var expression = _ref69.expression; - - return seq(t('throw'), expression, semiOp()); - } - }, { - key: 'reduceTryCatchStatement', - value: function reduceTryCatchStatement(node, _ref70) { - var body = _ref70.body, - catchClause = _ref70.catchClause; - - return seq(t('try'), body, catchClause); - } - }, { - key: 'reduceTryFinallyStatement', - value: function reduceTryFinallyStatement(node, _ref71) { - var body = _ref71.body, - catchClause = _ref71.catchClause, - finalizer = _ref71.finalizer; - - return seq(t('try'), body, catchClause || empty(), t('finally'), finalizer); - } - }, { - key: 'reduceYieldExpression', - value: function reduceYieldExpression(node, _ref72) { - var expression = _ref72.expression; - - if (node.expression == null) return t('yield'); - return (0, _objectAssign2.default)(seq(t('yield'), p(node.expression, (0, coderep.getPrecedence)(node), expression)), { containsIn: expression.containsIn }); - } - }, { - key: 'reduceYieldGeneratorExpression', - value: function reduceYieldGeneratorExpression(node, _ref73) { - var expression = _ref73.expression; - - return (0, _objectAssign2.default)(seq(t('yield'), t('*'), p(node.expression, (0, coderep.getPrecedence)(node), expression)), { containsIn: expression.containsIn }); - } - }, { - key: 'reduceDirective', - value: function reduceDirective(node) { - var delim = node.rawValue.match(/(^|[^\\])(\\\\)*"/) ? '\'' : '"'; - return seq(t(delim + node.rawValue + delim), semiOp()); - } - }, { - key: 'reduceVariableDeclaration', - value: function reduceVariableDeclaration(node, _ref74) { - var declarators = _ref74.declarators; - - return seq(t(node.kind), commaSep(declarators)); - } - }, { - key: 'reduceVariableDeclarationStatement', - value: function reduceVariableDeclarationStatement(node, _ref75) { - var declaration = _ref75.declaration; - - return seq(declaration, semiOp()); - } - }, { - key: 'reduceVariableDeclarator', - value: function reduceVariableDeclarator(node, _ref76) { - var binding = _ref76.binding, - init = _ref76.init; - - var containsIn = init && init.containsIn && !init.containsGroup; - if (init) { - if (init.containsGroup) { - init = paren(init); - } else { - init = markContainsIn(init); - } - } - return (0, _objectAssign2.default)(init == null ? binding : seq(binding, t('='), init), { containsIn: containsIn }); - } - }, { - key: 'reduceWhileStatement', - value: function reduceWhileStatement(node, _ref77) { - var test = _ref77.test, - body = _ref77.body; - - return (0, _objectAssign2.default)(seq(t('while'), paren(test), body), { endsWithMissingElse: body.endsWithMissingElse }); - } - }, { - key: 'reduceWithStatement', - value: function reduceWithStatement(node, _ref78) { - var object = _ref78.object, - body = _ref78.body; - - return (0, _objectAssign2.default)(seq(t('with'), paren(object), body), { endsWithMissingElse: body.endsWithMissingElse }); - } - }]); - - return MinimalCodeGen; -}(); - -exports.default = MinimalCodeGen; -}); - -var formattedCodegen = createCommonjsModule(function (module, exports) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.FormattedCodeGen = exports.ExtensibleCodeGen = exports.Sep = undefined; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - - -var _objectAssign2 = _interopRequireDefault(objectAssign); - - - - - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var INDENT = ' '; - -var Linebreak = function (_CodeRep) { - _inherits(Linebreak, _CodeRep); - - function Linebreak() { - _classCallCheck(this, Linebreak); - - var _this = _possibleConstructorReturn(this, (Linebreak.__proto__ || Object.getPrototypeOf(Linebreak)).call(this)); - - _this.indentation = 0; - return _this; - } - - _createClass(Linebreak, [{ - key: 'emit', - value: function emit(ts) { - ts.put('\n'); - for (var i = 0; i < this.indentation; ++i) { - ts.put(INDENT); - } - } - }]); - - return Linebreak; -}(coderep.CodeRep); - -function empty() { - return new coderep.Empty(); -} - -function noIn(rep) { - return new coderep.NoIn(rep); -} - -function markContainsIn(state) { - return state.containsIn ? new coderep.ContainsIn(state) : state; -} - -function seq() { - for (var _len = arguments.length, reps = Array(_len), _key = 0; _key < _len; _key++) { - reps[_key] = arguments[_key]; - } - - return new coderep.Seq(reps); -} - -function isEmpty(codeRep) { - return codeRep instanceof coderep.Empty || codeRep instanceof Linebreak || codeRep instanceof coderep.Seq && codeRep.children.every(isEmpty); -} - -var Sep = {}; -var separatorNames = ['ARRAY_EMPTY', 'ARRAY_BEFORE_COMMA', 'ARRAY_AFTER_COMMA', 'SPREAD', 'AWAIT', 'AFTER_FORAWAIT_AWAIT', 'BEFORE_DEFAULT_EQUALS', 'AFTER_DEFAULT_EQUALS', 'REST', 'OBJECT_BEFORE_COMMA', 'OBJECT_AFTER_COMMA', 'BEFORE_PROP', 'AFTER_PROP', 'BEFORE_JUMP_LABEL', 'ARGS_BEFORE_COMMA', 'ARGS_AFTER_COMMA', 'CALL', 'BEFORE_CATCH_BINDING', 'AFTER_CATCH_BINDING', 'BEFORE_CLASS_NAME', 'BEFORE_EXTENDS', 'AFTER_EXTENDS', 'BEFORE_CLASS_DECLARATION_ELEMENTS', 'BEFORE_CLASS_EXPRESSION_ELEMENTS', 'AFTER_STATIC', 'BEFORE_CLASS_ELEMENT', 'AFTER_CLASS_ELEMENT', 'BEFORE_TERNARY_QUESTION', 'AFTER_TERNARY_QUESTION', 'BEFORE_TERNARY_COLON', 'AFTER_TERNARY_COLON', 'COMPUTED_MEMBER_EXPRESSION', 'COMPUTED_MEMBER_ASSIGNMENT_TARGET', 'AFTER_DO', 'BEFORE_DOWHILE_WHILE', 'AFTER_DOWHILE_WHILE', 'AFTER_FORIN_FOR', 'BEFORE_FORIN_IN', 'AFTER_FORIN_FOR', 'BEFORE_FORIN_BODY', 'AFTER_FOROF_FOR', 'BEFORE_FOROF_OF', 'AFTER_FOROF_FOR', 'BEFORE_FOROF_BODY', 'AFTER_FOR_FOR', 'BEFORE_FOR_INIT', 'AFTER_FOR_INIT', 'EMPTY_FOR_INIT', 'BEFORE_FOR_TEST', 'AFTER_FOR_TEST', 'EMPTY_FOR_TEST', 'BEFORE_FOR_UPDATE', 'AFTER_FOR_UPDATE', 'EMPTY_FOR_UPDATE', 'BEFORE_FOR_BODY', 'BEFORE_GENERATOR_STAR', 'AFTER_GENERATOR_STAR', 'BEFORE_FUNCTION_PARAMS', 'BEFORE_FUNCTION_DECLARATION_BODY', 'BEFORE_FUNCTION_EXPRESSION_BODY', 'AFTER_FUNCTION_DIRECTIVES', 'BEFORE_ARROW', 'AFTER_ARROW', 'AFTER_GET', 'BEFORE_GET_PARAMS', 'BEFORE_GET_BODY', 'AFTER_IF', 'AFTER_IF_TEST', 'BEFORE_ELSE', 'AFTER_ELSE', 'PARAMETER_BEFORE_COMMA', 'PARAMETER_AFTER_COMMA', 'NAMED_IMPORT_BEFORE_COMMA', 'NAMED_IMPORT_AFTER_COMMA', 'IMPORT_BEFORE_COMMA', 'IMPORT_AFTER_COMMA', 'BEFORE_IMPORT_BINDINGS', 'BEFORE_IMPORT_MODULE', 'AFTER_IMPORT_BINDINGS', 'AFTER_FROM', 'BEFORE_IMPORT_NAMESPACE', 'BEFORE_IMPORT_STAR', 'AFTER_IMPORT_STAR', 'AFTER_IMPORT_AS', 'AFTER_NAMESPACE_BINDING', 'BEFORE_IMPORT_AS', 'AFTER_IMPORT_AS', 'EXPORTS_BEFORE_COMMA', 'EXPORTS_AFTER_COMMA', 'BEFORE_EXPORT_STAR', 'AFTER_EXPORT_STAR', 'BEFORE_EXPORT_BINDINGS', 'AFTER_EXPORT_FROM_BINDINGS', 'AFTER_EXPORT_LOCAL_BINDINGS', 'AFTER_EXPORT', 'EXPORT_DEFAULT', 'AFTER_EXPORT_DEFAULT', 'BEFORE_EXPORT_AS', 'AFTER_EXPORT_AS', 'BEFORE_LABEL_COLON', 'AFTER_LABEL_COLON', 'AFTER_METHOD_GENERATOR_STAR', 'AFTER_METHOD_ASYNC', 'AFTER_METHOD_NAME', 'BEFORE_METHOD_BODY', 'AFTER_MODULE_DIRECTIVES', 'AFTER_NEW', 'BEFORE_NEW_ARGS', 'EMPTY_NEW_CALL', 'NEW_TARGET_BEFORE_DOT', 'NEW_TARGET_AFTER_DOT', 'RETURN', 'AFTER_SET', 'BEFORE_SET_PARAMS', 'BEFORE_SET_BODY', 'AFTER_SCRIPT_DIRECTIVES', 'BEFORE_STATIC_MEMBER_DOT', 'AFTER_STATIC_MEMBER_DOT', 'BEFORE_STATIC_MEMBER_ASSIGNMENT_TARGET_DOT', 'AFTER_STATIC_MEMBER_ASSIGNMENT_TARGET_DOT', 'BEFORE_CASE_TEST', 'AFTER_CASE_TEST', 'BEFORE_CASE_BODY', 'AFTER_CASE_BODY', 'DEFAULT', 'AFTER_DEFAULT_BODY', 'BEFORE_SWITCH_DISCRIM', 'BEFORE_SWITCH_BODY', 'TEMPLATE_TAG', 'BEFORE_TEMPLATE_EXPRESSION', 'AFTER_TEMPLATE_EXPRESSION', 'THROW', 'AFTER_TRY', 'BEFORE_CATCH', 'BEFORE_FINALLY', 'AFTER_FINALLY', 'VARIABLE_DECLARATION', 'YIELD', 'BEFORE_YIELD_STAR', 'AFTER_YIELD_STAR', 'DECLARATORS_BEFORE_COMMA', 'DECLARATORS_AFTER_COMMA', 'BEFORE_INIT_EQUALS', 'AFTER_INIT_EQUALS', 'AFTER_WHILE', 'BEFORE_WHILE_BODY', 'AFTER_WITH', 'BEFORE_WITH_BODY', 'PAREN_AVOIDING_DIRECTIVE_BEFORE', 'PAREN_AVOIDING_DIRECTIVE_AFTER', 'PRECEDENCE_BEFORE', 'PRECEDENCE_AFTER', 'EXPRESSION_PAREN_BEFORE', 'EXPRESSION_PAREN_AFTER', 'CALL_PAREN_BEFORE', 'CALL_PAREN_AFTER', 'CALL_PAREN_EMPTY', 'CATCH_PAREN_BEFORE', 'CATCH_PAREN_AFTER', 'DO_WHILE_TEST_PAREN_BEFORE', 'DO_WHILE_TEST_PAREN_AFTER', 'EXPRESSION_STATEMENT_PAREN_BEFORE', 'EXPRESSION_STATEMENT_PAREN_AFTER', 'FOR_LET_PAREN_BEFORE', 'FOR_LET_PAREN_AFTER', 'FOR_IN_LET_PAREN_BEFORE', 'FOR_IN_LET_PAREN_AFTER', 'FOR_IN_PAREN_BEFORE', 'FOR_IN_PAREN_AFTER', 'FOR_OF_LET_PAREN_BEFORE', 'FOR_OF_LET_PAREN_AFTER', 'FOR_OF_PAREN_BEFORE', 'FOR_OF_PAREN_AFTER', 'PARAMETERS_PAREN_BEFORE', 'PARAMETERS_PAREN_AFTER', 'PARAMETERS_PAREN_EMPTY', 'ARROW_PARAMETERS_PAREN_BEFORE', 'ARROW_PARAMETERS_PAREN_AFTER', 'ARROW_PARAMETERS_PAREN_EMPTY', 'ARROW_BODY_PAREN_BEFORE', 'ARROW_BODY_PAREN_AFTER', 'BEFORE_ARROW_ASYNC_PARAMS', 'GETTER_PARAMS', 'IF_PAREN_BEFORE', 'IF_PAREN_AFTER', 'EXPORT_PAREN_BEFORE', 'EXPORT_PAREN_AFTER', 'NEW_CALLEE_PAREN_BEFORE', 'NEW_CALLEE_PAREN_AFTER', 'NEW_PAREN_BEFORE', 'NEW_PAREN_AFTER', 'NEW_PAREN_EMPTY', 'SETTER_PARAM_BEFORE', 'SETTER_PARAM_AFTER', 'SWITCH_DISCRIM_PAREN_BEFORE', 'SWITCH_DISCRIM_PAREN_AFTER', 'WHILE_TEST_PAREN_BEFORE', 'WHILE_TEST_PAREN_AFTER', 'WITH_PAREN_BEFORE', 'WITH_PAREN_AFTER', 'OBJECT_BRACE_INITIAL', 'OBJECT_BRACE_FINAL', 'OBJECT_EMPTY', 'BLOCK_BRACE_INITIAL', 'BLOCK_BRACE_FINAL', 'BLOCK_EMPTY', 'CLASS_BRACE_INITIAL', 'CLASS_BRACE_FINAL', 'CLASS_EMPTY', 'CLASS_EXPRESSION_BRACE_INITIAL', 'CLASS_EXPRESSION_BRACE_FINAL', 'CLASS_EXPRESSION_BRACE_EMPTY', 'FUNCTION_BRACE_INITIAL', 'FUNCTION_BRACE_FINAL', 'FUNCTION_EMPTY', 'FUNCTION_EXPRESSION_BRACE_INITIAL', 'FUNCTION_EXPRESSION_BRACE_FINAL', 'FUNCTION_EXPRESSION_EMPTY', 'ARROW_BRACE_INITIAL', 'ARROW_BRACE_FINAL', 'ARROW_BRACE_EMPTY', 'GET_BRACE_INTIAL', 'GET_BRACE_FINAL', 'GET_BRACE_EMPTY', 'MISSING_ELSE_INTIIAL', 'MISSING_ELSE_FINAL', 'MISSING_ELSE_EMPTY', 'IMPORT_BRACE_INTIAL', 'IMPORT_BRACE_FINAL', 'IMPORT_BRACE_EMPTY', 'EXPORT_BRACE_INITIAL', 'EXPORT_BRACE_FINAL', 'EXPORT_BRACE_EMPTY', 'METHOD_BRACE_INTIAL', 'METHOD_BRACE_FINAL', 'METHOD_BRACE_EMPTY', 'SET_BRACE_INTIIAL', 'SET_BRACE_FINAL', 'SET_BRACE_EMPTY', 'SWITCH_BRACE_INTIAL', 'SWITCH_BRACE_FINAL', 'SWITCH_BRACE_EMPTY', 'ARRAY_INITIAL', 'ARRAY_FINAL', 'COMPUTED_MEMBER_BRACKET_INTIAL', 'COMPUTED_MEMBER_BRACKET_FINAL', 'COMPUTED_MEMBER_ASSIGNMENT_TARGET_BRACKET_INTIAL', 'COMPUTED_MEMBER_ASSIGNMENT_TARGET_BRACKET_FINAL', 'COMPUTED_PROPERTY_BRACKET_INTIAL', 'COMPUTED_PROPERTY_BRACKET_FINAL']; -for (var i = 0; i < separatorNames.length; ++i) { - Sep[separatorNames[i]] = { type: separatorNames[i] }; -} - -Sep.BEFORE_ASSIGN_OP = function (op) { - return { - type: 'BEFORE_ASSIGN_OP', - op: op - }; -}; - -Sep.AFTER_ASSIGN_OP = function (op) { - return { - type: 'AFTER_ASSIGN_OP', - op: op - }; -}; - -Sep.BEFORE_BINOP = function (op) { - return { - type: 'BEFORE_BINOP', - op: op - }; -}; - -Sep.AFTER_BINOP = function (op) { - return { - type: 'AFTER_BINOP', - op: op - }; -}; - -Sep.BEFORE_POSTFIX = function (op) { - return { - type: 'BEFORE_POSTFIX', - op: op - }; -}; - -Sep.UNARY = function (op) { - return { - type: 'UNARY', - op: op - }; -}; - -Sep.AFTER_STATEMENT = function (node) { - return { - type: 'AFTER_STATEMENT', - node: node - }; -}; - -Sep.BEFORE_FUNCTION_NAME = function (node) { - return { - type: 'BEFORE_FUNCTION_NAME', - node: node - }; -}; -exports.Sep = Sep; - -var ExtensibleCodeGen = exports.ExtensibleCodeGen = function () { - function ExtensibleCodeGen() { - _classCallCheck(this, ExtensibleCodeGen); - } - - _createClass(ExtensibleCodeGen, [{ - key: 'parenToAvoidBeingDirective', - value: function parenToAvoidBeingDirective(element, original) { - if (element && element.type === 'ExpressionStatement' && element.expression.type === 'LiteralStringExpression') { - return seq(this.paren(original.children[0], Sep.PAREN_AVOIDING_DIRECTIVE_BEFORE, Sep.PAREN_AVOIDING_DIRECTIVE_AFTER), this.semiOp()); - } - return original; - } - }, { - key: 't', - value: function t(token) { - var isRegExp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - return new coderep.Token(token, isRegExp); - } - }, { - key: 'p', - value: function p(node, precedence, a) { - return (0, coderep.getPrecedence)(node) < precedence ? this.paren(a, Sep.PRECEDENCE_BEFORE, Sep.PRECEDENCE_AFTER) : a; - } - }, { - key: 'getAssignmentExpr', - value: function getAssignmentExpr(state) { - return state ? state.containsGroup ? this.paren(state, Sep.EXPRESSION_PAREN_BEFORE, Sep.EXPRESSION_PAREN_AFTER) : state : empty(); - } - }, { - key: 'paren', - value: function paren(rep, first, last, emptySep) { - if (isEmpty(rep)) { - return new coderep.Paren(this.sep(emptySep)); - } - return new coderep.Paren(seq(first ? this.sep(first) : empty(), rep, last ? this.sep(last) : empty())); - } - }, { - key: 'brace', - value: function brace(rep, node, first, last, emptySep) { - if (isEmpty(rep)) { - return new coderep.Brace(this.sep(emptySep)); - } - return new coderep.Brace(seq(this.sep(first), rep, this.sep(last))); - } - }, { - key: 'bracket', - value: function bracket(rep, first, last, emptySep) { - if (isEmpty(rep)) { - return new coderep.Bracket(this.sep(emptySep)); - } - return new coderep.Bracket(seq(this.sep(first), rep, this.sep(last))); - } - }, { - key: 'commaSep', - value: function commaSep(pieces, before, after) { - var _this2 = this; - - var first = true; - pieces = pieces.map(function (p) { - if (first) { - first = false; - return p; - } - return seq(_this2.sep(before), _this2.t(','), _this2.sep(after), p); - }); - return seq.apply(undefined, _toConsumableArray(pieces)); - } - }, { - key: 'semiOp', - value: function semiOp() { - return new coderep.SemiOp(); - } - }, { - key: 'sep', - value: function sep() /* kind */{ - return empty(); - } - }, { - key: 'reduceArrayExpression', - value: function reduceArrayExpression(node, _ref) { - var _this3 = this; - - var elements = _ref.elements; - - if (elements.length === 0) { - return this.bracket(empty(), null, null, Sep.ARRAY_EMPTY); - } - - var content = this.commaSep(elements.map(function (e) { - return _this3.getAssignmentExpr(e); - }), Sep.ARRAY_BEFORE_COMMA, Sep.ARRAY_AFTER_COMMA); - if (elements.length > 0 && elements[elements.length - 1] == null) { - content = seq(content, this.sep(Sep.ARRAY_BEFORE_COMMA), this.t(','), this.sep(Sep.ARRAY_AFTER_COMMA)); - } - return this.bracket(content, Sep.ARRAY_INITIAL, Sep.ARRAY_FINAL); - } - }, { - key: 'reduceAwaitExpression', - value: function reduceAwaitExpression(node, _ref2) { - var expression = _ref2.expression; - - return seq(this.t('await'), this.sep(Sep.AWAIT), this.p(node.expression, (0, coderep.getPrecedence)(node), expression)); - } - }, { - key: 'reduceSpreadElement', - value: function reduceSpreadElement(node, _ref3) { - var expression = _ref3.expression; - - return seq(this.t('...'), this.sep(Sep.SPREAD), this.p(node.expression, coderep.Precedence.Assignment, expression)); - } - }, { - key: 'reduceSpreadProperty', - value: function reduceSpreadProperty(node, _ref4) { - var expression = _ref4.expression; - - return seq(this.t('...'), this.sep(Sep.SPREAD), this.getAssignmentExpr(expression)); - } - }, { - key: 'reduceAssignmentExpression', - value: function reduceAssignmentExpression(node, _ref5) { - var binding = _ref5.binding, - expression = _ref5.expression; - - var leftCode = binding; - var rightCode = expression; - var containsIn = expression.containsIn; - var startsWithCurly = binding.startsWithCurly; - var startsWithLetSquareBracket = binding.startsWithLetSquareBracket; - var startsWithFunctionOrClass = binding.startsWithFunctionOrClass; - if ((0, coderep.getPrecedence)(node.expression) < (0, coderep.getPrecedence)(node)) { - rightCode = this.paren(rightCode, Sep.EXPRESSION_PAREN_BEFORE, Sep.EXPRESSION_PAREN_AFTER); - containsIn = false; - } - return (0, _objectAssign2.default)(seq(leftCode, this.sep(Sep.BEFORE_ASSIGN_OP('=')), this.t('='), this.sep(Sep.AFTER_ASSIGN_OP('=')), rightCode), { containsIn: containsIn, startsWithCurly: startsWithCurly, startsWithLetSquareBracket: startsWithLetSquareBracket, startsWithFunctionOrClass: startsWithFunctionOrClass }); - } - }, { - key: 'reduceAssignmentTargetIdentifier', - value: function reduceAssignmentTargetIdentifier(node) { - var a = this.t(node.name); - if (node.name === 'let') { - a.startsWithLet = true; - } - return a; - } - }, { - key: 'reduceAssignmentTargetWithDefault', - value: function reduceAssignmentTargetWithDefault(node, _ref6) { - var binding = _ref6.binding, - init = _ref6.init; - - return seq(binding, this.sep(Sep.BEFORE_DEFAULT_EQUALS), this.t('='), this.sep(Sep.AFTER_DEFAULT_EQUALS), this.p(node.init, coderep.Precedence.Assignment, init)); - } - }, { - key: 'reduceCompoundAssignmentExpression', - value: function reduceCompoundAssignmentExpression(node, _ref7) { - var binding = _ref7.binding, - expression = _ref7.expression; - - var leftCode = binding; - var rightCode = expression; - var containsIn = expression.containsIn; - var startsWithCurly = binding.startsWithCurly; - var startsWithLetSquareBracket = binding.startsWithLetSquareBracket; - var startsWithFunctionOrClass = binding.startsWithFunctionOrClass; - if ((0, coderep.getPrecedence)(node.expression) < (0, coderep.getPrecedence)(node)) { - rightCode = this.paren(rightCode, Sep.EXPRESSION_PAREN_BEFORE, Sep.EXPRESSION_PAREN_AFTER); - containsIn = false; - } - return (0, _objectAssign2.default)(seq(leftCode, this.sep(Sep.BEFORE_ASSIGN_OP(node.operator)), this.t(node.operator), this.sep(Sep.AFTER_ASSIGN_OP(node.operator)), rightCode), { containsIn: containsIn, startsWithCurly: startsWithCurly, startsWithLetSquareBracket: startsWithLetSquareBracket, startsWithFunctionOrClass: startsWithFunctionOrClass }); - } - }, { - key: 'reduceBinaryExpression', - value: function reduceBinaryExpression(node, _ref8) { - var left = _ref8.left, - right = _ref8.right; - - var leftCode = left; - var startsWithCurly = left.startsWithCurly; - var startsWithLetSquareBracket = left.startsWithLetSquareBracket; - var startsWithFunctionOrClass = left.startsWithFunctionOrClass; - var leftContainsIn = left.containsIn; - var isRightAssociative = node.operator === '**'; - if ((0, coderep.getPrecedence)(node.left) < (0, coderep.getPrecedence)(node) || isRightAssociative && ((0, coderep.getPrecedence)(node.left) === (0, coderep.getPrecedence)(node) || node.left.type === 'UnaryExpression')) { - leftCode = this.paren(leftCode, Sep.EXPRESSION_PAREN_BEFORE, Sep.EXPRESSION_PAREN_AFTER); - startsWithCurly = false; - startsWithLetSquareBracket = false; - startsWithFunctionOrClass = false; - leftContainsIn = false; - } - var rightCode = right; - var rightContainsIn = right.containsIn; - if ((0, coderep.getPrecedence)(node.right) < (0, coderep.getPrecedence)(node) || !isRightAssociative && (0, coderep.getPrecedence)(node.right) === (0, coderep.getPrecedence)(node)) { - rightCode = this.paren(rightCode, Sep.EXPRESSION_PAREN_BEFORE, Sep.EXPRESSION_PAREN_AFTER); - rightContainsIn = false; - } - return (0, _objectAssign2.default)(seq(leftCode, this.sep(Sep.BEFORE_BINOP(node.operator)), this.t(node.operator), this.sep(Sep.AFTER_BINOP(node.operator)), rightCode), { - containsIn: leftContainsIn || rightContainsIn || node.operator === 'in', - containsGroup: node.operator === ',', - startsWithCurly: startsWithCurly, - startsWithLetSquareBracket: startsWithLetSquareBracket, - startsWithFunctionOrClass: startsWithFunctionOrClass - }); - } - }, { - key: 'reduceBindingWithDefault', - value: function reduceBindingWithDefault(node, _ref9) { - var binding = _ref9.binding, - init = _ref9.init; - - return seq(binding, this.sep(Sep.BEFORE_DEFAULT_EQUALS), this.t('='), this.sep(Sep.AFTER_DEFAULT_EQUALS), this.p(node.init, coderep.Precedence.Assignment, init)); - } - }, { - key: 'reduceBindingIdentifier', - value: function reduceBindingIdentifier(node) { - var a = this.t(node.name); - if (node.name === 'let') { - a.startsWithLet = true; - } - return a; - } - }, { - key: 'reduceArrayAssignmentTarget', - value: function reduceArrayAssignmentTarget(node, _ref10) { - var _this4 = this; - - var elements = _ref10.elements, - rest = _ref10.rest; - - var content = void 0; - if (elements.length === 0) { - content = rest == null ? empty() : seq(this.t('...'), this.sep(Sep.REST), rest); - } else { - elements = elements.concat(rest == null ? [] : [seq(this.t('...'), this.sep(Sep.REST), rest)]); - content = this.commaSep(elements.map(function (e) { - return _this4.getAssignmentExpr(e); - }), Sep.ARRAY_BEFORE_COMMA, Sep.ARRAY_AFTER_COMMA); - if (elements.length > 0 && elements[elements.length - 1] == null) { - content = seq(content, this.sep(Sep.ARRAY_BEFORE_COMMA), this.t(','), this.sep(Sep.ARRAY_AFTER_COMMA)); - } - } - return this.bracket(content, Sep.ARRAY_INITIAL, Sep.ARRAY_FINAL, Sep.ARRAY_EMPTY); - } - }, { - key: 'reduceArrayBinding', - value: function reduceArrayBinding(node, _ref11) { - var _this5 = this; - - var elements = _ref11.elements, - rest = _ref11.rest; - - var content = void 0; - if (elements.length === 0) { - content = rest == null ? empty() : seq(this.t('...'), this.sep(Sep.REST), rest); - } else { - elements = elements.concat(rest == null ? [] : [seq(this.t('...'), this.sep(Sep.REST), rest)]); - content = this.commaSep(elements.map(function (e) { - return _this5.getAssignmentExpr(e); - }), Sep.ARRAY_BEFORE_COMMA, Sep.ARRAY_AFTER_COMMA); - if (elements.length > 0 && elements[elements.length - 1] == null) { - content = seq(content, this.sep(Sep.ARRAY_BEFORE_COMMA), this.t(','), this.sep(Sep.ARRAY_AFTER_COMMA)); - } - } - return this.bracket(content, Sep.ARRAY_INITIAL, Sep.ARRAY_FINAL, Sep.ARRAY_EMPTY); - } - }, { - key: 'reduceObjectAssignmentTarget', - value: function reduceObjectAssignmentTarget(node, _ref12) { - var properties = _ref12.properties, - rest = _ref12.rest; - - var content = void 0; - if (properties.length === 0) { - content = rest == null ? empty() : seq(this.t('...'), this.sep(Sep.REST), rest); - } else { - content = this.commaSep(properties, Sep.OBJECT_BEFORE_COMMA, Sep.OBJECT_AFTER_COMMA); - content = rest == null ? content : this.commaSep([content, seq(this.t('...'), this.sep(Sep.REST), rest)], Sep.OBJECT_BEFORE_COMMA, Sep.OBJECT_AFTER_COMMA); - } - var state = this.brace(content, node, Sep.OBJECT_BRACE_INITIAL, Sep.OBJECT_BRACE_FINAL, Sep.OBJECT_EMPTY); - state.startsWithCurly = true; - return state; - } - }, { - key: 'reduceObjectBinding', - value: function reduceObjectBinding(node, _ref13) { - var properties = _ref13.properties, - rest = _ref13.rest; - - var content = void 0; - if (properties.length === 0) { - content = rest == null ? empty() : seq(this.t('...'), this.sep(Sep.REST), rest); - } else { - content = this.commaSep(properties, Sep.OBJECT_BEFORE_COMMA, Sep.OBJECT_AFTER_COMMA); - content = rest == null ? content : this.commaSep([content, seq(this.t('...'), this.sep(Sep.REST), rest)], Sep.OBJECT_BEFORE_COMMA, Sep.OBJECT_AFTER_COMMA); - } - var state = this.brace(content, node, Sep.OBJECT_BRACE_INITIAL, Sep.OBJECT_BRACE_FINAL, Sep.OBJECT_EMPTY); - state.startsWithCurly = true; - return state; - } - }, { - key: 'reduceAssignmentTargetPropertyIdentifier', - value: function reduceAssignmentTargetPropertyIdentifier(node, _ref14) { - var binding = _ref14.binding, - init = _ref14.init; - - if (node.init == null) return binding; - return seq(binding, this.sep(Sep.BEFORE_DEFAULT_EQUALS), this.t('='), this.sep(Sep.AFTER_DEFAULT_EQUALS), this.p(node.init, coderep.Precedence.Assignment, init)); - } - }, { - key: 'reduceAssignmentTargetPropertyProperty', - value: function reduceAssignmentTargetPropertyProperty(node, _ref15) { - var name = _ref15.name, - binding = _ref15.binding; - - return seq(name, this.sep(Sep.BEFORE_PROP), this.t(':'), this.sep(Sep.AFTER_PROP), binding); - } - }, { - key: 'reduceBindingPropertyIdentifier', - value: function reduceBindingPropertyIdentifier(node, _ref16) { - var binding = _ref16.binding, - init = _ref16.init; - - if (node.init == null) return binding; - return seq(binding, this.sep(Sep.BEFORE_DEFAULT_EQUALS), this.t('='), this.sep(Sep.AFTER_DEFAULT_EQUALS), this.p(node.init, coderep.Precedence.Assignment, init)); - } - }, { - key: 'reduceBindingPropertyProperty', - value: function reduceBindingPropertyProperty(node, _ref17) { - var name = _ref17.name, - binding = _ref17.binding; - - return seq(name, this.sep(Sep.BEFORE_PROP), this.t(':'), this.sep(Sep.AFTER_PROP), binding); - } - }, { - key: 'reduceBlock', - value: function reduceBlock(node, _ref18) { - var statements = _ref18.statements; - - return this.brace(seq.apply(undefined, _toConsumableArray(statements)), node, Sep.BLOCK_BRACE_INITIAL, Sep.BLOCK_BRACE_FINAL, Sep.BLOCK_EMPTY); - } - }, { - key: 'reduceBlockStatement', - value: function reduceBlockStatement(node, _ref19) { - var block = _ref19.block; - - return seq(block, this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: 'reduceBreakStatement', - value: function reduceBreakStatement(node) { - return seq(this.t('break'), node.label ? seq(this.sep(Sep.BEFORE_JUMP_LABEL), this.t(node.label)) : empty(), this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: 'reduceCallExpression', - value: function reduceCallExpression(node, _ref20) { - var _this6 = this; - - var callee = _ref20.callee, - args = _ref20.arguments; - - var parenthizedArgs = args.map(function (a, i) { - return _this6.p(node.arguments[i], coderep.Precedence.Assignment, a); - }); - return (0, _objectAssign2.default)(seq(this.p(node.callee, (0, coderep.getPrecedence)(node), callee), this.sep(Sep.CALL), this.paren(this.commaSep(parenthizedArgs, Sep.ARGS_BEFORE_COMMA, Sep.ARGS_AFTER_COMMA), Sep.CALL_PAREN_BEFORE, Sep.CALL_PAREN_AFTER, Sep.CALL_PAREN_EMPTY)), { - startsWithCurly: callee.startsWithCurly, - startsWithLet: callee.startsWithLet, - startsWithLetSquareBracket: callee.startsWithLetSquareBracket, - startsWithFunctionOrClass: callee.startsWithFunctionOrClass - }); - } - }, { - key: 'reduceCatchClause', - value: function reduceCatchClause(node, _ref21) { - var binding = _ref21.binding, - body = _ref21.body; - - return seq(this.t('catch'), this.sep(Sep.BEFORE_CATCH_BINDING), this.paren(binding, Sep.CATCH_PAREN_BEFORE, Sep.CATCH_PAREN_AFTER), this.sep(Sep.AFTER_CATCH_BINDING), body); - } - }, { - key: 'reduceClassDeclaration', - value: function reduceClassDeclaration(node, _ref22) { - var name = _ref22.name, - _super = _ref22.super, - elements = _ref22.elements; - - var state = seq(this.t('class'), node.name.name === '*default*' ? empty() : seq(this.sep(Sep.BEFORE_CLASS_NAME), name)); - if (_super != null) { - state = seq(state, this.sep(Sep.BEFORE_EXTENDS), this.t('extends'), this.sep(Sep.AFTER_EXTENDS), this.p(node.super, coderep.Precedence.New, _super)); - } - state = seq(state, this.sep(Sep.BEFORE_CLASS_DECLARATION_ELEMENTS), this.brace(seq.apply(undefined, _toConsumableArray(elements)), node, Sep.CLASS_BRACE_INITIAL, Sep.CLASS_BRACE_FINAL, Sep.CLASS_EMPTY), this.sep(Sep.AFTER_STATEMENT(node))); - return state; - } - }, { - key: 'reduceClassExpression', - value: function reduceClassExpression(node, _ref23) { - var name = _ref23.name, - _super = _ref23.super, - elements = _ref23.elements; - - var state = this.t('class'); - if (name != null) { - state = seq(state, this.sep(Sep.BEFORE_CLASS_NAME), name); - } - if (_super != null) { - state = seq(state, this.sep(Sep.BEFORE_EXTENDS), this.t('extends'), this.sep(Sep.AFTER_EXTENDS), this.p(node.super, coderep.Precedence.New, _super)); - } - state = seq(state, this.sep(Sep.BEFORE_CLASS_EXPRESSION_ELEMENTS), this.brace(seq.apply(undefined, _toConsumableArray(elements)), node, Sep.CLASS_EXPRESSION_BRACE_INITIAL, Sep.CLASS_EXPRESSION_BRACE_FINAL, Sep.CLASS_EXPRESSION_BRACE_EMPTY)); - state.startsWithFunctionOrClass = true; - return state; - } - }, { - key: 'reduceClassElement', - value: function reduceClassElement(node, _ref24) { - var method = _ref24.method; - - method = seq(this.sep(Sep.BEFORE_CLASS_ELEMENT), method, this.sep(Sep.AFTER_CLASS_ELEMENT)); - if (!node.isStatic) return method; - return seq(this.t('static'), this.sep(Sep.AFTER_STATIC), method); - } - }, { - key: 'reduceComputedMemberAssignmentTarget', - value: function reduceComputedMemberAssignmentTarget(node, _ref25) { - var object = _ref25.object, - expression = _ref25.expression; - - var startsWithLetSquareBracket = object.startsWithLetSquareBracket || node.object.type === 'IdentifierExpression' && node.object.name === 'let'; - return (0, _objectAssign2.default)(seq(this.p(node.object, (0, coderep.getPrecedence)(node), object), this.sep(Sep.COMPUTED_MEMBER_ASSIGNMENT_TARGET), this.bracket(expression, Sep.COMPUTED_MEMBER_ASSIGNMENT_TARGET_BRACKET_INTIAL, Sep.COMPUTED_MEMBER_ASSIGNMENT_TARGET_BRACKET_FINAL)), { - startsWithLet: object.startsWithLet, - startsWithLetSquareBracket: startsWithLetSquareBracket, - startsWithCurly: object.startsWithCurly, - startsWithFunctionOrClass: object.startsWithFunctionOrClass - }); - } - }, { - key: 'reduceComputedMemberExpression', - value: function reduceComputedMemberExpression(node, _ref26) { - var object = _ref26.object, - expression = _ref26.expression; - - var startsWithLetSquareBracket = object.startsWithLetSquareBracket || node.object.type === 'IdentifierExpression' && node.object.name === 'let'; - return (0, _objectAssign2.default)(seq(this.p(node.object, (0, coderep.getPrecedence)(node), object), this.sep(Sep.COMPUTED_MEMBER_EXPRESSION), this.bracket(expression, Sep.COMPUTED_MEMBER_BRACKET_INTIAL, Sep.COMPUTED_MEMBER_BRACKET_FINAL)), { - startsWithLet: object.startsWithLet, - startsWithLetSquareBracket: startsWithLetSquareBracket, - startsWithCurly: object.startsWithCurly, - startsWithFunctionOrClass: object.startsWithFunctionOrClass - }); - } - }, { - key: 'reduceComputedPropertyName', - value: function reduceComputedPropertyName(node, _ref27) { - var expression = _ref27.expression; - - return this.bracket(this.p(node.expression, coderep.Precedence.Assignment, expression), Sep.COMPUTED_PROPERTY_BRACKET_INTIAL, Sep.COMPUTED_PROPERTY_BRACKET_FINAL); - } - }, { - key: 'reduceConditionalExpression', - value: function reduceConditionalExpression(node, _ref28) { - var test = _ref28.test, - consequent = _ref28.consequent, - alternate = _ref28.alternate; - - var containsIn = test.containsIn || alternate.containsIn; - var startsWithCurly = test.startsWithCurly; - var startsWithLetSquareBracket = test.startsWithLetSquareBracket; - var startsWithFunctionOrClass = test.startsWithFunctionOrClass; - return (0, _objectAssign2.default)(seq(this.p(node.test, coderep.Precedence.LogicalOR, test), this.sep(Sep.BEFORE_TERNARY_QUESTION), this.t('?'), this.sep(Sep.AFTER_TERNARY_QUESTION), this.p(node.consequent, coderep.Precedence.Assignment, consequent), this.sep(Sep.BEFORE_TERNARY_COLON), this.t(':'), this.sep(Sep.AFTER_TERNARY_COLON), this.p(node.alternate, coderep.Precedence.Assignment, alternate)), { - containsIn: containsIn, - startsWithCurly: startsWithCurly, - startsWithLetSquareBracket: startsWithLetSquareBracket, - startsWithFunctionOrClass: startsWithFunctionOrClass - }); - } - }, { - key: 'reduceContinueStatement', - value: function reduceContinueStatement(node) { - return seq(this.t('continue'), node.label ? seq(this.sep(Sep.BEFORE_JUMP_LABEL), this.t(node.label)) : empty(), this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: 'reduceDataProperty', - value: function reduceDataProperty(node, _ref29) { - var name = _ref29.name, - expression = _ref29.expression; - - return seq(name, this.sep(Sep.BEFORE_PROP), this.t(':'), this.sep(Sep.AFTER_PROP), this.getAssignmentExpr(expression)); - } - }, { - key: 'reduceDebuggerStatement', - value: function reduceDebuggerStatement(node) { - return seq(this.t('debugger'), this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: 'reduceDoWhileStatement', - value: function reduceDoWhileStatement(node, _ref30) { - var body = _ref30.body, - test = _ref30.test; - - return seq(this.t('do'), this.sep(Sep.AFTER_DO), body, this.sep(Sep.BEFORE_DOWHILE_WHILE), this.t('while'), this.sep(Sep.AFTER_DOWHILE_WHILE), this.paren(test, Sep.DO_WHILE_TEST_PAREN_BEFORE, Sep.DO_WHILE_TEST_PAREN_AFTER), this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: 'reduceEmptyStatement', - value: function reduceEmptyStatement(node) { - return seq(this.t(';'), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: 'reduceExpressionStatement', - value: function reduceExpressionStatement(node, _ref31) { - var expression = _ref31.expression; - - var needsParens = expression.startsWithCurly || expression.startsWithLetSquareBracket || expression.startsWithFunctionOrClass; - return seq(needsParens ? this.paren(expression, Sep.EXPRESSION_STATEMENT_PAREN_BEFORE, Sep.EXPRESSION_STATEMENT_PAREN_AFTER) : expression, this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: 'reduceForInStatement', - value: function reduceForInStatement(node, _ref32) { - var left = _ref32.left, - right = _ref32.right, - body = _ref32.body; - - left = node.left.type === 'VariableDeclaration' ? noIn(markContainsIn(left)) : left; - return (0, _objectAssign2.default)(seq(this.t('for'), this.sep(Sep.AFTER_FORIN_FOR), this.paren(seq(left.startsWithLet ? this.paren(left, Sep.FOR_IN_LET_PAREN_BEFORE, Sep.FOR_IN_LET_PAREN_AFTER) : left, this.sep(Sep.BEFORE_FORIN_IN), this.t('in'), this.sep(Sep.AFTER_FORIN_FOR), right), Sep.FOR_IN_PAREN_BEFORE, Sep.FOR_IN_PAREN_AFTER), this.sep(Sep.BEFORE_FORIN_BODY), body, this.sep(Sep.AFTER_STATEMENT(node))), { endsWithMissingElse: body.endsWithMissingElse }); - } - }, { - key: 'reduceForOfStatement', - value: function reduceForOfStatement(node, _ref33) { - var left = _ref33.left, - right = _ref33.right, - body = _ref33.body; - - left = node.left.type === 'VariableDeclaration' ? noIn(markContainsIn(left)) : left; - return (0, _objectAssign2.default)(seq(this.t('for'), this.sep(Sep.AFTER_FOROF_FOR), this.paren(seq(left.startsWithLet ? this.paren(left, Sep.FOR_OF_LET_PAREN_BEFORE, Sep.FOR_OF_LET_PAREN_AFTER) : left, this.sep(Sep.BEFORE_FOROF_OF), this.t('of'), this.sep(Sep.AFTER_FOROF_FOR), this.p(node.right, coderep.Precedence.Assignment, right)), Sep.FOR_OF_PAREN_BEFORE, Sep.FOR_OF_PAREN_AFTER), this.sep(Sep.BEFORE_FOROF_BODY), body, this.sep(Sep.AFTER_STATEMENT(node))), { endsWithMissingElse: body.endsWithMissingElse }); - } - }, { - key: 'reduceForStatement', - value: function reduceForStatement(node, _ref34) { - var init = _ref34.init, - test = _ref34.test, - update = _ref34.update, - body = _ref34.body; - - if (init) { - if (init.startsWithLetSquareBracket) { - init = this.paren(init, Sep.FOR_LET_PAREN_BEFORE, Sep.FOR_LET_PAREN_AFTER); - } - init = noIn(markContainsIn(init)); - } - return (0, _objectAssign2.default)(seq(this.t('for'), this.sep(Sep.AFTER_FOR_FOR), this.paren(seq(init ? seq(this.sep(Sep.BEFORE_FOR_INIT), init, this.sep(Sep.AFTER_FOR_INIT)) : this.sep(Sep.EMPTY_FOR_INIT), this.t(';'), test ? seq(this.sep(Sep.BEFORE_FOR_TEST), test, this.sep(Sep.AFTER_FOR_TEST)) : this.sep(Sep.EMPTY_FOR_TEST), this.t(';'), update ? seq(this.sep(Sep.BEFORE_FOR_UPDATE), update, this.sep(Sep.AFTER_FOR_UPDATE)) : this.sep(Sep.EMPTY_FOR_UPDATE))), this.sep(Sep.BEFORE_FOR_BODY), body, this.sep(Sep.AFTER_STATEMENT(node))), { - endsWithMissingElse: body.endsWithMissingElse - }); - } - }, { - key: 'reduceForAwaitStatement', - value: function reduceForAwaitStatement(node, _ref35) { - var left = _ref35.left, - right = _ref35.right, - body = _ref35.body; - - left = node.left.type === 'VariableDeclaration' ? noIn(markContainsIn(left)) : left; - return (0, _objectAssign2.default)(seq(this.t('for'), this.sep(Sep.AFTER_FOROF_FOR), this.t('await'), this.sep(Sep.AFTER_FORAWAIT_AWAIT), this.paren(seq(left.startsWithLet ? this.paren(left, Sep.FOR_OF_LET_PAREN_BEFORE, Sep.FOR_OF_LET_PAREN_AFTER) : left, this.sep(Sep.BEFORE_FOROF_OF), this.t('of'), this.sep(Sep.AFTER_FOROF_FOR), this.p(node.right, coderep.Precedence.Assignment, right)), Sep.FOR_OF_PAREN_BEFORE, Sep.FOR_OF_PAREN_AFTER), this.sep(Sep.BEFORE_FOROF_BODY), body, this.sep(Sep.AFTER_STATEMENT(node))), { endsWithMissingElse: body.endsWithMissingElse }); - } - }, { - key: 'reduceFunctionBody', - value: function reduceFunctionBody(node, _ref36) { - var directives = _ref36.directives, - statements = _ref36.statements; - - if (statements.length) { - statements[0] = this.parenToAvoidBeingDirective(node.statements[0], statements[0]); - } - return seq.apply(undefined, _toConsumableArray(directives).concat([directives.length ? this.sep(Sep.AFTER_FUNCTION_DIRECTIVES) : empty()], _toConsumableArray(statements))); - } - }, { - key: 'reduceFunctionDeclaration', - value: function reduceFunctionDeclaration(node, _ref37) { - var name = _ref37.name, - params = _ref37.params, - body = _ref37.body; - - return seq(node.isAsync ? this.t('async') : empty(), this.t('function'), node.isGenerator ? seq(this.sep(Sep.BEFORE_GENERATOR_STAR), this.t('*'), this.sep(Sep.AFTER_GENERATOR_STAR)) : empty(), this.sep(Sep.BEFORE_FUNCTION_NAME(node)), node.name.name === '*default*' ? empty() : name, this.sep(Sep.BEFORE_FUNCTION_PARAMS), this.paren(params, Sep.PARAMETERS_PAREN_BEFORE, Sep.PARAMETERS_PAREN_AFTER, Sep.PARAMETERS_PAREN_EMPTY), this.sep(Sep.BEFORE_FUNCTION_DECLARATION_BODY), this.brace(body, node, Sep.FUNCTION_BRACE_INITIAL, Sep.FUNCTION_BRACE_FINAL, Sep.FUNCTION_EMPTY), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: 'reduceFunctionExpression', - value: function reduceFunctionExpression(node, _ref38) { - var name = _ref38.name, - params = _ref38.params, - body = _ref38.body; - - var state = seq(node.isAsync ? this.t('async') : empty(), this.t('function'), node.isGenerator ? seq(this.sep(Sep.BEFORE_GENERATOR_STAR), this.t('*'), this.sep(Sep.AFTER_GENERATOR_STAR)) : empty(), this.sep(Sep.BEFORE_FUNCTION_NAME(node)), name ? name : empty(), this.sep(Sep.BEFORE_FUNCTION_PARAMS), this.paren(params, Sep.PARAMETERS_PAREN_BEFORE, Sep.PARAMETERS_PAREN_AFTER, Sep.PARAMETERS_PAREN_EMPTY), this.sep(Sep.BEFORE_FUNCTION_EXPRESSION_BODY), this.brace(body, node, Sep.FUNCTION_EXPRESSION_BRACE_INITIAL, Sep.FUNCTION_EXPRESSION_BRACE_FINAL, Sep.FUNCTION_EXPRESSION_EMPTY)); - state.startsWithFunctionOrClass = true; - return state; - } - }, { - key: 'reduceFormalParameters', - value: function reduceFormalParameters(node, _ref39) { - var items = _ref39.items, - rest = _ref39.rest; - - return this.commaSep(items.concat(rest == null ? [] : [seq(this.t('...'), this.sep(Sep.REST), rest)]), Sep.PARAMETER_BEFORE_COMMA, Sep.PARAMETER_AFTER_COMMA); - } - }, { - key: 'reduceArrowExpression', - value: function reduceArrowExpression(node, _ref40) { - var params = _ref40.params, - body = _ref40.body; - - if (node.params.rest != null || node.params.items.length !== 1 || node.params.items[0].type !== 'BindingIdentifier') { - params = this.paren(params, Sep.ARROW_PARAMETERS_PAREN_BEFORE, Sep.ARROW_PARAMETERS_PAREN_AFTER, Sep.ARROW_PARAMETERS_PAREN_EMPTY); - } - var containsIn = false; - if (node.body.type === 'FunctionBody') { - body = this.brace(body, node, Sep.ARROW_BRACE_INITIAL, Sep.ARROW_BRACE_FINAL, Sep.ARROW_BRACE_EMPTY); - } else if (body.startsWithCurly) { - body = this.paren(body, Sep.ARROW_BODY_PAREN_BEFORE, Sep.ARROW_BODY_PAREN_AFTER); - } else if (body.containsIn) { - containsIn = true; - } - return (0, _objectAssign2.default)(seq(node.isAsync ? seq(this.t('async'), this.sep(Sep.BEFORE_ARROW_ASYNC_PARAMS)) : empty(), params, this.sep(Sep.BEFORE_ARROW), this.t('=>'), this.sep(Sep.AFTER_ARROW), this.p(node.body, coderep.Precedence.Assignment, body)), { containsIn: containsIn }); - } - }, { - key: 'reduceGetter', - value: function reduceGetter(node, _ref41) { - var name = _ref41.name, - body = _ref41.body; - - return seq(this.t('get'), this.sep(Sep.AFTER_GET), name, this.sep(Sep.BEFORE_GET_PARAMS), this.paren(empty(), null, null, Sep.GETTER_PARAMS), this.sep(Sep.BEFORE_GET_BODY), this.brace(body, node, Sep.GET_BRACE_INTIAL, Sep.GET_BRACE_FINAL, Sep.GET_BRACE_EMPTY)); - } - }, { - key: 'reduceIdentifierExpression', - value: function reduceIdentifierExpression(node) { - var a = this.t(node.name); - if (node.name === 'let') { - a.startsWithLet = true; - } - return a; - } - }, { - key: 'reduceIfStatement', - value: function reduceIfStatement(node, _ref42) { - var test = _ref42.test, - consequent = _ref42.consequent, - alternate = _ref42.alternate; - - if (alternate && consequent.endsWithMissingElse) { - consequent = this.brace(consequent, node, Sep.MISSING_ELSE_INTIIAL, Sep.MISSING_ELSE_FINAL, Sep.MISSING_ELSE_EMPTY); - } - return (0, _objectAssign2.default)(seq(this.t('if'), this.sep(Sep.AFTER_IF), this.paren(test, Sep.IF_PAREN_BEFORE, Sep.IF_PAREN_AFTER), this.sep(Sep.AFTER_IF_TEST), consequent, alternate ? seq(this.sep(Sep.BEFORE_ELSE), this.t('else'), this.sep(Sep.AFTER_ELSE), alternate) : empty(), this.sep(Sep.AFTER_STATEMENT(node))), { endsWithMissingElse: alternate ? alternate.endsWithMissingElse : true }); - } - }, { - key: 'reduceImport', - value: function reduceImport(node, _ref43) { - var defaultBinding = _ref43.defaultBinding, - namedImports = _ref43.namedImports; - - var bindings = []; - if (defaultBinding != null) { - bindings.push(defaultBinding); - } - if (namedImports.length > 0) { - bindings.push(this.brace(this.commaSep(namedImports, Sep.NAMED_IMPORT_BEFORE_COMMA, Sep.NAMED_IMPORT_AFTER_COMMA), node, Sep.IMPORT_BRACE_INTIAL, Sep.IMPORT_BRACE_FINAL, Sep.IMPORT_BRACE_EMPTY)); - } - if (bindings.length === 0) { - return seq(this.t('import'), this.sep(Sep.BEFORE_IMPORT_MODULE), this.t((0, coderep.escapeStringLiteral)(node.moduleSpecifier)), this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - return seq(this.t('import'), this.sep(Sep.BEFORE_IMPORT_BINDINGS), this.commaSep(bindings, Sep.IMPORT_BEFORE_COMMA, Sep.IMPORT_AFTER_COMMA), this.sep(Sep.AFTER_IMPORT_BINDINGS), this.t('from'), this.sep(Sep.AFTER_FROM), this.t((0, coderep.escapeStringLiteral)(node.moduleSpecifier)), this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: 'reduceImportNamespace', - value: function reduceImportNamespace(node, _ref44) { - var defaultBinding = _ref44.defaultBinding, - namespaceBinding = _ref44.namespaceBinding; - - return seq(this.t('import'), this.sep(Sep.BEFORE_IMPORT_NAMESPACE), defaultBinding == null ? empty() : seq(defaultBinding, this.sep(Sep.IMPORT_BEFORE_COMMA), this.t(','), this.sep(Sep.IMPORT_AFTER_COMMA)), this.sep(Sep.BEFORE_IMPORT_STAR), this.t('*'), this.sep(Sep.AFTER_IMPORT_STAR), this.t('as'), this.sep(Sep.AFTER_IMPORT_AS), namespaceBinding, this.sep(Sep.AFTER_NAMESPACE_BINDING), this.t('from'), this.sep(Sep.AFTER_FROM), this.t((0, coderep.escapeStringLiteral)(node.moduleSpecifier)), this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: 'reduceImportSpecifier', - value: function reduceImportSpecifier(node, _ref45) { - var binding = _ref45.binding; - - if (node.name == null) return binding; - return seq(this.t(node.name), this.sep(Sep.BEFORE_IMPORT_AS), this.t('as'), this.sep(Sep.AFTER_IMPORT_AS), binding); - } - }, { - key: 'reduceExportAllFrom', - value: function reduceExportAllFrom(node) { - return seq(this.t('export'), this.sep(Sep.BEFORE_EXPORT_STAR), this.t('*'), this.sep(Sep.AFTER_EXPORT_STAR), this.t('from'), this.sep(Sep.AFTER_FROM), this.t((0, coderep.escapeStringLiteral)(node.moduleSpecifier)), this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: 'reduceExportFrom', - value: function reduceExportFrom(node, _ref46) { - var namedExports = _ref46.namedExports; - - return seq(this.t('export'), this.sep(Sep.BEFORE_EXPORT_BINDINGS), this.brace(this.commaSep(namedExports, Sep.EXPORTS_BEFORE_COMMA, Sep.EXPORTS_AFTER_COMMA), node, Sep.EXPORT_BRACE_INITIAL, Sep.EXPORT_BRACE_FINAL, Sep.EXPORT_BRACE_EMPTY), this.sep(Sep.AFTER_EXPORT_FROM_BINDINGS), this.t('from'), this.sep(Sep.AFTER_FROM), this.t((0, coderep.escapeStringLiteral)(node.moduleSpecifier)), this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: 'reduceExportLocals', - value: function reduceExportLocals(node, _ref47) { - var namedExports = _ref47.namedExports; - - return seq(this.t('export'), this.sep(Sep.BEFORE_EXPORT_BINDINGS), this.brace(this.commaSep(namedExports, Sep.EXPORTS_BEFORE_COMMA, Sep.EXPORTS_AFTER_COMMA), node, Sep.EXPORT_BRACE_INITIAL, Sep.EXPORT_BRACE_FINAL, Sep.EXPORT_BRACE_EMPTY), this.sep(Sep.AFTER_EXPORT_LOCAL_BINDINGS), this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: 'reduceExport', - value: function reduceExport(node, _ref48) { - var declaration = _ref48.declaration; - - switch (node.declaration.type) { - case 'FunctionDeclaration': - case 'ClassDeclaration': - break; - default: - declaration = seq(declaration, this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - return seq(this.t('export'), this.sep(Sep.AFTER_EXPORT), declaration); - } - }, { - key: 'reduceExportDefault', - value: function reduceExportDefault(node, _ref49) { - var body = _ref49.body; - - body = body.startsWithFunctionOrClass ? this.paren(body, Sep.EXPORT_PAREN_BEFORE, Sep.EXPORT_PAREN_AFTER) : body; - switch (node.body.type) { - case 'FunctionDeclaration': - case 'ClassDeclaration': - return seq(this.t('export'), this.sep(Sep.EXPORT_DEFAULT), this.t('default'), this.sep(Sep.AFTER_EXPORT_DEFAULT), body); - default: - return seq(this.t('export'), this.sep(Sep.EXPORT_DEFAULT), this.t('default'), this.sep(Sep.AFTER_EXPORT_DEFAULT), this.p(node.body, coderep.Precedence.Assignment, body), this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - } - }, { - key: 'reduceExportFromSpecifier', - value: function reduceExportFromSpecifier(node) { - if (node.exportedName == null) return this.t(node.name); - return seq(this.t(node.name), this.sep(Sep.BEFORE_EXPORT_AS), this.t('as'), this.sep(Sep.AFTER_EXPORT_AS), this.t(node.exportedName)); - } - }, { - key: 'reduceExportLocalSpecifier', - value: function reduceExportLocalSpecifier(node, _ref50) { - var name = _ref50.name; - - if (node.exportedName == null) return name; - return seq(name, this.sep(Sep.BEFORE_EXPORT_AS), this.t('as'), this.sep(Sep.AFTER_EXPORT_AS), this.t(node.exportedName)); - } - }, { - key: 'reduceLabeledStatement', - value: function reduceLabeledStatement(node, _ref51) { - var body = _ref51.body; - - return (0, _objectAssign2.default)(seq(this.t(node.label), this.sep(Sep.BEFORE_LABEL_COLON), this.t(':'), this.sep(Sep.AFTER_LABEL_COLON), body), { endsWithMissingElse: body.endsWithMissingElse }); - } - }, { - key: 'reduceLiteralBooleanExpression', - value: function reduceLiteralBooleanExpression(node) { - return this.t(node.value.toString()); - } - }, { - key: 'reduceLiteralNullExpression', - value: function reduceLiteralNullExpression() /* node */{ - return this.t('null'); - } - }, { - key: 'reduceLiteralInfinityExpression', - value: function reduceLiteralInfinityExpression() /* node */{ - return this.t('2e308'); - } - }, { - key: 'reduceLiteralNumericExpression', - value: function reduceLiteralNumericExpression(node) { - return new coderep.NumberCodeRep(node.value); - } - }, { - key: 'reduceLiteralRegExpExpression', - value: function reduceLiteralRegExpExpression(node) { - return this.t('/' + node.pattern + '/' + (node.global ? 'g' : '') + (node.ignoreCase ? 'i' : '') + (node.multiLine ? 'm' : '') + (node.dotAll ? 's' : '') + (node.unicode ? 'u' : '') + (node.sticky ? 'y' : ''), true); - } - }, { - key: 'reduceLiteralStringExpression', - value: function reduceLiteralStringExpression(node) { - return this.t((0, coderep.escapeStringLiteral)(node.value)); - } - }, { - key: 'reduceMethod', - value: function reduceMethod(node, _ref52) { - var name = _ref52.name, - params = _ref52.params, - body = _ref52.body; - - return seq(node.isAsync ? seq(this.t('async'), this.sep(Sep.AFTER_METHOD_ASYNC)) : empty(), node.isGenerator ? seq(this.t('*'), this.sep(Sep.AFTER_METHOD_GENERATOR_STAR)) : empty(), name, this.sep(Sep.AFTER_METHOD_NAME), this.paren(params, Sep.PARAMETERS_PAREN_BEFORE, Sep.PARAMETERS_PAREN_AFTER, Sep.PARAMETERS_PAREN_EMPTY), this.sep(Sep.BEFORE_METHOD_BODY), this.brace(body, node, Sep.METHOD_BRACE_INTIAL, Sep.METHOD_BRACE_FINAL, Sep.METHOD_BRACE_EMPTY)); - } - }, { - key: 'reduceModule', - value: function reduceModule(node, _ref53) { - var directives = _ref53.directives, - items = _ref53.items; - - if (items.length) { - items[0] = this.parenToAvoidBeingDirective(node.items[0], items[0]); - } - return seq.apply(undefined, _toConsumableArray(directives).concat([directives.length ? this.sep(Sep.AFTER_MODULE_DIRECTIVES) : empty()], _toConsumableArray(items))); - } - }, { - key: 'reduceNewExpression', - value: function reduceNewExpression(node, _ref54) { - var _this7 = this; - - var callee = _ref54.callee, - args = _ref54.arguments; - - var parenthizedArgs = args.map(function (a, i) { - return _this7.p(node.arguments[i], coderep.Precedence.Assignment, a); - }); - var calleeRep = (0, coderep.getPrecedence)(node.callee) === coderep.Precedence.Call ? this.paren(callee, Sep.NEW_CALLEE_PAREN_BEFORE, Sep.NEW_CALLEE_PAREN_AFTER) : this.p(node.callee, (0, coderep.getPrecedence)(node), callee); - return seq(this.t('new'), this.sep(Sep.AFTER_NEW), calleeRep, args.length === 0 ? this.sep(Sep.EMPTY_NEW_CALL) : seq(this.sep(Sep.BEFORE_NEW_ARGS), this.paren(this.commaSep(parenthizedArgs, Sep.ARGS_BEFORE_COMMA, Sep.ARGS_AFTER_COMMA), Sep.NEW_PAREN_BEFORE, Sep.NEW_PAREN_AFTER, Sep.NEW_PAREN_EMPTY))); - } - }, { - key: 'reduceNewTargetExpression', - value: function reduceNewTargetExpression() { - return seq(this.t('new'), this.sep(Sep.NEW_TARGET_BEFORE_DOT), this.t('.'), this.sep(Sep.NEW_TARGET_AFTER_DOT), this.t('target')); - } - }, { - key: 'reduceObjectExpression', - value: function reduceObjectExpression(node, _ref55) { - var properties = _ref55.properties; - - var state = this.brace(this.commaSep(properties, Sep.OBJECT_BEFORE_COMMA, Sep.OBJECT_AFTER_COMMA), node, Sep.OBJECT_BRACE_INITIAL, Sep.OBJECT_BRACE_FINAL, Sep.OBJECT_EMPTY); - state.startsWithCurly = true; - return state; - } - }, { - key: 'reduceUpdateExpression', - value: function reduceUpdateExpression(node, _ref56) { - var operand = _ref56.operand; - - if (node.isPrefix) { - return this.reduceUnaryExpression.apply(this, arguments); - } - return (0, _objectAssign2.default)(seq(this.p(node.operand, coderep.Precedence.New, operand), this.sep(Sep.BEFORE_POSTFIX(node.operator)), this.t(node.operator)), { - startsWithCurly: operand.startsWithCurly, - startsWithLetSquareBracket: operand.startsWithLetSquareBracket, - startsWithFunctionOrClass: operand.startsWithFunctionOrClass - }); - } - }, { - key: 'reduceUnaryExpression', - value: function reduceUnaryExpression(node, _ref57) { - var operand = _ref57.operand; - - return seq(this.t(node.operator), this.sep(Sep.UNARY(node.operator)), this.p(node.operand, (0, coderep.getPrecedence)(node), operand)); - } - }, { - key: 'reduceReturnStatement', - value: function reduceReturnStatement(node, _ref58) { - var expression = _ref58.expression; - - return seq(this.t('return'), expression ? seq(this.sep(Sep.RETURN), expression) : empty(), this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: 'reduceScript', - value: function reduceScript(node, _ref59) { - var directives = _ref59.directives, - statements = _ref59.statements; - - if (statements.length) { - statements[0] = this.parenToAvoidBeingDirective(node.statements[0], statements[0]); - } - return seq.apply(undefined, _toConsumableArray(directives).concat([directives.length ? this.sep(Sep.AFTER_SCRIPT_DIRECTIVES) : empty()], _toConsumableArray(statements))); - } - }, { - key: 'reduceSetter', - value: function reduceSetter(node, _ref60) { - var name = _ref60.name, - param = _ref60.param, - body = _ref60.body; - - return seq(this.t('set'), this.sep(Sep.AFTER_SET), name, this.sep(Sep.BEFORE_SET_PARAMS), this.paren(param, Sep.SETTER_PARAM_BEFORE, Sep.SETTER_PARAM_AFTER), this.sep(Sep.BEFORE_SET_BODY), this.brace(body, node, Sep.SET_BRACE_INTIIAL, Sep.SET_BRACE_FINAL, Sep.SET_BRACE_EMPTY)); - } - }, { - key: 'reduceShorthandProperty', - value: function reduceShorthandProperty(node, _ref61) { - var name = _ref61.name; - - return name; - } - }, { - key: 'reduceStaticMemberAssignmentTarget', - value: function reduceStaticMemberAssignmentTarget(node, _ref62) { - var object = _ref62.object; - - var state = seq(this.p(node.object, (0, coderep.getPrecedence)(node), object), this.sep(Sep.BEFORE_STATIC_MEMBER_ASSIGNMENT_TARGET_DOT), this.t('.'), this.sep(Sep.AFTER_STATIC_MEMBER_ASSIGNMENT_TARGET_DOT), this.t(node.property)); - state.startsWithLet = object.startsWithLet; - state.startsWithCurly = object.startsWithCurly; - state.startsWithLetSquareBracket = object.startsWithLetSquareBracket; - state.startsWithFunctionOrClass = object.startsWithFunctionOrClass; - return state; - } - }, { - key: 'reduceStaticMemberExpression', - value: function reduceStaticMemberExpression(node, _ref63) { - var object = _ref63.object; - - var state = seq(this.p(node.object, (0, coderep.getPrecedence)(node), object), this.sep(Sep.BEFORE_STATIC_MEMBER_DOT), this.t('.'), this.sep(Sep.AFTER_STATIC_MEMBER_DOT), this.t(node.property)); - state.startsWithLet = object.startsWithLet; - state.startsWithCurly = object.startsWithCurly; - state.startsWithLetSquareBracket = object.startsWithLetSquareBracket; - state.startsWithFunctionOrClass = object.startsWithFunctionOrClass; - return state; - } - }, { - key: 'reduceStaticPropertyName', - value: function reduceStaticPropertyName(node) { - if (utils.keyword.isIdentifierNameES6(node.value)) { - return this.t(node.value); - } - var n = parseFloat(node.value); - if (n >= 0 && n.toString() === node.value) { - return new coderep.NumberCodeRep(n); - } - return this.t((0, coderep.escapeStringLiteral)(node.value)); - } - }, { - key: 'reduceSuper', - value: function reduceSuper() { - return this.t('super'); - } - }, { - key: 'reduceSwitchCase', - value: function reduceSwitchCase(node, _ref64) { - var test = _ref64.test, - consequent = _ref64.consequent; - - return seq(this.t('case'), this.sep(Sep.BEFORE_CASE_TEST), test, this.sep(Sep.AFTER_CASE_TEST), this.t(':'), this.sep(Sep.BEFORE_CASE_BODY), seq.apply(undefined, _toConsumableArray(consequent)), this.sep(Sep.AFTER_CASE_BODY)); - } - }, { - key: 'reduceSwitchDefault', - value: function reduceSwitchDefault(node, _ref65) { - var consequent = _ref65.consequent; - - return seq(this.t('default'), this.sep(Sep.DEFAULT), this.t(':'), this.sep(Sep.BEFORE_CASE_BODY), seq.apply(undefined, _toConsumableArray(consequent)), this.sep(Sep.AFTER_DEFAULT_BODY)); - } - }, { - key: 'reduceSwitchStatement', - value: function reduceSwitchStatement(node, _ref66) { - var discriminant = _ref66.discriminant, - cases = _ref66.cases; - - return seq(this.t('switch'), this.sep(Sep.BEFORE_SWITCH_DISCRIM), this.paren(discriminant, Sep.SWITCH_DISCRIM_PAREN_BEFORE, Sep.SWITCH_DISCRIM_PAREN_AFTER), this.sep(Sep.BEFORE_SWITCH_BODY), this.brace(seq.apply(undefined, _toConsumableArray(cases)), node, Sep.SWITCH_BRACE_INTIAL, Sep.SWITCH_BRACE_FINAL, Sep.SWITCH_BRACE_EMPTY), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: 'reduceSwitchStatementWithDefault', - value: function reduceSwitchStatementWithDefault(node, _ref67) { - var discriminant = _ref67.discriminant, - preDefaultCases = _ref67.preDefaultCases, - defaultCase = _ref67.defaultCase, - postDefaultCases = _ref67.postDefaultCases; - - return seq(this.t('switch'), this.sep(Sep.BEFORE_SWITCH_DISCRIM), this.paren(discriminant, Sep.SWITCH_DISCRIM_PAREN_BEFORE, Sep.SWITCH_DISCRIM_PAREN_AFTER), this.sep(Sep.BEFORE_SWITCH_BODY), this.brace(seq.apply(undefined, _toConsumableArray(preDefaultCases).concat([defaultCase], _toConsumableArray(postDefaultCases))), node, Sep.SWITCH_BRACE_INTIAL, Sep.SWITCH_BRACE_FINAL, Sep.SWITCH_BRACE_EMPTY), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: 'reduceTemplateExpression', - value: function reduceTemplateExpression(node, _ref68) { - var tag = _ref68.tag, - elements = _ref68.elements; - - var state = node.tag == null ? empty() : seq(this.p(node.tag, (0, coderep.getPrecedence)(node), tag), this.sep(Sep.TEMPLATE_TAG)); - state = seq(state, this.t('`')); - for (var _i = 0, l = node.elements.length; _i < l; ++_i) { - if (node.elements[_i].type === 'TemplateElement') { - var d = ''; - if (_i > 0) d += '}'; - d += node.elements[_i].rawValue; - if (_i < l - 1) d += '${'; - state = seq(state, this.t(d)); - } else { - state = seq(state, this.sep(Sep.BEFORE_TEMPLATE_EXPRESSION), elements[_i], this.sep(Sep.AFTER_TEMPLATE_EXPRESSION)); - } - } - state = seq(state, this.t('`')); - if (node.tag != null) { - state.startsWithCurly = tag.startsWithCurly; - state.startsWithLet = tag.startsWithLet; - state.startsWithLetSquareBracket = tag.startsWithLetSquareBracket; - state.startsWithFunctionOrClass = tag.startsWithFunctionOrClass; - } - return state; - } - }, { - key: 'reduceTemplateElement', - value: function reduceTemplateElement(node) { - return this.t(node.rawValue); - } - }, { - key: 'reduceThisExpression', - value: function reduceThisExpression() /* node */{ - return this.t('this'); - } - }, { - key: 'reduceThrowStatement', - value: function reduceThrowStatement(node, _ref69) { - var expression = _ref69.expression; - - return seq(this.t('throw'), this.sep(Sep.THROW), expression, this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: 'reduceTryCatchStatement', - value: function reduceTryCatchStatement(node, _ref70) { - var body = _ref70.body, - catchClause = _ref70.catchClause; - - return seq(this.t('try'), this.sep(Sep.AFTER_TRY), body, this.sep(Sep.BEFORE_CATCH), catchClause, this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: 'reduceTryFinallyStatement', - value: function reduceTryFinallyStatement(node, _ref71) { - var body = _ref71.body, - catchClause = _ref71.catchClause, - finalizer = _ref71.finalizer; - - return seq(this.t('try'), this.sep(Sep.AFTER_TRY), body, catchClause ? seq(this.sep(Sep.BEFORE_CATCH), catchClause) : empty(), this.sep(Sep.BEFORE_FINALLY), this.t('finally'), this.sep(Sep.AFTER_FINALLY), finalizer, this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: 'reduceYieldExpression', - value: function reduceYieldExpression(node, _ref72) { - var expression = _ref72.expression; - - if (node.expression == null) return this.t('yield'); - return (0, _objectAssign2.default)(seq(this.t('yield'), this.sep(Sep.YIELD), this.p(node.expression, (0, coderep.getPrecedence)(node), expression)), { containsIn: expression.containsIn }); - } - }, { - key: 'reduceYieldGeneratorExpression', - value: function reduceYieldGeneratorExpression(node, _ref73) { - var expression = _ref73.expression; - - return (0, _objectAssign2.default)(seq(this.t('yield'), this.sep(Sep.BEFORE_YIELD_STAR), this.t('*'), this.sep(Sep.AFTER_YIELD_STAR), this.p(node.expression, (0, coderep.getPrecedence)(node), expression)), { containsIn: expression.containsIn }); - } - }, { - key: 'reduceDirective', - value: function reduceDirective(node) { - var delim = node.rawValue.match(/(^|[^\\])(\\\\)*"/) ? '\'' : '"'; - return seq(this.t(delim + node.rawValue + delim), this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: 'reduceVariableDeclaration', - value: function reduceVariableDeclaration(node, _ref74) { - var declarators = _ref74.declarators; - - return seq(this.t(node.kind), this.sep(Sep.VARIABLE_DECLARATION), this.commaSep(declarators, Sep.DECLARATORS_BEFORE_COMMA, Sep.DECLARATORS_AFTER_COMMA)); - } - }, { - key: 'reduceVariableDeclarationStatement', - value: function reduceVariableDeclarationStatement(node, _ref75) { - var declaration = _ref75.declaration; - - return seq(declaration, this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: 'reduceVariableDeclarator', - value: function reduceVariableDeclarator(node, _ref76) { - var binding = _ref76.binding, - init = _ref76.init; - - var containsIn = init && init.containsIn && !init.containsGroup; - if (init) { - if (init.containsGroup) { - init = this.paren(init, Sep.EXPRESSION_PAREN_BEFORE, Sep.EXPRESSION_PAREN_AFTER); - } else { - init = markContainsIn(init); - } - } - return (0, _objectAssign2.default)(init == null ? binding : seq(binding, this.sep(Sep.BEFORE_INIT_EQUALS), this.t('='), this.sep(Sep.AFTER_INIT_EQUALS), init), { containsIn: containsIn }); - } - }, { - key: 'reduceWhileStatement', - value: function reduceWhileStatement(node, _ref77) { - var test = _ref77.test, - body = _ref77.body; - - return (0, _objectAssign2.default)(seq(this.t('while'), this.sep(Sep.AFTER_WHILE), this.paren(test, Sep.WHILE_TEST_PAREN_BEFORE, Sep.WHILE_TEST_PAREN_AFTER), this.sep(Sep.BEFORE_WHILE_BODY), body, this.sep(Sep.AFTER_STATEMENT(node))), { endsWithMissingElse: body.endsWithMissingElse }); - } - }, { - key: 'reduceWithStatement', - value: function reduceWithStatement(node, _ref78) { - var object = _ref78.object, - body = _ref78.body; - - return (0, _objectAssign2.default)(seq(this.t('with'), this.sep(Sep.AFTER_WITH), this.paren(object, Sep.WITH_PAREN_BEFORE, Sep.WITH_PAREN_AFTER), this.sep(Sep.BEFORE_WITH_BODY), body, this.sep(Sep.AFTER_STATEMENT(node))), { endsWithMissingElse: body.endsWithMissingElse }); - } - }]); - - return ExtensibleCodeGen; -}(); - -function withoutTrailingLinebreak(state) { - if (state && state instanceof coderep.Seq) { - var lastChild = state.children[state.children.length - 1]; - /* istanbul ignore next */ - while (lastChild instanceof coderep.Empty) { - state.children.pop(); - lastChild = state.children[state.children.length - 1]; - } - /* istanbul ignore else */ - if (lastChild instanceof coderep.Seq) { - withoutTrailingLinebreak(lastChild); - } else if (lastChild instanceof Linebreak) { - state.children.pop(); - } - } - return state; -} - -function indent(rep, includingFinal) { - var finalLinebreak = void 0; - function indentNode(node) { - if (node instanceof Linebreak) { - finalLinebreak = node; - ++node.indentation; - } - } - rep.forEach(indentNode); - if (!includingFinal) { - --finalLinebreak.indentation; - } - return rep; -} - -var FormattedCodeGen = exports.FormattedCodeGen = function (_ExtensibleCodeGen) { - _inherits(FormattedCodeGen, _ExtensibleCodeGen); - - function FormattedCodeGen() { - _classCallCheck(this, FormattedCodeGen); - - return _possibleConstructorReturn(this, (FormattedCodeGen.__proto__ || Object.getPrototypeOf(FormattedCodeGen)).apply(this, arguments)); - } - - _createClass(FormattedCodeGen, [{ - key: 'parenToAvoidBeingDirective', - value: function parenToAvoidBeingDirective(element, original) { - if (element && element.type === 'ExpressionStatement' && element.expression.type === 'LiteralStringExpression') { - return seq(this.paren(original.children[0], Sep.PAREN_AVOIDING_DIRECTIVE_BEFORE, Sep.PAREN_AVOIDING_DIRECTIVE_AFTER), this.semiOp(), this.sep(Sep.AFTER_STATEMENT(element))); - } - return original; - } - }, { - key: 'brace', - value: function brace(rep, node) { - if (isEmpty(rep)) { - return this.t('{}'); - } - - switch (node.type) { - case 'ObjectAssignmentTarget': - case 'ObjectBinding': - case 'Import': - case 'ExportFrom': - case 'ExportLocals': - case 'ObjectExpression': - return new coderep.Brace(rep); - } - - rep = seq(new Linebreak(), rep); - indent(rep, false); - return new coderep.Brace(rep); - } - }, { - key: 'reduceDoWhileStatement', - value: function reduceDoWhileStatement(node, _ref79) { - var body = _ref79.body, - test = _ref79.test; - - return seq(this.t('do'), this.sep(Sep.AFTER_DO), withoutTrailingLinebreak(body), this.sep(Sep.BEFORE_DOWHILE_WHILE), this.t('while'), this.sep(Sep.AFTER_DOWHILE_WHILE), this.paren(test, Sep.DO_WHILE_TEST_PAREN_BEFORE, Sep.DO_WHILE_TEST_PAREN_AFTER), this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: 'reduceIfStatement', - value: function reduceIfStatement(node, _ref80) { - var test = _ref80.test, - consequent = _ref80.consequent, - alternate = _ref80.alternate; - - if (alternate && consequent.endsWithMissingElse) { - consequent = this.brace(consequent, node); - } - return (0, _objectAssign2.default)(seq(this.t('if'), this.sep(Sep.AFTER_IF), this.paren(test, Sep.IF_PAREN_BEFORE, Sep.IF_PAREN_AFTER), this.sep(Sep.AFTER_IF_TEST), withoutTrailingLinebreak(consequent), alternate ? seq(this.sep(Sep.BEFORE_ELSE), this.t('else'), this.sep(Sep.AFTER_ELSE), withoutTrailingLinebreak(alternate)) : empty(), this.sep(Sep.AFTER_STATEMENT(node))), { endsWithMissingElse: alternate ? alternate.endsWithMissingElse : true }); - } - }, { - key: 'reduceSwitchCase', - value: function reduceSwitchCase(node, _ref81) { - var test = _ref81.test, - consequent = _ref81.consequent; - - consequent = indent(withoutTrailingLinebreak(seq.apply(undefined, [this.sep(Sep.BEFORE_CASE_BODY)].concat(_toConsumableArray(consequent)))), true); - return seq(this.t('case'), this.sep(Sep.BEFORE_CASE_TEST), test, this.sep(Sep.AFTER_CASE_TEST), this.t(':'), consequent, this.sep(Sep.AFTER_CASE_BODY)); - } - }, { - key: 'reduceSwitchDefault', - value: function reduceSwitchDefault(node, _ref82) { - var consequent = _ref82.consequent; - - consequent = indent(withoutTrailingLinebreak(seq.apply(undefined, [this.sep(Sep.BEFORE_CASE_BODY)].concat(_toConsumableArray(consequent)))), true); - return seq(this.t('default'), this.sep(Sep.DEFAULT), this.t(':'), consequent, this.sep(Sep.AFTER_DEFAULT_BODY)); - } - }, { - key: 'sep', - value: function sep(separator) { - switch (separator.type) { - case 'AWAIT': - case 'AFTER_FORAWAIT_AWAIT': - case 'ARRAY_AFTER_COMMA': - case 'OBJECT_AFTER_COMMA': - case 'ARGS_AFTER_COMMA': - case 'PARAMETER_AFTER_COMMA': - case 'DECLARATORS_AFTER_COMMA': - case 'NAMED_IMPORT_AFTER_COMMA': - case 'IMPORT_AFTER_COMMA': - case 'BEFORE_DEFAULT_EQUALS': - case 'AFTER_DEFAULT_EQUALS': - case 'AFTER_PROP': - case 'BEFORE_JUMP_LABEL': - case 'BEFORE_CATCH_BINDING': - case 'AFTER_CATCH_BINDING': - case 'BEFORE_CLASS_NAME': - case 'BEFORE_EXTENDS': - case 'AFTER_EXTENDS': - case 'BEFORE_CLASS_DECLARATION_ELEMENTS': - case 'BEFORE_CLASS_EXPRESSION_ELEMENTS': - case 'AFTER_STATIC': - case 'BEFORE_TERNARY_QUESTION': - case 'AFTER_TERNARY_QUESTION': - case 'BEFORE_TERNARY_COLON': - case 'AFTER_TERNARY_COLON': - case 'AFTER_DO': - case 'BEFORE_DOWHILE_WHILE': - case 'AFTER_DOWHILE_WHILE': - case 'AFTER_FORIN_FOR': - case 'BEFORE_FORIN_IN': - case 'BEFORE_FORIN_BODY': - case 'BEFORE_FOROF_OF': - case 'AFTER_FOROF_FOR': - case 'BEFORE_FOROF_BODY': - case 'AFTER_FOR_FOR': - case 'BEFORE_FOR_TEST': - case 'BEFORE_FOR_UPDATE': - case 'BEFORE_FOR_BODY': - case 'BEFORE_FUNCTION_DECLARATION_BODY': - case 'BEFORE_FUNCTION_EXPRESSION_BODY': - case 'BEFORE_ARROW': - case 'AFTER_ARROW': - case 'BEFORE_ARROW_ASYNC_PARAMS': - case 'AFTER_GET': - case 'BEFORE_GET_BODY': - case 'AFTER_IF': - case 'AFTER_IF_TEST': - case 'BEFORE_ELSE': - case 'AFTER_ELSE': - case 'BEFORE_IMPORT_BINDINGS': - case 'BEFORE_IMPORT_MODULE': - case 'AFTER_IMPORT_BINDINGS': - case 'AFTER_FROM': - case 'BEFORE_IMPORT_NAMESPACE': - case 'BEFORE_IMPORT_STAR': - case 'AFTER_IMPORT_STAR': - case 'AFTER_NAMESPACE_BINDING': - case 'BEFORE_IMPORT_AS': - case 'AFTER_IMPORT_AS': - case 'EXPORTS_AFTER_COMMA': - case 'BEFORE_EXPORT_STAR': - case 'AFTER_EXPORT_STAR': - case 'BEFORE_EXPORT_BINDINGS': - case 'AFTER_EXPORT_FROM_BINDINGS': - case 'AFTER_EXPORT': - case 'AFTER_EXPORT_DEFAULT': - case 'BEFORE_EXPORT_AS': - case 'AFTER_EXPORT_AS': - case 'AFTER_LABEL_COLON': - case 'AFTER_METHOD_ASYNC': - case 'BEFORE_METHOD_BODY': - case 'AFTER_NEW': - case 'RETURN': - case 'AFTER_SET': - case 'BEFORE_SET_BODY': - case 'BEFORE_SET_PARAMS': - case 'BEFORE_CASE_TEST': - case 'BEFORE_SWITCH_DISCRIM': - case 'BEFORE_SWITCH_BODY': - case 'THROW': - case 'AFTER_TRY': - case 'BEFORE_CATCH': - case 'BEFORE_FINALLY': - case 'AFTER_FINALLY': - case 'VARIABLE_DECLARATION': - case 'YIELD': - case 'AFTER_YIELD_STAR': - case 'BEFORE_INIT_EQUALS': - case 'AFTER_INIT_EQUALS': - case 'AFTER_WHILE': - case 'BEFORE_WHILE_BODY': - case 'AFTER_WITH': - case 'BEFORE_WITH_BODY': - case 'BEFORE_FUNCTION_NAME': - case 'AFTER_BINOP': - case 'BEFORE_ASSIGN_OP': - case 'AFTER_ASSIGN_OP': - return this.t(' '); - case 'AFTER_STATEMENT': - switch (separator.node.type) { - case 'ForInStatement': - case 'ForOfStatement': - case 'ForStatement': - case 'WhileStatement': - case 'WithStatement': - return empty(); // because those already end with an AFTER_STATEMENT - default: - return new Linebreak(); - } - case 'AFTER_CLASS_ELEMENT': - case 'BEFORE_CASE_BODY': - case 'AFTER_CASE_BODY': - case 'AFTER_DEFAULT_BODY': - return new Linebreak(); - case 'BEFORE_BINOP': - return separator.op === ',' ? empty() : this.t(' '); - case 'UNARY': - return separator.op === 'delete' || separator.op === 'void' || separator.op === 'typeof' ? this.t(' ') : empty(); - default: - return empty(); - } - } - }]); - - return FormattedCodeGen; -}(ExtensibleCodeGen); -}); - -var director_1 = createCommonjsModule(function (module, exports) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.reduce = reduce; -// Generated by generate-director.js -/** - * Copyright 2018 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -var director = { - ArrayAssignmentTarget: function ArrayAssignmentTarget(reducer, node) { - var _this = this; - - return reducer.reduceArrayAssignmentTarget(node, { elements: node.elements.map(function (v) { - return v && _this[v.type](reducer, v); - }), rest: node.rest && this[node.rest.type](reducer, node.rest) }); - }, - ArrayBinding: function ArrayBinding(reducer, node) { - var _this2 = this; - - return reducer.reduceArrayBinding(node, { elements: node.elements.map(function (v) { - return v && _this2[v.type](reducer, v); - }), rest: node.rest && this[node.rest.type](reducer, node.rest) }); - }, - ArrayExpression: function ArrayExpression(reducer, node) { - var _this3 = this; - - return reducer.reduceArrayExpression(node, { elements: node.elements.map(function (v) { - return v && _this3[v.type](reducer, v); - }) }); - }, - ArrowExpression: function ArrowExpression(reducer, node) { - return reducer.reduceArrowExpression(node, { params: this.FormalParameters(reducer, node.params), body: this[node.body.type](reducer, node.body) }); - }, - AssignmentExpression: function AssignmentExpression(reducer, node) { - return reducer.reduceAssignmentExpression(node, { binding: this[node.binding.type](reducer, node.binding), expression: this[node.expression.type](reducer, node.expression) }); - }, - AssignmentTargetIdentifier: function AssignmentTargetIdentifier(reducer, node) { - return reducer.reduceAssignmentTargetIdentifier(node); - }, - AssignmentTargetPropertyIdentifier: function AssignmentTargetPropertyIdentifier(reducer, node) { - return reducer.reduceAssignmentTargetPropertyIdentifier(node, { binding: this.AssignmentTargetIdentifier(reducer, node.binding), init: node.init && this[node.init.type](reducer, node.init) }); - }, - AssignmentTargetPropertyProperty: function AssignmentTargetPropertyProperty(reducer, node) { - return reducer.reduceAssignmentTargetPropertyProperty(node, { name: this[node.name.type](reducer, node.name), binding: this[node.binding.type](reducer, node.binding) }); - }, - AssignmentTargetWithDefault: function AssignmentTargetWithDefault(reducer, node) { - return reducer.reduceAssignmentTargetWithDefault(node, { binding: this[node.binding.type](reducer, node.binding), init: this[node.init.type](reducer, node.init) }); - }, - AwaitExpression: function AwaitExpression(reducer, node) { - return reducer.reduceAwaitExpression(node, { expression: this[node.expression.type](reducer, node.expression) }); - }, - BinaryExpression: function BinaryExpression(reducer, node) { - return reducer.reduceBinaryExpression(node, { left: this[node.left.type](reducer, node.left), right: this[node.right.type](reducer, node.right) }); - }, - BindingIdentifier: function BindingIdentifier(reducer, node) { - return reducer.reduceBindingIdentifier(node); - }, - BindingPropertyIdentifier: function BindingPropertyIdentifier(reducer, node) { - return reducer.reduceBindingPropertyIdentifier(node, { binding: this.BindingIdentifier(reducer, node.binding), init: node.init && this[node.init.type](reducer, node.init) }); - }, - BindingPropertyProperty: function BindingPropertyProperty(reducer, node) { - return reducer.reduceBindingPropertyProperty(node, { name: this[node.name.type](reducer, node.name), binding: this[node.binding.type](reducer, node.binding) }); - }, - BindingWithDefault: function BindingWithDefault(reducer, node) { - return reducer.reduceBindingWithDefault(node, { binding: this[node.binding.type](reducer, node.binding), init: this[node.init.type](reducer, node.init) }); - }, - Block: function Block(reducer, node) { - var _this4 = this; - - return reducer.reduceBlock(node, { statements: node.statements.map(function (v) { - return _this4[v.type](reducer, v); - }) }); - }, - BlockStatement: function BlockStatement(reducer, node) { - return reducer.reduceBlockStatement(node, { block: this.Block(reducer, node.block) }); - }, - BreakStatement: function BreakStatement(reducer, node) { - return reducer.reduceBreakStatement(node); - }, - CallExpression: function CallExpression(reducer, node) { - var _this5 = this; - - return reducer.reduceCallExpression(node, { callee: this[node.callee.type](reducer, node.callee), arguments: node.arguments.map(function (v) { - return _this5[v.type](reducer, v); - }) }); - }, - CatchClause: function CatchClause(reducer, node) { - return reducer.reduceCatchClause(node, { binding: this[node.binding.type](reducer, node.binding), body: this.Block(reducer, node.body) }); - }, - ClassDeclaration: function ClassDeclaration(reducer, node) { - var _this6 = this; - - return reducer.reduceClassDeclaration(node, { name: this.BindingIdentifier(reducer, node.name), super: node.super && this[node.super.type](reducer, node.super), elements: node.elements.map(function (v) { - return _this6.ClassElement(reducer, v); - }) }); - }, - ClassElement: function ClassElement(reducer, node) { - return reducer.reduceClassElement(node, { method: this[node.method.type](reducer, node.method) }); - }, - ClassExpression: function ClassExpression(reducer, node) { - var _this7 = this; - - return reducer.reduceClassExpression(node, { name: node.name && this.BindingIdentifier(reducer, node.name), super: node.super && this[node.super.type](reducer, node.super), elements: node.elements.map(function (v) { - return _this7.ClassElement(reducer, v); - }) }); - }, - CompoundAssignmentExpression: function CompoundAssignmentExpression(reducer, node) { - return reducer.reduceCompoundAssignmentExpression(node, { binding: this[node.binding.type](reducer, node.binding), expression: this[node.expression.type](reducer, node.expression) }); - }, - ComputedMemberAssignmentTarget: function ComputedMemberAssignmentTarget(reducer, node) { - return reducer.reduceComputedMemberAssignmentTarget(node, { object: this[node.object.type](reducer, node.object), expression: this[node.expression.type](reducer, node.expression) }); - }, - ComputedMemberExpression: function ComputedMemberExpression(reducer, node) { - return reducer.reduceComputedMemberExpression(node, { object: this[node.object.type](reducer, node.object), expression: this[node.expression.type](reducer, node.expression) }); - }, - ComputedPropertyName: function ComputedPropertyName(reducer, node) { - return reducer.reduceComputedPropertyName(node, { expression: this[node.expression.type](reducer, node.expression) }); - }, - ConditionalExpression: function ConditionalExpression(reducer, node) { - return reducer.reduceConditionalExpression(node, { test: this[node.test.type](reducer, node.test), consequent: this[node.consequent.type](reducer, node.consequent), alternate: this[node.alternate.type](reducer, node.alternate) }); - }, - ContinueStatement: function ContinueStatement(reducer, node) { - return reducer.reduceContinueStatement(node); - }, - DataProperty: function DataProperty(reducer, node) { - return reducer.reduceDataProperty(node, { name: this[node.name.type](reducer, node.name), expression: this[node.expression.type](reducer, node.expression) }); - }, - DebuggerStatement: function DebuggerStatement(reducer, node) { - return reducer.reduceDebuggerStatement(node); - }, - Directive: function Directive(reducer, node) { - return reducer.reduceDirective(node); - }, - DoWhileStatement: function DoWhileStatement(reducer, node) { - return reducer.reduceDoWhileStatement(node, { body: this[node.body.type](reducer, node.body), test: this[node.test.type](reducer, node.test) }); - }, - EmptyStatement: function EmptyStatement(reducer, node) { - return reducer.reduceEmptyStatement(node); - }, - Export: function Export(reducer, node) { - return reducer.reduceExport(node, { declaration: this[node.declaration.type](reducer, node.declaration) }); - }, - ExportAllFrom: function ExportAllFrom(reducer, node) { - return reducer.reduceExportAllFrom(node); - }, - ExportDefault: function ExportDefault(reducer, node) { - return reducer.reduceExportDefault(node, { body: this[node.body.type](reducer, node.body) }); - }, - ExportFrom: function ExportFrom(reducer, node) { - var _this8 = this; - - return reducer.reduceExportFrom(node, { namedExports: node.namedExports.map(function (v) { - return _this8.ExportFromSpecifier(reducer, v); - }) }); - }, - ExportFromSpecifier: function ExportFromSpecifier(reducer, node) { - return reducer.reduceExportFromSpecifier(node); - }, - ExportLocalSpecifier: function ExportLocalSpecifier(reducer, node) { - return reducer.reduceExportLocalSpecifier(node, { name: this.IdentifierExpression(reducer, node.name) }); - }, - ExportLocals: function ExportLocals(reducer, node) { - var _this9 = this; - - return reducer.reduceExportLocals(node, { namedExports: node.namedExports.map(function (v) { - return _this9.ExportLocalSpecifier(reducer, v); - }) }); - }, - ExpressionStatement: function ExpressionStatement(reducer, node) { - return reducer.reduceExpressionStatement(node, { expression: this[node.expression.type](reducer, node.expression) }); - }, - ForAwaitStatement: function ForAwaitStatement(reducer, node) { - return reducer.reduceForAwaitStatement(node, { left: this[node.left.type](reducer, node.left), right: this[node.right.type](reducer, node.right), body: this[node.body.type](reducer, node.body) }); - }, - ForInStatement: function ForInStatement(reducer, node) { - return reducer.reduceForInStatement(node, { left: this[node.left.type](reducer, node.left), right: this[node.right.type](reducer, node.right), body: this[node.body.type](reducer, node.body) }); - }, - ForOfStatement: function ForOfStatement(reducer, node) { - return reducer.reduceForOfStatement(node, { left: this[node.left.type](reducer, node.left), right: this[node.right.type](reducer, node.right), body: this[node.body.type](reducer, node.body) }); - }, - ForStatement: function ForStatement(reducer, node) { - return reducer.reduceForStatement(node, { init: node.init && this[node.init.type](reducer, node.init), test: node.test && this[node.test.type](reducer, node.test), update: node.update && this[node.update.type](reducer, node.update), body: this[node.body.type](reducer, node.body) }); - }, - FormalParameters: function FormalParameters(reducer, node) { - var _this10 = this; - - return reducer.reduceFormalParameters(node, { items: node.items.map(function (v) { - return _this10[v.type](reducer, v); - }), rest: node.rest && this[node.rest.type](reducer, node.rest) }); - }, - FunctionBody: function FunctionBody(reducer, node) { - var _this11 = this; - - return reducer.reduceFunctionBody(node, { directives: node.directives.map(function (v) { - return _this11.Directive(reducer, v); - }), statements: node.statements.map(function (v) { - return _this11[v.type](reducer, v); - }) }); - }, - FunctionDeclaration: function FunctionDeclaration(reducer, node) { - return reducer.reduceFunctionDeclaration(node, { name: this.BindingIdentifier(reducer, node.name), params: this.FormalParameters(reducer, node.params), body: this.FunctionBody(reducer, node.body) }); - }, - FunctionExpression: function FunctionExpression(reducer, node) { - return reducer.reduceFunctionExpression(node, { name: node.name && this.BindingIdentifier(reducer, node.name), params: this.FormalParameters(reducer, node.params), body: this.FunctionBody(reducer, node.body) }); - }, - Getter: function Getter(reducer, node) { - return reducer.reduceGetter(node, { name: this[node.name.type](reducer, node.name), body: this.FunctionBody(reducer, node.body) }); - }, - IdentifierExpression: function IdentifierExpression(reducer, node) { - return reducer.reduceIdentifierExpression(node); - }, - IfStatement: function IfStatement(reducer, node) { - return reducer.reduceIfStatement(node, { test: this[node.test.type](reducer, node.test), consequent: this[node.consequent.type](reducer, node.consequent), alternate: node.alternate && this[node.alternate.type](reducer, node.alternate) }); - }, - Import: function Import(reducer, node) { - var _this12 = this; - - return reducer.reduceImport(node, { defaultBinding: node.defaultBinding && this.BindingIdentifier(reducer, node.defaultBinding), namedImports: node.namedImports.map(function (v) { - return _this12.ImportSpecifier(reducer, v); - }) }); - }, - ImportNamespace: function ImportNamespace(reducer, node) { - return reducer.reduceImportNamespace(node, { defaultBinding: node.defaultBinding && this.BindingIdentifier(reducer, node.defaultBinding), namespaceBinding: this.BindingIdentifier(reducer, node.namespaceBinding) }); - }, - ImportSpecifier: function ImportSpecifier(reducer, node) { - return reducer.reduceImportSpecifier(node, { binding: this.BindingIdentifier(reducer, node.binding) }); - }, - LabeledStatement: function LabeledStatement(reducer, node) { - return reducer.reduceLabeledStatement(node, { body: this[node.body.type](reducer, node.body) }); - }, - LiteralBooleanExpression: function LiteralBooleanExpression(reducer, node) { - return reducer.reduceLiteralBooleanExpression(node); - }, - LiteralInfinityExpression: function LiteralInfinityExpression(reducer, node) { - return reducer.reduceLiteralInfinityExpression(node); - }, - LiteralNullExpression: function LiteralNullExpression(reducer, node) { - return reducer.reduceLiteralNullExpression(node); - }, - LiteralNumericExpression: function LiteralNumericExpression(reducer, node) { - return reducer.reduceLiteralNumericExpression(node); - }, - LiteralRegExpExpression: function LiteralRegExpExpression(reducer, node) { - return reducer.reduceLiteralRegExpExpression(node); - }, - LiteralStringExpression: function LiteralStringExpression(reducer, node) { - return reducer.reduceLiteralStringExpression(node); - }, - Method: function Method(reducer, node) { - return reducer.reduceMethod(node, { name: this[node.name.type](reducer, node.name), params: this.FormalParameters(reducer, node.params), body: this.FunctionBody(reducer, node.body) }); - }, - Module: function Module(reducer, node) { - var _this13 = this; - - return reducer.reduceModule(node, { directives: node.directives.map(function (v) { - return _this13.Directive(reducer, v); - }), items: node.items.map(function (v) { - return _this13[v.type](reducer, v); - }) }); - }, - NewExpression: function NewExpression(reducer, node) { - var _this14 = this; - - return reducer.reduceNewExpression(node, { callee: this[node.callee.type](reducer, node.callee), arguments: node.arguments.map(function (v) { - return _this14[v.type](reducer, v); - }) }); - }, - NewTargetExpression: function NewTargetExpression(reducer, node) { - return reducer.reduceNewTargetExpression(node); - }, - ObjectAssignmentTarget: function ObjectAssignmentTarget(reducer, node) { - var _this15 = this; - - return reducer.reduceObjectAssignmentTarget(node, { properties: node.properties.map(function (v) { - return _this15[v.type](reducer, v); - }), rest: node.rest && this[node.rest.type](reducer, node.rest) }); - }, - ObjectBinding: function ObjectBinding(reducer, node) { - var _this16 = this; - - return reducer.reduceObjectBinding(node, { properties: node.properties.map(function (v) { - return _this16[v.type](reducer, v); - }), rest: node.rest && this[node.rest.type](reducer, node.rest) }); - }, - ObjectExpression: function ObjectExpression(reducer, node) { - var _this17 = this; - - return reducer.reduceObjectExpression(node, { properties: node.properties.map(function (v) { - return _this17[v.type](reducer, v); - }) }); - }, - ReturnStatement: function ReturnStatement(reducer, node) { - return reducer.reduceReturnStatement(node, { expression: node.expression && this[node.expression.type](reducer, node.expression) }); - }, - Script: function Script(reducer, node) { - var _this18 = this; - - return reducer.reduceScript(node, { directives: node.directives.map(function (v) { - return _this18.Directive(reducer, v); - }), statements: node.statements.map(function (v) { - return _this18[v.type](reducer, v); - }) }); - }, - Setter: function Setter(reducer, node) { - return reducer.reduceSetter(node, { name: this[node.name.type](reducer, node.name), param: this[node.param.type](reducer, node.param), body: this.FunctionBody(reducer, node.body) }); - }, - ShorthandProperty: function ShorthandProperty(reducer, node) { - return reducer.reduceShorthandProperty(node, { name: this.IdentifierExpression(reducer, node.name) }); - }, - SpreadElement: function SpreadElement(reducer, node) { - return reducer.reduceSpreadElement(node, { expression: this[node.expression.type](reducer, node.expression) }); - }, - SpreadProperty: function SpreadProperty(reducer, node) { - return reducer.reduceSpreadProperty(node, { expression: this[node.expression.type](reducer, node.expression) }); - }, - StaticMemberAssignmentTarget: function StaticMemberAssignmentTarget(reducer, node) { - return reducer.reduceStaticMemberAssignmentTarget(node, { object: this[node.object.type](reducer, node.object) }); - }, - StaticMemberExpression: function StaticMemberExpression(reducer, node) { - return reducer.reduceStaticMemberExpression(node, { object: this[node.object.type](reducer, node.object) }); - }, - StaticPropertyName: function StaticPropertyName(reducer, node) { - return reducer.reduceStaticPropertyName(node); - }, - Super: function Super(reducer, node) { - return reducer.reduceSuper(node); - }, - SwitchCase: function SwitchCase(reducer, node) { - var _this19 = this; - - return reducer.reduceSwitchCase(node, { test: this[node.test.type](reducer, node.test), consequent: node.consequent.map(function (v) { - return _this19[v.type](reducer, v); - }) }); - }, - SwitchDefault: function SwitchDefault(reducer, node) { - var _this20 = this; - - return reducer.reduceSwitchDefault(node, { consequent: node.consequent.map(function (v) { - return _this20[v.type](reducer, v); - }) }); - }, - SwitchStatement: function SwitchStatement(reducer, node) { - var _this21 = this; - - return reducer.reduceSwitchStatement(node, { discriminant: this[node.discriminant.type](reducer, node.discriminant), cases: node.cases.map(function (v) { - return _this21.SwitchCase(reducer, v); - }) }); - }, - SwitchStatementWithDefault: function SwitchStatementWithDefault(reducer, node) { - var _this22 = this; - - return reducer.reduceSwitchStatementWithDefault(node, { discriminant: this[node.discriminant.type](reducer, node.discriminant), preDefaultCases: node.preDefaultCases.map(function (v) { - return _this22.SwitchCase(reducer, v); - }), defaultCase: this.SwitchDefault(reducer, node.defaultCase), postDefaultCases: node.postDefaultCases.map(function (v) { - return _this22.SwitchCase(reducer, v); - }) }); - }, - TemplateElement: function TemplateElement(reducer, node) { - return reducer.reduceTemplateElement(node); - }, - TemplateExpression: function TemplateExpression(reducer, node) { - var _this23 = this; - - return reducer.reduceTemplateExpression(node, { tag: node.tag && this[node.tag.type](reducer, node.tag), elements: node.elements.map(function (v) { - return _this23[v.type](reducer, v); - }) }); - }, - ThisExpression: function ThisExpression(reducer, node) { - return reducer.reduceThisExpression(node); - }, - ThrowStatement: function ThrowStatement(reducer, node) { - return reducer.reduceThrowStatement(node, { expression: this[node.expression.type](reducer, node.expression) }); - }, - TryCatchStatement: function TryCatchStatement(reducer, node) { - return reducer.reduceTryCatchStatement(node, { body: this.Block(reducer, node.body), catchClause: this.CatchClause(reducer, node.catchClause) }); - }, - TryFinallyStatement: function TryFinallyStatement(reducer, node) { - return reducer.reduceTryFinallyStatement(node, { body: this.Block(reducer, node.body), catchClause: node.catchClause && this.CatchClause(reducer, node.catchClause), finalizer: this.Block(reducer, node.finalizer) }); - }, - UnaryExpression: function UnaryExpression(reducer, node) { - return reducer.reduceUnaryExpression(node, { operand: this[node.operand.type](reducer, node.operand) }); - }, - UpdateExpression: function UpdateExpression(reducer, node) { - return reducer.reduceUpdateExpression(node, { operand: this[node.operand.type](reducer, node.operand) }); - }, - VariableDeclaration: function VariableDeclaration(reducer, node) { - var _this24 = this; - - return reducer.reduceVariableDeclaration(node, { declarators: node.declarators.map(function (v) { - return _this24.VariableDeclarator(reducer, v); - }) }); - }, - VariableDeclarationStatement: function VariableDeclarationStatement(reducer, node) { - return reducer.reduceVariableDeclarationStatement(node, { declaration: this.VariableDeclaration(reducer, node.declaration) }); - }, - VariableDeclarator: function VariableDeclarator(reducer, node) { - return reducer.reduceVariableDeclarator(node, { binding: this[node.binding.type](reducer, node.binding), init: node.init && this[node.init.type](reducer, node.init) }); - }, - WhileStatement: function WhileStatement(reducer, node) { - return reducer.reduceWhileStatement(node, { test: this[node.test.type](reducer, node.test), body: this[node.body.type](reducer, node.body) }); - }, - WithStatement: function WithStatement(reducer, node) { - return reducer.reduceWithStatement(node, { object: this[node.object.type](reducer, node.object), body: this[node.body.type](reducer, node.body) }); - }, - YieldExpression: function YieldExpression(reducer, node) { - return reducer.reduceYieldExpression(node, { expression: node.expression && this[node.expression.type](reducer, node.expression) }); - }, - YieldGeneratorExpression: function YieldGeneratorExpression(reducer, node) { - return reducer.reduceYieldGeneratorExpression(node, { expression: this[node.expression.type](reducer, node.expression) }); - } -}; - -function reduce(reducer, node) { - return director[node.type](reducer, node); -} -}); - -var thunkedDirector = createCommonjsModule(function (module, exports) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.thunkedReduce = thunkedReduce; -// Generated by generate-director.js -/** - * Copyright 2018 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -var director = { - ArrayAssignmentTarget: function ArrayAssignmentTarget(reducer, node) { - var _this = this; - - return reducer.reduceArrayAssignmentTarget(node, { elements: node.elements.map(function (v) { - return v && function () { - return _this[v.type](reducer, v); - }; - }), rest: node.rest && function () { - return _this[node.rest.type](reducer, node.rest); - } }); - }, - ArrayBinding: function ArrayBinding(reducer, node) { - var _this2 = this; - - return reducer.reduceArrayBinding(node, { elements: node.elements.map(function (v) { - return v && function () { - return _this2[v.type](reducer, v); - }; - }), rest: node.rest && function () { - return _this2[node.rest.type](reducer, node.rest); - } }); - }, - ArrayExpression: function ArrayExpression(reducer, node) { - var _this3 = this; - - return reducer.reduceArrayExpression(node, { elements: node.elements.map(function (v) { - return v && function () { - return _this3[v.type](reducer, v); - }; - }) }); - }, - ArrowExpression: function ArrowExpression(reducer, node) { - var _this4 = this; - - return reducer.reduceArrowExpression(node, { params: function params() { - return _this4.FormalParameters(reducer, node.params); - }, body: function body() { - return _this4[node.body.type](reducer, node.body); - } }); - }, - AssignmentExpression: function AssignmentExpression(reducer, node) { - var _this5 = this; - - return reducer.reduceAssignmentExpression(node, { binding: function binding() { - return _this5[node.binding.type](reducer, node.binding); - }, expression: function expression() { - return _this5[node.expression.type](reducer, node.expression); - } }); - }, - AssignmentTargetIdentifier: function AssignmentTargetIdentifier(reducer, node) { - return reducer.reduceAssignmentTargetIdentifier(node); - }, - AssignmentTargetPropertyIdentifier: function AssignmentTargetPropertyIdentifier(reducer, node) { - var _this6 = this; - - return reducer.reduceAssignmentTargetPropertyIdentifier(node, { binding: function binding() { - return _this6.AssignmentTargetIdentifier(reducer, node.binding); - }, init: node.init && function () { - return _this6[node.init.type](reducer, node.init); - } }); - }, - AssignmentTargetPropertyProperty: function AssignmentTargetPropertyProperty(reducer, node) { - var _this7 = this; - - return reducer.reduceAssignmentTargetPropertyProperty(node, { name: function name() { - return _this7[node.name.type](reducer, node.name); - }, binding: function binding() { - return _this7[node.binding.type](reducer, node.binding); - } }); - }, - AssignmentTargetWithDefault: function AssignmentTargetWithDefault(reducer, node) { - var _this8 = this; - - return reducer.reduceAssignmentTargetWithDefault(node, { binding: function binding() { - return _this8[node.binding.type](reducer, node.binding); - }, init: function init() { - return _this8[node.init.type](reducer, node.init); - } }); - }, - AwaitExpression: function AwaitExpression(reducer, node) { - var _this9 = this; - - return reducer.reduceAwaitExpression(node, { expression: function expression() { - return _this9[node.expression.type](reducer, node.expression); - } }); - }, - BinaryExpression: function BinaryExpression(reducer, node) { - var _this10 = this; - - return reducer.reduceBinaryExpression(node, { left: function left() { - return _this10[node.left.type](reducer, node.left); - }, right: function right() { - return _this10[node.right.type](reducer, node.right); - } }); - }, - BindingIdentifier: function BindingIdentifier(reducer, node) { - return reducer.reduceBindingIdentifier(node); - }, - BindingPropertyIdentifier: function BindingPropertyIdentifier(reducer, node) { - var _this11 = this; - - return reducer.reduceBindingPropertyIdentifier(node, { binding: function binding() { - return _this11.BindingIdentifier(reducer, node.binding); - }, init: node.init && function () { - return _this11[node.init.type](reducer, node.init); - } }); - }, - BindingPropertyProperty: function BindingPropertyProperty(reducer, node) { - var _this12 = this; - - return reducer.reduceBindingPropertyProperty(node, { name: function name() { - return _this12[node.name.type](reducer, node.name); - }, binding: function binding() { - return _this12[node.binding.type](reducer, node.binding); - } }); - }, - BindingWithDefault: function BindingWithDefault(reducer, node) { - var _this13 = this; - - return reducer.reduceBindingWithDefault(node, { binding: function binding() { - return _this13[node.binding.type](reducer, node.binding); - }, init: function init() { - return _this13[node.init.type](reducer, node.init); - } }); - }, - Block: function Block(reducer, node) { - var _this14 = this; - - return reducer.reduceBlock(node, { statements: node.statements.map(function (v) { - return function () { - return _this14[v.type](reducer, v); - }; - }) }); - }, - BlockStatement: function BlockStatement(reducer, node) { - var _this15 = this; - - return reducer.reduceBlockStatement(node, { block: function block() { - return _this15.Block(reducer, node.block); - } }); - }, - BreakStatement: function BreakStatement(reducer, node) { - return reducer.reduceBreakStatement(node); - }, - CallExpression: function CallExpression(reducer, node) { - var _this16 = this; - - return reducer.reduceCallExpression(node, { callee: function callee() { - return _this16[node.callee.type](reducer, node.callee); - }, arguments: node.arguments.map(function (v) { - return function () { - return _this16[v.type](reducer, v); - }; - }) }); - }, - CatchClause: function CatchClause(reducer, node) { - var _this17 = this; - - return reducer.reduceCatchClause(node, { binding: function binding() { - return _this17[node.binding.type](reducer, node.binding); - }, body: function body() { - return _this17.Block(reducer, node.body); - } }); - }, - ClassDeclaration: function ClassDeclaration(reducer, node) { - var _this18 = this; - - return reducer.reduceClassDeclaration(node, { name: function name() { - return _this18.BindingIdentifier(reducer, node.name); - }, super: node.super && function () { - return _this18[node.super.type](reducer, node.super); - }, elements: node.elements.map(function (v) { - return function () { - return _this18.ClassElement(reducer, v); - }; - }) }); - }, - ClassElement: function ClassElement(reducer, node) { - var _this19 = this; - - return reducer.reduceClassElement(node, { method: function method() { - return _this19[node.method.type](reducer, node.method); - } }); - }, - ClassExpression: function ClassExpression(reducer, node) { - var _this20 = this; - - return reducer.reduceClassExpression(node, { name: node.name && function () { - return _this20.BindingIdentifier(reducer, node.name); - }, super: node.super && function () { - return _this20[node.super.type](reducer, node.super); - }, elements: node.elements.map(function (v) { - return function () { - return _this20.ClassElement(reducer, v); - }; - }) }); - }, - CompoundAssignmentExpression: function CompoundAssignmentExpression(reducer, node) { - var _this21 = this; - - return reducer.reduceCompoundAssignmentExpression(node, { binding: function binding() { - return _this21[node.binding.type](reducer, node.binding); - }, expression: function expression() { - return _this21[node.expression.type](reducer, node.expression); - } }); - }, - ComputedMemberAssignmentTarget: function ComputedMemberAssignmentTarget(reducer, node) { - var _this22 = this; - - return reducer.reduceComputedMemberAssignmentTarget(node, { object: function object() { - return _this22[node.object.type](reducer, node.object); - }, expression: function expression() { - return _this22[node.expression.type](reducer, node.expression); - } }); - }, - ComputedMemberExpression: function ComputedMemberExpression(reducer, node) { - var _this23 = this; - - return reducer.reduceComputedMemberExpression(node, { object: function object() { - return _this23[node.object.type](reducer, node.object); - }, expression: function expression() { - return _this23[node.expression.type](reducer, node.expression); - } }); - }, - ComputedPropertyName: function ComputedPropertyName(reducer, node) { - var _this24 = this; - - return reducer.reduceComputedPropertyName(node, { expression: function expression() { - return _this24[node.expression.type](reducer, node.expression); - } }); - }, - ConditionalExpression: function ConditionalExpression(reducer, node) { - var _this25 = this; - - return reducer.reduceConditionalExpression(node, { test: function test() { - return _this25[node.test.type](reducer, node.test); - }, consequent: function consequent() { - return _this25[node.consequent.type](reducer, node.consequent); - }, alternate: function alternate() { - return _this25[node.alternate.type](reducer, node.alternate); - } }); - }, - ContinueStatement: function ContinueStatement(reducer, node) { - return reducer.reduceContinueStatement(node); - }, - DataProperty: function DataProperty(reducer, node) { - var _this26 = this; - - return reducer.reduceDataProperty(node, { name: function name() { - return _this26[node.name.type](reducer, node.name); - }, expression: function expression() { - return _this26[node.expression.type](reducer, node.expression); - } }); - }, - DebuggerStatement: function DebuggerStatement(reducer, node) { - return reducer.reduceDebuggerStatement(node); - }, - Directive: function Directive(reducer, node) { - return reducer.reduceDirective(node); - }, - DoWhileStatement: function DoWhileStatement(reducer, node) { - var _this27 = this; - - return reducer.reduceDoWhileStatement(node, { body: function body() { - return _this27[node.body.type](reducer, node.body); - }, test: function test() { - return _this27[node.test.type](reducer, node.test); - } }); - }, - EmptyStatement: function EmptyStatement(reducer, node) { - return reducer.reduceEmptyStatement(node); - }, - Export: function Export(reducer, node) { - var _this28 = this; - - return reducer.reduceExport(node, { declaration: function declaration() { - return _this28[node.declaration.type](reducer, node.declaration); - } }); - }, - ExportAllFrom: function ExportAllFrom(reducer, node) { - return reducer.reduceExportAllFrom(node); - }, - ExportDefault: function ExportDefault(reducer, node) { - var _this29 = this; - - return reducer.reduceExportDefault(node, { body: function body() { - return _this29[node.body.type](reducer, node.body); - } }); - }, - ExportFrom: function ExportFrom(reducer, node) { - var _this30 = this; - - return reducer.reduceExportFrom(node, { namedExports: node.namedExports.map(function (v) { - return function () { - return _this30.ExportFromSpecifier(reducer, v); - }; - }) }); - }, - ExportFromSpecifier: function ExportFromSpecifier(reducer, node) { - return reducer.reduceExportFromSpecifier(node); - }, - ExportLocalSpecifier: function ExportLocalSpecifier(reducer, node) { - var _this31 = this; - - return reducer.reduceExportLocalSpecifier(node, { name: function name() { - return _this31.IdentifierExpression(reducer, node.name); - } }); - }, - ExportLocals: function ExportLocals(reducer, node) { - var _this32 = this; - - return reducer.reduceExportLocals(node, { namedExports: node.namedExports.map(function (v) { - return function () { - return _this32.ExportLocalSpecifier(reducer, v); - }; - }) }); - }, - ExpressionStatement: function ExpressionStatement(reducer, node) { - var _this33 = this; - - return reducer.reduceExpressionStatement(node, { expression: function expression() { - return _this33[node.expression.type](reducer, node.expression); - } }); - }, - ForAwaitStatement: function ForAwaitStatement(reducer, node) { - var _this34 = this; - - return reducer.reduceForAwaitStatement(node, { left: function left() { - return _this34[node.left.type](reducer, node.left); - }, right: function right() { - return _this34[node.right.type](reducer, node.right); - }, body: function body() { - return _this34[node.body.type](reducer, node.body); - } }); - }, - ForInStatement: function ForInStatement(reducer, node) { - var _this35 = this; - - return reducer.reduceForInStatement(node, { left: function left() { - return _this35[node.left.type](reducer, node.left); - }, right: function right() { - return _this35[node.right.type](reducer, node.right); - }, body: function body() { - return _this35[node.body.type](reducer, node.body); - } }); - }, - ForOfStatement: function ForOfStatement(reducer, node) { - var _this36 = this; - - return reducer.reduceForOfStatement(node, { left: function left() { - return _this36[node.left.type](reducer, node.left); - }, right: function right() { - return _this36[node.right.type](reducer, node.right); - }, body: function body() { - return _this36[node.body.type](reducer, node.body); - } }); - }, - ForStatement: function ForStatement(reducer, node) { - var _this37 = this; - - return reducer.reduceForStatement(node, { init: node.init && function () { - return _this37[node.init.type](reducer, node.init); - }, test: node.test && function () { - return _this37[node.test.type](reducer, node.test); - }, update: node.update && function () { - return _this37[node.update.type](reducer, node.update); - }, body: function body() { - return _this37[node.body.type](reducer, node.body); - } }); - }, - FormalParameters: function FormalParameters(reducer, node) { - var _this38 = this; - - return reducer.reduceFormalParameters(node, { items: node.items.map(function (v) { - return function () { - return _this38[v.type](reducer, v); - }; - }), rest: node.rest && function () { - return _this38[node.rest.type](reducer, node.rest); - } }); - }, - FunctionBody: function FunctionBody(reducer, node) { - var _this39 = this; - - return reducer.reduceFunctionBody(node, { directives: node.directives.map(function (v) { - return function () { - return _this39.Directive(reducer, v); - }; - }), statements: node.statements.map(function (v) { - return function () { - return _this39[v.type](reducer, v); - }; - }) }); - }, - FunctionDeclaration: function FunctionDeclaration(reducer, node) { - var _this40 = this; - - return reducer.reduceFunctionDeclaration(node, { name: function name() { - return _this40.BindingIdentifier(reducer, node.name); - }, params: function params() { - return _this40.FormalParameters(reducer, node.params); - }, body: function body() { - return _this40.FunctionBody(reducer, node.body); - } }); - }, - FunctionExpression: function FunctionExpression(reducer, node) { - var _this41 = this; - - return reducer.reduceFunctionExpression(node, { name: node.name && function () { - return _this41.BindingIdentifier(reducer, node.name); - }, params: function params() { - return _this41.FormalParameters(reducer, node.params); - }, body: function body() { - return _this41.FunctionBody(reducer, node.body); - } }); - }, - Getter: function Getter(reducer, node) { - var _this42 = this; - - return reducer.reduceGetter(node, { name: function name() { - return _this42[node.name.type](reducer, node.name); - }, body: function body() { - return _this42.FunctionBody(reducer, node.body); - } }); - }, - IdentifierExpression: function IdentifierExpression(reducer, node) { - return reducer.reduceIdentifierExpression(node); - }, - IfStatement: function IfStatement(reducer, node) { - var _this43 = this; - - return reducer.reduceIfStatement(node, { test: function test() { - return _this43[node.test.type](reducer, node.test); - }, consequent: function consequent() { - return _this43[node.consequent.type](reducer, node.consequent); - }, alternate: node.alternate && function () { - return _this43[node.alternate.type](reducer, node.alternate); - } }); - }, - Import: function Import(reducer, node) { - var _this44 = this; - - return reducer.reduceImport(node, { defaultBinding: node.defaultBinding && function () { - return _this44.BindingIdentifier(reducer, node.defaultBinding); - }, namedImports: node.namedImports.map(function (v) { - return function () { - return _this44.ImportSpecifier(reducer, v); - }; - }) }); - }, - ImportNamespace: function ImportNamespace(reducer, node) { - var _this45 = this; - - return reducer.reduceImportNamespace(node, { defaultBinding: node.defaultBinding && function () { - return _this45.BindingIdentifier(reducer, node.defaultBinding); - }, namespaceBinding: function namespaceBinding() { - return _this45.BindingIdentifier(reducer, node.namespaceBinding); - } }); - }, - ImportSpecifier: function ImportSpecifier(reducer, node) { - var _this46 = this; - - return reducer.reduceImportSpecifier(node, { binding: function binding() { - return _this46.BindingIdentifier(reducer, node.binding); - } }); - }, - LabeledStatement: function LabeledStatement(reducer, node) { - var _this47 = this; - - return reducer.reduceLabeledStatement(node, { body: function body() { - return _this47[node.body.type](reducer, node.body); - } }); - }, - LiteralBooleanExpression: function LiteralBooleanExpression(reducer, node) { - return reducer.reduceLiteralBooleanExpression(node); - }, - LiteralInfinityExpression: function LiteralInfinityExpression(reducer, node) { - return reducer.reduceLiteralInfinityExpression(node); - }, - LiteralNullExpression: function LiteralNullExpression(reducer, node) { - return reducer.reduceLiteralNullExpression(node); - }, - LiteralNumericExpression: function LiteralNumericExpression(reducer, node) { - return reducer.reduceLiteralNumericExpression(node); - }, - LiteralRegExpExpression: function LiteralRegExpExpression(reducer, node) { - return reducer.reduceLiteralRegExpExpression(node); - }, - LiteralStringExpression: function LiteralStringExpression(reducer, node) { - return reducer.reduceLiteralStringExpression(node); - }, - Method: function Method(reducer, node) { - var _this48 = this; - - return reducer.reduceMethod(node, { name: function name() { - return _this48[node.name.type](reducer, node.name); - }, params: function params() { - return _this48.FormalParameters(reducer, node.params); - }, body: function body() { - return _this48.FunctionBody(reducer, node.body); - } }); - }, - Module: function Module(reducer, node) { - var _this49 = this; - - return reducer.reduceModule(node, { directives: node.directives.map(function (v) { - return function () { - return _this49.Directive(reducer, v); - }; - }), items: node.items.map(function (v) { - return function () { - return _this49[v.type](reducer, v); - }; - }) }); - }, - NewExpression: function NewExpression(reducer, node) { - var _this50 = this; - - return reducer.reduceNewExpression(node, { callee: function callee() { - return _this50[node.callee.type](reducer, node.callee); - }, arguments: node.arguments.map(function (v) { - return function () { - return _this50[v.type](reducer, v); - }; - }) }); - }, - NewTargetExpression: function NewTargetExpression(reducer, node) { - return reducer.reduceNewTargetExpression(node); - }, - ObjectAssignmentTarget: function ObjectAssignmentTarget(reducer, node) { - var _this51 = this; - - return reducer.reduceObjectAssignmentTarget(node, { properties: node.properties.map(function (v) { - return function () { - return _this51[v.type](reducer, v); - }; - }), rest: node.rest && function () { - return _this51[node.rest.type](reducer, node.rest); - } }); - }, - ObjectBinding: function ObjectBinding(reducer, node) { - var _this52 = this; - - return reducer.reduceObjectBinding(node, { properties: node.properties.map(function (v) { - return function () { - return _this52[v.type](reducer, v); - }; - }), rest: node.rest && function () { - return _this52[node.rest.type](reducer, node.rest); - } }); - }, - ObjectExpression: function ObjectExpression(reducer, node) { - var _this53 = this; - - return reducer.reduceObjectExpression(node, { properties: node.properties.map(function (v) { - return function () { - return _this53[v.type](reducer, v); - }; - }) }); - }, - ReturnStatement: function ReturnStatement(reducer, node) { - var _this54 = this; - - return reducer.reduceReturnStatement(node, { expression: node.expression && function () { - return _this54[node.expression.type](reducer, node.expression); - } }); - }, - Script: function Script(reducer, node) { - var _this55 = this; - - return reducer.reduceScript(node, { directives: node.directives.map(function (v) { - return function () { - return _this55.Directive(reducer, v); - }; - }), statements: node.statements.map(function (v) { - return function () { - return _this55[v.type](reducer, v); - }; - }) }); - }, - Setter: function Setter(reducer, node) { - var _this56 = this; - - return reducer.reduceSetter(node, { name: function name() { - return _this56[node.name.type](reducer, node.name); - }, param: function param() { - return _this56[node.param.type](reducer, node.param); - }, body: function body() { - return _this56.FunctionBody(reducer, node.body); - } }); - }, - ShorthandProperty: function ShorthandProperty(reducer, node) { - var _this57 = this; - - return reducer.reduceShorthandProperty(node, { name: function name() { - return _this57.IdentifierExpression(reducer, node.name); - } }); - }, - SpreadElement: function SpreadElement(reducer, node) { - var _this58 = this; - - return reducer.reduceSpreadElement(node, { expression: function expression() { - return _this58[node.expression.type](reducer, node.expression); - } }); - }, - SpreadProperty: function SpreadProperty(reducer, node) { - var _this59 = this; - - return reducer.reduceSpreadProperty(node, { expression: function expression() { - return _this59[node.expression.type](reducer, node.expression); - } }); - }, - StaticMemberAssignmentTarget: function StaticMemberAssignmentTarget(reducer, node) { - var _this60 = this; - - return reducer.reduceStaticMemberAssignmentTarget(node, { object: function object() { - return _this60[node.object.type](reducer, node.object); - } }); - }, - StaticMemberExpression: function StaticMemberExpression(reducer, node) { - var _this61 = this; - - return reducer.reduceStaticMemberExpression(node, { object: function object() { - return _this61[node.object.type](reducer, node.object); - } }); - }, - StaticPropertyName: function StaticPropertyName(reducer, node) { - return reducer.reduceStaticPropertyName(node); - }, - Super: function Super(reducer, node) { - return reducer.reduceSuper(node); - }, - SwitchCase: function SwitchCase(reducer, node) { - var _this62 = this; - - return reducer.reduceSwitchCase(node, { test: function test() { - return _this62[node.test.type](reducer, node.test); - }, consequent: node.consequent.map(function (v) { - return function () { - return _this62[v.type](reducer, v); - }; - }) }); - }, - SwitchDefault: function SwitchDefault(reducer, node) { - var _this63 = this; - - return reducer.reduceSwitchDefault(node, { consequent: node.consequent.map(function (v) { - return function () { - return _this63[v.type](reducer, v); - }; - }) }); - }, - SwitchStatement: function SwitchStatement(reducer, node) { - var _this64 = this; - - return reducer.reduceSwitchStatement(node, { discriminant: function discriminant() { - return _this64[node.discriminant.type](reducer, node.discriminant); - }, cases: node.cases.map(function (v) { - return function () { - return _this64.SwitchCase(reducer, v); - }; - }) }); - }, - SwitchStatementWithDefault: function SwitchStatementWithDefault(reducer, node) { - var _this65 = this; - - return reducer.reduceSwitchStatementWithDefault(node, { discriminant: function discriminant() { - return _this65[node.discriminant.type](reducer, node.discriminant); - }, preDefaultCases: node.preDefaultCases.map(function (v) { - return function () { - return _this65.SwitchCase(reducer, v); - }; - }), defaultCase: function defaultCase() { - return _this65.SwitchDefault(reducer, node.defaultCase); - }, postDefaultCases: node.postDefaultCases.map(function (v) { - return function () { - return _this65.SwitchCase(reducer, v); - }; - }) }); - }, - TemplateElement: function TemplateElement(reducer, node) { - return reducer.reduceTemplateElement(node); - }, - TemplateExpression: function TemplateExpression(reducer, node) { - var _this66 = this; - - return reducer.reduceTemplateExpression(node, { tag: node.tag && function () { - return _this66[node.tag.type](reducer, node.tag); - }, elements: node.elements.map(function (v) { - return function () { - return _this66[v.type](reducer, v); - }; - }) }); - }, - ThisExpression: function ThisExpression(reducer, node) { - return reducer.reduceThisExpression(node); - }, - ThrowStatement: function ThrowStatement(reducer, node) { - var _this67 = this; - - return reducer.reduceThrowStatement(node, { expression: function expression() { - return _this67[node.expression.type](reducer, node.expression); - } }); - }, - TryCatchStatement: function TryCatchStatement(reducer, node) { - var _this68 = this; - - return reducer.reduceTryCatchStatement(node, { body: function body() { - return _this68.Block(reducer, node.body); - }, catchClause: function catchClause() { - return _this68.CatchClause(reducer, node.catchClause); - } }); - }, - TryFinallyStatement: function TryFinallyStatement(reducer, node) { - var _this69 = this; - - return reducer.reduceTryFinallyStatement(node, { body: function body() { - return _this69.Block(reducer, node.body); - }, catchClause: node.catchClause && function () { - return _this69.CatchClause(reducer, node.catchClause); - }, finalizer: function finalizer() { - return _this69.Block(reducer, node.finalizer); - } }); - }, - UnaryExpression: function UnaryExpression(reducer, node) { - var _this70 = this; - - return reducer.reduceUnaryExpression(node, { operand: function operand() { - return _this70[node.operand.type](reducer, node.operand); - } }); - }, - UpdateExpression: function UpdateExpression(reducer, node) { - var _this71 = this; - - return reducer.reduceUpdateExpression(node, { operand: function operand() { - return _this71[node.operand.type](reducer, node.operand); - } }); - }, - VariableDeclaration: function VariableDeclaration(reducer, node) { - var _this72 = this; - - return reducer.reduceVariableDeclaration(node, { declarators: node.declarators.map(function (v) { - return function () { - return _this72.VariableDeclarator(reducer, v); - }; - }) }); - }, - VariableDeclarationStatement: function VariableDeclarationStatement(reducer, node) { - var _this73 = this; - - return reducer.reduceVariableDeclarationStatement(node, { declaration: function declaration() { - return _this73.VariableDeclaration(reducer, node.declaration); - } }); - }, - VariableDeclarator: function VariableDeclarator(reducer, node) { - var _this74 = this; - - return reducer.reduceVariableDeclarator(node, { binding: function binding() { - return _this74[node.binding.type](reducer, node.binding); - }, init: node.init && function () { - return _this74[node.init.type](reducer, node.init); - } }); - }, - WhileStatement: function WhileStatement(reducer, node) { - var _this75 = this; - - return reducer.reduceWhileStatement(node, { test: function test() { - return _this75[node.test.type](reducer, node.test); - }, body: function body() { - return _this75[node.body.type](reducer, node.body); - } }); - }, - WithStatement: function WithStatement(reducer, node) { - var _this76 = this; - - return reducer.reduceWithStatement(node, { object: function object() { - return _this76[node.object.type](reducer, node.object); - }, body: function body() { - return _this76[node.body.type](reducer, node.body); - } }); - }, - YieldExpression: function YieldExpression(reducer, node) { - var _this77 = this; - - return reducer.reduceYieldExpression(node, { expression: node.expression && function () { - return _this77[node.expression.type](reducer, node.expression); - } }); - }, - YieldGeneratorExpression: function YieldGeneratorExpression(reducer, node) { - var _this78 = this; - - return reducer.reduceYieldGeneratorExpression(node, { expression: function expression() { - return _this78[node.expression.type](reducer, node.expression); - } }); - } -}; - -function thunkedReduce(reducer, node) { - return director[node.type](reducer, node); -} -}); - -var thunkify_1 = createCommonjsModule(function (module, exports) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = thunkify; -// Generated by generate-thunkify.js -/** - * Copyright 2018 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -function thunkify(reducer) { - return { - reduceArrayAssignmentTarget: function reduceArrayAssignmentTarget(node, _ref) { - var elements = _ref.elements, - rest = _ref.rest; - - return reducer.reduceArrayAssignmentTarget(node, { elements: elements.map(function (n) { - return n == null ? null : n(); - }), rest: rest == null ? null : rest() }); - }, - reduceArrayBinding: function reduceArrayBinding(node, _ref2) { - var elements = _ref2.elements, - rest = _ref2.rest; - - return reducer.reduceArrayBinding(node, { elements: elements.map(function (n) { - return n == null ? null : n(); - }), rest: rest == null ? null : rest() }); - }, - reduceArrayExpression: function reduceArrayExpression(node, _ref3) { - var elements = _ref3.elements; - - return reducer.reduceArrayExpression(node, { elements: elements.map(function (n) { - return n == null ? null : n(); - }) }); - }, - reduceArrowExpression: function reduceArrowExpression(node, _ref4) { - var params = _ref4.params, - body = _ref4.body; - - return reducer.reduceArrowExpression(node, { params: params(), body: body() }); - }, - reduceAssignmentExpression: function reduceAssignmentExpression(node, _ref5) { - var binding = _ref5.binding, - expression = _ref5.expression; - - return reducer.reduceAssignmentExpression(node, { binding: binding(), expression: expression() }); - }, - reduceAssignmentTargetIdentifier: function reduceAssignmentTargetIdentifier(node) { - return reducer.reduceAssignmentTargetIdentifier(node); - }, - reduceAssignmentTargetPropertyIdentifier: function reduceAssignmentTargetPropertyIdentifier(node, _ref6) { - var binding = _ref6.binding, - init = _ref6.init; - - return reducer.reduceAssignmentTargetPropertyIdentifier(node, { binding: binding(), init: init == null ? null : init() }); - }, - reduceAssignmentTargetPropertyProperty: function reduceAssignmentTargetPropertyProperty(node, _ref7) { - var name = _ref7.name, - binding = _ref7.binding; - - return reducer.reduceAssignmentTargetPropertyProperty(node, { name: name(), binding: binding() }); - }, - reduceAssignmentTargetWithDefault: function reduceAssignmentTargetWithDefault(node, _ref8) { - var binding = _ref8.binding, - init = _ref8.init; - - return reducer.reduceAssignmentTargetWithDefault(node, { binding: binding(), init: init() }); - }, - reduceAwaitExpression: function reduceAwaitExpression(node, _ref9) { - var expression = _ref9.expression; - - return reducer.reduceAwaitExpression(node, { expression: expression() }); - }, - reduceBinaryExpression: function reduceBinaryExpression(node, _ref10) { - var left = _ref10.left, - right = _ref10.right; - - return reducer.reduceBinaryExpression(node, { left: left(), right: right() }); - }, - reduceBindingIdentifier: function reduceBindingIdentifier(node) { - return reducer.reduceBindingIdentifier(node); - }, - reduceBindingPropertyIdentifier: function reduceBindingPropertyIdentifier(node, _ref11) { - var binding = _ref11.binding, - init = _ref11.init; - - return reducer.reduceBindingPropertyIdentifier(node, { binding: binding(), init: init == null ? null : init() }); - }, - reduceBindingPropertyProperty: function reduceBindingPropertyProperty(node, _ref12) { - var name = _ref12.name, - binding = _ref12.binding; - - return reducer.reduceBindingPropertyProperty(node, { name: name(), binding: binding() }); - }, - reduceBindingWithDefault: function reduceBindingWithDefault(node, _ref13) { - var binding = _ref13.binding, - init = _ref13.init; - - return reducer.reduceBindingWithDefault(node, { binding: binding(), init: init() }); - }, - reduceBlock: function reduceBlock(node, _ref14) { - var statements = _ref14.statements; - - return reducer.reduceBlock(node, { statements: statements.map(function (n) { - return n(); - }) }); - }, - reduceBlockStatement: function reduceBlockStatement(node, _ref15) { - var block = _ref15.block; - - return reducer.reduceBlockStatement(node, { block: block() }); - }, - reduceBreakStatement: function reduceBreakStatement(node) { - return reducer.reduceBreakStatement(node); - }, - reduceCallExpression: function reduceCallExpression(node, _ref16) { - var callee = _ref16.callee, - _arguments = _ref16.arguments; - - return reducer.reduceCallExpression(node, { callee: callee(), arguments: _arguments.map(function (n) { - return n(); - }) }); - }, - reduceCatchClause: function reduceCatchClause(node, _ref17) { - var binding = _ref17.binding, - body = _ref17.body; - - return reducer.reduceCatchClause(node, { binding: binding(), body: body() }); - }, - reduceClassDeclaration: function reduceClassDeclaration(node, _ref18) { - var name = _ref18.name, - _super = _ref18.super, - elements = _ref18.elements; - - return reducer.reduceClassDeclaration(node, { name: name(), super: _super == null ? null : _super(), elements: elements.map(function (n) { - return n(); - }) }); - }, - reduceClassElement: function reduceClassElement(node, _ref19) { - var method = _ref19.method; - - return reducer.reduceClassElement(node, { method: method() }); - }, - reduceClassExpression: function reduceClassExpression(node, _ref20) { - var name = _ref20.name, - _super = _ref20.super, - elements = _ref20.elements; - - return reducer.reduceClassExpression(node, { name: name == null ? null : name(), super: _super == null ? null : _super(), elements: elements.map(function (n) { - return n(); - }) }); - }, - reduceCompoundAssignmentExpression: function reduceCompoundAssignmentExpression(node, _ref21) { - var binding = _ref21.binding, - expression = _ref21.expression; - - return reducer.reduceCompoundAssignmentExpression(node, { binding: binding(), expression: expression() }); - }, - reduceComputedMemberAssignmentTarget: function reduceComputedMemberAssignmentTarget(node, _ref22) { - var object = _ref22.object, - expression = _ref22.expression; - - return reducer.reduceComputedMemberAssignmentTarget(node, { object: object(), expression: expression() }); - }, - reduceComputedMemberExpression: function reduceComputedMemberExpression(node, _ref23) { - var object = _ref23.object, - expression = _ref23.expression; - - return reducer.reduceComputedMemberExpression(node, { object: object(), expression: expression() }); - }, - reduceComputedPropertyName: function reduceComputedPropertyName(node, _ref24) { - var expression = _ref24.expression; - - return reducer.reduceComputedPropertyName(node, { expression: expression() }); - }, - reduceConditionalExpression: function reduceConditionalExpression(node, _ref25) { - var test = _ref25.test, - consequent = _ref25.consequent, - alternate = _ref25.alternate; - - return reducer.reduceConditionalExpression(node, { test: test(), consequent: consequent(), alternate: alternate() }); - }, - reduceContinueStatement: function reduceContinueStatement(node) { - return reducer.reduceContinueStatement(node); - }, - reduceDataProperty: function reduceDataProperty(node, _ref26) { - var name = _ref26.name, - expression = _ref26.expression; - - return reducer.reduceDataProperty(node, { name: name(), expression: expression() }); - }, - reduceDebuggerStatement: function reduceDebuggerStatement(node) { - return reducer.reduceDebuggerStatement(node); - }, - reduceDirective: function reduceDirective(node) { - return reducer.reduceDirective(node); - }, - reduceDoWhileStatement: function reduceDoWhileStatement(node, _ref27) { - var body = _ref27.body, - test = _ref27.test; - - return reducer.reduceDoWhileStatement(node, { body: body(), test: test() }); - }, - reduceEmptyStatement: function reduceEmptyStatement(node) { - return reducer.reduceEmptyStatement(node); - }, - reduceExport: function reduceExport(node, _ref28) { - var declaration = _ref28.declaration; - - return reducer.reduceExport(node, { declaration: declaration() }); - }, - reduceExportAllFrom: function reduceExportAllFrom(node) { - return reducer.reduceExportAllFrom(node); - }, - reduceExportDefault: function reduceExportDefault(node, _ref29) { - var body = _ref29.body; - - return reducer.reduceExportDefault(node, { body: body() }); - }, - reduceExportFrom: function reduceExportFrom(node, _ref30) { - var namedExports = _ref30.namedExports; - - return reducer.reduceExportFrom(node, { namedExports: namedExports.map(function (n) { - return n(); - }) }); - }, - reduceExportFromSpecifier: function reduceExportFromSpecifier(node) { - return reducer.reduceExportFromSpecifier(node); - }, - reduceExportLocalSpecifier: function reduceExportLocalSpecifier(node, _ref31) { - var name = _ref31.name; - - return reducer.reduceExportLocalSpecifier(node, { name: name() }); - }, - reduceExportLocals: function reduceExportLocals(node, _ref32) { - var namedExports = _ref32.namedExports; - - return reducer.reduceExportLocals(node, { namedExports: namedExports.map(function (n) { - return n(); - }) }); - }, - reduceExpressionStatement: function reduceExpressionStatement(node, _ref33) { - var expression = _ref33.expression; - - return reducer.reduceExpressionStatement(node, { expression: expression() }); - }, - reduceForAwaitStatement: function reduceForAwaitStatement(node, _ref34) { - var left = _ref34.left, - right = _ref34.right, - body = _ref34.body; - - return reducer.reduceForAwaitStatement(node, { left: left(), right: right(), body: body() }); - }, - reduceForInStatement: function reduceForInStatement(node, _ref35) { - var left = _ref35.left, - right = _ref35.right, - body = _ref35.body; - - return reducer.reduceForInStatement(node, { left: left(), right: right(), body: body() }); - }, - reduceForOfStatement: function reduceForOfStatement(node, _ref36) { - var left = _ref36.left, - right = _ref36.right, - body = _ref36.body; - - return reducer.reduceForOfStatement(node, { left: left(), right: right(), body: body() }); - }, - reduceForStatement: function reduceForStatement(node, _ref37) { - var init = _ref37.init, - test = _ref37.test, - update = _ref37.update, - body = _ref37.body; - - return reducer.reduceForStatement(node, { init: init == null ? null : init(), test: test == null ? null : test(), update: update == null ? null : update(), body: body() }); - }, - reduceFormalParameters: function reduceFormalParameters(node, _ref38) { - var items = _ref38.items, - rest = _ref38.rest; - - return reducer.reduceFormalParameters(node, { items: items.map(function (n) { - return n(); - }), rest: rest == null ? null : rest() }); - }, - reduceFunctionBody: function reduceFunctionBody(node, _ref39) { - var directives = _ref39.directives, - statements = _ref39.statements; - - return reducer.reduceFunctionBody(node, { directives: directives.map(function (n) { - return n(); - }), statements: statements.map(function (n) { - return n(); - }) }); - }, - reduceFunctionDeclaration: function reduceFunctionDeclaration(node, _ref40) { - var name = _ref40.name, - params = _ref40.params, - body = _ref40.body; - - return reducer.reduceFunctionDeclaration(node, { name: name(), params: params(), body: body() }); - }, - reduceFunctionExpression: function reduceFunctionExpression(node, _ref41) { - var name = _ref41.name, - params = _ref41.params, - body = _ref41.body; - - return reducer.reduceFunctionExpression(node, { name: name == null ? null : name(), params: params(), body: body() }); - }, - reduceGetter: function reduceGetter(node, _ref42) { - var name = _ref42.name, - body = _ref42.body; - - return reducer.reduceGetter(node, { name: name(), body: body() }); - }, - reduceIdentifierExpression: function reduceIdentifierExpression(node) { - return reducer.reduceIdentifierExpression(node); - }, - reduceIfStatement: function reduceIfStatement(node, _ref43) { - var test = _ref43.test, - consequent = _ref43.consequent, - alternate = _ref43.alternate; - - return reducer.reduceIfStatement(node, { test: test(), consequent: consequent(), alternate: alternate == null ? null : alternate() }); - }, - reduceImport: function reduceImport(node, _ref44) { - var defaultBinding = _ref44.defaultBinding, - namedImports = _ref44.namedImports; - - return reducer.reduceImport(node, { defaultBinding: defaultBinding == null ? null : defaultBinding(), namedImports: namedImports.map(function (n) { - return n(); - }) }); - }, - reduceImportNamespace: function reduceImportNamespace(node, _ref45) { - var defaultBinding = _ref45.defaultBinding, - namespaceBinding = _ref45.namespaceBinding; - - return reducer.reduceImportNamespace(node, { defaultBinding: defaultBinding == null ? null : defaultBinding(), namespaceBinding: namespaceBinding() }); - }, - reduceImportSpecifier: function reduceImportSpecifier(node, _ref46) { - var binding = _ref46.binding; - - return reducer.reduceImportSpecifier(node, { binding: binding() }); - }, - reduceLabeledStatement: function reduceLabeledStatement(node, _ref47) { - var body = _ref47.body; - - return reducer.reduceLabeledStatement(node, { body: body() }); - }, - reduceLiteralBooleanExpression: function reduceLiteralBooleanExpression(node) { - return reducer.reduceLiteralBooleanExpression(node); - }, - reduceLiteralInfinityExpression: function reduceLiteralInfinityExpression(node) { - return reducer.reduceLiteralInfinityExpression(node); - }, - reduceLiteralNullExpression: function reduceLiteralNullExpression(node) { - return reducer.reduceLiteralNullExpression(node); - }, - reduceLiteralNumericExpression: function reduceLiteralNumericExpression(node) { - return reducer.reduceLiteralNumericExpression(node); - }, - reduceLiteralRegExpExpression: function reduceLiteralRegExpExpression(node) { - return reducer.reduceLiteralRegExpExpression(node); - }, - reduceLiteralStringExpression: function reduceLiteralStringExpression(node) { - return reducer.reduceLiteralStringExpression(node); - }, - reduceMethod: function reduceMethod(node, _ref48) { - var name = _ref48.name, - params = _ref48.params, - body = _ref48.body; - - return reducer.reduceMethod(node, { name: name(), params: params(), body: body() }); - }, - reduceModule: function reduceModule(node, _ref49) { - var directives = _ref49.directives, - items = _ref49.items; - - return reducer.reduceModule(node, { directives: directives.map(function (n) { - return n(); - }), items: items.map(function (n) { - return n(); - }) }); - }, - reduceNewExpression: function reduceNewExpression(node, _ref50) { - var callee = _ref50.callee, - _arguments = _ref50.arguments; - - return reducer.reduceNewExpression(node, { callee: callee(), arguments: _arguments.map(function (n) { - return n(); - }) }); - }, - reduceNewTargetExpression: function reduceNewTargetExpression(node) { - return reducer.reduceNewTargetExpression(node); - }, - reduceObjectAssignmentTarget: function reduceObjectAssignmentTarget(node, _ref51) { - var properties = _ref51.properties, - rest = _ref51.rest; - - return reducer.reduceObjectAssignmentTarget(node, { properties: properties.map(function (n) { - return n(); - }), rest: rest == null ? null : rest() }); - }, - reduceObjectBinding: function reduceObjectBinding(node, _ref52) { - var properties = _ref52.properties, - rest = _ref52.rest; - - return reducer.reduceObjectBinding(node, { properties: properties.map(function (n) { - return n(); - }), rest: rest == null ? null : rest() }); - }, - reduceObjectExpression: function reduceObjectExpression(node, _ref53) { - var properties = _ref53.properties; - - return reducer.reduceObjectExpression(node, { properties: properties.map(function (n) { - return n(); - }) }); - }, - reduceReturnStatement: function reduceReturnStatement(node, _ref54) { - var expression = _ref54.expression; - - return reducer.reduceReturnStatement(node, { expression: expression == null ? null : expression() }); - }, - reduceScript: function reduceScript(node, _ref55) { - var directives = _ref55.directives, - statements = _ref55.statements; - - return reducer.reduceScript(node, { directives: directives.map(function (n) { - return n(); - }), statements: statements.map(function (n) { - return n(); - }) }); - }, - reduceSetter: function reduceSetter(node, _ref56) { - var name = _ref56.name, - param = _ref56.param, - body = _ref56.body; - - return reducer.reduceSetter(node, { name: name(), param: param(), body: body() }); - }, - reduceShorthandProperty: function reduceShorthandProperty(node, _ref57) { - var name = _ref57.name; - - return reducer.reduceShorthandProperty(node, { name: name() }); - }, - reduceSpreadElement: function reduceSpreadElement(node, _ref58) { - var expression = _ref58.expression; - - return reducer.reduceSpreadElement(node, { expression: expression() }); - }, - reduceSpreadProperty: function reduceSpreadProperty(node, _ref59) { - var expression = _ref59.expression; - - return reducer.reduceSpreadProperty(node, { expression: expression() }); - }, - reduceStaticMemberAssignmentTarget: function reduceStaticMemberAssignmentTarget(node, _ref60) { - var object = _ref60.object; - - return reducer.reduceStaticMemberAssignmentTarget(node, { object: object() }); - }, - reduceStaticMemberExpression: function reduceStaticMemberExpression(node, _ref61) { - var object = _ref61.object; - - return reducer.reduceStaticMemberExpression(node, { object: object() }); - }, - reduceStaticPropertyName: function reduceStaticPropertyName(node) { - return reducer.reduceStaticPropertyName(node); - }, - reduceSuper: function reduceSuper(node) { - return reducer.reduceSuper(node); - }, - reduceSwitchCase: function reduceSwitchCase(node, _ref62) { - var test = _ref62.test, - consequent = _ref62.consequent; - - return reducer.reduceSwitchCase(node, { test: test(), consequent: consequent.map(function (n) { - return n(); - }) }); - }, - reduceSwitchDefault: function reduceSwitchDefault(node, _ref63) { - var consequent = _ref63.consequent; - - return reducer.reduceSwitchDefault(node, { consequent: consequent.map(function (n) { - return n(); - }) }); - }, - reduceSwitchStatement: function reduceSwitchStatement(node, _ref64) { - var discriminant = _ref64.discriminant, - cases = _ref64.cases; - - return reducer.reduceSwitchStatement(node, { discriminant: discriminant(), cases: cases.map(function (n) { - return n(); - }) }); - }, - reduceSwitchStatementWithDefault: function reduceSwitchStatementWithDefault(node, _ref65) { - var discriminant = _ref65.discriminant, - preDefaultCases = _ref65.preDefaultCases, - defaultCase = _ref65.defaultCase, - postDefaultCases = _ref65.postDefaultCases; - - return reducer.reduceSwitchStatementWithDefault(node, { discriminant: discriminant(), preDefaultCases: preDefaultCases.map(function (n) { - return n(); - }), defaultCase: defaultCase(), postDefaultCases: postDefaultCases.map(function (n) { - return n(); - }) }); - }, - reduceTemplateElement: function reduceTemplateElement(node) { - return reducer.reduceTemplateElement(node); - }, - reduceTemplateExpression: function reduceTemplateExpression(node, _ref66) { - var tag = _ref66.tag, - elements = _ref66.elements; - - return reducer.reduceTemplateExpression(node, { tag: tag == null ? null : tag(), elements: elements.map(function (n) { - return n(); - }) }); - }, - reduceThisExpression: function reduceThisExpression(node) { - return reducer.reduceThisExpression(node); - }, - reduceThrowStatement: function reduceThrowStatement(node, _ref67) { - var expression = _ref67.expression; - - return reducer.reduceThrowStatement(node, { expression: expression() }); - }, - reduceTryCatchStatement: function reduceTryCatchStatement(node, _ref68) { - var body = _ref68.body, - catchClause = _ref68.catchClause; - - return reducer.reduceTryCatchStatement(node, { body: body(), catchClause: catchClause() }); - }, - reduceTryFinallyStatement: function reduceTryFinallyStatement(node, _ref69) { - var body = _ref69.body, - catchClause = _ref69.catchClause, - finalizer = _ref69.finalizer; - - return reducer.reduceTryFinallyStatement(node, { body: body(), catchClause: catchClause == null ? null : catchClause(), finalizer: finalizer() }); - }, - reduceUnaryExpression: function reduceUnaryExpression(node, _ref70) { - var operand = _ref70.operand; - - return reducer.reduceUnaryExpression(node, { operand: operand() }); - }, - reduceUpdateExpression: function reduceUpdateExpression(node, _ref71) { - var operand = _ref71.operand; - - return reducer.reduceUpdateExpression(node, { operand: operand() }); - }, - reduceVariableDeclaration: function reduceVariableDeclaration(node, _ref72) { - var declarators = _ref72.declarators; - - return reducer.reduceVariableDeclaration(node, { declarators: declarators.map(function (n) { - return n(); - }) }); - }, - reduceVariableDeclarationStatement: function reduceVariableDeclarationStatement(node, _ref73) { - var declaration = _ref73.declaration; - - return reducer.reduceVariableDeclarationStatement(node, { declaration: declaration() }); - }, - reduceVariableDeclarator: function reduceVariableDeclarator(node, _ref74) { - var binding = _ref74.binding, - init = _ref74.init; - - return reducer.reduceVariableDeclarator(node, { binding: binding(), init: init == null ? null : init() }); - }, - reduceWhileStatement: function reduceWhileStatement(node, _ref75) { - var test = _ref75.test, - body = _ref75.body; - - return reducer.reduceWhileStatement(node, { test: test(), body: body() }); - }, - reduceWithStatement: function reduceWithStatement(node, _ref76) { - var object = _ref76.object, - body = _ref76.body; - - return reducer.reduceWithStatement(node, { object: object(), body: body() }); - }, - reduceYieldExpression: function reduceYieldExpression(node, _ref77) { - var expression = _ref77.expression; - - return reducer.reduceYieldExpression(node, { expression: expression == null ? null : expression() }); - }, - reduceYieldGeneratorExpression: function reduceYieldGeneratorExpression(node, _ref78) { - var expression = _ref78.expression; - - return reducer.reduceYieldGeneratorExpression(node, { expression: expression() }); - } - }; -} -}); - -var thunkifyClass_1 = createCommonjsModule(function (module, exports) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -exports.default = thunkifyClass; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -// Generated by generate-thunkify.js -/** - * Copyright 2018 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -function thunkifyClass(reducerClass) { - return function (_reducerClass) { - _inherits(_class, _reducerClass); - - function _class() { - _classCallCheck(this, _class); - - return _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).apply(this, arguments)); - } - - _createClass(_class, [{ - key: "reduceArrayAssignmentTarget", - value: function reduceArrayAssignmentTarget(node, _ref) { - var elements = _ref.elements, - rest = _ref.rest; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceArrayAssignmentTarget", this).call(this, node, { elements: elements.map(function (n) { - return n == null ? null : n(); - }), rest: rest == null ? null : rest() }); - } - }, { - key: "reduceArrayBinding", - value: function reduceArrayBinding(node, _ref2) { - var elements = _ref2.elements, - rest = _ref2.rest; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceArrayBinding", this).call(this, node, { elements: elements.map(function (n) { - return n == null ? null : n(); - }), rest: rest == null ? null : rest() }); - } - }, { - key: "reduceArrayExpression", - value: function reduceArrayExpression(node, _ref3) { - var elements = _ref3.elements; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceArrayExpression", this).call(this, node, { elements: elements.map(function (n) { - return n == null ? null : n(); - }) }); - } - }, { - key: "reduceArrowExpression", - value: function reduceArrowExpression(node, _ref4) { - var params = _ref4.params, - body = _ref4.body; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceArrowExpression", this).call(this, node, { params: params(), body: body() }); - } - }, { - key: "reduceAssignmentExpression", - value: function reduceAssignmentExpression(node, _ref5) { - var binding = _ref5.binding, - expression = _ref5.expression; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceAssignmentExpression", this).call(this, node, { binding: binding(), expression: expression() }); - } - }, { - key: "reduceAssignmentTargetIdentifier", - value: function reduceAssignmentTargetIdentifier(node) { - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceAssignmentTargetIdentifier", this).call(this, node); - } - }, { - key: "reduceAssignmentTargetPropertyIdentifier", - value: function reduceAssignmentTargetPropertyIdentifier(node, _ref6) { - var binding = _ref6.binding, - init = _ref6.init; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceAssignmentTargetPropertyIdentifier", this).call(this, node, { binding: binding(), init: init == null ? null : init() }); - } - }, { - key: "reduceAssignmentTargetPropertyProperty", - value: function reduceAssignmentTargetPropertyProperty(node, _ref7) { - var name = _ref7.name, - binding = _ref7.binding; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceAssignmentTargetPropertyProperty", this).call(this, node, { name: name(), binding: binding() }); - } - }, { - key: "reduceAssignmentTargetWithDefault", - value: function reduceAssignmentTargetWithDefault(node, _ref8) { - var binding = _ref8.binding, - init = _ref8.init; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceAssignmentTargetWithDefault", this).call(this, node, { binding: binding(), init: init() }); - } - }, { - key: "reduceAwaitExpression", - value: function reduceAwaitExpression(node, _ref9) { - var expression = _ref9.expression; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceAwaitExpression", this).call(this, node, { expression: expression() }); - } - }, { - key: "reduceBinaryExpression", - value: function reduceBinaryExpression(node, _ref10) { - var left = _ref10.left, - right = _ref10.right; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceBinaryExpression", this).call(this, node, { left: left(), right: right() }); - } - }, { - key: "reduceBindingIdentifier", - value: function reduceBindingIdentifier(node) { - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceBindingIdentifier", this).call(this, node); - } - }, { - key: "reduceBindingPropertyIdentifier", - value: function reduceBindingPropertyIdentifier(node, _ref11) { - var binding = _ref11.binding, - init = _ref11.init; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceBindingPropertyIdentifier", this).call(this, node, { binding: binding(), init: init == null ? null : init() }); - } - }, { - key: "reduceBindingPropertyProperty", - value: function reduceBindingPropertyProperty(node, _ref12) { - var name = _ref12.name, - binding = _ref12.binding; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceBindingPropertyProperty", this).call(this, node, { name: name(), binding: binding() }); - } - }, { - key: "reduceBindingWithDefault", - value: function reduceBindingWithDefault(node, _ref13) { - var binding = _ref13.binding, - init = _ref13.init; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceBindingWithDefault", this).call(this, node, { binding: binding(), init: init() }); - } - }, { - key: "reduceBlock", - value: function reduceBlock(node, _ref14) { - var statements = _ref14.statements; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceBlock", this).call(this, node, { statements: statements.map(function (n) { - return n(); - }) }); - } - }, { - key: "reduceBlockStatement", - value: function reduceBlockStatement(node, _ref15) { - var block = _ref15.block; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceBlockStatement", this).call(this, node, { block: block() }); - } - }, { - key: "reduceBreakStatement", - value: function reduceBreakStatement(node) { - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceBreakStatement", this).call(this, node); - } - }, { - key: "reduceCallExpression", - value: function reduceCallExpression(node, _ref16) { - var callee = _ref16.callee, - _arguments = _ref16.arguments; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceCallExpression", this).call(this, node, { callee: callee(), arguments: _arguments.map(function (n) { - return n(); - }) }); - } - }, { - key: "reduceCatchClause", - value: function reduceCatchClause(node, _ref17) { - var binding = _ref17.binding, - body = _ref17.body; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceCatchClause", this).call(this, node, { binding: binding(), body: body() }); - } - }, { - key: "reduceClassDeclaration", - value: function reduceClassDeclaration(node, _ref18) { - var name = _ref18.name, - _super = _ref18.super, - elements = _ref18.elements; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceClassDeclaration", this).call(this, node, { name: name(), super: _super == null ? null : _super(), elements: elements.map(function (n) { - return n(); - }) }); - } - }, { - key: "reduceClassElement", - value: function reduceClassElement(node, _ref19) { - var method = _ref19.method; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceClassElement", this).call(this, node, { method: method() }); - } - }, { - key: "reduceClassExpression", - value: function reduceClassExpression(node, _ref20) { - var name = _ref20.name, - _super = _ref20.super, - elements = _ref20.elements; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceClassExpression", this).call(this, node, { name: name == null ? null : name(), super: _super == null ? null : _super(), elements: elements.map(function (n) { - return n(); - }) }); - } - }, { - key: "reduceCompoundAssignmentExpression", - value: function reduceCompoundAssignmentExpression(node, _ref21) { - var binding = _ref21.binding, - expression = _ref21.expression; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceCompoundAssignmentExpression", this).call(this, node, { binding: binding(), expression: expression() }); - } - }, { - key: "reduceComputedMemberAssignmentTarget", - value: function reduceComputedMemberAssignmentTarget(node, _ref22) { - var object = _ref22.object, - expression = _ref22.expression; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceComputedMemberAssignmentTarget", this).call(this, node, { object: object(), expression: expression() }); - } - }, { - key: "reduceComputedMemberExpression", - value: function reduceComputedMemberExpression(node, _ref23) { - var object = _ref23.object, - expression = _ref23.expression; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceComputedMemberExpression", this).call(this, node, { object: object(), expression: expression() }); - } - }, { - key: "reduceComputedPropertyName", - value: function reduceComputedPropertyName(node, _ref24) { - var expression = _ref24.expression; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceComputedPropertyName", this).call(this, node, { expression: expression() }); - } - }, { - key: "reduceConditionalExpression", - value: function reduceConditionalExpression(node, _ref25) { - var test = _ref25.test, - consequent = _ref25.consequent, - alternate = _ref25.alternate; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceConditionalExpression", this).call(this, node, { test: test(), consequent: consequent(), alternate: alternate() }); - } - }, { - key: "reduceContinueStatement", - value: function reduceContinueStatement(node) { - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceContinueStatement", this).call(this, node); - } - }, { - key: "reduceDataProperty", - value: function reduceDataProperty(node, _ref26) { - var name = _ref26.name, - expression = _ref26.expression; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceDataProperty", this).call(this, node, { name: name(), expression: expression() }); - } - }, { - key: "reduceDebuggerStatement", - value: function reduceDebuggerStatement(node) { - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceDebuggerStatement", this).call(this, node); - } - }, { - key: "reduceDirective", - value: function reduceDirective(node) { - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceDirective", this).call(this, node); - } - }, { - key: "reduceDoWhileStatement", - value: function reduceDoWhileStatement(node, _ref27) { - var body = _ref27.body, - test = _ref27.test; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceDoWhileStatement", this).call(this, node, { body: body(), test: test() }); - } - }, { - key: "reduceEmptyStatement", - value: function reduceEmptyStatement(node) { - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceEmptyStatement", this).call(this, node); - } - }, { - key: "reduceExport", - value: function reduceExport(node, _ref28) { - var declaration = _ref28.declaration; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceExport", this).call(this, node, { declaration: declaration() }); - } - }, { - key: "reduceExportAllFrom", - value: function reduceExportAllFrom(node) { - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceExportAllFrom", this).call(this, node); - } - }, { - key: "reduceExportDefault", - value: function reduceExportDefault(node, _ref29) { - var body = _ref29.body; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceExportDefault", this).call(this, node, { body: body() }); - } - }, { - key: "reduceExportFrom", - value: function reduceExportFrom(node, _ref30) { - var namedExports = _ref30.namedExports; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceExportFrom", this).call(this, node, { namedExports: namedExports.map(function (n) { - return n(); - }) }); - } - }, { - key: "reduceExportFromSpecifier", - value: function reduceExportFromSpecifier(node) { - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceExportFromSpecifier", this).call(this, node); - } - }, { - key: "reduceExportLocalSpecifier", - value: function reduceExportLocalSpecifier(node, _ref31) { - var name = _ref31.name; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceExportLocalSpecifier", this).call(this, node, { name: name() }); - } - }, { - key: "reduceExportLocals", - value: function reduceExportLocals(node, _ref32) { - var namedExports = _ref32.namedExports; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceExportLocals", this).call(this, node, { namedExports: namedExports.map(function (n) { - return n(); - }) }); - } - }, { - key: "reduceExpressionStatement", - value: function reduceExpressionStatement(node, _ref33) { - var expression = _ref33.expression; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceExpressionStatement", this).call(this, node, { expression: expression() }); - } - }, { - key: "reduceForAwaitStatement", - value: function reduceForAwaitStatement(node, _ref34) { - var left = _ref34.left, - right = _ref34.right, - body = _ref34.body; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceForAwaitStatement", this).call(this, node, { left: left(), right: right(), body: body() }); - } - }, { - key: "reduceForInStatement", - value: function reduceForInStatement(node, _ref35) { - var left = _ref35.left, - right = _ref35.right, - body = _ref35.body; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceForInStatement", this).call(this, node, { left: left(), right: right(), body: body() }); - } - }, { - key: "reduceForOfStatement", - value: function reduceForOfStatement(node, _ref36) { - var left = _ref36.left, - right = _ref36.right, - body = _ref36.body; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceForOfStatement", this).call(this, node, { left: left(), right: right(), body: body() }); - } - }, { - key: "reduceForStatement", - value: function reduceForStatement(node, _ref37) { - var init = _ref37.init, - test = _ref37.test, - update = _ref37.update, - body = _ref37.body; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceForStatement", this).call(this, node, { init: init == null ? null : init(), test: test == null ? null : test(), update: update == null ? null : update(), body: body() }); - } - }, { - key: "reduceFormalParameters", - value: function reduceFormalParameters(node, _ref38) { - var items = _ref38.items, - rest = _ref38.rest; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceFormalParameters", this).call(this, node, { items: items.map(function (n) { - return n(); - }), rest: rest == null ? null : rest() }); - } - }, { - key: "reduceFunctionBody", - value: function reduceFunctionBody(node, _ref39) { - var directives = _ref39.directives, - statements = _ref39.statements; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceFunctionBody", this).call(this, node, { directives: directives.map(function (n) { - return n(); - }), statements: statements.map(function (n) { - return n(); - }) }); - } - }, { - key: "reduceFunctionDeclaration", - value: function reduceFunctionDeclaration(node, _ref40) { - var name = _ref40.name, - params = _ref40.params, - body = _ref40.body; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceFunctionDeclaration", this).call(this, node, { name: name(), params: params(), body: body() }); - } - }, { - key: "reduceFunctionExpression", - value: function reduceFunctionExpression(node, _ref41) { - var name = _ref41.name, - params = _ref41.params, - body = _ref41.body; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceFunctionExpression", this).call(this, node, { name: name == null ? null : name(), params: params(), body: body() }); - } - }, { - key: "reduceGetter", - value: function reduceGetter(node, _ref42) { - var name = _ref42.name, - body = _ref42.body; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceGetter", this).call(this, node, { name: name(), body: body() }); - } - }, { - key: "reduceIdentifierExpression", - value: function reduceIdentifierExpression(node) { - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceIdentifierExpression", this).call(this, node); - } - }, { - key: "reduceIfStatement", - value: function reduceIfStatement(node, _ref43) { - var test = _ref43.test, - consequent = _ref43.consequent, - alternate = _ref43.alternate; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceIfStatement", this).call(this, node, { test: test(), consequent: consequent(), alternate: alternate == null ? null : alternate() }); - } - }, { - key: "reduceImport", - value: function reduceImport(node, _ref44) { - var defaultBinding = _ref44.defaultBinding, - namedImports = _ref44.namedImports; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceImport", this).call(this, node, { defaultBinding: defaultBinding == null ? null : defaultBinding(), namedImports: namedImports.map(function (n) { - return n(); - }) }); - } - }, { - key: "reduceImportNamespace", - value: function reduceImportNamespace(node, _ref45) { - var defaultBinding = _ref45.defaultBinding, - namespaceBinding = _ref45.namespaceBinding; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceImportNamespace", this).call(this, node, { defaultBinding: defaultBinding == null ? null : defaultBinding(), namespaceBinding: namespaceBinding() }); - } - }, { - key: "reduceImportSpecifier", - value: function reduceImportSpecifier(node, _ref46) { - var binding = _ref46.binding; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceImportSpecifier", this).call(this, node, { binding: binding() }); - } - }, { - key: "reduceLabeledStatement", - value: function reduceLabeledStatement(node, _ref47) { - var body = _ref47.body; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceLabeledStatement", this).call(this, node, { body: body() }); - } - }, { - key: "reduceLiteralBooleanExpression", - value: function reduceLiteralBooleanExpression(node) { - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceLiteralBooleanExpression", this).call(this, node); - } - }, { - key: "reduceLiteralInfinityExpression", - value: function reduceLiteralInfinityExpression(node) { - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceLiteralInfinityExpression", this).call(this, node); - } - }, { - key: "reduceLiteralNullExpression", - value: function reduceLiteralNullExpression(node) { - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceLiteralNullExpression", this).call(this, node); - } - }, { - key: "reduceLiteralNumericExpression", - value: function reduceLiteralNumericExpression(node) { - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceLiteralNumericExpression", this).call(this, node); - } - }, { - key: "reduceLiteralRegExpExpression", - value: function reduceLiteralRegExpExpression(node) { - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceLiteralRegExpExpression", this).call(this, node); - } - }, { - key: "reduceLiteralStringExpression", - value: function reduceLiteralStringExpression(node) { - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceLiteralStringExpression", this).call(this, node); - } - }, { - key: "reduceMethod", - value: function reduceMethod(node, _ref48) { - var name = _ref48.name, - params = _ref48.params, - body = _ref48.body; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceMethod", this).call(this, node, { name: name(), params: params(), body: body() }); - } - }, { - key: "reduceModule", - value: function reduceModule(node, _ref49) { - var directives = _ref49.directives, - items = _ref49.items; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceModule", this).call(this, node, { directives: directives.map(function (n) { - return n(); - }), items: items.map(function (n) { - return n(); - }) }); - } - }, { - key: "reduceNewExpression", - value: function reduceNewExpression(node, _ref50) { - var callee = _ref50.callee, - _arguments = _ref50.arguments; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceNewExpression", this).call(this, node, { callee: callee(), arguments: _arguments.map(function (n) { - return n(); - }) }); - } - }, { - key: "reduceNewTargetExpression", - value: function reduceNewTargetExpression(node) { - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceNewTargetExpression", this).call(this, node); - } - }, { - key: "reduceObjectAssignmentTarget", - value: function reduceObjectAssignmentTarget(node, _ref51) { - var properties = _ref51.properties, - rest = _ref51.rest; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceObjectAssignmentTarget", this).call(this, node, { properties: properties.map(function (n) { - return n(); - }), rest: rest == null ? null : rest() }); - } - }, { - key: "reduceObjectBinding", - value: function reduceObjectBinding(node, _ref52) { - var properties = _ref52.properties, - rest = _ref52.rest; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceObjectBinding", this).call(this, node, { properties: properties.map(function (n) { - return n(); - }), rest: rest == null ? null : rest() }); - } - }, { - key: "reduceObjectExpression", - value: function reduceObjectExpression(node, _ref53) { - var properties = _ref53.properties; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceObjectExpression", this).call(this, node, { properties: properties.map(function (n) { - return n(); - }) }); - } - }, { - key: "reduceReturnStatement", - value: function reduceReturnStatement(node, _ref54) { - var expression = _ref54.expression; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceReturnStatement", this).call(this, node, { expression: expression == null ? null : expression() }); - } - }, { - key: "reduceScript", - value: function reduceScript(node, _ref55) { - var directives = _ref55.directives, - statements = _ref55.statements; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceScript", this).call(this, node, { directives: directives.map(function (n) { - return n(); - }), statements: statements.map(function (n) { - return n(); - }) }); - } - }, { - key: "reduceSetter", - value: function reduceSetter(node, _ref56) { - var name = _ref56.name, - param = _ref56.param, - body = _ref56.body; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceSetter", this).call(this, node, { name: name(), param: param(), body: body() }); - } - }, { - key: "reduceShorthandProperty", - value: function reduceShorthandProperty(node, _ref57) { - var name = _ref57.name; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceShorthandProperty", this).call(this, node, { name: name() }); - } - }, { - key: "reduceSpreadElement", - value: function reduceSpreadElement(node, _ref58) { - var expression = _ref58.expression; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceSpreadElement", this).call(this, node, { expression: expression() }); - } - }, { - key: "reduceSpreadProperty", - value: function reduceSpreadProperty(node, _ref59) { - var expression = _ref59.expression; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceSpreadProperty", this).call(this, node, { expression: expression() }); - } - }, { - key: "reduceStaticMemberAssignmentTarget", - value: function reduceStaticMemberAssignmentTarget(node, _ref60) { - var object = _ref60.object; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceStaticMemberAssignmentTarget", this).call(this, node, { object: object() }); - } - }, { - key: "reduceStaticMemberExpression", - value: function reduceStaticMemberExpression(node, _ref61) { - var object = _ref61.object; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceStaticMemberExpression", this).call(this, node, { object: object() }); - } - }, { - key: "reduceStaticPropertyName", - value: function reduceStaticPropertyName(node) { - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceStaticPropertyName", this).call(this, node); - } - }, { - key: "reduceSuper", - value: function reduceSuper(node) { - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceSuper", this).call(this, node); - } - }, { - key: "reduceSwitchCase", - value: function reduceSwitchCase(node, _ref62) { - var test = _ref62.test, - consequent = _ref62.consequent; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceSwitchCase", this).call(this, node, { test: test(), consequent: consequent.map(function (n) { - return n(); - }) }); - } - }, { - key: "reduceSwitchDefault", - value: function reduceSwitchDefault(node, _ref63) { - var consequent = _ref63.consequent; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceSwitchDefault", this).call(this, node, { consequent: consequent.map(function (n) { - return n(); - }) }); - } - }, { - key: "reduceSwitchStatement", - value: function reduceSwitchStatement(node, _ref64) { - var discriminant = _ref64.discriminant, - cases = _ref64.cases; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceSwitchStatement", this).call(this, node, { discriminant: discriminant(), cases: cases.map(function (n) { - return n(); - }) }); - } - }, { - key: "reduceSwitchStatementWithDefault", - value: function reduceSwitchStatementWithDefault(node, _ref65) { - var discriminant = _ref65.discriminant, - preDefaultCases = _ref65.preDefaultCases, - defaultCase = _ref65.defaultCase, - postDefaultCases = _ref65.postDefaultCases; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceSwitchStatementWithDefault", this).call(this, node, { discriminant: discriminant(), preDefaultCases: preDefaultCases.map(function (n) { - return n(); - }), defaultCase: defaultCase(), postDefaultCases: postDefaultCases.map(function (n) { - return n(); - }) }); - } - }, { - key: "reduceTemplateElement", - value: function reduceTemplateElement(node) { - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceTemplateElement", this).call(this, node); - } - }, { - key: "reduceTemplateExpression", - value: function reduceTemplateExpression(node, _ref66) { - var tag = _ref66.tag, - elements = _ref66.elements; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceTemplateExpression", this).call(this, node, { tag: tag == null ? null : tag(), elements: elements.map(function (n) { - return n(); - }) }); - } - }, { - key: "reduceThisExpression", - value: function reduceThisExpression(node) { - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceThisExpression", this).call(this, node); - } - }, { - key: "reduceThrowStatement", - value: function reduceThrowStatement(node, _ref67) { - var expression = _ref67.expression; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceThrowStatement", this).call(this, node, { expression: expression() }); - } - }, { - key: "reduceTryCatchStatement", - value: function reduceTryCatchStatement(node, _ref68) { - var body = _ref68.body, - catchClause = _ref68.catchClause; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceTryCatchStatement", this).call(this, node, { body: body(), catchClause: catchClause() }); - } - }, { - key: "reduceTryFinallyStatement", - value: function reduceTryFinallyStatement(node, _ref69) { - var body = _ref69.body, - catchClause = _ref69.catchClause, - finalizer = _ref69.finalizer; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceTryFinallyStatement", this).call(this, node, { body: body(), catchClause: catchClause == null ? null : catchClause(), finalizer: finalizer() }); - } - }, { - key: "reduceUnaryExpression", - value: function reduceUnaryExpression(node, _ref70) { - var operand = _ref70.operand; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceUnaryExpression", this).call(this, node, { operand: operand() }); - } - }, { - key: "reduceUpdateExpression", - value: function reduceUpdateExpression(node, _ref71) { - var operand = _ref71.operand; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceUpdateExpression", this).call(this, node, { operand: operand() }); - } - }, { - key: "reduceVariableDeclaration", - value: function reduceVariableDeclaration(node, _ref72) { - var declarators = _ref72.declarators; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceVariableDeclaration", this).call(this, node, { declarators: declarators.map(function (n) { - return n(); - }) }); - } - }, { - key: "reduceVariableDeclarationStatement", - value: function reduceVariableDeclarationStatement(node, _ref73) { - var declaration = _ref73.declaration; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceVariableDeclarationStatement", this).call(this, node, { declaration: declaration() }); - } - }, { - key: "reduceVariableDeclarator", - value: function reduceVariableDeclarator(node, _ref74) { - var binding = _ref74.binding, - init = _ref74.init; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceVariableDeclarator", this).call(this, node, { binding: binding(), init: init == null ? null : init() }); - } - }, { - key: "reduceWhileStatement", - value: function reduceWhileStatement(node, _ref75) { - var test = _ref75.test, - body = _ref75.body; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceWhileStatement", this).call(this, node, { test: test(), body: body() }); - } - }, { - key: "reduceWithStatement", - value: function reduceWithStatement(node, _ref76) { - var object = _ref76.object, - body = _ref76.body; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceWithStatement", this).call(this, node, { object: object(), body: body() }); - } - }, { - key: "reduceYieldExpression", - value: function reduceYieldExpression(node, _ref77) { - var expression = _ref77.expression; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceYieldExpression", this).call(this, node, { expression: expression == null ? null : expression() }); - } - }, { - key: "reduceYieldGeneratorExpression", - value: function reduceYieldGeneratorExpression(node, _ref78) { - var expression = _ref78.expression; - - return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceYieldGeneratorExpression", this).call(this, node, { expression: expression() }); - } - }]); - - return _class; - }(reducerClass); -} -}); - -var memoize_1 = createCommonjsModule(function (module, exports) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = memoize; - - - -var Shift = _interopRequireWildcard(dist$2); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function memoize(reducer) { - var cache = new WeakMap(); - return { - reduceArrayAssignmentTarget: function reduceArrayAssignmentTarget(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceArrayAssignmentTarget(node, arg); - cache.set(node, res); - return res; - }, - reduceArrayBinding: function reduceArrayBinding(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceArrayBinding(node, arg); - cache.set(node, res); - return res; - }, - reduceArrayExpression: function reduceArrayExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceArrayExpression(node, arg); - cache.set(node, res); - return res; - }, - reduceArrowExpression: function reduceArrowExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceArrowExpression(node, arg); - cache.set(node, res); - return res; - }, - reduceAssignmentExpression: function reduceAssignmentExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceAssignmentExpression(node, arg); - cache.set(node, res); - return res; - }, - reduceAssignmentTargetIdentifier: function reduceAssignmentTargetIdentifier(node) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceAssignmentTargetIdentifier(node); - cache.set(node, res); - return res; - }, - reduceAssignmentTargetPropertyIdentifier: function reduceAssignmentTargetPropertyIdentifier(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceAssignmentTargetPropertyIdentifier(node, arg); - cache.set(node, res); - return res; - }, - reduceAssignmentTargetPropertyProperty: function reduceAssignmentTargetPropertyProperty(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceAssignmentTargetPropertyProperty(node, arg); - cache.set(node, res); - return res; - }, - reduceAssignmentTargetWithDefault: function reduceAssignmentTargetWithDefault(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceAssignmentTargetWithDefault(node, arg); - cache.set(node, res); - return res; - }, - reduceAwaitExpression: function reduceAwaitExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceAwaitExpression(node, arg); - cache.set(node, res); - return res; - }, - reduceBinaryExpression: function reduceBinaryExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceBinaryExpression(node, arg); - cache.set(node, res); - return res; - }, - reduceBindingIdentifier: function reduceBindingIdentifier(node) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceBindingIdentifier(node); - cache.set(node, res); - return res; - }, - reduceBindingPropertyIdentifier: function reduceBindingPropertyIdentifier(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceBindingPropertyIdentifier(node, arg); - cache.set(node, res); - return res; - }, - reduceBindingPropertyProperty: function reduceBindingPropertyProperty(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceBindingPropertyProperty(node, arg); - cache.set(node, res); - return res; - }, - reduceBindingWithDefault: function reduceBindingWithDefault(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceBindingWithDefault(node, arg); - cache.set(node, res); - return res; - }, - reduceBlock: function reduceBlock(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceBlock(node, arg); - cache.set(node, res); - return res; - }, - reduceBlockStatement: function reduceBlockStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceBlockStatement(node, arg); - cache.set(node, res); - return res; - }, - reduceBreakStatement: function reduceBreakStatement(node) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceBreakStatement(node); - cache.set(node, res); - return res; - }, - reduceCallExpression: function reduceCallExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceCallExpression(node, arg); - cache.set(node, res); - return res; - }, - reduceCatchClause: function reduceCatchClause(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceCatchClause(node, arg); - cache.set(node, res); - return res; - }, - reduceClassDeclaration: function reduceClassDeclaration(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceClassDeclaration(node, arg); - cache.set(node, res); - return res; - }, - reduceClassElement: function reduceClassElement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceClassElement(node, arg); - cache.set(node, res); - return res; - }, - reduceClassExpression: function reduceClassExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceClassExpression(node, arg); - cache.set(node, res); - return res; - }, - reduceCompoundAssignmentExpression: function reduceCompoundAssignmentExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceCompoundAssignmentExpression(node, arg); - cache.set(node, res); - return res; - }, - reduceComputedMemberAssignmentTarget: function reduceComputedMemberAssignmentTarget(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceComputedMemberAssignmentTarget(node, arg); - cache.set(node, res); - return res; - }, - reduceComputedMemberExpression: function reduceComputedMemberExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceComputedMemberExpression(node, arg); - cache.set(node, res); - return res; - }, - reduceComputedPropertyName: function reduceComputedPropertyName(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceComputedPropertyName(node, arg); - cache.set(node, res); - return res; - }, - reduceConditionalExpression: function reduceConditionalExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceConditionalExpression(node, arg); - cache.set(node, res); - return res; - }, - reduceContinueStatement: function reduceContinueStatement(node) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceContinueStatement(node); - cache.set(node, res); - return res; - }, - reduceDataProperty: function reduceDataProperty(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceDataProperty(node, arg); - cache.set(node, res); - return res; - }, - reduceDebuggerStatement: function reduceDebuggerStatement(node) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceDebuggerStatement(node); - cache.set(node, res); - return res; - }, - reduceDirective: function reduceDirective(node) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceDirective(node); - cache.set(node, res); - return res; - }, - reduceDoWhileStatement: function reduceDoWhileStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceDoWhileStatement(node, arg); - cache.set(node, res); - return res; - }, - reduceEmptyStatement: function reduceEmptyStatement(node) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceEmptyStatement(node); - cache.set(node, res); - return res; - }, - reduceExport: function reduceExport(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceExport(node, arg); - cache.set(node, res); - return res; - }, - reduceExportAllFrom: function reduceExportAllFrom(node) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceExportAllFrom(node); - cache.set(node, res); - return res; - }, - reduceExportDefault: function reduceExportDefault(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceExportDefault(node, arg); - cache.set(node, res); - return res; - }, - reduceExportFrom: function reduceExportFrom(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceExportFrom(node, arg); - cache.set(node, res); - return res; - }, - reduceExportFromSpecifier: function reduceExportFromSpecifier(node) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceExportFromSpecifier(node); - cache.set(node, res); - return res; - }, - reduceExportLocalSpecifier: function reduceExportLocalSpecifier(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceExportLocalSpecifier(node, arg); - cache.set(node, res); - return res; - }, - reduceExportLocals: function reduceExportLocals(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceExportLocals(node, arg); - cache.set(node, res); - return res; - }, - reduceExpressionStatement: function reduceExpressionStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceExpressionStatement(node, arg); - cache.set(node, res); - return res; - }, - reduceForAwaitStatement: function reduceForAwaitStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceForAwaitStatement(node, arg); - cache.set(node, res); - return res; - }, - reduceForInStatement: function reduceForInStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceForInStatement(node, arg); - cache.set(node, res); - return res; - }, - reduceForOfStatement: function reduceForOfStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceForOfStatement(node, arg); - cache.set(node, res); - return res; - }, - reduceForStatement: function reduceForStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceForStatement(node, arg); - cache.set(node, res); - return res; - }, - reduceFormalParameters: function reduceFormalParameters(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceFormalParameters(node, arg); - cache.set(node, res); - return res; - }, - reduceFunctionBody: function reduceFunctionBody(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceFunctionBody(node, arg); - cache.set(node, res); - return res; - }, - reduceFunctionDeclaration: function reduceFunctionDeclaration(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceFunctionDeclaration(node, arg); - cache.set(node, res); - return res; - }, - reduceFunctionExpression: function reduceFunctionExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceFunctionExpression(node, arg); - cache.set(node, res); - return res; - }, - reduceGetter: function reduceGetter(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceGetter(node, arg); - cache.set(node, res); - return res; - }, - reduceIdentifierExpression: function reduceIdentifierExpression(node) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceIdentifierExpression(node); - cache.set(node, res); - return res; - }, - reduceIfStatement: function reduceIfStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceIfStatement(node, arg); - cache.set(node, res); - return res; - }, - reduceImport: function reduceImport(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceImport(node, arg); - cache.set(node, res); - return res; - }, - reduceImportNamespace: function reduceImportNamespace(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceImportNamespace(node, arg); - cache.set(node, res); - return res; - }, - reduceImportSpecifier: function reduceImportSpecifier(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceImportSpecifier(node, arg); - cache.set(node, res); - return res; - }, - reduceLabeledStatement: function reduceLabeledStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceLabeledStatement(node, arg); - cache.set(node, res); - return res; - }, - reduceLiteralBooleanExpression: function reduceLiteralBooleanExpression(node) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceLiteralBooleanExpression(node); - cache.set(node, res); - return res; - }, - reduceLiteralInfinityExpression: function reduceLiteralInfinityExpression(node) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceLiteralInfinityExpression(node); - cache.set(node, res); - return res; - }, - reduceLiteralNullExpression: function reduceLiteralNullExpression(node) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceLiteralNullExpression(node); - cache.set(node, res); - return res; - }, - reduceLiteralNumericExpression: function reduceLiteralNumericExpression(node) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceLiteralNumericExpression(node); - cache.set(node, res); - return res; - }, - reduceLiteralRegExpExpression: function reduceLiteralRegExpExpression(node) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceLiteralRegExpExpression(node); - cache.set(node, res); - return res; - }, - reduceLiteralStringExpression: function reduceLiteralStringExpression(node) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceLiteralStringExpression(node); - cache.set(node, res); - return res; - }, - reduceMethod: function reduceMethod(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceMethod(node, arg); - cache.set(node, res); - return res; - }, - reduceModule: function reduceModule(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceModule(node, arg); - cache.set(node, res); - return res; - }, - reduceNewExpression: function reduceNewExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceNewExpression(node, arg); - cache.set(node, res); - return res; - }, - reduceNewTargetExpression: function reduceNewTargetExpression(node) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceNewTargetExpression(node); - cache.set(node, res); - return res; - }, - reduceObjectAssignmentTarget: function reduceObjectAssignmentTarget(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceObjectAssignmentTarget(node, arg); - cache.set(node, res); - return res; - }, - reduceObjectBinding: function reduceObjectBinding(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceObjectBinding(node, arg); - cache.set(node, res); - return res; - }, - reduceObjectExpression: function reduceObjectExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceObjectExpression(node, arg); - cache.set(node, res); - return res; - }, - reduceReturnStatement: function reduceReturnStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceReturnStatement(node, arg); - cache.set(node, res); - return res; - }, - reduceScript: function reduceScript(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceScript(node, arg); - cache.set(node, res); - return res; - }, - reduceSetter: function reduceSetter(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceSetter(node, arg); - cache.set(node, res); - return res; - }, - reduceShorthandProperty: function reduceShorthandProperty(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceShorthandProperty(node, arg); - cache.set(node, res); - return res; - }, - reduceSpreadElement: function reduceSpreadElement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceSpreadElement(node, arg); - cache.set(node, res); - return res; - }, - reduceSpreadProperty: function reduceSpreadProperty(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceSpreadProperty(node, arg); - cache.set(node, res); - return res; - }, - reduceStaticMemberAssignmentTarget: function reduceStaticMemberAssignmentTarget(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceStaticMemberAssignmentTarget(node, arg); - cache.set(node, res); - return res; - }, - reduceStaticMemberExpression: function reduceStaticMemberExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceStaticMemberExpression(node, arg); - cache.set(node, res); - return res; - }, - reduceStaticPropertyName: function reduceStaticPropertyName(node) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceStaticPropertyName(node); - cache.set(node, res); - return res; - }, - reduceSuper: function reduceSuper(node) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceSuper(node); - cache.set(node, res); - return res; - }, - reduceSwitchCase: function reduceSwitchCase(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceSwitchCase(node, arg); - cache.set(node, res); - return res; - }, - reduceSwitchDefault: function reduceSwitchDefault(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceSwitchDefault(node, arg); - cache.set(node, res); - return res; - }, - reduceSwitchStatement: function reduceSwitchStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceSwitchStatement(node, arg); - cache.set(node, res); - return res; - }, - reduceSwitchStatementWithDefault: function reduceSwitchStatementWithDefault(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceSwitchStatementWithDefault(node, arg); - cache.set(node, res); - return res; - }, - reduceTemplateElement: function reduceTemplateElement(node) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceTemplateElement(node); - cache.set(node, res); - return res; - }, - reduceTemplateExpression: function reduceTemplateExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceTemplateExpression(node, arg); - cache.set(node, res); - return res; - }, - reduceThisExpression: function reduceThisExpression(node) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceThisExpression(node); - cache.set(node, res); - return res; - }, - reduceThrowStatement: function reduceThrowStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceThrowStatement(node, arg); - cache.set(node, res); - return res; - }, - reduceTryCatchStatement: function reduceTryCatchStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceTryCatchStatement(node, arg); - cache.set(node, res); - return res; - }, - reduceTryFinallyStatement: function reduceTryFinallyStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceTryFinallyStatement(node, arg); - cache.set(node, res); - return res; - }, - reduceUnaryExpression: function reduceUnaryExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceUnaryExpression(node, arg); - cache.set(node, res); - return res; - }, - reduceUpdateExpression: function reduceUpdateExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceUpdateExpression(node, arg); - cache.set(node, res); - return res; - }, - reduceVariableDeclaration: function reduceVariableDeclaration(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceVariableDeclaration(node, arg); - cache.set(node, res); - return res; - }, - reduceVariableDeclarationStatement: function reduceVariableDeclarationStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceVariableDeclarationStatement(node, arg); - cache.set(node, res); - return res; - }, - reduceVariableDeclarator: function reduceVariableDeclarator(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceVariableDeclarator(node, arg); - cache.set(node, res); - return res; - }, - reduceWhileStatement: function reduceWhileStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceWhileStatement(node, arg); - cache.set(node, res); - return res; - }, - reduceWithStatement: function reduceWithStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceWithStatement(node, arg); - cache.set(node, res); - return res; - }, - reduceYieldExpression: function reduceYieldExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceYieldExpression(node, arg); - cache.set(node, res); - return res; - }, - reduceYieldGeneratorExpression: function reduceYieldGeneratorExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - var res = reducer.reduceYieldGeneratorExpression(node, arg); - cache.set(node, res); - return res; - } - }; -} // Generated by generate-memoize.js -/** - * Copyright 2018 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -}); - -var cloneReducer = createCommonjsModule(function (module, exports) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); // Generated by generate-clone-reducer.js -/** - * Copyright 2018 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - - -var Shift = _interopRequireWildcard(dist$2); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var CloneReducer = function () { - function CloneReducer() { - _classCallCheck(this, CloneReducer); - } - - _createClass(CloneReducer, [{ - key: 'reduceArrayAssignmentTarget', - value: function reduceArrayAssignmentTarget(node, _ref) { - var elements = _ref.elements, - rest = _ref.rest; - - return new Shift.ArrayAssignmentTarget({ elements: elements, rest: rest }); - } - }, { - key: 'reduceArrayBinding', - value: function reduceArrayBinding(node, _ref2) { - var elements = _ref2.elements, - rest = _ref2.rest; - - return new Shift.ArrayBinding({ elements: elements, rest: rest }); - } - }, { - key: 'reduceArrayExpression', - value: function reduceArrayExpression(node, _ref3) { - var elements = _ref3.elements; - - return new Shift.ArrayExpression({ elements: elements }); - } - }, { - key: 'reduceArrowExpression', - value: function reduceArrowExpression(node, _ref4) { - var params = _ref4.params, - body = _ref4.body; - - return new Shift.ArrowExpression({ isAsync: node.isAsync, params: params, body: body }); - } - }, { - key: 'reduceAssignmentExpression', - value: function reduceAssignmentExpression(node, _ref5) { - var binding = _ref5.binding, - expression = _ref5.expression; - - return new Shift.AssignmentExpression({ binding: binding, expression: expression }); - } - }, { - key: 'reduceAssignmentTargetIdentifier', - value: function reduceAssignmentTargetIdentifier(node) { - return new Shift.AssignmentTargetIdentifier({ name: node.name }); - } - }, { - key: 'reduceAssignmentTargetPropertyIdentifier', - value: function reduceAssignmentTargetPropertyIdentifier(node, _ref6) { - var binding = _ref6.binding, - init = _ref6.init; - - return new Shift.AssignmentTargetPropertyIdentifier({ binding: binding, init: init }); - } - }, { - key: 'reduceAssignmentTargetPropertyProperty', - value: function reduceAssignmentTargetPropertyProperty(node, _ref7) { - var name = _ref7.name, - binding = _ref7.binding; - - return new Shift.AssignmentTargetPropertyProperty({ name: name, binding: binding }); - } - }, { - key: 'reduceAssignmentTargetWithDefault', - value: function reduceAssignmentTargetWithDefault(node, _ref8) { - var binding = _ref8.binding, - init = _ref8.init; - - return new Shift.AssignmentTargetWithDefault({ binding: binding, init: init }); - } - }, { - key: 'reduceAwaitExpression', - value: function reduceAwaitExpression(node, _ref9) { - var expression = _ref9.expression; - - return new Shift.AwaitExpression({ expression: expression }); - } - }, { - key: 'reduceBinaryExpression', - value: function reduceBinaryExpression(node, _ref10) { - var left = _ref10.left, - right = _ref10.right; - - return new Shift.BinaryExpression({ left: left, operator: node.operator, right: right }); - } - }, { - key: 'reduceBindingIdentifier', - value: function reduceBindingIdentifier(node) { - return new Shift.BindingIdentifier({ name: node.name }); - } - }, { - key: 'reduceBindingPropertyIdentifier', - value: function reduceBindingPropertyIdentifier(node, _ref11) { - var binding = _ref11.binding, - init = _ref11.init; - - return new Shift.BindingPropertyIdentifier({ binding: binding, init: init }); - } - }, { - key: 'reduceBindingPropertyProperty', - value: function reduceBindingPropertyProperty(node, _ref12) { - var name = _ref12.name, - binding = _ref12.binding; - - return new Shift.BindingPropertyProperty({ name: name, binding: binding }); - } - }, { - key: 'reduceBindingWithDefault', - value: function reduceBindingWithDefault(node, _ref13) { - var binding = _ref13.binding, - init = _ref13.init; - - return new Shift.BindingWithDefault({ binding: binding, init: init }); - } - }, { - key: 'reduceBlock', - value: function reduceBlock(node, _ref14) { - var statements = _ref14.statements; - - return new Shift.Block({ statements: statements }); - } - }, { - key: 'reduceBlockStatement', - value: function reduceBlockStatement(node, _ref15) { - var block = _ref15.block; - - return new Shift.BlockStatement({ block: block }); - } - }, { - key: 'reduceBreakStatement', - value: function reduceBreakStatement(node) { - return new Shift.BreakStatement({ label: node.label }); - } - }, { - key: 'reduceCallExpression', - value: function reduceCallExpression(node, _ref16) { - var callee = _ref16.callee, - _arguments = _ref16.arguments; - - return new Shift.CallExpression({ callee: callee, arguments: _arguments }); - } - }, { - key: 'reduceCatchClause', - value: function reduceCatchClause(node, _ref17) { - var binding = _ref17.binding, - body = _ref17.body; - - return new Shift.CatchClause({ binding: binding, body: body }); - } - }, { - key: 'reduceClassDeclaration', - value: function reduceClassDeclaration(node, _ref18) { - var name = _ref18.name, - _super = _ref18.super, - elements = _ref18.elements; - - return new Shift.ClassDeclaration({ name: name, super: _super, elements: elements }); - } - }, { - key: 'reduceClassElement', - value: function reduceClassElement(node, _ref19) { - var method = _ref19.method; - - return new Shift.ClassElement({ isStatic: node.isStatic, method: method }); - } - }, { - key: 'reduceClassExpression', - value: function reduceClassExpression(node, _ref20) { - var name = _ref20.name, - _super = _ref20.super, - elements = _ref20.elements; - - return new Shift.ClassExpression({ name: name, super: _super, elements: elements }); - } - }, { - key: 'reduceCompoundAssignmentExpression', - value: function reduceCompoundAssignmentExpression(node, _ref21) { - var binding = _ref21.binding, - expression = _ref21.expression; - - return new Shift.CompoundAssignmentExpression({ binding: binding, operator: node.operator, expression: expression }); - } - }, { - key: 'reduceComputedMemberAssignmentTarget', - value: function reduceComputedMemberAssignmentTarget(node, _ref22) { - var object = _ref22.object, - expression = _ref22.expression; - - return new Shift.ComputedMemberAssignmentTarget({ object: object, expression: expression }); - } - }, { - key: 'reduceComputedMemberExpression', - value: function reduceComputedMemberExpression(node, _ref23) { - var object = _ref23.object, - expression = _ref23.expression; - - return new Shift.ComputedMemberExpression({ object: object, expression: expression }); - } - }, { - key: 'reduceComputedPropertyName', - value: function reduceComputedPropertyName(node, _ref24) { - var expression = _ref24.expression; - - return new Shift.ComputedPropertyName({ expression: expression }); - } - }, { - key: 'reduceConditionalExpression', - value: function reduceConditionalExpression(node, _ref25) { - var test = _ref25.test, - consequent = _ref25.consequent, - alternate = _ref25.alternate; - - return new Shift.ConditionalExpression({ test: test, consequent: consequent, alternate: alternate }); - } - }, { - key: 'reduceContinueStatement', - value: function reduceContinueStatement(node) { - return new Shift.ContinueStatement({ label: node.label }); - } - }, { - key: 'reduceDataProperty', - value: function reduceDataProperty(node, _ref26) { - var name = _ref26.name, - expression = _ref26.expression; - - return new Shift.DataProperty({ name: name, expression: expression }); - } - }, { - key: 'reduceDebuggerStatement', - value: function reduceDebuggerStatement(node) { - return new Shift.DebuggerStatement(); - } - }, { - key: 'reduceDirective', - value: function reduceDirective(node) { - return new Shift.Directive({ rawValue: node.rawValue }); - } - }, { - key: 'reduceDoWhileStatement', - value: function reduceDoWhileStatement(node, _ref27) { - var body = _ref27.body, - test = _ref27.test; - - return new Shift.DoWhileStatement({ body: body, test: test }); - } - }, { - key: 'reduceEmptyStatement', - value: function reduceEmptyStatement(node) { - return new Shift.EmptyStatement(); - } - }, { - key: 'reduceExport', - value: function reduceExport(node, _ref28) { - var declaration = _ref28.declaration; - - return new Shift.Export({ declaration: declaration }); - } - }, { - key: 'reduceExportAllFrom', - value: function reduceExportAllFrom(node) { - return new Shift.ExportAllFrom({ moduleSpecifier: node.moduleSpecifier }); - } - }, { - key: 'reduceExportDefault', - value: function reduceExportDefault(node, _ref29) { - var body = _ref29.body; - - return new Shift.ExportDefault({ body: body }); - } - }, { - key: 'reduceExportFrom', - value: function reduceExportFrom(node, _ref30) { - var namedExports = _ref30.namedExports; - - return new Shift.ExportFrom({ namedExports: namedExports, moduleSpecifier: node.moduleSpecifier }); - } - }, { - key: 'reduceExportFromSpecifier', - value: function reduceExportFromSpecifier(node) { - return new Shift.ExportFromSpecifier({ name: node.name, exportedName: node.exportedName }); - } - }, { - key: 'reduceExportLocalSpecifier', - value: function reduceExportLocalSpecifier(node, _ref31) { - var name = _ref31.name; - - return new Shift.ExportLocalSpecifier({ name: name, exportedName: node.exportedName }); - } - }, { - key: 'reduceExportLocals', - value: function reduceExportLocals(node, _ref32) { - var namedExports = _ref32.namedExports; - - return new Shift.ExportLocals({ namedExports: namedExports }); - } - }, { - key: 'reduceExpressionStatement', - value: function reduceExpressionStatement(node, _ref33) { - var expression = _ref33.expression; - - return new Shift.ExpressionStatement({ expression: expression }); - } - }, { - key: 'reduceForAwaitStatement', - value: function reduceForAwaitStatement(node, _ref34) { - var left = _ref34.left, - right = _ref34.right, - body = _ref34.body; - - return new Shift.ForAwaitStatement({ left: left, right: right, body: body }); - } - }, { - key: 'reduceForInStatement', - value: function reduceForInStatement(node, _ref35) { - var left = _ref35.left, - right = _ref35.right, - body = _ref35.body; - - return new Shift.ForInStatement({ left: left, right: right, body: body }); - } - }, { - key: 'reduceForOfStatement', - value: function reduceForOfStatement(node, _ref36) { - var left = _ref36.left, - right = _ref36.right, - body = _ref36.body; - - return new Shift.ForOfStatement({ left: left, right: right, body: body }); - } - }, { - key: 'reduceForStatement', - value: function reduceForStatement(node, _ref37) { - var init = _ref37.init, - test = _ref37.test, - update = _ref37.update, - body = _ref37.body; - - return new Shift.ForStatement({ init: init, test: test, update: update, body: body }); - } - }, { - key: 'reduceFormalParameters', - value: function reduceFormalParameters(node, _ref38) { - var items = _ref38.items, - rest = _ref38.rest; - - return new Shift.FormalParameters({ items: items, rest: rest }); - } - }, { - key: 'reduceFunctionBody', - value: function reduceFunctionBody(node, _ref39) { - var directives = _ref39.directives, - statements = _ref39.statements; - - return new Shift.FunctionBody({ directives: directives, statements: statements }); - } - }, { - key: 'reduceFunctionDeclaration', - value: function reduceFunctionDeclaration(node, _ref40) { - var name = _ref40.name, - params = _ref40.params, - body = _ref40.body; - - return new Shift.FunctionDeclaration({ isAsync: node.isAsync, isGenerator: node.isGenerator, name: name, params: params, body: body }); - } - }, { - key: 'reduceFunctionExpression', - value: function reduceFunctionExpression(node, _ref41) { - var name = _ref41.name, - params = _ref41.params, - body = _ref41.body; - - return new Shift.FunctionExpression({ isAsync: node.isAsync, isGenerator: node.isGenerator, name: name, params: params, body: body }); - } - }, { - key: 'reduceGetter', - value: function reduceGetter(node, _ref42) { - var name = _ref42.name, - body = _ref42.body; - - return new Shift.Getter({ name: name, body: body }); - } - }, { - key: 'reduceIdentifierExpression', - value: function reduceIdentifierExpression(node) { - return new Shift.IdentifierExpression({ name: node.name }); - } - }, { - key: 'reduceIfStatement', - value: function reduceIfStatement(node, _ref43) { - var test = _ref43.test, - consequent = _ref43.consequent, - alternate = _ref43.alternate; - - return new Shift.IfStatement({ test: test, consequent: consequent, alternate: alternate }); - } - }, { - key: 'reduceImport', - value: function reduceImport(node, _ref44) { - var defaultBinding = _ref44.defaultBinding, - namedImports = _ref44.namedImports; - - return new Shift.Import({ defaultBinding: defaultBinding, namedImports: namedImports, moduleSpecifier: node.moduleSpecifier }); - } - }, { - key: 'reduceImportNamespace', - value: function reduceImportNamespace(node, _ref45) { - var defaultBinding = _ref45.defaultBinding, - namespaceBinding = _ref45.namespaceBinding; - - return new Shift.ImportNamespace({ defaultBinding: defaultBinding, namespaceBinding: namespaceBinding, moduleSpecifier: node.moduleSpecifier }); - } - }, { - key: 'reduceImportSpecifier', - value: function reduceImportSpecifier(node, _ref46) { - var binding = _ref46.binding; - - return new Shift.ImportSpecifier({ name: node.name, binding: binding }); - } - }, { - key: 'reduceLabeledStatement', - value: function reduceLabeledStatement(node, _ref47) { - var body = _ref47.body; - - return new Shift.LabeledStatement({ label: node.label, body: body }); - } - }, { - key: 'reduceLiteralBooleanExpression', - value: function reduceLiteralBooleanExpression(node) { - return new Shift.LiteralBooleanExpression({ value: node.value }); - } - }, { - key: 'reduceLiteralInfinityExpression', - value: function reduceLiteralInfinityExpression(node) { - return new Shift.LiteralInfinityExpression(); - } - }, { - key: 'reduceLiteralNullExpression', - value: function reduceLiteralNullExpression(node) { - return new Shift.LiteralNullExpression(); - } - }, { - key: 'reduceLiteralNumericExpression', - value: function reduceLiteralNumericExpression(node) { - return new Shift.LiteralNumericExpression({ value: node.value }); - } - }, { - key: 'reduceLiteralRegExpExpression', - value: function reduceLiteralRegExpExpression(node) { - return new Shift.LiteralRegExpExpression({ pattern: node.pattern, global: node.global, ignoreCase: node.ignoreCase, multiLine: node.multiLine, dotAll: node.dotAll, unicode: node.unicode, sticky: node.sticky }); - } - }, { - key: 'reduceLiteralStringExpression', - value: function reduceLiteralStringExpression(node) { - return new Shift.LiteralStringExpression({ value: node.value }); - } - }, { - key: 'reduceMethod', - value: function reduceMethod(node, _ref48) { - var name = _ref48.name, - params = _ref48.params, - body = _ref48.body; - - return new Shift.Method({ isAsync: node.isAsync, isGenerator: node.isGenerator, name: name, params: params, body: body }); - } - }, { - key: 'reduceModule', - value: function reduceModule(node, _ref49) { - var directives = _ref49.directives, - items = _ref49.items; - - return new Shift.Module({ directives: directives, items: items }); - } - }, { - key: 'reduceNewExpression', - value: function reduceNewExpression(node, _ref50) { - var callee = _ref50.callee, - _arguments = _ref50.arguments; - - return new Shift.NewExpression({ callee: callee, arguments: _arguments }); - } - }, { - key: 'reduceNewTargetExpression', - value: function reduceNewTargetExpression(node) { - return new Shift.NewTargetExpression(); - } - }, { - key: 'reduceObjectAssignmentTarget', - value: function reduceObjectAssignmentTarget(node, _ref51) { - var properties = _ref51.properties, - rest = _ref51.rest; - - return new Shift.ObjectAssignmentTarget({ properties: properties, rest: rest }); - } - }, { - key: 'reduceObjectBinding', - value: function reduceObjectBinding(node, _ref52) { - var properties = _ref52.properties, - rest = _ref52.rest; - - return new Shift.ObjectBinding({ properties: properties, rest: rest }); - } - }, { - key: 'reduceObjectExpression', - value: function reduceObjectExpression(node, _ref53) { - var properties = _ref53.properties; - - return new Shift.ObjectExpression({ properties: properties }); - } - }, { - key: 'reduceReturnStatement', - value: function reduceReturnStatement(node, _ref54) { - var expression = _ref54.expression; - - return new Shift.ReturnStatement({ expression: expression }); - } - }, { - key: 'reduceScript', - value: function reduceScript(node, _ref55) { - var directives = _ref55.directives, - statements = _ref55.statements; - - return new Shift.Script({ directives: directives, statements: statements }); - } - }, { - key: 'reduceSetter', - value: function reduceSetter(node, _ref56) { - var name = _ref56.name, - param = _ref56.param, - body = _ref56.body; - - return new Shift.Setter({ name: name, param: param, body: body }); - } - }, { - key: 'reduceShorthandProperty', - value: function reduceShorthandProperty(node, _ref57) { - var name = _ref57.name; - - return new Shift.ShorthandProperty({ name: name }); - } - }, { - key: 'reduceSpreadElement', - value: function reduceSpreadElement(node, _ref58) { - var expression = _ref58.expression; - - return new Shift.SpreadElement({ expression: expression }); - } - }, { - key: 'reduceSpreadProperty', - value: function reduceSpreadProperty(node, _ref59) { - var expression = _ref59.expression; - - return new Shift.SpreadProperty({ expression: expression }); - } - }, { - key: 'reduceStaticMemberAssignmentTarget', - value: function reduceStaticMemberAssignmentTarget(node, _ref60) { - var object = _ref60.object; - - return new Shift.StaticMemberAssignmentTarget({ object: object, property: node.property }); - } - }, { - key: 'reduceStaticMemberExpression', - value: function reduceStaticMemberExpression(node, _ref61) { - var object = _ref61.object; - - return new Shift.StaticMemberExpression({ object: object, property: node.property }); - } - }, { - key: 'reduceStaticPropertyName', - value: function reduceStaticPropertyName(node) { - return new Shift.StaticPropertyName({ value: node.value }); - } - }, { - key: 'reduceSuper', - value: function reduceSuper(node) { - return new Shift.Super(); - } - }, { - key: 'reduceSwitchCase', - value: function reduceSwitchCase(node, _ref62) { - var test = _ref62.test, - consequent = _ref62.consequent; - - return new Shift.SwitchCase({ test: test, consequent: consequent }); - } - }, { - key: 'reduceSwitchDefault', - value: function reduceSwitchDefault(node, _ref63) { - var consequent = _ref63.consequent; - - return new Shift.SwitchDefault({ consequent: consequent }); - } - }, { - key: 'reduceSwitchStatement', - value: function reduceSwitchStatement(node, _ref64) { - var discriminant = _ref64.discriminant, - cases = _ref64.cases; - - return new Shift.SwitchStatement({ discriminant: discriminant, cases: cases }); - } - }, { - key: 'reduceSwitchStatementWithDefault', - value: function reduceSwitchStatementWithDefault(node, _ref65) { - var discriminant = _ref65.discriminant, - preDefaultCases = _ref65.preDefaultCases, - defaultCase = _ref65.defaultCase, - postDefaultCases = _ref65.postDefaultCases; - - return new Shift.SwitchStatementWithDefault({ discriminant: discriminant, preDefaultCases: preDefaultCases, defaultCase: defaultCase, postDefaultCases: postDefaultCases }); - } - }, { - key: 'reduceTemplateElement', - value: function reduceTemplateElement(node) { - return new Shift.TemplateElement({ rawValue: node.rawValue }); - } - }, { - key: 'reduceTemplateExpression', - value: function reduceTemplateExpression(node, _ref66) { - var tag = _ref66.tag, - elements = _ref66.elements; - - return new Shift.TemplateExpression({ tag: tag, elements: elements }); - } - }, { - key: 'reduceThisExpression', - value: function reduceThisExpression(node) { - return new Shift.ThisExpression(); - } - }, { - key: 'reduceThrowStatement', - value: function reduceThrowStatement(node, _ref67) { - var expression = _ref67.expression; - - return new Shift.ThrowStatement({ expression: expression }); - } - }, { - key: 'reduceTryCatchStatement', - value: function reduceTryCatchStatement(node, _ref68) { - var body = _ref68.body, - catchClause = _ref68.catchClause; - - return new Shift.TryCatchStatement({ body: body, catchClause: catchClause }); - } - }, { - key: 'reduceTryFinallyStatement', - value: function reduceTryFinallyStatement(node, _ref69) { - var body = _ref69.body, - catchClause = _ref69.catchClause, - finalizer = _ref69.finalizer; - - return new Shift.TryFinallyStatement({ body: body, catchClause: catchClause, finalizer: finalizer }); - } - }, { - key: 'reduceUnaryExpression', - value: function reduceUnaryExpression(node, _ref70) { - var operand = _ref70.operand; - - return new Shift.UnaryExpression({ operator: node.operator, operand: operand }); - } - }, { - key: 'reduceUpdateExpression', - value: function reduceUpdateExpression(node, _ref71) { - var operand = _ref71.operand; - - return new Shift.UpdateExpression({ isPrefix: node.isPrefix, operator: node.operator, operand: operand }); - } - }, { - key: 'reduceVariableDeclaration', - value: function reduceVariableDeclaration(node, _ref72) { - var declarators = _ref72.declarators; - - return new Shift.VariableDeclaration({ kind: node.kind, declarators: declarators }); - } - }, { - key: 'reduceVariableDeclarationStatement', - value: function reduceVariableDeclarationStatement(node, _ref73) { - var declaration = _ref73.declaration; - - return new Shift.VariableDeclarationStatement({ declaration: declaration }); - } - }, { - key: 'reduceVariableDeclarator', - value: function reduceVariableDeclarator(node, _ref74) { - var binding = _ref74.binding, - init = _ref74.init; - - return new Shift.VariableDeclarator({ binding: binding, init: init }); - } - }, { - key: 'reduceWhileStatement', - value: function reduceWhileStatement(node, _ref75) { - var test = _ref75.test, - body = _ref75.body; - - return new Shift.WhileStatement({ test: test, body: body }); - } - }, { - key: 'reduceWithStatement', - value: function reduceWithStatement(node, _ref76) { - var object = _ref76.object, - body = _ref76.body; - - return new Shift.WithStatement({ object: object, body: body }); - } - }, { - key: 'reduceYieldExpression', - value: function reduceYieldExpression(node, _ref77) { - var expression = _ref77.expression; - - return new Shift.YieldExpression({ expression: expression }); - } - }, { - key: 'reduceYieldGeneratorExpression', - value: function reduceYieldGeneratorExpression(node, _ref78) { - var expression = _ref78.expression; - - return new Shift.YieldGeneratorExpression({ expression: expression }); - } - }]); - - return CloneReducer; -}(); - -exports.default = CloneReducer; -}); - -var lazyCloneReducer = createCommonjsModule(function (module, exports) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); // Generated by generate-lazy-clone-reducer.js -/** - * Copyright 2018 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - - -var Shift = _interopRequireWildcard(dist$2); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var LazyCloneReducer = function () { - function LazyCloneReducer() { - _classCallCheck(this, LazyCloneReducer); - } - - _createClass(LazyCloneReducer, [{ - key: 'reduceArrayAssignmentTarget', - value: function reduceArrayAssignmentTarget(node, _ref) { - var elements = _ref.elements, - rest = _ref.rest; - - if (node.elements.length === elements.length && node.elements.every(function (v, i) { - return v === elements[i]; - }) && node.rest === rest) { - return node; - } - return new Shift.ArrayAssignmentTarget({ elements: elements, rest: rest }); - } - }, { - key: 'reduceArrayBinding', - value: function reduceArrayBinding(node, _ref2) { - var elements = _ref2.elements, - rest = _ref2.rest; - - if (node.elements.length === elements.length && node.elements.every(function (v, i) { - return v === elements[i]; - }) && node.rest === rest) { - return node; - } - return new Shift.ArrayBinding({ elements: elements, rest: rest }); - } - }, { - key: 'reduceArrayExpression', - value: function reduceArrayExpression(node, _ref3) { - var elements = _ref3.elements; - - if (node.elements.length === elements.length && node.elements.every(function (v, i) { - return v === elements[i]; - })) { - return node; - } - return new Shift.ArrayExpression({ elements: elements }); - } - }, { - key: 'reduceArrowExpression', - value: function reduceArrowExpression(node, _ref4) { - var params = _ref4.params, - body = _ref4.body; - - if (node.params === params && node.body === body) { - return node; - } - return new Shift.ArrowExpression({ isAsync: node.isAsync, params: params, body: body }); - } - }, { - key: 'reduceAssignmentExpression', - value: function reduceAssignmentExpression(node, _ref5) { - var binding = _ref5.binding, - expression = _ref5.expression; - - if (node.binding === binding && node.expression === expression) { - return node; - } - return new Shift.AssignmentExpression({ binding: binding, expression: expression }); - } - }, { - key: 'reduceAssignmentTargetIdentifier', - value: function reduceAssignmentTargetIdentifier(node) { - return node; - } - }, { - key: 'reduceAssignmentTargetPropertyIdentifier', - value: function reduceAssignmentTargetPropertyIdentifier(node, _ref6) { - var binding = _ref6.binding, - init = _ref6.init; - - if (node.binding === binding && node.init === init) { - return node; - } - return new Shift.AssignmentTargetPropertyIdentifier({ binding: binding, init: init }); - } - }, { - key: 'reduceAssignmentTargetPropertyProperty', - value: function reduceAssignmentTargetPropertyProperty(node, _ref7) { - var name = _ref7.name, - binding = _ref7.binding; - - if (node.name === name && node.binding === binding) { - return node; - } - return new Shift.AssignmentTargetPropertyProperty({ name: name, binding: binding }); - } - }, { - key: 'reduceAssignmentTargetWithDefault', - value: function reduceAssignmentTargetWithDefault(node, _ref8) { - var binding = _ref8.binding, - init = _ref8.init; - - if (node.binding === binding && node.init === init) { - return node; - } - return new Shift.AssignmentTargetWithDefault({ binding: binding, init: init }); - } - }, { - key: 'reduceAwaitExpression', - value: function reduceAwaitExpression(node, _ref9) { - var expression = _ref9.expression; - - if (node.expression === expression) { - return node; - } - return new Shift.AwaitExpression({ expression: expression }); - } - }, { - key: 'reduceBinaryExpression', - value: function reduceBinaryExpression(node, _ref10) { - var left = _ref10.left, - right = _ref10.right; - - if (node.left === left && node.right === right) { - return node; - } - return new Shift.BinaryExpression({ left: left, operator: node.operator, right: right }); - } - }, { - key: 'reduceBindingIdentifier', - value: function reduceBindingIdentifier(node) { - return node; - } - }, { - key: 'reduceBindingPropertyIdentifier', - value: function reduceBindingPropertyIdentifier(node, _ref11) { - var binding = _ref11.binding, - init = _ref11.init; - - if (node.binding === binding && node.init === init) { - return node; - } - return new Shift.BindingPropertyIdentifier({ binding: binding, init: init }); - } - }, { - key: 'reduceBindingPropertyProperty', - value: function reduceBindingPropertyProperty(node, _ref12) { - var name = _ref12.name, - binding = _ref12.binding; - - if (node.name === name && node.binding === binding) { - return node; - } - return new Shift.BindingPropertyProperty({ name: name, binding: binding }); - } - }, { - key: 'reduceBindingWithDefault', - value: function reduceBindingWithDefault(node, _ref13) { - var binding = _ref13.binding, - init = _ref13.init; - - if (node.binding === binding && node.init === init) { - return node; - } - return new Shift.BindingWithDefault({ binding: binding, init: init }); - } - }, { - key: 'reduceBlock', - value: function reduceBlock(node, _ref14) { - var statements = _ref14.statements; - - if (node.statements.length === statements.length && node.statements.every(function (v, i) { - return v === statements[i]; - })) { - return node; - } - return new Shift.Block({ statements: statements }); - } - }, { - key: 'reduceBlockStatement', - value: function reduceBlockStatement(node, _ref15) { - var block = _ref15.block; - - if (node.block === block) { - return node; - } - return new Shift.BlockStatement({ block: block }); - } - }, { - key: 'reduceBreakStatement', - value: function reduceBreakStatement(node) { - return node; - } - }, { - key: 'reduceCallExpression', - value: function reduceCallExpression(node, _ref16) { - var callee = _ref16.callee, - _arguments = _ref16.arguments; - - if (node.callee === callee && node.arguments.length === _arguments.length && node.arguments.every(function (v, i) { - return v === _arguments[i]; - })) { - return node; - } - return new Shift.CallExpression({ callee: callee, arguments: _arguments }); - } - }, { - key: 'reduceCatchClause', - value: function reduceCatchClause(node, _ref17) { - var binding = _ref17.binding, - body = _ref17.body; - - if (node.binding === binding && node.body === body) { - return node; - } - return new Shift.CatchClause({ binding: binding, body: body }); - } - }, { - key: 'reduceClassDeclaration', - value: function reduceClassDeclaration(node, _ref18) { - var name = _ref18.name, - _super = _ref18.super, - elements = _ref18.elements; - - if (node.name === name && node.super === _super && node.elements.length === elements.length && node.elements.every(function (v, i) { - return v === elements[i]; - })) { - return node; - } - return new Shift.ClassDeclaration({ name: name, super: _super, elements: elements }); - } - }, { - key: 'reduceClassElement', - value: function reduceClassElement(node, _ref19) { - var method = _ref19.method; - - if (node.method === method) { - return node; - } - return new Shift.ClassElement({ isStatic: node.isStatic, method: method }); - } - }, { - key: 'reduceClassExpression', - value: function reduceClassExpression(node, _ref20) { - var name = _ref20.name, - _super = _ref20.super, - elements = _ref20.elements; - - if (node.name === name && node.super === _super && node.elements.length === elements.length && node.elements.every(function (v, i) { - return v === elements[i]; - })) { - return node; - } - return new Shift.ClassExpression({ name: name, super: _super, elements: elements }); - } - }, { - key: 'reduceCompoundAssignmentExpression', - value: function reduceCompoundAssignmentExpression(node, _ref21) { - var binding = _ref21.binding, - expression = _ref21.expression; - - if (node.binding === binding && node.expression === expression) { - return node; - } - return new Shift.CompoundAssignmentExpression({ binding: binding, operator: node.operator, expression: expression }); - } - }, { - key: 'reduceComputedMemberAssignmentTarget', - value: function reduceComputedMemberAssignmentTarget(node, _ref22) { - var object = _ref22.object, - expression = _ref22.expression; - - if (node.object === object && node.expression === expression) { - return node; - } - return new Shift.ComputedMemberAssignmentTarget({ object: object, expression: expression }); - } - }, { - key: 'reduceComputedMemberExpression', - value: function reduceComputedMemberExpression(node, _ref23) { - var object = _ref23.object, - expression = _ref23.expression; - - if (node.object === object && node.expression === expression) { - return node; - } - return new Shift.ComputedMemberExpression({ object: object, expression: expression }); - } - }, { - key: 'reduceComputedPropertyName', - value: function reduceComputedPropertyName(node, _ref24) { - var expression = _ref24.expression; - - if (node.expression === expression) { - return node; - } - return new Shift.ComputedPropertyName({ expression: expression }); - } - }, { - key: 'reduceConditionalExpression', - value: function reduceConditionalExpression(node, _ref25) { - var test = _ref25.test, - consequent = _ref25.consequent, - alternate = _ref25.alternate; - - if (node.test === test && node.consequent === consequent && node.alternate === alternate) { - return node; - } - return new Shift.ConditionalExpression({ test: test, consequent: consequent, alternate: alternate }); - } - }, { - key: 'reduceContinueStatement', - value: function reduceContinueStatement(node) { - return node; - } - }, { - key: 'reduceDataProperty', - value: function reduceDataProperty(node, _ref26) { - var name = _ref26.name, - expression = _ref26.expression; - - if (node.name === name && node.expression === expression) { - return node; - } - return new Shift.DataProperty({ name: name, expression: expression }); - } - }, { - key: 'reduceDebuggerStatement', - value: function reduceDebuggerStatement(node) { - return node; - } - }, { - key: 'reduceDirective', - value: function reduceDirective(node) { - return node; - } - }, { - key: 'reduceDoWhileStatement', - value: function reduceDoWhileStatement(node, _ref27) { - var body = _ref27.body, - test = _ref27.test; - - if (node.body === body && node.test === test) { - return node; - } - return new Shift.DoWhileStatement({ body: body, test: test }); - } - }, { - key: 'reduceEmptyStatement', - value: function reduceEmptyStatement(node) { - return node; - } - }, { - key: 'reduceExport', - value: function reduceExport(node, _ref28) { - var declaration = _ref28.declaration; - - if (node.declaration === declaration) { - return node; - } - return new Shift.Export({ declaration: declaration }); - } - }, { - key: 'reduceExportAllFrom', - value: function reduceExportAllFrom(node) { - return node; - } - }, { - key: 'reduceExportDefault', - value: function reduceExportDefault(node, _ref29) { - var body = _ref29.body; - - if (node.body === body) { - return node; - } - return new Shift.ExportDefault({ body: body }); - } - }, { - key: 'reduceExportFrom', - value: function reduceExportFrom(node, _ref30) { - var namedExports = _ref30.namedExports; - - if (node.namedExports.length === namedExports.length && node.namedExports.every(function (v, i) { - return v === namedExports[i]; - })) { - return node; - } - return new Shift.ExportFrom({ namedExports: namedExports, moduleSpecifier: node.moduleSpecifier }); - } - }, { - key: 'reduceExportFromSpecifier', - value: function reduceExportFromSpecifier(node) { - return node; - } - }, { - key: 'reduceExportLocalSpecifier', - value: function reduceExportLocalSpecifier(node, _ref31) { - var name = _ref31.name; - - if (node.name === name) { - return node; - } - return new Shift.ExportLocalSpecifier({ name: name, exportedName: node.exportedName }); - } - }, { - key: 'reduceExportLocals', - value: function reduceExportLocals(node, _ref32) { - var namedExports = _ref32.namedExports; - - if (node.namedExports.length === namedExports.length && node.namedExports.every(function (v, i) { - return v === namedExports[i]; - })) { - return node; - } - return new Shift.ExportLocals({ namedExports: namedExports }); - } - }, { - key: 'reduceExpressionStatement', - value: function reduceExpressionStatement(node, _ref33) { - var expression = _ref33.expression; - - if (node.expression === expression) { - return node; - } - return new Shift.ExpressionStatement({ expression: expression }); - } - }, { - key: 'reduceForAwaitStatement', - value: function reduceForAwaitStatement(node, _ref34) { - var left = _ref34.left, - right = _ref34.right, - body = _ref34.body; - - if (node.left === left && node.right === right && node.body === body) { - return node; - } - return new Shift.ForAwaitStatement({ left: left, right: right, body: body }); - } - }, { - key: 'reduceForInStatement', - value: function reduceForInStatement(node, _ref35) { - var left = _ref35.left, - right = _ref35.right, - body = _ref35.body; - - if (node.left === left && node.right === right && node.body === body) { - return node; - } - return new Shift.ForInStatement({ left: left, right: right, body: body }); - } - }, { - key: 'reduceForOfStatement', - value: function reduceForOfStatement(node, _ref36) { - var left = _ref36.left, - right = _ref36.right, - body = _ref36.body; - - if (node.left === left && node.right === right && node.body === body) { - return node; - } - return new Shift.ForOfStatement({ left: left, right: right, body: body }); - } - }, { - key: 'reduceForStatement', - value: function reduceForStatement(node, _ref37) { - var init = _ref37.init, - test = _ref37.test, - update = _ref37.update, - body = _ref37.body; - - if (node.init === init && node.test === test && node.update === update && node.body === body) { - return node; - } - return new Shift.ForStatement({ init: init, test: test, update: update, body: body }); - } - }, { - key: 'reduceFormalParameters', - value: function reduceFormalParameters(node, _ref38) { - var items = _ref38.items, - rest = _ref38.rest; - - if (node.items.length === items.length && node.items.every(function (v, i) { - return v === items[i]; - }) && node.rest === rest) { - return node; - } - return new Shift.FormalParameters({ items: items, rest: rest }); - } - }, { - key: 'reduceFunctionBody', - value: function reduceFunctionBody(node, _ref39) { - var directives = _ref39.directives, - statements = _ref39.statements; - - if (node.directives.length === directives.length && node.directives.every(function (v, i) { - return v === directives[i]; - }) && node.statements.length === statements.length && node.statements.every(function (v, i) { - return v === statements[i]; - })) { - return node; - } - return new Shift.FunctionBody({ directives: directives, statements: statements }); - } - }, { - key: 'reduceFunctionDeclaration', - value: function reduceFunctionDeclaration(node, _ref40) { - var name = _ref40.name, - params = _ref40.params, - body = _ref40.body; - - if (node.name === name && node.params === params && node.body === body) { - return node; - } - return new Shift.FunctionDeclaration({ isAsync: node.isAsync, isGenerator: node.isGenerator, name: name, params: params, body: body }); - } - }, { - key: 'reduceFunctionExpression', - value: function reduceFunctionExpression(node, _ref41) { - var name = _ref41.name, - params = _ref41.params, - body = _ref41.body; - - if (node.name === name && node.params === params && node.body === body) { - return node; - } - return new Shift.FunctionExpression({ isAsync: node.isAsync, isGenerator: node.isGenerator, name: name, params: params, body: body }); - } - }, { - key: 'reduceGetter', - value: function reduceGetter(node, _ref42) { - var name = _ref42.name, - body = _ref42.body; - - if (node.name === name && node.body === body) { - return node; - } - return new Shift.Getter({ name: name, body: body }); - } - }, { - key: 'reduceIdentifierExpression', - value: function reduceIdentifierExpression(node) { - return node; - } - }, { - key: 'reduceIfStatement', - value: function reduceIfStatement(node, _ref43) { - var test = _ref43.test, - consequent = _ref43.consequent, - alternate = _ref43.alternate; - - if (node.test === test && node.consequent === consequent && node.alternate === alternate) { - return node; - } - return new Shift.IfStatement({ test: test, consequent: consequent, alternate: alternate }); - } - }, { - key: 'reduceImport', - value: function reduceImport(node, _ref44) { - var defaultBinding = _ref44.defaultBinding, - namedImports = _ref44.namedImports; - - if (node.defaultBinding === defaultBinding && node.namedImports.length === namedImports.length && node.namedImports.every(function (v, i) { - return v === namedImports[i]; - })) { - return node; - } - return new Shift.Import({ defaultBinding: defaultBinding, namedImports: namedImports, moduleSpecifier: node.moduleSpecifier }); - } - }, { - key: 'reduceImportNamespace', - value: function reduceImportNamespace(node, _ref45) { - var defaultBinding = _ref45.defaultBinding, - namespaceBinding = _ref45.namespaceBinding; - - if (node.defaultBinding === defaultBinding && node.namespaceBinding === namespaceBinding) { - return node; - } - return new Shift.ImportNamespace({ defaultBinding: defaultBinding, namespaceBinding: namespaceBinding, moduleSpecifier: node.moduleSpecifier }); - } - }, { - key: 'reduceImportSpecifier', - value: function reduceImportSpecifier(node, _ref46) { - var binding = _ref46.binding; - - if (node.binding === binding) { - return node; - } - return new Shift.ImportSpecifier({ name: node.name, binding: binding }); - } - }, { - key: 'reduceLabeledStatement', - value: function reduceLabeledStatement(node, _ref47) { - var body = _ref47.body; - - if (node.body === body) { - return node; - } - return new Shift.LabeledStatement({ label: node.label, body: body }); - } - }, { - key: 'reduceLiteralBooleanExpression', - value: function reduceLiteralBooleanExpression(node) { - return node; - } - }, { - key: 'reduceLiteralInfinityExpression', - value: function reduceLiteralInfinityExpression(node) { - return node; - } - }, { - key: 'reduceLiteralNullExpression', - value: function reduceLiteralNullExpression(node) { - return node; - } - }, { - key: 'reduceLiteralNumericExpression', - value: function reduceLiteralNumericExpression(node) { - return node; - } - }, { - key: 'reduceLiteralRegExpExpression', - value: function reduceLiteralRegExpExpression(node) { - return node; - } - }, { - key: 'reduceLiteralStringExpression', - value: function reduceLiteralStringExpression(node) { - return node; - } - }, { - key: 'reduceMethod', - value: function reduceMethod(node, _ref48) { - var name = _ref48.name, - params = _ref48.params, - body = _ref48.body; - - if (node.name === name && node.params === params && node.body === body) { - return node; - } - return new Shift.Method({ isAsync: node.isAsync, isGenerator: node.isGenerator, name: name, params: params, body: body }); - } - }, { - key: 'reduceModule', - value: function reduceModule(node, _ref49) { - var directives = _ref49.directives, - items = _ref49.items; - - if (node.directives.length === directives.length && node.directives.every(function (v, i) { - return v === directives[i]; - }) && node.items.length === items.length && node.items.every(function (v, i) { - return v === items[i]; - })) { - return node; - } - return new Shift.Module({ directives: directives, items: items }); - } - }, { - key: 'reduceNewExpression', - value: function reduceNewExpression(node, _ref50) { - var callee = _ref50.callee, - _arguments = _ref50.arguments; - - if (node.callee === callee && node.arguments.length === _arguments.length && node.arguments.every(function (v, i) { - return v === _arguments[i]; - })) { - return node; - } - return new Shift.NewExpression({ callee: callee, arguments: _arguments }); - } - }, { - key: 'reduceNewTargetExpression', - value: function reduceNewTargetExpression(node) { - return node; - } - }, { - key: 'reduceObjectAssignmentTarget', - value: function reduceObjectAssignmentTarget(node, _ref51) { - var properties = _ref51.properties, - rest = _ref51.rest; - - if (node.properties.length === properties.length && node.properties.every(function (v, i) { - return v === properties[i]; - }) && node.rest === rest) { - return node; - } - return new Shift.ObjectAssignmentTarget({ properties: properties, rest: rest }); - } - }, { - key: 'reduceObjectBinding', - value: function reduceObjectBinding(node, _ref52) { - var properties = _ref52.properties, - rest = _ref52.rest; - - if (node.properties.length === properties.length && node.properties.every(function (v, i) { - return v === properties[i]; - }) && node.rest === rest) { - return node; - } - return new Shift.ObjectBinding({ properties: properties, rest: rest }); - } - }, { - key: 'reduceObjectExpression', - value: function reduceObjectExpression(node, _ref53) { - var properties = _ref53.properties; - - if (node.properties.length === properties.length && node.properties.every(function (v, i) { - return v === properties[i]; - })) { - return node; - } - return new Shift.ObjectExpression({ properties: properties }); - } - }, { - key: 'reduceReturnStatement', - value: function reduceReturnStatement(node, _ref54) { - var expression = _ref54.expression; - - if (node.expression === expression) { - return node; - } - return new Shift.ReturnStatement({ expression: expression }); - } - }, { - key: 'reduceScript', - value: function reduceScript(node, _ref55) { - var directives = _ref55.directives, - statements = _ref55.statements; - - if (node.directives.length === directives.length && node.directives.every(function (v, i) { - return v === directives[i]; - }) && node.statements.length === statements.length && node.statements.every(function (v, i) { - return v === statements[i]; - })) { - return node; - } - return new Shift.Script({ directives: directives, statements: statements }); - } - }, { - key: 'reduceSetter', - value: function reduceSetter(node, _ref56) { - var name = _ref56.name, - param = _ref56.param, - body = _ref56.body; - - if (node.name === name && node.param === param && node.body === body) { - return node; - } - return new Shift.Setter({ name: name, param: param, body: body }); - } - }, { - key: 'reduceShorthandProperty', - value: function reduceShorthandProperty(node, _ref57) { - var name = _ref57.name; - - if (node.name === name) { - return node; - } - return new Shift.ShorthandProperty({ name: name }); - } - }, { - key: 'reduceSpreadElement', - value: function reduceSpreadElement(node, _ref58) { - var expression = _ref58.expression; - - if (node.expression === expression) { - return node; - } - return new Shift.SpreadElement({ expression: expression }); - } - }, { - key: 'reduceSpreadProperty', - value: function reduceSpreadProperty(node, _ref59) { - var expression = _ref59.expression; - - if (node.expression === expression) { - return node; - } - return new Shift.SpreadProperty({ expression: expression }); - } - }, { - key: 'reduceStaticMemberAssignmentTarget', - value: function reduceStaticMemberAssignmentTarget(node, _ref60) { - var object = _ref60.object; - - if (node.object === object) { - return node; - } - return new Shift.StaticMemberAssignmentTarget({ object: object, property: node.property }); - } - }, { - key: 'reduceStaticMemberExpression', - value: function reduceStaticMemberExpression(node, _ref61) { - var object = _ref61.object; - - if (node.object === object) { - return node; - } - return new Shift.StaticMemberExpression({ object: object, property: node.property }); - } - }, { - key: 'reduceStaticPropertyName', - value: function reduceStaticPropertyName(node) { - return node; - } - }, { - key: 'reduceSuper', - value: function reduceSuper(node) { - return node; - } - }, { - key: 'reduceSwitchCase', - value: function reduceSwitchCase(node, _ref62) { - var test = _ref62.test, - consequent = _ref62.consequent; - - if (node.test === test && node.consequent.length === consequent.length && node.consequent.every(function (v, i) { - return v === consequent[i]; - })) { - return node; - } - return new Shift.SwitchCase({ test: test, consequent: consequent }); - } - }, { - key: 'reduceSwitchDefault', - value: function reduceSwitchDefault(node, _ref63) { - var consequent = _ref63.consequent; - - if (node.consequent.length === consequent.length && node.consequent.every(function (v, i) { - return v === consequent[i]; - })) { - return node; - } - return new Shift.SwitchDefault({ consequent: consequent }); - } - }, { - key: 'reduceSwitchStatement', - value: function reduceSwitchStatement(node, _ref64) { - var discriminant = _ref64.discriminant, - cases = _ref64.cases; - - if (node.discriminant === discriminant && node.cases.length === cases.length && node.cases.every(function (v, i) { - return v === cases[i]; - })) { - return node; - } - return new Shift.SwitchStatement({ discriminant: discriminant, cases: cases }); - } - }, { - key: 'reduceSwitchStatementWithDefault', - value: function reduceSwitchStatementWithDefault(node, _ref65) { - var discriminant = _ref65.discriminant, - preDefaultCases = _ref65.preDefaultCases, - defaultCase = _ref65.defaultCase, - postDefaultCases = _ref65.postDefaultCases; - - if (node.discriminant === discriminant && node.preDefaultCases.length === preDefaultCases.length && node.preDefaultCases.every(function (v, i) { - return v === preDefaultCases[i]; - }) && node.defaultCase === defaultCase && node.postDefaultCases.length === postDefaultCases.length && node.postDefaultCases.every(function (v, i) { - return v === postDefaultCases[i]; - })) { - return node; - } - return new Shift.SwitchStatementWithDefault({ discriminant: discriminant, preDefaultCases: preDefaultCases, defaultCase: defaultCase, postDefaultCases: postDefaultCases }); - } - }, { - key: 'reduceTemplateElement', - value: function reduceTemplateElement(node) { - return node; - } - }, { - key: 'reduceTemplateExpression', - value: function reduceTemplateExpression(node, _ref66) { - var tag = _ref66.tag, - elements = _ref66.elements; - - if (node.tag === tag && node.elements.length === elements.length && node.elements.every(function (v, i) { - return v === elements[i]; - })) { - return node; - } - return new Shift.TemplateExpression({ tag: tag, elements: elements }); - } - }, { - key: 'reduceThisExpression', - value: function reduceThisExpression(node) { - return node; - } - }, { - key: 'reduceThrowStatement', - value: function reduceThrowStatement(node, _ref67) { - var expression = _ref67.expression; - - if (node.expression === expression) { - return node; - } - return new Shift.ThrowStatement({ expression: expression }); - } - }, { - key: 'reduceTryCatchStatement', - value: function reduceTryCatchStatement(node, _ref68) { - var body = _ref68.body, - catchClause = _ref68.catchClause; - - if (node.body === body && node.catchClause === catchClause) { - return node; - } - return new Shift.TryCatchStatement({ body: body, catchClause: catchClause }); - } - }, { - key: 'reduceTryFinallyStatement', - value: function reduceTryFinallyStatement(node, _ref69) { - var body = _ref69.body, - catchClause = _ref69.catchClause, - finalizer = _ref69.finalizer; - - if (node.body === body && node.catchClause === catchClause && node.finalizer === finalizer) { - return node; - } - return new Shift.TryFinallyStatement({ body: body, catchClause: catchClause, finalizer: finalizer }); - } - }, { - key: 'reduceUnaryExpression', - value: function reduceUnaryExpression(node, _ref70) { - var operand = _ref70.operand; - - if (node.operand === operand) { - return node; - } - return new Shift.UnaryExpression({ operator: node.operator, operand: operand }); - } - }, { - key: 'reduceUpdateExpression', - value: function reduceUpdateExpression(node, _ref71) { - var operand = _ref71.operand; - - if (node.operand === operand) { - return node; - } - return new Shift.UpdateExpression({ isPrefix: node.isPrefix, operator: node.operator, operand: operand }); - } - }, { - key: 'reduceVariableDeclaration', - value: function reduceVariableDeclaration(node, _ref72) { - var declarators = _ref72.declarators; - - if (node.declarators.length === declarators.length && node.declarators.every(function (v, i) { - return v === declarators[i]; - })) { - return node; - } - return new Shift.VariableDeclaration({ kind: node.kind, declarators: declarators }); - } - }, { - key: 'reduceVariableDeclarationStatement', - value: function reduceVariableDeclarationStatement(node, _ref73) { - var declaration = _ref73.declaration; - - if (node.declaration === declaration) { - return node; - } - return new Shift.VariableDeclarationStatement({ declaration: declaration }); - } - }, { - key: 'reduceVariableDeclarator', - value: function reduceVariableDeclarator(node, _ref74) { - var binding = _ref74.binding, - init = _ref74.init; - - if (node.binding === binding && node.init === init) { - return node; - } - return new Shift.VariableDeclarator({ binding: binding, init: init }); - } - }, { - key: 'reduceWhileStatement', - value: function reduceWhileStatement(node, _ref75) { - var test = _ref75.test, - body = _ref75.body; - - if (node.test === test && node.body === body) { - return node; - } - return new Shift.WhileStatement({ test: test, body: body }); - } - }, { - key: 'reduceWithStatement', - value: function reduceWithStatement(node, _ref76) { - var object = _ref76.object, - body = _ref76.body; - - if (node.object === object && node.body === body) { - return node; - } - return new Shift.WithStatement({ object: object, body: body }); - } - }, { - key: 'reduceYieldExpression', - value: function reduceYieldExpression(node, _ref77) { - var expression = _ref77.expression; - - if (node.expression === expression) { - return node; - } - return new Shift.YieldExpression({ expression: expression }); - } - }, { - key: 'reduceYieldGeneratorExpression', - value: function reduceYieldGeneratorExpression(node, _ref78) { - var expression = _ref78.expression; - - if (node.expression === expression) { - return node; - } - return new Shift.YieldGeneratorExpression({ expression: expression }); - } - }]); - - return LazyCloneReducer; -}(); - -exports.default = LazyCloneReducer; -}); - -var monoidalReducer = createCommonjsModule(function (module, exports) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); // Generated by generate-monoidal-reducer.js -/** - * Copyright 2018 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - - -var _shiftAst2 = _interopRequireDefault(dist$2); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var MonoidalReducer = function () { - function MonoidalReducer(monoid) { - _classCallCheck(this, MonoidalReducer); - - var identity = monoid.empty(); - this.identity = identity; - var concat = void 0; - if (monoid.prototype && typeof monoid.prototype.concat === 'function') { - concat = Function.prototype.call.bind(monoid.prototype.concat); - } else if (typeof monoid.concat === 'function') { - concat = monoid.concat; - } else { - throw new TypeError('Monoid must provide a `concat` method'); - } - this.append = function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return args.reduce(concat, identity); - }; - } - - _createClass(MonoidalReducer, [{ - key: 'reduceArrayAssignmentTarget', - value: function reduceArrayAssignmentTarget(node, _ref) { - var elements = _ref.elements, - rest = _ref.rest; - - return this.append.apply(this, _toConsumableArray(elements.filter(function (n) { - return n != null; - })).concat([rest == null ? this.identity : rest])); - } - }, { - key: 'reduceArrayBinding', - value: function reduceArrayBinding(node, _ref2) { - var elements = _ref2.elements, - rest = _ref2.rest; - - return this.append.apply(this, _toConsumableArray(elements.filter(function (n) { - return n != null; - })).concat([rest == null ? this.identity : rest])); - } - }, { - key: 'reduceArrayExpression', - value: function reduceArrayExpression(node, _ref3) { - var elements = _ref3.elements; - - return this.append.apply(this, _toConsumableArray(elements.filter(function (n) { - return n != null; - }))); - } - }, { - key: 'reduceArrowExpression', - value: function reduceArrowExpression(node, _ref4) { - var params = _ref4.params, - body = _ref4.body; - - return this.append(params, body); - } - }, { - key: 'reduceAssignmentExpression', - value: function reduceAssignmentExpression(node, _ref5) { - var binding = _ref5.binding, - expression = _ref5.expression; - - return this.append(binding, expression); - } - }, { - key: 'reduceAssignmentTargetIdentifier', - value: function reduceAssignmentTargetIdentifier(node) { - return this.identity; - } - }, { - key: 'reduceAssignmentTargetPropertyIdentifier', - value: function reduceAssignmentTargetPropertyIdentifier(node, _ref6) { - var binding = _ref6.binding, - init = _ref6.init; - - return this.append(binding, init == null ? this.identity : init); - } - }, { - key: 'reduceAssignmentTargetPropertyProperty', - value: function reduceAssignmentTargetPropertyProperty(node, _ref7) { - var name = _ref7.name, - binding = _ref7.binding; - - return this.append(name, binding); - } - }, { - key: 'reduceAssignmentTargetWithDefault', - value: function reduceAssignmentTargetWithDefault(node, _ref8) { - var binding = _ref8.binding, - init = _ref8.init; - - return this.append(binding, init); - } - }, { - key: 'reduceAwaitExpression', - value: function reduceAwaitExpression(node, _ref9) { - var expression = _ref9.expression; - - return expression; - } - }, { - key: 'reduceBinaryExpression', - value: function reduceBinaryExpression(node, _ref10) { - var left = _ref10.left, - right = _ref10.right; - - return this.append(left, right); - } - }, { - key: 'reduceBindingIdentifier', - value: function reduceBindingIdentifier(node) { - return this.identity; - } - }, { - key: 'reduceBindingPropertyIdentifier', - value: function reduceBindingPropertyIdentifier(node, _ref11) { - var binding = _ref11.binding, - init = _ref11.init; - - return this.append(binding, init == null ? this.identity : init); - } - }, { - key: 'reduceBindingPropertyProperty', - value: function reduceBindingPropertyProperty(node, _ref12) { - var name = _ref12.name, - binding = _ref12.binding; - - return this.append(name, binding); - } - }, { - key: 'reduceBindingWithDefault', - value: function reduceBindingWithDefault(node, _ref13) { - var binding = _ref13.binding, - init = _ref13.init; - - return this.append(binding, init); - } - }, { - key: 'reduceBlock', - value: function reduceBlock(node, _ref14) { - var statements = _ref14.statements; - - return this.append.apply(this, _toConsumableArray(statements)); - } - }, { - key: 'reduceBlockStatement', - value: function reduceBlockStatement(node, _ref15) { - var block = _ref15.block; - - return block; - } - }, { - key: 'reduceBreakStatement', - value: function reduceBreakStatement(node) { - return this.identity; - } - }, { - key: 'reduceCallExpression', - value: function reduceCallExpression(node, _ref16) { - var callee = _ref16.callee, - _arguments = _ref16.arguments; - - return this.append.apply(this, [callee].concat(_toConsumableArray(_arguments))); - } - }, { - key: 'reduceCatchClause', - value: function reduceCatchClause(node, _ref17) { - var binding = _ref17.binding, - body = _ref17.body; - - return this.append(binding, body); - } - }, { - key: 'reduceClassDeclaration', - value: function reduceClassDeclaration(node, _ref18) { - var name = _ref18.name, - _super = _ref18.super, - elements = _ref18.elements; - - return this.append.apply(this, [name, _super == null ? this.identity : _super].concat(_toConsumableArray(elements))); - } - }, { - key: 'reduceClassElement', - value: function reduceClassElement(node, _ref19) { - var method = _ref19.method; - - return method; - } - }, { - key: 'reduceClassExpression', - value: function reduceClassExpression(node, _ref20) { - var name = _ref20.name, - _super = _ref20.super, - elements = _ref20.elements; - - return this.append.apply(this, [name == null ? this.identity : name, _super == null ? this.identity : _super].concat(_toConsumableArray(elements))); - } - }, { - key: 'reduceCompoundAssignmentExpression', - value: function reduceCompoundAssignmentExpression(node, _ref21) { - var binding = _ref21.binding, - expression = _ref21.expression; - - return this.append(binding, expression); - } - }, { - key: 'reduceComputedMemberAssignmentTarget', - value: function reduceComputedMemberAssignmentTarget(node, _ref22) { - var object = _ref22.object, - expression = _ref22.expression; - - return this.append(object, expression); - } - }, { - key: 'reduceComputedMemberExpression', - value: function reduceComputedMemberExpression(node, _ref23) { - var object = _ref23.object, - expression = _ref23.expression; - - return this.append(object, expression); - } - }, { - key: 'reduceComputedPropertyName', - value: function reduceComputedPropertyName(node, _ref24) { - var expression = _ref24.expression; - - return expression; - } - }, { - key: 'reduceConditionalExpression', - value: function reduceConditionalExpression(node, _ref25) { - var test = _ref25.test, - consequent = _ref25.consequent, - alternate = _ref25.alternate; - - return this.append(test, consequent, alternate); - } - }, { - key: 'reduceContinueStatement', - value: function reduceContinueStatement(node) { - return this.identity; - } - }, { - key: 'reduceDataProperty', - value: function reduceDataProperty(node, _ref26) { - var name = _ref26.name, - expression = _ref26.expression; - - return this.append(name, expression); - } - }, { - key: 'reduceDebuggerStatement', - value: function reduceDebuggerStatement(node) { - return this.identity; - } - }, { - key: 'reduceDirective', - value: function reduceDirective(node) { - return this.identity; - } - }, { - key: 'reduceDoWhileStatement', - value: function reduceDoWhileStatement(node, _ref27) { - var body = _ref27.body, - test = _ref27.test; - - return this.append(body, test); - } - }, { - key: 'reduceEmptyStatement', - value: function reduceEmptyStatement(node) { - return this.identity; - } - }, { - key: 'reduceExport', - value: function reduceExport(node, _ref28) { - var declaration = _ref28.declaration; - - return declaration; - } - }, { - key: 'reduceExportAllFrom', - value: function reduceExportAllFrom(node) { - return this.identity; - } - }, { - key: 'reduceExportDefault', - value: function reduceExportDefault(node, _ref29) { - var body = _ref29.body; - - return body; - } - }, { - key: 'reduceExportFrom', - value: function reduceExportFrom(node, _ref30) { - var namedExports = _ref30.namedExports; - - return this.append.apply(this, _toConsumableArray(namedExports)); - } - }, { - key: 'reduceExportFromSpecifier', - value: function reduceExportFromSpecifier(node) { - return this.identity; - } - }, { - key: 'reduceExportLocalSpecifier', - value: function reduceExportLocalSpecifier(node, _ref31) { - var name = _ref31.name; - - return name; - } - }, { - key: 'reduceExportLocals', - value: function reduceExportLocals(node, _ref32) { - var namedExports = _ref32.namedExports; - - return this.append.apply(this, _toConsumableArray(namedExports)); - } - }, { - key: 'reduceExpressionStatement', - value: function reduceExpressionStatement(node, _ref33) { - var expression = _ref33.expression; - - return expression; - } - }, { - key: 'reduceForAwaitStatement', - value: function reduceForAwaitStatement(node, _ref34) { - var left = _ref34.left, - right = _ref34.right, - body = _ref34.body; - - return this.append(left, right, body); - } - }, { - key: 'reduceForInStatement', - value: function reduceForInStatement(node, _ref35) { - var left = _ref35.left, - right = _ref35.right, - body = _ref35.body; - - return this.append(left, right, body); - } - }, { - key: 'reduceForOfStatement', - value: function reduceForOfStatement(node, _ref36) { - var left = _ref36.left, - right = _ref36.right, - body = _ref36.body; - - return this.append(left, right, body); - } - }, { - key: 'reduceForStatement', - value: function reduceForStatement(node, _ref37) { - var init = _ref37.init, - test = _ref37.test, - update = _ref37.update, - body = _ref37.body; - - return this.append(init == null ? this.identity : init, test == null ? this.identity : test, update == null ? this.identity : update, body); - } - }, { - key: 'reduceFormalParameters', - value: function reduceFormalParameters(node, _ref38) { - var items = _ref38.items, - rest = _ref38.rest; - - return this.append.apply(this, _toConsumableArray(items).concat([rest == null ? this.identity : rest])); - } - }, { - key: 'reduceFunctionBody', - value: function reduceFunctionBody(node, _ref39) { - var directives = _ref39.directives, - statements = _ref39.statements; - - return this.append.apply(this, _toConsumableArray(directives).concat(_toConsumableArray(statements))); - } - }, { - key: 'reduceFunctionDeclaration', - value: function reduceFunctionDeclaration(node, _ref40) { - var name = _ref40.name, - params = _ref40.params, - body = _ref40.body; - - return this.append(name, params, body); - } - }, { - key: 'reduceFunctionExpression', - value: function reduceFunctionExpression(node, _ref41) { - var name = _ref41.name, - params = _ref41.params, - body = _ref41.body; - - return this.append(name == null ? this.identity : name, params, body); - } - }, { - key: 'reduceGetter', - value: function reduceGetter(node, _ref42) { - var name = _ref42.name, - body = _ref42.body; - - return this.append(name, body); - } - }, { - key: 'reduceIdentifierExpression', - value: function reduceIdentifierExpression(node) { - return this.identity; - } - }, { - key: 'reduceIfStatement', - value: function reduceIfStatement(node, _ref43) { - var test = _ref43.test, - consequent = _ref43.consequent, - alternate = _ref43.alternate; - - return this.append(test, consequent, alternate == null ? this.identity : alternate); - } - }, { - key: 'reduceImport', - value: function reduceImport(node, _ref44) { - var defaultBinding = _ref44.defaultBinding, - namedImports = _ref44.namedImports; - - return this.append.apply(this, [defaultBinding == null ? this.identity : defaultBinding].concat(_toConsumableArray(namedImports))); - } - }, { - key: 'reduceImportNamespace', - value: function reduceImportNamespace(node, _ref45) { - var defaultBinding = _ref45.defaultBinding, - namespaceBinding = _ref45.namespaceBinding; - - return this.append(defaultBinding == null ? this.identity : defaultBinding, namespaceBinding); - } - }, { - key: 'reduceImportSpecifier', - value: function reduceImportSpecifier(node, _ref46) { - var binding = _ref46.binding; - - return binding; - } - }, { - key: 'reduceLabeledStatement', - value: function reduceLabeledStatement(node, _ref47) { - var body = _ref47.body; - - return body; - } - }, { - key: 'reduceLiteralBooleanExpression', - value: function reduceLiteralBooleanExpression(node) { - return this.identity; - } - }, { - key: 'reduceLiteralInfinityExpression', - value: function reduceLiteralInfinityExpression(node) { - return this.identity; - } - }, { - key: 'reduceLiteralNullExpression', - value: function reduceLiteralNullExpression(node) { - return this.identity; - } - }, { - key: 'reduceLiteralNumericExpression', - value: function reduceLiteralNumericExpression(node) { - return this.identity; - } - }, { - key: 'reduceLiteralRegExpExpression', - value: function reduceLiteralRegExpExpression(node) { - return this.identity; - } - }, { - key: 'reduceLiteralStringExpression', - value: function reduceLiteralStringExpression(node) { - return this.identity; - } - }, { - key: 'reduceMethod', - value: function reduceMethod(node, _ref48) { - var name = _ref48.name, - params = _ref48.params, - body = _ref48.body; - - return this.append(name, params, body); - } - }, { - key: 'reduceModule', - value: function reduceModule(node, _ref49) { - var directives = _ref49.directives, - items = _ref49.items; - - return this.append.apply(this, _toConsumableArray(directives).concat(_toConsumableArray(items))); - } - }, { - key: 'reduceNewExpression', - value: function reduceNewExpression(node, _ref50) { - var callee = _ref50.callee, - _arguments = _ref50.arguments; - - return this.append.apply(this, [callee].concat(_toConsumableArray(_arguments))); - } - }, { - key: 'reduceNewTargetExpression', - value: function reduceNewTargetExpression(node) { - return this.identity; - } - }, { - key: 'reduceObjectAssignmentTarget', - value: function reduceObjectAssignmentTarget(node, _ref51) { - var properties = _ref51.properties, - rest = _ref51.rest; - - return this.append.apply(this, _toConsumableArray(properties).concat([rest == null ? this.identity : rest])); - } - }, { - key: 'reduceObjectBinding', - value: function reduceObjectBinding(node, _ref52) { - var properties = _ref52.properties, - rest = _ref52.rest; - - return this.append.apply(this, _toConsumableArray(properties).concat([rest == null ? this.identity : rest])); - } - }, { - key: 'reduceObjectExpression', - value: function reduceObjectExpression(node, _ref53) { - var properties = _ref53.properties; - - return this.append.apply(this, _toConsumableArray(properties)); - } - }, { - key: 'reduceReturnStatement', - value: function reduceReturnStatement(node, _ref54) { - var expression = _ref54.expression; - - return expression == null ? this.identity : expression; - } - }, { - key: 'reduceScript', - value: function reduceScript(node, _ref55) { - var directives = _ref55.directives, - statements = _ref55.statements; - - return this.append.apply(this, _toConsumableArray(directives).concat(_toConsumableArray(statements))); - } - }, { - key: 'reduceSetter', - value: function reduceSetter(node, _ref56) { - var name = _ref56.name, - param = _ref56.param, - body = _ref56.body; - - return this.append(name, param, body); - } - }, { - key: 'reduceShorthandProperty', - value: function reduceShorthandProperty(node, _ref57) { - var name = _ref57.name; - - return name; - } - }, { - key: 'reduceSpreadElement', - value: function reduceSpreadElement(node, _ref58) { - var expression = _ref58.expression; - - return expression; - } - }, { - key: 'reduceSpreadProperty', - value: function reduceSpreadProperty(node, _ref59) { - var expression = _ref59.expression; - - return expression; - } - }, { - key: 'reduceStaticMemberAssignmentTarget', - value: function reduceStaticMemberAssignmentTarget(node, _ref60) { - var object = _ref60.object; - - return object; - } - }, { - key: 'reduceStaticMemberExpression', - value: function reduceStaticMemberExpression(node, _ref61) { - var object = _ref61.object; - - return object; - } - }, { - key: 'reduceStaticPropertyName', - value: function reduceStaticPropertyName(node) { - return this.identity; - } - }, { - key: 'reduceSuper', - value: function reduceSuper(node) { - return this.identity; - } - }, { - key: 'reduceSwitchCase', - value: function reduceSwitchCase(node, _ref62) { - var test = _ref62.test, - consequent = _ref62.consequent; - - return this.append.apply(this, [test].concat(_toConsumableArray(consequent))); - } - }, { - key: 'reduceSwitchDefault', - value: function reduceSwitchDefault(node, _ref63) { - var consequent = _ref63.consequent; - - return this.append.apply(this, _toConsumableArray(consequent)); - } - }, { - key: 'reduceSwitchStatement', - value: function reduceSwitchStatement(node, _ref64) { - var discriminant = _ref64.discriminant, - cases = _ref64.cases; - - return this.append.apply(this, [discriminant].concat(_toConsumableArray(cases))); - } - }, { - key: 'reduceSwitchStatementWithDefault', - value: function reduceSwitchStatementWithDefault(node, _ref65) { - var discriminant = _ref65.discriminant, - preDefaultCases = _ref65.preDefaultCases, - defaultCase = _ref65.defaultCase, - postDefaultCases = _ref65.postDefaultCases; - - return this.append.apply(this, [discriminant].concat(_toConsumableArray(preDefaultCases), [defaultCase], _toConsumableArray(postDefaultCases))); - } - }, { - key: 'reduceTemplateElement', - value: function reduceTemplateElement(node) { - return this.identity; - } - }, { - key: 'reduceTemplateExpression', - value: function reduceTemplateExpression(node, _ref66) { - var tag = _ref66.tag, - elements = _ref66.elements; - - return this.append.apply(this, [tag == null ? this.identity : tag].concat(_toConsumableArray(elements))); - } - }, { - key: 'reduceThisExpression', - value: function reduceThisExpression(node) { - return this.identity; - } - }, { - key: 'reduceThrowStatement', - value: function reduceThrowStatement(node, _ref67) { - var expression = _ref67.expression; - - return expression; - } - }, { - key: 'reduceTryCatchStatement', - value: function reduceTryCatchStatement(node, _ref68) { - var body = _ref68.body, - catchClause = _ref68.catchClause; - - return this.append(body, catchClause); - } - }, { - key: 'reduceTryFinallyStatement', - value: function reduceTryFinallyStatement(node, _ref69) { - var body = _ref69.body, - catchClause = _ref69.catchClause, - finalizer = _ref69.finalizer; - - return this.append(body, catchClause == null ? this.identity : catchClause, finalizer); - } - }, { - key: 'reduceUnaryExpression', - value: function reduceUnaryExpression(node, _ref70) { - var operand = _ref70.operand; - - return operand; - } - }, { - key: 'reduceUpdateExpression', - value: function reduceUpdateExpression(node, _ref71) { - var operand = _ref71.operand; - - return operand; - } - }, { - key: 'reduceVariableDeclaration', - value: function reduceVariableDeclaration(node, _ref72) { - var declarators = _ref72.declarators; - - return this.append.apply(this, _toConsumableArray(declarators)); - } - }, { - key: 'reduceVariableDeclarationStatement', - value: function reduceVariableDeclarationStatement(node, _ref73) { - var declaration = _ref73.declaration; - - return declaration; - } - }, { - key: 'reduceVariableDeclarator', - value: function reduceVariableDeclarator(node, _ref74) { - var binding = _ref74.binding, - init = _ref74.init; - - return this.append(binding, init == null ? this.identity : init); - } - }, { - key: 'reduceWhileStatement', - value: function reduceWhileStatement(node, _ref75) { - var test = _ref75.test, - body = _ref75.body; - - return this.append(test, body); - } - }, { - key: 'reduceWithStatement', - value: function reduceWithStatement(node, _ref76) { - var object = _ref76.object, - body = _ref76.body; - - return this.append(object, body); - } - }, { - key: 'reduceYieldExpression', - value: function reduceYieldExpression(node, _ref77) { - var expression = _ref77.expression; - - return expression == null ? this.identity : expression; - } - }, { - key: 'reduceYieldGeneratorExpression', - value: function reduceYieldGeneratorExpression(node, _ref78) { - var expression = _ref78.expression; - - return expression; - } - }]); - - return MonoidalReducer; -}(); - -exports.default = MonoidalReducer; -}); - -var thunkedMonoidalReducer = createCommonjsModule(function (module, exports) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); // Generated by generate-monoidal-reducer.js -/** - * Copyright 2018 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - - -var _shiftAst2 = _interopRequireDefault(dist$2); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var MonoidalReducer = function () { - function MonoidalReducer(monoid) { - _classCallCheck(this, MonoidalReducer); - - var identity = monoid.empty(); - this.identity = identity; - - var concatThunk = void 0; - if (monoid.prototype && typeof monoid.prototype.concatThunk === 'function') { - concatThunk = Function.prototype.call.bind(monoid.prototype.concatThunk); - } else if (typeof monoid.concatThunk === 'function') { - concatThunk = monoid.concatThunk; - } else { - var concat = void 0; - if (monoid.prototype && typeof monoid.prototype.concat === 'function') { - concat = Function.prototype.call.bind(monoid.prototype.concat); - } else if (typeof monoid.concat === 'function') { - concat = monoid.concat; - } else { - throw new TypeError('Monoid must provide a `concatThunk` or `concat` method'); - } - if (typeof monoid.isAbsorbing === 'function') { - var isAbsorbing = monoid.isAbsorbing; - concatThunk = function concatThunk(a, b) { - return isAbsorbing(a) ? a : concat(a, b()); - }; - } else { - concatThunk = function concatThunk(a, b) { - return concat(a, b()); - }; - } - } - this.append = function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return args.reduce(concatThunk, identity); - }; - } - - _createClass(MonoidalReducer, [{ - key: 'reduceArrayAssignmentTarget', - value: function reduceArrayAssignmentTarget(node, _ref) { - var _this = this; - - var elements = _ref.elements, - rest = _ref.rest; - - return this.append.apply(this, _toConsumableArray(elements.filter(function (n) { - return n != null; - })).concat([rest == null ? function () { - return _this.identity; - } : rest])); - } - }, { - key: 'reduceArrayBinding', - value: function reduceArrayBinding(node, _ref2) { - var _this2 = this; - - var elements = _ref2.elements, - rest = _ref2.rest; - - return this.append.apply(this, _toConsumableArray(elements.filter(function (n) { - return n != null; - })).concat([rest == null ? function () { - return _this2.identity; - } : rest])); - } - }, { - key: 'reduceArrayExpression', - value: function reduceArrayExpression(node, _ref3) { - var elements = _ref3.elements; - - return this.append.apply(this, _toConsumableArray(elements.filter(function (n) { - return n != null; - }))); - } - }, { - key: 'reduceArrowExpression', - value: function reduceArrowExpression(node, _ref4) { - var params = _ref4.params, - body = _ref4.body; - - return this.append(params, body); - } - }, { - key: 'reduceAssignmentExpression', - value: function reduceAssignmentExpression(node, _ref5) { - var binding = _ref5.binding, - expression = _ref5.expression; - - return this.append(binding, expression); - } - }, { - key: 'reduceAssignmentTargetIdentifier', - value: function reduceAssignmentTargetIdentifier(node) { - return this.identity; - } - }, { - key: 'reduceAssignmentTargetPropertyIdentifier', - value: function reduceAssignmentTargetPropertyIdentifier(node, _ref6) { - var _this3 = this; - - var binding = _ref6.binding, - init = _ref6.init; - - return this.append(binding, init == null ? function () { - return _this3.identity; - } : init); - } - }, { - key: 'reduceAssignmentTargetPropertyProperty', - value: function reduceAssignmentTargetPropertyProperty(node, _ref7) { - var name = _ref7.name, - binding = _ref7.binding; - - return this.append(name, binding); - } - }, { - key: 'reduceAssignmentTargetWithDefault', - value: function reduceAssignmentTargetWithDefault(node, _ref8) { - var binding = _ref8.binding, - init = _ref8.init; - - return this.append(binding, init); - } - }, { - key: 'reduceAwaitExpression', - value: function reduceAwaitExpression(node, _ref9) { - var expression = _ref9.expression; - - return expression(); - } - }, { - key: 'reduceBinaryExpression', - value: function reduceBinaryExpression(node, _ref10) { - var left = _ref10.left, - right = _ref10.right; - - return this.append(left, right); - } - }, { - key: 'reduceBindingIdentifier', - value: function reduceBindingIdentifier(node) { - return this.identity; - } - }, { - key: 'reduceBindingPropertyIdentifier', - value: function reduceBindingPropertyIdentifier(node, _ref11) { - var _this4 = this; - - var binding = _ref11.binding, - init = _ref11.init; - - return this.append(binding, init == null ? function () { - return _this4.identity; - } : init); - } - }, { - key: 'reduceBindingPropertyProperty', - value: function reduceBindingPropertyProperty(node, _ref12) { - var name = _ref12.name, - binding = _ref12.binding; - - return this.append(name, binding); - } - }, { - key: 'reduceBindingWithDefault', - value: function reduceBindingWithDefault(node, _ref13) { - var binding = _ref13.binding, - init = _ref13.init; - - return this.append(binding, init); - } - }, { - key: 'reduceBlock', - value: function reduceBlock(node, _ref14) { - var statements = _ref14.statements; - - return this.append.apply(this, _toConsumableArray(statements)); - } - }, { - key: 'reduceBlockStatement', - value: function reduceBlockStatement(node, _ref15) { - var block = _ref15.block; - - return block(); - } - }, { - key: 'reduceBreakStatement', - value: function reduceBreakStatement(node) { - return this.identity; - } - }, { - key: 'reduceCallExpression', - value: function reduceCallExpression(node, _ref16) { - var callee = _ref16.callee, - _arguments = _ref16.arguments; - - return this.append.apply(this, [callee].concat(_toConsumableArray(_arguments))); - } - }, { - key: 'reduceCatchClause', - value: function reduceCatchClause(node, _ref17) { - var binding = _ref17.binding, - body = _ref17.body; - - return this.append(binding, body); - } - }, { - key: 'reduceClassDeclaration', - value: function reduceClassDeclaration(node, _ref18) { - var _this5 = this; - - var name = _ref18.name, - _super = _ref18.super, - elements = _ref18.elements; - - return this.append.apply(this, [name, _super == null ? function () { - return _this5.identity; - } : _super].concat(_toConsumableArray(elements))); - } - }, { - key: 'reduceClassElement', - value: function reduceClassElement(node, _ref19) { - var method = _ref19.method; - - return method(); - } - }, { - key: 'reduceClassExpression', - value: function reduceClassExpression(node, _ref20) { - var _this6 = this; - - var name = _ref20.name, - _super = _ref20.super, - elements = _ref20.elements; - - return this.append.apply(this, [name == null ? function () { - return _this6.identity; - } : name, _super == null ? function () { - return _this6.identity; - } : _super].concat(_toConsumableArray(elements))); - } - }, { - key: 'reduceCompoundAssignmentExpression', - value: function reduceCompoundAssignmentExpression(node, _ref21) { - var binding = _ref21.binding, - expression = _ref21.expression; - - return this.append(binding, expression); - } - }, { - key: 'reduceComputedMemberAssignmentTarget', - value: function reduceComputedMemberAssignmentTarget(node, _ref22) { - var object = _ref22.object, - expression = _ref22.expression; - - return this.append(object, expression); - } - }, { - key: 'reduceComputedMemberExpression', - value: function reduceComputedMemberExpression(node, _ref23) { - var object = _ref23.object, - expression = _ref23.expression; - - return this.append(object, expression); - } - }, { - key: 'reduceComputedPropertyName', - value: function reduceComputedPropertyName(node, _ref24) { - var expression = _ref24.expression; - - return expression(); - } - }, { - key: 'reduceConditionalExpression', - value: function reduceConditionalExpression(node, _ref25) { - var test = _ref25.test, - consequent = _ref25.consequent, - alternate = _ref25.alternate; - - return this.append(test, consequent, alternate); - } - }, { - key: 'reduceContinueStatement', - value: function reduceContinueStatement(node) { - return this.identity; - } - }, { - key: 'reduceDataProperty', - value: function reduceDataProperty(node, _ref26) { - var name = _ref26.name, - expression = _ref26.expression; - - return this.append(name, expression); - } - }, { - key: 'reduceDebuggerStatement', - value: function reduceDebuggerStatement(node) { - return this.identity; - } - }, { - key: 'reduceDirective', - value: function reduceDirective(node) { - return this.identity; - } - }, { - key: 'reduceDoWhileStatement', - value: function reduceDoWhileStatement(node, _ref27) { - var body = _ref27.body, - test = _ref27.test; - - return this.append(body, test); - } - }, { - key: 'reduceEmptyStatement', - value: function reduceEmptyStatement(node) { - return this.identity; - } - }, { - key: 'reduceExport', - value: function reduceExport(node, _ref28) { - var declaration = _ref28.declaration; - - return declaration(); - } - }, { - key: 'reduceExportAllFrom', - value: function reduceExportAllFrom(node) { - return this.identity; - } - }, { - key: 'reduceExportDefault', - value: function reduceExportDefault(node, _ref29) { - var body = _ref29.body; - - return body(); - } - }, { - key: 'reduceExportFrom', - value: function reduceExportFrom(node, _ref30) { - var namedExports = _ref30.namedExports; - - return this.append.apply(this, _toConsumableArray(namedExports)); - } - }, { - key: 'reduceExportFromSpecifier', - value: function reduceExportFromSpecifier(node) { - return this.identity; - } - }, { - key: 'reduceExportLocalSpecifier', - value: function reduceExportLocalSpecifier(node, _ref31) { - var name = _ref31.name; - - return name(); - } - }, { - key: 'reduceExportLocals', - value: function reduceExportLocals(node, _ref32) { - var namedExports = _ref32.namedExports; - - return this.append.apply(this, _toConsumableArray(namedExports)); - } - }, { - key: 'reduceExpressionStatement', - value: function reduceExpressionStatement(node, _ref33) { - var expression = _ref33.expression; - - return expression(); - } - }, { - key: 'reduceForAwaitStatement', - value: function reduceForAwaitStatement(node, _ref34) { - var left = _ref34.left, - right = _ref34.right, - body = _ref34.body; - - return this.append(left, right, body); - } - }, { - key: 'reduceForInStatement', - value: function reduceForInStatement(node, _ref35) { - var left = _ref35.left, - right = _ref35.right, - body = _ref35.body; - - return this.append(left, right, body); - } - }, { - key: 'reduceForOfStatement', - value: function reduceForOfStatement(node, _ref36) { - var left = _ref36.left, - right = _ref36.right, - body = _ref36.body; - - return this.append(left, right, body); - } - }, { - key: 'reduceForStatement', - value: function reduceForStatement(node, _ref37) { - var _this7 = this; - - var init = _ref37.init, - test = _ref37.test, - update = _ref37.update, - body = _ref37.body; - - return this.append(init == null ? function () { - return _this7.identity; - } : init, test == null ? function () { - return _this7.identity; - } : test, update == null ? function () { - return _this7.identity; - } : update, body); - } - }, { - key: 'reduceFormalParameters', - value: function reduceFormalParameters(node, _ref38) { - var _this8 = this; - - var items = _ref38.items, - rest = _ref38.rest; - - return this.append.apply(this, _toConsumableArray(items).concat([rest == null ? function () { - return _this8.identity; - } : rest])); - } - }, { - key: 'reduceFunctionBody', - value: function reduceFunctionBody(node, _ref39) { - var directives = _ref39.directives, - statements = _ref39.statements; - - return this.append.apply(this, _toConsumableArray(directives).concat(_toConsumableArray(statements))); - } - }, { - key: 'reduceFunctionDeclaration', - value: function reduceFunctionDeclaration(node, _ref40) { - var name = _ref40.name, - params = _ref40.params, - body = _ref40.body; - - return this.append(name, params, body); - } - }, { - key: 'reduceFunctionExpression', - value: function reduceFunctionExpression(node, _ref41) { - var _this9 = this; - - var name = _ref41.name, - params = _ref41.params, - body = _ref41.body; - - return this.append(name == null ? function () { - return _this9.identity; - } : name, params, body); - } - }, { - key: 'reduceGetter', - value: function reduceGetter(node, _ref42) { - var name = _ref42.name, - body = _ref42.body; - - return this.append(name, body); - } - }, { - key: 'reduceIdentifierExpression', - value: function reduceIdentifierExpression(node) { - return this.identity; - } - }, { - key: 'reduceIfStatement', - value: function reduceIfStatement(node, _ref43) { - var _this10 = this; - - var test = _ref43.test, - consequent = _ref43.consequent, - alternate = _ref43.alternate; - - return this.append(test, consequent, alternate == null ? function () { - return _this10.identity; - } : alternate); - } - }, { - key: 'reduceImport', - value: function reduceImport(node, _ref44) { - var _this11 = this; - - var defaultBinding = _ref44.defaultBinding, - namedImports = _ref44.namedImports; - - return this.append.apply(this, [defaultBinding == null ? function () { - return _this11.identity; - } : defaultBinding].concat(_toConsumableArray(namedImports))); - } - }, { - key: 'reduceImportNamespace', - value: function reduceImportNamespace(node, _ref45) { - var _this12 = this; - - var defaultBinding = _ref45.defaultBinding, - namespaceBinding = _ref45.namespaceBinding; - - return this.append(defaultBinding == null ? function () { - return _this12.identity; - } : defaultBinding, namespaceBinding); - } - }, { - key: 'reduceImportSpecifier', - value: function reduceImportSpecifier(node, _ref46) { - var binding = _ref46.binding; - - return binding(); - } - }, { - key: 'reduceLabeledStatement', - value: function reduceLabeledStatement(node, _ref47) { - var body = _ref47.body; - - return body(); - } - }, { - key: 'reduceLiteralBooleanExpression', - value: function reduceLiteralBooleanExpression(node) { - return this.identity; - } - }, { - key: 'reduceLiteralInfinityExpression', - value: function reduceLiteralInfinityExpression(node) { - return this.identity; - } - }, { - key: 'reduceLiteralNullExpression', - value: function reduceLiteralNullExpression(node) { - return this.identity; - } - }, { - key: 'reduceLiteralNumericExpression', - value: function reduceLiteralNumericExpression(node) { - return this.identity; - } - }, { - key: 'reduceLiteralRegExpExpression', - value: function reduceLiteralRegExpExpression(node) { - return this.identity; - } - }, { - key: 'reduceLiteralStringExpression', - value: function reduceLiteralStringExpression(node) { - return this.identity; - } - }, { - key: 'reduceMethod', - value: function reduceMethod(node, _ref48) { - var name = _ref48.name, - params = _ref48.params, - body = _ref48.body; - - return this.append(name, params, body); - } - }, { - key: 'reduceModule', - value: function reduceModule(node, _ref49) { - var directives = _ref49.directives, - items = _ref49.items; - - return this.append.apply(this, _toConsumableArray(directives).concat(_toConsumableArray(items))); - } - }, { - key: 'reduceNewExpression', - value: function reduceNewExpression(node, _ref50) { - var callee = _ref50.callee, - _arguments = _ref50.arguments; - - return this.append.apply(this, [callee].concat(_toConsumableArray(_arguments))); - } - }, { - key: 'reduceNewTargetExpression', - value: function reduceNewTargetExpression(node) { - return this.identity; - } - }, { - key: 'reduceObjectAssignmentTarget', - value: function reduceObjectAssignmentTarget(node, _ref51) { - var _this13 = this; - - var properties = _ref51.properties, - rest = _ref51.rest; - - return this.append.apply(this, _toConsumableArray(properties).concat([rest == null ? function () { - return _this13.identity; - } : rest])); - } - }, { - key: 'reduceObjectBinding', - value: function reduceObjectBinding(node, _ref52) { - var _this14 = this; - - var properties = _ref52.properties, - rest = _ref52.rest; - - return this.append.apply(this, _toConsumableArray(properties).concat([rest == null ? function () { - return _this14.identity; - } : rest])); - } - }, { - key: 'reduceObjectExpression', - value: function reduceObjectExpression(node, _ref53) { - var properties = _ref53.properties; - - return this.append.apply(this, _toConsumableArray(properties)); - } - }, { - key: 'reduceReturnStatement', - value: function reduceReturnStatement(node, _ref54) { - var expression = _ref54.expression; - - return expression == null ? this.identity : expression(); - } - }, { - key: 'reduceScript', - value: function reduceScript(node, _ref55) { - var directives = _ref55.directives, - statements = _ref55.statements; - - return this.append.apply(this, _toConsumableArray(directives).concat(_toConsumableArray(statements))); - } - }, { - key: 'reduceSetter', - value: function reduceSetter(node, _ref56) { - var name = _ref56.name, - param = _ref56.param, - body = _ref56.body; - - return this.append(name, param, body); - } - }, { - key: 'reduceShorthandProperty', - value: function reduceShorthandProperty(node, _ref57) { - var name = _ref57.name; - - return name(); - } - }, { - key: 'reduceSpreadElement', - value: function reduceSpreadElement(node, _ref58) { - var expression = _ref58.expression; - - return expression(); - } - }, { - key: 'reduceSpreadProperty', - value: function reduceSpreadProperty(node, _ref59) { - var expression = _ref59.expression; - - return expression(); - } - }, { - key: 'reduceStaticMemberAssignmentTarget', - value: function reduceStaticMemberAssignmentTarget(node, _ref60) { - var object = _ref60.object; - - return object(); - } - }, { - key: 'reduceStaticMemberExpression', - value: function reduceStaticMemberExpression(node, _ref61) { - var object = _ref61.object; - - return object(); - } - }, { - key: 'reduceStaticPropertyName', - value: function reduceStaticPropertyName(node) { - return this.identity; - } - }, { - key: 'reduceSuper', - value: function reduceSuper(node) { - return this.identity; - } - }, { - key: 'reduceSwitchCase', - value: function reduceSwitchCase(node, _ref62) { - var test = _ref62.test, - consequent = _ref62.consequent; - - return this.append.apply(this, [test].concat(_toConsumableArray(consequent))); - } - }, { - key: 'reduceSwitchDefault', - value: function reduceSwitchDefault(node, _ref63) { - var consequent = _ref63.consequent; - - return this.append.apply(this, _toConsumableArray(consequent)); - } - }, { - key: 'reduceSwitchStatement', - value: function reduceSwitchStatement(node, _ref64) { - var discriminant = _ref64.discriminant, - cases = _ref64.cases; - - return this.append.apply(this, [discriminant].concat(_toConsumableArray(cases))); - } - }, { - key: 'reduceSwitchStatementWithDefault', - value: function reduceSwitchStatementWithDefault(node, _ref65) { - var discriminant = _ref65.discriminant, - preDefaultCases = _ref65.preDefaultCases, - defaultCase = _ref65.defaultCase, - postDefaultCases = _ref65.postDefaultCases; - - return this.append.apply(this, [discriminant].concat(_toConsumableArray(preDefaultCases), [defaultCase], _toConsumableArray(postDefaultCases))); - } - }, { - key: 'reduceTemplateElement', - value: function reduceTemplateElement(node) { - return this.identity; - } - }, { - key: 'reduceTemplateExpression', - value: function reduceTemplateExpression(node, _ref66) { - var _this15 = this; - - var tag = _ref66.tag, - elements = _ref66.elements; - - return this.append.apply(this, [tag == null ? function () { - return _this15.identity; - } : tag].concat(_toConsumableArray(elements))); - } - }, { - key: 'reduceThisExpression', - value: function reduceThisExpression(node) { - return this.identity; - } - }, { - key: 'reduceThrowStatement', - value: function reduceThrowStatement(node, _ref67) { - var expression = _ref67.expression; - - return expression(); - } - }, { - key: 'reduceTryCatchStatement', - value: function reduceTryCatchStatement(node, _ref68) { - var body = _ref68.body, - catchClause = _ref68.catchClause; - - return this.append(body, catchClause); - } - }, { - key: 'reduceTryFinallyStatement', - value: function reduceTryFinallyStatement(node, _ref69) { - var _this16 = this; - - var body = _ref69.body, - catchClause = _ref69.catchClause, - finalizer = _ref69.finalizer; - - return this.append(body, catchClause == null ? function () { - return _this16.identity; - } : catchClause, finalizer); - } - }, { - key: 'reduceUnaryExpression', - value: function reduceUnaryExpression(node, _ref70) { - var operand = _ref70.operand; - - return operand(); - } - }, { - key: 'reduceUpdateExpression', - value: function reduceUpdateExpression(node, _ref71) { - var operand = _ref71.operand; - - return operand(); - } - }, { - key: 'reduceVariableDeclaration', - value: function reduceVariableDeclaration(node, _ref72) { - var declarators = _ref72.declarators; - - return this.append.apply(this, _toConsumableArray(declarators)); - } - }, { - key: 'reduceVariableDeclarationStatement', - value: function reduceVariableDeclarationStatement(node, _ref73) { - var declaration = _ref73.declaration; - - return declaration(); - } - }, { - key: 'reduceVariableDeclarator', - value: function reduceVariableDeclarator(node, _ref74) { - var _this17 = this; - - var binding = _ref74.binding, - init = _ref74.init; - - return this.append(binding, init == null ? function () { - return _this17.identity; - } : init); - } - }, { - key: 'reduceWhileStatement', - value: function reduceWhileStatement(node, _ref75) { - var test = _ref75.test, - body = _ref75.body; - - return this.append(test, body); - } - }, { - key: 'reduceWithStatement', - value: function reduceWithStatement(node, _ref76) { - var object = _ref76.object, - body = _ref76.body; - - return this.append(object, body); - } - }, { - key: 'reduceYieldExpression', - value: function reduceYieldExpression(node, _ref77) { - var expression = _ref77.expression; - - return expression == null ? this.identity : expression(); - } - }, { - key: 'reduceYieldGeneratorExpression', - value: function reduceYieldGeneratorExpression(node, _ref78) { - var expression = _ref78.expression; - - return expression(); - } - }]); - - return MonoidalReducer; -}(); - -exports.default = MonoidalReducer; -}); - -var adapt = createCommonjsModule(function (module, exports) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; // Generated by generate-adapt.js -/** - * Copyright 2018 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - - -var Shift = _interopRequireWildcard(dist$2); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -exports.default = function (fn, reducer) { - var _obj; - - return _obj = { - __proto__: reducer, - - reduceArrayAssignmentTarget: function reduceArrayAssignmentTarget(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceArrayAssignmentTarget', this).call(this, node, data), node); - }, - reduceArrayBinding: function reduceArrayBinding(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceArrayBinding', this).call(this, node, data), node); - }, - reduceArrayExpression: function reduceArrayExpression(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceArrayExpression', this).call(this, node, data), node); - }, - reduceArrowExpression: function reduceArrowExpression(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceArrowExpression', this).call(this, node, data), node); - }, - reduceAssignmentExpression: function reduceAssignmentExpression(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceAssignmentExpression', this).call(this, node, data), node); - }, - reduceAssignmentTargetIdentifier: function reduceAssignmentTargetIdentifier(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceAssignmentTargetIdentifier', this).call(this, node, data), node); - }, - reduceAssignmentTargetPropertyIdentifier: function reduceAssignmentTargetPropertyIdentifier(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceAssignmentTargetPropertyIdentifier', this).call(this, node, data), node); - }, - reduceAssignmentTargetPropertyProperty: function reduceAssignmentTargetPropertyProperty(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceAssignmentTargetPropertyProperty', this).call(this, node, data), node); - }, - reduceAssignmentTargetWithDefault: function reduceAssignmentTargetWithDefault(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceAssignmentTargetWithDefault', this).call(this, node, data), node); - }, - reduceAwaitExpression: function reduceAwaitExpression(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceAwaitExpression', this).call(this, node, data), node); - }, - reduceBinaryExpression: function reduceBinaryExpression(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceBinaryExpression', this).call(this, node, data), node); - }, - reduceBindingIdentifier: function reduceBindingIdentifier(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceBindingIdentifier', this).call(this, node, data), node); - }, - reduceBindingPropertyIdentifier: function reduceBindingPropertyIdentifier(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceBindingPropertyIdentifier', this).call(this, node, data), node); - }, - reduceBindingPropertyProperty: function reduceBindingPropertyProperty(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceBindingPropertyProperty', this).call(this, node, data), node); - }, - reduceBindingWithDefault: function reduceBindingWithDefault(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceBindingWithDefault', this).call(this, node, data), node); - }, - reduceBlock: function reduceBlock(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceBlock', this).call(this, node, data), node); - }, - reduceBlockStatement: function reduceBlockStatement(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceBlockStatement', this).call(this, node, data), node); - }, - reduceBreakStatement: function reduceBreakStatement(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceBreakStatement', this).call(this, node, data), node); - }, - reduceCallExpression: function reduceCallExpression(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceCallExpression', this).call(this, node, data), node); - }, - reduceCatchClause: function reduceCatchClause(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceCatchClause', this).call(this, node, data), node); - }, - reduceClassDeclaration: function reduceClassDeclaration(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceClassDeclaration', this).call(this, node, data), node); - }, - reduceClassElement: function reduceClassElement(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceClassElement', this).call(this, node, data), node); - }, - reduceClassExpression: function reduceClassExpression(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceClassExpression', this).call(this, node, data), node); - }, - reduceCompoundAssignmentExpression: function reduceCompoundAssignmentExpression(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceCompoundAssignmentExpression', this).call(this, node, data), node); - }, - reduceComputedMemberAssignmentTarget: function reduceComputedMemberAssignmentTarget(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceComputedMemberAssignmentTarget', this).call(this, node, data), node); - }, - reduceComputedMemberExpression: function reduceComputedMemberExpression(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceComputedMemberExpression', this).call(this, node, data), node); - }, - reduceComputedPropertyName: function reduceComputedPropertyName(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceComputedPropertyName', this).call(this, node, data), node); - }, - reduceConditionalExpression: function reduceConditionalExpression(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceConditionalExpression', this).call(this, node, data), node); - }, - reduceContinueStatement: function reduceContinueStatement(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceContinueStatement', this).call(this, node, data), node); - }, - reduceDataProperty: function reduceDataProperty(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceDataProperty', this).call(this, node, data), node); - }, - reduceDebuggerStatement: function reduceDebuggerStatement(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceDebuggerStatement', this).call(this, node, data), node); - }, - reduceDirective: function reduceDirective(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceDirective', this).call(this, node, data), node); - }, - reduceDoWhileStatement: function reduceDoWhileStatement(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceDoWhileStatement', this).call(this, node, data), node); - }, - reduceEmptyStatement: function reduceEmptyStatement(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceEmptyStatement', this).call(this, node, data), node); - }, - reduceExport: function reduceExport(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceExport', this).call(this, node, data), node); - }, - reduceExportAllFrom: function reduceExportAllFrom(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceExportAllFrom', this).call(this, node, data), node); - }, - reduceExportDefault: function reduceExportDefault(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceExportDefault', this).call(this, node, data), node); - }, - reduceExportFrom: function reduceExportFrom(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceExportFrom', this).call(this, node, data), node); - }, - reduceExportFromSpecifier: function reduceExportFromSpecifier(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceExportFromSpecifier', this).call(this, node, data), node); - }, - reduceExportLocalSpecifier: function reduceExportLocalSpecifier(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceExportLocalSpecifier', this).call(this, node, data), node); - }, - reduceExportLocals: function reduceExportLocals(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceExportLocals', this).call(this, node, data), node); - }, - reduceExpressionStatement: function reduceExpressionStatement(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceExpressionStatement', this).call(this, node, data), node); - }, - reduceForAwaitStatement: function reduceForAwaitStatement(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceForAwaitStatement', this).call(this, node, data), node); - }, - reduceForInStatement: function reduceForInStatement(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceForInStatement', this).call(this, node, data), node); - }, - reduceForOfStatement: function reduceForOfStatement(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceForOfStatement', this).call(this, node, data), node); - }, - reduceForStatement: function reduceForStatement(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceForStatement', this).call(this, node, data), node); - }, - reduceFormalParameters: function reduceFormalParameters(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceFormalParameters', this).call(this, node, data), node); - }, - reduceFunctionBody: function reduceFunctionBody(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceFunctionBody', this).call(this, node, data), node); - }, - reduceFunctionDeclaration: function reduceFunctionDeclaration(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceFunctionDeclaration', this).call(this, node, data), node); - }, - reduceFunctionExpression: function reduceFunctionExpression(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceFunctionExpression', this).call(this, node, data), node); - }, - reduceGetter: function reduceGetter(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceGetter', this).call(this, node, data), node); - }, - reduceIdentifierExpression: function reduceIdentifierExpression(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceIdentifierExpression', this).call(this, node, data), node); - }, - reduceIfStatement: function reduceIfStatement(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceIfStatement', this).call(this, node, data), node); - }, - reduceImport: function reduceImport(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceImport', this).call(this, node, data), node); - }, - reduceImportNamespace: function reduceImportNamespace(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceImportNamespace', this).call(this, node, data), node); - }, - reduceImportSpecifier: function reduceImportSpecifier(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceImportSpecifier', this).call(this, node, data), node); - }, - reduceLabeledStatement: function reduceLabeledStatement(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceLabeledStatement', this).call(this, node, data), node); - }, - reduceLiteralBooleanExpression: function reduceLiteralBooleanExpression(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceLiteralBooleanExpression', this).call(this, node, data), node); - }, - reduceLiteralInfinityExpression: function reduceLiteralInfinityExpression(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceLiteralInfinityExpression', this).call(this, node, data), node); - }, - reduceLiteralNullExpression: function reduceLiteralNullExpression(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceLiteralNullExpression', this).call(this, node, data), node); - }, - reduceLiteralNumericExpression: function reduceLiteralNumericExpression(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceLiteralNumericExpression', this).call(this, node, data), node); - }, - reduceLiteralRegExpExpression: function reduceLiteralRegExpExpression(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceLiteralRegExpExpression', this).call(this, node, data), node); - }, - reduceLiteralStringExpression: function reduceLiteralStringExpression(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceLiteralStringExpression', this).call(this, node, data), node); - }, - reduceMethod: function reduceMethod(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceMethod', this).call(this, node, data), node); - }, - reduceModule: function reduceModule(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceModule', this).call(this, node, data), node); - }, - reduceNewExpression: function reduceNewExpression(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceNewExpression', this).call(this, node, data), node); - }, - reduceNewTargetExpression: function reduceNewTargetExpression(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceNewTargetExpression', this).call(this, node, data), node); - }, - reduceObjectAssignmentTarget: function reduceObjectAssignmentTarget(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceObjectAssignmentTarget', this).call(this, node, data), node); - }, - reduceObjectBinding: function reduceObjectBinding(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceObjectBinding', this).call(this, node, data), node); - }, - reduceObjectExpression: function reduceObjectExpression(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceObjectExpression', this).call(this, node, data), node); - }, - reduceReturnStatement: function reduceReturnStatement(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceReturnStatement', this).call(this, node, data), node); - }, - reduceScript: function reduceScript(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceScript', this).call(this, node, data), node); - }, - reduceSetter: function reduceSetter(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceSetter', this).call(this, node, data), node); - }, - reduceShorthandProperty: function reduceShorthandProperty(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceShorthandProperty', this).call(this, node, data), node); - }, - reduceSpreadElement: function reduceSpreadElement(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceSpreadElement', this).call(this, node, data), node); - }, - reduceSpreadProperty: function reduceSpreadProperty(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceSpreadProperty', this).call(this, node, data), node); - }, - reduceStaticMemberAssignmentTarget: function reduceStaticMemberAssignmentTarget(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceStaticMemberAssignmentTarget', this).call(this, node, data), node); - }, - reduceStaticMemberExpression: function reduceStaticMemberExpression(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceStaticMemberExpression', this).call(this, node, data), node); - }, - reduceStaticPropertyName: function reduceStaticPropertyName(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceStaticPropertyName', this).call(this, node, data), node); - }, - reduceSuper: function reduceSuper(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceSuper', this).call(this, node, data), node); - }, - reduceSwitchCase: function reduceSwitchCase(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceSwitchCase', this).call(this, node, data), node); - }, - reduceSwitchDefault: function reduceSwitchDefault(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceSwitchDefault', this).call(this, node, data), node); - }, - reduceSwitchStatement: function reduceSwitchStatement(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceSwitchStatement', this).call(this, node, data), node); - }, - reduceSwitchStatementWithDefault: function reduceSwitchStatementWithDefault(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceSwitchStatementWithDefault', this).call(this, node, data), node); - }, - reduceTemplateElement: function reduceTemplateElement(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceTemplateElement', this).call(this, node, data), node); - }, - reduceTemplateExpression: function reduceTemplateExpression(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceTemplateExpression', this).call(this, node, data), node); - }, - reduceThisExpression: function reduceThisExpression(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceThisExpression', this).call(this, node, data), node); - }, - reduceThrowStatement: function reduceThrowStatement(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceThrowStatement', this).call(this, node, data), node); - }, - reduceTryCatchStatement: function reduceTryCatchStatement(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceTryCatchStatement', this).call(this, node, data), node); - }, - reduceTryFinallyStatement: function reduceTryFinallyStatement(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceTryFinallyStatement', this).call(this, node, data), node); - }, - reduceUnaryExpression: function reduceUnaryExpression(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceUnaryExpression', this).call(this, node, data), node); - }, - reduceUpdateExpression: function reduceUpdateExpression(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceUpdateExpression', this).call(this, node, data), node); - }, - reduceVariableDeclaration: function reduceVariableDeclaration(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceVariableDeclaration', this).call(this, node, data), node); - }, - reduceVariableDeclarationStatement: function reduceVariableDeclarationStatement(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceVariableDeclarationStatement', this).call(this, node, data), node); - }, - reduceVariableDeclarator: function reduceVariableDeclarator(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceVariableDeclarator', this).call(this, node, data), node); - }, - reduceWhileStatement: function reduceWhileStatement(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceWhileStatement', this).call(this, node, data), node); - }, - reduceWithStatement: function reduceWithStatement(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceWithStatement', this).call(this, node, data), node); - }, - reduceYieldExpression: function reduceYieldExpression(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceYieldExpression', this).call(this, node, data), node); - }, - reduceYieldGeneratorExpression: function reduceYieldGeneratorExpression(node, data) { - return fn(_get(_obj.__proto__ || Object.getPrototypeOf(_obj), 'reduceYieldGeneratorExpression', this).call(this, node, data), node); - } - }; -}; -}); - -var reducers = createCommonjsModule(function (module, exports) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ThunkedOrReducer = exports.OrReducer = exports.ThunkedAndReducer = exports.AndReducer = exports.ThunkedConcatReducer = exports.ConcatReducer = exports.ThunkedPlusReducer = exports.PlusReducer = undefined; - - - -var _monoidalReducer2 = _interopRequireDefault(monoidalReducer); - - - -var _thunkedMonoidalReducer2 = _interopRequireDefault(thunkedMonoidalReducer); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var PlusMonoid = { - empty: function empty() { - return 0; - }, - concat: function concat(a, b) { - return a + b; - } -}; - -var ConcatMonoid = { - empty: function empty() { - return []; - }, - concat: function concat(a, b) { - return a.concat(b); - } -}; - -var AndMonoid = { - empty: function empty() { - return true; - }, - concat: function concat(a, b) { - return a && b; - }, - concatThunk: function concatThunk(a, b) { - return a && b(); - } -}; - -var OrMonoid = { - empty: function empty() { - return false; - }, - concat: function concat(a, b) { - return a || b; - }, - concatThunk: function concatThunk(a, b) { - return a || b(); - } -}; - -var PlusReducer = exports.PlusReducer = function (_MonoidalReducer) { - _inherits(PlusReducer, _MonoidalReducer); - - function PlusReducer() { - _classCallCheck(this, PlusReducer); - - return _possibleConstructorReturn(this, (PlusReducer.__proto__ || Object.getPrototypeOf(PlusReducer)).call(this, PlusMonoid)); - } - - return PlusReducer; -}(_monoidalReducer2.default); - -var ThunkedPlusReducer = exports.ThunkedPlusReducer = function (_ThunkedMonoidalReduc) { - _inherits(ThunkedPlusReducer, _ThunkedMonoidalReduc); - - function ThunkedPlusReducer() { - _classCallCheck(this, ThunkedPlusReducer); - - return _possibleConstructorReturn(this, (ThunkedPlusReducer.__proto__ || Object.getPrototypeOf(ThunkedPlusReducer)).call(this, PlusMonoid)); - } - - return ThunkedPlusReducer; -}(_thunkedMonoidalReducer2.default); - -var ConcatReducer = exports.ConcatReducer = function (_MonoidalReducer2) { - _inherits(ConcatReducer, _MonoidalReducer2); - - function ConcatReducer() { - _classCallCheck(this, ConcatReducer); - - return _possibleConstructorReturn(this, (ConcatReducer.__proto__ || Object.getPrototypeOf(ConcatReducer)).call(this, ConcatMonoid)); - } - - return ConcatReducer; -}(_monoidalReducer2.default); - -var ThunkedConcatReducer = exports.ThunkedConcatReducer = function (_ThunkedMonoidalReduc2) { - _inherits(ThunkedConcatReducer, _ThunkedMonoidalReduc2); - - function ThunkedConcatReducer() { - _classCallCheck(this, ThunkedConcatReducer); - - return _possibleConstructorReturn(this, (ThunkedConcatReducer.__proto__ || Object.getPrototypeOf(ThunkedConcatReducer)).call(this, ConcatMonoid)); - } - - return ThunkedConcatReducer; -}(_thunkedMonoidalReducer2.default); - -var AndReducer = exports.AndReducer = function (_MonoidalReducer3) { - _inherits(AndReducer, _MonoidalReducer3); - - function AndReducer() { - _classCallCheck(this, AndReducer); - - return _possibleConstructorReturn(this, (AndReducer.__proto__ || Object.getPrototypeOf(AndReducer)).call(this, AndMonoid)); - } - - return AndReducer; -}(_monoidalReducer2.default); - -var ThunkedAndReducer = exports.ThunkedAndReducer = function (_ThunkedMonoidalReduc3) { - _inherits(ThunkedAndReducer, _ThunkedMonoidalReduc3); - - function ThunkedAndReducer() { - _classCallCheck(this, ThunkedAndReducer); - - return _possibleConstructorReturn(this, (ThunkedAndReducer.__proto__ || Object.getPrototypeOf(ThunkedAndReducer)).call(this, AndMonoid)); - } - - return ThunkedAndReducer; -}(_thunkedMonoidalReducer2.default); - -var OrReducer = exports.OrReducer = function (_MonoidalReducer4) { - _inherits(OrReducer, _MonoidalReducer4); - - function OrReducer() { - _classCallCheck(this, OrReducer); - - return _possibleConstructorReturn(this, (OrReducer.__proto__ || Object.getPrototypeOf(OrReducer)).call(this, OrMonoid)); - } - - return OrReducer; -}(_monoidalReducer2.default); - -var ThunkedOrReducer = exports.ThunkedOrReducer = function (_ThunkedMonoidalReduc4) { - _inherits(ThunkedOrReducer, _ThunkedMonoidalReduc4); - - function ThunkedOrReducer() { - _classCallCheck(this, ThunkedOrReducer); - - return _possibleConstructorReturn(this, (ThunkedOrReducer.__proto__ || Object.getPrototypeOf(ThunkedOrReducer)).call(this, OrMonoid)); - } - - return ThunkedOrReducer; -}(_thunkedMonoidalReducer2.default); -}); - -var dist = createCommonjsModule(function (module, exports) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); - - - -Object.defineProperty(exports, 'reduce', { - enumerable: true, - get: function get() { - return director_1.reduce; - } -}); -Object.defineProperty(exports, 'default', { - enumerable: true, - get: function get() { - return director_1.reduce; - } -}); - - - -Object.defineProperty(exports, 'thunkedReduce', { - enumerable: true, - get: function get() { - return thunkedDirector.thunkedReduce; - } -}); - - - -Object.defineProperty(exports, 'thunkify', { - enumerable: true, - get: function get() { - return _interopRequireDefault(thunkify_1).default; - } -}); - - - -Object.defineProperty(exports, 'thunkifyClass', { - enumerable: true, - get: function get() { - return _interopRequireDefault(thunkifyClass_1).default; - } -}); - - - -Object.defineProperty(exports, 'memoize', { - enumerable: true, - get: function get() { - return _interopRequireDefault(memoize_1).default; - } -}); - - - -Object.defineProperty(exports, 'CloneReducer', { - enumerable: true, - get: function get() { - return _interopRequireDefault(cloneReducer).default; - } -}); - - - -Object.defineProperty(exports, 'LazyCloneReducer', { - enumerable: true, - get: function get() { - return _interopRequireDefault(lazyCloneReducer).default; - } -}); - - - -Object.defineProperty(exports, 'MonoidalReducer', { - enumerable: true, - get: function get() { - return _interopRequireDefault(monoidalReducer).default; - } -}); - - - -Object.defineProperty(exports, 'ThunkedMonoidalReducer', { - enumerable: true, - get: function get() { - return _interopRequireDefault(thunkedMonoidalReducer).default; - } -}); - - - -Object.defineProperty(exports, 'adapt', { - enumerable: true, - get: function get() { - return _interopRequireDefault(adapt).default; - } -}); - - - -Object.defineProperty(exports, 'PlusReducer', { - enumerable: true, - get: function get() { - return reducers.PlusReducer; - } -}); -Object.defineProperty(exports, 'ThunkedPlusReducer', { - enumerable: true, - get: function get() { - return reducers.ThunkedPlusReducer; - } -}); -Object.defineProperty(exports, 'ConcatReducer', { - enumerable: true, - get: function get() { - return reducers.ConcatReducer; - } -}); -Object.defineProperty(exports, 'ThunkedConcatReducer', { - enumerable: true, - get: function get() { - return reducers.ThunkedConcatReducer; - } -}); -Object.defineProperty(exports, 'AndReducer', { - enumerable: true, - get: function get() { - return reducers.AndReducer; - } -}); -Object.defineProperty(exports, 'ThunkedAndReducer', { - enumerable: true, - get: function get() { - return reducers.ThunkedAndReducer; - } -}); -Object.defineProperty(exports, 'OrReducer', { - enumerable: true, - get: function get() { - return reducers.OrReducer; - } -}); -Object.defineProperty(exports, 'ThunkedOrReducer', { - enumerable: true, - get: function get() { - return reducers.ThunkedOrReducer; - } -}); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -}); - -var unicode = createCommonjsModule(function (module, exports) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); -// Generated by scripts/generate-unicode-data.js - -var whitespaceArray = exports.whitespaceArray = [5760, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8239, 8287, 12288, 65279]; -var whitespaceBool = exports.whitespaceBool = [false, false, false, false, false, false, false, false, false, true, false, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false]; - -var idStartLargeRegex = exports.idStartLargeRegex = /^[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]$/; -var idStartBool = exports.idStartBool = [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false, false, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false, false, false]; - -var idContinueLargeRegex = exports.idContinueLargeRegex = /^[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]$/; -var idContinueBool = exports.idContinueBool = [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, true, true, true, true, true, true, true, true, true, true, false, false, false, false, false, false, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false, false, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false, false, false]; -}); - -var tokenStream = createCommonjsModule(function (module, exports) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.TokenStream = undefined; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /** - * Copyright 2014 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -exports.needsDoubleDot = needsDoubleDot; - - - -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function isIdentifierPartES6(char) { - var charCode = char.charCodeAt(0); - if (charCode < 128) { - return unicode.idContinueBool[charCode]; - } - return unicode.idContinueLargeRegex.test(char); -} - -function needsDoubleDot(fragment) { - return fragment.indexOf('.') < 0 && fragment.indexOf('e') < 0 && fragment.indexOf('x') < 0; -} - -function renderNumber(n) { - var s = void 0; - if (n >= 1e3 && n % 10 === 0) { - s = n.toString(10); - if (/[eE]/.test(s)) { - return s.replace(/[eE]\+/, 'e'); - } - return n.toString(10).replace(/0{3,}$/, function (match) { - return 'e' + match.length; - }); - } else if (n % 1 === 0) { - if (n > 1e15 && n < 1e20) { - return '0x' + n.toString(16).toUpperCase(); - } - return n.toString(10).replace(/[eE]\+/, 'e'); - } - return n.toString(10).replace(/^0\./, '.').replace(/[eE]\+/, 'e'); -} - -var TokenStream = exports.TokenStream = function () { - function TokenStream() { - _classCallCheck(this, TokenStream); - - this.result = ''; - this.lastNumber = null; - this.lastCodePoint = null; - this.lastTokenStr = ''; - this.optionalSemi = false; - this.previousWasRegExp = false; - this.partialHtmlComment = false; - } - - _createClass(TokenStream, [{ - key: 'putNumber', - value: function putNumber(number) { - var tokenStr = renderNumber(number); - this.put(tokenStr); - this.lastNumber = tokenStr; - } - }, { - key: 'putOptionalSemi', - value: function putOptionalSemi() { - this.optionalSemi = true; - } - }, { - key: 'putRaw', - value: function putRaw(tokenStr) { - this.result += tokenStr; - this.lastTokenStr = tokenStr; - } - }, { - key: 'put', - value: function put(tokenStr, isRegExp) { - if (this.optionalSemi) { - this.optionalSemi = false; - if (tokenStr !== '}') { - this.result += ';'; - this.lastCodePoint = ';'; - this.previousWasRegExp = false; - } - } - if (this.lastNumber !== null && tokenStr.length === 1) { - if (tokenStr === '.') { - this.result += needsDoubleDot(this.lastNumber) ? '..' : '.'; - this.lastNumber = null; - this.lastCodePoint = '.'; - return; - } - } - var tokenStrCodePointCount = [].concat(_toConsumableArray(tokenStr)).length; // slow, no unicode length? - if (tokenStrCodePointCount > 0) { - this.lastNumber = null; - var rightCodePoint = String.fromCodePoint(tokenStr.codePointAt(0)); - var lastCodePoint = this.lastCodePoint; - this.lastCodePoint = String.fromCodePoint(tokenStr.codePointAt(tokenStrCodePointCount - 1)); - var previousWasRegExp = this.previousWasRegExp; - this.previousWasRegExp = isRegExp; - - if (lastCodePoint && ((lastCodePoint === '+' || lastCodePoint === '-') && lastCodePoint === rightCodePoint || isIdentifierPartES6(lastCodePoint) && isIdentifierPartES6(rightCodePoint) || lastCodePoint === '/' && rightCodePoint === '/' || previousWasRegExp && rightCodePoint === 'i' || this.partialHtmlComment && tokenStr.startsWith('--'))) { - this.result += ' '; - } - } - - this.partialHtmlComment = this.lastTokenStr.endsWith('<') && tokenStr === '!'; - - this.result += tokenStr; - this.lastTokenStr = tokenStr; - } - }]); - - return TokenStream; -}(); -}); - -var withLocation = createCommonjsModule(function (module, exports) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -exports.default = codeGenWithLocation; - - - - - - - -var _minimalCodegen2 = _interopRequireDefault(minimalCodegen); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -function mightHaveSemi(type) { - return (/(Import)|(Export)|(Statement)|(Directive)|(SwitchCase)|(SwitchDefault)/.test(type) - ); -} - -var TokenStreamWithLocation = function (_TokenStream) { - _inherits(TokenStreamWithLocation, _TokenStream); - - function TokenStreamWithLocation() { - _classCallCheck(this, TokenStreamWithLocation); - - var _this = _possibleConstructorReturn(this, (TokenStreamWithLocation.__proto__ || Object.getPrototypeOf(TokenStreamWithLocation)).call(this)); - - _this.line = 1; - _this.column = 0; - _this.startingNodes = []; - _this.finishingStatements = []; - _this.lastNumberNode = null; - _this.locations = new WeakMap(); - return _this; - } - - _createClass(TokenStreamWithLocation, [{ - key: 'putRaw', - value: function putRaw(tokenStr) { - var previousLength = this.result.length; - _get(TokenStreamWithLocation.prototype.__proto__ || Object.getPrototypeOf(TokenStreamWithLocation.prototype), 'putRaw', this).call(this, tokenStr); - this.startNodes(tokenStr, previousLength); - } - }, { - key: 'put', - value: function put(tokenStr, isRegExp) { - if (this.optionalSemi && tokenStr !== '}') { - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = this.finishingStatements[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var obj = _step.value; - - ++obj.end.column; - ++obj.end.offset; - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - } - this.finishingStatements = []; - - if (this.lastNumber !== null && tokenStr === '.' && (0, tokenStream.needsDoubleDot)(this.lastNumber)) { - var loc = this.locations.get(this.lastNumberNode).end; - ++loc.column; - ++loc.offset; - } - this.lastNumberNode = null; - - var previousLength = this.result.length; - _get(TokenStreamWithLocation.prototype.__proto__ || Object.getPrototypeOf(TokenStreamWithLocation.prototype), 'put', this).call(this, tokenStr, isRegExp); - this.startNodes(tokenStr, previousLength); - } - }, { - key: 'startNodes', - value: function startNodes(tokenStr, previousLength) { - var linebreakRegex = /\r\n?|[\n\u2028\u2029]/g; - var matched = false; - var match = void 0; - var startLine = this.line; - var startColumn = this.column; - while (match = linebreakRegex.exec(tokenStr)) { - ++this.line; - this.column = tokenStr.length - match.index - match[0].length; - matched = true; - } - - if (!matched) { - this.column += this.result.length - previousLength; - startColumn = this.column - tokenStr.length; // i.e., skip past any additional characters which were necessitated by, but not part of, this part - } - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - - try { - for (var _iterator2 = this.startingNodes[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var node = _step2.value; - - this.locations.set(node, { - start: { - line: startLine, - column: startColumn, - offset: this.result.length - tokenStr.length - }, - end: null - }); - } - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2.return) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - - this.startingNodes = []; - } - }, { - key: 'startEmit', - value: function startEmit(node) { - this.startingNodes.push(node); - } - }, { - key: 'finishEmit', - value: function finishEmit(node) { - this.locations.get(node).end = { - line: this.line, - column: this.column, - offset: this.result.length - }; - if (mightHaveSemi(node.type)) { - this.finishingStatements.push(this.locations.get(node)); - } - } - }]); - - return TokenStreamWithLocation; -}(tokenStream.TokenStream); - -function addLocation(rep, node) { - var originalEmit = rep.emit.bind(rep); - if (node.type === 'Script' || node.type === 'Module') { - // These are handled specially: they include beginning and trailing whitespace. - rep.emit = function (ts) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - ts.locations.set(node, { - start: { - line: 1, - column: 0, - offset: 0 - }, - end: null - }); - originalEmit.apply(undefined, [ts].concat(args)); - ts.locations.get(node).end = { - line: ts.line, - column: ts.column, - offset: ts.result.length - }; - }; - } else if (node.type === 'LiteralNumericExpression') { - rep.emit = function (ts) { - for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - args[_key2 - 1] = arguments[_key2]; - } - - ts.startEmit(node); - originalEmit.apply(undefined, [ts].concat(args)); - ts.finishEmit(node); - ts.lastNumberNode = node; - }; - } else { - rep.emit = function (ts) { - for (var _len3 = arguments.length, args = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { - args[_key3 - 1] = arguments[_key3]; - } - - ts.startEmit(node); - originalEmit.apply(undefined, [ts].concat(args)); - ts.finishEmit(node); - }; - } - return rep; -} - -function addLocationToReducer(reducer) { - var wrapped = (0, dist.adapt)(addLocation, reducer); - - var originalRegenerate = wrapped.regenerateArrowParams.bind(wrapped); - wrapped.regenerateArrowParams = function (element, original) { - var out = originalRegenerate(element, original); - if (out !== original) { - addLocation(out, element); - } - return out; - }; - - var originalDirective = wrapped.parenToAvoidBeingDirective.bind(wrapped); - wrapped.parenToAvoidBeingDirective = function (element, original) { - var out = originalDirective(element, original); - if (out !== original) { - addLocation(out, element); - } - return out; - }; - - return wrapped; -} - -function codeGenWithLocation(program) { - var generator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new _minimalCodegen2.default(); - - var ts = new TokenStreamWithLocation(); - var rep = (0, dist.reduce)(addLocationToReducer(generator), program); - rep.emit(ts); - return { source: ts.result, locations: ts.locations }; -} -}); - -var dist$1 = createCommonjsModule(function (module, exports) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.codeGenWithLocation = exports.SemiOp = exports.CommaSep = exports.Semi = exports.Seq = exports.ContainsIn = exports.NoIn = exports.Brace = exports.Bracket = exports.Paren = exports.NumberCodeRep = exports.Token = exports.Empty = exports.CodeRep = exports.escapeStringLiteral = exports.getPrecedence = exports.Precedence = exports.Sep = exports.FormattedCodeGen = exports.ExtensibleCodeGen = exports.MinimalCodeGen = undefined; -exports.default = codeGen; - - - -Object.defineProperty(exports, 'MinimalCodeGen', { - enumerable: true, - get: function get() { - return _interopRequireDefault(minimalCodegen).default; - } -}); - - - -Object.defineProperty(exports, 'ExtensibleCodeGen', { - enumerable: true, - get: function get() { - return formattedCodegen.ExtensibleCodeGen; - } -}); -Object.defineProperty(exports, 'FormattedCodeGen', { - enumerable: true, - get: function get() { - return formattedCodegen.FormattedCodeGen; - } -}); -Object.defineProperty(exports, 'Sep', { - enumerable: true, - get: function get() { - return formattedCodegen.Sep; - } -}); - - - -Object.defineProperty(exports, 'Precedence', { - enumerable: true, - get: function get() { - return coderep.Precedence; - } -}); -Object.defineProperty(exports, 'getPrecedence', { - enumerable: true, - get: function get() { - return coderep.getPrecedence; - } -}); -Object.defineProperty(exports, 'escapeStringLiteral', { - enumerable: true, - get: function get() { - return coderep.escapeStringLiteral; - } -}); -Object.defineProperty(exports, 'CodeRep', { - enumerable: true, - get: function get() { - return coderep.CodeRep; - } -}); -Object.defineProperty(exports, 'Empty', { - enumerable: true, - get: function get() { - return coderep.Empty; - } -}); -Object.defineProperty(exports, 'Token', { - enumerable: true, - get: function get() { - return coderep.Token; - } -}); -Object.defineProperty(exports, 'NumberCodeRep', { - enumerable: true, - get: function get() { - return coderep.NumberCodeRep; - } -}); -Object.defineProperty(exports, 'Paren', { - enumerable: true, - get: function get() { - return coderep.Paren; - } -}); -Object.defineProperty(exports, 'Bracket', { - enumerable: true, - get: function get() { - return coderep.Bracket; - } -}); -Object.defineProperty(exports, 'Brace', { - enumerable: true, - get: function get() { - return coderep.Brace; - } -}); -Object.defineProperty(exports, 'NoIn', { - enumerable: true, - get: function get() { - return coderep.NoIn; - } -}); -Object.defineProperty(exports, 'ContainsIn', { - enumerable: true, - get: function get() { - return coderep.ContainsIn; - } -}); -Object.defineProperty(exports, 'Seq', { - enumerable: true, - get: function get() { - return coderep.Seq; - } -}); -Object.defineProperty(exports, 'Semi', { - enumerable: true, - get: function get() { - return coderep.Semi; - } -}); -Object.defineProperty(exports, 'CommaSep', { - enumerable: true, - get: function get() { - return coderep.CommaSep; - } -}); -Object.defineProperty(exports, 'SemiOp', { - enumerable: true, - get: function get() { - return coderep.SemiOp; - } -}); - - - -Object.defineProperty(exports, 'codeGenWithLocation', { - enumerable: true, - get: function get() { - return _interopRequireDefault(withLocation).default; - } -}); - - - -var _shiftReducer2 = _interopRequireDefault(dist); - - - -var _minimalCodegen2 = _interopRequireDefault(minimalCodegen); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function codeGen(script) { - var generator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new _minimalCodegen2.default(); - - var ts = new tokenStream.TokenStream(); - var rep = (0, _shiftReducer2.default)(generator, script); - rep.emit(ts); - return ts.result; -} -}); - -var __pika_web_default_export_for_treeshaking__ = /*@__PURE__*/getDefaultExportFromCjs(dist$1); - -export default __pika_web_default_export_for_treeshaking__; diff --git a/docs/_snowpack/pkg/shift-regexp-acceptor.js b/docs/_snowpack/pkg/shift-regexp-acceptor.js deleted file mode 100644 index a7c9d7b4..00000000 --- a/docs/_snowpack/pkg/shift-regexp-acceptor.js +++ /dev/null @@ -1,1771 +0,0 @@ -import { c as createCommonjsModule, g as getDefaultExportFromCjs } from './common/_commonjsHelpers-8c19dec8.js'; - -var mappings = new Map([ - ['General_Category', new Map([ - ['C', 'Other'], - ['Cc', 'Control'], - ['cntrl', 'Control'], - ['Cf', 'Format'], - ['Cn', 'Unassigned'], - ['Co', 'Private_Use'], - ['Cs', 'Surrogate'], - ['L', 'Letter'], - ['LC', 'Cased_Letter'], - ['Ll', 'Lowercase_Letter'], - ['Lm', 'Modifier_Letter'], - ['Lo', 'Other_Letter'], - ['Lt', 'Titlecase_Letter'], - ['Lu', 'Uppercase_Letter'], - ['M', 'Mark'], - ['Combining_Mark', 'Mark'], - ['Mc', 'Spacing_Mark'], - ['Me', 'Enclosing_Mark'], - ['Mn', 'Nonspacing_Mark'], - ['N', 'Number'], - ['Nd', 'Decimal_Number'], - ['digit', 'Decimal_Number'], - ['Nl', 'Letter_Number'], - ['No', 'Other_Number'], - ['P', 'Punctuation'], - ['punct', 'Punctuation'], - ['Pc', 'Connector_Punctuation'], - ['Pd', 'Dash_Punctuation'], - ['Pe', 'Close_Punctuation'], - ['Pf', 'Final_Punctuation'], - ['Pi', 'Initial_Punctuation'], - ['Po', 'Other_Punctuation'], - ['Ps', 'Open_Punctuation'], - ['S', 'Symbol'], - ['Sc', 'Currency_Symbol'], - ['Sk', 'Modifier_Symbol'], - ['Sm', 'Math_Symbol'], - ['So', 'Other_Symbol'], - ['Z', 'Separator'], - ['Zl', 'Line_Separator'], - ['Zp', 'Paragraph_Separator'], - ['Zs', 'Space_Separator'], - ['Other', 'Other'], - ['Control', 'Control'], - ['Format', 'Format'], - ['Unassigned', 'Unassigned'], - ['Private_Use', 'Private_Use'], - ['Surrogate', 'Surrogate'], - ['Letter', 'Letter'], - ['Cased_Letter', 'Cased_Letter'], - ['Lowercase_Letter', 'Lowercase_Letter'], - ['Modifier_Letter', 'Modifier_Letter'], - ['Other_Letter', 'Other_Letter'], - ['Titlecase_Letter', 'Titlecase_Letter'], - ['Uppercase_Letter', 'Uppercase_Letter'], - ['Mark', 'Mark'], - ['Spacing_Mark', 'Spacing_Mark'], - ['Enclosing_Mark', 'Enclosing_Mark'], - ['Nonspacing_Mark', 'Nonspacing_Mark'], - ['Number', 'Number'], - ['Decimal_Number', 'Decimal_Number'], - ['Letter_Number', 'Letter_Number'], - ['Other_Number', 'Other_Number'], - ['Punctuation', 'Punctuation'], - ['Connector_Punctuation', 'Connector_Punctuation'], - ['Dash_Punctuation', 'Dash_Punctuation'], - ['Close_Punctuation', 'Close_Punctuation'], - ['Final_Punctuation', 'Final_Punctuation'], - ['Initial_Punctuation', 'Initial_Punctuation'], - ['Other_Punctuation', 'Other_Punctuation'], - ['Open_Punctuation', 'Open_Punctuation'], - ['Symbol', 'Symbol'], - ['Currency_Symbol', 'Currency_Symbol'], - ['Modifier_Symbol', 'Modifier_Symbol'], - ['Math_Symbol', 'Math_Symbol'], - ['Other_Symbol', 'Other_Symbol'], - ['Separator', 'Separator'], - ['Line_Separator', 'Line_Separator'], - ['Paragraph_Separator', 'Paragraph_Separator'], - ['Space_Separator', 'Space_Separator'] - ])], - ['Script', new Map([ - ['Adlm', 'Adlam'], - ['Aghb', 'Caucasian_Albanian'], - ['Ahom', 'Ahom'], - ['Arab', 'Arabic'], - ['Armi', 'Imperial_Aramaic'], - ['Armn', 'Armenian'], - ['Avst', 'Avestan'], - ['Bali', 'Balinese'], - ['Bamu', 'Bamum'], - ['Bass', 'Bassa_Vah'], - ['Batk', 'Batak'], - ['Beng', 'Bengali'], - ['Bhks', 'Bhaiksuki'], - ['Bopo', 'Bopomofo'], - ['Brah', 'Brahmi'], - ['Brai', 'Braille'], - ['Bugi', 'Buginese'], - ['Buhd', 'Buhid'], - ['Cakm', 'Chakma'], - ['Cans', 'Canadian_Aboriginal'], - ['Cari', 'Carian'], - ['Cham', 'Cham'], - ['Cher', 'Cherokee'], - ['Copt', 'Coptic'], - ['Qaac', 'Coptic'], - ['Cprt', 'Cypriot'], - ['Cyrl', 'Cyrillic'], - ['Deva', 'Devanagari'], - ['Dogr', 'Dogra'], - ['Dsrt', 'Deseret'], - ['Dupl', 'Duployan'], - ['Egyp', 'Egyptian_Hieroglyphs'], - ['Elba', 'Elbasan'], - ['Ethi', 'Ethiopic'], - ['Geor', 'Georgian'], - ['Glag', 'Glagolitic'], - ['Gong', 'Gunjala_Gondi'], - ['Gonm', 'Masaram_Gondi'], - ['Goth', 'Gothic'], - ['Gran', 'Grantha'], - ['Grek', 'Greek'], - ['Gujr', 'Gujarati'], - ['Guru', 'Gurmukhi'], - ['Hang', 'Hangul'], - ['Hani', 'Han'], - ['Hano', 'Hanunoo'], - ['Hatr', 'Hatran'], - ['Hebr', 'Hebrew'], - ['Hira', 'Hiragana'], - ['Hluw', 'Anatolian_Hieroglyphs'], - ['Hmng', 'Pahawh_Hmong'], - ['Hrkt', 'Katakana_Or_Hiragana'], - ['Hung', 'Old_Hungarian'], - ['Ital', 'Old_Italic'], - ['Java', 'Javanese'], - ['Kali', 'Kayah_Li'], - ['Kana', 'Katakana'], - ['Khar', 'Kharoshthi'], - ['Khmr', 'Khmer'], - ['Khoj', 'Khojki'], - ['Knda', 'Kannada'], - ['Kthi', 'Kaithi'], - ['Lana', 'Tai_Tham'], - ['Laoo', 'Lao'], - ['Latn', 'Latin'], - ['Lepc', 'Lepcha'], - ['Limb', 'Limbu'], - ['Lina', 'Linear_A'], - ['Linb', 'Linear_B'], - ['Lisu', 'Lisu'], - ['Lyci', 'Lycian'], - ['Lydi', 'Lydian'], - ['Mahj', 'Mahajani'], - ['Maka', 'Makasar'], - ['Mand', 'Mandaic'], - ['Mani', 'Manichaean'], - ['Marc', 'Marchen'], - ['Medf', 'Medefaidrin'], - ['Mend', 'Mende_Kikakui'], - ['Merc', 'Meroitic_Cursive'], - ['Mero', 'Meroitic_Hieroglyphs'], - ['Mlym', 'Malayalam'], - ['Modi', 'Modi'], - ['Mong', 'Mongolian'], - ['Mroo', 'Mro'], - ['Mtei', 'Meetei_Mayek'], - ['Mult', 'Multani'], - ['Mymr', 'Myanmar'], - ['Narb', 'Old_North_Arabian'], - ['Nbat', 'Nabataean'], - ['Newa', 'Newa'], - ['Nkoo', 'Nko'], - ['Nshu', 'Nushu'], - ['Ogam', 'Ogham'], - ['Olck', 'Ol_Chiki'], - ['Orkh', 'Old_Turkic'], - ['Orya', 'Oriya'], - ['Osge', 'Osage'], - ['Osma', 'Osmanya'], - ['Palm', 'Palmyrene'], - ['Pauc', 'Pau_Cin_Hau'], - ['Perm', 'Old_Permic'], - ['Phag', 'Phags_Pa'], - ['Phli', 'Inscriptional_Pahlavi'], - ['Phlp', 'Psalter_Pahlavi'], - ['Phnx', 'Phoenician'], - ['Plrd', 'Miao'], - ['Prti', 'Inscriptional_Parthian'], - ['Rjng', 'Rejang'], - ['Rohg', 'Hanifi_Rohingya'], - ['Runr', 'Runic'], - ['Samr', 'Samaritan'], - ['Sarb', 'Old_South_Arabian'], - ['Saur', 'Saurashtra'], - ['Sgnw', 'SignWriting'], - ['Shaw', 'Shavian'], - ['Shrd', 'Sharada'], - ['Sidd', 'Siddham'], - ['Sind', 'Khudawadi'], - ['Sinh', 'Sinhala'], - ['Sogd', 'Sogdian'], - ['Sogo', 'Old_Sogdian'], - ['Sora', 'Sora_Sompeng'], - ['Soyo', 'Soyombo'], - ['Sund', 'Sundanese'], - ['Sylo', 'Syloti_Nagri'], - ['Syrc', 'Syriac'], - ['Tagb', 'Tagbanwa'], - ['Takr', 'Takri'], - ['Tale', 'Tai_Le'], - ['Talu', 'New_Tai_Lue'], - ['Taml', 'Tamil'], - ['Tang', 'Tangut'], - ['Tavt', 'Tai_Viet'], - ['Telu', 'Telugu'], - ['Tfng', 'Tifinagh'], - ['Tglg', 'Tagalog'], - ['Thaa', 'Thaana'], - ['Thai', 'Thai'], - ['Tibt', 'Tibetan'], - ['Tirh', 'Tirhuta'], - ['Ugar', 'Ugaritic'], - ['Vaii', 'Vai'], - ['Wara', 'Warang_Citi'], - ['Xpeo', 'Old_Persian'], - ['Xsux', 'Cuneiform'], - ['Yiii', 'Yi'], - ['Zanb', 'Zanabazar_Square'], - ['Zinh', 'Inherited'], - ['Qaai', 'Inherited'], - ['Zyyy', 'Common'], - ['Zzzz', 'Unknown'], - ['Adlam', 'Adlam'], - ['Caucasian_Albanian', 'Caucasian_Albanian'], - ['Arabic', 'Arabic'], - ['Imperial_Aramaic', 'Imperial_Aramaic'], - ['Armenian', 'Armenian'], - ['Avestan', 'Avestan'], - ['Balinese', 'Balinese'], - ['Bamum', 'Bamum'], - ['Bassa_Vah', 'Bassa_Vah'], - ['Batak', 'Batak'], - ['Bengali', 'Bengali'], - ['Bhaiksuki', 'Bhaiksuki'], - ['Bopomofo', 'Bopomofo'], - ['Brahmi', 'Brahmi'], - ['Braille', 'Braille'], - ['Buginese', 'Buginese'], - ['Buhid', 'Buhid'], - ['Chakma', 'Chakma'], - ['Canadian_Aboriginal', 'Canadian_Aboriginal'], - ['Carian', 'Carian'], - ['Cherokee', 'Cherokee'], - ['Coptic', 'Coptic'], - ['Cypriot', 'Cypriot'], - ['Cyrillic', 'Cyrillic'], - ['Devanagari', 'Devanagari'], - ['Dogra', 'Dogra'], - ['Deseret', 'Deseret'], - ['Duployan', 'Duployan'], - ['Egyptian_Hieroglyphs', 'Egyptian_Hieroglyphs'], - ['Elbasan', 'Elbasan'], - ['Ethiopic', 'Ethiopic'], - ['Georgian', 'Georgian'], - ['Glagolitic', 'Glagolitic'], - ['Gunjala_Gondi', 'Gunjala_Gondi'], - ['Masaram_Gondi', 'Masaram_Gondi'], - ['Gothic', 'Gothic'], - ['Grantha', 'Grantha'], - ['Greek', 'Greek'], - ['Gujarati', 'Gujarati'], - ['Gurmukhi', 'Gurmukhi'], - ['Hangul', 'Hangul'], - ['Han', 'Han'], - ['Hanunoo', 'Hanunoo'], - ['Hatran', 'Hatran'], - ['Hebrew', 'Hebrew'], - ['Hiragana', 'Hiragana'], - ['Anatolian_Hieroglyphs', 'Anatolian_Hieroglyphs'], - ['Pahawh_Hmong', 'Pahawh_Hmong'], - ['Katakana_Or_Hiragana', 'Katakana_Or_Hiragana'], - ['Old_Hungarian', 'Old_Hungarian'], - ['Old_Italic', 'Old_Italic'], - ['Javanese', 'Javanese'], - ['Kayah_Li', 'Kayah_Li'], - ['Katakana', 'Katakana'], - ['Kharoshthi', 'Kharoshthi'], - ['Khmer', 'Khmer'], - ['Khojki', 'Khojki'], - ['Kannada', 'Kannada'], - ['Kaithi', 'Kaithi'], - ['Tai_Tham', 'Tai_Tham'], - ['Lao', 'Lao'], - ['Latin', 'Latin'], - ['Lepcha', 'Lepcha'], - ['Limbu', 'Limbu'], - ['Linear_A', 'Linear_A'], - ['Linear_B', 'Linear_B'], - ['Lycian', 'Lycian'], - ['Lydian', 'Lydian'], - ['Mahajani', 'Mahajani'], - ['Makasar', 'Makasar'], - ['Mandaic', 'Mandaic'], - ['Manichaean', 'Manichaean'], - ['Marchen', 'Marchen'], - ['Medefaidrin', 'Medefaidrin'], - ['Mende_Kikakui', 'Mende_Kikakui'], - ['Meroitic_Cursive', 'Meroitic_Cursive'], - ['Meroitic_Hieroglyphs', 'Meroitic_Hieroglyphs'], - ['Malayalam', 'Malayalam'], - ['Mongolian', 'Mongolian'], - ['Mro', 'Mro'], - ['Meetei_Mayek', 'Meetei_Mayek'], - ['Multani', 'Multani'], - ['Myanmar', 'Myanmar'], - ['Old_North_Arabian', 'Old_North_Arabian'], - ['Nabataean', 'Nabataean'], - ['Nko', 'Nko'], - ['Nushu', 'Nushu'], - ['Ogham', 'Ogham'], - ['Ol_Chiki', 'Ol_Chiki'], - ['Old_Turkic', 'Old_Turkic'], - ['Oriya', 'Oriya'], - ['Osage', 'Osage'], - ['Osmanya', 'Osmanya'], - ['Palmyrene', 'Palmyrene'], - ['Pau_Cin_Hau', 'Pau_Cin_Hau'], - ['Old_Permic', 'Old_Permic'], - ['Phags_Pa', 'Phags_Pa'], - ['Inscriptional_Pahlavi', 'Inscriptional_Pahlavi'], - ['Psalter_Pahlavi', 'Psalter_Pahlavi'], - ['Phoenician', 'Phoenician'], - ['Miao', 'Miao'], - ['Inscriptional_Parthian', 'Inscriptional_Parthian'], - ['Rejang', 'Rejang'], - ['Hanifi_Rohingya', 'Hanifi_Rohingya'], - ['Runic', 'Runic'], - ['Samaritan', 'Samaritan'], - ['Old_South_Arabian', 'Old_South_Arabian'], - ['Saurashtra', 'Saurashtra'], - ['SignWriting', 'SignWriting'], - ['Shavian', 'Shavian'], - ['Sharada', 'Sharada'], - ['Siddham', 'Siddham'], - ['Khudawadi', 'Khudawadi'], - ['Sinhala', 'Sinhala'], - ['Sogdian', 'Sogdian'], - ['Old_Sogdian', 'Old_Sogdian'], - ['Sora_Sompeng', 'Sora_Sompeng'], - ['Soyombo', 'Soyombo'], - ['Sundanese', 'Sundanese'], - ['Syloti_Nagri', 'Syloti_Nagri'], - ['Syriac', 'Syriac'], - ['Tagbanwa', 'Tagbanwa'], - ['Takri', 'Takri'], - ['Tai_Le', 'Tai_Le'], - ['New_Tai_Lue', 'New_Tai_Lue'], - ['Tamil', 'Tamil'], - ['Tangut', 'Tangut'], - ['Tai_Viet', 'Tai_Viet'], - ['Telugu', 'Telugu'], - ['Tifinagh', 'Tifinagh'], - ['Tagalog', 'Tagalog'], - ['Thaana', 'Thaana'], - ['Tibetan', 'Tibetan'], - ['Tirhuta', 'Tirhuta'], - ['Ugaritic', 'Ugaritic'], - ['Vai', 'Vai'], - ['Warang_Citi', 'Warang_Citi'], - ['Old_Persian', 'Old_Persian'], - ['Cuneiform', 'Cuneiform'], - ['Yi', 'Yi'], - ['Zanabazar_Square', 'Zanabazar_Square'], - ['Inherited', 'Inherited'], - ['Common', 'Common'], - ['Unknown', 'Unknown'] - ])], - ['Script_Extensions', new Map([ - ['Adlm', 'Adlam'], - ['Aghb', 'Caucasian_Albanian'], - ['Ahom', 'Ahom'], - ['Arab', 'Arabic'], - ['Armi', 'Imperial_Aramaic'], - ['Armn', 'Armenian'], - ['Avst', 'Avestan'], - ['Bali', 'Balinese'], - ['Bamu', 'Bamum'], - ['Bass', 'Bassa_Vah'], - ['Batk', 'Batak'], - ['Beng', 'Bengali'], - ['Bhks', 'Bhaiksuki'], - ['Bopo', 'Bopomofo'], - ['Brah', 'Brahmi'], - ['Brai', 'Braille'], - ['Bugi', 'Buginese'], - ['Buhd', 'Buhid'], - ['Cakm', 'Chakma'], - ['Cans', 'Canadian_Aboriginal'], - ['Cari', 'Carian'], - ['Cham', 'Cham'], - ['Cher', 'Cherokee'], - ['Copt', 'Coptic'], - ['Qaac', 'Coptic'], - ['Cprt', 'Cypriot'], - ['Cyrl', 'Cyrillic'], - ['Deva', 'Devanagari'], - ['Dogr', 'Dogra'], - ['Dsrt', 'Deseret'], - ['Dupl', 'Duployan'], - ['Egyp', 'Egyptian_Hieroglyphs'], - ['Elba', 'Elbasan'], - ['Ethi', 'Ethiopic'], - ['Geor', 'Georgian'], - ['Glag', 'Glagolitic'], - ['Gong', 'Gunjala_Gondi'], - ['Gonm', 'Masaram_Gondi'], - ['Goth', 'Gothic'], - ['Gran', 'Grantha'], - ['Grek', 'Greek'], - ['Gujr', 'Gujarati'], - ['Guru', 'Gurmukhi'], - ['Hang', 'Hangul'], - ['Hani', 'Han'], - ['Hano', 'Hanunoo'], - ['Hatr', 'Hatran'], - ['Hebr', 'Hebrew'], - ['Hira', 'Hiragana'], - ['Hluw', 'Anatolian_Hieroglyphs'], - ['Hmng', 'Pahawh_Hmong'], - ['Hrkt', 'Katakana_Or_Hiragana'], - ['Hung', 'Old_Hungarian'], - ['Ital', 'Old_Italic'], - ['Java', 'Javanese'], - ['Kali', 'Kayah_Li'], - ['Kana', 'Katakana'], - ['Khar', 'Kharoshthi'], - ['Khmr', 'Khmer'], - ['Khoj', 'Khojki'], - ['Knda', 'Kannada'], - ['Kthi', 'Kaithi'], - ['Lana', 'Tai_Tham'], - ['Laoo', 'Lao'], - ['Latn', 'Latin'], - ['Lepc', 'Lepcha'], - ['Limb', 'Limbu'], - ['Lina', 'Linear_A'], - ['Linb', 'Linear_B'], - ['Lisu', 'Lisu'], - ['Lyci', 'Lycian'], - ['Lydi', 'Lydian'], - ['Mahj', 'Mahajani'], - ['Maka', 'Makasar'], - ['Mand', 'Mandaic'], - ['Mani', 'Manichaean'], - ['Marc', 'Marchen'], - ['Medf', 'Medefaidrin'], - ['Mend', 'Mende_Kikakui'], - ['Merc', 'Meroitic_Cursive'], - ['Mero', 'Meroitic_Hieroglyphs'], - ['Mlym', 'Malayalam'], - ['Modi', 'Modi'], - ['Mong', 'Mongolian'], - ['Mroo', 'Mro'], - ['Mtei', 'Meetei_Mayek'], - ['Mult', 'Multani'], - ['Mymr', 'Myanmar'], - ['Narb', 'Old_North_Arabian'], - ['Nbat', 'Nabataean'], - ['Newa', 'Newa'], - ['Nkoo', 'Nko'], - ['Nshu', 'Nushu'], - ['Ogam', 'Ogham'], - ['Olck', 'Ol_Chiki'], - ['Orkh', 'Old_Turkic'], - ['Orya', 'Oriya'], - ['Osge', 'Osage'], - ['Osma', 'Osmanya'], - ['Palm', 'Palmyrene'], - ['Pauc', 'Pau_Cin_Hau'], - ['Perm', 'Old_Permic'], - ['Phag', 'Phags_Pa'], - ['Phli', 'Inscriptional_Pahlavi'], - ['Phlp', 'Psalter_Pahlavi'], - ['Phnx', 'Phoenician'], - ['Plrd', 'Miao'], - ['Prti', 'Inscriptional_Parthian'], - ['Rjng', 'Rejang'], - ['Rohg', 'Hanifi_Rohingya'], - ['Runr', 'Runic'], - ['Samr', 'Samaritan'], - ['Sarb', 'Old_South_Arabian'], - ['Saur', 'Saurashtra'], - ['Sgnw', 'SignWriting'], - ['Shaw', 'Shavian'], - ['Shrd', 'Sharada'], - ['Sidd', 'Siddham'], - ['Sind', 'Khudawadi'], - ['Sinh', 'Sinhala'], - ['Sogd', 'Sogdian'], - ['Sogo', 'Old_Sogdian'], - ['Sora', 'Sora_Sompeng'], - ['Soyo', 'Soyombo'], - ['Sund', 'Sundanese'], - ['Sylo', 'Syloti_Nagri'], - ['Syrc', 'Syriac'], - ['Tagb', 'Tagbanwa'], - ['Takr', 'Takri'], - ['Tale', 'Tai_Le'], - ['Talu', 'New_Tai_Lue'], - ['Taml', 'Tamil'], - ['Tang', 'Tangut'], - ['Tavt', 'Tai_Viet'], - ['Telu', 'Telugu'], - ['Tfng', 'Tifinagh'], - ['Tglg', 'Tagalog'], - ['Thaa', 'Thaana'], - ['Thai', 'Thai'], - ['Tibt', 'Tibetan'], - ['Tirh', 'Tirhuta'], - ['Ugar', 'Ugaritic'], - ['Vaii', 'Vai'], - ['Wara', 'Warang_Citi'], - ['Xpeo', 'Old_Persian'], - ['Xsux', 'Cuneiform'], - ['Yiii', 'Yi'], - ['Zanb', 'Zanabazar_Square'], - ['Zinh', 'Inherited'], - ['Qaai', 'Inherited'], - ['Zyyy', 'Common'], - ['Zzzz', 'Unknown'], - ['Adlam', 'Adlam'], - ['Caucasian_Albanian', 'Caucasian_Albanian'], - ['Arabic', 'Arabic'], - ['Imperial_Aramaic', 'Imperial_Aramaic'], - ['Armenian', 'Armenian'], - ['Avestan', 'Avestan'], - ['Balinese', 'Balinese'], - ['Bamum', 'Bamum'], - ['Bassa_Vah', 'Bassa_Vah'], - ['Batak', 'Batak'], - ['Bengali', 'Bengali'], - ['Bhaiksuki', 'Bhaiksuki'], - ['Bopomofo', 'Bopomofo'], - ['Brahmi', 'Brahmi'], - ['Braille', 'Braille'], - ['Buginese', 'Buginese'], - ['Buhid', 'Buhid'], - ['Chakma', 'Chakma'], - ['Canadian_Aboriginal', 'Canadian_Aboriginal'], - ['Carian', 'Carian'], - ['Cherokee', 'Cherokee'], - ['Coptic', 'Coptic'], - ['Cypriot', 'Cypriot'], - ['Cyrillic', 'Cyrillic'], - ['Devanagari', 'Devanagari'], - ['Dogra', 'Dogra'], - ['Deseret', 'Deseret'], - ['Duployan', 'Duployan'], - ['Egyptian_Hieroglyphs', 'Egyptian_Hieroglyphs'], - ['Elbasan', 'Elbasan'], - ['Ethiopic', 'Ethiopic'], - ['Georgian', 'Georgian'], - ['Glagolitic', 'Glagolitic'], - ['Gunjala_Gondi', 'Gunjala_Gondi'], - ['Masaram_Gondi', 'Masaram_Gondi'], - ['Gothic', 'Gothic'], - ['Grantha', 'Grantha'], - ['Greek', 'Greek'], - ['Gujarati', 'Gujarati'], - ['Gurmukhi', 'Gurmukhi'], - ['Hangul', 'Hangul'], - ['Han', 'Han'], - ['Hanunoo', 'Hanunoo'], - ['Hatran', 'Hatran'], - ['Hebrew', 'Hebrew'], - ['Hiragana', 'Hiragana'], - ['Anatolian_Hieroglyphs', 'Anatolian_Hieroglyphs'], - ['Pahawh_Hmong', 'Pahawh_Hmong'], - ['Katakana_Or_Hiragana', 'Katakana_Or_Hiragana'], - ['Old_Hungarian', 'Old_Hungarian'], - ['Old_Italic', 'Old_Italic'], - ['Javanese', 'Javanese'], - ['Kayah_Li', 'Kayah_Li'], - ['Katakana', 'Katakana'], - ['Kharoshthi', 'Kharoshthi'], - ['Khmer', 'Khmer'], - ['Khojki', 'Khojki'], - ['Kannada', 'Kannada'], - ['Kaithi', 'Kaithi'], - ['Tai_Tham', 'Tai_Tham'], - ['Lao', 'Lao'], - ['Latin', 'Latin'], - ['Lepcha', 'Lepcha'], - ['Limbu', 'Limbu'], - ['Linear_A', 'Linear_A'], - ['Linear_B', 'Linear_B'], - ['Lycian', 'Lycian'], - ['Lydian', 'Lydian'], - ['Mahajani', 'Mahajani'], - ['Makasar', 'Makasar'], - ['Mandaic', 'Mandaic'], - ['Manichaean', 'Manichaean'], - ['Marchen', 'Marchen'], - ['Medefaidrin', 'Medefaidrin'], - ['Mende_Kikakui', 'Mende_Kikakui'], - ['Meroitic_Cursive', 'Meroitic_Cursive'], - ['Meroitic_Hieroglyphs', 'Meroitic_Hieroglyphs'], - ['Malayalam', 'Malayalam'], - ['Mongolian', 'Mongolian'], - ['Mro', 'Mro'], - ['Meetei_Mayek', 'Meetei_Mayek'], - ['Multani', 'Multani'], - ['Myanmar', 'Myanmar'], - ['Old_North_Arabian', 'Old_North_Arabian'], - ['Nabataean', 'Nabataean'], - ['Nko', 'Nko'], - ['Nushu', 'Nushu'], - ['Ogham', 'Ogham'], - ['Ol_Chiki', 'Ol_Chiki'], - ['Old_Turkic', 'Old_Turkic'], - ['Oriya', 'Oriya'], - ['Osage', 'Osage'], - ['Osmanya', 'Osmanya'], - ['Palmyrene', 'Palmyrene'], - ['Pau_Cin_Hau', 'Pau_Cin_Hau'], - ['Old_Permic', 'Old_Permic'], - ['Phags_Pa', 'Phags_Pa'], - ['Inscriptional_Pahlavi', 'Inscriptional_Pahlavi'], - ['Psalter_Pahlavi', 'Psalter_Pahlavi'], - ['Phoenician', 'Phoenician'], - ['Miao', 'Miao'], - ['Inscriptional_Parthian', 'Inscriptional_Parthian'], - ['Rejang', 'Rejang'], - ['Hanifi_Rohingya', 'Hanifi_Rohingya'], - ['Runic', 'Runic'], - ['Samaritan', 'Samaritan'], - ['Old_South_Arabian', 'Old_South_Arabian'], - ['Saurashtra', 'Saurashtra'], - ['SignWriting', 'SignWriting'], - ['Shavian', 'Shavian'], - ['Sharada', 'Sharada'], - ['Siddham', 'Siddham'], - ['Khudawadi', 'Khudawadi'], - ['Sinhala', 'Sinhala'], - ['Sogdian', 'Sogdian'], - ['Old_Sogdian', 'Old_Sogdian'], - ['Sora_Sompeng', 'Sora_Sompeng'], - ['Soyombo', 'Soyombo'], - ['Sundanese', 'Sundanese'], - ['Syloti_Nagri', 'Syloti_Nagri'], - ['Syriac', 'Syriac'], - ['Tagbanwa', 'Tagbanwa'], - ['Takri', 'Takri'], - ['Tai_Le', 'Tai_Le'], - ['New_Tai_Lue', 'New_Tai_Lue'], - ['Tamil', 'Tamil'], - ['Tangut', 'Tangut'], - ['Tai_Viet', 'Tai_Viet'], - ['Telugu', 'Telugu'], - ['Tifinagh', 'Tifinagh'], - ['Tagalog', 'Tagalog'], - ['Thaana', 'Thaana'], - ['Tibetan', 'Tibetan'], - ['Tirhuta', 'Tirhuta'], - ['Ugaritic', 'Ugaritic'], - ['Vai', 'Vai'], - ['Warang_Citi', 'Warang_Citi'], - ['Old_Persian', 'Old_Persian'], - ['Cuneiform', 'Cuneiform'], - ['Yi', 'Yi'], - ['Zanabazar_Square', 'Zanabazar_Square'], - ['Inherited', 'Inherited'], - ['Common', 'Common'], - ['Unknown', 'Unknown'] - ])] -]); - -const matchPropertyValue = function(property, value) { - const aliasToValue = mappings.get(property); - if (!aliasToValue) { - throw new Error(`Unknown property \`${ property }\`.`); - } - const canonicalValue = aliasToValue.get(value); - if (canonicalValue) { - return canonicalValue; - } - throw new Error( - `Unknown value \`${ value }\` for property \`${ property }\`.` - ); -}; - -var unicodeMatchPropertyValueEcmascript = matchPropertyValue; - -var unicodeCanonicalPropertyNamesEcmascript = new Set([ - // Non-binary properties: - 'General_Category', - 'Script', - 'Script_Extensions', - // Binary properties: - 'Alphabetic', - 'Any', - 'ASCII', - 'ASCII_Hex_Digit', - 'Assigned', - 'Bidi_Control', - 'Bidi_Mirrored', - 'Case_Ignorable', - 'Cased', - 'Changes_When_Casefolded', - 'Changes_When_Casemapped', - 'Changes_When_Lowercased', - 'Changes_When_NFKC_Casefolded', - 'Changes_When_Titlecased', - 'Changes_When_Uppercased', - 'Dash', - 'Default_Ignorable_Code_Point', - 'Deprecated', - 'Diacritic', - 'Emoji', - 'Emoji_Component', - 'Emoji_Modifier', - 'Emoji_Modifier_Base', - 'Emoji_Presentation', - 'Extended_Pictographic', - 'Extender', - 'Grapheme_Base', - 'Grapheme_Extend', - 'Hex_Digit', - 'ID_Continue', - 'ID_Start', - 'Ideographic', - 'IDS_Binary_Operator', - 'IDS_Trinary_Operator', - 'Join_Control', - 'Logical_Order_Exception', - 'Lowercase', - 'Math', - 'Noncharacter_Code_Point', - 'Pattern_Syntax', - 'Pattern_White_Space', - 'Quotation_Mark', - 'Radical', - 'Regional_Indicator', - 'Sentence_Terminal', - 'Soft_Dotted', - 'Terminal_Punctuation', - 'Unified_Ideograph', - 'Uppercase', - 'Variation_Selector', - 'White_Space', - 'XID_Continue', - 'XID_Start' -]); - -// Generated using `npm run build`. Do not edit! -var unicodePropertyAliasesEcmascript = new Map([ - ['scx', 'Script_Extensions'], - ['sc', 'Script'], - ['gc', 'General_Category'], - ['AHex', 'ASCII_Hex_Digit'], - ['Alpha', 'Alphabetic'], - ['Bidi_C', 'Bidi_Control'], - ['Bidi_M', 'Bidi_Mirrored'], - ['Cased', 'Cased'], - ['CI', 'Case_Ignorable'], - ['CWCF', 'Changes_When_Casefolded'], - ['CWCM', 'Changes_When_Casemapped'], - ['CWKCF', 'Changes_When_NFKC_Casefolded'], - ['CWL', 'Changes_When_Lowercased'], - ['CWT', 'Changes_When_Titlecased'], - ['CWU', 'Changes_When_Uppercased'], - ['Dash', 'Dash'], - ['Dep', 'Deprecated'], - ['DI', 'Default_Ignorable_Code_Point'], - ['Dia', 'Diacritic'], - ['Ext', 'Extender'], - ['Gr_Base', 'Grapheme_Base'], - ['Gr_Ext', 'Grapheme_Extend'], - ['Hex', 'Hex_Digit'], - ['IDC', 'ID_Continue'], - ['Ideo', 'Ideographic'], - ['IDS', 'ID_Start'], - ['IDSB', 'IDS_Binary_Operator'], - ['IDST', 'IDS_Trinary_Operator'], - ['Join_C', 'Join_Control'], - ['LOE', 'Logical_Order_Exception'], - ['Lower', 'Lowercase'], - ['Math', 'Math'], - ['NChar', 'Noncharacter_Code_Point'], - ['Pat_Syn', 'Pattern_Syntax'], - ['Pat_WS', 'Pattern_White_Space'], - ['QMark', 'Quotation_Mark'], - ['Radical', 'Radical'], - ['RI', 'Regional_Indicator'], - ['SD', 'Soft_Dotted'], - ['STerm', 'Sentence_Terminal'], - ['Term', 'Terminal_Punctuation'], - ['UIdeo', 'Unified_Ideograph'], - ['Upper', 'Uppercase'], - ['VS', 'Variation_Selector'], - ['WSpace', 'White_Space'], - ['space', 'White_Space'], - ['XIDC', 'XID_Continue'], - ['XIDS', 'XID_Start'] -]); - -const matchProperty = function(property) { - if (unicodeCanonicalPropertyNamesEcmascript.has(property)) { - return property; - } - if (unicodePropertyAliasesEcmascript.has(property)) { - return unicodePropertyAliasesEcmascript.get(property); - } - throw new Error(`Unknown property: ${ property }`); -}; - -var unicodeMatchPropertyEcmascript = matchProperty; - -var unicode = createCommonjsModule(function (module, exports) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); -// Generated by shift-parser-js/scripts/generate-unicode-data.js - -var whitespaceArray = exports.whitespaceArray = [5760, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8239, 8287, 12288, 65279]; -var whitespaceBool = exports.whitespaceBool = [false, false, false, false, false, false, false, false, false, true, false, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false]; - -var idStartLargeRegex = exports.idStartLargeRegex = /^[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]$/; -var idStartBool = exports.idStartBool = [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false, false, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false, false, false]; - -var idContinueLargeRegex = exports.idContinueLargeRegex = /^[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]$/; -var idContinueBool = exports.idContinueBool = [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, true, true, true, true, true, true, true, true, true, true, false, false, false, false, false, false, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false, false, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false, false, false]; -}); - -var dist = createCommonjsModule(function (module, exports) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /** - * Copyright 2018 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* eslint-disable no-use-before-define */ - - - -var _unicodeMatchPropertyValueEcmascript2 = _interopRequireDefault(unicodeMatchPropertyValueEcmascript); - - - -var _mappings2 = _interopRequireDefault(mappings); - - - -var _unicodeMatchPropertyEcmascript2 = _interopRequireDefault(unicodeMatchPropertyEcmascript); - - - -var _unicodePropertyAliasesEcmascript2 = _interopRequireDefault(unicodePropertyAliasesEcmascript); - - - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var catchIsFalse = function catchIsFalse(predicate) { - try { - return !!predicate(); - } catch (e) { - return false; - } -}; - -var syntaxCharacters = '^$\\.*+?()[]{}|'.split(''); -var extendedSyntaxCharacters = '^$\\.*+?()[|'.split(''); - -var controlEscapeCharacters = 'fnrtv'.split(''); -var controlEscapeCharacterValues = { 'f': '\f'.charCodeAt(0), 'n': '\n'.charCodeAt(0), 'r': '\r'.charCodeAt(0), 't': '\t'.charCodeAt(0), 'v': '\v'.charCodeAt(0) }; - -var controlCharacters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split(''); -var hexDigits = '0123456789abcdefABCDEF'.split(''); -var decimalDigits = '0123456789'.split(''); -var octalDigits = '01234567'.split(''); - -var INVALID_NAMED_BACKREFERENCE_SENTINEL = {}; - -function isIdentifierStart(ch) { - return ch < 128 ? unicode.idStartBool[ch] : unicode.idStartLargeRegex.test(String.fromCodePoint(ch)); -} - -function isIdentifierPart(ch) { - return ch < 128 ? unicode.idContinueBool[ch] : unicode.idContinueLargeRegex.test(String.fromCodePoint(ch)); -} - -var PatternAcceptorState = function () { - function PatternAcceptorState(pattern, unicode) { - _classCallCheck(this, PatternAcceptorState); - - this.pattern = pattern; - this.unicode = unicode; - this.index = 0; - this.largestBackreference = 0; - this.backreferenceNames = []; - this.groupingNames = []; - this.capturingGroups = 0; - } - - _createClass(PatternAcceptorState, [{ - key: 'empty', - value: function empty() { - return this.index >= this.pattern.length; - } - }, { - key: 'backreference', - value: function backreference(ref) { - if (ref > this.largestBackreference) { - this.largestBackreference = ref; - } - } - }, { - key: 'nextCodePoint', - value: function nextCodePoint() { - if (this.empty()) { - return null; - } - if (this.unicode) { - return String.fromCodePoint(this.pattern.codePointAt(this.index)); - } - return this.pattern.charAt(this.index); - } - }, { - key: 'skipCodePoint', - value: function skipCodePoint() { - this.index += this.nextCodePoint().length; - } - }, { - key: 'eat', - value: function eat(str) { - if (this.index + str.length > this.pattern.length || this.pattern.slice(this.index, this.index + str.length) !== str) { - return false; - } - this.index += str.length; - return true; - } - }, { - key: 'eatIdentifierCodePoint', - value: function eatIdentifierCodePoint() { - var characterValue = void 0; - var originalIndex = this.index; - var character = void 0; - if (this.match('\\u')) { - this.skipCodePoint(); - characterValue = acceptUnicodeEscape(this); - if (!characterValue.matched) { - this.index = originalIndex; - return null; - } - characterValue = characterValue.value; - character = String.fromCodePoint(characterValue); - } else { - character = this.nextCodePoint(); - if (character == null) { - this.index = originalIndex; - return null; - } - this.index += character.length; - characterValue = character.codePointAt(0); - } - return { character: character, characterValue: characterValue }; - } - }, { - key: 'eatIdentifierStart', - value: function eatIdentifierStart() { - var originalIndex = this.index; - var codePoint = this.eatIdentifierCodePoint(); - if (codePoint === null) { - this.index = originalIndex; - return null; - } - if (codePoint.character === '_' || codePoint.character === '$' || isIdentifierStart(codePoint.characterValue)) { - return codePoint.character; - } - this.index = originalIndex; - return null; - } - }, { - key: 'eatIdentifierPart', - value: function eatIdentifierPart() { - var originalIndex = this.index; - var codePoint = this.eatIdentifierCodePoint(); - if (codePoint === null) { - this.index = originalIndex; - return null; - } - // ZWNJ / ZWJ - if (codePoint.character === '\u200C' || codePoint.character === '\u200D' || codePoint.character === '$' || isIdentifierPart(codePoint.characterValue)) { - return codePoint.character; - } - this.index = originalIndex; - return null; - } - }, { - key: 'eatAny', - value: function eatAny() { - for (var _len = arguments.length, strs = Array(_len), _key = 0; _key < _len; _key++) { - strs[_key] = arguments[_key]; - } - - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = strs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var str = _step.value; - - if (this.eat(str)) { - return str; - } - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - - return null; - } - }, { - key: 'match', - value: function match(str) { - return this.index + str.length <= this.pattern.length && this.pattern.slice(this.index, this.index + str.length) === str; - } - }, { - key: 'matchAny', - value: function matchAny() { - for (var _len2 = arguments.length, strs = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - strs[_key2] = arguments[_key2]; - } - - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - - try { - for (var _iterator2 = strs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var str = _step2.value; - - if (this.match(str)) { - return true; - } - } - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2.return) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - - return false; - } - }, { - key: 'eatNaturalNumber', - value: function eatNaturalNumber() { - var _this = this; - - var characters = []; - var eatNumber = function eatNumber() { - var _iteratorNormalCompletion3 = true; - var _didIteratorError3 = false; - var _iteratorError3 = undefined; - - try { - for (var _iterator3 = decimalDigits[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { - var str = _step3.value; - - if (_this.eat(str)) { - characters.push(str); - return true; - } - } - } catch (err) { - _didIteratorError3 = true; - _iteratorError3 = err; - } finally { - try { - if (!_iteratorNormalCompletion3 && _iterator3.return) { - _iterator3.return(); - } - } finally { - if (_didIteratorError3) { - throw _iteratorError3; - } - } - } - - return false; - }; - while (eatNumber()) {} - return characters.length === 0 ? null : characters.join(''); - } - }]); - - return PatternAcceptorState; -}(); - -// acceptRegex - - -exports.default = function (pattern) { - var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - _ref$unicode = _ref.unicode, - unicode = _ref$unicode === undefined ? false : _ref$unicode; - - var state = new PatternAcceptorState(pattern, unicode); - var accepted = acceptDisjunction(state); - if (accepted.matched) { - if (state.unicode) { - if (state.largestBackreference > state.capturingGroups) { - return false; - } - } - if (state.groupingNames.length > 0 || state.unicode) { - var _iteratorNormalCompletion4 = true; - var _didIteratorError4 = false; - var _iteratorError4 = undefined; - - try { - for (var _iterator4 = state.backreferenceNames[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { - var backreferenceName = _step4.value; - - if (state.groupingNames.indexOf(backreferenceName) === -1) { - return false; - } - } - } catch (err) { - _didIteratorError4 = true; - _iteratorError4 = err; - } finally { - try { - if (!_iteratorNormalCompletion4 && _iterator4.return) { - _iterator4.return(); - } - } finally { - if (_didIteratorError4) { - throw _iteratorError4; - } - } - } - } - } - return accepted.matched; -}; - -var backtrackOnFailure = function backtrackOnFailure(func) { - return function (state) { - var savedIndex = state.index; - var oldBackreference = state.largestBackreference; - var oldCapturingGroups = state.capturingGroups; - var val = func(state); - if (!val.matched) { - state.index = savedIndex; - state.largestBackreference = oldBackreference; - state.capturingGroups = oldCapturingGroups; - } - return val; - }; -}; - -var acceptUnicodeEscape = backtrackOnFailure(function (state) { - if (!state.eat('u')) { - return { matched: false }; - } - if (state.unicode && state.eat('{')) { - var _digits = []; - while (!state.eat('}')) { - var digit = state.eatAny.apply(state, _toConsumableArray(hexDigits)); - if (digit === null) { - return { matched: false }; - } - _digits.push(digit); - } - var _value = parseInt(_digits.join(''), 16); - return _value > 0x10FFFF ? { matched: false } : { matched: true, value: _value }; - } - var digits = [0, 0, 0, 0].map(function () { - return state.eatAny.apply(state, _toConsumableArray(hexDigits)); - }); - if (digits.some(function (digit) { - return digit === null; - })) { - return { matched: false }; - } - var value = parseInt(digits.join(''), 16); - if (state.unicode && value >= 0xD800 && value <= 0xDBFF) { - var surrogatePairValue = backtrackOnFailure(function (subState) { - if (!subState.eat('\\u')) { - return { matched: false }; - } - var digits2 = [0, 0, 0, 0].map(function () { - return subState.eatAny.apply(subState, _toConsumableArray(hexDigits)); - }); - if (digits2.some(function (digit) { - return digit === null; - })) { - return { matched: false }; - } - var value2 = parseInt(digits2.join(''), 16); - if (value2 < 0xDC00 || value2 >= 0xE000) { - return { matched: false }; - } - return { matched: true, value: 0x10000 + ((value & 0x03FF) << 10) + (value2 & 0x03FF) }; - })(state); - if (surrogatePairValue.matched) { - return surrogatePairValue; - } - } - return { matched: true, value: value }; -}); - -var acceptDisjunction = function acceptDisjunction(state, terminator) { - do { - if (terminator !== void 0 && state.eat(terminator)) { - return { matched: true }; - } else if (state.match('|')) { - continue; - } - if (!acceptAlternative(state, terminator).matched) { - return { matched: false }; - } - } while (state.eat('|')); - return { matched: terminator === void 0 || !!state.eat(terminator) }; -}; - -var acceptAlternative = function acceptAlternative(state, terminator) { - while (!state.match('|') && !state.empty() && (terminator === void 0 || !state.match(terminator))) { - if (!acceptTerm(state).matched) { - return { matched: false }; - } - } - return { matched: true }; -}; - -var anyOf = function anyOf() { - for (var _len3 = arguments.length, acceptors = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - acceptors[_key3] = arguments[_key3]; - } - - return function (state) { - var _iteratorNormalCompletion5 = true; - var _didIteratorError5 = false; - var _iteratorError5 = undefined; - - try { - for (var _iterator5 = acceptors[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { - var predicate = _step5.value; - - var value = predicate(state); - if (value.matched) { - return value; - } - } - } catch (err) { - _didIteratorError5 = true; - _iteratorError5 = err; - } finally { - try { - if (!_iteratorNormalCompletion5 && _iterator5.return) { - _iterator5.return(); - } - } finally { - if (_didIteratorError5) { - throw _iteratorError5; - } - } - } - - return { matched: false }; - }; -}; - -var acceptTerm = function acceptTerm(state) { - // non-quantified references are rolled into quantified accepts to improve performance significantly. - if (state.unicode) { - return anyOf(acceptAssertion, acceptQuantified(acceptAtom))(state); - } - return anyOf(acceptQuantified(acceptQuantifiableAssertion), acceptAssertion, acceptQuantified(acceptAtom))(state); -}; - -var acceptLabeledGroup = function acceptLabeledGroup(predicate) { - return backtrackOnFailure(function (state) { - if (!state.eat('(')) { - return { matched: false }; - } - if (predicate(state)) { - return acceptDisjunction(state, ')'); - } - return { matched: false }; - }); -}; - -var acceptQuantifiableAssertion = acceptLabeledGroup(function (state) { - return !!state.eatAny('?=', '?!'); -}); - -var acceptAssertion = function acceptAssertion(state) { - if (state.eatAny('^', '$', '\\b', '\\B')) { - return { matched: true }; - } - return acceptLabeledGroup(function (subState) { - return subState.unicode ? !!subState.eatAny('?=', '?!', '?<=', '? parseInt(num2)) { - return { matched: false }; - } - } - if (!subState.eat('}')) { - return { matched: false }; - } - subState.eat('?'); - return { matched: true }; - })(state); - if (!value.matched) { - return { matched: !state.unicode }; - } - return value; - } else if (state.eatAny('*', '+', '?')) { - state.eat('?'); - } - return { matched: true }; - }); -}; - -var acceptCharacterExcept = function acceptCharacterExcept(characters) { - return function (state) { - var nextCodePoint = state.nextCodePoint(); - if (nextCodePoint === null || characters.indexOf(nextCodePoint) !== -1) { - return { matched: false }; - } - state.skipCodePoint(); - return { matched: true }; - }; -}; - -var acceptPatternCharacter = acceptCharacterExcept(syntaxCharacters); - -var acceptExtendedPatternCharacter = acceptCharacterExcept(extendedSyntaxCharacters); - -var acceptInvalidBracedQuantifier = function acceptInvalidBracedQuantifier(state) { - return backtrackOnFailure(function (subState) { - return { matched: !!(subState.eat('{') && acceptDecimal(subState).matched && (!subState.eat(',') || subState.match('}') || acceptDecimal(subState).matched) && subState.eat('}')) }; - })(state); -}; - -var acceptAtom = function acceptAtom(state) { - if (state.unicode) { - return anyOf(acceptPatternCharacter, function (subState) { - return { matched: !!subState.eat('.') }; - }, backtrackOnFailure(function (subState) { - return subState.eat('\\') ? acceptAtomEscape(subState) : { matched: false }; - }), acceptCharacterClass, acceptLabeledGroup(function (subState) { - return subState.eat('?:'); - }), acceptGrouping)(state); - } - var matched = anyOf(function (subState) { - return { matched: !!subState.eat('.') }; - }, backtrackOnFailure(function (subState) { - return subState.eat('\\') ? acceptAtomEscape(subState) : { matched: false }; - }), backtrackOnFailure(function (subState) { - return { matched: subState.eat('\\') && subState.match('c') }; - }), acceptCharacterClass, acceptLabeledGroup(function (subState) { - return subState.eat('?:'); - }), acceptGrouping)(state); - if (!matched.matched && acceptInvalidBracedQuantifier(state).matched) { - return { matched: false }; - } - return matched.matched ? matched : acceptExtendedPatternCharacter(state); -}; - -var acceptGrouping = backtrackOnFailure(function (state) { - if (!state.eat('(')) { - return { matched: false }; - } - var groupName = backtrackOnFailure(function (subState) { - if (!state.eat('?')) { - return { matched: false }; - } - return acceptGroupName(subState); - })(state); - if (!acceptDisjunction(state, ')').matched) { - return { matched: false }; - } - if (groupName.matched) { - if (state.groupingNames.indexOf(groupName.data) !== -1) { - return { matched: false }; - } - state.groupingNames.push(groupName.data); - } - state.capturingGroups++; - return { matched: true }; -}); - -var acceptDecimalEscape = backtrackOnFailure(function (state) { - var firstDecimal = state.eatAny.apply(state, _toConsumableArray(decimalDigits)); - if (firstDecimal === null) { - return { matched: false }; - } - if (firstDecimal === '0') { - return { matched: true }; - } - // we also accept octal escapes here, but it is impossible to tell if it is a octal escape until all parsing is complete. - // octal escapes are handled in acceptCharacterEscape for classes - state.backreference(parseInt(firstDecimal + (state.eatNaturalNumber() || ''))); - return { matched: true }; -}); - -var acceptCharacterClassEscape = function acceptCharacterClassEscape(state) { - if (state.eatAny('d', 'D', 's', 'S', 'w', 'W')) { - return { matched: true }; - } - if (state.unicode) { - return backtrackOnFailure(function (subState) { - if (!subState.eat('p{') && !subState.eat('P{')) { - return { matched: false }; - } - if (!acceptUnicodePropertyValueExpression(subState).matched) { - return { matched: false }; - } - return { matched: !!subState.eat('}') }; - })(state); - } - return { matched: false }; -}; - -var acceptUnicodePropertyName = function acceptUnicodePropertyName(state) { - var characters = []; - var character = void 0; - while (character = state.eatAny.apply(state, _toConsumableArray(controlCharacters).concat(['_']))) { - // eslint-disable-line no-cond-assign - characters.push(character); - } - return { matched: characters.length > 0, data: characters.join('') }; -}; - -var acceptUnicodePropertyValue = function acceptUnicodePropertyValue(state) { - var characters = []; - var character = void 0; - while (character = state.eatAny.apply(state, _toConsumableArray(controlCharacters).concat(_toConsumableArray(decimalDigits), ['_']))) { - // eslint-disable-line no-cond-assign - characters.push(character); - } - return { matched: characters.length > 0, data: characters.join('') }; -}; - -// excluding nonbinary properties from mathias' list -// https://www.ecma-international.org/ecma-262/9.0/index.html#table-nonbinary-unicode-properties -var illegalLoneUnicodePropertyNames = ['General_Category', 'Script', 'Script_Extensions', 'scx', 'sc', 'gc']; - -var generalCategoryValues = _mappings2.default.get('General_Category'); - -var acceptLoneUnicodePropertyNameOrValue = function acceptLoneUnicodePropertyNameOrValue(state) { - var loneValue = acceptUnicodePropertyValue(state); - if (!loneValue.matched || illegalLoneUnicodePropertyNames.includes(loneValue.data)) { - return { matched: false }; - } - - return { matched: catchIsFalse(function () { - return (0, _unicodeMatchPropertyEcmascript2.default)(loneValue.data); - }) || generalCategoryValues.get(loneValue.data) != null }; -}; - -var acceptUnicodePropertyValueExpression = function acceptUnicodePropertyValueExpression(state) { - return anyOf(backtrackOnFailure(function (subState) { - var name = acceptUnicodePropertyName(subState); - if (!name.matched || !subState.eat('=')) { - return { matched: false }; - } - var value = acceptUnicodePropertyValue(subState); - if (!value.matched) { - return { matched: false }; - } - return { matched: catchIsFalse(function () { - return (0, _unicodeMatchPropertyValueEcmascript2.default)(_unicodePropertyAliasesEcmascript2.default.get(name.data) || name.data, value.data); - }) }; - }), backtrackOnFailure(acceptLoneUnicodePropertyNameOrValue))(state); -}; - -var acceptCharacterEscape = anyOf(function (state) { - var eaten = state.eatAny.apply(state, _toConsumableArray(controlEscapeCharacters)); - if (eaten === null) { - return { matched: false }; - } - return { matched: true, value: controlEscapeCharacterValues[eaten] }; -}, backtrackOnFailure(function (state) { - if (!state.eat('c')) { - return { matched: false }; - } - var character = state.eatAny.apply(state, _toConsumableArray(controlCharacters)); - if (character === null) { - return { matched: false }; - } - return { matched: true, value: character.charCodeAt(0) % 32 }; -}), backtrackOnFailure(function (state) { - if (!state.eat('0') || state.eatAny.apply(state, _toConsumableArray(decimalDigits))) { - return { matched: false }; - } - return { matched: true, value: 0 }; -}), backtrackOnFailure(function (state) { - if (!state.eat('x')) { - return { matched: false }; - } - var digits = [0, 0].map(function () { - return state.eatAny.apply(state, _toConsumableArray(hexDigits)); - }); - if (digits.some(function (value) { - return value === null; - })) { - return { matched: false }; - } - return { matched: true, value: parseInt(digits.join(''), 16) }; -}), acceptUnicodeEscape, backtrackOnFailure(function (state) { - if (state.unicode) { - return { matched: false }; - } - var octal1 = state.eatAny.apply(state, _toConsumableArray(octalDigits)); - if (octal1 === null) { - return { matched: false }; - } - var octal1Value = parseInt(octal1, 8); - if (octalDigits.indexOf(state.nextCodePoint()) === -1) { - return { matched: true, value: octal1Value }; - } - var octal2 = state.eatAny.apply(state, _toConsumableArray(octalDigits)); - var octal2Value = parseInt(octal2, 8); - if (octal1Value < 4) { - if (octalDigits.indexOf(state.nextCodePoint()) === -1) { - return { matched: true, value: octal1Value << 3 | octal2Value }; - } - var octal3 = state.eatAny.apply(state, _toConsumableArray(octalDigits)); - var octal3Value = parseInt(octal3, 8); - return { matched: true, value: octal1Value << 6 | octal2Value << 3 | octal3Value }; - } - return { matched: true, value: octal1Value << 3 | octal2Value }; -}), backtrackOnFailure(function (state) { - if (!state.unicode) { - return { matched: false }; - } - var value = state.eatAny.apply(state, _toConsumableArray(syntaxCharacters)); - if (value === null) { - return { matched: false }; - } - return { matched: true, value: value.charCodeAt(0) }; -}), function (state) { - if (!state.unicode || !state.eat('/')) { - return { matched: false }; - } - return { matched: true, value: '/'.charCodeAt(0) }; -}, backtrackOnFailure(function (state) { - if (state.unicode) { - return { matched: false }; - } - var next = state.nextCodePoint(); - if (next !== null && next !== 'c' && next !== 'k') { - state.skipCodePoint(); - return { matched: true, value: next.codePointAt(0) }; - } - return { matched: false }; -})); - -var acceptGroupNameBackreference = backtrackOnFailure(function (state) { - if (!state.eat('k')) { - return { matched: false }; - } - var name = acceptGroupName(state); - if (!name.matched) { - state.backreferenceNames.push(INVALID_NAMED_BACKREFERENCE_SENTINEL); - return { matched: true }; - } - state.backreferenceNames.push(name.data); - return { matched: true }; -}); - -var acceptGroupName = backtrackOnFailure(function (state) { - if (!state.eat('<')) { - return { matched: false }; - } - var characters = []; - var start = state.eatIdentifierStart(); - if (!start) { - return { matched: false }; - } - characters.push(start); - var part = void 0; - while (part = state.eatIdentifierPart()) { - // eslint-disable-line no-cond-assign - characters.push(part); - } - if (!state.eat('>')) { - return { matched: false }; - } - return { matched: characters.length > 0, data: characters.join('') }; -}); - -var acceptAtomEscape = anyOf(acceptDecimalEscape, acceptCharacterClassEscape, acceptCharacterEscape, acceptGroupNameBackreference); - -var acceptCharacterClass = backtrackOnFailure(function (state) { - if (!state.eat('[')) { - return { matched: false }; - } - state.eat('^'); - - var acceptClassEscape = anyOf(function (subState) { - return { matched: !!subState.eat('b'), value: 0x0008 }; - }, function (subState) { - return { matched: subState.unicode && !!subState.eat('-'), value: '-'.charCodeAt(0) }; - }, backtrackOnFailure(function (subState) { - if (subState.unicode || !subState.eat('c')) { - return { matched: false }; - } - var character = subState.eatAny.apply(subState, _toConsumableArray(decimalDigits).concat(['_'])); - if (character === null) { - return { matched: false }; - } - return { matched: true, value: character.charCodeAt(0) % 32 }; - }), acceptCharacterClassEscape, acceptCharacterEscape, - // We special-case `\k` because `acceptCharacterEscape` rejects `\k` unconditionally, - // deferring `\k` to acceptGroupNameBackreference, which is not called here. - // See also https://github.com/tc39/ecma262/issues/2037. This code takes the route of - // making it unconditionally legal, rather than legal only in the absence of a group name. - function (subState) { - return { matched: !subState.unicode && !!subState.eat('k'), value: 107 }; - }); - - var acceptClassAtomNoDash = function acceptClassAtomNoDash(localState) { - var nextCodePoint = localState.nextCodePoint(); - if (nextCodePoint === ']' || nextCodePoint === '-' || nextCodePoint === null) { - return { matched: false }; - } - if (nextCodePoint !== '\\') { - localState.skipCodePoint(); - return { matched: true, value: nextCodePoint.codePointAt(0) }; - } - localState.eat('\\'); - var classEscape = acceptClassEscape(localState); - if (!classEscape.matched && localState.nextCodePoint() === 'c' && !localState.unicode) { - return { matched: true, value: '\\'.charCodeAt(0) }; - } - return classEscape; - }; - - var acceptClassAtom = function acceptClassAtom(localState) { - if (localState.eat('-')) { - return { matched: true, value: '-'.charCodeAt(0) }; - } - return acceptClassAtomNoDash(localState); - }; - - var finishClassRange = function finishClassRange(localState, atom) { - var isUnvaluedPassedAtom = function isUnvaluedPassedAtom(subAtom) { - return subAtom.value === void 0 && subAtom.matched; - }; - if (localState.eat('-')) { - if (localState.match(']')) { - return { matched: true }; - } - var otherAtom = acceptClassAtom(localState); - if (!otherAtom.matched) { - return { matched: false }; - } - if (localState.unicode && (isUnvaluedPassedAtom(atom) || isUnvaluedPassedAtom(otherAtom))) { - return { matched: false }; - } else if (!(!localState.unicode && (isUnvaluedPassedAtom(atom) || isUnvaluedPassedAtom(otherAtom))) && atom.value > otherAtom.value) { - return { matched: false }; - } else if (localState.match(']')) { - return { matched: true }; - } - return acceptNonEmptyClassRanges(localState); - } - if (localState.match(']')) { - return { matched: true }; - } - return acceptNonEmptyClassRangesNoDash(localState); - }; - - var acceptNonEmptyClassRanges = function acceptNonEmptyClassRanges(localState) { - var atom = acceptClassAtom(localState); - return atom.matched ? finishClassRange(localState, atom) : { matched: false }; - }; - - var acceptNonEmptyClassRangesNoDash = function acceptNonEmptyClassRangesNoDash(localState) { - var atom = acceptClassAtomNoDash(localState); - return atom.matched ? finishClassRange(localState, atom) : { matched: false }; - }; - - if (state.eat(']')) { - return { matched: true }; - } - - var value = acceptNonEmptyClassRanges(state); - if (value.matched) { - state.eat(']'); // cannot fail, as above will not return matched if it is not seen in advance - } - - return value; -}); -}); - -var __pika_web_default_export_for_treeshaking__ = /*@__PURE__*/getDefaultExportFromCjs(dist); - -export default __pika_web_default_export_for_treeshaking__; diff --git a/docs/_snowpack/pkg/shift-spec.js b/docs/_snowpack/pkg/shift-spec.js deleted file mode 100644 index 67d8504c..00000000 --- a/docs/_snowpack/pkg/shift-spec.js +++ /dev/null @@ -1,876 +0,0 @@ -import { g as getDefaultExportFromCjs, c as createCommonjsModule } from './common/_commonjsHelpers-8c19dec8.js'; - -var dist = createCommonjsModule(function (module, exports) { -// Generated by src/generate-spec.js. - -/** - * Copyright 2016 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Hack to make Babel6 import this as a module. -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.default = (function() { - var SPEC = {}; - - var BOOLEAN = { typeName: "Boolean" }; - var DOUBLE = { typeName: "Number" }; - var STRING = { typeName: "String" }; - function Maybe(arg) { return { typeName: "Maybe", argument: arg }; } - function List(arg) { return { typeName: "List", argument: arg }; } - function Const(arg) { return { typeName: "Const", argument: arg }; } - function Union() { return { typeName: "Union", arguments: [].slice.call(arguments, 0) }; } - - - var TYPE_INDICATOR = { - typeName: "Enum", - values: ["ArrayAssignmentTarget", "ArrayBinding", "ArrayExpression", "ArrowExpression", "AssignmentExpression", "AssignmentTargetIdentifier", "AssignmentTargetPropertyIdentifier", "AssignmentTargetPropertyProperty", "AssignmentTargetWithDefault", "AwaitExpression", "BinaryExpression", "BindingIdentifier", "BindingPropertyIdentifier", "BindingPropertyProperty", "BindingWithDefault", "Block", "BlockStatement", "BreakStatement", "CallExpression", "CatchClause", "ClassDeclaration", "ClassElement", "ClassExpression", "CompoundAssignmentExpression", "ComputedMemberAssignmentTarget", "ComputedMemberExpression", "ComputedPropertyName", "ConditionalExpression", "ContinueStatement", "DataProperty", "DebuggerStatement", "Directive", "DoWhileStatement", "EmptyStatement", "Export", "ExportAllFrom", "ExportDefault", "ExportFrom", "ExportFromSpecifier", "ExportLocalSpecifier", "ExportLocals", "ExpressionStatement", "ForAwaitStatement", "ForInStatement", "ForOfStatement", "ForStatement", "FormalParameters", "FunctionBody", "FunctionDeclaration", "FunctionExpression", "Getter", "IdentifierExpression", "IfStatement", "Import", "ImportNamespace", "ImportSpecifier", "LabeledStatement", "LiteralBooleanExpression", "LiteralInfinityExpression", "LiteralNullExpression", "LiteralNumericExpression", "LiteralRegExpExpression", "LiteralStringExpression", "Method", "Module", "NewExpression", "NewTargetExpression", "ObjectAssignmentTarget", "ObjectBinding", "ObjectExpression", "ReturnStatement", "Script", "Setter", "ShorthandProperty", "SpreadElement", "SpreadProperty", "StaticMemberAssignmentTarget", "StaticMemberExpression", "StaticPropertyName", "Super", "SwitchCase", "SwitchDefault", "SwitchStatement", "SwitchStatementWithDefault", "TemplateElement", "TemplateExpression", "ThisExpression", "ThrowStatement", "TryCatchStatement", "TryFinallyStatement", "UnaryExpression", "UpdateExpression", "VariableDeclaration", "VariableDeclarationStatement", "VariableDeclarator", "WhileStatement", "WithStatement", "YieldExpression", "YieldGeneratorExpression"] - }; - - var BinaryOperator = { - typeName: "Enum", - values: ["==", "!=", "===", "!==", "<", "<=", ">", ">=", "in", "instanceof", "<<", ">>", ">>>", "+", "-", "*", "/", "%", "**", ",", "||", "&&", "|", "^", "&"] - }; - - var CompoundAssignmentOperator = { - typeName: "Enum", - values: ["+=", "-=", "*=", "/=", "%=", "**=", "<<=", ">>=", ">>>=", "|=", "^=", "&="] - }; - - var UnaryOperator = { - typeName: "Enum", - values: ["+", "-", "!", "~", "typeof", "void", "delete"] - }; - - var UpdateOperator = { - typeName: "Enum", - values: ["++", "--"] - }; - - var VariableDeclarationKind = { - typeName: "Enum", - values: ["var", "let", "const"] - }; - - - var ArrayAssignmentTarget = SPEC.ArrayAssignmentTarget = {}; - var ArrayBinding = SPEC.ArrayBinding = {}; - var ArrayExpression = SPEC.ArrayExpression = {}; - var ArrowExpression = SPEC.ArrowExpression = {}; - var AssignmentExpression = SPEC.AssignmentExpression = {}; - var AssignmentTargetIdentifier = SPEC.AssignmentTargetIdentifier = {}; - var AssignmentTargetPropertyIdentifier = SPEC.AssignmentTargetPropertyIdentifier = {}; - var AssignmentTargetPropertyProperty = SPEC.AssignmentTargetPropertyProperty = {}; - var AssignmentTargetWithDefault = SPEC.AssignmentTargetWithDefault = {}; - var AwaitExpression = SPEC.AwaitExpression = {}; - var BinaryExpression = SPEC.BinaryExpression = {}; - var BindingIdentifier = SPEC.BindingIdentifier = {}; - var BindingPropertyIdentifier = SPEC.BindingPropertyIdentifier = {}; - var BindingPropertyProperty = SPEC.BindingPropertyProperty = {}; - var BindingWithDefault = SPEC.BindingWithDefault = {}; - var Block = SPEC.Block = {}; - var BlockStatement = SPEC.BlockStatement = {}; - var BreakStatement = SPEC.BreakStatement = {}; - var CallExpression = SPEC.CallExpression = {}; - var CatchClause = SPEC.CatchClause = {}; - var ClassDeclaration = SPEC.ClassDeclaration = {}; - var ClassElement = SPEC.ClassElement = {}; - var ClassExpression = SPEC.ClassExpression = {}; - var CompoundAssignmentExpression = SPEC.CompoundAssignmentExpression = {}; - var ComputedMemberAssignmentTarget = SPEC.ComputedMemberAssignmentTarget = {}; - var ComputedMemberExpression = SPEC.ComputedMemberExpression = {}; - var ComputedPropertyName = SPEC.ComputedPropertyName = {}; - var ConditionalExpression = SPEC.ConditionalExpression = {}; - var ContinueStatement = SPEC.ContinueStatement = {}; - var DataProperty = SPEC.DataProperty = {}; - var DebuggerStatement = SPEC.DebuggerStatement = {}; - var Directive = SPEC.Directive = {}; - var DoWhileStatement = SPEC.DoWhileStatement = {}; - var EmptyStatement = SPEC.EmptyStatement = {}; - var Export = SPEC.Export = {}; - var ExportAllFrom = SPEC.ExportAllFrom = {}; - var ExportDefault = SPEC.ExportDefault = {}; - var ExportFrom = SPEC.ExportFrom = {}; - var ExportFromSpecifier = SPEC.ExportFromSpecifier = {}; - var ExportLocalSpecifier = SPEC.ExportLocalSpecifier = {}; - var ExportLocals = SPEC.ExportLocals = {}; - var ExpressionStatement = SPEC.ExpressionStatement = {}; - var ForAwaitStatement = SPEC.ForAwaitStatement = {}; - var ForInStatement = SPEC.ForInStatement = {}; - var ForOfStatement = SPEC.ForOfStatement = {}; - var ForStatement = SPEC.ForStatement = {}; - var FormalParameters = SPEC.FormalParameters = {}; - var FunctionBody = SPEC.FunctionBody = {}; - var FunctionDeclaration = SPEC.FunctionDeclaration = {}; - var FunctionExpression = SPEC.FunctionExpression = {}; - var Getter = SPEC.Getter = {}; - var IdentifierExpression = SPEC.IdentifierExpression = {}; - var IfStatement = SPEC.IfStatement = {}; - var Import = SPEC.Import = {}; - var ImportNamespace = SPEC.ImportNamespace = {}; - var ImportSpecifier = SPEC.ImportSpecifier = {}; - var LabeledStatement = SPEC.LabeledStatement = {}; - var LiteralBooleanExpression = SPEC.LiteralBooleanExpression = {}; - var LiteralInfinityExpression = SPEC.LiteralInfinityExpression = {}; - var LiteralNullExpression = SPEC.LiteralNullExpression = {}; - var LiteralNumericExpression = SPEC.LiteralNumericExpression = {}; - var LiteralRegExpExpression = SPEC.LiteralRegExpExpression = {}; - var LiteralStringExpression = SPEC.LiteralStringExpression = {}; - var Method = SPEC.Method = {}; - var Module = SPEC.Module = {}; - var NewExpression = SPEC.NewExpression = {}; - var NewTargetExpression = SPEC.NewTargetExpression = {}; - var ObjectAssignmentTarget = SPEC.ObjectAssignmentTarget = {}; - var ObjectBinding = SPEC.ObjectBinding = {}; - var ObjectExpression = SPEC.ObjectExpression = {}; - var ReturnStatement = SPEC.ReturnStatement = {}; - var Script = SPEC.Script = {}; - var Setter = SPEC.Setter = {}; - var ShorthandProperty = SPEC.ShorthandProperty = {}; - var SpreadElement = SPEC.SpreadElement = {}; - var SpreadProperty = SPEC.SpreadProperty = {}; - var StaticMemberAssignmentTarget = SPEC.StaticMemberAssignmentTarget = {}; - var StaticMemberExpression = SPEC.StaticMemberExpression = {}; - var StaticPropertyName = SPEC.StaticPropertyName = {}; - var Super = SPEC.Super = {}; - var SwitchCase = SPEC.SwitchCase = {}; - var SwitchDefault = SPEC.SwitchDefault = {}; - var SwitchStatement = SPEC.SwitchStatement = {}; - var SwitchStatementWithDefault = SPEC.SwitchStatementWithDefault = {}; - var TemplateElement = SPEC.TemplateElement = {}; - var TemplateExpression = SPEC.TemplateExpression = {}; - var ThisExpression = SPEC.ThisExpression = {}; - var ThrowStatement = SPEC.ThrowStatement = {}; - var TryCatchStatement = SPEC.TryCatchStatement = {}; - var TryFinallyStatement = SPEC.TryFinallyStatement = {}; - var UnaryExpression = SPEC.UnaryExpression = {}; - var UpdateExpression = SPEC.UpdateExpression = {}; - var VariableDeclaration = SPEC.VariableDeclaration = {}; - var VariableDeclarationStatement = SPEC.VariableDeclarationStatement = {}; - var VariableDeclarator = SPEC.VariableDeclarator = {}; - var WhileStatement = SPEC.WhileStatement = {}; - var WithStatement = SPEC.WithStatement = {}; - var YieldExpression = SPEC.YieldExpression = {}; - var YieldGeneratorExpression = SPEC.YieldGeneratorExpression = {}; - - var MemberExpression = Union(ComputedMemberExpression, StaticMemberExpression); - var AssignmentTargetProperty = Union(AssignmentTargetPropertyIdentifier, AssignmentTargetPropertyProperty); - var Class = Union(ClassDeclaration, ClassExpression); - var ExportDeclaration = Union(Export, ExportAllFrom, ExportDefault, ExportFrom, ExportLocals); - var PropertyName = Union(ComputedPropertyName, StaticPropertyName); - var Function = Union(FunctionDeclaration, FunctionExpression); - var ImportDeclaration = Union(Import, ImportNamespace); - var IterationStatement = Union(DoWhileStatement, ForAwaitStatement, ForInStatement, ForOfStatement, ForStatement, WhileStatement); - var MemberAssignmentTarget = Union(ComputedMemberAssignmentTarget, StaticMemberAssignmentTarget); - var BindingProperty = Union(BindingPropertyIdentifier, BindingPropertyProperty); - var MethodDefinition = Union(Getter, Method, Setter); - var Program = Union(Module, Script); - var VariableReference = Union(AssignmentTargetIdentifier, BindingIdentifier, IdentifierExpression); - var NamedObjectProperty = Union(DataProperty, MethodDefinition); - var Expression = Union(ArrayExpression, ArrowExpression, AssignmentExpression, AwaitExpression, BinaryExpression, CallExpression, ClassExpression, CompoundAssignmentExpression, ConditionalExpression, FunctionExpression, IdentifierExpression, LiteralBooleanExpression, LiteralInfinityExpression, LiteralNullExpression, LiteralNumericExpression, LiteralRegExpExpression, LiteralStringExpression, MemberExpression, NewExpression, NewTargetExpression, ObjectExpression, TemplateExpression, ThisExpression, UnaryExpression, UpdateExpression, YieldExpression, YieldGeneratorExpression); - var Statement = Union(BlockStatement, BreakStatement, ClassDeclaration, ContinueStatement, DebuggerStatement, EmptyStatement, ExpressionStatement, FunctionDeclaration, IfStatement, IterationStatement, LabeledStatement, ReturnStatement, SwitchStatement, SwitchStatementWithDefault, ThrowStatement, TryCatchStatement, TryFinallyStatement, VariableDeclarationStatement, WithStatement); - var ObjectProperty = Union(NamedObjectProperty, ShorthandProperty, SpreadProperty); - var Node = Union(ArrayAssignmentTarget, ArrayBinding, AssignmentTargetProperty, AssignmentTargetWithDefault, BindingProperty, BindingWithDefault, Block, CatchClause, ClassElement, Directive, ExportDeclaration, ExportFromSpecifier, ExportLocalSpecifier, Expression, FormalParameters, FunctionBody, ImportDeclaration, ImportSpecifier, MemberAssignmentTarget, ObjectAssignmentTarget, ObjectBinding, ObjectProperty, Program, PropertyName, SpreadElement, Statement, Super, SwitchCase, SwitchDefault, TemplateElement, VariableDeclaration, VariableDeclarator, VariableReference); - - ArrayAssignmentTarget.typeName = "ArrayAssignmentTarget"; - ArrayAssignmentTarget.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ArrayAssignmentTarget" }, - { name: "elements", type: List(Maybe(Union(AssignmentTargetWithDefault, Union(Union(ArrayAssignmentTarget, ObjectAssignmentTarget), Union(AssignmentTargetIdentifier, MemberAssignmentTarget))))) }, - { name: "rest", type: Maybe(Union(Union(ArrayAssignmentTarget, ObjectAssignmentTarget), Union(AssignmentTargetIdentifier, MemberAssignmentTarget))) } - ]; - - ArrayBinding.typeName = "ArrayBinding"; - ArrayBinding.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ArrayBinding" }, - { name: "elements", type: List(Maybe(Union(BindingWithDefault, Union(BindingIdentifier, Union(ArrayBinding, ObjectBinding))))) }, - { name: "rest", type: Maybe(Union(BindingIdentifier, Union(ArrayBinding, ObjectBinding))) } - ]; - - ArrayExpression.typeName = "ArrayExpression"; - ArrayExpression.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ArrayExpression" }, - { name: "elements", type: List(Maybe(Union(Expression, SpreadElement))) } - ]; - - ArrowExpression.typeName = "ArrowExpression"; - ArrowExpression.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ArrowExpression" }, - { name: "isAsync", type: BOOLEAN }, - { name: "params", type: FormalParameters }, - { name: "body", type: Union(Expression, FunctionBody) } - ]; - - AssignmentExpression.typeName = "AssignmentExpression"; - AssignmentExpression.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "AssignmentExpression" }, - { name: "binding", type: Union(Union(ArrayAssignmentTarget, ObjectAssignmentTarget), Union(AssignmentTargetIdentifier, MemberAssignmentTarget)) }, - { name: "expression", type: Expression } - ]; - - AssignmentTargetIdentifier.typeName = "AssignmentTargetIdentifier"; - AssignmentTargetIdentifier.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "AssignmentTargetIdentifier" }, - { name: "name", type: STRING } - ]; - - AssignmentTargetPropertyIdentifier.typeName = "AssignmentTargetPropertyIdentifier"; - AssignmentTargetPropertyIdentifier.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "AssignmentTargetPropertyIdentifier" }, - { name: "binding", type: AssignmentTargetIdentifier }, - { name: "init", type: Maybe(Expression) } - ]; - - AssignmentTargetPropertyProperty.typeName = "AssignmentTargetPropertyProperty"; - AssignmentTargetPropertyProperty.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "AssignmentTargetPropertyProperty" }, - { name: "name", type: PropertyName }, - { name: "binding", type: Union(AssignmentTargetWithDefault, Union(Union(ArrayAssignmentTarget, ObjectAssignmentTarget), Union(AssignmentTargetIdentifier, MemberAssignmentTarget))) } - ]; - - AssignmentTargetWithDefault.typeName = "AssignmentTargetWithDefault"; - AssignmentTargetWithDefault.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "AssignmentTargetWithDefault" }, - { name: "binding", type: Union(Union(ArrayAssignmentTarget, ObjectAssignmentTarget), Union(AssignmentTargetIdentifier, MemberAssignmentTarget)) }, - { name: "init", type: Expression } - ]; - - AwaitExpression.typeName = "AwaitExpression"; - AwaitExpression.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "AwaitExpression" }, - { name: "expression", type: Expression } - ]; - - BinaryExpression.typeName = "BinaryExpression"; - BinaryExpression.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "BinaryExpression" }, - { name: "left", type: Expression }, - { name: "operator", type: BinaryOperator }, - { name: "right", type: Expression } - ]; - - BindingIdentifier.typeName = "BindingIdentifier"; - BindingIdentifier.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "BindingIdentifier" }, - { name: "name", type: STRING } - ]; - - BindingPropertyIdentifier.typeName = "BindingPropertyIdentifier"; - BindingPropertyIdentifier.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "BindingPropertyIdentifier" }, - { name: "binding", type: BindingIdentifier }, - { name: "init", type: Maybe(Expression) } - ]; - - BindingPropertyProperty.typeName = "BindingPropertyProperty"; - BindingPropertyProperty.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "BindingPropertyProperty" }, - { name: "name", type: PropertyName }, - { name: "binding", type: Union(BindingWithDefault, Union(BindingIdentifier, Union(ArrayBinding, ObjectBinding))) } - ]; - - BindingWithDefault.typeName = "BindingWithDefault"; - BindingWithDefault.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "BindingWithDefault" }, - { name: "binding", type: Union(BindingIdentifier, Union(ArrayBinding, ObjectBinding)) }, - { name: "init", type: Expression } - ]; - - Block.typeName = "Block"; - Block.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "Block" }, - { name: "statements", type: List(Statement) } - ]; - - BlockStatement.typeName = "BlockStatement"; - BlockStatement.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "BlockStatement" }, - { name: "block", type: Block } - ]; - - BreakStatement.typeName = "BreakStatement"; - BreakStatement.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "BreakStatement" }, - { name: "label", type: Maybe(STRING) } - ]; - - CallExpression.typeName = "CallExpression"; - CallExpression.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "CallExpression" }, - { name: "callee", type: Union(Expression, Super) }, - { name: "arguments", type: List(Union(Expression, SpreadElement)) } - ]; - - CatchClause.typeName = "CatchClause"; - CatchClause.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "CatchClause" }, - { name: "binding", type: Union(BindingIdentifier, Union(ArrayBinding, ObjectBinding)) }, - { name: "body", type: Block } - ]; - - ClassDeclaration.typeName = "ClassDeclaration"; - ClassDeclaration.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ClassDeclaration" }, - { name: "name", type: BindingIdentifier }, - { name: "super", type: Maybe(Expression) }, - { name: "elements", type: List(ClassElement) } - ]; - - ClassElement.typeName = "ClassElement"; - ClassElement.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ClassElement" }, - { name: "isStatic", type: BOOLEAN }, - { name: "method", type: MethodDefinition } - ]; - - ClassExpression.typeName = "ClassExpression"; - ClassExpression.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ClassExpression" }, - { name: "name", type: Maybe(BindingIdentifier) }, - { name: "super", type: Maybe(Expression) }, - { name: "elements", type: List(ClassElement) } - ]; - - CompoundAssignmentExpression.typeName = "CompoundAssignmentExpression"; - CompoundAssignmentExpression.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "CompoundAssignmentExpression" }, - { name: "binding", type: Union(AssignmentTargetIdentifier, MemberAssignmentTarget) }, - { name: "operator", type: CompoundAssignmentOperator }, - { name: "expression", type: Expression } - ]; - - ComputedMemberAssignmentTarget.typeName = "ComputedMemberAssignmentTarget"; - ComputedMemberAssignmentTarget.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ComputedMemberAssignmentTarget" }, - { name: "object", type: Union(Expression, Super) }, - { name: "expression", type: Expression } - ]; - - ComputedMemberExpression.typeName = "ComputedMemberExpression"; - ComputedMemberExpression.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ComputedMemberExpression" }, - { name: "object", type: Union(Expression, Super) }, - { name: "expression", type: Expression } - ]; - - ComputedPropertyName.typeName = "ComputedPropertyName"; - ComputedPropertyName.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ComputedPropertyName" }, - { name: "expression", type: Expression } - ]; - - ConditionalExpression.typeName = "ConditionalExpression"; - ConditionalExpression.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ConditionalExpression" }, - { name: "test", type: Expression }, - { name: "consequent", type: Expression }, - { name: "alternate", type: Expression } - ]; - - ContinueStatement.typeName = "ContinueStatement"; - ContinueStatement.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ContinueStatement" }, - { name: "label", type: Maybe(STRING) } - ]; - - DataProperty.typeName = "DataProperty"; - DataProperty.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "DataProperty" }, - { name: "name", type: PropertyName }, - { name: "expression", type: Expression } - ]; - - DebuggerStatement.typeName = "DebuggerStatement"; - DebuggerStatement.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "DebuggerStatement" } - ]; - - Directive.typeName = "Directive"; - Directive.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "Directive" }, - { name: "rawValue", type: STRING } - ]; - - DoWhileStatement.typeName = "DoWhileStatement"; - DoWhileStatement.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "DoWhileStatement" }, - { name: "body", type: Statement }, - { name: "test", type: Expression } - ]; - - EmptyStatement.typeName = "EmptyStatement"; - EmptyStatement.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "EmptyStatement" } - ]; - - Export.typeName = "Export"; - Export.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "Export" }, - { name: "declaration", type: Union(ClassDeclaration, FunctionDeclaration, VariableDeclaration) } - ]; - - ExportAllFrom.typeName = "ExportAllFrom"; - ExportAllFrom.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ExportAllFrom" }, - { name: "moduleSpecifier", type: STRING } - ]; - - ExportDefault.typeName = "ExportDefault"; - ExportDefault.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ExportDefault" }, - { name: "body", type: Union(ClassDeclaration, Expression, FunctionDeclaration) } - ]; - - ExportFrom.typeName = "ExportFrom"; - ExportFrom.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ExportFrom" }, - { name: "namedExports", type: List(ExportFromSpecifier) }, - { name: "moduleSpecifier", type: STRING } - ]; - - ExportFromSpecifier.typeName = "ExportFromSpecifier"; - ExportFromSpecifier.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ExportFromSpecifier" }, - { name: "name", type: STRING }, - { name: "exportedName", type: Maybe(STRING) } - ]; - - ExportLocalSpecifier.typeName = "ExportLocalSpecifier"; - ExportLocalSpecifier.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ExportLocalSpecifier" }, - { name: "name", type: IdentifierExpression }, - { name: "exportedName", type: Maybe(STRING) } - ]; - - ExportLocals.typeName = "ExportLocals"; - ExportLocals.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ExportLocals" }, - { name: "namedExports", type: List(ExportLocalSpecifier) } - ]; - - ExpressionStatement.typeName = "ExpressionStatement"; - ExpressionStatement.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ExpressionStatement" }, - { name: "expression", type: Expression } - ]; - - ForAwaitStatement.typeName = "ForAwaitStatement"; - ForAwaitStatement.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ForAwaitStatement" }, - { name: "left", type: Union(Union(Union(ArrayAssignmentTarget, ObjectAssignmentTarget), Union(AssignmentTargetIdentifier, MemberAssignmentTarget)), VariableDeclaration) }, - { name: "right", type: Expression }, - { name: "body", type: Statement } - ]; - - ForInStatement.typeName = "ForInStatement"; - ForInStatement.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ForInStatement" }, - { name: "left", type: Union(Union(Union(ArrayAssignmentTarget, ObjectAssignmentTarget), Union(AssignmentTargetIdentifier, MemberAssignmentTarget)), VariableDeclaration) }, - { name: "right", type: Expression }, - { name: "body", type: Statement } - ]; - - ForOfStatement.typeName = "ForOfStatement"; - ForOfStatement.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ForOfStatement" }, - { name: "left", type: Union(Union(Union(ArrayAssignmentTarget, ObjectAssignmentTarget), Union(AssignmentTargetIdentifier, MemberAssignmentTarget)), VariableDeclaration) }, - { name: "right", type: Expression }, - { name: "body", type: Statement } - ]; - - ForStatement.typeName = "ForStatement"; - ForStatement.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ForStatement" }, - { name: "init", type: Maybe(Union(Expression, VariableDeclaration)) }, - { name: "test", type: Maybe(Expression) }, - { name: "update", type: Maybe(Expression) }, - { name: "body", type: Statement } - ]; - - FormalParameters.typeName = "FormalParameters"; - FormalParameters.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "FormalParameters" }, - { name: "items", type: List(Union(BindingWithDefault, Union(BindingIdentifier, Union(ArrayBinding, ObjectBinding)))) }, - { name: "rest", type: Maybe(Union(BindingIdentifier, Union(ArrayBinding, ObjectBinding))) } - ]; - - FunctionBody.typeName = "FunctionBody"; - FunctionBody.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "FunctionBody" }, - { name: "directives", type: List(Directive) }, - { name: "statements", type: List(Statement) } - ]; - - FunctionDeclaration.typeName = "FunctionDeclaration"; - FunctionDeclaration.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "FunctionDeclaration" }, - { name: "isAsync", type: BOOLEAN }, - { name: "isGenerator", type: BOOLEAN }, - { name: "name", type: BindingIdentifier }, - { name: "params", type: FormalParameters }, - { name: "body", type: FunctionBody } - ]; - - FunctionExpression.typeName = "FunctionExpression"; - FunctionExpression.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "FunctionExpression" }, - { name: "isAsync", type: BOOLEAN }, - { name: "isGenerator", type: BOOLEAN }, - { name: "name", type: Maybe(BindingIdentifier) }, - { name: "params", type: FormalParameters }, - { name: "body", type: FunctionBody } - ]; - - Getter.typeName = "Getter"; - Getter.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "Getter" }, - { name: "name", type: PropertyName }, - { name: "body", type: FunctionBody } - ]; - - IdentifierExpression.typeName = "IdentifierExpression"; - IdentifierExpression.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "IdentifierExpression" }, - { name: "name", type: STRING } - ]; - - IfStatement.typeName = "IfStatement"; - IfStatement.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "IfStatement" }, - { name: "test", type: Expression }, - { name: "consequent", type: Statement }, - { name: "alternate", type: Maybe(Statement) } - ]; - - Import.typeName = "Import"; - Import.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "Import" }, - { name: "defaultBinding", type: Maybe(BindingIdentifier) }, - { name: "namedImports", type: List(ImportSpecifier) }, - { name: "moduleSpecifier", type: STRING } - ]; - - ImportNamespace.typeName = "ImportNamespace"; - ImportNamespace.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ImportNamespace" }, - { name: "defaultBinding", type: Maybe(BindingIdentifier) }, - { name: "namespaceBinding", type: BindingIdentifier }, - { name: "moduleSpecifier", type: STRING } - ]; - - ImportSpecifier.typeName = "ImportSpecifier"; - ImportSpecifier.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ImportSpecifier" }, - { name: "name", type: Maybe(STRING) }, - { name: "binding", type: BindingIdentifier } - ]; - - LabeledStatement.typeName = "LabeledStatement"; - LabeledStatement.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "LabeledStatement" }, - { name: "label", type: STRING }, - { name: "body", type: Statement } - ]; - - LiteralBooleanExpression.typeName = "LiteralBooleanExpression"; - LiteralBooleanExpression.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "LiteralBooleanExpression" }, - { name: "value", type: BOOLEAN } - ]; - - LiteralInfinityExpression.typeName = "LiteralInfinityExpression"; - LiteralInfinityExpression.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "LiteralInfinityExpression" } - ]; - - LiteralNullExpression.typeName = "LiteralNullExpression"; - LiteralNullExpression.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "LiteralNullExpression" } - ]; - - LiteralNumericExpression.typeName = "LiteralNumericExpression"; - LiteralNumericExpression.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "LiteralNumericExpression" }, - { name: "value", type: DOUBLE } - ]; - - LiteralRegExpExpression.typeName = "LiteralRegExpExpression"; - LiteralRegExpExpression.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "LiteralRegExpExpression" }, - { name: "pattern", type: STRING }, - { name: "global", type: BOOLEAN }, - { name: "ignoreCase", type: BOOLEAN }, - { name: "multiLine", type: BOOLEAN }, - { name: "dotAll", type: BOOLEAN }, - { name: "unicode", type: BOOLEAN }, - { name: "sticky", type: BOOLEAN } - ]; - - LiteralStringExpression.typeName = "LiteralStringExpression"; - LiteralStringExpression.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "LiteralStringExpression" }, - { name: "value", type: STRING } - ]; - - Method.typeName = "Method"; - Method.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "Method" }, - { name: "isAsync", type: BOOLEAN }, - { name: "isGenerator", type: BOOLEAN }, - { name: "name", type: PropertyName }, - { name: "params", type: FormalParameters }, - { name: "body", type: FunctionBody } - ]; - - Module.typeName = "Module"; - Module.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "Module" }, - { name: "directives", type: List(Directive) }, - { name: "items", type: List(Union(ExportDeclaration, ImportDeclaration, Statement)) } - ]; - - NewExpression.typeName = "NewExpression"; - NewExpression.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "NewExpression" }, - { name: "callee", type: Expression }, - { name: "arguments", type: List(Union(Expression, SpreadElement)) } - ]; - - NewTargetExpression.typeName = "NewTargetExpression"; - NewTargetExpression.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "NewTargetExpression" } - ]; - - ObjectAssignmentTarget.typeName = "ObjectAssignmentTarget"; - ObjectAssignmentTarget.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ObjectAssignmentTarget" }, - { name: "properties", type: List(AssignmentTargetProperty) }, - { name: "rest", type: Maybe(Union(Union(ArrayAssignmentTarget, ObjectAssignmentTarget), Union(AssignmentTargetIdentifier, MemberAssignmentTarget))) } - ]; - - ObjectBinding.typeName = "ObjectBinding"; - ObjectBinding.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ObjectBinding" }, - { name: "properties", type: List(BindingProperty) }, - { name: "rest", type: Maybe(Union(BindingIdentifier, Union(ArrayBinding, ObjectBinding))) } - ]; - - ObjectExpression.typeName = "ObjectExpression"; - ObjectExpression.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ObjectExpression" }, - { name: "properties", type: List(ObjectProperty) } - ]; - - ReturnStatement.typeName = "ReturnStatement"; - ReturnStatement.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ReturnStatement" }, - { name: "expression", type: Maybe(Expression) } - ]; - - Script.typeName = "Script"; - Script.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "Script" }, - { name: "directives", type: List(Directive) }, - { name: "statements", type: List(Statement) } - ]; - - Setter.typeName = "Setter"; - Setter.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "Setter" }, - { name: "name", type: PropertyName }, - { name: "param", type: Union(BindingWithDefault, Union(BindingIdentifier, Union(ArrayBinding, ObjectBinding))) }, - { name: "body", type: FunctionBody } - ]; - - ShorthandProperty.typeName = "ShorthandProperty"; - ShorthandProperty.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ShorthandProperty" }, - { name: "name", type: IdentifierExpression } - ]; - - SpreadElement.typeName = "SpreadElement"; - SpreadElement.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "SpreadElement" }, - { name: "expression", type: Expression } - ]; - - SpreadProperty.typeName = "SpreadProperty"; - SpreadProperty.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "SpreadProperty" }, - { name: "expression", type: Expression } - ]; - - StaticMemberAssignmentTarget.typeName = "StaticMemberAssignmentTarget"; - StaticMemberAssignmentTarget.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "StaticMemberAssignmentTarget" }, - { name: "object", type: Union(Expression, Super) }, - { name: "property", type: STRING } - ]; - - StaticMemberExpression.typeName = "StaticMemberExpression"; - StaticMemberExpression.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "StaticMemberExpression" }, - { name: "object", type: Union(Expression, Super) }, - { name: "property", type: STRING } - ]; - - StaticPropertyName.typeName = "StaticPropertyName"; - StaticPropertyName.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "StaticPropertyName" }, - { name: "value", type: STRING } - ]; - - Super.typeName = "Super"; - Super.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "Super" } - ]; - - SwitchCase.typeName = "SwitchCase"; - SwitchCase.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "SwitchCase" }, - { name: "test", type: Expression }, - { name: "consequent", type: List(Statement) } - ]; - - SwitchDefault.typeName = "SwitchDefault"; - SwitchDefault.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "SwitchDefault" }, - { name: "consequent", type: List(Statement) } - ]; - - SwitchStatement.typeName = "SwitchStatement"; - SwitchStatement.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "SwitchStatement" }, - { name: "discriminant", type: Expression }, - { name: "cases", type: List(SwitchCase) } - ]; - - SwitchStatementWithDefault.typeName = "SwitchStatementWithDefault"; - SwitchStatementWithDefault.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "SwitchStatementWithDefault" }, - { name: "discriminant", type: Expression }, - { name: "preDefaultCases", type: List(SwitchCase) }, - { name: "defaultCase", type: SwitchDefault }, - { name: "postDefaultCases", type: List(SwitchCase) } - ]; - - TemplateElement.typeName = "TemplateElement"; - TemplateElement.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "TemplateElement" }, - { name: "rawValue", type: STRING } - ]; - - TemplateExpression.typeName = "TemplateExpression"; - TemplateExpression.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "TemplateExpression" }, - { name: "tag", type: Maybe(Expression) }, - { name: "elements", type: List(Union(Expression, TemplateElement)) } - ]; - - ThisExpression.typeName = "ThisExpression"; - ThisExpression.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ThisExpression" } - ]; - - ThrowStatement.typeName = "ThrowStatement"; - ThrowStatement.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ThrowStatement" }, - { name: "expression", type: Expression } - ]; - - TryCatchStatement.typeName = "TryCatchStatement"; - TryCatchStatement.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "TryCatchStatement" }, - { name: "body", type: Block }, - { name: "catchClause", type: CatchClause } - ]; - - TryFinallyStatement.typeName = "TryFinallyStatement"; - TryFinallyStatement.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "TryFinallyStatement" }, - { name: "body", type: Block }, - { name: "catchClause", type: Maybe(CatchClause) }, - { name: "finalizer", type: Block } - ]; - - UnaryExpression.typeName = "UnaryExpression"; - UnaryExpression.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "UnaryExpression" }, - { name: "operator", type: UnaryOperator }, - { name: "operand", type: Expression } - ]; - - UpdateExpression.typeName = "UpdateExpression"; - UpdateExpression.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "UpdateExpression" }, - { name: "isPrefix", type: BOOLEAN }, - { name: "operator", type: UpdateOperator }, - { name: "operand", type: Union(AssignmentTargetIdentifier, MemberAssignmentTarget) } - ]; - - VariableDeclaration.typeName = "VariableDeclaration"; - VariableDeclaration.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "VariableDeclaration" }, - { name: "kind", type: VariableDeclarationKind }, - { name: "declarators", type: List(VariableDeclarator) } - ]; - - VariableDeclarationStatement.typeName = "VariableDeclarationStatement"; - VariableDeclarationStatement.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "VariableDeclarationStatement" }, - { name: "declaration", type: VariableDeclaration } - ]; - - VariableDeclarator.typeName = "VariableDeclarator"; - VariableDeclarator.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "VariableDeclarator" }, - { name: "binding", type: Union(BindingIdentifier, Union(ArrayBinding, ObjectBinding)) }, - { name: "init", type: Maybe(Expression) } - ]; - - WhileStatement.typeName = "WhileStatement"; - WhileStatement.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "WhileStatement" }, - { name: "test", type: Expression }, - { name: "body", type: Statement } - ]; - - WithStatement.typeName = "WithStatement"; - WithStatement.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "WithStatement" }, - { name: "object", type: Expression }, - { name: "body", type: Statement } - ]; - - YieldExpression.typeName = "YieldExpression"; - YieldExpression.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "YieldExpression" }, - { name: "expression", type: Maybe(Expression) } - ]; - - YieldGeneratorExpression.typeName = "YieldGeneratorExpression"; - YieldGeneratorExpression.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "YieldGeneratorExpression" }, - { name: "expression", type: Expression } - ]; - - return SPEC; -}()); -}); - -var __pika_web_default_export_for_treeshaking__ = /*@__PURE__*/getDefaultExportFromCjs(dist); - -export default __pika_web_default_export_for_treeshaking__; diff --git a/docs/_snowpack/pkg/tone.js b/docs/_snowpack/pkg/tone.js deleted file mode 100644 index 67a519c7..00000000 --- a/docs/_snowpack/pkg/tone.js +++ /dev/null @@ -1,8264 +0,0 @@ -import { T as ToneAudioNode, o as optionsFromArguments, P as Param, r as readOnly, g as getContext, _ as __awaiter, O as OfflineContext, s as setContext, c as ToneAudioBuffer, d as Source, e as assert, b as ToneBufferSource, V as Volume, f as isNumber, h as isDefined, j as connect, k as Signal, G as Gain, l as connectSeries, m as SignalOperator, n as Multiply, p as disconnect, q as Oscillator, A as AudioToGain, t as connectSignal, a as ToneAudioBuffers, u as noOp, v as Player, C as Clock, w as intervalToFrequencyRatio, x as assertRange, y as defaultArg, W as WaveShaper, z as ToneConstantSource, B as TransportTimeClass, D as Monophonic, E as Synth, H as omitFromObject, I as OmniOscillator, J as Envelope, K as writable, L as AmplitudeEnvelope, N as deepMerge, Q as FMOscillator, R as Instrument, U as getWorkletGlobalScope, X as workletName, Y as warn, Z as MidiClass, $ as isArray, a0 as ToneWithContext, a1 as StateTimeline, a2 as TicksClass, a3 as isBoolean, a4 as isObject, a5 as isUndef, a6 as clamp, i as isString, a7 as Panner, a8 as gainToDb, a9 as dbToGain, aa as workletName$1, ab as ToneOscillatorNode, ac as theWindow } from './common/index-b6fc655f.js'; -export { aL as AMOscillator, L as AmplitudeEnvelope, A as AudioToGain, aB as BaseContext, as as Buffer, au as BufferSource, at as Buffers, aP as Channel, C as Clock, aA as Context, ak as Destination, ao as Draw, aH as Emitter, J as Envelope, Q as FMOscillator, aN as FatOscillator, F as Frequency, aC as FrequencyClass, G as Gain, aI as IntervalTimeline, am as Listener, al as Master, ae as MembraneSynth, M as Midi, Z as MidiClass, n as Multiply, O as OfflineContext, I as OmniOscillator, q as Oscillator, aO as PWMOscillator, aQ as PanVol, a7 as Panner, P as Param, v as Player, aM as PulseOscillator, S as Sampler, k as Signal, aR as Solo, a1 as StateTimeline, E as Synth, aF as Ticks, a2 as TicksClass, aE as Time, aD as TimeClass, aJ as Timeline, c as ToneAudioBuffer, a as ToneAudioBuffers, T as ToneAudioNode, b as ToneBufferSource, ab as ToneOscillatorNode, ai as Transport, aG as TransportTime, B as TransportTimeClass, V as Volume, W as WaveShaper, j as connect, l as connectSeries, t as connectSignal, aq as context, a9 as dbToGain, ax as debug, y as defaultArg, p as disconnect, ay as ftom, a8 as gainToDb, g as getContext, af as getDestination, ap as getDraw, an as getListener, aj as getTransport, ah as immediate, w as intervalToFrequencyRatio, $ as isArray, a3 as isBoolean, h as isDefined, aK as isFunction, ad as isNote, f as isNumber, a4 as isObject, i as isString, a5 as isUndef, ar as loaded, az as mtof, ag as now, o as optionsFromArguments, s as setContext, av as start, aw as supported, aS as version } from './common/index-b6fc655f.js'; - -/** - * Wrapper around Web Audio's native [DelayNode](http://webaudio.github.io/web-audio-api/#the-delaynode-interface). - * @category Core - * @example - * return Tone.Offline(() => { - * const delay = new Tone.Delay(0.1).toDestination(); - * // connect the signal to both the delay and the destination - * const pulse = new Tone.PulseOscillator().connect(delay).toDestination(); - * // start and stop the pulse - * pulse.start(0).stop(0.01); - * }, 0.5, 1); - */ -class Delay extends ToneAudioNode { - constructor() { - super(optionsFromArguments(Delay.getDefaults(), arguments, ["delayTime", "maxDelay"])); - this.name = "Delay"; - const options = optionsFromArguments(Delay.getDefaults(), arguments, ["delayTime", "maxDelay"]); - const maxDelayInSeconds = this.toSeconds(options.maxDelay); - this._maxDelay = Math.max(maxDelayInSeconds, this.toSeconds(options.delayTime)); - this._delayNode = this.input = this.output = this.context.createDelay(maxDelayInSeconds); - this.delayTime = new Param({ - context: this.context, - param: this._delayNode.delayTime, - units: "time", - value: options.delayTime, - minValue: 0, - maxValue: this.maxDelay, - }); - readOnly(this, "delayTime"); - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - delayTime: 0, - maxDelay: 1, - }); - } - /** - * The maximum delay time. This cannot be changed after - * the value is passed into the constructor. - */ - get maxDelay() { - return this._maxDelay; - } - /** - * Clean up. - */ - dispose() { - super.dispose(); - this._delayNode.disconnect(); - this.delayTime.dispose(); - return this; - } -} - -/** - * Generate a buffer by rendering all of the Tone.js code within the callback using the OfflineAudioContext. - * The OfflineAudioContext is capable of rendering much faster than real time in many cases. - * The callback function also passes in an offline instance of [[Context]] which can be used - * to schedule events along the Transport. - * @param callback All Tone.js nodes which are created and scheduled within this callback are recorded into the output Buffer. - * @param duration the amount of time to record for. - * @return The promise which is invoked with the ToneAudioBuffer of the recorded output. - * @example - * // render 2 seconds of the oscillator - * Tone.Offline(() => { - * // only nodes created in this callback will be recorded - * const oscillator = new Tone.Oscillator().toDestination().start(0); - * }, 2).then((buffer) => { - * // do something with the output buffer - * console.log(buffer); - * }); - * @example - * // can also schedule events along the Transport - * // using the passed in Offline Transport - * Tone.Offline(({ transport }) => { - * const osc = new Tone.Oscillator().toDestination(); - * transport.schedule(time => { - * osc.start(time).stop(time + 0.1); - * }, 1); - * // make sure to start the transport - * transport.start(0.2); - * }, 4).then((buffer) => { - * // do something with the output buffer - * console.log(buffer); - * }); - * @category Core - */ -function Offline(callback, duration, channels = 2, sampleRate = getContext().sampleRate) { - return __awaiter(this, void 0, void 0, function* () { - // set the OfflineAudioContext based on the current context - const originalContext = getContext(); - const context = new OfflineContext(channels, duration, sampleRate); - setContext(context); - // invoke the callback/scheduling - yield callback(context); - // then render the audio - const bufferPromise = context.render(); - // return the original AudioContext - setContext(originalContext); - // await the rendering - const buffer = yield bufferPromise; - // return the audio - return new ToneAudioBuffer(buffer); - }); -} - -var Units = /*#__PURE__*/Object.freeze({ - __proto__: null -}); - -/** - * Noise is a noise generator. It uses looped noise buffers to save on performance. - * Noise supports the noise types: "pink", "white", and "brown". Read more about - * colors of noise on [Wikipedia](https://en.wikipedia.org/wiki/Colors_of_noise). - * - * @example - * // initialize the noise and start - * const noise = new Tone.Noise("pink").start(); - * // make an autofilter to shape the noise - * const autoFilter = new Tone.AutoFilter({ - * frequency: "8n", - * baseFrequency: 200, - * octaves: 8 - * }).toDestination().start(); - * // connect the noise - * noise.connect(autoFilter); - * // start the autofilter LFO - * autoFilter.start(); - * @category Source - */ -class Noise extends Source { - constructor() { - super(optionsFromArguments(Noise.getDefaults(), arguments, ["type"])); - this.name = "Noise"; - /** - * Private reference to the source - */ - this._source = null; - const options = optionsFromArguments(Noise.getDefaults(), arguments, ["type"]); - this._playbackRate = options.playbackRate; - this.type = options.type; - this._fadeIn = options.fadeIn; - this._fadeOut = options.fadeOut; - } - static getDefaults() { - return Object.assign(Source.getDefaults(), { - fadeIn: 0, - fadeOut: 0, - playbackRate: 1, - type: "white", - }); - } - /** - * The type of the noise. Can be "white", "brown", or "pink". - * @example - * const noise = new Tone.Noise().toDestination().start(); - * noise.type = "brown"; - */ - get type() { - return this._type; - } - set type(type) { - assert(type in _noiseBuffers, "Noise: invalid type: " + type); - if (this._type !== type) { - this._type = type; - // if it's playing, stop and restart it - if (this.state === "started") { - const now = this.now(); - this._stop(now); - this._start(now); - } - } - } - /** - * The playback rate of the noise. Affects - * the "frequency" of the noise. - */ - get playbackRate() { - return this._playbackRate; - } - set playbackRate(rate) { - this._playbackRate = rate; - if (this._source) { - this._source.playbackRate.value = rate; - } - } - /** - * internal start method - */ - _start(time) { - const buffer = _noiseBuffers[this._type]; - this._source = new ToneBufferSource({ - url: buffer, - context: this.context, - fadeIn: this._fadeIn, - fadeOut: this._fadeOut, - loop: true, - onended: () => this.onstop(this), - playbackRate: this._playbackRate, - }).connect(this.output); - this._source.start(this.toSeconds(time), Math.random() * (buffer.duration - 0.001)); - } - /** - * internal stop method - */ - _stop(time) { - if (this._source) { - this._source.stop(this.toSeconds(time)); - this._source = null; - } - } - /** - * The fadeIn time of the amplitude envelope. - */ - get fadeIn() { - return this._fadeIn; - } - set fadeIn(time) { - this._fadeIn = time; - if (this._source) { - this._source.fadeIn = this._fadeIn; - } - } - /** - * The fadeOut time of the amplitude envelope. - */ - get fadeOut() { - return this._fadeOut; - } - set fadeOut(time) { - this._fadeOut = time; - if (this._source) { - this._source.fadeOut = this._fadeOut; - } - } - _restart(time) { - // TODO could be optimized by cancelling the buffer source 'stop' - this._stop(time); - this._start(time); - } - /** - * Clean up. - */ - dispose() { - super.dispose(); - if (this._source) { - this._source.disconnect(); - } - return this; - } -} -//-------------------- -// THE NOISE BUFFERS -//-------------------- -// Noise buffer stats -const BUFFER_LENGTH = 44100 * 5; -const NUM_CHANNELS = 2; -/** - * Cache the noise buffers - */ -const _noiseCache = { - brown: null, - pink: null, - white: null, -}; -/** - * The noise arrays. Generated on initialization. - * borrowed heavily from https://github.com/zacharydenton/noise.js - * (c) 2013 Zach Denton (MIT) - */ -const _noiseBuffers = { - get brown() { - if (!_noiseCache.brown) { - const buffer = []; - for (let channelNum = 0; channelNum < NUM_CHANNELS; channelNum++) { - const channel = new Float32Array(BUFFER_LENGTH); - buffer[channelNum] = channel; - let lastOut = 0.0; - for (let i = 0; i < BUFFER_LENGTH; i++) { - const white = Math.random() * 2 - 1; - channel[i] = (lastOut + (0.02 * white)) / 1.02; - lastOut = channel[i]; - channel[i] *= 3.5; // (roughly) compensate for gain - } - } - _noiseCache.brown = new ToneAudioBuffer().fromArray(buffer); - } - return _noiseCache.brown; - }, - get pink() { - if (!_noiseCache.pink) { - const buffer = []; - for (let channelNum = 0; channelNum < NUM_CHANNELS; channelNum++) { - const channel = new Float32Array(BUFFER_LENGTH); - buffer[channelNum] = channel; - let b0, b1, b2, b3, b4, b5, b6; - b0 = b1 = b2 = b3 = b4 = b5 = b6 = 0.0; - for (let i = 0; i < BUFFER_LENGTH; i++) { - const white = Math.random() * 2 - 1; - b0 = 0.99886 * b0 + white * 0.0555179; - b1 = 0.99332 * b1 + white * 0.0750759; - b2 = 0.96900 * b2 + white * 0.1538520; - b3 = 0.86650 * b3 + white * 0.3104856; - b4 = 0.55000 * b4 + white * 0.5329522; - b5 = -0.7616 * b5 - white * 0.0168980; - channel[i] = b0 + b1 + b2 + b3 + b4 + b5 + b6 + white * 0.5362; - channel[i] *= 0.11; // (roughly) compensate for gain - b6 = white * 0.115926; - } - } - _noiseCache.pink = new ToneAudioBuffer().fromArray(buffer); - } - return _noiseCache.pink; - }, - get white() { - if (!_noiseCache.white) { - const buffer = []; - for (let channelNum = 0; channelNum < NUM_CHANNELS; channelNum++) { - const channel = new Float32Array(BUFFER_LENGTH); - buffer[channelNum] = channel; - for (let i = 0; i < BUFFER_LENGTH; i++) { - channel[i] = Math.random() * 2 - 1; - } - } - _noiseCache.white = new ToneAudioBuffer().fromArray(buffer); - } - return _noiseCache.white; - }, -}; - -/** - * UserMedia uses MediaDevices.getUserMedia to open up and external microphone or audio input. - * Check [MediaDevices API Support](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia) - * to see which browsers are supported. Access to an external input - * is limited to secure (HTTPS) connections. - * @example - * const meter = new Tone.Meter(); - * const mic = new Tone.UserMedia().connect(meter); - * mic.open().then(() => { - * // promise resolves when input is available - * console.log("mic open"); - * // print the incoming mic levels in decibels - * setInterval(() => console.log(meter.getValue()), 100); - * }).catch(e => { - * // promise is rejected when the user doesn't have or allow mic access - * console.log("mic not open"); - * }); - * @category Source - */ -class UserMedia extends ToneAudioNode { - constructor() { - super(optionsFromArguments(UserMedia.getDefaults(), arguments, ["volume"])); - this.name = "UserMedia"; - const options = optionsFromArguments(UserMedia.getDefaults(), arguments, ["volume"]); - this._volume = this.output = new Volume({ - context: this.context, - volume: options.volume, - }); - this.volume = this._volume.volume; - readOnly(this, "volume"); - this.mute = options.mute; - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - mute: false, - volume: 0 - }); - } - /** - * Open the media stream. If a string is passed in, it is assumed - * to be the label or id of the stream, if a number is passed in, - * it is the input number of the stream. - * @param labelOrId The label or id of the audio input media device. - * With no argument, the default stream is opened. - * @return The promise is resolved when the stream is open. - */ - open(labelOrId) { - return __awaiter(this, void 0, void 0, function* () { - assert(UserMedia.supported, "UserMedia is not supported"); - // close the previous stream - if (this.state === "started") { - this.close(); - } - const devices = yield UserMedia.enumerateDevices(); - if (isNumber(labelOrId)) { - this._device = devices[labelOrId]; - } - else { - this._device = devices.find((device) => { - return device.label === labelOrId || device.deviceId === labelOrId; - }); - // didn't find a matching device - if (!this._device && devices.length > 0) { - this._device = devices[0]; - } - assert(isDefined(this._device), `No matching device ${labelOrId}`); - } - // do getUserMedia - const constraints = { - audio: { - echoCancellation: false, - sampleRate: this.context.sampleRate, - noiseSuppression: false, - mozNoiseSuppression: false, - } - }; - if (this._device) { - // @ts-ignore - constraints.audio.deviceId = this._device.deviceId; - } - const stream = yield navigator.mediaDevices.getUserMedia(constraints); - // start a new source only if the previous one is closed - if (!this._stream) { - this._stream = stream; - // Wrap a MediaStreamSourceNode around the live input stream. - const mediaStreamNode = this.context.createMediaStreamSource(stream); - // Connect the MediaStreamSourceNode to a gate gain node - connect(mediaStreamNode, this.output); - this._mediaStream = mediaStreamNode; - } - return this; - }); - } - /** - * Close the media stream - */ - close() { - if (this._stream && this._mediaStream) { - this._stream.getAudioTracks().forEach((track) => { - track.stop(); - }); - this._stream = undefined; - // remove the old media stream - this._mediaStream.disconnect(); - this._mediaStream = undefined; - } - this._device = undefined; - return this; - } - /** - * Returns a promise which resolves with the list of audio input devices available. - * @return The promise that is resolved with the devices - * @example - * Tone.UserMedia.enumerateDevices().then((devices) => { - * // print the device labels - * console.log(devices.map(device => device.label)); - * }); - */ - static enumerateDevices() { - return __awaiter(this, void 0, void 0, function* () { - const allDevices = yield navigator.mediaDevices.enumerateDevices(); - return allDevices.filter(device => { - return device.kind === "audioinput"; - }); - }); - } - /** - * Returns the playback state of the source, "started" when the microphone is open - * and "stopped" when the mic is closed. - */ - get state() { - return this._stream && this._stream.active ? "started" : "stopped"; - } - /** - * Returns an identifier for the represented device that is - * persisted across sessions. It is un-guessable by other applications and - * unique to the origin of the calling application. It is reset when the - * user clears cookies (for Private Browsing, a different identifier is - * used that is not persisted across sessions). Returns undefined when the - * device is not open. - */ - get deviceId() { - if (this._device) { - return this._device.deviceId; - } - else { - return undefined; - } - } - /** - * Returns a group identifier. Two devices have the - * same group identifier if they belong to the same physical device. - * Returns null when the device is not open. - */ - get groupId() { - if (this._device) { - return this._device.groupId; - } - else { - return undefined; - } - } - /** - * Returns a label describing this device (for example "Built-in Microphone"). - * Returns undefined when the device is not open or label is not available - * because of permissions. - */ - get label() { - if (this._device) { - return this._device.label; - } - else { - return undefined; - } - } - /** - * Mute the output. - * @example - * const mic = new Tone.UserMedia(); - * mic.open().then(() => { - * // promise resolves when input is available - * }); - * // mute the output - * mic.mute = true; - */ - get mute() { - return this._volume.mute; - } - set mute(mute) { - this._volume.mute = mute; - } - dispose() { - super.dispose(); - this.close(); - this._volume.dispose(); - this.volume.dispose(); - return this; - } - /** - * If getUserMedia is supported by the browser. - */ - static get supported() { - return isDefined(navigator.mediaDevices) && - isDefined(navigator.mediaDevices.getUserMedia); - } -} - -/** - * Add a signal and a number or two signals. When no value is - * passed into the constructor, Tone.Add will sum input and `addend` - * If a value is passed into the constructor, the it will be added to the input. - * - * @example - * return Tone.Offline(() => { - * const add = new Tone.Add(2).toDestination(); - * add.addend.setValueAtTime(1, 0.2); - * const signal = new Tone.Signal(2); - * // add a signal and a scalar - * signal.connect(add); - * signal.setValueAtTime(1, 0.1); - * }, 0.5, 1); - * @category Signal - */ -class Add extends Signal { - constructor() { - super(Object.assign(optionsFromArguments(Add.getDefaults(), arguments, ["value"]))); - this.override = false; - this.name = "Add"; - /** - * the summing node - */ - this._sum = new Gain({ context: this.context }); - this.input = this._sum; - this.output = this._sum; - /** - * The value which is added to the input signal - */ - this.addend = this._param; - connectSeries(this._constantSource, this._sum); - } - static getDefaults() { - return Object.assign(Signal.getDefaults(), { - value: 0, - }); - } - dispose() { - super.dispose(); - this._sum.dispose(); - return this; - } -} - -/** - * Performs a linear scaling on an input signal. - * Scales a NormalRange input to between - * outputMin and outputMax. - * - * @example - * const scale = new Tone.Scale(50, 100); - * const signal = new Tone.Signal(0.5).connect(scale); - * // the output of scale equals 75 - * @category Signal - */ -class Scale extends SignalOperator { - constructor() { - super(Object.assign(optionsFromArguments(Scale.getDefaults(), arguments, ["min", "max"]))); - this.name = "Scale"; - const options = optionsFromArguments(Scale.getDefaults(), arguments, ["min", "max"]); - this._mult = this.input = new Multiply({ - context: this.context, - value: options.max - options.min, - }); - this._add = this.output = new Add({ - context: this.context, - value: options.min, - }); - this._min = options.min; - this._max = options.max; - this.input.connect(this.output); - } - static getDefaults() { - return Object.assign(SignalOperator.getDefaults(), { - max: 1, - min: 0, - }); - } - /** - * The minimum output value. This number is output when the value input value is 0. - */ - get min() { - return this._min; - } - set min(min) { - this._min = min; - this._setRange(); - } - /** - * The maximum output value. This number is output when the value input value is 1. - */ - get max() { - return this._max; - } - set max(max) { - this._max = max; - this._setRange(); - } - /** - * set the values - */ - _setRange() { - this._add.value = this._min; - this._mult.value = this._max - this._min; - } - dispose() { - super.dispose(); - this._add.dispose(); - this._mult.dispose(); - return this; - } -} - -/** - * Tone.Zero outputs 0's at audio-rate. The reason this has to be - * it's own class is that many browsers optimize out Tone.Signal - * with a value of 0 and will not process nodes further down the graph. - * @category Signal - */ -class Zero extends SignalOperator { - constructor() { - super(Object.assign(optionsFromArguments(Zero.getDefaults(), arguments))); - this.name = "Zero"; - /** - * The gain node which connects the constant source to the output - */ - this._gain = new Gain({ context: this.context }); - /** - * Only outputs 0 - */ - this.output = this._gain; - /** - * no input node - */ - this.input = undefined; - connect(this.context.getConstant(0), this._gain); - } - /** - * clean up - */ - dispose() { - super.dispose(); - disconnect(this.context.getConstant(0), this._gain); - return this; - } -} - -/** - * LFO stands for low frequency oscillator. LFO produces an output signal - * which can be attached to an AudioParam or Tone.Signal - * in order to modulate that parameter with an oscillator. The LFO can - * also be synced to the transport to start/stop and change when the tempo changes. - * @example - * return Tone.Offline(() => { - * const lfo = new Tone.LFO("4n", 400, 4000).start().toDestination(); - * }, 0.5, 1); - * @category Source - */ -class LFO extends ToneAudioNode { - constructor() { - super(optionsFromArguments(LFO.getDefaults(), arguments, ["frequency", "min", "max"])); - this.name = "LFO"; - /** - * The value that the LFO outputs when it's stopped - */ - this._stoppedValue = 0; - /** - * A private placeholder for the units - */ - this._units = "number"; - /** - * If the input value is converted using the [[units]] - */ - this.convert = true; - /** - * Private methods borrowed from Param - */ - // @ts-ignore - this._fromType = Param.prototype._fromType; - // @ts-ignore - this._toType = Param.prototype._toType; - // @ts-ignore - this._is = Param.prototype._is; - // @ts-ignore - this._clampValue = Param.prototype._clampValue; - const options = optionsFromArguments(LFO.getDefaults(), arguments, ["frequency", "min", "max"]); - this._oscillator = new Oscillator(options); - this.frequency = this._oscillator.frequency; - this._amplitudeGain = new Gain({ - context: this.context, - gain: options.amplitude, - units: "normalRange", - }); - this.amplitude = this._amplitudeGain.gain; - this._stoppedSignal = new Signal({ - context: this.context, - units: "audioRange", - value: 0, - }); - this._zeros = new Zero({ context: this.context }); - this._a2g = new AudioToGain({ context: this.context }); - this._scaler = this.output = new Scale({ - context: this.context, - max: options.max, - min: options.min, - }); - this.units = options.units; - this.min = options.min; - this.max = options.max; - // connect it up - this._oscillator.chain(this._amplitudeGain, this._a2g, this._scaler); - this._zeros.connect(this._a2g); - this._stoppedSignal.connect(this._a2g); - readOnly(this, ["amplitude", "frequency"]); - this.phase = options.phase; - } - static getDefaults() { - return Object.assign(Oscillator.getDefaults(), { - amplitude: 1, - frequency: "4n", - max: 1, - min: 0, - type: "sine", - units: "number", - }); - } - /** - * Start the LFO. - * @param time The time the LFO will start - */ - start(time) { - time = this.toSeconds(time); - this._stoppedSignal.setValueAtTime(0, time); - this._oscillator.start(time); - return this; - } - /** - * Stop the LFO. - * @param time The time the LFO will stop - */ - stop(time) { - time = this.toSeconds(time); - this._stoppedSignal.setValueAtTime(this._stoppedValue, time); - this._oscillator.stop(time); - return this; - } - /** - * Sync the start/stop/pause to the transport - * and the frequency to the bpm of the transport - * @example - * const lfo = new Tone.LFO("8n"); - * lfo.sync().start(0); - * // the rate of the LFO will always be an eighth note, even as the tempo changes - */ - sync() { - this._oscillator.sync(); - this._oscillator.syncFrequency(); - return this; - } - /** - * unsync the LFO from transport control - */ - unsync() { - this._oscillator.unsync(); - this._oscillator.unsyncFrequency(); - return this; - } - /** - * After the oscillator waveform is updated, reset the `_stoppedSignal` value to match the updated waveform - */ - _setStoppedValue() { - this._stoppedValue = this._oscillator.getInitialValue(); - this._stoppedSignal.value = this._stoppedValue; - } - /** - * The minimum output of the LFO. - */ - get min() { - return this._toType(this._scaler.min); - } - set min(min) { - min = this._fromType(min); - this._scaler.min = min; - } - /** - * The maximum output of the LFO. - */ - get max() { - return this._toType(this._scaler.max); - } - set max(max) { - max = this._fromType(max); - this._scaler.max = max; - } - /** - * The type of the oscillator: See [[Oscillator.type]] - */ - get type() { - return this._oscillator.type; - } - set type(type) { - this._oscillator.type = type; - this._setStoppedValue(); - } - /** - * The oscillator's partials array: See [[Oscillator.partials]] - */ - get partials() { - return this._oscillator.partials; - } - set partials(partials) { - this._oscillator.partials = partials; - this._setStoppedValue(); - } - /** - * The phase of the LFO. - */ - get phase() { - return this._oscillator.phase; - } - set phase(phase) { - this._oscillator.phase = phase; - this._setStoppedValue(); - } - /** - * The output units of the LFO. - */ - get units() { - return this._units; - } - set units(val) { - const currentMin = this.min; - const currentMax = this.max; - // convert the min and the max - this._units = val; - this.min = currentMin; - this.max = currentMax; - } - /** - * Returns the playback state of the source, either "started" or "stopped". - */ - get state() { - return this._oscillator.state; - } - /** - * @param node the destination to connect to - * @param outputNum the optional output number - * @param inputNum the input number - */ - connect(node, outputNum, inputNum) { - if (node instanceof Param || node instanceof Signal) { - this.convert = node.convert; - this.units = node.units; - } - connectSignal(this, node, outputNum, inputNum); - return this; - } - dispose() { - super.dispose(); - this._oscillator.dispose(); - this._stoppedSignal.dispose(); - this._zeros.dispose(); - this._scaler.dispose(); - this._a2g.dispose(); - this._amplitudeGain.dispose(); - this.amplitude.dispose(); - return this; - } -} - -/** - * Players combines multiple [[Player]] objects. - * @category Source - */ -class Players extends ToneAudioNode { - constructor() { - super(optionsFromArguments(Players.getDefaults(), arguments, ["urls", "onload"], "urls")); - this.name = "Players"; - /** - * Players has no input. - */ - this.input = undefined; - /** - * The container of all of the players - */ - this._players = new Map(); - const options = optionsFromArguments(Players.getDefaults(), arguments, ["urls", "onload"], "urls"); - /** - * The output volume node - */ - this._volume = this.output = new Volume({ - context: this.context, - volume: options.volume, - }); - this.volume = this._volume.volume; - readOnly(this, "volume"); - this._buffers = new ToneAudioBuffers({ - urls: options.urls, - onload: options.onload, - baseUrl: options.baseUrl, - onerror: options.onerror - }); - // mute initially - this.mute = options.mute; - this._fadeIn = options.fadeIn; - this._fadeOut = options.fadeOut; - } - static getDefaults() { - return Object.assign(Source.getDefaults(), { - baseUrl: "", - fadeIn: 0, - fadeOut: 0, - mute: false, - onload: noOp, - onerror: noOp, - urls: {}, - volume: 0, - }); - } - /** - * Mute the output. - */ - get mute() { - return this._volume.mute; - } - set mute(mute) { - this._volume.mute = mute; - } - /** - * The fadeIn time of the envelope applied to the source. - */ - get fadeIn() { - return this._fadeIn; - } - set fadeIn(fadeIn) { - this._fadeIn = fadeIn; - this._players.forEach(player => { - player.fadeIn = fadeIn; - }); - } - /** - * The fadeOut time of the each of the sources. - */ - get fadeOut() { - return this._fadeOut; - } - set fadeOut(fadeOut) { - this._fadeOut = fadeOut; - this._players.forEach(player => { - player.fadeOut = fadeOut; - }); - } - /** - * The state of the players object. Returns "started" if any of the players are playing. - */ - get state() { - const playing = Array.from(this._players).some(([_, player]) => player.state === "started"); - return playing ? "started" : "stopped"; - } - /** - * True if the buffers object has a buffer by that name. - * @param name The key or index of the buffer. - */ - has(name) { - return this._buffers.has(name); - } - /** - * Get a player by name. - * @param name The players name as defined in the constructor object or `add` method. - */ - player(name) { - assert(this.has(name), `No Player with the name ${name} exists on this object`); - if (!this._players.has(name)) { - const player = new Player({ - context: this.context, - fadeIn: this._fadeIn, - fadeOut: this._fadeOut, - url: this._buffers.get(name), - }).connect(this.output); - this._players.set(name, player); - } - return this._players.get(name); - } - /** - * If all the buffers are loaded or not - */ - get loaded() { - return this._buffers.loaded; - } - /** - * Add a player by name and url to the Players - * @param name A unique name to give the player - * @param url Either the url of the bufer or a buffer which will be added with the given name. - * @param callback The callback to invoke when the url is loaded. - */ - add(name, url, callback) { - assert(!this._buffers.has(name), "A buffer with that name already exists on this object"); - this._buffers.add(name, url, callback); - return this; - } - /** - * Stop all of the players at the given time - * @param time The time to stop all of the players. - */ - stopAll(time) { - this._players.forEach(player => player.stop(time)); - return this; - } - dispose() { - super.dispose(); - this._volume.dispose(); - this.volume.dispose(); - this._players.forEach(player => player.dispose()); - this._buffers.dispose(); - return this; - } -} - -/** - * GrainPlayer implements [granular synthesis](https://en.wikipedia.org/wiki/Granular_synthesis). - * Granular Synthesis enables you to adjust pitch and playback rate independently. The grainSize is the - * amount of time each small chunk of audio is played for and the overlap is the - * amount of crossfading transition time between successive grains. - * @category Source - */ -class GrainPlayer extends Source { - constructor() { - super(optionsFromArguments(GrainPlayer.getDefaults(), arguments, ["url", "onload"])); - this.name = "GrainPlayer"; - /** - * Internal loopStart value - */ - this._loopStart = 0; - /** - * Internal loopStart value - */ - this._loopEnd = 0; - /** - * All of the currently playing BufferSources - */ - this._activeSources = []; - const options = optionsFromArguments(GrainPlayer.getDefaults(), arguments, ["url", "onload"]); - this.buffer = new ToneAudioBuffer({ - onload: options.onload, - onerror: options.onerror, - reverse: options.reverse, - url: options.url, - }); - this._clock = new Clock({ - context: this.context, - callback: this._tick.bind(this), - frequency: 1 / options.grainSize - }); - this._playbackRate = options.playbackRate; - this._grainSize = options.grainSize; - this._overlap = options.overlap; - this.detune = options.detune; - // setup - this.overlap = options.overlap; - this.loop = options.loop; - this.playbackRate = options.playbackRate; - this.grainSize = options.grainSize; - this.loopStart = options.loopStart; - this.loopEnd = options.loopEnd; - this.reverse = options.reverse; - this._clock.on("stop", this._onstop.bind(this)); - } - static getDefaults() { - return Object.assign(Source.getDefaults(), { - onload: noOp, - onerror: noOp, - overlap: 0.1, - grainSize: 0.2, - playbackRate: 1, - detune: 0, - loop: false, - loopStart: 0, - loopEnd: 0, - reverse: false - }); - } - /** - * Internal start method - */ - _start(time, offset, duration) { - offset = defaultArg(offset, 0); - offset = this.toSeconds(offset); - time = this.toSeconds(time); - const grainSize = 1 / this._clock.frequency.getValueAtTime(time); - this._clock.start(time, offset / grainSize); - if (duration) { - this.stop(time + this.toSeconds(duration)); - } - } - /** - * Stop and then restart the player from the beginning (or offset) - * @param time When the player should start. - * @param offset The offset from the beginning of the sample to start at. - * @param duration How long the sample should play. If no duration is given, - * it will default to the full length of the sample (minus any offset) - */ - restart(time, offset, duration) { - super.restart(time, offset, duration); - return this; - } - _restart(time, offset, duration) { - this._stop(time); - this._start(time, offset, duration); - } - /** - * Internal stop method - */ - _stop(time) { - this._clock.stop(time); - } - /** - * Invoked when the clock is stopped - */ - _onstop(time) { - // stop the players - this._activeSources.forEach((source) => { - source.fadeOut = 0; - source.stop(time); - }); - this.onstop(this); - } - /** - * Invoked on each clock tick. scheduled a new grain at this time. - */ - _tick(time) { - // check if it should stop looping - const ticks = this._clock.getTicksAtTime(time); - const offset = ticks * this._grainSize; - this.log("offset", offset); - if (!this.loop && offset > this.buffer.duration) { - this.stop(time); - return; - } - // at the beginning of the file, the fade in should be 0 - const fadeIn = offset < this._overlap ? 0 : this._overlap; - // create a buffer source - const source = new ToneBufferSource({ - context: this.context, - url: this.buffer, - fadeIn: fadeIn, - fadeOut: this._overlap, - loop: this.loop, - loopStart: this._loopStart, - loopEnd: this._loopEnd, - // compute the playbackRate based on the detune - playbackRate: intervalToFrequencyRatio(this.detune / 100) - }).connect(this.output); - source.start(time, this._grainSize * ticks); - source.stop(time + this._grainSize / this.playbackRate); - // add it to the active sources - this._activeSources.push(source); - // remove it when it's done - source.onended = () => { - const index = this._activeSources.indexOf(source); - if (index !== -1) { - this._activeSources.splice(index, 1); - } - }; - } - /** - * The playback rate of the sample - */ - get playbackRate() { - return this._playbackRate; - } - set playbackRate(rate) { - assertRange(rate, 0.001); - this._playbackRate = rate; - this.grainSize = this._grainSize; - } - /** - * The loop start time. - */ - get loopStart() { - return this._loopStart; - } - set loopStart(time) { - if (this.buffer.loaded) { - assertRange(this.toSeconds(time), 0, this.buffer.duration); - } - this._loopStart = this.toSeconds(time); - } - /** - * The loop end time. - */ - get loopEnd() { - return this._loopEnd; - } - set loopEnd(time) { - if (this.buffer.loaded) { - assertRange(this.toSeconds(time), 0, this.buffer.duration); - } - this._loopEnd = this.toSeconds(time); - } - /** - * The direction the buffer should play in - */ - get reverse() { - return this.buffer.reverse; - } - set reverse(rev) { - this.buffer.reverse = rev; - } - /** - * The size of each chunk of audio that the - * buffer is chopped into and played back at. - */ - get grainSize() { - return this._grainSize; - } - set grainSize(size) { - this._grainSize = this.toSeconds(size); - this._clock.frequency.setValueAtTime(this._playbackRate / this._grainSize, this.now()); - } - /** - * The duration of the cross-fade between successive grains. - */ - get overlap() { - return this._overlap; - } - set overlap(time) { - const computedTime = this.toSeconds(time); - assertRange(computedTime, 0); - this._overlap = computedTime; - } - /** - * If all the buffer is loaded - */ - get loaded() { - return this.buffer.loaded; - } - dispose() { - super.dispose(); - this.buffer.dispose(); - this._clock.dispose(); - this._activeSources.forEach((source) => source.dispose()); - return this; - } -} - -/** - * Return the absolute value of an incoming signal. - * - * @example - * return Tone.Offline(() => { - * const abs = new Tone.Abs().toDestination(); - * const signal = new Tone.Signal(1); - * signal.rampTo(-1, 0.5); - * signal.connect(abs); - * }, 0.5, 1); - * @category Signal - */ -class Abs extends SignalOperator { - constructor() { - super(...arguments); - this.name = "Abs"; - /** - * The node which converts the audio ranges - */ - this._abs = new WaveShaper({ - context: this.context, - mapping: val => { - if (Math.abs(val) < 0.001) { - return 0; - } - else { - return Math.abs(val); - } - }, - }); - /** - * The AudioRange input [-1, 1] - */ - this.input = this._abs; - /** - * The output range [0, 1] - */ - this.output = this._abs; - } - /** - * clean up - */ - dispose() { - super.dispose(); - this._abs.dispose(); - return this; - } -} - -/** - * GainToAudio converts an input in NormalRange [0,1] to AudioRange [-1,1]. - * See [[AudioToGain]]. - * @category Signal - */ -class GainToAudio extends SignalOperator { - constructor() { - super(...arguments); - this.name = "GainToAudio"; - /** - * The node which converts the audio ranges - */ - this._norm = new WaveShaper({ - context: this.context, - mapping: x => Math.abs(x) * 2 - 1, - }); - /** - * The NormalRange input [0, 1] - */ - this.input = this._norm; - /** - * The AudioRange output [-1, 1] - */ - this.output = this._norm; - } - /** - * clean up - */ - dispose() { - super.dispose(); - this._norm.dispose(); - return this; - } -} - -/** - * Negate the incoming signal. i.e. an input signal of 10 will output -10 - * - * @example - * const neg = new Tone.Negate(); - * const sig = new Tone.Signal(-2).connect(neg); - * // output of neg is positive 2. - * @category Signal - */ -class Negate extends SignalOperator { - constructor() { - super(...arguments); - this.name = "Negate"; - /** - * negation is done by multiplying by -1 - */ - this._multiply = new Multiply({ - context: this.context, - value: -1, - }); - /** - * The input and output are equal to the multiply node - */ - this.input = this._multiply; - this.output = this._multiply; - } - /** - * clean up - * @returns {Negate} this - */ - dispose() { - super.dispose(); - this._multiply.dispose(); - return this; - } -} - -/** - * Subtract the signal connected to the input is subtracted from the signal connected - * The subtrahend. - * - * @example - * // subtract a scalar from a signal - * const sub = new Tone.Subtract(1); - * const sig = new Tone.Signal(4).connect(sub); - * // the output of sub is 3. - * @example - * // subtract two signals - * const sub = new Tone.Subtract(); - * const sigA = new Tone.Signal(10); - * const sigB = new Tone.Signal(2.5); - * sigA.connect(sub); - * sigB.connect(sub.subtrahend); - * // output of sub is 7.5 - * @category Signal - */ -class Subtract extends Signal { - constructor() { - super(Object.assign(optionsFromArguments(Subtract.getDefaults(), arguments, ["value"]))); - this.override = false; - this.name = "Subtract"; - /** - * the summing node - */ - this._sum = new Gain({ context: this.context }); - this.input = this._sum; - this.output = this._sum; - /** - * Negate the input of the second input before connecting it to the summing node. - */ - this._neg = new Negate({ context: this.context }); - /** - * The value which is subtracted from the main signal - */ - this.subtrahend = this._param; - connectSeries(this._constantSource, this._neg, this._sum); - } - static getDefaults() { - return Object.assign(Signal.getDefaults(), { - value: 0, - }); - } - dispose() { - super.dispose(); - this._neg.dispose(); - this._sum.dispose(); - return this; - } -} - -/** - * GreaterThanZero outputs 1 when the input is strictly greater than zero - * @example - * return Tone.Offline(() => { - * const gt0 = new Tone.GreaterThanZero().toDestination(); - * const sig = new Tone.Signal(0.5).connect(gt0); - * sig.setValueAtTime(-1, 0.05); - * }, 0.1, 1); - * @category Signal - */ -class GreaterThanZero extends SignalOperator { - constructor() { - super(Object.assign(optionsFromArguments(GreaterThanZero.getDefaults(), arguments))); - this.name = "GreaterThanZero"; - this._thresh = this.output = new WaveShaper({ - context: this.context, - length: 127, - mapping: (val) => { - if (val <= 0) { - return 0; - } - else { - return 1; - } - }, - }); - this._scale = this.input = new Multiply({ - context: this.context, - value: 10000 - }); - // connections - this._scale.connect(this._thresh); - } - dispose() { - super.dispose(); - this._scale.dispose(); - this._thresh.dispose(); - return this; - } -} - -/** - * Output 1 if the signal is greater than the value, otherwise outputs 0. - * can compare two signals or a signal and a number. - * - * @example - * return Tone.Offline(() => { - * const gt = new Tone.GreaterThan(2).toDestination(); - * const sig = new Tone.Signal(4).connect(gt); - * }, 0.1, 1); - * @category Signal - */ -class GreaterThan extends Signal { - constructor() { - super(Object.assign(optionsFromArguments(GreaterThan.getDefaults(), arguments, ["value"]))); - this.name = "GreaterThan"; - this.override = false; - const options = optionsFromArguments(GreaterThan.getDefaults(), arguments, ["value"]); - this._subtract = this.input = new Subtract({ - context: this.context, - value: options.value - }); - this._gtz = this.output = new GreaterThanZero({ context: this.context }); - this.comparator = this._param = this._subtract.subtrahend; - readOnly(this, "comparator"); - // connect - this._subtract.connect(this._gtz); - } - static getDefaults() { - return Object.assign(Signal.getDefaults(), { - value: 0, - }); - } - dispose() { - super.dispose(); - this._gtz.dispose(); - this._subtract.dispose(); - this.comparator.dispose(); - return this; - } -} - -/** - * Pow applies an exponent to the incoming signal. The incoming signal must be AudioRange [-1, 1] - * - * @example - * const pow = new Tone.Pow(2); - * const sig = new Tone.Signal(0.5).connect(pow); - * // output of pow is 0.25. - * @category Signal - */ -class Pow extends SignalOperator { - constructor() { - super(Object.assign(optionsFromArguments(Pow.getDefaults(), arguments, ["value"]))); - this.name = "Pow"; - const options = optionsFromArguments(Pow.getDefaults(), arguments, ["value"]); - this._exponentScaler = this.input = this.output = new WaveShaper({ - context: this.context, - mapping: this._expFunc(options.value), - length: 8192, - }); - this._exponent = options.value; - } - static getDefaults() { - return Object.assign(SignalOperator.getDefaults(), { - value: 1, - }); - } - /** - * the function which maps the waveshaper - * @param exponent exponent value - */ - _expFunc(exponent) { - return (val) => { - return Math.pow(Math.abs(val), exponent); - }; - } - /** - * The value of the exponent. - */ - get value() { - return this._exponent; - } - set value(exponent) { - this._exponent = exponent; - this._exponentScaler.setMap(this._expFunc(this._exponent)); - } - /** - * Clean up. - */ - dispose() { - super.dispose(); - this._exponentScaler.dispose(); - return this; - } -} - -/** - * Performs an exponential scaling on an input signal. - * Scales a NormalRange value [0,1] exponentially - * to the output range of outputMin to outputMax. - * @example - * const scaleExp = new Tone.ScaleExp(0, 100, 2); - * const signal = new Tone.Signal(0.5).connect(scaleExp); - * @category Signal - */ -class ScaleExp extends Scale { - constructor() { - super(Object.assign(optionsFromArguments(ScaleExp.getDefaults(), arguments, ["min", "max", "exponent"]))); - this.name = "ScaleExp"; - const options = optionsFromArguments(ScaleExp.getDefaults(), arguments, ["min", "max", "exponent"]); - this.input = this._exp = new Pow({ - context: this.context, - value: options.exponent, - }); - this._exp.connect(this._mult); - } - static getDefaults() { - return Object.assign(Scale.getDefaults(), { - exponent: 1, - }); - } - /** - * Instead of interpolating linearly between the [[min]] and - * [[max]] values, setting the exponent will interpolate between - * the two values with an exponential curve. - */ - get exponent() { - return this._exp.value; - } - set exponent(exp) { - this._exp.value = exp; - } - dispose() { - super.dispose(); - this._exp.dispose(); - return this; - } -} - -/** - * Adds the ability to synchronize the signal to the [[Transport]] - */ -class SyncedSignal extends Signal { - constructor() { - super(optionsFromArguments(Signal.getDefaults(), arguments, ["value", "units"])); - this.name = "SyncedSignal"; - /** - * Don't override when something is connected to the input - */ - this.override = false; - const options = optionsFromArguments(Signal.getDefaults(), arguments, ["value", "units"]); - this._lastVal = options.value; - this._synced = this.context.transport.scheduleRepeat(this._onTick.bind(this), "1i"); - this._syncedCallback = this._anchorValue.bind(this); - this.context.transport.on("start", this._syncedCallback); - this.context.transport.on("pause", this._syncedCallback); - this.context.transport.on("stop", this._syncedCallback); - // disconnect the constant source from the output and replace it with another one - this._constantSource.disconnect(); - this._constantSource.stop(0); - // create a new one - this._constantSource = this.output = new ToneConstantSource({ - context: this.context, - offset: options.value, - units: options.units, - }).start(0); - this.setValueAtTime(options.value, 0); - } - /** - * Callback which is invoked every tick. - */ - _onTick(time) { - const val = super.getValueAtTime(this.context.transport.seconds); - // approximate ramp curves with linear ramps - if (this._lastVal !== val) { - this._lastVal = val; - this._constantSource.offset.setValueAtTime(val, time); - } - } - /** - * Anchor the value at the start and stop of the Transport - */ - _anchorValue(time) { - const val = super.getValueAtTime(this.context.transport.seconds); - this._lastVal = val; - this._constantSource.offset.cancelAndHoldAtTime(time); - this._constantSource.offset.setValueAtTime(val, time); - } - getValueAtTime(time) { - const computedTime = new TransportTimeClass(this.context, time).toSeconds(); - return super.getValueAtTime(computedTime); - } - setValueAtTime(value, time) { - const computedTime = new TransportTimeClass(this.context, time).toSeconds(); - super.setValueAtTime(value, computedTime); - return this; - } - linearRampToValueAtTime(value, time) { - const computedTime = new TransportTimeClass(this.context, time).toSeconds(); - super.linearRampToValueAtTime(value, computedTime); - return this; - } - exponentialRampToValueAtTime(value, time) { - const computedTime = new TransportTimeClass(this.context, time).toSeconds(); - super.exponentialRampToValueAtTime(value, computedTime); - return this; - } - setTargetAtTime(value, startTime, timeConstant) { - const computedTime = new TransportTimeClass(this.context, startTime).toSeconds(); - super.setTargetAtTime(value, computedTime, timeConstant); - return this; - } - cancelScheduledValues(startTime) { - const computedTime = new TransportTimeClass(this.context, startTime).toSeconds(); - super.cancelScheduledValues(computedTime); - return this; - } - setValueCurveAtTime(values, startTime, duration, scaling) { - const computedTime = new TransportTimeClass(this.context, startTime).toSeconds(); - duration = this.toSeconds(duration); - super.setValueCurveAtTime(values, computedTime, duration, scaling); - return this; - } - cancelAndHoldAtTime(time) { - const computedTime = new TransportTimeClass(this.context, time).toSeconds(); - super.cancelAndHoldAtTime(computedTime); - return this; - } - setRampPoint(time) { - const computedTime = new TransportTimeClass(this.context, time).toSeconds(); - super.setRampPoint(computedTime); - return this; - } - exponentialRampTo(value, rampTime, startTime) { - const computedTime = new TransportTimeClass(this.context, startTime).toSeconds(); - super.exponentialRampTo(value, rampTime, computedTime); - return this; - } - linearRampTo(value, rampTime, startTime) { - const computedTime = new TransportTimeClass(this.context, startTime).toSeconds(); - super.linearRampTo(value, rampTime, computedTime); - return this; - } - targetRampTo(value, rampTime, startTime) { - const computedTime = new TransportTimeClass(this.context, startTime).toSeconds(); - super.targetRampTo(value, rampTime, computedTime); - return this; - } - dispose() { - super.dispose(); - this.context.transport.clear(this._synced); - this.context.transport.off("start", this._syncedCallback); - this.context.transport.off("pause", this._syncedCallback); - this.context.transport.off("stop", this._syncedCallback); - this._constantSource.dispose(); - return this; - } -} - -/** - * Base class for both AM and FM synths - */ -class ModulationSynth extends Monophonic { - constructor() { - super(optionsFromArguments(ModulationSynth.getDefaults(), arguments)); - this.name = "ModulationSynth"; - const options = optionsFromArguments(ModulationSynth.getDefaults(), arguments); - this._carrier = new Synth({ - context: this.context, - oscillator: options.oscillator, - envelope: options.envelope, - onsilence: () => this.onsilence(this), - volume: -10, - }); - this._modulator = new Synth({ - context: this.context, - oscillator: options.modulation, - envelope: options.modulationEnvelope, - volume: -10, - }); - this.oscillator = this._carrier.oscillator; - this.envelope = this._carrier.envelope; - this.modulation = this._modulator.oscillator; - this.modulationEnvelope = this._modulator.envelope; - this.frequency = new Signal({ - context: this.context, - units: "frequency", - }); - this.detune = new Signal({ - context: this.context, - value: options.detune, - units: "cents" - }); - this.harmonicity = new Multiply({ - context: this.context, - value: options.harmonicity, - minValue: 0, - }); - this._modulationNode = new Gain({ - context: this.context, - gain: 0, - }); - readOnly(this, ["frequency", "harmonicity", "oscillator", "envelope", "modulation", "modulationEnvelope", "detune"]); - } - static getDefaults() { - return Object.assign(Monophonic.getDefaults(), { - harmonicity: 3, - oscillator: Object.assign(omitFromObject(OmniOscillator.getDefaults(), [ - ...Object.keys(Source.getDefaults()), - "frequency", - "detune" - ]), { - type: "sine" - }), - envelope: Object.assign(omitFromObject(Envelope.getDefaults(), Object.keys(ToneAudioNode.getDefaults())), { - attack: 0.01, - decay: 0.01, - sustain: 1, - release: 0.5 - }), - modulation: Object.assign(omitFromObject(OmniOscillator.getDefaults(), [ - ...Object.keys(Source.getDefaults()), - "frequency", - "detune" - ]), { - type: "square" - }), - modulationEnvelope: Object.assign(omitFromObject(Envelope.getDefaults(), Object.keys(ToneAudioNode.getDefaults())), { - attack: 0.5, - decay: 0.0, - sustain: 1, - release: 0.5 - }) - }); - } - /** - * Trigger the attack portion of the note - */ - _triggerEnvelopeAttack(time, velocity) { - // @ts-ignore - this._carrier._triggerEnvelopeAttack(time, velocity); - // @ts-ignore - this._modulator._triggerEnvelopeAttack(time, velocity); - } - /** - * Trigger the release portion of the note - */ - _triggerEnvelopeRelease(time) { - // @ts-ignore - this._carrier._triggerEnvelopeRelease(time); - // @ts-ignore - this._modulator._triggerEnvelopeRelease(time); - return this; - } - getLevelAtTime(time) { - time = this.toSeconds(time); - return this.envelope.getValueAtTime(time); - } - dispose() { - super.dispose(); - this._carrier.dispose(); - this._modulator.dispose(); - this.frequency.dispose(); - this.detune.dispose(); - this.harmonicity.dispose(); - this._modulationNode.dispose(); - return this; - } -} - -/** - * AMSynth uses the output of one Tone.Synth to modulate the - * amplitude of another Tone.Synth. The harmonicity (the ratio between - * the two signals) affects the timbre of the output signal greatly. - * Read more about Amplitude Modulation Synthesis on - * [SoundOnSound](https://web.archive.org/web/20160404103653/http://www.soundonsound.com:80/sos/mar00/articles/synthsecrets.htm). - * - * @example - * const synth = new Tone.AMSynth().toDestination(); - * synth.triggerAttackRelease("C4", "4n"); - * - * @category Instrument - */ -class AMSynth extends ModulationSynth { - constructor() { - super(optionsFromArguments(AMSynth.getDefaults(), arguments)); - this.name = "AMSynth"; - this._modulationScale = new AudioToGain({ - context: this.context, - }); - // control the two voices frequency - this.frequency.connect(this._carrier.frequency); - this.frequency.chain(this.harmonicity, this._modulator.frequency); - this.detune.fan(this._carrier.detune, this._modulator.detune); - this._modulator.chain(this._modulationScale, this._modulationNode.gain); - this._carrier.chain(this._modulationNode, this.output); - } - dispose() { - super.dispose(); - this._modulationScale.dispose(); - return this; - } -} - -/** - * Thin wrapper around the native Web Audio [BiquadFilterNode](https://webaudio.github.io/web-audio-api/#biquadfilternode). - * BiquadFilter is similar to [[Filter]] but doesn't have the option to set the "rolloff" value. - * @category Component - */ -class BiquadFilter extends ToneAudioNode { - constructor() { - super(optionsFromArguments(BiquadFilter.getDefaults(), arguments, ["frequency", "type"])); - this.name = "BiquadFilter"; - const options = optionsFromArguments(BiquadFilter.getDefaults(), arguments, ["frequency", "type"]); - this._filter = this.context.createBiquadFilter(); - this.input = this.output = this._filter; - this.Q = new Param({ - context: this.context, - units: "number", - value: options.Q, - param: this._filter.Q, - }); - this.frequency = new Param({ - context: this.context, - units: "frequency", - value: options.frequency, - param: this._filter.frequency, - }); - this.detune = new Param({ - context: this.context, - units: "cents", - value: options.detune, - param: this._filter.detune, - }); - this.gain = new Param({ - context: this.context, - units: "decibels", - convert: false, - value: options.gain, - param: this._filter.gain, - }); - this.type = options.type; - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - Q: 1, - type: "lowpass", - frequency: 350, - detune: 0, - gain: 0, - }); - } - /** - * The type of this BiquadFilterNode. For a complete list of types and their attributes, see the - * [Web Audio API](https://webaudio.github.io/web-audio-api/#dom-biquadfiltertype-lowpass) - */ - get type() { - return this._filter.type; - } - set type(type) { - const types = ["lowpass", "highpass", "bandpass", - "lowshelf", "highshelf", "notch", "allpass", "peaking"]; - assert(types.indexOf(type) !== -1, `Invalid filter type: ${type}`); - this._filter.type = type; - } - /** - * Get the frequency response curve. This curve represents how the filter - * responses to frequencies between 20hz-20khz. - * @param len The number of values to return - * @return The frequency response curve between 20-20kHz - */ - getFrequencyResponse(len = 128) { - // start with all 1s - const freqValues = new Float32Array(len); - for (let i = 0; i < len; i++) { - const norm = Math.pow(i / len, 2); - const freq = norm * (20000 - 20) + 20; - freqValues[i] = freq; - } - const magValues = new Float32Array(len); - const phaseValues = new Float32Array(len); - // clone the filter to remove any connections which may be changing the value - const filterClone = this.context.createBiquadFilter(); - filterClone.type = this.type; - filterClone.Q.value = this.Q.value; - filterClone.frequency.value = this.frequency.value; - filterClone.gain.value = this.gain.value; - filterClone.getFrequencyResponse(freqValues, magValues, phaseValues); - return magValues; - } - dispose() { - super.dispose(); - this._filter.disconnect(); - this.Q.dispose(); - this.frequency.dispose(); - this.gain.dispose(); - this.detune.dispose(); - return this; - } -} - -/** - * Tone.Filter is a filter which allows for all of the same native methods - * as the [BiquadFilterNode](http://webaudio.github.io/web-audio-api/#the-biquadfilternode-interface). - * Tone.Filter has the added ability to set the filter rolloff at -12 - * (default), -24 and -48. - * @example - * const filter = new Tone.Filter(1500, "highpass").toDestination(); - * filter.frequency.rampTo(20000, 10); - * const noise = new Tone.Noise().connect(filter).start(); - * @category Component - */ -class Filter extends ToneAudioNode { - constructor() { - super(optionsFromArguments(Filter.getDefaults(), arguments, ["frequency", "type", "rolloff"])); - this.name = "Filter"; - this.input = new Gain({ context: this.context }); - this.output = new Gain({ context: this.context }); - this._filters = []; - const options = optionsFromArguments(Filter.getDefaults(), arguments, ["frequency", "type", "rolloff"]); - this._filters = []; - this.Q = new Signal({ - context: this.context, - units: "positive", - value: options.Q, - }); - this.frequency = new Signal({ - context: this.context, - units: "frequency", - value: options.frequency, - }); - this.detune = new Signal({ - context: this.context, - units: "cents", - value: options.detune, - }); - this.gain = new Signal({ - context: this.context, - units: "decibels", - convert: false, - value: options.gain, - }); - this._type = options.type; - this.rolloff = options.rolloff; - readOnly(this, ["detune", "frequency", "gain", "Q"]); - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - Q: 1, - detune: 0, - frequency: 350, - gain: 0, - rolloff: -12, - type: "lowpass", - }); - } - /** - * The type of the filter. Types: "lowpass", "highpass", - * "bandpass", "lowshelf", "highshelf", "notch", "allpass", or "peaking". - */ - get type() { - return this._type; - } - set type(type) { - const types = ["lowpass", "highpass", "bandpass", - "lowshelf", "highshelf", "notch", "allpass", "peaking"]; - assert(types.indexOf(type) !== -1, `Invalid filter type: ${type}`); - this._type = type; - this._filters.forEach(filter => filter.type = type); - } - /** - * The rolloff of the filter which is the drop in db - * per octave. Implemented internally by cascading filters. - * Only accepts the values -12, -24, -48 and -96. - */ - get rolloff() { - return this._rolloff; - } - set rolloff(rolloff) { - const rolloffNum = isNumber(rolloff) ? rolloff : parseInt(rolloff, 10); - const possibilities = [-12, -24, -48, -96]; - let cascadingCount = possibilities.indexOf(rolloffNum); - // check the rolloff is valid - assert(cascadingCount !== -1, `rolloff can only be ${possibilities.join(", ")}`); - cascadingCount += 1; - this._rolloff = rolloffNum; - this.input.disconnect(); - this._filters.forEach(filter => filter.disconnect()); - this._filters = new Array(cascadingCount); - for (let count = 0; count < cascadingCount; count++) { - const filter = new BiquadFilter({ - context: this.context, - }); - filter.type = this._type; - this.frequency.connect(filter.frequency); - this.detune.connect(filter.detune); - this.Q.connect(filter.Q); - this.gain.connect(filter.gain); - this._filters[count] = filter; - } - this._internalChannels = this._filters; - connectSeries(this.input, ...this._internalChannels, this.output); - } - /** - * Get the frequency response curve. This curve represents how the filter - * responses to frequencies between 20hz-20khz. - * @param len The number of values to return - * @return The frequency response curve between 20-20kHz - */ - getFrequencyResponse(len = 128) { - const filterClone = new BiquadFilter({ - frequency: this.frequency.value, - gain: this.gain.value, - Q: this.Q.value, - type: this._type, - detune: this.detune.value, - }); - // start with all 1s - const totalResponse = new Float32Array(len).map(() => 1); - this._filters.forEach(() => { - const response = filterClone.getFrequencyResponse(len); - response.forEach((val, i) => totalResponse[i] *= val); - }); - filterClone.dispose(); - return totalResponse; - } - /** - * Clean up. - */ - dispose() { - super.dispose(); - this._filters.forEach(filter => { - filter.dispose(); - }); - writable(this, ["detune", "frequency", "gain", "Q"]); - this.frequency.dispose(); - this.Q.dispose(); - this.detune.dispose(); - this.gain.dispose(); - return this; - } -} - -/** - * FrequencyEnvelope is an [[Envelope]] which ramps between [[baseFrequency]] - * and [[octaves]]. It can also have an optional [[exponent]] to adjust the curve - * which it ramps. - * @example - * const oscillator = new Tone.Oscillator().toDestination().start(); - * const freqEnv = new Tone.FrequencyEnvelope({ - * attack: 0.2, - * baseFrequency: "C2", - * octaves: 4 - * }); - * freqEnv.connect(oscillator.frequency); - * freqEnv.triggerAttack(); - * @category Component - */ -class FrequencyEnvelope extends Envelope { - constructor() { - super(optionsFromArguments(FrequencyEnvelope.getDefaults(), arguments, ["attack", "decay", "sustain", "release"])); - this.name = "FrequencyEnvelope"; - const options = optionsFromArguments(FrequencyEnvelope.getDefaults(), arguments, ["attack", "decay", "sustain", "release"]); - this._octaves = options.octaves; - this._baseFrequency = this.toFrequency(options.baseFrequency); - this._exponent = this.input = new Pow({ - context: this.context, - value: options.exponent - }); - this._scale = this.output = new Scale({ - context: this.context, - min: this._baseFrequency, - max: this._baseFrequency * Math.pow(2, this._octaves), - }); - this._sig.chain(this._exponent, this._scale); - } - static getDefaults() { - return Object.assign(Envelope.getDefaults(), { - baseFrequency: 200, - exponent: 1, - octaves: 4, - }); - } - /** - * The envelope's minimum output value. This is the value which it - * starts at. - */ - get baseFrequency() { - return this._baseFrequency; - } - set baseFrequency(min) { - const freq = this.toFrequency(min); - assertRange(freq, 0); - this._baseFrequency = freq; - this._scale.min = this._baseFrequency; - // update the max value when the min changes - this.octaves = this._octaves; - } - /** - * The number of octaves above the baseFrequency that the - * envelope will scale to. - */ - get octaves() { - return this._octaves; - } - set octaves(octaves) { - this._octaves = octaves; - this._scale.max = this._baseFrequency * Math.pow(2, octaves); - } - /** - * The envelope's exponent value. - */ - get exponent() { - return this._exponent.value; - } - set exponent(exponent) { - this._exponent.value = exponent; - } - /** - * Clean up - */ - dispose() { - super.dispose(); - this._exponent.dispose(); - this._scale.dispose(); - return this; - } -} - -/** - * MonoSynth is composed of one `oscillator`, one `filter`, and two `envelopes`. - * The amplitude of the Oscillator and the cutoff frequency of the - * Filter are controlled by Envelopes. - * - * @example - * const synth = new Tone.MonoSynth({ - * oscillator: { - * type: "square" - * }, - * envelope: { - * attack: 0.1 - * } - * }).toDestination(); - * synth.triggerAttackRelease("C4", "8n"); - * @category Instrument - */ -class MonoSynth extends Monophonic { - constructor() { - super(optionsFromArguments(MonoSynth.getDefaults(), arguments)); - this.name = "MonoSynth"; - const options = optionsFromArguments(MonoSynth.getDefaults(), arguments); - this.oscillator = new OmniOscillator(Object.assign(options.oscillator, { - context: this.context, - detune: options.detune, - onstop: () => this.onsilence(this), - })); - this.frequency = this.oscillator.frequency; - this.detune = this.oscillator.detune; - this.filter = new Filter(Object.assign(options.filter, { context: this.context })); - this.filterEnvelope = new FrequencyEnvelope(Object.assign(options.filterEnvelope, { context: this.context })); - this.envelope = new AmplitudeEnvelope(Object.assign(options.envelope, { context: this.context })); - // connect the oscillators to the output - this.oscillator.chain(this.filter, this.envelope, this.output); - // connect the filter envelope - this.filterEnvelope.connect(this.filter.frequency); - readOnly(this, ["oscillator", "frequency", "detune", "filter", "filterEnvelope", "envelope"]); - } - static getDefaults() { - return Object.assign(Monophonic.getDefaults(), { - envelope: Object.assign(omitFromObject(Envelope.getDefaults(), Object.keys(ToneAudioNode.getDefaults())), { - attack: 0.005, - decay: 0.1, - release: 1, - sustain: 0.9, - }), - filter: Object.assign(omitFromObject(Filter.getDefaults(), Object.keys(ToneAudioNode.getDefaults())), { - Q: 1, - rolloff: -12, - type: "lowpass", - }), - filterEnvelope: Object.assign(omitFromObject(FrequencyEnvelope.getDefaults(), Object.keys(ToneAudioNode.getDefaults())), { - attack: 0.6, - baseFrequency: 200, - decay: 0.2, - exponent: 2, - octaves: 3, - release: 2, - sustain: 0.5, - }), - oscillator: Object.assign(omitFromObject(OmniOscillator.getDefaults(), Object.keys(Source.getDefaults())), { - type: "sawtooth", - }), - }); - } - /** - * start the attack portion of the envelope - * @param time the time the attack should start - * @param velocity the velocity of the note (0-1) - */ - _triggerEnvelopeAttack(time, velocity = 1) { - this.envelope.triggerAttack(time, velocity); - this.filterEnvelope.triggerAttack(time); - this.oscillator.start(time); - if (this.envelope.sustain === 0) { - const computedAttack = this.toSeconds(this.envelope.attack); - const computedDecay = this.toSeconds(this.envelope.decay); - this.oscillator.stop(time + computedAttack + computedDecay); - } - } - /** - * start the release portion of the envelope - * @param time the time the release should start - */ - _triggerEnvelopeRelease(time) { - this.envelope.triggerRelease(time); - this.filterEnvelope.triggerRelease(time); - this.oscillator.stop(time + this.toSeconds(this.envelope.release)); - } - getLevelAtTime(time) { - time = this.toSeconds(time); - return this.envelope.getValueAtTime(time); - } - dispose() { - super.dispose(); - this.oscillator.dispose(); - this.envelope.dispose(); - this.filterEnvelope.dispose(); - this.filter.dispose(); - return this; - } -} - -/** - * DuoSynth is a monophonic synth composed of two [[MonoSynths]] run in parallel with control over the - * frequency ratio between the two voices and vibrato effect. - * @example - * const duoSynth = new Tone.DuoSynth().toDestination(); - * duoSynth.triggerAttackRelease("C4", "2n"); - * @category Instrument - */ -class DuoSynth extends Monophonic { - constructor() { - super(optionsFromArguments(DuoSynth.getDefaults(), arguments)); - this.name = "DuoSynth"; - const options = optionsFromArguments(DuoSynth.getDefaults(), arguments); - this.voice0 = new MonoSynth(Object.assign(options.voice0, { - context: this.context, - onsilence: () => this.onsilence(this) - })); - this.voice1 = new MonoSynth(Object.assign(options.voice1, { - context: this.context, - })); - this.harmonicity = new Multiply({ - context: this.context, - units: "positive", - value: options.harmonicity, - }); - this._vibrato = new LFO({ - frequency: options.vibratoRate, - context: this.context, - min: -50, - max: 50 - }); - // start the vibrato immediately - this._vibrato.start(); - this.vibratoRate = this._vibrato.frequency; - this._vibratoGain = new Gain({ - context: this.context, - units: "normalRange", - gain: options.vibratoAmount - }); - this.vibratoAmount = this._vibratoGain.gain; - this.frequency = new Signal({ - context: this.context, - units: "frequency", - value: 440 - }); - this.detune = new Signal({ - context: this.context, - units: "cents", - value: options.detune - }); - // control the two voices frequency - this.frequency.connect(this.voice0.frequency); - this.frequency.chain(this.harmonicity, this.voice1.frequency); - this._vibrato.connect(this._vibratoGain); - this._vibratoGain.fan(this.voice0.detune, this.voice1.detune); - this.detune.fan(this.voice0.detune, this.voice1.detune); - this.voice0.connect(this.output); - this.voice1.connect(this.output); - readOnly(this, ["voice0", "voice1", "frequency", "vibratoAmount", "vibratoRate"]); - } - getLevelAtTime(time) { - time = this.toSeconds(time); - return this.voice0.envelope.getValueAtTime(time) + this.voice1.envelope.getValueAtTime(time); - } - static getDefaults() { - return deepMerge(Monophonic.getDefaults(), { - vibratoAmount: 0.5, - vibratoRate: 5, - harmonicity: 1.5, - voice0: deepMerge(omitFromObject(MonoSynth.getDefaults(), Object.keys(Monophonic.getDefaults())), { - filterEnvelope: { - attack: 0.01, - decay: 0.0, - sustain: 1, - release: 0.5 - }, - envelope: { - attack: 0.01, - decay: 0.0, - sustain: 1, - release: 0.5 - } - }), - voice1: deepMerge(omitFromObject(MonoSynth.getDefaults(), Object.keys(Monophonic.getDefaults())), { - filterEnvelope: { - attack: 0.01, - decay: 0.0, - sustain: 1, - release: 0.5 - }, - envelope: { - attack: 0.01, - decay: 0.0, - sustain: 1, - release: 0.5 - } - }), - }); - } - /** - * Trigger the attack portion of the note - */ - _triggerEnvelopeAttack(time, velocity) { - // @ts-ignore - this.voice0._triggerEnvelopeAttack(time, velocity); - // @ts-ignore - this.voice1._triggerEnvelopeAttack(time, velocity); - } - /** - * Trigger the release portion of the note - */ - _triggerEnvelopeRelease(time) { - // @ts-ignore - this.voice0._triggerEnvelopeRelease(time); - // @ts-ignore - this.voice1._triggerEnvelopeRelease(time); - return this; - } - dispose() { - super.dispose(); - this.voice0.dispose(); - this.voice1.dispose(); - this.frequency.dispose(); - this.detune.dispose(); - this._vibrato.dispose(); - this.vibratoRate.dispose(); - this._vibratoGain.dispose(); - this.harmonicity.dispose(); - return this; - } -} - -/** - * FMSynth is composed of two Tone.Synths where one Tone.Synth modulates - * the frequency of a second Tone.Synth. A lot of spectral content - * can be explored using the modulationIndex parameter. Read more about - * frequency modulation synthesis on Sound On Sound: [Part 1](https://web.archive.org/web/20160403123704/http://www.soundonsound.com/sos/apr00/articles/synthsecrets.htm), [Part 2](https://web.archive.org/web/20160403115835/http://www.soundonsound.com/sos/may00/articles/synth.htm). - * - * @example - * const fmSynth = new Tone.FMSynth().toDestination(); - * fmSynth.triggerAttackRelease("C5", "4n"); - * - * @category Instrument - */ -class FMSynth extends ModulationSynth { - constructor() { - super(optionsFromArguments(FMSynth.getDefaults(), arguments)); - this.name = "FMSynth"; - const options = optionsFromArguments(FMSynth.getDefaults(), arguments); - this.modulationIndex = new Multiply({ - context: this.context, - value: options.modulationIndex, - }); - // control the two voices frequency - this.frequency.connect(this._carrier.frequency); - this.frequency.chain(this.harmonicity, this._modulator.frequency); - this.frequency.chain(this.modulationIndex, this._modulationNode); - this.detune.fan(this._carrier.detune, this._modulator.detune); - this._modulator.connect(this._modulationNode.gain); - this._modulationNode.connect(this._carrier.frequency); - this._carrier.connect(this.output); - } - static getDefaults() { - return Object.assign(ModulationSynth.getDefaults(), { - modulationIndex: 10, - }); - } - dispose() { - super.dispose(); - this.modulationIndex.dispose(); - return this; - } -} - -/** - * Inharmonic ratio of frequencies based on the Roland TR-808 - * Taken from https://ccrma.stanford.edu/papers/tr-808-cymbal-physically-informed-circuit-bendable-digital-model - */ -const inharmRatios = [1.0, 1.483, 1.932, 2.546, 2.630, 3.897]; -/** - * A highly inharmonic and spectrally complex source with a highpass filter - * and amplitude envelope which is good for making metallophone sounds. - * Based on CymbalSynth by [@polyrhythmatic](https://github.com/polyrhythmatic). - * Inspiration from [Sound on Sound](https://shorturl.at/rSZ12). - * @category Instrument - */ -class MetalSynth extends Monophonic { - constructor() { - super(optionsFromArguments(MetalSynth.getDefaults(), arguments)); - this.name = "MetalSynth"; - /** - * The array of FMOscillators - */ - this._oscillators = []; - /** - * The frequency multipliers - */ - this._freqMultipliers = []; - const options = optionsFromArguments(MetalSynth.getDefaults(), arguments); - this.detune = new Signal({ - context: this.context, - units: "cents", - value: options.detune, - }); - this.frequency = new Signal({ - context: this.context, - units: "frequency", - }); - this._amplitude = new Gain({ - context: this.context, - gain: 0, - }).connect(this.output); - this._highpass = new Filter({ - // Q: -3.0102999566398125, - Q: 0, - context: this.context, - type: "highpass", - }).connect(this._amplitude); - for (let i = 0; i < inharmRatios.length; i++) { - const osc = new FMOscillator({ - context: this.context, - harmonicity: options.harmonicity, - modulationIndex: options.modulationIndex, - modulationType: "square", - onstop: i === 0 ? () => this.onsilence(this) : noOp, - type: "square", - }); - osc.connect(this._highpass); - this._oscillators[i] = osc; - const mult = new Multiply({ - context: this.context, - value: inharmRatios[i], - }); - this._freqMultipliers[i] = mult; - this.frequency.chain(mult, osc.frequency); - this.detune.connect(osc.detune); - } - this._filterFreqScaler = new Scale({ - context: this.context, - max: 7000, - min: this.toFrequency(options.resonance), - }); - this.envelope = new Envelope({ - attack: options.envelope.attack, - attackCurve: "linear", - context: this.context, - decay: options.envelope.decay, - release: options.envelope.release, - sustain: 0, - }); - this.envelope.chain(this._filterFreqScaler, this._highpass.frequency); - this.envelope.connect(this._amplitude.gain); - // set the octaves - this._octaves = options.octaves; - this.octaves = options.octaves; - } - static getDefaults() { - return deepMerge(Monophonic.getDefaults(), { - envelope: Object.assign(omitFromObject(Envelope.getDefaults(), Object.keys(ToneAudioNode.getDefaults())), { - attack: 0.001, - decay: 1.4, - release: 0.2, - }), - harmonicity: 5.1, - modulationIndex: 32, - octaves: 1.5, - resonance: 4000, - }); - } - /** - * Trigger the attack. - * @param time When the attack should be triggered. - * @param velocity The velocity that the envelope should be triggered at. - */ - _triggerEnvelopeAttack(time, velocity = 1) { - this.envelope.triggerAttack(time, velocity); - this._oscillators.forEach(osc => osc.start(time)); - if (this.envelope.sustain === 0) { - this._oscillators.forEach(osc => { - osc.stop(time + this.toSeconds(this.envelope.attack) + this.toSeconds(this.envelope.decay)); - }); - } - return this; - } - /** - * Trigger the release of the envelope. - * @param time When the release should be triggered. - */ - _triggerEnvelopeRelease(time) { - this.envelope.triggerRelease(time); - this._oscillators.forEach(osc => osc.stop(time + this.toSeconds(this.envelope.release))); - return this; - } - getLevelAtTime(time) { - time = this.toSeconds(time); - return this.envelope.getValueAtTime(time); - } - /** - * The modulationIndex of the oscillators which make up the source. - * see [[FMOscillator.modulationIndex]] - * @min 1 - * @max 100 - */ - get modulationIndex() { - return this._oscillators[0].modulationIndex.value; - } - set modulationIndex(val) { - this._oscillators.forEach(osc => (osc.modulationIndex.value = val)); - } - /** - * The harmonicity of the oscillators which make up the source. - * see Tone.FMOscillator.harmonicity - * @min 0.1 - * @max 10 - */ - get harmonicity() { - return this._oscillators[0].harmonicity.value; - } - set harmonicity(val) { - this._oscillators.forEach(osc => (osc.harmonicity.value = val)); - } - /** - * The lower level of the highpass filter which is attached to the envelope. - * This value should be between [0, 7000] - * @min 0 - * @max 7000 - */ - get resonance() { - return this._filterFreqScaler.min; - } - set resonance(val) { - this._filterFreqScaler.min = this.toFrequency(val); - this.octaves = this._octaves; - } - /** - * The number of octaves above the "resonance" frequency - * that the filter ramps during the attack/decay envelope - * @min 0 - * @max 8 - */ - get octaves() { - return this._octaves; - } - set octaves(val) { - this._octaves = val; - this._filterFreqScaler.max = this._filterFreqScaler.min * Math.pow(2, val); - } - dispose() { - super.dispose(); - this._oscillators.forEach(osc => osc.dispose()); - this._freqMultipliers.forEach(freqMult => freqMult.dispose()); - this.frequency.dispose(); - this.detune.dispose(); - this._filterFreqScaler.dispose(); - this._amplitude.dispose(); - this.envelope.dispose(); - this._highpass.dispose(); - return this; - } -} - -/** - * Tone.NoiseSynth is composed of [[Noise]] through an [[AmplitudeEnvelope]]. - * ``` - * +-------+ +-------------------+ - * | Noise +>--> AmplitudeEnvelope +>--> Output - * +-------+ +-------------------+ - * ``` - * @example - * const noiseSynth = new Tone.NoiseSynth().toDestination(); - * noiseSynth.triggerAttackRelease("8n", 0.05); - * @category Instrument - */ -class NoiseSynth extends Instrument { - constructor() { - super(optionsFromArguments(NoiseSynth.getDefaults(), arguments)); - this.name = "NoiseSynth"; - const options = optionsFromArguments(NoiseSynth.getDefaults(), arguments); - this.noise = new Noise(Object.assign({ - context: this.context, - }, options.noise)); - this.envelope = new AmplitudeEnvelope(Object.assign({ - context: this.context, - }, options.envelope)); - // connect the noise to the output - this.noise.chain(this.envelope, this.output); - } - static getDefaults() { - return Object.assign(Instrument.getDefaults(), { - envelope: Object.assign(omitFromObject(Envelope.getDefaults(), Object.keys(ToneAudioNode.getDefaults())), { - decay: 0.1, - sustain: 0.0, - }), - noise: Object.assign(omitFromObject(Noise.getDefaults(), Object.keys(Source.getDefaults())), { - type: "white", - }), - }); - } - /** - * Start the attack portion of the envelopes. Unlike other - * instruments, Tone.NoiseSynth doesn't have a note. - * @example - * const noiseSynth = new Tone.NoiseSynth().toDestination(); - * noiseSynth.triggerAttack(); - */ - triggerAttack(time, velocity = 1) { - time = this.toSeconds(time); - // the envelopes - this.envelope.triggerAttack(time, velocity); - // start the noise - this.noise.start(time); - if (this.envelope.sustain === 0) { - this.noise.stop(time + this.toSeconds(this.envelope.attack) + this.toSeconds(this.envelope.decay)); - } - return this; - } - /** - * Start the release portion of the envelopes. - */ - triggerRelease(time) { - time = this.toSeconds(time); - this.envelope.triggerRelease(time); - this.noise.stop(time + this.toSeconds(this.envelope.release)); - return this; - } - sync() { - if (this._syncState()) { - this._syncMethod("triggerAttack", 0); - this._syncMethod("triggerRelease", 0); - } - return this; - } - triggerAttackRelease(duration, time, velocity = 1) { - time = this.toSeconds(time); - duration = this.toSeconds(duration); - this.triggerAttack(time, velocity); - this.triggerRelease(time + duration); - return this; - } - dispose() { - super.dispose(); - this.noise.dispose(); - this.envelope.dispose(); - return this; - } -} - -class ToneAudioWorklet extends ToneAudioNode { - constructor(options) { - super(options); - this.name = "ToneAudioWorklet"; - /** - * The constructor options for the node - */ - this.workletOptions = {}; - /** - * Callback which is invoked when there is an error in the processing - */ - this.onprocessorerror = noOp; - const blobUrl = URL.createObjectURL(new Blob([getWorkletGlobalScope()], { type: "text/javascript" })); - const name = this._audioWorkletName(); - this._dummyGain = this.context.createGain(); - this._dummyParam = this._dummyGain.gain; - // Register the processor - this.context.addAudioWorkletModule(blobUrl, name).then(() => { - // create the worklet when it's read - if (!this.disposed) { - this._worklet = this.context.createAudioWorkletNode(name, this.workletOptions); - this._worklet.onprocessorerror = this.onprocessorerror.bind(this); - this.onReady(this._worklet); - } - }); - } - dispose() { - super.dispose(); - this._dummyGain.disconnect(); - if (this._worklet) { - this._worklet.port.postMessage("dispose"); - this._worklet.disconnect(); - } - return this; - } -} - -/** - * Comb filters are basic building blocks for physical modeling. Read more - * about comb filters on [CCRMA's website](https://ccrma.stanford.edu/~jos/pasp/Feedback_Comb_Filters.html). - * - * This comb filter is implemented with the AudioWorkletNode which allows it to have feedback delays less than the - * Web Audio processing block of 128 samples. There is a polyfill for browsers that don't yet support the - * AudioWorkletNode, but it will add some latency and have slower performance than the AudioWorkletNode. - * @category Component - */ -class FeedbackCombFilter extends ToneAudioWorklet { - constructor() { - super(optionsFromArguments(FeedbackCombFilter.getDefaults(), arguments, ["delayTime", "resonance"])); - this.name = "FeedbackCombFilter"; - const options = optionsFromArguments(FeedbackCombFilter.getDefaults(), arguments, ["delayTime", "resonance"]); - this.input = new Gain({ context: this.context }); - this.output = new Gain({ context: this.context }); - this.delayTime = new Param({ - context: this.context, - value: options.delayTime, - units: "time", - minValue: 0, - maxValue: 1, - param: this._dummyParam, - swappable: true, - }); - this.resonance = new Param({ - context: this.context, - value: options.resonance, - units: "normalRange", - param: this._dummyParam, - swappable: true, - }); - readOnly(this, ["resonance", "delayTime"]); - } - _audioWorkletName() { - return workletName; - } - /** - * The default parameters - */ - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - delayTime: 0.1, - resonance: 0.5, - }); - } - onReady(node) { - connectSeries(this.input, node, this.output); - const delayTime = node.parameters.get("delayTime"); - this.delayTime.setParam(delayTime); - const feedback = node.parameters.get("feedback"); - this.resonance.setParam(feedback); - } - dispose() { - super.dispose(); - this.input.dispose(); - this.output.dispose(); - this.delayTime.dispose(); - this.resonance.dispose(); - return this; - } -} - -/** - * A one pole filter with 6db-per-octave rolloff. Either "highpass" or "lowpass". - * Note that changing the type or frequency may result in a discontinuity which - * can sound like a click or pop. - * References: - * * http://www.earlevel.com/main/2012/12/15/a-one-pole-filter/ - * * http://www.dspguide.com/ch19/2.htm - * * https://github.com/vitaliy-bobrov/js-rocks/blob/master/src/app/audio/effects/one-pole-filters.ts - * @category Component - */ -class OnePoleFilter extends ToneAudioNode { - constructor() { - super(optionsFromArguments(OnePoleFilter.getDefaults(), arguments, ["frequency", "type"])); - this.name = "OnePoleFilter"; - const options = optionsFromArguments(OnePoleFilter.getDefaults(), arguments, ["frequency", "type"]); - this._frequency = options.frequency; - this._type = options.type; - this.input = new Gain({ context: this.context }); - this.output = new Gain({ context: this.context }); - this._createFilter(); - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - frequency: 880, - type: "lowpass" - }); - } - /** - * Create a filter and dispose the old one - */ - _createFilter() { - const oldFilter = this._filter; - const freq = this.toFrequency(this._frequency); - const t = 1 / (2 * Math.PI * freq); - if (this._type === "lowpass") { - const a0 = 1 / (t * this.context.sampleRate); - const b1 = a0 - 1; - this._filter = this.context.createIIRFilter([a0, 0], [1, b1]); - } - else { - const b1 = 1 / (t * this.context.sampleRate) - 1; - this._filter = this.context.createIIRFilter([1, -1], [1, b1]); - } - this.input.chain(this._filter, this.output); - if (oldFilter) { - // dispose it on the next block - this.context.setTimeout(() => { - if (!this.disposed) { - this.input.disconnect(oldFilter); - oldFilter.disconnect(); - } - }, this.blockTime); - } - } - /** - * The frequency value. - */ - get frequency() { - return this._frequency; - } - set frequency(fq) { - this._frequency = fq; - this._createFilter(); - } - /** - * The OnePole Filter type, either "highpass" or "lowpass" - */ - get type() { - return this._type; - } - set type(t) { - this._type = t; - this._createFilter(); - } - /** - * Get the frequency response curve. This curve represents how the filter - * responses to frequencies between 20hz-20khz. - * @param len The number of values to return - * @return The frequency response curve between 20-20kHz - */ - getFrequencyResponse(len = 128) { - const freqValues = new Float32Array(len); - for (let i = 0; i < len; i++) { - const norm = Math.pow(i / len, 2); - const freq = norm * (20000 - 20) + 20; - freqValues[i] = freq; - } - const magValues = new Float32Array(len); - const phaseValues = new Float32Array(len); - this._filter.getFrequencyResponse(freqValues, magValues, phaseValues); - return magValues; - } - dispose() { - super.dispose(); - this.input.dispose(); - this.output.dispose(); - this._filter.disconnect(); - return this; - } -} - -/** - * A lowpass feedback comb filter. It is similar to - * [[FeedbackCombFilter]], but includes a lowpass filter. - * @category Component - */ -class LowpassCombFilter extends ToneAudioNode { - constructor() { - super(optionsFromArguments(LowpassCombFilter.getDefaults(), arguments, ["delayTime", "resonance", "dampening"])); - this.name = "LowpassCombFilter"; - const options = optionsFromArguments(LowpassCombFilter.getDefaults(), arguments, ["delayTime", "resonance", "dampening"]); - this._combFilter = this.output = new FeedbackCombFilter({ - context: this.context, - delayTime: options.delayTime, - resonance: options.resonance, - }); - this.delayTime = this._combFilter.delayTime; - this.resonance = this._combFilter.resonance; - this._lowpass = this.input = new OnePoleFilter({ - context: this.context, - frequency: options.dampening, - type: "lowpass", - }); - // connections - this._lowpass.connect(this._combFilter); - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - dampening: 3000, - delayTime: 0.1, - resonance: 0.5, - }); - } - /** - * The dampening control of the feedback - */ - get dampening() { - return this._lowpass.frequency; - } - set dampening(fq) { - this._lowpass.frequency = fq; - } - dispose() { - super.dispose(); - this._combFilter.dispose(); - this._lowpass.dispose(); - return this; - } -} - -/** - * Karplus-String string synthesis. - * @example - * const plucky = new Tone.PluckSynth().toDestination(); - * plucky.triggerAttack("C4", "+0.5"); - * plucky.triggerAttack("C3", "+1"); - * plucky.triggerAttack("C2", "+1.5"); - * plucky.triggerAttack("C1", "+2"); - * @category Instrument - */ -class PluckSynth extends Instrument { - constructor() { - super(optionsFromArguments(PluckSynth.getDefaults(), arguments)); - this.name = "PluckSynth"; - const options = optionsFromArguments(PluckSynth.getDefaults(), arguments); - this._noise = new Noise({ - context: this.context, - type: "pink" - }); - this.attackNoise = options.attackNoise; - this._lfcf = new LowpassCombFilter({ - context: this.context, - dampening: options.dampening, - resonance: options.resonance, - }); - this.resonance = options.resonance; - this.release = options.release; - this._noise.connect(this._lfcf); - this._lfcf.connect(this.output); - } - static getDefaults() { - return deepMerge(Instrument.getDefaults(), { - attackNoise: 1, - dampening: 4000, - resonance: 0.7, - release: 1, - }); - } - /** - * The dampening control. i.e. the lowpass filter frequency of the comb filter - * @min 0 - * @max 7000 - */ - get dampening() { - return this._lfcf.dampening; - } - set dampening(fq) { - this._lfcf.dampening = fq; - } - triggerAttack(note, time) { - const freq = this.toFrequency(note); - time = this.toSeconds(time); - const delayAmount = 1 / freq; - this._lfcf.delayTime.setValueAtTime(delayAmount, time); - this._noise.start(time); - this._noise.stop(time + delayAmount * this.attackNoise); - this._lfcf.resonance.cancelScheduledValues(time); - this._lfcf.resonance.setValueAtTime(this.resonance, time); - return this; - } - /** - * Ramp down the [[resonance]] to 0 over the duration of the release time. - */ - triggerRelease(time) { - this._lfcf.resonance.linearRampTo(0, this.release, time); - return this; - } - dispose() { - super.dispose(); - this._noise.dispose(); - this._lfcf.dispose(); - return this; - } -} - -/** - * PolySynth handles voice creation and allocation for any - * instruments passed in as the second paramter. PolySynth is - * not a synthesizer by itself, it merely manages voices of - * one of the other types of synths, allowing any of the - * monophonic synthesizers to be polyphonic. - * - * @example - * const synth = new Tone.PolySynth().toDestination(); - * // set the attributes across all the voices using 'set' - * synth.set({ detune: -1200 }); - * // play a chord - * synth.triggerAttackRelease(["C4", "E4", "A4"], 1); - * @category Instrument - */ -class PolySynth extends Instrument { - constructor() { - super(optionsFromArguments(PolySynth.getDefaults(), arguments, ["voice", "options"])); - this.name = "PolySynth"; - /** - * The voices which are not currently in use - */ - this._availableVoices = []; - /** - * The currently active voices - */ - this._activeVoices = []; - /** - * All of the allocated voices for this synth. - */ - this._voices = []; - /** - * The GC timeout. Held so that it could be cancelled when the node is disposed. - */ - this._gcTimeout = -1; - /** - * A moving average of the number of active voices - */ - this._averageActiveVoices = 0; - const options = optionsFromArguments(PolySynth.getDefaults(), arguments, ["voice", "options"]); - // check against the old API (pre 14.3.0) - assert(!isNumber(options.voice), "DEPRECATED: The polyphony count is no longer the first argument."); - const defaults = options.voice.getDefaults(); - this.options = Object.assign(defaults, options.options); - this.voice = options.voice; - this.maxPolyphony = options.maxPolyphony; - // create the first voice - this._dummyVoice = this._getNextAvailableVoice(); - // remove it from the voices list - const index = this._voices.indexOf(this._dummyVoice); - this._voices.splice(index, 1); - // kick off the GC interval - this._gcTimeout = this.context.setInterval(this._collectGarbage.bind(this), 1); - } - static getDefaults() { - return Object.assign(Instrument.getDefaults(), { - maxPolyphony: 32, - options: {}, - voice: Synth, - }); - } - /** - * The number of active voices. - */ - get activeVoices() { - return this._activeVoices.length; - } - /** - * Invoked when the source is done making sound, so that it can be - * readded to the pool of available voices - */ - _makeVoiceAvailable(voice) { - this._availableVoices.push(voice); - // remove the midi note from 'active voices' - const activeVoiceIndex = this._activeVoices.findIndex((e) => e.voice === voice); - this._activeVoices.splice(activeVoiceIndex, 1); - } - /** - * Get an available voice from the pool of available voices. - * If one is not available and the maxPolyphony limit is reached, - * steal a voice, otherwise return null. - */ - _getNextAvailableVoice() { - // if there are available voices, return the first one - if (this._availableVoices.length) { - return this._availableVoices.shift(); - } - else if (this._voices.length < this.maxPolyphony) { - // otherwise if there is still more maxPolyphony, make a new voice - const voice = new this.voice(Object.assign(this.options, { - context: this.context, - onsilence: this._makeVoiceAvailable.bind(this), - })); - voice.connect(this.output); - this._voices.push(voice); - return voice; - } - else { - warn("Max polyphony exceeded. Note dropped."); - } - } - /** - * Occasionally check if there are any allocated voices which can be cleaned up. - */ - _collectGarbage() { - this._averageActiveVoices = Math.max(this._averageActiveVoices * 0.95, this.activeVoices); - if (this._availableVoices.length && this._voices.length > Math.ceil(this._averageActiveVoices + 1)) { - // take off an available note - const firstAvail = this._availableVoices.shift(); - const index = this._voices.indexOf(firstAvail); - this._voices.splice(index, 1); - if (!this.context.isOffline) { - firstAvail.dispose(); - } - } - } - /** - * Internal method which triggers the attack - */ - _triggerAttack(notes, time, velocity) { - notes.forEach(note => { - const midiNote = new MidiClass(this.context, note).toMidi(); - const voice = this._getNextAvailableVoice(); - if (voice) { - voice.triggerAttack(note, time, velocity); - this._activeVoices.push({ - midi: midiNote, voice, released: false, - }); - this.log("triggerAttack", note, time); - } - }); - } - /** - * Internal method which triggers the release - */ - _triggerRelease(notes, time) { - notes.forEach(note => { - const midiNote = new MidiClass(this.context, note).toMidi(); - const event = this._activeVoices.find(({ midi, released }) => midi === midiNote && !released); - if (event) { - // trigger release on that note - event.voice.triggerRelease(time); - // mark it as released - event.released = true; - this.log("triggerRelease", note, time); - } - }); - } - /** - * Schedule the attack/release events. If the time is in the future, then it should set a timeout - * to wait for just-in-time scheduling - */ - _scheduleEvent(type, notes, time, velocity) { - assert(!this.disposed, "Synth was already disposed"); - // if the notes are greater than this amount of time in the future, they should be scheduled with setTimeout - if (time <= this.now()) { - // do it immediately - if (type === "attack") { - this._triggerAttack(notes, time, velocity); - } - else { - this._triggerRelease(notes, time); - } - } - else { - // schedule it to start in the future - this.context.setTimeout(() => { - this._scheduleEvent(type, notes, time, velocity); - }, time - this.now()); - } - } - /** - * Trigger the attack portion of the note - * @param notes The notes to play. Accepts a single Frequency or an array of frequencies. - * @param time The start time of the note. - * @param velocity The velocity of the note. - * @example - * const synth = new Tone.PolySynth(Tone.FMSynth).toDestination(); - * // trigger a chord immediately with a velocity of 0.2 - * synth.triggerAttack(["Ab3", "C4", "F5"], Tone.now(), 0.2); - */ - triggerAttack(notes, time, velocity) { - if (!Array.isArray(notes)) { - notes = [notes]; - } - const computedTime = this.toSeconds(time); - this._scheduleEvent("attack", notes, computedTime, velocity); - return this; - } - /** - * Trigger the release of the note. Unlike monophonic instruments, - * a note (or array of notes) needs to be passed in as the first argument. - * @param notes The notes to play. Accepts a single Frequency or an array of frequencies. - * @param time When the release will be triggered. - * @example - * @example - * const poly = new Tone.PolySynth(Tone.AMSynth).toDestination(); - * poly.triggerAttack(["Ab3", "C4", "F5"]); - * // trigger the release of the given notes. - * poly.triggerRelease(["Ab3", "C4"], "+1"); - * poly.triggerRelease("F5", "+3"); - */ - triggerRelease(notes, time) { - if (!Array.isArray(notes)) { - notes = [notes]; - } - const computedTime = this.toSeconds(time); - this._scheduleEvent("release", notes, computedTime); - return this; - } - /** - * Trigger the attack and release after the specified duration - * @param notes The notes to play. Accepts a single Frequency or an array of frequencies. - * @param duration the duration of the note - * @param time if no time is given, defaults to now - * @param velocity the velocity of the attack (0-1) - * @example - * const poly = new Tone.PolySynth(Tone.AMSynth).toDestination(); - * // can pass in an array of durations as well - * poly.triggerAttackRelease(["Eb3", "G4", "Bb4", "D5"], [4, 3, 2, 1]); - */ - triggerAttackRelease(notes, duration, time, velocity) { - const computedTime = this.toSeconds(time); - this.triggerAttack(notes, computedTime, velocity); - if (isArray(duration)) { - assert(isArray(notes), "If the duration is an array, the notes must also be an array"); - notes = notes; - for (let i = 0; i < notes.length; i++) { - const d = duration[Math.min(i, duration.length - 1)]; - const durationSeconds = this.toSeconds(d); - assert(durationSeconds > 0, "The duration must be greater than 0"); - this.triggerRelease(notes[i], computedTime + durationSeconds); - } - } - else { - const durationSeconds = this.toSeconds(duration); - assert(durationSeconds > 0, "The duration must be greater than 0"); - this.triggerRelease(notes, computedTime + durationSeconds); - } - return this; - } - sync() { - if (this._syncState()) { - this._syncMethod("triggerAttack", 1); - this._syncMethod("triggerRelease", 1); - } - return this; - } - /** - * Set a member/attribute of the voices - * @example - * const poly = new Tone.PolySynth().toDestination(); - * // set all of the voices using an options object for the synth type - * poly.set({ - * envelope: { - * attack: 0.25 - * } - * }); - * poly.triggerAttackRelease("Bb3", 0.2); - */ - set(options) { - // remove options which are controlled by the PolySynth - const sanitizedOptions = omitFromObject(options, ["onsilence", "context"]); - // store all of the options - this.options = deepMerge(this.options, sanitizedOptions); - this._voices.forEach(voice => voice.set(sanitizedOptions)); - this._dummyVoice.set(sanitizedOptions); - return this; - } - get() { - return this._dummyVoice.get(); - } - /** - * Trigger the release portion of all the currently active voices immediately. - * Useful for silencing the synth. - */ - releaseAll(time) { - const computedTime = this.toSeconds(time); - this._activeVoices.forEach(({ voice }) => { - voice.triggerRelease(computedTime); - }); - return this; - } - dispose() { - super.dispose(); - this._dummyVoice.dispose(); - this._voices.forEach(v => v.dispose()); - this._activeVoices = []; - this._availableVoices = []; - this.context.clearInterval(this._gcTimeout); - return this; - } -} - -/** - * ToneEvent abstracts away this.context.transport.schedule and provides a schedulable - * callback for a single or repeatable events along the timeline. - * - * @example - * const synth = new Tone.PolySynth().toDestination(); - * const chordEvent = new Tone.ToneEvent(((time, chord) => { - * // the chord as well as the exact time of the event - * // are passed in as arguments to the callback function - * synth.triggerAttackRelease(chord, 0.5, time); - * }), ["D4", "E4", "F4"]); - * // start the chord at the beginning of the transport timeline - * chordEvent.start(); - * // loop it every measure for 8 measures - * chordEvent.loop = 8; - * chordEvent.loopEnd = "1m"; - * @category Event - */ -class ToneEvent extends ToneWithContext { - constructor() { - super(optionsFromArguments(ToneEvent.getDefaults(), arguments, ["callback", "value"])); - this.name = "ToneEvent"; - /** - * Tracks the scheduled events - */ - this._state = new StateTimeline("stopped"); - /** - * A delay time from when the event is scheduled to start - */ - this._startOffset = 0; - const options = optionsFromArguments(ToneEvent.getDefaults(), arguments, ["callback", "value"]); - this._loop = options.loop; - this.callback = options.callback; - this.value = options.value; - this._loopStart = this.toTicks(options.loopStart); - this._loopEnd = this.toTicks(options.loopEnd); - this._playbackRate = options.playbackRate; - this._probability = options.probability; - this._humanize = options.humanize; - this.mute = options.mute; - this._playbackRate = options.playbackRate; - this._state.increasing = true; - // schedule the events for the first time - this._rescheduleEvents(); - } - static getDefaults() { - return Object.assign(ToneWithContext.getDefaults(), { - callback: noOp, - humanize: false, - loop: false, - loopEnd: "1m", - loopStart: 0, - mute: false, - playbackRate: 1, - probability: 1, - value: null, - }); - } - /** - * Reschedule all of the events along the timeline - * with the updated values. - * @param after Only reschedules events after the given time. - */ - _rescheduleEvents(after = -1) { - // if no argument is given, schedules all of the events - this._state.forEachFrom(after, event => { - let duration; - if (event.state === "started") { - if (event.id !== -1) { - this.context.transport.clear(event.id); - } - const startTick = event.time + Math.round(this.startOffset / this._playbackRate); - if (this._loop === true || isNumber(this._loop) && this._loop > 1) { - duration = Infinity; - if (isNumber(this._loop)) { - duration = (this._loop) * this._getLoopDuration(); - } - const nextEvent = this._state.getAfter(startTick); - if (nextEvent !== null) { - duration = Math.min(duration, nextEvent.time - startTick); - } - if (duration !== Infinity) { - // schedule a stop since it's finite duration - this._state.setStateAtTime("stopped", startTick + duration + 1, { id: -1 }); - duration = new TicksClass(this.context, duration); - } - const interval = new TicksClass(this.context, this._getLoopDuration()); - event.id = this.context.transport.scheduleRepeat(this._tick.bind(this), interval, new TicksClass(this.context, startTick), duration); - } - else { - event.id = this.context.transport.schedule(this._tick.bind(this), new TicksClass(this.context, startTick)); - } - } - }); - } - /** - * Returns the playback state of the note, either "started" or "stopped". - */ - get state() { - return this._state.getValueAtTime(this.context.transport.ticks); - } - /** - * The start from the scheduled start time. - */ - get startOffset() { - return this._startOffset; - } - set startOffset(offset) { - this._startOffset = offset; - } - /** - * The probability of the notes being triggered. - */ - get probability() { - return this._probability; - } - set probability(prob) { - this._probability = prob; - } - /** - * If set to true, will apply small random variation - * to the callback time. If the value is given as a time, it will randomize - * by that amount. - * @example - * const event = new Tone.ToneEvent(); - * event.humanize = true; - */ - get humanize() { - return this._humanize; - } - set humanize(variation) { - this._humanize = variation; - } - /** - * Start the note at the given time. - * @param time When the event should start. - */ - start(time) { - const ticks = this.toTicks(time); - if (this._state.getValueAtTime(ticks) === "stopped") { - this._state.add({ - id: -1, - state: "started", - time: ticks, - }); - this._rescheduleEvents(ticks); - } - return this; - } - /** - * Stop the Event at the given time. - * @param time When the event should stop. - */ - stop(time) { - this.cancel(time); - const ticks = this.toTicks(time); - if (this._state.getValueAtTime(ticks) === "started") { - this._state.setStateAtTime("stopped", ticks, { id: -1 }); - const previousEvent = this._state.getBefore(ticks); - let reschedulTime = ticks; - if (previousEvent !== null) { - reschedulTime = previousEvent.time; - } - this._rescheduleEvents(reschedulTime); - } - return this; - } - /** - * Cancel all scheduled events greater than or equal to the given time - * @param time The time after which events will be cancel. - */ - cancel(time) { - time = defaultArg(time, -Infinity); - const ticks = this.toTicks(time); - this._state.forEachFrom(ticks, event => { - this.context.transport.clear(event.id); - }); - this._state.cancel(ticks); - return this; - } - /** - * The callback function invoker. Also - * checks if the Event is done playing - * @param time The time of the event in seconds - */ - _tick(time) { - const ticks = this.context.transport.getTicksAtTime(time); - if (!this.mute && this._state.getValueAtTime(ticks) === "started") { - if (this.probability < 1 && Math.random() > this.probability) { - return; - } - if (this.humanize) { - let variation = 0.02; - if (!isBoolean(this.humanize)) { - variation = this.toSeconds(this.humanize); - } - time += (Math.random() * 2 - 1) * variation; - } - this.callback(time, this.value); - } - } - /** - * Get the duration of the loop. - */ - _getLoopDuration() { - return Math.round((this._loopEnd - this._loopStart) / this._playbackRate); - } - /** - * If the note should loop or not - * between ToneEvent.loopStart and - * ToneEvent.loopEnd. If set to true, - * the event will loop indefinitely, - * if set to a number greater than 1 - * it will play a specific number of - * times, if set to false, 0 or 1, the - * part will only play once. - */ - get loop() { - return this._loop; - } - set loop(loop) { - this._loop = loop; - this._rescheduleEvents(); - } - /** - * The playback rate of the note. Defaults to 1. - * @example - * const note = new Tone.ToneEvent(); - * note.loop = true; - * // repeat the note twice as fast - * note.playbackRate = 2; - */ - get playbackRate() { - return this._playbackRate; - } - set playbackRate(rate) { - this._playbackRate = rate; - this._rescheduleEvents(); - } - /** - * The loopEnd point is the time the event will loop - * if ToneEvent.loop is true. - */ - get loopEnd() { - return new TicksClass(this.context, this._loopEnd).toSeconds(); - } - set loopEnd(loopEnd) { - this._loopEnd = this.toTicks(loopEnd); - if (this._loop) { - this._rescheduleEvents(); - } - } - /** - * The time when the loop should start. - */ - get loopStart() { - return new TicksClass(this.context, this._loopStart).toSeconds(); - } - set loopStart(loopStart) { - this._loopStart = this.toTicks(loopStart); - if (this._loop) { - this._rescheduleEvents(); - } - } - /** - * The current progress of the loop interval. - * Returns 0 if the event is not started yet or - * it is not set to loop. - */ - get progress() { - if (this._loop) { - const ticks = this.context.transport.ticks; - const lastEvent = this._state.get(ticks); - if (lastEvent !== null && lastEvent.state === "started") { - const loopDuration = this._getLoopDuration(); - const progress = (ticks - lastEvent.time) % loopDuration; - return progress / loopDuration; - } - else { - return 0; - } - } - else { - return 0; - } - } - dispose() { - super.dispose(); - this.cancel(); - this._state.dispose(); - return this; - } -} - -/** - * Loop creates a looped callback at the - * specified interval. The callback can be - * started, stopped and scheduled along - * the Transport's timeline. - * @example - * const loop = new Tone.Loop((time) => { - * // triggered every eighth note. - * console.log(time); - * }, "8n").start(0); - * Tone.Transport.start(); - * @category Event - */ -class Loop extends ToneWithContext { - constructor() { - super(optionsFromArguments(Loop.getDefaults(), arguments, ["callback", "interval"])); - this.name = "Loop"; - const options = optionsFromArguments(Loop.getDefaults(), arguments, ["callback", "interval"]); - this._event = new ToneEvent({ - context: this.context, - callback: this._tick.bind(this), - loop: true, - loopEnd: options.interval, - playbackRate: options.playbackRate, - probability: options.probability - }); - this.callback = options.callback; - // set the iterations - this.iterations = options.iterations; - } - static getDefaults() { - return Object.assign(ToneWithContext.getDefaults(), { - interval: "4n", - callback: noOp, - playbackRate: 1, - iterations: Infinity, - probability: 1, - mute: false, - humanize: false - }); - } - /** - * Start the loop at the specified time along the Transport's timeline. - * @param time When to start the Loop. - */ - start(time) { - this._event.start(time); - return this; - } - /** - * Stop the loop at the given time. - * @param time When to stop the Loop. - */ - stop(time) { - this._event.stop(time); - return this; - } - /** - * Cancel all scheduled events greater than or equal to the given time - * @param time The time after which events will be cancel. - */ - cancel(time) { - this._event.cancel(time); - return this; - } - /** - * Internal function called when the notes should be called - * @param time The time the event occurs - */ - _tick(time) { - this.callback(time); - } - /** - * The state of the Loop, either started or stopped. - */ - get state() { - return this._event.state; - } - /** - * The progress of the loop as a value between 0-1. 0, when the loop is stopped or done iterating. - */ - get progress() { - return this._event.progress; - } - /** - * The time between successive callbacks. - * @example - * const loop = new Tone.Loop(); - * loop.interval = "8n"; // loop every 8n - */ - get interval() { - return this._event.loopEnd; - } - set interval(interval) { - this._event.loopEnd = interval; - } - /** - * The playback rate of the loop. The normal playback rate is 1 (no change). - * A `playbackRate` of 2 would be twice as fast. - */ - get playbackRate() { - return this._event.playbackRate; - } - set playbackRate(rate) { - this._event.playbackRate = rate; - } - /** - * Random variation +/-0.01s to the scheduled time. - * Or give it a time value which it will randomize by. - */ - get humanize() { - return this._event.humanize; - } - set humanize(variation) { - this._event.humanize = variation; - } - /** - * The probably of the callback being invoked. - */ - get probability() { - return this._event.probability; - } - set probability(prob) { - this._event.probability = prob; - } - /** - * Muting the Loop means that no callbacks are invoked. - */ - get mute() { - return this._event.mute; - } - set mute(mute) { - this._event.mute = mute; - } - /** - * The number of iterations of the loop. The default value is `Infinity` (loop forever). - */ - get iterations() { - if (this._event.loop === true) { - return Infinity; - } - else { - return this._event.loop; - } - } - set iterations(iters) { - if (iters === Infinity) { - this._event.loop = true; - } - else { - this._event.loop = iters; - } - } - dispose() { - super.dispose(); - this._event.dispose(); - return this; - } -} - -/** - * Part is a collection ToneEvents which can be started/stopped and looped as a single unit. - * - * @example - * const synth = new Tone.Synth().toDestination(); - * const part = new Tone.Part(((time, note) => { - * // the notes given as the second element in the array - * // will be passed in as the second argument - * synth.triggerAttackRelease(note, "8n", time); - * }), [[0, "C2"], ["0:2", "C3"], ["0:3:2", "G2"]]); - * Tone.Transport.start(); - * @example - * const synth = new Tone.Synth().toDestination(); - * // use an array of objects as long as the object has a "time" attribute - * const part = new Tone.Part(((time, value) => { - * // the value is an object which contains both the note and the velocity - * synth.triggerAttackRelease(value.note, "8n", time, value.velocity); - * }), [{ time: 0, note: "C3", velocity: 0.9 }, - * { time: "0:2", note: "C4", velocity: 0.5 } - * ]).start(0); - * Tone.Transport.start(); - * @category Event - */ -class Part extends ToneEvent { - constructor() { - super(optionsFromArguments(Part.getDefaults(), arguments, ["callback", "events"])); - this.name = "Part"; - /** - * Tracks the scheduled events - */ - this._state = new StateTimeline("stopped"); - /** - * The events that belong to this part - */ - this._events = new Set(); - const options = optionsFromArguments(Part.getDefaults(), arguments, ["callback", "events"]); - // make sure things are assigned in the right order - this._state.increasing = true; - // add the events - options.events.forEach(event => { - if (isArray(event)) { - this.add(event[0], event[1]); - } - else { - this.add(event); - } - }); - } - static getDefaults() { - return Object.assign(ToneEvent.getDefaults(), { - events: [], - }); - } - /** - * Start the part at the given time. - * @param time When to start the part. - * @param offset The offset from the start of the part to begin playing at. - */ - start(time, offset) { - const ticks = this.toTicks(time); - if (this._state.getValueAtTime(ticks) !== "started") { - offset = defaultArg(offset, this._loop ? this._loopStart : 0); - if (this._loop) { - offset = defaultArg(offset, this._loopStart); - } - else { - offset = defaultArg(offset, 0); - } - const computedOffset = this.toTicks(offset); - this._state.add({ - id: -1, - offset: computedOffset, - state: "started", - time: ticks, - }); - this._forEach(event => { - this._startNote(event, ticks, computedOffset); - }); - } - return this; - } - /** - * Start the event in the given event at the correct time given - * the ticks and offset and looping. - * @param event - * @param ticks - * @param offset - */ - _startNote(event, ticks, offset) { - ticks -= offset; - if (this._loop) { - if (event.startOffset >= this._loopStart && event.startOffset < this._loopEnd) { - if (event.startOffset < offset) { - // start it on the next loop - ticks += this._getLoopDuration(); - } - event.start(new TicksClass(this.context, ticks)); - } - else if (event.startOffset < this._loopStart && event.startOffset >= offset) { - event.loop = false; - event.start(new TicksClass(this.context, ticks)); - } - } - else if (event.startOffset >= offset) { - event.start(new TicksClass(this.context, ticks)); - } - } - get startOffset() { - return this._startOffset; - } - set startOffset(offset) { - this._startOffset = offset; - this._forEach(event => { - event.startOffset += this._startOffset; - }); - } - /** - * Stop the part at the given time. - * @param time When to stop the part. - */ - stop(time) { - const ticks = this.toTicks(time); - this._state.cancel(ticks); - this._state.setStateAtTime("stopped", ticks); - this._forEach(event => { - event.stop(time); - }); - return this; - } - /** - * Get/Set an Event's value at the given time. - * If a value is passed in and no event exists at - * the given time, one will be created with that value. - * If two events are at the same time, the first one will - * be returned. - * @example - * const part = new Tone.Part(); - * part.at("1m"); // returns the part at the first measure - * part.at("2m", "C2"); // set the value at "2m" to C2. - * // if an event didn't exist at that time, it will be created. - * @param time The time of the event to get or set. - * @param value If a value is passed in, the value of the event at the given time will be set to it. - */ - at(time, value) { - const timeInTicks = new TransportTimeClass(this.context, time).toTicks(); - const tickTime = new TicksClass(this.context, 1).toSeconds(); - const iterator = this._events.values(); - let result = iterator.next(); - while (!result.done) { - const event = result.value; - if (Math.abs(timeInTicks - event.startOffset) < tickTime) { - if (isDefined(value)) { - event.value = value; - } - return event; - } - result = iterator.next(); - } - // if there was no event at that time, create one - if (isDefined(value)) { - this.add(time, value); - // return the new event - return this.at(time); - } - else { - return null; - } - } - add(time, value) { - // extract the parameters - if (time instanceof Object && Reflect.has(time, "time")) { - value = time; - time = value.time; - } - const ticks = this.toTicks(time); - let event; - if (value instanceof ToneEvent) { - event = value; - event.callback = this._tick.bind(this); - } - else { - event = new ToneEvent({ - callback: this._tick.bind(this), - context: this.context, - value, - }); - } - // the start offset - event.startOffset = ticks; - // initialize the values - event.set({ - humanize: this.humanize, - loop: this.loop, - loopEnd: this.loopEnd, - loopStart: this.loopStart, - playbackRate: this.playbackRate, - probability: this.probability, - }); - this._events.add(event); - // start the note if it should be played right now - this._restartEvent(event); - return this; - } - /** - * Restart the given event - */ - _restartEvent(event) { - this._state.forEach((stateEvent) => { - if (stateEvent.state === "started") { - this._startNote(event, stateEvent.time, stateEvent.offset); - } - else { - // stop the note - event.stop(new TicksClass(this.context, stateEvent.time)); - } - }); - } - remove(time, value) { - // extract the parameters - if (isObject(time) && time.hasOwnProperty("time")) { - value = time; - time = value.time; - } - time = this.toTicks(time); - this._events.forEach(event => { - if (event.startOffset === time) { - if (isUndef(value) || (isDefined(value) && event.value === value)) { - this._events.delete(event); - event.dispose(); - } - } - }); - return this; - } - /** - * Remove all of the notes from the group. - */ - clear() { - this._forEach(event => event.dispose()); - this._events.clear(); - return this; - } - /** - * Cancel scheduled state change events: i.e. "start" and "stop". - * @param after The time after which to cancel the scheduled events. - */ - cancel(after) { - this._forEach(event => event.cancel(after)); - this._state.cancel(this.toTicks(after)); - return this; - } - /** - * Iterate over all of the events - */ - _forEach(callback) { - if (this._events) { - this._events.forEach(event => { - if (event instanceof Part) { - event._forEach(callback); - } - else { - callback(event); - } - }); - } - return this; - } - /** - * Set the attribute of all of the events - * @param attr the attribute to set - * @param value The value to set it to - */ - _setAll(attr, value) { - this._forEach(event => { - event[attr] = value; - }); - } - /** - * Internal tick method - * @param time The time of the event in seconds - */ - _tick(time, value) { - if (!this.mute) { - this.callback(time, value); - } - } - /** - * Determine if the event should be currently looping - * given the loop boundries of this Part. - * @param event The event to test - */ - _testLoopBoundries(event) { - if (this._loop && (event.startOffset < this._loopStart || event.startOffset >= this._loopEnd)) { - event.cancel(0); - } - else if (event.state === "stopped") { - // reschedule it if it's stopped - this._restartEvent(event); - } - } - get probability() { - return this._probability; - } - set probability(prob) { - this._probability = prob; - this._setAll("probability", prob); - } - get humanize() { - return this._humanize; - } - set humanize(variation) { - this._humanize = variation; - this._setAll("humanize", variation); - } - /** - * If the part should loop or not - * between Part.loopStart and - * Part.loopEnd. If set to true, - * the part will loop indefinitely, - * if set to a number greater than 1 - * it will play a specific number of - * times, if set to false, 0 or 1, the - * part will only play once. - * @example - * const part = new Tone.Part(); - * // loop the part 8 times - * part.loop = 8; - */ - get loop() { - return this._loop; - } - set loop(loop) { - this._loop = loop; - this._forEach(event => { - event.loopStart = this.loopStart; - event.loopEnd = this.loopEnd; - event.loop = loop; - this._testLoopBoundries(event); - }); - } - /** - * The loopEnd point determines when it will - * loop if Part.loop is true. - */ - get loopEnd() { - return new TicksClass(this.context, this._loopEnd).toSeconds(); - } - set loopEnd(loopEnd) { - this._loopEnd = this.toTicks(loopEnd); - if (this._loop) { - this._forEach(event => { - event.loopEnd = loopEnd; - this._testLoopBoundries(event); - }); - } - } - /** - * The loopStart point determines when it will - * loop if Part.loop is true. - */ - get loopStart() { - return new TicksClass(this.context, this._loopStart).toSeconds(); - } - set loopStart(loopStart) { - this._loopStart = this.toTicks(loopStart); - if (this._loop) { - this._forEach(event => { - event.loopStart = this.loopStart; - this._testLoopBoundries(event); - }); - } - } - /** - * The playback rate of the part - */ - get playbackRate() { - return this._playbackRate; - } - set playbackRate(rate) { - this._playbackRate = rate; - this._setAll("playbackRate", rate); - } - /** - * The number of scheduled notes in the part. - */ - get length() { - return this._events.size; - } - dispose() { - super.dispose(); - this.clear(); - return this; - } -} - -/** - * Start at the first value and go up to the last - */ -function* upPatternGen(values) { - let index = 0; - while (index < values.length) { - index = clampToArraySize(index, values); - yield values[index]; - index++; - } -} -/** - * Start at the last value and go down to 0 - */ -function* downPatternGen(values) { - let index = values.length - 1; - while (index >= 0) { - index = clampToArraySize(index, values); - yield values[index]; - index--; - } -} -/** - * Infinitely yield the generator - */ -function* infiniteGen(values, gen) { - while (true) { - yield* gen(values); - } -} -/** - * Make sure that the index is in the given range - */ -function clampToArraySize(index, values) { - return clamp(index, 0, values.length - 1); -} -/** - * Alternate between two generators - */ -function* alternatingGenerator(values, directionUp) { - let index = directionUp ? 0 : values.length - 1; - while (true) { - index = clampToArraySize(index, values); - yield values[index]; - if (directionUp) { - index++; - if (index >= values.length - 1) { - directionUp = false; - } - } - else { - index--; - if (index <= 0) { - directionUp = true; - } - } - } -} -/** - * Starting from the bottom move up 2, down 1 - */ -function* jumpUp(values) { - let index = 0; - let stepIndex = 0; - while (index < values.length) { - index = clampToArraySize(index, values); - yield values[index]; - stepIndex++; - index += (stepIndex % 2 ? 2 : -1); - } -} -/** - * Starting from the top move down 2, up 1 - */ -function* jumpDown(values) { - let index = values.length - 1; - let stepIndex = 0; - while (index >= 0) { - index = clampToArraySize(index, values); - yield values[index]; - stepIndex++; - index += (stepIndex % 2 ? -2 : 1); - } -} -/** - * Choose a random index each time - */ -function* randomGen(values) { - while (true) { - const randomIndex = Math.floor(Math.random() * values.length); - yield values[randomIndex]; - } -} -/** - * Randomly go through all of the values once before choosing a new random order - */ -function* randomOnce(values) { - // create an array of indices - const copy = []; - for (let i = 0; i < values.length; i++) { - copy.push(i); - } - while (copy.length > 0) { - // random choose an index, and then remove it so it's not chosen again - const randVal = copy.splice(Math.floor(copy.length * Math.random()), 1); - const index = clampToArraySize(randVal[0], values); - yield values[index]; - } -} -/** - * Randomly choose to walk up or down 1 index in the values array - */ -function* randomWalk(values) { - // randomly choose a starting index in the values array - let index = Math.floor(Math.random() * values.length); - while (true) { - if (index === 0) { - index++; // at bottom of array, so force upward step - } - else if (index === values.length - 1) { - index--; // at top of array, so force downward step - } - else if (Math.random() < 0.5) { // else choose random downward or upward step - index--; - } - else { - index++; - } - yield values[index]; - } -} -/** - * PatternGenerator returns a generator which will iterate over the given array - * of values and yield the items according to the passed in pattern - * @param values An array of values to iterate over - * @param pattern The name of the pattern use when iterating over - * @param index Where to start in the offset of the values array - */ -function* PatternGenerator(values, pattern = "up", index = 0) { - // safeguards - assert(values.length > 0, "The array must have more than one value in it"); - switch (pattern) { - case "up": - yield* infiniteGen(values, upPatternGen); - case "down": - yield* infiniteGen(values, downPatternGen); - case "upDown": - yield* alternatingGenerator(values, true); - case "downUp": - yield* alternatingGenerator(values, false); - case "alternateUp": - yield* infiniteGen(values, jumpUp); - case "alternateDown": - yield* infiniteGen(values, jumpDown); - case "random": - yield* randomGen(values); - case "randomOnce": - yield* infiniteGen(values, randomOnce); - case "randomWalk": - yield* randomWalk(values); - } -} - -/** - * Pattern arpeggiates between the given notes - * in a number of patterns. - * @example - * const pattern = new Tone.Pattern((time, note) => { - * // the order of the notes passed in depends on the pattern - * }, ["C2", "D4", "E5", "A6"], "upDown"); - * @category Event - */ -class Pattern extends Loop { - constructor() { - super(optionsFromArguments(Pattern.getDefaults(), arguments, ["callback", "values", "pattern"])); - this.name = "Pattern"; - const options = optionsFromArguments(Pattern.getDefaults(), arguments, ["callback", "values", "pattern"]); - this.callback = options.callback; - this._values = options.values; - this._pattern = PatternGenerator(options.values, options.pattern); - this._type = options.pattern; - } - static getDefaults() { - return Object.assign(Loop.getDefaults(), { - pattern: "up", - values: [], - callback: noOp, - }); - } - /** - * Internal function called when the notes should be called - */ - _tick(time) { - const value = this._pattern.next(); - this._value = value.value; - this.callback(time, this._value); - } - /** - * The array of events. - */ - get values() { - return this._values; - } - set values(val) { - this._values = val; - // reset the pattern - this.pattern = this._type; - } - /** - * The current value of the pattern. - */ - get value() { - return this._value; - } - /** - * The pattern type. See Tone.CtrlPattern for the full list of patterns. - */ - get pattern() { - return this._type; - } - set pattern(pattern) { - this._type = pattern; - this._pattern = PatternGenerator(this._values, this._type); - } -} - -/** - * A sequence is an alternate notation of a part. Instead - * of passing in an array of [time, event] pairs, pass - * in an array of events which will be spaced at the - * given subdivision. Sub-arrays will subdivide that beat - * by the number of items are in the array. - * Sequence notation inspiration from [Tidal](http://yaxu.org/tidal/) - * @example - * const synth = new Tone.Synth().toDestination(); - * const seq = new Tone.Sequence((time, note) => { - * synth.triggerAttackRelease(note, 0.1, time); - * // subdivisions are given as subarrays - * }, ["C4", ["E4", "D4", "E4"], "G4", ["A4", "G4"]]).start(0); - * Tone.Transport.start(); - * @category Event - */ -class Sequence extends ToneEvent { - constructor() { - super(optionsFromArguments(Sequence.getDefaults(), arguments, ["callback", "events", "subdivision"])); - this.name = "Sequence"; - /** - * The object responsible for scheduling all of the events - */ - this._part = new Part({ - callback: this._seqCallback.bind(this), - context: this.context, - }); - /** - * private reference to all of the sequence proxies - */ - this._events = []; - /** - * The proxied array - */ - this._eventsArray = []; - const options = optionsFromArguments(Sequence.getDefaults(), arguments, ["callback", "events", "subdivision"]); - this._subdivision = this.toTicks(options.subdivision); - this.events = options.events; - // set all of the values - this.loop = options.loop; - this.loopStart = options.loopStart; - this.loopEnd = options.loopEnd; - this.playbackRate = options.playbackRate; - this.probability = options.probability; - this.humanize = options.humanize; - this.mute = options.mute; - this.playbackRate = options.playbackRate; - } - static getDefaults() { - return Object.assign(omitFromObject(ToneEvent.getDefaults(), ["value"]), { - events: [], - loop: true, - loopEnd: 0, - loopStart: 0, - subdivision: "8n", - }); - } - /** - * The internal callback for when an event is invoked - */ - _seqCallback(time, value) { - if (value !== null) { - this.callback(time, value); - } - } - /** - * The sequence - */ - get events() { - return this._events; - } - set events(s) { - this.clear(); - this._eventsArray = s; - this._events = this._createSequence(this._eventsArray); - this._eventsUpdated(); - } - /** - * Start the part at the given time. - * @param time When to start the part. - * @param offset The offset index to start at - */ - start(time, offset) { - this._part.start(time, offset ? this._indexTime(offset) : offset); - return this; - } - /** - * Stop the part at the given time. - * @param time When to stop the part. - */ - stop(time) { - this._part.stop(time); - return this; - } - /** - * The subdivision of the sequence. This can only be - * set in the constructor. The subdivision is the - * interval between successive steps. - */ - get subdivision() { - return new TicksClass(this.context, this._subdivision).toSeconds(); - } - /** - * Create a sequence proxy which can be monitored to create subsequences - */ - _createSequence(array) { - return new Proxy(array, { - get: (target, property) => { - // property is index in this case - return target[property]; - }, - set: (target, property, value) => { - if (isString(property) && isFinite(parseInt(property, 10))) { - if (isArray(value)) { - target[property] = this._createSequence(value); - } - else { - target[property] = value; - } - } - else { - target[property] = value; - } - this._eventsUpdated(); - // return true to accept the changes - return true; - }, - }); - } - /** - * When the sequence has changed, all of the events need to be recreated - */ - _eventsUpdated() { - this._part.clear(); - this._rescheduleSequence(this._eventsArray, this._subdivision, this.startOffset); - // update the loopEnd - this.loopEnd = this.loopEnd; - } - /** - * reschedule all of the events that need to be rescheduled - */ - _rescheduleSequence(sequence, subdivision, startOffset) { - sequence.forEach((value, index) => { - const eventOffset = index * (subdivision) + startOffset; - if (isArray(value)) { - this._rescheduleSequence(value, subdivision / value.length, eventOffset); - } - else { - const startTime = new TicksClass(this.context, eventOffset, "i").toSeconds(); - this._part.add(startTime, value); - } - }); - } - /** - * Get the time of the index given the Sequence's subdivision - * @param index - * @return The time of that index - */ - _indexTime(index) { - return new TicksClass(this.context, index * (this._subdivision) + this.startOffset).toSeconds(); - } - /** - * Clear all of the events - */ - clear() { - this._part.clear(); - return this; - } - dispose() { - super.dispose(); - this._part.dispose(); - return this; - } - //------------------------------------- - // PROXY CALLS - //------------------------------------- - get loop() { - return this._part.loop; - } - set loop(l) { - this._part.loop = l; - } - /** - * The index at which the sequence should start looping - */ - get loopStart() { - return this._loopStart; - } - set loopStart(index) { - this._loopStart = index; - this._part.loopStart = this._indexTime(index); - } - /** - * The index at which the sequence should end looping - */ - get loopEnd() { - return this._loopEnd; - } - set loopEnd(index) { - this._loopEnd = index; - if (index === 0) { - this._part.loopEnd = this._indexTime(this._eventsArray.length); - } - else { - this._part.loopEnd = this._indexTime(index); - } - } - get startOffset() { - return this._part.startOffset; - } - set startOffset(start) { - this._part.startOffset = start; - } - get playbackRate() { - return this._part.playbackRate; - } - set playbackRate(rate) { - this._part.playbackRate = rate; - } - get probability() { - return this._part.probability; - } - set probability(prob) { - this._part.probability = prob; - } - get progress() { - return this._part.progress; - } - get humanize() { - return this._part.humanize; - } - set humanize(variation) { - this._part.humanize = variation; - } - /** - * The number of scheduled events - */ - get length() { - return this._part.length; - } -} - -/** - * Tone.Crossfade provides equal power fading between two inputs. - * More on crossfading technique [here](https://en.wikipedia.org/wiki/Fade_(audio_engineering)#Crossfading). - * ``` - * +---------+ - * +> input a +>--+ - * +-----------+ +---------------------+ | | | - * | 1s signal +>--> stereoPannerNode L +>----> gain | | - * +-----------+ | | +---------+ | - * +-> pan R +>-+ | +--------+ - * | +---------------------+ | +---> output +> - * +------+ | | +---------+ | +--------+ - * | fade +>----+ | +> input b +>--+ - * +------+ | | | - * +--> gain | - * +---------+ - * ``` - * @example - * const crossFade = new Tone.CrossFade().toDestination(); - * // connect two inputs Tone.to a/b - * const inputA = new Tone.Oscillator(440, "square").connect(crossFade.a).start(); - * const inputB = new Tone.Oscillator(440, "sine").connect(crossFade.b).start(); - * // use the fade to control the mix between the two - * crossFade.fade.value = 0.5; - * @category Component - */ -class CrossFade extends ToneAudioNode { - constructor() { - super(Object.assign(optionsFromArguments(CrossFade.getDefaults(), arguments, ["fade"]))); - this.name = "CrossFade"; - /** - * The crossfading is done by a StereoPannerNode - */ - this._panner = this.context.createStereoPanner(); - /** - * Split the output of the panner node into two values used to control the gains. - */ - this._split = this.context.createChannelSplitter(2); - /** - * Convert the fade value into an audio range value so it can be connected - * to the panner.pan AudioParam - */ - this._g2a = new GainToAudio({ context: this.context }); - /** - * The input which is at full level when fade = 0 - */ - this.a = new Gain({ - context: this.context, - gain: 0, - }); - /** - * The input which is at full level when fade = 1 - */ - this.b = new Gain({ - context: this.context, - gain: 0, - }); - /** - * The output is a mix between `a` and `b` at the ratio of `fade` - */ - this.output = new Gain({ context: this.context }); - this._internalChannels = [this.a, this.b]; - const options = optionsFromArguments(CrossFade.getDefaults(), arguments, ["fade"]); - this.fade = new Signal({ - context: this.context, - units: "normalRange", - value: options.fade, - }); - readOnly(this, "fade"); - this.context.getConstant(1).connect(this._panner); - this._panner.connect(this._split); - // this is necessary for standardized-audio-context - // doesn't make any difference for the native AudioContext - // https://github.com/chrisguttandin/standardized-audio-context/issues/647 - this._panner.channelCount = 1; - this._panner.channelCountMode = "explicit"; - connect(this._split, this.a.gain, 0); - connect(this._split, this.b.gain, 1); - this.fade.chain(this._g2a, this._panner.pan); - this.a.connect(this.output); - this.b.connect(this.output); - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - fade: 0.5, - }); - } - dispose() { - super.dispose(); - this.a.dispose(); - this.b.dispose(); - this.output.dispose(); - this.fade.dispose(); - this._g2a.dispose(); - this._panner.disconnect(); - this._split.disconnect(); - return this; - } -} - -/** - * Effect is the base class for effects. Connect the effect between - * the effectSend and effectReturn GainNodes, then control the amount of - * effect which goes to the output using the wet control. - */ -class Effect extends ToneAudioNode { - constructor(options) { - super(options); - this.name = "Effect"; - /** - * the drywet knob to control the amount of effect - */ - this._dryWet = new CrossFade({ context: this.context }); - /** - * The wet control is how much of the effected - * will pass through to the output. 1 = 100% effected - * signal, 0 = 100% dry signal. - */ - this.wet = this._dryWet.fade; - /** - * connect the effectSend to the input of hte effect - */ - this.effectSend = new Gain({ context: this.context }); - /** - * connect the output of the effect to the effectReturn - */ - this.effectReturn = new Gain({ context: this.context }); - /** - * The effect input node - */ - this.input = new Gain({ context: this.context }); - /** - * The effect output - */ - this.output = this._dryWet; - // connections - this.input.fan(this._dryWet.a, this.effectSend); - this.effectReturn.connect(this._dryWet.b); - this.wet.setValueAtTime(options.wet, 0); - this._internalChannels = [this.effectReturn, this.effectSend]; - readOnly(this, "wet"); - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - wet: 1, - }); - } - /** - * chains the effect in between the effectSend and effectReturn - */ - connectEffect(effect) { - // add it to the internal channels - this._internalChannels.push(effect); - this.effectSend.chain(effect, this.effectReturn); - return this; - } - dispose() { - super.dispose(); - this._dryWet.dispose(); - this.effectSend.dispose(); - this.effectReturn.dispose(); - this.wet.dispose(); - return this; - } -} - -/** - * Base class for LFO-based effects. - */ -class LFOEffect extends Effect { - constructor(options) { - super(options); - this.name = "LFOEffect"; - this._lfo = new LFO({ - context: this.context, - frequency: options.frequency, - amplitude: options.depth, - }); - this.depth = this._lfo.amplitude; - this.frequency = this._lfo.frequency; - this.type = options.type; - readOnly(this, ["frequency", "depth"]); - } - static getDefaults() { - return Object.assign(Effect.getDefaults(), { - frequency: 1, - type: "sine", - depth: 1, - }); - } - /** - * Start the effect. - */ - start(time) { - this._lfo.start(time); - return this; - } - /** - * Stop the lfo - */ - stop(time) { - this._lfo.stop(time); - return this; - } - /** - * Sync the filter to the transport. See [[LFO.sync]] - */ - sync() { - this._lfo.sync(); - return this; - } - /** - * Unsync the filter from the transport. - */ - unsync() { - this._lfo.unsync(); - return this; - } - /** - * The type of the LFO's oscillator: See [[Oscillator.type]] - * @example - * const autoFilter = new Tone.AutoFilter().start().toDestination(); - * const noise = new Tone.Noise().start().connect(autoFilter); - * autoFilter.type = "square"; - */ - get type() { - return this._lfo.type; - } - set type(type) { - this._lfo.type = type; - } - dispose() { - super.dispose(); - this._lfo.dispose(); - this.frequency.dispose(); - this.depth.dispose(); - return this; - } -} - -/** - * AutoFilter is a Tone.Filter with a Tone.LFO connected to the filter cutoff frequency. - * Setting the LFO rate and depth allows for control over the filter modulation rate - * and depth. - * - * @example - * // create an autofilter and start it's LFO - * const autoFilter = new Tone.AutoFilter("4n").toDestination().start(); - * // route an oscillator through the filter and start it - * const oscillator = new Tone.Oscillator().connect(autoFilter).start(); - * @category Effect - */ -class AutoFilter extends LFOEffect { - constructor() { - super(optionsFromArguments(AutoFilter.getDefaults(), arguments, ["frequency", "baseFrequency", "octaves"])); - this.name = "AutoFilter"; - const options = optionsFromArguments(AutoFilter.getDefaults(), arguments, ["frequency", "baseFrequency", "octaves"]); - this.filter = new Filter(Object.assign(options.filter, { - context: this.context, - })); - // connections - this.connectEffect(this.filter); - this._lfo.connect(this.filter.frequency); - this.octaves = options.octaves; - this.baseFrequency = options.baseFrequency; - } - static getDefaults() { - return Object.assign(LFOEffect.getDefaults(), { - baseFrequency: 200, - octaves: 2.6, - filter: { - type: "lowpass", - rolloff: -12, - Q: 1, - } - }); - } - /** - * The minimum value of the filter's cutoff frequency. - */ - get baseFrequency() { - return this._lfo.min; - } - set baseFrequency(freq) { - this._lfo.min = this.toFrequency(freq); - // and set the max - this.octaves = this._octaves; - } - /** - * The maximum value of the filter's cutoff frequency. - */ - get octaves() { - return this._octaves; - } - set octaves(oct) { - this._octaves = oct; - this._lfo.max = this._lfo.min * Math.pow(2, oct); - } - dispose() { - super.dispose(); - this.filter.dispose(); - return this; - } -} - -/** - * AutoPanner is a [[Panner]] with an [[LFO]] connected to the pan amount. - * [Related Reading](https://www.ableton.com/en/blog/autopan-chopper-effect-and-more-liveschool/). - * - * @example - * // create an autopanner and start it - * const autoPanner = new Tone.AutoPanner("4n").toDestination().start(); - * // route an oscillator through the panner and start it - * const oscillator = new Tone.Oscillator().connect(autoPanner).start(); - * @category Effect - */ -class AutoPanner extends LFOEffect { - constructor() { - super(optionsFromArguments(AutoPanner.getDefaults(), arguments, ["frequency"])); - this.name = "AutoPanner"; - const options = optionsFromArguments(AutoPanner.getDefaults(), arguments, ["frequency"]); - this._panner = new Panner({ - context: this.context, - channelCount: options.channelCount - }); - // connections - this.connectEffect(this._panner); - this._lfo.connect(this._panner.pan); - this._lfo.min = -1; - this._lfo.max = 1; - } - static getDefaults() { - return Object.assign(LFOEffect.getDefaults(), { - channelCount: 1 - }); - } - dispose() { - super.dispose(); - this._panner.dispose(); - return this; - } -} - -/** - * Follower is a simple envelope follower. - * It's implemented by applying a lowpass filter to the absolute value of the incoming signal. - * ``` - * +-----+ +---------------+ - * Input +--> Abs +----> OnePoleFilter +--> Output - * +-----+ +---------------+ - * ``` - * @category Component - */ -class Follower extends ToneAudioNode { - constructor() { - super(optionsFromArguments(Follower.getDefaults(), arguments, ["smoothing"])); - this.name = "Follower"; - const options = optionsFromArguments(Follower.getDefaults(), arguments, ["smoothing"]); - this._abs = this.input = new Abs({ context: this.context }); - this._lowpass = this.output = new OnePoleFilter({ - context: this.context, - frequency: 1 / this.toSeconds(options.smoothing), - type: "lowpass" - }); - this._abs.connect(this._lowpass); - this._smoothing = options.smoothing; - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - smoothing: 0.05 - }); - } - /** - * The amount of time it takes a value change to arrive at the updated value. - */ - get smoothing() { - return this._smoothing; - } - set smoothing(smoothing) { - this._smoothing = smoothing; - this._lowpass.frequency = 1 / this.toSeconds(this.smoothing); - } - dispose() { - super.dispose(); - this._abs.dispose(); - this._lowpass.dispose(); - return this; - } -} - -/** - * AutoWah connects a [[Follower]] to a [[Filter]]. - * The frequency of the filter, follows the input amplitude curve. - * Inspiration from [Tuna.js](https://github.com/Dinahmoe/tuna). - * - * @example - * const autoWah = new Tone.AutoWah(50, 6, -30).toDestination(); - * // initialize the synth and connect to autowah - * const synth = new Tone.Synth().connect(autoWah); - * // Q value influences the effect of the wah - default is 2 - * autoWah.Q.value = 6; - * // more audible on higher notes - * synth.triggerAttackRelease("C4", "8n"); - * @category Effect - */ -class AutoWah extends Effect { - constructor() { - super(optionsFromArguments(AutoWah.getDefaults(), arguments, ["baseFrequency", "octaves", "sensitivity"])); - this.name = "AutoWah"; - const options = optionsFromArguments(AutoWah.getDefaults(), arguments, ["baseFrequency", "octaves", "sensitivity"]); - this._follower = new Follower({ - context: this.context, - smoothing: options.follower, - }); - this._sweepRange = new ScaleExp({ - context: this.context, - min: 0, - max: 1, - exponent: 0.5, - }); - this._baseFrequency = this.toFrequency(options.baseFrequency); - this._octaves = options.octaves; - this._inputBoost = new Gain({ context: this.context }); - this._bandpass = new Filter({ - context: this.context, - rolloff: -48, - frequency: 0, - Q: options.Q, - }); - this._peaking = new Filter({ - context: this.context, - type: "peaking" - }); - this._peaking.gain.value = options.gain; - this.gain = this._peaking.gain; - this.Q = this._bandpass.Q; - // the control signal path - this.effectSend.chain(this._inputBoost, this._follower, this._sweepRange); - this._sweepRange.connect(this._bandpass.frequency); - this._sweepRange.connect(this._peaking.frequency); - // the filtered path - this.effectSend.chain(this._bandpass, this._peaking, this.effectReturn); - // set the initial value - this._setSweepRange(); - this.sensitivity = options.sensitivity; - readOnly(this, ["gain", "Q"]); - } - static getDefaults() { - return Object.assign(Effect.getDefaults(), { - baseFrequency: 100, - octaves: 6, - sensitivity: 0, - Q: 2, - gain: 2, - follower: 0.2, - }); - } - /** - * The number of octaves that the filter will sweep above the baseFrequency. - */ - get octaves() { - return this._octaves; - } - set octaves(octaves) { - this._octaves = octaves; - this._setSweepRange(); - } - /** - * The follower's smoothing time - */ - get follower() { - return this._follower.smoothing; - } - set follower(follower) { - this._follower.smoothing = follower; - } - /** - * The base frequency from which the sweep will start from. - */ - get baseFrequency() { - return this._baseFrequency; - } - set baseFrequency(baseFreq) { - this._baseFrequency = this.toFrequency(baseFreq); - this._setSweepRange(); - } - /** - * The sensitivity to control how responsive to the input signal the filter is. - */ - get sensitivity() { - return gainToDb(1 / this._inputBoost.gain.value); - } - set sensitivity(sensitivity) { - this._inputBoost.gain.value = 1 / dbToGain(sensitivity); - } - /** - * sets the sweep range of the scaler - */ - _setSweepRange() { - this._sweepRange.min = this._baseFrequency; - this._sweepRange.max = Math.min(this._baseFrequency * Math.pow(2, this._octaves), this.context.sampleRate / 2); - } - dispose() { - super.dispose(); - this._follower.dispose(); - this._sweepRange.dispose(); - this._bandpass.dispose(); - this._peaking.dispose(); - this._inputBoost.dispose(); - return this; - } -} - -/** - * BitCrusher down-samples the incoming signal to a different bit depth. - * Lowering the bit depth of the signal creates distortion. Read more about BitCrushing - * on [Wikipedia](https://en.wikipedia.org/wiki/Bitcrusher). - * @example - * // initialize crusher and route a synth through it - * const crusher = new Tone.BitCrusher(4).toDestination(); - * const synth = new Tone.Synth().connect(crusher); - * synth.triggerAttackRelease("C2", 2); - * - * @category Effect - */ -class BitCrusher extends Effect { - constructor() { - super(optionsFromArguments(BitCrusher.getDefaults(), arguments, ["bits"])); - this.name = "BitCrusher"; - const options = optionsFromArguments(BitCrusher.getDefaults(), arguments, ["bits"]); - this._bitCrusherWorklet = new BitCrusherWorklet({ - context: this.context, - bits: options.bits, - }); - // connect it up - this.connectEffect(this._bitCrusherWorklet); - this.bits = this._bitCrusherWorklet.bits; - } - static getDefaults() { - return Object.assign(Effect.getDefaults(), { - bits: 4, - }); - } - dispose() { - super.dispose(); - this._bitCrusherWorklet.dispose(); - return this; - } -} -/** - * Internal class which creates an AudioWorklet to do the bit crushing - */ -class BitCrusherWorklet extends ToneAudioWorklet { - constructor() { - super(optionsFromArguments(BitCrusherWorklet.getDefaults(), arguments)); - this.name = "BitCrusherWorklet"; - const options = optionsFromArguments(BitCrusherWorklet.getDefaults(), arguments); - this.input = new Gain({ context: this.context }); - this.output = new Gain({ context: this.context }); - this.bits = new Param({ - context: this.context, - value: options.bits, - units: "positive", - minValue: 1, - maxValue: 16, - param: this._dummyParam, - swappable: true, - }); - } - static getDefaults() { - return Object.assign(ToneAudioWorklet.getDefaults(), { - bits: 12, - }); - } - _audioWorkletName() { - return workletName$1; - } - onReady(node) { - connectSeries(this.input, node, this.output); - const bits = node.parameters.get("bits"); - this.bits.setParam(bits); - } - dispose() { - super.dispose(); - this.input.dispose(); - this.output.dispose(); - this.bits.dispose(); - return this; - } -} - -/** - * Chebyshev is a waveshaper which is good - * for making different types of distortion sounds. - * Note that odd orders sound very different from even ones, - * and order = 1 is no change. - * Read more at [music.columbia.edu](http://music.columbia.edu/cmc/musicandcomputers/chapter4/04_06.php). - * @example - * // create a new cheby - * const cheby = new Tone.Chebyshev(50).toDestination(); - * // create a monosynth connected to our cheby - * const synth = new Tone.MonoSynth().connect(cheby); - * synth.triggerAttackRelease("C2", 0.4); - * @category Effect - */ -class Chebyshev extends Effect { - constructor() { - super(optionsFromArguments(Chebyshev.getDefaults(), arguments, ["order"])); - this.name = "Chebyshev"; - const options = optionsFromArguments(Chebyshev.getDefaults(), arguments, ["order"]); - this._shaper = new WaveShaper({ - context: this.context, - length: 4096 - }); - this._order = options.order; - this.connectEffect(this._shaper); - this.order = options.order; - this.oversample = options.oversample; - } - static getDefaults() { - return Object.assign(Effect.getDefaults(), { - order: 1, - oversample: "none" - }); - } - /** - * get the coefficient for that degree - * @param x the x value - * @param degree - * @param memo memoize the computed value. this speeds up computation greatly. - */ - _getCoefficient(x, degree, memo) { - if (memo.has(degree)) { - return memo.get(degree); - } - else if (degree === 0) { - memo.set(degree, 0); - } - else if (degree === 1) { - memo.set(degree, x); - } - else { - memo.set(degree, 2 * x * this._getCoefficient(x, degree - 1, memo) - this._getCoefficient(x, degree - 2, memo)); - } - return memo.get(degree); - } - /** - * The order of the Chebyshev polynomial which creates the equation which is applied to the incoming - * signal through a Tone.WaveShaper. The equations are in the form: - * ``` - * order 2: 2x^2 + 1 - * order 3: 4x^3 + 3x - * ``` - * @min 1 - * @max 100 - */ - get order() { - return this._order; - } - set order(order) { - this._order = order; - this._shaper.setMap((x => { - return this._getCoefficient(x, order, new Map()); - })); - } - /** - * The oversampling of the effect. Can either be "none", "2x" or "4x". - */ - get oversample() { - return this._shaper.oversample; - } - set oversample(oversampling) { - this._shaper.oversample = oversampling; - } - dispose() { - super.dispose(); - this._shaper.dispose(); - return this; - } -} - -/** - * Split splits an incoming signal into the number of given channels. - * - * @example - * const split = new Tone.Split(); - * // stereoSignal.connect(split); - * @category Component - */ -class Split extends ToneAudioNode { - constructor() { - super(optionsFromArguments(Split.getDefaults(), arguments, ["channels"])); - this.name = "Split"; - const options = optionsFromArguments(Split.getDefaults(), arguments, ["channels"]); - this._splitter = this.input = this.output = this.context.createChannelSplitter(options.channels); - this._internalChannels = [this._splitter]; - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - channels: 2, - }); - } - dispose() { - super.dispose(); - this._splitter.disconnect(); - return this; - } -} - -/** - * Merge brings multiple mono input channels into a single multichannel output channel. - * - * @example - * const merge = new Tone.Merge().toDestination(); - * // routing a sine tone in the left channel - * const osc = new Tone.Oscillator().connect(merge, 0, 0).start(); - * // and noise in the right channel - * const noise = new Tone.Noise().connect(merge, 0, 1).start();; - * @category Component - */ -class Merge extends ToneAudioNode { - constructor() { - super(optionsFromArguments(Merge.getDefaults(), arguments, ["channels"])); - this.name = "Merge"; - const options = optionsFromArguments(Merge.getDefaults(), arguments, ["channels"]); - this._merger = this.output = this.input = this.context.createChannelMerger(options.channels); - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - channels: 2, - }); - } - dispose() { - super.dispose(); - this._merger.disconnect(); - return this; - } -} - -/** - * Base class for Stereo effects. - */ -class StereoEffect extends ToneAudioNode { - constructor(options) { - super(options); - this.name = "StereoEffect"; - this.input = new Gain({ context: this.context }); - // force mono sources to be stereo - this.input.channelCount = 2; - this.input.channelCountMode = "explicit"; - this._dryWet = this.output = new CrossFade({ - context: this.context, - fade: options.wet - }); - this.wet = this._dryWet.fade; - this._split = new Split({ context: this.context, channels: 2 }); - this._merge = new Merge({ context: this.context, channels: 2 }); - // connections - this.input.connect(this._split); - // dry wet connections - this.input.connect(this._dryWet.a); - this._merge.connect(this._dryWet.b); - readOnly(this, ["wet"]); - } - /** - * Connect the left part of the effect - */ - connectEffectLeft(...nodes) { - this._split.connect(nodes[0], 0, 0); - connectSeries(...nodes); - connect(nodes[nodes.length - 1], this._merge, 0, 0); - } - /** - * Connect the right part of the effect - */ - connectEffectRight(...nodes) { - this._split.connect(nodes[0], 1, 0); - connectSeries(...nodes); - connect(nodes[nodes.length - 1], this._merge, 0, 1); - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - wet: 1, - }); - } - dispose() { - super.dispose(); - this._dryWet.dispose(); - this._split.dispose(); - this._merge.dispose(); - return this; - } -} - -/** - * Base class for stereo feedback effects where the effectReturn is fed back into the same channel. - */ -class StereoFeedbackEffect extends StereoEffect { - constructor(options) { - super(options); - this.feedback = new Signal({ - context: this.context, - value: options.feedback, - units: "normalRange" - }); - this._feedbackL = new Gain({ context: this.context }); - this._feedbackR = new Gain({ context: this.context }); - this._feedbackSplit = new Split({ context: this.context, channels: 2 }); - this._feedbackMerge = new Merge({ context: this.context, channels: 2 }); - this._merge.connect(this._feedbackSplit); - this._feedbackMerge.connect(this._split); - // the left output connected to the left input - this._feedbackSplit.connect(this._feedbackL, 0, 0); - this._feedbackL.connect(this._feedbackMerge, 0, 0); - // the right output connected to the right input - this._feedbackSplit.connect(this._feedbackR, 1, 0); - this._feedbackR.connect(this._feedbackMerge, 0, 1); - // the feedback control - this.feedback.fan(this._feedbackL.gain, this._feedbackR.gain); - readOnly(this, ["feedback"]); - } - static getDefaults() { - return Object.assign(StereoEffect.getDefaults(), { - feedback: 0.5, - }); - } - dispose() { - super.dispose(); - this.feedback.dispose(); - this._feedbackL.dispose(); - this._feedbackR.dispose(); - this._feedbackSplit.dispose(); - this._feedbackMerge.dispose(); - return this; - } -} - -/** - * Chorus is a stereo chorus effect composed of a left and right delay with an [[LFO]] applied to the delayTime of each channel. - * When [[feedback]] is set to a value larger than 0, you also get Flanger-type effects. - * Inspiration from [Tuna.js](https://github.com/Dinahmoe/tuna/blob/master/tuna.js). - * Read more on the chorus effect on [SoundOnSound](http://www.soundonsound.com/sos/jun04/articles/synthsecrets.htm). - * - * @example - * const chorus = new Tone.Chorus(4, 2.5, 0.5).toDestination().start(); - * const synth = new Tone.PolySynth().connect(chorus); - * synth.triggerAttackRelease(["C3", "E3", "G3"], "8n"); - * - * @category Effect - */ -class Chorus extends StereoFeedbackEffect { - constructor() { - super(optionsFromArguments(Chorus.getDefaults(), arguments, ["frequency", "delayTime", "depth"])); - this.name = "Chorus"; - const options = optionsFromArguments(Chorus.getDefaults(), arguments, ["frequency", "delayTime", "depth"]); - this._depth = options.depth; - this._delayTime = options.delayTime / 1000; - this._lfoL = new LFO({ - context: this.context, - frequency: options.frequency, - min: 0, - max: 1, - }); - this._lfoR = new LFO({ - context: this.context, - frequency: options.frequency, - min: 0, - max: 1, - phase: 180 - }); - this._delayNodeL = new Delay({ context: this.context }); - this._delayNodeR = new Delay({ context: this.context }); - this.frequency = this._lfoL.frequency; - readOnly(this, ["frequency"]); - // have one LFO frequency control the other - this._lfoL.frequency.connect(this._lfoR.frequency); - // connections - this.connectEffectLeft(this._delayNodeL); - this.connectEffectRight(this._delayNodeR); - // lfo setup - this._lfoL.connect(this._delayNodeL.delayTime); - this._lfoR.connect(this._delayNodeR.delayTime); - // set the initial values - this.depth = this._depth; - this.type = options.type; - this.spread = options.spread; - } - static getDefaults() { - return Object.assign(StereoFeedbackEffect.getDefaults(), { - frequency: 1.5, - delayTime: 3.5, - depth: 0.7, - type: "sine", - spread: 180, - feedback: 0, - wet: 0.5, - }); - } - /** - * The depth of the effect. A depth of 1 makes the delayTime - * modulate between 0 and 2*delayTime (centered around the delayTime). - */ - get depth() { - return this._depth; - } - set depth(depth) { - this._depth = depth; - const deviation = this._delayTime * depth; - this._lfoL.min = Math.max(this._delayTime - deviation, 0); - this._lfoL.max = this._delayTime + deviation; - this._lfoR.min = Math.max(this._delayTime - deviation, 0); - this._lfoR.max = this._delayTime + deviation; - } - /** - * The delayTime in milliseconds of the chorus. A larger delayTime - * will give a more pronounced effect. Nominal range a delayTime - * is between 2 and 20ms. - */ - get delayTime() { - return this._delayTime * 1000; - } - set delayTime(delayTime) { - this._delayTime = delayTime / 1000; - this.depth = this._depth; - } - /** - * The oscillator type of the LFO. - */ - get type() { - return this._lfoL.type; - } - set type(type) { - this._lfoL.type = type; - this._lfoR.type = type; - } - /** - * Amount of stereo spread. When set to 0, both LFO's will be panned centrally. - * When set to 180, LFO's will be panned hard left and right respectively. - */ - get spread() { - return this._lfoR.phase - this._lfoL.phase; - } - set spread(spread) { - this._lfoL.phase = 90 - (spread / 2); - this._lfoR.phase = (spread / 2) + 90; - } - /** - * Start the effect. - */ - start(time) { - this._lfoL.start(time); - this._lfoR.start(time); - return this; - } - /** - * Stop the lfo - */ - stop(time) { - this._lfoL.stop(time); - this._lfoR.stop(time); - return this; - } - /** - * Sync the filter to the transport. See [[LFO.sync]] - */ - sync() { - this._lfoL.sync(); - this._lfoR.sync(); - return this; - } - /** - * Unsync the filter from the transport. - */ - unsync() { - this._lfoL.unsync(); - this._lfoR.unsync(); - return this; - } - dispose() { - super.dispose(); - this._lfoL.dispose(); - this._lfoR.dispose(); - this._delayNodeL.dispose(); - this._delayNodeR.dispose(); - this.frequency.dispose(); - return this; - } -} - -/** - * A simple distortion effect using Tone.WaveShaper. - * Algorithm from [this stackoverflow answer](http://stackoverflow.com/a/22313408). - * - * @example - * const dist = new Tone.Distortion(0.8).toDestination(); - * const fm = new Tone.FMSynth().connect(dist); - * fm.triggerAttackRelease("A1", "8n"); - * @category Effect - */ -class Distortion extends Effect { - constructor() { - super(optionsFromArguments(Distortion.getDefaults(), arguments, ["distortion"])); - this.name = "Distortion"; - const options = optionsFromArguments(Distortion.getDefaults(), arguments, ["distortion"]); - this._shaper = new WaveShaper({ - context: this.context, - length: 4096, - }); - this._distortion = options.distortion; - this.connectEffect(this._shaper); - this.distortion = options.distortion; - this.oversample = options.oversample; - } - static getDefaults() { - return Object.assign(Effect.getDefaults(), { - distortion: 0.4, - oversample: "none", - }); - } - /** - * The amount of distortion. Nominal range is between 0 and 1. - */ - get distortion() { - return this._distortion; - } - set distortion(amount) { - this._distortion = amount; - const k = amount * 100; - const deg = Math.PI / 180; - this._shaper.setMap((x) => { - if (Math.abs(x) < 0.001) { - // should output 0 when input is 0 - return 0; - } - else { - return (3 + k) * x * 20 * deg / (Math.PI + k * Math.abs(x)); - } - }); - } - /** - * The oversampling of the effect. Can either be "none", "2x" or "4x". - */ - get oversample() { - return this._shaper.oversample; - } - set oversample(oversampling) { - this._shaper.oversample = oversampling; - } - dispose() { - super.dispose(); - this._shaper.dispose(); - return this; - } -} - -/** - * FeedbackEffect provides a loop between an audio source and its own output. - * This is a base-class for feedback effects. - */ -class FeedbackEffect extends Effect { - constructor(options) { - super(options); - this.name = "FeedbackEffect"; - this._feedbackGain = new Gain({ - context: this.context, - gain: options.feedback, - units: "normalRange", - }); - this.feedback = this._feedbackGain.gain; - readOnly(this, "feedback"); - // the feedback loop - this.effectReturn.chain(this._feedbackGain, this.effectSend); - } - static getDefaults() { - return Object.assign(Effect.getDefaults(), { - feedback: 0.125, - }); - } - dispose() { - super.dispose(); - this._feedbackGain.dispose(); - this.feedback.dispose(); - return this; - } -} - -/** - * FeedbackDelay is a DelayNode in which part of output signal is fed back into the delay. - * - * @param delayTime The delay applied to the incoming signal. - * @param feedback The amount of the effected signal which is fed back through the delay. - * @example - * const feedbackDelay = new Tone.FeedbackDelay("8n", 0.5).toDestination(); - * const tom = new Tone.MembraneSynth({ - * octaves: 4, - * pitchDecay: 0.1 - * }).connect(feedbackDelay); - * tom.triggerAttackRelease("A2", "32n"); - * @category Effect - */ -class FeedbackDelay extends FeedbackEffect { - constructor() { - super(optionsFromArguments(FeedbackDelay.getDefaults(), arguments, ["delayTime", "feedback"])); - this.name = "FeedbackDelay"; - const options = optionsFromArguments(FeedbackDelay.getDefaults(), arguments, ["delayTime", "feedback"]); - this._delayNode = new Delay({ - context: this.context, - delayTime: options.delayTime, - maxDelay: options.maxDelay, - }); - this.delayTime = this._delayNode.delayTime; - // connect it up - this.connectEffect(this._delayNode); - readOnly(this, "delayTime"); - } - static getDefaults() { - return Object.assign(FeedbackEffect.getDefaults(), { - delayTime: 0.25, - maxDelay: 1, - }); - } - dispose() { - super.dispose(); - this._delayNode.dispose(); - this.delayTime.dispose(); - return this; - } -} - -/** - * PhaseShiftAllpass is an very efficient implementation of a Hilbert Transform - * using two Allpass filter banks whose outputs have a phase difference of 90°. - * Here the `offset90` phase is offset by +90° in relation to `output`. - * Coefficients and structure was developed by Olli Niemitalo. - * For more details see: http://yehar.com/blog/?p=368 - * @category Component - */ -class PhaseShiftAllpass extends ToneAudioNode { - constructor(options) { - super(options); - this.name = "PhaseShiftAllpass"; - this.input = new Gain({ context: this.context }); - /** - * The phase shifted output - */ - this.output = new Gain({ context: this.context }); - /** - * The PhaseShifted allpass output - */ - this.offset90 = new Gain({ context: this.context }); - const allpassBank1Values = [0.6923878, 0.9360654322959, 0.9882295226860, 0.9987488452737]; - const allpassBank2Values = [0.4021921162426, 0.8561710882420, 0.9722909545651, 0.9952884791278]; - this._bank0 = this._createAllPassFilterBank(allpassBank1Values); - this._bank1 = this._createAllPassFilterBank(allpassBank2Values); - this._oneSampleDelay = this.context.createIIRFilter([0.0, 1.0], [1.0, 0.0]); - // connect Allpass filter banks - connectSeries(this.input, ...this._bank0, this._oneSampleDelay, this.output); - connectSeries(this.input, ...this._bank1, this.offset90); - } - /** - * Create all of the IIR filters from an array of values using the coefficient calculation. - */ - _createAllPassFilterBank(bankValues) { - const nodes = bankValues.map(value => { - const coefficients = [[value * value, 0, -1], [1, 0, -(value * value)]]; - return this.context.createIIRFilter(coefficients[0], coefficients[1]); - }); - return nodes; - } - dispose() { - super.dispose(); - this.input.dispose(); - this.output.dispose(); - this.offset90.dispose(); - this._bank0.forEach(f => f.disconnect()); - this._bank1.forEach(f => f.disconnect()); - this._oneSampleDelay.disconnect(); - return this; - } -} - -/** - * FrequencyShifter can be used to shift all frequencies of a signal by a fixed amount. - * The amount can be changed at audio rate and the effect is applied in real time. - * The frequency shifting is implemented with a technique called single side band modulation using a ring modulator. - * Note: Contrary to pitch shifting, all frequencies are shifted by the same amount, - * destroying the harmonic relationship between them. This leads to the classic ring modulator timbre distortion. - * The algorithm will produces some aliasing towards the high end, especially if your source material - * contains a lot of high frequencies. Unfortunatelly the webaudio API does not support resampling - * buffers in real time, so it is not possible to fix it properly. Depending on the use case it might - * be an option to low pass filter your input before frequency shifting it to get ride of the aliasing. - * You can find a very detailed description of the algorithm here: https://larzeitlin.github.io/RMFS/ - * - * @example - * const input = new Tone.Oscillator(230, "sawtooth").start(); - * const shift = new Tone.FrequencyShifter(42).toDestination(); - * input.connect(shift); - * @category Effect - */ -class FrequencyShifter extends Effect { - constructor() { - super(optionsFromArguments(FrequencyShifter.getDefaults(), arguments, ["frequency"])); - this.name = "FrequencyShifter"; - const options = optionsFromArguments(FrequencyShifter.getDefaults(), arguments, ["frequency"]); - this.frequency = new Signal({ - context: this.context, - units: "frequency", - value: options.frequency, - minValue: -this.context.sampleRate / 2, - maxValue: this.context.sampleRate / 2, - }); - this._sine = new ToneOscillatorNode({ - context: this.context, - type: "sine", - }); - this._cosine = new Oscillator({ - context: this.context, - phase: -90, - type: "sine", - }); - this._sineMultiply = new Multiply({ context: this.context }); - this._cosineMultiply = new Multiply({ context: this.context }); - this._negate = new Negate({ context: this.context }); - this._add = new Add({ context: this.context }); - this._phaseShifter = new PhaseShiftAllpass({ context: this.context }); - this.effectSend.connect(this._phaseShifter); - // connect the carrier frequency signal to the two oscillators - this.frequency.fan(this._sine.frequency, this._cosine.frequency); - this._phaseShifter.offset90.connect(this._cosineMultiply); - this._cosine.connect(this._cosineMultiply.factor); - this._phaseShifter.connect(this._sineMultiply); - this._sine.connect(this._sineMultiply.factor); - this._sineMultiply.connect(this._negate); - this._cosineMultiply.connect(this._add); - this._negate.connect(this._add.addend); - this._add.connect(this.effectReturn); - // start the oscillators at the same time - const now = this.immediate(); - this._sine.start(now); - this._cosine.start(now); - } - static getDefaults() { - return Object.assign(Effect.getDefaults(), { - frequency: 0, - }); - } - dispose() { - super.dispose(); - this.frequency.dispose(); - this._add.dispose(); - this._cosine.dispose(); - this._cosineMultiply.dispose(); - this._negate.dispose(); - this._phaseShifter.dispose(); - this._sine.dispose(); - this._sineMultiply.dispose(); - return this; - } -} - -/** - * An array of comb filter delay values from Freeverb implementation - */ -const combFilterTunings = [1557 / 44100, 1617 / 44100, 1491 / 44100, 1422 / 44100, 1277 / 44100, 1356 / 44100, 1188 / 44100, 1116 / 44100]; -/** - * An array of allpass filter frequency values from Freeverb implementation - */ -const allpassFilterFrequencies = [225, 556, 441, 341]; -/** - * Freeverb is a reverb based on [Freeverb](https://ccrma.stanford.edu/~jos/pasp/Freeverb.html). - * Read more on reverb on [Sound On Sound](https://web.archive.org/web/20160404083902/http://www.soundonsound.com:80/sos/feb01/articles/synthsecrets.asp). - * Freeverb is now implemented with an AudioWorkletNode which may result on performance degradation on some platforms. Consider using [[Reverb]]. - * @example - * const freeverb = new Tone.Freeverb().toDestination(); - * freeverb.dampening = 1000; - * // routing synth through the reverb - * const synth = new Tone.NoiseSynth().connect(freeverb); - * synth.triggerAttackRelease(0.05); - * @category Effect - */ -class Freeverb extends StereoEffect { - constructor() { - super(optionsFromArguments(Freeverb.getDefaults(), arguments, ["roomSize", "dampening"])); - this.name = "Freeverb"; - /** - * the comb filters - */ - this._combFilters = []; - /** - * the allpass filters on the left - */ - this._allpassFiltersL = []; - /** - * the allpass filters on the right - */ - this._allpassFiltersR = []; - const options = optionsFromArguments(Freeverb.getDefaults(), arguments, ["roomSize", "dampening"]); - this.roomSize = new Signal({ - context: this.context, - value: options.roomSize, - units: "normalRange", - }); - // make the allpass filters on the right - this._allpassFiltersL = allpassFilterFrequencies.map(freq => { - const allpassL = this.context.createBiquadFilter(); - allpassL.type = "allpass"; - allpassL.frequency.value = freq; - return allpassL; - }); - // make the allpass filters on the left - this._allpassFiltersR = allpassFilterFrequencies.map(freq => { - const allpassR = this.context.createBiquadFilter(); - allpassR.type = "allpass"; - allpassR.frequency.value = freq; - return allpassR; - }); - // make the comb filters - this._combFilters = combFilterTunings.map((delayTime, index) => { - const lfpf = new LowpassCombFilter({ - context: this.context, - dampening: options.dampening, - delayTime, - }); - if (index < combFilterTunings.length / 2) { - this.connectEffectLeft(lfpf, ...this._allpassFiltersL); - } - else { - this.connectEffectRight(lfpf, ...this._allpassFiltersR); - } - this.roomSize.connect(lfpf.resonance); - return lfpf; - }); - readOnly(this, ["roomSize"]); - } - static getDefaults() { - return Object.assign(StereoEffect.getDefaults(), { - roomSize: 0.7, - dampening: 3000 - }); - } - /** - * The amount of dampening of the reverberant signal. - */ - get dampening() { - return this._combFilters[0].dampening; - } - set dampening(d) { - this._combFilters.forEach(c => c.dampening = d); - } - dispose() { - super.dispose(); - this._allpassFiltersL.forEach(al => al.disconnect()); - this._allpassFiltersR.forEach(ar => ar.disconnect()); - this._combFilters.forEach(cf => cf.dispose()); - this.roomSize.dispose(); - return this; - } -} - -/** - * an array of the comb filter delay time values - */ -const combFilterDelayTimes = [1687 / 25000, 1601 / 25000, 2053 / 25000, 2251 / 25000]; -/** - * the resonances of each of the comb filters - */ -const combFilterResonances = [0.773, 0.802, 0.753, 0.733]; -/** - * the allpass filter frequencies - */ -const allpassFilterFreqs = [347, 113, 37]; -/** - * JCReverb is a simple [Schroeder Reverberator](https://ccrma.stanford.edu/~jos/pasp/Schroeder_Reverberators.html) - * tuned by John Chowning in 1970. - * It is made up of three allpass filters and four [[FeedbackCombFilter]]. - * JCReverb is now implemented with an AudioWorkletNode which may result on performance degradation on some platforms. Consider using [[Reverb]]. - * @example - * const reverb = new Tone.JCReverb(0.4).toDestination(); - * const delay = new Tone.FeedbackDelay(0.5); - * // connecting the synth to reverb through delay - * const synth = new Tone.DuoSynth().chain(delay, reverb); - * synth.triggerAttackRelease("A4", "8n"); - * - * @category Effect - */ -class JCReverb extends StereoEffect { - constructor() { - super(optionsFromArguments(JCReverb.getDefaults(), arguments, ["roomSize"])); - this.name = "JCReverb"; - /** - * a series of allpass filters - */ - this._allpassFilters = []; - /** - * parallel feedback comb filters - */ - this._feedbackCombFilters = []; - const options = optionsFromArguments(JCReverb.getDefaults(), arguments, ["roomSize"]); - this.roomSize = new Signal({ - context: this.context, - value: options.roomSize, - units: "normalRange", - }); - this._scaleRoomSize = new Scale({ - context: this.context, - min: -0.733, - max: 0.197, - }); - // make the allpass filters - this._allpassFilters = allpassFilterFreqs.map(freq => { - const allpass = this.context.createBiquadFilter(); - allpass.type = "allpass"; - allpass.frequency.value = freq; - return allpass; - }); - // and the comb filters - this._feedbackCombFilters = combFilterDelayTimes.map((delayTime, index) => { - const fbcf = new FeedbackCombFilter({ - context: this.context, - delayTime, - }); - this._scaleRoomSize.connect(fbcf.resonance); - fbcf.resonance.value = combFilterResonances[index]; - if (index < combFilterDelayTimes.length / 2) { - this.connectEffectLeft(...this._allpassFilters, fbcf); - } - else { - this.connectEffectRight(...this._allpassFilters, fbcf); - } - return fbcf; - }); - // chain the allpass filters together - this.roomSize.connect(this._scaleRoomSize); - readOnly(this, ["roomSize"]); - } - static getDefaults() { - return Object.assign(StereoEffect.getDefaults(), { - roomSize: 0.5, - }); - } - dispose() { - super.dispose(); - this._allpassFilters.forEach(apf => apf.disconnect()); - this._feedbackCombFilters.forEach(fbcf => fbcf.dispose()); - this.roomSize.dispose(); - this._scaleRoomSize.dispose(); - return this; - } -} - -/** - * Just like a [[StereoFeedbackEffect]], but the feedback is routed from left to right - * and right to left instead of on the same channel. - * ``` - * +--------------------------------+ feedbackL <-----------------------------------+ - * | | - * +--> +-----> +----> +-----+ - * feedbackMerge +--> split (EFFECT) merge +--> feedbackSplit | | - * +--> +-----> +----> +---+ | - * | | - * +--------------------------------+ feedbackR <-------------------------------------+ - * ``` - */ -class StereoXFeedbackEffect extends StereoFeedbackEffect { - constructor(options) { - super(options); - // the left output connected to the right input - this._feedbackL.disconnect(); - this._feedbackL.connect(this._feedbackMerge, 0, 1); - // the left output connected to the right input - this._feedbackR.disconnect(); - this._feedbackR.connect(this._feedbackMerge, 0, 0); - readOnly(this, ["feedback"]); - } -} - -/** - * PingPongDelay is a feedback delay effect where the echo is heard - * first in one channel and next in the opposite channel. In a stereo - * system these are the right and left channels. - * PingPongDelay in more simplified terms is two Tone.FeedbackDelays - * with independent delay values. Each delay is routed to one channel - * (left or right), and the channel triggered second will always - * trigger at the same interval after the first. - * @example - * const pingPong = new Tone.PingPongDelay("4n", 0.2).toDestination(); - * const drum = new Tone.MembraneSynth().connect(pingPong); - * drum.triggerAttackRelease("C4", "32n"); - * @category Effect - */ -class PingPongDelay extends StereoXFeedbackEffect { - constructor() { - super(optionsFromArguments(PingPongDelay.getDefaults(), arguments, ["delayTime", "feedback"])); - this.name = "PingPongDelay"; - const options = optionsFromArguments(PingPongDelay.getDefaults(), arguments, ["delayTime", "feedback"]); - this._leftDelay = new Delay({ - context: this.context, - maxDelay: options.maxDelay, - }); - this._rightDelay = new Delay({ - context: this.context, - maxDelay: options.maxDelay - }); - this._rightPreDelay = new Delay({ - context: this.context, - maxDelay: options.maxDelay - }); - this.delayTime = new Signal({ - context: this.context, - units: "time", - value: options.delayTime, - }); - // connect it up - this.connectEffectLeft(this._leftDelay); - this.connectEffectRight(this._rightPreDelay, this._rightDelay); - this.delayTime.fan(this._leftDelay.delayTime, this._rightDelay.delayTime, this._rightPreDelay.delayTime); - // rearranged the feedback to be after the rightPreDelay - this._feedbackL.disconnect(); - this._feedbackL.connect(this._rightDelay); - readOnly(this, ["delayTime"]); - } - static getDefaults() { - return Object.assign(StereoXFeedbackEffect.getDefaults(), { - delayTime: 0.25, - maxDelay: 1 - }); - } - dispose() { - super.dispose(); - this._leftDelay.dispose(); - this._rightDelay.dispose(); - this._rightPreDelay.dispose(); - this.delayTime.dispose(); - return this; - } -} - -/** - * PitchShift does near-realtime pitch shifting to the incoming signal. - * The effect is achieved by speeding up or slowing down the delayTime - * of a DelayNode using a sawtooth wave. - * Algorithm found in [this pdf](http://dsp-book.narod.ru/soundproc.pdf). - * Additional reference by [Miller Pucket](http://msp.ucsd.edu/techniques/v0.11/book-html/node115.html). - * @category Effect - */ -class PitchShift extends FeedbackEffect { - constructor() { - super(optionsFromArguments(PitchShift.getDefaults(), arguments, ["pitch"])); - this.name = "PitchShift"; - const options = optionsFromArguments(PitchShift.getDefaults(), arguments, ["pitch"]); - this._frequency = new Signal({ context: this.context }); - this._delayA = new Delay({ - maxDelay: 1, - context: this.context - }); - this._lfoA = new LFO({ - context: this.context, - min: 0, - max: 0.1, - type: "sawtooth" - }).connect(this._delayA.delayTime); - this._delayB = new Delay({ - maxDelay: 1, - context: this.context - }); - this._lfoB = new LFO({ - context: this.context, - min: 0, - max: 0.1, - type: "sawtooth", - phase: 180 - }).connect(this._delayB.delayTime); - this._crossFade = new CrossFade({ context: this.context }); - this._crossFadeLFO = new LFO({ - context: this.context, - min: 0, - max: 1, - type: "triangle", - phase: 90 - }).connect(this._crossFade.fade); - this._feedbackDelay = new Delay({ - delayTime: options.delayTime, - context: this.context, - }); - this.delayTime = this._feedbackDelay.delayTime; - readOnly(this, "delayTime"); - this._pitch = options.pitch; - this._windowSize = options.windowSize; - // connect the two delay lines up - this._delayA.connect(this._crossFade.a); - this._delayB.connect(this._crossFade.b); - // connect the frequency - this._frequency.fan(this._lfoA.frequency, this._lfoB.frequency, this._crossFadeLFO.frequency); - // route the input - this.effectSend.fan(this._delayA, this._delayB); - this._crossFade.chain(this._feedbackDelay, this.effectReturn); - // start the LFOs at the same time - const now = this.now(); - this._lfoA.start(now); - this._lfoB.start(now); - this._crossFadeLFO.start(now); - // set the initial value - this.windowSize = this._windowSize; - } - static getDefaults() { - return Object.assign(FeedbackEffect.getDefaults(), { - pitch: 0, - windowSize: 0.1, - delayTime: 0, - feedback: 0 - }); - } - /** - * Repitch the incoming signal by some interval (measured in semi-tones). - * @example - * const pitchShift = new Tone.PitchShift().toDestination(); - * const osc = new Tone.Oscillator().connect(pitchShift).start().toDestination(); - * pitchShift.pitch = -12; // down one octave - * pitchShift.pitch = 7; // up a fifth - */ - get pitch() { - return this._pitch; - } - set pitch(interval) { - this._pitch = interval; - let factor = 0; - if (interval < 0) { - this._lfoA.min = 0; - this._lfoA.max = this._windowSize; - this._lfoB.min = 0; - this._lfoB.max = this._windowSize; - factor = intervalToFrequencyRatio(interval - 1) + 1; - } - else { - this._lfoA.min = this._windowSize; - this._lfoA.max = 0; - this._lfoB.min = this._windowSize; - this._lfoB.max = 0; - factor = intervalToFrequencyRatio(interval) - 1; - } - this._frequency.value = factor * (1.2 / this._windowSize); - } - /** - * The window size corresponds roughly to the sample length in a looping sampler. - * Smaller values are desirable for a less noticeable delay time of the pitch shifted - * signal, but larger values will result in smoother pitch shifting for larger intervals. - * A nominal range of 0.03 to 0.1 is recommended. - */ - get windowSize() { - return this._windowSize; - } - set windowSize(size) { - this._windowSize = this.toSeconds(size); - this.pitch = this._pitch; - } - dispose() { - super.dispose(); - this._frequency.dispose(); - this._delayA.dispose(); - this._delayB.dispose(); - this._lfoA.dispose(); - this._lfoB.dispose(); - this._crossFade.dispose(); - this._crossFadeLFO.dispose(); - this._feedbackDelay.dispose(); - return this; - } -} - -/** - * Phaser is a phaser effect. Phasers work by changing the phase - * of different frequency components of an incoming signal. Read more on - * [Wikipedia](https://en.wikipedia.org/wiki/Phaser_(effect)). - * Inspiration for this phaser comes from [Tuna.js](https://github.com/Dinahmoe/tuna/). - * @example - * const phaser = new Tone.Phaser({ - * frequency: 15, - * octaves: 5, - * baseFrequency: 1000 - * }).toDestination(); - * const synth = new Tone.FMSynth().connect(phaser); - * synth.triggerAttackRelease("E3", "2n"); - * @category Effect - */ -class Phaser extends StereoEffect { - constructor() { - super(optionsFromArguments(Phaser.getDefaults(), arguments, ["frequency", "octaves", "baseFrequency"])); - this.name = "Phaser"; - const options = optionsFromArguments(Phaser.getDefaults(), arguments, ["frequency", "octaves", "baseFrequency"]); - this._lfoL = new LFO({ - context: this.context, - frequency: options.frequency, - min: 0, - max: 1 - }); - this._lfoR = new LFO({ - context: this.context, - frequency: options.frequency, - min: 0, - max: 1, - phase: 180, - }); - this._baseFrequency = this.toFrequency(options.baseFrequency); - this._octaves = options.octaves; - this.Q = new Signal({ - context: this.context, - value: options.Q, - units: "positive", - }); - this._filtersL = this._makeFilters(options.stages, this._lfoL); - this._filtersR = this._makeFilters(options.stages, this._lfoR); - this.frequency = this._lfoL.frequency; - this.frequency.value = options.frequency; - // connect them up - this.connectEffectLeft(...this._filtersL); - this.connectEffectRight(...this._filtersR); - // control the frequency with one LFO - this._lfoL.frequency.connect(this._lfoR.frequency); - // set the options - this.baseFrequency = options.baseFrequency; - this.octaves = options.octaves; - // start the lfo - this._lfoL.start(); - this._lfoR.start(); - readOnly(this, ["frequency", "Q"]); - } - static getDefaults() { - return Object.assign(StereoEffect.getDefaults(), { - frequency: 0.5, - octaves: 3, - stages: 10, - Q: 10, - baseFrequency: 350, - }); - } - _makeFilters(stages, connectToFreq) { - const filters = []; - // make all the filters - for (let i = 0; i < stages; i++) { - const filter = this.context.createBiquadFilter(); - filter.type = "allpass"; - this.Q.connect(filter.Q); - connectToFreq.connect(filter.frequency); - filters.push(filter); - } - return filters; - } - /** - * The number of octaves the phase goes above the baseFrequency - */ - get octaves() { - return this._octaves; - } - set octaves(octaves) { - this._octaves = octaves; - const max = this._baseFrequency * Math.pow(2, octaves); - this._lfoL.max = max; - this._lfoR.max = max; - } - /** - * The the base frequency of the filters. - */ - get baseFrequency() { - return this._baseFrequency; - } - set baseFrequency(freq) { - this._baseFrequency = this.toFrequency(freq); - this._lfoL.min = this._baseFrequency; - this._lfoR.min = this._baseFrequency; - this.octaves = this._octaves; - } - dispose() { - super.dispose(); - this.Q.dispose(); - this._lfoL.dispose(); - this._lfoR.dispose(); - this._filtersL.forEach(f => f.disconnect()); - this._filtersR.forEach(f => f.disconnect()); - this.frequency.dispose(); - return this; - } -} - -/** - * Simple convolution created with decaying noise. - * Generates an Impulse Response Buffer - * with Tone.Offline then feeds the IR into ConvolverNode. - * The impulse response generation is async, so you have - * to wait until [[ready]] resolves before it will make a sound. - * - * Inspiration from [ReverbGen](https://github.com/adelespinasse/reverbGen). - * Copyright (c) 2014 Alan deLespinasse Apache 2.0 License. - * - * @category Effect - */ -class Reverb extends Effect { - constructor() { - super(optionsFromArguments(Reverb.getDefaults(), arguments, ["decay"])); - this.name = "Reverb"; - /** - * Convolver node - */ - this._convolver = this.context.createConvolver(); - /** - * Resolves when the reverb buffer is generated. Whenever either [[decay]] - * or [[preDelay]] are set, you have to wait until [[ready]] resolves - * before the IR is generated with the latest values. - */ - this.ready = Promise.resolve(); - const options = optionsFromArguments(Reverb.getDefaults(), arguments, ["decay"]); - this._decay = options.decay; - this._preDelay = options.preDelay; - this.generate(); - this.connectEffect(this._convolver); - } - static getDefaults() { - return Object.assign(Effect.getDefaults(), { - decay: 1.5, - preDelay: 0.01, - }); - } - /** - * The duration of the reverb. - */ - get decay() { - return this._decay; - } - set decay(time) { - time = this.toSeconds(time); - assertRange(time, 0.001); - this._decay = time; - this.generate(); - } - /** - * The amount of time before the reverb is fully ramped in. - */ - get preDelay() { - return this._preDelay; - } - set preDelay(time) { - time = this.toSeconds(time); - assertRange(time, 0); - this._preDelay = time; - this.generate(); - } - /** - * Generate the Impulse Response. Returns a promise while the IR is being generated. - * @return Promise which returns this object. - */ - generate() { - return __awaiter(this, void 0, void 0, function* () { - const previousReady = this.ready; - // create a noise burst which decays over the duration in each channel - const context = new OfflineContext(2, this._decay + this._preDelay, this.context.sampleRate); - const noiseL = new Noise({ context }); - const noiseR = new Noise({ context }); - const merge = new Merge({ context }); - noiseL.connect(merge, 0, 0); - noiseR.connect(merge, 0, 1); - const gainNode = new Gain({ context }).toDestination(); - merge.connect(gainNode); - noiseL.start(0); - noiseR.start(0); - // predelay - gainNode.gain.setValueAtTime(0, 0); - gainNode.gain.setValueAtTime(1, this._preDelay); - // decay - gainNode.gain.exponentialApproachValueAtTime(0, this._preDelay, this.decay); - // render the buffer - const renderPromise = context.render(); - this.ready = renderPromise.then(noOp); - // wait for the previous `ready` to resolve - yield previousReady; - // set the buffer - this._convolver.buffer = (yield renderPromise).get(); - return this; - }); - } - dispose() { - super.dispose(); - this._convolver.disconnect(); - return this; - } -} - -/** - * Mid/Side processing separates the the 'mid' signal (which comes out of both the left and the right channel) - * and the 'side' (which only comes out of the the side channels). - * ``` - * Mid = (Left+Right)/sqrt(2); // obtain mid-signal from left and right - * Side = (Left-Right)/sqrt(2); // obtain side-signal from left and right - * ``` - * @category Component - */ -class MidSideSplit extends ToneAudioNode { - constructor() { - super(optionsFromArguments(MidSideSplit.getDefaults(), arguments)); - this.name = "MidSideSplit"; - this._split = this.input = new Split({ - channels: 2, - context: this.context - }); - this._midAdd = new Add({ context: this.context }); - this.mid = new Multiply({ - context: this.context, - value: Math.SQRT1_2, - }); - this._sideSubtract = new Subtract({ context: this.context }); - this.side = new Multiply({ - context: this.context, - value: Math.SQRT1_2, - }); - this._split.connect(this._midAdd, 0); - this._split.connect(this._midAdd.addend, 1); - this._split.connect(this._sideSubtract, 0); - this._split.connect(this._sideSubtract.subtrahend, 1); - this._midAdd.connect(this.mid); - this._sideSubtract.connect(this.side); - } - dispose() { - super.dispose(); - this.mid.dispose(); - this.side.dispose(); - this._midAdd.dispose(); - this._sideSubtract.dispose(); - this._split.dispose(); - return this; - } -} - -/** - * MidSideMerge merges the mid and side signal after they've been separated by [[MidSideSplit]] - * ``` - * Mid = (Left+Right)/sqrt(2); // obtain mid-signal from left and right - * Side = (Left-Right)/sqrt(2); // obtain side-signal from left and right - * ``` - * @category Component - */ -class MidSideMerge extends ToneAudioNode { - constructor() { - super(optionsFromArguments(MidSideMerge.getDefaults(), arguments)); - this.name = "MidSideMerge"; - this.mid = new Gain({ context: this.context }); - this.side = new Gain({ context: this.context }); - this._left = new Add({ context: this.context }); - this._leftMult = new Multiply({ - context: this.context, - value: Math.SQRT1_2 - }); - this._right = new Subtract({ context: this.context }); - this._rightMult = new Multiply({ - context: this.context, - value: Math.SQRT1_2 - }); - this._merge = this.output = new Merge({ context: this.context }); - this.mid.fan(this._left); - this.side.connect(this._left.addend); - this.mid.connect(this._right); - this.side.connect(this._right.subtrahend); - this._left.connect(this._leftMult); - this._right.connect(this._rightMult); - this._leftMult.connect(this._merge, 0, 0); - this._rightMult.connect(this._merge, 0, 1); - } - dispose() { - super.dispose(); - this.mid.dispose(); - this.side.dispose(); - this._leftMult.dispose(); - this._rightMult.dispose(); - this._left.dispose(); - this._right.dispose(); - return this; - } -} - -/** - * Mid/Side processing separates the the 'mid' signal - * (which comes out of both the left and the right channel) - * and the 'side' (which only comes out of the the side channels) - * and effects them separately before being recombined. - * Applies a Mid/Side seperation and recombination. - * Algorithm found in [kvraudio forums](http://www.kvraudio.com/forum/viewtopic.php?t=212587). - * This is a base-class for Mid/Side Effects. - * @category Effect - */ -class MidSideEffect extends Effect { - constructor(options) { - super(options); - this.name = "MidSideEffect"; - this._midSideMerge = new MidSideMerge({ context: this.context }); - this._midSideSplit = new MidSideSplit({ context: this.context }); - this._midSend = this._midSideSplit.mid; - this._sideSend = this._midSideSplit.side; - this._midReturn = this._midSideMerge.mid; - this._sideReturn = this._midSideMerge.side; - // the connections - this.effectSend.connect(this._midSideSplit); - this._midSideMerge.connect(this.effectReturn); - } - /** - * Connect the mid chain of the effect - */ - connectEffectMid(...nodes) { - this._midSend.chain(...nodes, this._midReturn); - } - /** - * Connect the side chain of the effect - */ - connectEffectSide(...nodes) { - this._sideSend.chain(...nodes, this._sideReturn); - } - dispose() { - super.dispose(); - this._midSideSplit.dispose(); - this._midSideMerge.dispose(); - this._midSend.dispose(); - this._sideSend.dispose(); - this._midReturn.dispose(); - this._sideReturn.dispose(); - return this; - } -} - -/** - * Applies a width factor to the mid/side seperation. - * 0 is all mid and 1 is all side. - * Algorithm found in [kvraudio forums](http://www.kvraudio.com/forum/viewtopic.php?t=212587). - * ``` - * Mid *= 2*(1-width)
- * Side *= 2*width - * ``` - * @category Effect - */ -class StereoWidener extends MidSideEffect { - constructor() { - super(optionsFromArguments(StereoWidener.getDefaults(), arguments, ["width"])); - this.name = "StereoWidener"; - const options = optionsFromArguments(StereoWidener.getDefaults(), arguments, ["width"]); - this.width = new Signal({ - context: this.context, - value: options.width, - units: "normalRange", - }); - readOnly(this, ["width"]); - this._twoTimesWidthMid = new Multiply({ - context: this.context, - value: 2, - }); - this._twoTimesWidthSide = new Multiply({ - context: this.context, - value: 2, - }); - this._midMult = new Multiply({ context: this.context }); - this._twoTimesWidthMid.connect(this._midMult.factor); - this.connectEffectMid(this._midMult); - this._oneMinusWidth = new Subtract({ context: this.context }); - this._oneMinusWidth.connect(this._twoTimesWidthMid); - connect(this.context.getConstant(1), this._oneMinusWidth); - this.width.connect(this._oneMinusWidth.subtrahend); - this._sideMult = new Multiply({ context: this.context }); - this.width.connect(this._twoTimesWidthSide); - this._twoTimesWidthSide.connect(this._sideMult.factor); - this.connectEffectSide(this._sideMult); - } - static getDefaults() { - return Object.assign(MidSideEffect.getDefaults(), { - width: 0.5, - }); - } - dispose() { - super.dispose(); - this.width.dispose(); - this._midMult.dispose(); - this._sideMult.dispose(); - this._twoTimesWidthMid.dispose(); - this._twoTimesWidthSide.dispose(); - this._oneMinusWidth.dispose(); - return this; - } -} - -/** - * Tremolo modulates the amplitude of an incoming signal using an [[LFO]]. - * The effect is a stereo effect where the modulation phase is inverted in each channel. - * - * @example - * // create a tremolo and start it's LFO - * const tremolo = new Tone.Tremolo(9, 0.75).toDestination().start(); - * // route an oscillator through the tremolo and start it - * const oscillator = new Tone.Oscillator().connect(tremolo).start(); - * - * @category Effect - */ -class Tremolo extends StereoEffect { - constructor() { - super(optionsFromArguments(Tremolo.getDefaults(), arguments, ["frequency", "depth"])); - this.name = "Tremolo"; - const options = optionsFromArguments(Tremolo.getDefaults(), arguments, ["frequency", "depth"]); - this._lfoL = new LFO({ - context: this.context, - type: options.type, - min: 1, - max: 0, - }); - this._lfoR = new LFO({ - context: this.context, - type: options.type, - min: 1, - max: 0, - }); - this._amplitudeL = new Gain({ context: this.context }); - this._amplitudeR = new Gain({ context: this.context }); - this.frequency = new Signal({ - context: this.context, - value: options.frequency, - units: "frequency", - }); - this.depth = new Signal({ - context: this.context, - value: options.depth, - units: "normalRange", - }); - readOnly(this, ["frequency", "depth"]); - this.connectEffectLeft(this._amplitudeL); - this.connectEffectRight(this._amplitudeR); - this._lfoL.connect(this._amplitudeL.gain); - this._lfoR.connect(this._amplitudeR.gain); - this.frequency.fan(this._lfoL.frequency, this._lfoR.frequency); - this.depth.fan(this._lfoR.amplitude, this._lfoL.amplitude); - this.spread = options.spread; - } - static getDefaults() { - return Object.assign(StereoEffect.getDefaults(), { - frequency: 10, - type: "sine", - depth: 0.5, - spread: 180, - }); - } - /** - * Start the tremolo. - */ - start(time) { - this._lfoL.start(time); - this._lfoR.start(time); - return this; - } - /** - * Stop the tremolo. - */ - stop(time) { - this._lfoL.stop(time); - this._lfoR.stop(time); - return this; - } - /** - * Sync the effect to the transport. - */ - sync() { - this._lfoL.sync(); - this._lfoR.sync(); - this.context.transport.syncSignal(this.frequency); - return this; - } - /** - * Unsync the filter from the transport - */ - unsync() { - this._lfoL.unsync(); - this._lfoR.unsync(); - this.context.transport.unsyncSignal(this.frequency); - return this; - } - /** - * The oscillator type. - */ - get type() { - return this._lfoL.type; - } - set type(type) { - this._lfoL.type = type; - this._lfoR.type = type; - } - /** - * Amount of stereo spread. When set to 0, both LFO's will be panned centrally. - * When set to 180, LFO's will be panned hard left and right respectively. - */ - get spread() { - return this._lfoR.phase - this._lfoL.phase; // 180 - } - set spread(spread) { - this._lfoL.phase = 90 - (spread / 2); - this._lfoR.phase = (spread / 2) + 90; - } - dispose() { - super.dispose(); - this._lfoL.dispose(); - this._lfoR.dispose(); - this._amplitudeL.dispose(); - this._amplitudeR.dispose(); - this.frequency.dispose(); - this.depth.dispose(); - return this; - } -} - -/** - * A Vibrato effect composed of a Tone.Delay and a Tone.LFO. The LFO - * modulates the delayTime of the delay, causing the pitch to rise and fall. - * @category Effect - */ -class Vibrato extends Effect { - constructor() { - super(optionsFromArguments(Vibrato.getDefaults(), arguments, ["frequency", "depth"])); - this.name = "Vibrato"; - const options = optionsFromArguments(Vibrato.getDefaults(), arguments, ["frequency", "depth"]); - this._delayNode = new Delay({ - context: this.context, - delayTime: 0, - maxDelay: options.maxDelay, - }); - this._lfo = new LFO({ - context: this.context, - type: options.type, - min: 0, - max: options.maxDelay, - frequency: options.frequency, - phase: -90 // offse the phase so the resting position is in the center - }).start().connect(this._delayNode.delayTime); - this.frequency = this._lfo.frequency; - this.depth = this._lfo.amplitude; - this.depth.value = options.depth; - readOnly(this, ["frequency", "depth"]); - this.effectSend.chain(this._delayNode, this.effectReturn); - } - static getDefaults() { - return Object.assign(Effect.getDefaults(), { - maxDelay: 0.005, - frequency: 5, - depth: 0.1, - type: "sine" - }); - } - /** - * Type of oscillator attached to the Vibrato. - */ - get type() { - return this._lfo.type; - } - set type(type) { - this._lfo.type = type; - } - dispose() { - super.dispose(); - this._delayNode.dispose(); - this._lfo.dispose(); - this.frequency.dispose(); - this.depth.dispose(); - return this; - } -} - -/** - * Wrapper around the native Web Audio's [AnalyserNode](http://webaudio.github.io/web-audio-api/#idl-def-AnalyserNode). - * Extracts FFT or Waveform data from the incoming signal. - * @category Component - */ -class Analyser extends ToneAudioNode { - constructor() { - super(optionsFromArguments(Analyser.getDefaults(), arguments, ["type", "size"])); - this.name = "Analyser"; - /** - * The analyser node. - */ - this._analysers = []; - /** - * The buffer that the FFT data is written to - */ - this._buffers = []; - const options = optionsFromArguments(Analyser.getDefaults(), arguments, ["type", "size"]); - this.input = this.output = this._gain = new Gain({ context: this.context }); - this._split = new Split({ - context: this.context, - channels: options.channels, - }); - this.input.connect(this._split); - assertRange(options.channels, 1); - // create the analysers - for (let channel = 0; channel < options.channels; channel++) { - this._analysers[channel] = this.context.createAnalyser(); - this._split.connect(this._analysers[channel], channel, 0); - } - // set the values initially - this.size = options.size; - this.type = options.type; - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - size: 1024, - smoothing: 0.8, - type: "fft", - channels: 1, - }); - } - /** - * Run the analysis given the current settings. If [[channels]] = 1, - * it will return a Float32Array. If [[channels]] > 1, it will - * return an array of Float32Arrays where each index in the array - * represents the analysis done on a channel. - */ - getValue() { - this._analysers.forEach((analyser, index) => { - const buffer = this._buffers[index]; - if (this._type === "fft") { - analyser.getFloatFrequencyData(buffer); - } - else if (this._type === "waveform") { - analyser.getFloatTimeDomainData(buffer); - } - }); - if (this.channels === 1) { - return this._buffers[0]; - } - else { - return this._buffers; - } - } - /** - * The size of analysis. This must be a power of two in the range 16 to 16384. - */ - get size() { - return this._analysers[0].frequencyBinCount; - } - set size(size) { - this._analysers.forEach((analyser, index) => { - analyser.fftSize = size * 2; - this._buffers[index] = new Float32Array(size); - }); - } - /** - * The number of channels the analyser does the analysis on. Channel - * separation is done using [[Split]] - */ - get channels() { - return this._analysers.length; - } - /** - * The analysis function returned by analyser.getValue(), either "fft" or "waveform". - */ - get type() { - return this._type; - } - set type(type) { - assert(type === "waveform" || type === "fft", `Analyser: invalid type: ${type}`); - this._type = type; - } - /** - * 0 represents no time averaging with the last analysis frame. - */ - get smoothing() { - return this._analysers[0].smoothingTimeConstant; - } - set smoothing(val) { - this._analysers.forEach(a => a.smoothingTimeConstant = val); - } - /** - * Clean up. - */ - dispose() { - super.dispose(); - this._analysers.forEach(a => a.disconnect()); - this._split.dispose(); - this._gain.dispose(); - return this; - } -} - -/** - * The base class for Metering classes. - */ -class MeterBase extends ToneAudioNode { - constructor() { - super(optionsFromArguments(MeterBase.getDefaults(), arguments)); - this.name = "MeterBase"; - this.input = this.output = this._analyser = new Analyser({ - context: this.context, - size: 256, - type: "waveform", - }); - } - dispose() { - super.dispose(); - this._analyser.dispose(); - return this; - } -} - -/** - * Meter gets the [RMS](https://en.wikipedia.org/wiki/Root_mean_square) - * of an input signal. It can also get the raw value of the input signal. - * - * @example - * const meter = new Tone.Meter(); - * const mic = new Tone.UserMedia(); - * mic.open(); - * // connect mic to the meter - * mic.connect(meter); - * // the current level of the mic - * setInterval(() => console.log(meter.getValue()), 100); - * @category Component - */ -class Meter extends MeterBase { - constructor() { - super(optionsFromArguments(Meter.getDefaults(), arguments, ["smoothing"])); - this.name = "Meter"; - /** - * The previous frame's value - */ - this._rms = 0; - const options = optionsFromArguments(Meter.getDefaults(), arguments, ["smoothing"]); - this.input = this.output = this._analyser = new Analyser({ - context: this.context, - size: 256, - type: "waveform", - channels: options.channels, - }); - this.smoothing = options.smoothing, - this.normalRange = options.normalRange; - } - static getDefaults() { - return Object.assign(MeterBase.getDefaults(), { - smoothing: 0.8, - normalRange: false, - channels: 1, - }); - } - /** - * Use [[getValue]] instead. For the previous getValue behavior, use DCMeter. - * @deprecated - */ - getLevel() { - warn("'getLevel' has been changed to 'getValue'"); - return this.getValue(); - } - /** - * Get the current value of the incoming signal. - * Output is in decibels when [[normalRange]] is `false`. - * If [[channels]] = 1, then the output is a single number - * representing the value of the input signal. When [[channels]] > 1, - * then each channel is returned as a value in a number array. - */ - getValue() { - const aValues = this._analyser.getValue(); - const channelValues = this.channels === 1 ? [aValues] : aValues; - const vals = channelValues.map(values => { - const totalSquared = values.reduce((total, current) => total + current * current, 0); - const rms = Math.sqrt(totalSquared / values.length); - // the rms can only fall at the rate of the smoothing - // but can jump up instantly - this._rms = Math.max(rms, this._rms * this.smoothing); - return this.normalRange ? this._rms : gainToDb(this._rms); - }); - if (this.channels === 1) { - return vals[0]; - } - else { - return vals; - } - } - /** - * The number of channels of analysis. - */ - get channels() { - return this._analyser.channels; - } - dispose() { - super.dispose(); - this._analyser.dispose(); - return this; - } -} - -/** - * Get the current frequency data of the connected audio source using a fast Fourier transform. - * @category Component - */ -class FFT extends MeterBase { - constructor() { - super(optionsFromArguments(FFT.getDefaults(), arguments, ["size"])); - this.name = "FFT"; - const options = optionsFromArguments(FFT.getDefaults(), arguments, ["size"]); - this.normalRange = options.normalRange; - this._analyser.type = "fft"; - this.size = options.size; - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - normalRange: false, - size: 1024, - smoothing: 0.8, - }); - } - /** - * Gets the current frequency data from the connected audio source. - * Returns the frequency data of length [[size]] as a Float32Array of decibel values. - */ - getValue() { - const values = this._analyser.getValue(); - return values.map(v => this.normalRange ? dbToGain(v) : v); - } - /** - * The size of analysis. This must be a power of two in the range 16 to 16384. - * Determines the size of the array returned by [[getValue]] (i.e. the number of - * frequency bins). Large FFT sizes may be costly to compute. - */ - get size() { - return this._analyser.size; - } - set size(size) { - this._analyser.size = size; - } - /** - * 0 represents no time averaging with the last analysis frame. - */ - get smoothing() { - return this._analyser.smoothing; - } - set smoothing(val) { - this._analyser.smoothing = val; - } - /** - * Returns the frequency value in hertz of each of the indices of the FFT's [[getValue]] response. - * @example - * const fft = new Tone.FFT(32); - * console.log([0, 1, 2, 3, 4].map(index => fft.getFrequencyOfIndex(index))); - */ - getFrequencyOfIndex(index) { - assert(0 <= index && index < this.size, `index must be greater than or equal to 0 and less than ${this.size}`); - return index * this.context.sampleRate / (this.size * 2); - } -} - -/** - * DCMeter gets the raw value of the input signal at the current time. - * - * @example - * const meter = new Tone.DCMeter(); - * const mic = new Tone.UserMedia(); - * mic.open(); - * // connect mic to the meter - * mic.connect(meter); - * // the current level of the mic - * const level = meter.getValue(); - * @category Component - */ -class DCMeter extends MeterBase { - constructor() { - super(optionsFromArguments(DCMeter.getDefaults(), arguments)); - this.name = "DCMeter"; - this._analyser.type = "waveform"; - this._analyser.size = 256; - } - /** - * Get the signal value of the incoming signal - */ - getValue() { - const value = this._analyser.getValue(); - return value[0]; - } -} - -/** - * Get the current waveform data of the connected audio source. - * @category Component - */ -class Waveform extends MeterBase { - constructor() { - super(optionsFromArguments(Waveform.getDefaults(), arguments, ["size"])); - this.name = "Waveform"; - const options = optionsFromArguments(Waveform.getDefaults(), arguments, ["size"]); - this._analyser.type = "waveform"; - this.size = options.size; - } - static getDefaults() { - return Object.assign(MeterBase.getDefaults(), { - size: 1024, - }); - } - /** - * Return the waveform for the current time as a Float32Array where each value in the array - * represents a sample in the waveform. - */ - getValue() { - return this._analyser.getValue(); - } - /** - * The size of analysis. This must be a power of two in the range 16 to 16384. - * Determines the size of the array returned by [[getValue]]. - */ - get size() { - return this._analyser.size; - } - set size(size) { - this._analyser.size = size; - } -} - -/** - * Mono coerces the incoming mono or stereo signal into a mono signal - * where both left and right channels have the same value. This can be useful - * for [stereo imaging](https://en.wikipedia.org/wiki/Stereo_imaging). - * @category Component - */ -class Mono extends ToneAudioNode { - constructor() { - super(optionsFromArguments(Mono.getDefaults(), arguments)); - this.name = "Mono"; - this.input = new Gain({ context: this.context }); - this._merge = this.output = new Merge({ - channels: 2, - context: this.context, - }); - this.input.connect(this._merge, 0, 0); - this.input.connect(this._merge, 0, 1); - } - dispose() { - super.dispose(); - this._merge.dispose(); - this.input.dispose(); - return this; - } -} - -/** - * Split the incoming signal into three bands (low, mid, high) - * with two crossover frequency controls. - * ``` - * +----------------------+ - * +-> input < lowFrequency +------------------> low - * | +----------------------+ - * | - * | +--------------------------------------+ - * input ---+-> lowFrequency < input < highFrequency +--> mid - * | +--------------------------------------+ - * | - * | +-----------------------+ - * +-> highFrequency < input +-----------------> high - * +-----------------------+ - * ``` - * @category Component - */ -class MultibandSplit extends ToneAudioNode { - constructor() { - super(optionsFromArguments(MultibandSplit.getDefaults(), arguments, ["lowFrequency", "highFrequency"])); - this.name = "MultibandSplit"; - /** - * the input - */ - this.input = new Gain({ context: this.context }); - /** - * no output node, use either low, mid or high outputs - */ - this.output = undefined; - /** - * The low band. - */ - this.low = new Filter({ - context: this.context, - frequency: 0, - type: "lowpass", - }); - /** - * the lower filter of the mid band - */ - this._lowMidFilter = new Filter({ - context: this.context, - frequency: 0, - type: "highpass", - }); - /** - * The mid band output. - */ - this.mid = new Filter({ - context: this.context, - frequency: 0, - type: "lowpass", - }); - /** - * The high band output. - */ - this.high = new Filter({ - context: this.context, - frequency: 0, - type: "highpass", - }); - this._internalChannels = [this.low, this.mid, this.high]; - const options = optionsFromArguments(MultibandSplit.getDefaults(), arguments, ["lowFrequency", "highFrequency"]); - this.lowFrequency = new Signal({ - context: this.context, - units: "frequency", - value: options.lowFrequency, - }); - this.highFrequency = new Signal({ - context: this.context, - units: "frequency", - value: options.highFrequency, - }); - this.Q = new Signal({ - context: this.context, - units: "positive", - value: options.Q, - }); - this.input.fan(this.low, this.high); - this.input.chain(this._lowMidFilter, this.mid); - // the frequency control signal - this.lowFrequency.fan(this.low.frequency, this._lowMidFilter.frequency); - this.highFrequency.fan(this.mid.frequency, this.high.frequency); - // the Q value - this.Q.connect(this.low.Q); - this.Q.connect(this._lowMidFilter.Q); - this.Q.connect(this.mid.Q); - this.Q.connect(this.high.Q); - readOnly(this, ["high", "mid", "low", "highFrequency", "lowFrequency"]); - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - Q: 1, - highFrequency: 2500, - lowFrequency: 400, - }); - } - /** - * Clean up. - */ - dispose() { - super.dispose(); - writable(this, ["high", "mid", "low", "highFrequency", "lowFrequency"]); - this.low.dispose(); - this._lowMidFilter.dispose(); - this.mid.dispose(); - this.high.dispose(); - this.lowFrequency.dispose(); - this.highFrequency.dispose(); - this.Q.dispose(); - return this; - } -} - -/** - * A spatialized panner node which supports equalpower or HRTF panning. - * @category Component - */ -class Panner3D extends ToneAudioNode { - constructor() { - super(optionsFromArguments(Panner3D.getDefaults(), arguments, ["positionX", "positionY", "positionZ"])); - this.name = "Panner3D"; - const options = optionsFromArguments(Panner3D.getDefaults(), arguments, ["positionX", "positionY", "positionZ"]); - this._panner = this.input = this.output = this.context.createPanner(); - // set some values - this.panningModel = options.panningModel; - this.maxDistance = options.maxDistance; - this.distanceModel = options.distanceModel; - this.coneOuterGain = options.coneOuterGain; - this.coneOuterAngle = options.coneOuterAngle; - this.coneInnerAngle = options.coneInnerAngle; - this.refDistance = options.refDistance; - this.rolloffFactor = options.rolloffFactor; - this.positionX = new Param({ - context: this.context, - param: this._panner.positionX, - value: options.positionX, - }); - this.positionY = new Param({ - context: this.context, - param: this._panner.positionY, - value: options.positionY, - }); - this.positionZ = new Param({ - context: this.context, - param: this._panner.positionZ, - value: options.positionZ, - }); - this.orientationX = new Param({ - context: this.context, - param: this._panner.orientationX, - value: options.orientationX, - }); - this.orientationY = new Param({ - context: this.context, - param: this._panner.orientationY, - value: options.orientationY, - }); - this.orientationZ = new Param({ - context: this.context, - param: this._panner.orientationZ, - value: options.orientationZ, - }); - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - coneInnerAngle: 360, - coneOuterAngle: 360, - coneOuterGain: 0, - distanceModel: "inverse", - maxDistance: 10000, - orientationX: 0, - orientationY: 0, - orientationZ: 0, - panningModel: "equalpower", - positionX: 0, - positionY: 0, - positionZ: 0, - refDistance: 1, - rolloffFactor: 1, - }); - } - /** - * Sets the position of the source in 3d space. - */ - setPosition(x, y, z) { - this.positionX.value = x; - this.positionY.value = y; - this.positionZ.value = z; - return this; - } - /** - * Sets the orientation of the source in 3d space. - */ - setOrientation(x, y, z) { - this.orientationX.value = x; - this.orientationY.value = y; - this.orientationZ.value = z; - return this; - } - /** - * The panning model. Either "equalpower" or "HRTF". - */ - get panningModel() { - return this._panner.panningModel; - } - set panningModel(val) { - this._panner.panningModel = val; - } - /** - * A reference distance for reducing volume as source move further from the listener - */ - get refDistance() { - return this._panner.refDistance; - } - set refDistance(val) { - this._panner.refDistance = val; - } - /** - * Describes how quickly the volume is reduced as source moves away from listener. - */ - get rolloffFactor() { - return this._panner.rolloffFactor; - } - set rolloffFactor(val) { - this._panner.rolloffFactor = val; - } - /** - * The distance model used by, "linear", "inverse", or "exponential". - */ - get distanceModel() { - return this._panner.distanceModel; - } - set distanceModel(val) { - this._panner.distanceModel = val; - } - /** - * The angle, in degrees, inside of which there will be no volume reduction - */ - get coneInnerAngle() { - return this._panner.coneInnerAngle; - } - set coneInnerAngle(val) { - this._panner.coneInnerAngle = val; - } - /** - * The angle, in degrees, outside of which the volume will be reduced - * to a constant value of coneOuterGain - */ - get coneOuterAngle() { - return this._panner.coneOuterAngle; - } - set coneOuterAngle(val) { - this._panner.coneOuterAngle = val; - } - /** - * The gain outside of the coneOuterAngle - */ - get coneOuterGain() { - return this._panner.coneOuterGain; - } - set coneOuterGain(val) { - this._panner.coneOuterGain = val; - } - /** - * The maximum distance between source and listener, - * after which the volume will not be reduced any further. - */ - get maxDistance() { - return this._panner.maxDistance; - } - set maxDistance(val) { - this._panner.maxDistance = val; - } - dispose() { - super.dispose(); - this._panner.disconnect(); - this.orientationX.dispose(); - this.orientationY.dispose(); - this.orientationZ.dispose(); - this.positionX.dispose(); - this.positionY.dispose(); - this.positionZ.dispose(); - return this; - } -} - -/** - * A wrapper around the MediaRecorder API. Unlike the rest of Tone.js, this module does not offer - * any sample-accurate scheduling because it is not a feature of the MediaRecorder API. - * This is only natively supported in Chrome and Firefox. - * For a cross-browser shim, install (audio-recorder-polyfill)[https://www.npmjs.com/package/audio-recorder-polyfill]. - * @example - * const recorder = new Tone.Recorder(); - * const synth = new Tone.Synth().connect(recorder); - * // start recording - * recorder.start(); - * // generate a few notes - * synth.triggerAttackRelease("C3", 0.5); - * synth.triggerAttackRelease("C4", 0.5, "+1"); - * synth.triggerAttackRelease("C5", 0.5, "+2"); - * // wait for the notes to end and stop the recording - * setTimeout(async () => { - * // the recorded audio is returned as a blob - * const recording = await recorder.stop(); - * // download the recording by creating an anchor element and blob url - * const url = URL.createObjectURL(recording); - * const anchor = document.createElement("a"); - * anchor.download = "recording.webm"; - * anchor.href = url; - * anchor.click(); - * }, 4000); - * @category Component - */ -class Recorder extends ToneAudioNode { - constructor() { - super(optionsFromArguments(Recorder.getDefaults(), arguments)); - this.name = "Recorder"; - const options = optionsFromArguments(Recorder.getDefaults(), arguments); - this.input = new Gain({ - context: this.context - }); - assert(Recorder.supported, "Media Recorder API is not available"); - this._stream = this.context.createMediaStreamDestination(); - this.input.connect(this._stream); - this._recorder = new MediaRecorder(this._stream.stream, { - mimeType: options.mimeType - }); - } - static getDefaults() { - return ToneAudioNode.getDefaults(); - } - /** - * The mime type is the format that the audio is encoded in. For Chrome - * that is typically webm encoded as "vorbis". - */ - get mimeType() { - return this._recorder.mimeType; - } - /** - * Test if your platform supports the Media Recorder API. If it's not available, - * try installing this (polyfill)[https://www.npmjs.com/package/audio-recorder-polyfill]. - */ - static get supported() { - return theWindow !== null && Reflect.has(theWindow, "MediaRecorder"); - } - /** - * Get the playback state of the Recorder, either "started", "stopped" or "paused" - */ - get state() { - if (this._recorder.state === "inactive") { - return "stopped"; - } - else if (this._recorder.state === "paused") { - return "paused"; - } - else { - return "started"; - } - } - /** - * Start the Recorder. Returns a promise which resolves - * when the recorder has started. - */ - start() { - return __awaiter(this, void 0, void 0, function* () { - assert(this.state !== "started", "Recorder is already started"); - const startPromise = new Promise(done => { - const handleStart = () => { - this._recorder.removeEventListener("start", handleStart, false); - done(); - }; - this._recorder.addEventListener("start", handleStart, false); - }); - this._recorder.start(); - return yield startPromise; - }); - } - /** - * Stop the recorder. Returns a promise with the recorded content until this point - * encoded as [[mimeType]] - */ - stop() { - return __awaiter(this, void 0, void 0, function* () { - assert(this.state !== "stopped", "Recorder is not started"); - const dataPromise = new Promise(done => { - const handleData = (e) => { - this._recorder.removeEventListener("dataavailable", handleData, false); - done(e.data); - }; - this._recorder.addEventListener("dataavailable", handleData, false); - }); - this._recorder.stop(); - return yield dataPromise; - }); - } - /** - * Pause the recorder - */ - pause() { - assert(this.state === "started", "Recorder must be started"); - this._recorder.pause(); - return this; - } - dispose() { - super.dispose(); - this.input.dispose(); - this._stream.disconnect(); - return this; - } -} - -/** - * Compressor is a thin wrapper around the Web Audio - * [DynamicsCompressorNode](http://webaudio.github.io/web-audio-api/#the-dynamicscompressornode-interface). - * Compression reduces the volume of loud sounds or amplifies quiet sounds - * by narrowing or "compressing" an audio signal's dynamic range. - * Read more on [Wikipedia](https://en.wikipedia.org/wiki/Dynamic_range_compression). - * @example - * const comp = new Tone.Compressor(-30, 3); - * @category Component - */ -class Compressor extends ToneAudioNode { - constructor() { - super(optionsFromArguments(Compressor.getDefaults(), arguments, ["threshold", "ratio"])); - this.name = "Compressor"; - /** - * the compressor node - */ - this._compressor = this.context.createDynamicsCompressor(); - this.input = this._compressor; - this.output = this._compressor; - const options = optionsFromArguments(Compressor.getDefaults(), arguments, ["threshold", "ratio"]); - this.threshold = new Param({ - minValue: this._compressor.threshold.minValue, - maxValue: this._compressor.threshold.maxValue, - context: this.context, - convert: false, - param: this._compressor.threshold, - units: "decibels", - value: options.threshold, - }); - this.attack = new Param({ - minValue: this._compressor.attack.minValue, - maxValue: this._compressor.attack.maxValue, - context: this.context, - param: this._compressor.attack, - units: "time", - value: options.attack, - }); - this.release = new Param({ - minValue: this._compressor.release.minValue, - maxValue: this._compressor.release.maxValue, - context: this.context, - param: this._compressor.release, - units: "time", - value: options.release, - }); - this.knee = new Param({ - minValue: this._compressor.knee.minValue, - maxValue: this._compressor.knee.maxValue, - context: this.context, - convert: false, - param: this._compressor.knee, - units: "decibels", - value: options.knee, - }); - this.ratio = new Param({ - minValue: this._compressor.ratio.minValue, - maxValue: this._compressor.ratio.maxValue, - context: this.context, - convert: false, - param: this._compressor.ratio, - units: "positive", - value: options.ratio, - }); - // set the defaults - readOnly(this, ["knee", "release", "attack", "ratio", "threshold"]); - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - attack: 0.003, - knee: 30, - ratio: 12, - release: 0.25, - threshold: -24, - }); - } - /** - * A read-only decibel value for metering purposes, representing the current amount of gain - * reduction that the compressor is applying to the signal. If fed no signal the value will be 0 (no gain reduction). - */ - get reduction() { - return this._compressor.reduction; - } - dispose() { - super.dispose(); - this._compressor.disconnect(); - this.attack.dispose(); - this.release.dispose(); - this.threshold.dispose(); - this.ratio.dispose(); - this.knee.dispose(); - return this; - } -} - -/** - * Gate only passes a signal through when the incoming - * signal exceeds a specified threshold. It uses [[Follower]] to follow the ampltiude - * of the incoming signal and compares it to the [[threshold]] value using [[GreaterThan]]. - * - * @example - * const gate = new Tone.Gate(-30, 0.2).toDestination(); - * const mic = new Tone.UserMedia().connect(gate); - * // the gate will only pass through the incoming - * // signal when it's louder than -30db - * @category Component - */ -class Gate extends ToneAudioNode { - constructor() { - super(Object.assign(optionsFromArguments(Gate.getDefaults(), arguments, ["threshold", "smoothing"]))); - this.name = "Gate"; - const options = optionsFromArguments(Gate.getDefaults(), arguments, ["threshold", "smoothing"]); - this._follower = new Follower({ - context: this.context, - smoothing: options.smoothing, - }); - this._gt = new GreaterThan({ - context: this.context, - value: dbToGain(options.threshold), - }); - this.input = new Gain({ context: this.context }); - this._gate = this.output = new Gain({ context: this.context }); - // connections - this.input.connect(this._gate); - // the control signal - this.input.chain(this._follower, this._gt, this._gate.gain); - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - smoothing: 0.1, - threshold: -40 - }); - } - /** - * The threshold of the gate in decibels - */ - get threshold() { - return gainToDb(this._gt.value); - } - set threshold(thresh) { - this._gt.value = dbToGain(thresh); - } - /** - * The attack/decay speed of the gate. See [[Follower.smoothing]] - */ - get smoothing() { - return this._follower.smoothing; - } - set smoothing(smoothingTime) { - this._follower.smoothing = smoothingTime; - } - dispose() { - super.dispose(); - this.input.dispose(); - this._follower.dispose(); - this._gt.dispose(); - this._gate.dispose(); - return this; - } -} - -/** - * Limiter will limit the loudness of an incoming signal. - * Under the hood it's composed of a [[Compressor]] with a fast attack - * and release and max compression ratio. - * - * @example - * const limiter = new Tone.Limiter(-20).toDestination(); - * const oscillator = new Tone.Oscillator().connect(limiter); - * oscillator.start(); - * @category Component - */ -class Limiter extends ToneAudioNode { - constructor() { - super(Object.assign(optionsFromArguments(Limiter.getDefaults(), arguments, ["threshold"]))); - this.name = "Limiter"; - const options = optionsFromArguments(Limiter.getDefaults(), arguments, ["threshold"]); - this._compressor = this.input = this.output = new Compressor({ - context: this.context, - ratio: 20, - attack: 0.003, - release: 0.01, - threshold: options.threshold - }); - this.threshold = this._compressor.threshold; - readOnly(this, "threshold"); - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - threshold: -12 - }); - } - /** - * A read-only decibel value for metering purposes, representing the current amount of gain - * reduction that the compressor is applying to the signal. - */ - get reduction() { - return this._compressor.reduction; - } - dispose() { - super.dispose(); - this._compressor.dispose(); - this.threshold.dispose(); - return this; - } -} - -/** - * MidSideCompressor applies two different compressors to the [[mid]] - * and [[side]] signal components of the input. See [[MidSideSplit]] and [[MidSideMerge]]. - * @category Component - */ -class MidSideCompressor extends ToneAudioNode { - constructor() { - super(Object.assign(optionsFromArguments(MidSideCompressor.getDefaults(), arguments))); - this.name = "MidSideCompressor"; - const options = optionsFromArguments(MidSideCompressor.getDefaults(), arguments); - this._midSideSplit = this.input = new MidSideSplit({ context: this.context }); - this._midSideMerge = this.output = new MidSideMerge({ context: this.context }); - this.mid = new Compressor(Object.assign(options.mid, { context: this.context })); - this.side = new Compressor(Object.assign(options.side, { context: this.context })); - this._midSideSplit.mid.chain(this.mid, this._midSideMerge.mid); - this._midSideSplit.side.chain(this.side, this._midSideMerge.side); - readOnly(this, ["mid", "side"]); - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - mid: { - ratio: 3, - threshold: -24, - release: 0.03, - attack: 0.02, - knee: 16 - }, - side: { - ratio: 6, - threshold: -30, - release: 0.25, - attack: 0.03, - knee: 10 - } - }); - } - dispose() { - super.dispose(); - this.mid.dispose(); - this.side.dispose(); - this._midSideSplit.dispose(); - this._midSideMerge.dispose(); - return this; - } -} - -/** - * A compressor with separate controls over low/mid/high dynamics. See [[Compressor]] and [[MultibandSplit]] - * - * @example - * const multiband = new Tone.MultibandCompressor({ - * lowFrequency: 200, - * highFrequency: 1300, - * low: { - * threshold: -12 - * } - * }); - * @category Component - */ -class MultibandCompressor extends ToneAudioNode { - constructor() { - super(Object.assign(optionsFromArguments(MultibandCompressor.getDefaults(), arguments))); - this.name = "MultibandCompressor"; - const options = optionsFromArguments(MultibandCompressor.getDefaults(), arguments); - this._splitter = this.input = new MultibandSplit({ - context: this.context, - lowFrequency: options.lowFrequency, - highFrequency: options.highFrequency - }); - this.lowFrequency = this._splitter.lowFrequency; - this.highFrequency = this._splitter.highFrequency; - this.output = new Gain({ context: this.context }); - this.low = new Compressor(Object.assign(options.low, { context: this.context })); - this.mid = new Compressor(Object.assign(options.mid, { context: this.context })); - this.high = new Compressor(Object.assign(options.high, { context: this.context })); - // connect the compressor - this._splitter.low.chain(this.low, this.output); - this._splitter.mid.chain(this.mid, this.output); - this._splitter.high.chain(this.high, this.output); - readOnly(this, ["high", "mid", "low", "highFrequency", "lowFrequency"]); - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - lowFrequency: 250, - highFrequency: 2000, - low: { - ratio: 6, - threshold: -30, - release: 0.25, - attack: 0.03, - knee: 10 - }, - mid: { - ratio: 3, - threshold: -24, - release: 0.03, - attack: 0.02, - knee: 16 - }, - high: { - ratio: 3, - threshold: -24, - release: 0.03, - attack: 0.02, - knee: 16 - }, - }); - } - dispose() { - super.dispose(); - this._splitter.dispose(); - this.low.dispose(); - this.mid.dispose(); - this.high.dispose(); - this.output.dispose(); - return this; - } -} - -/** - * EQ3 provides 3 equalizer bins: Low/Mid/High. - * @category Component - */ -class EQ3 extends ToneAudioNode { - constructor() { - super(optionsFromArguments(EQ3.getDefaults(), arguments, ["low", "mid", "high"])); - this.name = "EQ3"; - /** - * the output - */ - this.output = new Gain({ context: this.context }); - this._internalChannels = []; - const options = optionsFromArguments(EQ3.getDefaults(), arguments, ["low", "mid", "high"]); - this.input = this._multibandSplit = new MultibandSplit({ - context: this.context, - highFrequency: options.highFrequency, - lowFrequency: options.lowFrequency, - }); - this._lowGain = new Gain({ - context: this.context, - gain: options.low, - units: "decibels", - }); - this._midGain = new Gain({ - context: this.context, - gain: options.mid, - units: "decibels", - }); - this._highGain = new Gain({ - context: this.context, - gain: options.high, - units: "decibels", - }); - this.low = this._lowGain.gain; - this.mid = this._midGain.gain; - this.high = this._highGain.gain; - this.Q = this._multibandSplit.Q; - this.lowFrequency = this._multibandSplit.lowFrequency; - this.highFrequency = this._multibandSplit.highFrequency; - // the frequency bands - this._multibandSplit.low.chain(this._lowGain, this.output); - this._multibandSplit.mid.chain(this._midGain, this.output); - this._multibandSplit.high.chain(this._highGain, this.output); - readOnly(this, ["low", "mid", "high", "lowFrequency", "highFrequency"]); - this._internalChannels = [this._multibandSplit]; - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - high: 0, - highFrequency: 2500, - low: 0, - lowFrequency: 400, - mid: 0, - }); - } - /** - * Clean up. - */ - dispose() { - super.dispose(); - writable(this, ["low", "mid", "high", "lowFrequency", "highFrequency"]); - this._multibandSplit.dispose(); - this.lowFrequency.dispose(); - this.highFrequency.dispose(); - this._lowGain.dispose(); - this._midGain.dispose(); - this._highGain.dispose(); - this.low.dispose(); - this.mid.dispose(); - this.high.dispose(); - this.Q.dispose(); - return this; - } -} - -/** - * Convolver is a wrapper around the Native Web Audio - * [ConvolverNode](http://webaudio.github.io/web-audio-api/#the-convolvernode-interface). - * Convolution is useful for reverb and filter emulation. Read more about convolution reverb on - * [Wikipedia](https://en.wikipedia.org/wiki/Convolution_reverb). - * - * @example - * // initializing the convolver with an impulse response - * const convolver = new Tone.Convolver("./path/to/ir.wav").toDestination(); - * @category Component - */ -class Convolver extends ToneAudioNode { - constructor() { - super(optionsFromArguments(Convolver.getDefaults(), arguments, ["url", "onload"])); - this.name = "Convolver"; - /** - * The native ConvolverNode - */ - this._convolver = this.context.createConvolver(); - const options = optionsFromArguments(Convolver.getDefaults(), arguments, ["url", "onload"]); - this._buffer = new ToneAudioBuffer(options.url, buffer => { - this.buffer = buffer; - options.onload(); - }); - this.input = new Gain({ context: this.context }); - this.output = new Gain({ context: this.context }); - // set if it's already loaded, set it immediately - if (this._buffer.loaded) { - this.buffer = this._buffer; - } - // initially set normalization - this.normalize = options.normalize; - // connect it up - this.input.chain(this._convolver, this.output); - } - static getDefaults() { - return Object.assign(ToneAudioNode.getDefaults(), { - normalize: true, - onload: noOp, - }); - } - /** - * Load an impulse response url as an audio buffer. - * Decodes the audio asynchronously and invokes - * the callback once the audio buffer loads. - * @param url The url of the buffer to load. filetype support depends on the browser. - */ - load(url) { - return __awaiter(this, void 0, void 0, function* () { - this.buffer = yield this._buffer.load(url); - }); - } - /** - * The convolver's buffer - */ - get buffer() { - if (this._buffer.length) { - return this._buffer; - } - else { - return null; - } - } - set buffer(buffer) { - if (buffer) { - this._buffer.set(buffer); - } - // if it's already got a buffer, create a new one - if (this._convolver.buffer) { - // disconnect the old one - this.input.disconnect(); - this._convolver.disconnect(); - // create and connect a new one - this._convolver = this.context.createConvolver(); - this.input.chain(this._convolver, this.output); - } - const buff = this._buffer.get(); - this._convolver.buffer = buff ? buff : null; - } - /** - * The normalize property of the ConvolverNode interface is a boolean that - * controls whether the impulse response from the buffer will be scaled by - * an equal-power normalization when the buffer attribute is set, or not. - */ - get normalize() { - return this._convolver.normalize; - } - set normalize(norm) { - this._convolver.normalize = norm; - } - dispose() { - super.dispose(); - this._buffer.dispose(); - this._convolver.disconnect(); - return this; - } -} - -export { AMSynth, Abs, Add, Analyser, AutoFilter, AutoPanner, AutoWah, BiquadFilter, BitCrusher, Chebyshev, Chorus, Compressor, Convolver, CrossFade, DCMeter, Delay, Distortion, DuoSynth, EQ3, FFT, FMSynth, FeedbackCombFilter, FeedbackDelay, Filter, Follower, Freeverb, FrequencyEnvelope, FrequencyShifter, GainToAudio, Gate, GrainPlayer, GreaterThan, GreaterThanZero, JCReverb, LFO, Limiter, Loop, LowpassCombFilter, Merge, MetalSynth, Meter, MidSideCompressor, MidSideMerge, MidSideSplit, Mono, MonoSynth, MultibandCompressor, MultibandSplit, Negate, Noise, NoiseSynth, Offline, OnePoleFilter, Panner3D, Part, Pattern, Phaser, PingPongDelay, PitchShift, Players, PluckSynth, PolySynth, Pow, Recorder, Reverb, Scale, ScaleExp, Sequence, Split, StereoWidener, Subtract, SyncedSignal, ToneEvent, Tremolo, Units as Unit, UserMedia, Vibrato, Waveform, Zero }; diff --git a/docs/_snowpack/pkg/webmidi.js b/docs/_snowpack/pkg/webmidi.js deleted file mode 100644 index 92d89cc9..00000000 --- a/docs/_snowpack/pkg/webmidi.js +++ /dev/null @@ -1,3 +0,0 @@ -import { w as webmidi_min } from './common/webmidi.min-97732fd4.js'; -export { w as default } from './common/webmidi.min-97732fd4.js'; -import './common/_commonjsHelpers-8c19dec8.js'; diff --git a/docs/asset-manifest.json b/docs/asset-manifest.json new file mode 100644 index 00000000..de6fcc70 --- /dev/null +++ b/docs/asset-manifest.json @@ -0,0 +1,16 @@ +{ + "files": { + "main.css": "/static/css/main.0d689283.css", + "main.js": "/static/js/main.77e38ada.js", + "static/js/787.8f7ec9e0.chunk.js": "/static/js/787.8f7ec9e0.chunk.js", + "static/media/logo.svg": "/static/media/logo.ac95051720b3dccfe511e0e02d8e1029.svg", + "index.html": "/index.html", + "main.0d689283.css.map": "/static/css/main.0d689283.css.map", + "main.77e38ada.js.map": "/static/js/main.77e38ada.js.map", + "787.8f7ec9e0.chunk.js.map": "/static/js/787.8f7ec9e0.chunk.js.map" + }, + "entrypoints": [ + "static/css/main.0d689283.css", + "static/js/main.77e38ada.js" + ] +} \ No newline at end of file diff --git a/docs/dist/App.js b/docs/dist/App.js deleted file mode 100644 index ab093cca..00000000 --- a/docs/dist/App.js +++ /dev/null @@ -1,147 +0,0 @@ -import React, {useCallback, useLayoutEffect, useRef, useState} from "../_snowpack/pkg/react.js"; -import CodeMirror, {markEvent, markParens} from "./CodeMirror.js"; -import cx from "./cx.js"; -import {evaluate} from "./evaluate.js"; -import logo from "./logo.svg.proxy.js"; -import {useWebMidi} from "./midi.js"; -import playStatic from "./static.js"; -import {defaultSynth} from "./tone.js"; -import * as tunes from "./tunes.js"; -import useRepl from "./useRepl.js"; -const [_, codeParam] = window.location.href.split("#"); -let decoded; -try { - decoded = atob(decodeURIComponent(codeParam || "")); -} catch (err) { - console.warn("failed to decode", err); -} -function getRandomTune() { - const allTunes = Object.values(tunes); - const randomItem = (arr) => arr[Math.floor(Math.random() * arr.length)]; - return randomItem(allTunes); -} -const randomTune = getRandomTune(); -function App() { - const [editor, setEditor] = useState(); - const {setCode, setPattern, error, code, cycle, dirty, log, togglePlay, activateCode, pattern, pushLog, pending} = useRepl({ - tune: decoded || randomTune, - defaultSynth, - onDraw: useCallback(markEvent(editor), [editor]) - }); - const [uiHidden, setUiHidden] = useState(false); - const logBox = useRef(); - useLayoutEffect(() => { - logBox.current.scrollTop = logBox.current?.scrollHeight; - }, [log]); - useLayoutEffect(() => { - const handleKeyPress = async (e) => { - if (e.ctrlKey || e.altKey) { - switch (e.code) { - case "Enter": - await activateCode(); - break; - case "Period": - cycle.stop(); - } - } - }; - window.addEventListener("keydown", handleKeyPress); - return () => window.removeEventListener("keydown", handleKeyPress); - }, [pattern, code]); - useWebMidi({ - ready: useCallback(({outputs}) => { - pushLog(`WebMidi ready! Just add .midi(${outputs.map((o) => `'${o.name}'`).join(" | ")}) to the pattern. `); - }, []), - connected: useCallback(({outputs}) => { - pushLog(`Midi device connected! Available: ${outputs.map((o) => `'${o.name}'`).join(", ")}`); - }, []), - disconnected: useCallback(({outputs}) => { - pushLog(`Midi device disconnected! Available: ${outputs.map((o) => `'${o.name}'`).join(", ")}`); - }, []) - }); - return /* @__PURE__ */ React.createElement("div", { - className: "min-h-screen flex flex-col" - }, /* @__PURE__ */ React.createElement("header", { - id: "header", - className: cx("flex-none w-full h-14 px-2 flex border-b border-gray-200 justify-between z-[10]", uiHidden ? "bg-transparent text-white" : "bg-white") - }, /* @__PURE__ */ React.createElement("div", { - className: "flex items-center space-x-2" - }, /* @__PURE__ */ React.createElement("img", { - src: logo, - className: "Tidal-logo w-12 h-12", - alt: "logo" - }), /* @__PURE__ */ React.createElement("h1", { - className: "text-2xl" - }, "Strudel REPL")), /* @__PURE__ */ React.createElement("div", { - className: "flex space-x-4" - }, /* @__PURE__ */ React.createElement("button", { - onClick: () => togglePlay() - }, !pending ? /* @__PURE__ */ React.createElement("span", { - className: "flex items-center w-16" - }, cycle.started ? /* @__PURE__ */ React.createElement("svg", { - xmlns: "http://www.w3.org/2000/svg", - className: "h-5 w-5", - viewBox: "0 0 20 20", - fill: "currentColor" - }, /* @__PURE__ */ React.createElement("path", { - fillRule: "evenodd", - d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zM7 8a1 1 0 012 0v4a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v4a1 1 0 102 0V8a1 1 0 00-1-1z", - clipRule: "evenodd" - })) : /* @__PURE__ */ React.createElement("svg", { - xmlns: "http://www.w3.org/2000/svg", - className: "h-5 w-5", - viewBox: "0 0 20 20", - fill: "currentColor" - }, /* @__PURE__ */ React.createElement("path", { - fillRule: "evenodd", - d: "M10 18a8 8 0 100-16 8 8 0 000 16zM9.555 7.168A1 1 0 008 8v4a1 1 0 001.555.832l3-2a1 1 0 000-1.664l-3-2z", - clipRule: "evenodd" - })), cycle.started ? "pause" : "play") : /* @__PURE__ */ React.createElement(React.Fragment, null, "loading...")), /* @__PURE__ */ React.createElement("button", { - onClick: async () => { - const _code = getRandomTune(); - console.log("tune", _code); - setCode(_code); - const parsed = await evaluate(_code); - setPattern(parsed.pattern); - } - }, "🎲 random"), /* @__PURE__ */ React.createElement("button", null, /* @__PURE__ */ React.createElement("a", { - href: "./tutorial" - }, "📚 tutorial")), /* @__PURE__ */ React.createElement("button", { - onClick: () => setUiHidden((c) => !c) - }, "👀 ", uiHidden ? "show ui" : "hide ui"))), /* @__PURE__ */ React.createElement("section", { - className: "grow flex flex-col text-gray-100" - }, /* @__PURE__ */ React.createElement("div", { - className: "grow relative", - id: "code" - }, /* @__PURE__ */ React.createElement("div", { - className: cx("h-full transition-opacity", error ? "focus:ring-red-500" : "focus:ring-slate-800", uiHidden ? "opacity-0" : "opacity-100") - }, /* @__PURE__ */ React.createElement(CodeMirror, { - value: code, - editorDidMount: setEditor, - options: { - mode: "javascript", - theme: "material", - lineNumbers: false, - styleSelectedText: true, - cursorBlinkRate: 0 - }, - onCursor: markParens, - onChange: (_2, __, value) => setCode(value) - }), /* @__PURE__ */ React.createElement("span", { - className: "p-4 absolute top-0 right-0 text-xs whitespace-pre text-right pointer-events-none" - }, !cycle.started ? `press ctrl+enter to play -` : dirty ? `ctrl+enter to update -` : "no changes\n")), error && /* @__PURE__ */ React.createElement("div", { - className: cx("absolute right-2 bottom-2 px-2", "text-red-500") - }, error?.message || "unknown error")), /* @__PURE__ */ React.createElement("textarea", { - className: "z-[10] h-16 border-0 text-xs bg-[transparent] border-t border-slate-600 resize-none", - value: log, - readOnly: true, - ref: logBox, - style: {fontFamily: "monospace"} - })), /* @__PURE__ */ React.createElement("button", { - className: "fixed right-4 bottom-2 z-[11]", - onClick: () => playStatic(code) - }, "static")); -} -export default App; diff --git a/docs/dist/CodeMirror.js b/docs/dist/CodeMirror.js deleted file mode 100644 index fc83cd3e..00000000 --- a/docs/dist/CodeMirror.js +++ /dev/null @@ -1,96 +0,0 @@ -import React from "../_snowpack/pkg/react.js"; -import {Controlled as CodeMirror2} from "../_snowpack/pkg/react-codemirror2.js"; -import "../_snowpack/pkg/codemirror/mode/javascript/javascript.js"; -import "../_snowpack/pkg/codemirror/mode/pegjs/pegjs.js"; -import "../_snowpack/pkg/codemirror/lib/codemirror.css.proxy.js"; -import "../_snowpack/pkg/codemirror/theme/material.css.proxy.js"; -export default function CodeMirror({value, onChange, onCursor, options, editorDidMount}) { - options = options || { - mode: "javascript", - theme: "material", - lineNumbers: true, - styleSelectedText: true, - cursorBlinkRate: 500 - }; - return /* @__PURE__ */ React.createElement(CodeMirror2, { - value, - options, - onBeforeChange: onChange, - editorDidMount, - onCursor: (editor, data) => onCursor?.(editor, data) - }); -} -export const markEvent = (editor) => (time, event) => { - const locs = event.context.locations; - if (!locs || !editor) { - return; - } - const col = event.context?.color || "#FFCA28"; - const marks = locs.map(({start, end}) => editor.getDoc().markText({line: start.line - 1, ch: start.column}, {line: end.line - 1, ch: end.column}, {css: "outline: 1px solid " + col + "; box-sizing:border-box"})); - setTimeout(() => { - marks.forEach((mark) => mark.clear()); - }, event.duration * 1e3); -}; -let parenMark; -export const markParens = (editor, data) => { - const v = editor.getDoc().getValue(); - const marked = getCurrentParenArea(v, data); - parenMark?.clear(); - parenMark = editor.getDoc().markText(...marked, {css: "background-color: #00007720"}); -}; -export function offsetToPosition(offset, code) { - const lines = code.split("\n"); - let line = 0; - let ch = 0; - for (let i = 0; i < offset; i++) { - if (ch === lines[line].length) { - line++; - ch = 0; - } else { - ch++; - } - } - return {line, ch}; -} -export function positionToOffset(position, code) { - const lines = code.split("\n"); - let offset = 0; - for (let i = 0; i < position.line; i++) { - offset += lines[i].length + 1; - } - offset += position.ch; - return offset; -} -export function getCurrentParenArea(code, caretPosition) { - const caret = positionToOffset(caretPosition, code); - let open, i, begin, end; - i = caret; - open = 0; - while (i > 0) { - if (code[i - 1] === "(") { - open--; - } else if (code[i - 1] === ")") { - open++; - } - if (open === -1) { - break; - } - i--; - } - begin = i; - i = caret; - open = 0; - while (i < code.length) { - if (code[i] === "(") { - open--; - } else if (code[i] === ")") { - open++; - } - if (open === 1) { - break; - } - i++; - } - end = i; - return [begin, end].map((o) => offsetToPosition(o, code)); -} diff --git a/docs/dist/cx.js b/docs/dist/cx.js deleted file mode 100644 index 1677e96e..00000000 --- a/docs/dist/cx.js +++ /dev/null @@ -1,3 +0,0 @@ -export default function cx(...classes) { - return classes.filter(Boolean).join(" "); -} diff --git a/docs/dist/draw.js b/docs/dist/draw.js deleted file mode 100644 index f2cac985..00000000 --- a/docs/dist/draw.js +++ /dev/null @@ -1,47 +0,0 @@ -import * as Tone from "../_snowpack/pkg/tone.js"; -import {Pattern} from "../_snowpack/link/strudel.js"; -export const getDrawContext = (id = "test-canvas") => { - let canvas = document.querySelector("#" + id); - if (!canvas) { - canvas = document.createElement("canvas"); - canvas.id = id; - canvas.width = window.innerWidth; - canvas.height = window.innerHeight; - canvas.style = "pointer-events:none;width:100%;height:100%;position:fixed;top:0;left:0;z-index:5"; - document.body.prepend(canvas); - } - return canvas.getContext("2d"); -}; -Pattern.prototype.draw = function(callback, cycleSpan, lookaheadCycles = 1) { - if (window.strudelAnimation) { - cancelAnimationFrame(window.strudelAnimation); - } - const ctx = getDrawContext(); - let cycle, events = []; - const animate = (time) => { - const t = Tone.getTransport().seconds; - if (cycleSpan) { - const currentCycle = Math.floor(t / cycleSpan); - if (cycle !== currentCycle) { - cycle = currentCycle; - const begin = currentCycle * cycleSpan; - const end = (currentCycle + lookaheadCycles) * cycleSpan; - events = this._asNumber(true).query(new State(new TimeSpan(begin, end))).filter((event) => event.part.begin.equals(event.whole.begin)); - } - } - callback(ctx, events, t, cycleSpan, time); - window.strudelAnimation = requestAnimationFrame(animate); - }; - requestAnimationFrame(animate); - return this; -}; -export const cleanup = () => { - const ctx = getDrawContext(); - ctx.clearRect(0, 0, window.innerWidth, window.innerHeight); - if (window.strudelAnimation) { - cancelAnimationFrame(window.strudelAnimation); - } - if (window.strudelScheduler) { - clearInterval(window.strudelScheduler); - } -}; diff --git a/docs/dist/euclid.js b/docs/dist/euclid.js deleted file mode 100644 index 5d51a7ff..00000000 --- a/docs/dist/euclid.js +++ /dev/null @@ -1,21 +0,0 @@ -import {Pattern, timeCat} from "../_snowpack/link/strudel.js"; -import bjork from "../_snowpack/pkg/bjork.js"; -import {rotate} from "../_snowpack/link/util.js"; -import Fraction from "../_snowpack/link/fraction.js"; -const euclid = (pulses, steps, rotation = 0) => { - const b = bjork(steps, pulses); - if (rotation) { - return rotate(b, -rotation); - } - return b; -}; -Pattern.prototype.euclid = function(pulses, steps, rotation = 0) { - return this.struct(euclid(pulses, steps, rotation)); -}; -Pattern.prototype.euclidLegato = function(pulses, steps, rotation = 0) { - const bin_pat = euclid(pulses, steps, rotation); - const firstOne = bin_pat.indexOf(1); - const gapless = rotate(bin_pat, firstOne).join("").split("1").slice(1).map((s) => [s.length + 1, true]); - return this.struct(timeCat(...gapless)).late(Fraction(firstOne).div(steps)); -}; -export default euclid; diff --git a/docs/dist/evaluate.js b/docs/dist/evaluate.js deleted file mode 100644 index 17c60ff9..00000000 --- a/docs/dist/evaluate.js +++ /dev/null @@ -1,47 +0,0 @@ -import * as strudel from "../_snowpack/link/strudel.js"; -import "./tone.js"; -import "./midi.js"; -import "./voicings.js"; -import "./tonal.js"; -import "./xen.js"; -import "./tune.js"; -import "./euclid.js"; -import euclid from "./euclid.js"; -import "./pianoroll.js"; -import "./draw.js"; -import * as uiHelpers from "./ui.js"; -import * as drawHelpers from "./draw.js"; -import gist from "./gist.js"; -import shapeshifter from "./shapeshifter.js"; -import {mini} from "./parse.js"; -import * as Tone from "../_snowpack/pkg/tone.js"; -import * as toneHelpers from "./tone.js"; -import * as voicingHelpers from "./voicings.js"; -const bootstrapped = {...strudel, ...strudel.Pattern.prototype.bootstrap()}; -function hackLiteral(literal, names, func) { - names.forEach((name) => { - Object.defineProperty(literal.prototype, name, { - get: function() { - return func(String(this)); - } - }); - }); -} -hackLiteral(String, ["mini", "m"], bootstrapped.mini); -hackLiteral(String, ["pure", "p"], bootstrapped.pure); -Object.assign(globalThis, Tone, bootstrapped, toneHelpers, voicingHelpers, drawHelpers, uiHelpers, { - gist, - euclid, - mini -}); -export const evaluate = async (code) => { - const shapeshifted = shapeshifter(code); - drawHelpers.cleanup(); - uiHelpers.cleanup(); - let evaluated = await eval(shapeshifted); - if (evaluated?.constructor?.name !== "Pattern") { - const message = `got "${typeof evaluated}" instead of pattern`; - throw new Error(message + (typeof evaluated === "function" ? ", did you forget to call a function?" : ".")); - } - return {mode: "javascript", pattern: evaluated}; -}; diff --git a/docs/dist/gist.js b/docs/dist/gist.js deleted file mode 100644 index 716f797f..00000000 --- a/docs/dist/gist.js +++ /dev/null @@ -1,6 +0,0 @@ -// this is a shortcut to eval code from a gist -// why? to be able to shorten strudel code + e.g. be able to change instruments after links have been generated -export default (route) => - fetch(`https://gist.githubusercontent.com/${route}?cachebust=${Date.now()}`) - .then((res) => res.text()) - .then((code) => eval(code)); diff --git a/docs/dist/index.js b/docs/dist/index.js deleted file mode 100644 index 828bd19d..00000000 --- a/docs/dist/index.js +++ /dev/null @@ -1,10 +0,0 @@ -import * as __SNOWPACK_ENV__ from '../_snowpack/env.js'; -import.meta.env = __SNOWPACK_ENV__; - -import React from "../_snowpack/pkg/react.js"; -import ReactDOM from "../_snowpack/pkg/react-dom.js"; -import App from "./App.js"; -ReactDOM.render(/* @__PURE__ */ React.createElement(React.StrictMode, null, /* @__PURE__ */ React.createElement(App, null)), document.getElementById("root")); -if (undefined /* [snowpack] import.meta.hot */ ) { - undefined /* [snowpack] import.meta.hot */ .accept(); -} diff --git a/docs/dist/logo.svg.proxy.js b/docs/dist/logo.svg.proxy.js deleted file mode 100644 index aed9da04..00000000 --- a/docs/dist/logo.svg.proxy.js +++ /dev/null @@ -1 +0,0 @@ -export default "/dist/logo.svg"; \ No newline at end of file diff --git a/docs/dist/midi.js b/docs/dist/midi.js deleted file mode 100644 index 8813c43b..00000000 --- a/docs/dist/midi.js +++ /dev/null @@ -1,87 +0,0 @@ -import {useEffect, useState} from "../_snowpack/pkg/react.js"; -import {isNote} from "../_snowpack/pkg/tone.js"; -import _WebMidi from "../_snowpack/pkg/webmidi.js"; -import {Pattern as _Pattern} from "../_snowpack/link/strudel.js"; -import * as Tone from "../_snowpack/pkg/tone.js"; -const WebMidi = _WebMidi; -const Pattern = _Pattern; -export default function enableWebMidi() { - return new Promise((resolve, reject) => { - if (WebMidi.enabled) { - resolve(WebMidi); - return; - } - WebMidi.enable((err) => { - if (err) { - reject(err); - } - resolve(WebMidi); - }); - }); -} -const outputByName = (name) => WebMidi.getOutputByName(name); -Pattern.prototype.midi = function(output, channel = 1) { - if (output?.constructor?.name === "Pattern") { - throw new Error(`.midi does not accept Pattern input. Make sure to pass device name with single quotes. Example: .midi('${WebMidi.outputs?.[0]?.name || "IAC Driver Bus 1"}')`); - } - return this._withEvent((event) => { - const onTrigger = (time, event2) => { - let note = event2.value; - const velocity = event2.context?.velocity ?? 0.9; - if (!isNote(note)) { - throw new Error("not a note: " + note); - } - if (!WebMidi.enabled) { - throw new Error(`🎹 WebMidi is not enabled. Supported Browsers: https://caniuse.com/?search=webmidi`); - } - if (!WebMidi.outputs.length) { - throw new Error(`🔌 No MIDI devices found. Connect a device or enable IAC Driver.`); - } - let device; - if (typeof output === "number") { - device = WebMidi.outputs[output]; - } else if (typeof output === "string") { - device = outputByName(output); - } else { - device = WebMidi.outputs[0]; - } - if (!device) { - throw new Error(`🔌 MIDI device '${output ? output : ""}' not found. Use one of ${WebMidi.outputs.map((o) => `'${o.name}'`).join(" | ")}`); - } - const timingOffset = WebMidi.time - Tone.context.currentTime * 1e3; - time = time * 1e3 + timingOffset; - device.playNote(note, channel, { - time, - duration: event2.duration * 1e3 - 5, - velocity - }); - }; - return event.setContext({...event.context, onTrigger}); - }); -}; -export function useWebMidi(props) { - const {ready, connected, disconnected} = props; - const [loading, setLoading] = useState(true); - const [outputs, setOutputs] = useState(WebMidi?.outputs || []); - useEffect(() => { - enableWebMidi().then(() => { - WebMidi.addListener("connected", (e) => { - setOutputs([...WebMidi.outputs]); - connected?.(WebMidi, e); - }); - WebMidi.addListener("disconnected", (e) => { - setOutputs([...WebMidi.outputs]); - disconnected?.(WebMidi, e); - }); - ready?.(WebMidi); - setLoading(false); - }).catch((err) => { - if (err) { - console.warn("Web Midi could not be enabled.."); - return; - } - }); - }, [ready, connected, disconnected, outputs]); - const outputByName2 = (name) => WebMidi.getOutputByName(name); - return {loading, outputs, outputByName: outputByName2}; -} diff --git a/docs/dist/oldtunes.js b/docs/dist/oldtunes.js deleted file mode 100644 index 7a27683e..00000000 --- a/docs/dist/oldtunes.js +++ /dev/null @@ -1,151 +0,0 @@ -export const timeCatMini = `stack( - "c3@3 [eb3, g3, [c4 d4]/2]", - "c2 g2", - "[eb4@5 [f4 eb4 d4]@3] [eb4 c4]/2".slow(8) -)`; -export const timeCat = `stack( - timeCat([3, c3], [1, stack(eb3, g3, cat(c4, d4).slow(2))]), - cat(c2, g2), - sequence( - timeCat([5, eb4], [3, cat(f4, eb4, d4)]), - cat(eb4, c4).slow(2) - ).slow(4) -)`; -export const shapeShifted = `stack( - sequence( - e5, [b4, c5], d5, [c5, b4], - a4, [a4, c5], e5, [d5, c5], - b4, [r, c5], d5, e5, - c5, a4, a4, r, - [r, d5], [r, f5], a5, [g5, f5], - e5, [r, c5], e5, [d5, c5], - b4, [b4, c5], d5, e5, - c5, a4, a4, r, - ).rev(), - sequence( - e2, e3, e2, e3, e2, e3, e2, e3, - a2, a3, a2, a3, a2, a3, a2, a3, - gs2, gs3, gs2, gs3, e2, e3, e2, e3, - a2, a3, a2, a3, a2, a3, b1, c2, - d2, d3, d2, d3, d2, d3, d2, d3, - c2, c3, c2, c3, c2, c3, c2, c3, - b1, b2, b1, b2, e2, e3, e2, e3, - a1, a2, a1, a2, a1, a2, a1, a2, - ).rev() -).slow(16)`; -export const tetrisWithFunctions = `stack(sequence( - 'e5', sequence('b4', 'c5'), 'd5', sequence('c5', 'b4'), - 'a4', sequence('a4', 'c5'), 'e5', sequence('d5', 'c5'), - 'b4', sequence(silence, 'c5'), 'd5', 'e5', - 'c5', 'a4', 'a4', silence, - sequence(silence, 'd5'), sequence(silence, 'f5'), 'a5', sequence('g5', 'f5'), - 'e5', sequence(silence, 'c5'), 'e5', sequence('d5', 'c5'), - 'b4', sequence('b4', 'c5'), 'd5', 'e5', - 'c5', 'a4', 'a4', silence), - sequence( - 'e2', 'e3', 'e2', 'e3', 'e2', 'e3', 'e2', 'e3', - 'a2', 'a3', 'a2', 'a3', 'a2', 'a3', 'a2', 'a3', - 'g#2', 'g#3', 'g#2', 'g#3', 'e2', 'e3', 'e2', 'e3', - 'a2', 'a3', 'a2', 'a3', 'a2', 'a3', 'b1', 'c2', - 'd2', 'd3', 'd2', 'd3', 'd2', 'd3', 'd2', 'd3', - 'c2', 'c3', 'c2', 'c3', 'c2', 'c3', 'c2', 'c3', - 'b1', 'b2', 'b1', 'b2', 'e2', 'e3', 'e2', 'e3', - 'a1', 'a2', 'a1', 'a2', 'a1', 'a2', 'a1', 'a2', - ) -).slow(16)`; -export const tetris = `stack( - cat( - "e5 [b4 c5] d5 [c5 b4]", - "a4 [a4 c5] e5 [d5 c5]", - "b4 [~ c5] d5 e5", - "c5 a4 a4 ~", - "[~ d5] [~ f5] a5 [g5 f5]", - "e5 [~ c5] e5 [d5 c5]", - "b4 [b4 c5] d5 e5", - "c5 a4 a4 ~" - ), - cat( - "e2 e3 e2 e3 e2 e3 e2 e3", - "a2 a3 a2 a3 a2 a3 a2 a3", - "g#2 g#3 g#2 g#3 e2 e3 e2 e3", - "a2 a3 a2 a3 a2 a3 b1 c2", - "d2 d3 d2 d3 d2 d3 d2 d3", - "c2 c3 c2 c3 c2 c3 c2 c3", - "b1 b2 b1 b2 e2 e3 e2 e3", - "a1 a2 a1 a2 a1 a2 a1 a2", - ) -).slow(16)`; -export const tetrisMini = `\`[[e5 [b4 c5] d5 [c5 b4]] -[a4 [a4 c5] e5 [d5 c5]] -[b4 [~ c5] d5 e5] -[c5 a4 a4 ~] -[[~ d5] [~ f5] a5 [g5 f5]] -[e5 [~ c5] e5 [d5 c5]] -[b4 [b4 c5] d5 e5] -[c5 a4 a4 ~]], -[[e2 e3]*4] -[[a2 a3]*4] -[[g#2 g#3]*2 [e2 e3]*2] -[a2 a3 a2 a3 a2 a3 b1 c2] -[[d2 d3]*4] -[[c2 c3]*4] -[[b1 b2]*2 [e2 e3]*2] -[[a1 a2]*4]\`.slow(16) -`; -export const whirlyStrudel = `sequence(e4, [b2, b3], c4) -.every(4, fast(2)) -.every(3, slow(1.5)) -.fast(slowcat(1.25, 1, 1.5)) -.every(2, _ => sequence(e4, r, e3, d4, r))`; -export const giantSteps = `stack( - // melody - cat( - "[F#5 D5] [B4 G4] Bb4 [B4 A4]", - "[D5 Bb4] [G4 Eb4] F#4 [G4 F4]", - "Bb4 [B4 A4] D5 [D#5 C#5]", - "F#5 [G5 F5] Bb5 [F#5 F#5]", - ), - // chords - cat( - "[B^7 D7] [G^7 Bb7] Eb^7 [Am7 D7]", - "[G^7 Bb7] [Eb^7 F#7] B^7 [Fm7 Bb7]", - "Eb^7 [Am7 D7] G^7 [C#m7 F#7]", - "B^7 [Fm7 Bb7] Eb^7 [C#m7 F#7]" - ).voicings(['E3', 'G4']), - // bass - cat( - "[B2 D2] [G2 Bb2] [Eb2 Bb3] [A2 D2]", - "[G2 Bb2] [Eb2 F#2] [B2 F#2] [F2 Bb2]", - "[Eb2 Bb2] [A2 D2] [G2 D2] [C#2 F#2]", - "[B2 F#2] [F2 Bb2] [Eb2 Bb3] [C#2 F#2]" - ) -).slow(20);`; -export const transposedChordsHacked = `stack( - "c2 eb2 g2", - "Cm7".voicings(['g2','c4']).slow(2) -).transpose( - slowcat(1, 2, 3, 2).slow(2) -).transpose(5)`; -export const scaleTranspose = `stack(f2, f3, c4, ab4) -.scale(sequence('F minor', 'F harmonic minor').slow(4)) -.scaleTranspose(sequence(0, -1, -2, -3).slow(4)) -.transpose(sequence(0, 1).slow(16))`; -export const struct = `stack( - "c2 g2 a2 [e2@2 eb2] d2 a2 g2 [d2 ~ db2]", - "[C^7 A7] [Dm7 G7]".struct("[x@2 x] [~@2 x] [~ x@2]@2 [x ~@2] ~ [~@2 x@4]@2") - .voicings(['G3','A4']) -).slow(4)`; -export const magicSofa = `stack( - " " - .every(2, fast(2)) - .voicings(), - " " -).slow(1).transpose.slowcat(0, 2, 3, 4)`; -export const primalEnemy = `()=>{ - const f = fast("<1 <2 [4 8]>>"); - return stack( - "c3,g3,c4".struct("[x ~]*2").apply(f).transpose("<0 <3 [5 [7 [9 [11 13]]]]>>"), - "c2 [c2 ~]*2".tone(synth(osc('sawtooth8')).chain(vol(0.8),out())), - "c1*2".tone(membrane().chain(vol(0.8),out())) - ).slow(1) -}`; diff --git a/docs/dist/parse.js b/docs/dist/parse.js deleted file mode 100644 index 2060f020..00000000 --- a/docs/dist/parse.js +++ /dev/null @@ -1,149 +0,0 @@ -import * as krill from "../_snowpack/link/repl/krill-parser.js"; -import * as strudel from "../_snowpack/link/strudel.js"; -import {Scale, Note, Interval} from "../_snowpack/pkg/@tonaljs/tonal.js"; -import {addMiniLocations} from "./shapeshifter.js"; -const {pure, Pattern, Fraction, stack, slowcat, sequence, timeCat, silence} = strudel; -const applyOptions = (parent) => (pat, i) => { - const ast = parent.source_[i]; - const options = ast.options_; - const operator = options?.operator; - if (operator) { - switch (operator.type_) { - case "stretch": - const speed = Fraction(operator.arguments_.amount).inverse(); - return reify(pat).fast(speed); - case "bjorklund": - return pat.euclid(operator.arguments_.pulse, operator.arguments_.step, operator.arguments_.rotation); - } - console.warn(`operator "${operator.type_}" not implemented`); - } - if (options?.weight) { - return pat; - } - const unimplemented = Object.keys(options || {}).filter((key) => key !== "operator"); - if (unimplemented.length) { - console.warn(`option${unimplemented.length > 1 ? "s" : ""} ${unimplemented.map((o) => `"${o}"`).join(", ")} not implemented`); - } - return pat; -}; -function resolveReplications(ast) { - ast.source_ = ast.source_.map((child) => { - const {replicate, ...options} = child.options_ || {}; - if (replicate) { - return { - ...child, - options_: {...options, weight: replicate}, - source_: { - type_: "pattern", - arguments_: { - alignment: "h" - }, - source_: [ - { - type_: "element", - source_: child.source_, - location_: child.location_, - options_: { - operator: { - type_: "stretch", - arguments_: {amount: Fraction(replicate).inverse().toString()} - } - } - } - ] - } - }; - } - return child; - }); -} -export function patternifyAST(ast) { - switch (ast.type_) { - case "pattern": - resolveReplications(ast); - const children = ast.source_.map(patternifyAST).map(applyOptions(ast)); - const alignment = ast.arguments_.alignment; - if (alignment === "v") { - return stack(...children); - } - const weightedChildren = ast.source_.some((child) => !!child.options_?.weight); - if (!weightedChildren && alignment === "t") { - return slowcat(...children); - } - if (weightedChildren) { - const pat = timeCat(...ast.source_.map((child, i) => [child.options_?.weight || 1, children[i]])); - if (alignment === "t") { - const weightSum = ast.source_.reduce((sum, child) => sum + (child.options_?.weight || 1), 0); - return pat._slow(weightSum); - } - return pat; - } - return sequence(...children); - case "element": - if (ast.source_ === "~") { - return silence; - } - if (typeof ast.source_ !== "object") { - if (!addMiniLocations) { - return ast.source_; - } - if (!ast.location_) { - console.warn("no location for", ast); - return ast.source_; - } - const {start, end} = ast.location_; - const value = !isNaN(Number(ast.source_)) ? Number(ast.source_) : ast.source_; - return pure(value).withLocation([start.line, start.column, start.offset], [end.line, end.column, end.offset]); - } - return patternifyAST(ast.source_); - case "stretch": - return patternifyAST(ast.source_).slow(ast.arguments_.amount); - case "scale": - let [tonic, scale] = Scale.tokenize(ast.arguments_.scale); - const intervals = Scale.get(scale).intervals; - const pattern = patternifyAST(ast.source_); - tonic = tonic || "C4"; - console.log("tonic", tonic); - return pattern.fmap((step) => { - step = Number(step); - if (isNaN(step)) { - console.warn(`scale step "${step}" not a number`); - return step; - } - const octaves = Math.floor(step / intervals.length); - const mod = (n, m) => n < 0 ? mod(n + m, m) : n % m; - const index = mod(step, intervals.length); - const interval = Interval.add(intervals[index], Interval.fromSemitones(octaves * 12)); - return Note.transpose(tonic, interval || "1P"); - }); - default: - console.warn(`node type "${ast.type_}" not implemented -> returning silence`); - return silence; - } -} -export const mini = (...strings) => { - const pats = strings.map((str) => { - const ast = krill.parse(`"${str}"`); - return patternifyAST(ast); - }); - return sequence(...pats); -}; -export const h = (string) => { - const ast = krill.parse(string); - return patternifyAST(ast); -}; -Pattern.prototype.define("mini", mini, {composable: true}); -Pattern.prototype.define("m", mini, {composable: true}); -Pattern.prototype.define("h", h, {composable: true}); -export function reify(thing) { - if (thing?.constructor?.name === "Pattern") { - return thing; - } - return pure(thing); -} -export function minify(thing) { - if (typeof thing === "string") { - return mini(thing); - } - return reify(thing); -} diff --git a/docs/dist/pianoroll.js b/docs/dist/pianoroll.js deleted file mode 100644 index 9781d8dc..00000000 --- a/docs/dist/pianoroll.js +++ /dev/null @@ -1,33 +0,0 @@ -import {Pattern} from "../_snowpack/link/strudel.js"; -Pattern.prototype.pianoroll = function({ - timeframe = 10, - inactive = "#C9E597", - active = "#FFCA28", - background = "#2A3236", - maxMidi = 90, - minMidi = 0 -} = {}) { - const w = window.innerWidth; - const h = window.innerHeight; - const midiRange = maxMidi - minMidi + 1; - const height = h / midiRange; - this.draw((ctx, events, t) => { - ctx.fillStyle = background; - ctx.clearRect(0, 0, w, h); - ctx.fillRect(0, 0, w, h); - events.forEach((event) => { - const isActive = event.whole.begin <= t && event.whole.end >= t; - ctx.fillStyle = event.context?.color || inactive; - ctx.strokeStyle = event.context?.color || active; - ctx.globalAlpha = event.context.velocity ?? 1; - const x = Math.round(event.whole.begin / timeframe * w); - const width = Math.round((event.whole.end - event.whole.begin) / timeframe * w); - const y = Math.round(h - (Number(event.value) - minMidi) / midiRange * h); - const offset = t / timeframe * w; - const margin = 0; - const coords = [x - offset + margin + 1, y + 1, width - 2, height - 2]; - isActive ? ctx.strokeRect(...coords) : ctx.fillRect(...coords); - }); - }, timeframe, 2); - return this; -}; diff --git a/docs/dist/shapeshifter.js b/docs/dist/shapeshifter.js deleted file mode 100644 index b0d99973..00000000 --- a/docs/dist/shapeshifter.js +++ /dev/null @@ -1,261 +0,0 @@ -import { parseScriptWithLocation } from './shift-parser/index.js'; // npm module does not work in the browser -import traverser from './shift-traverser/index.js'; // npm module does not work in the browser -const { replace } = traverser; -import { - LiteralStringExpression, - IdentifierExpression, - CallExpression, - StaticMemberExpression, - ReturnStatement, - ArrayExpression, - LiteralNumericExpression, -} from '../_snowpack/pkg/shift-ast.js'; -import codegen from '../_snowpack/pkg/shift-codegen.js'; -import * as strudel from '../_snowpack/link/strudel.js'; - -const { Pattern } = strudel; - -const isNote = (name) => /^[a-gC-G][bs]?[0-9]$/.test(name); - -const addLocations = true; -export const addMiniLocations = true; - -export default (_code) => { - const { code, addReturn } = wrapAsync(_code); - const ast = parseScriptWithLocation(code); - const artificialNodes = []; - const parents = []; - const shifted = replace(ast.tree, { - enter(node, parent) { - parents.push(parent); - const isSynthetic = parents.some((p) => artificialNodes.includes(p)); - if (isSynthetic) { - return node; - } - - // replace template string `xxx` with mini(`xxx`) - if (isBackTickString(node)) { - return minifyWithLocation(node, node, ast.locations, artificialNodes); - } - // allows to use top level strings, which are normally directives... but we don't need directives - if (node.directives?.length === 1 && !node.statements?.length) { - const str = new LiteralStringExpression({ value: node.directives[0].rawValue }); - const wrapped = minifyWithLocation(str, node.directives[0], ast.locations, artificialNodes); - return { ...node, directives: [], statements: [wrapped] }; - } - - // replace double quote string "xxx" with mini('xxx') - if (isStringWithDoubleQuotes(node, ast.locations, code)) { - return minifyWithLocation(node, node, ast.locations, artificialNodes); - } - - // operator overloading => still not done - const operators = { - '*': 'fast', - '/': 'slow', - '&': 'stack', - '&&': 'append', - }; - if ( - node.type === 'BinaryExpression' && - operators[node.operator] && - ['LiteralNumericExpression', 'LiteralStringExpression', 'IdentifierExpression'].includes(node.right?.type) && - canBeOverloaded(node.left) - ) { - let arg = node.left; - if (node.left.type === 'IdentifierExpression') { - arg = wrapFunction('reify', node.left); - } - return new CallExpression({ - callee: new StaticMemberExpression({ - property: operators[node.operator], - object: wrapFunction('reify', arg), - }), - arguments: [node.right], - }); - } - - const isMarkable = isPatternArg(parents) || hasModifierCall(parent); - // add to location to pure(x) calls - if (node.type === 'CallExpression' && node.callee.name === 'pure') { - const literal = node.arguments[0]; - // const value = literal[{ LiteralNumericExpression: 'value', LiteralStringExpression: 'name' }[literal.type]]; - return reifyWithLocation(literal, node.arguments[0], ast.locations, artificialNodes); - } - // replace pseudo note variables - if (node.type === 'IdentifierExpression') { - if (isNote(node.name)) { - const value = node.name[1] === 's' ? node.name.replace('s', '#') : node.name; - if (addLocations && isMarkable) { - return reifyWithLocation(new LiteralStringExpression({ value }), node, ast.locations, artificialNodes); - } - return new LiteralStringExpression({ value }); - } - if (node.name === 'r') { - return new IdentifierExpression({ name: 'silence' }); - } - } - if ( - addLocations && - ['LiteralStringExpression' /* , 'LiteralNumericExpression' */].includes(node.type) && - isMarkable - ) { - // TODO: to make LiteralNumericExpression work, we need to make sure we're not inside timeCat... - return reifyWithLocation(node, node, ast.locations, artificialNodes); - } - if (addMiniLocations) { - return addMiniNotationLocations(node, ast.locations, artificialNodes); - } - return node; - }, - leave() { - parents.pop(); - }, - }); - // add return to last statement (because it's wrapped in an async function artificially) - addReturn(shifted); - const generated = codegen(shifted); - return generated; -}; - -function wrapAsync(code) { - // wrap code in async to make await work on top level => this will create 1 line offset to locations - // this is why line offset is -1 in getLocationObject calls below - code = `(async () => { -${code} -})()`; - const addReturn = (ast) => { - const body = ast.statements[0].expression.callee.body; // actual code ast inside async function body - body.statements = body.statements - .slice(0, -1) - .concat([new ReturnStatement({ expression: body.statements.slice(-1)[0] })]); - }; - return { - code, - addReturn, - }; -} - -function addMiniNotationLocations(node, locations, artificialNodes) { - const miniFunctions = ['mini', 'm']; - // const isAlreadyWrapped = parent?.type === 'CallExpression' && parent.callee.name === 'withLocationOffset'; - if (node.type === 'CallExpression' && miniFunctions.includes(node.callee.name)) { - // mini('c3') - if (node.arguments.length > 1) { - // TODO: transform mini(...args) to cat(...args.map(mini)) ? - console.warn('multi arg mini locations not supported yet...'); - return node; - } - const str = node.arguments[0]; - return minifyWithLocation(str, str, locations, artificialNodes); - } - if (node.type === 'StaticMemberExpression' && miniFunctions.includes(node.property)) { - // 'c3'.mini or 'c3'.m - return minifyWithLocation(node.object, node, locations, artificialNodes); - } - return node; -} - -function wrapFunction(name, ...args) { - return new CallExpression({ - callee: new IdentifierExpression({ name }), - arguments: args, - }); -} - -function isBackTickString(node) { - return node.type === 'TemplateExpression' && node.elements.length === 1; -} - -function isStringWithDoubleQuotes(node, locations, code) { - if (node.type !== 'LiteralStringExpression') { - return false; - } - const loc = locations.get(node); - const snippet = code.slice(loc.start.offset, loc.end.offset); - return snippet[0] === '"'; // we can trust the end is also ", as the parsing did not fail -} - -// returns true if the given parents belong to a pattern argument node -// this is used to check if a node should receive a location for highlighting -function isPatternArg(parents) { - if (!parents.length) { - return false; - } - const ancestors = parents.slice(0, -1); - const parent = parents[parents.length - 1]; - if (isPatternFactory(parent)) { - return true; - } - if (parent?.type === 'ArrayExpression') { - return isPatternArg(ancestors); - } - return false; -} - -function hasModifierCall(parent) { - // TODO: modifiers are more than composables, for example every is not composable but should be seen as modifier.. - // need all prototypes of Pattern - return ( - parent?.type === 'StaticMemberExpression' && Object.keys(Pattern.prototype.composable).includes(parent.property) - ); -} - -function isPatternFactory(node) { - return node?.type === 'CallExpression' && Object.keys(Pattern.prototype.factories).includes(node.callee.name); -} - -function canBeOverloaded(node) { - return (node.type === 'IdentifierExpression' && isNote(node.name)) || isPatternFactory(node); - // TODO: support sequence(c3).transpose(3).x.y.z -} - -// turns node in reify(value).withLocation(location), where location is the node's location in the source code -// with this, the reified pattern can pass its location to the event, to know where to highlight when it's active -function reifyWithLocation(literalNode, node, locations, artificialNodes) { - const args = getLocationArguments(node, locations); - const withLocation = new CallExpression({ - callee: new StaticMemberExpression({ - object: wrapFunction('reify', literalNode), - property: 'withLocation', - }), - arguments: args, - }); - artificialNodes.push(withLocation); - return withLocation; -} - -// turns node in reify(value).withLocation(location), where location is the node's location in the source code -// with this, the reified pattern can pass its location to the event, to know where to highlight when it's active -function minifyWithLocation(literalNode, node, locations, artificialNodes) { - const args = getLocationArguments(node, locations); - const withLocation = new CallExpression({ - callee: new StaticMemberExpression({ - object: wrapFunction('mini', literalNode), - property: 'withMiniLocation', - }), - arguments: args, - }); - artificialNodes.push(withLocation); - return withLocation; -} - -function getLocationArguments(node, locations) { - const loc = locations.get(node); - return [ - new ArrayExpression({ - elements: [ - new LiteralNumericExpression({ value: loc.start.line - 1 }), // the minus 1 assumes the code has been wrapped in async iife - new LiteralNumericExpression({ value: loc.start.column }), - new LiteralNumericExpression({ value: loc.start.offset }), - ], - }), - new ArrayExpression({ - elements: [ - new LiteralNumericExpression({ value: loc.end.line - 1 }), // the minus 1 assumes the code has been wrapped in async iife - new LiteralNumericExpression({ value: loc.end.column }), - new LiteralNumericExpression({ value: loc.end.offset }), - ], - }), - ]; -} diff --git a/docs/dist/shift-parser/early-error-state.js b/docs/dist/shift-parser/early-error-state.js deleted file mode 100644 index b15f5433..00000000 --- a/docs/dist/shift-parser/early-error-state.js +++ /dev/null @@ -1,409 +0,0 @@ -/** - * Copyright 2014 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import MultiMap from '../../_snowpack/pkg/multimap.js'; - -function addEach(thisMap, ...otherMaps) { - otherMaps.forEach(otherMap => { - otherMap.forEachEntry((v, k) => { - thisMap.set.apply(thisMap, [k].concat(v)); - }); - }); - return thisMap; -} - -let identity; // initialised below EarlyErrorState - -export class EarlyErrorState { - - constructor() { - this.errors = []; - // errors that are only errors in strict mode code - this.strictErrors = []; - - // Label values used in LabeledStatement nodes; cleared at function boundaries - this.usedLabelNames = []; - - // BreakStatement nodes; cleared at iteration; switch; and function boundaries - this.freeBreakStatements = []; - // ContinueStatement nodes; cleared at - this.freeContinueStatements = []; - - // labeled BreakStatement nodes; cleared at LabeledStatement with same Label and function boundaries - this.freeLabeledBreakStatements = []; - // labeled ContinueStatement nodes; cleared at labeled iteration statement with same Label and function boundaries - this.freeLabeledContinueStatements = []; - - // NewTargetExpression nodes; cleared at function (besides arrow expression) boundaries - this.newTargetExpressions = []; - - // BindingIdentifier nodes; cleared at containing declaration node - this.boundNames = new MultiMap; - // BindingIdentifiers that were found to be in a lexical binding position - this.lexicallyDeclaredNames = new MultiMap; - // BindingIdentifiers that were the name of a FunctionDeclaration - this.functionDeclarationNames = new MultiMap; - // BindingIdentifiers that were found to be in a variable binding position - this.varDeclaredNames = new MultiMap; - // BindingIdentifiers that were found to be in a variable binding position - this.forOfVarDeclaredNames = []; - - // Names that this module exports - this.exportedNames = new MultiMap; - // Locally declared names that are referenced in export declarations - this.exportedBindings = new MultiMap; - - // CallExpressions with Super callee - this.superCallExpressions = []; - // SuperCall expressions in the context of a Method named "constructor" - this.superCallExpressionsInConstructorMethod = []; - // MemberExpressions with Super object - this.superPropertyExpressions = []; - - // YieldExpression and YieldGeneratorExpression nodes; cleared at function boundaries - this.yieldExpressions = []; - // AwaitExpression nodes; cleared at function boundaries - this.awaitExpressions = []; - } - - - addFreeBreakStatement(s) { - this.freeBreakStatements.push(s); - return this; - } - - addFreeLabeledBreakStatement(s) { - this.freeLabeledBreakStatements.push(s); - return this; - } - - clearFreeBreakStatements() { - this.freeBreakStatements = []; - return this; - } - - addFreeContinueStatement(s) { - this.freeContinueStatements.push(s); - return this; - } - - addFreeLabeledContinueStatement(s) { - this.freeLabeledContinueStatements.push(s); - return this; - } - - clearFreeContinueStatements() { - this.freeContinueStatements = []; - return this; - } - - enforceFreeBreakStatementErrors(createError) { - [].push.apply(this.errors, this.freeBreakStatements.map(createError)); - this.freeBreakStatements = []; - return this; - } - - enforceFreeLabeledBreakStatementErrors(createError) { - [].push.apply(this.errors, this.freeLabeledBreakStatements.map(createError)); - this.freeLabeledBreakStatements = []; - return this; - } - - enforceFreeContinueStatementErrors(createError) { - [].push.apply(this.errors, this.freeContinueStatements.map(createError)); - this.freeContinueStatements = []; - return this; - } - - enforceFreeLabeledContinueStatementErrors(createError) { - [].push.apply(this.errors, this.freeLabeledContinueStatements.map(createError)); - this.freeLabeledContinueStatements = []; - return this; - } - - - observeIterationLabel(label) { - this.usedLabelNames.push(label); - this.freeLabeledBreakStatements = this.freeLabeledBreakStatements.filter(s => s.label !== label); - this.freeLabeledContinueStatements = this.freeLabeledContinueStatements.filter(s => s.label !== label); - return this; - } - - observeNonIterationLabel(label) { - this.usedLabelNames.push(label); - this.freeLabeledBreakStatements = this.freeLabeledBreakStatements.filter(s => s.label !== label); - return this; - } - - clearUsedLabelNames() { - this.usedLabelNames = []; - return this; - } - - - observeSuperCallExpression(node) { - this.superCallExpressions.push(node); - return this; - } - - observeConstructorMethod() { - this.superCallExpressionsInConstructorMethod = this.superCallExpressions; - this.superCallExpressions = []; - return this; - } - - clearSuperCallExpressionsInConstructorMethod() { - this.superCallExpressionsInConstructorMethod = []; - return this; - } - - enforceSuperCallExpressions(createError) { - [].push.apply(this.errors, this.superCallExpressions.map(createError)); - [].push.apply(this.errors, this.superCallExpressionsInConstructorMethod.map(createError)); - this.superCallExpressions = []; - this.superCallExpressionsInConstructorMethod = []; - return this; - } - - enforceSuperCallExpressionsInConstructorMethod(createError) { - [].push.apply(this.errors, this.superCallExpressionsInConstructorMethod.map(createError)); - this.superCallExpressionsInConstructorMethod = []; - return this; - } - - - observeSuperPropertyExpression(node) { - this.superPropertyExpressions.push(node); - return this; - } - - clearSuperPropertyExpressions() { - this.superPropertyExpressions = []; - return this; - } - - enforceSuperPropertyExpressions(createError) { - [].push.apply(this.errors, this.superPropertyExpressions.map(createError)); - this.superPropertyExpressions = []; - return this; - } - - - observeNewTargetExpression(node) { - this.newTargetExpressions.push(node); - return this; - } - - clearNewTargetExpressions() { - this.newTargetExpressions = []; - return this; - } - - - bindName(name, node) { - this.boundNames.set(name, node); - return this; - } - - clearBoundNames() { - this.boundNames = new MultiMap; - return this; - } - - observeLexicalDeclaration() { - addEach(this.lexicallyDeclaredNames, this.boundNames); - this.boundNames = new MultiMap; - return this; - } - - observeLexicalBoundary() { - this.previousLexicallyDeclaredNames = this.lexicallyDeclaredNames; - this.lexicallyDeclaredNames = new MultiMap; - this.functionDeclarationNames = new MultiMap; - return this; - } - - enforceDuplicateLexicallyDeclaredNames(createError) { - this.lexicallyDeclaredNames.forEachEntry(nodes => { - if (nodes.length > 1) { - nodes.slice(1).forEach(dupeNode => { - this.addError(createError(dupeNode)); - }); - } - }); - return this; - } - - enforceConflictingLexicallyDeclaredNames(otherNames, createError) { - this.lexicallyDeclaredNames.forEachEntry((nodes, bindingName) => { - if (otherNames.has(bindingName)) { - nodes.forEach(conflictingNode => { - this.addError(createError(conflictingNode)); - }); - } - }); - return this; - } - - observeFunctionDeclaration() { - this.observeVarBoundary(); - addEach(this.functionDeclarationNames, this.boundNames); - this.boundNames = new MultiMap; - return this; - } - - functionDeclarationNamesAreLexical() { - addEach(this.lexicallyDeclaredNames, this.functionDeclarationNames); - this.functionDeclarationNames = new MultiMap; - return this; - } - - observeVarDeclaration() { - addEach(this.varDeclaredNames, this.boundNames); - this.boundNames = new MultiMap; - return this; - } - - recordForOfVars() { - this.varDeclaredNames.forEach(bindingIdentifier => { - this.forOfVarDeclaredNames.push(bindingIdentifier); - }); - return this; - } - - observeVarBoundary() { - this.lexicallyDeclaredNames = new MultiMap; - this.functionDeclarationNames = new MultiMap; - this.varDeclaredNames = new MultiMap; - this.forOfVarDeclaredNames = []; - return this; - } - - - exportName(name, node) { - this.exportedNames.set(name, node); - return this; - } - - exportDeclaredNames() { - addEach(this.exportedNames, this.lexicallyDeclaredNames, this.varDeclaredNames); - addEach(this.exportedBindings, this.lexicallyDeclaredNames, this.varDeclaredNames); - return this; - } - - exportBinding(name, node) { - this.exportedBindings.set(name, node); - return this; - } - - clearExportedBindings() { - this.exportedBindings = new MultiMap; - return this; - } - - - observeYieldExpression(node) { - this.yieldExpressions.push(node); - return this; - } - - clearYieldExpressions() { - this.yieldExpressions = []; - return this; - } - - observeAwaitExpression(node) { - this.awaitExpressions.push(node); - return this; - } - - clearAwaitExpressions() { - this.awaitExpressions = []; - return this; - } - - - addError(e) { - this.errors.push(e); - return this; - } - - addStrictError(e) { - this.strictErrors.push(e); - return this; - } - - enforceStrictErrors() { - [].push.apply(this.errors, this.strictErrors); - this.strictErrors = []; - return this; - } - - - // MONOID IMPLEMENTATION - - static empty() { - return identity; - } - - concat(s) { - if (this === identity) return s; - if (s === identity) return this; - [].push.apply(this.errors, s.errors); - [].push.apply(this.strictErrors, s.strictErrors); - [].push.apply(this.usedLabelNames, s.usedLabelNames); - [].push.apply(this.freeBreakStatements, s.freeBreakStatements); - [].push.apply(this.freeContinueStatements, s.freeContinueStatements); - [].push.apply(this.freeLabeledBreakStatements, s.freeLabeledBreakStatements); - [].push.apply(this.freeLabeledContinueStatements, s.freeLabeledContinueStatements); - [].push.apply(this.newTargetExpressions, s.newTargetExpressions); - addEach(this.boundNames, s.boundNames); - addEach(this.lexicallyDeclaredNames, s.lexicallyDeclaredNames); - addEach(this.functionDeclarationNames, s.functionDeclarationNames); - addEach(this.varDeclaredNames, s.varDeclaredNames); - [].push.apply(this.forOfVarDeclaredNames, s.forOfVarDeclaredNames); - addEach(this.exportedNames, s.exportedNames); - addEach(this.exportedBindings, s.exportedBindings); - [].push.apply(this.superCallExpressions, s.superCallExpressions); - [].push.apply(this.superCallExpressionsInConstructorMethod, s.superCallExpressionsInConstructorMethod); - [].push.apply(this.superPropertyExpressions, s.superPropertyExpressions); - [].push.apply(this.yieldExpressions, s.yieldExpressions); - [].push.apply(this.awaitExpressions, s.awaitExpressions); - return this; - } - -} - -identity = new EarlyErrorState; -Object.getOwnPropertyNames(EarlyErrorState.prototype).forEach(methodName => { - if (methodName === 'constructor') return; - Object.defineProperty(identity, methodName, { - value() { - return EarlyErrorState.prototype[methodName].apply(new EarlyErrorState, arguments); - }, - enumerable: false, - writable: true, - configurable: true, - }); -}); - -export class EarlyError extends Error { - constructor(node, message) { - super(message); - this.node = node; - this.message = message; - } -} diff --git a/docs/dist/shift-parser/early-errors.js b/docs/dist/shift-parser/early-errors.js deleted file mode 100644 index 9c230b8a..00000000 --- a/docs/dist/shift-parser/early-errors.js +++ /dev/null @@ -1,772 +0,0 @@ -/** - * Copyright 2014 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import reduce, { MonoidalReducer } from '../shift-reducer/index.js'; -import { isStrictModeReservedWord } from './utils.js'; -import { ErrorMessages } from './errors.js'; - -import { EarlyErrorState, EarlyError } from './early-error-state.js'; - -function isStrictFunctionBody({ directives }) { - return directives.some(directive => directive.rawValue === 'use strict'); -} - -function isLabelledFunction(node) { - return node.type === 'LabeledStatement' && - (node.body.type === 'FunctionDeclaration' || isLabelledFunction(node.body)); -} - -function isIterationStatement(node) { - switch (node.type) { - case 'LabeledStatement': - return isIterationStatement(node.body); - case 'DoWhileStatement': - case 'ForInStatement': - case 'ForOfStatement': - case 'ForStatement': - case 'WhileStatement': - return true; - } - return false; -} - -function isSpecialMethod(methodDefinition) { - if (methodDefinition.name.type !== 'StaticPropertyName' || methodDefinition.name.value !== 'constructor') { - return false; - } - switch (methodDefinition.type) { - case 'Getter': - case 'Setter': - return true; - case 'Method': - return methodDefinition.isGenerator || methodDefinition.isAsync; - } - /* istanbul ignore next */ - throw new Error('not reached'); -} - - -function enforceDuplicateConstructorMethods(node, s) { - let ctors = node.elements.filter(e => - !e.isStatic && - e.method.type === 'Method' && - !e.method.isGenerator && - e.method.name.type === 'StaticPropertyName' && - e.method.name.value === 'constructor' - ); - if (ctors.length > 1) { - ctors.slice(1).forEach(ctor => { - s = s.addError(new EarlyError(ctor, 'Duplicate constructor method in class')); - }); - } - return s; -} - -const SUPERCALL_ERROR = node => new EarlyError(node, ErrorMessages.ILLEGAL_SUPER_CALL); -const SUPERPROPERTY_ERROR = node => new EarlyError(node, 'Member access on super must be in a method'); -const DUPLICATE_BINDING = node => new EarlyError(node, `Duplicate binding ${JSON.stringify(node.name)}`); -const FREE_CONTINUE = node => new EarlyError(node, 'Continue statement must be nested within an iteration statement'); -const UNBOUND_CONTINUE = node => new EarlyError(node, `Continue statement must be nested within an iteration statement with label ${JSON.stringify(node.label)}`); -const FREE_BREAK = node => new EarlyError(node, 'Break statement must be nested within an iteration statement or a switch statement'); -const UNBOUND_BREAK = node => new EarlyError(node, `Break statement must be nested within a statement with label ${JSON.stringify(node.label)}`); - -export class EarlyErrorChecker extends MonoidalReducer { - constructor() { - super(EarlyErrorState); - } - - reduceAssignmentExpression() { - return super.reduceAssignmentExpression(...arguments).clearBoundNames(); - } - - reduceAssignmentTargetIdentifier(node) { - let s = this.identity; - if (node.name === 'eval' || node.name === 'arguments' || isStrictModeReservedWord(node.name)) { - s = s.addStrictError(new EarlyError(node, `The identifier ${JSON.stringify(node.name)} must not be in binding position in strict mode`)); - } - return s; - } - - reduceArrowExpression(node, { params, body }) { - let isSimpleParameterList = node.params.rest == null && node.params.items.every(i => i.type === 'BindingIdentifier'); - params = params.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING); - if (node.body.type === 'FunctionBody') { - body = body.enforceConflictingLexicallyDeclaredNames(params.lexicallyDeclaredNames, DUPLICATE_BINDING); - if (isStrictFunctionBody(node.body)) { - params = params.enforceStrictErrors(); - body = body.enforceStrictErrors(); - } - } - params.yieldExpressions.forEach(n => { - params = params.addError(new EarlyError(n, 'Arrow parameters must not contain yield expressions')); - }); - params.awaitExpressions.forEach(n => { - params = params.addError(new EarlyError(n, 'Arrow parameters must not contain await expressions')); - }); - let s = super.reduceArrowExpression(node, { params, body }); - if (!isSimpleParameterList && node.body.type === 'FunctionBody' && isStrictFunctionBody(node.body)) { - s = s.addError(new EarlyError(node, 'Functions with non-simple parameter lists may not contain a "use strict" directive')); - } - s = s.clearYieldExpressions(); - s = s.clearAwaitExpressions(); - s = s.observeVarBoundary(); - return s; - } - - reduceAwaitExpression(node, { expression }) { - return expression.observeAwaitExpression(node); - } - - reduceBindingIdentifier(node) { - let s = this.identity; - if (node.name === 'eval' || node.name === 'arguments' || isStrictModeReservedWord(node.name)) { - s = s.addStrictError(new EarlyError(node, `The identifier ${JSON.stringify(node.name)} must not be in binding position in strict mode`)); - } - s = s.bindName(node.name, node); - return s; - } - - reduceBlock() { - let s = super.reduceBlock(...arguments); - s = s.functionDeclarationNamesAreLexical(); - s = s.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING); - s = s.enforceConflictingLexicallyDeclaredNames(s.varDeclaredNames, DUPLICATE_BINDING); - s = s.observeLexicalBoundary(); - return s; - } - - reduceBreakStatement(node) { - let s = super.reduceBreakStatement(...arguments); - s = node.label == null - ? s.addFreeBreakStatement(node) - : s.addFreeLabeledBreakStatement(node); - return s; - } - - reduceCallExpression(node) { - let s = super.reduceCallExpression(...arguments); - if (node.callee.type === 'Super') { - s = s.observeSuperCallExpression(node); - } - return s; - } - - reduceCatchClause(node, { binding, body }) { - binding = binding.observeLexicalDeclaration(); - binding = binding.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING); - binding = binding.enforceConflictingLexicallyDeclaredNames(body.previousLexicallyDeclaredNames, DUPLICATE_BINDING); - binding.lexicallyDeclaredNames.forEachEntry((nodes, bindingName) => { - if (body.varDeclaredNames.has(bindingName)) { - body.varDeclaredNames.get(bindingName).forEach(conflictingNode => { - if (body.forOfVarDeclaredNames.indexOf(conflictingNode) >= 0) { - binding = binding.addError(DUPLICATE_BINDING(conflictingNode)); - } - }); - } - }); - let s = super.reduceCatchClause(node, { binding, body }); - s = s.observeLexicalBoundary(); - return s; - } - - reduceClassDeclaration(node, { name, super: _super, elements }) { - let s = name.enforceStrictErrors(); - let sElements = this.append(...elements); - sElements = sElements.enforceStrictErrors(); - if (node.super != null) { - _super = _super.enforceStrictErrors(); - s = this.append(s, _super); - sElements = sElements.clearSuperCallExpressionsInConstructorMethod(); - } - s = this.append(s, sElements); - s = enforceDuplicateConstructorMethods(node, s); - s = s.observeLexicalDeclaration(); - return s; - } - - reduceClassElement(node) { - let s = super.reduceClassElement(...arguments); - if (!node.isStatic && isSpecialMethod(node.method)) { - s = s.addError(new EarlyError(node, ErrorMessages.ILLEGAL_CONSTRUCTORS)); - } - if (node.isStatic && node.method.name.type === 'StaticPropertyName' && node.method.name.value === 'prototype') { - s = s.addError(new EarlyError(node, 'Static class methods cannot be named "prototype"')); - } - return s; - } - - reduceClassExpression(node, { name, super: _super, elements }) { - let s = node.name == null ? this.identity : name.enforceStrictErrors(); - let sElements = this.append(...elements); - sElements = sElements.enforceStrictErrors(); - if (node.super != null) { - _super = _super.enforceStrictErrors(); - s = this.append(s, _super); - sElements = sElements.clearSuperCallExpressionsInConstructorMethod(); - } - s = this.append(s, sElements); - s = enforceDuplicateConstructorMethods(node, s); - s = s.clearBoundNames(); - return s; - } - - reduceCompoundAssignmentExpression() { - return super.reduceCompoundAssignmentExpression(...arguments).clearBoundNames(); - } - - reduceComputedMemberExpression(node) { - let s = super.reduceComputedMemberExpression(...arguments); - if (node.object.type === 'Super') { - s = s.observeSuperPropertyExpression(node); - } - return s; - } - - reduceContinueStatement(node) { - let s = super.reduceContinueStatement(...arguments); - s = node.label == null - ? s.addFreeContinueStatement(node) - : s.addFreeLabeledContinueStatement(node); - return s; - } - - reduceDoWhileStatement(node) { - let s = super.reduceDoWhileStatement(...arguments); - if (isLabelledFunction(node.body)) { - s = s.addError(new EarlyError(node.body, 'The body of a do-while statement must not be a labeled function declaration')); - } - s = s.clearFreeContinueStatements(); - s = s.clearFreeBreakStatements(); - return s; - } - - reduceExport() { - let s = super.reduceExport(...arguments); - s = s.functionDeclarationNamesAreLexical(); - s = s.exportDeclaredNames(); - return s; - } - - reduceExportFrom() { - let s = super.reduceExportFrom(...arguments); - s = s.clearExportedBindings(); - return s; - } - - reduceExportFromSpecifier(node) { - let s = super.reduceExportFromSpecifier(...arguments); - s = s.exportName(node.exportedName || node.name, node); - s = s.exportBinding(node.name, node); - return s; - } - - reduceExportLocalSpecifier(node) { - let s = super.reduceExportLocalSpecifier(...arguments); - s = s.exportName(node.exportedName || node.name.name, node); - s = s.exportBinding(node.name.name, node); - return s; - } - - reduceExportDefault(node) { - let s = super.reduceExportDefault(...arguments); - s = s.functionDeclarationNamesAreLexical(); - s = s.exportName('default', node); - return s; - } - - reduceFormalParameters() { - let s = super.reduceFormalParameters(...arguments); - s = s.observeLexicalDeclaration(); - return s; - } - - reduceForStatement(node, { init, test, update, body }) { - if (init != null) { - init = init.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING); - init = init.enforceConflictingLexicallyDeclaredNames(body.varDeclaredNames, DUPLICATE_BINDING); - } - let s = super.reduceForStatement(node, { init, test, update, body }); - if (node.init != null && node.init.type === 'VariableDeclaration' && node.init.kind === 'const') { - node.init.declarators.forEach(declarator => { - if (declarator.init == null) { - s = s.addError(new EarlyError(declarator, 'Constant lexical declarations must have an initialiser')); - } - }); - } - if (isLabelledFunction(node.body)) { - s = s.addError(new EarlyError(node.body, 'The body of a for statement must not be a labeled function declaration')); - } - s = s.clearFreeContinueStatements(); - s = s.clearFreeBreakStatements(); - s = s.observeLexicalBoundary(); - return s; - } - - reduceForInStatement(node, { left, right, body }) { - left = left.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING); - left = left.enforceConflictingLexicallyDeclaredNames(body.varDeclaredNames, DUPLICATE_BINDING); - let s = super.reduceForInStatement(node, { left, right, body }); - if (isLabelledFunction(node.body)) { - s = s.addError(new EarlyError(node.body, 'The body of a for-in statement must not be a labeled function declaration')); - } - s = s.clearFreeContinueStatements(); - s = s.clearFreeBreakStatements(); - s = s.observeLexicalBoundary(); - return s; - } - - reduceForOfStatement(node, { left, right, body }) { - left = left.recordForOfVars(); - left = left.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING); - left = left.enforceConflictingLexicallyDeclaredNames(body.varDeclaredNames, DUPLICATE_BINDING); - let s = super.reduceForOfStatement(node, { left, right, body }); - if (isLabelledFunction(node.body)) { - s = s.addError(new EarlyError(node.body, 'The body of a for-of statement must not be a labeled function declaration')); - } - s = s.clearFreeContinueStatements(); - s = s.clearFreeBreakStatements(); - s = s.observeLexicalBoundary(); - return s; - } - - reduceForAwaitStatement(node, { left, right, body }) { - left = left.recordForOfVars(); - left = left.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING); - left = left.enforceConflictingLexicallyDeclaredNames(body.varDeclaredNames, DUPLICATE_BINDING); - let s = super.reduceForOfStatement(node, { left, right, body }); - if (isLabelledFunction(node.body)) { - s = s.addError(new EarlyError(node.body, 'The body of a for-await statement must not be a labeled function declaration')); - } - s = s.clearFreeContinueStatements(); - s = s.clearFreeBreakStatements(); - s = s.observeLexicalBoundary(); - return s; - } - - reduceFunctionBody(node) { - let s = super.reduceFunctionBody(...arguments); - s = s.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING); - s = s.enforceConflictingLexicallyDeclaredNames(s.varDeclaredNames, DUPLICATE_BINDING); - s = s.enforceFreeContinueStatementErrors(FREE_CONTINUE); - s = s.enforceFreeLabeledContinueStatementErrors(UNBOUND_CONTINUE); - s = s.enforceFreeBreakStatementErrors(FREE_BREAK); - s = s.enforceFreeLabeledBreakStatementErrors(UNBOUND_BREAK); - s = s.clearUsedLabelNames(); - s = s.clearYieldExpressions(); - s = s.clearAwaitExpressions(); - if (isStrictFunctionBody(node)) { - s = s.enforceStrictErrors(); - } - return s; - } - - reduceFunctionDeclaration(node, { name, params, body }) { - let isSimpleParameterList = node.params.rest == null && node.params.items.every(i => i.type === 'BindingIdentifier'); - let addError = !isSimpleParameterList || node.isGenerator ? 'addError' : 'addStrictError'; - params.lexicallyDeclaredNames.forEachEntry(nodes => { - if (nodes.length > 1) { - nodes.slice(1).forEach(dupeNode => { - params = params[addError](DUPLICATE_BINDING(dupeNode)); - }); - } - }); - body = body.enforceConflictingLexicallyDeclaredNames(params.lexicallyDeclaredNames, DUPLICATE_BINDING); - body = body.enforceSuperCallExpressions(SUPERCALL_ERROR); - body = body.enforceSuperPropertyExpressions(SUPERPROPERTY_ERROR); - params = params.enforceSuperCallExpressions(SUPERCALL_ERROR); - params = params.enforceSuperPropertyExpressions(SUPERPROPERTY_ERROR); - if (node.isGenerator) { - params.yieldExpressions.forEach(n => { - params = params.addError(new EarlyError(n, 'Generator parameters must not contain yield expressions')); - }); - } - if (node.isAsync) { - params.awaitExpressions.forEach(n => { - params = params.addError(new EarlyError(n, 'Async function parameters must not contain await expressions')); - }); - } - params = params.clearNewTargetExpressions(); - body = body.clearNewTargetExpressions(); - if (isStrictFunctionBody(node.body)) { - params = params.enforceStrictErrors(); - body = body.enforceStrictErrors(); - } - let s = super.reduceFunctionDeclaration(node, { name, params, body }); - if (!isSimpleParameterList && isStrictFunctionBody(node.body)) { - s = s.addError(new EarlyError(node, 'Functions with non-simple parameter lists may not contain a "use strict" directive')); - } - s = s.clearYieldExpressions(); - s = s.clearAwaitExpressions(); - s = s.observeFunctionDeclaration(); - return s; - } - - reduceFunctionExpression(node, { name, params, body }) { - let isSimpleParameterList = node.params.rest == null && node.params.items.every(i => i.type === 'BindingIdentifier'); - let addError = !isSimpleParameterList || node.isGenerator ? 'addError' : 'addStrictError'; - params.lexicallyDeclaredNames.forEachEntry((nodes, bindingName) => { - if (nodes.length > 1) { - nodes.slice(1).forEach(dupeNode => { - params = params[addError](new EarlyError(dupeNode, `Duplicate binding ${JSON.stringify(bindingName)}`)); - }); - } - }); - body = body.enforceConflictingLexicallyDeclaredNames(params.lexicallyDeclaredNames, DUPLICATE_BINDING); - body = body.enforceSuperCallExpressions(SUPERCALL_ERROR); - body = body.enforceSuperPropertyExpressions(SUPERPROPERTY_ERROR); - params = params.enforceSuperCallExpressions(SUPERCALL_ERROR); - params = params.enforceSuperPropertyExpressions(SUPERPROPERTY_ERROR); - if (node.isGenerator) { - params.yieldExpressions.forEach(n => { - params = params.addError(new EarlyError(n, 'Generator parameters must not contain yield expressions')); - }); - } - if (node.isAsync) { - params.awaitExpressions.forEach(n => { - params = params.addError(new EarlyError(n, 'Async function parameters must not contain await expressions')); - }); - } - params = params.clearNewTargetExpressions(); - body = body.clearNewTargetExpressions(); - if (isStrictFunctionBody(node.body)) { - params = params.enforceStrictErrors(); - body = body.enforceStrictErrors(); - } - let s = super.reduceFunctionExpression(node, { name, params, body }); - if (!isSimpleParameterList && isStrictFunctionBody(node.body)) { - s = s.addError(new EarlyError(node, 'Functions with non-simple parameter lists may not contain a "use strict" directive')); - } - s = s.clearBoundNames(); - s = s.clearYieldExpressions(); - s = s.clearAwaitExpressions(); - s = s.observeVarBoundary(); - return s; - } - - reduceGetter(node, { name, body }) { - body = body.enforceSuperCallExpressions(SUPERCALL_ERROR); - body = body.clearSuperPropertyExpressions(); - body = body.clearNewTargetExpressions(); - if (isStrictFunctionBody(node.body)) { - body = body.enforceStrictErrors(); - } - let s = super.reduceGetter(node, { name, body }); - s = s.observeVarBoundary(); - return s; - } - - reduceIdentifierExpression(node) { - let s = this.identity; - if (isStrictModeReservedWord(node.name)) { - s = s.addStrictError(new EarlyError(node, `The identifier ${JSON.stringify(node.name)} must not be in expression position in strict mode`)); - } - return s; - } - - reduceIfStatement(node, { test, consequent, alternate }) { - if (isLabelledFunction(node.consequent)) { - consequent = consequent.addError(new EarlyError(node.consequent, 'The consequent of an if statement must not be a labeled function declaration')); - } - if (node.alternate != null && isLabelledFunction(node.alternate)) { - alternate = alternate.addError(new EarlyError(node.alternate, 'The alternate of an if statement must not be a labeled function declaration')); - } - if (node.consequent.type === 'FunctionDeclaration') { - consequent = consequent.addStrictError(new EarlyError(node.consequent, 'FunctionDeclarations in IfStatements are disallowed in strict mode')); - consequent = consequent.observeLexicalBoundary(); - } - if (node.alternate != null && node.alternate.type === 'FunctionDeclaration') { - alternate = alternate.addStrictError(new EarlyError(node.alternate, 'FunctionDeclarations in IfStatements are disallowed in strict mode')); - alternate = alternate.observeLexicalBoundary(); - } - return super.reduceIfStatement(node, { test, consequent, alternate }); - } - - reduceImport() { - let s = super.reduceImport(...arguments); - s = s.observeLexicalDeclaration(); - return s; - } - - reduceImportNamespace() { - let s = super.reduceImportNamespace(...arguments); - s = s.observeLexicalDeclaration(); - return s; - } - - reduceLabeledStatement(node) { - let s = super.reduceLabeledStatement(...arguments); - if (node.label === 'yield' || isStrictModeReservedWord(node.label)) { - s = s.addStrictError(new EarlyError(node, `The identifier ${JSON.stringify(node.label)} must not be in label position in strict mode`)); - } - if (s.usedLabelNames.indexOf(node.label) >= 0) { - s = s.addError(new EarlyError(node, `Label ${JSON.stringify(node.label)} has already been declared`)); - } - if (node.body.type === 'FunctionDeclaration') { - s = s.addStrictError(new EarlyError(node, 'Labeled FunctionDeclarations are disallowed in strict mode')); - } - s = isIterationStatement(node.body) - ? s.observeIterationLabel(node.label) - : s.observeNonIterationLabel(node.label); - return s; - } - - reduceLiteralRegExpExpression() { - let s = this.identity; - // NOTE: the RegExp pattern acceptor is disabled until we have more confidence in its correctness (more tests) - // if (!PatternAcceptor.test(node.pattern, node.flags.indexOf("u") >= 0)) { - // s = s.addError(new EarlyError(node, "Invalid regular expression pattern")); - // } - return s; - } - - reduceMethod(node, { name, params, body }) { - let isSimpleParameterList = node.params.rest == null && node.params.items.every(i => i.type === 'BindingIdentifier'); - params = params.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING); - body = body.enforceConflictingLexicallyDeclaredNames(params.lexicallyDeclaredNames, DUPLICATE_BINDING); - if (node.name.type === 'StaticPropertyName' && node.name.value === 'constructor') { - body = body.observeConstructorMethod(); - params = params.observeConstructorMethod(); - } else { - body = body.enforceSuperCallExpressions(SUPERCALL_ERROR); - params = params.enforceSuperCallExpressions(SUPERCALL_ERROR); - } - if (node.isGenerator) { - params.yieldExpressions.forEach(n => { - params = params.addError(new EarlyError(n, 'Generator parameters must not contain yield expressions')); - }); - } - if (node.isAsync) { - params.awaitExpressions.forEach(n => { - params = params.addError(new EarlyError(n, 'Async function parameters must not contain await expressions')); - }); - } - body = body.clearSuperPropertyExpressions(); - params = params.clearSuperPropertyExpressions(); - params = params.clearNewTargetExpressions(); - body = body.clearNewTargetExpressions(); - if (isStrictFunctionBody(node.body)) { - params = params.enforceStrictErrors(); - body = body.enforceStrictErrors(); - } - let s = super.reduceMethod(node, { name, params, body }); - if (!isSimpleParameterList && isStrictFunctionBody(node.body)) { - s = s.addError(new EarlyError(node, 'Functions with non-simple parameter lists may not contain a "use strict" directive')); - } - s = s.clearYieldExpressions(); - s = s.clearAwaitExpressions(); - s = s.observeVarBoundary(); - return s; - } - - reduceModule() { - let s = super.reduceModule(...arguments); - s = s.functionDeclarationNamesAreLexical(); - s = s.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING); - s = s.enforceConflictingLexicallyDeclaredNames(s.varDeclaredNames, DUPLICATE_BINDING); - s.exportedNames.forEachEntry((nodes, bindingName) => { - if (nodes.length > 1) { - nodes.slice(1).forEach(dupeNode => { - s = s.addError(new EarlyError(dupeNode, `Duplicate export ${JSON.stringify(bindingName)}`)); - }); - } - }); - s.exportedBindings.forEachEntry((nodes, bindingName) => { - if (!s.lexicallyDeclaredNames.has(bindingName) && !s.varDeclaredNames.has(bindingName)) { - nodes.forEach(undeclaredNode => { - s = s.addError(new EarlyError(undeclaredNode, `Exported binding ${JSON.stringify(bindingName)} is not declared`)); - }); - } - }); - s.newTargetExpressions.forEach(node => { - s = s.addError(new EarlyError(node, 'new.target must be within function (but not arrow expression) code')); - }); - s = s.enforceFreeContinueStatementErrors(FREE_CONTINUE); - s = s.enforceFreeLabeledContinueStatementErrors(UNBOUND_CONTINUE); - s = s.enforceFreeBreakStatementErrors(FREE_BREAK); - s = s.enforceFreeLabeledBreakStatementErrors(UNBOUND_BREAK); - s = s.enforceSuperCallExpressions(SUPERCALL_ERROR); - s = s.enforceSuperPropertyExpressions(SUPERPROPERTY_ERROR); - s = s.enforceStrictErrors(); - return s; - } - - reduceNewTargetExpression(node) { - return this.identity.observeNewTargetExpression(node); - } - - reduceObjectExpression(node) { - let s = super.reduceObjectExpression(...arguments); - s = s.enforceSuperCallExpressionsInConstructorMethod(SUPERCALL_ERROR); - let protos = node.properties.filter(p => p.type === 'DataProperty' && p.name.type === 'StaticPropertyName' && p.name.value === '__proto__'); - protos.slice(1).forEach(n => { - s = s.addError(new EarlyError(n, 'Duplicate __proto__ property in object literal not allowed')); - }); - return s; - } - - reduceUpdateExpression() { - let s = super.reduceUpdateExpression(...arguments); - s = s.clearBoundNames(); - return s; - } - - reduceUnaryExpression(node) { - let s = super.reduceUnaryExpression(...arguments); - if (node.operator === 'delete' && node.operand.type === 'IdentifierExpression') { - s = s.addStrictError(new EarlyError(node, 'Identifier expressions must not be deleted in strict mode')); - } - return s; - } - - reduceScript(node) { - let s = super.reduceScript(...arguments); - s = s.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING); - s = s.enforceConflictingLexicallyDeclaredNames(s.varDeclaredNames, DUPLICATE_BINDING); - s.newTargetExpressions.forEach(n => { - s = s.addError(new EarlyError(n, 'new.target must be within function (but not arrow expression) code')); - }); - s = s.enforceFreeContinueStatementErrors(FREE_CONTINUE); - s = s.enforceFreeLabeledContinueStatementErrors(UNBOUND_CONTINUE); - s = s.enforceFreeBreakStatementErrors(FREE_BREAK); - s = s.enforceFreeLabeledBreakStatementErrors(UNBOUND_BREAK); - s = s.enforceSuperCallExpressions(SUPERCALL_ERROR); - s = s.enforceSuperPropertyExpressions(SUPERPROPERTY_ERROR); - if (isStrictFunctionBody(node)) { - s = s.enforceStrictErrors(); - } - return s; - } - - reduceSetter(node, { name, param, body }) { - let isSimpleParameterList = node.param.type === 'BindingIdentifier'; - param = param.observeLexicalDeclaration(); - param = param.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING); - body = body.enforceConflictingLexicallyDeclaredNames(param.lexicallyDeclaredNames, DUPLICATE_BINDING); - param = param.enforceSuperCallExpressions(SUPERCALL_ERROR); - body = body.enforceSuperCallExpressions(SUPERCALL_ERROR); - param = param.clearSuperPropertyExpressions(); - body = body.clearSuperPropertyExpressions(); - param = param.clearNewTargetExpressions(); - body = body.clearNewTargetExpressions(); - if (isStrictFunctionBody(node.body)) { - param = param.enforceStrictErrors(); - body = body.enforceStrictErrors(); - } - let s = super.reduceSetter(node, { name, param, body }); - if (!isSimpleParameterList && isStrictFunctionBody(node.body)) { - s = s.addError(new EarlyError(node, 'Functions with non-simple parameter lists may not contain a "use strict" directive')); - } - s = s.observeVarBoundary(); - return s; - } - - reduceStaticMemberExpression(node) { - let s = super.reduceStaticMemberExpression(...arguments); - if (node.object.type === 'Super') { - s = s.observeSuperPropertyExpression(node); - } - return s; - } - - reduceSwitchStatement(node, { discriminant, cases }) { - let sCases = this.append(...cases); - sCases = sCases.functionDeclarationNamesAreLexical(); - sCases = sCases.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING); - sCases = sCases.enforceConflictingLexicallyDeclaredNames(sCases.varDeclaredNames, DUPLICATE_BINDING); - sCases = sCases.observeLexicalBoundary(); - let s = this.append(discriminant, sCases); - s = s.clearFreeBreakStatements(); - return s; - } - - reduceSwitchStatementWithDefault(node, { discriminant, preDefaultCases, defaultCase, postDefaultCases }) { - let sCases = this.append(defaultCase, ...preDefaultCases, ...postDefaultCases); - sCases = sCases.functionDeclarationNamesAreLexical(); - sCases = sCases.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING); - sCases = sCases.enforceConflictingLexicallyDeclaredNames(sCases.varDeclaredNames, DUPLICATE_BINDING); - sCases = sCases.observeLexicalBoundary(); - let s = this.append(discriminant, sCases); - s = s.clearFreeBreakStatements(); - return s; - } - - reduceVariableDeclaration(node) { - let s = super.reduceVariableDeclaration(...arguments); - switch (node.kind) { - case 'const': - case 'let': { - s = s.observeLexicalDeclaration(); - if (s.lexicallyDeclaredNames.has('let')) { - s.lexicallyDeclaredNames.get('let').forEach(n => { - s = s.addError(new EarlyError(n, 'Lexical declarations must not have a binding named "let"')); - }); - } - break; - } - case 'var': - s = s.observeVarDeclaration(); - break; - } - return s; - } - - reduceVariableDeclarationStatement(node) { - let s = super.reduceVariableDeclarationStatement(...arguments); - if (node.declaration.kind === 'const') { - node.declaration.declarators.forEach(declarator => { - if (declarator.init == null) { - s = s.addError(new EarlyError(declarator, 'Constant lexical declarations must have an initialiser')); - } - }); - } - return s; - } - - reduceWhileStatement(node) { - let s = super.reduceWhileStatement(...arguments); - if (isLabelledFunction(node.body)) { - s = s.addError(new EarlyError(node.body, 'The body of a while statement must not be a labeled function declaration')); - } - s = s.clearFreeContinueStatements().clearFreeBreakStatements(); - return s; - } - - reduceWithStatement(node) { - let s = super.reduceWithStatement(...arguments); - if (isLabelledFunction(node.body)) { - s = s.addError(new EarlyError(node.body, 'The body of a with statement must not be a labeled function declaration')); - } - s = s.addStrictError(new EarlyError(node, 'Strict mode code must not include a with statement')); - return s; - } - - reduceYieldExpression(node) { - let s = super.reduceYieldExpression(...arguments); - s = s.observeYieldExpression(node); - return s; - } - - reduceYieldGeneratorExpression(node) { - let s = super.reduceYieldGeneratorExpression(...arguments); - s = s.observeYieldExpression(node); - return s; - } - - - static check(node) { - return reduce(new EarlyErrorChecker, node).errors; - } -} diff --git a/docs/dist/shift-parser/errors.js b/docs/dist/shift-parser/errors.js deleted file mode 100644 index 11d84b01..00000000 --- a/docs/dist/shift-parser/errors.js +++ /dev/null @@ -1,119 +0,0 @@ -/** - * Copyright 2014 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export const ErrorMessages = { - UNEXPECTED_TOKEN(id) { - return `Unexpected token ${JSON.stringify(id)}`; - }, - UNEXPECTED_ILLEGAL_TOKEN(id) { - return `Unexpected ${JSON.stringify(id)}`; - }, - UNEXPECTED_ESCAPED_KEYWORD: 'Unexpected escaped keyword', - UNEXPECTED_NUMBER: 'Unexpected number', - UNEXPECTED_STRING: 'Unexpected string', - UNEXPECTED_IDENTIFIER: 'Unexpected identifier', - UNEXPECTED_RESERVED_WORD: 'Unexpected reserved word', - UNEXPECTED_TEMPLATE: 'Unexpected template', - UNEXPECTED_EOS: 'Unexpected end of input', - UNEXPECTED_LINE_TERMINATOR: 'Unexpected line terminator', - UNEXPECTED_COMMA_AFTER_REST: 'Unexpected comma after rest', - UNEXPECTED_REST_PARAMETERS_INITIALIZATION: 'Rest parameter may not have a default initializer', - NEWLINE_AFTER_THROW: 'Illegal newline after throw', - UNTERMINATED_REGEXP: 'Invalid regular expression: missing /', - INVALID_LAST_REST_PARAMETER: 'Rest parameter must be last formal parameter', - INVALID_REST_PARAMETERS_INITIALIZATION: 'Rest parameter may not have a default initializer', - INVALID_REGEXP_FLAGS: 'Invalid regular expression flags', - INVALID_REGEX: 'Invalid regular expression', - INVALID_LHS_IN_ASSIGNMENT: 'Invalid left-hand side in assignment', - INVALID_LHS_IN_BINDING: 'Invalid left-hand side in binding', // todo collapse messages? - INVALID_LHS_IN_FOR_IN: 'Invalid left-hand side in for-in', - INVALID_LHS_IN_FOR_OF: 'Invalid left-hand side in for-of', - INVALID_LHS_IN_FOR_AWAIT: 'Invalid left-hand side in for-await', - INVALID_UPDATE_OPERAND: 'Increment/decrement target must be an identifier or member expression', - INVALID_EXPONENTIATION_LHS: 'Unary expressions as the left operand of an exponentation expression ' + - 'must be disambiguated with parentheses', - MULTIPLE_DEFAULTS_IN_SWITCH: 'More than one default clause in switch statement', - NO_CATCH_OR_FINALLY: 'Missing catch or finally after try', - ILLEGAL_RETURN: 'Illegal return statement', - ILLEGAL_ARROW_FUNCTION_PARAMS: 'Illegal arrow function parameter list', - INVALID_ASYNC_PARAMS: 'Async function parameters must not contain await expressions', - INVALID_VAR_INIT_FOR_IN: 'Invalid variable declaration in for-in statement', - INVALID_VAR_INIT_FOR_OF: 'Invalid variable declaration in for-of statement', - INVALID_VAR_INIT_FOR_AWAIT: 'Invalid variable declaration in for-await statement', - UNINITIALIZED_BINDINGPATTERN_IN_FOR_INIT: 'Binding pattern appears without initializer in for statement init', - ILLEGAL_PROPERTY: 'Illegal property initializer', - INVALID_ID_BINDING_STRICT_MODE(id) { - return `The identifier ${JSON.stringify(id)} must not be in binding position in strict mode`; - }, - INVALID_ID_IN_LABEL_STRICT_MODE(id) { - return `The identifier ${JSON.stringify(id)} must not be in label position in strict mode`; - }, - INVALID_ID_IN_EXPRESSION_STRICT_MODE(id) { - return `The identifier ${JSON.stringify(id)} must not be in expression position in strict mode`; - }, - INVALID_CALL_TO_SUPER: 'Calls to super must be in the "constructor" method of a class expression ' + - 'or class declaration that has a superclass', - INVALID_DELETE_STRICT_MODE: 'Identifier expressions must not be deleted in strict mode', - DUPLICATE_BINDING(id) { - return `Duplicate binding ${JSON.stringify(id)}`; - }, - ILLEGAL_ID_IN_LEXICAL_DECLARATION(id) { - return `Lexical declarations must not have a binding named ${JSON.stringify(id)}`; - }, - UNITIALIZED_CONST: 'Constant lexical declarations must have an initialiser', - ILLEGAL_LABEL_IN_BODY(stmt) { - return `The body of a ${stmt} statement must not be a labeled function declaration`; - }, - ILLEGEAL_LABEL_IN_IF: 'The consequent of an if statement must not be a labeled function declaration', - ILLEGAL_LABEL_IN_ELSE: 'The alternate of an if statement must not be a labeled function declaration', - ILLEGAL_CONTINUE_WITHOUT_ITERATION_WITH_ID(id) { - return `Continue statement must be nested within an iteration statement with label ${JSON.stringify(id)}`; - }, - ILLEGAL_CONTINUE_WITHOUT_ITERATION: 'Continue statement must be nested within an iteration statement', - ILLEGAL_BREAK_WITHOUT_ITERATION_OR_SWITCH: - 'Break statement must be nested within an iteration statement or a switch statement', - ILLEGAL_WITH_STRICT_MODE: 'Strict mode code must not include a with statement', - ILLEGAL_ACCESS_SUPER_MEMBER: 'Member access on super must be in a method', - ILLEGAL_SUPER_CALL: 'Calls to super must be in the "constructor" method of a class expression or class declaration that has a superclass', - DUPLICATE_LABEL_DECLARATION(label) { - return `Label ${JSON.stringify(label)} has already been declared`; - }, - ILLEGAL_BREAK_WITHIN_LABEL(label) { - return `Break statement must be nested within a statement with label ${JSON.stringify(label)}`; - }, - ILLEGAL_YIELD_EXPRESSIONS(paramType) { - return `${paramType} parameters must not contain yield expressions`; - }, - ILLEGAL_YIELD_IDENTIFIER: '"yield" may not be used as an identifier in this context', - ILLEGAL_AWAIT_IDENTIFIER: '"await" may not be used as an identifier in this context', - DUPLICATE_CONSTRUCTOR: 'Duplicate constructor method in class', - ILLEGAL_CONSTRUCTORS: 'Constructors cannot be async, generators, getters or setters', - ILLEGAL_STATIC_CLASS_NAME: 'Static class methods cannot be named "prototype"', - NEW_TARGET_ERROR: 'new.target must be within function (but not arrow expression) code', - DUPLICATE_EXPORT(id) { - return `Duplicate export ${JSON.stringify(id)}`; - }, - UNDECLARED_BINDING(id) { - return `Exported binding ${JSON.stringify(id)} is not declared`; - }, - DUPLICATE_PROPTO_PROP: 'Duplicate __proto__ property in object literal not allowed', - ILLEGAL_LABEL_FUNC_DECLARATION: 'Labeled FunctionDeclarations are disallowed in strict mode', - ILLEGAL_FUNC_DECL_IF: 'FunctionDeclarations in IfStatements are disallowed in strict mode', - ILLEGAL_USE_STRICT: 'Functions with non-simple parameter lists may not contain a "use strict" directive', - ILLEGAL_EXPORTED_NAME: 'Names of variables used in an export specifier from the current module must be identifiers', - NO_OCTALS_IN_TEMPLATES: 'Template literals may not contain octal escape sequences', - NO_AWAIT_IN_ASYNC_PARAMS: 'Async arrow parameters may not contain "await"', -}; diff --git a/docs/dist/shift-parser/index.js b/docs/dist/shift-parser/index.js deleted file mode 100644 index 2cb39d44..00000000 --- a/docs/dist/shift-parser/index.js +++ /dev/null @@ -1,149 +0,0 @@ -/** - * Copyright 2016 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { GenericParser } from './parser.js'; -import { JsError } from './tokenizer.js'; -import { EarlyErrorChecker } from './early-errors.js'; -import { isLineTerminator } from './utils.js'; - -class ParserWithLocation extends GenericParser { - constructor(source) { - super(source); - this.locations = new WeakMap; - this.comments = []; - } - - startNode() { - return this.getLocation(); - } - - finishNode(node, start) { - if (node.type === 'Script' || node.type === 'Module') { - this.locations.set(node, { - start: { line: 1, column: 0, offset: 0 }, - end: this.getLocation(), - }); - return node; - } - if (node.type === 'TemplateExpression') { - // Adjust TemplateElements to not include surrounding backticks or braces - for (let i = 0; i < node.elements.length; i += 2) { - const endAdjustment = i < node.elements.length - 1 ? 2 : 1; // discard '${' or '`' respectively - const element = node.elements[i]; - const location = this.locations.get(element); - this.locations.set(element, { - start: { line: location.start.line, column: location.start.column + 1, offset: location.start.offset + 1 }, // discard '}' or '`' - end: { line: location.end.line, column: location.end.column - endAdjustment, offset: location.end.offset - endAdjustment }, - }); - } - } - this.locations.set(node, { - start, - end: this.getLastTokenEndLocation(), - }); - return node; - } - - copyNode(src, dest) { - this.locations.set(dest, this.locations.get(src)); // todo check undefined - return dest; - } - - skipSingleLineComment(offset) { - // We're actually extending the *tokenizer*, here. - const start = { - line: this.line + 1, - column: this.index - this.lineStart, - offset: this.index, - }; - const c = this.source[this.index]; - const type = c === '/' ? 'SingleLine' : c === '<' ? 'HTMLOpen' : 'HTMLClose'; - - super.skipSingleLineComment(offset); - - const end = { - line: this.line + 1, - column: this.index - this.lineStart, - offset: this.index, - }; - const trailingLineTerminatorCharacters = this.source[this.index - 2] === '\r' ? 2 : isLineTerminator(this.source.charCodeAt(this.index - 1)) ? 1 : 0; - const text = this.source.substring(start.offset + offset, end.offset - trailingLineTerminatorCharacters); - - this.comments.push({ text, type, start, end }); - } - - skipMultiLineComment() { - const start = { - line: this.line + 1, - column: this.index - this.lineStart, - offset: this.index, - }; - const type = 'MultiLine'; - - const retval = super.skipMultiLineComment(); - - const end = { - line: this.line + 1, - column: this.index - this.lineStart, - offset: this.index, - }; - const text = this.source.substring(start.offset + 2, end.offset - 2); - - this.comments.push({ text, type, start, end }); - - return retval; - } -} - -function generateInterface(parsingFunctionName) { - return function parse(code, { earlyErrors = true } = {}) { - let parser = new GenericParser(code); - let tree = parser[parsingFunctionName](); - if (earlyErrors) { - let errors = EarlyErrorChecker.check(tree); - // for now, just throw the first error; we will handle multiple errors later - if (errors.length > 0) { - throw new JsError(0, 1, 0, errors[0].message); - } - } - return tree; - }; -} - -function generateInterfaceWithLocation(parsingFunctionName) { - return function parse(code, { earlyErrors = true } = {}) { - let parser = new ParserWithLocation(code); - let tree = parser[parsingFunctionName](); - if (earlyErrors) { - let errors = EarlyErrorChecker.check(tree); - // for now, just throw the first error; we will handle multiple errors later - if (errors.length > 0) { - let { node, message } = errors[0]; - let { offset, line, column } = parser.locations.get(node).start; - throw new JsError(offset, line, column, message); - } - } - return { tree, locations: parser.locations, comments: parser.comments }; - }; -} - -export const parseModule = generateInterface('parseModule'); -export const parseScript = generateInterface('parseScript'); -export const parseModuleWithLocation = generateInterfaceWithLocation('parseModule'); -export const parseScriptWithLocation = generateInterfaceWithLocation('parseScript'); -export default parseScript; -export { EarlyErrorChecker, GenericParser, ParserWithLocation }; -export { default as Tokenizer, TokenClass, TokenType } from './tokenizer.js'; diff --git a/docs/dist/shift-parser/parser.js b/docs/dist/shift-parser/parser.js deleted file mode 100644 index 4af854d9..00000000 --- a/docs/dist/shift-parser/parser.js +++ /dev/null @@ -1,2641 +0,0 @@ -/** - * Copyright 2014 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { ErrorMessages } from './errors.js'; - -import acceptRegex from '../../_snowpack/pkg/shift-regexp-acceptor.js'; - -import Tokenizer, { TokenClass, TokenType } from './tokenizer.js'; - -import * as AST from '../../_snowpack/pkg/shift-ast.js'; - -// Empty parameter list for ArrowExpression -const ARROW_EXPRESSION_PARAMS = 'CoverParenthesizedExpressionAndArrowParameterList'; -const EXPORT_UNKNOWN_SPECIFIER = 'ExportNameOfUnknownType'; - -const Precedence = { - Sequence: 0, - Yield: 1, - Assignment: 1, - Conditional: 2, - ArrowFunction: 2, - LogicalOR: 3, - LogicalAND: 4, - BitwiseOR: 5, - BitwiseXOR: 6, - BitwiseAND: 7, - Equality: 8, - Relational: 9, - BitwiseSHIFT: 10, - Additive: 11, - Multiplicative: 12, - Unary: 13, - Postfix: 14, - Call: 15, - New: 16, - TaggedTemplate: 17, - Member: 18, - Primary: 19, -}; - -const BinaryPrecedence = { - '||': Precedence.LogicalOR, - '&&': Precedence.LogicalAND, - '|': Precedence.BitwiseOR, - '^': Precedence.BitwiseXOR, - '&': Precedence.BitwiseAND, - '==': Precedence.Equality, - '!=': Precedence.Equality, - '===': Precedence.Equality, - '!==': Precedence.Equality, - '<': Precedence.Relational, - '>': Precedence.Relational, - '<=': Precedence.Relational, - '>=': Precedence.Relational, - 'in': Precedence.Relational, - 'instanceof': Precedence.Relational, - '<<': Precedence.BitwiseSHIFT, - '>>': Precedence.BitwiseSHIFT, - '>>>': Precedence.BitwiseSHIFT, - '+': Precedence.Additive, - '-': Precedence.Additive, - '*': Precedence.Multiplicative, - '%': Precedence.Multiplicative, - '/': Precedence.Multiplicative, -}; - -function isValidSimpleAssignmentTarget(node) { - if (node == null) return false; - switch (node.type) { - case 'IdentifierExpression': - case 'ComputedMemberExpression': - case 'StaticMemberExpression': - return true; - } - return false; -} - -function isPrefixOperator(token) { - switch (token.type) { - case TokenType.INC: - case TokenType.DEC: - case TokenType.ADD: - case TokenType.SUB: - case TokenType.BIT_NOT: - case TokenType.NOT: - case TokenType.DELETE: - case TokenType.VOID: - case TokenType.TYPEOF: - return true; - } - return false; -} - -function isUpdateOperator(token) { - return token.type === TokenType.INC || token.type === TokenType.DEC; -} - -export class GenericParser extends Tokenizer { - constructor(source) { - super(source); - this.allowIn = true; - this.inFunctionBody = false; - this.inParameter = false; - this.allowYieldExpression = false; - this.allowAwaitExpression = false; - this.firstAwaitLocation = null; // for forbidding `await` in async arrow params. - this.module = false; - this.moduleIsTheGoalSymbol = false; - this.strict = false; - - // Cover grammar - this.isBindingElement = true; - this.isAssignmentTarget = true; - this.firstExprError = null; - } - - match(subType) { - return this.lookahead.type === subType; - } - - matchIdentifier() { - switch (this.lookahead.type) { - case TokenType.IDENTIFIER: - case TokenType.LET: - case TokenType.YIELD: - case TokenType.ASYNC: - return true; - case TokenType.AWAIT: - if (!this.moduleIsTheGoalSymbol) { - if (this.firstAwaitLocation === null) { - this.firstAwaitLocation = this.getLocation(); - } - return true; - } - return false; - case TokenType.ESCAPED_KEYWORD: - if (this.lookahead.value === 'await' && !this.moduleIsTheGoalSymbol) { - if (this.firstAwaitLocation === null) { - this.firstAwaitLocation = this.getLocation(); - } - return true; - } - return this.lookahead.value === 'let' - || this.lookahead.value === 'yield' - || this.lookahead.value === 'async'; - } - return false; - } - - eat(tokenType) { - if (this.lookahead.type === tokenType) { - return this.lex(); - } - return null; - } - - expect(tokenType) { - if (this.lookahead.type === tokenType) { - return this.lex(); - } - throw this.createUnexpected(this.lookahead); - } - - matchContextualKeyword(keyword) { - return this.lookahead.type === TokenType.IDENTIFIER && !this.lookahead.escaped && this.lookahead.value === keyword; - } - - expectContextualKeyword(keyword) { - if (this.lookahead.type === TokenType.IDENTIFIER && !this.lookahead.escaped && this.lookahead.value === keyword) { - return this.lex(); - } - throw this.createUnexpected(this.lookahead); - } - - eatContextualKeyword(keyword) { - if (this.lookahead.type === TokenType.IDENTIFIER && !this.lookahead.escaped && this.lookahead.value === keyword) { - return this.lex(); - } - return null; - } - - consumeSemicolon() { - if (this.eat(TokenType.SEMICOLON)) return; - if (this.hasLineTerminatorBeforeNext) return; - if (!this.eof() && !this.match(TokenType.RBRACE)) { - throw this.createUnexpected(this.lookahead); - } - } - - // this is a no-op, reserved for future use - startNode(node) { - return node; - } - - copyNode(src, dest) { - return dest; - } - - finishNode(node /* , startState */) { - return node; - } - - parseModule() { - this.moduleIsTheGoalSymbol = this.module = this.strict = true; - this.lookahead = this.advance(); - - let startState = this.startNode(); - let { directives, statements } = this.parseBody(); - if (!this.match(TokenType.EOS)) { - throw this.createUnexpected(this.lookahead); - } - return this.finishNode(new AST.Module({ directives, items: statements }), startState); - } - - parseScript() { - this.lookahead = this.advance(); - - let startState = this.startNode(); - let { directives, statements } = this.parseBody(); - if (!this.match(TokenType.EOS)) { - throw this.createUnexpected(this.lookahead); - } - return this.finishNode(new AST.Script({ directives, statements }), startState); - } - - parseFunctionBody() { - let oldInFunctionBody = this.inFunctionBody; - let oldModule = this.module; - let oldStrict = this.strict; - this.inFunctionBody = true; - this.module = false; - - let startState = this.startNode(); - this.expect(TokenType.LBRACE); - let body = new AST.FunctionBody(this.parseBody()); - this.expect(TokenType.RBRACE); - body = this.finishNode(body, startState); - - this.inFunctionBody = oldInFunctionBody; - this.module = oldModule; - this.strict = oldStrict; - - return body; - } - - parseBody() { - let directives = [], statements = [], parsingDirectives = true, directiveOctal = null; - - while (true) { - if (this.eof() || this.match(TokenType.RBRACE)) break; - let token = this.lookahead; - let text = token.slice.text; - let isStringLiteral = token.type === TokenType.STRING; - let isModule = this.module; - let directiveLocation = this.getLocation(); - let directiveStartState = this.startNode(); - let stmt = isModule ? this.parseModuleItem() : this.parseStatementListItem(); - if (parsingDirectives) { - if (isStringLiteral && stmt.type === 'ExpressionStatement' && stmt.expression.type === 'LiteralStringExpression') { - if (!directiveOctal && token.octal) { - directiveOctal = this.createErrorWithLocation(directiveLocation, 'Unexpected legacy octal escape sequence: \\' + token.octal); - } - let rawValue = text.slice(1, -1); - if (rawValue === 'use strict') { - this.strict = true; - } - directives.push(this.finishNode(new AST.Directive({ rawValue }), directiveStartState)); - } else { - parsingDirectives = false; - if (directiveOctal && this.strict) { - throw directiveOctal; - } - statements.push(stmt); - } - } else { - statements.push(stmt); - } - } - if (directiveOctal && this.strict) { - throw directiveOctal; - } - - return { directives, statements }; - } - - parseImportSpecifier() { - let startState = this.startNode(), name; - if (this.matchIdentifier()) { - name = this.parseIdentifier(); - if (!this.eatContextualKeyword('as')) { - return this.finishNode(new AST.ImportSpecifier({ - name: null, - binding: this.finishNode(new AST.BindingIdentifier({ name }), startState), - }), startState); - } - } else if (this.lookahead.type.klass.isIdentifierName) { - name = this.parseIdentifierName(); - this.expectContextualKeyword('as'); - } - - return this.finishNode(new AST.ImportSpecifier({ name, binding: this.parseBindingIdentifier() }), startState); - } - - parseNameSpaceBinding() { - this.expect(TokenType.MUL); - this.expectContextualKeyword('as'); - return this.parseBindingIdentifier(); - } - - parseNamedImports() { - let result = []; - this.expect(TokenType.LBRACE); - while (!this.eat(TokenType.RBRACE)) { - result.push(this.parseImportSpecifier()); - if (!this.eat(TokenType.COMMA)) { - this.expect(TokenType.RBRACE); - break; - } - } - return result; - } - - parseFromClause() { - this.expectContextualKeyword('from'); - let value = this.expect(TokenType.STRING).str; - return value; - } - - parseImportDeclaration() { - let startState = this.startNode(), defaultBinding = null, moduleSpecifier; - this.expect(TokenType.IMPORT); - if (this.match(TokenType.STRING)) { - moduleSpecifier = this.lex().str; - this.consumeSemicolon(); - return this.finishNode(new AST.Import({ defaultBinding: null, namedImports: [], moduleSpecifier }), startState); - } - if (this.matchIdentifier()) { - defaultBinding = this.parseBindingIdentifier(); - if (!this.eat(TokenType.COMMA)) { - let decl = new AST.Import({ defaultBinding, namedImports: [], moduleSpecifier: this.parseFromClause() }); - this.consumeSemicolon(); - return this.finishNode(decl, startState); - } - } - if (this.match(TokenType.MUL)) { - let decl = new AST.ImportNamespace({ - defaultBinding, - namespaceBinding: this.parseNameSpaceBinding(), - moduleSpecifier: this.parseFromClause(), - }); - this.consumeSemicolon(); - return this.finishNode(decl, startState); - } else if (this.match(TokenType.LBRACE)) { - let decl = new AST.Import({ - defaultBinding, - namedImports: this.parseNamedImports(), - moduleSpecifier: this.parseFromClause(), - }); - this.consumeSemicolon(); - return this.finishNode(decl, startState); - } - throw this.createUnexpected(this.lookahead); - } - - parseExportSpecifier() { - let startState = this.startNode(); - let name = this.finishNode({ type: EXPORT_UNKNOWN_SPECIFIER, isIdentifier: this.matchIdentifier(), value: this.parseIdentifierName() }, startState); - if (this.eatContextualKeyword('as')) { - let exportedName = this.parseIdentifierName(); - return this.finishNode({ name, exportedName }, startState); - } - return this.finishNode({ name, exportedName: null }, startState); - } - - parseExportClause() { - this.expect(TokenType.LBRACE); - let result = []; - while (!this.eat(TokenType.RBRACE)) { - result.push(this.parseExportSpecifier()); - if (!this.eat(TokenType.COMMA)) { - this.expect(TokenType.RBRACE); - break; - } - } - return result; - } - - parseExportDeclaration() { - let startState = this.startNode(), decl; - this.expect(TokenType.EXPORT); - switch (this.lookahead.type) { - case TokenType.MUL: - this.lex(); - // export * FromClause ; - decl = new AST.ExportAllFrom({ moduleSpecifier: this.parseFromClause() }); - this.consumeSemicolon(); - break; - case TokenType.LBRACE: { - // export ExportClause FromClause ; - // export ExportClause ; - let namedExports = this.parseExportClause(); - let moduleSpecifier = null; - if (this.matchContextualKeyword('from')) { - moduleSpecifier = this.parseFromClause(); - decl = new AST.ExportFrom({ namedExports: namedExports.map(e => this.copyNode(e, new AST.ExportFromSpecifier({ name: e.name.value, exportedName: e.exportedName }))), moduleSpecifier }); - } else { - namedExports.forEach(({ name }) => { - if (!name.isIdentifier) { - throw this.createError(ErrorMessages.ILLEGAL_EXPORTED_NAME); - } - }); - decl = new AST.ExportLocals({ namedExports: namedExports.map(e => this.copyNode(e, new AST.ExportLocalSpecifier({ name: this.copyNode(e.name, new AST.IdentifierExpression({ name: e.name.value })), exportedName: e.exportedName }))) }); - } - this.consumeSemicolon(); - break; - } - case TokenType.CLASS: - // export ClassDeclaration - decl = new AST.Export({ declaration: this.parseClass({ isExpr: false, inDefault: false }) }); - break; - case TokenType.FUNCTION: - // export HoistableDeclaration - decl = new AST.Export({ declaration: this.parseFunction({ isExpr: false, inDefault: false, allowGenerator: true, isAsync: false }) }); - break; - case TokenType.ASYNC: { - let preAsyncStartState = this.startNode(); - this.lex(); - decl = new AST.Export({ declaration: this.parseFunction({ isExpr: false, inDefault: false, allowGenerator: true, isAsync: true, startState: preAsyncStartState }) }); - break; - } - case TokenType.DEFAULT: - this.lex(); - switch (this.lookahead.type) { - case TokenType.FUNCTION: - // export default HoistableDeclaration[Default] - decl = new AST.ExportDefault({ - body: this.parseFunction({ isExpr: false, inDefault: true, allowGenerator: true, isAsync: false }), - }); - break; - case TokenType.CLASS: - // export default ClassDeclaration[Default] - decl = new AST.ExportDefault({ body: this.parseClass({ isExpr: false, inDefault: true }) }); - break; - case TokenType.ASYNC: { - let preAsyncStartState = this.startNode(); - let lexerState = this.saveLexerState(); - this.lex(); - if (!this.hasLineTerminatorBeforeNext && this.match(TokenType.FUNCTION)) { - decl = new AST.ExportDefault({ - body: this.parseFunction({ isExpr: false, inDefault: true, allowGenerator: false, isAsync: true, startState: preAsyncStartState }), - }); - break; - } - this.restoreLexerState(lexerState); - } - // else fall through - default: - // export default [lookahead ∉ {function, async [no LineTerminatorHere] function, class}] AssignmentExpression[In] ; - decl = new AST.ExportDefault({ body: this.parseAssignmentExpression() }); - this.consumeSemicolon(); - break; - } - break; - case TokenType.VAR: - case TokenType.LET: - case TokenType.CONST: - // export LexicalDeclaration - decl = new AST.Export({ declaration: this.parseVariableDeclaration(true) }); - this.consumeSemicolon(); - break; - default: - throw this.createUnexpected(this.lookahead); - } - return this.finishNode(decl, startState); - } - - parseModuleItem() { - switch (this.lookahead.type) { - case TokenType.IMPORT: - return this.parseImportDeclaration(); - case TokenType.EXPORT: - return this.parseExportDeclaration(); - default: - return this.parseStatementListItem(); - } - } - - lookaheadLexicalDeclaration() { - if (this.match(TokenType.LET) || this.match(TokenType.CONST)) { - let lexerState = this.saveLexerState(); - this.lex(); - if ( - this.matchIdentifier() || - this.match(TokenType.LBRACE) || - this.match(TokenType.LBRACK) - ) { - this.restoreLexerState(lexerState); - return true; - } - this.restoreLexerState(lexerState); - } - return false; - } - - parseStatementListItem() { - if (this.eof()) throw this.createUnexpected(this.lookahead); - - switch (this.lookahead.type) { - case TokenType.FUNCTION: - return this.parseFunction({ isExpr: false, inDefault: false, allowGenerator: true, isAsync: false }); - case TokenType.CLASS: - return this.parseClass({ isExpr: false, inDefault: false }); - case TokenType.ASYNC: { - let preAsyncStartState = this.getLocation(); - let lexerState = this.saveLexerState(); - this.lex(); - if (!this.hasLineTerminatorBeforeNext && this.match(TokenType.FUNCTION)) { - return this.parseFunction({ isExpr: false, inDefault: false, allowGenerator: true, isAsync: true, startState: preAsyncStartState }); - } - this.restoreLexerState(lexerState); - return this.parseStatement(); - } - default: - if (this.lookaheadLexicalDeclaration()) { - let startState = this.startNode(); - return this.finishNode(this.parseVariableDeclarationStatement(), startState); - } - return this.parseStatement(); - } - } - - parseStatement() { - let startState = this.startNode(); - let stmt = this.isolateCoverGrammar(this.parseStatementHelper); - return this.finishNode(stmt, startState); - } - - parseStatementHelper() { - if (this.eof()) { - throw this.createUnexpected(this.lookahead); - } - - switch (this.lookahead.type) { - case TokenType.SEMICOLON: - return this.parseEmptyStatement(); - case TokenType.LBRACE: - return this.parseBlockStatement(); - case TokenType.LPAREN: - return this.parseExpressionStatement(); - case TokenType.BREAK: - return this.parseBreakStatement(); - case TokenType.CONTINUE: - return this.parseContinueStatement(); - case TokenType.DEBUGGER: - return this.parseDebuggerStatement(); - case TokenType.DO: - return this.parseDoWhileStatement(); - case TokenType.FOR: - return this.parseForStatement(); - case TokenType.IF: - return this.parseIfStatement(); - case TokenType.RETURN: - return this.parseReturnStatement(); - case TokenType.SWITCH: - return this.parseSwitchStatement(); - case TokenType.THROW: - return this.parseThrowStatement(); - case TokenType.TRY: - return this.parseTryStatement(); - case TokenType.VAR: - return this.parseVariableDeclarationStatement(); - case TokenType.WHILE: - return this.parseWhileStatement(); - case TokenType.WITH: - return this.parseWithStatement(); - case TokenType.FUNCTION: - case TokenType.CLASS: - throw this.createUnexpected(this.lookahead); - - default: { - let lexerState = this.saveLexerState(); - if (this.eat(TokenType.LET)) { - if (this.match(TokenType.LBRACK)) { - this.restoreLexerState(lexerState); - throw this.createUnexpected(this.lookahead); - } - this.restoreLexerState(lexerState); - } else if (this.eat(TokenType.ASYNC)) { - if (!this.hasLineTerminatorBeforeNext && this.match(TokenType.FUNCTION)) { - throw this.createUnexpected(this.lookahead); - } - this.restoreLexerState(lexerState); - } - let expr = this.parseExpression(); - // 12.12 Labelled Statements; - if (expr.type === 'IdentifierExpression' && this.eat(TokenType.COLON)) { - let labeledBody = this.match(TokenType.FUNCTION) - ? this.parseFunction({ isExpr: false, inDefault: false, allowGenerator: false, isAsync: false }) - : this.parseStatement(); - return new AST.LabeledStatement({ label: expr.name, body: labeledBody }); - } - this.consumeSemicolon(); - return new AST.ExpressionStatement({ expression: expr }); - } - } - } - - parseEmptyStatement() { - this.lex(); - return new AST.EmptyStatement; - } - - parseBlockStatement() { - return new AST.BlockStatement({ block: this.parseBlock() }); - } - - parseExpressionStatement() { - let expr = this.parseExpression(); - this.consumeSemicolon(); - return new AST.ExpressionStatement({ expression: expr }); - } - - parseBreakStatement() { - this.lex(); - - // Catch the very common case first: immediately a semicolon (U+003B). - if (this.eat(TokenType.SEMICOLON) || this.hasLineTerminatorBeforeNext) { - return new AST.BreakStatement({ label: null }); - } - - let label = null; - if (this.matchIdentifier()) { - label = this.parseIdentifier(); - } - - this.consumeSemicolon(); - - return new AST.BreakStatement({ label }); - } - - parseContinueStatement() { - this.lex(); - - // Catch the very common case first: immediately a semicolon (U+003B). - if (this.eat(TokenType.SEMICOLON) || this.hasLineTerminatorBeforeNext) { - return new AST.ContinueStatement({ label: null }); - } - - let label = null; - if (this.matchIdentifier()) { - label = this.parseIdentifier(); - } - - this.consumeSemicolon(); - - return new AST.ContinueStatement({ label }); - } - - - parseDebuggerStatement() { - this.lex(); - this.consumeSemicolon(); - return new AST.DebuggerStatement; - } - - parseDoWhileStatement() { - this.lex(); - let body = this.parseStatement(); - this.expect(TokenType.WHILE); - this.expect(TokenType.LPAREN); - let test = this.parseExpression(); - this.expect(TokenType.RPAREN); - this.eat(TokenType.SEMICOLON); - return new AST.DoWhileStatement({ body, test }); - } - - parseForStatement() { - this.lex(); - let isAwait = this.allowAwaitExpression && this.eat(TokenType.AWAIT); - this.expect(TokenType.LPAREN); - let test = null; - let right = null; - if (isAwait && this.match(TokenType.SEMICOLON)) { - throw this.createUnexpected(this.lookahead); - } - if (this.eat(TokenType.SEMICOLON)) { - if (!this.match(TokenType.SEMICOLON)) { - test = this.parseExpression(); - } - this.expect(TokenType.SEMICOLON); - if (!this.match(TokenType.RPAREN)) { - right = this.parseExpression(); - } - return new AST.ForStatement({ init: null, test, update: right, body: this.getIteratorStatementEpilogue() }); - } - let startsWithLet = this.match(TokenType.LET); - let isForDecl = this.lookaheadLexicalDeclaration(); - let leftStartState = this.startNode(); - if (this.match(TokenType.VAR) || isForDecl) { - let previousAllowIn = this.allowIn; - this.allowIn = false; - let init = this.parseVariableDeclaration(false); - this.allowIn = previousAllowIn; - - if (init.declarators.length === 1 && (this.match(TokenType.IN) || this.matchContextualKeyword('of'))) { - let ctor; - let decl = init.declarators[0]; - - if (this.match(TokenType.IN)) { - if (isAwait) { - throw this.createUnexpected(this.lookahead); - } - if (decl.init !== null && (this.strict || init.kind !== 'var' || decl.binding.type !== 'BindingIdentifier')) { - throw this.createError(ErrorMessages.INVALID_VAR_INIT_FOR_IN); - } - ctor = AST.ForInStatement; - this.lex(); - right = this.parseExpression(); - } else { - if (decl.init !== null) { - throw this.createError(isAwait ? ErrorMessages.INVALID_VAR_INIT_FOR_AWAIT : ErrorMessages.INVALID_VAR_INIT_FOR_OF); - } - if (isAwait) { - ctor = AST.ForAwaitStatement; - } else { - ctor = AST.ForOfStatement; - } - this.lex(); - right = this.parseAssignmentExpression(); - } - - let body = this.getIteratorStatementEpilogue(); - - return new ctor({ left: init, right, body }); - } else if (isAwait) { - throw this.createUnexpected(this.lookahead); - } - this.expect(TokenType.SEMICOLON); - if (init.declarators.some(decl => decl.binding.type !== 'BindingIdentifier' && decl.init === null)) { - throw this.createError(ErrorMessages.UNINITIALIZED_BINDINGPATTERN_IN_FOR_INIT); - } - if (!this.match(TokenType.SEMICOLON)) { - test = this.parseExpression(); - } - this.expect(TokenType.SEMICOLON); - if (!this.match(TokenType.RPAREN)) { - right = this.parseExpression(); - } - return new AST.ForStatement({ init, test, update: right, body: this.getIteratorStatementEpilogue() }); - - } - let previousAllowIn = this.allowIn; - this.allowIn = false; - let expr = this.inheritCoverGrammar(this.parseAssignmentExpressionOrTarget); - this.allowIn = previousAllowIn; - - if (this.isAssignmentTarget && expr.type !== 'AssignmentExpression' && (this.match(TokenType.IN) || this.matchContextualKeyword('of'))) { - if (expr.type === 'ObjectAssignmentTarget' || expr.type === 'ArrayAssignmentTarget') { - this.firstExprError = null; - } - if (startsWithLet && this.matchContextualKeyword('of')) { - throw this.createError(isAwait ? ErrorMessages.INVALID_LHS_IN_FOR_AWAIT : ErrorMessages.INVALID_LHS_IN_FOR_OF); - } - let ctor; - if (this.match(TokenType.IN)) { - if (isAwait) { - throw this.createUnexpected(this.lookahead); - } - ctor = AST.ForInStatement; - this.lex(); - right = this.parseExpression(); - } else { - if (isAwait) { - ctor = AST.ForAwaitStatement; - } else { - ctor = AST.ForOfStatement; - } - this.lex(); - right = this.parseAssignmentExpression(); - } - - return new ctor({ left: this.transformDestructuring(expr), right, body: this.getIteratorStatementEpilogue() }); - } else if (isAwait) { - throw this.createError(ErrorMessages.INVALID_LHS_IN_FOR_AWAIT); - } - if (this.firstExprError) { - throw this.firstExprError; - } - while (this.eat(TokenType.COMMA)) { - let rhs = this.parseAssignmentExpression(); - expr = this.finishNode(new AST.BinaryExpression({ left: expr, operator: ',', right: rhs }), leftStartState); - } - if (this.match(TokenType.IN)) { - throw this.createError(ErrorMessages.INVALID_LHS_IN_FOR_IN); - } - if (this.matchContextualKeyword('of')) { - throw this.createError(ErrorMessages.INVALID_LHS_IN_FOR_OF); - } - this.expect(TokenType.SEMICOLON); - if (!this.match(TokenType.SEMICOLON)) { - test = this.parseExpression(); - } - this.expect(TokenType.SEMICOLON); - if (!this.match(TokenType.RPAREN)) { - right = this.parseExpression(); - } - return new AST.ForStatement({ init: expr, test, update: right, body: this.getIteratorStatementEpilogue() }); - } - - getIteratorStatementEpilogue() { - this.expect(TokenType.RPAREN); - let body = this.parseStatement(); - return body; - } - - parseIfStatementChild() { - return this.match(TokenType.FUNCTION) - ? this.parseFunction({ isExpr: false, inDefault: false, allowGenerator: false, isAsync: false }) - : this.parseStatement(); - } - - parseIfStatement() { - this.lex(); - this.expect(TokenType.LPAREN); - let test = this.parseExpression(); - this.expect(TokenType.RPAREN); - let consequent = this.parseIfStatementChild(); - let alternate = null; - if (this.eat(TokenType.ELSE)) { - alternate = this.parseIfStatementChild(); - } - return new AST.IfStatement({ test, consequent, alternate }); - } - - parseReturnStatement() { - if (!this.inFunctionBody) { - throw this.createError(ErrorMessages.ILLEGAL_RETURN); - } - - this.lex(); - - // Catch the very common case first: immediately a semicolon (U+003B). - if (this.eat(TokenType.SEMICOLON) || this.hasLineTerminatorBeforeNext) { - return new AST.ReturnStatement({ expression: null }); - } - - let expression = null; - if (!this.match(TokenType.RBRACE) && !this.eof()) { - expression = this.parseExpression(); - } - - this.consumeSemicolon(); - return new AST.ReturnStatement({ expression }); - } - - parseSwitchStatement() { - this.lex(); - this.expect(TokenType.LPAREN); - let discriminant = this.parseExpression(); - this.expect(TokenType.RPAREN); - this.expect(TokenType.LBRACE); - - if (this.eat(TokenType.RBRACE)) { - return new AST.SwitchStatement({ discriminant, cases: [] }); - } - - let cases = this.parseSwitchCases(); - if (this.match(TokenType.DEFAULT)) { - let defaultCase = this.parseSwitchDefault(); - let postDefaultCases = this.parseSwitchCases(); - if (this.match(TokenType.DEFAULT)) { - throw this.createError(ErrorMessages.MULTIPLE_DEFAULTS_IN_SWITCH); - } - this.expect(TokenType.RBRACE); - return new AST.SwitchStatementWithDefault({ - discriminant, - preDefaultCases: cases, - defaultCase, - postDefaultCases, - }); - } - this.expect(TokenType.RBRACE); - return new AST.SwitchStatement({ discriminant, cases }); - } - - parseSwitchCases() { - let result = []; - while (!(this.eof() || this.match(TokenType.RBRACE) || this.match(TokenType.DEFAULT))) { - result.push(this.parseSwitchCase()); - } - return result; - } - - parseSwitchCase() { - let startState = this.startNode(); - this.expect(TokenType.CASE); - return this.finishNode(new AST.SwitchCase({ - test: this.parseExpression(), - consequent: this.parseSwitchCaseBody(), - }), startState); - } - - parseSwitchDefault() { - let startState = this.startNode(); - this.expect(TokenType.DEFAULT); - return this.finishNode(new AST.SwitchDefault({ consequent: this.parseSwitchCaseBody() }), startState); - } - - parseSwitchCaseBody() { - this.expect(TokenType.COLON); - return this.parseStatementListInSwitchCaseBody(); - } - - parseStatementListInSwitchCaseBody() { - let result = []; - while (!(this.eof() || this.match(TokenType.RBRACE) || this.match(TokenType.DEFAULT) || this.match(TokenType.CASE))) { - result.push(this.parseStatementListItem()); - } - return result; - } - - parseThrowStatement() { - let token = this.lex(); - if (this.hasLineTerminatorBeforeNext) { - throw this.createErrorWithLocation(token, ErrorMessages.NEWLINE_AFTER_THROW); - } - let expression = this.parseExpression(); - this.consumeSemicolon(); - return new AST.ThrowStatement({ expression }); - } - - parseTryStatement() { - this.lex(); - let body = this.parseBlock(); - - if (this.match(TokenType.CATCH)) { - let catchClause = this.parseCatchClause(); - if (this.eat(TokenType.FINALLY)) { - let finalizer = this.parseBlock(); - return new AST.TryFinallyStatement({ body, catchClause, finalizer }); - } - return new AST.TryCatchStatement({ body, catchClause }); - } - - if (this.eat(TokenType.FINALLY)) { - let finalizer = this.parseBlock(); - return new AST.TryFinallyStatement({ body, catchClause: null, finalizer }); - } - throw this.createError(ErrorMessages.NO_CATCH_OR_FINALLY); - } - - parseVariableDeclarationStatement() { - let declaration = this.parseVariableDeclaration(true); - this.consumeSemicolon(); - return new AST.VariableDeclarationStatement({ declaration }); - } - - parseWhileStatement() { - this.lex(); - this.expect(TokenType.LPAREN); - let test = this.parseExpression(); - let body = this.getIteratorStatementEpilogue(); - return new AST.WhileStatement({ test, body }); - } - - parseWithStatement() { - this.lex(); - this.expect(TokenType.LPAREN); - let object = this.parseExpression(); - this.expect(TokenType.RPAREN); - let body = this.parseStatement(); - return new AST.WithStatement({ object, body }); - } - - parseCatchClause() { - let startState = this.startNode(); - - this.lex(); - this.expect(TokenType.LPAREN); - if (this.match(TokenType.RPAREN) || this.match(TokenType.LPAREN)) { - throw this.createUnexpected(this.lookahead); - } - let binding = this.parseBindingTarget(); - this.expect(TokenType.RPAREN); - let body = this.parseBlock(); - - return this.finishNode(new AST.CatchClause({ binding, body }), startState); - } - - parseBlock() { - let startState = this.startNode(); - this.expect(TokenType.LBRACE); - let body = []; - while (!this.match(TokenType.RBRACE)) { - body.push(this.parseStatementListItem()); - } - this.expect(TokenType.RBRACE); - return this.finishNode(new AST.Block({ statements: body }), startState); - } - - parseVariableDeclaration(bindingPatternsMustHaveInit) { - let startState = this.startNode(); - let token = this.lex(); - - // preceded by this.match(TokenSubType.VAR) || this.match(TokenSubType.LET); - let kind = token.type === TokenType.VAR ? 'var' : token.type === TokenType.CONST ? 'const' : 'let'; - let declarators = this.parseVariableDeclaratorList(bindingPatternsMustHaveInit); - return this.finishNode(new AST.VariableDeclaration({ kind, declarators }), startState); - } - - parseVariableDeclaratorList(bindingPatternsMustHaveInit) { - let result = []; - do { - result.push(this.parseVariableDeclarator(bindingPatternsMustHaveInit)); - } while (this.eat(TokenType.COMMA)); - return result; - } - - parseVariableDeclarator(bindingPatternsMustHaveInit) { - let startState = this.startNode(); - - if (this.match(TokenType.LPAREN)) { - throw this.createUnexpected(this.lookahead); - } - - let previousAllowIn = this.allowIn; - this.allowIn = true; - let binding = this.parseBindingTarget(); - this.allowIn = previousAllowIn; - - if (bindingPatternsMustHaveInit && binding.type !== 'BindingIdentifier' && !this.match(TokenType.ASSIGN)) { - this.expect(TokenType.ASSIGN); - } - - let init = null; - if (this.eat(TokenType.ASSIGN)) { - init = this.parseAssignmentExpression(); - } - - return this.finishNode(new AST.VariableDeclarator({ binding, init }), startState); - } - - isolateCoverGrammar(parser) { - let oldIsBindingElement = this.isBindingElement, - oldIsAssignmentTarget = this.isAssignmentTarget, - oldFirstExprError = this.firstExprError, - result; - this.isBindingElement = this.isAssignmentTarget = true; - this.firstExprError = null; - result = parser.call(this); - if (this.firstExprError !== null) { - throw this.firstExprError; - } - this.isBindingElement = oldIsBindingElement; - this.isAssignmentTarget = oldIsAssignmentTarget; - this.firstExprError = oldFirstExprError; - return result; - } - - inheritCoverGrammar(parser) { - let oldIsBindingElement = this.isBindingElement, - oldIsAssignmentTarget = this.isAssignmentTarget, - oldFirstExprError = this.firstExprError, - result; - this.isBindingElement = this.isAssignmentTarget = true; - this.firstExprError = null; - result = parser.call(this); - this.isBindingElement = this.isBindingElement && oldIsBindingElement; - this.isAssignmentTarget = this.isAssignmentTarget && oldIsAssignmentTarget; - this.firstExprError = oldFirstExprError || this.firstExprError; - return result; - } - - parseExpression() { - let startState = this.startNode(); - - let left = this.parseAssignmentExpression(); - if (this.match(TokenType.COMMA)) { - while (!this.eof()) { - if (!this.match(TokenType.COMMA)) break; - this.lex(); - let right = this.parseAssignmentExpression(); - left = this.finishNode(new AST.BinaryExpression({ left, operator: ',', right }), startState); - } - } - return left; - } - - finishArrowParams(head) { - let { params = null, rest = null } = head; - if (head.type !== ARROW_EXPRESSION_PARAMS) { - if (head.type === 'IdentifierExpression') { - params = [this.targetToBinding(this.transformDestructuring(head))]; - } else { - throw this.createUnexpected(this.lookahead); - } - } - return this.copyNode(head, new AST.FormalParameters({ items: params, rest })); - } - - parseArrowExpressionTail(params, isAsync, startState) { - this.expect(TokenType.ARROW); - let previousYield = this.allowYieldExpression; - let previousAwait = this.allowAwaitExpression; - let previousAwaitLocation = this.firstAwaitLocation; - this.allowYieldExpression = false; - this.allowAwaitExpression = isAsync; - this.firstAwaitLocation = null; - let body; - if (this.match(TokenType.LBRACE)) { - let previousAllowIn = this.allowIn; - this.allowIn = true; - body = this.parseFunctionBody(); - this.allowIn = previousAllowIn; - } else { - body = this.parseAssignmentExpression(); - } - this.allowYieldExpression = previousYield; - this.allowAwaitExpression = previousAwait; - this.firstAwaitLocation = previousAwaitLocation; - return this.finishNode(new AST.ArrowExpression({ isAsync, params, body }), startState); - } - - parseAssignmentExpression() { - return this.isolateCoverGrammar(this.parseAssignmentExpressionOrTarget); - } - - parseAssignmentExpressionOrTarget() { - let startState = this.startNode(); - if (this.allowYieldExpression && this.match(TokenType.YIELD)) { - this.isBindingElement = this.isAssignmentTarget = false; - return this.parseYieldExpression(); - } - let expr = this.parseConditionalExpression(); - if (!this.hasLineTerminatorBeforeNext && this.match(TokenType.ARROW)) { - this.isBindingElement = this.isAssignmentTarget = false; - this.firstExprError = null; - let isAsync = expr.type === ARROW_EXPRESSION_PARAMS && expr.isAsync; - return this.parseArrowExpressionTail(this.finishArrowParams(expr), isAsync, startState); - } - let isAssignmentOperator = false; - let operator = this.lookahead; - switch (operator.type) { - case TokenType.ASSIGN_BIT_OR: - case TokenType.ASSIGN_BIT_XOR: - case TokenType.ASSIGN_BIT_AND: - case TokenType.ASSIGN_SHL: - case TokenType.ASSIGN_SHR: - case TokenType.ASSIGN_SHR_UNSIGNED: - case TokenType.ASSIGN_ADD: - case TokenType.ASSIGN_SUB: - case TokenType.ASSIGN_MUL: - case TokenType.ASSIGN_DIV: - case TokenType.ASSIGN_MOD: - case TokenType.ASSIGN_EXP: - isAssignmentOperator = true; - break; - } - if (isAssignmentOperator) { - if (!this.isAssignmentTarget || !isValidSimpleAssignmentTarget(expr)) { - throw this.createError(ErrorMessages.INVALID_LHS_IN_ASSIGNMENT); - } - expr = this.transformDestructuring(expr); - } else if (operator.type === TokenType.ASSIGN) { - if (!this.isAssignmentTarget) { - throw this.createError(ErrorMessages.INVALID_LHS_IN_ASSIGNMENT); - } - expr = this.transformDestructuring(expr); - } else { - return expr; - } - this.lex(); - let rhs = this.parseAssignmentExpression(); - - this.firstExprError = null; - let node; - if (operator.type === TokenType.ASSIGN) { - node = new AST.AssignmentExpression({ binding: expr, expression: rhs }); - } else { - node = new AST.CompoundAssignmentExpression({ binding: expr, operator: operator.type.name, expression: rhs }); - this.isBindingElement = this.isAssignmentTarget = false; - } - return this.finishNode(node, startState); - } - - targetToBinding(node) { - if (node === null) { - return null; - } - - switch (node.type) { - case 'AssignmentTargetIdentifier': - return this.copyNode(node, new AST.BindingIdentifier({ name: node.name })); - case 'ArrayAssignmentTarget': - return this.copyNode(node, new AST.ArrayBinding({ elements: node.elements.map(e => this.targetToBinding(e)), rest: this.targetToBinding(node.rest) })); - case 'ObjectAssignmentTarget': - return this.copyNode(node, new AST.ObjectBinding({ properties: node.properties.map(p => this.targetToBinding(p)), rest: this.targetToBinding(node.rest) })); - case 'AssignmentTargetPropertyIdentifier': - return this.copyNode(node, new AST.BindingPropertyIdentifier({ binding: this.targetToBinding(node.binding), init: node.init })); - case 'AssignmentTargetPropertyProperty': - return this.copyNode(node, new AST.BindingPropertyProperty({ name: node.name, binding: this.targetToBinding(node.binding) })); - case 'AssignmentTargetWithDefault': - return this.copyNode(node, new AST.BindingWithDefault({ binding: this.targetToBinding(node.binding), init: node.init })); - } - - // istanbul ignore next - throw new Error('Not reached'); - } - - transformDestructuring(node) { - switch (node.type) { - - case 'DataProperty': - return this.copyNode(node, new AST.AssignmentTargetPropertyProperty({ - name: node.name, - binding: this.transformDestructuringWithDefault(node.expression), - })); - case 'ShorthandProperty': - return this.copyNode(node, new AST.AssignmentTargetPropertyIdentifier({ - binding: this.copyNode(node, new AST.AssignmentTargetIdentifier({ name: node.name.name })), - init: null, - })); - - case 'ObjectExpression': { - let last = node.properties.length > 0 ? node.properties[node.properties.length - 1] : void 0; - if (last != null && last.type === 'SpreadProperty') { - return this.copyNode(node, new AST.ObjectAssignmentTarget({ - properties: node.properties.slice(0, -1).map(e => e && this.transformDestructuringWithDefault(e)), - rest: this.transformDestructuring(last.expression), - })); - } - - return this.copyNode(node, new AST.ObjectAssignmentTarget({ - properties: node.properties.map(e => e && this.transformDestructuringWithDefault(e)), - rest: null, - })); - } - case 'ArrayExpression': { - let last = node.elements[node.elements.length - 1]; - if (last != null && last.type === 'SpreadElement') { - return this.copyNode(node, new AST.ArrayAssignmentTarget({ - elements: node.elements.slice(0, -1).map(e => e && this.transformDestructuringWithDefault(e)), - rest: this.copyNode(last.expression, this.transformDestructuring(last.expression)), - })); - } - return this.copyNode(node, new AST.ArrayAssignmentTarget({ - elements: node.elements.map(e => e && this.transformDestructuringWithDefault(e)), - rest: null, - })); - } - case 'IdentifierExpression': - return this.copyNode(node, new AST.AssignmentTargetIdentifier({ name: node.name })); - - case 'StaticPropertyName': - return this.copyNode(node, new AST.AssignmentTargetIdentifier({ name: node.value })); - - case 'ComputedMemberExpression': - return this.copyNode(node, new AST.ComputedMemberAssignmentTarget({ object: node.object, expression: node.expression })); - case 'StaticMemberExpression': - return this.copyNode(node, new AST.StaticMemberAssignmentTarget({ object: node.object, property: node.property })); - - case 'ArrayAssignmentTarget': - case 'ObjectAssignmentTarget': - case 'ComputedMemberAssignmentTarget': - case 'StaticMemberAssignmentTarget': - case 'AssignmentTargetIdentifier': - case 'AssignmentTargetPropertyIdentifier': - case 'AssignmentTargetPropertyProperty': - case 'AssignmentTargetWithDefault': - return node; - } - // istanbul ignore next - throw new Error('Not reached'); - } - - transformDestructuringWithDefault(node) { - switch (node.type) { - case 'AssignmentExpression': - return this.copyNode(node, new AST.AssignmentTargetWithDefault({ - binding: this.transformDestructuring(node.binding), - init: node.expression, - })); - } - return this.transformDestructuring(node); - } - - lookaheadAssignmentExpression() { - if (this.matchIdentifier()) { - return true; - } - switch (this.lookahead.type) { - case TokenType.ADD: - case TokenType.ASSIGN_DIV: - case TokenType.BIT_NOT: - case TokenType.CLASS: - case TokenType.DEC: - case TokenType.DELETE: - case TokenType.DIV: - case TokenType.FALSE: - case TokenType.FUNCTION: - case TokenType.INC: - case TokenType.LBRACE: - case TokenType.LBRACK: - case TokenType.LPAREN: - case TokenType.NEW: - case TokenType.NOT: - case TokenType.NULL: - case TokenType.NUMBER: - case TokenType.STRING: - case TokenType.SUB: - case TokenType.SUPER: - case TokenType.THIS: - case TokenType.TRUE: - case TokenType.TYPEOF: - case TokenType.VOID: - case TokenType.TEMPLATE: - return true; - } - return false; - } - - parseYieldExpression() { - let startState = this.startNode(); - - this.lex(); - if (this.hasLineTerminatorBeforeNext) { - return this.finishNode(new AST.YieldExpression({ expression: null }), startState); - } - let isGenerator = !!this.eat(TokenType.MUL); - let expr = null; - if (isGenerator || this.lookaheadAssignmentExpression()) { - expr = this.parseAssignmentExpression(); - } - let ctor = isGenerator ? AST.YieldGeneratorExpression : AST.YieldExpression; - return this.finishNode(new ctor({ expression: expr }), startState); - } - - parseConditionalExpression() { - let startState = this.startNode(); - let test = this.parseBinaryExpression(); - if (this.firstExprError) return test; - if (this.eat(TokenType.CONDITIONAL)) { - this.isBindingElement = this.isAssignmentTarget = false; - let previousAllowIn = this.allowIn; - this.allowIn = true; - let consequent = this.isolateCoverGrammar(this.parseAssignmentExpression); - this.allowIn = previousAllowIn; - this.expect(TokenType.COLON); - let alternate = this.isolateCoverGrammar(this.parseAssignmentExpression); - return this.finishNode(new AST.ConditionalExpression({ test, consequent, alternate }), startState); - } - return test; - } - - isBinaryOperator(type) { - switch (type) { - case TokenType.OR: - case TokenType.AND: - case TokenType.BIT_OR: - case TokenType.BIT_XOR: - case TokenType.BIT_AND: - case TokenType.EQ: - case TokenType.NE: - case TokenType.EQ_STRICT: - case TokenType.NE_STRICT: - case TokenType.LT: - case TokenType.GT: - case TokenType.LTE: - case TokenType.GTE: - case TokenType.INSTANCEOF: - case TokenType.SHL: - case TokenType.SHR: - case TokenType.SHR_UNSIGNED: - case TokenType.ADD: - case TokenType.SUB: - case TokenType.MUL: - case TokenType.DIV: - case TokenType.MOD: - return true; - case TokenType.IN: - return this.allowIn; - default: - return false; - } - } - - parseBinaryExpression() { - let startState = this.startNode(); - let left = this.parseExponentiationExpression(); - if (this.firstExprError) { - return left; - } - - let operator = this.lookahead.type; - if (!this.isBinaryOperator(operator)) return left; - - this.isBindingElement = this.isAssignmentTarget = false; - - this.lex(); - let stack = []; - stack.push({ startState, left, operator, precedence: BinaryPrecedence[operator.name] }); - startState = this.startNode(); - let right = this.isolateCoverGrammar(this.parseExponentiationExpression); - operator = this.lookahead.type; - while (this.isBinaryOperator(operator)) { - let precedence = BinaryPrecedence[operator.name]; - // Reduce: make a binary expression from the three topmost entries. - while (stack.length && precedence <= stack[stack.length - 1].precedence) { - let stackItem = stack[stack.length - 1]; - let stackOperator = stackItem.operator; - left = stackItem.left; - stack.pop(); - startState = stackItem.startState; - right = this.finishNode(new AST.BinaryExpression({ left, operator: stackOperator.name, right }), startState); - } - - this.lex(); - stack.push({ startState, left: right, operator, precedence }); - - startState = this.startNode(); - right = this.isolateCoverGrammar(this.parseExponentiationExpression); - operator = this.lookahead.type; - } - - // Final reduce to clean-up the stack. - return stack.reduceRight((expr, stackItem) => - this.finishNode(new AST.BinaryExpression({ - left: stackItem.left, - operator: stackItem.operator.name, - right: expr, - }), stackItem.startState), - right); - } - - parseExponentiationExpression() { - let startState = this.startNode(); - - let leftIsParenthesized = this.lookahead.type === TokenType.LPAREN; - let left = this.parseUnaryExpression(); - if (this.lookahead.type !== TokenType.EXP) { - return left; - } - if (left.type === 'UnaryExpression' && !leftIsParenthesized) { - throw this.createError(ErrorMessages.INVALID_EXPONENTIATION_LHS); - } - this.lex(); - - this.isBindingElement = this.isAssignmentTarget = false; - - let right = this.isolateCoverGrammar(this.parseExponentiationExpression); - return this.finishNode(new AST.BinaryExpression({ left, operator: '**', right }), startState); - } - - parseUnaryExpression() { - if (this.lookahead.type.klass !== TokenClass.Punctuator && this.lookahead.type.klass !== TokenClass.Keyword) { - return this.parseUpdateExpression(); - } - - let startState = this.startNode(); - if (this.allowAwaitExpression && this.eat(TokenType.AWAIT)) { - this.isBindingElement = this.isAssignmentTarget = false; - let expression = this.isolateCoverGrammar(this.parseUnaryExpression); - return this.finishNode(new AST.AwaitExpression({ expression }), startState); - } - - let operator = this.lookahead; - if (!isPrefixOperator(operator)) { - return this.parseUpdateExpression(); - } - - this.lex(); - this.isBindingElement = this.isAssignmentTarget = false; - - let node; - if (isUpdateOperator(operator)) { - let operandStartLocation = this.getLocation(); - let operand = this.isolateCoverGrammar(this.parseUnaryExpression); - if (!isValidSimpleAssignmentTarget(operand)) { - throw this.createErrorWithLocation(operandStartLocation, ErrorMessages.INVALID_UPDATE_OPERAND); - } - operand = this.transformDestructuring(operand); - node = new AST.UpdateExpression({ isPrefix: true, operator: operator.value, operand }); - } else { - let operand = this.isolateCoverGrammar(this.parseUnaryExpression); - node = new AST.UnaryExpression({ operator: operator.value, operand }); - } - - return this.finishNode(node, startState); - } - - parseUpdateExpression() { - let startLocation = this.getLocation(); - let startState = this.startNode(); - - let operand = this.parseLeftHandSideExpression({ allowCall: true }); - if (this.firstExprError || this.hasLineTerminatorBeforeNext) return operand; - - let operator = this.lookahead; - if (!isUpdateOperator(operator)) return operand; - this.lex(); - this.isBindingElement = this.isAssignmentTarget = false; - if (!isValidSimpleAssignmentTarget(operand)) { - throw this.createErrorWithLocation(startLocation, ErrorMessages.INVALID_UPDATE_OPERAND); - } - operand = this.transformDestructuring(operand); - - return this.finishNode(new AST.UpdateExpression({ isPrefix: false, operator: operator.value, operand }), startState); - } - - parseLeftHandSideExpression({ allowCall }) { - let startState = this.startNode(); - let previousAllowIn = this.allowIn; - this.allowIn = true; - - let expr, token = this.lookahead; - - if (this.eat(TokenType.SUPER)) { - this.isBindingElement = false; - this.isAssignmentTarget = false; - expr = this.finishNode(new AST.Super, startState); - if (this.match(TokenType.LPAREN)) { - if (allowCall) { - expr = this.finishNode(new AST.CallExpression({ - callee: expr, - arguments: this.parseArgumentList().args, - }), startState); - } else { - throw this.createUnexpected(token); - } - } else if (this.match(TokenType.LBRACK)) { - expr = this.finishNode(new AST.ComputedMemberExpression({ - object: expr, - expression: this.parseComputedMember(), - }), startState); - this.isAssignmentTarget = true; - } else if (this.match(TokenType.PERIOD)) { - expr = this.finishNode(new AST.StaticMemberExpression({ - object: expr, - property: this.parseStaticMember(), - }), startState); - this.isAssignmentTarget = true; - } else { - throw this.createUnexpected(token); - } - } else if (this.match(TokenType.NEW)) { - this.isBindingElement = this.isAssignmentTarget = false; - expr = this.parseNewExpression(); - } else if (this.match(TokenType.ASYNC)) { - expr = this.parsePrimaryExpression(); - // there's only three things this could be: an identifier, an async arrow, or an async function expression. - if (expr.type === 'IdentifierExpression' && allowCall && !this.hasLineTerminatorBeforeNext) { - if (this.matchIdentifier()) { - // `async [no lineterminator here] identifier` must be an async arrow - let afterAsyncStartState = this.startNode(); - let previousAwait = this.allowAwaitExpression; - this.allowAwaitExpression = true; - let param = this.parseBindingIdentifier(); - this.allowAwaitExpression = previousAwait; - this.ensureArrow(); - return this.finishNode({ - type: ARROW_EXPRESSION_PARAMS, - params: [param], - rest: null, - isAsync: true, - }, afterAsyncStartState); - } - if (this.match(TokenType.LPAREN)) { - // the maximally obnoxious case: `async (` - let afterAsyncStartState = this.startNode(); - let previousAwaitLocation = this.firstAwaitLocation; - this.firstAwaitLocation = null; - let { args, locationFollowingFirstSpread } = this.parseArgumentList(); - if (this.isBindingElement && !this.hasLineTerminatorBeforeNext && this.match(TokenType.ARROW)) { - if (locationFollowingFirstSpread !== null) { - throw this.createErrorWithLocation(locationFollowingFirstSpread, ErrorMessages.UNEXPECTED_TOKEN(',')); - } - if (this.firstAwaitLocation !== null) { - throw this.createErrorWithLocation(this.firstAwaitLocation, ErrorMessages.NO_AWAIT_IN_ASYNC_PARAMS); - } - let rest = null; - if (args.length > 0 && args[args.length - 1].type === 'SpreadElement') { - rest = this.targetToBinding(this.transformDestructuringWithDefault(args[args.length - 1].expression)); - if (rest.init != null) { - throw this.createError(ErrorMessages.UNEXPECTED_REST_PARAMETERS_INITIALIZATION); - } - args = args.slice(0, -1); - } - let params = args.map(arg => this.targetToBinding(this.transformDestructuringWithDefault(arg))); - return this.finishNode({ - type: ARROW_EXPRESSION_PARAMS, - params, - rest, - isAsync: true, - }, afterAsyncStartState); - } - this.firstAwaitLocation = previousAwaitLocation || this.firstAwaitLocation; - // otherwise we've just taken the first iteration of the loop below - this.isBindingElement = this.isAssignmentTarget = false; - expr = this.finishNode(new AST.CallExpression({ - callee: expr, - arguments: args, - }), startState); - } - } - } else { - expr = this.parsePrimaryExpression(); - if (this.firstExprError) { - return expr; - } - } - - while (true) { - if (allowCall && this.match(TokenType.LPAREN)) { - this.isBindingElement = this.isAssignmentTarget = false; - expr = this.finishNode(new AST.CallExpression({ - callee: expr, - arguments: this.parseArgumentList().args, - }), startState); - } else if (this.match(TokenType.LBRACK)) { - this.isBindingElement = false; - this.isAssignmentTarget = true; - expr = this.finishNode(new AST.ComputedMemberExpression({ - object: expr, - expression: this.parseComputedMember(), - }), startState); - } else if (this.match(TokenType.PERIOD)) { - this.isBindingElement = false; - this.isAssignmentTarget = true; - expr = this.finishNode(new AST.StaticMemberExpression({ - object: expr, - property: this.parseStaticMember(), - }), startState); - } else if (this.match(TokenType.TEMPLATE)) { - this.isBindingElement = this.isAssignmentTarget = false; - expr = this.finishNode(new AST.TemplateExpression({ - tag: expr, - elements: this.parseTemplateElements(), - }), startState); - } else { - break; - } - } - - this.allowIn = previousAllowIn; - - return expr; - } - - parseTemplateElements() { - let startState = this.startNode(); - let token = this.lookahead; - if (token.tail) { - this.lex(); - return [this.finishNode(new AST.TemplateElement({ rawValue: token.slice.text.slice(1, -1) }), startState)]; - } - let result = [ - this.finishNode(new AST.TemplateElement({ rawValue: this.lex().slice.text.slice(1, -2) }), startState), - ]; - while (true) { - result.push(this.parseExpression()); - if (!this.match(TokenType.RBRACE)) { - throw this.createILLEGAL(); - } - this.index = this.startIndex; - this.line = this.startLine; - this.lineStart = this.startLineStart; - this.lookahead = this.scanTemplateElement(); - startState = this.startNode(); - token = this.lex(); - if (token.tail) { - result.push(this.finishNode(new AST.TemplateElement({ rawValue: token.slice.text.slice(1, -1) }), startState)); - return result; - } - result.push(this.finishNode(new AST.TemplateElement({ rawValue: token.slice.text.slice(1, -2) }), startState)); - } - } - - parseStaticMember() { - this.lex(); - if (this.lookahead.type.klass.isIdentifierName) { - return this.lex().value; - } - throw this.createUnexpected(this.lookahead); - } - - parseComputedMember() { - this.lex(); - let expr = this.parseExpression(); - this.expect(TokenType.RBRACK); - return expr; - } - - parseNewExpression() { - let startState = this.startNode(); - this.lex(); - if (this.eat(TokenType.PERIOD)) { - this.expectContextualKeyword('target'); - return this.finishNode(new AST.NewTargetExpression, startState); - } - let callee = this.isolateCoverGrammar(() => this.parseLeftHandSideExpression({ allowCall: false })); - return this.finishNode(new AST.NewExpression({ - callee, - arguments: this.match(TokenType.LPAREN) ? this.parseArgumentList().args : [], - }), startState); - } - - parseRegexFlags(flags) { - let global = false, - ignoreCase = false, - multiLine = false, - unicode = false, - sticky = false, - dotAll = false; - for (let i = 0; i < flags.length; ++i) { - let f = flags[i]; - switch (f) { - case 'g': - if (global) { - throw this.createError('Duplicate regular expression flag \'g\''); - } - global = true; - break; - case 'i': - if (ignoreCase) { - throw this.createError('Duplicate regular expression flag \'i\''); - } - ignoreCase = true; - break; - case 'm': - if (multiLine) { - throw this.createError('Duplicate regular expression flag \'m\''); - } - multiLine = true; - break; - case 'u': - if (unicode) { - throw this.createError('Duplicate regular expression flag \'u\''); - } - unicode = true; - break; - case 'y': - if (sticky) { - throw this.createError('Duplicate regular expression flag \'y\''); - } - sticky = true; - break; - case 's': - if (dotAll) { - throw this.createError('Duplicate regular expression flag \'s\''); - } - dotAll = true; - break; - default: - throw this.createError(`Invalid regular expression flag '${f}'`); - } - } - return { global, ignoreCase, multiLine, unicode, sticky, dotAll }; - } - - parsePrimaryExpression() { - if (this.match(TokenType.LPAREN)) { - return this.parseGroupExpression(); - } - - let startState = this.startNode(); - - if (this.eat(TokenType.ASYNC)) { - if (!this.hasLineTerminatorBeforeNext && this.match(TokenType.FUNCTION)) { - this.isBindingElement = this.isAssignmentTarget = false; - return this.finishNode(this.parseFunction({ isExpr: true, inDefault: false, allowGenerator: true, isAsync: true }), startState); - } - return this.finishNode(new AST.IdentifierExpression({ name: 'async' }), startState); - } - - if (this.matchIdentifier()) { - return this.finishNode(new AST.IdentifierExpression({ name: this.parseIdentifier() }), startState); - } - switch (this.lookahead.type) { - case TokenType.STRING: - this.isBindingElement = this.isAssignmentTarget = false; - return this.parseStringLiteral(); - case TokenType.NUMBER: - this.isBindingElement = this.isAssignmentTarget = false; - return this.parseNumericLiteral(); - case TokenType.THIS: - this.lex(); - this.isBindingElement = this.isAssignmentTarget = false; - return this.finishNode(new AST.ThisExpression, startState); - case TokenType.FUNCTION: - this.isBindingElement = this.isAssignmentTarget = false; - return this.finishNode(this.parseFunction({ isExpr: true, inDefault: false, allowGenerator: true, isAsync: false }), startState); - case TokenType.TRUE: - this.lex(); - this.isBindingElement = this.isAssignmentTarget = false; - return this.finishNode(new AST.LiteralBooleanExpression({ value: true }), startState); - case TokenType.FALSE: - this.lex(); - this.isBindingElement = this.isAssignmentTarget = false; - return this.finishNode(new AST.LiteralBooleanExpression({ value: false }), startState); - case TokenType.NULL: - this.lex(); - this.isBindingElement = this.isAssignmentTarget = false; - return this.finishNode(new AST.LiteralNullExpression, startState); - case TokenType.LBRACK: - return this.parseArrayExpression(); - case TokenType.LBRACE: - return this.parseObjectExpression(); - case TokenType.TEMPLATE: - this.isBindingElement = this.isAssignmentTarget = false; - return this.finishNode(new AST.TemplateExpression({ tag: null, elements: this.parseTemplateElements() }), startState); - case TokenType.DIV: - case TokenType.ASSIGN_DIV: { - this.isBindingElement = this.isAssignmentTarget = false; - this.lookahead = this.scanRegExp(this.match(TokenType.DIV) ? '/' : '/='); - let token = this.lex(); - let lastSlash = token.value.lastIndexOf('/'); - let pattern = token.value.slice(1, lastSlash); - let flags = token.value.slice(lastSlash + 1); - let ctorArgs = this.parseRegexFlags(flags); - if (!acceptRegex(pattern, ctorArgs)) { - throw this.createError(ErrorMessages.INVALID_REGEX); - } - ctorArgs.pattern = pattern; - return this.finishNode(new AST.LiteralRegExpExpression(ctorArgs), startState); - } - case TokenType.CLASS: - this.isBindingElement = this.isAssignmentTarget = false; - return this.parseClass({ isExpr: true, inDefault: false }); - default: - throw this.createUnexpected(this.lookahead); - } - } - - parseNumericLiteral() { - let startLocation = this.getLocation(); - let startState = this.startNode(); - let token = this.lex(); - if (token.octal && this.strict) { - if (token.noctal) { - throw this.createErrorWithLocation(startLocation, 'Unexpected noctal integer literal'); - } else { - throw this.createErrorWithLocation(startLocation, 'Unexpected legacy octal integer literal'); - } - } - let node = token.value === 1 / 0 - ? new AST.LiteralInfinityExpression - : new AST.LiteralNumericExpression({ value: token.value }); - return this.finishNode(node, startState); - } - - parseStringLiteral() { - let startLocation = this.getLocation(); - let startState = this.startNode(); - let token = this.lex(); - if (token.octal != null && this.strict) { - throw this.createErrorWithLocation(startLocation, 'Unexpected legacy octal escape sequence: \\' + token.octal); - } - return this.finishNode(new AST.LiteralStringExpression({ value: token.str }), startState); - } - - parseIdentifierName() { - if (this.lookahead.type.klass.isIdentifierName) { - return this.lex().value; - } - throw this.createUnexpected(this.lookahead); - } - - parseBindingIdentifier() { - let startState = this.startNode(); - return this.finishNode(new AST.BindingIdentifier({ name: this.parseIdentifier() }), startState); - } - - parseIdentifier() { - if (this.lookahead.value === 'yield' && this.allowYieldExpression) { - throw this.createError(ErrorMessages.ILLEGAL_YIELD_IDENTIFIER); - } - if (this.lookahead.value === 'await' && this.allowAwaitExpression) { - throw this.createError(ErrorMessages.ILLEGAL_AWAIT_IDENTIFIER); - } - if (this.matchIdentifier()) { - return this.lex().value; - } - throw this.createUnexpected(this.lookahead); - } - - parseArgumentList() { - this.lex(); - let args = this.parseArguments(); - this.expect(TokenType.RPAREN); - return args; - } - - parseArguments() { - let args = []; - let locationFollowingFirstSpread = null; - while (!this.match(TokenType.RPAREN)) { - let arg; - let startState = this.startNode(); - if (this.eat(TokenType.ELLIPSIS)) { - arg = this.finishNode(new AST.SpreadElement({ expression: this.inheritCoverGrammar(this.parseAssignmentExpressionOrTarget) }), startState); - if (locationFollowingFirstSpread === null) { - args.push(arg); - if (this.match(TokenType.RPAREN)) { - break; - } - locationFollowingFirstSpread = this.getLocation(); - this.expect(TokenType.COMMA); - continue; - } - } else { - arg = this.inheritCoverGrammar(this.parseAssignmentExpressionOrTarget); - } - args.push(arg); - if (this.match(TokenType.RPAREN)) { - break; - } - this.expect(TokenType.COMMA); - } - return { args, locationFollowingFirstSpread }; - } - - // 11.2 Left-Hand-Side Expressions; - - ensureArrow() { - if (this.hasLineTerminatorBeforeNext) { - throw this.createError(ErrorMessages.UNEXPECTED_LINE_TERMINATOR); - } - if (!this.match(TokenType.ARROW)) { - this.expect(TokenType.ARROW); - } - } - - parseGroupExpression() { - // At this point, we need to parse 3 things: - // 1. Group expression - // 2. Assignment target of assignment expression - // 3. Parameter list of arrow function - let rest = null; - let preParenStartState = this.startNode(); - let start = this.expect(TokenType.LPAREN); - let postParenStartState = this.startNode(); - if (this.match(TokenType.RPAREN)) { - this.lex(); - let paramsNode = this.finishNode({ - type: ARROW_EXPRESSION_PARAMS, - params: [], - rest: null, - isAsync: false, - }, preParenStartState); - this.ensureArrow(); - this.isBindingElement = this.isAssignmentTarget = false; - return paramsNode; - } else if (this.eat(TokenType.ELLIPSIS)) { - rest = this.parseBindingTarget(); - if (this.match(TokenType.ASSIGN)) { - throw this.createError(ErrorMessages.INVALID_REST_PARAMETERS_INITIALIZATION); - } - if (this.match(TokenType.COMMA)) { - throw this.createError(ErrorMessages.INVALID_LAST_REST_PARAMETER); - } - this.expect(TokenType.RPAREN); - let paramsNode = this.finishNode({ - type: ARROW_EXPRESSION_PARAMS, - params: [], - rest, - isAsync: false, - }, preParenStartState); - this.ensureArrow(); - this.isBindingElement = this.isAssignmentTarget = false; - return paramsNode; - } - let group = this.inheritCoverGrammar(this.parseAssignmentExpressionOrTarget); - - let params = this.isBindingElement ? [this.targetToBinding(this.transformDestructuringWithDefault(group))] : null; - - while (this.eat(TokenType.COMMA)) { - if (this.match(TokenType.RPAREN)) { - if (!this.isBindingElement) { - throw this.createUnexpected(this.lookahead); - } - this.firstExprError = this.firstExprError || this.createUnexpected(this.lookahead); - group = null; - break; - } - this.isAssignmentTarget = false; - if (this.match(TokenType.ELLIPSIS)) { - if (!this.isBindingElement) { - throw this.createUnexpected(this.lookahead); - } - this.lex(); - rest = this.parseBindingTarget(); - if (this.match(TokenType.ASSIGN)) { - throw this.createError(ErrorMessages.INVALID_REST_PARAMETERS_INITIALIZATION); - } - if (this.match(TokenType.COMMA)) { - throw this.createError(ErrorMessages.INVALID_LAST_REST_PARAMETER); - } - break; - } - - if (group) { - // Can be either binding element or assignment target. - let expr = this.inheritCoverGrammar(this.parseAssignmentExpressionOrTarget); - if (this.isBindingElement) { - params.push(this.targetToBinding(this.transformDestructuringWithDefault(expr))); - } else { - params = null; - } - - if (this.firstExprError) { - group = null; - } else { - group = this.finishNode(new AST.BinaryExpression({ - left: group, - operator: ',', - right: expr, - }), postParenStartState); - } - } else { - // Can be only binding elements. - let binding = this.parseBindingElement(); - params.push(binding); - } - } - this.expect(TokenType.RPAREN); - - if (!this.hasLineTerminatorBeforeNext && this.match(TokenType.ARROW)) { - if (!this.isBindingElement) { - throw this.createErrorWithLocation(start, ErrorMessages.ILLEGAL_ARROW_FUNCTION_PARAMS); - } - - this.isBindingElement = false; - return this.finishNode({ - type: ARROW_EXPRESSION_PARAMS, - params, - rest, - isAsync: false, - }, preParenStartState); - } - // Ensure assignment pattern: - if (rest) { - this.ensureArrow(); - } - this.isBindingElement = false; - if (!isValidSimpleAssignmentTarget(group)) { - this.isAssignmentTarget = false; - } - return group; - } - - parseArrayExpression() { - let startLocation = this.getLocation(); - let startState = this.startNode(); - - this.lex(); - - let exprs = []; - let rest = null; - - while (true) { - if (this.match(TokenType.RBRACK)) { - break; - } - if (this.eat(TokenType.COMMA)) { - exprs.push(null); - } else { - let elementStartState = this.startNode(); - let expr; - if (this.eat(TokenType.ELLIPSIS)) { - // Spread/Rest element - expr = this.inheritCoverGrammar(this.parseAssignmentExpressionOrTarget); - if (!this.isAssignmentTarget && this.firstExprError) { - throw this.firstExprError; - } - if (expr.type === 'ArrayAssignmentTarget' || expr.type === 'ObjectAssignmentTarget') { - rest = expr; - break; - } - if (expr.type !== 'ArrayExpression' && expr.type !== 'ObjectExpression' && !isValidSimpleAssignmentTarget(expr)) { - this.isBindingElement = this.isAssignmentTarget = false; - } - expr = this.finishNode(new AST.SpreadElement({ expression: expr }), elementStartState); - if (!this.match(TokenType.RBRACK)) { - this.isBindingElement = this.isAssignmentTarget = false; - } - } else { - expr = this.inheritCoverGrammar(this.parseAssignmentExpressionOrTarget); - if (!this.isAssignmentTarget && this.firstExprError) { - throw this.firstExprError; - } - } - exprs.push(expr); - - if (!this.match(TokenType.RBRACK)) { - this.expect(TokenType.COMMA); - } - } - } - - if (rest && this.match(TokenType.COMMA)) { - throw this.createErrorWithLocation(startLocation, ErrorMessages.UNEXPECTED_COMMA_AFTER_REST); - } - - this.expect(TokenType.RBRACK); - - if (rest) { - // No need to check isAssignmentTarget: the only way to have something we know is a rest element is if we have ...Object/ArrayAssignmentTarget, which implies we have a firstExprError; as such, if isAssignmentTarget were false, we'd've thrown above before setting rest. - return this.finishNode(new AST.ArrayAssignmentTarget({ - elements: exprs.map(e => e && this.transformDestructuringWithDefault(e)), - rest, - }), startState); - } else if (this.firstExprError) { - let last = exprs[exprs.length - 1]; - if (last != null && last.type === 'SpreadElement') { - return this.finishNode(new AST.ArrayAssignmentTarget({ - elements: exprs.slice(0, -1).map(e => e && this.transformDestructuringWithDefault(e)), - rest: this.transformDestructuring(last.expression), - }), startState); - } - return this.finishNode(new AST.ArrayAssignmentTarget({ - elements: exprs.map(e => e && this.transformDestructuringWithDefault(e)), - rest: null, - }), startState); - - } - return this.finishNode(new AST.ArrayExpression({ elements: exprs }), startState); - } - - parseObjectExpression() { - let startState = this.startNode(); - this.lex(); - let properties = []; - while (!this.match(TokenType.RBRACE)) { - let isSpreadProperty = false; - if (this.match(TokenType.ELLIPSIS)) { - isSpreadProperty = true; - let spreadPropertyOrAssignmentTarget = this.parseSpreadPropertyDefinition(); - properties.push(spreadPropertyOrAssignmentTarget); - } else { - let property = this.inheritCoverGrammar(this.parsePropertyDefinition); - properties.push(property); - } - if (!this.match(TokenType.RBRACE)) { - this.expect(TokenType.COMMA); - if (isSpreadProperty) { - this.isBindingElement = this.isAssignmentTarget = false; - } - } - } - this.expect(TokenType.RBRACE); - if (this.firstExprError) { - if (!this.isAssignmentTarget) { - throw this.createError(ErrorMessages.INVALID_LHS_IN_BINDING); - } - let last = properties[properties.length - 1]; - if (last != null && last.type === 'SpreadProperty') { - return this.finishNode(new AST.ObjectAssignmentTarget({ - properties: properties.slice(0, -1).map(p => this.transformDestructuringWithDefault(p)), - rest: this.transformDestructuring(last.expression), - }), startState); - } - return this.finishNode(new AST.ObjectAssignmentTarget({ properties: properties.map(p => this.transformDestructuringWithDefault(p)), rest: null }), startState); - } - return this.finishNode(new AST.ObjectExpression({ properties }), startState); - } - - parseSpreadPropertyDefinition() { - let startState = this.startNode(); - this.expect(TokenType.ELLIPSIS); - let expression = this.parseAssignmentExpression(); - if (!isValidSimpleAssignmentTarget(expression)) { - this.isBindingElement = this.isAssignmentTarget = false; - } else if (expression.type !== 'IdentifierExpression') { - this.isBindingElement = false; - } - return this.finishNode(new AST.SpreadProperty({ expression }), startState); - } - - parsePropertyDefinition() { - let startLocation = this.getLocation(); - let startState = this.startNode(); - let token = this.lookahead; - - let { methodOrKey, kind } = this.parseMethodDefinition(); - switch (kind) { - case 'method': - this.isBindingElement = this.isAssignmentTarget = false; - return methodOrKey; - case 'identifier': - if (token.value === 'await' && this.firstAwaitLocation == null) { - this.firstAwaitLocation = this.getLocation(); - } - if (this.eat(TokenType.ASSIGN)) { - if (this.allowYieldExpression && token.value === 'yield') { - throw this.createError(ErrorMessages.ILLEGAL_YIELD_IDENTIFIER); - } - if (this.allowAwaitExpression && token.value === 'await') { - throw this.createError(ErrorMessages.ILLEGAL_AWAIT_IDENTIFIER); - } - // CoverInitializedName - let init = this.isolateCoverGrammar(this.parseAssignmentExpression); - this.firstExprError = this.createErrorWithLocation(startLocation, ErrorMessages.ILLEGAL_PROPERTY); - return this.finishNode(new AST.AssignmentTargetPropertyIdentifier({ - binding: this.transformDestructuring(methodOrKey), - init, - }), startState); - } else if (!this.match(TokenType.COLON)) { - if (this.allowYieldExpression && token.value === 'yield') { - throw this.createError(ErrorMessages.ILLEGAL_YIELD_IDENTIFIER); - } - if (this.allowAwaitExpression && token.value === 'await') { - throw this.createError(ErrorMessages.ILLEGAL_AWAIT_IDENTIFIER); - } - if (token.type === TokenType.IDENTIFIER || token.value === 'let' || token.value === 'yield' || token.value === 'async' || token.value === 'await') { - return this.finishNode(new AST.ShorthandProperty({ name: this.finishNode(new AST.IdentifierExpression({ name: methodOrKey.value }), startState) }), startState); - } - throw this.createUnexpected(token); - } - } - - // property - this.expect(TokenType.COLON); - - let expr = this.inheritCoverGrammar(this.parseAssignmentExpressionOrTarget); - if (this.firstExprError) { - return this.finishNode(new AST.AssignmentTargetPropertyProperty({ name: methodOrKey, binding: expr }), startState); - } - return this.finishNode(new AST.DataProperty({ name: methodOrKey, expression: expr }), startState); - } - - parsePropertyName() { - // PropertyName[Yield,GeneratorParameter]: - let token = this.lookahead; - let startState = this.startNode(); - - if (this.eof()) { - throw this.createUnexpected(token); - } - - switch (token.type) { - case TokenType.STRING: - return { - name: this.finishNode(new AST.StaticPropertyName({ - value: this.parseStringLiteral().value, - }), startState), - binding: null, - }; - case TokenType.NUMBER: { - let numLiteral = this.parseNumericLiteral(); - return { - name: this.finishNode(new AST.StaticPropertyName({ - value: `${numLiteral.type === 'LiteralInfinityExpression' ? 1 / 0 : numLiteral.value}`, - }), startState), - binding: null, - }; - } - case TokenType.LBRACK: { - this.lex(); - let expr = this.parseAssignmentExpression(); - this.expect(TokenType.RBRACK); - return { name: this.finishNode(new AST.ComputedPropertyName({ expression: expr }), startState), binding: null }; - } - } - - let name = this.parseIdentifierName(); - return { - name: this.finishNode(new AST.StaticPropertyName({ value: name }), startState), - binding: this.finishNode(new AST.BindingIdentifier({ name }), startState), - }; - } - - /** - * Test if lookahead can be the beginning of a `PropertyName`. - * @returns {boolean} - */ - lookaheadPropertyName() { - switch (this.lookahead.type) { - case TokenType.NUMBER: - case TokenType.STRING: - case TokenType.LBRACK: - return true; - default: - return this.lookahead.type.klass.isIdentifierName; - } - } - - // eslint-disable-next-line valid-jsdoc - /** - * Try to parse a method definition. - * - * If it turns out to be one of: - * * `IdentifierReference` - * * `CoverInitializedName` (`IdentifierReference "=" AssignmentExpression`) - * * `PropertyName : AssignmentExpression` - * The parser will stop at the end of the leading `Identifier` or `PropertyName` and return it. - * - * @returns {{methodOrKey: (Method|PropertyName), kind: string}} - */ - parseMethodDefinition() { - let token = this.lookahead; - let startState = this.startNode(); - - let preAsyncTokenState = this.saveLexerState(); - - let isAsync = !!this.eat(TokenType.ASYNC); - if (isAsync && this.hasLineTerminatorBeforeNext) { - isAsync = false; - this.restoreLexerState(preAsyncTokenState); - } - - let isGenerator = !!this.eat(TokenType.MUL); - if (isAsync && !this.lookaheadPropertyName()) { - isAsync = false; - isGenerator = false; - this.restoreLexerState(preAsyncTokenState); - } - - let { name } = this.parsePropertyName(); - - if (!isGenerator && !isAsync) { - if (token.type === TokenType.IDENTIFIER && token.value.length === 3) { - // Property Assignment: Getter and Setter. - if (token.value === 'get' && this.lookaheadPropertyName() && !token.escaped) { - ({ name } = this.parsePropertyName()); - this.expect(TokenType.LPAREN); - this.expect(TokenType.RPAREN); - let previousYield = this.allowYieldExpression; - let previousAwait = this.allowAwaitExpression; - let previousAwaitLocation = this.firstAwaitLocation; - this.allowYieldExpression = false; - this.allowAwaitExpression = false; - this.firstAwaitLocation = null; - let body = this.parseFunctionBody(); - this.allowYieldExpression = previousYield; - this.allowAwaitExpression = previousAwait; - this.firstAwaitLocation = previousAwaitLocation; - return { - methodOrKey: this.finishNode(new AST.Getter({ name, body }), startState), - kind: 'method', - }; - } else if (token.value === 'set' && this.lookaheadPropertyName() && !token.escaped) { - ({ name } = this.parsePropertyName()); - this.expect(TokenType.LPAREN); - let previousYield = this.allowYieldExpression; - let previousAwait = this.allowAwaitExpression; - let previousAwaitLocation = this.firstAwaitLocation; - this.allowYieldExpression = false; - this.allowAwaitExpression = false; - this.firstAwaitLocation = null; - let param = this.parseBindingElement(); - this.expect(TokenType.RPAREN); - let body = this.parseFunctionBody(); - this.allowYieldExpression = previousYield; - this.allowAwaitExpression = previousAwait; - this.firstAwaitLocation = previousAwaitLocation; - return { - methodOrKey: this.finishNode(new AST.Setter({ name, param, body }), startState), - kind: 'method', - }; - } - } - } - if (isAsync) { - let previousYield = this.allowYieldExpression; - let previousAwait = this.allowAwaitExpression; - this.allowYieldExpression = isGenerator; - this.allowAwaitExpression = true; - let params = this.parseParams(); - this.allowYieldExpression = isGenerator; - this.allowAwaitExpression = true; - let body = this.parseFunctionBody(); - this.allowYieldExpression = previousYield; - this.allowAwaitExpression = previousAwait; - return { - methodOrKey: this.finishNode(new AST.Method({ isAsync, isGenerator, name, params, body }), startState), - kind: 'method', - }; - } - - if (this.match(TokenType.LPAREN)) { - let previousYield = this.allowYieldExpression; - let previousAwait = this.allowAwaitExpression; - let previousAwaitLocation = this.firstAwaitLocation; - this.allowYieldExpression = isGenerator; - this.allowAwaitExpression = false; - this.firstAwaitLocation = null; - let params = this.parseParams(); - let body = this.parseFunctionBody(); - this.allowYieldExpression = previousYield; - this.allowAwaitExpression = previousAwait; - this.firstAwaitLocation = previousAwaitLocation; - - return { - methodOrKey: this.finishNode(new AST.Method({ isAsync, isGenerator, name, params, body }), startState), - kind: 'method', - }; - } - - if (isGenerator && this.match(TokenType.COLON)) { - throw this.createUnexpected(this.lookahead); - } - - return { - methodOrKey: name, - kind: token.type.klass.isIdentifierName ? 'identifier' : 'property', - escaped: token.escaped, - }; - } - - parseClass({ isExpr, inDefault }) { - let startState = this.startNode(); - - this.lex(); - let name = null; - let heritage = null; - - if (this.matchIdentifier()) { - name = this.parseBindingIdentifier(); - } else if (!isExpr) { - if (inDefault) { - name = new AST.BindingIdentifier({ name: '*default*' }); - } else { - throw this.createUnexpected(this.lookahead); - } - } - - if (this.eat(TokenType.EXTENDS)) { - heritage = this.isolateCoverGrammar(() => this.parseLeftHandSideExpression({ allowCall: true })); - } - - this.expect(TokenType.LBRACE); - let elements = []; - while (!this.eat(TokenType.RBRACE)) { - if (this.eat(TokenType.SEMICOLON)) { - continue; - } - let isStatic = false; - let classElementStart = this.startNode(); - let { methodOrKey, kind, escaped } = this.parseMethodDefinition(); - if (kind === 'identifier' && methodOrKey.value === 'static' && !escaped) { - isStatic = true; - ({ methodOrKey, kind } = this.parseMethodDefinition()); - } - if (kind === 'method') { - elements.push(this.finishNode(new AST.ClassElement({ isStatic, method: methodOrKey }), classElementStart)); - } else { - throw this.createError('Only methods are allowed in classes'); - } - } - return this.finishNode(new (isExpr ? AST.ClassExpression : AST.ClassDeclaration)({ name, super: heritage, elements }), startState); - } - - parseFunction({ isExpr, inDefault, allowGenerator, isAsync, startState = this.startNode() }) { - this.lex(); - let name = null; - let isGenerator = allowGenerator && !!this.eat(TokenType.MUL); - - let previousYield = this.allowYieldExpression; - let previousAwait = this.allowAwaitExpression; - let previousAwaitLocation = this.firstAwaitLocation; - - if (isExpr) { - this.allowYieldExpression = isGenerator; - this.allowAwaitExpression = isAsync; - } - - if (!this.match(TokenType.LPAREN)) { - name = this.parseBindingIdentifier(); - } else if (!isExpr) { - if (inDefault) { - name = new AST.BindingIdentifier({ name: '*default*' }); - } else { - throw this.createUnexpected(this.lookahead); - } - } - this.allowYieldExpression = isGenerator; - this.allowAwaitExpression = isAsync; - this.firstAwaitLocation = null; - let params = this.parseParams(); - let body = this.parseFunctionBody(); - this.allowYieldExpression = previousYield; - this.allowAwaitExpression = previousAwait; - this.firstAwaitLocation = previousAwaitLocation; - - return this.finishNode(new (isExpr ? AST.FunctionExpression : AST.FunctionDeclaration)({ isAsync, isGenerator, name, params, body }), startState); - } - - parseArrayBinding() { - let startState = this.startNode(); - - this.expect(TokenType.LBRACK); - - let elements = [], rest = null; - - while (true) { - if (this.match(TokenType.RBRACK)) { - break; - } - let el; - - if (this.eat(TokenType.COMMA)) { - el = null; - } else { - if (this.eat(TokenType.ELLIPSIS)) { - rest = this.parseBindingTarget(); - break; - } else { - el = this.parseBindingElement(); - } - if (!this.match(TokenType.RBRACK)) { - this.expect(TokenType.COMMA); - } - } - elements.push(el); - } - - this.expect(TokenType.RBRACK); - - return this.finishNode(new AST.ArrayBinding({ elements, rest }), startState); - } - - parseBindingProperty() { - let startState = this.startNode(); - let isIdentifier = this.matchIdentifier(); - let token = this.lookahead; - let { name, binding } = this.parsePropertyName(); - if (isIdentifier && name.type === 'StaticPropertyName') { - if (!this.match(TokenType.COLON)) { - if (this.allowYieldExpression && token.value === 'yield') { - throw this.createError(ErrorMessages.ILLEGAL_YIELD_IDENTIFIER); - } - if (this.allowAwaitExpression && token.value === 'await') { - throw this.createError(ErrorMessages.ILLEGAL_AWAIT_IDENTIFIER); - } - let defaultValue = null; - if (this.eat(TokenType.ASSIGN)) { - defaultValue = this.parseAssignmentExpression(); - } - return this.finishNode(new AST.BindingPropertyIdentifier({ - binding, - init: defaultValue, - }), startState); - } - } - this.expect(TokenType.COLON); - binding = this.parseBindingElement(); - return this.finishNode(new AST.BindingPropertyProperty({ name, binding }), startState); - } - - parseObjectBinding() { - let startState = this.startNode(); - this.expect(TokenType.LBRACE); - - let properties = []; - let rest = null; - while (!this.match(TokenType.RBRACE)) { - if (this.eat(TokenType.ELLIPSIS)) { - rest = this.parseBindingIdentifier(); - break; - } - properties.push(this.parseBindingProperty()); - if (!this.match(TokenType.RBRACE)) { - this.expect(TokenType.COMMA); - } - } - - this.expect(TokenType.RBRACE); - - return this.finishNode(new AST.ObjectBinding({ properties, rest }), startState); - } - - parseBindingTarget() { - if (this.matchIdentifier()) { - return this.parseBindingIdentifier(); - } - switch (this.lookahead.type) { - case TokenType.LBRACK: - return this.parseArrayBinding(); - case TokenType.LBRACE: - return this.parseObjectBinding(); - } - throw this.createUnexpected(this.lookahead); - } - - parseBindingElement() { - let startState = this.startNode(); - let binding = this.parseBindingTarget(); - if (this.eat(TokenType.ASSIGN)) { - let init = this.parseAssignmentExpression(); - binding = this.finishNode(new AST.BindingWithDefault({ binding, init }), startState); - } - return binding; - } - - parseParam() { - let previousInParameter = this.inParameter; - this.inParameter = true; - let param = this.parseBindingElement(); - this.inParameter = previousInParameter; - return param; - } - - parseParams() { - let startState = this.startNode(); - this.expect(TokenType.LPAREN); - - let items = [], rest = null; - while (!this.match(TokenType.RPAREN)) { - if (this.eat(TokenType.ELLIPSIS)) { - rest = this.parseBindingTarget(); - if (this.lookahead.type === TokenType.ASSIGN) { - throw this.createError(ErrorMessages.UNEXPECTED_REST_PARAMETERS_INITIALIZATION); - } - if (this.match(TokenType.COMMA)) { - throw this.createError(ErrorMessages.UNEXPECTED_COMMA_AFTER_REST); - } - break; - } - items.push(this.parseParam()); - if (this.match(TokenType.RPAREN)) break; - this.expect(TokenType.COMMA); - } - - this.expect(TokenType.RPAREN); - - return this.finishNode(new AST.FormalParameters({ items, rest }), startState); - } -} diff --git a/docs/dist/shift-parser/tokenizer.js b/docs/dist/shift-parser/tokenizer.js deleted file mode 100644 index f5e24611..00000000 --- a/docs/dist/shift-parser/tokenizer.js +++ /dev/null @@ -1,1505 +0,0 @@ -/** - * Copyright 2014 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -import { getHexValue, isLineTerminator, isWhiteSpace, isIdentifierStart, isIdentifierPart, isDecimalDigit } from './utils.js'; -import { ErrorMessages } from './errors.js'; - -export const TokenClass = { - Eof: { name: '' }, - Ident: { name: 'Identifier', isIdentifierName: true }, - Keyword: { name: 'Keyword', isIdentifierName: true }, - NumericLiteral: { name: 'Numeric' }, - TemplateElement: { name: 'Template' }, - Punctuator: { name: 'Punctuator' }, - StringLiteral: { name: 'String' }, - RegularExpression: { name: 'RegularExpression' }, - Illegal: { name: 'Illegal' }, -}; - -export const TokenType = { - EOS: { klass: TokenClass.Eof, name: 'EOS' }, - LPAREN: { klass: TokenClass.Punctuator, name: '(' }, - RPAREN: { klass: TokenClass.Punctuator, name: ')' }, - LBRACK: { klass: TokenClass.Punctuator, name: '[' }, - RBRACK: { klass: TokenClass.Punctuator, name: ']' }, - LBRACE: { klass: TokenClass.Punctuator, name: '{' }, - RBRACE: { klass: TokenClass.Punctuator, name: '}' }, - COLON: { klass: TokenClass.Punctuator, name: ':' }, - SEMICOLON: { klass: TokenClass.Punctuator, name: ';' }, - PERIOD: { klass: TokenClass.Punctuator, name: '.' }, - ELLIPSIS: { klass: TokenClass.Punctuator, name: '...' }, - ARROW: { klass: TokenClass.Punctuator, name: '=>' }, - CONDITIONAL: { klass: TokenClass.Punctuator, name: '?' }, - INC: { klass: TokenClass.Punctuator, name: '++' }, - DEC: { klass: TokenClass.Punctuator, name: '--' }, - ASSIGN: { klass: TokenClass.Punctuator, name: '=' }, - ASSIGN_BIT_OR: { klass: TokenClass.Punctuator, name: '|=' }, - ASSIGN_BIT_XOR: { klass: TokenClass.Punctuator, name: '^=' }, - ASSIGN_BIT_AND: { klass: TokenClass.Punctuator, name: '&=' }, - ASSIGN_SHL: { klass: TokenClass.Punctuator, name: '<<=' }, - ASSIGN_SHR: { klass: TokenClass.Punctuator, name: '>>=' }, - ASSIGN_SHR_UNSIGNED: { klass: TokenClass.Punctuator, name: '>>>=' }, - ASSIGN_ADD: { klass: TokenClass.Punctuator, name: '+=' }, - ASSIGN_SUB: { klass: TokenClass.Punctuator, name: '-=' }, - ASSIGN_MUL: { klass: TokenClass.Punctuator, name: '*=' }, - ASSIGN_DIV: { klass: TokenClass.Punctuator, name: '/=' }, - ASSIGN_MOD: { klass: TokenClass.Punctuator, name: '%=' }, - ASSIGN_EXP: { klass: TokenClass.Punctuator, name: '**=' }, - COMMA: { klass: TokenClass.Punctuator, name: ',' }, - OR: { klass: TokenClass.Punctuator, name: '||' }, - AND: { klass: TokenClass.Punctuator, name: '&&' }, - BIT_OR: { klass: TokenClass.Punctuator, name: '|' }, - BIT_XOR: { klass: TokenClass.Punctuator, name: '^' }, - BIT_AND: { klass: TokenClass.Punctuator, name: '&' }, - SHL: { klass: TokenClass.Punctuator, name: '<<' }, - SHR: { klass: TokenClass.Punctuator, name: '>>' }, - SHR_UNSIGNED: { klass: TokenClass.Punctuator, name: '>>>' }, - ADD: { klass: TokenClass.Punctuator, name: '+' }, - SUB: { klass: TokenClass.Punctuator, name: '-' }, - MUL: { klass: TokenClass.Punctuator, name: '*' }, - DIV: { klass: TokenClass.Punctuator, name: '/' }, - MOD: { klass: TokenClass.Punctuator, name: '%' }, - EXP: { klass: TokenClass.Punctuator, name: '**' }, - EQ: { klass: TokenClass.Punctuator, name: '==' }, - NE: { klass: TokenClass.Punctuator, name: '!=' }, - EQ_STRICT: { klass: TokenClass.Punctuator, name: '===' }, - NE_STRICT: { klass: TokenClass.Punctuator, name: '!==' }, - LT: { klass: TokenClass.Punctuator, name: '<' }, - GT: { klass: TokenClass.Punctuator, name: '>' }, - LTE: { klass: TokenClass.Punctuator, name: '<=' }, - GTE: { klass: TokenClass.Punctuator, name: '>=' }, - INSTANCEOF: { klass: TokenClass.Keyword, name: 'instanceof' }, - IN: { klass: TokenClass.Keyword, name: 'in' }, - NOT: { klass: TokenClass.Punctuator, name: '!' }, - BIT_NOT: { klass: TokenClass.Punctuator, name: '~' }, - ASYNC: { klass: TokenClass.Keyword, name: 'async' }, - AWAIT: { klass: TokenClass.Keyword, name: 'await' }, - ENUM: { klass: TokenClass.Keyword, name: 'enum' }, - DELETE: { klass: TokenClass.Keyword, name: 'delete' }, - TYPEOF: { klass: TokenClass.Keyword, name: 'typeof' }, - VOID: { klass: TokenClass.Keyword, name: 'void' }, - BREAK: { klass: TokenClass.Keyword, name: 'break' }, - CASE: { klass: TokenClass.Keyword, name: 'case' }, - CATCH: { klass: TokenClass.Keyword, name: 'catch' }, - CLASS: { klass: TokenClass.Keyword, name: 'class' }, - CONTINUE: { klass: TokenClass.Keyword, name: 'continue' }, - DEBUGGER: { klass: TokenClass.Keyword, name: 'debugger' }, - DEFAULT: { klass: TokenClass.Keyword, name: 'default' }, - DO: { klass: TokenClass.Keyword, name: 'do' }, - ELSE: { klass: TokenClass.Keyword, name: 'else' }, - EXPORT: { klass: TokenClass.Keyword, name: 'export' }, - EXTENDS: { klass: TokenClass.Keyword, name: 'extends' }, - FINALLY: { klass: TokenClass.Keyword, name: 'finally' }, - FOR: { klass: TokenClass.Keyword, name: 'for' }, - FUNCTION: { klass: TokenClass.Keyword, name: 'function' }, - IF: { klass: TokenClass.Keyword, name: 'if' }, - IMPORT: { klass: TokenClass.Keyword, name: 'import' }, - LET: { klass: TokenClass.Keyword, name: 'let' }, - NEW: { klass: TokenClass.Keyword, name: 'new' }, - RETURN: { klass: TokenClass.Keyword, name: 'return' }, - SUPER: { klass: TokenClass.Keyword, name: 'super' }, - SWITCH: { klass: TokenClass.Keyword, name: 'switch' }, - THIS: { klass: TokenClass.Keyword, name: 'this' }, - THROW: { klass: TokenClass.Keyword, name: 'throw' }, - TRY: { klass: TokenClass.Keyword, name: 'try' }, - VAR: { klass: TokenClass.Keyword, name: 'var' }, - WHILE: { klass: TokenClass.Keyword, name: 'while' }, - WITH: { klass: TokenClass.Keyword, name: 'with' }, - NULL: { klass: TokenClass.Keyword, name: 'null' }, - TRUE: { klass: TokenClass.Keyword, name: 'true' }, - FALSE: { klass: TokenClass.Keyword, name: 'false' }, - YIELD: { klass: TokenClass.Keyword, name: 'yield' }, - NUMBER: { klass: TokenClass.NumericLiteral, name: '' }, - STRING: { klass: TokenClass.StringLiteral, name: '' }, - REGEXP: { klass: TokenClass.RegularExpression, name: '' }, - IDENTIFIER: { klass: TokenClass.Ident, name: '' }, - CONST: { klass: TokenClass.Keyword, name: 'const' }, - TEMPLATE: { klass: TokenClass.TemplateElement, name: '' }, - ESCAPED_KEYWORD: { klass: TokenClass.Keyword, name: '' }, - ILLEGAL: { klass: TokenClass.Illegal, name: '' }, -}; - -const TT = TokenType; -const I = TT.ILLEGAL; -const F = false; -const T = true; - -const ONE_CHAR_PUNCTUATOR = [ - I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, TT.NOT, I, I, I, - TT.MOD, TT.BIT_AND, I, TT.LPAREN, TT.RPAREN, TT.MUL, TT.ADD, TT.COMMA, TT.SUB, TT.PERIOD, TT.DIV, I, I, I, I, I, I, I, - I, I, I, TT.COLON, TT.SEMICOLON, TT.LT, TT.ASSIGN, TT.GT, TT.CONDITIONAL, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, - I, I, I, I, I, I, I, I, I, I, I, I, TT.LBRACK, I, TT.RBRACK, TT.BIT_XOR, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, - I, I, I, I, I, I, I, I, I, I, I, I, I, TT.LBRACE, TT.BIT_OR, TT.RBRACE, TT.BIT_NOT, -]; - -const PUNCTUATOR_START = [ - F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, T, F, F, F, T, T, - F, T, T, T, T, T, T, F, T, F, F, F, F, F, F, F, F, F, F, T, T, T, T, T, T, F, F, F, F, F, F, F, F, F, F, F, F, F, F, - F, F, F, F, F, F, F, F, F, F, F, F, F, T, F, T, T, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, - F, F, F, F, F, F, T, T, T, T, F, -]; - -export class JsError extends Error { - constructor(index, line, column, msg) { - super(msg); - this.index = index; - // Safari defines these properties as non-writable and non-configurable on Error objects - try { - this.line = line; - this.column = column; - } catch (e) {} - // define these as well so Safari still has access to this info - this.parseErrorLine = line; - this.parseErrorColumn = column; - this.description = msg; - this.message = `[${line}:${column}]: ${msg}`; - } -} - -function fromCodePoint(cp) { - if (cp <= 0xFFFF) return String.fromCharCode(cp); - let cu1 = String.fromCharCode(Math.floor((cp - 0x10000) / 0x400) + 0xD800); - let cu2 = String.fromCharCode((cp - 0x10000) % 0x400 + 0xDC00); - return cu1 + cu2; -} - -function decodeUtf16(lead, trail) { - return (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; -} - -export default class Tokenizer { - constructor(source) { - this.source = source; - this.index = 0; - this.line = 0; - this.lineStart = 0; - this.startIndex = 0; - this.startLine = 0; - this.startLineStart = 0; - this.lastIndex = 0; - this.lastLine = 0; - this.lastLineStart = 0; - this.hasLineTerminatorBeforeNext = false; - this.tokenIndex = 0; - } - - saveLexerState() { - return { - source: this.source, - index: this.index, - line: this.line, - lineStart: this.lineStart, - startIndex: this.startIndex, - startLine: this.startLine, - startLineStart: this.startLineStart, - lastIndex: this.lastIndex, - lastLine: this.lastLine, - lastLineStart: this.lastLineStart, - lookahead: this.lookahead, - hasLineTerminatorBeforeNext: this.hasLineTerminatorBeforeNext, - tokenIndex: this.tokenIndex, - }; - } - - restoreLexerState(state) { - this.source = state.source; - this.index = state.index; - this.line = state.line; - this.lineStart = state.lineStart; - this.startIndex = state.startIndex; - this.startLine = state.startLine; - this.startLineStart = state.startLineStart; - this.lastIndex = state.lastIndex; - this.lastLine = state.lastLine; - this.lastLineStart = state.lastLineStart; - this.lookahead = state.lookahead; - this.hasLineTerminatorBeforeNext = state.hasLineTerminatorBeforeNext; - this.tokenIndex = state.tokenIndex; - } - - createILLEGAL() { - this.startIndex = this.index; - this.startLine = this.line; - this.startLineStart = this.lineStart; - return this.index < this.source.length - ? this.createError(ErrorMessages.UNEXPECTED_ILLEGAL_TOKEN, this.source.charAt(this.index)) - : this.createError(ErrorMessages.UNEXPECTED_EOS); - } - - createUnexpected(token) { - switch (token.type.klass) { - case TokenClass.Eof: - return this.createError(ErrorMessages.UNEXPECTED_EOS); - case TokenClass.Ident: - return this.createError(ErrorMessages.UNEXPECTED_IDENTIFIER); - case TokenClass.Keyword: - if (token.type === TokenType.ESCAPED_KEYWORD) { - return this.createError(ErrorMessages.UNEXPECTED_ESCAPED_KEYWORD); - } - return this.createError(ErrorMessages.UNEXPECTED_TOKEN, token.slice.text); - case TokenClass.NumericLiteral: - return this.createError(ErrorMessages.UNEXPECTED_NUMBER); - case TokenClass.TemplateElement: - return this.createError(ErrorMessages.UNEXPECTED_TEMPLATE); - case TokenClass.Punctuator: - return this.createError(ErrorMessages.UNEXPECTED_TOKEN, token.type.name); - case TokenClass.StringLiteral: - return this.createError(ErrorMessages.UNEXPECTED_STRING); - // the other token classes are RegularExpression and Illegal, but they cannot reach here - } - // istanbul ignore next - throw new Error('Unreachable: unexpected token of class ' + token.type.klass); - } - - createError(message, ...params) { - let msg; - if (typeof message === 'function') { - msg = message(...params); - } else { - msg = message; - } - return new JsError(this.startIndex, this.startLine + 1, this.startIndex - this.startLineStart + 1, msg); - } - - createErrorWithLocation(location, message) { - /* istanbul ignore next */ - let msg = message.replace(/\{(\d+)\}/g, (_, n) => JSON.stringify(arguments[+n + 2])); - if (location.slice && location.slice.startLocation) { - location = location.slice.startLocation; - } - return new JsError(location.offset, location.line, location.column + 1, msg); - } - - static cse2(id, ch1, ch2) { - return id.charAt(1) === ch1 && id.charAt(2) === ch2; - } - - static cse3(id, ch1, ch2, ch3) { - return id.charAt(1) === ch1 && id.charAt(2) === ch2 && id.charAt(3) === ch3; - } - - static cse4(id, ch1, ch2, ch3, ch4) { - return id.charAt(1) === ch1 && id.charAt(2) === ch2 && id.charAt(3) === ch3 && id.charAt(4) === ch4; - } - - static cse5(id, ch1, ch2, ch3, ch4, ch5) { - return id.charAt(1) === ch1 && id.charAt(2) === ch2 && id.charAt(3) === ch3 && id.charAt(4) === ch4 && id.charAt(5) === ch5; - } - - static cse6(id, ch1, ch2, ch3, ch4, ch5, ch6) { - return id.charAt(1) === ch1 && id.charAt(2) === ch2 && id.charAt(3) === ch3 && id.charAt(4) === ch4 && id.charAt(5) === ch5 && id.charAt(6) === ch6; - } - - static cse7(id, ch1, ch2, ch3, ch4, ch5, ch6, ch7) { - return id.charAt(1) === ch1 && id.charAt(2) === ch2 && id.charAt(3) === ch3 && id.charAt(4) === ch4 && id.charAt(5) === ch5 && id.charAt(6) === ch6 && id.charAt(7) === ch7; - } - - getKeyword(id) { - if (id.length === 1 || id.length > 10) { - return TokenType.IDENTIFIER; - } - - /* istanbul ignore next */ - switch (id.length) { - case 2: - switch (id.charAt(0)) { - case 'i': - switch (id.charAt(1)) { - case 'f': - return TokenType.IF; - case 'n': - return TokenType.IN; - default: - break; - } - break; - case 'd': - if (id.charAt(1) === 'o') { - return TokenType.DO; - } - break; - } - break; - case 3: - switch (id.charAt(0)) { - case 'v': - if (Tokenizer.cse2(id, 'a', 'r')) { - return TokenType.VAR; - } - break; - case 'f': - if (Tokenizer.cse2(id, 'o', 'r')) { - return TokenType.FOR; - } - break; - case 'n': - if (Tokenizer.cse2(id, 'e', 'w')) { - return TokenType.NEW; - } - break; - case 't': - if (Tokenizer.cse2(id, 'r', 'y')) { - return TokenType.TRY; - } - break; - case 'l': - if (Tokenizer.cse2(id, 'e', 't')) { - return TokenType.LET; - } - break; - } - break; - case 4: - switch (id.charAt(0)) { - case 't': - if (Tokenizer.cse3(id, 'h', 'i', 's')) { - return TokenType.THIS; - } else if (Tokenizer.cse3(id, 'r', 'u', 'e')) { - return TokenType.TRUE; - } - break; - case 'n': - if (Tokenizer.cse3(id, 'u', 'l', 'l')) { - return TokenType.NULL; - } - break; - case 'e': - if (Tokenizer.cse3(id, 'l', 's', 'e')) { - return TokenType.ELSE; - } else if (Tokenizer.cse3(id, 'n', 'u', 'm')) { - return TokenType.ENUM; - } - break; - case 'c': - if (Tokenizer.cse3(id, 'a', 's', 'e')) { - return TokenType.CASE; - } - break; - case 'v': - if (Tokenizer.cse3(id, 'o', 'i', 'd')) { - return TokenType.VOID; - } - break; - case 'w': - if (Tokenizer.cse3(id, 'i', 't', 'h')) { - return TokenType.WITH; - } - break; - } - break; - case 5: - switch (id.charAt(0)) { - case 'a': - if (Tokenizer.cse4(id, 's', 'y', 'n', 'c')) { - return TokenType.ASYNC; - } - if (Tokenizer.cse4(id, 'w', 'a', 'i', 't')) { - return TokenType.AWAIT; - } - break; - case 'w': - if (Tokenizer.cse4(id, 'h', 'i', 'l', 'e')) { - return TokenType.WHILE; - } - break; - case 'b': - if (Tokenizer.cse4(id, 'r', 'e', 'a', 'k')) { - return TokenType.BREAK; - } - break; - case 'f': - if (Tokenizer.cse4(id, 'a', 'l', 's', 'e')) { - return TokenType.FALSE; - } - break; - case 'c': - if (Tokenizer.cse4(id, 'a', 't', 'c', 'h')) { - return TokenType.CATCH; - } else if (Tokenizer.cse4(id, 'o', 'n', 's', 't')) { - return TokenType.CONST; - } else if (Tokenizer.cse4(id, 'l', 'a', 's', 's')) { - return TokenType.CLASS; - } - break; - case 't': - if (Tokenizer.cse4(id, 'h', 'r', 'o', 'w')) { - return TokenType.THROW; - } - break; - case 'y': - if (Tokenizer.cse4(id, 'i', 'e', 'l', 'd')) { - return TokenType.YIELD; - } - break; - case 's': - if (Tokenizer.cse4(id, 'u', 'p', 'e', 'r')) { - return TokenType.SUPER; - } - break; - } - break; - case 6: - switch (id.charAt(0)) { - case 'r': - if (Tokenizer.cse5(id, 'e', 't', 'u', 'r', 'n')) { - return TokenType.RETURN; - } - break; - case 't': - if (Tokenizer.cse5(id, 'y', 'p', 'e', 'o', 'f')) { - return TokenType.TYPEOF; - } - break; - case 'd': - if (Tokenizer.cse5(id, 'e', 'l', 'e', 't', 'e')) { - return TokenType.DELETE; - } - break; - case 's': - if (Tokenizer.cse5(id, 'w', 'i', 't', 'c', 'h')) { - return TokenType.SWITCH; - } - break; - case 'e': - if (Tokenizer.cse5(id, 'x', 'p', 'o', 'r', 't')) { - return TokenType.EXPORT; - } - break; - case 'i': - if (Tokenizer.cse5(id, 'm', 'p', 'o', 'r', 't')) { - return TokenType.IMPORT; - } - break; - } - break; - case 7: - switch (id.charAt(0)) { - case 'd': - if (Tokenizer.cse6(id, 'e', 'f', 'a', 'u', 'l', 't')) { - return TokenType.DEFAULT; - } - break; - case 'f': - if (Tokenizer.cse6(id, 'i', 'n', 'a', 'l', 'l', 'y')) { - return TokenType.FINALLY; - } - break; - case 'e': - if (Tokenizer.cse6(id, 'x', 't', 'e', 'n', 'd', 's')) { - return TokenType.EXTENDS; - } - break; - } - break; - case 8: - switch (id.charAt(0)) { - case 'f': - if (Tokenizer.cse7(id, 'u', 'n', 'c', 't', 'i', 'o', 'n')) { - return TokenType.FUNCTION; - } - break; - case 'c': - if (Tokenizer.cse7(id, 'o', 'n', 't', 'i', 'n', 'u', 'e')) { - return TokenType.CONTINUE; - } - break; - case 'd': - if (Tokenizer.cse7(id, 'e', 'b', 'u', 'g', 'g', 'e', 'r')) { - return TokenType.DEBUGGER; - } - break; - } - break; - case 10: - if (id === 'instanceof') { - return TokenType.INSTANCEOF; - } - break; - } - return TokenType.IDENTIFIER; - } - - skipSingleLineComment(offset) { - this.index += offset; - while (this.index < this.source.length) { - /** - * @type {Number} - */ - let chCode = this.source.charCodeAt(this.index); - this.index++; - if (isLineTerminator(chCode)) { - this.hasLineTerminatorBeforeNext = true; - if (chCode === 0xD /* "\r" */ && this.source.charCodeAt(this.index) === 0xA /* "\n" */) { - this.index++; - } - this.lineStart = this.index; - this.line++; - return; - } - } - } - - skipMultiLineComment() { - this.index += 2; - const length = this.source.length; - let isLineStart = false; - while (this.index < length) { - let chCode = this.source.charCodeAt(this.index); - if (chCode < 0x80) { - switch (chCode) { - case 42: // "*" - // Block comment ends with "*/". - if (this.source.charAt(this.index + 1) === '/') { - this.index = this.index + 2; - return isLineStart; - } - this.index++; - break; - case 10: // "\n" - isLineStart = true; - this.hasLineTerminatorBeforeNext = true; - this.index++; - this.lineStart = this.index; - this.line++; - break; - case 13: // "\r": - isLineStart = true; - this.hasLineTerminatorBeforeNext = true; - if (this.source.charAt(this.index + 1) === '\n') { - this.index++; - } - this.index++; - this.lineStart = this.index; - this.line++; - break; - default: - this.index++; - } - } else if (chCode === 0x2028 || chCode === 0x2029) { - isLineStart = true; - this.hasLineTerminatorBeforeNext = true; - this.index++; - this.lineStart = this.index; - this.line++; - } else { - this.index++; - } - } - throw this.createILLEGAL(); - } - - - skipComment() { - this.hasLineTerminatorBeforeNext = false; - - let isLineStart = this.index === 0; - const length = this.source.length; - - while (this.index < length) { - let chCode = this.source.charCodeAt(this.index); - if (isWhiteSpace(chCode)) { - this.index++; - } else if (isLineTerminator(chCode)) { - this.hasLineTerminatorBeforeNext = true; - this.index++; - if (chCode === 13 /* "\r" */ && this.source.charAt(this.index) === '\n') { - this.index++; - } - this.lineStart = this.index; - this.line++; - isLineStart = true; - } else if (chCode === 47 /* "/" */) { - if (this.index + 1 >= length) { - break; - } - chCode = this.source.charCodeAt(this.index + 1); - if (chCode === 47 /* "/" */) { - this.skipSingleLineComment(2); - isLineStart = true; - } else if (chCode === 42 /* "*" */) { - isLineStart = this.skipMultiLineComment() || isLineStart; - } else { - break; - } - } else if (!this.moduleIsTheGoalSymbol && isLineStart && chCode === 45 /* "-" */) { - if (this.index + 2 >= length) { - break; - } - // U+003E is ">" - if (this.source.charAt(this.index + 1) === '-' && this.source.charAt(this.index + 2) === '>') { - // "-->" is a single-line comment - this.skipSingleLineComment(3); - } else { - break; - } - } else if (!this.moduleIsTheGoalSymbol && chCode === 60 /* "<" */) { - if (this.source.slice(this.index + 1, this.index + 4) === '!--') { - this.skipSingleLineComment(4); - isLineStart = true; - } else { - break; - } - } else { - break; - } - } - } - - scanHexEscape2() { - if (this.index + 2 > this.source.length) { - return -1; - } - let r1 = getHexValue(this.source.charAt(this.index)); - if (r1 === -1) { - return -1; - } - let r2 = getHexValue(this.source.charAt(this.index + 1)); - if (r2 === -1) { - return -1; - } - this.index += 2; - return r1 << 4 | r2; - } - - scanUnicode() { - if (this.source.charAt(this.index) === '{') { - // \u{HexDigits} - let i = this.index + 1; - let hexDigits = 0, ch; - while (i < this.source.length) { - ch = this.source.charAt(i); - let hex = getHexValue(ch); - if (hex === -1) { - break; - } - hexDigits = hexDigits << 4 | hex; - if (hexDigits > 0x10FFFF) { - throw this.createILLEGAL(); - } - i++; - } - if (ch !== '}') { - throw this.createILLEGAL(); - } - if (i === this.index + 1) { - ++this.index; // This is so that the error is 'Unexpected "}"' instead of 'Unexpected "{"'. - throw this.createILLEGAL(); - } - this.index = i + 1; - return hexDigits; - } - // \uHex4Digits - if (this.index + 4 > this.source.length) { - return -1; - } - let r1 = getHexValue(this.source.charAt(this.index)); - if (r1 === -1) { - return -1; - } - let r2 = getHexValue(this.source.charAt(this.index + 1)); - if (r2 === -1) { - return -1; - } - let r3 = getHexValue(this.source.charAt(this.index + 2)); - if (r3 === -1) { - return -1; - } - let r4 = getHexValue(this.source.charAt(this.index + 3)); - if (r4 === -1) { - return -1; - } - this.index += 4; - return r1 << 12 | r2 << 8 | r3 << 4 | r4; - } - - getEscapedIdentifier() { - let id = ''; - let check = isIdentifierStart; - - while (this.index < this.source.length) { - let ch = this.source.charAt(this.index); - let code = ch.charCodeAt(0); - let start = this.index; - ++this.index; - if (ch === '\\') { - if (this.index >= this.source.length) { - throw this.createILLEGAL(); - } - if (this.source.charAt(this.index) !== 'u') { - throw this.createILLEGAL(); - } - ++this.index; - code = this.scanUnicode(); - if (code < 0) { - throw this.createILLEGAL(); - } - ch = fromCodePoint(code); - } else if (code >= 0xD800 && code <= 0xDBFF) { - if (this.index >= this.source.length) { - throw this.createILLEGAL(); - } - let lowSurrogateCode = this.source.charCodeAt(this.index); - ++this.index; - if (!(lowSurrogateCode >= 0xDC00 && lowSurrogateCode <= 0xDFFF)) { - throw this.createILLEGAL(); - } - code = decodeUtf16(code, lowSurrogateCode); - ch = fromCodePoint(code); - } - if (!check(code)) { - if (id.length < 1) { - throw this.createILLEGAL(); - } - this.index = start; - return id; - } - check = isIdentifierPart; - id += ch; - } - return id; - } - - getIdentifier() { - let start = this.index; - let l = this.source.length; - let i = this.index; - let check = isIdentifierStart; - while (i < l) { - let ch = this.source.charAt(i); - let code = ch.charCodeAt(0); - if (ch === '\\' || code >= 0xD800 && code <= 0xDBFF) { - // Go back and try the hard one. - this.index = start; - return this.getEscapedIdentifier(); - } - if (!check(code)) { - this.index = i; - return this.source.slice(start, i); - } - ++i; - check = isIdentifierPart; - } - this.index = i; - return this.source.slice(start, i); - } - - scanIdentifier() { - let startLocation = this.getLocation(); - let start = this.index; - - // Backslash (U+005C) starts an escaped character. - let id = this.source.charAt(this.index) === '\\' ? this.getEscapedIdentifier() : this.getIdentifier(); - - let slice = this.getSlice(start, startLocation); - slice.text = id; - let hasEscape = this.index - start !== id.length; - - let type = this.getKeyword(id); - if (hasEscape && type !== TokenType.IDENTIFIER) { - type = TokenType.ESCAPED_KEYWORD; - } - return { type, value: id, slice, escaped: hasEscape }; - } - - getLocation() { - return { - line: this.startLine + 1, - column: this.startIndex - this.startLineStart, - offset: this.startIndex, - }; - } - - getLastTokenEndLocation() { - return { - line: this.lastLine + 1, - column: this.lastIndex - this.lastLineStart, - offset: this.lastIndex, - }; - } - - getSlice(start, startLocation) { - return { text: this.source.slice(start, this.index), start, startLocation, end: this.index }; - } - - scanPunctuatorHelper() { - let ch1 = this.source.charAt(this.index); - - switch (ch1) { - // Check for most common single-character punctuators. - case '.': { - let ch2 = this.source.charAt(this.index + 1); - if (ch2 !== '.') return TokenType.PERIOD; - let ch3 = this.source.charAt(this.index + 2); - if (ch3 !== '.') return TokenType.PERIOD; - return TokenType.ELLIPSIS; - } - case '(': - return TokenType.LPAREN; - case ')': - case ';': - case ',': - return ONE_CHAR_PUNCTUATOR[ch1.charCodeAt(0)]; - case '{': - return TokenType.LBRACE; - case '}': - case '[': - case ']': - case ':': - case '?': - case '~': - return ONE_CHAR_PUNCTUATOR[ch1.charCodeAt(0)]; - default: - // "=" (U+003D) marks an assignment or comparison operator. - if (this.index + 1 < this.source.length && this.source.charAt(this.index + 1) === '=') { - switch (ch1) { - case '=': - if (this.index + 2 < this.source.length && this.source.charAt(this.index + 2) === '=') { - return TokenType.EQ_STRICT; - } - return TokenType.EQ; - case '!': - if (this.index + 2 < this.source.length && this.source.charAt(this.index + 2) === '=') { - return TokenType.NE_STRICT; - } - return TokenType.NE; - case '|': - return TokenType.ASSIGN_BIT_OR; - case '+': - return TokenType.ASSIGN_ADD; - case '-': - return TokenType.ASSIGN_SUB; - case '*': - return TokenType.ASSIGN_MUL; - case '<': - return TokenType.LTE; - case '>': - return TokenType.GTE; - case '/': - return TokenType.ASSIGN_DIV; - case '%': - return TokenType.ASSIGN_MOD; - case '^': - return TokenType.ASSIGN_BIT_XOR; - case '&': - return TokenType.ASSIGN_BIT_AND; - // istanbul ignore next - default: - break; // failed - } - } - } - - if (this.index + 1 < this.source.length) { - let ch2 = this.source.charAt(this.index + 1); - if (ch1 === ch2) { - if (this.index + 2 < this.source.length) { - let ch3 = this.source.charAt(this.index + 2); - if (ch1 === '>' && ch3 === '>') { - // 4-character punctuator: >>>= - if (this.index + 3 < this.source.length && this.source.charAt(this.index + 3) === '=') { - return TokenType.ASSIGN_SHR_UNSIGNED; - } - return TokenType.SHR_UNSIGNED; - } - - if (ch1 === '<' && ch3 === '=') { - return TokenType.ASSIGN_SHL; - } - - if (ch1 === '>' && ch3 === '=') { - return TokenType.ASSIGN_SHR; - } - - if (ch1 === '*' && ch3 === '=') { - return TokenType.ASSIGN_EXP; - } - } - // Other 2-character punctuators: ++ -- << >> && || - switch (ch1) { - case '*': - return TokenType.EXP; - case '+': - return TokenType.INC; - case '-': - return TokenType.DEC; - case '<': - return TokenType.SHL; - case '>': - return TokenType.SHR; - case '&': - return TokenType.AND; - case '|': - return TokenType.OR; - // istanbul ignore next - default: - break; // failed - } - } else if (ch1 === '=' && ch2 === '>') { - return TokenType.ARROW; - } - } - - return ONE_CHAR_PUNCTUATOR[ch1.charCodeAt(0)]; - } - - // 7.7 Punctuators - scanPunctuator() { - let startLocation = this.getLocation(); - let start = this.index; - let subType = this.scanPunctuatorHelper(); - this.index += subType.name.length; - return { type: subType, value: subType.name, slice: this.getSlice(start, startLocation) }; - } - - scanHexLiteral(start, startLocation) { - let i = this.index; - while (i < this.source.length) { - let ch = this.source.charAt(i); - let hex = getHexValue(ch); - if (hex === -1) { - break; - } - i++; - } - - if (this.index === i) { - throw this.createILLEGAL(); - } - - if (i < this.source.length && isIdentifierStart(this.source.charCodeAt(i))) { - throw this.createILLEGAL(); - } - - this.index = i; - - let slice = this.getSlice(start, startLocation); - return { type: TokenType.NUMBER, value: parseInt(slice.text.substr(2), 16), slice }; - } - - scanBinaryLiteral(start, startLocation) { - let offset = this.index - start; - - while (this.index < this.source.length) { - let ch = this.source.charAt(this.index); - if (ch !== '0' && ch !== '1') { - break; - } - this.index++; - } - - if (this.index - start <= offset) { - throw this.createILLEGAL(); - } - - if (this.index < this.source.length && (isIdentifierStart(this.source.charCodeAt(this.index)) - || isDecimalDigit(this.source.charCodeAt(this.index)))) { - throw this.createILLEGAL(); - } - - return { - type: TokenType.NUMBER, - value: parseInt(this.getSlice(start, startLocation).text.substr(offset), 2), - slice: this.getSlice(start, startLocation), - octal: false, - noctal: false, - }; - } - - scanOctalLiteral(start, startLocation) { - while (this.index < this.source.length) { - let ch = this.source.charAt(this.index); - if (ch >= '0' && ch <= '7') { - this.index++; - } else if (isIdentifierPart(ch.charCodeAt(0))) { - throw this.createILLEGAL(); - } else { - break; - } - } - - if (this.index - start === 2) { - throw this.createILLEGAL(); - } - - return { - type: TokenType.NUMBER, - value: parseInt(this.getSlice(start, startLocation).text.substr(2), 8), - slice: this.getSlice(start, startLocation), - octal: false, - noctal: false, - }; - } - - scanLegacyOctalLiteral(start, startLocation) { - let isOctal = true; - - while (this.index < this.source.length) { - let ch = this.source.charAt(this.index); - if (ch >= '0' && ch <= '7') { - this.index++; - } else if (ch === '8' || ch === '9') { - isOctal = false; - this.index++; - } else if (isIdentifierPart(ch.charCodeAt(0))) { - throw this.createILLEGAL(); - } else { - break; - } - } - - let slice = this.getSlice(start, startLocation); - if (!isOctal) { - this.eatDecimalLiteralSuffix(); - return { - type: TokenType.NUMBER, - slice, - value: +slice.text, - octal: true, - noctal: !isOctal, - }; - } - - return { - type: TokenType.NUMBER, - slice, - value: parseInt(slice.text.substr(1), 8), - octal: true, - noctal: !isOctal, - }; - } - - scanNumericLiteral() { - let ch = this.source.charAt(this.index); - // assert(ch === "." || "0" <= ch && ch <= "9") - let startLocation = this.getLocation(); - let start = this.index; - - if (ch === '0') { - this.index++; - if (this.index < this.source.length) { - ch = this.source.charAt(this.index); - if (ch === 'x' || ch === 'X') { - this.index++; - return this.scanHexLiteral(start, startLocation); - } else if (ch === 'b' || ch === 'B') { - this.index++; - return this.scanBinaryLiteral(start, startLocation); - } else if (ch === 'o' || ch === 'O') { - this.index++; - return this.scanOctalLiteral(start, startLocation); - } else if (ch >= '0' && ch <= '9') { - return this.scanLegacyOctalLiteral(start, startLocation); - } - } else { - let slice = this.getSlice(start, startLocation); - return { - type: TokenType.NUMBER, - value: +slice.text, - slice, - octal: false, - noctal: false, - }; - } - } else if (ch !== '.') { - // Must be "1".."9" - ch = this.source.charAt(this.index); - while (ch >= '0' && ch <= '9') { - this.index++; - if (this.index === this.source.length) { - let slice = this.getSlice(start, startLocation); - return { - type: TokenType.NUMBER, - value: +slice.text, - slice, - octal: false, - noctal: false, - }; - } - ch = this.source.charAt(this.index); - } - } - - this.eatDecimalLiteralSuffix(); - - if (this.index !== this.source.length && isIdentifierStart(this.source.charCodeAt(this.index))) { - throw this.createILLEGAL(); - } - - let slice = this.getSlice(start, startLocation); - return { - type: TokenType.NUMBER, - value: +slice.text, - slice, - octal: false, - noctal: false, - }; - } - - eatDecimalLiteralSuffix() { - let ch = this.source.charAt(this.index); - if (ch === '.') { - this.index++; - if (this.index === this.source.length) { - return; - } - - ch = this.source.charAt(this.index); - while (ch >= '0' && ch <= '9') { - this.index++; - if (this.index === this.source.length) { - return; - } - ch = this.source.charAt(this.index); - } - } - - // EOF not reached here - if (ch === 'e' || ch === 'E') { - this.index++; - if (this.index === this.source.length) { - throw this.createILLEGAL(); - } - - ch = this.source.charAt(this.index); - if (ch === '+' || ch === '-') { - this.index++; - if (this.index === this.source.length) { - throw this.createILLEGAL(); - } - ch = this.source.charAt(this.index); - } - - if (ch >= '0' && ch <= '9') { - while (ch >= '0' && ch <= '9') { - this.index++; - if (this.index === this.source.length) { - break; - } - ch = this.source.charAt(this.index); - } - } else { - throw this.createILLEGAL(); - } - } - } - - scanStringEscape(str, octal) { - this.index++; - if (this.index === this.source.length) { - throw this.createILLEGAL(); - } - let ch = this.source.charAt(this.index); - if (isLineTerminator(ch.charCodeAt(0))) { - this.index++; - if (ch === '\r' && this.source.charAt(this.index) === '\n') { - this.index++; - } - this.lineStart = this.index; - this.line++; - } else { - switch (ch) { - case 'n': - str += '\n'; - this.index++; - break; - case 'r': - str += '\r'; - this.index++; - break; - case 't': - str += '\t'; - this.index++; - break; - case 'u': - case 'x': { - let unescaped; - this.index++; - if (this.index >= this.source.length) { - throw this.createILLEGAL(); - } - unescaped = ch === 'u' ? this.scanUnicode() : this.scanHexEscape2(); - if (unescaped < 0) { - throw this.createILLEGAL(); - } - str += fromCodePoint(unescaped); - break; - } - case 'b': - str += '\b'; - this.index++; - break; - case 'f': - str += '\f'; - this.index++; - break; - case 'v': - str += '\u000B'; - this.index++; - break; - default: - if (ch >= '0' && ch <= '7') { - let octalStart = this.index; - let octLen = 1; - // 3 digits are only allowed when string starts - // with 0, 1, 2, 3 - if (ch >= '0' && ch <= '3') { - octLen = 0; - } - let code = 0; - while (octLen < 3 && ch >= '0' && ch <= '7') { - this.index++; - if (octLen > 0 || ch !== '0') { - octal = this.source.slice(octalStart, this.index); - } - code *= 8; - code += ch - '0'; - octLen++; - if (this.index === this.source.length) { - throw this.createILLEGAL(); - } - ch = this.source.charAt(this.index); - } - if (code === 0 && octLen === 1 && (ch === '8' || ch === '9')) { - octal = this.source.slice(octalStart, this.index + 1); - } - str += String.fromCharCode(code); - } else if (ch === '8' || ch === '9') { - throw this.createILLEGAL(); - } else { - str += ch; - this.index++; - } - } - } - return [str, octal]; - } - // 7.8.4 String Literals - scanStringLiteral() { - let str = ''; - - let quote = this.source.charAt(this.index); - // assert((quote === "\"" || quote === """), "String literal must starts with a quote") - - let startLocation = this.getLocation(); - let start = this.index; - this.index++; - - let octal = null; - while (this.index < this.source.length) { - let ch = this.source.charAt(this.index); - if (ch === quote) { - this.index++; - return { type: TokenType.STRING, slice: this.getSlice(start, startLocation), str, octal }; - } else if (ch === '\\') { - [str, octal] = this.scanStringEscape(str, octal); - } else if (isLineTerminator(ch.charCodeAt(0))) { - throw this.createILLEGAL(); - } else { - str += ch; - this.index++; - } - } - - throw this.createILLEGAL(); - } - - scanTemplateElement() { - let startLocation = this.getLocation(); - let start = this.index; - this.index++; - while (this.index < this.source.length) { - let ch = this.source.charCodeAt(this.index); - switch (ch) { - case 0x60: { // ` - this.index++; - return { type: TokenType.TEMPLATE, tail: true, slice: this.getSlice(start, startLocation) }; - } - case 0x24: { // $ - if (this.source.charCodeAt(this.index + 1) === 0x7B) { // { - this.index += 2; - return { type: TokenType.TEMPLATE, tail: false, slice: this.getSlice(start, startLocation) }; - } - this.index++; - break; - } - case 0x5C: { // \\ - let octal = this.scanStringEscape('', null)[1]; - if (octal != null) { - throw this.createError(ErrorMessages.NO_OCTALS_IN_TEMPLATES); - } - break; - } - case 0x0D: { // \r - this.line++; - this.index++; - if (this.index < this.source.length && this.source.charAt(this.index) === '\n') { - this.index++; - } - this.lineStart = this.index; - break; - } - case 0x0A: // \r - case 0x2028: - case 0x2029: { - this.line++; - this.index++; - this.lineStart = this.index; - break; - } - default: - this.index++; - } - } - - throw this.createILLEGAL(); - } - - scanRegExp(str) { - let startLocation = this.getLocation(); - let start = this.index; - - let terminated = false; - let classMarker = false; - while (this.index < this.source.length) { - let ch = this.source.charAt(this.index); - if (ch === '\\') { - str += ch; - this.index++; - ch = this.source.charAt(this.index); - // ECMA-262 7.8.5 - if (isLineTerminator(ch.charCodeAt(0))) { - throw this.createError(ErrorMessages.UNTERMINATED_REGEXP); - } - str += ch; - this.index++; - } else if (isLineTerminator(ch.charCodeAt(0))) { - throw this.createError(ErrorMessages.UNTERMINATED_REGEXP); - } else { - if (classMarker) { - if (ch === ']') { - classMarker = false; - } - } else if (ch === '/') { - terminated = true; - str += ch; - this.index++; - break; - } else if (ch === '[') { - classMarker = true; - } - str += ch; - this.index++; - } - } - - if (!terminated) { - throw this.createError(ErrorMessages.UNTERMINATED_REGEXP); - } - - while (this.index < this.source.length) { - let ch = this.source.charAt(this.index); - if (ch === '\\') { - throw this.createError(ErrorMessages.INVALID_REGEXP_FLAGS); - } - if (!isIdentifierPart(ch.charCodeAt(0))) { - break; - } - this.index++; - str += ch; - } - return { type: TokenType.REGEXP, value: str, slice: this.getSlice(start, startLocation) }; - } - - advance() { - let startLocation = this.getLocation(); - - this.lastIndex = this.index; - this.lastLine = this.line; - this.lastLineStart = this.lineStart; - - this.skipComment(); - - this.startIndex = this.index; - this.startLine = this.line; - this.startLineStart = this.lineStart; - - if (this.lastIndex === 0) { - this.lastIndex = this.index; - this.lastLine = this.line; - this.lastLineStart = this.lineStart; - } - - if (this.index >= this.source.length) { - return { type: TokenType.EOS, slice: this.getSlice(this.index, startLocation) }; - } - - let charCode = this.source.charCodeAt(this.index); - - if (charCode < 0x80) { - if (PUNCTUATOR_START[charCode]) { - return this.scanPunctuator(); - } - - if (isIdentifierStart(charCode) || charCode === 0x5C /* backslash (\) */) { - return this.scanIdentifier(); - } - - // Dot (.) U+002E can also start a floating-point number, hence the need - // to check the next character. - if (charCode === 0x2E) { - if (this.index + 1 < this.source.length && isDecimalDigit(this.source.charCodeAt(this.index + 1))) { - return this.scanNumericLiteral(); - } - return this.scanPunctuator(); - } - - // String literal starts with single quote (U+0027) or double quote (U+0022). - if (charCode === 0x27 || charCode === 0x22) { - return this.scanStringLiteral(); - } - - // Template literal starts with back quote (U+0060) - if (charCode === 0x60) { - return this.scanTemplateElement(); - } - - if (charCode /* "0" */ >= 0x30 && charCode <= 0x39 /* "9" */) { - return this.scanNumericLiteral(); - } - - // Slash (/) U+002F can also start a regex. - throw this.createILLEGAL(); - } else { - if (isIdentifierStart(charCode) || charCode >= 0xD800 && charCode <= 0xDBFF) { - return this.scanIdentifier(); - } - - throw this.createILLEGAL(); - } - } - - eof() { - return this.lookahead.type === TokenType.EOS; - } - - lex() { - let prevToken = this.lookahead; - this.lookahead = this.advance(); - this.tokenIndex++; - return prevToken; - } -} diff --git a/docs/dist/shift-parser/unicode.js b/docs/dist/shift-parser/unicode.js deleted file mode 100644 index 27906deb..00000000 --- a/docs/dist/shift-parser/unicode.js +++ /dev/null @@ -1,11 +0,0 @@ -// Generated by scripts/generate-unicode-data.js - -export const whitespaceArray = [5760, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8239, 8287, 12288, 65279]; -export const whitespaceBool = [false, false, false, false, false, false, false, false, false, true, false, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false]; - -export const idStartLargeRegex = /^[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]$/; -export const idStartBool = [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false, false, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false, false, false]; - -export const idContinueLargeRegex = /^[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]$/; -export const idContinueBool = [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, true, true, true, true, true, true, true, true, true, true, false, false, false, false, false, false, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false, false, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false, false, false]; - diff --git a/docs/dist/shift-parser/utils.js b/docs/dist/shift-parser/utils.js deleted file mode 100644 index a5efcb86..00000000 --- a/docs/dist/shift-parser/utils.js +++ /dev/null @@ -1,105 +0,0 @@ -/** - * Copyright 2017 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { whitespaceArray, whitespaceBool, idStartLargeRegex, idStartBool, idContinueLargeRegex, idContinueBool } from './unicode.js'; - - -const strictReservedWords = [ - 'null', - 'true', - 'false', - - 'implements', - 'interface', - 'package', - 'private', - 'protected', - 'public', - 'static', - 'let', - - 'if', - 'in', - 'do', - 'var', - 'for', - 'new', - 'try', - 'this', - 'else', - 'case', - 'void', - 'with', - 'enum', - 'while', - 'break', - 'catch', - 'throw', - 'const', - 'yield', - 'class', - 'super', - 'return', - 'typeof', - 'delete', - 'switch', - 'export', - 'import', - 'default', - 'finally', - 'extends', - 'function', - 'continue', - 'debugger', - 'instanceof', -]; - -export function isStrictModeReservedWord(id) { - return strictReservedWords.indexOf(id) !== -1; -} - -export function isWhiteSpace(ch) { - return ch < 128 ? whitespaceBool[ch] : ch === 0xA0 || ch > 0x167F && whitespaceArray.indexOf(ch) !== -1; -} - -export function isLineTerminator(ch) { - return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029; -} - -export function isIdentifierStart(ch) { - return ch < 128 ? idStartBool[ch] : idStartLargeRegex.test(String.fromCodePoint(ch)); -} - -export function isIdentifierPart(ch) { - return ch < 128 ? idContinueBool[ch] : idContinueLargeRegex.test(String.fromCodePoint(ch)); -} - -export function isDecimalDigit(ch) { - return ch >= 48 && ch <= 57; -} - -export function getHexValue(rune) { - if (rune >= '0' && rune <= '9') { - return rune.charCodeAt(0) - 48; - } - if (rune >= 'a' && rune <= 'f') { - return rune.charCodeAt(0) - 87; - } - if (rune >= 'A' && rune <= 'F') { - return rune.charCodeAt(0) - 55; - } - return -1; -} diff --git a/docs/dist/shift-reducer/adapt.js b/docs/dist/shift-reducer/adapt.js deleted file mode 100644 index 56653486..00000000 --- a/docs/dist/shift-reducer/adapt.js +++ /dev/null @@ -1,418 +0,0 @@ -// Generated by generate-adapt.js -/** - * Copyright 2018 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import * as Shift from '../../_snowpack/pkg/shift-ast.js'; - -export default (fn, reducer) => ({ - __proto__: reducer, - - reduceArrayAssignmentTarget(node, data) { - return fn(super.reduceArrayAssignmentTarget(node, data), node); - }, - - reduceArrayBinding(node, data) { - return fn(super.reduceArrayBinding(node, data), node); - }, - - reduceArrayExpression(node, data) { - return fn(super.reduceArrayExpression(node, data), node); - }, - - reduceArrowExpression(node, data) { - return fn(super.reduceArrowExpression(node, data), node); - }, - - reduceAssignmentExpression(node, data) { - return fn(super.reduceAssignmentExpression(node, data), node); - }, - - reduceAssignmentTargetIdentifier(node, data) { - return fn(super.reduceAssignmentTargetIdentifier(node, data), node); - }, - - reduceAssignmentTargetPropertyIdentifier(node, data) { - return fn(super.reduceAssignmentTargetPropertyIdentifier(node, data), node); - }, - - reduceAssignmentTargetPropertyProperty(node, data) { - return fn(super.reduceAssignmentTargetPropertyProperty(node, data), node); - }, - - reduceAssignmentTargetWithDefault(node, data) { - return fn(super.reduceAssignmentTargetWithDefault(node, data), node); - }, - - reduceAwaitExpression(node, data) { - return fn(super.reduceAwaitExpression(node, data), node); - }, - - reduceBinaryExpression(node, data) { - return fn(super.reduceBinaryExpression(node, data), node); - }, - - reduceBindingIdentifier(node, data) { - return fn(super.reduceBindingIdentifier(node, data), node); - }, - - reduceBindingPropertyIdentifier(node, data) { - return fn(super.reduceBindingPropertyIdentifier(node, data), node); - }, - - reduceBindingPropertyProperty(node, data) { - return fn(super.reduceBindingPropertyProperty(node, data), node); - }, - - reduceBindingWithDefault(node, data) { - return fn(super.reduceBindingWithDefault(node, data), node); - }, - - reduceBlock(node, data) { - return fn(super.reduceBlock(node, data), node); - }, - - reduceBlockStatement(node, data) { - return fn(super.reduceBlockStatement(node, data), node); - }, - - reduceBreakStatement(node, data) { - return fn(super.reduceBreakStatement(node, data), node); - }, - - reduceCallExpression(node, data) { - return fn(super.reduceCallExpression(node, data), node); - }, - - reduceCatchClause(node, data) { - return fn(super.reduceCatchClause(node, data), node); - }, - - reduceClassDeclaration(node, data) { - return fn(super.reduceClassDeclaration(node, data), node); - }, - - reduceClassElement(node, data) { - return fn(super.reduceClassElement(node, data), node); - }, - - reduceClassExpression(node, data) { - return fn(super.reduceClassExpression(node, data), node); - }, - - reduceCompoundAssignmentExpression(node, data) { - return fn(super.reduceCompoundAssignmentExpression(node, data), node); - }, - - reduceComputedMemberAssignmentTarget(node, data) { - return fn(super.reduceComputedMemberAssignmentTarget(node, data), node); - }, - - reduceComputedMemberExpression(node, data) { - return fn(super.reduceComputedMemberExpression(node, data), node); - }, - - reduceComputedPropertyName(node, data) { - return fn(super.reduceComputedPropertyName(node, data), node); - }, - - reduceConditionalExpression(node, data) { - return fn(super.reduceConditionalExpression(node, data), node); - }, - - reduceContinueStatement(node, data) { - return fn(super.reduceContinueStatement(node, data), node); - }, - - reduceDataProperty(node, data) { - return fn(super.reduceDataProperty(node, data), node); - }, - - reduceDebuggerStatement(node, data) { - return fn(super.reduceDebuggerStatement(node, data), node); - }, - - reduceDirective(node, data) { - return fn(super.reduceDirective(node, data), node); - }, - - reduceDoWhileStatement(node, data) { - return fn(super.reduceDoWhileStatement(node, data), node); - }, - - reduceEmptyStatement(node, data) { - return fn(super.reduceEmptyStatement(node, data), node); - }, - - reduceExport(node, data) { - return fn(super.reduceExport(node, data), node); - }, - - reduceExportAllFrom(node, data) { - return fn(super.reduceExportAllFrom(node, data), node); - }, - - reduceExportDefault(node, data) { - return fn(super.reduceExportDefault(node, data), node); - }, - - reduceExportFrom(node, data) { - return fn(super.reduceExportFrom(node, data), node); - }, - - reduceExportFromSpecifier(node, data) { - return fn(super.reduceExportFromSpecifier(node, data), node); - }, - - reduceExportLocalSpecifier(node, data) { - return fn(super.reduceExportLocalSpecifier(node, data), node); - }, - - reduceExportLocals(node, data) { - return fn(super.reduceExportLocals(node, data), node); - }, - - reduceExpressionStatement(node, data) { - return fn(super.reduceExpressionStatement(node, data), node); - }, - - reduceForAwaitStatement(node, data) { - return fn(super.reduceForAwaitStatement(node, data), node); - }, - - reduceForInStatement(node, data) { - return fn(super.reduceForInStatement(node, data), node); - }, - - reduceForOfStatement(node, data) { - return fn(super.reduceForOfStatement(node, data), node); - }, - - reduceForStatement(node, data) { - return fn(super.reduceForStatement(node, data), node); - }, - - reduceFormalParameters(node, data) { - return fn(super.reduceFormalParameters(node, data), node); - }, - - reduceFunctionBody(node, data) { - return fn(super.reduceFunctionBody(node, data), node); - }, - - reduceFunctionDeclaration(node, data) { - return fn(super.reduceFunctionDeclaration(node, data), node); - }, - - reduceFunctionExpression(node, data) { - return fn(super.reduceFunctionExpression(node, data), node); - }, - - reduceGetter(node, data) { - return fn(super.reduceGetter(node, data), node); - }, - - reduceIdentifierExpression(node, data) { - return fn(super.reduceIdentifierExpression(node, data), node); - }, - - reduceIfStatement(node, data) { - return fn(super.reduceIfStatement(node, data), node); - }, - - reduceImport(node, data) { - return fn(super.reduceImport(node, data), node); - }, - - reduceImportNamespace(node, data) { - return fn(super.reduceImportNamespace(node, data), node); - }, - - reduceImportSpecifier(node, data) { - return fn(super.reduceImportSpecifier(node, data), node); - }, - - reduceLabeledStatement(node, data) { - return fn(super.reduceLabeledStatement(node, data), node); - }, - - reduceLiteralBooleanExpression(node, data) { - return fn(super.reduceLiteralBooleanExpression(node, data), node); - }, - - reduceLiteralInfinityExpression(node, data) { - return fn(super.reduceLiteralInfinityExpression(node, data), node); - }, - - reduceLiteralNullExpression(node, data) { - return fn(super.reduceLiteralNullExpression(node, data), node); - }, - - reduceLiteralNumericExpression(node, data) { - return fn(super.reduceLiteralNumericExpression(node, data), node); - }, - - reduceLiteralRegExpExpression(node, data) { - return fn(super.reduceLiteralRegExpExpression(node, data), node); - }, - - reduceLiteralStringExpression(node, data) { - return fn(super.reduceLiteralStringExpression(node, data), node); - }, - - reduceMethod(node, data) { - return fn(super.reduceMethod(node, data), node); - }, - - reduceModule(node, data) { - return fn(super.reduceModule(node, data), node); - }, - - reduceNewExpression(node, data) { - return fn(super.reduceNewExpression(node, data), node); - }, - - reduceNewTargetExpression(node, data) { - return fn(super.reduceNewTargetExpression(node, data), node); - }, - - reduceObjectAssignmentTarget(node, data) { - return fn(super.reduceObjectAssignmentTarget(node, data), node); - }, - - reduceObjectBinding(node, data) { - return fn(super.reduceObjectBinding(node, data), node); - }, - - reduceObjectExpression(node, data) { - return fn(super.reduceObjectExpression(node, data), node); - }, - - reduceReturnStatement(node, data) { - return fn(super.reduceReturnStatement(node, data), node); - }, - - reduceScript(node, data) { - return fn(super.reduceScript(node, data), node); - }, - - reduceSetter(node, data) { - return fn(super.reduceSetter(node, data), node); - }, - - reduceShorthandProperty(node, data) { - return fn(super.reduceShorthandProperty(node, data), node); - }, - - reduceSpreadElement(node, data) { - return fn(super.reduceSpreadElement(node, data), node); - }, - - reduceSpreadProperty(node, data) { - return fn(super.reduceSpreadProperty(node, data), node); - }, - - reduceStaticMemberAssignmentTarget(node, data) { - return fn(super.reduceStaticMemberAssignmentTarget(node, data), node); - }, - - reduceStaticMemberExpression(node, data) { - return fn(super.reduceStaticMemberExpression(node, data), node); - }, - - reduceStaticPropertyName(node, data) { - return fn(super.reduceStaticPropertyName(node, data), node); - }, - - reduceSuper(node, data) { - return fn(super.reduceSuper(node, data), node); - }, - - reduceSwitchCase(node, data) { - return fn(super.reduceSwitchCase(node, data), node); - }, - - reduceSwitchDefault(node, data) { - return fn(super.reduceSwitchDefault(node, data), node); - }, - - reduceSwitchStatement(node, data) { - return fn(super.reduceSwitchStatement(node, data), node); - }, - - reduceSwitchStatementWithDefault(node, data) { - return fn(super.reduceSwitchStatementWithDefault(node, data), node); - }, - - reduceTemplateElement(node, data) { - return fn(super.reduceTemplateElement(node, data), node); - }, - - reduceTemplateExpression(node, data) { - return fn(super.reduceTemplateExpression(node, data), node); - }, - - reduceThisExpression(node, data) { - return fn(super.reduceThisExpression(node, data), node); - }, - - reduceThrowStatement(node, data) { - return fn(super.reduceThrowStatement(node, data), node); - }, - - reduceTryCatchStatement(node, data) { - return fn(super.reduceTryCatchStatement(node, data), node); - }, - - reduceTryFinallyStatement(node, data) { - return fn(super.reduceTryFinallyStatement(node, data), node); - }, - - reduceUnaryExpression(node, data) { - return fn(super.reduceUnaryExpression(node, data), node); - }, - - reduceUpdateExpression(node, data) { - return fn(super.reduceUpdateExpression(node, data), node); - }, - - reduceVariableDeclaration(node, data) { - return fn(super.reduceVariableDeclaration(node, data), node); - }, - - reduceVariableDeclarationStatement(node, data) { - return fn(super.reduceVariableDeclarationStatement(node, data), node); - }, - - reduceVariableDeclarator(node, data) { - return fn(super.reduceVariableDeclarator(node, data), node); - }, - - reduceWhileStatement(node, data) { - return fn(super.reduceWhileStatement(node, data), node); - }, - - reduceWithStatement(node, data) { - return fn(super.reduceWithStatement(node, data), node); - }, - - reduceYieldExpression(node, data) { - return fn(super.reduceYieldExpression(node, data), node); - }, - - reduceYieldGeneratorExpression(node, data) { - return fn(super.reduceYieldGeneratorExpression(node, data), node); - }, -}); diff --git a/docs/dist/shift-reducer/clone-reducer.js b/docs/dist/shift-reducer/clone-reducer.js deleted file mode 100644 index b248ae0c..00000000 --- a/docs/dist/shift-reducer/clone-reducer.js +++ /dev/null @@ -1,416 +0,0 @@ -// Generated by generate-clone-reducer.js -/** - * Copyright 2018 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import * as Shift from '../../_snowpack/pkg/shift-ast.js'; - -export default class CloneReducer { - reduceArrayAssignmentTarget(node, { elements, rest }) { - return new Shift.ArrayAssignmentTarget({ elements, rest }); - } - - reduceArrayBinding(node, { elements, rest }) { - return new Shift.ArrayBinding({ elements, rest }); - } - - reduceArrayExpression(node, { elements }) { - return new Shift.ArrayExpression({ elements }); - } - - reduceArrowExpression(node, { params, body }) { - return new Shift.ArrowExpression({ isAsync: node.isAsync, params, body }); - } - - reduceAssignmentExpression(node, { binding, expression }) { - return new Shift.AssignmentExpression({ binding, expression }); - } - - reduceAssignmentTargetIdentifier(node) { - return new Shift.AssignmentTargetIdentifier({ name: node.name }); - } - - reduceAssignmentTargetPropertyIdentifier(node, { binding, init }) { - return new Shift.AssignmentTargetPropertyIdentifier({ binding, init }); - } - - reduceAssignmentTargetPropertyProperty(node, { name, binding }) { - return new Shift.AssignmentTargetPropertyProperty({ name, binding }); - } - - reduceAssignmentTargetWithDefault(node, { binding, init }) { - return new Shift.AssignmentTargetWithDefault({ binding, init }); - } - - reduceAwaitExpression(node, { expression }) { - return new Shift.AwaitExpression({ expression }); - } - - reduceBinaryExpression(node, { left, right }) { - return new Shift.BinaryExpression({ left, operator: node.operator, right }); - } - - reduceBindingIdentifier(node) { - return new Shift.BindingIdentifier({ name: node.name }); - } - - reduceBindingPropertyIdentifier(node, { binding, init }) { - return new Shift.BindingPropertyIdentifier({ binding, init }); - } - - reduceBindingPropertyProperty(node, { name, binding }) { - return new Shift.BindingPropertyProperty({ name, binding }); - } - - reduceBindingWithDefault(node, { binding, init }) { - return new Shift.BindingWithDefault({ binding, init }); - } - - reduceBlock(node, { statements }) { - return new Shift.Block({ statements }); - } - - reduceBlockStatement(node, { block }) { - return new Shift.BlockStatement({ block }); - } - - reduceBreakStatement(node) { - return new Shift.BreakStatement({ label: node.label }); - } - - reduceCallExpression(node, { callee, arguments: _arguments }) { - return new Shift.CallExpression({ callee, arguments: _arguments }); - } - - reduceCatchClause(node, { binding, body }) { - return new Shift.CatchClause({ binding, body }); - } - - reduceClassDeclaration(node, { name, super: _super, elements }) { - return new Shift.ClassDeclaration({ name, super: _super, elements }); - } - - reduceClassElement(node, { method }) { - return new Shift.ClassElement({ isStatic: node.isStatic, method }); - } - - reduceClassExpression(node, { name, super: _super, elements }) { - return new Shift.ClassExpression({ name, super: _super, elements }); - } - - reduceCompoundAssignmentExpression(node, { binding, expression }) { - return new Shift.CompoundAssignmentExpression({ binding, operator: node.operator, expression }); - } - - reduceComputedMemberAssignmentTarget(node, { object, expression }) { - return new Shift.ComputedMemberAssignmentTarget({ object, expression }); - } - - reduceComputedMemberExpression(node, { object, expression }) { - return new Shift.ComputedMemberExpression({ object, expression }); - } - - reduceComputedPropertyName(node, { expression }) { - return new Shift.ComputedPropertyName({ expression }); - } - - reduceConditionalExpression(node, { test, consequent, alternate }) { - return new Shift.ConditionalExpression({ test, consequent, alternate }); - } - - reduceContinueStatement(node) { - return new Shift.ContinueStatement({ label: node.label }); - } - - reduceDataProperty(node, { name, expression }) { - return new Shift.DataProperty({ name, expression }); - } - - reduceDebuggerStatement(node) { - return new Shift.DebuggerStatement; - } - - reduceDirective(node) { - return new Shift.Directive({ rawValue: node.rawValue }); - } - - reduceDoWhileStatement(node, { body, test }) { - return new Shift.DoWhileStatement({ body, test }); - } - - reduceEmptyStatement(node) { - return new Shift.EmptyStatement; - } - - reduceExport(node, { declaration }) { - return new Shift.Export({ declaration }); - } - - reduceExportAllFrom(node) { - return new Shift.ExportAllFrom({ moduleSpecifier: node.moduleSpecifier }); - } - - reduceExportDefault(node, { body }) { - return new Shift.ExportDefault({ body }); - } - - reduceExportFrom(node, { namedExports }) { - return new Shift.ExportFrom({ namedExports, moduleSpecifier: node.moduleSpecifier }); - } - - reduceExportFromSpecifier(node) { - return new Shift.ExportFromSpecifier({ name: node.name, exportedName: node.exportedName }); - } - - reduceExportLocalSpecifier(node, { name }) { - return new Shift.ExportLocalSpecifier({ name, exportedName: node.exportedName }); - } - - reduceExportLocals(node, { namedExports }) { - return new Shift.ExportLocals({ namedExports }); - } - - reduceExpressionStatement(node, { expression }) { - return new Shift.ExpressionStatement({ expression }); - } - - reduceForAwaitStatement(node, { left, right, body }) { - return new Shift.ForAwaitStatement({ left, right, body }); - } - - reduceForInStatement(node, { left, right, body }) { - return new Shift.ForInStatement({ left, right, body }); - } - - reduceForOfStatement(node, { left, right, body }) { - return new Shift.ForOfStatement({ left, right, body }); - } - - reduceForStatement(node, { init, test, update, body }) { - return new Shift.ForStatement({ init, test, update, body }); - } - - reduceFormalParameters(node, { items, rest }) { - return new Shift.FormalParameters({ items, rest }); - } - - reduceFunctionBody(node, { directives, statements }) { - return new Shift.FunctionBody({ directives, statements }); - } - - reduceFunctionDeclaration(node, { name, params, body }) { - return new Shift.FunctionDeclaration({ isAsync: node.isAsync, isGenerator: node.isGenerator, name, params, body }); - } - - reduceFunctionExpression(node, { name, params, body }) { - return new Shift.FunctionExpression({ isAsync: node.isAsync, isGenerator: node.isGenerator, name, params, body }); - } - - reduceGetter(node, { name, body }) { - return new Shift.Getter({ name, body }); - } - - reduceIdentifierExpression(node) { - return new Shift.IdentifierExpression({ name: node.name }); - } - - reduceIfStatement(node, { test, consequent, alternate }) { - return new Shift.IfStatement({ test, consequent, alternate }); - } - - reduceImport(node, { defaultBinding, namedImports }) { - return new Shift.Import({ defaultBinding, namedImports, moduleSpecifier: node.moduleSpecifier }); - } - - reduceImportNamespace(node, { defaultBinding, namespaceBinding }) { - return new Shift.ImportNamespace({ defaultBinding, namespaceBinding, moduleSpecifier: node.moduleSpecifier }); - } - - reduceImportSpecifier(node, { binding }) { - return new Shift.ImportSpecifier({ name: node.name, binding }); - } - - reduceLabeledStatement(node, { body }) { - return new Shift.LabeledStatement({ label: node.label, body }); - } - - reduceLiteralBooleanExpression(node) { - return new Shift.LiteralBooleanExpression({ value: node.value }); - } - - reduceLiteralInfinityExpression(node) { - return new Shift.LiteralInfinityExpression; - } - - reduceLiteralNullExpression(node) { - return new Shift.LiteralNullExpression; - } - - reduceLiteralNumericExpression(node) { - return new Shift.LiteralNumericExpression({ value: node.value }); - } - - reduceLiteralRegExpExpression(node) { - return new Shift.LiteralRegExpExpression({ pattern: node.pattern, global: node.global, ignoreCase: node.ignoreCase, multiLine: node.multiLine, dotAll: node.dotAll, unicode: node.unicode, sticky: node.sticky }); - } - - reduceLiteralStringExpression(node) { - return new Shift.LiteralStringExpression({ value: node.value }); - } - - reduceMethod(node, { name, params, body }) { - return new Shift.Method({ isAsync: node.isAsync, isGenerator: node.isGenerator, name, params, body }); - } - - reduceModule(node, { directives, items }) { - return new Shift.Module({ directives, items }); - } - - reduceNewExpression(node, { callee, arguments: _arguments }) { - return new Shift.NewExpression({ callee, arguments: _arguments }); - } - - reduceNewTargetExpression(node) { - return new Shift.NewTargetExpression; - } - - reduceObjectAssignmentTarget(node, { properties, rest }) { - return new Shift.ObjectAssignmentTarget({ properties, rest }); - } - - reduceObjectBinding(node, { properties, rest }) { - return new Shift.ObjectBinding({ properties, rest }); - } - - reduceObjectExpression(node, { properties }) { - return new Shift.ObjectExpression({ properties }); - } - - reduceReturnStatement(node, { expression }) { - return new Shift.ReturnStatement({ expression }); - } - - reduceScript(node, { directives, statements }) { - return new Shift.Script({ directives, statements }); - } - - reduceSetter(node, { name, param, body }) { - return new Shift.Setter({ name, param, body }); - } - - reduceShorthandProperty(node, { name }) { - return new Shift.ShorthandProperty({ name }); - } - - reduceSpreadElement(node, { expression }) { - return new Shift.SpreadElement({ expression }); - } - - reduceSpreadProperty(node, { expression }) { - return new Shift.SpreadProperty({ expression }); - } - - reduceStaticMemberAssignmentTarget(node, { object }) { - return new Shift.StaticMemberAssignmentTarget({ object, property: node.property }); - } - - reduceStaticMemberExpression(node, { object }) { - return new Shift.StaticMemberExpression({ object, property: node.property }); - } - - reduceStaticPropertyName(node) { - return new Shift.StaticPropertyName({ value: node.value }); - } - - reduceSuper(node) { - return new Shift.Super; - } - - reduceSwitchCase(node, { test, consequent }) { - return new Shift.SwitchCase({ test, consequent }); - } - - reduceSwitchDefault(node, { consequent }) { - return new Shift.SwitchDefault({ consequent }); - } - - reduceSwitchStatement(node, { discriminant, cases }) { - return new Shift.SwitchStatement({ discriminant, cases }); - } - - reduceSwitchStatementWithDefault(node, { discriminant, preDefaultCases, defaultCase, postDefaultCases }) { - return new Shift.SwitchStatementWithDefault({ discriminant, preDefaultCases, defaultCase, postDefaultCases }); - } - - reduceTemplateElement(node) { - return new Shift.TemplateElement({ rawValue: node.rawValue }); - } - - reduceTemplateExpression(node, { tag, elements }) { - return new Shift.TemplateExpression({ tag, elements }); - } - - reduceThisExpression(node) { - return new Shift.ThisExpression; - } - - reduceThrowStatement(node, { expression }) { - return new Shift.ThrowStatement({ expression }); - } - - reduceTryCatchStatement(node, { body, catchClause }) { - return new Shift.TryCatchStatement({ body, catchClause }); - } - - reduceTryFinallyStatement(node, { body, catchClause, finalizer }) { - return new Shift.TryFinallyStatement({ body, catchClause, finalizer }); - } - - reduceUnaryExpression(node, { operand }) { - return new Shift.UnaryExpression({ operator: node.operator, operand }); - } - - reduceUpdateExpression(node, { operand }) { - return new Shift.UpdateExpression({ isPrefix: node.isPrefix, operator: node.operator, operand }); - } - - reduceVariableDeclaration(node, { declarators }) { - return new Shift.VariableDeclaration({ kind: node.kind, declarators }); - } - - reduceVariableDeclarationStatement(node, { declaration }) { - return new Shift.VariableDeclarationStatement({ declaration }); - } - - reduceVariableDeclarator(node, { binding, init }) { - return new Shift.VariableDeclarator({ binding, init }); - } - - reduceWhileStatement(node, { test, body }) { - return new Shift.WhileStatement({ test, body }); - } - - reduceWithStatement(node, { object, body }) { - return new Shift.WithStatement({ object, body }); - } - - reduceYieldExpression(node, { expression }) { - return new Shift.YieldExpression({ expression }); - } - - reduceYieldGeneratorExpression(node, { expression }) { - return new Shift.YieldGeneratorExpression({ expression }); - } -} diff --git a/docs/dist/shift-reducer/director.js b/docs/dist/shift-reducer/director.js deleted file mode 100644 index c9e4b038..00000000 --- a/docs/dist/shift-reducer/director.js +++ /dev/null @@ -1,418 +0,0 @@ -// Generated by generate-director.js -/** - * Copyright 2018 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -const director = { - ArrayAssignmentTarget(reducer, node) { - return reducer.reduceArrayAssignmentTarget(node, { elements: node.elements.map(v => v && this[v.type](reducer, v)), rest: node.rest && this[node.rest.type](reducer, node.rest) }); - }, - - ArrayBinding(reducer, node) { - return reducer.reduceArrayBinding(node, { elements: node.elements.map(v => v && this[v.type](reducer, v)), rest: node.rest && this[node.rest.type](reducer, node.rest) }); - }, - - ArrayExpression(reducer, node) { - return reducer.reduceArrayExpression(node, { elements: node.elements.map(v => v && this[v.type](reducer, v)) }); - }, - - ArrowExpression(reducer, node) { - return reducer.reduceArrowExpression(node, { params: this.FormalParameters(reducer, node.params), body: this[node.body.type](reducer, node.body) }); - }, - - AssignmentExpression(reducer, node) { - return reducer.reduceAssignmentExpression(node, { binding: this[node.binding.type](reducer, node.binding), expression: this[node.expression.type](reducer, node.expression) }); - }, - - AssignmentTargetIdentifier(reducer, node) { - return reducer.reduceAssignmentTargetIdentifier(node); - }, - - AssignmentTargetPropertyIdentifier(reducer, node) { - return reducer.reduceAssignmentTargetPropertyIdentifier(node, { binding: this.AssignmentTargetIdentifier(reducer, node.binding), init: node.init && this[node.init.type](reducer, node.init) }); - }, - - AssignmentTargetPropertyProperty(reducer, node) { - return reducer.reduceAssignmentTargetPropertyProperty(node, { name: this[node.name.type](reducer, node.name), binding: this[node.binding.type](reducer, node.binding) }); - }, - - AssignmentTargetWithDefault(reducer, node) { - return reducer.reduceAssignmentTargetWithDefault(node, { binding: this[node.binding.type](reducer, node.binding), init: this[node.init.type](reducer, node.init) }); - }, - - AwaitExpression(reducer, node) { - return reducer.reduceAwaitExpression(node, { expression: this[node.expression.type](reducer, node.expression) }); - }, - - BinaryExpression(reducer, node) { - return reducer.reduceBinaryExpression(node, { left: this[node.left.type](reducer, node.left), right: this[node.right.type](reducer, node.right) }); - }, - - BindingIdentifier(reducer, node) { - return reducer.reduceBindingIdentifier(node); - }, - - BindingPropertyIdentifier(reducer, node) { - return reducer.reduceBindingPropertyIdentifier(node, { binding: this.BindingIdentifier(reducer, node.binding), init: node.init && this[node.init.type](reducer, node.init) }); - }, - - BindingPropertyProperty(reducer, node) { - return reducer.reduceBindingPropertyProperty(node, { name: this[node.name.type](reducer, node.name), binding: this[node.binding.type](reducer, node.binding) }); - }, - - BindingWithDefault(reducer, node) { - return reducer.reduceBindingWithDefault(node, { binding: this[node.binding.type](reducer, node.binding), init: this[node.init.type](reducer, node.init) }); - }, - - Block(reducer, node) { - return reducer.reduceBlock(node, { statements: node.statements.map(v => this[v.type](reducer, v)) }); - }, - - BlockStatement(reducer, node) { - return reducer.reduceBlockStatement(node, { block: this.Block(reducer, node.block) }); - }, - - BreakStatement(reducer, node) { - return reducer.reduceBreakStatement(node); - }, - - CallExpression(reducer, node) { - return reducer.reduceCallExpression(node, { callee: this[node.callee.type](reducer, node.callee), arguments: node.arguments.map(v => this[v.type](reducer, v)) }); - }, - - CatchClause(reducer, node) { - return reducer.reduceCatchClause(node, { binding: this[node.binding.type](reducer, node.binding), body: this.Block(reducer, node.body) }); - }, - - ClassDeclaration(reducer, node) { - return reducer.reduceClassDeclaration(node, { name: this.BindingIdentifier(reducer, node.name), super: node.super && this[node.super.type](reducer, node.super), elements: node.elements.map(v => this.ClassElement(reducer, v)) }); - }, - - ClassElement(reducer, node) { - return reducer.reduceClassElement(node, { method: this[node.method.type](reducer, node.method) }); - }, - - ClassExpression(reducer, node) { - return reducer.reduceClassExpression(node, { name: node.name && this.BindingIdentifier(reducer, node.name), super: node.super && this[node.super.type](reducer, node.super), elements: node.elements.map(v => this.ClassElement(reducer, v)) }); - }, - - CompoundAssignmentExpression(reducer, node) { - return reducer.reduceCompoundAssignmentExpression(node, { binding: this[node.binding.type](reducer, node.binding), expression: this[node.expression.type](reducer, node.expression) }); - }, - - ComputedMemberAssignmentTarget(reducer, node) { - return reducer.reduceComputedMemberAssignmentTarget(node, { object: this[node.object.type](reducer, node.object), expression: this[node.expression.type](reducer, node.expression) }); - }, - - ComputedMemberExpression(reducer, node) { - return reducer.reduceComputedMemberExpression(node, { object: this[node.object.type](reducer, node.object), expression: this[node.expression.type](reducer, node.expression) }); - }, - - ComputedPropertyName(reducer, node) { - return reducer.reduceComputedPropertyName(node, { expression: this[node.expression.type](reducer, node.expression) }); - }, - - ConditionalExpression(reducer, node) { - return reducer.reduceConditionalExpression(node, { test: this[node.test.type](reducer, node.test), consequent: this[node.consequent.type](reducer, node.consequent), alternate: this[node.alternate.type](reducer, node.alternate) }); - }, - - ContinueStatement(reducer, node) { - return reducer.reduceContinueStatement(node); - }, - - DataProperty(reducer, node) { - return reducer.reduceDataProperty(node, { name: this[node.name.type](reducer, node.name), expression: this[node.expression.type](reducer, node.expression) }); - }, - - DebuggerStatement(reducer, node) { - return reducer.reduceDebuggerStatement(node); - }, - - Directive(reducer, node) { - return reducer.reduceDirective(node); - }, - - DoWhileStatement(reducer, node) { - return reducer.reduceDoWhileStatement(node, { body: this[node.body.type](reducer, node.body), test: this[node.test.type](reducer, node.test) }); - }, - - EmptyStatement(reducer, node) { - return reducer.reduceEmptyStatement(node); - }, - - Export(reducer, node) { - return reducer.reduceExport(node, { declaration: this[node.declaration.type](reducer, node.declaration) }); - }, - - ExportAllFrom(reducer, node) { - return reducer.reduceExportAllFrom(node); - }, - - ExportDefault(reducer, node) { - return reducer.reduceExportDefault(node, { body: this[node.body.type](reducer, node.body) }); - }, - - ExportFrom(reducer, node) { - return reducer.reduceExportFrom(node, { namedExports: node.namedExports.map(v => this.ExportFromSpecifier(reducer, v)) }); - }, - - ExportFromSpecifier(reducer, node) { - return reducer.reduceExportFromSpecifier(node); - }, - - ExportLocalSpecifier(reducer, node) { - return reducer.reduceExportLocalSpecifier(node, { name: this.IdentifierExpression(reducer, node.name) }); - }, - - ExportLocals(reducer, node) { - return reducer.reduceExportLocals(node, { namedExports: node.namedExports.map(v => this.ExportLocalSpecifier(reducer, v)) }); - }, - - ExpressionStatement(reducer, node) { - return reducer.reduceExpressionStatement(node, { expression: this[node.expression.type](reducer, node.expression) }); - }, - - ForAwaitStatement(reducer, node) { - return reducer.reduceForAwaitStatement(node, { left: this[node.left.type](reducer, node.left), right: this[node.right.type](reducer, node.right), body: this[node.body.type](reducer, node.body) }); - }, - - ForInStatement(reducer, node) { - return reducer.reduceForInStatement(node, { left: this[node.left.type](reducer, node.left), right: this[node.right.type](reducer, node.right), body: this[node.body.type](reducer, node.body) }); - }, - - ForOfStatement(reducer, node) { - return reducer.reduceForOfStatement(node, { left: this[node.left.type](reducer, node.left), right: this[node.right.type](reducer, node.right), body: this[node.body.type](reducer, node.body) }); - }, - - ForStatement(reducer, node) { - return reducer.reduceForStatement(node, { init: node.init && this[node.init.type](reducer, node.init), test: node.test && this[node.test.type](reducer, node.test), update: node.update && this[node.update.type](reducer, node.update), body: this[node.body.type](reducer, node.body) }); - }, - - FormalParameters(reducer, node) { - return reducer.reduceFormalParameters(node, { items: node.items.map(v => this[v.type](reducer, v)), rest: node.rest && this[node.rest.type](reducer, node.rest) }); - }, - - FunctionBody(reducer, node) { - return reducer.reduceFunctionBody(node, { directives: node.directives.map(v => this.Directive(reducer, v)), statements: node.statements.map(v => this[v.type](reducer, v)) }); - }, - - FunctionDeclaration(reducer, node) { - return reducer.reduceFunctionDeclaration(node, { name: this.BindingIdentifier(reducer, node.name), params: this.FormalParameters(reducer, node.params), body: this.FunctionBody(reducer, node.body) }); - }, - - FunctionExpression(reducer, node) { - return reducer.reduceFunctionExpression(node, { name: node.name && this.BindingIdentifier(reducer, node.name), params: this.FormalParameters(reducer, node.params), body: this.FunctionBody(reducer, node.body) }); - }, - - Getter(reducer, node) { - return reducer.reduceGetter(node, { name: this[node.name.type](reducer, node.name), body: this.FunctionBody(reducer, node.body) }); - }, - - IdentifierExpression(reducer, node) { - return reducer.reduceIdentifierExpression(node); - }, - - IfStatement(reducer, node) { - return reducer.reduceIfStatement(node, { test: this[node.test.type](reducer, node.test), consequent: this[node.consequent.type](reducer, node.consequent), alternate: node.alternate && this[node.alternate.type](reducer, node.alternate) }); - }, - - Import(reducer, node) { - return reducer.reduceImport(node, { defaultBinding: node.defaultBinding && this.BindingIdentifier(reducer, node.defaultBinding), namedImports: node.namedImports.map(v => this.ImportSpecifier(reducer, v)) }); - }, - - ImportNamespace(reducer, node) { - return reducer.reduceImportNamespace(node, { defaultBinding: node.defaultBinding && this.BindingIdentifier(reducer, node.defaultBinding), namespaceBinding: this.BindingIdentifier(reducer, node.namespaceBinding) }); - }, - - ImportSpecifier(reducer, node) { - return reducer.reduceImportSpecifier(node, { binding: this.BindingIdentifier(reducer, node.binding) }); - }, - - LabeledStatement(reducer, node) { - return reducer.reduceLabeledStatement(node, { body: this[node.body.type](reducer, node.body) }); - }, - - LiteralBooleanExpression(reducer, node) { - return reducer.reduceLiteralBooleanExpression(node); - }, - - LiteralInfinityExpression(reducer, node) { - return reducer.reduceLiteralInfinityExpression(node); - }, - - LiteralNullExpression(reducer, node) { - return reducer.reduceLiteralNullExpression(node); - }, - - LiteralNumericExpression(reducer, node) { - return reducer.reduceLiteralNumericExpression(node); - }, - - LiteralRegExpExpression(reducer, node) { - return reducer.reduceLiteralRegExpExpression(node); - }, - - LiteralStringExpression(reducer, node) { - return reducer.reduceLiteralStringExpression(node); - }, - - Method(reducer, node) { - return reducer.reduceMethod(node, { name: this[node.name.type](reducer, node.name), params: this.FormalParameters(reducer, node.params), body: this.FunctionBody(reducer, node.body) }); - }, - - Module(reducer, node) { - return reducer.reduceModule(node, { directives: node.directives.map(v => this.Directive(reducer, v)), items: node.items.map(v => this[v.type](reducer, v)) }); - }, - - NewExpression(reducer, node) { - return reducer.reduceNewExpression(node, { callee: this[node.callee.type](reducer, node.callee), arguments: node.arguments.map(v => this[v.type](reducer, v)) }); - }, - - NewTargetExpression(reducer, node) { - return reducer.reduceNewTargetExpression(node); - }, - - ObjectAssignmentTarget(reducer, node) { - return reducer.reduceObjectAssignmentTarget(node, { properties: node.properties.map(v => this[v.type](reducer, v)), rest: node.rest && this[node.rest.type](reducer, node.rest) }); - }, - - ObjectBinding(reducer, node) { - return reducer.reduceObjectBinding(node, { properties: node.properties.map(v => this[v.type](reducer, v)), rest: node.rest && this[node.rest.type](reducer, node.rest) }); - }, - - ObjectExpression(reducer, node) { - return reducer.reduceObjectExpression(node, { properties: node.properties.map(v => this[v.type](reducer, v)) }); - }, - - ReturnStatement(reducer, node) { - return reducer.reduceReturnStatement(node, { expression: node.expression && this[node.expression.type](reducer, node.expression) }); - }, - - Script(reducer, node) { - return reducer.reduceScript(node, { directives: node.directives.map(v => this.Directive(reducer, v)), statements: node.statements.map(v => this[v.type](reducer, v)) }); - }, - - Setter(reducer, node) { - return reducer.reduceSetter(node, { name: this[node.name.type](reducer, node.name), param: this[node.param.type](reducer, node.param), body: this.FunctionBody(reducer, node.body) }); - }, - - ShorthandProperty(reducer, node) { - return reducer.reduceShorthandProperty(node, { name: this.IdentifierExpression(reducer, node.name) }); - }, - - SpreadElement(reducer, node) { - return reducer.reduceSpreadElement(node, { expression: this[node.expression.type](reducer, node.expression) }); - }, - - SpreadProperty(reducer, node) { - return reducer.reduceSpreadProperty(node, { expression: this[node.expression.type](reducer, node.expression) }); - }, - - StaticMemberAssignmentTarget(reducer, node) { - return reducer.reduceStaticMemberAssignmentTarget(node, { object: this[node.object.type](reducer, node.object) }); - }, - - StaticMemberExpression(reducer, node) { - return reducer.reduceStaticMemberExpression(node, { object: this[node.object.type](reducer, node.object) }); - }, - - StaticPropertyName(reducer, node) { - return reducer.reduceStaticPropertyName(node); - }, - - Super(reducer, node) { - return reducer.reduceSuper(node); - }, - - SwitchCase(reducer, node) { - return reducer.reduceSwitchCase(node, { test: this[node.test.type](reducer, node.test), consequent: node.consequent.map(v => this[v.type](reducer, v)) }); - }, - - SwitchDefault(reducer, node) { - return reducer.reduceSwitchDefault(node, { consequent: node.consequent.map(v => this[v.type](reducer, v)) }); - }, - - SwitchStatement(reducer, node) { - return reducer.reduceSwitchStatement(node, { discriminant: this[node.discriminant.type](reducer, node.discriminant), cases: node.cases.map(v => this.SwitchCase(reducer, v)) }); - }, - - SwitchStatementWithDefault(reducer, node) { - return reducer.reduceSwitchStatementWithDefault(node, { discriminant: this[node.discriminant.type](reducer, node.discriminant), preDefaultCases: node.preDefaultCases.map(v => this.SwitchCase(reducer, v)), defaultCase: this.SwitchDefault(reducer, node.defaultCase), postDefaultCases: node.postDefaultCases.map(v => this.SwitchCase(reducer, v)) }); - }, - - TemplateElement(reducer, node) { - return reducer.reduceTemplateElement(node); - }, - - TemplateExpression(reducer, node) { - return reducer.reduceTemplateExpression(node, { tag: node.tag && this[node.tag.type](reducer, node.tag), elements: node.elements.map(v => this[v.type](reducer, v)) }); - }, - - ThisExpression(reducer, node) { - return reducer.reduceThisExpression(node); - }, - - ThrowStatement(reducer, node) { - return reducer.reduceThrowStatement(node, { expression: this[node.expression.type](reducer, node.expression) }); - }, - - TryCatchStatement(reducer, node) { - return reducer.reduceTryCatchStatement(node, { body: this.Block(reducer, node.body), catchClause: this.CatchClause(reducer, node.catchClause) }); - }, - - TryFinallyStatement(reducer, node) { - return reducer.reduceTryFinallyStatement(node, { body: this.Block(reducer, node.body), catchClause: node.catchClause && this.CatchClause(reducer, node.catchClause), finalizer: this.Block(reducer, node.finalizer) }); - }, - - UnaryExpression(reducer, node) { - return reducer.reduceUnaryExpression(node, { operand: this[node.operand.type](reducer, node.operand) }); - }, - - UpdateExpression(reducer, node) { - return reducer.reduceUpdateExpression(node, { operand: this[node.operand.type](reducer, node.operand) }); - }, - - VariableDeclaration(reducer, node) { - return reducer.reduceVariableDeclaration(node, { declarators: node.declarators.map(v => this.VariableDeclarator(reducer, v)) }); - }, - - VariableDeclarationStatement(reducer, node) { - return reducer.reduceVariableDeclarationStatement(node, { declaration: this.VariableDeclaration(reducer, node.declaration) }); - }, - - VariableDeclarator(reducer, node) { - return reducer.reduceVariableDeclarator(node, { binding: this[node.binding.type](reducer, node.binding), init: node.init && this[node.init.type](reducer, node.init) }); - }, - - WhileStatement(reducer, node) { - return reducer.reduceWhileStatement(node, { test: this[node.test.type](reducer, node.test), body: this[node.body.type](reducer, node.body) }); - }, - - WithStatement(reducer, node) { - return reducer.reduceWithStatement(node, { object: this[node.object.type](reducer, node.object), body: this[node.body.type](reducer, node.body) }); - }, - - YieldExpression(reducer, node) { - return reducer.reduceYieldExpression(node, { expression: node.expression && this[node.expression.type](reducer, node.expression) }); - }, - - YieldGeneratorExpression(reducer, node) { - return reducer.reduceYieldGeneratorExpression(node, { expression: this[node.expression.type](reducer, node.expression) }); - }, -}; - -export function reduce(reducer, node) { - return director[node.type](reducer, node); -} diff --git a/docs/dist/shift-reducer/index.js b/docs/dist/shift-reducer/index.js deleted file mode 100644 index 2a97b980..00000000 --- a/docs/dist/shift-reducer/index.js +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2018 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export { reduce, reduce as default } from './director.js'; -export { thunkedReduce } from './thunked-director.js'; -export { default as thunkify } from './thunkify.js'; -export { default as thunkifyClass } from './thunkify-class.js'; -export { default as memoize } from './memoize.js'; -export { default as CloneReducer } from './clone-reducer.js'; -export { default as LazyCloneReducer } from './lazy-clone-reducer.js'; -export { default as MonoidalReducer } from './monoidal-reducer.js'; -export { default as ThunkedMonoidalReducer } from './thunked-monoidal-reducer.js'; -export { default as adapt } from './adapt.js'; -export { PlusReducer, ThunkedPlusReducer, ConcatReducer, ThunkedConcatReducer, AndReducer, ThunkedAndReducer, OrReducer, ThunkedOrReducer } from './reducers.js'; diff --git a/docs/dist/shift-reducer/lazy-clone-reducer.js b/docs/dist/shift-reducer/lazy-clone-reducer.js deleted file mode 100644 index 1014b347..00000000 --- a/docs/dist/shift-reducer/lazy-clone-reducer.js +++ /dev/null @@ -1,650 +0,0 @@ -// Generated by generate-lazy-clone-reducer.js -/** - * Copyright 2018 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import * as Shift from '../../_snowpack/pkg/shift-ast.js'; - -export default class LazyCloneReducer { - reduceArrayAssignmentTarget(node, { elements, rest }) { - if ((node.elements.length === elements.length && node.elements.every((v, i) => v === elements[i])) && node.rest === rest) { - return node; - } - return new Shift.ArrayAssignmentTarget({ elements, rest }); - } - - reduceArrayBinding(node, { elements, rest }) { - if ((node.elements.length === elements.length && node.elements.every((v, i) => v === elements[i])) && node.rest === rest) { - return node; - } - return new Shift.ArrayBinding({ elements, rest }); - } - - reduceArrayExpression(node, { elements }) { - if ((node.elements.length === elements.length && node.elements.every((v, i) => v === elements[i]))) { - return node; - } - return new Shift.ArrayExpression({ elements }); - } - - reduceArrowExpression(node, { params, body }) { - if (node.params === params && node.body === body) { - return node; - } - return new Shift.ArrowExpression({ isAsync: node.isAsync, params, body }); - } - - reduceAssignmentExpression(node, { binding, expression }) { - if (node.binding === binding && node.expression === expression) { - return node; - } - return new Shift.AssignmentExpression({ binding, expression }); - } - - reduceAssignmentTargetIdentifier(node) { - return node; - } - - reduceAssignmentTargetPropertyIdentifier(node, { binding, init }) { - if (node.binding === binding && node.init === init) { - return node; - } - return new Shift.AssignmentTargetPropertyIdentifier({ binding, init }); - } - - reduceAssignmentTargetPropertyProperty(node, { name, binding }) { - if (node.name === name && node.binding === binding) { - return node; - } - return new Shift.AssignmentTargetPropertyProperty({ name, binding }); - } - - reduceAssignmentTargetWithDefault(node, { binding, init }) { - if (node.binding === binding && node.init === init) { - return node; - } - return new Shift.AssignmentTargetWithDefault({ binding, init }); - } - - reduceAwaitExpression(node, { expression }) { - if (node.expression === expression) { - return node; - } - return new Shift.AwaitExpression({ expression }); - } - - reduceBinaryExpression(node, { left, right }) { - if (node.left === left && node.right === right) { - return node; - } - return new Shift.BinaryExpression({ left, operator: node.operator, right }); - } - - reduceBindingIdentifier(node) { - return node; - } - - reduceBindingPropertyIdentifier(node, { binding, init }) { - if (node.binding === binding && node.init === init) { - return node; - } - return new Shift.BindingPropertyIdentifier({ binding, init }); - } - - reduceBindingPropertyProperty(node, { name, binding }) { - if (node.name === name && node.binding === binding) { - return node; - } - return new Shift.BindingPropertyProperty({ name, binding }); - } - - reduceBindingWithDefault(node, { binding, init }) { - if (node.binding === binding && node.init === init) { - return node; - } - return new Shift.BindingWithDefault({ binding, init }); - } - - reduceBlock(node, { statements }) { - if ((node.statements.length === statements.length && node.statements.every((v, i) => v === statements[i]))) { - return node; - } - return new Shift.Block({ statements }); - } - - reduceBlockStatement(node, { block }) { - if (node.block === block) { - return node; - } - return new Shift.BlockStatement({ block }); - } - - reduceBreakStatement(node) { - return node; - } - - reduceCallExpression(node, { callee, arguments: _arguments }) { - if (node.callee === callee && (node.arguments.length === _arguments.length && node.arguments.every((v, i) => v === _arguments[i]))) { - return node; - } - return new Shift.CallExpression({ callee, arguments: _arguments }); - } - - reduceCatchClause(node, { binding, body }) { - if (node.binding === binding && node.body === body) { - return node; - } - return new Shift.CatchClause({ binding, body }); - } - - reduceClassDeclaration(node, { name, super: _super, elements }) { - if (node.name === name && node.super === _super && (node.elements.length === elements.length && node.elements.every((v, i) => v === elements[i]))) { - return node; - } - return new Shift.ClassDeclaration({ name, super: _super, elements }); - } - - reduceClassElement(node, { method }) { - if (node.method === method) { - return node; - } - return new Shift.ClassElement({ isStatic: node.isStatic, method }); - } - - reduceClassExpression(node, { name, super: _super, elements }) { - if (node.name === name && node.super === _super && (node.elements.length === elements.length && node.elements.every((v, i) => v === elements[i]))) { - return node; - } - return new Shift.ClassExpression({ name, super: _super, elements }); - } - - reduceCompoundAssignmentExpression(node, { binding, expression }) { - if (node.binding === binding && node.expression === expression) { - return node; - } - return new Shift.CompoundAssignmentExpression({ binding, operator: node.operator, expression }); - } - - reduceComputedMemberAssignmentTarget(node, { object, expression }) { - if (node.object === object && node.expression === expression) { - return node; - } - return new Shift.ComputedMemberAssignmentTarget({ object, expression }); - } - - reduceComputedMemberExpression(node, { object, expression }) { - if (node.object === object && node.expression === expression) { - return node; - } - return new Shift.ComputedMemberExpression({ object, expression }); - } - - reduceComputedPropertyName(node, { expression }) { - if (node.expression === expression) { - return node; - } - return new Shift.ComputedPropertyName({ expression }); - } - - reduceConditionalExpression(node, { test, consequent, alternate }) { - if (node.test === test && node.consequent === consequent && node.alternate === alternate) { - return node; - } - return new Shift.ConditionalExpression({ test, consequent, alternate }); - } - - reduceContinueStatement(node) { - return node; - } - - reduceDataProperty(node, { name, expression }) { - if (node.name === name && node.expression === expression) { - return node; - } - return new Shift.DataProperty({ name, expression }); - } - - reduceDebuggerStatement(node) { - return node; - } - - reduceDirective(node) { - return node; - } - - reduceDoWhileStatement(node, { body, test }) { - if (node.body === body && node.test === test) { - return node; - } - return new Shift.DoWhileStatement({ body, test }); - } - - reduceEmptyStatement(node) { - return node; - } - - reduceExport(node, { declaration }) { - if (node.declaration === declaration) { - return node; - } - return new Shift.Export({ declaration }); - } - - reduceExportAllFrom(node) { - return node; - } - - reduceExportDefault(node, { body }) { - if (node.body === body) { - return node; - } - return new Shift.ExportDefault({ body }); - } - - reduceExportFrom(node, { namedExports }) { - if ((node.namedExports.length === namedExports.length && node.namedExports.every((v, i) => v === namedExports[i]))) { - return node; - } - return new Shift.ExportFrom({ namedExports, moduleSpecifier: node.moduleSpecifier }); - } - - reduceExportFromSpecifier(node) { - return node; - } - - reduceExportLocalSpecifier(node, { name }) { - if (node.name === name) { - return node; - } - return new Shift.ExportLocalSpecifier({ name, exportedName: node.exportedName }); - } - - reduceExportLocals(node, { namedExports }) { - if ((node.namedExports.length === namedExports.length && node.namedExports.every((v, i) => v === namedExports[i]))) { - return node; - } - return new Shift.ExportLocals({ namedExports }); - } - - reduceExpressionStatement(node, { expression }) { - if (node.expression === expression) { - return node; - } - return new Shift.ExpressionStatement({ expression }); - } - - reduceForAwaitStatement(node, { left, right, body }) { - if (node.left === left && node.right === right && node.body === body) { - return node; - } - return new Shift.ForAwaitStatement({ left, right, body }); - } - - reduceForInStatement(node, { left, right, body }) { - if (node.left === left && node.right === right && node.body === body) { - return node; - } - return new Shift.ForInStatement({ left, right, body }); - } - - reduceForOfStatement(node, { left, right, body }) { - if (node.left === left && node.right === right && node.body === body) { - return node; - } - return new Shift.ForOfStatement({ left, right, body }); - } - - reduceForStatement(node, { init, test, update, body }) { - if (node.init === init && node.test === test && node.update === update && node.body === body) { - return node; - } - return new Shift.ForStatement({ init, test, update, body }); - } - - reduceFormalParameters(node, { items, rest }) { - if ((node.items.length === items.length && node.items.every((v, i) => v === items[i])) && node.rest === rest) { - return node; - } - return new Shift.FormalParameters({ items, rest }); - } - - reduceFunctionBody(node, { directives, statements }) { - if ((node.directives.length === directives.length && node.directives.every((v, i) => v === directives[i])) && (node.statements.length === statements.length && node.statements.every((v, i) => v === statements[i]))) { - return node; - } - return new Shift.FunctionBody({ directives, statements }); - } - - reduceFunctionDeclaration(node, { name, params, body }) { - if (node.name === name && node.params === params && node.body === body) { - return node; - } - return new Shift.FunctionDeclaration({ isAsync: node.isAsync, isGenerator: node.isGenerator, name, params, body }); - } - - reduceFunctionExpression(node, { name, params, body }) { - if (node.name === name && node.params === params && node.body === body) { - return node; - } - return new Shift.FunctionExpression({ isAsync: node.isAsync, isGenerator: node.isGenerator, name, params, body }); - } - - reduceGetter(node, { name, body }) { - if (node.name === name && node.body === body) { - return node; - } - return new Shift.Getter({ name, body }); - } - - reduceIdentifierExpression(node) { - return node; - } - - reduceIfStatement(node, { test, consequent, alternate }) { - if (node.test === test && node.consequent === consequent && node.alternate === alternate) { - return node; - } - return new Shift.IfStatement({ test, consequent, alternate }); - } - - reduceImport(node, { defaultBinding, namedImports }) { - if (node.defaultBinding === defaultBinding && (node.namedImports.length === namedImports.length && node.namedImports.every((v, i) => v === namedImports[i]))) { - return node; - } - return new Shift.Import({ defaultBinding, namedImports, moduleSpecifier: node.moduleSpecifier }); - } - - reduceImportNamespace(node, { defaultBinding, namespaceBinding }) { - if (node.defaultBinding === defaultBinding && node.namespaceBinding === namespaceBinding) { - return node; - } - return new Shift.ImportNamespace({ defaultBinding, namespaceBinding, moduleSpecifier: node.moduleSpecifier }); - } - - reduceImportSpecifier(node, { binding }) { - if (node.binding === binding) { - return node; - } - return new Shift.ImportSpecifier({ name: node.name, binding }); - } - - reduceLabeledStatement(node, { body }) { - if (node.body === body) { - return node; - } - return new Shift.LabeledStatement({ label: node.label, body }); - } - - reduceLiteralBooleanExpression(node) { - return node; - } - - reduceLiteralInfinityExpression(node) { - return node; - } - - reduceLiteralNullExpression(node) { - return node; - } - - reduceLiteralNumericExpression(node) { - return node; - } - - reduceLiteralRegExpExpression(node) { - return node; - } - - reduceLiteralStringExpression(node) { - return node; - } - - reduceMethod(node, { name, params, body }) { - if (node.name === name && node.params === params && node.body === body) { - return node; - } - return new Shift.Method({ isAsync: node.isAsync, isGenerator: node.isGenerator, name, params, body }); - } - - reduceModule(node, { directives, items }) { - if ((node.directives.length === directives.length && node.directives.every((v, i) => v === directives[i])) && (node.items.length === items.length && node.items.every((v, i) => v === items[i]))) { - return node; - } - return new Shift.Module({ directives, items }); - } - - reduceNewExpression(node, { callee, arguments: _arguments }) { - if (node.callee === callee && (node.arguments.length === _arguments.length && node.arguments.every((v, i) => v === _arguments[i]))) { - return node; - } - return new Shift.NewExpression({ callee, arguments: _arguments }); - } - - reduceNewTargetExpression(node) { - return node; - } - - reduceObjectAssignmentTarget(node, { properties, rest }) { - if ((node.properties.length === properties.length && node.properties.every((v, i) => v === properties[i])) && node.rest === rest) { - return node; - } - return new Shift.ObjectAssignmentTarget({ properties, rest }); - } - - reduceObjectBinding(node, { properties, rest }) { - if ((node.properties.length === properties.length && node.properties.every((v, i) => v === properties[i])) && node.rest === rest) { - return node; - } - return new Shift.ObjectBinding({ properties, rest }); - } - - reduceObjectExpression(node, { properties }) { - if ((node.properties.length === properties.length && node.properties.every((v, i) => v === properties[i]))) { - return node; - } - return new Shift.ObjectExpression({ properties }); - } - - reduceReturnStatement(node, { expression }) { - if (node.expression === expression) { - return node; - } - return new Shift.ReturnStatement({ expression }); - } - - reduceScript(node, { directives, statements }) { - if ((node.directives.length === directives.length && node.directives.every((v, i) => v === directives[i])) && (node.statements.length === statements.length && node.statements.every((v, i) => v === statements[i]))) { - return node; - } - return new Shift.Script({ directives, statements }); - } - - reduceSetter(node, { name, param, body }) { - if (node.name === name && node.param === param && node.body === body) { - return node; - } - return new Shift.Setter({ name, param, body }); - } - - reduceShorthandProperty(node, { name }) { - if (node.name === name) { - return node; - } - return new Shift.ShorthandProperty({ name }); - } - - reduceSpreadElement(node, { expression }) { - if (node.expression === expression) { - return node; - } - return new Shift.SpreadElement({ expression }); - } - - reduceSpreadProperty(node, { expression }) { - if (node.expression === expression) { - return node; - } - return new Shift.SpreadProperty({ expression }); - } - - reduceStaticMemberAssignmentTarget(node, { object }) { - if (node.object === object) { - return node; - } - return new Shift.StaticMemberAssignmentTarget({ object, property: node.property }); - } - - reduceStaticMemberExpression(node, { object }) { - if (node.object === object) { - return node; - } - return new Shift.StaticMemberExpression({ object, property: node.property }); - } - - reduceStaticPropertyName(node) { - return node; - } - - reduceSuper(node) { - return node; - } - - reduceSwitchCase(node, { test, consequent }) { - if (node.test === test && (node.consequent.length === consequent.length && node.consequent.every((v, i) => v === consequent[i]))) { - return node; - } - return new Shift.SwitchCase({ test, consequent }); - } - - reduceSwitchDefault(node, { consequent }) { - if ((node.consequent.length === consequent.length && node.consequent.every((v, i) => v === consequent[i]))) { - return node; - } - return new Shift.SwitchDefault({ consequent }); - } - - reduceSwitchStatement(node, { discriminant, cases }) { - if (node.discriminant === discriminant && (node.cases.length === cases.length && node.cases.every((v, i) => v === cases[i]))) { - return node; - } - return new Shift.SwitchStatement({ discriminant, cases }); - } - - reduceSwitchStatementWithDefault(node, { discriminant, preDefaultCases, defaultCase, postDefaultCases }) { - if (node.discriminant === discriminant && (node.preDefaultCases.length === preDefaultCases.length && node.preDefaultCases.every((v, i) => v === preDefaultCases[i])) && node.defaultCase === defaultCase && (node.postDefaultCases.length === postDefaultCases.length && node.postDefaultCases.every((v, i) => v === postDefaultCases[i]))) { - return node; - } - return new Shift.SwitchStatementWithDefault({ discriminant, preDefaultCases, defaultCase, postDefaultCases }); - } - - reduceTemplateElement(node) { - return node; - } - - reduceTemplateExpression(node, { tag, elements }) { - if (node.tag === tag && (node.elements.length === elements.length && node.elements.every((v, i) => v === elements[i]))) { - return node; - } - return new Shift.TemplateExpression({ tag, elements }); - } - - reduceThisExpression(node) { - return node; - } - - reduceThrowStatement(node, { expression }) { - if (node.expression === expression) { - return node; - } - return new Shift.ThrowStatement({ expression }); - } - - reduceTryCatchStatement(node, { body, catchClause }) { - if (node.body === body && node.catchClause === catchClause) { - return node; - } - return new Shift.TryCatchStatement({ body, catchClause }); - } - - reduceTryFinallyStatement(node, { body, catchClause, finalizer }) { - if (node.body === body && node.catchClause === catchClause && node.finalizer === finalizer) { - return node; - } - return new Shift.TryFinallyStatement({ body, catchClause, finalizer }); - } - - reduceUnaryExpression(node, { operand }) { - if (node.operand === operand) { - return node; - } - return new Shift.UnaryExpression({ operator: node.operator, operand }); - } - - reduceUpdateExpression(node, { operand }) { - if (node.operand === operand) { - return node; - } - return new Shift.UpdateExpression({ isPrefix: node.isPrefix, operator: node.operator, operand }); - } - - reduceVariableDeclaration(node, { declarators }) { - if ((node.declarators.length === declarators.length && node.declarators.every((v, i) => v === declarators[i]))) { - return node; - } - return new Shift.VariableDeclaration({ kind: node.kind, declarators }); - } - - reduceVariableDeclarationStatement(node, { declaration }) { - if (node.declaration === declaration) { - return node; - } - return new Shift.VariableDeclarationStatement({ declaration }); - } - - reduceVariableDeclarator(node, { binding, init }) { - if (node.binding === binding && node.init === init) { - return node; - } - return new Shift.VariableDeclarator({ binding, init }); - } - - reduceWhileStatement(node, { test, body }) { - if (node.test === test && node.body === body) { - return node; - } - return new Shift.WhileStatement({ test, body }); - } - - reduceWithStatement(node, { object, body }) { - if (node.object === object && node.body === body) { - return node; - } - return new Shift.WithStatement({ object, body }); - } - - reduceYieldExpression(node, { expression }) { - if (node.expression === expression) { - return node; - } - return new Shift.YieldExpression({ expression }); - } - - reduceYieldGeneratorExpression(node, { expression }) { - if (node.expression === expression) { - return node; - } - return new Shift.YieldGeneratorExpression({ expression }); - } -} diff --git a/docs/dist/shift-reducer/memoize.js b/docs/dist/shift-reducer/memoize.js deleted file mode 100644 index 947f7b72..00000000 --- a/docs/dist/shift-reducer/memoize.js +++ /dev/null @@ -1,914 +0,0 @@ -// Generated by generate-memoize.js -/** - * Copyright 2018 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import * as Shift from '../../_snowpack/pkg/shift-ast.js'; - -export default function memoize(reducer) { - const cache = new WeakMap; - return { - reduceArrayAssignmentTarget(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceArrayAssignmentTarget(node, arg); - cache.set(node, res); - return res; - }, - - reduceArrayBinding(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceArrayBinding(node, arg); - cache.set(node, res); - return res; - }, - - reduceArrayExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceArrayExpression(node, arg); - cache.set(node, res); - return res; - }, - - reduceArrowExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceArrowExpression(node, arg); - cache.set(node, res); - return res; - }, - - reduceAssignmentExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceAssignmentExpression(node, arg); - cache.set(node, res); - return res; - }, - - reduceAssignmentTargetIdentifier(node) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceAssignmentTargetIdentifier(node); - cache.set(node, res); - return res; - }, - - reduceAssignmentTargetPropertyIdentifier(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceAssignmentTargetPropertyIdentifier(node, arg); - cache.set(node, res); - return res; - }, - - reduceAssignmentTargetPropertyProperty(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceAssignmentTargetPropertyProperty(node, arg); - cache.set(node, res); - return res; - }, - - reduceAssignmentTargetWithDefault(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceAssignmentTargetWithDefault(node, arg); - cache.set(node, res); - return res; - }, - - reduceAwaitExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceAwaitExpression(node, arg); - cache.set(node, res); - return res; - }, - - reduceBinaryExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceBinaryExpression(node, arg); - cache.set(node, res); - return res; - }, - - reduceBindingIdentifier(node) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceBindingIdentifier(node); - cache.set(node, res); - return res; - }, - - reduceBindingPropertyIdentifier(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceBindingPropertyIdentifier(node, arg); - cache.set(node, res); - return res; - }, - - reduceBindingPropertyProperty(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceBindingPropertyProperty(node, arg); - cache.set(node, res); - return res; - }, - - reduceBindingWithDefault(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceBindingWithDefault(node, arg); - cache.set(node, res); - return res; - }, - - reduceBlock(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceBlock(node, arg); - cache.set(node, res); - return res; - }, - - reduceBlockStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceBlockStatement(node, arg); - cache.set(node, res); - return res; - }, - - reduceBreakStatement(node) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceBreakStatement(node); - cache.set(node, res); - return res; - }, - - reduceCallExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceCallExpression(node, arg); - cache.set(node, res); - return res; - }, - - reduceCatchClause(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceCatchClause(node, arg); - cache.set(node, res); - return res; - }, - - reduceClassDeclaration(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceClassDeclaration(node, arg); - cache.set(node, res); - return res; - }, - - reduceClassElement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceClassElement(node, arg); - cache.set(node, res); - return res; - }, - - reduceClassExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceClassExpression(node, arg); - cache.set(node, res); - return res; - }, - - reduceCompoundAssignmentExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceCompoundAssignmentExpression(node, arg); - cache.set(node, res); - return res; - }, - - reduceComputedMemberAssignmentTarget(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceComputedMemberAssignmentTarget(node, arg); - cache.set(node, res); - return res; - }, - - reduceComputedMemberExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceComputedMemberExpression(node, arg); - cache.set(node, res); - return res; - }, - - reduceComputedPropertyName(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceComputedPropertyName(node, arg); - cache.set(node, res); - return res; - }, - - reduceConditionalExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceConditionalExpression(node, arg); - cache.set(node, res); - return res; - }, - - reduceContinueStatement(node) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceContinueStatement(node); - cache.set(node, res); - return res; - }, - - reduceDataProperty(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceDataProperty(node, arg); - cache.set(node, res); - return res; - }, - - reduceDebuggerStatement(node) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceDebuggerStatement(node); - cache.set(node, res); - return res; - }, - - reduceDirective(node) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceDirective(node); - cache.set(node, res); - return res; - }, - - reduceDoWhileStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceDoWhileStatement(node, arg); - cache.set(node, res); - return res; - }, - - reduceEmptyStatement(node) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceEmptyStatement(node); - cache.set(node, res); - return res; - }, - - reduceExport(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceExport(node, arg); - cache.set(node, res); - return res; - }, - - reduceExportAllFrom(node) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceExportAllFrom(node); - cache.set(node, res); - return res; - }, - - reduceExportDefault(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceExportDefault(node, arg); - cache.set(node, res); - return res; - }, - - reduceExportFrom(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceExportFrom(node, arg); - cache.set(node, res); - return res; - }, - - reduceExportFromSpecifier(node) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceExportFromSpecifier(node); - cache.set(node, res); - return res; - }, - - reduceExportLocalSpecifier(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceExportLocalSpecifier(node, arg); - cache.set(node, res); - return res; - }, - - reduceExportLocals(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceExportLocals(node, arg); - cache.set(node, res); - return res; - }, - - reduceExpressionStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceExpressionStatement(node, arg); - cache.set(node, res); - return res; - }, - - reduceForAwaitStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceForAwaitStatement(node, arg); - cache.set(node, res); - return res; - }, - - reduceForInStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceForInStatement(node, arg); - cache.set(node, res); - return res; - }, - - reduceForOfStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceForOfStatement(node, arg); - cache.set(node, res); - return res; - }, - - reduceForStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceForStatement(node, arg); - cache.set(node, res); - return res; - }, - - reduceFormalParameters(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceFormalParameters(node, arg); - cache.set(node, res); - return res; - }, - - reduceFunctionBody(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceFunctionBody(node, arg); - cache.set(node, res); - return res; - }, - - reduceFunctionDeclaration(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceFunctionDeclaration(node, arg); - cache.set(node, res); - return res; - }, - - reduceFunctionExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceFunctionExpression(node, arg); - cache.set(node, res); - return res; - }, - - reduceGetter(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceGetter(node, arg); - cache.set(node, res); - return res; - }, - - reduceIdentifierExpression(node) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceIdentifierExpression(node); - cache.set(node, res); - return res; - }, - - reduceIfStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceIfStatement(node, arg); - cache.set(node, res); - return res; - }, - - reduceImport(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceImport(node, arg); - cache.set(node, res); - return res; - }, - - reduceImportNamespace(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceImportNamespace(node, arg); - cache.set(node, res); - return res; - }, - - reduceImportSpecifier(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceImportSpecifier(node, arg); - cache.set(node, res); - return res; - }, - - reduceLabeledStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceLabeledStatement(node, arg); - cache.set(node, res); - return res; - }, - - reduceLiteralBooleanExpression(node) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceLiteralBooleanExpression(node); - cache.set(node, res); - return res; - }, - - reduceLiteralInfinityExpression(node) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceLiteralInfinityExpression(node); - cache.set(node, res); - return res; - }, - - reduceLiteralNullExpression(node) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceLiteralNullExpression(node); - cache.set(node, res); - return res; - }, - - reduceLiteralNumericExpression(node) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceLiteralNumericExpression(node); - cache.set(node, res); - return res; - }, - - reduceLiteralRegExpExpression(node) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceLiteralRegExpExpression(node); - cache.set(node, res); - return res; - }, - - reduceLiteralStringExpression(node) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceLiteralStringExpression(node); - cache.set(node, res); - return res; - }, - - reduceMethod(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceMethod(node, arg); - cache.set(node, res); - return res; - }, - - reduceModule(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceModule(node, arg); - cache.set(node, res); - return res; - }, - - reduceNewExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceNewExpression(node, arg); - cache.set(node, res); - return res; - }, - - reduceNewTargetExpression(node) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceNewTargetExpression(node); - cache.set(node, res); - return res; - }, - - reduceObjectAssignmentTarget(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceObjectAssignmentTarget(node, arg); - cache.set(node, res); - return res; - }, - - reduceObjectBinding(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceObjectBinding(node, arg); - cache.set(node, res); - return res; - }, - - reduceObjectExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceObjectExpression(node, arg); - cache.set(node, res); - return res; - }, - - reduceReturnStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceReturnStatement(node, arg); - cache.set(node, res); - return res; - }, - - reduceScript(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceScript(node, arg); - cache.set(node, res); - return res; - }, - - reduceSetter(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceSetter(node, arg); - cache.set(node, res); - return res; - }, - - reduceShorthandProperty(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceShorthandProperty(node, arg); - cache.set(node, res); - return res; - }, - - reduceSpreadElement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceSpreadElement(node, arg); - cache.set(node, res); - return res; - }, - - reduceSpreadProperty(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceSpreadProperty(node, arg); - cache.set(node, res); - return res; - }, - - reduceStaticMemberAssignmentTarget(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceStaticMemberAssignmentTarget(node, arg); - cache.set(node, res); - return res; - }, - - reduceStaticMemberExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceStaticMemberExpression(node, arg); - cache.set(node, res); - return res; - }, - - reduceStaticPropertyName(node) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceStaticPropertyName(node); - cache.set(node, res); - return res; - }, - - reduceSuper(node) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceSuper(node); - cache.set(node, res); - return res; - }, - - reduceSwitchCase(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceSwitchCase(node, arg); - cache.set(node, res); - return res; - }, - - reduceSwitchDefault(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceSwitchDefault(node, arg); - cache.set(node, res); - return res; - }, - - reduceSwitchStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceSwitchStatement(node, arg); - cache.set(node, res); - return res; - }, - - reduceSwitchStatementWithDefault(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceSwitchStatementWithDefault(node, arg); - cache.set(node, res); - return res; - }, - - reduceTemplateElement(node) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceTemplateElement(node); - cache.set(node, res); - return res; - }, - - reduceTemplateExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceTemplateExpression(node, arg); - cache.set(node, res); - return res; - }, - - reduceThisExpression(node) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceThisExpression(node); - cache.set(node, res); - return res; - }, - - reduceThrowStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceThrowStatement(node, arg); - cache.set(node, res); - return res; - }, - - reduceTryCatchStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceTryCatchStatement(node, arg); - cache.set(node, res); - return res; - }, - - reduceTryFinallyStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceTryFinallyStatement(node, arg); - cache.set(node, res); - return res; - }, - - reduceUnaryExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceUnaryExpression(node, arg); - cache.set(node, res); - return res; - }, - - reduceUpdateExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceUpdateExpression(node, arg); - cache.set(node, res); - return res; - }, - - reduceVariableDeclaration(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceVariableDeclaration(node, arg); - cache.set(node, res); - return res; - }, - - reduceVariableDeclarationStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceVariableDeclarationStatement(node, arg); - cache.set(node, res); - return res; - }, - - reduceVariableDeclarator(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceVariableDeclarator(node, arg); - cache.set(node, res); - return res; - }, - - reduceWhileStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceWhileStatement(node, arg); - cache.set(node, res); - return res; - }, - - reduceWithStatement(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceWithStatement(node, arg); - cache.set(node, res); - return res; - }, - - reduceYieldExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceYieldExpression(node, arg); - cache.set(node, res); - return res; - }, - - reduceYieldGeneratorExpression(node, arg) { - if (cache.has(node)) { - return cache.get(node); - } - const res = reducer.reduceYieldGeneratorExpression(node, arg); - cache.set(node, res); - return res; - }, - }; -} diff --git a/docs/dist/shift-reducer/monoidal-reducer.js b/docs/dist/shift-reducer/monoidal-reducer.js deleted file mode 100644 index 304dcd63..00000000 --- a/docs/dist/shift-reducer/monoidal-reducer.js +++ /dev/null @@ -1,430 +0,0 @@ -// Generated by generate-monoidal-reducer.js -/** - * Copyright 2018 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import Shift from '../../_snowpack/pkg/shift-ast.js'; - -export default class MonoidalReducer { - constructor(monoid) { - let identity = monoid.empty(); - this.identity = identity; - let concat; - if (monoid.prototype && typeof monoid.prototype.concat === 'function') { - concat = Function.prototype.call.bind(monoid.prototype.concat); - } else if (typeof monoid.concat === 'function') { - concat = monoid.concat; - } else { - throw new TypeError('Monoid must provide a `concat` method'); - } - this.append = (...args) => args.reduce(concat, identity); - } - - reduceArrayAssignmentTarget(node, { elements, rest }) { - return this.append(...elements.filter(n => n != null), rest == null ? this.identity : rest); - } - - reduceArrayBinding(node, { elements, rest }) { - return this.append(...elements.filter(n => n != null), rest == null ? this.identity : rest); - } - - reduceArrayExpression(node, { elements }) { - return this.append(...elements.filter(n => n != null)); - } - - reduceArrowExpression(node, { params, body }) { - return this.append(params, body); - } - - reduceAssignmentExpression(node, { binding, expression }) { - return this.append(binding, expression); - } - - reduceAssignmentTargetIdentifier(node) { - return this.identity; - } - - reduceAssignmentTargetPropertyIdentifier(node, { binding, init }) { - return this.append(binding, init == null ? this.identity : init); - } - - reduceAssignmentTargetPropertyProperty(node, { name, binding }) { - return this.append(name, binding); - } - - reduceAssignmentTargetWithDefault(node, { binding, init }) { - return this.append(binding, init); - } - - reduceAwaitExpression(node, { expression }) { - return expression; - } - - reduceBinaryExpression(node, { left, right }) { - return this.append(left, right); - } - - reduceBindingIdentifier(node) { - return this.identity; - } - - reduceBindingPropertyIdentifier(node, { binding, init }) { - return this.append(binding, init == null ? this.identity : init); - } - - reduceBindingPropertyProperty(node, { name, binding }) { - return this.append(name, binding); - } - - reduceBindingWithDefault(node, { binding, init }) { - return this.append(binding, init); - } - - reduceBlock(node, { statements }) { - return this.append(...statements); - } - - reduceBlockStatement(node, { block }) { - return block; - } - - reduceBreakStatement(node) { - return this.identity; - } - - reduceCallExpression(node, { callee, arguments: _arguments }) { - return this.append(callee, ..._arguments); - } - - reduceCatchClause(node, { binding, body }) { - return this.append(binding, body); - } - - reduceClassDeclaration(node, { name, super: _super, elements }) { - return this.append(name, _super == null ? this.identity : _super, ...elements); - } - - reduceClassElement(node, { method }) { - return method; - } - - reduceClassExpression(node, { name, super: _super, elements }) { - return this.append(name == null ? this.identity : name, _super == null ? this.identity : _super, ...elements); - } - - reduceCompoundAssignmentExpression(node, { binding, expression }) { - return this.append(binding, expression); - } - - reduceComputedMemberAssignmentTarget(node, { object, expression }) { - return this.append(object, expression); - } - - reduceComputedMemberExpression(node, { object, expression }) { - return this.append(object, expression); - } - - reduceComputedPropertyName(node, { expression }) { - return expression; - } - - reduceConditionalExpression(node, { test, consequent, alternate }) { - return this.append(test, consequent, alternate); - } - - reduceContinueStatement(node) { - return this.identity; - } - - reduceDataProperty(node, { name, expression }) { - return this.append(name, expression); - } - - reduceDebuggerStatement(node) { - return this.identity; - } - - reduceDirective(node) { - return this.identity; - } - - reduceDoWhileStatement(node, { body, test }) { - return this.append(body, test); - } - - reduceEmptyStatement(node) { - return this.identity; - } - - reduceExport(node, { declaration }) { - return declaration; - } - - reduceExportAllFrom(node) { - return this.identity; - } - - reduceExportDefault(node, { body }) { - return body; - } - - reduceExportFrom(node, { namedExports }) { - return this.append(...namedExports); - } - - reduceExportFromSpecifier(node) { - return this.identity; - } - - reduceExportLocalSpecifier(node, { name }) { - return name; - } - - reduceExportLocals(node, { namedExports }) { - return this.append(...namedExports); - } - - reduceExpressionStatement(node, { expression }) { - return expression; - } - - reduceForAwaitStatement(node, { left, right, body }) { - return this.append(left, right, body); - } - - reduceForInStatement(node, { left, right, body }) { - return this.append(left, right, body); - } - - reduceForOfStatement(node, { left, right, body }) { - return this.append(left, right, body); - } - - reduceForStatement(node, { init, test, update, body }) { - return this.append(init == null ? this.identity : init, test == null ? this.identity : test, update == null ? this.identity : update, body); - } - - reduceFormalParameters(node, { items, rest }) { - return this.append(...items, rest == null ? this.identity : rest); - } - - reduceFunctionBody(node, { directives, statements }) { - return this.append(...directives, ...statements); - } - - reduceFunctionDeclaration(node, { name, params, body }) { - return this.append(name, params, body); - } - - reduceFunctionExpression(node, { name, params, body }) { - return this.append(name == null ? this.identity : name, params, body); - } - - reduceGetter(node, { name, body }) { - return this.append(name, body); - } - - reduceIdentifierExpression(node) { - return this.identity; - } - - reduceIfStatement(node, { test, consequent, alternate }) { - return this.append(test, consequent, alternate == null ? this.identity : alternate); - } - - reduceImport(node, { defaultBinding, namedImports }) { - return this.append(defaultBinding == null ? this.identity : defaultBinding, ...namedImports); - } - - reduceImportNamespace(node, { defaultBinding, namespaceBinding }) { - return this.append(defaultBinding == null ? this.identity : defaultBinding, namespaceBinding); - } - - reduceImportSpecifier(node, { binding }) { - return binding; - } - - reduceLabeledStatement(node, { body }) { - return body; - } - - reduceLiteralBooleanExpression(node) { - return this.identity; - } - - reduceLiteralInfinityExpression(node) { - return this.identity; - } - - reduceLiteralNullExpression(node) { - return this.identity; - } - - reduceLiteralNumericExpression(node) { - return this.identity; - } - - reduceLiteralRegExpExpression(node) { - return this.identity; - } - - reduceLiteralStringExpression(node) { - return this.identity; - } - - reduceMethod(node, { name, params, body }) { - return this.append(name, params, body); - } - - reduceModule(node, { directives, items }) { - return this.append(...directives, ...items); - } - - reduceNewExpression(node, { callee, arguments: _arguments }) { - return this.append(callee, ..._arguments); - } - - reduceNewTargetExpression(node) { - return this.identity; - } - - reduceObjectAssignmentTarget(node, { properties, rest }) { - return this.append(...properties, rest == null ? this.identity : rest); - } - - reduceObjectBinding(node, { properties, rest }) { - return this.append(...properties, rest == null ? this.identity : rest); - } - - reduceObjectExpression(node, { properties }) { - return this.append(...properties); - } - - reduceReturnStatement(node, { expression }) { - return expression == null ? this.identity : expression; - } - - reduceScript(node, { directives, statements }) { - return this.append(...directives, ...statements); - } - - reduceSetter(node, { name, param, body }) { - return this.append(name, param, body); - } - - reduceShorthandProperty(node, { name }) { - return name; - } - - reduceSpreadElement(node, { expression }) { - return expression; - } - - reduceSpreadProperty(node, { expression }) { - return expression; - } - - reduceStaticMemberAssignmentTarget(node, { object }) { - return object; - } - - reduceStaticMemberExpression(node, { object }) { - return object; - } - - reduceStaticPropertyName(node) { - return this.identity; - } - - reduceSuper(node) { - return this.identity; - } - - reduceSwitchCase(node, { test, consequent }) { - return this.append(test, ...consequent); - } - - reduceSwitchDefault(node, { consequent }) { - return this.append(...consequent); - } - - reduceSwitchStatement(node, { discriminant, cases }) { - return this.append(discriminant, ...cases); - } - - reduceSwitchStatementWithDefault(node, { discriminant, preDefaultCases, defaultCase, postDefaultCases }) { - return this.append(discriminant, ...preDefaultCases, defaultCase, ...postDefaultCases); - } - - reduceTemplateElement(node) { - return this.identity; - } - - reduceTemplateExpression(node, { tag, elements }) { - return this.append(tag == null ? this.identity : tag, ...elements); - } - - reduceThisExpression(node) { - return this.identity; - } - - reduceThrowStatement(node, { expression }) { - return expression; - } - - reduceTryCatchStatement(node, { body, catchClause }) { - return this.append(body, catchClause); - } - - reduceTryFinallyStatement(node, { body, catchClause, finalizer }) { - return this.append(body, catchClause == null ? this.identity : catchClause, finalizer); - } - - reduceUnaryExpression(node, { operand }) { - return operand; - } - - reduceUpdateExpression(node, { operand }) { - return operand; - } - - reduceVariableDeclaration(node, { declarators }) { - return this.append(...declarators); - } - - reduceVariableDeclarationStatement(node, { declaration }) { - return declaration; - } - - reduceVariableDeclarator(node, { binding, init }) { - return this.append(binding, init == null ? this.identity : init); - } - - reduceWhileStatement(node, { test, body }) { - return this.append(test, body); - } - - reduceWithStatement(node, { object, body }) { - return this.append(object, body); - } - - reduceYieldExpression(node, { expression }) { - return expression == null ? this.identity : expression; - } - - reduceYieldGeneratorExpression(node, { expression }) { - return expression; - } -} diff --git a/docs/dist/shift-reducer/reducers.js b/docs/dist/shift-reducer/reducers.js deleted file mode 100644 index ed7a43cb..00000000 --- a/docs/dist/shift-reducer/reducers.js +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2018 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -import MonoidalReducer from './monoidal-reducer.js'; -import ThunkedMonoidalReducer from './thunked-monoidal-reducer.js'; - -const PlusMonoid = { - empty: () => 0, - concat: (a, b) => a + b, -}; - -const ConcatMonoid = { - empty: () => [], - concat: (a, b) => a.concat(b), -}; - -const AndMonoid = { - empty: () => true, - concat: (a, b) => a && b, - concatThunk: (a, b) => a && b(), -}; - -const OrMonoid = { - empty: () => false, - concat: (a, b) => a || b, - concatThunk: (a, b) => a || b(), -}; - - -export class PlusReducer extends MonoidalReducer { - constructor() { - super(PlusMonoid); - } -} - -export class ThunkedPlusReducer extends ThunkedMonoidalReducer { - constructor() { - super(PlusMonoid); - } -} - -export class ConcatReducer extends MonoidalReducer { - constructor() { - super(ConcatMonoid); - } -} - -export class ThunkedConcatReducer extends ThunkedMonoidalReducer { - constructor() { - super(ConcatMonoid); - } -} - -export class AndReducer extends MonoidalReducer { - constructor() { - super(AndMonoid); - } -} - -export class ThunkedAndReducer extends ThunkedMonoidalReducer { - constructor() { - super(AndMonoid); - } -} - -export class OrReducer extends MonoidalReducer { - constructor() { - super(OrMonoid); - } -} - -export class ThunkedOrReducer extends ThunkedMonoidalReducer { - constructor() { - super(OrMonoid); - } -} diff --git a/docs/dist/shift-reducer/thunked-director.js b/docs/dist/shift-reducer/thunked-director.js deleted file mode 100644 index 01fd3d3f..00000000 --- a/docs/dist/shift-reducer/thunked-director.js +++ /dev/null @@ -1,418 +0,0 @@ -// Generated by generate-director.js -/** - * Copyright 2018 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -const director = { - ArrayAssignmentTarget(reducer, node) { - return reducer.reduceArrayAssignmentTarget(node, { elements: node.elements.map(v => v && (() => this[v.type](reducer, v))), rest: node.rest && (() => this[node.rest.type](reducer, node.rest)) }); - }, - - ArrayBinding(reducer, node) { - return reducer.reduceArrayBinding(node, { elements: node.elements.map(v => v && (() => this[v.type](reducer, v))), rest: node.rest && (() => this[node.rest.type](reducer, node.rest)) }); - }, - - ArrayExpression(reducer, node) { - return reducer.reduceArrayExpression(node, { elements: node.elements.map(v => v && (() => this[v.type](reducer, v))) }); - }, - - ArrowExpression(reducer, node) { - return reducer.reduceArrowExpression(node, { params: (() => this.FormalParameters(reducer, node.params)), body: (() => this[node.body.type](reducer, node.body)) }); - }, - - AssignmentExpression(reducer, node) { - return reducer.reduceAssignmentExpression(node, { binding: (() => this[node.binding.type](reducer, node.binding)), expression: (() => this[node.expression.type](reducer, node.expression)) }); - }, - - AssignmentTargetIdentifier(reducer, node) { - return reducer.reduceAssignmentTargetIdentifier(node); - }, - - AssignmentTargetPropertyIdentifier(reducer, node) { - return reducer.reduceAssignmentTargetPropertyIdentifier(node, { binding: (() => this.AssignmentTargetIdentifier(reducer, node.binding)), init: node.init && (() => this[node.init.type](reducer, node.init)) }); - }, - - AssignmentTargetPropertyProperty(reducer, node) { - return reducer.reduceAssignmentTargetPropertyProperty(node, { name: (() => this[node.name.type](reducer, node.name)), binding: (() => this[node.binding.type](reducer, node.binding)) }); - }, - - AssignmentTargetWithDefault(reducer, node) { - return reducer.reduceAssignmentTargetWithDefault(node, { binding: (() => this[node.binding.type](reducer, node.binding)), init: (() => this[node.init.type](reducer, node.init)) }); - }, - - AwaitExpression(reducer, node) { - return reducer.reduceAwaitExpression(node, { expression: (() => this[node.expression.type](reducer, node.expression)) }); - }, - - BinaryExpression(reducer, node) { - return reducer.reduceBinaryExpression(node, { left: (() => this[node.left.type](reducer, node.left)), right: (() => this[node.right.type](reducer, node.right)) }); - }, - - BindingIdentifier(reducer, node) { - return reducer.reduceBindingIdentifier(node); - }, - - BindingPropertyIdentifier(reducer, node) { - return reducer.reduceBindingPropertyIdentifier(node, { binding: (() => this.BindingIdentifier(reducer, node.binding)), init: node.init && (() => this[node.init.type](reducer, node.init)) }); - }, - - BindingPropertyProperty(reducer, node) { - return reducer.reduceBindingPropertyProperty(node, { name: (() => this[node.name.type](reducer, node.name)), binding: (() => this[node.binding.type](reducer, node.binding)) }); - }, - - BindingWithDefault(reducer, node) { - return reducer.reduceBindingWithDefault(node, { binding: (() => this[node.binding.type](reducer, node.binding)), init: (() => this[node.init.type](reducer, node.init)) }); - }, - - Block(reducer, node) { - return reducer.reduceBlock(node, { statements: node.statements.map(v => (() => this[v.type](reducer, v))) }); - }, - - BlockStatement(reducer, node) { - return reducer.reduceBlockStatement(node, { block: (() => this.Block(reducer, node.block)) }); - }, - - BreakStatement(reducer, node) { - return reducer.reduceBreakStatement(node); - }, - - CallExpression(reducer, node) { - return reducer.reduceCallExpression(node, { callee: (() => this[node.callee.type](reducer, node.callee)), arguments: node.arguments.map(v => (() => this[v.type](reducer, v))) }); - }, - - CatchClause(reducer, node) { - return reducer.reduceCatchClause(node, { binding: (() => this[node.binding.type](reducer, node.binding)), body: (() => this.Block(reducer, node.body)) }); - }, - - ClassDeclaration(reducer, node) { - return reducer.reduceClassDeclaration(node, { name: (() => this.BindingIdentifier(reducer, node.name)), super: node.super && (() => this[node.super.type](reducer, node.super)), elements: node.elements.map(v => (() => this.ClassElement(reducer, v))) }); - }, - - ClassElement(reducer, node) { - return reducer.reduceClassElement(node, { method: (() => this[node.method.type](reducer, node.method)) }); - }, - - ClassExpression(reducer, node) { - return reducer.reduceClassExpression(node, { name: node.name && (() => this.BindingIdentifier(reducer, node.name)), super: node.super && (() => this[node.super.type](reducer, node.super)), elements: node.elements.map(v => (() => this.ClassElement(reducer, v))) }); - }, - - CompoundAssignmentExpression(reducer, node) { - return reducer.reduceCompoundAssignmentExpression(node, { binding: (() => this[node.binding.type](reducer, node.binding)), expression: (() => this[node.expression.type](reducer, node.expression)) }); - }, - - ComputedMemberAssignmentTarget(reducer, node) { - return reducer.reduceComputedMemberAssignmentTarget(node, { object: (() => this[node.object.type](reducer, node.object)), expression: (() => this[node.expression.type](reducer, node.expression)) }); - }, - - ComputedMemberExpression(reducer, node) { - return reducer.reduceComputedMemberExpression(node, { object: (() => this[node.object.type](reducer, node.object)), expression: (() => this[node.expression.type](reducer, node.expression)) }); - }, - - ComputedPropertyName(reducer, node) { - return reducer.reduceComputedPropertyName(node, { expression: (() => this[node.expression.type](reducer, node.expression)) }); - }, - - ConditionalExpression(reducer, node) { - return reducer.reduceConditionalExpression(node, { test: (() => this[node.test.type](reducer, node.test)), consequent: (() => this[node.consequent.type](reducer, node.consequent)), alternate: (() => this[node.alternate.type](reducer, node.alternate)) }); - }, - - ContinueStatement(reducer, node) { - return reducer.reduceContinueStatement(node); - }, - - DataProperty(reducer, node) { - return reducer.reduceDataProperty(node, { name: (() => this[node.name.type](reducer, node.name)), expression: (() => this[node.expression.type](reducer, node.expression)) }); - }, - - DebuggerStatement(reducer, node) { - return reducer.reduceDebuggerStatement(node); - }, - - Directive(reducer, node) { - return reducer.reduceDirective(node); - }, - - DoWhileStatement(reducer, node) { - return reducer.reduceDoWhileStatement(node, { body: (() => this[node.body.type](reducer, node.body)), test: (() => this[node.test.type](reducer, node.test)) }); - }, - - EmptyStatement(reducer, node) { - return reducer.reduceEmptyStatement(node); - }, - - Export(reducer, node) { - return reducer.reduceExport(node, { declaration: (() => this[node.declaration.type](reducer, node.declaration)) }); - }, - - ExportAllFrom(reducer, node) { - return reducer.reduceExportAllFrom(node); - }, - - ExportDefault(reducer, node) { - return reducer.reduceExportDefault(node, { body: (() => this[node.body.type](reducer, node.body)) }); - }, - - ExportFrom(reducer, node) { - return reducer.reduceExportFrom(node, { namedExports: node.namedExports.map(v => (() => this.ExportFromSpecifier(reducer, v))) }); - }, - - ExportFromSpecifier(reducer, node) { - return reducer.reduceExportFromSpecifier(node); - }, - - ExportLocalSpecifier(reducer, node) { - return reducer.reduceExportLocalSpecifier(node, { name: (() => this.IdentifierExpression(reducer, node.name)) }); - }, - - ExportLocals(reducer, node) { - return reducer.reduceExportLocals(node, { namedExports: node.namedExports.map(v => (() => this.ExportLocalSpecifier(reducer, v))) }); - }, - - ExpressionStatement(reducer, node) { - return reducer.reduceExpressionStatement(node, { expression: (() => this[node.expression.type](reducer, node.expression)) }); - }, - - ForAwaitStatement(reducer, node) { - return reducer.reduceForAwaitStatement(node, { left: (() => this[node.left.type](reducer, node.left)), right: (() => this[node.right.type](reducer, node.right)), body: (() => this[node.body.type](reducer, node.body)) }); - }, - - ForInStatement(reducer, node) { - return reducer.reduceForInStatement(node, { left: (() => this[node.left.type](reducer, node.left)), right: (() => this[node.right.type](reducer, node.right)), body: (() => this[node.body.type](reducer, node.body)) }); - }, - - ForOfStatement(reducer, node) { - return reducer.reduceForOfStatement(node, { left: (() => this[node.left.type](reducer, node.left)), right: (() => this[node.right.type](reducer, node.right)), body: (() => this[node.body.type](reducer, node.body)) }); - }, - - ForStatement(reducer, node) { - return reducer.reduceForStatement(node, { init: node.init && (() => this[node.init.type](reducer, node.init)), test: node.test && (() => this[node.test.type](reducer, node.test)), update: node.update && (() => this[node.update.type](reducer, node.update)), body: (() => this[node.body.type](reducer, node.body)) }); - }, - - FormalParameters(reducer, node) { - return reducer.reduceFormalParameters(node, { items: node.items.map(v => (() => this[v.type](reducer, v))), rest: node.rest && (() => this[node.rest.type](reducer, node.rest)) }); - }, - - FunctionBody(reducer, node) { - return reducer.reduceFunctionBody(node, { directives: node.directives.map(v => (() => this.Directive(reducer, v))), statements: node.statements.map(v => (() => this[v.type](reducer, v))) }); - }, - - FunctionDeclaration(reducer, node) { - return reducer.reduceFunctionDeclaration(node, { name: (() => this.BindingIdentifier(reducer, node.name)), params: (() => this.FormalParameters(reducer, node.params)), body: (() => this.FunctionBody(reducer, node.body)) }); - }, - - FunctionExpression(reducer, node) { - return reducer.reduceFunctionExpression(node, { name: node.name && (() => this.BindingIdentifier(reducer, node.name)), params: (() => this.FormalParameters(reducer, node.params)), body: (() => this.FunctionBody(reducer, node.body)) }); - }, - - Getter(reducer, node) { - return reducer.reduceGetter(node, { name: (() => this[node.name.type](reducer, node.name)), body: (() => this.FunctionBody(reducer, node.body)) }); - }, - - IdentifierExpression(reducer, node) { - return reducer.reduceIdentifierExpression(node); - }, - - IfStatement(reducer, node) { - return reducer.reduceIfStatement(node, { test: (() => this[node.test.type](reducer, node.test)), consequent: (() => this[node.consequent.type](reducer, node.consequent)), alternate: node.alternate && (() => this[node.alternate.type](reducer, node.alternate)) }); - }, - - Import(reducer, node) { - return reducer.reduceImport(node, { defaultBinding: node.defaultBinding && (() => this.BindingIdentifier(reducer, node.defaultBinding)), namedImports: node.namedImports.map(v => (() => this.ImportSpecifier(reducer, v))) }); - }, - - ImportNamespace(reducer, node) { - return reducer.reduceImportNamespace(node, { defaultBinding: node.defaultBinding && (() => this.BindingIdentifier(reducer, node.defaultBinding)), namespaceBinding: (() => this.BindingIdentifier(reducer, node.namespaceBinding)) }); - }, - - ImportSpecifier(reducer, node) { - return reducer.reduceImportSpecifier(node, { binding: (() => this.BindingIdentifier(reducer, node.binding)) }); - }, - - LabeledStatement(reducer, node) { - return reducer.reduceLabeledStatement(node, { body: (() => this[node.body.type](reducer, node.body)) }); - }, - - LiteralBooleanExpression(reducer, node) { - return reducer.reduceLiteralBooleanExpression(node); - }, - - LiteralInfinityExpression(reducer, node) { - return reducer.reduceLiteralInfinityExpression(node); - }, - - LiteralNullExpression(reducer, node) { - return reducer.reduceLiteralNullExpression(node); - }, - - LiteralNumericExpression(reducer, node) { - return reducer.reduceLiteralNumericExpression(node); - }, - - LiteralRegExpExpression(reducer, node) { - return reducer.reduceLiteralRegExpExpression(node); - }, - - LiteralStringExpression(reducer, node) { - return reducer.reduceLiteralStringExpression(node); - }, - - Method(reducer, node) { - return reducer.reduceMethod(node, { name: (() => this[node.name.type](reducer, node.name)), params: (() => this.FormalParameters(reducer, node.params)), body: (() => this.FunctionBody(reducer, node.body)) }); - }, - - Module(reducer, node) { - return reducer.reduceModule(node, { directives: node.directives.map(v => (() => this.Directive(reducer, v))), items: node.items.map(v => (() => this[v.type](reducer, v))) }); - }, - - NewExpression(reducer, node) { - return reducer.reduceNewExpression(node, { callee: (() => this[node.callee.type](reducer, node.callee)), arguments: node.arguments.map(v => (() => this[v.type](reducer, v))) }); - }, - - NewTargetExpression(reducer, node) { - return reducer.reduceNewTargetExpression(node); - }, - - ObjectAssignmentTarget(reducer, node) { - return reducer.reduceObjectAssignmentTarget(node, { properties: node.properties.map(v => (() => this[v.type](reducer, v))), rest: node.rest && (() => this[node.rest.type](reducer, node.rest)) }); - }, - - ObjectBinding(reducer, node) { - return reducer.reduceObjectBinding(node, { properties: node.properties.map(v => (() => this[v.type](reducer, v))), rest: node.rest && (() => this[node.rest.type](reducer, node.rest)) }); - }, - - ObjectExpression(reducer, node) { - return reducer.reduceObjectExpression(node, { properties: node.properties.map(v => (() => this[v.type](reducer, v))) }); - }, - - ReturnStatement(reducer, node) { - return reducer.reduceReturnStatement(node, { expression: node.expression && (() => this[node.expression.type](reducer, node.expression)) }); - }, - - Script(reducer, node) { - return reducer.reduceScript(node, { directives: node.directives.map(v => (() => this.Directive(reducer, v))), statements: node.statements.map(v => (() => this[v.type](reducer, v))) }); - }, - - Setter(reducer, node) { - return reducer.reduceSetter(node, { name: (() => this[node.name.type](reducer, node.name)), param: (() => this[node.param.type](reducer, node.param)), body: (() => this.FunctionBody(reducer, node.body)) }); - }, - - ShorthandProperty(reducer, node) { - return reducer.reduceShorthandProperty(node, { name: (() => this.IdentifierExpression(reducer, node.name)) }); - }, - - SpreadElement(reducer, node) { - return reducer.reduceSpreadElement(node, { expression: (() => this[node.expression.type](reducer, node.expression)) }); - }, - - SpreadProperty(reducer, node) { - return reducer.reduceSpreadProperty(node, { expression: (() => this[node.expression.type](reducer, node.expression)) }); - }, - - StaticMemberAssignmentTarget(reducer, node) { - return reducer.reduceStaticMemberAssignmentTarget(node, { object: (() => this[node.object.type](reducer, node.object)) }); - }, - - StaticMemberExpression(reducer, node) { - return reducer.reduceStaticMemberExpression(node, { object: (() => this[node.object.type](reducer, node.object)) }); - }, - - StaticPropertyName(reducer, node) { - return reducer.reduceStaticPropertyName(node); - }, - - Super(reducer, node) { - return reducer.reduceSuper(node); - }, - - SwitchCase(reducer, node) { - return reducer.reduceSwitchCase(node, { test: (() => this[node.test.type](reducer, node.test)), consequent: node.consequent.map(v => (() => this[v.type](reducer, v))) }); - }, - - SwitchDefault(reducer, node) { - return reducer.reduceSwitchDefault(node, { consequent: node.consequent.map(v => (() => this[v.type](reducer, v))) }); - }, - - SwitchStatement(reducer, node) { - return reducer.reduceSwitchStatement(node, { discriminant: (() => this[node.discriminant.type](reducer, node.discriminant)), cases: node.cases.map(v => (() => this.SwitchCase(reducer, v))) }); - }, - - SwitchStatementWithDefault(reducer, node) { - return reducer.reduceSwitchStatementWithDefault(node, { discriminant: (() => this[node.discriminant.type](reducer, node.discriminant)), preDefaultCases: node.preDefaultCases.map(v => (() => this.SwitchCase(reducer, v))), defaultCase: (() => this.SwitchDefault(reducer, node.defaultCase)), postDefaultCases: node.postDefaultCases.map(v => (() => this.SwitchCase(reducer, v))) }); - }, - - TemplateElement(reducer, node) { - return reducer.reduceTemplateElement(node); - }, - - TemplateExpression(reducer, node) { - return reducer.reduceTemplateExpression(node, { tag: node.tag && (() => this[node.tag.type](reducer, node.tag)), elements: node.elements.map(v => (() => this[v.type](reducer, v))) }); - }, - - ThisExpression(reducer, node) { - return reducer.reduceThisExpression(node); - }, - - ThrowStatement(reducer, node) { - return reducer.reduceThrowStatement(node, { expression: (() => this[node.expression.type](reducer, node.expression)) }); - }, - - TryCatchStatement(reducer, node) { - return reducer.reduceTryCatchStatement(node, { body: (() => this.Block(reducer, node.body)), catchClause: (() => this.CatchClause(reducer, node.catchClause)) }); - }, - - TryFinallyStatement(reducer, node) { - return reducer.reduceTryFinallyStatement(node, { body: (() => this.Block(reducer, node.body)), catchClause: node.catchClause && (() => this.CatchClause(reducer, node.catchClause)), finalizer: (() => this.Block(reducer, node.finalizer)) }); - }, - - UnaryExpression(reducer, node) { - return reducer.reduceUnaryExpression(node, { operand: (() => this[node.operand.type](reducer, node.operand)) }); - }, - - UpdateExpression(reducer, node) { - return reducer.reduceUpdateExpression(node, { operand: (() => this[node.operand.type](reducer, node.operand)) }); - }, - - VariableDeclaration(reducer, node) { - return reducer.reduceVariableDeclaration(node, { declarators: node.declarators.map(v => (() => this.VariableDeclarator(reducer, v))) }); - }, - - VariableDeclarationStatement(reducer, node) { - return reducer.reduceVariableDeclarationStatement(node, { declaration: (() => this.VariableDeclaration(reducer, node.declaration)) }); - }, - - VariableDeclarator(reducer, node) { - return reducer.reduceVariableDeclarator(node, { binding: (() => this[node.binding.type](reducer, node.binding)), init: node.init && (() => this[node.init.type](reducer, node.init)) }); - }, - - WhileStatement(reducer, node) { - return reducer.reduceWhileStatement(node, { test: (() => this[node.test.type](reducer, node.test)), body: (() => this[node.body.type](reducer, node.body)) }); - }, - - WithStatement(reducer, node) { - return reducer.reduceWithStatement(node, { object: (() => this[node.object.type](reducer, node.object)), body: (() => this[node.body.type](reducer, node.body)) }); - }, - - YieldExpression(reducer, node) { - return reducer.reduceYieldExpression(node, { expression: node.expression && (() => this[node.expression.type](reducer, node.expression)) }); - }, - - YieldGeneratorExpression(reducer, node) { - return reducer.reduceYieldGeneratorExpression(node, { expression: (() => this[node.expression.type](reducer, node.expression)) }); - }, -}; - -export function thunkedReduce(reducer, node) { - return director[node.type](reducer, node); -} diff --git a/docs/dist/shift-reducer/thunked-monoidal-reducer.js b/docs/dist/shift-reducer/thunked-monoidal-reducer.js deleted file mode 100644 index 721b5c18..00000000 --- a/docs/dist/shift-reducer/thunked-monoidal-reducer.js +++ /dev/null @@ -1,444 +0,0 @@ -// Generated by generate-monoidal-reducer.js -/** - * Copyright 2018 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import Shift from '../../_snowpack/pkg/shift-ast.js'; - -export default class MonoidalReducer { - constructor(monoid) { - let identity = monoid.empty(); - this.identity = identity; - - let concatThunk; - if (monoid.prototype && typeof monoid.prototype.concatThunk === 'function') { - concatThunk = Function.prototype.call.bind(monoid.prototype.concatThunk); - } else if (typeof monoid.concatThunk === 'function') { - concatThunk = monoid.concatThunk; - } else { - let concat; - if (monoid.prototype && typeof monoid.prototype.concat === 'function') { - concat = Function.prototype.call.bind(monoid.prototype.concat); - } else if (typeof monoid.concat === 'function') { - concat = monoid.concat; - } else { - throw new TypeError('Monoid must provide a `concatThunk` or `concat` method'); - } - if (typeof monoid.isAbsorbing === 'function') { - let isAbsorbing = monoid.isAbsorbing; - concatThunk = (a, b) => isAbsorbing(a) ? a : concat(a, b()); - } else { - concatThunk = (a, b) => concat(a, b()); - } - } - this.append = (...args) => args.reduce(concatThunk, identity); - } - - reduceArrayAssignmentTarget(node, { elements, rest }) { - return this.append(...elements.filter(n => n != null), rest == null ? () => this.identity : rest); - } - - reduceArrayBinding(node, { elements, rest }) { - return this.append(...elements.filter(n => n != null), rest == null ? () => this.identity : rest); - } - - reduceArrayExpression(node, { elements }) { - return this.append(...elements.filter(n => n != null)); - } - - reduceArrowExpression(node, { params, body }) { - return this.append(params, body); - } - - reduceAssignmentExpression(node, { binding, expression }) { - return this.append(binding, expression); - } - - reduceAssignmentTargetIdentifier(node) { - return this.identity; - } - - reduceAssignmentTargetPropertyIdentifier(node, { binding, init }) { - return this.append(binding, init == null ? () => this.identity : init); - } - - reduceAssignmentTargetPropertyProperty(node, { name, binding }) { - return this.append(name, binding); - } - - reduceAssignmentTargetWithDefault(node, { binding, init }) { - return this.append(binding, init); - } - - reduceAwaitExpression(node, { expression }) { - return expression(); - } - - reduceBinaryExpression(node, { left, right }) { - return this.append(left, right); - } - - reduceBindingIdentifier(node) { - return this.identity; - } - - reduceBindingPropertyIdentifier(node, { binding, init }) { - return this.append(binding, init == null ? () => this.identity : init); - } - - reduceBindingPropertyProperty(node, { name, binding }) { - return this.append(name, binding); - } - - reduceBindingWithDefault(node, { binding, init }) { - return this.append(binding, init); - } - - reduceBlock(node, { statements }) { - return this.append(...statements); - } - - reduceBlockStatement(node, { block }) { - return block(); - } - - reduceBreakStatement(node) { - return this.identity; - } - - reduceCallExpression(node, { callee, arguments: _arguments }) { - return this.append(callee, ..._arguments); - } - - reduceCatchClause(node, { binding, body }) { - return this.append(binding, body); - } - - reduceClassDeclaration(node, { name, super: _super, elements }) { - return this.append(name, _super == null ? () => this.identity : _super, ...elements); - } - - reduceClassElement(node, { method }) { - return method(); - } - - reduceClassExpression(node, { name, super: _super, elements }) { - return this.append(name == null ? () => this.identity : name, _super == null ? () => this.identity : _super, ...elements); - } - - reduceCompoundAssignmentExpression(node, { binding, expression }) { - return this.append(binding, expression); - } - - reduceComputedMemberAssignmentTarget(node, { object, expression }) { - return this.append(object, expression); - } - - reduceComputedMemberExpression(node, { object, expression }) { - return this.append(object, expression); - } - - reduceComputedPropertyName(node, { expression }) { - return expression(); - } - - reduceConditionalExpression(node, { test, consequent, alternate }) { - return this.append(test, consequent, alternate); - } - - reduceContinueStatement(node) { - return this.identity; - } - - reduceDataProperty(node, { name, expression }) { - return this.append(name, expression); - } - - reduceDebuggerStatement(node) { - return this.identity; - } - - reduceDirective(node) { - return this.identity; - } - - reduceDoWhileStatement(node, { body, test }) { - return this.append(body, test); - } - - reduceEmptyStatement(node) { - return this.identity; - } - - reduceExport(node, { declaration }) { - return declaration(); - } - - reduceExportAllFrom(node) { - return this.identity; - } - - reduceExportDefault(node, { body }) { - return body(); - } - - reduceExportFrom(node, { namedExports }) { - return this.append(...namedExports); - } - - reduceExportFromSpecifier(node) { - return this.identity; - } - - reduceExportLocalSpecifier(node, { name }) { - return name(); - } - - reduceExportLocals(node, { namedExports }) { - return this.append(...namedExports); - } - - reduceExpressionStatement(node, { expression }) { - return expression(); - } - - reduceForAwaitStatement(node, { left, right, body }) { - return this.append(left, right, body); - } - - reduceForInStatement(node, { left, right, body }) { - return this.append(left, right, body); - } - - reduceForOfStatement(node, { left, right, body }) { - return this.append(left, right, body); - } - - reduceForStatement(node, { init, test, update, body }) { - return this.append(init == null ? () => this.identity : init, test == null ? () => this.identity : test, update == null ? () => this.identity : update, body); - } - - reduceFormalParameters(node, { items, rest }) { - return this.append(...items, rest == null ? () => this.identity : rest); - } - - reduceFunctionBody(node, { directives, statements }) { - return this.append(...directives, ...statements); - } - - reduceFunctionDeclaration(node, { name, params, body }) { - return this.append(name, params, body); - } - - reduceFunctionExpression(node, { name, params, body }) { - return this.append(name == null ? () => this.identity : name, params, body); - } - - reduceGetter(node, { name, body }) { - return this.append(name, body); - } - - reduceIdentifierExpression(node) { - return this.identity; - } - - reduceIfStatement(node, { test, consequent, alternate }) { - return this.append(test, consequent, alternate == null ? () => this.identity : alternate); - } - - reduceImport(node, { defaultBinding, namedImports }) { - return this.append(defaultBinding == null ? () => this.identity : defaultBinding, ...namedImports); - } - - reduceImportNamespace(node, { defaultBinding, namespaceBinding }) { - return this.append(defaultBinding == null ? () => this.identity : defaultBinding, namespaceBinding); - } - - reduceImportSpecifier(node, { binding }) { - return binding(); - } - - reduceLabeledStatement(node, { body }) { - return body(); - } - - reduceLiteralBooleanExpression(node) { - return this.identity; - } - - reduceLiteralInfinityExpression(node) { - return this.identity; - } - - reduceLiteralNullExpression(node) { - return this.identity; - } - - reduceLiteralNumericExpression(node) { - return this.identity; - } - - reduceLiteralRegExpExpression(node) { - return this.identity; - } - - reduceLiteralStringExpression(node) { - return this.identity; - } - - reduceMethod(node, { name, params, body }) { - return this.append(name, params, body); - } - - reduceModule(node, { directives, items }) { - return this.append(...directives, ...items); - } - - reduceNewExpression(node, { callee, arguments: _arguments }) { - return this.append(callee, ..._arguments); - } - - reduceNewTargetExpression(node) { - return this.identity; - } - - reduceObjectAssignmentTarget(node, { properties, rest }) { - return this.append(...properties, rest == null ? () => this.identity : rest); - } - - reduceObjectBinding(node, { properties, rest }) { - return this.append(...properties, rest == null ? () => this.identity : rest); - } - - reduceObjectExpression(node, { properties }) { - return this.append(...properties); - } - - reduceReturnStatement(node, { expression }) { - return expression == null ? this.identity : expression(); - } - - reduceScript(node, { directives, statements }) { - return this.append(...directives, ...statements); - } - - reduceSetter(node, { name, param, body }) { - return this.append(name, param, body); - } - - reduceShorthandProperty(node, { name }) { - return name(); - } - - reduceSpreadElement(node, { expression }) { - return expression(); - } - - reduceSpreadProperty(node, { expression }) { - return expression(); - } - - reduceStaticMemberAssignmentTarget(node, { object }) { - return object(); - } - - reduceStaticMemberExpression(node, { object }) { - return object(); - } - - reduceStaticPropertyName(node) { - return this.identity; - } - - reduceSuper(node) { - return this.identity; - } - - reduceSwitchCase(node, { test, consequent }) { - return this.append(test, ...consequent); - } - - reduceSwitchDefault(node, { consequent }) { - return this.append(...consequent); - } - - reduceSwitchStatement(node, { discriminant, cases }) { - return this.append(discriminant, ...cases); - } - - reduceSwitchStatementWithDefault(node, { discriminant, preDefaultCases, defaultCase, postDefaultCases }) { - return this.append(discriminant, ...preDefaultCases, defaultCase, ...postDefaultCases); - } - - reduceTemplateElement(node) { - return this.identity; - } - - reduceTemplateExpression(node, { tag, elements }) { - return this.append(tag == null ? () => this.identity : tag, ...elements); - } - - reduceThisExpression(node) { - return this.identity; - } - - reduceThrowStatement(node, { expression }) { - return expression(); - } - - reduceTryCatchStatement(node, { body, catchClause }) { - return this.append(body, catchClause); - } - - reduceTryFinallyStatement(node, { body, catchClause, finalizer }) { - return this.append(body, catchClause == null ? () => this.identity : catchClause, finalizer); - } - - reduceUnaryExpression(node, { operand }) { - return operand(); - } - - reduceUpdateExpression(node, { operand }) { - return operand(); - } - - reduceVariableDeclaration(node, { declarators }) { - return this.append(...declarators); - } - - reduceVariableDeclarationStatement(node, { declaration }) { - return declaration(); - } - - reduceVariableDeclarator(node, { binding, init }) { - return this.append(binding, init == null ? () => this.identity : init); - } - - reduceWhileStatement(node, { test, body }) { - return this.append(test, body); - } - - reduceWithStatement(node, { object, body }) { - return this.append(object, body); - } - - reduceYieldExpression(node, { expression }) { - return expression == null ? this.identity : expression(); - } - - reduceYieldGeneratorExpression(node, { expression }) { - return expression(); - } -} diff --git a/docs/dist/shift-reducer/thunkify-class.js b/docs/dist/shift-reducer/thunkify-class.js deleted file mode 100644 index 4d091f21..00000000 --- a/docs/dist/shift-reducer/thunkify-class.js +++ /dev/null @@ -1,416 +0,0 @@ -// Generated by generate-thunkify.js -/** - * Copyright 2018 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default function thunkifyClass(reducerClass) { - return class extends reducerClass { - reduceArrayAssignmentTarget(node, { elements, rest }) { - return super.reduceArrayAssignmentTarget(node, { elements: elements.map(n => n == null ? null : n()), rest: rest == null ? null : rest() }); - } - - reduceArrayBinding(node, { elements, rest }) { - return super.reduceArrayBinding(node, { elements: elements.map(n => n == null ? null : n()), rest: rest == null ? null : rest() }); - } - - reduceArrayExpression(node, { elements }) { - return super.reduceArrayExpression(node, { elements: elements.map(n => n == null ? null : n()) }); - } - - reduceArrowExpression(node, { params, body }) { - return super.reduceArrowExpression(node, { params: params(), body: body() }); - } - - reduceAssignmentExpression(node, { binding, expression }) { - return super.reduceAssignmentExpression(node, { binding: binding(), expression: expression() }); - } - - reduceAssignmentTargetIdentifier(node) { - return super.reduceAssignmentTargetIdentifier(node); - } - - reduceAssignmentTargetPropertyIdentifier(node, { binding, init }) { - return super.reduceAssignmentTargetPropertyIdentifier(node, { binding: binding(), init: init == null ? null : init() }); - } - - reduceAssignmentTargetPropertyProperty(node, { name, binding }) { - return super.reduceAssignmentTargetPropertyProperty(node, { name: name(), binding: binding() }); - } - - reduceAssignmentTargetWithDefault(node, { binding, init }) { - return super.reduceAssignmentTargetWithDefault(node, { binding: binding(), init: init() }); - } - - reduceAwaitExpression(node, { expression }) { - return super.reduceAwaitExpression(node, { expression: expression() }); - } - - reduceBinaryExpression(node, { left, right }) { - return super.reduceBinaryExpression(node, { left: left(), right: right() }); - } - - reduceBindingIdentifier(node) { - return super.reduceBindingIdentifier(node); - } - - reduceBindingPropertyIdentifier(node, { binding, init }) { - return super.reduceBindingPropertyIdentifier(node, { binding: binding(), init: init == null ? null : init() }); - } - - reduceBindingPropertyProperty(node, { name, binding }) { - return super.reduceBindingPropertyProperty(node, { name: name(), binding: binding() }); - } - - reduceBindingWithDefault(node, { binding, init }) { - return super.reduceBindingWithDefault(node, { binding: binding(), init: init() }); - } - - reduceBlock(node, { statements }) { - return super.reduceBlock(node, { statements: statements.map(n => n()) }); - } - - reduceBlockStatement(node, { block }) { - return super.reduceBlockStatement(node, { block: block() }); - } - - reduceBreakStatement(node) { - return super.reduceBreakStatement(node); - } - - reduceCallExpression(node, { callee, arguments: _arguments }) { - return super.reduceCallExpression(node, { callee: callee(), arguments: _arguments.map(n => n()) }); - } - - reduceCatchClause(node, { binding, body }) { - return super.reduceCatchClause(node, { binding: binding(), body: body() }); - } - - reduceClassDeclaration(node, { name, super: _super, elements }) { - return super.reduceClassDeclaration(node, { name: name(), super: _super == null ? null : _super(), elements: elements.map(n => n()) }); - } - - reduceClassElement(node, { method }) { - return super.reduceClassElement(node, { method: method() }); - } - - reduceClassExpression(node, { name, super: _super, elements }) { - return super.reduceClassExpression(node, { name: name == null ? null : name(), super: _super == null ? null : _super(), elements: elements.map(n => n()) }); - } - - reduceCompoundAssignmentExpression(node, { binding, expression }) { - return super.reduceCompoundAssignmentExpression(node, { binding: binding(), expression: expression() }); - } - - reduceComputedMemberAssignmentTarget(node, { object, expression }) { - return super.reduceComputedMemberAssignmentTarget(node, { object: object(), expression: expression() }); - } - - reduceComputedMemberExpression(node, { object, expression }) { - return super.reduceComputedMemberExpression(node, { object: object(), expression: expression() }); - } - - reduceComputedPropertyName(node, { expression }) { - return super.reduceComputedPropertyName(node, { expression: expression() }); - } - - reduceConditionalExpression(node, { test, consequent, alternate }) { - return super.reduceConditionalExpression(node, { test: test(), consequent: consequent(), alternate: alternate() }); - } - - reduceContinueStatement(node) { - return super.reduceContinueStatement(node); - } - - reduceDataProperty(node, { name, expression }) { - return super.reduceDataProperty(node, { name: name(), expression: expression() }); - } - - reduceDebuggerStatement(node) { - return super.reduceDebuggerStatement(node); - } - - reduceDirective(node) { - return super.reduceDirective(node); - } - - reduceDoWhileStatement(node, { body, test }) { - return super.reduceDoWhileStatement(node, { body: body(), test: test() }); - } - - reduceEmptyStatement(node) { - return super.reduceEmptyStatement(node); - } - - reduceExport(node, { declaration }) { - return super.reduceExport(node, { declaration: declaration() }); - } - - reduceExportAllFrom(node) { - return super.reduceExportAllFrom(node); - } - - reduceExportDefault(node, { body }) { - return super.reduceExportDefault(node, { body: body() }); - } - - reduceExportFrom(node, { namedExports }) { - return super.reduceExportFrom(node, { namedExports: namedExports.map(n => n()) }); - } - - reduceExportFromSpecifier(node) { - return super.reduceExportFromSpecifier(node); - } - - reduceExportLocalSpecifier(node, { name }) { - return super.reduceExportLocalSpecifier(node, { name: name() }); - } - - reduceExportLocals(node, { namedExports }) { - return super.reduceExportLocals(node, { namedExports: namedExports.map(n => n()) }); - } - - reduceExpressionStatement(node, { expression }) { - return super.reduceExpressionStatement(node, { expression: expression() }); - } - - reduceForAwaitStatement(node, { left, right, body }) { - return super.reduceForAwaitStatement(node, { left: left(), right: right(), body: body() }); - } - - reduceForInStatement(node, { left, right, body }) { - return super.reduceForInStatement(node, { left: left(), right: right(), body: body() }); - } - - reduceForOfStatement(node, { left, right, body }) { - return super.reduceForOfStatement(node, { left: left(), right: right(), body: body() }); - } - - reduceForStatement(node, { init, test, update, body }) { - return super.reduceForStatement(node, { init: init == null ? null : init(), test: test == null ? null : test(), update: update == null ? null : update(), body: body() }); - } - - reduceFormalParameters(node, { items, rest }) { - return super.reduceFormalParameters(node, { items: items.map(n => n()), rest: rest == null ? null : rest() }); - } - - reduceFunctionBody(node, { directives, statements }) { - return super.reduceFunctionBody(node, { directives: directives.map(n => n()), statements: statements.map(n => n()) }); - } - - reduceFunctionDeclaration(node, { name, params, body }) { - return super.reduceFunctionDeclaration(node, { name: name(), params: params(), body: body() }); - } - - reduceFunctionExpression(node, { name, params, body }) { - return super.reduceFunctionExpression(node, { name: name == null ? null : name(), params: params(), body: body() }); - } - - reduceGetter(node, { name, body }) { - return super.reduceGetter(node, { name: name(), body: body() }); - } - - reduceIdentifierExpression(node) { - return super.reduceIdentifierExpression(node); - } - - reduceIfStatement(node, { test, consequent, alternate }) { - return super.reduceIfStatement(node, { test: test(), consequent: consequent(), alternate: alternate == null ? null : alternate() }); - } - - reduceImport(node, { defaultBinding, namedImports }) { - return super.reduceImport(node, { defaultBinding: defaultBinding == null ? null : defaultBinding(), namedImports: namedImports.map(n => n()) }); - } - - reduceImportNamespace(node, { defaultBinding, namespaceBinding }) { - return super.reduceImportNamespace(node, { defaultBinding: defaultBinding == null ? null : defaultBinding(), namespaceBinding: namespaceBinding() }); - } - - reduceImportSpecifier(node, { binding }) { - return super.reduceImportSpecifier(node, { binding: binding() }); - } - - reduceLabeledStatement(node, { body }) { - return super.reduceLabeledStatement(node, { body: body() }); - } - - reduceLiteralBooleanExpression(node) { - return super.reduceLiteralBooleanExpression(node); - } - - reduceLiteralInfinityExpression(node) { - return super.reduceLiteralInfinityExpression(node); - } - - reduceLiteralNullExpression(node) { - return super.reduceLiteralNullExpression(node); - } - - reduceLiteralNumericExpression(node) { - return super.reduceLiteralNumericExpression(node); - } - - reduceLiteralRegExpExpression(node) { - return super.reduceLiteralRegExpExpression(node); - } - - reduceLiteralStringExpression(node) { - return super.reduceLiteralStringExpression(node); - } - - reduceMethod(node, { name, params, body }) { - return super.reduceMethod(node, { name: name(), params: params(), body: body() }); - } - - reduceModule(node, { directives, items }) { - return super.reduceModule(node, { directives: directives.map(n => n()), items: items.map(n => n()) }); - } - - reduceNewExpression(node, { callee, arguments: _arguments }) { - return super.reduceNewExpression(node, { callee: callee(), arguments: _arguments.map(n => n()) }); - } - - reduceNewTargetExpression(node) { - return super.reduceNewTargetExpression(node); - } - - reduceObjectAssignmentTarget(node, { properties, rest }) { - return super.reduceObjectAssignmentTarget(node, { properties: properties.map(n => n()), rest: rest == null ? null : rest() }); - } - - reduceObjectBinding(node, { properties, rest }) { - return super.reduceObjectBinding(node, { properties: properties.map(n => n()), rest: rest == null ? null : rest() }); - } - - reduceObjectExpression(node, { properties }) { - return super.reduceObjectExpression(node, { properties: properties.map(n => n()) }); - } - - reduceReturnStatement(node, { expression }) { - return super.reduceReturnStatement(node, { expression: expression == null ? null : expression() }); - } - - reduceScript(node, { directives, statements }) { - return super.reduceScript(node, { directives: directives.map(n => n()), statements: statements.map(n => n()) }); - } - - reduceSetter(node, { name, param, body }) { - return super.reduceSetter(node, { name: name(), param: param(), body: body() }); - } - - reduceShorthandProperty(node, { name }) { - return super.reduceShorthandProperty(node, { name: name() }); - } - - reduceSpreadElement(node, { expression }) { - return super.reduceSpreadElement(node, { expression: expression() }); - } - - reduceSpreadProperty(node, { expression }) { - return super.reduceSpreadProperty(node, { expression: expression() }); - } - - reduceStaticMemberAssignmentTarget(node, { object }) { - return super.reduceStaticMemberAssignmentTarget(node, { object: object() }); - } - - reduceStaticMemberExpression(node, { object }) { - return super.reduceStaticMemberExpression(node, { object: object() }); - } - - reduceStaticPropertyName(node) { - return super.reduceStaticPropertyName(node); - } - - reduceSuper(node) { - return super.reduceSuper(node); - } - - reduceSwitchCase(node, { test, consequent }) { - return super.reduceSwitchCase(node, { test: test(), consequent: consequent.map(n => n()) }); - } - - reduceSwitchDefault(node, { consequent }) { - return super.reduceSwitchDefault(node, { consequent: consequent.map(n => n()) }); - } - - reduceSwitchStatement(node, { discriminant, cases }) { - return super.reduceSwitchStatement(node, { discriminant: discriminant(), cases: cases.map(n => n()) }); - } - - reduceSwitchStatementWithDefault(node, { discriminant, preDefaultCases, defaultCase, postDefaultCases }) { - return super.reduceSwitchStatementWithDefault(node, { discriminant: discriminant(), preDefaultCases: preDefaultCases.map(n => n()), defaultCase: defaultCase(), postDefaultCases: postDefaultCases.map(n => n()) }); - } - - reduceTemplateElement(node) { - return super.reduceTemplateElement(node); - } - - reduceTemplateExpression(node, { tag, elements }) { - return super.reduceTemplateExpression(node, { tag: tag == null ? null : tag(), elements: elements.map(n => n()) }); - } - - reduceThisExpression(node) { - return super.reduceThisExpression(node); - } - - reduceThrowStatement(node, { expression }) { - return super.reduceThrowStatement(node, { expression: expression() }); - } - - reduceTryCatchStatement(node, { body, catchClause }) { - return super.reduceTryCatchStatement(node, { body: body(), catchClause: catchClause() }); - } - - reduceTryFinallyStatement(node, { body, catchClause, finalizer }) { - return super.reduceTryFinallyStatement(node, { body: body(), catchClause: catchClause == null ? null : catchClause(), finalizer: finalizer() }); - } - - reduceUnaryExpression(node, { operand }) { - return super.reduceUnaryExpression(node, { operand: operand() }); - } - - reduceUpdateExpression(node, { operand }) { - return super.reduceUpdateExpression(node, { operand: operand() }); - } - - reduceVariableDeclaration(node, { declarators }) { - return super.reduceVariableDeclaration(node, { declarators: declarators.map(n => n()) }); - } - - reduceVariableDeclarationStatement(node, { declaration }) { - return super.reduceVariableDeclarationStatement(node, { declaration: declaration() }); - } - - reduceVariableDeclarator(node, { binding, init }) { - return super.reduceVariableDeclarator(node, { binding: binding(), init: init == null ? null : init() }); - } - - reduceWhileStatement(node, { test, body }) { - return super.reduceWhileStatement(node, { test: test(), body: body() }); - } - - reduceWithStatement(node, { object, body }) { - return super.reduceWithStatement(node, { object: object(), body: body() }); - } - - reduceYieldExpression(node, { expression }) { - return super.reduceYieldExpression(node, { expression: expression == null ? null : expression() }); - } - - reduceYieldGeneratorExpression(node, { expression }) { - return super.reduceYieldGeneratorExpression(node, { expression: expression() }); - } - }; -} diff --git a/docs/dist/shift-reducer/thunkify.js b/docs/dist/shift-reducer/thunkify.js deleted file mode 100644 index 80620d64..00000000 --- a/docs/dist/shift-reducer/thunkify.js +++ /dev/null @@ -1,416 +0,0 @@ -// Generated by generate-thunkify.js -/** - * Copyright 2018 Shape Security, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License") - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default function thunkify(reducer) { - return { - reduceArrayAssignmentTarget(node, { elements, rest }) { - return reducer.reduceArrayAssignmentTarget(node, { elements: elements.map(n => n == null ? null : n()), rest: rest == null ? null : rest() }); - }, - - reduceArrayBinding(node, { elements, rest }) { - return reducer.reduceArrayBinding(node, { elements: elements.map(n => n == null ? null : n()), rest: rest == null ? null : rest() }); - }, - - reduceArrayExpression(node, { elements }) { - return reducer.reduceArrayExpression(node, { elements: elements.map(n => n == null ? null : n()) }); - }, - - reduceArrowExpression(node, { params, body }) { - return reducer.reduceArrowExpression(node, { params: params(), body: body() }); - }, - - reduceAssignmentExpression(node, { binding, expression }) { - return reducer.reduceAssignmentExpression(node, { binding: binding(), expression: expression() }); - }, - - reduceAssignmentTargetIdentifier(node) { - return reducer.reduceAssignmentTargetIdentifier(node); - }, - - reduceAssignmentTargetPropertyIdentifier(node, { binding, init }) { - return reducer.reduceAssignmentTargetPropertyIdentifier(node, { binding: binding(), init: init == null ? null : init() }); - }, - - reduceAssignmentTargetPropertyProperty(node, { name, binding }) { - return reducer.reduceAssignmentTargetPropertyProperty(node, { name: name(), binding: binding() }); - }, - - reduceAssignmentTargetWithDefault(node, { binding, init }) { - return reducer.reduceAssignmentTargetWithDefault(node, { binding: binding(), init: init() }); - }, - - reduceAwaitExpression(node, { expression }) { - return reducer.reduceAwaitExpression(node, { expression: expression() }); - }, - - reduceBinaryExpression(node, { left, right }) { - return reducer.reduceBinaryExpression(node, { left: left(), right: right() }); - }, - - reduceBindingIdentifier(node) { - return reducer.reduceBindingIdentifier(node); - }, - - reduceBindingPropertyIdentifier(node, { binding, init }) { - return reducer.reduceBindingPropertyIdentifier(node, { binding: binding(), init: init == null ? null : init() }); - }, - - reduceBindingPropertyProperty(node, { name, binding }) { - return reducer.reduceBindingPropertyProperty(node, { name: name(), binding: binding() }); - }, - - reduceBindingWithDefault(node, { binding, init }) { - return reducer.reduceBindingWithDefault(node, { binding: binding(), init: init() }); - }, - - reduceBlock(node, { statements }) { - return reducer.reduceBlock(node, { statements: statements.map(n => n()) }); - }, - - reduceBlockStatement(node, { block }) { - return reducer.reduceBlockStatement(node, { block: block() }); - }, - - reduceBreakStatement(node) { - return reducer.reduceBreakStatement(node); - }, - - reduceCallExpression(node, { callee, arguments: _arguments }) { - return reducer.reduceCallExpression(node, { callee: callee(), arguments: _arguments.map(n => n()) }); - }, - - reduceCatchClause(node, { binding, body }) { - return reducer.reduceCatchClause(node, { binding: binding(), body: body() }); - }, - - reduceClassDeclaration(node, { name, super: _super, elements }) { - return reducer.reduceClassDeclaration(node, { name: name(), super: _super == null ? null : _super(), elements: elements.map(n => n()) }); - }, - - reduceClassElement(node, { method }) { - return reducer.reduceClassElement(node, { method: method() }); - }, - - reduceClassExpression(node, { name, super: _super, elements }) { - return reducer.reduceClassExpression(node, { name: name == null ? null : name(), super: _super == null ? null : _super(), elements: elements.map(n => n()) }); - }, - - reduceCompoundAssignmentExpression(node, { binding, expression }) { - return reducer.reduceCompoundAssignmentExpression(node, { binding: binding(), expression: expression() }); - }, - - reduceComputedMemberAssignmentTarget(node, { object, expression }) { - return reducer.reduceComputedMemberAssignmentTarget(node, { object: object(), expression: expression() }); - }, - - reduceComputedMemberExpression(node, { object, expression }) { - return reducer.reduceComputedMemberExpression(node, { object: object(), expression: expression() }); - }, - - reduceComputedPropertyName(node, { expression }) { - return reducer.reduceComputedPropertyName(node, { expression: expression() }); - }, - - reduceConditionalExpression(node, { test, consequent, alternate }) { - return reducer.reduceConditionalExpression(node, { test: test(), consequent: consequent(), alternate: alternate() }); - }, - - reduceContinueStatement(node) { - return reducer.reduceContinueStatement(node); - }, - - reduceDataProperty(node, { name, expression }) { - return reducer.reduceDataProperty(node, { name: name(), expression: expression() }); - }, - - reduceDebuggerStatement(node) { - return reducer.reduceDebuggerStatement(node); - }, - - reduceDirective(node) { - return reducer.reduceDirective(node); - }, - - reduceDoWhileStatement(node, { body, test }) { - return reducer.reduceDoWhileStatement(node, { body: body(), test: test() }); - }, - - reduceEmptyStatement(node) { - return reducer.reduceEmptyStatement(node); - }, - - reduceExport(node, { declaration }) { - return reducer.reduceExport(node, { declaration: declaration() }); - }, - - reduceExportAllFrom(node) { - return reducer.reduceExportAllFrom(node); - }, - - reduceExportDefault(node, { body }) { - return reducer.reduceExportDefault(node, { body: body() }); - }, - - reduceExportFrom(node, { namedExports }) { - return reducer.reduceExportFrom(node, { namedExports: namedExports.map(n => n()) }); - }, - - reduceExportFromSpecifier(node) { - return reducer.reduceExportFromSpecifier(node); - }, - - reduceExportLocalSpecifier(node, { name }) { - return reducer.reduceExportLocalSpecifier(node, { name: name() }); - }, - - reduceExportLocals(node, { namedExports }) { - return reducer.reduceExportLocals(node, { namedExports: namedExports.map(n => n()) }); - }, - - reduceExpressionStatement(node, { expression }) { - return reducer.reduceExpressionStatement(node, { expression: expression() }); - }, - - reduceForAwaitStatement(node, { left, right, body }) { - return reducer.reduceForAwaitStatement(node, { left: left(), right: right(), body: body() }); - }, - - reduceForInStatement(node, { left, right, body }) { - return reducer.reduceForInStatement(node, { left: left(), right: right(), body: body() }); - }, - - reduceForOfStatement(node, { left, right, body }) { - return reducer.reduceForOfStatement(node, { left: left(), right: right(), body: body() }); - }, - - reduceForStatement(node, { init, test, update, body }) { - return reducer.reduceForStatement(node, { init: init == null ? null : init(), test: test == null ? null : test(), update: update == null ? null : update(), body: body() }); - }, - - reduceFormalParameters(node, { items, rest }) { - return reducer.reduceFormalParameters(node, { items: items.map(n => n()), rest: rest == null ? null : rest() }); - }, - - reduceFunctionBody(node, { directives, statements }) { - return reducer.reduceFunctionBody(node, { directives: directives.map(n => n()), statements: statements.map(n => n()) }); - }, - - reduceFunctionDeclaration(node, { name, params, body }) { - return reducer.reduceFunctionDeclaration(node, { name: name(), params: params(), body: body() }); - }, - - reduceFunctionExpression(node, { name, params, body }) { - return reducer.reduceFunctionExpression(node, { name: name == null ? null : name(), params: params(), body: body() }); - }, - - reduceGetter(node, { name, body }) { - return reducer.reduceGetter(node, { name: name(), body: body() }); - }, - - reduceIdentifierExpression(node) { - return reducer.reduceIdentifierExpression(node); - }, - - reduceIfStatement(node, { test, consequent, alternate }) { - return reducer.reduceIfStatement(node, { test: test(), consequent: consequent(), alternate: alternate == null ? null : alternate() }); - }, - - reduceImport(node, { defaultBinding, namedImports }) { - return reducer.reduceImport(node, { defaultBinding: defaultBinding == null ? null : defaultBinding(), namedImports: namedImports.map(n => n()) }); - }, - - reduceImportNamespace(node, { defaultBinding, namespaceBinding }) { - return reducer.reduceImportNamespace(node, { defaultBinding: defaultBinding == null ? null : defaultBinding(), namespaceBinding: namespaceBinding() }); - }, - - reduceImportSpecifier(node, { binding }) { - return reducer.reduceImportSpecifier(node, { binding: binding() }); - }, - - reduceLabeledStatement(node, { body }) { - return reducer.reduceLabeledStatement(node, { body: body() }); - }, - - reduceLiteralBooleanExpression(node) { - return reducer.reduceLiteralBooleanExpression(node); - }, - - reduceLiteralInfinityExpression(node) { - return reducer.reduceLiteralInfinityExpression(node); - }, - - reduceLiteralNullExpression(node) { - return reducer.reduceLiteralNullExpression(node); - }, - - reduceLiteralNumericExpression(node) { - return reducer.reduceLiteralNumericExpression(node); - }, - - reduceLiteralRegExpExpression(node) { - return reducer.reduceLiteralRegExpExpression(node); - }, - - reduceLiteralStringExpression(node) { - return reducer.reduceLiteralStringExpression(node); - }, - - reduceMethod(node, { name, params, body }) { - return reducer.reduceMethod(node, { name: name(), params: params(), body: body() }); - }, - - reduceModule(node, { directives, items }) { - return reducer.reduceModule(node, { directives: directives.map(n => n()), items: items.map(n => n()) }); - }, - - reduceNewExpression(node, { callee, arguments: _arguments }) { - return reducer.reduceNewExpression(node, { callee: callee(), arguments: _arguments.map(n => n()) }); - }, - - reduceNewTargetExpression(node) { - return reducer.reduceNewTargetExpression(node); - }, - - reduceObjectAssignmentTarget(node, { properties, rest }) { - return reducer.reduceObjectAssignmentTarget(node, { properties: properties.map(n => n()), rest: rest == null ? null : rest() }); - }, - - reduceObjectBinding(node, { properties, rest }) { - return reducer.reduceObjectBinding(node, { properties: properties.map(n => n()), rest: rest == null ? null : rest() }); - }, - - reduceObjectExpression(node, { properties }) { - return reducer.reduceObjectExpression(node, { properties: properties.map(n => n()) }); - }, - - reduceReturnStatement(node, { expression }) { - return reducer.reduceReturnStatement(node, { expression: expression == null ? null : expression() }); - }, - - reduceScript(node, { directives, statements }) { - return reducer.reduceScript(node, { directives: directives.map(n => n()), statements: statements.map(n => n()) }); - }, - - reduceSetter(node, { name, param, body }) { - return reducer.reduceSetter(node, { name: name(), param: param(), body: body() }); - }, - - reduceShorthandProperty(node, { name }) { - return reducer.reduceShorthandProperty(node, { name: name() }); - }, - - reduceSpreadElement(node, { expression }) { - return reducer.reduceSpreadElement(node, { expression: expression() }); - }, - - reduceSpreadProperty(node, { expression }) { - return reducer.reduceSpreadProperty(node, { expression: expression() }); - }, - - reduceStaticMemberAssignmentTarget(node, { object }) { - return reducer.reduceStaticMemberAssignmentTarget(node, { object: object() }); - }, - - reduceStaticMemberExpression(node, { object }) { - return reducer.reduceStaticMemberExpression(node, { object: object() }); - }, - - reduceStaticPropertyName(node) { - return reducer.reduceStaticPropertyName(node); - }, - - reduceSuper(node) { - return reducer.reduceSuper(node); - }, - - reduceSwitchCase(node, { test, consequent }) { - return reducer.reduceSwitchCase(node, { test: test(), consequent: consequent.map(n => n()) }); - }, - - reduceSwitchDefault(node, { consequent }) { - return reducer.reduceSwitchDefault(node, { consequent: consequent.map(n => n()) }); - }, - - reduceSwitchStatement(node, { discriminant, cases }) { - return reducer.reduceSwitchStatement(node, { discriminant: discriminant(), cases: cases.map(n => n()) }); - }, - - reduceSwitchStatementWithDefault(node, { discriminant, preDefaultCases, defaultCase, postDefaultCases }) { - return reducer.reduceSwitchStatementWithDefault(node, { discriminant: discriminant(), preDefaultCases: preDefaultCases.map(n => n()), defaultCase: defaultCase(), postDefaultCases: postDefaultCases.map(n => n()) }); - }, - - reduceTemplateElement(node) { - return reducer.reduceTemplateElement(node); - }, - - reduceTemplateExpression(node, { tag, elements }) { - return reducer.reduceTemplateExpression(node, { tag: tag == null ? null : tag(), elements: elements.map(n => n()) }); - }, - - reduceThisExpression(node) { - return reducer.reduceThisExpression(node); - }, - - reduceThrowStatement(node, { expression }) { - return reducer.reduceThrowStatement(node, { expression: expression() }); - }, - - reduceTryCatchStatement(node, { body, catchClause }) { - return reducer.reduceTryCatchStatement(node, { body: body(), catchClause: catchClause() }); - }, - - reduceTryFinallyStatement(node, { body, catchClause, finalizer }) { - return reducer.reduceTryFinallyStatement(node, { body: body(), catchClause: catchClause == null ? null : catchClause(), finalizer: finalizer() }); - }, - - reduceUnaryExpression(node, { operand }) { - return reducer.reduceUnaryExpression(node, { operand: operand() }); - }, - - reduceUpdateExpression(node, { operand }) { - return reducer.reduceUpdateExpression(node, { operand: operand() }); - }, - - reduceVariableDeclaration(node, { declarators }) { - return reducer.reduceVariableDeclaration(node, { declarators: declarators.map(n => n()) }); - }, - - reduceVariableDeclarationStatement(node, { declaration }) { - return reducer.reduceVariableDeclarationStatement(node, { declaration: declaration() }); - }, - - reduceVariableDeclarator(node, { binding, init }) { - return reducer.reduceVariableDeclarator(node, { binding: binding(), init: init == null ? null : init() }); - }, - - reduceWhileStatement(node, { test, body }) { - return reducer.reduceWhileStatement(node, { test: test(), body: body() }); - }, - - reduceWithStatement(node, { object, body }) { - return reducer.reduceWithStatement(node, { object: object(), body: body() }); - }, - - reduceYieldExpression(node, { expression }) { - return reducer.reduceYieldExpression(node, { expression: expression == null ? null : expression() }); - }, - - reduceYieldGeneratorExpression(node, { expression }) { - return reducer.reduceYieldGeneratorExpression(node, { expression: expression() }); - }, - }; -} diff --git a/docs/dist/shift-traverser/index.js b/docs/dist/shift-traverser/index.js deleted file mode 100644 index d04494f1..00000000 --- a/docs/dist/shift-traverser/index.js +++ /dev/null @@ -1,61 +0,0 @@ -/* - Copyright (C) 2014 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -import Spec from '../../_snowpack/pkg/shift-spec.js'; -// import { version } from '../package.json' - -// Loading uncached estraverse for changing estraverse.Syntax. -import _estraverse from '../../_snowpack/pkg/estraverse.js'; - -const estraverse = _estraverse.cloneEnvironment(); - -// Adjust estraverse members. - -Object.keys(estraverse.Syntax) - .filter((key) => key !== 'Property') - .forEach((key) => { - delete estraverse.Syntax[key]; - delete estraverse.VisitorKeys[key]; - }); - -Object.assign( - estraverse.Syntax, - Object.keys(Spec).reduce((result, key) => { - result[key] = key; - return result; - }, {}) -); - -Object.assign( - estraverse.VisitorKeys, - Object.keys(Spec).reduce((result, key) => { - result[key] = Spec[key].fields.map((field) => field.name); - return result; - }, {}) -); - -// estraverse.version = version; -export default estraverse; - -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/docs/dist/static.js b/docs/dist/static.js deleted file mode 100644 index 86a98f1b..00000000 --- a/docs/dist/static.js +++ /dev/null @@ -1,53 +0,0 @@ -import * as Tone from "../_snowpack/pkg/tone.js"; -import {State, TimeSpan} from "../_snowpack/link/strudel.js"; -import {getPlayableNoteValue} from "../_snowpack/link/util.js"; -import {evaluate} from "./evaluate.js"; -async function playStatic(code) { - Tone.getTransport().cancel(); - Tone.getTransport().stop(); - let start, took; - const seconds = Number(prompt("How many seconds to run?")) || 60; - start = performance.now(); - console.log("evaluating.."); - const {pattern: pat} = await evaluate(code); - took = performance.now() - start; - console.log("evaluate took", took, "ms"); - console.log("querying.."); - start = performance.now(); - const events = pat?.query(new State(new TimeSpan(0, seconds)))?.filter((event) => event.part.begin.equals(event.whole.begin))?.map((event) => ({ - time: event.whole.begin.valueOf(), - duration: event.whole.end.sub(event.whole.begin).valueOf(), - value: event.value, - context: event.context - })); - took = performance.now() - start; - console.log("query took", took, "ms"); - console.log("scheduling.."); - start = performance.now(); - events.forEach((event) => { - Tone.getTransport().schedule((time) => { - try { - const {onTrigger, velocity} = event.context; - if (!onTrigger) { - if (defaultSynth) { - const note = getPlayableNoteValue(event); - defaultSynth.triggerAttackRelease(note, event.duration, time, velocity); - } else { - throw new Error("no defaultSynth passed to useRepl."); - } - } else { - onTrigger(time, event); - } - } catch (err) { - console.warn(err); - err.message = "unplayable event: " + err?.message; - console.error(err); - } - }, event.time); - }); - took = performance.now() - start; - console.log("scheduling took", took, "ms"); - console.log("now starting!"); - Tone.getTransport().start("+0.5"); -} -export default playStatic; diff --git a/docs/dist/tonal.js b/docs/dist/tonal.js deleted file mode 100644 index 971e2b90..00000000 --- a/docs/dist/tonal.js +++ /dev/null @@ -1,68 +0,0 @@ -import {Note, Interval, Scale} from "../_snowpack/pkg/@tonaljs/tonal.js"; -import {Pattern as _Pattern} from "../_snowpack/link/strudel.js"; -import {mod, tokenizeNote} from "../_snowpack/link/util.js"; -const Pattern = _Pattern; -export function scaleTranspose(scale, offset, note) { - let [tonic, scaleName] = Scale.tokenize(scale); - let {notes} = Scale.get(`${tonic} ${scaleName}`); - notes = notes.map((note2) => Note.get(note2).pc); - offset = Number(offset); - if (isNaN(offset)) { - throw new Error(`scale offset "${offset}" not a number`); - } - const {pc: fromPc, oct = 3} = Note.get(note); - const noteIndex = notes.indexOf(fromPc); - if (noteIndex === -1) { - throw new Error(`note "${note}" is not in scale "${scale}"`); - } - let i = noteIndex, o = oct, n = fromPc; - const direction = Math.sign(offset); - while (Math.abs(i - noteIndex) < Math.abs(offset)) { - i += direction; - const index = mod(i, notes.length); - if (direction < 0 && n[0] === "C") { - o += direction; - } - n = notes[index]; - if (direction > 0 && n[0] === "C") { - o += direction; - } - } - return n + o; -} -Pattern.prototype._transpose = function(intervalOrSemitones) { - return this._withEvent((event) => { - const interval = !isNaN(Number(intervalOrSemitones)) ? Interval.fromSemitones(intervalOrSemitones) : String(intervalOrSemitones); - if (typeof event.value === "number") { - const semitones = typeof interval === "string" ? Interval.semitones(interval) || 0 : interval; - return event.withValue(() => event.value + semitones); - } - return event.withValue(() => Note.simplify(Note.transpose(event.value, interval))); - }); -}; -Pattern.prototype._scaleTranspose = function(offset) { - return this._withEvent((event) => { - if (!event.context.scale) { - throw new Error("can only use scaleTranspose after .scale"); - } - if (typeof event.value !== "string") { - throw new Error("can only use scaleTranspose with notes"); - } - return event.withValue(() => scaleTranspose(event.context.scale, Number(offset), event.value)); - }); -}; -Pattern.prototype._scale = function(scale) { - return this._withEvent((event) => { - let note = event.value; - const asNumber = Number(note); - if (!isNaN(asNumber)) { - let [tonic, scaleName] = Scale.tokenize(scale); - const {pc, oct = 3} = Note.get(tonic); - note = scaleTranspose(pc + " " + scaleName, asNumber, pc + oct); - } - return event.withValue(() => note).setContext({...event.context, scale}); - }); -}; -Pattern.prototype.define("transpose", (a, pat) => pat.transpose(a), {composable: true, patternified: true}); -Pattern.prototype.define("scale", (a, pat) => pat.scale(a), {composable: true, patternified: true}); -Pattern.prototype.define("scaleTranspose", (a, pat) => pat.scaleTranspose(a), {composable: true, patternified: true}); diff --git a/docs/dist/tone.js b/docs/dist/tone.js deleted file mode 100644 index 535e0473..00000000 --- a/docs/dist/tone.js +++ /dev/null @@ -1,202 +0,0 @@ -import {Pattern as _Pattern} from "../_snowpack/link/strudel.js"; -import { - AutoFilter, - Filter, - Gain, - isNote, - Synth, - PolySynth, - MembraneSynth, - MetalSynth, - MonoSynth, - AMSynth, - DuoSynth, - FMSynth, - NoiseSynth, - PluckSynth, - Sampler, - getDestination, - Players -} from "../_snowpack/pkg/tone.js"; -import {Piano} from "../_snowpack/pkg/@tonejs/piano.js"; -import {getPlayableNoteValue} from "../_snowpack/link/util.js"; -export const defaultSynth = new PolySynth().chain(new Gain(0.5), getDestination()); -defaultSynth.set({ - oscillator: {type: "triangle"}, - envelope: { - release: 0.01 - } -}); -const Pattern = _Pattern; -Pattern.prototype.tone = function(instrument) { - return this._withEvent((event) => { - const onTrigger = (time, event2) => { - let note; - let velocity = event2.context?.velocity ?? 0.75; - switch (instrument.constructor.name) { - case "PluckSynth": - note = getPlayableNoteValue(event2); - instrument.triggerAttack(note, time); - break; - case "NoiseSynth": - instrument.triggerAttackRelease(event2.duration, time); - break; - case "Piano": - note = getPlayableNoteValue(event2); - instrument.keyDown({note, time, velocity}); - instrument.keyUp({note, time: time + event2.duration, velocity}); - break; - case "Sampler": - note = getPlayableNoteValue(event2); - instrument.triggerAttackRelease(note, event2.duration, time, velocity); - break; - case "Players": - if (!instrument.has(event2.value)) { - throw new Error(`name "${event2.value}" not defined for players`); - } - const player = instrument.player(event2.value); - player.start(time); - player.stop(time + event2.duration); - break; - default: - note = getPlayableNoteValue(event2); - instrument.triggerAttackRelease(note, event2.duration, time, velocity); - } - }; - return event.setContext({...event.context, instrument, onTrigger}); - }); -}; -Pattern.prototype.define("tone", (type, pat) => pat.tone(type), {composable: true, patternified: false}); -export const amsynth = (options) => new AMSynth(options); -export const duosynth = (options) => new DuoSynth(options); -export const fmsynth = (options) => new FMSynth(options); -export const membrane = (options) => new MembraneSynth(options); -export const metal = (options) => new MetalSynth(options); -export const monosynth = (options) => new MonoSynth(options); -export const noise = (options) => new NoiseSynth(options); -export const pluck = (options) => new PluckSynth(options); -export const polysynth = (options) => new PolySynth(options); -export const sampler = (options, baseUrl) => new Promise((resolve) => { - const s = new Sampler(options, () => resolve(s), baseUrl); -}); -export const players = (options, baseUrl = "") => { - options = !baseUrl ? options : Object.fromEntries(Object.entries(options).map(([key, value]) => [key, baseUrl + value])); - return new Promise((resolve) => { - const s = new Players(options, () => resolve(s)); - }); -}; -export const synth = (options) => new Synth(options); -export const piano = async (options = {velocities: 1}) => { - const p = new Piano(options); - await p.load(); - return p; -}; -export const vol = (v) => new Gain(v); -export const lowpass = (v) => new Filter(v, "lowpass"); -export const highpass = (v) => new Filter(v, "highpass"); -export const adsr = (a, d = 0.1, s = 0.4, r = 0.01) => ({envelope: {attack: a, decay: d, sustain: s, release: r}}); -export const osc = (type) => ({oscillator: {type}}); -export const out = () => getDestination(); -const chainable = function(instr) { - const _chain = instr.chain.bind(instr); - let chained = []; - instr.chain = (...args) => { - chained = chained.concat(args); - instr.disconnect(); - return _chain(...chained, getDestination()); - }; - instr.filter = (freq = 1e3, type = "lowpass") => instr.chain(new Filter(freq, type)); - instr.gain = (gain2 = 0.9) => instr.chain(new Gain(gain2)); - return instr; -}; -export const poly = (type) => { - const s = new PolySynth(Synth, {oscillator: {type}}).toDestination(); - return chainable(s); -}; -Pattern.prototype._poly = function(type = "triangle") { - const instrumentConfig = { - oscillator: {type}, - envelope: {attack: 0.01, decay: 0.01, sustain: 0.6, release: 0.01} - }; - if (!this.instrument) { - this.instrument = poly(type); - } - return this._withEvent((event) => { - const onTrigger = (time, event2) => { - this.instrument.set(instrumentConfig); - this.instrument.triggerAttackRelease(event2.value, event2.duration, time); - }; - return event.setContext({...event.context, instrumentConfig, onTrigger}); - }); -}; -Pattern.prototype.define("poly", (type, pat) => pat.poly(type), {composable: true, patternified: true}); -const getTrigger = (getChain, value) => (time, event) => { - const chain = getChain(); - if (!isNote(value)) { - throw new Error("not a note: " + value); - } - chain.triggerAttackRelease(value, event.duration, time); - setTimeout(() => { - chain.dispose(); - }, event.duration * 2e3); -}; -Pattern.prototype._synth = function(type = "triangle") { - return this._withEvent((event) => { - const instrumentConfig = { - oscillator: {type}, - envelope: {attack: 0.01, decay: 0.01, sustain: 0.6, release: 0.01} - }; - const getInstrument = () => { - const instrument = new Synth(); - instrument.set(instrumentConfig); - return instrument; - }; - const onTrigger = getTrigger(() => getInstrument().toDestination(), event.value); - return event.setContext({...event.context, getInstrument, instrumentConfig, onTrigger}); - }); -}; -Pattern.prototype.adsr = function(attack = 0.01, decay = 0.01, sustain = 0.6, release = 0.01) { - return this._withEvent((event) => { - if (!event.context.getInstrument) { - throw new Error("cannot chain adsr: need instrument first (like synth)"); - } - const instrumentConfig = {...event.context.instrumentConfig, envelope: {attack, decay, sustain, release}}; - const getInstrument = () => { - const instrument = event.context.getInstrument(); - instrument.set(instrumentConfig); - return instrument; - }; - const onTrigger = getTrigger(() => getInstrument().toDestination(), event.value); - return event.setContext({...event.context, getInstrument, instrumentConfig, onTrigger}); - }); -}; -Pattern.prototype.chain = function(...effectGetters) { - return this._withEvent((event) => { - if (!event.context?.getInstrument) { - throw new Error("cannot chain: need instrument first (like synth)"); - } - const chain = (event.context.chain || []).concat(effectGetters); - const getChain = () => { - const effects = chain.map((getEffect) => getEffect()); - return event.context.getInstrument().chain(...effects, getDestination()); - }; - const onTrigger = getTrigger(getChain, event.value); - return event.setContext({...event.context, getChain, onTrigger, chain}); - }); -}; -export const autofilter = (freq = 1) => () => new AutoFilter(freq).start(); -export const filter = (freq = 1, q = 1, type = "lowpass") => () => new Filter(freq, type); -export const gain = (gain2 = 0.9) => () => new Gain(gain2); -Pattern.prototype._gain = function(g) { - return this.chain(gain(g)); -}; -Pattern.prototype._filter = function(freq, q, type = "lowpass") { - return this.chain(filter(freq, q, type)); -}; -Pattern.prototype._autofilter = function(g) { - return this.chain(autofilter(g)); -}; -Pattern.prototype.define("synth", (type, pat) => pat.synth(type), {composable: true, patternified: true}); -Pattern.prototype.define("gain", (gain2, pat) => pat.synth(gain2), {composable: true, patternified: true}); -Pattern.prototype.define("filter", (cutoff, pat) => pat.filter(cutoff), {composable: true, patternified: true}); -Pattern.prototype.define("autofilter", (cutoff, pat) => pat.filter(cutoff), {composable: true, patternified: true}); diff --git a/docs/dist/tune.js b/docs/dist/tune.js deleted file mode 100644 index 4dd2850e..00000000 --- a/docs/dist/tune.js +++ /dev/null @@ -1,14 +0,0 @@ -import Tune from "./tunejs.js"; -import {Pattern} from "../_snowpack/link/strudel.js"; -Pattern.prototype._tune = function(scale, tonic = 220) { - const tune = new Tune(); - if (!tune.isValidScale(scale)) { - throw new Error('not a valid tune.js scale name: "' + scale + '". See http://abbernie.github.io/tune/scales.html'); - } - tune.loadScale(scale); - tune.tonicize(tonic); - return this._asNumber()._withEvent((event) => { - return event.withValue(() => tune.note(event.value)).setContext({...event.context, type: "frequency"}); - }); -}; -Pattern.prototype.define("tune", (scale, pat) => pat.tune(scale), {composable: true, patternified: true}); diff --git a/docs/dist/tunejs.js b/docs/dist/tunejs.js deleted file mode 100644 index 80bf043a..00000000 --- a/docs/dist/tunejs.js +++ /dev/null @@ -1,233 +0,0 @@ - -// See all scales at: http://abbernie.github.io/tune/scales.html -export default function Tune(){ - - // the scale as ratios - this.scale = [] - - // i/o modes - this.mode = { - output: "frequency", - input: "step" - } - - // ET major, for reference - this.etmajor = [ 261.62558, - 293.664764, - 329.627563, - 349.228241, - 391.995422, - 440, - 493.883301, - 523.25116 - ] - - // Root frequency. - this.tonic = 440 // * Math.pow(2,(60-69)/12); - - // console.log("{{{{ Tune.js v0.1 Loaded }}}}"); - -} - -/* Set the tonic frequency */ - -Tune.prototype.tonicize = function(newTonic) { - this.tonic = newTonic -} - - -/* Return data in the mode you are in (freq, ratio, or midi) */ - -Tune.prototype.note = function(input,octave){ - - var newvalue; - - if (this.mode.output == "frequency") { - newvalue = this.frequency(input,octave) - } else if (this.mode.output == "ratio") { - newvalue = this.ratio(input,octave) - } else if (this.mode.output == "MIDI") { - newvalue = this.MIDI(input,octave) - } else { - newvalue = this.frequency(input,octave) - } - - return newvalue; - -} - - -/* Return freq data */ - -Tune.prototype.frequency = function(stepIn, octaveIn) { - - if (this.mode.input == "midi" || this.mode.input == "MIDI" ) { - this.stepIn += 60 - } - - // what octave is our input - var octave = Math.floor(stepIn/this.scale.length) - - if (octaveIn) { - octave += octaveIn - } - - // which scale degree (0 - scale length) is our input - var scaleDegree = stepIn % this.scale.length - - while (scaleDegree < 0) { - scaleDegree += this.scale.length - } - - var freq = this.tonic*this.scale[scaleDegree] - - freq = freq*(Math.pow(2,octave)) - - // truncate irrational numbers - freq = Math.floor(freq*100000000000)/100000000000 - - return freq - -} - -/* Force return ratio data */ - -Tune.prototype.ratio = function(stepIn, octaveIn) { - - if (this.mode.input == "midi" || this.mode.input == "MIDI" ) { - this.stepIn += 60 - } - - // what octave is our input - var octave = Math.floor(stepIn/this.scale.length) - - if (octaveIn) { - octave += octaveIn - } - - // which scale degree (0 - scale length) is our input - var scaleDegree = stepIn % this.scale.length - - // what ratio is our input to our key - var ratio = Math.pow(2,octave)*this.scale[scaleDegree] - - ratio = Math.floor(ratio*100000000000)/100000000000 - - return ratio - -} - -/* Force return adjusted MIDI data */ - -Tune.prototype.MIDI = function(stepIn,octaveIn) { - - var newvalue = this.frequency(stepIn,octaveIn) - - var n = 69 + 12*Math.log(newvalue/440)/Math.log(2) - - n = Math.floor(n*1000000000)/1000000000 - - return n - -} - -/* Load a new scale */ - -Tune.prototype.loadScale = function(name){ - - /* load the scale */ - var freqs = TuningList[name].frequencies - this.scale = [] - for (var i=0;i[1, 1, -1]->[0, 1, -1]->[0, 0, -1]->[0, 0, 0]->[0, -1, 0],[0, -1, 1]->[0, -2, 1]->[-1, -2, 1]"},"breedt1":{"frequencies":[261.6255653006,275.62199471997,292.34127285051,310.07474405997,326.6631048533,348.83408706747,367.49599295996,391.11111150212,413.43299207996,437.02884834934,465.11211608996,489.99465727995,523.2511306012],"description":"Graham Breed's 1/4 P temperament, TL 10-06-99"},"breedt2":{"frequencies":[261.6255653006,276.37000081643,293.53214922797,310.91625060765,328.43856194079,349.78078158391,368.4933346061,392.4383479509,414.55500101742,439.10654054756,466.37437567834,492.65784266492,523.2511306012],"description":"Graham Breed's 1/5 P temperament, TL 10-06-99"},"breedt3":{"frequencies":[261.6255653006,276.55731914056,293.33333347996,311.12698372208,328.88393162803,350.01785633742,368.74309237173,392.4383479509,414.83597850347,438.51190905657,466.69047534984,491.65745674141,523.2511306012],"description":"Graham Breed's other 1/4 P temperament, TL 10-06-99"},"brown":{"frequencies":[261.6255653006,272.52663052146,275.62199471997,275.93321340298,279.38237857051,287.10624449997,290.69507255622,291.02331101095,294.32876096318,306.24666079997,306.59245933664,310.07474405997,310.42486507835,322.99452506247,327.03195662575,331.11985608357,344.52749339997,344.91651675372,348.83408706747,349.22797321314,363.36884069528,367.49599295996,367.91095120397,372.50983809402,382.80832599996,387.59343007496,388.03108134794,392.4383479509,408.78994578219,413.43299207996,413.89982010446,430.65936674996,436.04260883433,436.53496651643,441.49314144476,459.36999119996,459.88868900496,465.11211608996,465.63729761752,484.4917875937,489.99465727995,490.54793493862,496.67978412536,516.79124009995,517.37477513058,523.2511306012],"description":"Tuning of Colin Brown's Voice Harmonium, Glasgow. Helmholtz/Ellis p. 470-473"},"bruder":{"frequencies":[261.6255653006,276.38325105256,293.66476791741,310.22971009486,327.53979283172,349.02656754477,368.60786575306,391.65594491223,414.34624765043,439.23819834286,465.62553897253,491.60634075178,523.2511306012],"description":"Ignaz Bruder organ temperament (1829) according to P. Vier"},"burma3":{"frequencies":[261.6255653006,287.71029735626,317.68827763215,350.39147881787,389.32370520689,429.81331927092,476.14308821464,523.2511306012],"description":"Burmese scale, von Hornbostel"},"burt-forks":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,290.69507255622,294.32876096318,313.95067836072,327.03195662575,336.37572681506,348.83408706747,366.27579142084,373.75080757229,392.4383479509,406.97310157871,418.60090448096,436.04260883433,465.11211608996,470.92601754108,490.54793493862,504.56359022259,523.2511306012],"description":"Warren Burt 19-tone Forks. Interval 5(3): pp. 13+23 Winter 1986-87"},"burt1":{"frequencies":[261.6255653006,272.09058791262,283.42769574232,295.75063903546,309.19384990071,340.11323489078,358.01393146398,377.90359432309,415.52295665389,425.14154361347,453.48431318771,485.87604984397,523.2511306012],"description":"W. Burt's 13diatsub #1"},"burt10":{"frequencies":[261.6255653006,265.11390617127,268.69652652494,272.3773008609,276.16031892841,355.06326719367,368.21375857121,382.37582620857,386.08821287079,389.87339142835,393.73352401674,397.67085925691,523.2511306012],"description":"W. Burt's 19enhsub #10"},"burt11":{"frequencies":[261.6255653006,344.24416486921,347.6866065179,351.12904816659,354.57148981529,358.01393146398,371.78369805875,385.55346465352,495.71159741166,502.59648070905,509.48136400643,516.36624730382,523.2511306012],"description":"W. Burt's 19enhharm #11"},"burt12":{"frequencies":[261.6255653006,302.93486508491,316.70463167967,330.47439827444,344.24416486921,358.01393146398,371.78369805875,385.55346465352,440.63253103259,468.17206422213,495.71159741166,509.48136400643,523.2511306012],"description":"W. Burt's 19diatharm #12"},"burt13":{"frequencies":[261.6255653006,273.51763645063,286.54228580542,293.53112204458,300.86940009569,334.29933343966,353.96400011258,376.08675011961,401.15920012759,429.81342870813,445.73244458621,462.87600014722,523.2511306012],"description":"W. Burt's 23diatsub #13"},"burt14":{"frequencies":[261.6255653006,264.50057151269,267.43946675172,270.4444045804,273.51763645063,334.29933343966,353.96400011258,376.08675011961,382.05638107389,388.21858076863,394.58281979763,401.15920012759,523.2511306012],"description":"W. Burt's 23enhsub #14"},"burt15":{"frequencies":[261.6255653006,341.25073734861,346.93824963775,352.6257619269,358.31327421604,364.00078650518,386.75083566176,409.50088481833,500.50108144463,506.18859373377,511.87610602291,517.56361831206,523.2511306012],"description":"W. Burt's 23enhharm #15"},"burt16":{"frequencies":[261.6255653006,295.75063903546,307.12566361375,318.50068819203,341.25073734861,364.00078650518,386.75083566176,409.50088481833,455.00098313148,466.37600770977,477.75103228805,500.50108144463,523.2511306012],"description":"W. Burt's 23diatharm #16"},"burt17":{"frequencies":[261.6255653006,262.27760655527,262.77528702311,280.51080915002,281.04308772525,281.33584094163,286.12102533302,286.66394947976,306.91182648178,308.56189006502,309.14739649778,336.61297098002,337.2517052703,337.60300912996,338.42271813583,339.41807907152,363.01398831179,369.18841978454,370.27426807802,396.01525997649,398.14437427744,399.31538714296,403.93556517602,406.10726176299,434.33931739357,434.79175418253,435.61678597414,437.95881170519,475.21831197179,476.86837555503,477.77324913293,478.27092960078,479.17846457156,521.20718087229,521.75010501903,522.74014316897,523.2511306012],"description":"W. Burt's \"2 out of 3,5,11,17,31 dekany\" CPS with 1/1=3/1. 1/1 vol. 10(1) '98"},"burt18":{"frequencies":[261.6255653006,268.26840191956,269.80136421624,270.50397193556,275.42222597075,281.04308772525,286.15296204753,295.09524211152,300.46061014991,306.59245933664,309.14739649778,314.76825825228,321.92208230347,324.60476632267,337.2517052703,343.38355445704,344.27778246344,354.11429053382,357.69120255941,367.91095120397,370.97687579734,375.57576268738,393.46032281536,404.70204632437,413.13333895612,421.56463158788,429.2294430713,432.80635509689,449.66894036041,463.72109474667,472.15238737843,490.54793493862,491.82540351919,500.76768358318,505.87755790546,515.07533168556,523.2511306012],"description":"W. Burt's \"2 out of 1,3,5,7,11 dekany\" CPS with 1/1=1/1. 1/1 vol. 10(1) '98"},"burt19":{"frequencies":[261.6255653006,268.26840191956,286.15296204753,294.32876096318,300.46061014991,306.59245933664,321.92208230347,327.03195662575,343.38355445704,357.69120255941,367.91095120397,375.57576268738,392.4383479509,400.61414686654,408.78994578219,429.2294430713,457.84473927605,490.54793493862,500.76768358318,515.07533168556,523.2511306012],"description":"W. Burt's \"2 out of 2,3,4,5,7 dekany\" CPS with 1/1=1/1. 1/1 vol. 10(1) '98"},"burt2":{"frequencies":[261.6255653006,264.16561933264,266.75547834571,269.39662169567,272.09058791262,340.11323489078,344.41846571218,348.83408706747,353.36439988652,358.01393146398,412.25846653428,485.87604984397,523.2511306012],"description":"W. Burt's 13enhsub #2"},"burt20":{"frequencies":[261.6255653006,269.10058145205,279.06726965397,279.38237857051,294.32876096318,298.00787047521,330.74639366397,335.25885428462,367.91095120397,376.74081403286,412.06026534844,418.60090448096,523.2511306012],"description":"Warren Burt tuning for \"Commas\" (1993) 1/1=263. XH 16"},"burt3":{"frequencies":[261.6255653006,281.75060878526,332.06321749692,382.37582620857,387.40708707973,392.4383479509,397.46960882207,402.50086969323,503.12608711654,508.1573479877,513.18860885887,518.21986973003,523.2511306012],"description":"W. Burt's 13enhharm #3"},"burt4":{"frequencies":[261.6255653006,281.75060878526,301.87565226992,322.00069575458,342.12573923925,362.25078272391,382.37582620857,402.50086969323,442.75095666255,462.87600014722,483.00104363188,503.12608711654,523.2511306012],"description":"W. Burt's 13diatharm #4, see his post 3/30/94 in Tuning Digest #57"},"burt5":{"frequencies":[261.6255653006,277.97716313189,296.50897400735,317.68818643644,342.12573923925,277.97716313189,386.75083566176,404.33041910093,423.58424858192,444.76346101102,468.17206422213,494.18162334558,523.2511306012],"description":"W. Burt's 17diatsub #5"},"burt6":{"frequencies":[261.6255653006,265.53042448419,269.55361273395,273.7005913914,277.97716313189,370.63621750918,386.75083566176,404.33041910093,408.97789518255,413.73345210327,418.60090448096,423.58424858192,523.2511306012],"description":"W. Burt's 17enhsub #6"},"burt7":{"frequencies":[261.6255653006,323.18452184192,327.03195662575,330.87939140958,334.72682619341,338.57426097725,353.96400011258,369.35373924791,492.47165233054,500.16652189821,507.86139146587,515.55626103354,523.2511306012],"description":"W. Burt's 17enhharm #7"},"burt8":{"frequencies":[261.6255653006,277.01530443593,292.40504357126,307.79478270659,323.18452184192,338.57426097725,353.96400011258,369.35373924791,400.13321751856,430.91269578922,461.69217405988,492.47165233054,523.2511306012],"description":"W. Burt's 17diatharm #8"},"burt9":{"frequencies":[261.6255653006,268.69652652494,276.16031892841,292.40504357126,310.68035879446,355.06326719367,368.21375857121,382.37582620857,397.67085925691,414.24047839262,432.2509339749,451.89870370104,523.2511306012],"description":"W. Burt's 19diatsub #9"},"burt_fibo":{"frequencies":[261.6255653006,277.97716313189,294.32876096318,311.70233365892,327.03195662575,343.38355445704,363.82305174615,385.28452389971,392.4383479509,425.14154361347,449.66894036041,476.24028683625,523.2511306012],"description":"Warren Burt, 3/2+5/3+8/5+etc. \"Recurrent Sequences\", 2002"},"burt_fibo23":{"frequencies":[261.6255653006,267.05480676802,277.97716313189,282.81557538079,294.32876096318,299.5065008038,311.70233365892,327.03195662575,330.09788121912,343.38355445704,349.5792770728,363.82305174615,370.21039464899,385.28452389971,392.4383479509,408.02346463385,425.14154361347,432.10374737758,449.66894036041,457.60521391719,476.24028683625,484.61169812829,504.34459560877,523.2511306012],"description":"Warren Burt, 23-tone Fibonacci scale. \"Recurrent Sequences\", 2002"},"burt_primes":{"frequencies":[261.6255653006,267.75741448733,273.88926367407,277.97716313189,280.0211128608,284.10901231862,290.24086150535,298.416660421,302.50455987882,304.54850960773,308.63640906555,310.68035879446,320.90010743902,322.94405716793,327.03195662575,333.16380581248,335.20775554139,339.29565499922,341.33960472813,351.55935337268,353.60330310159,359.73515228832,363.82305174615,365.86700147506,369.95490093288,376.08675011961,384.26254903526,390.39439822199,392.4383479509,394.48229767981,396.52624740872,402.65809659545,406.74599605328,412.87784524001,421.05364415565,425.14154361347,431.27339280021,433.31734252912,437.40524198694,445.58104090258,455.80078954714,457.84473927605,461.93263873387,463.97658846278,468.0644879206,474.19633710734,476.24028683625,482.37213602298,488.50398520971,492.59188466754,498.72373385427,506.89953276991,513.03138195665,519.16323114338,523.2511306012],"description":"Warren Burt, primes until 251. \"Some Numbers\", Dec. 2002"},"bushmen":{"frequencies":[261.6255653006,347.0163224393,394.26624244126,453.9405988926,523.2511306012],"description":"Observed scale of South-African bushmen, almost (4 notes) equal pentatonic"},"dan_semantic":{"frequencies":[261.6255653006,272.52663052146,275.62199471997,279.06726965397,290.69507255622,294.32876096318,297.67175429757,306.59245933664,310.07474405997,313.95067836072,322.99452506247,327.03195662575,331.11985608357,344.91651675372,348.83408706747,353.19451315581,363.36884069528,367.91095120397,372.08969287196,387.59343007496,392.4383479509,397.34382730029,408.78994578219,413.43299207996,418.60090448096,430.65936674996,436.04260883433,441.49314144476,459.88868900496,465.11211608996,470.92601754108,484.4917875937,490.54793493862,496.67978412536,516.79124009995,523.2511306012],"description":"The Semantic Scale, from Alain Dani�lou: \"S�mantique Musicale\" (1967)"},"danielou5_53":{"frequencies":[261.6255653006,264.89588486686,267.90457886781,272.52663052146,275.62199471997,279.06726965397,282.55561052465,285.76488412567,290.69507255622,294.32876096318,297.67175429757,301.39265122629,306.59245933664,310.07474405997,313.95067836072,317.87506184023,322.99452506247,327.03195662575,331.11985608357,334.88072358477,340.65828815182,344.52749339997,348.83408706747,353.19451315581,357.20610515709,363.36884069528,367.91095120397,372.08969287196,376.74081403286,383.2405741708,387.59343007496,392.4383479509,397.34382730029,401.85686830172,408.78994578219,413.43299207996,418.60090448096,423.83341578697,430.65936674996,436.04260883433,441.49314144476,446.50763144636,454.2110508691,459.88868900496,465.11211608996,470.92601754108,479.0507177135,484.4917875937,490.54793493862,496.67978412536,502.32108537715,510.98743222773,516.79124009995,523.2511306012],"description":"Dani�lou's Harmonic Division in 5-limit, symmetrized"},"danielou_53":{"frequencies":[261.6255653006,264.89588486686,267.43946675172,272.52663052146,275.62199471997,279.06726965397,282.55561052465,287.78812183066,290.69507255622,294.32876096318,297.67175429757,301.87565226992,306.59245933664,310.07474405997,313.95067836072,318.93402246168,322.99452506247,327.03195662575,331.11985608357,334.88072358477,340.65828815182,344.52749339997,348.83408706747,353.19451315581,357.20610515709,363.36884069528,367.91095120397,372.08969287196,376.74081403286,383.2405741708,387.59343007496,392.4383479509,397.34382730029,401.85686830172,408.78994578219,413.43299207996,418.60090448096,423.83341578697,430.65936674996,436.04260883433,441.49314144476,446.50763144636,454.2110508691,459.88868900496,465.11211608996,470.92601754108,479.64686971777,484.4917875937,490.54793493862,496.67978412536,502.32108537715,510.98743222773,516.79124009995,523.2511306012],"description":"Dani�lou's Harmonic Division of the Octave, see p. 153"},"darreg":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,290.69507255622,294.32876096318,306.59245933664,313.95067836072,327.03195662575,348.83408706747,367.91095120397,372.08969287196,392.4383479509,408.78994578219,418.60090448096,436.04260883433,441.49314144476,459.88868900496,470.92601754108,490.54793493862,523.2511306012],"description":"This set of 19 ratios in 5-limit JI is for his megalyra family"},"darreg_ennea":{"frequencies":[261.6255653006,269.29177952703,277.18263097687,293.66476791741,349.22823143301,391.99543598175,403.48177901006,415.30469757995,440,523.2511306012],"description":"Ivor Darreg's Mixed Enneatonic, a mixture of chromatic and enharmonic"},"darreg_genus":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,290.69507255622,348.83408706747,392.4383479509,406.97310157871,418.60090448096,436.04260883433,523.2511306012],"description":"Ivor Darreg's Mixed JI Genus (Archytas Enh, Ptolemy Soft Chrom, Didymos Chrom"},"darreg_genus2":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,294.32876096318,348.83408706747,392.4383479509,406.97310157871,418.60090448096,441.49314144476,523.2511306012],"description":"Darreg's Mixed JI Genus 2 (Archytas Enharmonic and Chromatic Genera)"},"david11":{"frequencies":[261.6255653006,269.80136421624,274.70684356563,285.40970760065,294.32876096318,305.22982618403,314.76825825228,327.03195662575,332.97799220076,343.38355445704,359.73515228832,366.27579142084,374.60024122586,392.4383479509,406.97310157871,419.69101100305,428.11456140098,441.49314144476,457.84473927605,479.64686971777,490.54793493862,499.46698830115,523.2511306012],"description":"11-limit system from Gary David, 1967"},"david7":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,313.95067836072,336.37572681506,348.83408706747,366.27579142084,392.4383479509,418.60090448096,448.50096908674,470.92601754108,488.36772189445,523.2511306012],"description":"Gary David's Constant Structure, 1967. A mode of Fokker's 7-limit scale"},"ddimlim1":{"frequencies":[261.6255653006,294.32876096318,306.59245933664,313.95067836072,327.03195662575,348.83408706747,367.91095120397,392.4383479509,408.78994578219,418.60090448096,436.04260883433,490.54793493862,502.32108537715,510.98743222773,523.2511306012],"description":"First 27/25&2048/1875 scale"},"de_caus":{"frequencies":[261.6255653006,272.52663052146,290.69507255622,306.59245933664,327.03195662575,348.83408706747,363.36884069528,392.4383479509,408.78994578219,436.04260883433,465.11211608996,490.54793493862,523.2511306012],"description":"De Caus (a mode of Ellis's duodene) (1615)"},"degung1":{"frequencies":[261.6255653006,286.1303811777,319.28416942365,390.63652710512,420.90734643474,523.2511306012],"description":"Gamelan Degung, Kabupaten Sukabumi. 1/1=363 Hz"},"degung2":{"frequencies":[261.6255653006,276.67939184371,325.99375993805,390.36201910543,415.27879033283,523.2511306012],"description":"Gamelan Degung, Kabupaten Bandung. 1/1=252 Hz"},"degung3":{"frequencies":[261.6255653006,282.83850205216,320.55017368416,393.28023705203,426.95140008307,523.2511306012],"description":"Gamelan Degung, Kabupaten Sumedang. 1/1=388.5 Hz"},"degung4":{"frequencies":[261.6255653006,284.6485709981,319.18312009646,379.88037698982,415.46137490477,523.2511306012],"description":"Gamelan Degung, Kasepuhan Cheribon. 1/1=250 Hz"},"degung5":{"frequencies":[261.6255653006,284.24274449773,317.86283634652,388.77066331187,430.33748813761,523.2511306012],"description":"Gamelan Degung, Kanoman Cheribon. 1/1=428 Hz"},"degung6":{"frequencies":[261.6255653006,273.29426590363,298.47415715355,379.54129348313,409.02013274169,523.2511306012],"description":"Gamelan Degung, Kacherbonan Cheribon. 1/1=426 Hz"},"dekany":{"frequencies":[261.6255653006,299.7792935736,305.22982618403,327.03195662575,359.73515228832,381.53728273004,419.69101100305,436.04260883433,457.84473927605,479.64686971777,523.2511306012],"description":"2)5 Dekany 1.3.5.7.11 (1.3 tonic)"},"dekany2":{"frequencies":[261.6255653006,279.06726965397,299.00064605783,313.95067836072,348.83408706747,358.80077526939,398.6675280771,418.60090448096,448.50096908674,465.11211608996,523.2511306012],"description":"3)5 Dekany 1.3.5.7.9 (1.3.5.7.9 tonic)"},"dekany3":{"frequencies":[261.6255653006,294.32876096318,305.22982618403,327.03195662575,343.38355445704,381.53728273004,392.4383479509,436.04260883433,457.84473927605,490.54793493862,523.2511306012],"description":"2)5 Dekany 1.3.5.7.9 and 3)5 Dekany 1 1/3 1/5 1/7 1/9"},"dekany4":{"frequencies":[261.6255653006,270.96933548991,288.48890459486,310.68035879446,321.77608589426,355.06326719367,425.14154361347,440.3251701711,474.19633710734,485.87604984397,523.2511306012],"description":"2)5 Dekany 1.7.13.19.29 (1.7 tonic)"},"dekany_union":{"frequencies":[261.6255653006,274.70684356563,294.32876096318,305.22982618403,327.03195662575,343.38355445704,366.27579142084,381.53728273004,392.4383479509,412.06026534844,436.04260883433,457.84473927605,470.92601754108,490.54793493862,523.2511306012],"description":"Union of 2)5 and 3)5 [ 1 3 5 7 9] dekanies"},"dent":{"frequencies":[261.6255653006,276.73939277812,293.41671964988,311.13637945111,328.33487278761,349.18153137729,368.9858570375,391.91718148616,414.84850593482,438.82216331296,465.92281947955,491.98114271667,523.2511306012],"description":"Tom Dent, well temperament with A=421 Hz. Integer Hz beat rates from A"},"dent2":{"frequencies":[261.6255653006,276.57667301797,293.18838124587,310.79781949647,328.55897053596,349.10502918563,369.05532299592,391.67735584266,414.54302837239,438.92977277749,465.83490899549,492.45596147139,523.2511306012],"description":"Tom Dent, well-temperament, 2/32 and 5/32 comma. TL 3 & 5-9-2005"},"dent3":{"frequencies":[261.6255653006,276.38325105256,293.15632631094,310.94732162256,328.48713220126,349.22823143301,368.7143392539,391.76907592069,414.58565256441,438.73106346722,466.16376151809,492.17459484008,523.2511306012],"description":"Tom Dent, Bach harpsichord \"sine wave\" temperament, TL 10-10-2005"},"deporcy":{"frequencies":[261.6255653006,272.52663052146,286.15296204753,299.00064605783,313.95067836072,327.03195662575,348.83408706747,358.80077526939,381.53728273004,392.4383479509,418.60090448096,436.04260883433,457.84473927605,478.40103369253,502.32108537715,523.2511306012],"description":"A 15-note chord-based detempering of 7-limit porcupine"},"diab19_612":{"frequencies":[261.6255653006,267.01398215014,280.33982809972,299.03492334906,305.19382000629,313.95883772326,320.42510414137,327.02455105776,348.83292260574,366.24210002542,373.7851897098,392.43965797471,418.61038382265,427.23204601759,436.03127668087,448.5538823653,457.79225819026,488.32116993744,512.69177642068,523.2511306012],"description":"diab19a in 612-tET"},"diab19_72":{"frequencies":[261.6255653006,266.71173418545,279.86396690685,299.37379946195,305.19382000629,314.13668154225,320.24370022528,326.46944327063,349.22823143301,366.44956000397,373.57357677338,391.99543598175,419.32216217931,427.47405410759,435.78442404634,448.5538823653,457.27406033445,489.15147723638,513.27277840175,523.2511306012],"description":"diab19a in 72-tET"},"diablack":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,313.95067836072,331.11985608357,372.08969287196,392.4383479509,418.60090448096,441.49314144476,470.92601754108,523.2511306012],"description":"Unique 256/245&2048/2025 Fokker block"},"diachrome1":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,313.95067836072,334.88072358477,367.91095120397,392.4383479509,418.60090448096,441.49314144476,470.92601754108,523.2511306012],"description":"First 25/24&2048/2025 scale"},"diacycle13":{"frequencies":[261.6255653006,268.33391312882,275.39533189537,282.83844897362,290.69507255622,299.00064605783,307.79478270659,317.12189733406,327.03195662575,337.58137458142,348.83408706747,360.86284869048,373.75080757229,387.59343007496,402.50086969323,413.09299784305,424.25767346043,436.04260883433,448.50096908674,461.69217405988,475.68284600109,490.54793493862,506.37206187213,523.2511306012],"description":"Diacycle on 20/13, 13/10; there are also nodes at 3/2, 4/3; 13/9, 18/13"},"diaddim1":{"frequencies":[261.6255653006,275.93321340298,294.32876096318,313.95067836072,334.88072358477,344.91651675372,357.20610515709,367.91095120397,392.4383479509,418.60090448096,446.50763144636,470.92601754108,490.54793493862,502.32108537715,523.2511306012],"description":"First 2048/2025&2048/1875 scale"},"dialim1":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,313.95067836072,334.88072358477,348.83408706747,353.19451315581,367.91095120397,392.4383479509,418.60090448096,441.49314144476,470.92601754108,490.54793493862,502.32108537715,523.2511306012],"description":"First 27/25&2048/2025 scale"},"diamisty":{"frequencies":[261.6255653006,275.93321340298,294.32876096318,310.42486507835,330.74639366397,348.83408706747,372.08969287196,392.4383479509,413.89982010446,436.53496651643,470.39487098876,496.11959049595,523.2511306012],"description":"Diamisty scale 2048/2025 and 67108864/66430125"},"diamond11a":{"frequencies":[261.6255653006,279.06726965397,285.40970760065,287.78812183066,290.69507255622,294.32876096318,299.00064605783,305.22982618403,313.95067836072,319.76457981184,327.03195662575,332.97799220076,336.37572681506,348.83408706747,359.73515228832,366.27579142084,373.75080757229,380.54627680087,392.4383479509,406.97310157871,411.12588832951,418.60090448096,428.11456140098,436.04260883433,448.50096908674,457.84473927605,465.11211608996,470.92601754108,475.68284600109,479.64686971777,490.54793493862,523.2511306012],"description":"11-limit Diamond with added 16/15 & 15/8, Zoomoozophone tuning: 1/1 = 392 Hz"},"diamond11ak":{"frequencies":[261.6255653006,279.72330032405,285.63317938628,287.78812183066,290.69507255622,293.86839138568,299.07491977616,305.39295512204,314.19649759716,319.76457981184,326.52043447049,333.41680553884,335.93301933283,349.10721912206,359.17247822875,366.75848641051,373.2589099097,381.14243472333,392.13131479202,407.50942884268,410.58480125643,419.25667855894,428.11456140098,435.70146034294,448.26139746089,457.73103588952,465.84075338014,470.92601754108,475.68284600109,479.27160679251,489.39746055879,523.2511306012],"description":"microtempered version of diamond11a, Dave Keenan TL 11-1-2000, 225/224&385/384"},"diamond11at":{"frequencies":[261.6255653006,279.83704120119,285.33574350137,287.98268367985,290.84948650387,293.82121114493,299.2738827313,305.22380787491,314.19079532693,320.23980272009,326.48518221507,332.71524733285,336.02719554531,349.1122100506,359.53680125564,366.52331521885,373.4984028396,380.75621844446,392.12570885984,407.39521875769,411.45055399509,419.30194782174,427.47925671618,435.70936791853,448.50981249085,457.42672761267,465.91555560021,470.67599975252,475.36147343465,479.7712027167,489.19854301666,523.2511306012],"description":"microtempered version of diamond11a, OdC"},"diamond11map":{"frequencies":[195.99771799087,228.66400432268,261.33029065449,293.99657698631,326.66286331812,359.32914964993,391.99543598174,457.32800864536,522.66058130899,587.99315397261,653.32572663623,718.65829929986,213.81569235368,249.45164107929,285.0875898049,320.72353853051,356.35948725613,391.99543598174,427.63138470735,498.90328215858,570.1751796098,641.44707706103,712.71897451225,783.99087196348,235.19726158904,274.39680518722,313.59634878539,352.79589238357,391.99543598174,431.19497957991,470.39452317809,548.79361037444,627.19269757078,705.59178476713,783.99087196348,862.38995915983,261.33029065449,304.88533909691,348.44038753932,391.99543598174,435.55048442416,479.10553286657,522.66058130899,609.77067819382,696.88077507865,783.99087196348,871.10096884831,958.21106573314,293.99657698631,342.99600648402,391.99543598174,440.99486547946,489.99429497718,538.99372447489,587.99315397261,685.99201296804,783.99087196348,881.98973095892,979.98858995435,1077.98744894978,335.99608798435,391.99543598174,447.99478397913,503.99413197652,559.99347997391,615.99282797131,671.9921759687,783.99087196348,895.98956795826,1007.98826395305,1119.98695994783,1231.98565594261,783.99087196348],"description":"11-limit diamond on a 'centreless' map"},"diamond15":{"frequencies":[261.6255653006,269.80136421624,279.06726965397,280.31310567921,281.75060878526,283.42769574232,285.40970760065,287.78812183066,290.69507255622,294.32876096318,299.00064605783,301.87565226992,305.22982618403,309.19384990071,310.07474405997,313.95067836072,318.85615771011,319.76457981184,322.00069575458,327.03195662575,332.97799220076,336.37572681506,340.11323489078,343.38355445704,348.83408706747,356.76213450082,359.73515228832,362.25078272391,366.27579142084,367.91095120397,372.08969287196,373.75080757229,377.90359432309,380.54627680087,383.71749577421,392.4383479509,398.6675280771,402.50086969323,406.97310157871,411.12588832951,418.60090448096,425.14154361347,428.11456140098,429.33426100611,436.04260883433,441.49314144476,442.75095666255,448.50096908674,453.48431318771,457.84473927605,465.11211608996,470.92601754108,475.68284600109,479.64686971777,483.00104363188,485.87604984397,488.36772189445,490.54793493862,507.3950357345,523.2511306012],"description":"15-limit Diamond + 2nd ratios. See Novaro, 1927, Sistema Natural..."},"diamond17":{"frequencies":[261.6255653006,277.97716313189,281.75060878526,283.42769574232,285.40970760065,287.78812183066,299.00064605783,305.22982618403,307.79478270659,309.19384990071,313.95067836072,317.68818643644,322.00069575458,327.03195662575,332.97799220076,338.57426097725,340.11323489078,342.12573923925,348.83408706747,359.73515228832,366.27579142084,369.35373924791,370.63621750918,373.75080757229,380.54627680087,392.4383479509,400.13321751856,402.50086969323,404.33041910093,411.12588832951,418.60090448096,425.14154361347,430.91269578922,436.04260883433,442.75095666255,444.76346101102,448.50096908674,457.84473927605,475.68284600109,479.64686971777,483.00104363188,485.87604984397,492.47165233054,523.2511306012],"description":"17-limit Diamond"},"diamond17a":{"frequencies":[261.6255653006,277.01530443593,277.97716313189,281.75060878526,283.42769574232,285.40970760065,287.78812183066,290.69507255622,294.32876096318,299.00064605783,305.22982618403,307.79478270659,309.19384990071,313.95067836072,317.68818643644,319.76457981184,322.00069575458,327.03195662575,332.97799220076,336.37572681506,338.57426097725,340.11323489078,342.12573923925,348.83408706747,359.73515228832,362.25078272391,366.27579142084,369.35373924791,370.63621750918,373.75080757229,377.90359432309,380.54627680087,392.4383479509,400.13321751856,402.50086969323,404.33041910093,406.97310157871,411.12588832951,418.60090448096,425.14154361347,428.11456140098,430.91269578922,436.04260883433,442.75095666255,444.76346101102,448.50096908674,457.84473927605,465.11211608996,470.92601754108,475.68284600109,479.64686971777,483.00104363188,485.87604984397,492.47165233054,494.18162334558,523.2511306012],"description":"17-limit, +9 Diamond"},"diamond19":{"frequencies":[261.6255653006,275.39533189537,277.97716313189,281.75060878526,283.42769574232,285.40970760065,287.78812183066,292.40504357126,299.00064605783,302.93486508491,305.22982618403,307.79478270659,309.19384990071,310.68035879446,313.95067836072,317.68818643644,322.00069575458,327.03195662575,330.47439827444,332.97799220076,338.57426097725,340.11323489078,342.12573923925,348.83408706747,355.06326719367,358.01393146398,359.73515228832,366.27579142084,369.35373924791,370.63621750918,373.75080757229,380.54627680087,382.37582620857,385.55346465352,392.4383479509,400.13321751856,402.50086969323,404.33041910093,411.12588832951,414.24047839262,418.60090448096,425.14154361347,430.91269578922,436.04260883433,440.63253103259,442.75095666255,444.76346101102,448.50096908674,451.89870370104,457.84473927605,468.17206422213,475.68284600109,479.64686971777,483.00104363188,485.87604984397,492.47165233054,497.08857407114,523.2511306012],"description":"19-limit Diamond"},"diamond7":{"frequencies":[261.6255653006,299.00064605783,305.22982618403,313.95067836072,327.03195662575,348.83408706747,366.27579142084,373.75080757229,392.4383479509,418.60090448096,436.04260883433,448.50096908674,457.84473927605,523.2511306012],"description":"7-limit Diamond, also double-tie circular mirroring of 4:5:6:7"},"diamond9":{"frequencies":[261.6255653006,290.69507255622,294.32876096318,299.00064605783,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,366.27579142084,373.75080757229,392.4383479509,406.97310157871,418.60090448096,436.04260883433,448.50096908674,457.84473927605,465.11211608996,470.92601754108,523.2511306012],"description":"9-limit Diamond"},"diamond_chess":{"frequencies":[261.6255653006,299.00064605783,313.95067836072,336.37572681506,348.83408706747,366.27579142084,373.75080757229,392.4383479509,406.97310157871,436.04260883433,457.84473927605,523.2511306012],"description":"9-limit chessboard pattern diamond. OdC"},"diamond_chess11":{"frequencies":[261.6255653006,287.78812183066,299.00064605783,313.95067836072,319.76457981184,336.37572681506,348.83408706747,359.73515228832,366.27579142084,373.75080757229,380.54627680087,392.4383479509,406.97310157871,428.11456140098,436.04260883433,457.84473927605,475.68284600109,523.2511306012],"description":"11-limit chessboard pattern diamond. OdC"},"diamond_dup":{"frequencies":[261.6255653006,274.70684356563,280.31310567921,294.32876096318,299.00064605783,305.22982618403,313.95067836072,327.03195662575,336.37572681506,343.38355445704,348.83408706747,366.27579142084,373.75080757229,392.4383479509,418.60090448096,436.04260883433,448.50096908674,457.84473927605,470.92601754108,490.54793493862,523.2511306012],"description":"Two 7-limit diamonds 3/2 apart"},"diamond_mod":{"frequencies":[261.6255653006,269.10058145205,271.31540105247,279.06726965397,327.03195662575,336.37572681506,348.83408706747,392.4383479509,406.97310157871,418.60090448096,490.54793493862,504.56359022259,508.71637697339,523.2511306012],"description":"13-tone Octave Modular Diamond, based on Archytas's Enharmonic"},"diamond_tetr":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,327.03195662575,336.37572681506,339.14425131559,348.83408706747,358.80077526939,523.2511306012],"description":"Tetrachord Modular Diamond based on Archytas's Enharmonic"},"diaphonic_10":{"frequencies":[261.6255653006,277.01530443593,294.32876096318,313.95067836072,336.37572681506,362.25078272391,392.4383479509,418.60090448096,448.50096908674,483.00104363188,523.2511306012],"description":"10-tone Diaphonic Cycle"},"diaphonic_12":{"frequencies":[261.6255653006,274.70684356563,289.16509849014,305.22982618403,323.18452184192,343.38355445704,366.27579142084,392.4383479509,413.09299784305,436.04260883433,461.69217405988,490.54793493862,523.2511306012],"description":"12-tone Diaphonic Cycle, conjunctive form on 3/2 and 4/3"},"diaphonic_12a":{"frequencies":[261.6255653006,274.70684356563,289.16509849014,305.22982618403,323.18452184192,343.38355445704,366.27579142084,385.55346465352,406.97310157871,430.91269578922,457.84473927605,488.36772189445,523.2511306012],"description":"2nd 12-tone Diaphonic Cycle, conjunctive form on 10/7 and 7/5"},"diaphonic_5":{"frequencies":[261.6255653006,299.00064605783,348.83408706747,392.4383479509,448.50096908674,523.2511306012],"description":"D5-tone Diaphonic Cycle"},"diaphonic_7":{"frequencies":[261.6255653006,285.40970760065,313.95067836072,348.83408706747,380.54627680087,418.60090448096,465.11211608996,523.2511306012],"description":"7-tone Diaphonic Cycle, disjunctive form on 4/3 and 3/2"},"diaschismic":{"frequencies":[261.6255653006,266.61097723855,278.05603152599,283.35453458855,295.51835494038,301.14961170579,314.07733767684,320.06224556188,333.80185153667,340.16262034629,354.76509561975,369.99442271164,377.04485988831,393.23061088369,400.72382577504,417.92606548687,425.88986517773,444.17243057662,452.63636847719,472.06710558841,481.06259110609,501.71360968203,523.2511306012],"description":"diaschismic temperament, g=105.446531, p=600, 5-limit"},"diat13":{"frequencies":[261.6255653006,279.06726965397,322.00069575458,348.83408706747,392.4383479509,418.60090448096,483.00104363188,523.2511306012],"description":"This genus is from K.S's diatonic Hypodorian harmonia"},"diat15":{"frequencies":[261.6255653006,301.87565226992,327.03195662575,356.76213450082,373.75080757229,392.4383479509,436.04260883433,490.54793493862,523.2511306012],"description":"Tonos-15 Diatonic and its own trite synemmenon Bb"},"diat15_inv":{"frequencies":[261.6255653006,279.06726965397,313.95067836072,348.83408706747,366.27579142084,383.71749577421,418.60090448096,453.48431318771,523.2511306012],"description":"Inverted Tonos-15 Harmonia, a harmonic series from 15 from 30."},"diat17":{"frequencies":[261.6255653006,296.50897400735,342.12573923925,370.63621750918,386.75083566176,404.33041910093,444.76346101102,494.18162334558,523.2511306012],"description":"Tonos-17 Diatonic and its own trite synemmenon Bb"},"diat19":{"frequencies":[261.6255653006,276.16031892841,310.68035879446,355.06326719367,368.21375857121,382.37582620857,414.24047839262,451.89870370104,523.2511306012],"description":"Tonos-19 Diatonic and its own trite synemmenon Bb"},"diat21":{"frequencies":[261.6255653006,289.16509849014,305.22982618403,343.38355445704,366.27579142084,392.4383479509,422.62591317789,457.84473927605,523.2511306012],"description":"Tonos-21 Diatonic and its own trite synemmenon Bb"},"diat21_inv":{"frequencies":[261.6255653006,299.00064605783,323.91736656265,348.83408706747,373.75080757229,398.6675280771,448.50096908674,473.41768959156,523.2511306012],"description":"Inverted Tonos-21 Harmonia, a harmonic series from 21 from 42."},"diat23":{"frequencies":[261.6255653006,286.54228580542,300.86940009569,334.29933343966,353.96400011258,376.08675011961,429.81342870813,462.87600014722,523.2511306012],"description":"Tonos-23 Diatonic and its own trite synemmenon Bb"},"diat25":{"frequencies":[261.6255653006,297.30177875068,327.03195662575,363.36884069528,384.74347838324,408.78994578219,467.18850946536,503.12608711654,523.2511306012],"description":"Tonos-25 Diatonic and its own trite synemmenon Bb"},"diat27":{"frequencies":[261.6255653006,294.32876096318,336.37572681506,353.19451315581,371.78369805875,392.4383479509,441.49314144476,504.56359022259,523.2511306012],"description":"Tonos-27 Diatonic and its own trite synemmenon Bb"},"diat27_inv":{"frequencies":[261.6255653006,271.31540105247,310.07474405997,348.83408706747,377.90359432309,387.59343007496,406.97310157871,465.11211608996,523.2511306012],"description":"Inverted Tonos-27 Harmonia, a harmonic series from 27 from 54"},"diat29":{"frequencies":[261.6255653006,291.81313052759,316.13089140489,344.87006335079,361.29244731988,379.35706968587,421.50785520652,474.19633710734,523.2511306012],"description":"Tonos-29 Diatonic and its own trite synemmenon Bb"},"diat31":{"frequencies":[261.6255653006,289.65687586852,311.93817401225,337.93302184661,352.6257619269,368.65420565085,405.51962621593,450.57736246214,523.2511306012],"description":"Tonos-31 Diatonic. The disjunctive and conjunctive diatonic forms are the same"},"diat33":{"frequencies":[261.6255653006,287.78812183066,319.76457981184,359.73515228832,375.37581108347,392.4383479509,431.68218274599,479.64686971777,523.2511306012],"description":"Tonos-33 Diatonic. The conjunctive form is 23 (Bb instead of B) 20 18 33/2"},"diat_chrom":{"frequencies":[261.6255653006,280.31310567921,301.87565226992,348.83408706747,392.4383479509,420.46965851882,452.81347840488,523.2511306012],"description":"Diatonic- Chromatic, on the border between the chromatic and diatonic genera"},"diat_dies2":{"frequencies":[261.6255653006,266.71168334607,311.12698372208,349.22823143301,391.99543598175,399.61600264311,466.16376151809,523.2511306012],"description":"Dorian Diatonic, 2 part Diesis"},"diat_dies5":{"frequencies":[261.6255653006,274.52693220706,311.12698372208,349.22823143301,391.99543598175,411.32564531909,466.16376151809,523.2511306012],"description":"Dorian Diatonic, 5 part Diesis"},"diat_enh":{"frequencies":[261.6255653006,269.29177952703,311.12698372208,349.22823143301,391.99543598175,403.48177901006,466.16376151809,523.2511306012],"description":"Diat. + Enharm. Diesis, Dorian Mode"},"diat_enh2":{"frequencies":[261.6255653006,269.29177952703,302.26980244078,349.22823143301,391.99543598175,403.48177901006,452.89298412314,523.2511306012],"description":"Diat. + Enharm. Diesis, Dorian Mode 3 + 12 + 15 parts"},"diat_enh3":{"frequencies":[261.6255653006,302.26980244078,311.12698372208,349.22823143301,391.99543598175,452.89298412314,466.16376151809,523.2511306012],"description":"Diat. + Enharm. Diesis, Dorian Mode, 15 + 3 + 12 parts"},"diat_enh4":{"frequencies":[261.6255653006,302.26980244078,339.28638158975,349.22823143301,391.99543598175,452.89298412314,508.3551866238,523.2511306012],"description":"Diat. + Enharm. Diesis, Dorian Mode, 15 + 12 + 3 parts"},"diat_enh5":{"frequencies":[261.6255653006,293.66476791741,339.28638158975,349.22823143301,391.99543598175,440,508.3551866238,523.2511306012],"description":"Dorian Mode, 12 + 15 + 3 parts"},"diat_enh6":{"frequencies":[261.6255653006,293.66476791741,302.26980244078,349.22823143301,391.99543598175,440,452.89298412314,523.2511306012],"description":"Dorian Mode, 12 + 3 + 15 parts"},"diat_eq":{"frequencies":[261.6255653006,288.06466200271,317.1754314895,349.22823143301,391.99543598175,431.60932167676,475.22619361214,523.2511306012],"description":"Equal Diatonic, Islamic form, similar to 11/10 x 11/10 x 400/363"},"diat_eq2":{"frequencies":[261.6255653006,287.78812183066,317.12189733406,348.83408706747,392.4383479509,431.68218274599,475.68284600109,523.2511306012],"description":"Equal Diatonic, 11/10 x 400/363 x 11/10"},"diat_gold":{"frequencies":[261.6255653006,292.38332274669,326.75708630452,349.99258496952,391.13935185123,437.1232727958,488.51296691354,523.2511306012],"description":"Diatonic scale with ratio between whole and half tone the Golden Section"},"diat_hemchrom":{"frequencies":[261.6255653006,273.20871865617,311.12698372208,349.22823143301,391.99543598175,409.35055662695,466.16376151809,523.2511306012],"description":"Diat. + Hem. Chrom. Diesis, Another genus of Aristoxenos, Dorian Mode"},"diat_smal":{"frequencies":[261.6255653006,299.00064605783,327.03195662575,348.83408706747,392.4383479509,436.04260883433,457.84473927605,523.2511306012],"description":"\"Smallest number\" diatonic scale"},"diat_sofchrom":{"frequencies":[261.6255653006,271.8968348557,311.12698372208,349.22823143301,391.99543598175,407.38495184466,466.16376151809,523.2511306012],"description":"Diat. + Soft Chrom. Diesis, Another genus of Aristoxenos, Dorian Mode"},"diat_soft":{"frequencies":[261.6255653006,274.52693220706,302.26980244078,349.22823143301,391.99543598175,411.32564531909,452.89298412314,523.2511306012],"description":"Soft Diatonic genus 5 + 10 + 15 parts"},"diat_soft2":{"frequencies":[261.6255653006,281.2143451833,302.26980244078,349.22823143301,391.99543598175,421.34544350737,452.89298412314,523.2511306012],"description":"Soft Diatonic genus with equally divided Pyknon; Dorian Mode"},"diat_soft3":{"frequencies":[261.6255653006,281.2143451833,324.90175210669,349.22823143301,391.99543598175,421.34544350737,486.80259447109,523.2511306012],"description":"New Soft Diatonic genus with equally divided Pyknon; Dorian Mode; 1:1 pyknon"},"diat_soft4":{"frequencies":[261.6255653006,302.26980244078,324.90175210669,349.22823143301,391.99543598175,452.89298412314,486.80259447109,523.2511306012],"description":"New Soft Diatonic genus with equally divided Pyknon; Dorian Mode; 1:1 pyknon"},"dicot":{"frequencies":[261.6255653006,270.35822989652,294.32876096318,320.42456924675,331.11985608357,360.47764004221,392.4383479509,405.53734464206,441.49314144476,480.63685362987,523.2511306012],"description":"Dicot temperament, g=350.9775, 5-limit"},"didy_chrom":{"frequencies":[261.6255653006,279.06726965397,290.69507255622,348.83408706747,392.4383479509,418.60090448096,436.04260883433,523.2511306012],"description":"Didymus Chromatic"},"didy_chrom1":{"frequencies":[261.6255653006,279.06726965397,334.88072358477,348.83408706747,392.4383479509,418.60090448096,502.32108537715,523.2511306012],"description":"Permuted Didymus Chromatic"},"didy_chrom2":{"frequencies":[261.6255653006,313.95067836072,327.03195662575,348.83408706747,392.4383479509,470.92601754108,490.54793493862,523.2511306012],"description":"Didymos's Chromatic, 6/5 x 25/24 x 16/15"},"didy_chrom3":{"frequencies":[261.6255653006,272.52663052146,290.69507255622,348.83408706747,392.4383479509,408.78994578219,436.04260883433,523.2511306012],"description":"Didymos's Chromatic, 25/24 x 16/15 x 6/5"},"didy_diat":{"frequencies":[261.6255653006,279.06726965397,310.07474405997,348.83408706747,392.4383479509,418.60090448096,465.11211608996,523.2511306012],"description":"Didymus Diatonic"},"didy_diatinv":{"frequencies":[261.6255653006,294.32876096318,327.03195662575,348.83408706747,392.4383479509,441.49314144476,490.54793493862,523.2511306012],"description":"Inverse Didymus Diatonic, variant of Ptolemy with 2 identical triads"},"didy_enh":{"frequencies":[261.6255653006,270.06509966514,279.06726965397,348.83408706747,392.4383479509,405.0976494977,418.60090448096,523.2511306012],"description":"Dorian mode of Didymos's Enharmonic"},"didy_enh2":{"frequencies":[261.6255653006,275.62199471997,279.06726965397,348.83408706747,392.4383479509,413.43299207996,418.60090448096,523.2511306012],"description":"Permuted Didymus Enharmonic"},"diesic-m":{"frequencies":[261.6255653006,289.62525622617,320.62153003931,354.93508703008,392.92094947462,434.97213484265,481.52372211906,523.2511306012],"description":"Minimal Diesic temperament, g=176.021, 5-limit"},"diesic-t":{"frequencies":[261.6255653006,272.92239980638,281.87304203955,294.04415210774,303.68749398125,316.80053726141,327.19018747082,337.92057205022,352.51178108166,364.07260143821,379.79303732838,392.24856169057,409.18561859271,422.60509148244,436.46466102477,455.31094249407,470.24311865111,490.54793493862,506.63572944675,523.2511306012],"description":"Tiny Diesic temperament, g=443.017, 5-limit"},"diff31_72":{"frequencies":[261.6255653006,269.29177952703,274.52698453615,279.86396690685,285.30470202322,293.66476791741,299.37379946195,305.19382000629,314.13668154225,320.24370022528,326.46944327063,336.03572815422,342.56848033562,352.60650301302,356.01745236555,366.44956000397,373.57357677338,384.52011812375,388.23978476841,399.61607881612,407.38487419079,419.32216217931,427.47405410759,435.78442404634,448.5538823653,457.27406033445,466.16376151809,479.82340237272,489.15147723638,498.66089874196,508.3551866238,523.2511306012],"description":"Diff31, 11/9, 4/3, 7/5, 3/2, 7/4, 9/5 difference diamond, tempered to 72-et"},"dimteta":{"frequencies":[261.6255653006,282.55561052465,307.12566361375,336.37572681506,406.97310157871,439.53094970501,477.75103228805,523.2511306012],"description":"A heptatonic form on the 9/7"},"dimtetb":{"frequencies":[261.6255653006,294.32876096318,336.37572681506,406.97310157871,457.84473927605,523.2511306012],"description":"A pentatonic form on the 9/7"},"div_fifth1":{"frequencies":[261.6255653006,273.00058987889,285.40970760065,348.83408706747,392.4383479509,523.2511306012],"description":"Divided Fifth #1, From Schlesinger, see Chapter 8, p. 160"},"div_fifth2":{"frequencies":[261.6255653006,279.06726965397,299.00064605783,348.83408706747,392.4383479509,523.2511306012],"description":"Divided Fifth #2, From Schlesinger, see Chapter 8, p. 160"},"div_fifth3":{"frequencies":[261.6255653006,271.31540105247,305.22982618403,348.83408706747,392.4383479509,523.2511306012],"description":"Divided Fifth #3, From Schlesinger, see Chapter 8, p. 160"},"div_fifth4":{"frequencies":[261.6255653006,274.70684356563,305.22982618403,343.38355445704,392.4383479509,523.2511306012],"description":"Divided Fifth #4, From Schlesinger, see Chapter 8, p. 160"},"div_fifth5":{"frequencies":[261.6255653006,287.78812183066,319.76457981184,359.73515228832,411.12588832951,523.2511306012],"description":"Divided Fifth #5, From Schlesinger, see Chapter 8, p. 160"},"dkring1":{"frequencies":[261.6255653006,274.70684356563,305.22982618403,313.95067836072,320.49131749323,327.03195662575,366.27579142084,392.4383479509,439.53094970501,448.50096908674,457.84473927605,470.92601754108,523.2511306012],"description":"Double-tie circular mirroring of 4:5:6:7"},"dkring2":{"frequencies":[261.6255653006,274.70684356563,305.22982618403,329.64821227876,336.37572681506,353.19451315581,366.27579142084,392.4383479509,406.97310157871,427.32175665765,436.04260883433,470.92601754108,523.2511306012],"description":"Double-tie circular mirroring of 3:5:7:9"},"dkring3":{"frequencies":[261.6255653006,294.32876096318,299.00064605783,305.22982618403,336.37572681506,348.83408706747,384.42940207435,392.4383479509,398.6675280771,448.50096908674,465.11211608996,504.56359022259,523.2511306012],"description":"Double-tie circular mirroring of 6:7:8:9"},"dkring4":{"frequencies":[261.6255653006,290.69507255622,294.32876096318,299.00064605783,327.03195662575,336.37572681506,367.91095120397,373.75080757229,378.42269266694,420.46965851882,467.18850946536,470.92601754108,523.2511306012],"description":"Double-tie circular mirroring of 7:8:9:10"},"dodeceny":{"frequencies":[261.6255653006,275.93321340298,294.32876096318,306.59245933664,313.95067836072,327.03195662575,348.83408706747,367.91095120397,392.4383479509,436.04260883433,441.49314144476,490.54793493862,523.2511306012],"description":"Degenerate eikosany 3)6 from 1.3.5.9.15.45 tonic 1.3.15"},"dorian_chrom":{"frequencies":[261.6255653006,279.06726965397,299.00064605783,310.07474405997,315.92521092903,322.00069575458,348.83408706747,380.54627680087,398.6675280771,408.39112632289,418.60090448096,465.11211608996,523.2511306012,558.13453930795,598.00129211566,620.14948811994,631.85042185805,644.00139150917,697.66817413493,761.09255360175,797.33505615421,816.78225264578,837.20180896192,930.22423217991,1046.5022612024],"description":"Dorian Chromatic Tonos"},"dorian_chrom2":{"frequencies":[261.6255653006,274.08392555301,287.78812183066,359.73515228832,411.12588832951,426.35277308246,442.75095666255,523.2511306012],"description":"Schlesinger's Dorian Harmonia in the chromatic genus"},"dorian_chrominv":{"frequencies":[261.6255653006,273.00058987889,285.40970760065,332.97799220076,380.54627680087,404.33041910093,428.11456140098,523.2511306012],"description":"A harmonic form of Schlesinger's Chromatic Dorian inverted"},"dorian_diat":{"frequencies":[261.6255653006,279.06726965397,299.00064605783,322.00069575458,334.88072358477,348.83408706747,364.00078650518,380.54627680087,418.60090448096,440.63253103259,465.11211608996,492.47165233054,523.2511306012,558.13453930795,598.00129211566,644.00139150917,669.76144716954,697.66817413493,728.00157301037,761.09255360175,837.20180896192,881.26506206518,930.22423217991,984.94330466108,1046.5022612024],"description":"Dorian Diatonic Tonos"},"dorian_diat2":{"frequencies":[261.6255653006,287.78812183066,319.76457981184,359.73515228832,383.71749577421,411.12588832951,442.75095666255,479.64686971777,523.2511306012],"description":"Schlesinger's Dorian Harmonia, a subharmonic series through 13 from 22"},"dorian_diat2inv":{"frequencies":[261.6255653006,285.40970760065,309.19384990071,332.97799220076,356.76213450082,380.54627680087,428.11456140098,475.68284600109,523.2511306012],"description":"Inverted Schlesinger's Dorian Harmonia, a harmonic series from 11 from 22"},"dorian_diatcon":{"frequencies":[261.6255653006,287.78812183066,319.76457981184,359.73515228832,383.71749577421,411.12588832951,479.64686971777,523.2511306012],"description":"A Dorian Diatonic with its own trite synemmenon replacing paramese"},"dorian_diatred11":{"frequencies":[261.6255653006,287.78812183066,316.56693401373,348.83408706747,392.4383479509,431.68218274599,474.85040102059,523.2511306012],"description":"Dorian mode of a diatonic genus with reduplicated 11/10"},"dorian_enh":{"frequencies":[261.6255653006,279.06726965397,299.00064605783,304.4370214407,307.2300216374,310.07474405997,348.83408706747,380.54627680087,389.39619021485,393.97732186443,398.6675280771,465.11211608996,523.2511306012,558.13453930795,598.00129211566,608.8740428814,614.4600432748,620.14948811994,697.66817413493,761.09255360175,778.79238042969,787.95464372887,797.33505615421,930.22423217991,1046.5022612024],"description":"Dorian Enharmonic Tonos"},"dorian_enh2":{"frequencies":[261.6255653006,267.70988077271,274.08392555301,359.73515228832,411.12588832951,426.35277308246,442.75095666255,523.2511306012],"description":"Schlesinger's Dorian Harmonia in the enharmonic genus"},"dorian_enhinv":{"frequencies":[261.6255653006,267.19206668997,273.00058987889,332.97799220076,380.54627680087,392.4383479509,404.33041910093,523.2511306012],"description":"A harmonic form of Schlesinger's Dorian enharmonic inverted"},"dorian_pent":{"frequencies":[261.6255653006,271.49822814213,287.78812183066,359.73515228832,411.12588832951,423.21782622156,442.75095666255,523.2511306012],"description":"Schlesinger's Dorian Harmonia in the pentachromatic genus"},"dorian_pis":{"frequencies":[261.6255653006,299.00064605783,322.00069575458,348.83408706747,380.54627680087,418.60090448096,465.11211608996,523.2511306012,558.13453930795,598.00129211566,644.00139150917,697.66817413493,761.09255360175,837.20180896192,930.22423217991,1046.5022612024],"description":"Diatonic Perfect Immutable System in the Dorian Tonos, a non-rep. 16 tone gamut"},"dorian_schl":{"frequencies":[261.6255653006,274.08392555301,287.78812183066,302.93486508491,319.76457981184,338.57426097725,359.73515228832,383.71749577421,411.12588832951,442.75095666255,460.46099492906,479.64686971777,523.2511306012],"description":"Schlesinger's Dorian Piano Tuning (Sub 22)"},"dorian_tri1":{"frequencies":[261.6255653006,269.80136421624,278.50463402967,359.73515228832,411.12588832951,421.15334902048,431.68218274599,523.2511306012],"description":"Schlesinger's Dorian Harmonia in the first trichromatic genus"},"dorian_tri2":{"frequencies":[261.6255653006,269.80136421624,287.78812183066,359.73515228832,411.12588832951,421.15334902048,442.75095666255,523.2511306012],"description":"Schlesinger's Dorian Harmonia in the second trichromatic genus"},"douwes":{"frequencies":[261.6255653006,273.00058987889,292.50063201309,313.39353429974,327.01933943691,350.37786403433,365.61168556196,391.72680409,408.75840577964,436.81779569448,468.01906681552,488.36772189445,523.2511306012],"description":"Claas Douwes recommendation of 24/23 and 15/14 steps for clavichord (1699)"},"dow_high":{"frequencies":[261.6255653006,277.01530443593,278.50463402967,294.32876096318,308.34441624714,313.31771328338,327.34193952303,331.11985608357,346.88746827803,348.83408706747,369.35373924791,392.4383479509,417.75695104451,441.49314144476,462.5166243707],"description":"Highest octave of Dowlands lute tuning, strings 5,6. 1/1=G (1610)"},"dow_lmh":{"frequencies":[261.6255653006,278.50463402967,294.32876096318,308.34441624714,327.34193952303,348.83408706747,369.35373924791,371.33951203956,392.4383479509,411.12588832951,417.75695104451,436.45591936403,441.49314144476,462.5166243707,465.11211608996,492.47165233054,495.11934938608,523.2511306012,548.16785110602,557.00926805934,581.94122581871,588.65752192635,616.68883249427,620.14948811994,626.63542656676,656.62886977405,662.23971216714,693.77493655606,697.66817413493,736.51936392681,742.67902407912,784.8766959018,822.25177665903,831.04591330779,835.51390208901,882.98628288953,925.03324874141,939.95313985014,982.02581856908,993.35956825072,1040.66240483408,1046.5022612024,1108.06121774372,1114.01853611868,1177.3150438527,1233.37766498854,1253.27085313352,1309.3677580921,1324.47942433429,1387.54987311211,1395.33634826987,1477.41495699162,1569.7533918036,1671.02780417803,1765.97256577905,1850.06649748281],"description":"All three octaves of Dowland's lute tuning"},"dow_low":{"frequencies":[261.6255653006,278.50463402967,294.32876096318,308.34441624714,327.34193952303,348.83408706747,369.35373924791,371.33951203956,392.4383479509,411.12588832951,417.75695104451,436.45591936403,441.49314144476,462.5166243707,465.11211608996,492.47165233054,495.11934938608,523.2511306012],"description":"Lowest octave of Dowlands lute tuning, strings 1,2,3. 1/1=G. (1610)"},"dow_middle":{"frequencies":[261.6255653006,274.08392555301,278.50463402967,290.97061290936,294.32876096318,308.34441624714,310.07474405997,313.31771328338,328.31443488703,331.11985608357,346.88746827803,348.83408706747,368.2596819634,371.33951203956,392.4383479509,411.12588832951,415.52295665389,417.75695104451,441.49314144476,462.5166243707,469.97656992507,491.01290928454,496.67978412536,520.33120241704,523.2511306012],"description":"Middle octave of Dowlands lute tuning, strings 3,4,5. 1/1=G (1610)"},"dowland_12":{"frequencies":[261.6255653006,278.50463402967,294.32876096318,308.34441624714,327.34193952303,348.83408706747,369.35373924791,392.4383479509,417.75695104451,441.49314144476,462.5166243707,492.47165233054,523.2511306012],"description":"subset of Dowland's lute tuning, lowest octave"},"druri":{"frequencies":[261.6255653006,285.79952600623,326.97270111135,357.18467683857,523.2511306012],"description":"Scale of druri dana of Siwoli, south Nias, Jaap Kunst"},"dudon_a":{"frequencies":[261.6255653006,285.85015468029,319.76457981184,348.83408706747,392.4383479509,428.77523202043,479.64686971777,523.2511306012],"description":"Dudon Tetrachord A"},"dudon_b":{"frequencies":[261.6255653006,283.42769574232,321.58142401532,348.83408706747,392.4383479509,425.14154361347,482.37213602298,523.2511306012],"description":"Dudon Tetrachord B"},"dudon_c12":{"frequencies":[261.6255653006,302.50455987882,327.03195662575,343.38355445704,392.4383479509,425.14154361347,474.19633710734,523.2511306012],"description":"Differentially coherent scale in interval class 1 and 2"},"dudon_diat":{"frequencies":[261.6255653006,294.32876096318,321.08592105074,350.8160989258,392.4383479509,428.11456140098,481.6288815761,523.2511306012],"description":"Dudon Neutral Diatonic"},"dudon_moha_baya":{"frequencies":[261.6255653006,285.30470202322,320.24370022528,349.22823143301,391.99543598175,427.47405410759,466.16376151809,523.2511306012],"description":"Mohajira + Bayati (Dudon) 3 + 4 + 3 Mohajira and 3 + 3 + 4 Bayati tetrachords"},"dudon_mohajira":{"frequencies":[261.6255653006,285.30470202322,320.24370022528,349.22823143301,391.99543598175,427.47405410759,479.82340237272,523.2511306012],"description":"Dudon's Mohajira, two 3 + 4 + 3 tetrachords, neutral diatonic"},"dudon_mohajira_r":{"frequencies":[261.6255653006,283.42769574232,321.58142401532,348.83408706747,392.4383479509,425.14154361347,479.64686971777,523.2511306012],"description":"Jacques Dudon, JI Mohajira, Lumi�res audibles"},"dudon_thai":{"frequencies":[261.6255653006,288.26147859917,317.63518509943,350.43752981487,386.47021463976,426.17461277719,469.97930400405,523.2511306012],"description":"Dudon, coherent Thai heptatonic scale, 1/1 vol. 11/2, 2003"},"dudon_thai2":{"frequencies":[261.6255653006,288.02814528506,314.43072526953,347.1339209321,383.13743909274,422.44127975143,475.35895071461,523.2511306012],"description":"Slightly better version, 3.685 cents deviation"},"dudon_thai3":{"frequencies":[261.6255653006,291.60349465796,321.58142401532,354.2846196779,394.48229767981,434.67997568173,478.96555314146,523.2511306012],"description":"Dudon, Thai scale with two 704/703 = 2.46 c. deviations and simpler numbers"},"duncan":{"frequencies":[261.6255653006,277.97716313189,294.32876096318,313.95067836072,327.03195662575,348.83408706747,366.27579142084,392.4383479509,418.60090448096,436.04260883433,457.84473927605,490.54793493862,523.2511306012],"description":"Dudley Duncan's Superparticular Scale"},"duoden12":{"frequencies":[261.6255653006,275.93321340298,294.32876096318,310.42486507835,330.74639366397,348.83408706747,372.08969287196,392.4383479509,413.89982010446,440.99519155196,465.63729761752,496.11959049595,523.2511306012],"description":"Almost equal 12-tone subset of Duodenarium"},"duodenarium":{"frequencies":[14.56761754744,14.73307690724,14.74971276678,14.91724036858,14.98726085128,15.00418372272,15.10370587319,15.17460161192,15.19173601925,15.34695511171,15.36428413207,15.5387920506,15.55633768372,15.71528203439,15.73302695124,15.80687667908,15.91172305982,15.92968978813,16.00446263757,16.18624171938,16.20451842054,16.38856974087,16.57471152064,16.59342686263,16.78189541465,16.86066845769,16.87970668806,16.99166910733,17.07142681341,17.26532450067,17.28481964857,17.48114105693,17.67969228869,17.69965532014,17.78273626396,17.90068844229,17.98471302153,18.00502046726,18.2095219343,18.41634613405,18.43714095848,18.64655046072,18.73407606409,18.85833844126,18.87963234148,18.9682520149,18.98967002407,19.18369388963,19.20535516508,19.42349006325,19.44542210465,19.64410254298,19.66628368904,19.88965382477,19.91211223516,20.00557829696,20.13827449758,20.23280214922,20.25564802567,20.48571217609,20.7183894008,20.74178357829,20.97736926831,21.07583557211,21.21563074642,21.23958638417,21.33928351676,21.58165562584,21.60602456072,21.85142632116,22.09961536086,22.12456915017,22.37586055287,22.48089127691,22.50627558408,22.65555880978,22.76190241787,23.02043266756,23.0464261981,23.3081880759,23.57292305158,23.59954042685,23.71031501862,23.86758458973,23.97961736204,24.00669395635,24.27936257907,24.30677763081,24.55512817873,24.5828546113,24.86206728096,24.89014029395,25.14445125502,25.17284312198,25.29100268653,25.31956003209,25.487503661,25.60714022011,25.897986751,25.92722947286,26.22171158539,26.51953843303,26.54948298021,26.67410439595,26.85103266344,26.9770695323,27.0075307009,27.31428290145,27.62451920107,27.65571143772,27.96982569108,28.10111409614,28.2875076619,28.31944851222,28.45237802234,28.77554083445,28.80803274762,29.13523509488],"description":"Ellis's Duodenarium : genus [3^12 5^8]"},"duodene":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,313.95067836072,327.03195662575,348.83408706747,367.91095120397,392.4383479509,418.60090448096,436.04260883433,470.92601754108,490.54793493862,523.2511306012],"description":"Ellis's Duodene : genus [33355]"},"duodene14-18-21":{"frequencies":[261.6255653006,271.31540105247,294.32876096318,305.22982618403,336.37572681506,348.83408706747,378.42269266694,392.4383479509,406.97310157871,448.50096908674,457.84473927605,504.56359022259,523.2511306012],"description":"14-18-21 Duodene"},"duodene3-11_9":{"frequencies":[261.6255653006,285.40970760065,294.32876096318,319.76457981184,321.08592105074,348.83408706747,359.73515228832,392.4383479509,426.35277308246,428.11456140098,479.64686971777,481.6288815761,523.2511306012],"description":"3-11/9 Duodene"},"duodene3-7":{"frequencies":[261.6255653006,294.32876096318,299.00064605783,305.22982618403,336.37572681506,343.38355445704,348.83408706747,392.4383479509,398.6675280771,448.50096908674,457.84473927605,515.07533168556,523.2511306012],"description":"3-7 Duodene"},"duodene6-7-9":{"frequencies":[261.6255653006,294.32876096318,299.00064605783,305.22982618403,336.37572681506,343.38355445704,348.83408706747,392.4383479509,406.97310157871,448.50096908674,457.84473927605,504.56359022259,523.2511306012],"description":"6-7-9 Duodene"},"duodene_min":{"frequencies":[261.6255653006,290.69507255622,294.32876096318,313.95067836072,327.03195662575,348.83408706747,353.19451315581,392.4383479509,418.60090448096,436.04260883433,470.92601754108,490.54793493862,523.2511306012],"description":"Minor Duodene"},"duodene_r-45":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,313.95067836072,334.88072358477,353.19451315581,376.74081403286,401.85686830172,408.78994578219,436.04260883433,465.11211608996,490.54793493862,523.2511306012],"description":"Ellis's Duodene rotated -45 degrees"},"duodene_r45":{"frequencies":[261.6255653006,275.93321340298,279.06726965397,294.32876096318,313.95067836072,334.88072358477,383.2405741708,408.78994578219,436.04260883433,459.88868900496,465.11211608996,490.54793493862,523.2511306012],"description":"Ellis's Duodene rotated 45 degrees"},"duodene_r90":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,306.59245933664,313.95067836072,327.03195662575,348.83408706747,392.4383479509,408.78994578219,418.60090448096,436.04260883433,490.54793493862,523.2511306012],"description":"Ellis's Duodene rotated 90 degrees: genus [33555]"},"duodene_skew":{"frequencies":[261.6255653006,282.55561052465,290.69507255622,313.95067836072,327.03195662575,348.83408706747,376.74081403286,392.4383479509,418.60090448096,436.04260883433,470.92601754108,502.32108537715,523.2511306012],"description":"Rotated 6/5x3/2 duodene"},"duodene_t":{"frequencies":[261.6255653006,279.3825857701,293.66476791741,313.59634948548,327.03195662575,349.22823143301,367.08095907728,391.99543598175,418.60090448096,436.53528831673,469.86362971679,489.99429388332,523.2511306012],"description":"Duodene with equal tempered fifths"},"duowell":{"frequencies":[261.6255653006,278.41172412276,294.03623226919,312.90189200955,327.96500300935,349.00756672938,368.59392213143,392.24328034087,417.4100028405,437.50413894442,469.11953885575,491.70297432358,523.2511306012],"description":"Ellis duodene well-tuned to fifth=(7168/11)^(1/16) third=(11/7)^(1/2)"},"dwarf6_7":{"frequencies":[261.6255653006,299.00064605783,327.03195662575,373.75080757229,392.4383479509,448.50096908674,523.2511306012],"description":"Dwarf(<6 10 14 17|)"},"cairo":{"frequencies":[261.6255653006,269.38381929633,276.03456984659,285.15047989166,293.63138642043,300.85736580106,309.799366845,312.20234522745,320.03127253896,327.93377450564,337.66851484331,348.83408706747,357.41197445437,367.9166999024,380.21445327801,392.4383479509,401.02017979859,414.62054722758,417.26565438692,427.77234352616,440.44707963064,451.93568025669,468.86302025197,480.04690880844,491.77737838459,510.98743222773,523.2511306012],"description":"P.42, of d'Erlanger, vol.5. Congress of Arabic Music, Cairo, 1932"},"canright":{"frequencies":[261.6255653006,286.48426603331,306.03443598155,335.11270457212,357.98136125932,391.99543598175,418.74586628806,458.53356119912,489.82466832727,523.2511306012],"description":"David Canright's piano tuning for \"Fibonacci Suite\" (2001)"},"carlos_alpha":{"frequencies":[261.6255653006,273.68256372566,286.29520819723,299.48910562989,313.29104303136,327.729041887,342.83241505062,358.63182625716,375.1593523779,392.44854854484,410.5345162762,429.45397474154,449.24533531117,469.94877954106,491.60634075178,514.26198936695,537.96172218451,562.75365576207,588.68812410589],"description":"Wendy Carlos' Alpha scale with perfect fifth divided in nine"},"carlos_alpha2":{"frequencies":[261.6255653006,267.58616452957,273.68256372566,279.91785681123,286.29520819723,292.81785438923,299.48910562989,306.31234757893,313.29104303136,320.42873367481,327.729041887,335.19567257401,342.83241505062,350.6431449633,358.63182625716,366.8025131876,375.1593523779,383.7065849236,392.44854854484,401.3896797878,410.5345162762,419.88769901416,429.45397474154,439.23819834286,449.24533531117,459.48046426806,469.94877954106,480.6555937997,491.60634075178,502.8065779009,514.26198936695,525.97838877075,537.96172218451,550.21807114943,562.75365576207,575.57483783111,588.68812410589],"description":"Wendy Carlos' Alpha prime scale with perfect fifth divided by eightteen"},"carlos_beta":{"frequencies":[261.6255653006,271.44693432634,281.63699549204,292.20958942356,303.17907632096,314.56035546319,326.36888544505,338.62070517372,351.33245565363,364.52140258903,378.2054598351,392.40321372938,407.13394833666,422.41767164147,438.27514272393,454.72789995564,471.7982902542,489.50949943583,507.88558370741,526.95150234083,546.73315157381,567.25739978343,588.55212398003],"description":"Wendy Carlos' Beta scale with perfect fifth divided by eleven"},"carlos_beta2":{"frequencies":[261.6255653006,266.49100855797,271.44693432634,276.49502530642,281.63699549204,286.87459075215,292.20958942356,297.64380291476,303.17907632096,308.81728905054,314.56035546319,320.41022551991,326.36888544505,332.43835840072,338.62070517372,344.91802487526,351.33245565363,357.86617542024,364.52140258903,371.30039682974,378.2054598351,385.23893610237,392.40321372938,399.70072522531,407.13394833666,414.70540688852,422.41767164147,430.27336116448,438.27514272393,446.42573318931,454.72789995564,463.18446188312,471.7982902542,480.57230974851,489.50949943583,498.61289378764,507.88558370741,517.33071758003,526.95150234083,536.75120456442,546.73315157381,556.90073257014,567.25739978343,577.80666964473,588.55212398003],"description":"Wendy Carlos' Beta prime scale with perfect fifth divided by twentytwo"},"carlos_gamma":{"frequencies":[261.6255653006,266.98388983977,272.45195763676,278.03201633122,283.72635959645,289.53732808222,295.4673103769,301.51874398927,307.69411635045,313.99596583639,320.42688281121,326.98951069203,333.68654703547,340.52074464653,347.49491271011,354.6119179457,361.87468578579,369.2862015783,376.84951181374,384.56772537748,392.44401482761,400.48161769905,408.68383783428,417.05404674148,425.59568498025,434.31226357598,443.20736546293,452.28464695708,461.547839259,471.00074998758,480.64726474513,490.49134871455,500.53704828923,510.78849273629,521.24989589392,531.92555790347],"description":"Wendy Carlos' Gamma scale with third divided by eleven or fifth by twenty"},"carlos_harm":{"frequencies":[261.6255653006,277.97716313189,294.32876096318,310.68035879446,327.03195662575,343.38355445704,359.73515228832,392.4383479509,425.14154361347,441.49314144476,457.84473927605,490.54793493862,523.2511306012],"description":"Carlos Harmonic & Ben Johnston's scale of 'Blues' from Suite f.micr.piano (1977) & David Beardsley's scale of 'Science Friction'"},"carlos_super":{"frequencies":[261.6255653006,277.97716313189,294.32876096318,313.95067836072,327.03195662575,348.83408706747,359.73515228832,392.4383479509,425.14154361347,436.04260883433,457.84473927605,490.54793493862,523.2511306012],"description":"Carlos Super Just"},"carlson":{"frequencies":[261.6255653006,274.70684356563,286.15296204753,294.32876096318,305.22982618403,313.95067836072,327.03195662575,339.14425131559,348.83408706747,366.27579142084,381.53728273004,392.4383479509,406.97310157871,418.60090448096,436.04260883433,457.84473927605,470.92601754108,490.54793493862,508.71637697339,523.2511306012],"description":"Brian Carlson's guitar scale (or 7 is 21/16 instead) fretted by Mark Rankin"},"cassandra1":{"frequencies":[261.6255653006,265.52313139125,271.43629763673,275.48001908354,279.58398024378,283.7490817683,290.06813927787,294.38942683035,298.7750924519,305.42877739024,309.97889991383,314.59680966486,319.28351286859,326.39391783308,331.25637026535,336.19125912653,343.67819754196,348.79814248043,353.99435973883,359.26798967332,367.26884406885,372.74022844163,378.29312490007,386.71766674112,392.47878977853,398.32574139651,407.19640716832,413.26261206104,419.41919061043,425.66748431192,435.14704737009,441.62964923022,448.20882304357,458.19037897128,465.01626879626,471.9438445688,478.97462660712,489.64133323501,496.93576068834,504.33885972365,515.57042175735,523.2511306012],"description":"Cassandra temperament (Erv Wilson), 13-limit, g=497.866"},"cassandra2":{"frequencies":[261.6255653006,265.34593985135,270.18130909623,275.10479273152,279.0168449367,284.10133754875,289.27848429833,293.3920895946,298.7385406747,304.18241953205,309.72550158209,314.12986807617,319.85422136322,325.68288889698,330.31417303802,336.33345109576,342.46241778116,348.70307193775,353.66170827405,360.10644584283,366.66862514012,371.88273569526,378.65951299923,385.5597827545,392.58579535013,398.16845391153,405.42423290482,412.81223314336,418.68251621245,426.31212065787,434.08075852776,440.25348482514,448.27617460765,456.44506096456,464.76280801961,471.37183998139,479.96159605313,488.70788228454,495.65741860341,504.6897280454,513.8866322474,523.2511306012],"description":"Cassandra temperament, schismic variant, 13-limit, g=497.395"},"catler":{"frequencies":[261.6255653006,269.80136421624,279.06726965397,294.32876096318,299.00064605783,305.22982618403,313.95067836072,318.93402246168,322.00069575458,327.03195662575,343.38355445704,348.83408706747,359.73515228832,367.91095120397,380.54627680087,392.4383479509,418.60090448096,425.14154361347,436.04260883433,441.49314144476,457.84473927605,465.11211608996,483.00104363188,490.54793493862,523.2511306012],"description":"Catler 24-tone JI from \"Over and Under the 13 Limit\", 1/1 3(3)"},"cbrat19":{"frequencies":[261.6255653006,272.05448646742,281.65887246066,291.7164960911,303.76422848609,314.23522436032,325.78124145721,339.14379232251,350.05979530932,364.18597952318,377.95660802413,389.93691761381,406.2330981776,420.87727247778,436.65546295526,454.14747622901,467.92430113657,486.684954898,506.27371414348,523.2511306012],"description":"brats = -1 -1 -1 -1 -1 -1 -1 -1 0 3/7 390808/591947 1/2 1/2 1/2 1/2 1/4 0 0 -1"},"ceb88f":{"frequencies":[261.6255653006,275.30280934529,289.60851057007,304.80308899558,320.69584574771,337.31885569235,354.97473368038,373.44187862432,393.05647479461,413.57234190108,435.03089105397,457.82276134277,481.66189358475,506.59641128799],"description":"88 cents steps with equal beating fifths"},"ceb88s":{"frequencies":[261.6255653006,275.27750547448,289.60710371138,304.74878776577,320.64207659236,337.32428016541,354.95189689869,373.45451504132,392.8755714351,413.39725679488,434.93759942207,457.54716438978,481.43806014345,506.51485544552,533.01280425363],"description":"88 cents steps with equal beating sevenths"},"ceb88t":{"frequencies":[261.6255653006,275.20384442973,289.60910777612,304.54100616185,320.3823320487,337.18847246966,354.60902163481,373.09056856306,392.69773188536,413.02170471677,434.58350960486,457.45853552679,481.16983689269,506.32527343025,533.01280425363],"description":"88 cents steps with equal beating 7/6 thirds"},"cet105":{"frequencies":[261.6255653006,277.98437592617,295.36606150822,313.83458334354,333.45789502888,354.30820661869,376.46223533368,400.00150378562,425.01262301844,451.58762919357,479.82430313337,509.82655042708,541.70476218406,575.57624366132],"description":"Equal temperament with very good 6/5 and 13/8"},"cet105a":{"frequencies":[261.6255653006,278.09098920184,295.59266404146,314.19580976213,333.96974580612,354.98815389674,377.32935907335,401.07660961589,426.31839262878,453.14877154631,481.66772230429,511.98151233648,544.20310589723,578.45256778249,614.85751848055,653.5536209391,694.68506540856,738.40511604959,784.8766959018],"description":"18th root of 3"},"cet111":{"frequencies":[261.6255653006,279.02234237845,297.57591715819,317.3632108372,338.46625752841,360.97255206362,384.97540137331,410.57431878206,437.87543474729,466.99193686517,498.04453913461,531.16197935691,566.48156495049,604.14972437838,644.32262592407,687.16682227215,732.8599410185,781.59142109591,833.56329335333,888.99103711409,948.10444554232,1011.14859670036,1078.38486510237,1150.09200534594,1226.56730779978,1308.127826503],"description":"25th root of 5, Karlheinz Stockhausen in \"Studie II\" (1954)"},"cet111a":{"frequencies":[261.6255653006,279.09119608948,297.72279782842,317.59821198502,338.80046946076,361.41815173468,385.54574794778,411.2840547398,438.74060487161,468.03009995854,499.27490936609,532.60556349815,568.16130614457,606.09068659426,646.55215742719,689.71476370538,735.75882016749,784.8766959018],"description":"17th root of 3. McLaren 'Microtonal Music', volume 1, track 8"},"cet112":{"frequencies":[261.6255653006,279.13807488234,297.82282461384,317.75828292395,339.02816520012,361.72179601836,385.93447726538,411.76789245756,439.33052439618,468.73812456399,500.11419015728,533.59048802364,569.30759588159,607.4155105893,648.07426630787,691.45461344743,737.73872000797,787.12095980595,839.80871352279,896.02324851892,956.00062766807,1019.99273078287,1088.26829265547,1161.11404316696,1238.83588500259,1321.76021726874,1410.23528064063,1504.63263477595,1605.34868446028,1712.8063948195,1827.45703443292,1949.78208984359,2080.29524321777,2219.54459500735,2368.11492276755,2526.63016208001,2695.75596930795,2876.20260183901,3068.72784518,3274.14022786751,3493.30234242079,3727.13457771193,3976.61891204907,4242.80307922676,4526.8048719912,4829.81697864182,5153.11189830808,5498.04733953642,5866.07179694692,6258.73081875602,6677.6733762505,7124.65885956048,7601.56430418436,8110.3925243186],"description":"53rd root of 31. McLaren 'Microtonal Music', volume 4, track 16"},"cet114":{"frequencies":[261.6255653006,279.47933554513,298.55147893584,318.92513586406,340.68912750315,363.93832870511,388.77409689134,415.30469757995,443.64579124771,473.92093172942,506.26209616971,540.81027939262,577.71608583803,617.1404103833,659.25511382574,704.24379572788,752.30258557703,803.64098403142,858.48280642307,917.06712239825,979.64933665453,1046.5022612024],"description":"21st root of 4"},"cet115":{"frequencies":[261.6255653006,279.68949451567,299.00064605783,319.64513593742,341.71502406609,365.30872604057,390.53145607553,417.49568846357,446.32166408632,477.13792869952,510.08190181294],"description":"2nd root of 8/7. Werner Linden, Musiktheorie, 2003 no.1 midi 15.Eb=19.44544 Hz"},"cet117":{"frequencies":[261.6255653006,279.86396690685,299.37379946195,320.24370022528,342.56848033562,366.44956000397,391.99543598175,419.32216217931,448.5538823653,479.82340237272,513.27277840175,549.0539690723,587.32953583482,628.27336308449,672.07145630843,718.92279942609,769.0402362475,822.65144744826,880,941.34642612261,1006.96941915374,1077.1671181081,1152.25842837255,1232.58448551457,1318.51022765149,1410.42601205207,1508.74940691646,1613.92711604023,1726.4369576214,1846.79005749489,1975.53320502451,2113.25127526858,2260.56991361642,2418.15841952625,2586.73271138559,2767.05861265008,2959.95538169309],"description":"72nd root of 128, step = generator of Miracle"},"cet118":{"frequencies":[261.6255653006,280.22072913446,300.13755324878,321.46997343155,344.3186075731,368.79121945838,395.0032340925,423.07827792492,453.14877154631,485.35654007358,519.85349135637,556.8023269521,596.37732215892,638.76512932755,684.16567043124,732.79307276157,784.8766959018],"description":"16th root of 3. McLaren 'Microtonal Music', volume 1, track 7"},"cet126":{"frequencies":[261.6255653006,281.50639381697,302.89795903081,325.91506125677,350.68122444233,377.32935907335,406.00247545366,436.85445118639,470.05085697597,505.76984518255,544.20310589723,585.55689566922,630.05314440547,677.93064638327,729.44634176744,784.8766959018],"description":"15th root of 3. McLaren 'Microtonal Music', volume 1, track 6"},"cet126a":{"frequencies":[261.6255653006,281.42815779395,302.72962012827,325.64340264099,350.29154279212,376.80531512858,405.32593044476,436.00528786292,469.00678383895,504.50618240233,542.69254813034,583.76926541313,627.95510352048,675.48539363125,726.61327927927,781.61106458091,840.77166451082,904.41016494992,972.86550081423,1046.5022612024],"description":"19th root of 4"},"cet133":{"frequencies":[261.6255653006,282.54488373859,305.13688994853,329.53533037111,355.88464567857,384.34082587483,415.07233376839,448.26110228542,484.10361152681,522.81205194575,564.61558053174,609.76167743791,658.5176110828,711.17202040031],"description":"13th root of e"},"cet140":{"frequencies":[261.6255653006,283.72172983292,307.68407293041,333.67021037701,361.85106232365,392.4119924075,425.55401329039,461.49511402661,500.47170241421,542.7401414615,588.57845795114,638.28815062634,692.19618110881,750.65713728047,814.05554253056,882.80839491877,957.36792629418,1038.22454144983,1125.91008648826,1221.00130775733,1324.12366033919,1435.95544645068,1557.23222387914,1688.75170820144,1831.3789571042],"description":"24th root of 7"},"cet141":{"frequencies":[261.6255653006,283.85429714132,307.97166902637,334.13814720468,362.52783176564,393.32961502355,426.7484383229,463.0066556268,502.34551296122,545.02675670673,591.33436279611,641.57644431325,696.08728968715,755.22958979995,819.39685117042,889.01601417107,964.55029369918,1046.5022612024],"description":"17th root of 4"},"cet146":{"frequencies":[261.6255653006,284.69629445872,309.80145226022,337.12043918596,366.84847565362,399.19799705513,434.40017432099,472.70655602525,514.39088038704,559.75102196641,609.11112257023,662.82390755693,721.27320639821,784.8766959018],"description":"13th root of 3, Bohlen-Pierce approximation"},"cet148":{"frequencies":[261.6255653006,284.92791524313,310.30575035912,337.94392545772,368.04376529149,400.82452432448,436.52498800167,475.40520223986,517.74838217475,563.86296895784,614.08486606944,668.77990486322,728.34649714081,793.21854485147,863.86858278563,940.81124699851,1024.60701225804,1115.86625569541,1215.25373699679,1323.49342609599,1441.37375222579,1569.7533918036],"description":"21th root of 6, Moreno's C-21"},"cet152":{"frequencies":[261.6255653006,285.70808394691,312.0073878821,340.72733440875,372.0911362405,406.34196228781,443.74556186468,484.59214639302,529.19833545193,577.91081034511,631.10724720728,689.20039277289,752.64098693245,821.92125998587],"description":"13th root of pi"},"cet158":{"frequencies":[261.6255653006,286.70831230381,314.19580976213,344.3186075731,377.32935907335,413.50494015483,453.14877154631,496.5933637384,544.20310589723,596.37732215892,653.5536209391,716.21156534988,784.8766959018],"description":"12th root of 3, Moreno's A-12, see dissertation \"Embedding Equal Pitch Spaces."},"cet159":{"frequencies":[261.6255653006,286.82842069679,314.45911373416,344.75151869218,377.96204482418,414.37180231943,454.28897403052,498.05144066897,546.02962057131],"description":"4e-th root of e. e-th root of e is highest x-th root of x"},"cet160":{"frequencies":[261.6255653006,286.95745534843,314.74210513576,345.21700307457,378.64263238751,415.30469757995,455.51656649021,499.62194879119,547.99783383788,601.05771297194,659.25511382574,723.0874768355,793.10040709753,869.89233791055,954.11964586525,1046.5022612024],"description":"15th root of 4, Rudolf Escher in \"The Long Christmas Dinner\" (1960)"},"cet160a":{"frequencies":[261.6255653006,287.06963246392,314.98822873932,345.62201499981,379.23505183234,416.11708252541,456.58602635137,500.99072933585,549.71395617638,603.17569602575,661.83679400878,726.20290371434,796.8288589228,874.32344802967,959.35468153537,1052.65552131526,1155.03021091382,1267.36122959081,1390.6168610076,1525.85955590014,1674.2551187631,1837.08270650821,2015.74588766663,2211.78472029595,2426.88907720145,2662.91313932742,2921.89140956529,3206.0563044734,3517.85730085803,3859.98211320646,4235.37982185266,4647.28638964387,5099.2524155536,5595.17379976366,6139.32543031277,6736.39784717273,7391.53779523322,8110.3925243186],"description":"37th root of 31. McLaren 'Microtonal Music', volume 2, track 7"},"cet163":{"frequencies":[261.6255653006,287.45276480522,315.82957660097,347.00769742017,381.26366336311,418.90131810157,460.25449359467,505.68997636603,555.61077020009,610.45965236807],"description":"9th root of 7/3. Jeff Scott in \"Quiet Moonlight\" (2001)"},"cet163a":{"frequencies":[261.6255653006,287.41152361975,315.7389582221,346.85836204295,381.04491126651,418.60090448096,459.85843616195,505.18233428314,554.97338050766],"description":"5th root of 8/5"},"cet166":{"frequencies":[261.6255653006,287.95619440582,316.93680165166,348.83408706747],"description":"3rd root of 4/3"},"cet173":{"frequencies":[261.6255653006,289.10449173793,319.46957112932,353.02394045842,390.10257564198,431.07563562091,476.35215768611,526.38414093011,581.67105858963,642.7648443263,710.27540222401,784.8766959018],"description":"11th root of 3, Moreno's A-11"},"cet175":{"frequencies":[261.6255653006,289.48414624674,320.30918244523,354.41654988346,392.15575985798,433.91353804458,480.11779720922,531.2420078798,587.8100594825,650.40162657281,719.65810898332,796.28920449429,881.08018137935,974.89992535123,1078.70983713651,1193.57370864212,1320.66858845324,1461.29686662697,1616.89961515233,1789.07135516847,1979.57639663535,2190.36691789568,2423.60297039629,2681.67459807517,2967.22638952895,3283.18448966052,3632.78664249769,4019.61535560076,4447.6346101102],"description":"28th root of 7. McLaren 'Microtonal Music', volume 6, track 3"},"cet175a":{"frequencies":[261.6255653006,289.53628281337,320.42456924675,354.60807736883,392.4383479509,434.30442400296,480.63685362987,531.91211578736],"description":"4th root of 3/2"},"cet178":{"frequencies":[261.6255653006,289.91935960089,321.27301846367,356.01745236555,394.51936464224,437.18511000944,484.46499093218,536.85800524663,594.91712478053,659.25511382574,730.5510078664,809.55727745129,897.10776473059,994.12650420781,1101.63744560301,1220.77528002516,1352.79740322961,1499.09721690784,1661.21879031979,1840.87318566558,2039.95650991293,2260.56991361642,2505.04181781964,2775.9524141353,3076.16094499002,3408.83584914421,3777.48827884202,4186.0090448096],"description":"27th root of 16"},"cet181":{"frequencies":[261.6255653006,290.48091212946,322.51878830959,358.09020513941,397.58488163802,441.43552612833,490.12256936272,544.17943316245,604.19836236377,670.83693141722,744.82523718317,826.97390553231,918.18295398723,1019.45167961503,1131.88958971281,1256.72856920928,1395.33634826987],"description":"6.625 tET. The 16/3 is the so-called Kidjel Ratio promoted by Maurice Kidjel in 1958"},"cet182":{"frequencies":[261.6255653006,290.70585738945,323.0184918031,358.92275093366,398.81785224951,443.14738973192,492.40425618917,547.1361382945,607.95159681319,675.52683545966,750.61321956915,834.04563048717,926.75174856904,1029.76237395443,1144.22286477952,1271.40590625444,1412.7256395721,1569.7533918036],"description":"17th root of 6, Moreno's C-17"},"cet195":{"frequencies":[261.6255653006,292.81795587218,327.72927094457,366.80289667873,410.53509014096,459.48126579586,514.26306468681,575.57624366132],"description":"7th root of 11/5"},"cet21k":{"frequencies":[261.6255653006,264.89588486686,268.20708342769,271.55967197054,274.95416787017,278.3910952928,281.87098404962,285.39437141672,288.96180112674,292.57382370898,296.23099657435,299.9338841014,303.68305772341,307.47909424051,311.32258299104,315.21411535185,319.1542918681,323.14372059172,327.18301717534,331.2728049672,335.41371510742,339.60638662537,343.85146653829,348.14960995112,352.50148015762,356.90774874273,361.36909568619,365.8862094675,370.45978717215,375.09053459917,379.77916637013,384.52640603933,389.33298620552,394.19964862491,399.1271443257,404.11623372391,409.16768674077,414.28228292154,419.46080913287,424.70406934596,430.01287031296,435.38803129329,440.83038178715,446.34076166346,451.92002128953,457.56902166224,463.28863454093,469.07974258197,474.94323947488,480.88003008033,486.89103056976,492.97716856672,499.13938329007,505.37862569893,511.69585863936,518.09205699304,524.56820782765],"description":"scale of syntonic comma's, almost 56-tET"},"cet222":{"frequencies":[261.6255653006,297.3462123974,337.94392545772,384.08458333231,436.52498800167,496.12526073276,563.86296895784,640.8491384935,728.34649714081,827.79017883768,940.81124699851,1069.2634803114,1215.25373699679,1381.1765584523,1569.7533918036],"description":"14th root of 6, Moreno's C-14"},"cet233":{"frequencies":[261.6255653006,299.41460910537,342.66187834083,392.15575985798,448.79850611373,513.6227001391,587.8100594825,672.71300106294,769.87926947615,881.08018137935,1008.34288220748,1153.98733901804,1320.66858845324,1511.42518780658,1729.7345489351,1979.57639663535,2265.50524176842,2592.73349533282,2967.22638952895,3395.81083571538,3886.29974647262,4447.6346101102],"description":"21st root of 17. McLaren 'Microtonal Music', volume 2, track 15"},"cet24":{"frequencies":[261.6255653006,265.3411057651,269.1094134006,272.9312375932,276.80733837157,280.73848655813,284.72546392233,288.7690633361,292.87008893155,297.02935626086,301.24769245848,305.52593640563,309.86493889709,314.26556281043,318.72868327757,323.25518785885,327.84597671953,332.50196280875,337.22407204116,342.01324348101,346.8704295289,351.79659611118,356.79272287204,361.85980336835,366.9988452672,372.21087054633,377.49691569736,382.85803193188,388.29528539052,393.80975735501,399.40254446313,405.07475892685,410.82752875349,416.66199797006,422.57932685074,428.58069214763,434.66728732478,440.84032279551,447.10102616311,453.45064246502,459.89043442035,466.42168268106,473.04568608657,479.76376192214,486.57724618073,493.48749382879,500.49587907561,507.6037956467,514.81265706088,522.12389691142,529.53896915113],"description":"least squares fit primes 2-13"},"cet258":{"frequencies":[261.6255653006,303.75687573192,352.67287219582,409.46613795376,475.40520223986,551.96287401486,640.8491384935,744.04935121924,863.86858278563,1002.98310468409,1164.50016626124,1352.0273979586,1569.7533918036],"description":"12th root of 6, Moreno's C-12"},"cet29":{"frequencies":[51.91308719749,52.80006242627,53.70219231256,54.6197354699,55.55295587693,56.50212107609,57.46750349647,58.44938022184,59.44803272677,60.46374832519,61.49681820986,62.54753889218,63.61621194966,64.70314373878,65.80864697157,66.93303858176,68.07664129187,69.2397833384,70.42279815925,71.62602610967,72.84981213985,74.09450750046,75.36046944358,76.64806088248,77.95765225928,79.28961901721,80.64434345693,82.02221441105,83.42362735565,84.84898403373,86.29869452271,87.77317443616,89.27284697886,90.79814258634,92.34949851506,93.9273610926,95.53218267212,97.16442386902,98.82455316866,100.51304648023,102.230389586,103.97707482641,105.75360353451,107.56048560902,109.39823902877,111.26739251837,113.16848194039,115.10205294491,117.06866050489,119.06886838764,121.10325205621,123.17239474253,125.2768903313,127.4173428542,129.59436591466,131.80858584574,134.06063743615,136.35116706905,138.68083217153,141.05030058861,143.46025402018,145.91138336926,148.40439215824,150.93999592972,153.51892156515,156.14191102559,158.8097162888,161.52310306741,164.28285015685,167.08974869373,169.94460622727,172.84824120887,175.80148703892,178.80519135714,181.8602162858,184.96743760879,188.12774927869,191.34205731671,194.61128429254,197.93636853869,201.31826325695,204.75794142387,208.2563891515,211.8146105632,215.43362693858,219.11447574094,222.85821595641,226.66592086774,230.53868336123,234.47761499594,238.48384494529,242.55852580808,246.70282574354,250.91793424736,255.20506113867,259.56543598745],"description":"95th root of 5"},"cet39":{"frequencies":[261.6255653006,267.55763511324,273.62420803617,279.82833216202,286.17312954462,292.66178817784,299.29756995616,306.08381073387,313.02392200207,320.12139075456,327.37978859613,334.80276256646,342.39404424694,350.15744982839,358.09687996112,366.21632994368,374.51987945827,383.01170275779,391.6960687417,400.57734310204,409.65998815178,418.94857448076,428.44776921301,438.16234766073,448.09719341103,458.25729813392,468.64777462103,479.27384364987,490.14084702027,501.25424765147,512.61963232837,524.24271148185,536.12933410494,548.28547272565,560.71723832061,573.43088042607,586.43278689221,599.72950056876,613.32770249519,627.23422858353,641.45606974252,656.00037539202,670.87445318194,686.08578808043,701.64202314362,717.55097860059,733.82065199545,750.45921787297,767.47504913108,784.8766959018],"description":"49th root of 3"},"cet39a":{"frequencies":[261.6255653006,267.54999903763,273.60843178624,279.80421399945,286.14029787289,292.61969147246,299.24597805224,306.02231493662,312.9519192023,320.03862308027,327.28580327671,334.69690040195,342.27601296361,350.02675229311,357.95279806627,366.05853356918,374.34782106107,382.82459589435,391.49354592099,400.35880176332,409.42457221564,418.6958708581,428.17711532294,437.87280684605,447.78830736843,457.9283414747,468.29772316218,478.90218693807,489.74678566745,500.83666784082,512.17796641877,523.77608535691],"description":"31-tET with least squares octave; equal weight to 5/4, 3/2, 7/4 and 2/1"},"cet39b":{"frequencies":[261.6255653006,267.54443554965,273.59736903996,279.78708267123,286.11699418435,292.58994480246,299.2095086599,305.97865699219,312.90112748358,319.98002733127,327.21907624411,334.6220906301,342.19239338178,349.93416455252,357.85087908811,365.94690831825,374.22588619981,382.6921630398,391.3502022376,400.20389001205,409.25811505631,418.51694141988,427.98548149913,437.66798531163,447.56979919346,457.69536764001,468.05001127562,478.63918904181,489.46765396188,500.54138513107,511.86535306771,523.4458104663],"description":"31-tET with l.s. 8/7, 5/4, 4/3, 3/2, 8/5, 7/4, 2/1; equal weights"},"cet39c":{"frequencies":[261.6255653006,267.52919373065,273.56603860918,279.73910598956,286.05147140959,292.50627485027,299.10673210371,305.85612987468,312.75782903301,319.8152662872,327.03195662575,334.41149334841,341.95754947331,349.67388372612,357.56433846376,365.63284274659,373.88341429498,382.32016148985,390.94728541851,399.7690842757,408.78994578219,418.01436575232,427.44693588739,437.09235368188,446.9554220819,457.04105241293,467.35426952494,477.9002035559,488.68410850494,499.71135422907,510.98743222773,522.51795602393],"description":"10th root of 5/4"},"cet39d":{"frequencies":[261.6255653006,267.55786538889,273.62467903016,279.82905628857,286.1741163878,292.66304927922,299.29911724561,306.08565654127,313.02607906932,320.12387409698,327.38261000985,334.80593610581,342.39758442978,350.16137164992,358.1012009765,366.22106412416,374.52504331879,383.0173133498,391.70214366901,400.58390053708,409.66704921865,418.95615622721,428.45589162089,438.17103135034,448.1064596598,458.26717154264,468.65827525256,479.28499487175,490.15267293726,501.26677312698,512.63288300643,524.25671683791],"description":"31-tET with l.s. 5/4, 3/2, 7/4"},"cet39e":{"frequencies":[261.6255653006,267.56053134626,273.63013029147,279.83741943955,286.18551905392,292.67762672082,299.3170076044,306.10700082387,313.05102655064,320.15257723818,327.41522444303,334.84262641603,342.43851674365,350.20672153383,358.15114775562,366.27579142084],"description":"15th root of 7/5, X.J. Scott"},"cet44":{"frequencies":[261.6255653006,268.36512159638,275.27829096782,282.369545742,289.64347345451,297.10477981732,304.75829176301,312.60896056742,320.66186505284,328.92221487359,337.3953538863,346.08676360706,355.00206675748,364.14703090225,373.52757218034,383.14975913231,393.01981662619,403.14412988459,413.52924861543,424.18189124916,435.1089492851,446.31749174973,457.81476976988,469.60822126365,481.70547575226,494.11435929576,506.84289955596,519.89933098975,533.2921001762],"description":"least maximum error of 10.0911 cents to a set of 11-limit consonances"},"cet45":{"frequencies":[261.6255653006,268.55812265554,275.67437899809,282.97903853108,290.47742047479,298.17449463282,306.07552595385,314.18591889722,322.51122112969,331.05693609414,339.82928674186,348.83408706747],"description":"11th root of 4/3"},"cet45a":{"frequencies":[261.6255653006,268.48547646737,275.52525683447,282.74962263341,290.1634137569,297.77159700127,305.57926939395,313.59166160814,321.8141414671,330.2522175402,338.9115428334,347.79791857637,356.91729810903,366.27579142084],"description":"13th root of 7/5, X.J. Scott"},"cet49":{"frequencies":[261.6255653006,269.10883825956,276.80615518671,284.72363837915,292.86758524998,301.24447333711,309.86096545541,318.72391499615,327.84037137809,337.21758565441,346.86301628009,356.78433504421,366.98943317194,377.48642760107,388.28366743806,399.38974059878,410.81348063915,422.56397378117,434.65056613995,447.08287115744,459.87077724873,473.02445566714,486.55436859423,500.47127746122,514.78625150841,529.51067658945],"description":"least squares fit primes 3-13"},"cet49a":{"frequencies":[261.6255653006,269.10939785623,276.80730639354,284.72541458317,292.8700212642,301.24760545475,309.86483150611,318.72855440416,327.84582522255,337.22389673177,346.87022916874,356.7924961714,366.99859088307,377.49663223147,388.29497138724,399.40219840734,410.82714906841,422.57891189558,434.66683539241,447.10053547759,459.8899031344,473.04511227892,486.57662785344,500.49521415122,514.81194337949,529.53820446742],"description":"least squares fit primes 5-13"},"cet49b":{"frequencies":[261.6255653006,269.11089011973,276.81037630182,284.73015118141,292.87651740119,301.25595792767,309.87514121046,318.74092648901,327.86036925135,337.24072684885,346.88946427176,356.81426008988,367.0230125633,377.52384592787,388.3251168606,399.43542112995,410.86360043647,422.61874944911,434.71022304287,447.14764374346,459.94090938509,473.10020098719,486.63599085665,500.55905092174,514.88046130456,529.61161913871],"description":"least squares fit primes 3-11"},"cet51":{"frequencies":[261.6255653006,269.45730810595,277.52349357863,285.8311397433,294.38747470873,303.19994295657,312.27621181854,321.62417814738,331.25197518754,341.1679796516,351.38081900843,361.89937898954,372.73281132023,383.89054168203,395.38227791356,407.21801845694,419.40806105693,431.96301172054,444.89379394488,458.21165822114,471.92819182319,486.05532888913,500.60536080461,515.59094689708,531.0251223827,546.92132188791,563.29337300176,580.1555203085,597.52243480304,615.40922665547,633.83145835774,652.80515826392,672.34683453572,692.47348950549,713.20263446921,734.55230492227,756.54107625132,779.18807989593,802.51301999392,826.53619052513,851.2784929682,876.7614544861,903.00724665589,930.0387047592,957.87934765022,986.55339821839,1016.08580446361,1046.5022612024],"description":"47nd root of 4"},"cet53":{"frequencies":[261.6255653006,269.81714175785,278.26519897904,286.97776745533,295.963129115,305.22982618403],"description":"5th root of 7/6, X.J. Scott"},"cet54":{"frequencies":[261.6255653006,269.96706985652,278.57452968396,287.45642599351,296.6215054241,306.0787984682,315.83762188043,325.9075894649,336.29862154621,347.0209567468,358.08515411748,369.5021153806,381.28308783765,393.43967739203,405.98385998242,418.92799580061,432.28483186346,446.06752886518,460.28966468743,474.96525012045,490.10874266572,505.73506369981,521.85960157932,538.49824405725,555.66738252045,573.38393096839,591.66534267587,610.52963091344,629.99537269573,650.08174791487,670.80854445602,692.19618110881,714.26572768264,737.03893002078,760.53821452531,784.78673539949,809.80838082331,835.62780061242,862.2704354823,889.76252234217,918.13114956434,947.40426420901,977.61070438283,1008.78022764847,1040.94354635268,1074.13233401713,1108.37929206026,1143.71815851921,1180.1837471134,1217.81198154093,1256.63993812708,1296.7058535394,1338.04920533515,1380.71072249048,1424.73243255855,1470.15770307252,1517.03129303135,1565.39936221354,1615.30956841503,1666.81108016015,1719.95463363144,1774.79258265191,1831.3789571042],"description":"62nd root of 7"},"cet54a":{"frequencies":[36.70809598968,37.88151295543,39.09243955873,40.34207507177,41.63165640381,42.96246070241,44.33580570763,45.75305128262,47.21560103286,48.72490261351,50.28245077394,51.88978777214,53.5485051662,55.26024570942,57.02670371,58.84962859429,60.73082539186,62.67215683218,64.67554556259,66.74297456936,68.87649134796,71.07820847085,73.35030604133,75.69503428946,78.11471406483,80.61174171737,83.18858976192,85.8478097501,88.59203530858,91.42398271579,94.34645661434,97.36235078878,100.47465152683,103.6864411753,107.00089881505,110.42130694669,113.95105240089,117.59363027227,121.3526480812,125.23182656372,129.23500749643,133.36615476182,137.62935895249,142.02884224198,146.56895930934,151.25420649717,156.08922305851,161.0787965455,166.22786851013,171.54153558634,177.0250602084,182.68387207023,188.52357443227,194.5499507934,200.76896615752,207.18677957808,213.80974586608,220.64442297146,227.69757979185,234.97619765489,242.48748500016,250.23887937817,258.23805608937,266.49293732345,275.01169389411,283.8027624226,292.87484767725,302.23693268442,311.89828942495,321.86848086456,332.15738106504,342.77517792247,353.73238500089,365.03985405114,376.70877738729,388.75071142436,401.17757988308,414.00168763976,427.23573537822,440.89282237095,454.98647402737,469.53064564449,484.53973861665,500.02861758376,516.01261368641,532.50755680773,549.52977996323,567.09613827221,585.22402902787,603.93139550692,623.23676470498,643.1592524742,663.71858572717,684.9351219702,706.82987354375,729.42451222373,752.74141479803,776.80366927173,801.63510168485,827.26030448295,853.70464190233,880.99430375232],"description":"101st root of 24"},"cet54b":{"frequencies":[261.6255653006,269.96795403263,278.5763544202,287.45924871019,296.62539133416,306.08381073387,315.84382837889,325.91506125677,336.30743300953,347.03118371184,358.09687996112,369.51542742358,381.29807310848,393.45642905887,406.00247545366,418.94857448076,432.30748251802,446.09236270275,460.31680056078,474.99480683953,490.14084702027,505.76984518255,521.89720128632,538.53880634615,555.71105808945,573.43088042607,591.71572697754,610.58361784146,630.05314440547,650.14349087612,670.87445318194,692.26646247798,714.3405894063,737.11858847932,760.62290389144,784.8766959018],"description":"35th root of 3 or shrunk 22-tET"},"cet55":{"frequencies":[261.6255653006,270.01349691657,278.67035254505,287.60475577316,296.82560168354,306.34207552634,316.16365537714,326.30012507123,336.76157646737,347.55843063202,358.70144085484,370.20170518484,382.07067969055,394.32018111076,406.96241165943,420.00996255663,433.47583121124,447.37342422819,461.71658555081,476.51960046685,491.79721226214,507.56463983627,523.83758122386,540.63224654693,557.96536270557,575.85419620437,594.31655714751,613.37083662462,633.03601203256,653.33166919923,674.2780257851,695.8959359612,718.20693418482,741.23324143097,764.99779551626,789.52425640623,814.83705588084,840.96140460432,867.92332151557,895.74966491622,924.46813868508,954.10735043232,984.69681977767,1016.26701863443,1048.84937826003,1082.47635523452,1117.18144085251,1152.9992001672,1189.96531328939,1228.1165836432,1267.49101522141,1308.127826503],"description":"51th root of 5"},"cet55a":{"frequencies":[261.6255653006,270.1234331478,278.89732210685,287.95619440582,297.30930820811,306.96622255393,316.93680165166,327.23123542864,337.86004496999,348.83408706747],"description":"9th root of 4/3"},"cet63":{"frequencies":[261.6255653006,271.38398887572,281.50639381697,292.00635633712,302.89795903081,314.19580976213,325.91506125677,338.07143142496,350.68122444233,363.76135261718,377.32935907335,391.4034412791,406.00247545366,421.14604188408,436.85445118639,453.14877154631,470.05085697597,487.58337662462,505.76984518255,524.63465441916,544.20310589723,564.50144490757,585.55689566922,607.39769784277,630.05314440547,653.5536209391,677.93064638327,703.21691530872,729.44634176744,756.65410477833,784.8766959018],"description":"30th root of 3 or stretched 19-tET"},"cet63a":{"frequencies":[261.6255653006,271.37251603396,281.48259278098,291.96932561311,302.84674360983,314.12940356828,325.83240291761,337.9714015469,350.5626427598,363.62297711023,377.1698766242,391.22147055517,405.79656146784,420.91465242294,436.59597307447,452.86150935499,469.73302118774,487.23308701689,505.38512383853,524.21342105699,543.74317298677,564.00051582303,585.01254970054,606.80739415229,629.41421305643,652.8632568014,677.18590276436,702.41470135475,728.58340348685,755.72702964881,783.88190097186,813.08569174348,843.37747981977,874.79780396885,907.38869808556,941.19377721109,976.25827622702,1012.62911525602,1050.35496244617,1089.48630538731,1130.07549372248,1172.17684627813,1215.84669925421,1261.14348767523,1308.127826503],"description":"44th root of 5"},"cet67":{"frequencies":[261.6255653006,271.89449162354,282.56647812794,293.65734341902,305.18353207836,317.16212905639,329.61089159214,342.54827390456,355.99345454941,369.96636271272,384.48771622149,399.57903967613,415.26270466472,431.56196087069,448.50096908674],"description":"14th root of 12/7, X.J. Scott"},"cet70":{"frequencies":[261.6255653006,272.49048247121,283.80660334964,295.59266404146,307.86818385681,320.65348759128,333.96974580612,347.83900623503,362.28423824861,377.32935907335,392.99928119148,409.31995166322,426.31839262878,444.02275580482,462.46235461904,481.66772230429,501.67065719504,522.50428685614,544.20310589723,566.80304433509,590.34152430617,614.85751848055,640.39162865951,666.98613212152,694.68506540856,723.53429383412,753.58158307649,784.8766959018],"description":"27th root of 3"},"cet78":{"frequencies":[261.6255653006,273.68177330057,286.29355449603,299.48651076576,313.28742377221,327.72430932822,342.82647426905,358.62457594514,375.15068445646,392.4383479509],"description":"9th root of 3/2"},"cet79":{"frequencies":[261.6255653006,273.87994580863,286.70831230381,300.13755324878,314.19580976213,328.91254817579,344.3186075731,360.44627930254,377.32935907335,395.0032340925,413.50494015483,432.87325713404,453.14877154631,474.3739811962,496.5933637384,519.85349135637,544.20310589723,569.69324454502,596.37732215892,624.31126899512,653.5536209391,684.16567043124,716.21156534988,749.7584744066,784.8766959018],"description":"24th root of 3, James Heffernan (1906)."},"cet80":{"frequencies":[261.6255653006,273.93704112612,286.82786567404,300.32530171503,314.4578949408,329.25553433534,344.74951538696,360.97260627516,377.95911717185,395.74497280393,414.36778843034,433.8669493945,454.28369442026,475.66120282759,498.04439817054,521.48118104407,546.02084308555,571.71528316122,598.61884237431,626.7884189909,656.28358877393,687.16673097983,719.50316028422,753.36126491573,788.81265129014,825.93229545055,864.79870163404,905.49406830005,948.10446197172,992.7199992577,1039.43503743958,1088.34837402783,1139.56345570838,1193.18859712177,1249.33720993748,1308.127826503],"description":"35th root of 5"},"cet84":{"frequencies":[261.6255653006,274.70153691096,288.43104187674,302.84674360983,317.98293803021,333.87563322966,350.5626427598,368.08366429725,386.48038152577,405.79656146784,426.0781586093,447.37342422819,469.73302118774,493.21014446673,517.86064472263,543.74317298677,570.91930267857,599.45368763079,629.41421305643,660.87215705217,693.9023601738,728.58340348685,764.99779551626,803.23216389999,843.37747981977,885.52924725223,929.78774807537,976.25827622702,1025.05138820617,1076.28316609431,1130.07549372248,1186.55634664103,1245.86008938569,1308.127826503],"description":"33rd root of 5"},"cet87":{"frequencies":[261.6255653006,275.05808287728,289.18026151691,304.0275068203,319.63704721237,336.04802279017,353.30157737897,371.44097305523,390.51169339433,410.56155044631,431.64081781968,453.80235066263,477.10170997643,501.59731726833,527.35059397819,554.42610593952],"description":"Least-squares stretched ET to telephone dial tones. 1/1=697 Hz"},"cet88":{"frequencies":[261.6255653006,275.26799068863,289.6217982776,304.72408298441,320.61387403473,337.33223582731,354.92237405774,373.42974737602,392.90218486657,413.39000965417,434.94616895528,457.62637091093,481.48922855473,506.59641128799,533.01280425363],"description":"88 cents steps by Gary Morrison"},"cet88_appr":{"frequencies":[261.6255653006,275.62199471997,290.69507255622,305.22982618403,320.49131749323,336.37572681506,354.37113606854,373.75080757229,392.4383479509,413.43299207996,436.04260883433,457.84473927605,482.33849075995,504.56359022259,531.55670410281,560.62621135843,588.65752192635,620.14948811994,654.0639132515,686.76710891407,723.50773613993,763.07456546008,801.22829373309],"description":"88 cents scale approximated"},"cet88b":{"frequencies":[261.6255653006,275.26385669298,289.61326650562,304.7105300898,320.59498481995,337.30729585456,354.89100872976,373.39113880701,392.85588995712,413.33509311257,434.8821088097,457.55209870333,481.40413163568,506.49927024418,532.9029023296],"description":"87.9745 cents steps. Least squares of 7/6, 11/9, 10/7, 3/2, 7/4."},"cet88bis":{"frequencies":[261.6255653006,289.53272725508,320.41669955092,337.26306895804,373.23835706057,392.86190344834,434.76782633734,457.62637091093],"description":"Bistep approximation of 2212121 mode in 7/4 to 11/9 9/7 10/7 3/2"},"cet88bm":{"frequencies":[261.6255653006,275.22889829239,289.53954239223,304.59427454323,320.43178392135,337.09277136281,354.62005396115,373.05867644715,392.45602022512,412.86193859025,434.32887139488,456.91198653787,480.66932039657,505.66192697453,531.95403480429],"description":"87.75412 cents steps. Minimal highest deviation for 7/6, 11/9, 10/7, 3/2, 7/4."},"cet88c":{"frequencies":[261.6255653006,275.37188725148,289.84046967782,305.06925821769,321.09819727018,337.96933026971,355.72690383892,374.4174952616,394.09012940783,414.79640018179,436.59061916193,459.52995194191,483.67455974508,509.0877727469,535.83624905561,563.99013984227,593.62329144382,624.813430743,657.64235771869,692.19618110881,728.56553457307,766.84580121693,807.13738838693,849.54597972796,894.18279699007,941.16492045434,990.61558284509,1042.66447461031,1097.44811755542,1155.11020756021,1215.8019705522,1279.68259818323,1346.91964745566,1417.68945580607,1492.17764912727,1570.57960775359,1653.10095047047,1739.95812689496,1831.3789571042],"description":"38th root of 7. McLaren 'Microtonal Music', volume 3, track 7"},"cet89":{"frequencies":[261.6255653006,275.56724848068,290.25186566903,305.71900507847,322.01036982349,339.16988002511,357.2437980159,376.28084921395,396.33236207144,417.45239374596,439.69788420361,463.12880499146,487.80833148705,513.80299757552,541.1828853206,570.0218080747,600.39752248465,632.39191886931,666.09125466774,701.58637981228,738.97299766656,778.35189934333,819.82925103406,863.51687139942,909.53255273344,958.00034936337,1009.05093129669,1062.82192563509,1119.45831186524,1179.11277682321,1241.94614996535,1308.127826503],"description":"31st root of 5. McLaren 'Microtonal Music', volume 2, track 22"},"cet90":{"frequencies":[261.6255653006,275.62199471997,290.36720431405,305.90125228146,322.26633935092,339.50692625527,357.66984706396,376.80444887746,396.96271256675,418.19939952297,440.572208006,464.1419130862,488.97255163391,515.13157534193,542.69005603758,571.72285881831,602.3088534069,634.53113933145],"description":"Scale with limma steps"},"cet93":{"frequencies":[261.6255653006,275.99488223824,291.15340824655,307.14448922429,324.01384989472,341.80973194459,360.58302103444,380.38739950036,401.27949808494,423.31905787312],"description":"Tuning used in John Chowning's STRIA, 9th root of Phi"},"cet98":{"frequencies":[261.6255653006,276.83245825991,292.92324815749,309.94930780463,327.96500300935,347.02785219778,367.1987248383,388.54202015806,411.12588832951],"description":"8th root of 11/7, X.J. Scott"},"chahargah":{"frequencies":[261.6255653006,277.18263097687,283.66146785671,311.12698372208,326.97270111135,348.82502010853,367.86341164695,392.44854854484,415.30469757995,425.01198472693,466.16376151809,493.88330125613,523.2511306012],"description":"Chahargah in C"},"chahargah2":{"frequencies":[261.6255653006,283.66146785671,327.729041887,348.82502010853,392.44854854484,425.01198472693,493.88330125613,523.2511306012],"description":"Dastgah Chahargah in C, Mohammad Reza Gharib"},"chalmers":{"frequencies":[261.6255653006,274.70684356563,279.06726965397,294.32876096318,305.22982618403,313.95067836072,327.03195662575,343.38355445704,348.83408706747,366.27579142084,381.53728273004,392.4383479509,412.06026534844,418.60090448096,436.04260883433,457.84473927605,470.92601754108,488.36772189445,515.07533168556,523.2511306012],"description":"Chalmers' 19-tone with more hexanies than Perrett's Tierce-Tone"},"chalmers_17":{"frequencies":[261.6255653006,269.10058145205,286.15296204753,294.32876096318,313.95067836072,327.03195662575,336.37572681506,343.38355445704,376.74081403286,384.42940207435,392.4383479509,400.61414686654,408.78994578219,448.50096908674,457.84473927605,470.92601754108,490.54793493862,523.2511306012],"description":"7-limit figurative scale, Chalmers '96 Adnexed S&H decads"},"chalmers_19":{"frequencies":[261.6255653006,269.10058145205,290.69507255622,294.32876096318,305.22982618403,313.95067836072,336.37572681506,348.83408706747,356.10146388137,363.36884069528,376.74081403286,384.42940207435,392.4383479509,406.97310157871,436.04260883433,448.50096908674,465.11211608996,470.92601754108,508.71637697339,523.2511306012],"description":"7-limit figurative scale. Reversed S&H decads"},"chalmers_csurd":{"frequencies":[261.6255653006,273.35108123154,287.04667286017,303.37994773979,315.80837468238,323.38635505005,348.83408706747,357.38803216938,383.0466618906,392.4383479509,423.31690179539,433.47765231178,451.2357321491,476.91154755397,500.80604115761,523.2511306012],"description":"Combined Surd Scale, combination of Surd and Inverted Surd, JHC, 26-6-97"},"chalmers_isurd":{"frequencies":[261.6255653006,273.35108123154,287.04667286017,303.37994773979,323.38635505005,348.83408706747,383.0466618906,433.47765231178,523.2511306012],"description":"Inverted Surd Scale, of the form 4/(SQRT(N)+1, JHC, 26-6-97"},"chalmers_ji1":{"frequencies":[261.6255653006,277.97716313189,294.32876096318,310.68035879446,327.03195662575,348.83408706747,370.63621750918,392.4383479509,414.24047839262,436.04260883433,466.02053819169,490.54793493862,523.2511306012],"description":"Based loosely on Wronski's and similar JI scales, May 2, 1997."},"chalmers_ji2":{"frequencies":[261.6255653006,277.97716313189,294.32876096318,310.68035879446,327.03195662575,348.83408706747,370.63621750918,392.4383479509,416.96574469783,441.49314144476,466.02053819169,490.54793493862,523.2511306012],"description":"Based loosely on Wronski's and similar JI scales, May 2, 1997."},"chalmers_ji3":{"frequencies":[261.6255653006,279.06726965397,296.50897400735,313.95067836072,331.39238271409,348.83408706747,366.27579142084,392.4383479509,418.60090448096,444.76346101102,470.92601754108,497.08857407114,523.2511306012],"description":"15 16 17 18 19 20 21 on 1/1, 15-20 on 3/2, May 2, 1997. See other scales"},"chalmers_ji4":{"frequencies":[261.6255653006,279.06726965397,296.50897400735,313.95067836072,331.39238271409,348.83408706747,372.08969287196,395.34529867646,418.60090448096,441.85651028546,465.11211608996,496.11959049595,523.2511306012],"description":"15 16 17 18 19 20 on 1/1, same on 4/3, + 16/15 on 16/9"},"chalmers_surd":{"frequencies":[261.6255653006,315.80837468238,357.38803216938,392.4383479509,423.31690179539,451.2357321491,476.91154755397,500.80604115761,523.2511306012],"description":"Surd Scale, Surds of the form (SQRT(N)+1)/2, JHC, 26-6-97"},"chalmers_surd2":{"frequencies":[261.6255653006,272.2395613933,282.33485096279,291.98077704337,301.23248980765,310.13469895524,318.72425558532,327.03195662575,335.08385052998,342.90220911983,350.50624086893,357.91266581346,365.13613061818,372.18956061116,379.08442465499,385.8309605564,392.4383479509,398.91485744029,405.26796981327,411.50448329997,417.63058822561,423.65195171798,429.57376586736,435.40081471708,441.13750301549,446.78791303515,452.35581962987,457.84473927605,463.2579384726,468.59846621725,473.86917438523,479.07273156015,484.21164154672,489.28825377326,494.3047826718,499.26331035461,504.16580309972,509.01411882861,513.81001953884,518.55516185524,523.2511306012],"description":"Surd Scale, Surds of the form (SQRT(N)+1)/4"},"chalung":{"frequencies":[261.6255653006,328.09251713275,362.03316295439,390.31715077734,479.41117101029,527.4935758042,647.70012555753,728.30917696308,823.06004869243,961.65052057178,1054.9871516084,1301.05663342451],"description":"Tuning of chalung from Tasikmalaya. \"slendroid\". 1/1=185 Hz"},"chaumont":{"frequencies":[261.6255653006,273.37431312998,292.50627485027,309.49749487796,327.03195662575,349.91912034749,365.63284274659,391.22147055517,408.78994578219,437.39890198442,465.40109831725,489.02683710225,523.2511306012],"description":"Lambert Chaumont organ temperament (1695), 1st interpretation"},"chaumont2":{"frequencies":[261.6255653006,274.56549986328,292.86986732103,309.30531842668,327.84547867349,349.70184487387,366.99801003998,391.46454285105,410.8262805401,438.2147004401,465.11211608996,490.54793493862,523.2511306012],"description":"Lambert Chaumont organ temperament (1695), 2nd interpretation"},"chimes":{"frequencies":[261.6255653006,288.69027895239,130.8127826503,144.34513947619],"description":"Heavenly Chimes"},"chimes_peck":{"frequencies":[261.6255653006,327.03195662575,392.4383479509,457.84473927605,588.65752192635,719.47030457665,850.28308722695,981.09586987725,1046.5022612024],"description":"Kris Peck, 9-tone windchime tuning. TL 7-3-2001"},"chin_12":{"frequencies":[261.6255653006,277.05457499359,293.57996645301,310.53449241474,329.24697610111,347.79893712036,368.97000115401,391.76907592069,413.1274313058,439.00991514661,462.11551390967,491.43599249807,523.2511306012],"description":"Chinese scale, 4th cent."},"chin_5":{"frequencies":[261.6255653006,294.32876096318,348.83408706747,392.4383479509,441.49314144476,523.2511306012],"description":"Chinese pentatonic from Zhou period"},"chin_60":{"frequencies":[261.6255653006,262.17244551937,265.19499215873,268.81311753311,272.48060600886,276.1981310001,279.38237857051,283.19406633357,287.05775848811,290.97416342694,294.32876096318,294.94400091442,298.34436617857,302.41475692242,306.54068145351,310.72289706448,314.30517589183,318.59332496145,322.93997797627,327.34593352805,331.11985608357,331.812000697,335.63741195089,340.21660119759,344.85826629043,349.56326086722,353.59332287831,358.41749022331,363.30747486009,368.26417485089,372.50983809402,373.28850041093,377.59208844475,382.74367817547,387.96555142985,392.4383479509,393.25866808247,397.79248823809,403.21967609811,408.72090880899,414.29719629306,419.07356785577,424.79110016094,430.58663751693,436.46124492224,441.49314144476,442.41600115048,447.51654926786,453.62213515688,459.81102195042,466.08434536373,471.45776383774,477.8899872033,484.40996672226,491.01890004663,496.67978412536,497.7180007967,503.45611792634,510.32490448905,517.28740216504,523.2511306012],"description":"Chinese scale of fifths (the 60 lu\")"},"chin_7":{"frequencies":[261.6255653006,294.32876096318,331.11985608357,348.83408706747,392.4383479509,441.49314144476,496.67978412536,523.2511306012],"description":"Chinese heptatonic scale and tritriadic of 64:81:96 triad"},"chin_bianzhong":{"frequencies":[261.6255653006,277.82379926216,312.56802260838,375.1593523779,420.13030572059,469.40618689596,506.59641128799,563.72967895209,627.66881138238,764.75812197709,849.53311813274,949.1724262561,1225.95732655636],"description":"Pitches of Bianzhong bells (Xinyang). 1/1=b, Liang Mingyue, 1975."},"chin_bianzhong2a":{"frequencies":[261.6255653006,284.81073476233,312.56802260838,372.56793743951,413.39000965417,447.94973572445,491.60634075178,562.75365576207,652.05945856061,695.63805470995,863.88355261715,960.75607282217,1173.30283584026],"description":"A-tones (GU) of 13 Xinyang bells (Ma Cheng-Yuan) 1/1=d#=619 Hz"},"chin_bianzhong2b":{"frequencies":[261.6255653006,279.59231184543,312.74738729016,375.37536096215,418.43048063126,468.86028020615,505.12945327459,562.08698385796,624.42058858709,762.97988553915,849.53425657971,936.08862980659,1215.37624187632],"description":"B-tones (SUI) of 13 Xinyang bells (Ma Cheng-Yuan) 1/1=b+=506.6 Hz"},"chin_bianzhong3":{"frequencies":[261.6255653006,508.3551866238,542.32970395878,608.04166718582,619.02750937577,673.88551872153,729.80120031671,739.56153452917,812.57643344187,881.52624580654,911.03313298042,978.11461117351,982.0774855146,1059.88575280263,1092.20381072382,1163.18085489566,1213.27682870749,1331.52122774489,1483.40111876828,1542.82606951623,1645.93659621657,1649.74391394557,1818.91159982256,2044.01922018919,2273.22753490632,2362.92760489328,2776.13057951436],"description":"A and B-tones of 13 Xinyang bells (Ma Cheng-Yuan) abs. pitches wrt middle-C"},"chin_bronze":{"frequencies":[261.6255653006,299.00064605783,313.95067836072,327.03195662575,348.83408706747,392.4383479509,436.04260883433,523.2511306012],"description":"Scale found on ancient Chinese bronze instrument 3rd c.BC & \"Scholar's Lute\""},"chin_chime":{"frequencies":[261.6255653006,248.6592656401,341.74499057264,392.56190849927,548.78974538591,648.86582834888,714.36935367713,785.57745330134,889.7110417619,886.88898199546,992.62825668803,1044.08711871947,1326.14827969763],"description":"Pitches of 12 stone chimes, F. Kuttner, 1951, ROMA Toronto. %1=b4"},"chin_ching":{"frequencies":[261.6255653006,276.1981310001,294.32876096318,310.72289706448,331.11985608357,349.56326086722,368.26417485089,392.4383479509,414.29719629306,441.49314144476,466.08434536373,496.67978412536,524.34489103873],"description":"Scale of Ching Fang, c.45 BC. Pyth.steps 0 1 2 3 4 5 47 48 49 50 51 52 53"},"chin_di":{"frequencies":[261.6255653006,298.70635408336,316.56004827153,360.50766037677,409.94872043165,433.75364775074,527.37121036213],"description":"Chinese di scale"},"chin_di2":{"frequencies":[261.6255653006,289.95657583698,318.21537073485,338.89464890898,383.48501130814,436.9606979923,494.73987775324,522.04355935974],"description":"Observed tuning from Chinese flute dizi, Helmholtz/Ellis p. 518, nr.103"},"chin_huang":{"frequencies":[261.6255653006,331.11985608357,392.4383479509,441.49314144476,523.2511306012,588.65752192635,662.23971216714],"description":"Huang Zhong qin tuning"},"chin_liu-an":{"frequencies":[261.6255653006,278.83777354406,294.32876096318,311.64221749042,331.11985608357,353.19451315581,371.78369805875,392.4383479509,415.52295665389,441.49314144476,470.92601754108,492.82955324067],"description":"Scale of Liu An, in: \"Huai Nan Tzu\", c.122 BC, 1st known corr. to Pyth. scale"},"chin_lu":{"frequencies":[261.6255653006,277.01530443593,294.32876096318,313.95067836072,328.55303549378,348.83408706747,371.78369805875,392.4383479509,415.52295665389,441.49314144476,470.92601754108,495.71159741166,523.2511306012],"description":"Chinese L� scale by Huai Nan zi, Han era. P�re Amiot 1780, Kurt Reinhard"},"chin_lu2":{"frequencies":[261.6255653006,279.38237857051,294.32876096318,314.30517589183,331.11985608357,353.59332287831,372.50983809402,392.4383479509,419.07356785577,441.49314144476,471.45776383774,496.67978412536,523.2511306012],"description":"Chinese L� (Lushi chunqiu, by Lu Buwei). Mingyue: Music of the billion, p.67"},"chin_lu3":{"frequencies":[261.6255653006,277.34278419245,293.66476791741,310.58830860439,329.24697610111,347.81902735497,369.14054089803,391.76907592069,413.1512951712,439.23819834286,462.1422075194,491.60634075178,523.2511306012],"description":"Chinese L� scale by Ho Ch'�ng-T'ien, reported in Sung Shu (500 AD)"},"chin_lu3a":{"frequencies":[261.6255653006,277.06033146978,293.58830182213,310.53780743131,329.25144446584,347.79484055318,368.74579520635,391.78066943209,413.13681807919,438.99947255393,462.1072190611,491.17907538715,523.2511306012],"description":"Chinese L� scale by Ho Ch'�ng-T'ien, calc. basis is \"big number\" 177147"},"chin_lu4":{"frequencies":[261.6255653006,276.78521684908,293.5444075184,310.55356739316,329.35741152087,348.44172229085,369.5396750577,391.9150968203,414.62425518576,439.72952246257,465.20924434298,493.37740286979,523.2511306012],"description":"Chinese L� \"749-Temperament\""},"chin_lu5":{"frequencies":[261.6255653006,277.35401920913,293.41471131112,311.37240624271,329.40299530711,349.20610523279,369.80535913035,392.03738806826,415.16320853113,440.12206674667,466.08434536373,494.10449271367,522.71643616375],"description":"Chinese L� scale by Ch'ien Lo-Chih, c.450 AD Pyth.steps 0 154 255 103 204 etc."},"chin_lusheng":{"frequencies":[261.6255653006,316.38258506467,348.82502010853,389.28772571905,466.97226207056,520.53801357752],"description":"Observed tuning of a small Lusheng, 1/1=d, OdC '97"},"chin_pan":{"frequencies":[261.6255653006,275.62199471997,279.38237857051,290.36720431405,294.32876096318,310.07474405997,326.6631048533,331.11985608357,344.13890881665,348.83408706747,367.49599295996,372.50983809402,387.15627241873,392.4383479509,413.43299207996,419.07356785577,435.55080647107,441.49314144476,458.8518784222,465.11211608996,489.99465727995,496.67978412536,516.20836322497,523.2511306012],"description":"Pan Huai-su pure system, in: Sin-Yan Shen, 1991"},"chin_pipa":{"frequencies":[261.6255653006,284.4818984792,320.42873367481,380.17671965621,433.44136952667,521.74210224793],"description":"Observed tuning from Chinese balloon lute p'i-p'a, Helmholtz/Ellis p. 518, nr.109"},"chin_sheng":{"frequencies":[261.6255653006,295.36595061166,318.03161540472,348.82502010853,395.40657391157,442.03793673691,477.05982293263,522.94897617031],"description":"Observed tuning from Chinese sheng or mouth organ, Helmholtz/Ellis p. 518, nr.105"},"chin_sientsu":{"frequencies":[261.6255653006,291.80478157373,326.97270111135,392.44854854484,438.22451411849,523.2511306012],"description":"Observed tuning from Chinese tamboura sienzi, Helmholtz/Ellis p. 518, nr.108"},"chin_sona":{"frequencies":[261.6255653006,284.4818984792,310.58830860439,337.33223582731,377.98706287655,418.43499793376,469.94877954106,528.10941333272],"description":"Observed tuning from Chinese oboe (so-na), Helmholtz/Ellis p. 518, nr.104"},"chin_wang-po":{"frequencies":[261.6255653006,294.32876096318,330.24264909897,371.97947673071,392.4383479509,440.94196398978,495.71159741166,517.50111817701],"description":"Scale of Wang Po, 958 AD. H. Pischner: Musik in China, Berlin, 1955, p.20"},"chin_yangqin":{"frequencies":[261.6255653006,288.45311779165,306.48933163909,347.41744306689,383.26356564167,434.44398956347,465.08793784701,522.64699622026],"description":"Observed tuning from Chinese dulcimer yangqin, Helmholtz/Ellis p. 518, nr.107"},"chin_yunlo":{"frequencies":[261.6255653006,288.45311779165,323.40385076956,367.0144478307,386.1523605003,409.35055662695,483.1608380663,525.67465946865],"description":"Observed tuning from Chinese gong-chime (y�n-lo), Helmholtz/Ellis p. 518, nr.106"},"choquel":{"frequencies":[261.6255653006,272.52663052146,294.32876096318,313.95067836072,327.03195662575,348.83408706747,367.91095120397,392.4383479509,408.78994578219,436.04260883433,475.68284600109,490.54793493862,523.2511306012],"description":"Choquel/Barbour/Marpurg?"},"chordal":{"frequencies":[261.6255653006,392.4383479509,327.03195662575,457.84473927605,588.65752192635,719.47030457665,850.28308722695,981.09586987725,981.09586987725,490.54793493862,555.95432626377,621.36071758893,310.68035879446,523.2511306012,348.83408706747,418.60090448096,299.00064605783,465.11211608996,380.54627680087,322.00069575458,279.06726965397,610.45965236807,915.6894785521,872.08521766867,697.66817413493,654.0639132515,627.90135672144,448.50096908674,319.76457981184,377.90359432309,444.76346101102,889.52692202204,336.37572681506,294.32876096318,465.11211608996,411.12588832951,305.22982618403,366.27579142084,373.75080757229,313.95067836072,470.92601754108],"description":"Chordal Notes S&H"},"chrom15":{"frequencies":[261.6255653006,280.31310567921,301.87565226992,356.76213450082,392.4383479509,413.09299784305,436.04260883433,523.2511306012],"description":"Tonos-15 Chromatic"},"chrom15_inv":{"frequencies":[261.6255653006,313.95067836072,331.39238271409,348.83408706747,383.71749577421,453.48431318771,488.36772189445,523.2511306012],"description":"Inverted Chromatic Tonos-15 Harmonia"},"chrom15_inv2":{"frequencies":[261.6255653006,279.06726965397,296.50897400735,348.83408706747,383.71749577421,401.15920012759,418.60090448096,523.2511306012],"description":"A harmonic form of the Chromatic Tonos-15 inverted"},"chrom17":{"frequencies":[261.6255653006,277.97716313189,296.50897400735,370.63621750918,404.33041910093,423.58424858192,444.76346101102,523.2511306012],"description":"Tonos-17 Chromatic"},"chrom17_con":{"frequencies":[261.6255653006,277.97716313189,296.50897400735,370.63621750918,386.75083566176,404.33041910093,494.18162334558,523.2511306012],"description":"Conjunct Tonos-17 Chromatic"},"chrom19":{"frequencies":[261.6255653006,276.16031892841,292.40504357126,355.06326719367,382.37582620857,397.67085925691,414.24047839262,523.2511306012],"description":"Tonos-19 Chromatic"},"chrom19_con":{"frequencies":[261.6255653006,276.16031892841,292.40504357126,355.06326719367,368.21375857121,382.37582620857,451.89870370104,523.2511306012],"description":"Conjunct Tonos-19 Chromatic"},"chrom21":{"frequencies":[261.6255653006,274.70684356563,289.16509849014,343.38355445704,392.4383479509,406.97310157871,422.62591317789,523.2511306012],"description":"Tonos-21 Chromatic"},"chrom21_inv":{"frequencies":[261.6255653006,323.91736656265,336.37572681506,348.83408706747,398.6675280771,473.41768959156,498.33441009638,523.2511306012],"description":"Inverted Chromatic Tonos-21 Harmonia"},"chrom21_inv2":{"frequencies":[261.6255653006,279.06726965397,299.00064605783,348.83408706747,398.6675280771,423.58424858192,448.50096908674,523.2511306012],"description":"Inverted harmonic form of the Chromatic Tonos-21"},"chrom23":{"frequencies":[261.6255653006,273.51763645063,286.54228580542,334.29933343966,376.08675011961,401.15920012759,429.81342870813,523.2511306012],"description":"Tonos-23 Chromatic"},"chrom23_con":{"frequencies":[261.6255653006,273.51763645063,286.54228580542,334.29933343966,353.96400011258,376.08675011961,462.87600014722,523.2511306012],"description":"Conjunct Tonos-23 Chromatic"},"chrom25":{"frequencies":[261.6255653006,278.32506946872,297.30177875068,363.36884069528,408.78994578219,436.04260883433,467.18850946536,523.2511306012],"description":"Tonos-25 Chromatic"},"chrom25_con":{"frequencies":[261.6255653006,278.32506946872,297.30177875068,363.36884069528,384.74347838324,408.78994578219,503.12608711654,523.2511306012],"description":"Conjunct Tonos-25 Chromatic"},"chrom27":{"frequencies":[261.6255653006,277.01530443593,294.32876096318,353.19451315581,392.4383479509,415.52295665389,441.49314144476,523.2511306012],"description":"Tonos-27 Chromatic"},"chrom27_inv":{"frequencies":[261.6255653006,310.07474405997,329.45441556372,348.83408706747,387.59343007496,465.11211608996,494.18162334558,523.2511306012],"description":"Inverted Chromatic Tonos-27 Harmonia"},"chrom27_inv2":{"frequencies":[261.6255653006,271.31540105247,281.00523680435,348.83408706747,387.59343007496,406.97310157871,436.04260883433,523.2511306012],"description":"Inverted harmonic form of the Chromatic Tonos-27"},"chrom29":{"frequencies":[261.6255653006,270.96933548991,281.00523680435,344.87006335079,379.35706968587,399.32323124828,421.50785520652,523.2511306012],"description":"Tonos-29 Chromatic"},"chrom29_con":{"frequencies":[261.6255653006,270.96933548991,281.00523680435,344.87006335079,361.29244731988,379.35706968587,474.19633710734,523.2511306012],"description":"Conjunct Tonos-29 Chromatic"},"chrom31":{"frequencies":[261.6255653006,279.66870773512,300.3849083081,337.93302184661,352.6257619269,368.65420565085,386.2091678247,405.51962621593,523.2511306012],"description":"Tonos-31 Chromatic. Tone 24 alternates with 23 as MESE or A"},"chrom31_con":{"frequencies":[261.6255653006,279.66870773512,300.3849083081,337.93302184661,352.6257619269,368.65420565085,386.2091678247,450.57736246214,523.2511306012],"description":"Conjunct Tonos-31 Chromatic"},"chrom33":{"frequencies":[261.6255653006,278.50463402967,297.71185016965,359.73515228832,392.4383479509,411.12588832951,431.68218274599,523.2511306012],"description":"Tonos-33 Chromatic. A variant is 66 63 60 48"},"chrom33_con":{"frequencies":[261.6255653006,278.50463402967,297.71185016965,359.73515228832,375.37581108347,392.4383479509,479.64686971777,523.2511306012],"description":"Conjunct Tonos-33 Chromatic"},"chrom_new":{"frequencies":[261.6255653006,273.20871865617,297.93622032612,349.22823143301,391.99543598175,409.35055662695,446.39994737251,523.2511306012],"description":"New Chromatic genus 4.5 + 9 + 16.5"},"chrom_new2":{"frequencies":[261.6255653006,273.6474710507,299.37374239667,349.22823143301,391.99543598175,410.00794244467,448.55379686399,523.2511306012],"description":"New Chromatic genus 14/3 + 28/3 + 16 parts"},"chrom_soft":{"frequencies":[261.6255653006,271.68808704293,282.55561052465,348.83408706747,392.4383479509,407.5321305644,423.83341578697,523.2511306012],"description":"100/81 Chromatic. This genus is a good approximation to the soft chromatic"},"chrom_soft2":{"frequencies":[261.6255653006,268.42893440103,282.57118533961,349.22823143301,391.99543598175,402.18897205153,423.37840671577,523.2511306012],"description":"1:2 Soft Chromatic"},"chrom_soft3":{"frequencies":[261.6255653006,271.31540105247,281.75060878526,348.83408706747,392.4383479509,406.97310157871,422.62591317789,523.2511306012],"description":"Soft chromatic genus is from K. Schlesinger's modified Mixolydian Harmonia"},"cifariello":{"frequencies":[261.6255653006,279.06726965397,290.69507255622,294.32876096318,313.95067836072,327.03195662575,348.83408706747,363.36884069528,376.74081403286,392.4383479509,418.60090448096,436.04260883433,465.11211608996,470.92601754108,490.54793493862,523.2511306012],"description":"F. Cifariello Ciardi, ICMC 86 Proc. 15-tone 5-limit tuning"},"ckring1":{"frequencies":[261.6255653006,299.00064605783,305.22982618403,313.95067836072,327.03195662575,348.83408706747,366.27579142084,373.75080757229,392.4383479509,418.60090448096,436.04260883433,448.50096908674,457.84473927605,523.2511306012],"description":"Double-tie circular mirroring with common pivot of 4:5:6:7 = square 1 3 5 7"},"ckring2":{"frequencies":[261.6255653006,290.69507255622,305.22982618403,313.95067836072,336.37572681506,348.83408706747,366.27579142084,373.75080757229,392.4383479509,406.97310157871,436.04260883433,448.50096908674,470.92601754108,523.2511306012],"description":"Double-tie circular mirroring with common pivot of 3:5:7:9"},"clampitt-phi":{"frequencies":[261.6255653006,289.46753582364,320.2724252102,340.92857683151,377.20990650852,444.26963537301,491.54843559637,523.2511306012],"description":"David Clampitt, phi+1 mod 3phi+2, from \"Pairwise Well-Formed Scales\", 1997"},"classr":{"frequencies":[261.6255653006,275.93321340298,287.4304306281,313.95067836072,327.03195662575,344.91651675372,367.91095120397,392.4383479509,408.78994578219,441.49314144476,459.88868900496,490.54793493862,523.2511306012],"description":"Marvel projection to the 5-limit of class"},"cluster":{"frequencies":[261.6255653006,272.52663052146,294.32876096318,313.95067836072,327.03195662575,348.83408706747,376.74081403286,392.4383479509,408.78994578219,418.60090448096,436.04260883433,470.92601754108,490.54793493862,523.2511306012],"description":"13-tone 5-limit Tritriadic Cluster"},"cluster6a":{"frequencies":[261.6255653006,327.03195662575,348.83408706747,392.4383479509,436.04260883433,490.54793493862,523.2511306012],"description":"Six-Tone Triadic Cluster 4:5:6"},"cluster6b":{"frequencies":[261.6255653006,313.95067836072,327.03195662575,392.4383479509,418.60090448096,490.54793493862,523.2511306012],"description":"Six-Tone Triadic Cluster 4:6:5"},"cluster6c":{"frequencies":[261.6255653006,290.69507255622,313.95067836072,348.83408706747,418.60090448096,436.04260883433,523.2511306012],"description":"Six-Tone Triadic Cluster 3:4:5"},"cluster6d":{"frequencies":[261.6255653006,290.69507255622,327.03195662575,348.83408706747,392.4383479509,436.04260883433,523.2511306012],"description":"Six-Tone Triadic Cluster 3:5:4"},"cluster6e":{"frequencies":[261.6255653006,313.95067836072,327.03195662575,392.4383479509,418.60090448096,502.32108537715,523.2511306012],"description":"Six-Tone Triadic Cluster 5:6:8"},"cluster6f":{"frequencies":[261.6255653006,313.95067836072,348.83408706747,418.60090448096,436.04260883433,502.32108537715,523.2511306012],"description":"Six-Tone Triadic Cluster 5:8:6"},"cluster6g":{"frequencies":[261.6255653006,286.15296204753,299.00064605783,327.03195662575,373.75080757229,457.84473927605,523.2511306012],"description":"Six-Tone Triadic Cluster 4:5:7"},"cluster6h":{"frequencies":[261.6255653006,286.15296204753,327.03195662575,366.27579142084,418.60090448096,457.84473927605,523.2511306012],"description":"Six-Tone Triadic Cluster 4:7:5"},"cluster6i":{"frequencies":[261.6255653006,313.95067836072,366.27579142084,373.75080757229,439.53094970501,448.50096908674,523.2511306012],"description":"Six-Tone Triadic Cluster 5:6:7"},"cluster6j":{"frequencies":[261.6255653006,305.22982618403,313.95067836072,366.27579142084,436.04260883433,439.53094970501,523.2511306012],"description":"Six-Tone Triadic Cluster 5:7:6"},"cluster8a":{"frequencies":[261.6255653006,294.32876096318,327.03195662575,348.83408706747,367.91095120397,392.4383479509,436.04260883433,490.54793493862,523.2511306012],"description":"Eight-Tone Triadic Cluster 4:5:6"},"cluster8b":{"frequencies":[261.6255653006,306.59245933664,313.95067836072,327.03195662575,392.4383479509,408.78994578219,418.60090448096,490.54793493862,523.2511306012],"description":"Eight-Tone Triadic Cluster 4:6:5"},"cluster8c":{"frequencies":[261.6255653006,290.69507255622,313.95067836072,348.83408706747,363.36884069528,418.60090448096,436.04260883433,484.4917875937,523.2511306012],"description":"Eight-Tone Triadic Cluster 3:4:5"},"cluster8d":{"frequencies":[261.6255653006,290.69507255622,327.03195662575,348.83408706747,387.59343007496,392.4383479509,436.04260883433,465.11211608996,523.2511306012],"description":"Eight-Tone Triadic Cluster 3:5:4"},"cluster8e":{"frequencies":[261.6255653006,313.95067836072,327.03195662575,334.88072358477,392.4383479509,401.85686830172,418.60090448096,502.32108537715,523.2511306012],"description":"Eight-Tone Triadic Cluster 5:6:8"},"cluster8f":{"frequencies":[261.6255653006,301.39265122629,313.95067836072,348.83408706747,376.74081403286,418.60090448096,436.04260883433,502.32108537715,523.2511306012],"description":"Eight-Tone Triadic Cluster 5:8:6"},"cluster8g":{"frequencies":[261.6255653006,286.15296204753,299.00064605783,327.03195662575,373.75080757229,400.61414686654,457.84473927605,500.76768358318,523.2511306012],"description":"Eight-Tone Triadic Cluster 4:5:7"},"cluster8h":{"frequencies":[261.6255653006,286.15296204753,327.03195662575,357.69120255941,366.27579142084,408.78994578219,418.60090448096,457.84473927605,523.2511306012],"description":"Eight-Tone Triadic Cluster 4:7:5"},"cluster8i":{"frequencies":[261.6255653006,307.67166479351,313.95067836072,366.27579142084,373.75080757229,439.53094970501,448.50096908674,512.78610798918,523.2511306012],"description":"Eight-Tone Triadic Cluster 5:6:7"},"cluster8j":{"frequencies":[261.6255653006,263.718569823,305.22982618403,313.95067836072,366.27579142084,376.74081403286,436.04260883433,439.53094970501,523.2511306012],"description":"Eight-Tone Triadic Cluster 5:7:6"},"cohenf_11":{"frequencies":[261.6255653006,299.00064605783,305.22982618403,313.95067836072,327.03195662575,348.83408706747,366.27579142084,392.4383479509,418.60090448096,436.04260883433,457.84473927605,523.2511306012],"description":"Flynn Cohen, 7-limit scale of \"Rameau's nephew\", 1996"},"coleman":{"frequencies":[261.6255653006,276.70272600503,293.15632631094,310.58830860439,328.48713220126,349.43001184052,368.92737853004,391.76907592069,414.58565256441,438.98455767189,465.89457252293,491.89038573682,523.2511306012],"description":"Jim Coleman's ModX piano temperament. TL 16 Mar 1999"},"collengettes":{"frequencies":[261.6255653006,269.10058145205,275.62199471997,285.40970760065,294.32876096318,302.73815413355,310.07474405997,321.08592105074,331.11985608357,340.58042340025,348.83408706747,358.80077526939,367.49599295996,380.54627680087,392.4383479509,403.65087217807,413.43299207996,428.11456140098,441.49314144476,454.10723120033,465.11211608996,478.40103369253,496.67978412536,507.3950357345,523.2511306012],"description":"R.P. Collengettes, from p.23 of d'Erlanger, vol 5. 24 tone Arabic system"},"colonna1":{"frequencies":[261.6255653006,272.52663052146,290.69507255622,308.86351459099,327.03195662575,348.83408706747,363.36884069528,392.4383479509,399.70572476481,436.04260883433,463.29527188648,490.54793493862,523.2511306012],"description":"Colonna 1"},"colonna2":{"frequencies":[261.6255653006,272.52663052146,294.32876096318,313.95067836072,327.03195662575,348.83408706747,366.27579142084,392.4383479509,418.60090448096,436.04260883433,470.92601754108,479.64686971777,523.2511306012],"description":"Colonna 2"},"concertina":{"frequencies":[261.6255653006,272.52663052146,290.69507255622,294.32876096318,306.59245933664,327.03195662575,348.83408706747,367.91095120397,392.4383479509,408.78994578219,436.04260883433,441.49314144476,465.11211608996,490.54793493862,523.2511306012],"description":"English Concertina, Helmholtz/Ellis, p. 470"},"cons11":{"frequencies":[261.6255653006,313.95067836072,327.03195662575,348.83408706747,392.4383479509,436.04260883433,457.84473927605,523.2511306012],"description":"Set of intervals with num + den <= 11 not exceeding 2/1"},"cons12":{"frequencies":[261.6255653006,313.95067836072,327.03195662575,348.83408706747,366.27579142084,392.4383479509,436.04260883433,457.84473927605,523.2511306012],"description":"Set of intervals with num + den <= 12 not exceeding 2/1"},"cons13":{"frequencies":[261.6255653006,305.22982618403,313.95067836072,327.03195662575,348.83408706747,366.27579142084,392.4383479509,418.60090448096,436.04260883433,457.84473927605,523.2511306012],"description":"Set of intervals with num + den <= 13 not exceeding 2/1"},"cons14":{"frequencies":[261.6255653006,305.22982618403,313.95067836072,327.03195662575,348.83408706747,366.27579142084,392.4383479509,418.60090448096,436.04260883433,457.84473927605,470.92601754108,523.2511306012],"description":"Set of intervals with num + den <= 14 not exceeding 2/1"},"cons15":{"frequencies":[261.6255653006,299.00064605783,305.22982618403,313.95067836072,327.03195662575,348.83408706747,366.27579142084,392.4383479509,418.60090448096,436.04260883433,457.84473927605,470.92601754108,523.2511306012],"description":"Set of intervals with num + den <= 15 not exceeding 2/1"},"cons16":{"frequencies":[261.6255653006,299.00064605783,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,366.27579142084,392.4383479509,418.60090448096,436.04260883433,457.84473927605,470.92601754108,523.2511306012],"description":"Set of intervals with num + den <= 16 not exceeding 2/1"},"cons17":{"frequencies":[261.6255653006,294.32876096318,299.00064605783,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,366.27579142084,373.75080757229,392.4383479509,418.60090448096,436.04260883433,457.84473927605,470.92601754108,479.64686971777,523.2511306012],"description":"Set of intervals with num + den <= 17 not exceeding 2/1"},"cons18":{"frequencies":[261.6255653006,294.32876096318,299.00064605783,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,366.27579142084,373.75080757229,392.4383479509,411.12588832951,418.60090448096,436.04260883433,457.84473927605,470.92601754108,479.64686971777,523.2511306012],"description":"Set of intervals with num + den <= 18 not exceeding 2/1"},"cons19":{"frequencies":[261.6255653006,290.69507255622,294.32876096318,299.00064605783,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,359.73515228832,366.27579142084,373.75080757229,392.4383479509,411.12588832951,418.60090448096,436.04260883433,448.50096908674,457.84473927605,470.92601754108,479.64686971777,523.2511306012],"description":"Set of intervals with num + den <= 19 not exceeding 2/1"},"cons20":{"frequencies":[261.6255653006,290.69507255622,294.32876096318,299.00064605783,305.22982618403,313.95067836072,319.76457981184,327.03195662575,336.37572681506,348.83408706747,359.73515228832,366.27579142084,373.75080757229,392.4383479509,411.12588832951,418.60090448096,436.04260883433,448.50096908674,457.84473927605,470.92601754108,479.64686971777,485.87604984397,523.2511306012],"description":"Set of intervals with num + den <= 20 not exceeding 2/1"},"cons21":{"frequencies":[261.6255653006,287.78812183066,290.69507255622,294.32876096318,299.00064605783,305.22982618403,313.95067836072,319.76457981184,327.03195662575,336.37572681506,348.83408706747,359.73515228832,366.27579142084,373.75080757229,392.4383479509,411.12588832951,418.60090448096,425.14154361347,436.04260883433,448.50096908674,457.84473927605,470.92601754108,479.64686971777,485.87604984397,523.2511306012],"description":"Set of intervals with num + den <= 21 not exceeding 2/1"},"cons8":{"frequencies":[261.6255653006,348.83408706747,392.4383479509,436.04260883433,523.2511306012],"description":"Set of intervals with num + den <= 8 not exceeding 2/1"},"cons9":{"frequencies":[261.6255653006,327.03195662575,348.83408706747,392.4383479509,436.04260883433,523.2511306012],"description":"Set of intervals with num + den <= 9 not exceeding 2/1"},"cons_5":{"frequencies":[261.6255653006,313.95067836072,327.03195662575,348.83408706747,392.4383479509,418.60090448096,436.04260883433,470.92601754108,523.2511306012],"description":"Set of consonant 5-limit intervals within the octave"},"cons_7":{"frequencies":[261.6255653006,299.00064605783,305.22982618403,313.95067836072,327.03195662575,348.83408706747,366.27579142084,392.4383479509,418.60090448096,436.04260883433,457.84473927605],"description":"Set of consonant 7-limit intervals of tetrad 4:5:6:7 and inverse"},"cons_7a":{"frequencies":[261.6255653006,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,366.27579142084,373.75080757229,392.4383479509,418.60090448096,436.04260883433,457.84473927605],"description":"Set of consonant 7-limit intervals, harmonic entropy minima"},"cont_frac1":{"frequencies":[261.6255653006,264.29672053658,267.01859068163,284.39991302433,288.64312378534,304.51680721446,328.36325429535,342.47239171077,368.24757473349,390.36247006958,408.23697512781,419.80330474394,448.3033221197,488.42606438843,498.20005830409],"description":"Continued fraction scale 1, see McLaren in Xenharmonikon 15, pp.33-38"},"cont_frac2":{"frequencies":[261.6255653006,268.67076720771,283.00159623424,287.78825007941,303.56038377389,306.30898587133,329.63288816559,333.85601282718,352.97051886932,380.09613548074,393.10104267352,426.45795861378,432.83315799354,472.91012288255,483.94654132265,519.4303061261],"description":"Continued fraction scale 2, see McLaren in Xenharmonikon 15, pp.33-38"},"cordier":{"frequencies":[261.6255653006,277.2273508585,293.75953199293,311.27759533081,329.84032939425,349.51003591412,370.35272620855,392.4383479509,415.84102607989,440.63929776914,466.91639276282,494.76049384407,524.26505360912],"description":"Serge Cordier, piano tuning, 1975 (Piano bien temp�r� et justesse orchestrale)"},"corner11":{"frequencies":[261.6255653006,269.80136421624,286.15296204753,294.32876096318,314.76825825228,327.03195662575,343.38355445704,359.73515228832,392.4383479509,400.61414686654,408.78994578219,449.66894036041,457.84473927605,490.54793493862,494.63583439645,523.2511306012],"description":"Quadratic Corner 11-limit. Chalmers '96"},"corner13":{"frequencies":[261.6255653006,265.71346475842,269.80136421624,286.15296204753,292.28481123426,294.32876096318,314.76825825228,318.85615771011,327.03195662575,343.38355445704,345.42750418595,359.73515228832,371.99885066179,392.4383479509,400.61414686654,408.78994578219,425.14154361347,449.66894036041,457.84473927605,490.54793493862,494.63583439645,523.2511306012],"description":"Quadratic Corner 13-limit. Chalmers '96"},"corner17":{"frequencies":[261.6255653006,265.71346475842,269.80136421624,277.97716313189,286.15296204753,292.28481123426,294.32876096318,295.35073582763,314.76825825228,318.85615771011,327.03195662575,343.38355445704,345.42750418595,347.47145391486,359.73515228832,371.99885066179,382.21859930635,392.4383479509,400.61414686654,408.78994578219,416.96574469783,425.14154361347,449.66894036041,451.71289008932,457.84473927605,486.4600354808,490.54793493862,494.63583439645,523.2511306012],"description":"Quadratic Corner 17-limit."},"corner17a":{"frequencies":[261.6255653006,265.71346475842,269.80136421624,275.93321340298,277.97716313189,286.15296204753,292.28481123426,294.32876096318,295.35073582763,306.59245933664,312.72430852337,314.76825825228,318.85615771011,327.03195662575,331.11985608357,337.2517052703,343.38355445704,345.42750418595,347.47145391486,359.73515228832,367.91095120397,371.99885066179,382.21859930635,392.4383479509,398.57019713763,400.61414686654,404.70204632437,408.78994578219,416.96574469783,425.14154361347,429.2294430713,441.49314144476,449.66894036041,451.71289008932,457.84473927605,459.88868900496,478.28423656516,486.4600354808,490.54793493862,494.63583439645,515.07533168556,521.20718087229,523.2511306012],"description":"Quadratic Corner 17 odd limit."},"corner7":{"frequencies":[261.6255653006,286.15296204753,294.32876096318,327.03195662575,343.38355445704,392.4383479509,400.61414686654,408.78994578219,457.84473927605,490.54793493862,523.2511306012],"description":"Quadratic corner 7-limit. Chalmers '96"},"corner9":{"frequencies":[261.6255653006,286.15296204753,294.32876096318,327.03195662575,331.11985608357,343.38355445704,367.91095120397,392.4383479509,400.61414686654,408.78994578219,441.49314144476,457.84473927605,490.54793493862,515.07533168556,523.2511306012],"description":"First 9 harmonics of 5th through 9th harmonics"},"corners11":{"frequencies":[261.6255653006,269.80136421624,276.76092858245,279.06726965397,286.15296204753,294.32876096318,299.00064605783,304.4370214407,314.76825825228,327.03195662575,334.88072358477,341.71502406609,343.38355445704,348.83408706747,359.73515228832,380.54627680087,392.4383479509,398.6675280771,400.61414686654,408.78994578219,418.60090448096,434.91003062957,449.66894036041,457.84473927605,465.11211608996,478.40103369253,490.54793493862,494.63583439645,507.3950357345,523.2511306012],"description":"Quadratic Corners 11-limit. Chalmers '96"},"corners13":{"frequencies":[261.6255653006,265.71346475842,269.80136421624,276.76092858245,279.06726965397,286.15296204753,292.28481123426,294.32876096318,299.00064605783,304.4370214407,314.76825825228,318.85615771011,322.00069575458,327.03195662575,334.88072358477,341.71502406609,343.38355445704,345.42750418595,348.83408706747,359.73515228832,368.0007951481,371.99885066179,380.54627680087,392.4383479509,396.30854862103,398.6675280771,400.61414686654,408.78994578219,418.60090448096,425.14154361347,429.33426100611,434.91003062957,449.66894036041,457.84473927605,465.11211608996,468.3646483703,478.40103369253,490.54793493862,494.63583439645,507.3950357345,515.20111320734,523.2511306012],"description":"Quadratic Corners 13-limit. Chalmers '96"},"corners7":{"frequencies":[261.6255653006,279.06726965397,286.15296204753,294.32876096318,299.00064605783,327.03195662575,334.88072358477,341.71502406609,343.38355445704,348.83408706747,392.4383479509,398.6675280771,400.61414686654,408.78994578219,418.60090448096,457.84473927605,465.11211608996,478.40103369253,490.54793493862,523.2511306012],"description":"Quadratic Corners 7-limit. Chalmers '96"},"corrette":{"frequencies":[261.6255653006,273.37431312998,292.50627485027,309.11326130363,327.03195662575,349.91912034749,365.63284274659,391.22147055517,411.33704984564,437.39890198442,465.11211608996,489.02683710225,523.2511306012],"description":"Corrette temperament"},"corrette2":{"frequencies":[261.6255653006,272.8349596094,292.34127285051,310.42509491746,326.6631048533,350.01785633742,365.01443422269,391.11111150212,409.71484950008,437.02884834934,466.16376151809,488.33748205014,523.2511306012],"description":"Michel Corrette, modified meantone temperament (1753)"},"coul_12":{"frequencies":[261.6255653006,272.52663052146,290.69507255622,313.95067836072,327.03195662575,340.65828815182,363.36884069528,392.4383479509,408.78994578219,436.04260883433,470.92601754108,490.54793493862,523.2511306012],"description":"Scale 1 5/4 3/2 2 successively split largest intervals by smallest interval"},"coul_12a":{"frequencies":[261.6255653006,272.52663052146,290.69507255622,313.95067836072,327.03195662575,348.83408706747,376.74081403286,392.4383479509,408.78994578219,436.04260883433,470.92601754108,490.54793493862,523.2511306012],"description":"Scale 1 6/5 3/2 2 successively split largest intervals by smallest interval"},"coul_12sup":{"frequencies":[261.6255653006,280.31310567921,294.32876096318,310.68035879446,331.39238271409,348.83408706747,373.75080757229,392.4383479509,420.46965851882,441.49314144476,466.02053819169,497.08857407114,523.2511306012],"description":"Superparticular approximation to Pythagorean scale. Op de Coul, 2003"},"coul_13":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,313.95067836072,327.03195662575,348.83408706747,363.36884069528,376.74081403286,392.4383479509,418.60090448096,436.04260883433,465.11211608996,490.54793493862,523.2511306012],"description":"Symmetrical 13-tone 5-limit just system"},"coul_17sup":{"frequencies":[261.6255653006,276.16031892841,279.06726965397,294.57100685697,310.07474405997,313.95067836072,331.39238271409,348.83408706747,368.21375857121,372.08969287196,392.76134247596,413.43299207996,418.60090448096,441.85651028546,465.11211608996,470.92601754108,497.08857407114,523.2511306012],"description":"Superparticular approximation to Pythagorean 17-tone scale. Op de Coul, 2003"},"coul_20":{"frequencies":[261.6255653006,277.18263097687,282.2367833559,293.66476791741,305.55548036855,311.12698372208,329.62755691287,335.63799088232,349.22823143301,363.36884069528,369.99442271164,391.99543598175,399.14308682247,415.30469757995,432.12070439462,440,466.16376151809,474.66379875343,493.88330125613,513.88101620607,523.2511306012],"description":"Tuning for a 3-row symmetrical keyboard, Op de Coul, 1989"},"coul_27":{"frequencies":[261.6255653006,275.62199471997,275.93321340298,279.06726965397,293.99679436797,294.32876096318,310.07474405997,310.42486507835,327.03195662575,330.74639366397,331.11985608357,348.83408706747,367.49599295996,367.91095120397,372.08969287196,372.50983809402,392.4383479509,413.43299207996,413.89982010446,418.60090448096,440.99519155196,441.49314144476,465.11211608996,465.63729761752,490.54793493862,496.11959049595,496.67978412536,523.2511306012],"description":"Symmetrical 27-tone 5-limit just system, 67108864/66430125 and 25/24"},"counterschismic":{"frequencies":[261.6255653006,265.12640119254,268.67408364533,272.2692364133,275.65170316539,279.34022410565,283.07810312094,286.865997406,290.70457953408,294.3160713245,298.25434362449,302.24531258767,306.28968684494,310.09479611189,314.24420508029,318.4491358588,322.71033506911,327.0285519162,331.0913069245,335.5216703313,340.01131880467,344.56104171562,348.84160709651,353.50948891197,358.2398341551,363.03347451625,367.54352740958,372.46166135084,377.44560747755,382.49624206822,387.61445966759,392.4298881006,397.68103103357,403.0024376988,408.3950505989,413.46864135256,419.00130591222,424.60800114791,430.28972009123,436.04746916004,441.46459261549,447.37187116862,453.35819556254,459.4246261707,465.13216971689,471.35614630867,477.663406507,484.05506753352,490.06860102591,496.62625431187,503.27165616309,510.00598369715,516.83042094502,523.2511306012],"description":"Counterschismic temperament, g=498.082318, 5-limit"},"couperin":{"frequencies":[261.6255653006,273.37431312998,292.50627485027,309.28785294636,327.03195662575,349.91912034749,365.63284274659,391.22147055517,408.78994578219,437.39890198442,465.24345038333,489.02683710225,523.2511306012],"description":"Couperin modified meantone"},"cross13":{"frequencies":[261.6255653006,281.75060878526,285.40970760065,290.69507255622,299.00064605783,305.22982618403,322.00069575458,332.97799220076,336.37572681506,366.27579142084,373.75080757229,406.97310157871,411.12588832951,425.14154361347,448.50096908674,457.84473927605,470.92601754108,479.64686971777,485.87604984397,523.2511306012],"description":"13-limit harmonic/subharmonic cross"},"cross2":{"frequencies":[261.6255653006,282.55561052465,339.14425131559,366.27579142084,436.04260883433,470.92601754108,560.62621135843,605.4763082671,726.73768139056,784.8766959018],"description":"Pusey's double 5-7 cross reduced by 3/1"},"cross2_5":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,313.95067836072,348.83408706747,392.4383479509,436.04260883433,465.11211608996,490.54793493862,523.2511306012],"description":"double 3-5 cross reduced by 2/1"},"cross2_7":{"frequencies":[261.6255653006,294.32876096318,299.00064605783,327.03195662575,334.88072358477,341.71502406609,348.83408706747,392.4383479509,400.61414686654,408.78994578219,418.60090448096,457.84473927605,465.11211608996,523.2511306012],"description":"longer 3-5-7 cross reduced by 2/1"},"cross3":{"frequencies":[261.6255653006,282.55561052465,311.45900631024,336.37572681506,363.28578496026,403.74315632809,436.04260883433,470.92601754108,508.60009894437,565.24041885932,610.45965236807,659.29642455751,726.73768139056,784.8766959018],"description":"Pusey's triple 5-7 cross reduced by 3/1"},"cross_7":{"frequencies":[261.6255653006,299.00064605783,327.03195662575,348.83408706747,392.4383479509,418.60090448096,457.84473927605,523.2511306012],"description":"3-5-7 cross reduced by 2/1, quasi diatonic, similar to Zalzal's, Flynn Cohen"},"cross_72":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,305.22982618403,313.95067836072,343.38355445704,348.83408706747,392.4383479509,398.6675280771,436.04260883433,448.50096908674,465.11211608996,490.54793493862,523.2511306012],"description":"double 3-5-7 cross reduced by 2/1"},"cross_7a":{"frequencies":[261.6255653006,336.37572681506,392.4383479509,436.04260883433,470.92601754108,523.2511306012,610.45965236807,784.8766959018],"description":"2-5-7 cross reduced by 3/1"},"cruciform":{"frequencies":[261.6255653006,294.32876096318,306.59245933664,313.95067836072,327.03195662575,348.83408706747,367.91095120397,392.4383479509,408.78994578219,418.60090448096,436.04260883433,490.54793493862,523.2511306012],"description":"Cruciform Lattice"},"galilei":{"frequencies":[261.6255653006,277.66336828161,293.32570896007,311.30674962848,328.86683469969,348.2210758395,368.7143392539,390.41365788584,413.39000965417,437.71854962063,463.47885582013,490.75518955849,523.2511306012],"description":"Vincenzo Galilei's approximation"},"gamelan_om":{"frequencies":[261.6255653006,280.31310567921,294.32876096318,305.22982618403,327.03195662575,348.83408706747,366.27579142084,392.4383479509,406.97310157871,436.04260883433,457.84473927605,490.54793493862,523.2511306012],"description":"Other Music gamelan (7 limit black keys)"},"gamelan_udan":{"frequencies":[261.6255653006,261.6255653006,290.69507255622,305.22982618403,334.88072358477,351.32575911795,364.00078650518,392.4383479509,402.50086969323,465.11211608996,465.11211608996,501.44900015948,523.2511306012],"description":"Gamelan Udan Mas (approx) s6,p6,p7,s1,p1,s2,p2,p3,s3,p4,s5,p5"},"ganassi":{"frequencies":[261.6255653006,275.39533189537,290.69507255622,307.79478270659,327.03195662575,348.83408706747,369.35373924791,392.4383479509,413.09299784305,436.04260883433,461.69217405988,490.54793493862,523.2511306012],"description":"Sylvestro Ganassi's temperament (1543)"},"gann_custer":{"frequencies":[261.6255653006,269.80136421624,274.70684356563,279.06726965397,287.78812183066,290.69507255622,294.32876096318,299.00064605783,305.22982618403,313.95067836072,319.76457981184,327.03195662575,336.37572681506,343.38355445704,348.83408706747,353.19451315581,359.73515228832,366.27579142084,380.54627680087,392.4383479509,406.97310157871,418.60090448096,428.11456140098,436.04260883433,448.50096908674,457.84473927605,465.11211608996,470.92601754108,479.64686971777,490.54793493862,507.3950357345,523.2511306012],"description":"Kyle Gann, scale from Custer's Ghost to Sitting Bull, 1/1=G"},"gann_frac":{"frequencies":[261.6255653006,264.89588486686,294.32876096318,305.22982618403,309.04519901133,313.95067836072,348.83408706747,353.19451315581,366.27579142084,392.4383479509,397.34382730029,412.06026534844,418.60090448096,423.83341578697,457.84473927605,470.92601754108,523.2511306012],"description":"Kyle Gann, scale from Fractured Paradise, 1/1=B"},"gann_ghost":{"frequencies":[261.6255653006,294.32876096318,305.22982618403,343.38355445704,348.83408706747,392.4383479509,406.97310157871,457.84473927605,523.2511306012],"description":"Kyle Gann, scale from Ghost Town, 1/1=E"},"gann_super":{"frequencies":[261.6255653006,287.78812183066,290.69507255622,294.32876096318,299.00064605783,313.95067836072,327.03195662575,336.37572681506,348.83408706747,359.73515228832,366.27579142084,373.75080757229,392.4383479509,411.12588832951,406.97310157871,418.60090448096,436.04260883433,448.50096908674,457.84473927605,465.11211608996,470.92601754108,523.2511306012],"description":"Kyle Gann, scale from Superparticular Woman (1992), 1/1=G"},"gann_things":{"frequencies":[261.6255653006,266.47048317654,272.52663052146,290.69507255622,294.32876096318,299.00064605783,305.22982618403,313.95067836072,319.76457981184,327.03195662575,336.37572681506,343.38355445704,348.83408706747,373.75080757229,387.59343007496,392.4383479509,406.97310157871,408.78994578219,436.04260883433,448.50096908674,465.11211608996,490.54793493862,498.33441009638,508.71637697339,523.2511306012],"description":"Kyle Gann, scale from How Miraculous Things Happen, 1/1=A"},"garcia":{"frequencies":[261.6255653006,268.33391312882,271.68808704293,279.06726965397,286.22284067074,294.32876096318,301.87565226992,310.07474405997,313.95067836072,322.00069575458,331.11985608357,339.61010880366,348.83408706747,357.77855083843,362.25078272391,372.08969287196,381.63045422766,392.4383479509,402.50086969323,407.5321305644,418.60090448096,429.33426100611,441.49314144476,452.81347840488,465.11211608996,470.92601754108,483.00104363188,496.11959049595,509.4151632055,523.2511306012],"description":"Linear 29-tone scale by Jos� L. Garcia, 1988 15/13-52/45 alternating"},"garibaldi24":{"frequencies":[261.6255653006,271.45160478635,275.48458787532,290.07776082447,294.38747453868,305.44397410364,309.9819851541,326.40257969757,331.25197480486,343.69301829526,348.79929894143,361.89937857146,367.27615309757,386.73177659938,392.47748849606,407.21801775129,413.26809573999,435.16003837828,441.62525370518,458.21165716245,465.0193526482,489.65270106975,496.92751922541,515.59094540799,523.2511306012],"description":"Garibaldi[24] in 94-tET tuning."},"genovese":{"frequencies":[261.6255653006,277.01530443593,277.97716313189,279.06726965397,280.31310567921,281.75060878526,283.42769574232,285.40970760065,287.78812183066,290.69507255622,294.32876096318,296.50897400735,299.00064605783,301.87565226992,305.22982618403,307.79478270659,309.19384990071,313.95067836072,317.68818643644,319.76457981184,322.00069575458,327.03195662575,332.97799220076,336.37572681506,338.57426097725,340.11323489078,342.12573923925,348.83408706747,356.76213450082,359.73515228832,362.25078272391,366.27579142084,369.35373924791,370.63621750918,373.75080757229,377.90359432309,380.54627680087,383.71749577421,392.4383479509,400.13321751856,402.50086969323,404.33041910093,406.97310157871,411.12588832951,418.60090448096,425.14154361347,428.11456140098,430.91269578922,436.04260883433,442.75095666255,444.76346101102,448.50096908674,453.48431318771,457.84473927605,461.69217405988,465.11211608996,470.92601754108,475.68284600109,479.64686971777,483.00104363188,485.87604984397,488.36772189445,490.54793493862,492.47165233054,494.18162334558,523.2511306012],"description":"Denny Genovese's 65-note scale. 3/2=384 Hz"},"genovese_12":{"frequencies":[261.6255653006,285.40970760065,294.32876096318,313.95067836072,327.03195662575,348.83408706747,359.73515228832,392.4383479509,425.14154361347,448.50096908674,457.84473927605,490.54793493862,523.2511306012],"description":"Denny Genovese's superposition of harmonics 8-16 and subharmonics 6-12"},"genovese_38":{"frequencies":[261.6255653006,280.31310567921,283.42769574232,285.40970760065,287.78812183066,290.69507255622,294.32876096318,299.00064605783,305.22982618403,309.19384990071,313.95067836072,319.76457981184,327.03195662575,332.97799220076,336.37572681506,340.11323489078,348.83408706747,356.76213450082,359.73515228832,366.27579142084,373.75080757229,377.90359432309,380.54627680087,392.4383479509,406.97310157871,411.12588832951,418.60090448096,425.14154361347,428.11456140098,436.04260883433,448.50096908674,457.84473927605,465.11211608996,470.92601754108,475.68284600109,479.64686971777,485.87604984397,490.54793493862,523.2511306012],"description":"Denny Genovese's 38-note scale. Harm 1..16 x Subh. 1..12"},"gf1-2":{"frequencies":[261.6255653006,269.29177952703,277.18263097687,285.30470202322,293.66476791741,311.12698372208,320.24370022528,339.28638158975,349.22823143301,359.46139971304,380.8360868427,403.48177901006,415.30469757995,440,466.16376151809,493.88330125613,523.2511306012],"description":"16-note scale with all possible quadruplets of 50 & 100 c. Galois Field GF(2)"},"gf2-3":{"frequencies":[261.6255653006,270.85177093588,280.40333801024,290.29174037004,300.52885648597,316.56538760238,327.729041887,345.21700307457,357.39105439675,369.99442271164,389.73770840504,410.5345162762,425.01198472693,447.69106452518,471.58032351597,496.7443381147,523.2511306012],"description":"16-note scale with all possible quadruplets of 60 & 90 c. Galois Field GF(2)"},"gilson7":{"frequencies":[261.6255653006,261.6255653006,299.00064605783,313.95067836072,327.03195662575,392.4383479509,373.75080757229,392.4383479509,408.78994578219,408.78994578219,467.18850946536,490.54793493862,523.2511306012],"description":"Gilson septimal"},"gilson7a":{"frequencies":[261.6255653006,261.6255653006,280.31310567921,299.00064605783,313.95067836072,336.37572681506,373.75080757229,373.75080757229,392.4383479509,418.60090448096,470.92601754108,470.92601754108,523.2511306012],"description":"Gilson septimal 2"},"golden_10":{"frequencies":[261.6255653006,287.58715183149,304.90466328003,323.26497397694,342.73087946949,376.74069565061,399.42672527674,423.47882962254,465.50141625349,493.53231135469,523.2511306012],"description":"Golden version of Rapoport's Major 10 out of 13"},"golden_5":{"frequencies":[261.6255653006,327.03195662575,343.38355445704,392.4383479509,425.14154361347,523.2511306012],"description":"Golden pentatonic"},"gradus10":{"frequencies":[261.6255653006,290.69507255622,299.00064605783,305.22982618403,490.54793493862,882.98628288953,930.22423217991,941.85203508216,1220.91930473613,1255.80271344288,1674.40361792384,2747.0684356563,3270.3195662575,3488.34087067467,5886.5752192635,10595.8353946743,10988.2737426252,11162.69078615893,13081.27826503,14651.0316568336,23546.300877054,31395.067836072,41860.090448096,42383.3415786972,56511.1221049296,75348.1628065728,100464.2170754304,133952.2894339072],"description":"Intervals > 1 with Gradus = 10"},"gradus3":{"frequencies":[261.6255653006,784.8766959018,1046.5022612024],"description":"Intervals > 1 with Gradus = 3"},"gradus4":{"frequencies":[261.6255653006,392.4383479509,1569.7533918036,2093.0045224048],"description":"Intervals > 1 with Gradus = 4"},"gradus5":{"frequencies":[261.6255653006,348.83408706747,1308.127826503,2354.6300877054,3139.5067836072,4186.0090448096],"description":"Intervals > 1 with Gradus = 5"},"gradus6":{"frequencies":[261.6255653006,654.0639132515,697.66817413493,1177.3150438527,2616.255653006,4709.2601754108,6279.0135672144,8372.0180896192],"description":"Intervals > 1 with Gradus = 6"},"gradus7":{"frequencies":[261.6255653006,327.03195662575,436.04260883433,588.65752192635,1395.33634826987,1831.3789571042,3924.383479509,5232.511306012,7063.8902631162,9418.5203508216,12558.0271344288,16744.0361792384],"description":"Intervals > 1 with Gradus = 7"},"gradus8":{"frequencies":[261.6255653006,294.32876096318,313.95067836072,418.60090448096,872.08521766867,915.6894785521,1962.1917397545,2790.67269653973,3531.9451315581,3662.7579142084,7848.766959018,10465.022612024,14127.7805262324,18837.0407016432,25116.0542688576,33488.0723584768],"description":"Intervals > 1 with Gradus = 8"},"gradus9":{"frequencies":[261.6255653006,457.84473927605,465.11211608996,470.92601754108,610.45965236807,627.90135672144,837.20180896192,981.09586987725,1744.17043533733,1765.97256577905,5494.1368713126,5581.34539307947,6540.639132515,7325.5158284168,11773.150438527,15697.533918036,20930.045224048,21191.6707893486,28255.5610524648,37674.0814032864,50232.1085377152,66976.1447169536],"description":"Intervals > 1 with Gradus = 9"},"grady11":{"frequencies":[261.6255653006,277.4816601673,290.69507255622,305.22982618403,332.97799220076,356.76213450082,378.42269266694,392.4383479509,420.46965851882,458.69417292962,481.6288815761,504.56359022259,523.2511306012],"description":"Kraig Grady's dual [5 7 9 11] hexany scale"},"grady7":{"frequencies":[261.6255653006,274.70684356563,294.32876096318,305.22982618403,327.03195662575,348.83408706747,366.27579142084,392.4383479509,406.97310157871,436.04260883433,457.84473927605,490.54793493862,523.2511306012],"description":"Kraig Grady's 7-limit \"Centaur\" scale (1987), see Xenharmonikon 16"},"grady7t":{"frequencies":[261.6255653006,274.79177208104,293.65339461903,305.54250820508,326.68804977983,349.10444036529,366.6627351378,392.00975085961,407.77240291308,436.0718257558,457.96530027286,489.37179607373,523.2511306012],"description":"Tempered version of grady7 with egalised 225/224"},"grady_14":{"frequencies":[261.6255653006,274.70684356563,294.32876096318,305.22982618403,327.03195662575,343.38355445704,348.83408706747,366.27579142084,392.4383479509,412.06026534844,441.49314144476,457.84473927605,490.54793493862,515.07533168556,523.2511306012],"description":"Kraig Grady, letter to Lou Harrison, published in 1/1 7 (1) 1991 p 5."},"grammateus":{"frequencies":[261.6255653006,277.49581689502,294.32876096318,312.18279369479,331.11985608357,348.83408706747,369.99442271164,392.4383479509,416.24372513446,441.49314144476,468.27419030811,496.67978412536,523.2511306012],"description":"H. Grammateus (Heinrich Schreiber) (1518). B-F# and Bb-F 1/2 P. Also Marpurg temp.nr.6"},"graupner":{"frequencies":[261.6255653006,277.083518473,293.59062125964,310.9808189359,329.55130849159,349.11528328816,370.00708353276,392.01655298731,415.20348378516,439.96413779539,466.04943410823,493.90517116572,523.2511306012],"description":"Johann Gottlieb Graupner's temperament (1819)"},"groenewald_21":{"frequencies":[261.6255653006,275.93321340298,279.06726965397,290.69507255622,294.32876096318,310.07474405997,313.95067836072,327.03195662575,330.74639366397,348.83408706747,367.91095120397,372.08969287196,392.4383479509,413.89982010446,418.60090448096,436.04260883433,441.49314144476,465.11211608996,470.92601754108,490.54793493862,496.11959049595,523.2511306012],"description":"J�rgen Gr�newald, new meantone temperament I (2000)"},"gross":{"frequencies":[13.75,13.83042567154,13.91662997964,13.99803029322,14.07990672861,14.1622619889,14.24509903843,14.32842061343,14.41222946472,14.49652860895,14.58132083065,14.67220542837,14.75802520833,14.84434696019,14.93117353378,15.01850805439,15.10635340681,15.19471249121,15.28358848801,15.37298433293,15.46880332718,15.55928251958,15.65029093742,15.74183158529,15.83390775812,15.92652249736,16.01967895316,16.113380201,16.20762961362,16.30865090754,16.4040424858,16.49999202274,16.59650278193,16.69357794961,16.79122101993,16.88943521823,16.98822378696,17.08759028197,17.18753798549,17.29466699621,17.39582592037,17.49757653721,17.59992220598,17.70286661052,17.80641315127,17.91056524676,18.01532664586,18.12070080902,18.23364617402,18.34029731861,18.44757228066,18.55547460176,18.66400816581,18.77317655783,18.88298349104,18.99343259063,19.10452783216,19.2236053387,19.33604689279,19.44914613325,19.56290690697,19.67733296969,19.79242844011,19.90819712001,20.02464283144,20.14176976577,20.26731246322,20.38585868839,20.50509842475,20.62503561099,20.74567420676,20.86701855437,20.98907266203,21.11184068121,21.23532666504,21.36768545088,21.49266790503,21.61838152318,21.74483045784,21.87201888365,21.99995137868,22.12863216875,22.25806563075,22.38825603783,22.52780097787,22.65956910312,22.79210808945,22.92542231482,23.05951631373,23.1943945132,23.33006176809,23.46652255971,23.60378139323,23.75090264526,23.88982499399,24.02955978014,24.17011203339,24.3114863964,24.45368753658,24.59672057234,24.74059022832,24.88530139802,25.04041015894,25.18687501732,25.33419642278,25.48237967807,25.63142967793,25.78135134315,25.93215007005,26.08383083979,26.23639881154,26.39992889083,26.55434576426,26.70966568928,26.86589425653,27.0230366265,27.18109814415,27.34008402779,27.5],"description":"Gross temperament, g=91.531021, 5-limit"},"groven":{"frequencies":[261.6255653006,264.7464578752,272.5650766677,275.81646505128,279.10663876478,290.77709705464,294.24573392894,297.75574765819,306.54921255625,310.20599265769,313.90639394672,327.03195662575,330.93307160522,334.88072358477,344.77058253591,348.88329767713,353.04507480266,363.47137260637,367.80716871461,372.19468374184,387.75749219625,392.38299382393,397.06367008113,408.78994578219,413.66634097248,418.60090448096,436.10412364188,441.30634506723,446.57062302059,459.75895986689,465.24335632603,470.79317533731,484.69686416326,490.47874118496,496.32958936031,517.08292506126,523.2511306012],"description":"Eivind Groven's 36-tone scale with 1/8-schisma temp. fifths and 5/4 (1948)"},"groven_ji":{"frequencies":[261.6255653006,264.89588486686,272.52663052146,275.93321340298,279.06726965397,290.69507255622,294.32876096318,297.67175429757,306.59245933664,310.07474405997,313.95067836072,327.03195662575,331.11985608357,334.88072358477,344.91651675372,348.83408706747,353.19451315581,363.36884069528,367.91095120397,372.08969287196,387.59343007496,392.4383479509,396.89567239676,408.78994578219,413.89982010446,418.60090448096,436.04260883433,441.49314144476,446.50763144636,459.88868900496,465.11211608996,470.92601754108,484.4917875937,490.54793493862,496.11959049595,517.37477513058,523.2511306012],"description":"Untempered version of Groven's 36-tone scale"},"gumbeng":{"frequencies":[261.6255653006,305.03156112838,348.43777142572,394.8168394034,470.9259392365,525.62941881859],"description":"Scale of gumbeng ensemble, Java. 1/1=440 Hz."},"gunkali":{"frequencies":[261.6255653006,275.93321340298,282.55561052465,348.83408706747,392.4383479509,408.78994578219,418.60090448096,523.2511306012],"description":"Indian mode Gunkali, see Dani�lou: Intr. to the Stud. of Mus. Scales, p.175"},"gyaling":{"frequencies":[261.6255653006,283.49766588023,307.55338551939,339.28638158975,347.81902735497,393.58362272115,435.9522698367],"description":"Tibetan Buddhist Gyaling tones measured from CD \"The Diamond Path\", Ligon 2002"},"far12_104":{"frequencies":[261.6255653006,276.7193479141,294.32876096318,311.93817401225,329.54758706133,349.67263054599,369.79767403066,392.4383479509,415.07902187114,440.23532622697,465.3916305828,493.06356537421,523.2511306012],"description":"Farey approximation to 12-tET with den=104"},"far12_65":{"frequencies":[261.6255653006,277.72560008833,293.82563487606,309.92566966379,330.05071314845,350.17575663311,370.30080011777,390.42584360243,414.57589578403,438.72594796562,466.90100884415,495.07606972267,523.2511306012],"description":"Farey approximation to 12-tET with den=65"},"far12_80":{"frequencies":[261.6255653006,277.97716313189,294.32876096318,310.68035879446,330.30227619201,349.92419358955,369.5461109871,392.4383479509,415.3305849147,441.49314144476,467.65569797482,493.81825450488,523.2511306012],"description":"Farey approximation to 12-tET with den=80"},"farey3":{"frequencies":[261.6255653006,313.95067836072,348.83408706747,392.4383479509,418.60090448096,523.2511306012],"description":"Farey fractions between 0 and 1 until 3rd level, normalised by 2/1"},"farey4":{"frequencies":[261.6255653006,299.00064605783,313.95067836072,327.03195662575,348.83408706747,373.75080757229,392.4383479509,418.60090448096,448.50096908674,523.2511306012],"description":"Farey fractions between 0 and 1 until 4th level, normalised by 2/1"},"farey5":{"frequencies":[261.6255653006,285.40970760065,290.69507255622,299.00064605783,305.22982618403,313.95067836072,322.00069575458,327.03195662575,332.97799220076,348.83408706747,366.27579142084,373.75080757229,380.54627680087,392.4383479509,402.50086969323,406.97310157871,418.60090448096,436.04260883433,448.50096908674,465.11211608996,523.2511306012],"description":"Farey fractions between 0 and 1 until 5th level, normalised by 2/1"},"farnsworth":{"frequencies":[261.6255653006,294.32876096318,327.03195662575,343.38355445704,392.4383479509,441.49314144476,490.54793493862,523.2511306012],"description":"Farnsworth's scale"},"fibo_9":{"frequencies":[261.6255653006,277.97716313189,327.03195662575,343.38355445704,363.82305174615,392.4383479509,425.14154361347,449.66894036041,523.2511306012],"description":"First 9 Fibonacci terms reduced by 2/1, B. McLaren, XH 13, 1991"},"finnamore":{"frequencies":[261.6255653006,277.97716313189,310.68035879446,348.83408706747,392.4383479509,416.96574469783,457.84473927605,466.02053819169,523.2511306012],"description":"David J. Finnamore, Tuning List 9 May '97. Tetrachordal scale, 17/16x19/17x64/57"},"finnamore53":{"frequencies":[261.6255653006,286.15296204753,310.68035879446,327.03195662575,343.38355445704,359.73515228832,367.91095120397,376.08675011961,392.4383479509,408.78994578219,416.96574469783,425.14154361347,433.31734252912,441.49314144476,457.84473927605,474.19633710734,523.2511306012],"description":"David J. Finnamore, tuning for \"Crawlspace\", 53-limit, 1998."},"finnamore_11":{"frequencies":[261.6255653006,287.78812183066,294.32876096318,305.22982618403,323.76163705949,331.11985608357,343.38355445704,348.83408706747,392.4383479509,431.68218274599,441.49314144476,457.84473927605,485.64245558924,515.07533168556,523.2511306012],"description":"David J. Finnamore, 11-limit scale, Tuning List 3 Sept '98"},"finnamore_7":{"frequencies":[261.6255653006,274.70684356563,294.32876096318,309.04519901133,331.11985608357,348.83408706747,366.27579142084,392.4383479509,412.06026534844,441.49314144476,463.567798517,496.67978412536,523.2511306012],"description":"David J. Finnamore, TL 1 Sept '98. 7-tone Pyth. with 9/8 div. in 21/20 &15/14"},"finnamore_7a":{"frequencies":[261.6255653006,280.31310567921,294.32876096318,315.35224388912,331.11985608357,348.83408706747,373.75080757229,392.4383479509,420.46965851882,441.49314144476,473.02836583367,496.67978412536,523.2511306012],"description":"David J. Finnamore, TL 1 Sept '98. 7-tone Pyth. with 9/8 div. in 15/14 &21/20"},"finnamore_jc":{"frequencies":[261.6255653006,276.16031892841,310.68035879446,348.83408706747,392.4383479509,414.24047839262,466.02053819169,523.2511306012],"description":"Chalmers' modification of Finnamore. Tuning List 9-5-97 19/18 x 9/8 x 64/57"},"fisher":{"frequencies":[261.6255653006,273.37431312998,292.50627485027,310.67535808973,327.03195662575,349.71841093413,365.63284485857,391.22147055517,410.55062036439,437.39890198442,467.47330218196,489.02683992698,523.2511306012],"description":"Alexander Metcalf Fisher's modified meantone temperament (1818)"},"fj-10tet":{"frequencies":[261.6255653006,280.31310567921,300.51585203447,322.00069575458,345.20039866051,370.01329949656,396.52624740872,425.14154361347,455.42228033808,488.36772189445,523.2511306012],"description":"Franck Jedrzejewski continued fractions approx. of 10-tet"},"fj-12tet":{"frequencies":[261.6255653006,277.19851561611,293.6613488068,311.12229387098,329.64821227876,348.83408706747,370.01329949656,391.99491478937,415.52295665389,440.00663255101,466.16918908107,490.54793493862,523.2511306012],"description":"Franck Jedrzejewski continued fractions approx. of 12-tet"},"fj-13tet":{"frequencies":[261.6255653006,275.96121271433,291.05844139692,306.97399661937,323.91736656265,341.56671025356,360.27127025001,379.97998769849,400.78810003496,422.62591317789,445.95266812602,41.6222490251,496.18641694941,523.2511306012],"description":"Franck Jedrzejewski continued fractions approx. of 13-tet"},"fj-14tet":{"frequencies":[261.6255653006,274.92856014639,288.87822835275,303.4856557487,318.85615771011,335.0643204727,352.18826098158,370.01329949656,388.70083987518,408.5030756448,429.33426100611,451.0785608631,473.88781639354,497.93252750759,523.2511306012],"description":"Franck Jedrzejewski continued fractions approx. of 14-tet"},"fj-15tet":{"frequencies":[261.6255653006,274.08392555301,286.94416839421,300.51585203447,314.76825825228,329.64821227876,345.20039866051,361.51896296083,378.66858135613,396.52624740872,415.52295665389,392.4383479509,455.42228033808,477.08191319521,499.46698830115,523.2511306012],"description":"Franck Jedrzejewski continued fractions approx. of 15-tet"},"fj-16tet":{"frequencies":[261.6255653006,273.25336820285,285.40970760065,297.96244937013,311.12229387098,324.92207303462,339.29565499922,354.2846196779,370.01329949656,386.4008349055,403.52417698906,421.50785520652,440.00663255101,459.44001711325,479.64686971777,500.9851250437,523.2511306012],"description":"Franck Jedrzejewski continued fractions approx. of 16-tet"},"fj-17tet":{"frequencies":[261.6255653006,272.52663052146,283.8915708581,295.75063903546,307.98958953109,320.70230585235,334.29933343966,348.03400888612,362.53828334512,373.75080757229,392.4383479509,409.71550792358,426.86276443782,444.76346101102,462.87600014722,482.37213602298,502.32108537715,523.2511306012],"description":"Franck Jedrzejewski continued fractions approx. of 17-tet"},"fj-18tet":{"frequencies":[261.6255653006,271.88539139082,282.55561052465,293.6613488068,305.22982618403,317.12189733406,329.64821227876,342.60490694126,355.98232655655,370.01329949656,384.51030051755,399.57359064092,415.52295665389,431.68218274599,448.50096908674,466.16918908107,484.4917875937,503.12608711654,523.2511306012],"description":"Franck Jedrzejewski continued fractions approx. of 18-tet"},"fj-19tet":{"frequencies":[261.6255653006,271.31540105247,281.44568388398,291.81313052759,302.73815413355,313.95067836072,325.69713231299,337.73482066077,350.31219760589,363.36884069528,376.74081403286,390.78248994267,405.26313056367,420.46965851882,436.04260883433,451.89870370104,468.95148497277,485.87604984397,504.56359022259,523.2511306012],"description":"Franck Jedrzejewski continued fractions approx. of 19-tet"},"fj-20tet":{"frequencies":[261.6255653006,270.8594087818,280.31310567921,290.29686012806,300.51585203447,311.12229387098,322.00069575458,333.44434793214,345.20039866051,357.34223553253,370.01329949656,383.09457776159,396.52624740872,410.48149038542,425.14154361347,440.00663255101,455.42228033808,470.92601754108,488.36772189445,505.41302387616,523.2511306012],"description":"Franck Jedrzejewski continued fractions approx. of 20-tet"},"fj-21tet":{"frequencies":[261.6255653006,270.34641747729,279.46367202564,288.87822835275,298.56093922539,308.58400009814,318.85615771011,329.64821227876,340.72166643799,352.18826098158,364.00078650518,376.08675011961,388.70083987518,401.78211814021,415.52295665389,429.33426100611,443.62595855319,457.84473927605,473.88781639354,489.85212226495,506.18859373377,523.2511306012],"description":"Franck Jedrzejewski continued fractions approx. of 21-tet"},"fj-22tet":{"frequencies":[261.6255653006,270.06509966514,278.68810216803,287.55242312318,296.76929795292,306.29334474217,316.13089140489,326.18252297218,336.37572681506,347.40443916965,358.52392281934,370.01329949656,381.83190611439,392.4383479509,392.4383479509,419.69101100305,433.03541842858,446.94367405519,461.28718092474,475.68284600109,491.34557385722,506.89953276991,523.2511306012],"description":"Franck Jedrzejewski continued fractions approx. of 22-tet"},"fj-23tet":{"frequencies":[261.6255653006,269.55361273395,277.97716313189,286.37392958579,295.1673044417,304.21577360535,313.47928094576,323.18452184192,332.97799220076,343.1154954762,353.6790049434,364.40703738298,375.66747838035,387.20583664489,398.97898708342,411.12588832951,423.58424858192,436.04260883433,449.99597231703,463.79077485106,477.96978276071,492.47165233054,507.86139146587,523.2511306012],"description":"Franck Jedrzejewski continued fractions approx. of 23-tet"},"fj-24tet":{"frequencies":[261.6255653006,269.32043486826,277.19851561611,285.40970760065,293.6613488068,302.32287545847,311.12229387098,320.2657782128,329.64821227876,339.29565499922,348.83408706747,348.83408706747,370.01329949656,380.54627680087,391.99491478937,403.52417698906,415.52295665389,427.53446036927,440.00663255101,452.81347840488,466.16918908107,479.64686971777,490.54793493862,508.30109829831,523.2511306012],"description":"Franck Jedrzejewski continued fractions approx. of 24-tet"},"fj-26tet":{"frequencies":[261.6255653006,268.69652652494,275.96121271433,283.42769574232,291.05844139692,299.00064605783,306.97399661937,315.29234792636,323.91736656265,332.57487114483,341.56671025356,350.8160989258,360.27127025001,370.01329949656,379.97998769849,390.22118214327,400.78810003496,411.12588832951,422.62591317789,434.18710837121,445.95266812602,457.84473927605,457.84473927605,483.00104363188,496.18641694941,509.48136400643,523.2511306012],"description":"Franck Jedrzejewski continued fractions approx. of 26-tet"},"fj-30tet":{"frequencies":[261.6255653006,267.70988077271,274.08392555301,280.31310567921,286.94416839421,293.6613488068,300.51585203447,307.52478728316,314.76825825228,322.00069575458,329.64821227876,337.35928157183,345.20039866051,353.19451315581,361.51896296083,370.01329949656,378.66858135613,387.59343007496,396.52624740872,405.78659107848,415.52295665389,425.14154361347,392.4383479509,444.76346101102,455.42228033808,466.16918908107,477.08191319521,488.36772189445,499.46698830115,511.35905945117,523.2511306012],"description":"Franck Jedrzejewski continued fractions approx. of 30-tet"},"fj-31tet":{"frequencies":[261.6255653006,267.57160087561,273.51763645063,279.79400733536,286.15296204753,292.60754013883,299.00064605783,305.96888145324,312.81317590289,319.76457981184,327.03195662575,334.53760808929,342.12573923925,349.884792149,357.81143489641,366.27579142084,373.75080757229,382.37582620857,391.25985441351,400.13321751856,409.20921752145,418.60090448096,428.11456140098,437.54620403721,447.51741432997,457.84473927605,467.90726101838,478.40103369253,489.12605686634,500.50108144463,511.62332769895,523.2511306012],"description":"Franck Jedrzejewski continued fractions approx. of 31-tet"},"fj-36tet":{"frequencies":[261.6255653006,266.75547834571,271.88539139082,277.19851561611,282.55561052465,288.08208313999,293.6613488068,299.00064605783,305.22982618403,311.12229387098,317.12189733406,323.18452184192,329.64821227876,327.03195662575,342.60490694126,348.83408706747,355.98232655655,362.89997767503,370.01329949656,377.22755927063,384.51030051755,391.99491478937,399.57359064092,406.97310157871,415.52295665389,423.35773294097,431.68218274599,440.00663255101,448.50096908674,436.04260883433,466.16918908107,475.19745534191,484.4917875937,490.54793493862,503.12608711654,513.18860885887,523.2511306012],"description":"Franck Jedrzejewski continued fractions approx. of 36-tet"},"fj-41tet":{"frequencies":[261.6255653006,266.05989691586,270.64713651786,275.21650375777,279.87851171692,284.71017400359,289.532292266,294.32876096318,299.49242343621,304.63250754179,309.81974838229,315.13988547572,320.49131749323,325.95972070239,331.39238271409,337.09447836808,342.81970625596,348.83408706747,354.64798851859,360.72615821749,366.27579142084,373.13810133036,379.35706968587,386.00493241072,392.4383479509,399.32323124828,405.97070477679,413.09299784305,419.97788114044,427.14378008261,434.48531380278,441.85651028546,449.45930449077,436.04260883433,465.11211608996,472.93852188955,480.82536325516,489.12605686634,497.08857407114,505.80942624783,514.53027842451,523.2511306012],"description":"Franck Jedrzejewski continued fractions approx. of 41-tet"},"fj-42tet":{"frequencies":[261.6255653006,265.98599138894,270.34641747729,274.92856014639,279.46367202564,284.05061375494,288.87822835275,293.6613488068,298.56093922539,303.4856557487,308.58400009814,313.7026920429,318.85615771011,324.18820048118,329.64821227876,335.0643204727,340.72166643799,346.37750898953,352.18826098158,358.01393146398,364.00078650518,370.01329949656,376.08675011961,382.37582620857,388.70083987518,395.22159864559,401.78211814021,408.5030756448,415.52295665389,422.16852582597,429.33426100611,436.04260883433,443.62595855319,451.0785608631,457.84473927605,466.16918908107,473.88781639354,481.94183081689,489.85212226495,497.93252750759,506.18859373377,514.81159623666,523.2511306012],"description":"Franck Jedrzejewski continued fractions approx. of 42-tet"},"fj-43tet":{"frequencies":[261.6255653006,265.84533248287,270.2034526875,274.70684356563,279.06726965397,283.42769574232,288.1672893166,292.86443876933,297.71185016965,302.50455987882,307.4100392282,312.38873468728,317.43901923139,322.67153053741,327.85988562987,332.97799220076,338.57426097725,344.24416486921,348.83408706747,355.41586229515,361.11697745717,367.05676325756,372.95559308809,379.09010482332,385.17097113699,391.45479319413,397.88888056133,404.33041910093,392.4383479509,417.48760420309,424.25767346043,431.1976909584,438.2228218785,445.32011114996,452.54151835779,459.82675113439,467.18850946536,475.05694751951,483.00104363188,490.54793493862,498.33441009638,506.89953276991,514.81159623666,523.2511306012],"description":"Franck Jedrzejewski continued fractions approx. of 43-tet"},"fj-53tet":{"frequencies":[261.6255653006,265.06800694929,268.51044859798,272.09058791262,275.69145590816,279.30296836145,282.98275430473,286.71294827463,290.48132617934,294.32876096318,298.13145813324,302.11523612093,306.05254808749,310.07474405997,313.95067836072,318.31110444906,322.46872002167,326.7649917632,331.03642956402,335.41739141103,336.37572681506,344.24416486921,348.83408706747,353.42400926572,358.01393146398,362.89997767503,367.52162744608,372.31330446624,377.3445653374,382.37582620857,387.20583664489,392.4383479509,397.67085925691,402.82031482791,408.13588186894,413.53718386224,418.60090448096,424.41480593208,429.81342870813,436.04260883433,441.49314144476,447.29532132038,453.1728541814,459.07882213124,465.11211608996,470.92601754108,477.46665667359,483.76047923507,485.87604984397,496.55464434604,503.12608711654,509.83443494476,516.36624730382,523.2511306012],"description":"Franck Jedrzejewski continued fractions approx. of 53-tet"},"fj-54tet":{"frequencies":[261.6255653006,265.02329991489,268.42103452919,271.88539139082,275.39533189537,279.06726965397,282.55561052465,286.15296204753,289.90941019796,293.6613488068,297.46468383493,301.26580246736,305.22982618403,309.19384990071,313.15787361738,317.12189733406,321.29455387793,325.43667878855,329.64821227876,333.91683992313,338.19890148614,342.60490694126,346.93824963775,351.55935337268,355.98232655655,360.61902244137,365.28852513669,370.01329949656,374.76094489005,379.61356533813,384.51030051755,389.53139722534,394.5147413263,399.57359064092,404.77917650282,409.88005230427,415.52295665389,420.652869699,426.07592063241,431.68218274599,436.04260883433,442.75095666255,448.50096908674,454.40229762736,460.26719821402,466.16918908107,472.20223981084,478.40103369253,484.4917875937,490.54793493862,497.08857407114,503.12608711654,510.16985233617,516.54278277298,523.2511306012],"description":"Franck Jedrzejewski continued fractions approx. of 54-tet"},"fj-55tet":{"frequencies":[261.6255653006,264.93728131706,268.33391312882,271.68808704293,275.15792212649,278.68810216803,282.14521748104,285.77561748219,289.37373131733,293.02063313667,296.76929795292,300.51585203447,304.33994330886,308.21641939523,312.11470948142,316.13089140489,319.76457981184,324.10331223806,328.22116374075,332.33517754401,336.37572681506,340.90603963412,345.20039866051,348.83408706747,353.96400011258,358.52392281934,363.07221307022,367.68998366571,372.31330446624,377.04860881557,381.83190611439,386.75083566176,391.58336244338,396.52624740872,401.56482115906,406.65712867376,411.81801945465,416.96574469783,418.60090448096,427.65717404906,433.03541842858,438.60756535689,444.15502946381,449.8123754291,455.42228033808,461.28718092474,467.18850946536,472.93852188955,479.03272519828,485.0974023282,491.34557385722,497.60156537565,503.87145909745,510.16985233617,516.71049146868,523.2511306012],"description":"Franck Jedrzejewski continued fractions approx. of 55-tet"},"fj-5tet":{"frequencies":[261.6255653006,300.51585203447,345.20039866051,396.52624740872,455.42228033808,523.2511306012],"description":"Franck Jedrzejewski continued fractions approx. of 5-tet"},"fj-60tet":{"frequencies":[261.6255653006,264.66772303665,267.70988077271,270.8594087818,274.08392555301,277.19851561611,280.31310567921,283.6903720127,286.94416839421,290.29686012806,293.6613488068,297.10021822272,300.51585203447,304.05133264664,307.52478728316,311.12229387098,314.76825825228,318.50068819203,322.00069575458,325.79787377056,329.64821227876,333.44434793214,337.35928157183,341.25073734861,345.20039866051,348.83408706747,353.19451315581,357.34223553253,361.51896296083,365.74186169574,370.01329949656,374.3258088147,378.66858135613,383.09457776159,387.59343007496,391.99491478937,396.52624740872,401.15920012759,405.78659107848,410.48149038542,415.52295665389,420.18651396763,425.14154361347,429.81342870813,434.91003062957,440.00663255101,444.76346101102,450.23934493592,455.42228033808,460.95932933915,466.16918908107,470.92601754108,477.08191319521,482.55382044333,488.36772189445,490.54793493862,499.46698830115,505.41302387616,511.35905945117,517.30509502619,523.2511306012],"description":"Franck Jedrzejewski continued fractions approx. of 60-tet"},"fj-66tet":{"frequencies":[261.6255653006,264.37951861955,267.19206668997,270.06509966514,272.83808952777,275.76748774928,278.68810216803,281.58005756929,284.57517629188,287.55242312318,290.69507255622,293.6613488068,296.76929795292,299.91223339337,302.93486508491,306.29334474217,309.48390041656,312.81317590289,316.13089140489,319.38705374359,322.78478835788,326.18252297218,329.64821227876,332.97799220076,336.37572681506,340.11323489078,343.8507429665,347.40443916965,351.12904816659,354.74652922115,358.52392281934,362.25078272391,366.27579142084,370.01329949656,373.75080757229,377.90359432309,381.83190611439,385.89770881839,389.97018224052,392.4383479509,398.12586024004,402.50086969323,406.65712867376,411.12588832951,415.52295665389,419.69101100305,424.01384721132,428.62060698183,433.03541842858,437.71969579139,442.27178896054,446.94367405519,451.89870370104,456.45311392871,461.28718092474,466.16918908107,470.92601754108,475.68284600109,481.05345877852,485.87604984397,491.34557385722,496.41773928832,501.44900015948,506.89953276991,512.35006538034,517.80059799077,523.2511306012],"description":"Franck Jedrzejewski continued fractions approx. of 66-tet"},"fj-72tet":{"frequencies":[195.99771799087,197.9006084568,199.84081050049,201.76235675531,203.68390301012,205.67661764474,207.66424882366,209.67197738558,211.67753543014,213.81569235368,215.817711945,217.77524221208,219.99743856118,222.13074705632,223.99739198957,226.48625190056,228.66400432268,230.8417567448,233.07836734049,235.19726158904,237.57299150408,239.92824098882,242.11482810637,244.5635242187,246.9571246685,249.45164107929,251.74018824515,254.18454051941,256.66367832138,259.11562717437,261.33029065449,264.17083729204,266.68541956135,269.28382123963,271.86780237443,274.39680518722,277.19677258709,279.99673998696,282.60136082405,285.0875898049,288.0572521987,290.83532347032,293.66437746429,296.5093682426,299.34196929515,302.30156503677,304.88533909691,307.99641398565,311.29049327962,313.59634878539,317.15994365795,320.28895378996,323.39623468494,326.46784071315,329.63252571192,332.8263135694,335.99608798435,339.22681959958,342.55457018224,345.87832586624,349.232297511,352.79589238357,355.99585512627,359.32914964993,362.95873702013,366.4305162438,367.49572123288,373.6206499201,376.91868844398,380.79556638226,384.45706221286,388.2262490973,391.99543598174],"description":"Franck Jedrzejewski continued fractions approx. of 72-tet"},"fj-78tet":{"frequencies":[138.59131548844,139.82873794816,141.06616040788,142.33702671786,143.60064014465,144.89092073791,146.18536017274,147.4753741736,148.781853392,150.14059177914,151.48353088271,152.80580938469,154.18283848089,155.56168065029,156.95883922787,158.39007484393,159.76498868806,161.21846903757,162.6138101731,164.12129465736,165.53962683341,167.02030328094,168.55700532378,170.00534699915,171.58924774759,173.06676710248,174.62505751543,176.17540104463,177.75842638735,179.35346710269,180.93866188769,182.53490332624,184.15558359423,185.8383548595,187.50589742554,188.98815748424,190.84705739392,192.48793817839,194.02784168382,196.00771761937,197.74614527009,199.57149430335,201.28738678083,203.10796235375,204.87411854813,206.71247055903,207.88697323266,210.45347907504,212.31010032272,214.18657848213,216.10849194808,217.78635291041,220.11561871693,221.7461047815,223.87827886594,225.96410133985,228.00506741647,230.00260868294,232.05987709692,234.17153306667,236.2351968553,238.37706264012,240.41350645954,242.53480210477,244.7463656498,246.9445257794,249.1343885566,251.39820018833,253.59261982991,255.8608901325,258.1602935569,260.55167311827,262.84559834014,265.13121223875,267.51346943117,269.88835121433,272.23294113801,274.70778605744,277.18263097688],"description":"Franck Jedrzejewski continued fractions approx. of 78-tet"},"fj-7tet":{"frequencies":[261.6255653006,288.87822835275,318.85615771011,352.18826098158,388.70083987518,429.33426100611,473.88781639354,523.2511306012],"description":"Franck Jedrzejewski continued fractions approx. of 7-tet"},"fj-84tet":{"frequencies":[97.99885899544,98.81551615374,99.63217331203,100.44883047033,101.26548762862,102.12512674262,102.98185182572,103.83212441184,104.68059938149,105.53723276432,106.39876119505,107.33208366167,108.20707347413,109.09306944775,109.9987192806,110.89344570537,111.83399203009,112.76581035092,113.67867643471,114.64017467391,115.58839778949,116.53918367025,117.50574088079,118.47623251688,119.43610940069,120.45693084856,121.43336875522,122.4985737443,123.47856233425,124.48503710232,125.50731064328,126.58185953578,127.62642101732,128.62350243151,129.74496824748,130.66514532725,131.9215409554,132.99845149381,134.10370178323,135.17083999371,136.34623860235,137.19840259362,138.59838629355,139.73911375276,140.87335980595,142.09834554339,143.22910160872,144.41937115117,145.59830479323,146.83218873215,148.0408295463,149.25980062382,150.498247743,151.74016876713,153.01576229113,154.29607586516,155.64524663982,156.7981743927,158.13452246991,159.45577056885,160.81864040277,162.07503603092,163.33143165907,164.81626285597,166.17197829662,167.54643634704,168.96354999214,170.33135015874,171.49800324202,173.20728566636,174.61614875551,176.03498745477,177.50736723702,178.95443816559,180.52421393897,181.99788099153,183.48722535316,183.74786061645,186.51395744293,188.05186455882,189.60648805639,191.21728584476,192.8364644749,194.36440367429,195.99771799088],"description":"Franck Jedrzejewski continued fractions approx. of 84-tet"},"fj-8tet":{"frequencies":[261.6255653006,285.40970760065,311.12229387098,339.29565499922,370.01329949656,403.52417698906,440.00663255101,479.64686971777,523.2511306012],"description":"Franck Jedrzejewski continued fractions approx. of 8-tet"},"fj-90tet":{"frequencies":[69.29565774422,69.83283338565,70.37840239647,70.9071846685,71.46114704873,72.0131345185,72.59545097014,73.14541650779,73.69538204544,74.24534758309,74.83931036376,75.40998048636,76.00168913882,76.58993750677,77.19009976571,77.78084032514,78.38361285822,78.99704982841,79.59636362512,80.23707738804,80.84493403492,81.4527906818,82.08870225085,82.70772053342,83.37133822351,83.99473665966,84.69469279849,85.2869633775,85.97794571968,86.61957218027,87.31252875772,87.95218098305,88.65767976099,89.35492709123,90.08435506749,90.74431371267,91.43177063473,92.14038007748,92.85618137725,93.5491379547,94.28753430771,95.03404490636,95.75399979201,96.51895185802,97.25706350066,98.00385880968,98.74631228551,99.50145727375,100.29634673506,101.05616754365,101.84361819984,102.66023369514,103.42635484212,103.94348661633,105.02623126858,105.83336819117,106.60870422188,107.47897935838,108.27446522534,109.14066094715,110.05780935847,110.87305239075,111.72157064884,112.60544383436,113.39289449054,114.33783527796,115.19278170468,116.11704811194,116.93642244337,117.80261816517,118.79255613295,119.69249974002,120.62577459179,121.5942673625,122.52275717094,123.4722628897,124.41720367712,125.39214258478,126.36267000417,127.35418180019,128.32529211893,129.35189445588,130.27583655913,131.29703572589,132.29171023897,133.26088027735,134.39157865546,135.4415128637,136.49144707195,137.52522844622,138.59131548844],"description":"Franck Jedrzejewski continued fractions approx. of 90-tet"},"fj-96tet":{"frequencies":[48.99942949772,49.35708956705,49.70956615711,50.0646344868,50.44058918883,50.81422318282,51.17718191984,51.5338827476,51.91606220592,52.2660581309,52.67438671005,53.04896912563,53.45392308842,53.81904551389,54.21213476343,54.59936429746,54.9993596403,55.39065943221,55.80490581685,56.20522795327,56.62156297514,57.01751796098,57.44760699733,57.85474808165,58.26959183513,58.69162434342,59.11042288614,59.54361052887,59.98206024721,60.41025554513,60.85413018265,61.24928687215,61.73928116713,62.19158359326,62.61038213598,63.09515579158,63.54613512986,63.99925485416,64.47293354963,64.92424408448,65.33257266363,65.89578449693,66.3533941115,66.81740386053,67.32095530991,67.84536391992,68.30223505743,68.78766064103,69.29919314678,69.78706625433,70.30352927934,70.77695371893,71.27189745123,71.86582992999,72.36838818125,72.90159022832,73.41609436608,73.94459360565,74.47913283653,75.03037641838,75.5753912592,76.10549687944,76.66039776256,77.21122223883,77.82262331991,78.34524166943,78.94352530188,79.48796340741,80.07223844749,80.64489438166,81.23589627254,81.66571582953,82.40813142798,82.999033639,83.58726208435,84.21776944921,84.8067048999,85.43490271397,86.04777863014,86.69129834212,87.30807437776,87.94769397027,88.57589178434,89.20408959841,89.83228741249,90.46048522656,91.16172929808,91.87393030822,92.49330511929,93.09891604567,93.82869478287,94.4988997456,95.19889159557,95.91377688915,96.59887529551,97.28872233605,97.99885899544],"description":"Franck Jedrzejewski continued fractions approx. of 96-tet"},"fj-9tet":{"frequencies":[261.6255653006,282.55561052465,305.22982618403,329.64821227876,355.98232655655,384.51030051755,415.52295665389,448.50096908674,484.4917875937,523.2511306012],"description":"Franck Jedrzejewski continued fractions approx. of 9-tet"},"flavel":{"frequencies":[261.6255653006,272.52663052146,290.69507255622,294.32876096318,327.03195662575,348.83408706747,363.36884069528,392.4383479509,408.78994578219,436.04260883433,465.11211608996,490.54793493862,523.2511306012],"description":"Bill Flavel's just tuning. Tuning List 6-5-98"},"fogliano":{"frequencies":[261.6255653006,272.52663052146,290.69507255622,294.32876096318,313.95067836072,327.03195662575,348.83408706747,363.36884069528,392.4383479509,408.78994578219,436.04260883433,465.11211608996,470.92601754108,490.54793493862,523.2511306012],"description":"Fogliano's Monochord with D-/D and Bb-/Bb"},"fogliano1":{"frequencies":[261.6255653006,272.52663052146,290.69507255622,313.95067836072,327.03195662575,348.83408706747,363.36884069528,392.4383479509,408.78994578219,436.04260883433,465.11211608996,490.54793493862,523.2511306012],"description":"Fogliano's Monochord no.1, Musica theorica (1529)"},"fogliano2":{"frequencies":[261.6255653006,272.52663052146,294.32876096318,313.95067836072,327.03195662575,348.83408706747,363.36884069528,392.4383479509,408.78994578219,436.04260883433,470.92601754108,490.54793493862,523.2511306012],"description":"Fogliano's Monochord no.2"},"fokker-h":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,290.69507255622,306.59245933664,313.95067836072,327.03195662575,334.88072358477,348.83408706747,363.36884069528,376.74081403286,392.4383479509,408.78994578219,418.60090448096,436.04260883433,446.50763144636,470.92601754108,490.54793493862,502.32108537715,523.2511306012],"description":"Fokker-H 5-limit per.bl. synt.comma&small diesis, KNAW B71, 1968"},"fokker-ht":{"frequencies":[261.6255653006,272.31140503734,279.67242998298,290.89121260742,305.67073265504,313.92185180985,326.66733279836,335.5942968927,349.22294231864,363.36596605244,376.74379448613,392.00137290182,407.92073675044,419.068143928,436.08264938702,447.85404100892,470.60848490625,489.4864783277,502.71810253025,523.2511306012],"description":"Tempered version of Fokker-H per.bl. with better 6 tetrads, OdC"},"fokker-k":{"frequencies":[261.6255653006,272.52663052146,282.55561052465,290.69507255622,302.80736724606,313.95067836072,327.03195662575,339.06673262958,348.83408706747,363.36884069528,376.74081403286,392.4383479509,403.74315632809,418.60090448096,436.04260883433,452.08897683944,470.92601754108,484.4917875937,502.32108537715,523.2511306012],"description":"Fokker-K 5-limit per.bl. of 225/224 & 81/80 & 10976/10935, KNAW B71, 1968"},"fokker-l":{"frequencies":[261.6255653006,271.31540105247,282.62020942966,291.99281841585,301.39265122629,313.95067836072,325.57848126297,339.14425131559,350.39138209902,363.36884069528,376.74081403286,390.69417751556,403.65087217807,420.46965851882,436.04260883433,454.2110508691,468.83301301868,484.38104661368,504.56359022259,523.2511306012],"description":"Fokker-L 7-limit periodicity block 10976/10935 & 225/224 & 15625/15552, 1969"},"fokker-lt":{"frequencies":[261.6255653006,272.07297743248,282.57734531132,291.77233860052,302.20925621315,313.90139500947,326.42149564976,339.58797317787,349.9403315901,363.14714144228,376.97081214523,391.19775936204,403.12344267272,419.38375585596,436.11106867998,452.98371913917,469.18728997524,484.4545223075,503.15865298196,523.2511306012],"description":"Tempered version of Fokker-L per.bl. with more triads"},"fokker-m":{"frequencies":[261.6255653006,265.7783520514,274.70684356563,279.06726965397,286.15296204753,294.32876096318,299.00064605783,305.22982618403,313.95067836072,318.93402246168,327.03195662575,336.37572681506,343.38355445704,348.83408706747,358.80077526939,366.27579142084,373.75080757229,381.53728273004,392.4383479509,398.6675280771,406.97310157871,418.60090448096,429.2294430713,436.04260883433,448.50096908674,457.84473927605,465.11211608996,478.40103369253,490.54793493862,498.33441009638,515.07533168556,523.2511306012],"description":"Fokker-M 7-limit periodicity block 81/80 & 225/224 & 1029/1024, KNAW B72, 1969"},"fokker-n":{"frequencies":[261.6255653006,265.7783520514,273.37201925287,277.71125765371,286.15296204753,290.69507255622,299.00064605783,303.74668805875,313.95067836072,318.93402246168,328.62879235146,333.84512238879,343.38355445704,348.83408706747,358.80077526939,364.4960256705,375.57576268738,381.53728273004,392.4383479509,398.6675280771,410.05802887931,416.56688648057,429.2294430713,436.04260883433,450.69091522486,457.84473927605,470.92601754108,478.40103369253,492.94318852719,500.76768358318,515.07533168556,523.2511306012],"description":"Fokker-N 7-limit periodicity block 81/80 & 2100875/2097152 & 1029/1024, 1969"},"fokker-n2":{"frequencies":[261.6255653006,265.7783520514,272.52663052146,279.06726965397,286.15296204753,290.69507255622,299.00064605783,305.22982618403,313.95067836072,318.93402246168,327.03195662575,334.88072358477,343.38355445704,348.83408706747,358.80077526939,366.27579142084,373.75080757229,381.53728273004,392.4383479509,398.6675280771,408.78994578219,418.60090448096,429.2294430713,436.04260883433,448.50096908674,457.84473927605,470.92601754108,478.40103369253,490.54793493862,502.32108537715,515.07533168556,523.2511306012],"description":"Fokker-N different block shape"},"fokker-p":{"frequencies":[261.6255653006,267.90457886781,273.37201925287,280.31310567921,286.15296204753,290.69507255622,299.00064605783,306.17666156322,312.97980223949,320.35783506196,327.03195662575,334.88072358477,341.85740532612,350.39138209902,357.69120255941,366.27579142084,373.75080757229,382.72082695402,390.69417751556,400.44729382745,408.78994578219,418.60090448096,427.32175665765,437.39523080459,447.11400319927,457.84473927605,470.92601754108,478.40103369253,488.36772189445,500.76768358318,510.98743222773,523.2511306012],"description":"Fokker-P 7-limit periodicity block 65625/65536 & 6144/6125 & 2401/2400, 1969"},"fokker-q":{"frequencies":[261.6255653006,265.7783520514,269.10058145205,272.52663052146,274.70684356563,279.06726965397,284.76252005507,286.15296204753,290.69507255622,294.32876096318,299.00064605783,301.39265122629,305.22982618403,311.45900631024,313.95067836072,318.93402246168,321.92208230347,327.03195662575,332.22294006425,334.88072358477,340.65828815182,343.38355445704,348.83408706747,353.19451315581,358.80077526939,363.36884069528,366.27579142084,373.75080757229,376.74081403286,381.53728273004,387.59343007496,392.4383479509,398.6675280771,401.85686830172,408.78994578219,412.06026534844,418.60090448096,425.24536328225,429.2294430713,436.04260883433,439.53094970501,448.50096908674,454.2110508691,457.84473927605,465.11211608996,470.92601754108,478.40103369253,480.73697623985,490.54793493862,498.33441009638,502.32108537715,508.71637697339,515.07533168556,523.2511306012],"description":"Fokker-Q 7-limit per.bl. 225/224 & 4000/3969 & 6144/6125, KNAW B72, 1969"},"fokker-r":{"frequencies":[261.6255653006,264.95644634031,268.26840191956,272.52663052146,275.55899540689,279.06726965397,282.62020942966,287.04062021552,290.69507255622,294.32876096318,298.07600213285,301.80195215951,306.17666156322,310.07474405997,313.95067836072,317.94773560837,322.92069774245,327.03195662575,331.19555792538,334.88072358477,340.1962906258,344.44874425862,348.83408706747,353.19451315581,357.69120255941,363.36884069528,367.91095120397,372.08969287196,376.74081403286,382.72082695402,387.59343007496,392.4383479509,397.43466951046,402.40260287934,408.78994578219,413.33849311034,418.60090448096,423.93031414449,430.56093032327,436.04260883433,441.49314144476,447.11400319927,453.59505416773,459.26499234482,465.11211608996,470.92601754108,476.92160341255,484.38104661368,490.54793493862,496.79333688808,502.32108537715,510.29443593869,516.67311638793,523.2511306012],"description":"Fokker-R 7-limit per.bl. 4375/4374 & 65625/65536 & 6144/6125, 1969"},"fokker-s":{"frequencies":[261.6255653006,265.7783520514,269.10058145205,273.37201925287,273.85732695955,278.20426865732,282.55561052465,286.15296204753,290.69507255622,295.2417807931,299.00064605783,303.74668805875,304.28591884395,309.04519901133,313.95067836072,317.94773560837,322.92069774245,328.04642310345,332.22294006425,333.84512238879,338.01818641865,343.38355445704,348.83408706747,353.19451315581,358.80077526939,364.4960256705,369.13660007139,370.8542388136,375.57576268738,381.53728273004,387.59343007496,392.4383479509,398.6675280771,404.99558407833,410.05802887931,412.06026534844,417.30640298598,423.93031414449,430.56093032327,436.04260883433,442.96392008567,449.89223739901,450.69091522486,457.84473927605,463.67378109554,470.92601754108,478.40103369253,484.4917875937,492.06963465517,499.88026377668,500.76768358318,508.71637697339,515.07533168556,523.2511306012],"description":"Fokker-S 7-limit per.bl. 4375/4374 & 323/322 & 64827/65536, 1969"},"fokker_12":{"frequencies":[261.6255653006,280.31310567921,294.32876096318,305.22982618403,327.03195662575,348.83408706747,367.91095120397,392.4383479509,420.46965851882,436.04260883433,457.84473927605,490.54793493862,523.2511306012],"description":"Fokker's 7-limit 12-tone just scale"},"fokker_12a":{"frequencies":[261.6255653006,274.70684356563,293.02063313667,309.04519901133,327.03195662575,348.83408706747,367.91095120397,390.69417751556,412.06026534844,439.53094970501,465.11211608996,490.54793493862,523.2511306012],"description":"Fokker's 7-limit periodicity block of 2048/2025 & 3969/4000 & 225/224"},"fokker_12b":{"frequencies":[261.6255653006,275.93321340298,293.02063313667,309.04519901133,332.22294006425,348.83408706747,367.91095120397,392.4383479509,412.06026534844,439.53094970501,467.18850946536,496.11959049595,523.2511306012],"description":"Fokker's 7-limit semitone scale KNAW B72, 1969"},"fokker_12c":{"frequencies":[261.6255653006,275.93321340298,293.02063313667,311.45900631024,332.22294006425,348.83408706747,372.08969287196,392.4383479509,412.06026534844,442.96392008567,467.18850946536,496.11959049595,523.2511306012],"description":"Fokker's 7-limit complementary semitone scale, KNAW B72, 1969"},"fokker_12t":{"frequencies":[261.6255653006,279.53180800295,293.53544531438,305.4439412874,326.66157401657,349.08351368992,366.63408494061,391.81886165309,419.06057467847,436.03416050506,457.88164994338,489.21957814041,523.2511306012],"description":"Tempered version of fokker_12 with egalised 225/224, see also lumma"},"fokker_12t2":{"frequencies":[261.6255653006,279.53060025556,293.5302824794,305.44678713816,326.66192308793,349.10467831311,366.62831408589,391.81689264402,419.03095498017,436.04260883433,457.88067400285,489.21694446174,523.2511306012],"description":"Another tempered version of fokker_12 with egalised 225/224"},"fokker_22":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,287.4304306281,294.32876096318,306.59245933664,313.95067836072,327.03195662575,334.88072358477,348.83408706747,353.19451315581,367.91095120397,383.2405741708,392.4383479509,408.78994578219,418.60090448096,436.04260883433,446.50763144636,459.88868900496,470.92601754108,490.54793493862,502.32108537715,523.2511306012],"description":"Fokker's 22-tone periodicity block of 2048/2025 & 3125/3072. KNAW B71, 1968"},"fokker_22a":{"frequencies":[261.6255653006,269.46602871384,279.06726965397,287.4304306281,297.67175429757,306.59245933664,313.95067836072,327.03195662575,334.88072358477,348.83408706747,357.20610515709,367.91095120397,383.2405741708,392.4383479509,408.78994578219,418.60090448096,431.14564594215,446.50763144636,459.88868900496,476.27480687611,490.54793493862,502.32108537715,523.2511306012],"description":"Fokker's 22-tone periodicity block of 2048/2025 & 2109375/2097152 = semicomma"},"fokker_31":{"frequencies":[261.6255653006,265.7783520514,275.93321340298,280.31310567921,286.15296204753,294.32876096318,299.00064605783,305.22982618403,315.35224388912,321.92208230347,327.03195662575,336.37572681506,343.38355445704,348.83408706747,357.69120255941,367.91095120397,373.75080757229,381.53728273004,392.4383479509,398.6675280771,406.97310157871,420.46965851882,429.2294430713,436.04260883433,448.50096908674,457.84473927605,465.11211608996,482.88312345521,490.54793493862,498.33441009638,515.07533168556,523.2511306012],"description":"Fokker's 31-tone just system"},"fokker_31a":{"frequencies":[261.6255653006,269.10058145205,272.52663052146,280.31310567921,286.15296204753,294.32876096318,299.00064605783,305.22982618403,311.45900631024,321.92208230347,327.03195662575,336.37572681506,343.38355445704,348.83408706747,357.69120255941,367.91095120397,373.75080757229,381.53728273004,392.4383479509,398.6675280771,412.06026534844,420.46965851882,429.2294430713,436.04260883433,448.50096908674,457.84473927605,470.92601754108,476.92160341255,490.54793493862,498.33441009638,515.07533168556,523.2511306012],"description":"Fokker's 31-tone first alternate septimal tuning"},"fokker_31b":{"frequencies":[261.6255653006,267.07609791103,274.70684356563,280.31310567921,286.15296204753,294.32876096318,299.00064605783,305.22982618403,313.95067836072,321.92208230347,327.03195662575,336.37572681506,343.38355445704,348.83408706747,357.69120255941,367.91095120397,373.75080757229,381.53728273004,392.4383479509,398.6675280771,408.78994578219,420.46965851882,429.2294430713,436.04260883433,448.50096908674,457.84473927605,467.18850946536,480.53675259294,490.54793493862,498.33441009638,515.07533168556,523.2511306012],"description":"Fokker's 31-tone second alternate septimal tuning"},"fokker_31c":{"frequencies":[261.6255653006,269.46602871384,272.52663052146,279.06726965397,287.4304306281,294.32876096318,297.67175429757,306.59245933664,313.95067836072,319.36714514233,327.03195662575,334.88072358477,344.91651675372,348.83408706747,359.28803828513,367.91095120397,372.08969287196,383.2405741708,392.4383479509,396.89567239676,408.78994578219,418.60090448096,431.14564594215,436.04260883433,446.50763144636,459.88868900496,465.11211608996,479.0507177135,490.54793493862,502.32108537715,510.98743222773,523.2511306012],"description":"Fokker's 31-tone periodicity block of 81/80 & 2109375/2097152 = semicomma"},"fokker_31d":{"frequencies":[261.6255653006,266.13928761861,272.52663052146,279.06726965397,287.4304306281,294.32876096318,299.40669857094,306.59245933664,313.95067836072,319.36714514233,327.03195662575,334.88072358477,340.65828815182,348.83408706747,359.28803828513,367.91095120397,376.74081403286,383.2405741708,392.4383479509,399.20893142792,408.78994578219,418.60090448096,425.82286018978,436.04260883433,443.56547936435,459.88868900496,470.92601754108,479.0507177135,490.54793493862,502.32108537715,510.98743222773,523.2511306012],"description":"Fokker's 31-tone periodicity block of 81/80 & W�rschmidt's comma"},"fokker_31d2":{"frequencies":[261.6255653006,267.90457886781,272.52663052146,279.06726965397,283.88190679319,290.69507255622,301.39265122629,306.59245933664,313.95067836072,319.36714514233,327.03195662575,334.88072358477,340.65828815182,348.83408706747,357.20610515709,363.36884069528,376.74081403286,383.2405741708,392.4383479509,401.85686830172,408.78994578219,418.60090448096,425.82286018978,436.04260883433,446.50763144636,454.2110508691,465.11211608996,482.22824196207,490.54793493862,502.32108537715,510.98743222773,523.2511306012],"description":"Reduced version of fokker_31d by Prooijen expressibility"},"fokker_41":{"frequencies":[261.6255653006,264.89588486686,271.31540105247,274.70684356563,280.31310567921,283.8170195002,290.69507255622,294.32876096318,300.33547037059,305.22982618403,311.45900631024,313.95067836072,321.55899383997,325.57848126297,329.64821227876,336.37572681506,341.85740532612,348.83408706747,353.19451315581,361.75386806997,366.27579142084,373.75080757229,378.42269266694,387.59343007496,392.4383479509,400.44729382745,406.97310157871,415.27867508032,420.46965851882,425.72552925031,436.04260883433,439.53094970501,448.50096908674,455.80987376816,465.11211608996,470.92601754108,482.33849075995,488.36772189445,498.33441009638,504.56359022259,516.79124009995,523.2511306012],"description":"Fokker's 7-limit supracomma per.bl. 10976/10935 & 225/224 & 496125/262144"},"fokker_41a":{"frequencies":[261.6255653006,264.59711493117,272.83435407277,275.93321340298,279.06726965397,287.4304306281,291.02331101095,294.32876096318,297.67175429757,306.59245933664,310.42486507835,313.95067836072,323.35923445661,327.03195662575,331.11985608357,334.88072358477,344.91651675372,348.83408706747,353.19451315581,363.77913876369,367.91095120397,372.08969287196,376.315896791,388.03108134794,392.4383479509,396.89567239676,408.78994578219,413.89982010446,418.60090448096,431.14564594215,436.04260883433,441.49314144476,446.50763144636,459.88868900496,465.11211608996,470.92601754108,485.03885168492,490.54793493862,496.11959049595,502.32108537715,517.37477513058,523.2511306012],"description":"Fokker's 41-tone periodicity block of schisma & 34171875/33554432"},"fokker_41b":{"frequencies":[261.6255653006,264.89588486686,272.52663052146,275.93321340298,279.06726965397,287.4304306281,290.69507255622,294.32876096318,297.67175429757,306.59245933664,310.42486507835,313.95067836072,323.35923445661,327.03195662575,331.11985608357,340.65828815182,344.91651675372,348.83408706747,353.19451315581,363.36884069528,367.91095120397,372.08969287196,383.2405741708,388.03108134794,392.4383479509,397.34382730029,408.78994578219,413.89982010446,418.60090448096,431.14564594215,436.04260883433,441.49314144476,454.2110508691,459.88868900496,465.11211608996,470.92601754108,485.03885168492,490.54793493862,496.67978412536,510.98743222773,517.37477513058,523.2511306012],"description":"Fokker's 41-tone periodicity block of schisma & 3125/3072"},"fokker_53":{"frequencies":[261.6255653006,263.718569823,268.26840191956,272.52663052146,274.70684356563,279.06726965397,282.55561052465,286.15296204753,290.69507255622,294.32876096318,299.00064605783,300.46061014991,305.22982618403,309.04519901133,313.95067836072,317.87506184023,321.92208230347,327.03195662575,329.64821227876,334.88072358477,340.65828815182,343.38355445704,348.83408706747,353.19451315581,357.69120255941,360.55273217989,366.27579142084,373.75080757229,376.74081403286,381.53728273004,386.30649876417,392.4383479509,398.6675280771,400.61414686654,410.05802887931,412.06026534844,418.60090448096,423.83341578697,429.2294430713,436.04260883433,439.53094970501,448.50096908674,450.69091522486,457.84473927605,465.11211608996,470.92601754108,476.92160341255,480.73697623985,490.54793493862,498.33441009638,502.32108537715,508.71637697339,515.07533168556,523.2511306012],"description":"Fokker's 53-tone system, degree 37 has alternatives"},"fokker_53a":{"frequencies":[261.6255653006,264.89588486686,269.46602871384,272.52663052146,275.93321340298,279.38237857051,283.88190679319,287.4304306281,290.69507255622,294.32876096318,298.00787047521,302.80736724606,306.59245933664,310.42486507835,313.95067836072,319.36714514233,323.35923445661,327.03195662575,331.11985608357,334.88072358477,340.65828815182,344.91651675372,348.83408706747,353.19451315581,359.28803828513,363.36884069528,367.91095120397,372.50983809402,378.50920905758,383.2405741708,388.03108134794,392.4383479509,397.34382730029,403.74315632809,408.78994578219,413.89982010446,418.60090448096,425.82286018978,431.14564594215,436.04260883433,441.49314144476,447.01180571282,454.2110508691,459.88868900496,465.63729761752,470.92601754108,479.0507177135,484.4917875937,490.54793493862,496.67978412536,504.67894541011,510.98743222773,517.37477513058,523.2511306012],"description":"Fokker's 53-tone periodicity block of schisma & kleisma"},"fokker_53b":{"frequencies":[261.6255653006,264.59711493117,267.90457886781,272.52663052146,275.93321340298,279.06726965397,282.55561052465,287.4304306281,290.69507255622,294.32876096318,297.67175429757,301.39265122629,306.59245933664,310.07474405997,313.95067836072,317.51653791741,323.35923445661,327.03195662575,331.11985608357,334.88072358477,340.65828815182,344.91651675372,348.83408706747,353.19451315581,357.20610515709,363.36884069528,367.91095120397,372.08969287196,376.74081403286,383.2405741708,388.03108134794,392.4383479509,396.89567239676,401.85686830172,408.78994578219,413.89982010446,418.60090448096,423.35538388988,431.14564594215,436.04260883433,441.49314144476,446.50763144636,451.5790761492,459.88868900496,465.11211608996,470.92601754108,476.27480687611,485.03885168492,490.54793493862,496.11959049595,502.32108537715,510.98743222773,517.37477513058,523.2511306012],"description":"Fokker's 53-tone periodicity block of schisma & 2109375/2097152"},"fokker_av":{"frequencies":[261.6255653006,267.53238172257,273.57240048543,279.74894499065,286.06477437084,292.52336378682,299.12777114678,305.88111195206,312.78710209553,319.84901131344,327.07017092477,334.45455423048,342.00545991849,349.72704272607,357.62295854304,365.69693211485,373.95340598657,382.39606841888,391.02956482064,399.85798283974,408.88548711149,418.11704484248,427.5567798744,437.20988623572,447.08093432269,457.17458061119,467.49637893146,478.0512162812,488.84407170063,499.88088374606,511.16658268681,522.70737825664],"description":"Fokker's suggestion for a shrinked octave by averaging approximations"},"fokker_bosch":{"frequencies":[261.6255653006,294.32876096318,327.03195662575,343.38355445704,348.83408706747,392.4383479509,436.04260883433,457.84473927605,490.54793493862,523.2511306012],"description":"Scale of \"Naar Den Bosch toe\", genus diatonicum cum septimis. 1/1=D"},"fokker_sr":{"frequencies":[261.6255653006,269.10058145205,279.06726965397,287.04062021552,296.75121990114,305.22982618403,315.35224388912,325.57848126297,336.37572681506,347.28371334717,358.80077526939,367.91095120397,381.53728273004,392.4383479509,406.97310157871,418.60090448096,434.10464168396,446.50763144636,461.31528248922,474.80195184183,490.54793493862,506.45541529795,523.2511306012],"description":"Fokker's 7-limit sruti scale, KNAW B72, 1969"},"fokker_sr2":{"frequencies":[261.6255653006,270.30192333353,279.06726965397,288.32205155576,296.75121990114,306.59245933664,315.35224388912,327.03195662575,336.37572681506,348.83408706747,358.80077526939,372.08969287196,381.53728273004,394.1903048614,406.97310157871,420.46965851882,434.10464168396,448.50096908674,461.31528248922,476.92160341255,490.54793493862,508.71637697339,523.2511306012],"description":"Fokker's complementary 7-limit sruti scale, KNAW B72, 1969"},"fokker_sra":{"frequencies":[261.6255653006,269.76956886185,278.7476190342,287.42460593148,296.37169586701,305.59729331129,315.11006948887,325.59707150921,336.43308557971,346.90573279191,357.7043774887,368.83916960349,381.11429755927,392.97780480816,406.05627704035,419.57000893919,433.5334812886,447.02871783796,460.94403787128,475.29252052682,490.08765232515,506.39798251136,523.2511306012],"description":"Two-step approximation 9-13 to Fokker's 7-limit sruti scale"},"fokker_srb":{"frequencies":[261.6255653006,269.31534001393,278.64197723942,286.83190328195,296.76515515861,305.48776291796,316.06708432391,325.35701999957,336.62443200122,346.51859521924,358.51885197895,369.0565423573,381.83730669135,393.06038214356,406.67242132093,418.62545783369,433.12283887627,445.85331391262,461.29362042034,474.85209942927,491.29666030217,505.73699464332,523.2511306012],"description":"Two-step maximally even approximation 11-11 to Fokker's 7-limit sruti scale"},"fokker_uv":{"frequencies":[220,220.05029721079,220.09166666667,220.14198483463,220.15668113546,220.24841308594,220.29876708984,220.3905582428,220.5253936656,220.68244897959,220.7744,220.82487425697,220.98214285714,221.03266460905,221.0236875,221.07421875,221.28224372864,221.41762468656,221.66763848397,221.71831695641,221.76,221.81069958848,222.01040039062,222.06115722656,222.40609622534,222.44790857143,222.4987654321,222.65722615577,222.75,222.80092592593,223.00151824951,223.05250167847,223.14544022083,223.18896568405,223.23999196793,223.44097959184,223.49206349206,223.58518518519,223.79557291667,223.88882107205,224.18534499514,224.23659907493,224.33003099121,224.48979591837,224.58333333333,224.79466029576,224.83692169189,224.88832473755,225.18617242815,225.28,225.33150434385,225.49198250729,225.5859375,225.67993164062,225.9788277551,226.03049186753,226.28571428571,226.4317558299,226.68743133545,227.08224,227.1341563786,227.29591836735,227.390625,227.44261188272,228.096,228.14814814815,229.16666666667,231,232.03125,233.6237037037,233.84353741497],"description":"Table of Unison Vectors, Microsons and Minisons, from article KNAW, 1969"},"foote":{"frequencies":[261.6255653006,276.70272600503,293.15632631094,310.58830860439,328.48713220126,349.43001184052,368.92737853004,391.76907592069,414.58565256441,438.98455767189,465.89457252293,492.17459484008,523.2511306012],"description":"Ed Foote, piano temperament. TL 9 Jun 1999, almost equal to Coleman"},"forster":{"frequencies":[261.6255653006,279.06726965397,283.42769574232,287.78812183066,299.00064605783,309.19384990071,319.76457981184,327.03195662575,336.37572681506,340.11323489078,343.38355445704,353.19451315581,359.73515228832,366.27579142084,373.75080757229,377.90359432309,380.54627680087,387.59343007496,392.4383479509,398.6675280771,402.50086969323,406.97310157871,418.60090448096,428.11456140098,441.49314144476,442.75095666255,448.50096908674,457.84473927605,465.11211608996,483.00104363188,490.54793493862,507.3950357345,523.2511306012],"description":"Cris Forster's Chrysalis tuning, XH 7+8"},"fortuna11":{"frequencies":[261.6255653006,274.70684356563,299.00064605783,305.22982618403,332.97799220076,343.38355445704,373.75080757229,398.6675280771,411.12588832951,448.50096908674,457.84473927605,498.33441009638,523.2511306012],"description":"11-limit scale from Clem Fortuna"},"fortuna_a1":{"frequencies":[261.6255653006,277.18263097687,293.66476791741,311.12698372208,320.24370022528,349.22823143301,369.99442271164,391.99543598175,415.30469757995,440,466.16376151809,479.82340237272,523.2511306012],"description":"Clem Fortuna, Arabic mode of 24-tET, try C or G major, superset of Basandida, trivalent"},"fortuna_a2":{"frequencies":[261.6255653006,277.18263097687,285.30470202322,311.12698372208,329.62755691287,349.22823143301,369.99442271164,391.99543598175,428.11456140098,440,466.16376151809,493.88330125613,523.2511306012],"description":"Clem Fortuna, Arabic mode of 24-tET, try C or F minor"},"fortuna_bag":{"frequencies":[261.6255653006,266.17557513191,291.58269109838,303.42373253797,318.96815495553,348.01136516401,359.18086083642,388.55281975337,398.8194592997,432.92801877123,462.35552488468,479.64686971777,523.2511306012],"description":"Bagpipe tuning from Fortuna, try key of G with F natural"},"fortuna_eth":{"frequencies":[261.6255653006,280.31310567921,288.69027895239,305.7551787248,323.91736656265,346.02090894595,368.95913055213,385.17097113699,414.24047839262,422.62591317789,469.58434797544,484.00729580611,523.2511306012],"description":"Ethiopian Tunings from Fortuna"},"fortuna_sheng":{"frequencies":[261.6255653006,275.29257244317,286.94416839421,312.81317590289,320.2657782128,348.83408706747,367.19377586049,382.62738925213,417.81993264424,433.74764773521,467.75479856774,484.77678276288,523.2511306012],"description":"Sheng scale on naturals starting on d, from Fortuna"},"francis_r12-14p":{"frequencies":[261.6255653006,277.2273508585,293.19140419912,311.27759533081,328.56574776048,349.51003591412,369.636465861,391.67937618637,415.43871422078,438.93656251816,466.46466724696,492.84862139436,523.2511306012],"description":"Bach WTC theoretical temperament, 1/14 Pyth. comma, Cornet-ton"},"francis_r12-2":{"frequencies":[261.6255653006,277.2831963903,293.15801965318,311.35818177599,328.6319369554,349.45847225471,369.71092870521,391.50168688506,415.45657533448,438.80025285527,466.56783666625,492.94847466277,523.2511306012],"description":"J. Charles Francis, Bach WTC temperament R12-2, fifths beat ratios 0, 1, 2. C=279.331 Cornet-ton"},"francis_r2-1":{"frequencies":[261.6255653006,276.41735337657,293.40958958006,310.96959408698,328.77281747949,349.18425877583,368.55655650762,391.91325216238,414.62612565656,439.06418506387,465.92902003736,492.10921220871,523.2511306012],"description":"J. Charles Francis, Bach WTC temperament R2-1, fifths beat ratios 0, 1, 2. C=249.072 Cammerton"},"francis_r2-14p":{"frequencies":[261.6255653006,276.42350693124,293.47533146651,310.97644498676,328.88393162803,349.17189700163,368.56467609256,392.05867944486,414.6352601896,439.36162975058,466.01338145177,492.37181018521,523.2511306012],"description":"Bach WTC theoretical temperament, 1/14 Pyth. comma, Cammerton"},"francis_seal":{"frequencies":[261.6255653006,275.89934348748,293.01242796531,310.38672525582,327.92787107993,349.18506556371,367.865749003,391.38524198103,413.84896721463,437.93907827641,465.58008765101,490.83740312498,523.2511306012],"description":"J. Charles Francis, Bach tuning interpretion as beats/sec. from seal"},"francis_suppig":{"frequencies":[261.6255653006,276.33536163417,293.13939342657,310.64213412049,328.58201670643,349.47038191026,368.45885450371,391.47500324588,414.51381656966,438.73106346722,465.97531289569,491.91879926026,523.2511306012],"description":"J. Charles Francis, Suppig Calculus musicus, 5ths beat ratios 0, 1, 2."},"efg333":{"frequencies":[261.6255653006,294.32876096318,348.83408706747,392.4383479509,523.2511306012],"description":"Genus primum [333]"},"efg333333333337":{"frequencies":[261.6255653006,275.01702890535,279.38237857051,289.72987407313,294.32876096318,309.39415751852,314.30517589183,325.94610833227,331.11985608357,343.38355445704,353.59332287831,366.6893718738,372.50983809402,386.30649876417,392.4383479509,412.52554335802,419.07356785577,434.59481110969,441.49314144476,457.84473927605,471.45776383774,488.9191624984,496.67978412536,515.07533168556,523.2511306012],"description":"Genus [333333333337]"},"efg333333355":{"frequencies":[261.6255653006,264.89588486686,275.93321340298,279.06726965397,290.69507255622,294.32876096318,310.42486507835,313.95067836072,327.03195662575,331.11985608357,348.83408706747,353.19451315581,367.91095120397,372.08969287196,392.4383479509,397.34382730029,413.89982010446,418.60090448096,436.04260883433,441.49314144476,465.11211608996,470.92601754108,490.54793493862,496.67978412536,523.2511306012],"description":"Genus [333333355]"},"efg33335":{"frequencies":[261.6255653006,275.93321340298,294.32876096318,327.03195662575,348.83408706747,367.91095120397,392.4383479509,436.04260883433,441.49314144476,490.54793493862,523.2511306012],"description":"Genus [33335]"},"efg3333555":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,290.69507255622,294.32876096318,306.59245933664,313.95067836072,327.03195662575,348.83408706747,363.36884069528,367.91095120397,372.08969287196,392.4383479509,408.78994578219,418.60090448096,436.04260883433,459.88868900496,465.11211608996,470.92601754108,490.54793493862,523.2511306012],"description":"Genus [3333555]"},"efg33335555":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,290.69507255622,294.32876096318,297.67175429757,306.59245933664,313.95067836072,327.03195662575,334.88072358477,348.83408706747,363.36884069528,367.91095120397,372.08969287196,376.74081403286,392.4383479509,408.78994578219,418.60090448096,436.04260883433,446.50763144636,459.88868900496,465.11211608996,470.92601754108,490.54793493862,502.32108537715,523.2511306012],"description":"Genus bis-ultra-chromaticum [33335555]"},"efg333355577":{"frequencies":[261.6255653006,267.07609791103,268.26840191956,272.52663052146,274.70684356563,278.20426865732,279.06726965397,281.68182201554,284.8811711051,286.15296204753,290.69507255622,294.32876096318,300.46061014991,305.22982618403,306.59245933664,312.97980223949,313.95067836072,317.94773560837,320.49131749323,321.92208230347,325.57848126297,327.03195662575,333.84512238879,343.38355445704,348.83408706747,352.10227751942,356.10146388137,357.69120255941,360.55273217989,363.36884069528,366.27579142084,367.91095120397,372.08969287196,375.57576268738,381.53728273004,392.4383479509,400.61414686654,402.40260287934,406.97310157871,408.78994578219,412.06026534844,417.30640298598,418.60090448096,427.32175665765,429.2294430713,436.04260883433,445.12682985172,450.69091522486,457.84473927605,459.88868900496,465.11211608996,469.46970335923,470.92601754108,476.92160341255,480.73697623985,488.36772189445,490.54793493862,500.76768358318,508.71637697339,515.07533168556,523.2511306012],"description":"Genus [333355577]"},"efg33337":{"frequencies":[261.6255653006,294.32876096318,305.22982618403,343.38355445704,348.83408706747,386.30649876417,392.4383479509,441.49314144476,457.84473927605,515.07533168556,523.2511306012],"description":"Genus [33337]"},"efg3335":{"frequencies":[261.6255653006,290.69507255622,327.03195662575,348.83408706747,392.4383479509,436.04260883433,465.11211608996,490.54793493862,523.2511306012],"description":"Genus diatonicum veterum correctum [3335]"},"efg33355":{"frequencies":[261.6255653006,272.52663052146,290.69507255622,310.07474405997,327.03195662575,348.83408706747,363.36884069528,387.59343007496,408.78994578219,436.04260883433,465.11211608996,484.4917875937,523.2511306012],"description":"Genus diatonico-chromaticum hodiernum correctum [33355]"},"efg333555":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,290.69507255622,306.59245933664,313.95067836072,327.03195662575,348.83408706747,363.36884069528,372.08969287196,392.4383479509,408.78994578219,418.60090448096,436.04260883433,465.11211608996,490.54793493862,523.2511306012],"description":"Genus diatonico-hyperchromaticum [333555]"},"efg33355555":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,287.4304306281,294.32876096318,306.59245933664,313.95067836072,319.36714514233,327.03195662575,340.65828815182,348.83408706747,359.28803828513,367.91095120397,383.2405741708,392.4383479509,408.78994578219,418.60090448096,425.82286018978,436.04260883433,459.88868900496,470.92601754108,479.0507177135,490.54793493862,510.98743222773,523.2511306012],"description":"Genus [33355555]"},"efg333555777":{"frequencies":[261.6255653006,262.79353657426,267.07609791103,268.26840191956,269.10058145205,272.52663052146,274.70684356563,279.06726965397,280.31310567921,281.68182201554,286.15296204753,294.32876096318,299.00064605783,300.46061014991,305.22982618403,306.59245933664,311.45900631024,312.97980223949,313.95067836072,318.93402246168,320.49131749323,321.92208230347,327.03195662575,333.84512238879,336.37572681506,343.38355445704,348.83408706747,350.39138209902,352.10227751942,357.69120255941,358.80077526939,360.55273217989,366.27579142084,367.91095120397,373.75080757229,375.57576268738,381.53728273004,392.4383479509,398.6675280771,400.61414686654,402.40260287934,408.78994578219,412.06026534844,417.30640298598,418.60090448096,420.46965851882,427.32175665765,429.2294430713,436.04260883433,448.50096908674,450.69091522486,457.84473927605,459.88868900496,467.18850946536,469.46970335923,470.92601754108,476.92160341255,478.40103369253,480.73697623985,488.36772189445,490.54793493862,498.33441009638,500.76768358318,515.07533168556,523.2511306012],"description":"Genus [333555777]"},"efg333557":{"frequencies":[261.6255653006,265.7783520514,279.06726965397,280.31310567921,290.69507255622,299.00064605783,313.95067836072,318.93402246168,327.03195662575,332.22294006425,348.83408706747,358.80077526939,372.08969287196,373.75080757229,392.4383479509,398.6675280771,418.60090448096,425.24536328225,436.04260883433,448.50096908674,465.11211608996,478.40103369253,490.54793493862,498.33441009638,523.2511306012],"description":"Genus diatonico-enharmonicum [333557]"},"efg33357":{"frequencies":[261.6255653006,274.70684356563,279.06726965397,305.22982618403,313.95067836072,325.57848126297,343.38355445704,348.83408706747,366.27579142084,372.08969287196,392.4383479509,406.97310157871,418.60090448096,457.84473927605,465.11211608996,488.36772189445,523.2511306012],"description":"Genus diatonico-enharmonicum [33357]"},"efg3335711":{"frequencies":[261.6255653006,265.58571790036,269.80136421624,275.93321340298,286.15296204753,294.32876096318,295.09524211152,303.52653474327,314.76825825228,321.92208230347,327.03195662575,331.98214737546,337.2517052703,343.38355445704,354.11429053382,359.73515228832,367.91095120397,379.40816842909,386.30649876417,392.4383479509,393.46032281536,404.70204632437,429.2294430713,441.49314144476,442.64286316727,449.66894036041,457.84473927605,472.15238737843,482.88312345521,490.54793493862,505.87755790546,515.07533168556,523.2511306012],"description":"Genus [3 3 3 5 7 11], expanded hexany 1 3 5 7 9 11"},"efg333577":{"frequencies":[261.6255653006,267.07609791103,281.68182201554,286.15296204753,294.32876096318,300.46061014991,305.22982618403,321.92208230347,327.03195662575,333.84512238879,343.38355445704,348.83408706747,367.91095120397,375.57576268738,381.53728273004,392.4383479509,400.61414686654,429.2294430713,436.04260883433,450.69091522486,457.84473927605,490.54793493862,500.76768358318,515.07533168556,523.2511306012],"description":"Genus [333577]"},"efg3337":{"frequencies":[261.6255653006,294.32876096318,305.22982618403,343.38355445704,348.83408706747,392.4383479509,457.84473927605,515.07533168556,523.2511306012],"description":"Genus [3337]"},"efg33377":{"frequencies":[261.6255653006,294.32876096318,299.00064605783,305.22982618403,336.37572681506,343.38355445704,348.83408706747,392.4383479509,398.6675280771,448.50096908674,457.84473927605,515.07533168556,523.2511306012],"description":"Genus [33377] Bi-enharmonicum simplex"},"efg335":{"frequencies":[261.6255653006,327.03195662575,348.83408706747,392.4383479509,436.04260883433,490.54793493862,523.2511306012],"description":"Genus secundum [335]"},"efg3355":{"frequencies":[261.6255653006,279.06726965397,313.95067836072,327.03195662575,348.83408706747,392.4383479509,418.60090448096,436.04260883433,490.54793493862,523.2511306012],"description":"Genus chromaticum veterum correctum [3355]"},"efg33555":{"frequencies":[261.6255653006,294.32876096318,306.59245933664,313.95067836072,327.03195662575,367.91095120397,392.4383479509,408.78994578219,418.60090448096,459.88868900496,470.92601754108,490.54793493862,523.2511306012],"description":"Genus bichromaticum [33555]"},"efg335555577":{"frequencies":[261.6255653006,267.07609791103,268.26840191956,272.52663052146,274.70684356563,279.06726965397,286.15296204753,293.02063313667,300.46061014991,305.22982618403,306.59245933664,312.97980223949,313.95067836072,320.49131749323,327.03195662575,333.84512238879,334.88072358477,341.85740532612,343.38355445704,348.83408706747,357.69120255941,366.27579142084,375.57576268738,381.53728273004,384.58958099188,390.69417751556,392.4383479509,400.61414686654,408.78994578219,417.30640298598,418.60090448096,427.32175665765,429.2294430713,436.04260883433,439.53094970501,446.50763144636,457.84473927605,469.46970335923,476.92160341255,480.73697623985,488.36772189445,490.54793493862,500.76768358318,502.32108537715,512.78610798918,523.2511306012],"description":"Genus [335555577]"},"efg33557":{"frequencies":[261.6255653006,274.70684356563,279.06726965397,286.15296204753,305.22982618403,313.95067836072,327.03195662575,343.38355445704,348.83408706747,366.27579142084,381.53728273004,392.4383479509,418.60090448096,429.2294430713,436.04260883433,457.84473927605,488.36772189445,490.54793493862,523.2511306012],"description":"Genus chromatico-enharmonicum [33557]"},"efg335577":{"frequencies":[261.6255653006,274.70684356563,279.06726965397,280.31310567921,286.15296204753,299.00064605783,305.22982618403,313.95067836072,318.93402246168,327.03195662575,343.38355445704,348.83408706747,358.80077526939,366.27579142084,373.75080757229,381.53728273004,392.4383479509,398.6675280771,418.60090448096,429.2294430713,436.04260883433,448.50096908674,457.84473927605,478.40103369253,488.36772189445,490.54793493862,498.33441009638,523.2511306012],"description":"Genus chromaticum septimis triplex [335577]"},"efg3357":{"frequencies":[261.6255653006,286.15296204753,305.22982618403,327.03195662575,343.38355445704,348.83408706747,381.53728273004,392.4383479509,429.2294430713,436.04260883433,457.84473927605,490.54793493862,523.2511306012],"description":"Genus enharmonicum vocale [3357]"},"efg33577":{"frequencies":[261.6255653006,280.31310567921,286.15296204753,299.00064605783,305.22982618403,327.03195662575,343.38355445704,348.83408706747,373.75080757229,381.53728273004,392.4383479509,398.6675280771,429.2294430713,436.04260883433,448.50096908674,457.84473927605,490.54793493862,498.33441009638,523.2511306012],"description":"Genus [33577]"},"efg337":{"frequencies":[261.6255653006,294.32876096318,343.38355445704,392.4383479509,457.84473927605,515.07533168556,523.2511306012],"description":"Genus quintum [337]"},"efg3377":{"frequencies":[261.6255653006,299.00064605783,305.22982618403,343.38355445704,348.83408706747,392.4383479509,398.6675280771,448.50096908674,457.84473927605,523.2511306012],"description":"Genus [3377]"},"efg33777":{"frequencies":[261.6255653006,267.07609791103,299.00064605783,300.46061014991,305.22982618403,343.38355445704,348.83408706747,392.4383479509,398.6675280771,400.61414686654,448.50096908674,457.84473927605,523.2511306012],"description":"Genus [33777]"},"efg33777a":{"frequencies":[261.6255653006,267.07609791103,299.00064605783,305.22982618403,343.38355445704,348.83408706747,392.4383479509,398.6675280771,448.50096908674,457.84473927605,523.2511306012],"description":"Genus [33777] with comma discarded which disappears in 31-tET"},"efg355":{"frequencies":[261.6255653006,313.95067836072,327.03195662575,392.4383479509,418.60090448096,490.54793493862,523.2511306012],"description":"Genus tertium [355]"},"efg3555":{"frequencies":[261.6255653006,306.59245933664,327.03195662575,383.2405741708,392.4383479509,408.78994578219,490.54793493862,510.98743222773,523.2511306012],"description":"Genus enharmonicum veterum correctum [3555]"},"efg35555":{"frequencies":[261.6255653006,306.59245933664,313.95067836072,327.03195662575,334.88072358477,392.4383479509,408.78994578219,418.60090448096,490.54793493862,502.32108537715,523.2511306012],"description":"Genus [35555]"},"efg35557":{"frequencies":[261.6255653006,268.26840191956,274.70684356563,286.15296204753,306.59245933664,313.95067836072,327.03195662575,343.38355445704,357.69120255941,366.27579142084,392.4383479509,408.78994578219,418.60090448096,429.2294430713,457.84473927605,490.54793493862,523.2511306012],"description":"Genus [35557]"},"efg3557":{"frequencies":[261.6255653006,274.70684356563,286.15296204753,313.95067836072,327.03195662575,343.38355445704,366.27579142084,392.4383479509,418.60090448096,429.2294430713,457.84473927605,490.54793493862,523.2511306012],"description":"Genus enharmonicum instrumentale [3557]"},"efg35577":{"frequencies":[261.6255653006,274.70684356563,280.31310567921,286.15296204753,299.00064605783,313.95067836072,327.03195662575,343.38355445704,358.80077526939,366.27579142084,373.75080757229,392.4383479509,418.60090448096,429.2294430713,448.50096908674,457.84473927605,478.40103369253,490.54793493862,523.2511306012],"description":"Genus [35577]"},"efg357":{"frequencies":[261.6255653006,286.15296204753,327.03195662575,343.38355445704,392.4383479509,429.2294430713,457.84473927605,490.54793493862,523.2511306012],"description":"Genus sextum [357] & 7-limit Octony, see ch.6 p.118"},"efg35711":{"frequencies":[261.6255653006,269.80136421624,286.15296204753,295.09524211152,314.76825825228,327.03195662575,337.2517052703,343.38355445704,359.73515228832,392.4383479509,393.46032281536,429.2294430713,449.66894036041,457.84473927605,472.15238737843,490.54793493862,523.2511306012],"description":"Genus [3 5 7 11]"},"efg3571113":{"frequencies":[261.6255653006,265.71346475842,269.80136421624,274.01701053212,278.99913799634,286.15296204753,292.28481123426,295.09524211152,314.76825825228,318.85615771011,319.68651228748,327.03195662575,337.2517052703,343.38355445704,348.74892249543,359.73515228832,365.35601404283,371.99885066179,383.62381474497,392.4383479509,393.46032281536,398.57019713763,425.14154361347,429.2294430713,438.4272168514,449.66894036041,457.84473927605,464.99856332724,472.15238737843,479.52976843121,490.54793493862,511.49841965996,523.2511306012],"description":"Genus [3 5 7 11 13]"},"efg3577":{"frequencies":[261.6255653006,280.31310567921,286.15296204753,299.00064605783,327.03195662575,343.38355445704,373.75080757229,392.4383479509,429.2294430713,448.50096908674,457.84473927605,490.54793493862,523.2511306012],"description":"Genus [3577]"},"efg35777":{"frequencies":[261.6255653006,280.31310567921,286.15296204753,299.00064605783,300.46061014991,327.03195662575,343.38355445704,373.75080757229,375.57576268738,392.4383479509,400.61414686654,429.2294430713,448.50096908674,457.84473927605,490.54793493862,500.76768358318,523.2511306012],"description":"Genus [35777]"},"efg35777a":{"frequencies":[261.6255653006,280.31310567921,286.15296204753,299.00064605783,327.03195662575,343.38355445704,373.75080757229,392.4383479509,400.61414686654,429.2294430713,448.50096908674,457.84473927605,490.54793493862,500.76768358318,523.2511306012],"description":"Genus [35777] with comma discarded which disappears in 31-tET"},"efg377":{"frequencies":[261.6255653006,300.46061014991,343.38355445704,392.4383479509,400.61414686654,457.84473927605,523.2511306012],"description":"Genus octavum [377]"},"efg3777":{"frequencies":[261.6255653006,262.90303388117,300.46061014991,343.38355445704,350.53737850823,392.4383479509,400.61414686654,457.84473927605,523.2511306012],"description":"Genus [3777]"},"efg37777":{"frequencies":[261.6255653006,262.90303388117,299.00064605783,300.46061014991,343.38355445704,350.53737850823,392.4383479509,400.61414686654,448.50096908674,457.84473927605,523.2511306012],"description":"Genus [37777]"},"efg37777a":{"frequencies":[261.6255653006,299.00064605783,343.38355445704,350.53737850823,392.4383479509,400.61414686654,448.50096908674,457.84473927605,523.2511306012],"description":"Genus [37777] with comma discarded that disappears in 31-tET"},"efg555":{"frequencies":[261.6255653006,327.03195662575,408.78994578219,510.98743222773,523.2511306012],"description":"Genus quartum [555]"},"efg55557":{"frequencies":[261.6255653006,286.15296204753,327.03195662575,357.69120255941,366.27579142084,408.78994578219,418.60090448096,447.11400319927,457.84473927605,510.98743222773,523.2511306012],"description":"Genus [55557]"},"efg5557":{"frequencies":[261.6255653006,286.15296204753,327.03195662575,357.69120255941,408.78994578219,447.11400319927,457.84473927605,510.98743222773,523.2511306012],"description":"Genus [5557]"},"efg55577":{"frequencies":[261.6255653006,286.15296204753,291.99281841585,299.00064605783,327.03195662575,357.69120255941,373.75080757229,408.78994578219,447.11400319927,457.84473927605,467.18850946536,510.98743222773,523.2511306012],"description":"Genus [55577]"},"efg557":{"frequencies":[261.6255653006,286.15296204753,327.03195662575,366.27579142084,418.60090448096,457.84473927605,523.2511306012],"description":"Genus septimum [557]"},"efg5577":{"frequencies":[261.6255653006,293.02063313667,320.49131749323,334.88072358477,366.27579142084,400.61414686654,418.60090448096,457.84473927605,512.78610798918,523.2511306012],"description":"Genus [5577]"},"efg55777":{"frequencies":[261.6255653006,286.15296204753,299.00064605783,320.49131749323,327.03195662575,366.27579142084,373.75080757229,400.61414686654,418.60090448096,457.84473927605,478.40103369253,500.76768358318,523.2511306012],"description":"Genus [55777]"},"efg577":{"frequencies":[261.6255653006,286.15296204753,327.03195662575,400.61414686654,457.84473927605,500.76768358318,523.2511306012],"description":"Genus nonum [577]"},"efg5777":{"frequencies":[261.6255653006,286.15296204753,299.00064605783,327.03195662575,373.75080757229,400.61414686654,457.84473927605,500.76768358318,523.2511306012],"description":"Genus [5777]"},"efg57777":{"frequencies":[261.6255653006,286.15296204753,299.00064605783,327.03195662575,350.53737850823,373.75080757229,400.61414686654,438.17172313528,457.84473927605,500.76768358318,523.2511306012],"description":"Genus [57777]"},"efg777":{"frequencies":[261.6255653006,350.53737850823,400.61414686654,457.84473927605,523.2511306012],"description":"Genus decimum [777]"},"efg77777":{"frequencies":[261.6255653006,299.00064605783,341.71502406609,350.53737850823,400.61414686654,457.84473927605,523.2511306012],"description":"Genus [77777]"},"eikohole1":{"frequencies":[261.6255653006,277.4816601673,305.22982618403,332.97799220076,436.04260883433,475.68284600109,523.2511306012],"description":"First eikohole ball <6 9 13 17 20|-epimorphic"},"eikohole2":{"frequencies":[261.6255653006,266.38239376061,274.70684356563,285.40970760065,299.68019298069,313.95067836072,332.97799220076,348.83408706747,366.27579142084,380.54627680087,392.4383479509,399.57359064092,418.60090448096,428.11456140098,443.97065626768,470.92601754108,488.36772189445,499.46698830115,523.2511306012],"description":"Second eikohole ball"},"eikohole4":{"frequencies":[261.6255653006,274.70684356563,279.79400733536,287.78812183066,305.22982618403,313.95067836072,319.76457981184,335.75280880244,348.83408706747,359.73515228832,366.27579142084,373.05867644715,383.71749577421,392.4383479509,406.97310157871,418.60090448096,419.69101100305,431.68218274599,447.67041173658,457.84473927605,470.92601754108,479.64686971777,488.36772189445,503.62921320365,523.2511306012],"description":"Fourth eikohole ball"},"eikohole5":{"frequencies":[261.6255653006,266.38239376061,274.70684356563,279.06726965397,285.40970760065,287.78812183066,294.32876096318,295.98043751179,299.68019298069,305.22982618403,313.95067836072,321.08592105074,325.57848126297,332.97799220076,342.49164912079,348.83408706747,353.19451315581,355.17652501415,363.24871876447,366.27579142084,374.60024122586,380.54627680087,392.4383479509,399.57359064092,406.97310157871,412.06026534844,418.60090448096,428.11456140098,439.53094970501,443.97065626768,448.50096908674,449.52028947103,456.65553216105,457.84473927605,465.11211608996,466.16918908107,470.92601754108,475.68284600109,488.36772189445,499.46698830115,507.3950357345,513.73747368118,523.2511306012],"description":"Fifth eikohole ball"},"eikohole6":{"frequencies":[261.6255653006,266.38239376061,272.43653907335,274.70684356563,279.06726965397,285.40970760065,287.78812183066,293.02063313667,294.32876096318,295.98043751179,299.00064605783,299.68019298069,305.22982618403,310.77945938738,313.95067836072,317.12189733406,321.08592105074,325.57848126297,329.64821227876,332.97799220076,336.37572681506,342.49164912079,348.83408706747,349.6268918108,353.19451315581,355.17652501415,356.76213450082,363.24871876447,366.27579142084,374.60024122586,380.54627680087,383.71749577421,392.4383479509,399.57359064092,406.97310157871,412.06026534844,418.60090448096,428.11456140098,431.68218274599,439.53094970501,443.97065626768,448.50096908674,449.52028947103,456.65553216105,457.84473927605,465.11211608996,466.16918908107,470.92601754108,475.68284600109,484.33162501929,488.36772189445,499.46698830115,507.3950357345,513.73747368118,523.2511306012],"description":"Sixth eikohole ball"},"eikosany":{"frequencies":[261.6255653006,269.80136421624,274.70684356563,287.78812183066,294.32876096318,305.22982618403,323.76163705949,335.75280880244,343.38355445704,359.73515228832,366.27579142084,377.72190990274,392.4383479509,412.06026534844,419.69101100305,431.68218274599,457.84473927605,470.92601754108,479.64686971777,503.62921320365,523.2511306012],"description":"3)6 1.3.5.7.9.11 Eikosany (1.3.5 tonic)"},"ekring1":{"frequencies":[261.6255653006,294.32876096318,313.95067836072,327.03195662575,353.19451315581,367.91095120397,376.74081403286,408.78994578219,418.60090448096,436.04260883433,470.92601754108,490.54793493862,523.2511306012],"description":"Single-tie circular mirroring of 3:4:5"},"ekring2":{"frequencies":[261.6255653006,294.32876096318,299.00064605783,305.22982618403,336.37572681506,343.38355445704,384.42940207435,400.61414686654,448.50096908674,457.84473927605,504.56359022259,515.07533168556,523.2511306012],"description":"Single-tie circular mirroring of 6:7:8"},"ekring3":{"frequencies":[261.6255653006,266.96486255163,299.00064605783,305.10270005901,327.03195662575,333.70607818954,341.71502406609,408.78994578219,418.60090448096,427.14378008261,457.84473927605,467.18850946536,523.2511306012],"description":"Single-tie circular mirroring of 4:5:7"},"ekring4":{"frequencies":[261.6255653006,279.06726965397,313.95067836072,334.88072358477,348.83408706747,376.74081403286,392.4383479509,401.85686830172,436.04260883433,446.50763144636,465.11211608996,502.32108537715,523.2511306012],"description":"Single-tie circular mirroring of 4:5:6"},"ekring5":{"frequencies":[261.6255653006,263.718569823,269.10058145205,305.22982618403,322.92069774245,366.27579142084,373.75080757229,376.74081403286,384.42940207435,439.53094970501,448.50096908674,512.78610798918,523.2511306012],"description":"Single-tie circular mirroring of 3:5:7"},"ekring5bp":{"frequencies":[261.6255653006,282.55561052465,336.37572681506,363.28578496026,366.27579142084,395.57785473451,432.48307733364,512.78610798918,560.62621135843,605.4763082671,610.45965236807,659.29642455751,784.8766959018],"description":"Single-tie BP circular mirroring of 3:5:7"},"ekring6":{"frequencies":[261.6255653006,288.32205155576,299.00064605783,336.37572681506,348.83408706747,384.42940207435,392.4383479509,406.97310157871,432.48307733364,465.11211608996,494.26637409559,512.57253609913,523.2511306012],"description":"Single-tie circular mirroring of 6:7:9"},"ekring7":{"frequencies":[261.6255653006,266.96486255163,290.69507255622,296.62762505737,322.99452506247,336.37572681506,343.24053756638,406.97310157871,415.27867508032,432.48307733364,470.92601754108,480.53675259294,523.2511306012],"description":"Single-tie circular mirroring of 5:7:9"},"ekring7bp":{"frequencies":[261.6255653006,311.45900631024,336.37572681506,400.44729382745,432.48307733364,436.04260883433,470.92601754108,514.86080634958,610.45965236807,667.41215637908,720.80512888941,726.73768139056,784.8766959018],"description":"Single-tie BP circular mirroring of 5:7:9"},"ellis":{"frequencies":[261.6255653006,277.10015133873,293.57875905702,310.98767008297,329.52610437773,349.11112716429,369.96685849926,391.93834696391,415.15022554673,439.86813926913,465.98150356841,493.78915701915,523.2511306012],"description":"Alexander John Ellis' imitation equal temperament (1875)"},"ellis_24":{"frequencies":[261.6255653006,264.89588486686,272.52663052146,275.93321340298,294.32876096318,298.00787047521,306.59245933664,310.42486507835,327.03195662575,331.11985608357,348.83408706747,353.19451315581,367.91095120397,372.50983809402,392.4383479509,397.34382730029,408.78994578219,413.89982010446,436.04260883433,441.49314144476,459.88868900496,465.63729761752,490.54793493862,496.67978412536,523.2511306012],"description":"Ellis, from p.421 of Helmholtz, 24 tones of JI for 1 manual harmonium"},"ellis_eb":{"frequencies":[261.6255653006,277.21587437848,293.6537610003,311.19285946782,329.68548178616,349.2169654334,370.02116610622,391.93834696391,415.32381240723,439.98064151826,466.28928903228,494.02822100775,523.2511306012],"description":"Ellis' new equal beating temperament for pianofortes (1885)"},"ellis_harm":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,313.95067836072,327.03195662575,348.83408706747,353.19451315581,392.4383479509,418.60090448096,436.04260883433,470.92601754108,490.54793493862,523.2511306012],"description":"Ellis's Just Harmonium"},"ellis_mteb":{"frequencies":[261.6255653006,273.31920907322,292.34465012884,313.05587813274,326.9349299255,350.18846153218,365.78692922515,391.15004079048,408.78346942429,437.23842445073,468.2723780569,489.17031487243,523.2511306012],"description":"Ellis' equal beating meantone tuning (1885)"},"enh14":{"frequencies":[261.6255653006,267.70988077271,274.08392555301,348.83408706747,392.4383479509,401.56482115906,411.12588832951,523.2511306012],"description":"14/11 Enharmonic"},"enh15":{"frequencies":[261.6255653006,270.64713651786,280.31310567921,356.76213450082,392.4383479509,402.50086969323,413.09299784305,523.2511306012],"description":"Tonos-15 Enharmonic"},"enh15_inv":{"frequencies":[261.6255653006,331.39238271409,340.11323489078,348.83408706747,383.71749577421,488.36772189445,505.80942624783,523.2511306012],"description":"Inverted Enharmonic Tonos-15 Harmonia"},"enh15_inv2":{"frequencies":[261.6255653006,270.34641747729,279.06726965397,348.83408706747,383.71749577421,392.4383479509,401.15920012759,523.2511306012],"description":"Inverted harmonic form of the enharmonic Tonos-15"},"enh17":{"frequencies":[261.6255653006,269.55361273395,277.97716313189,370.63621750918,404.33041910093,413.73345210327,423.58424858192,523.2511306012],"description":"Tonos-17 Enharmonic"},"enh17_con":{"frequencies":[261.6255653006,269.55361273395,277.97716313189,370.63621750918,378.52209447746,386.75083566176,494.18162334558,523.2511306012],"description":"Conjunct Tonos-17 Enharmonic"},"enh19":{"frequencies":[261.6255653006,268.69652652494,276.16031892841,355.06326719367,382.37582620857,389.87339142835,397.67085925691,523.2511306012],"description":"Tonos-19 Enharmonic"},"enh19_con":{"frequencies":[261.6255653006,268.69652652494,276.16031892841,355.06326719367,361.51896296083,368.21375857121,451.89870370104,523.2511306012],"description":"Conjunct Tonos-19 Enharmonic"},"enh2":{"frequencies":[261.6255653006,266.71168334607,277.18263097687,349.22823143301,391.99543598175,399.61600264311,415.30469757995,523.2511306012],"description":"1:2 Enharmonic. New genus 2 + 4 + 24 parts"},"enh21":{"frequencies":[261.6255653006,268.0066766494,274.70684356563,343.38355445704,392.4383479509,399.57359064092,406.97310157871,523.2511306012],"description":"Tonos-21 Enharmonic"},"enh21_inv":{"frequencies":[261.6255653006,336.37572681506,342.60490694126,348.83408706747,398.6675280771,498.33441009638,510.79277034879,523.2511306012],"description":"Inverted Enharmonic Tonos-21 Harmonia"},"enh21_inv2":{"frequencies":[261.6255653006,270.06509966514,279.06726965397,348.83408706747,398.6675280771,411.12588832951,423.58424858192,523.2511306012],"description":"Inverted harmonic form of the enharmonic Tonos-21"},"enh23":{"frequencies":[261.6255653006,267.43946675172,273.51763645063,334.29933343966,376.08675011961,388.21858076863,401.15920012759,523.2511306012],"description":"Tonos-23 Enharmonic"},"enh23_con":{"frequencies":[261.6255653006,267.43946675172,273.51763645063,334.29933343966,343.8507429665,353.96400011258,462.87600014722,523.2511306012],"description":"Conjunct Tonos-23 Enharmonic"},"enh25":{"frequencies":[261.6255653006,269.71707762948,278.32506946872,363.36884069528,408.78994578219,421.97671822677,436.04260883433,523.2511306012],"description":"Tonos-25 Enharmonic"},"enh25_con":{"frequencies":[261.6255653006,269.71707762948,278.32506946872,363.36884069528,373.75080757229,384.74347838324,503.12608711654,523.2511306012],"description":"Conjunct Tonos-25 Enharmonic"},"enh27":{"frequencies":[261.6255653006,269.10058145205,277.01530443593,353.19451315581,392.4383479509,403.65087217807,415.52295665389,523.2511306012],"description":"Tonos-27 Enharmonic"},"enh27_inv":{"frequencies":[261.6255653006,329.45441556372,339.14425131559,348.83408706747,387.59343007496,494.18162334558,508.71637697339,523.2511306012],"description":"Inverted Enharmonic Tonos-27 Harmonia"},"enh27_inv2":{"frequencies":[261.6255653006,266.38239376061,271.31540105247,348.83408706747,387.59343007496,397.28326582684,406.97310157871,523.2511306012],"description":"Inverted harmonic form of the enharmonic Tonos-27"},"enh29":{"frequencies":[261.6255653006,266.21548749886,270.96933548991,344.87006335079,379.35706968587,389.08417403679,399.32323124828,523.2511306012],"description":"Tonos-29 Enharmonic"},"enh29_con":{"frequencies":[261.6255653006,266.21548749886,270.96933548991,344.87006335079,352.8902973822,361.29244731988,474.19633710734,523.2511306012],"description":"Conjunct Tonos-29 Enharmonic"},"enh31":{"frequencies":[261.6255653006,270.34641747729,279.66870773512,337.93302184661,352.6257619269,368.65420565085,377.22755927063,386.2091678247,523.2511306012],"description":"Tonos-31 Enharmonic. Tone 24 alternates with 23 as MESE or A"},"enh31_con":{"frequencies":[261.6255653006,270.34641747729,279.66870773512,337.93302184661,352.6257619269,360.46188996972,368.65420565085,450.57736246214,523.2511306012],"description":"Conjunct Tonos-31 Enharmonic"},"enh33":{"frequencies":[261.6255653006,269.80136421624,278.50463402967,359.73515228832,392.4383479509,401.56482115906,411.12588832951,523.2511306012],"description":"Tonos-33 Enharmonic"},"enh33_con":{"frequencies":[261.6255653006,269.80136421624,278.50463402967,359.73515228832,367.38909169871,375.37581108347,479.64686971777,523.2511306012],"description":"Conjunct Tonos-33 Enharmonic"},"enh_invcon":{"frequencies":[261.6255653006,283.42769574232,370.63621750918,381.53728273004,392.4383479509,501.44900015948,512.35006538034,523.2511306012],"description":"Inverted Enharmonic Conjunct Phrygian Harmonia"},"enh_mod":{"frequencies":[261.6255653006,294.32876096318,305.22982618403,348.83408706747,392.4383479509,406.97310157871,418.60090448096,523.2511306012],"description":"Enharmonic After Wilson's Purvi Modulations, See page 111"},"enh_perm":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,348.83408706747,392.4383479509,406.97310157871,465.11211608996,523.2511306012],"description":"Permuted Enharmonic, After Wilson's Marwa Permutations, See page 110."},"enn45ji":{"frequencies":[261.6255653006,267.07609791103,269.10058145205,274.70684356563,276.85245005354,282.55561052465,288.32205155576,290.69507255622,296.75121990114,299.00064605783,305.22982618403,311.45900631024,313.95067836072,320.49131749323,322.92069774245,329.64821227876,336.37572681506,339.14425131559,346.06556256693,348.83408706747,356.10146388137,363.36884069528,366.27579142084,373.75080757229,376.74081403286,384.42940207435,392.4383479509,395.57785473451,403.65087217807,406.97310157871,415.27867508032,423.93031414449,427.32175665765,436.04260883433,439.53094970501,448.50096908674,457.84473927605,461.31528248922,470.92601754108,474.80195184183,484.4917875937,494.47231841813,498.33441009638,508.71637697339,512.78610798918,523.2511306012],"description":"Detempered Ennealimma[45], Hahn reduced"},"enn72synch":{"frequencies":[195.99771799087,197.54967854522,199.11392792408,201.62391554947,203.22042578925,204.82957760946,207.41161549338,209.05395423619,211.68924370912,213.36545381699,215.05493658943,217.76587316352,219.49019959291,221.22817968434,224.01693484168,225.790758792,228.63703016722,230.44743589451,232.27217821307,235.20015301436,237.06252857463,238.93964952543,241.95167308427,243.86750892427,246.94165062806,248.89699839908,250.8678291188,254.03021536301,256.04169222048,258.06909647124,261.3222603528,263.39147750593,266.71173418544,268.8236265844,270.95224149283,274.36780754746,276.54032271274,278.73004041423,282.24365173996,284.47852987378,288.0646054292,290.34557537779,292.64460663558,296.33362372129,298.68006816723,301.0450940916,304.84000597616,307.25380610435,311.12698372207,313.59056753865,316.0736586482,320.05801564518,322.59231767928,325.14668697146,329.24541662461,331.85246687263,336.03572815421,338.69654584276,341.37843257302,345.68177614255,348.4189737305,351.17784515594,355.60471802638,358.42048803112,362.93866010991,365.81250216232,368.70910003837,373.35696816148,376.31330506793,379.29305101359,384.07434037944,387.11553797119,391.99543598174],"description":"Poptimal synchonized beating ennealimmal tuning, TM 10-10-2005"},"ennea45":{"frequencies":[261.6255653006,267.02028728287,269.13615104392,274.68574138534,276.8623300691,282.57123430547,288.39787286736,290.68311542614,296.67700440585,299.02785016604,305.1938252949,311.48692526882,313.95512370264,320.42888174436,322.96795420876,329.62755691287,336.42448069667,339.09030198792,346.08234767737,348.824677577,356.01744619623,363.3585507705,366.23777597441,373.78960287068,376.751482929,384.52012478698,392.44893391322,395.5586690753,403.715093104,406.91412394911,415.30469757995,423.86828492968,427.22700928979,436.03643483576,439.49155400205,448.55387459245,457.80308677504,461.43068321685,470.94538888861,474.67712392136,484.46499932732,494.45467284607,498.37269363637,508.649143962,512.67967026301,523.2511306012],"description":"Ennealimmal-45, in a 7-limit least-squares tuning, g=48.999, G.W. Smith"},"epimore_enh":{"frequencies":[261.6255653006,265.11390617127,279.06726965397,348.83408706747,392.4383479509,397.67085925691,418.60090448096,523.2511306012],"description":"New Epimoric Enharmonic, Dorian mode of the 4th new Enharmonic on Hofmann's list"},"eratos_chrom":{"frequencies":[261.6255653006,275.39533189537,290.69507255622,348.83408706747,392.4383479509,413.09299784305,436.04260883433,523.2511306012],"description":"Dorian mode of Eratosthenes's Chromatic. same as Ptol. Intense Chromatic"},"eratos_diat":{"frequencies":[261.6255653006,275.62199471997,310.07474405997,348.83408706747,392.4383479509,413.43299207996,465.11211608996,523.2511306012],"description":"Dorian mode of Eratosthenes's Diatonic, Pythagorean"},"eratos_enh":{"frequencies":[261.6255653006,268.33391312882,275.39533189537,348.83408706747,392.4383479509,402.50086969323,413.09299784305,523.2511306012],"description":"Dorian mode of Eratosthenes's Enharmonic"},"erlangen":{"frequencies":[261.6255653006,275.62199471997,293.99679436797,310.07474405997,327.03195662575,348.83408706747,367.49599295996,392.4383479509,413.43299207996,440.99519155196,465.11211608996,490.54793493862,523.2511306012],"description":"Anonymus: Pro clavichordiis faciendis, Erlangen 15th century"},"erlangen2":{"frequencies":[261.6255653006,275.93321340298,294.32876096318,310.07474405997,327.03195662575,348.83408706747,367.91095120397,392.4383479509,413.89982010446,441.49314144476,465.11211608996,490.54793493862,523.2511306012],"description":"Revised Erlangen"},"erlich1":{"frequencies":[261.6255653006,278.64199172491,296.7651860139,326.1838132033,347.39918201406,369.99442271164,394.05928374402,433.12277132725,461.29357245868,491.2966347616,523.2511306012],"description":"Asymmetrical Major decatonic mode of 22-tET, Paul Erlich"},"erlich10":{"frequencies":[261.6255653006,274.70684356563,299.00064605783,313.95067836072,348.83408706747,366.27579142084,392.4383479509,418.60090448096,448.50096908674,470.92601754108,523.2511306012],"description":"Canonical JI interpretation of the Pentachordal decatonic mode of 22-tET"},"erlich10s1":{"frequencies":[261.6255653006,280.31310567921,299.00064605783,313.95067836072,348.83408706747,366.27579142084,392.4383479509,418.60090448096,448.50096908674,470.92601754108,523.2511306012],"description":"Superparticular version of erlich10 using 50/49 decatonic comma"},"erlich10s2":{"frequencies":[261.6255653006,274.70684356563,293.02063313667,313.95067836072,348.83408706747,366.27579142084,392.4383479509,418.60090448096,448.50096908674,470.92601754108,523.2511306012],"description":"Other superparticular version of erlich10 using 50/49 decatonic comma"},"erlich11":{"frequencies":[261.6255653006,280.31310567921,305.22982618403,327.03195662575,348.83408706747,373.75080757229,392.4383479509,436.04260883433,457.84473927605,490.54793493862,523.2511306012],"description":"Canonical JI interpretation of the Symmetrical decatonic mode of 22-tET"},"erlich11s1":{"frequencies":[261.6255653006,274.70684356563,305.22982618403,327.03195662575,348.83408706747,373.75080757229,392.4383479509,436.04260883433,457.84473927605,490.54793493862,523.2511306012],"description":"Superparticular version of erlich11 using 50/49 decatonic comma"},"erlich11s2":{"frequencies":[261.6255653006,280.31310567921,305.22982618403,311.45900631024,348.83408706747,373.75080757229,392.4383479509,436.04260883433,457.84473927605,490.54793493862,523.2511306012],"description":"Other superparticular version of erlich11 using 50/49 decatonic comma"},"erlich12":{"frequencies":[261.6255653006,267.01308914069,282.57123920205,288.39008844866,305.19382000629,311.47852302926,329.62755691287,336.41541160581,356.01745236555,363.34874301751,384.52011812375,392.4383479509,415.30469757995,423.85685859121,448.5538823653,457.7907297806,484.46499093218,494.44133512215,523.2511306012],"description":"Two 9-tET scales 3/2 shifted, Paul Erlich, TL 5-12-2001"},"erlich13":{"frequencies":[261.6255653006,269.80136421624,294.32876096318,327.03195662575,343.38355445704,359.73515228832,392.4383479509,441.49314144476,457.84473927605,490.54793493862,523.2511306012],"description":"Just scale by Paul Erlich (2002)"},"erlich2":{"frequencies":[261.6255653006,278.64199172491,296.7651860139,316.06713361714,347.39918201406,369.99442271164,394.05928374402,419.68935090103,446.98642698175,476.05893615592,523.2511306012],"description":"Asymmetrical Minor decatonic mode of 22-tET, Paul Erlich"},"erlich3":{"frequencies":[261.6255653006,278.64199172491,296.7651860139,326.1838132033,347.39918201406,369.99442271164,394.05928374402,419.68935090103,461.29357245868,491.2966347616,523.2511306012],"description":"Symmetrical Major decatonic mode of 22-tET, Paul Erlich"},"erlich4":{"frequencies":[261.6255653006,278.64199172491,296.7651860139,316.06713361714,347.39918201406,369.99442271164,394.05928374402,419.68935090103,446.98642698175,491.2966347616,523.2511306012],"description":"Symmetrical Minor decatonic mode of 22-tET, Paul Erlich"},"erlich5":{"frequencies":[261.6255653006,269.33066959279,278.10477655849,287.16472157287,295.62197660533,306.17967660611,315.19693888202,326.45372959864,335.05049156411,348.07025322573,357.23626005287,368.87410717392,380.89108570115,393.29954676976,406.11224388345,419.34234602259,433.00345117936,444.40607048653,461.67529188567,473.83294924974,490.75518955849,505.2083639382,523.2511306012],"description":"Unequal 22-note compromise between decatonic & Indian srutis, Paul Erlich"},"erlich6":{"frequencies":[261.6255653006,274.70684356563,280.31310567921,285.40970760065,294.32876096318,299.00064605783,305.22982618403,313.95067836072,327.03195662575,336.37572681506,343.38355445704,348.83408706747,359.73515228832,366.27579142084,373.75080757229,392.4383479509,418.60090448096,436.04260883433,448.50096908674,457.84473927605,470.92601754108,490.54793493862,523.2511306012],"description":"Scale of consonant tones against 1/1-3/2 drone. TL 23-9-1998"},"erlich7":{"frequencies":[261.6255653006,272.64118737561,277.98432293805,281.84855879469,292.47977325983,303.51199286577,307.73108663824,313.76190292287,326.97270111135,337.05955506058,340.85784563832,350.05627231138,365.1325261687,373.60234843661,378.13992750117,391.18115131013,406.9458559663,413.62886206386,420.42161880722,437.36472209676,452.44848028305,457.94368329907,468.56640608675,488.7466646507,501.93603498211,507.59230220159,523.2511306012],"description":"Meantone-like circle of sinuoidally varying fifths, TL 08-12-99"},"erlich8":{"frequencies":[261.6255653006,263.902226729,277.18263097687,279.59466973861,293.66476791741,296.22023396764,311.12698372208,313.83440569119,329.62755691287,332.49597057,349.22823143301,352.26720984209,369.99442271164,373.21410818061,391.99543598175,395.40657391157,415.30469757995,418.91867232636,440,443.82887286778,466.16376151809,470.22031101449,493.88330125613,498.18106573801,523.2511306012],"description":"Two 12-tET scales 15 cents shifted, Paul Erlich"},"erlich9":{"frequencies":[261.6255653006,271.31540105247,280.31310567921,290.69507255622,302.70726563706,308.34441624714,319.76457981184,332.97799220076,345.34574619679,356.76213450082,369.97554688974,383.71749577421,396.40237166758,411.12588832951,428.11456140098,436.04260883433,452.23847716247,470.92601754108,488.36772189445,504.56359022259,523.2511306012],"description":"11-limit periodicity block, u.v.: 9801/9800 243/242 126/125 100/99"},"erlich_bpf":{"frequencies":[261.6255653006,269.93113880221,277.4816601673,282.55561052465,293.6613488068,301.87565226992,311.45900631024,319.76457981184,328.70904358281,336.37572681506,347.05432131712,356.76213450082,366.27579142084,377.90359432309,388.47432423422,400.44729382745,411.12588832951,422.62591317789,436.04260883433,447.67041173658,458.69417292962,470.92601754108,485.87604984397,499.46698830115,512.78610798918,528.59042785223,543.37617408586,560.62621135843,575.57624366132,591.67627844905,610.45965236807,624.69777837082,642.17184210147,659.29642455751,680.22646978156,699.2537836216,726.73768139056,740.02659899313,760.72664372021,784.8766959018],"description":"Erlich's 39-tone Triple Bohlen-Pierce scale"},"erlich_bpp":{"frequencies":[261.6255653006,268.60224704195,277.4816601673,282.55561052465,293.6613488068,299.68019298069,311.45900631024,319.76457981184,323.65460841914,336.37572681506,345.34574619679,356.76213450082,366.27579142084,380.67211882362,385.30310526088,400.44729382745,411.12588832951,419.55227017296,436.04260883433,447.67041173658,458.69417292962,470.92601754108,489.43558134466,499.46698830115,512.78610798918,528.59042785223,539.42434736524,560.62621135843,575.57624366132,594.60355750136,610.45965236807,629.27431887171,642.17184210147,659.29642455751,685.20981388252,699.2537836216,720.80512888941,740.02659899313,764.49028821604,784.8766959018],"description":"Periodicity block for erlich_bpf, 1625/1617 1331/1323 275/273 245/243"},"erlich_bpp2":{"frequencies":[261.6255653006,268.60224704195,277.4816601673,282.55561052465,293.92501780685,299.68019298069,311.45900631024,319.76457981184,326.02570445152,336.37572681506,345.34574619679,356.76213450082,366.27579142084,377.90359432309,385.30310526088,400.44729382745,411.12588832951,422.62591317789,436.04260883433,447.67041173658,458.69417292962,470.92601754108,485.87604984397,499.46698830115,512.78610798918,528.59042785223,543.37617408586,560.62621135843,575.57624366132,594.60355750136,610.45965236807,629.83932387181,642.17184210147,659.29642455751,685.20981388252,698.62650953896,726.73768139056,740.02659899313,764.49028821604,784.8766959018],"description":"Improved shape for erlich_bpp"},"erlich_bppe":{"frequencies":[261.6255653006,269.03526454087,276.77324548748,284.61195549492,292.79795257063,301.09050901183,309.7504615497,318.52314490095,327.68449417797,337.10934179701,346.6568752383,356.62740568226,366.72772736951,377.27553481706,387.96064596243,399.11915372018,410.59860200806,422.22748385656,434.37157296247,446.67374500165,459.5209564409,472.53540627884,486.12644973042,499.89441151621,514.27235352402,529.06383329425,544.0478609495,559.69574261012,575.54731703113,592.10118472076,608.870542156,626.38285104305,644.39884822068,662.64936456684,681.70845767885,701.01565227402,721.17823493702,741.60327945962,762.93324174612,784.8766959018],"description":"LS optimal 3:5:7:11:13 tempering, virtually equal, g=780.2702 cents"},"erlich_bppm":{"frequencies":[261.6255653006,269.3148593258,276.83859227209,284.97500405989,292.93622770824,301.54575630263,309.96990811138,319.08006614158,327.99406628962,337.15709295818,347.06629484351,356.76213450082,367.24753706379,377.50717076432,388.60227773252,399.45849178361,410.61798882758,422.6862401977,434.49464068244,447.26463523836,459.75967424319,473.27221959449,486.49381977384,500.79209531182,514.78250488433,529.16376146212,544.7161244152,559.93362036345,576.39032675477,592.49269103014,609.9063234692,626.94500947499,644.45969779399,663.40066444061,681.93379843592,701.97614206495,721.5869464624,742.79471409673,763.54584931731,784.8766959018],"description":"MM optimal 3:5:7:11:13 tempering, g=780.352 cents"},"erlich_paj":{"frequencies":[261.6255653006,269.74106841426,278.59741216196,287.23937405609,296.67040683594,305.87298460253,315.91563888094,325.71519477697,336.4093235789,346.84458402385,358.23265591403,369.99442271164,381.47147728046,393.99623872149,406.21781843768,419.55531290213,432.56972318844,446.77218107119,460.63084592459,475.75462791404,490.51231476219,506.61748047856,523.2511306012],"description":"Erlich's Pajara or Twintone, with RMS optimal generator"},"erlich_paj2":{"frequencies":[261.6255653006,270.25447814202,278.68577354399,287.87753105276,296.85845221806,306.64959036092,316.21614384055,326.645747324,336.83612131731,347.94582350257,358.80069640371,369.99442271164,382.1975482805,394.12120058634,407.1203087173,419.82124923186,433.66800958456,447.19715926063,461.9468459571,476.35821106408,492.06970256841,507.42081104304,523.2511306012],"description":"Erlich's Pajara or Twintone with minimax optimal generator"},"escapade":{"frequencies":[261.6255653006,270.11362843741,278.8770761192,287.9248395776,297.26614463769,306.91051483225,316.86778450163,327.1481015562,337.76194863153,348.72014864112,360.03386958939,371.71464785337,383.77439429365,392.56657056143,405.30282760495,418.45229174958,432.02837124332,446.04490958069,460.51619165905,475.45697355792,490.88248752006,506.80846290374,523.2511306012],"description":"Escapade temperament, g=55.275493, 5-limit"},"et-mix6":{"frequencies":[261.6255653006,293.66476791741,300.52885648597,311.12698372208,329.62755691287,345.21700307457,369.99442271164,396.55020354877,415.30469757995,440,455.51656649021,466.16376151809,523.2511306012],"description":"Mix of equal temperaments from 1-6 (= 4-6)"},"euler":{"frequencies":[261.6255653006,272.52663052146,294.32876096318,306.59245933664,327.03195662575,348.83408706747,367.91095120397,392.4383479509,408.78994578219,436.04260883433,459.88868900496,490.54793493862,523.2511306012],"description":"Euler's Monochord (a mode of Ellis's duodene) (1739), genus [33355]"},"euler20":{"frequencies":[261.6255653006,274.58143914872,285.65749968142,293.61100773131,305.45468261618,320.58100381398,326.62388782443,329.50688232588,342.79852229325,366.55580177366,381.34192228364,391.95955371998,407.7704102616,411.36965665618,427.96347506501,439.87918162894,457.62301915088,489.33808574423,509.07699553894,513.57043963064,523.2511306012],"description":"Genus [3333555] tempered by 225/224-planar"},"euler24":{"frequencies":[261.6255653006,274.58143914872,285.65749968142,293.61100773131,305.45468261618,308.1508239679,320.58100381398,326.62388782443,329.50688232588,342.79852229325,366.55580177366,381.34192228364,384.70789368407,391.95955371998,407.7704102616,411.36965665618,427.96347506501,439.87918162894,457.62301915088,480.28481865546,489.33808574423,493.65730140218,509.07699553894,513.57043963064,523.2511306012],"description":"Genus [33333555] tempered by 225/224-planar"},"euler_diat":{"frequencies":[261.6255653006,294.32876096318,327.03195662575,348.83408706747,367.91095120397,392.4383479509,436.04260883433,490.54793493862,523.2511306012],"description":"Euler's genus diatonicum veterum correctum"},"euler_enh":{"frequencies":[261.6255653006,267.90457886781,275.62199471997,348.83408706747,392.4383479509,401.85686830172,413.43299207996,523.2511306012],"description":"Euler's Old Enharmonic, From Tentamen Novae Theoriae Musicae"},"euler_gm":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,289.40309445597,348.83408706747,361.75386806997,372.08969287196,385.87079260796,523.2511306012],"description":"Euler's Genus Musicum, Octony based on Archytas's Enharmonic"},"exptriad2":{"frequencies":[261.6255653006,306.59245933664,327.03195662575,367.91095120397,392.4383479509,459.88868900496,490.54793493862,523.2511306012],"description":"Two times expanded major triad"},"exptriad3":{"frequencies":[261.6255653006,269.46602871384,275.93321340298,279.06726965397,287.4304306281,294.32876096318,297.67175429757,303.14928230307,306.59245933664,313.95067836072,323.35923445661,327.03195662575,344.91651675372,348.83408706747,359.28803828513,367.91095120397,372.08969287196,378.93660287884,383.2405741708,392.4383479509,404.19904307077,408.78994578219,418.60090448096,431.14564594215,436.04260883433,446.50763144636,459.88868900496,490.54793493862,505.24880383846,517.37477513058,523.2511306012],"description":"Three times expanded major triad"},"iivv17":{"frequencies":[261.6255653006,269.80136421624,277.97716313189,283.42769574232,294.32876096318,305.22982618403,318.85615771011,327.03195662575,343.38355445704,348.83408706747,359.73515228832,367.91095120397,370.63621750918,392.4383479509,416.96574469783,425.14154361347,436.04260883433,441.49314144476,457.84473927605,479.64686971777,490.54793493862,523.2511306012],"description":"17-limit IIVV"},"indian-ayyar":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,290.69507255622,294.32876096318,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,359.73515228832,366.27579142084,373.75080757229,392.4383479509,406.97310157871,418.60090448096,436.04260883433,441.49314144476,457.84473927605,470.92601754108,490.54793493862,502.32108537715,523.2511306012],"description":"Carnatic sruti system, C.Subrahmanya Ayyar, 1976. alt:21/20 25/16 63/40 40/21"},"indian-dk":{"frequencies":[261.6255653006,294.32876096318,305.22982618403,313.95067836072,348.83408706747,392.4383479509,406.97310157871,418.60090448096,465.11211608996,523.2511306012],"description":"Raga Darbari Kanada"},"indian-ellis":{"frequencies":[261.6255653006,269.10058145205,277.01530443593,285.40970760065,294.32876096318,303.82323712328,313.95067836072,324.77656382143,336.37572681506,348.83408706747,358.01393146398,367.68998366571,377.90359432309,388.70083987518,400.13321751856,412.25846653428,425.14154361347,438.85578695585,453.48431318771,469.12170329763,485.87604984397,503.87145909745,523.2511306012],"description":"Ellis's Indian Chromatic, theoretical #74 of App.XX, p.517 of Helmholtz"},"indian-hahn":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,290.69507255622,294.32876096318,306.59245933664,313.95067836072,327.03195662575,334.88072358477,348.83408706747,353.19451315581,367.91095120397,376.74081403286,392.4383479509,408.78994578219,418.60090448096,436.04260883433,441.49314144476,465.11211608996,470.92601754108,490.54793493862,502.32108537715,523.2511306012],"description":"Indian shrutis Paul Hahn proposal"},"indian-hrdaya1":{"frequencies":[261.6255653006,282.55561052465,294.32876096318,313.95067836072,328.55303549378,348.83408706747,375.07381928051,392.4383479509,428.11456140098,441.49314144476,470.92601754108,492.82955324067,523.2511306012],"description":"From Hrdayakautaka of Hrdaya Narayana (17th c) Bhatkande's interpretation"},"indian-hrdaya2":{"frequencies":[261.6255653006,282.55561052465,294.32876096318,313.95067836072,330.47439827444,348.83408706747,376.74081403286,392.4383479509,428.11456140098,448.50096908674,470.92601754108,495.71159741166,523.2511306012],"description":"From Hrdayakautaka of Hrdaya Narayana (17th c) Levy's interpretation"},"indian-invrot":{"frequencies":[261.6255653006,267.90457886781,279.06726965397,313.95067836072,327.03195662575,334.88072358477,348.83408706747,392.4383479509,418.60090448096,446.50763144636,490.54793493862,502.32108537715,523.2511306012],"description":"Inverted and rotated North Indian gamut"},"indian-magrama":{"frequencies":[261.6255653006,294.32876096318,327.03195662575,367.91095120397,392.4383479509,441.49314144476,490.54793493862,523.2511306012],"description":"Indian mode Ma-grama (Sa Ri Ga Ma Pa Dha Ni Sa)"},"indian-newbengali":{"frequencies":[261.6255653006,269.13627541126,277.02257024271,285.46954808622,294.32876096318,303.84527498141,313.95067836072,324.71413568646,336.35938765066,348.83408706747,358.01090280364,367.91095120397,377.98706287655,388.6137256405,400.23209335925,412.19781491431,425.25755219187,438.98455767189,453.41648894489,469.13512554326,485.39868175205,503.9696508909,523.2511306012],"description":"Modern Bengali scale,S.M. Tagore: The mus. scales of the Hindus,Calcutta 1884"},"indian-old2ellis":{"frequencies":[261.6255653006,270.06509966514,277.97716313189,285.40970760065,294.32876096318,305.22982618403,316.13089140489,327.03195662575,337.93302184661,348.83408706747,359.73515228832,370.63621750918,380.54627680087,392.4383479509,404.33041910093,415.52295665389,428.11456140098,441.49314144476,457.84473927605,474.19633710734,490.54793493862,505.80942624783,523.2511306012],"description":"Ellis Old Indian Chrom2, Helmholtz, p. 517. This is a 4 cent appr. to #73"},"indian-oldellis":{"frequencies":[261.6255653006,269.44737349144,277.4816601673,285.79952600623,294.32876096318,304.84150796353,315.71315096976,327.03195662575,337.72216249472,348.83408706747,359.25382662183,369.99442271164,381.0561299374,392.4383479509,404.18156579781,416.22249025095,428.71043212875,441.49314144476,457.27414749797,473.58203588493,490.54793493862,506.59641128799,523.2511306012],"description":"Ellis Old Indian Chromatic, Helmholtz, p. 517. This is a 0.5 cent appr. to #73"},"indian-raja":{"frequencies":[261.6255653006,294.32876096318,327.03195662575,348.83408706747,392.4383479509,490.54793493862,523.2511306012],"description":"A folk scale from Rajasthan, India"},"indian-sagrama":{"frequencies":[261.6255653006,294.32876096318,327.03195662575,348.83408706747,392.4383479509,441.49314144476,490.54793493862,523.2511306012],"description":"Indian mode Sa-grama (Sa Ri Ga Ma Pa Dha Ni Sa), inverse of Didymus' diatonic"},"indian-srutiharm":{"frequencies":[261.6255653006,275.04226095704,278.87560257317,292.29229825722,294.20896982953,310.50067090621,313.3756771183,327.75070817877,332.5423844325,351.70909240436,354.58409877157,369.9174668925,374.70914348171,393.87585105695,414.95923028882,421.66757847392,437.95928040996,441.79262140873,467.66767825558,473.41768959156,493.54273382289,499.29274676062,523.2511306012],"description":"B. Chaitanya Deva's sruti harmonium. The Music of India, 1981, p. 109"},"indian-srutivina":{"frequencies":[261.6255653006,268.56758546278,278.98051393788,288.52577197574,297.52863491406,305.33829130574,314.01573591759,327.57422802312,336.57725592546,350.35262131413,358.2707318239,366.40588882483,378.77125721528,394.82459335461,403.28512412878,416.95215854696,428.77531684666,444.28620821491,453.93981227417,469.5594057965,487.34812384257,504.37765306036,529.32520658991],"description":"Raja S.M. Tagore's sruti vina, measured by Ellis and Hipkins, 1886. 1/1=241.2"},"indian-srutivina2":{"frequencies":[261.6255653006,275.04226095704,278.87560257317,292.29229825722,294.20896982953,310.50067090621,313.3756771183,327.75070817877,332.5423844325,351.70909240436,354.58409877157,369.9174668925,374.70914348171,393.87585105695,414.95923028882,421.66757847392,437.95928040996,441.79262140873,467.66767825558,473.41768959156,493.54273382289,499.29274676062,523.2511306012],"description":"S. Ramanathan's sruti vina, 1973. In B.C. Deva, The Music of India, p. 110"},"indian-vina":{"frequencies":[261.6255653006,276.70272600503,292.81785438923,313.29104303136,329.05685050583,352.26720984209,369.14054089803,390.18821123181,411.0090584005,435.70052664441,465.35666077712,491.60634075178,525.37110555681],"description":"Observed South Indian tuning of a vina, Ellis"},"indian-vina2":{"frequencies":[261.6255653006,277.02257024271,292.81785438923,308.97787266236,326.21810583671,344.81842302716,363.84824628932,386.37547528213,409.11417474979,432.19134773437,455.25352578019,480.93331155807,507.76825077597,539.82938999168,571.59905201246,602.44805673853,637.90290877605,678.5727631795,715.19510239543,756.4109196702,799.53998816902,846.10508618474,890.73947019126,943.16064703194,1001.55531043729],"description":"Observed tuning of old vina in Tanjore Palace, Ellis and Hipkins. 1/1=210.7 Hz"},"indian-vina3":{"frequencies":[261.6255653006,275.62199471997,294.32876096318,310.07474405997,327.03195662575,348.83408706747,367.91095120397,392.4383479509,413.43299207996,441.49314144476,465.11211608996,490.54793493862,523.2511306012],"description":"Tuning of K.S. Subramanian's vina (1983)"},"indian":{"frequencies":[261.6255653006,275.62199471997,279.06726965397,290.69507255622,294.32876096318,310.07474405997,313.95067836072,327.03195662575,331.11985608357,348.83408706747,353.19451315581,367.91095120397,372.50983809402,392.4383479509,413.43299207996,418.60090448096,436.04260883433,441.49314144476,465.11211608996,470.92601754108,490.54793493862,496.67978412536,523.2511306012],"description":"Indian shruti scale"},"indian2":{"frequencies":[261.6255653006,275.62199471997,279.06726965397,290.69507255622,294.32876096318,310.07474405997,313.95067836072,327.03195662575,331.11985608357,348.83408706747,353.19451315581,367.91095120397,372.08969287196,392.4383479509,413.43299207996,418.60090448096,436.04260883433,441.49314144476,465.11211608996,470.92601754108,490.54793493862,496.67978412536,523.2511306012],"description":"Indian shruti scale with tritone 64/45 schisma lower (Mr.Devarajan, Madurai)"},"indian2_sm":{"frequencies":[261.6255653006,275.80107697063,279.12844116922,290.7446524607,294.25230137258,310.19560923413,313.9379197281,327.00276442799,330.9478443499,348.87940629173,353.08841191408,367.78254402461,372.21960384438,392.38737044642,413.64787586584,418.63827382983,436.06032987759,441.3211172644,465.23297251763,470.84571179248,490.44043044945,496.35728163707,523.2511306012],"description":"Shruti/Mathieu's Magic Mode scale in 289-equal (schismic) temperament"},"indian3":{"frequencies":[261.6255653006,270.06509966514,279.06726965397,290.69507255622,294.32876096318,310.07474405997,313.95067836072,327.03195662575,331.11985608357,348.83408706747,353.19451315581,367.91095120397,372.08969287196,392.4383479509,413.43299207996,418.60090448096,436.04260883433,441.49314144476,465.11211608996,470.92601754108,490.54793493862,506.89953276991,523.2511306012],"description":"Indian shruti scale with 32/31 and 31/16 and tritone schisma lower"},"indian4":{"frequencies":[261.6255653006,275.93321340298,279.06726965397,290.69507255622,294.32876096318,310.07474405997,313.95067836072,327.03195662575,330.74639366397,348.83408706747,367.91095120397,372.08969287196,387.59343007496,392.4383479509,413.89982010446,418.60090448096,436.04260883433,441.49314144476,465.11211608996,470.92601754108,490.54793493862,496.11959049595,523.2511306012],"description":"Indian shruti scale according to Firoze Framjee: Text book of Indian music"},"indian5":{"frequencies":[261.6255653006,275.62199471997,279.06726965397,290.69507255622,294.32876096318,310.07474405997,313.95067836072,327.03195662575,331.11985608357,348.83408706747,353.19451315581,367.91095120397,372.08969287196,387.59343007496,392.4383479509,413.43299207996,418.60090448096,436.04260883433,441.49314144476,465.11211608996,470.92601754108,490.54793493862,496.67978412536,523.2511306012],"description":"23 Shrutis, Amit Mitra, 1/1 no. 12:2, Table C."},"indian6":{"frequencies":[146.8323839587,148.66778875818,150.35636117371,151.0621234143,152.23581568838,152.95039995698,154.68761437624,154.86227995644,156.62120955595,158.5789746754,159.32333328852,163.14709328744,165.18643195354,167.06262352634,169.15090632042,169.94488884109,172.0691999516,174.02356617327,176.19886075044,178.40134650982,179.23874994958,180.42763340845,181.27454809716,183.54047994838,185.62513725149,185.83473594773,187.94545146714,188.82765426788,190.29476961048,191.18799994622,193.3595179703,193.57784994555,195.77651194493,198.22371834425,200.47514823161,202.98108758451,203.93386660931,206.48303994192,208.82827940793,209.0640779412,211.43863290053,212.43111105136,214.08161581178,215.0864999395,217.52945771659,220.24857593805,223.00168313728,225.53454176056,226.59318512145,228.35372353257,229.42559993547,232.03142156437,232.29341993466,234.93181433392,237.86846201309,238.98499993278,240.57017787793,241.69939746288,244.72063993117,247.77964793031,250.59393528951,253.72635948063,254.91733326163,258.1037999274,261.03534925991,264.29829112566,267.60201976473,270.64145011268,271.91182214574,275.31071992256,278.43770587724,278.75210392159,281.9181772007,283.24148140181,285.44215441571,286.78199991934,290.03927695546,293.6647679174],"description":"Shrutis calculated by generation method, Amit Mitra, 1/1 no. 12:2, Table B."},"indian_12":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,313.95067836072,327.03195662575,348.83408706747,367.91095120397,392.4383479509,418.60090448096,441.49314144476,470.92601754108,490.54793493862,523.2511306012],"description":"North Indian Gamut, modern Hindustani gamut out of 22 or more shrutis"},"indian_12c":{"frequencies":[261.6255653006,277.01530443593,294.32876096318,313.95067836072,328.55303549378,348.83408706747,369.35373924791,392.4383479509,415.52295665389,441.49314144476,470.92601754108,492.82955324067,523.2511306012],"description":"Carnatic gamut. Kuppuswami: Carnatic music and the Tamils, p. v"},"indian_a":{"frequencies":[261.6255653006,290.79521372391,318.76727400207,355.94891173479,388.6137256405,432.69092326853,486.52148746092,523.2511306012],"description":"One observed indian mode"},"indian_b":{"frequencies":[261.6255653006,290.79521372391,305.95868600104,356.15457528086,388.83826257328,432.94092754357,461.60862817266,523.2511306012],"description":"Observed Indian mode"},"indian_c":{"frequencies":[261.6255653006,278.94941459687,313.65318017499,356.15457528086,388.83826257328,422.07621250312,470.76384471612,523.2511306012],"description":"Observed Indian mode"},"indian_d":{"frequencies":[261.6255653006,289.28740724512,320.24370022528,344.61930560862,391.31674786192,442.03793673691,485.39868175205,523.2511306012],"description":"Indian D (Ellis, correct)"},"indian_e":{"frequencies":[261.6255653006,275.58617649731,323.21709932123,347.81902735497,393.58362272115,410.77171881178,488.21056770985,523.2511306012],"description":"Observed Indian mode"},"indian_g":{"frequencies":[261.6255653006,275.48458755707,279.57748987366,290.07776015425,294.38747470873,309.98198497505,314.58741860623,326.40257913196,331.25197518754,348.79929894143,353.98144532328,367.27615246113,372.73281132023,392.47748849606,413.26809526256,419.40806105693,435.16003737285,441.62525396027,465.0193523796,471.92819182319,489.65270022124,496.92751979948,523.2511306012],"description":"Shruti/Mathieu's Magic Mode scale in 94-et (garibaldi) temperament"},"indian_rat":{"frequencies":[261.6255653006,269.55361273395,277.4816601673,285.40970760065,294.32876096318,302.93486508491,315.75499260417,327.03195662575,337.58137458142,348.83408706747,359.73515228832,370.63621750918,380.54627680087,392.4383479509,404.33041910093,416.22249025095,428.77523202043,441.49314144476,457.84473927605,473.41768959156,490.54793493862,506.37206187213,523.2511306012],"description":"Indian Raga, From Fortuna, after Helmholtz, ratios by JC"},"indian_rot":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,306.59245933664,327.03195662575,348.83408706747,392.4383479509,408.78994578219,418.60090448096,436.04260883433,490.54793493862,510.98743222773,523.2511306012],"description":"Rotated North Indian Gamut"},"ionic":{"frequencies":[261.6255653006,294.32876096318,327.03195662575,348.83408706747,392.4383479509,436.04260883433,470.92601754108,523.2511306012],"description":"Ancient greek Ionic"},"iran_diat":{"frequencies":[261.6255653006,297.21429859784,337.6441411202,347.13660997509,394.35734781054,448.00148789644,460.59652406882,523.2511306012],"description":"Iranian Diatonic from Dariush Anooshfar, Safi-a-ddin Armavi's scale from 125 ET"},"iraq":{"frequencies":[261.6255653006,290.3675288125,326.6631048533,348.83408706747,387.1561215731,435.55129321875,465.11211608996,516.20736538157,523.2511306012],"description":"Iraq 8-tone scale, Ellis"},"isfahan_5":{"frequencies":[261.6255653006,283.42769574232,305.22982618403,327.03195662575,348.83408706747,523.2511306012],"description":"Isfahan (IG #2, DF #8), from Rouanet"},"islamic":{"frequencies":[261.6255653006,283.42769574232,305.22982618403,330.6656450327,348.83408706747,523.2511306012],"description":"Islamic Genus (DF#7), from Rouanet"},"italian":{"frequencies":[261.6255653006,274.68983337859,292.34127285051,309.02606224197,326.6631048533,348.44038788768,366.66693712906,391.11111150212,411.56972129721,437.02884834934,464.06284405662,489.44164088633,523.2511306012],"description":"Italian organ temperament, G.C. Klop (1974), 1/12 P.comma, also d'Alembert/Rousseau (1752/67)"},"iter1":{"frequencies":[261.6255653006,264.43874342211,268.51044859798,278.54662176283,304.33994330886,376.91818729747,631.61998662719],"description":"McLaren style, IE= 2.414214, PD=5, SD=0"},"iter10":{"frequencies":[261.6255653006,277.06070189651,293.38358189778,297.59908052943,301.91391280887,310.68035879446,328.97472072452,338.5155215149,348.35227203008,368.89204707385,413.65123162392,438.0707139917,463.89070822207,520.1365405381,535.27989222422,550.79066379074,583.29634230953,654.0639132515],"description":"Iterated 5/2 Scale, IE=5/2, PD=4, SD=3"},"iter11":{"frequencies":[261.6255653006,278.87608544381,297.26403435806,306.90779184711,316.86440944623,337.75715313333,360.02747892105,383.76621672426,396.21625406084,409.07019206122,436.04260883433],"description":"Binary 5/3 Scale #2"},"iter12":{"frequencies":[261.6255653006,297.26403435806,306.90779184711,316.86440944623,337.75715313333,360.02747892105,383.76621672426,396.21625406084,409.07019206122,436.04260883433],"description":"Binary 5/3 Scale #4"},"iter13":{"frequencies":[261.6255653006,297.26403435806,337.75715313333,383.76621672426,409.07019206122,436.04260883433],"description":"Binary 5/3 Scale #6"},"iter14":{"frequencies":[261.6255653006,280.22072913446,300.13755324878,344.3186075731,368.79121945838,395.0032340925,453.14877154631,519.85349135637,596.37732215892,638.76512932755,684.16567043124,784.8766959018],"description":"Binary Divided 3/1 Scale #2"},"iter15":{"frequencies":[261.6255653006,285.30470202322,311.12698372208,324.90175210669,339.28638158975,369.99442271164,403.48177901006,440,459.48046426806,479.82340237272,523.2511306012],"description":"Binary Division Scale"},"iter16":{"frequencies":[261.6255653006,273.20871865617,285.30470202322,311.12698372208,324.90175210669,339.28638158975,369.99442271164,403.48177901006,440,459.48046426806,479.82340237272,523.2511306012],"description":"Binary Division Scale 4+2"},"iter17":{"frequencies":[261.6255653006,278.49896488475,296.46060526524,301.12918013362,305.87127435301,315.58067012184,335.93387506143,346.5975621448,357.59974896504,380.66295170881,431.34763334053,459.16716607109,488.78090454553,553.8613271114,571.44277158458,589.58231097183,627.60710380636,711.17202040031],"description":"Binary E Scale #2"},"iter18":{"frequencies":[261.6255653006,296.46060526524,335.93387506143,357.59974896504,380.66295170881,431.34763334053,488.78090454553,553.8613271114,589.58231097183,627.60710380636,711.17202040031],"description":"Binary E Scale #4"},"iter19":{"frequencies":[261.6255653006,322.51878830959,331.06584352035,339.83940187549,358.09020513941,397.58488163802,418.936859706,441.43552612833,490.12256936272,604.19836236377,670.83693141722,744.82523718317,918.18295398723,967.49323514067,1019.45167961503,1131.88958971281,1395.33634826987],"description":"Binary Kidjel Ratio scale #2, IE=16/3"},"iter2":{"frequencies":[261.6255653006,264.43874342211,268.51044859798,278.54662176283,304.33994330886,376.91818729747,466.76379263857,529.06503205232,631.63886479716],"description":"Iterated 1 + SQR(2) Scale, IE=2.414214, PD=5, SD=1"},"iter20":{"frequencies":[261.6255653006,269.61366892789,277.84567157694,295.07138236029,304.08067308856,313.36504071103,332.79286022776,353.42515415018,375.3365967665,386.79659161311,398.60648967463,423.31905787312],"description":"Binary PHI Scale #2"},"iter21":{"frequencies":[261.6255653006,265.58958666715,269.61366892789,277.84567157694,295.07138236029,304.08067308856,313.36504071103,332.79286022776,353.42515415018,375.3365967665,386.79659161311,398.60648967463,423.31905787312],"description":"Binary PHI Scale 5+2 #2"},"iter22":{"frequencies":[261.6255653006,301.8727519909,307.3207469799,312.86706369289,324.26179396336,348.311367392,360.99698978488,374.14462916403,401.89387036212,463.7192413329,498.11197631533,535.05552246568,617.36582527423,639.85050556571,663.15408964479,712.33833913185,821.92095613931],"description":"Binary PI Scale #2"},"iter23":{"frequencies":[261.6255653006,280.22072913446,282.63618845904,285.07246866924,290.00821285991,300.13755151512,305.33413252207,310.62068712289,321.46997343155,344.3186075731,356.34488692223,368.79121945838,395.00323181087,401.84231702948,408.7998141568,423.07827792492,453.14877154631],"description":"Binary SQR(3) Scale #2"},"iter24":{"frequencies":[261.6255653006,289.31157243481,292.97226416221,296.67927674571,304.23460945445,319.92739457651,328.07477344771,336.42963427227,353.78307729046,391.22147055517,411.40114203819,432.62170761687,478.4030399831,490.58621022536,503.07964402145,529.02909391167,585.01254970054],"description":"Binary SQR(5) Scale #2"},"iter25":{"frequencies":[261.6255653006,295.4600775297,299.98610231105,304.581459303,313.98443628203,333.67021037701,343.97120738708,354.59021667251,376.82183739983,425.55401329039,452.23482674104,480.58843796626,542.7401414615,559.49550492793,576.76813324226,612.92956630767,692.19618110881],"description":"Binary SQR(7) Scale #2"},"iter26":{"frequencies":[261.6255653006,266.56189672137,275.04226095704,276.16031892841,278.32506946872,283.8915708581,299.68019298069,302.93486508491,309.19384990071,326.13597866239,377.90359432309,389.87339142835,411.92110281371,477.08191319521,486.74523776856,503.12608711654,552.32063785682,711.29450566101],"description":"E Scale"},"iter27":{"frequencies":[261.6255653006,264.53251602616,264.59858308811,264.97973921471,266.91093025617,277.4816601673,277.93638607994,279.98525409362,291.05844139692,358.0999925052,361.3330282979,375.61956161015,462.09190754392,465.48964215821,480.4396744611,568.53247844169,1395.33634826987],"description":"Iterated Kidjel Ratio Scale, IE=16/3, PD=3, SD=3"},"iter28":{"frequencies":[261.6255653006,265.20947715403,272.47639519786,295.60291144354,377.3445653374,784.8766959018],"description":"McLaren 3-Division Scale"},"iter29":{"frequencies":[261.6255653006,264.46932144517,267.35459227799,273.20191774753,285.29018929764,311.12229387098,370.01329949656,523.2511306012],"description":"Iterated Binary Division of the Octave, IE=2, PD=6, SD=0"},"iter3":{"frequencies":[261.6255653006,291.72408166262,314.40967058055,328.65360269166,338.82655178274,356.71329642628,384.4758307461,404.77917650282,417.30358762823,426.15298265459,441.49314144476],"description":"Iterated 27/16 Scale, analog of Hexachord, IE=27/16, PD=3, SD=2"},"iter30":{"frequencies":[261.6255653006,263.40533105094,266.47048317654,274.97380842818,299.54231389489,377.98194879009,711.1793535636],"description":"Iterated E-scale, IE= 2.71828, PD=5, SD=0"},"iter31":{"frequencies":[261.6255653006,264.53251602616,277.4816601673,358.0999925052,1395.33634826987],"description":"Iterated Kidjel Ratio Scale, IE=16/3, PD=3, SD=0"},"iter32":{"frequencies":[261.6255653006,264.32273607689,265.98599138894,268.74462830198,273.21657135822,280.65287914064,293.09931751721,314.43072526953,352.25402909754,423.30428543018],"description":"Iterated PHI scale, IE= 1.61803339, PD=8, SD=0"},"iter33":{"frequencies":[261.6255653006,264.70351312767,271.46111286829,293.79264300149,376.62581378438,821.87425059077],"description":"Iterated PI Scale, IE= 3.14159, PD=4, SD=0"},"iter34":{"frequencies":[261.6255653006,263.41752122732,264.70351312767,267.00143308075,271.01725226011,278.10591587072,290.81088732616,314.21361862735,359.24704489038,453.1728541814],"description":"Iterated SQR3 Scale, IE= 1.73205, PD=8, SD=0"},"iter35":{"frequencies":[261.6255653006,263.32443260775,265.41724016003,270.17542037578,281.14986121856,307.30621955943,374.94109676838,585.0238335194],"description":"Iterated SQR 5 Scale, IE= 2.23607, PD=6, SD=0"},"iter36":{"frequencies":[261.6255653006,263.60757715894,266.85807660661,275.72514666411,300.63990398578,377.90359432309,692.2176415245],"description":"Iterated SQR 7 Scale, IE= 2.64575, PD=5, SD=0"},"iter37":{"frequencies":[261.6255653006,295.02271214403,313.28742377221,326.0879260201,332.68289475257,342.82647426905,364.05069339959,375.15068445646,382.73792346942,386.58911684499,392.4383479509],"description":"Iterated 3/2 scale, IE=3/2, PD=3, SD=2"},"iter4":{"frequencies":[261.6255653006,267.82522324611,277.41331493081,278.97828136646,281.37089098366,287.35922746131,302.93486508491,307.2300216374,313.76772341995,330.79094463294,377.42704502382,390.96854140427,412.14986314478,470.26367433779,480.2976795817,495.79659597089,536.59937372878,654.0639132515],"description":"Iterated 5/2 Scale, IE=5/2, PD=4, SD=3"},"iter5":{"frequencies":[261.6255653006,292.148547919,314.45380444784,328.62723446295,338.43307070995,355.46951807147,382.59222452561,401.8431885336,413.81298563886,422.03832066739,436.04260883433],"description":"Iterated 5/3 Scale, analog of Hexachord, IE=5/3, PD=3, SD=2"},"iter6":{"frequencies":[261.6255653006,276.4345595629,292.10621368514,326.13597866239,344.58001283494,364.1180547998,406.52587839016,453.84026633778,506.69255051888,535.41976154541,565.73733351326,631.63886479716],"description":"Iterated binary 1+SQR(2) scale, IE= 2.414214, G=2, PD=4, SD=2"},"iter7":{"frequencies":[261.6255653006,279.30296836145,298.19688088025,308.09852755794,318.34159693919,339.84351781315,362.8203594263,387.34174602946,400.24806631808,413.53718386224,441.49314144476],"description":"Iterated 27/16 Scale, analog of Hexachord, IE=27/16, PD=3, SD=2"},"iter8":{"frequencies":[261.6255653006,298.19688088025,308.09852755794,318.34159693919,339.84351781315,362.8203594263,387.34174602946,400.24806631808,413.53718386224,441.49314144476],"description":"Iterated 27/16 Scale, analog of Hexachord, IE=27/16, PD=2, SD=2"},"iter9":{"frequencies":[261.6255653006,298.19688088025,339.84351781315,387.34174602946,413.53718386224,441.49314144476],"description":"Iterated 27/16 Scale, analog of Hexachord, IE=27/16, PD=2, SD=12"},"ives":{"frequencies":[261.6255653006,302.26980244078,349.22823143301,375.37611551499,433.69180740168,501.06699929295,578.9091089468,622.25396744417],"description":"Charles Ives' stretched major scale, \"Scrapbook\" pp. 108-110"},"ives2a":{"frequencies":[261.6255653006,303.72829164664,352.60650301302,379.92060676531,441.0602510811,512.03893786214,594.44004134205,640.48740045057],"description":"Speculation by Joe Monzo for Ives' other stretched scale"},"ives2b":{"frequencies":[261.6255653006,300.81831683262,345.88232658126,370.885984045,426.44646246473,490.3301667422,563.78395315523,604.53960488156],"description":"Alt. speculation by Joe Monzo for Ives' other stretched scale"},"abell1":{"frequencies":[261.6255653006,273.68256372566,292.6487650037,305.95868600104,327.16162250699,342.04121835587,365.95599773772,391.31674786192,409.35055662695,437.71854962063,457.62637091093,489.33987776603,523.2511306012],"description":"Ross Abell's French Baroque Meantone 1, a'=520"},"abell2":{"frequencies":[261.6255653006,275.90473010106,294.68429813772,308.79945157961,330.00857764288,348.01999353916,369.14054089803,392.90218486657,412.67427966689,441.52756934418,463.21121723949,493.59810545034,523.2511306012],"description":"Ross Abell's French Baroque Meantone 2, a'=520"},"abell3":{"frequencies":[261.6255653006,275.90505521365,293.49576926806,308.08682543008,329.24698751194,350.03632176331,368.71497179837,392.44893164635,412.28324979826,440.25465969448,462.14293627657,492.7440237889,523.2511306012],"description":"Ross Abell's French Baroque Meantone 3, a' = 520"},"abell4":{"frequencies":[261.6255653006,274.95017225036,292.98704147282,308.2648062752,328.10786809908,346.01554587335,367.43868454848,391.54284657258,411.48414905414,438.47771564426,461.87534079415,491.0387427573,523.2511306012],"description":"Ross Abell's French Baroque Meantone 4, a'=520"},"abell5":{"frequencies":[261.6255653006,277.98432293805,295.87822452474,311.66659310186,331.15428443044,349.43001184052,371.27895029721,395.6350356808,416.26536455926,442.29334161825,466.70260620202,495.88429116026,523.2511306012],"description":"Ross Abell's French Baroque Meantone 5, a'=520"},"abell6":{"frequencies":[261.6255653006,277.02257024271,293.32570896007,311.66659310186,330.00857764288,349.43001184052,369.99442271164,391.76907592069,414.82519580403,440.76312290327,466.70260620202,494.16866184506,523.2511306012],"description":"Ross Abell's French Baroque Meantone 6, a'=520"},"abell7":{"frequencies":[261.6255653006,277.50302994288,294.34406205295,310.05056613125,328.86683469969,348.82502010853,369.99442271164,392.44854854484,416.26536455926,438.47771564426,465.08793784701,493.31307433255,523.2511306012],"description":"Ross Abell's French Baroque Meantone 7, a'=520"},"abell8":{"frequencies":[261.6255653006,277.82379926216,294.68429813772,311.48661940174,329.62755691287,350.03605285217,371.27895029721,392.44854854484,415.30469757995,441.01779121056,467.78216486233,494.45418731234,523.2511306012],"description":"Ross Abell's French Baroque Meantone 8, a'=520"},"abell9":{"frequencies":[261.6255653006,276.06414495892,293.32570896007,309.69258848748,330.19925313612,348.62358905703,369.14054089803,391.99543598175,412.67427966689,440,464.55095742407,493.88330125613,523.2511306012],"description":"Ross Abell's French Baroque Meantone 9, a'=520"},"ad-dik":{"frequencies":[261.6255653006,269.0348830679,275.62199471997,285.40970760065,294.32876096318,300.46061014991,310.07474405997,321.08592105074,327.03195662575,336.37572681506,348.83408706747,358.80077526939,367.49599295996,378.42269266694,392.4383479509,400.61414686654,413.43299207996,428.11456140098,441.49314144476,453.48431318771,470.92601754108,479.64686971777,490.54793493862,508.71637697339,523.2511306012],"description":"Amin Ad-Dik, d'Erlanger, vol 5, p.42"},"adjeng":{"frequencies":[261.6255653006,285.30470202322,305.78200836532,383.0422478503,417.71053321823,523.2511306012],"description":"Soeroepan adjeng"},"aeolic":{"frequencies":[261.6255653006,294.32876096318,310.07474405997,348.83408706747,392.4383479509,413.43299207996,465.11211608996,523.2511306012],"description":"Ancient Greek Aeolic, also tritriadic scale of the 54:64:81 triad"},"agricola":{"frequencies":[261.6255653006,275.93321340298,294.32876096318,310.42486507835,331.11985608357,348.83408706747,367.91095120397,392.4383479509,413.89982010446,441.49314144476,465.11211608996,496.67978412536,523.2511306012],"description":"Agricola's Monochord, Rudimenta musices (1539)"},"al-din":{"frequencies":[261.6255653006,275.62199471997,290.36720431405,294.32876096318,310.07474405997,326.6631048533,331.11985608357,348.83408706747,367.49599295996,387.15627241873,392.4383479509,413.43299207996,435.55080647107,441.49314144476,465.11211608996,489.99465727995,516.20836322497,523.2511306012,551.24398943995,580.73440862809,588.65752192635,620.14948811994,653.3262097066,688.27781763329,697.66817413493,734.99198591993,774.31254483746,784.8766959018,826.86598415992,871.10161294214,917.70375684439,930.22423217991,979.98931455991,1032.41672644994,1046.5022612024,1102.48797887989],"description":"Safi al-Din's complete lute tuning on 5 strings 4/3 apart"},"al-din_19":{"frequencies":[261.6255653006,275.62199471997,290.36720431405,294.32876096318,310.07474405997,326.6631048533,331.11985608357,344.13890881665,348.83408706747,367.49599295996,387.15627241873,392.4383479509,413.43299207996,435.55080647107,441.49314144476,458.8518784222,465.11211608996,489.99465727995,516.20836322497,523.2511306012],"description":"Arabic scale by Safi al-Din"},"al-farabi":{"frequencies":[261.6255653006,279.06726965397,299.00064605783,348.83408706747,392.4383479509,418.60090448096,448.50096908674,523.2511306012],"description":"Al-Farabi Syn Chrom"},"al-farabi_19":{"frequencies":[261.6255653006,275.62199471997,285.40970760065,294.32876096318,310.07474405997,326.6631048533,331.11985608357,336.87132687997,348.83408706747,367.49599295996,380.54627680087,392.4383479509,413.43299207996,435.55080647107,441.49314144476,455.28980211491,465.11211608996,489.99465727995,507.3950357345,523.2511306012],"description":"Arabic scale by Al Farabi"},"al-farabi_22":{"frequencies":[261.6255653006,275.62199471997,277.01530443593,285.40970760065,294.32876096318,310.07474405997,321.08592105074,326.6631048533,331.11985608357,348.83408706747,367.49599295996,369.35373924791,380.54627680087,392.4383479509,413.43299207996,428.11456140098,435.55080647107,441.49314144476,465.11211608996,489.99465727995,492.47165233054,507.3950357345,523.2511306012],"description":"Al-Farabi 22 note ud scale"},"al-farabi_9":{"frequencies":[261.6255653006,294.32876096318,321.08592105074,331.11985608357,348.83408706747,392.4383479509,428.11456140098,441.49314144476,465.11211608996,523.2511306012],"description":"Al-Farabi 9 note ud scale"},"al-farabi_blue":{"frequencies":[261.6255653006,294.32876096318,367.91095120397,380.81054504865,392.4383479509,490.54793493862,506.89953276991,523.2511306012],"description":"Another tuning from Al Farabi, c700 AD"},"al-farabi_chrom":{"frequencies":[261.6255653006,294.32876096318,353.19451315581,372.50983809402,392.4383479509,470.92601754108,497.08857407114,523.2511306012],"description":"Al Farabi's Chromatic c700 AD"},"al-farabi_chrom2":{"frequencies":[261.6255653006,279.06726965397,325.57848126297,348.83408706747,392.4383479509,418.60090448096,488.36772189445,523.2511306012],"description":"Al-Farabi's Chromatic permuted"},"al-farabi_diat":{"frequencies":[261.6255653006,299.00064605783,341.71502406609,348.83408706747,392.4383479509,448.50096908674,512.57253609913,523.2511306012],"description":"Al-Farabi's Diatonic"},"al-farabi_diat2":{"frequencies":[261.6255653006,290.69507255622,313.95067836072,348.83408706747,392.4383479509,436.04260883433,470.92601754108,523.2511306012],"description":"Old Phrygian, permuted form of Al-Farabi's reduplicated 10/9 diatonic genus, same as ptolemy_diat"},"al-farabi_div":{"frequencies":[261.6255653006,275.62199471997,277.01530443593,284.45195690401,288.32205155576,294.32876096318,310.07474405997,311.64221749042,321.08592105074,331.11985608357,348.83408706747],"description":"Al Farabi's 10 intervals for the division of the tetrachord"},"al-farabi_div2":{"frequencies":[261.6255653006,275.62199471997,277.01530443593,279.38237857051,284.45195690401,288.32205155576,294.32876096318,310.07474405997,311.64221749042,314.30517589183,321.08592105074,331.11985608357,348.83408706747],"description":"Al-Farabi's tetrachord division, incl. extra 2187/2048 & 19683/16384"},"al-farabi_divo":{"frequencies":[261.6255653006,275.62199471997,277.01530443593,284.45195690401,288.32205155576,294.32876096318,310.07474405997,311.64221749042,321.08592105074,331.11985608357,348.83408706747,367.49599295996,369.35373924791,379.26927587201,392.4383479509,413.43299207996,415.52295665389,426.67793535601,432.48307733364,441.49314144476,465.11211608996,467.46332623563,481.6288815761,496.67978412536,523.2511306012],"description":"Al Farabi's theoretical octave division with identical tetrachords, 10th c."},"al-farabi_dor":{"frequencies":[261.6255653006,282.55561052465,313.95067836072,348.83408706747,392.4383479509,423.83341578697,470.92601754108,523.2511306012],"description":"Dorian mode of Al-Farabi's 10/9 Diatonic"},"al-farabi_dor2":{"frequencies":[261.6255653006,267.07609791103,305.22982618403,348.83408706747,392.4383479509,400.61414686654,457.84473927605,523.2511306012],"description":"Dorian mode of Al-Farabi's Diatonic"},"al-farabi_g1":{"frequencies":[261.6255653006,294.32876096318,331.11985608357,367.91095120397,392.4383479509,441.49314144476,490.54793493862,523.2511306012],"description":"Al-Farabi's Greek genus conjunctum medium, Land"},"al-farabi_g10":{"frequencies":[261.6255653006,294.32876096318,343.38355445704,367.91095120397,392.4383479509,457.84473927605,490.54793493862,523.2511306012],"description":"Al-Farabi's Greek genus chromaticum forte"},"al-farabi_g11":{"frequencies":[261.6255653006,294.32876096318,353.19451315581,372.50983809402,392.4383479509,470.92601754108,496.67978412536,523.2511306012],"description":"Al-Farabi's Greek genus chromaticum mollissimum"},"al-farabi_g12":{"frequencies":[261.6255653006,294.32876096318,367.91095120397,380.17464957743,392.4383479509,490.54793493862,506.89953276991,523.2511306012],"description":"Al-Farabi's Greek genus mollissimum ordinantium"},"al-farabi_g3":{"frequencies":[261.6255653006,294.32876096318,336.37572681506,378.42269266694,392.4383479509,448.50096908674,504.56359022259,523.2511306012],"description":"Al-Farabi's Greek genus conjunctum primum"},"al-farabi_g4":{"frequencies":[261.6255653006,294.32876096318,336.37572681506,384.42940207435,392.4383479509,448.50096908674,512.57253609913,523.2511306012],"description":"Al-Farabi's Greek genus forte duplicatum primum"},"al-farabi_g5":{"frequencies":[261.6255653006,294.32876096318,327.03195662575,359.73515228832,392.4383479509,436.04260883433,479.64686971777,523.2511306012],"description":"Al-Farabi's Greek genus conjunctum tertium, or forte aequatum"},"al-farabi_g6":{"frequencies":[261.6255653006,294.32876096318,336.37572681506,373.75080757229,392.4383479509,448.50096908674,498.33441009638,523.2511306012],"description":"Al-Farabi's Greek genus forte disjunctum primum"},"al-farabi_g7":{"frequencies":[261.6255653006,294.32876096318,343.38355445704,374.60024122586,392.4383479509,457.84473927605,499.46698830115,523.2511306012],"description":"Al-Farabi's Greek genus non continuum acre"},"al-farabi_g8":{"frequencies":[261.6255653006,294.32876096318,353.19451315581,378.42269266694,392.4383479509,470.92601754108,504.56359022259,523.2511306012],"description":"Al-Farabi's Greek genus non continuum mediocre"},"al-farabi_g9":{"frequencies":[261.6255653006,294.32876096318,367.91095120397,383.71749577421,392.4383479509,490.54793493862,511.62332769895,523.2511306012],"description":"Al-Farabi's Greek genus non continuum laxum"},"al-hwarizmi":{"frequencies":[261.6255653006,294.32876096318,302.73815413355,311.64221749042,321.08592105074,331.11985608357,348.83408706747],"description":"Al-Hwarizmi's tetrachord division"},"al-kindi":{"frequencies":[261.6255653006,275.62199471997,279.38237857051,294.32876096318,310.07474405997,331.11985608357,348.83408706747],"description":"Al-Kindi's tetrachord division"},"al-kindi2":{"frequencies":[261.6255653006,275.62199471997,294.32876096318,310.07474405997,326.6631048533,331.11985608357,348.83408706747,367.49599295996,392.4383479509,413.43299207996,435.55080647107,441.49314144476,465.11211608996,489.99465727995,523.2511306012],"description":"Arabic mode by al-Kindi"},"al-mausili":{"frequencies":[261.6255653006,275.62199471997,294.32876096318,310.07474405997,331.11985608357,348.83408706747,367.49599295996,392.4383479509,413.43299207996,441.49314144476,465.11211608996,523.2511306012],"description":"Arabic mode by Ishaq al-Mausili, ? - 850 AD"},"albion":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,313.95067836072,327.03195662575,348.83408706747,372.08969287196,392.4383479509,418.60090448096,436.04260883433,465.11211608996,490.54793493862,523.2511306012],"description":"Terry Riley's Harp of New Albion scale, inverse Malcolm's Monochord, 1/1 on C#"},"alembert":{"frequencies":[261.6255653006,273.70610837433,292.50627485027,307.8325111191,327.03195662575,347.99121610009,365.92863081328,391.22147055517,409.45161370755,437.39890198442,462.86717295458,489.22460251523,523.2511306012],"description":"Jean-Le Rond d'Alembert modified meantone (1752)"},"alembert2":{"frequencies":[261.6255653006,274.99999938609,292.5775112526,309.28790118232,327.03195662575,348.53877105022,367.08095907728,391.31674786192,412.03444522126,437.50542525192,464.32494005553,489.99429388332,523.2511306012],"description":"d'Alembert (?)"},"alves":{"frequencies":[261.6255653006,267.07609791103,294.32876096318,305.22982618403,327.03195662575,336.37572681506,348.83408706747,359.73515228832,392.4383479509,425.14154361347,448.50096908674,457.84473927605,504.56359022259,523.2511306012],"description":"Bill Alves, tuning for \"Instantaneous Motion\", 1/1 vol. 6/3"},"alves_22":{"frequencies":[261.6255653006,269.80136421624,279.06726965397,287.78812183066,297.30177875068,305.22982618403,317.12189733406,327.03195662575,336.37572681506,348.83408706747,359.73515228832,370.01329949656,380.54627680087,392.4383479509,406.97310157871,418.60090448096,431.68218274599,448.50096908674,460.46099492906,475.68284600109,490.54793493862,507.3950357345,523.2511306012],"description":"11-limit rational interpretation of 22-tET, Bill Alves, tuning list 9-1-98"},"amity":{"frequencies":[261.6255653006,265.19165427121,275.22357733525,278.97501409741,282.77758484276,286.63198489776,290.53892403345,294.49911672845,305.63971046081,309.80573452349,314.02854360428,318.30891171173,322.64762154083,327.04547204619,339.41726037801,344.04368955469,348.73317930436,353.48658917459,358.304790429,371.85908609843,376.92771379174,382.0654272409,387.27317253358,392.55190203235,397.90258328792,412.95482206782,418.58360545772,424.28911201625,430.07238503487,435.93448947821,452.42543551278,458.59222335614,464.84306764133,471.17911410024,477.60152408164,484.11147196776,502.42490579041,509.27320879713,516.21486058423,523.2511306012],"description":"Amity temperament, g=339.508826, 5-limit"},"angklung":{"frequencies":[261.6255653006,294.70472480469,326.28010551578,372.13971319976,421.00655337609,533.77627782773,589.40944960937,672.10704388342,757.81210779894],"description":"Scale of an anklung set from Tasikmalaya. 1/1=174 Hz"},"appunn":{"frequencies":[261.6255653006,272.52663052146,275.93321340298,279.38237857051,287.10624449997,290.69507255622,294.32876096318,302.46583782713,306.24666079997,310.07474405997,322.99452506247,327.03195662575,331.11985608357,340.27406755552,344.52749339997,348.83408706747,363.36884069528,367.91095120397,372.50983809402,382.80832599996,387.59343007496,392.4383479509,408.78994578219,413.89982010446,419.07356785577,430.65936674996,436.04260883433,441.49314144476,453.6987567407,459.36999119996,465.11211608996,484.4917875937,490.54793493862,496.67978412536,510.41110133328,516.79124009995,523.2511306012],"description":"Probable tuning of A. Appunn's 36-tone harmonium w. 3 manuals 80/81 apart,1887"},"arabic":{"frequencies":[261.6255653006,275.62199471997,290.36720431405,294.32876096318,310.07474405997,326.6631048533,331.11985608357,348.83408706747,367.49599295996,387.15627241873,392.4383479509,413.43299207996,435.55080647107,441.49314144476,465.11211608996,489.99465727995,516.20836322497,523.2511306012],"description":"Arabic 17-tone Pythagorean mode, Safi al-Din"},"arabic_s":{"frequencies":[261.6255653006,275.62199471997,290.69507255622,294.32876096318,310.07474405997,327.03195662575,331.11985608357,348.83408706747,367.91095120397,387.59343007496,392.4383479509,413.43299207996,436.04260883433,441.49314144476,465.11211608996,490.54793493862,516.79124009995,523.2511306012],"description":"Schimatically altered Arabic 17-tone Pythagorean mode"},"arch_chrom":{"frequencies":[261.6255653006,271.31540105247,294.32876096318,348.83408706747,392.4383479509,406.97310157871,441.49314144476,523.2511306012],"description":"Archytas' Chromatic"},"arch_chromc2":{"frequencies":[261.6255653006,271.31540105247,294.32876096318,305.22982618403,331.11985608357,343.38355445704,348.83408706747,361.75386806997,392.4383479509,406.97310157871,422.04617941496,441.49314144476,457.84473927605,496.67978412536,523.2511306012],"description":"Product set of 2 of Archytas' Chromatic"},"arch_dor":{"frequencies":[261.6255653006,271.31540105247,294.32876096318,348.83408706747,392.4383479509,406.97310157871,465.11211608996,441.49314144476,523.2511306012],"description":"Dorian mode of Archytas' Chromatic with added 16/9"},"arch_enh":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,348.83408706747,392.4383479509,406.97310157871,418.60090448096,523.2511306012],"description":"Archytas' Enharmonic"},"arch_enh2":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,348.83408706747,392.4383479509,406.97310157871,465.11211608996,418.60090448096,523.2511306012],"description":"Archytas' Enharmonic with added 16/9"},"arch_enh3":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,336.37572681506,348.83408706747,358.80077526939,448.50096908674,523.2511306012],"description":"Complex 9 of p. 113 based on Archytas's Enharmonic"},"arch_enhp":{"frequencies":[261.6255653006,269.10058145205,279.06726965397,348.83408706747,392.4383479509,403.65087217807,418.60090448096,523.2511306012],"description":"Permutation of Archytas's Enharmonic with the 36/35 first"},"arch_enht":{"frequencies":[261.6255653006,269.10058145205,271.31540105247,279.06726965397,336.37572681506,348.83408706747,504.56359022259,523.2511306012],"description":"Complex 6 of p. 113 based on Archytas's Enharmonic"},"arch_enht2":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,327.03195662575,348.83408706747,490.54793493862,508.71637697339,523.2511306012],"description":"Complex 5 of p. 113 based on Archytas's Enharmonic"},"arch_enht3":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,281.36411960997,289.40309445597,348.83408706747,361.75386806997,523.2511306012],"description":"Complex 1 of p. 113 based on Archytas's Enharmonic"},"arch_enht4":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,327.03195662575,339.14425131559,348.83408706747,436.04260883433,523.2511306012],"description":"Complex 8 of p. 113 based on Archytas's Enharmonic"},"arch_enht5":{"frequencies":[261.6255653006,263.77886213435,271.31540105247,279.06726965397,339.14425131559,348.83408706747,508.71637697339,523.2511306012],"description":"Complex 10 of p. 113 based on Archytas's Enharmonic"},"arch_enht6":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,289.40309445597,297.67175429757,348.83408706747,372.08969287196,523.2511306012],"description":"Complex 2 of p. 113 based on Archytas's Enharmonic"},"arch_enht7":{"frequencies":[261.6255653006,269.10058145205,271.31540105247,279.06726965397,287.04062021552,348.83408706747,358.80077526939,523.2511306012],"description":"Complex 11 of p. 113 based on Archytas's Enharmonic"},"arch_mult":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,327.03195662575,336.37572681506,348.83408706747,361.75386806997,392.4383479509,406.97310157871,418.60090448096,490.54793493862,504.56359022259,523.2511306012],"description":"Multiple Archytas"},"arch_ptol":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,290.69507255622,310.07474405997,348.83408706747,361.75386806997,392.4383479509,406.97310157871,418.60090448096,436.04260883433,465.11211608996,523.2511306012],"description":"Archytas/Ptolemy Hybrid 1"},"arch_ptol2":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,294.32876096318,313.95067836072,348.83408706747,361.75386806997,392.4383479509,406.97310157871,418.60090448096,441.49314144476,470.92601754108,523.2511306012],"description":"Archytas/Ptolemy Hybrid 2"},"arch_sept":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,294.32876096318,310.07474405997,348.83408706747,361.75386806997,392.4383479509,406.97310157871,418.60090448096,441.49314144476,465.11211608996,523.2511306012],"description":"Archytas Septimal"},"ariel1":{"frequencies":[261.6255653006,282.55561052465,294.32876096318,313.95067836072,327.03195662575,348.83408706747,363.36884069528,392.4383479509,418.60090448096,436.04260883433,470.92601754108,490.54793493862,523.2511306012],"description":"Ariel 1"},"ariel2":{"frequencies":[261.6255653006,279.06726965397,290.69507255622,313.95067836072,327.03195662575,348.83408706747,363.36884069528,392.4383479509,418.60090448096,436.04260883433,470.92601754108,490.54793493862,523.2511306012],"description":"Ariel 2"},"ariel3":{"frequencies":[261.6255653006,279.06726965397,290.69507255622,310.07474405997,322.99452506247,348.83408706747,363.36884069528,392.4383479509,418.60090448096,436.04260883433,465.11211608996,484.4917875937,523.2511306012],"description":"Ariel's 12-tone JI scale"},"ariel_19":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,290.69507255622,302.80736724606,313.95067836072,327.03195662575,334.88072358477,348.83408706747,363.36884069528,376.74081403286,392.4383479509,408.78994578219,418.60090448096,436.04260883433,452.08897683944,470.92601754108,490.54793493862,502.32108537715,523.2511306012],"description":"Ariel 19-tone scale"},"ariel_31":{"frequencies":[261.6255653006,267.90457886781,272.52663052146,279.06726965397,283.88190679319,294.32876096318,301.39265122629,306.59245933664,313.95067836072,319.36714514233,327.03195662575,334.88072358477,340.65828815182,348.83408706747,357.20610515709,363.36884069528,376.74081403286,383.2405741708,392.4383479509,401.85686830172,408.78994578219,418.60090448096,428.6473261885,436.04260883433,446.50763144636,454.2110508691,465.11211608996,482.22824196207,490.54793493862,502.32108537715,510.98743222773,523.2511306012],"description":"Ariel's 31-tone system"},"arist_archenh":{"frequencies":[261.6255653006,271.89678302796,279.86396690685,349.22823143301,391.99543598175,407.38487419079,419.32216217931,523.2511306012],"description":"PsAristo Arch. Enharmonic, 4 + 3 + 23 parts, similar to Archytas' enharmonic"},"arist_chrom":{"frequencies":[261.6255653006,277.18263097687,329.62755691287,349.22823143301,391.99543598175,415.30469757995,493.88330125613,523.2511306012],"description":"Dorian, Neo-Chromatic,6+18+6 parts = Athanasopoulos' Byzant.liturg. 2nd chromatic"},"arist_chrom2":{"frequencies":[261.6255653006,282.57123920205,336.03572815422,349.22823143301,391.99543598175,423.37848741825,503.48470957687,523.2511306012],"description":"Dorian Mode, a 1:2 Chromatic, 8 + 18 + 4 parts"},"arist_chrom3":{"frequencies":[261.6255653006,279.86388595857,299.37253740865,349.22869576324,391.99491478937,419.32387668214,448.55625766774,523.2511306012],"description":"PsAristo 3 Chromatic, 7 + 7 + 16 parts"},"arist_chrom4":{"frequencies":[261.6255653006,275.85166538713,290.85115308106,349.22823143301,391.99543598175,413.31050241775,435.7843409791,523.2511306012],"description":"PsAristo Chromatic, 5.5 + 5.5 + 19 parts"},"arist_chromenh":{"frequencies":[261.6255653006,269.29177952703,293.66476791741,349.22823143301,391.99543598175,403.48177901006,440,523.2511306012],"description":"Aristoxenos' Chromatic/Enharmonic, 3 + 9 + 18 parts"},"arist_chrominv":{"frequencies":[261.6255653006,311.12698372208,329.62755691287,349.22823143301,391.99543598175,466.16376151809,493.88330125613,523.2511306012],"description":"Aristoxenos' Inverted Chromatic, Dorian mode, 18 + 6 + 6 parts"},"arist_chromrej":{"frequencies":[261.6255653006,277.18263097687,285.30470202322,349.22823143301,391.99543598175,415.30469757995,427.47405410759,523.2511306012],"description":"Aristoxenos Rejected Chromatic, 6 + 3 + 21 parts"},"arist_chromunm":{"frequencies":[261.6255653006,273.20871865617,282.57118533961,349.22823143301,391.99543598175,409.35055662695,423.37840671577,523.2511306012],"description":"Unmelodic Chromatic, genus of Aristoxenos, Dorian Mode, 4.5 + 3.5 + 22 parts"},"arist_diat":{"frequencies":[261.6255653006,293.66476791741,311.12698372208,349.22823143301,391.99543598175,440,466.16376151809,523.2511306012],"description":"Phrygian octave species on E, 12 + 6 + 12 parts"},"arist_diat2":{"frequencies":[261.6255653006,279.86396690685,311.12698372208,349.22823143301,391.99543598175,419.32216217931,466.16376151809,523.2511306012],"description":"PsAristo 2 Diatonic, 7 + 11 + 12 parts"},"arist_diat3":{"frequencies":[261.6255653006,286.68133251996,314.13668154225,349.22823143301,391.99543598175,429.53666932309,470.6732130613,523.2511306012],"description":"PsAristo Diat 3, 9.5 + 9.5 + 11 parts"},"arist_diat4":{"frequencies":[261.6255653006,282.57123920205,305.19382000629,349.22823143301,391.99543598175,423.37848741825,457.27406033445,523.2511306012],"description":"PsAristo Diatonic, 8 + 8 + 14 parts"},"arist_diatdor":{"frequencies":[261.6255653006,299.37379946195,305.19382000629,349.22823143301,391.99543598175,448.5538823653,457.27406033445,523.2511306012],"description":"PsAristo Redup. Diatonic, 14 + 2 + 14 parts"},"arist_diatinv":{"frequencies":[261.6255653006,293.66476791741,329.62755691287,349.22823143301,391.99543598175,440,493.88330125613,523.2511306012],"description":"Lydian octave species on E, major mode, 12 + 12 + 6 parts"},"arist_diatred":{"frequencies":[261.6255653006,299.37379946195,342.56848033562,349.22823143301,391.99543598175,448.5538823653,513.27277840175,523.2511306012],"description":"Aristo Redup. Diatonic, Dorian Mode, 14 + 14 + 2 parts"},"arist_diatred2":{"frequencies":[261.6255653006,271.89678302796,308.14612137864,349.22823143301,391.99543598175,407.38487419079,461.69751437372,523.2511306012],"description":"PsAristo 2 Redup. Diatonic 2, 4 + 13 + 13 parts"},"arist_diatred3":{"frequencies":[261.6255653006,282.57123920205,314.13668154225,349.22823143301,391.99543598175,423.37848741825,470.6732130613,523.2511306012],"description":"PsAristo 3 Redup. Diatonic, 8 + 11 + 11 parts"},"arist_enh":{"frequencies":[261.6255653006,269.29177952703,277.18263097687,349.22823143301,391.99543598175,403.48177901006,415.30469757995,523.2511306012],"description":"Aristoxenos' Enharmonion, Dorian mode"},"arist_enh2":{"frequencies":[261.6255653006,270.59109411209,279.86402025325,349.22823143301,391.99543598175,405.42855124795,419.32224210861,523.2511306012],"description":"PsAristo 2 Enharmonic, 3.5 + 3.5 + 23 parts"},"arist_enh3":{"frequencies":[261.6255653006,267.99870394401,274.52693220706,349.22823143301,391.99543598175,401.54435471309,411.32564531909,523.2511306012],"description":"PsAristo Enharmonic, 2.5 + 2.5 + 25 parts"},"arist_hemchrom":{"frequencies":[261.6255653006,273.20871865617,285.30470202322,349.22823143301,391.99543598175,409.35055662695,427.47405410759,523.2511306012],"description":"Aristoxenos's Chromatic Hemiolion, Dorian Mode"},"arist_hemchrom2":{"frequencies":[261.6255653006,273.20871865617,293.66476791741,349.22823143301,391.99543598175,409.35055662695,440,523.2511306012],"description":"PsAristo C/H Chromatic, 4.5 + 7.5 + 18 parts"},"arist_hemchrom3":{"frequencies":[261.6255653006,271.81876914348,282.83844897362,348.83408706747,392.4383479509,407.72815371522,424.25767346043,523.2511306012],"description":"Dorian mode of Aristoxenos' Hemiolic Chromatic according to Ptolemy's interpret"},"arist_hypenh2":{"frequencies":[261.6255653006,267.3544191957,273.20871865617,349.22823143301,391.99543598175,400.57901831518,409.35055662695,523.2511306012],"description":"PsAristo 2nd Hyperenharmonic, 37.5 + 37.5 + 425 cents"},"arist_hypenh3":{"frequencies":[261.6255653006,265.43099677612,269.29177952703,349.22823143301,391.99543598175,397.69714089209,403.48177901006,523.2511306012],"description":"PsAristo 3 Hyperenharmonic, 1.5 + 1.5 + 27 parts"},"arist_hypenh4":{"frequencies":[261.6255653006,266.71168334607,271.8968348557,349.22823143301,391.99543598175,399.61600264311,407.38495184466,523.2511306012],"description":"PsAristo 4 Hyperenharmonic, 2 + 2 + 26 parts"},"arist_hypenh5":{"frequencies":[261.6255653006,265.12453591719,268.67030163715,349.22823143301,391.99543598175,397.23796841836,402.55061428954,523.2511306012],"description":"PsAristo Hyperenharmonic, 23 + 23 + 454 cents"},"arist_intdiat":{"frequencies":[261.6255653006,275.39533189537,307.79478270659,348.83408706747,392.4383479509,413.09299784305,461.69217405988,523.2511306012],"description":"Dorian mode of Aristoxenos's Intense Diatonic according to Ptolemy"},"arist_penh2":{"frequencies":[261.6255653006,269.29177952703,339.28638158975,349.22823143301,391.99543598175,403.48177901006,508.3551866238,523.2511306012],"description":"Permuted Aristoxenos's Enharmonion, 3 + 24 + 3 parts"},"arist_penh3":{"frequencies":[261.6255653006,329.62755691287,339.28638158975,349.22823143301,391.99543598175,493.88330125613,508.3551866238,523.2511306012],"description":"Permuted Aristoxenos's Enharmonion, 24 + 3 + 3 parts"},"arist_pschrom2":{"frequencies":[261.6255653006,278.52001838539,296.50560089735,349.22823143301,391.99543598175,417.30851459865,444.25644015807,523.2511306012],"description":"PsAristo 2 Chromatic, 6.5 + 6.5 + 17 parts"},"arist_softchrom":{"frequencies":[261.6255653006,271.89678302796,282.57123920205,349.22823143301,391.99543598175,407.38487419079,423.37848741825,523.2511306012],"description":"Aristoxenos's Chromatic Malakon, Dorian Mode"},"arist_softchrom2":{"frequencies":[261.6255653006,277.18263097687,324.90175210669,349.22823143301,391.99543598175,415.30469757995,486.80259447109,523.2511306012],"description":"Aristoxenos' Soft Chromatic, 6 + 16.5 + 9.5 parts"},"arist_softchrom3":{"frequencies":[261.6255653006,281.2143451833,329.62755691287,349.22823143301,391.99543598175,421.34544350737,493.88330125613,523.2511306012],"description":"Aristoxenos's Chromatic Malakon, 9.5 + 16.5 + 6 parts"},"arist_softchrom4":{"frequencies":[261.6255653006,277.18263097687,297.93622032612,349.22823143301,391.99543598175,415.30469757995,446.39994737251,523.2511306012],"description":"PsAristo S. Chromatic, 6 + 7.5 + 16.5 parts"},"arist_softchrom5":{"frequencies":[261.6255653006,270.64713651786,280.31310567921,348.83408706747,392.4383479509,405.97070477679,420.46965851882,523.2511306012],"description":"Dorian mode of Aristoxenos' Soft Chromatic according to Ptolemy's interpretati"},"arist_softdiat":{"frequencies":[261.6255653006,277.18263097687,302.26980244078,349.22823143301,391.99543598175,415.30469757995,452.89298412314,523.2511306012],"description":"Aristoxenos's Diatonon Malakon, Dorian Mode"},"arist_softdiat2":{"frequencies":[261.6255653006,277.18263097687,320.24370022528,349.22823143301,391.99543598175,415.30469757995,479.82340237272,523.2511306012],"description":"Dorian Mode, 6 + 15 + 9 parts"},"arist_softdiat3":{"frequencies":[261.6255653006,285.30470202322,329.62755691287,349.22823143301,391.99543598175,427.47405410759,466.16376151809,523.2511306012],"description":"Dorian Mode, 9 + 15 + 6 parts"},"arist_softdiat4":{"frequencies":[261.6255653006,285.30470202322,302.26980244078,349.22823143301,391.99543598175,427.47405410759,452.89298412314,523.2511306012],"description":"Dorian Mode, 9 + 6 + 15 parts"},"arist_softdiat5":{"frequencies":[261.6255653006,302.26980244078,320.24370022528,349.22823143301,391.99543598175,452.89298412314,479.82340237272,523.2511306012],"description":"Dorian Mode, 15 + 6 + 9 parts"},"arist_softdiat6":{"frequencies":[261.6255653006,302.26980244078,329.62755691287,349.22823143301,391.99543598175,452.89298412314,493.88330125613,523.2511306012],"description":"Dorian Mode, 15 + 9 + 6 parts"},"arist_softdiat7":{"frequencies":[261.6255653006,275.39533189537,299.00064605783,348.83408706747,392.4383479509,413.09299784305,448.50096908674,523.2511306012],"description":"Dorian mode of Aristoxenos's Soft Diatonic according to Ptolemy"},"arist_synchrom":{"frequencies":[261.6255653006,277.18263097687,293.66476791741,349.22823143301,391.99543598175,415.30469757995,440,523.2511306012],"description":"Aristoxenos's Chromatic Syntonon, Dorian Mode"},"arist_syndiat":{"frequencies":[261.6255653006,277.18263097687,311.12698372208,349.22823143301,391.99543598175,415.30469757995,466.16376151809,523.2511306012],"description":"Aristoxenos's Diatonon Syntonon, Dorian Mode"},"arist_unchrom":{"frequencies":[261.6255653006,271.89678302796,293.66476791741,349.22823143301,391.99543598175,407.38487419079,440,523.2511306012],"description":"Aristoxenos's Unnamed Chromatic, Dorian Mode, 4 + 8 + 18 parts"},"arist_unchrom2":{"frequencies":[261.6255653006,282.57123920205,293.66476791741,349.22823143301,391.99543598175,423.37848741825,440,523.2511306012],"description":"Dorian Mode, a 1:2 Chromatic, 8 + 4 + 18 parts"},"arist_unchrom3":{"frequencies":[261.6255653006,311.12698372208,323.3415889232,349.22823143301,391.99543598175,466.16376151809,484.46499093218,523.2511306012],"description":"Dorian Mode, a 1:2 Chromatic, 18 + 4 + 8 parts"},"arist_unchrom4":{"frequencies":[261.6255653006,311.12698372208,336.03572815422,349.22823143301,391.99543598175,466.16376151809,503.48470957687,523.2511306012],"description":"Dorian Mode, a 1:2 Chromatic, 18 + 8 + 4 parts"},"arith13":{"frequencies":[261.6255653006,269.80136421624,294.32876096318,318.85615771011,327.03195662575,343.38355445704,367.91095120397,371.99885066179,392.4383479509,449.66894036041,457.84473927605,490.54793493862,523.2511306012],"description":"The first 13 terms of the arithmetic series, octave reduced"},"arith22":{"frequencies":[261.6255653006,269.80136421624,277.97716313189,294.32876096318,312.72430852337,318.85615771011,327.03195662575,343.38355445704,349.51540364377,367.91095120397,371.99885066179,388.35044849308,392.4383479509,429.2294430713,449.66894036041,457.84473927605,472.15238737843,490.54793493862,517.11928141447,523.2511306012],"description":"The first 22 terms of the arithmetic series, octave reduced"},"arnautoff_21":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,294.32876096318,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,361.75386806997,367.91095120397,372.08969287196,378.42269266694,392.4383479509,406.97310157871,418.60090448096,436.04260883433,448.50096908674,465.11211608996,490.54793493862,504.56359022259,523.2511306012],"description":"Philip Arnautoff, transposed Archytas enharmonic (2005), 1/1 vol 12/1"},"aron-neidhardt":{"frequencies":[261.6255653006,275.62199471997,292.53519855339,310.07474405997,327.04005607367,348.83408706747,367.49599295996,391.42133845759,413.43299207996,437.43855491017,465.11211608996,489.99465727995,523.2511306012],"description":"Aron-Neidhardt equal beating well temperament"},"art_nam":{"frequencies":[261.6255653006,287.78812183066,317.68818643644,324.77656382143,348.83408706747,353.19451315581,392.4383479509,431.68218274599,473.41768959156,523.2511306012],"description":"Artificial Nam System"},"artusi":{"frequencies":[261.6255653006,276.63528606528,292.50629850443,309.28767786778,327.03195662575,349.91920725962,369.99442271164,391.22137338448,413.66637442451,437.39882871549,462.49310482954,489.02679755603,523.2511306012],"description":"Lute tuning of Giovanni Maria Artusi (1603). 1/4-comma w. acc. 1/2-way naturals"},"astro":{"frequencies":[13.75,13.8316453704,13.91377553836,13.99639338254,14.07098381034,14.15453513289,14.23858257025,14.32312915102,14.40817767355,14.49373120103,14.57979273211,14.66636528323,14.75345188876,14.84105560105,14.92917949063,15.01782664621,15.10700017487,15.1875093157,15.27769039377,15.36840704189,15.45966226264,15.55145934276,15.64380149972,15.73669197012,15.83013400973,15.92413089371,16.01868591662,16.11380239262,16.20948365552,16.30573305894,16.39263055969,16.48996755631,16.58788242969,16.68637870643,16.78545983879,16.88512929958,16.98539058219,17.08624720077,17.18770269033,17.28976060687,17.39242452751,17.49569805061,17.59958489756,17.69337767194,17.7984382082,17.90412257766,18.01043448453,18.11737765504,18.22495583753,18.33317280261,18.44203234327,18.55153827502,18.66169443603,18.77250468726,18.88397302169,18.99610312873,19.09733831271,19.21073534981,19.32480572095,19.43955342429,19.55498248173,19.67109693902,19.78790086598,19.90539835657,20.02359352906,20.14249064253,20.26209363229,20.38240680608,20.50343438087,20.62518059864,20.73509756099,20.85821935885,20.98207223488,21.1066605301,21.23198861133,21.35806087129,21.4848817288,21.61245575376,21.74078716869,21.86988059568,21.99974055944,22.13037161156,22.26177833063,22.38041714879,22.51330859954,22.64698913914,22.78146345308,22.91673625467,23.0528122852,23.18969644807,23.32739327396,23.46590772227,23.60524464792,23.74540893465,23.88640549521,24.02823927151,24.15629202037,24.29972834105,24.44401636439,24.58916114767,24.73516777819,24.8820415172,25.02978722599,25.17841022592,25.32791572621,25.478308967,25.62959521956,25.78177978645,25.93486800174,26.07308167197,26.22789959273,26.38363679833,26.54029874734,26.69789108494,26.85641902723,27.01588828389,27.17630444429,27.33767313101,27.5],"description":"Astro temperament, g=132.194511, 5-limit"},"athan_chrom":{"frequencies":[261.6255653006,285.30470202322,329.62755691287,349.22823143301,391.99543598175,427.47405410759,493.88330125613,523.2511306012],"description":"Athanasopoulos's Byzantine Liturgical mode Chromatic"},"auftetf":{"frequencies":[261.6255653006,264.29521392612,269.80136421624,287.78812183066,359.73515228832,380.54627680087,384.42940207435,392.4383479509,418.60090448096],"description":"5/4 C.I. again"},"augmented":{"frequencies":[261.6255653006,312.71213182188,329.62755691287,393.99259743989,415.30469757995,496.39956701727,523.2511306012],"description":"Augmented temperament, g=91.2, oct=1/3, 5-limit"},"augteta":{"frequencies":[261.6255653006,280.76889934699,302.93486508491,328.90071066361,359.73515228832,380.54627680087,408.39112632289,440.63253103259,478.40103369253],"description":"Linear Division of the 11/8, duplicated on the 16/11"},"augteta2":{"frequencies":[261.6255653006,281.75060878526,305.22982618403,332.97799220076,366.27579142084,373.75080757229,402.50086969323,436.04260883433,475.68284600109],"description":"Linear Division of the 7/5, duplicated on the 10/7"},"augtetb":{"frequencies":[261.6255653006,270.8594087818,280.76889934699,302.93486508491,359.73515228832,380.54627680087,295.48299139832,408.39112632289,440.63253103259],"description":"Harmonic mean division of 11/8"},"augtetc":{"frequencies":[261.6255653006,280.31310567921,301.87565226992,327.03195662575,359.73515228832,380.54627680087,407.72815371522,439.09185784716,475.68284600109],"description":"11/10 C.I."},"augtetd":{"frequencies":[261.6255653006,271.68808704293,282.55561052465,294.32876096318,359.73515228832,380.54627680087,395.18267206244,410.98997894494,428.11456140098],"description":"11/9 C.I."},"augtete":{"frequencies":[261.6255653006,269.80136421624,278.50463402967,287.78812183066,359.73515228832,380.54627680087,392.4383479509,405.0976494977,418.60090448096],"description":"5/4 C.I."},"augtetg":{"frequencies":[261.6255653006,278.50463402967,297.71185016965,319.76457981184,359.73515228832,380.54627680087,405.0976494977,433.03541842858,465.11211608996],"description":"9/8 C.I."},"augteth":{"frequencies":[261.6255653006,278.50463402967,287.78812183066,319.76457981184,359.73515228832,380.54627680087,405.0976494977,418.60090448096,465.11211608996],"description":"9/8 C.I. A gapped version of this scale is called AugTetI"},"augtetj":{"frequencies":[261.6255653006,287.78812183066,319.76457981184,359.73515228832,380.54627680087,428.11456140098,475.68284600109],"description":"9/8 C.I. comprised of 11:10:9:8 subharmonic series on 1 and 8:9:10:11 on 16/11"},"augtetk":{"frequencies":[261.6255653006,294.32876096318,327.03195662575,359.73515228832,380.54627680087,418.60090448096,465.11211608996],"description":"9/8 C.I. This is the converse form of AugTetJ"},"augtetl":{"frequencies":[261.6255653006,294.32876096318,327.03195662575,359.73515228832,380.54627680087,428.11456140098,475.68284600109],"description":"9/8 C.I. This is the harmonic form of AugTetI"},"avg_bac":{"frequencies":[261.6255653006,290.69507255622,307.79478270659,348.83408706747,392.4383479509,436.04260883433,461.69217405988,523.2511306012],"description":"Average Bac System"},"avicenna":{"frequencies":[261.6255653006,290.69507255622,299.00064605783,348.83408706747,392.4383479509,436.04260883433,448.50096908674,523.2511306012],"description":"Soft diatonic of Avicenna (Ibn Sina)"},"avicenna_17":{"frequencies":[261.6255653006,278.99913799634,283.42769574232,294.32876096318,310.07474405997,318.85615771011,331.11985608357,348.83408706747,371.99885066179,377.90359432309,392.4383479509,413.43299207996,425.14154361347,441.49314144476,465.11211608996,495.99846754905,503.87145909745,523.2511306012],"description":"Tuning by Avicenna (Ibn Sina), Ahmed Mahmud Hifni, Cairo, 1977"},"avicenna_19":{"frequencies":[261.6255653006,275.62199471997,283.49690885483,294.32876096318,310.07474405997,326.6631048533,331.11985608357,348.83408706747,358.80077526939,372.50983809402,377.99587847311,392.4383479509,413.43299207996,425.24536328225,441.49314144476,465.11211608996,478.40103369253,496.67978412536,503.45611792634,523.2511306012],"description":"Arabic scale by Ibn Sina"},"avicenna_chrom":{"frequencies":[261.6255653006,269.10058145205,299.00064605783,348.83408706747,392.4383479509,403.65087217807,448.50096908674,523.2511306012],"description":"Dorian mode a chromatic genus of Avicenna"},"avicenna_chrom2":{"frequencies":[261.6255653006,271.8968348557,323.34165055711,349.22823143301,391.99543598175,407.38495184466,484.46508327871,523.2511306012],"description":"Dorian Mode, a 1:2 Chromatic, 4 + 18 + 8 parts"},"avicenna_chrom3":{"frequencies":[261.6255653006,290.69507255622,339.14425131559,348.83408706747,392.4383479509,436.04260883433,508.71637697339,523.2511306012],"description":"Avicenna's Chromatic permuted"},"avicenna_diat":{"frequencies":[261.6255653006,281.75060878526,305.22982618403,348.83408706747,392.4383479509,422.62591317789,457.84473927605,523.2511306012],"description":"Dorian mode a soft diatonic genus of Avicenna"},"avicenna_diff":{"frequencies":[261.6255653006,269.80136421624,286.15296204753,294.32876096318,310.68035879446,343.38355445704,367.91095120397,392.4383479509,400.61414686654,441.49314144476,457.84473927605,515.07533168556,523.2511306012],"description":"Difference tones of Avicenna's Soft diatonic reduced by 2/1"},"avicenna_enh":{"frequencies":[261.6255653006,268.33391312882,279.06726965397,348.83408706747,392.4383479509,402.50086969323,418.60090448096,523.2511306012],"description":"Dorian mode of Avicenna's (Ibn Sina) Enharmonic genus"},"awad":{"frequencies":[261.6255653006,268.33391312882,275.39533189537,282.83844897362,290.69507255622,299.00064605783,307.79478270659,317.12189733406,327.03195662575,337.58137458142,348.83408706747,358.80077526939,369.35373924791,380.54627680087,392.4383479509,402.50086969323,413.09299784305,424.25767346043,436.04260883433,448.50096908674,461.69217405988,475.68284600109,490.54793493862,506.37206187213,523.2511306012],"description":"d'Erlanger vol.5, p.37, after Mans.ur 'Awad"},"awraamoff":{"frequencies":[261.6255653006,294.32876096318,299.00064605783,313.95067836072,327.03195662575,343.38355445704,348.83408706747,392.4383479509,418.60090448096,448.50096908674,457.84473927605,490.54793493862,523.2511306012],"description":"Awraamoff Septimal Just"},"ayers":{"frequencies":[261.6255653006,268.89294211451,276.57559760349,284.71017400359,293.33775503401,302.50455987882,312.26277148781,322.67153053741,333.7981350387,345.71949700436,358.52392281934,372.31330446624,387.20583664489,403.33941317176,420.87590939662,440.00663255101,460.95932933915,484.00729580611,509.48136400643,537.78588422901,569.42034800719,605.00911975764,645.34306107481,691.43899400873,744.62660893248,806.67882634352,880.01326510202,968.01459161222,1075.57176845802,1210.01823951527,1382.87798801746,1613.35765268703,1936.02918322444,2420.03647903055,3226.71530537407,4840.0729580611,9680.1459161222],"description":"Lydia Ayers, algorithmic composition, subharmonics 1-37"},"ayers_19":{"frequencies":[261.6255653006,268.89294211451,276.57559760349,284.71017400359,293.33775503401,302.50455987882,312.26277148781,322.67153053741,333.7981350387,345.71949700436,358.52392281934,372.31330446624,387.20583664489,403.33941317176,420.87590939662,440.00663255101,460.95932933915,484.00729580611,509.48136400643,523.2511306012],"description":"Scale for NINETEEN, for 19 for the 90's CD. Repeats at 37/19 (or 2/1)"},"ayers_ap":{"frequencies":[261.6255653006,299.00064605783,336.37572681506,388.70083987518,448.50096908674,523.2511306012],"description":"Lydia Ayers' Appetizer, ICMC 96, Balinese Slendro from Singaraja,"},"ayers_me":{"frequencies":[261.6255653006,280.31310567921,299.00064605783,308.34441624714,336.37572681506,392.4383479509,420.46965851882,448.50096908674,504.56359022259,523.2511306012],"description":"Scale for Merapi (1996), Lydia Ayers. Slendro 0 2 4 5 7 9, Pelog 0 1 3 6 8 9"},"h10_27":{"frequencies":[261.6255653006,281.00523680435,300.3849083081,319.76457981184,348.83408706747,368.21375857121,397.28326582684,426.35277308246,455.42228033808,484.4917875937,523.2511306012],"description":"10-tET harmonic approximation, fundamental=27"},"h12_24":{"frequencies":[261.6255653006,272.52663052146,294.32876096318,316.13089140489,327.03195662575,348.83408706747,370.63621750918,392.4383479509,414.24047839262,436.04260883433,468.74580449691,490.54793493862,523.2511306012],"description":"12-tET harmonic approximation, fundamental=24"},"h14_27":{"frequencies":[261.6255653006,271.31540105247,290.69507255622,300.3849083081,319.76457981184,339.14425131559,348.83408706747,368.21375857121,387.59343007496,406.97310157871,426.35277308246,455.42228033808,474.80195184183,494.18162334558,523.2511306012],"description":"14-tET harmonic approximation, fundamental=27"},"h15_24":{"frequencies":[261.6255653006,272.52663052146,283.42769574232,305.22982618403,316.13089140489,327.03195662575,348.83408706747,359.73515228832,381.53728273004,392.4383479509,414.24047839262,436.04260883433,457.84473927605,479.64686971777,501.44900015948,523.2511306012],"description":"15-tET harmonic approximation, fundamental=24"},"hahn9":{"frequencies":[261.6255653006,286.15296204753,313.95067836072,327.03195662575,366.27579142084,392.4383479509,418.60090448096,457.84473927605,490.54793493862,523.2511306012],"description":"Paul Hahn's just version of 9 out of 31 scale. TL 6-8-'98"},"hahn_7":{"frequencies":[261.6255653006,274.70684356563,305.22982618403,313.95067836072,327.03195662575,348.83408706747,366.27579142084,392.4383479509,418.60090448096,436.04260883433,457.84473927605,488.36772189445,523.2511306012],"description":"Paul Hahn's scale with 32 consonant 7-limit dyads. TL '99, see also smithgw_hahn12"},"hahn_g":{"frequencies":[261.6255653006,280.50183143454,294.66523452594,309.54379154736,331.87735433448,348.63486612079,373.78884718875,392.66259958718,420.99317852788,442.25042328711,464.58101193362,498.10049926644,523.2511306012],"description":"fourth of sqrt(2)-1 octave \"recursive\" meantone, Paul Hahn"},"hahnmaxr":{"frequencies":[261.6255653006,275.93321340298,306.59245933664,313.95067836072,327.03195662575,348.83408706747,367.91095120397,392.4383479509,418.60090448096,436.04260883433,459.88868900496,490.54793493862,523.2511306012],"description":"Paul Hahn's hahn_7 marvel projected to the 5-limit"},"halfefg357777":{"frequencies":[261.6255653006,280.31310567921,299.00064605783,320.35783506196,341.71502406609,375.57576268738,400.61414686654,429.2294430713,457.84473927605,490.54793493862,523.2511306012],"description":"Half genus [357777]"},"hamilton":{"frequencies":[261.6255653006,274.08392555301,287.78812183066,302.93486508491,319.76457981184,338.57426097725,359.73515228832,383.71749577421,411.12588832951,426.35277308246,442.75095666255,479.64686971777,523.2511306012],"description":"Elsie Hamilton's gamut, from article The Modes of Ancient Greek Music (1953)"},"hamilton_jc":{"frequencies":[261.6255653006,274.08392555301,287.78812183066,302.93486508491,319.76457981184,359.73515228832,338.57426097725,411.12588832951,383.71749577421,442.75095666255,426.35277308246,479.64686971777,523.2511306012],"description":"Chalmers' permutation of Hamilton's gamut. Diatonic notes on white"},"hamilton_jc2":{"frequencies":[261.6255653006,274.08392555301,287.78812183066,302.93486508491,319.76457981184,359.73515228832,383.71749577421,411.12588832951,426.35277308246,442.75095666255,460.46099492906,479.64686971777,523.2511306012],"description":"EH gamut, diatonic notes on white and drops 17 for 25. JC Dorian Harmonia on C"},"hammond":{"frequencies":[261.6255653006,226.52945288223,240.12209418,254.35818848669,269.43528366778,285.40970760065,302.50455987882,320.49131749323,339.40613876835,359.73515228832,381.06332337261,403.65087217807,427.65717404906,453.05890576445],"description":"Hammond organ pitch wheel ratios, 1/1=320 Hz. Do \"del 0\" to get 12-tone scale"},"hammond12":{"frequencies":[261.6255653006,277.32410877127,293.76579515365,311.17877832054,329.62811300357,349.37146352202,370.1449018936,391.99018843668,415.46876743159,440.10130305006,466.18833124791,493.91391932426,523.2511306012],"description":"Hammond organ scale, 1/1=277.0731707 Hz, A=440, see hammond for the ratios"},"handblue":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,305.22982618403,327.03195662575,348.83408706747,366.27579142084,392.4383479509,406.97310157871,436.04260883433,457.84473927605,490.54793493862,523.2511306012],"description":"\"Handy Blues\" of Pitch Palette, 7-limit"},"handel":{"frequencies":[261.6255653006,276.07055536165,292.89641271707,310.57937447136,328.79480940231,349.02322090701,368.4933346061,391.37619916626,414.10583283548,438.86859125239,465.61660972366,492.3908742288,523.2511306012],"description":"Well temperament according to Georg Friedrich H�ndel's rules (c. 1780)"},"hanson_19":{"frequencies":[261.6255653006,272.52663052146,282.55561052465,294.32876096318,302.80736724606,313.95067836072,327.03195662575,340.65828815182,348.83408706747,363.36884069528,376.74081403286,392.4383479509,408.78994578219,418.60090448096,436.04260883433,454.2110508691,470.92601754108,490.54793493862,502.32108537715,523.2511306012],"description":"JI version of Hanson's 19 out of 53-tET scale"},"harm-doreninv1":{"frequencies":[261.6255653006,321.08592105074,327.03195662575,332.97799220076,380.54627680087,499.46698830115,511.35905945117,523.2511306012],"description":"1st Inverted Schlesinger's Enharmonic Dorian Harmonia"},"harm-dorinv1":{"frequencies":[261.6255653006,309.19384990071,321.08592105074,332.97799220076,380.54627680087,475.68284600109,499.46698830115,523.2511306012],"description":"1st Inverted Schlesinger's Chromatic Dorian Harmonia"},"harm-lydchrinv1":{"frequencies":[261.6255653006,322.00069575458,342.12573923925,362.25078272391,402.50086969323,483.00104363188,503.12608711654,523.2511306012],"description":"1st Inverted Schlesinger's Chromatic Lydian Harmonia"},"harm-lydeninv1":{"frequencies":[261.6255653006,342.12573923925,352.18826098158,362.25078272391,402.50086969323,503.12608711654,513.18860885887,523.2511306012],"description":"1st Inverted Schlesinger's Enharmonic Lydian Harmonia"},"harm-mixochrinv1":{"frequencies":[261.6255653006,336.37572681506,355.06326719367,373.75080757229,411.12588832951,485.87604984397,504.56359022259,523.2511306012],"description":"1st Inverted Schlesinger's Chromatic Mixolydian Harmonia"},"harm-mixoeninv1":{"frequencies":[261.6255653006,355.06326719367,364.40703738298,373.75080757229,411.12588832951,504.56359022259,513.90736041189,523.2511306012],"description":"1st Inverted Schlesinger's Enharmonic Mixolydian Harmonia"},"harm10":{"frequencies":[261.6255653006,286.15296204753,294.32876096318,327.03195662575,331.11985608357,343.38355445704,367.91095120397,392.4383479509,400.61414686654,408.78994578219,441.49314144476,457.84473927605,515.07533168556,523.2511306012],"description":"6/7/8/9/10 harmonics"},"harm11s":{"frequencies":[261.6255653006,65.40639132515,95.13656920022,104.65022612024,116.27802902249,130.8127826503,149.50032302891,174.41704353373,196.21917397545,209.30045224048,261.6255653006,327.03195662575,348.83408706747,392.4383479509,457.84473927605,523.2511306012,588.65752192635,654.0639132515,719.47030457665,1046.5022612024],"description":"Harm. 1/4-11/4 and subh. 4/1-4/11. Joseph Pehrson 1999"},"harm12s":{"frequencies":[261.6255653006,294.32876096318,299.00064605783,327.03195662575,348.83408706747,359.73515228832,380.54627680087,392.4383479509,418.60090448096,457.84473927605,465.11211608996,523.2511306012],"description":"Harmonics 1 to 12 and subharmonics mixed"},"harm15-30":{"frequencies":[261.6255653006,279.06726965397,296.50897400735,313.95067836072,331.39238271409,348.83408706747,366.27579142084,383.71749577421,418.60090448096,436.04260883433,453.48431318771,488.36772189445,523.2511306012],"description":"Harmonics 15 to 30"},"harm15":{"frequencies":[261.6255653006,277.97716313189,294.32876096318,310.68035879446,327.03195662575,343.38355445704,359.73515228832,376.08675011961,392.4383479509,408.78994578219,425.14154361347,441.49314144476,457.84473927605,474.19633710734,490.54793493862,506.89953276991],"description":"Fifth octave of the harmonic overtone series"},"harm16-32":{"frequencies":[261.6255653006,277.97716313189,294.32876096318,310.68035879446,327.03195662575,343.38355445704,359.73515228832,376.08675011961,392.4383479509,408.78994578219,425.14154361347,441.49314144476,457.84473927605,474.19633710734,490.54793493862,506.89953276991,523.2511306012],"description":"Harmonics 16-32 & Tom Stone's Guitar Scale"},"harm16":{"frequencies":[261.6255653006,523.2511306012,784.8766959018,1046.5022612024,1308.127826503,1569.7533918036,1831.3789571042,2093.0045224048,2354.6300877054,2616.255653006,2877.8812183066,3139.5067836072,3401.1323489078,3662.7579142084,3924.383479509,4186.0090448096,2093.0045224048,1395.33634826987,1046.5022612024,837.20180896192,697.66817413493,598.00129211566,523.2511306012,465.11211608996,418.60090448096,380.54627680087,348.83408706747,322.00069575458,299.00064605783,279.06726965397,261.6255653006],"description":"First 16 harmonics and subharmonics"},"harm1c-dorian":{"frequencies":[261.6255653006,309.19384990071,321.08592105074,332.97799220076,380.54627680087,475.68284600109,499.46698830115,523.2511306012],"description":"Harm1C-Dorian"},"harm1c-hypod":{"frequencies":[261.6255653006,327.03195662575,343.38355445704,359.73515228832,376.08675011961,392.4383479509,457.84473927605,490.54793493862,523.2511306012],"description":"HarmC-Hypodorian"},"harm1c-hypol":{"frequencies":[261.6255653006,274.70684356563,287.78812183066,340.11323489078,366.27579142084,392.4383479509,418.60090448096,444.76346101102,523.2511306012],"description":"HarmC-Hypolydian"},"harm1c-lydian":{"frequencies":[261.6255653006,271.68808704293,281.75060878526,362.25078272391,382.37582620857,402.50086969323,422.62591317789,442.75095666255,523.2511306012],"description":"Harm1C-Lydian"},"harm1c-mix":{"frequencies":[261.6255653006,299.00064605783,373.75080757229,392.4383479509,411.12588832951,485.87604984397,504.56359022259,523.2511306012],"description":"Harm1C-Con Mixolydian"},"harm1c-mixolydian":{"frequencies":[261.6255653006,280.31310567921,299.00064605783,373.75080757229,411.12588832951,429.81342870813,448.50096908674,523.2511306012],"description":"Harm1C-Mixolydian"},"harm24":{"frequencies":[261.6255653006,283.42769574232,305.22982618403,327.03195662575,348.83408706747,370.63621750918,392.4383479509,414.24047839262,436.04260883433,457.84473927605,479.64686971777,501.44900015948,523.2511306012],"description":"Harmonics 12 to 24"},"harm24_2":{"frequencies":[261.6255653006,277.97716313189,294.32876096318,310.68035879446,327.03195662575,343.38355445704,359.73515228832,376.08675011961,392.4383479509,425.14154361347,457.84473927605,490.54793493862,523.2511306012],"description":"Harmonics 12 to 24, mode 9"},"harm3":{"frequencies":[261.6255653006,327.03195662575,392.4383479509,457.84473927605],"description":"Third octave of the harmonic overtone series"},"harm30-60":{"frequencies":[261.6255653006,270.34641747729,279.06726965397,287.78812183066,296.50897400735,305.22982618403,313.95067836072,322.67153053741,331.39238271409,340.11323489078,348.83408706747,357.55493924415,366.27579142084,374.99664359753,383.71749577421,392.4383479509,401.15920012759,409.88005230427,418.60090448096,427.32175665765,436.04260883433,444.76346101102,453.48431318771,462.20516536439,470.92601754108,479.64686971777,488.36772189445,497.08857407114,505.80942624783,514.53027842451,523.2511306012],"description":"Harmonics 30-60"},"harm30":{"frequencies":[261.6255653006,279.06726965397,288.69027895239,299.00064605783,310.07474405997,322.00069575458,334.88072358477,348.83408706747,364.00078650518,398.6675280771,418.60090448096,440.63253103259,465.11211608996,492.47165233054,523.2511306012,558.13453930795,598.00129211566,644.00139150917,697.66817413493,761.09255360175,837.20180896192,930.22423217991,1046.5022612024,1196.00258423131,1395.33634826987,1674.40361792384,2093.0045224048,2790.67269653973,4186.0090448096,8372.0180896192,8633.6436549198,8895.2692202204,9156.894785521,9418.5203508216,9680.1459161222,9941.7714814228,10203.3970467234,10465.022612024,10726.6481773246,10988.2737426252,11249.8993079258,11511.5248732264,11773.150438527,12034.7760038276,12296.4015691282,12558.0271344288,12819.6526997294,13081.27826503,13342.9038303306,13604.5293956312,13866.1549609318,14127.7805262324,14389.406091533,14651.0316568336,14912.6572221342,15174.2827874348,15435.9083527354,15697.533918036,15959.1594833366,16220.7850486372],"description":"First 30 harmonics and subharmonics"},"harm32-64":{"frequencies":[261.6255653006,269.80136421624,277.97716313189,286.15296204753,294.32876096318,302.50455987882,310.68035879446,318.85615771011,327.03195662575,335.20775554139,343.38355445704,351.55935337268,359.73515228832,367.91095120397,376.08675011961,384.26254903526,392.4383479509,400.61414686654,408.78994578219,416.96574469783,425.14154361347,433.31734252912,441.49314144476,449.66894036041,457.84473927605,466.02053819169,474.19633710734,482.37213602298,490.54793493862,498.72373385427,506.89953276991,515.07533168556,523.2511306012],"description":"Harmonics 32-64"},"harm37odd":{"frequencies":[261.6255653006,269.80136421624,277.97716313189,286.15296204753,294.32876096318,302.50455987882,310.68035879446,327.03195662575,343.38355445704,359.73515228832,376.08675011961,392.4383479509,408.78994578219,425.14154361347,441.49314144476,457.84473927605,474.19633710734,490.54793493862,506.89953276991,523.2511306012],"description":"Odd harmonics until 37"},"harm4":{"frequencies":[261.6255653006,294.32876096318,327.03195662575,359.73515228832,392.4383479509,425.14154361347,457.84473927605,490.54793493862],"description":"Fourth octave of the harmonic overtone series"},"harm6-12":{"frequencies":[261.6255653006,269.80136421624,286.15296204753,294.32876096318,314.76825825228,327.03195662575,331.11985608357,343.38355445704,359.73515228832,367.91095120397,392.4383479509,400.61414686654,404.70204632437,408.78994578219,441.49314144476,449.66894036041,457.84473927605,490.54793493862,494.63583439645,515.07533168556,523.2511306012],"description":"First 12 harmonics of 6th through 12th harmonics"},"harm6":{"frequencies":[261.6255653006,294.32876096318,327.03195662575,359.73515228832,392.4383479509,457.84473927605,523.2511306012],"description":"Harmonics 6-12"},"harm60-30":{"frequencies":[261.6255653006,280.31310567921,290.69507255622,313.95067836072,327.03195662575,348.83408706747,373.75080757229,392.4383479509,413.09299784305,436.04260883433,448.50096908674,490.54793493862,523.2511306012],"description":"Harmonics 60 to 30 (Perkis)"},"harm7lim":{"frequencies":[261.6255653006,523.2511306012,784.8766959018,1046.5022612024,1308.127826503,1569.7533918036,1831.3789571042,2093.0045224048,2354.6300877054,2616.255653006,3139.5067836072,3662.7579142084,3924.383479509,4186.0090448096,4709.2601754108,5232.511306012,5494.1368713126,5755.7624366132,6279.0135672144,6540.639132515,7325.5158284168,7848.766959018,8372.0180896192,9156.894785521,9418.5203508216,10465.022612024,10988.2737426252,11773.150438527,12558.0271344288,12819.6526997294,13081.27826503,14651.0316568336,15697.533918036,16482.4106139378,16744.0361792384,18313.789571042,18837.0407016432,19621.917397545,20930.045224048,21191.6707893486,21976.5474852504,23546.300877054,25116.0542688576,25639.3053994588,26162.55653006,27470.684356563,29302.0633136672,31395.067836072],"description":"7-limit harmonics"},"harm8":{"frequencies":[261.6255653006,294.32876096318,327.03195662575,359.73515228832,392.4383479509,425.14154361347,457.84473927605,490.54793493862,523.2511306012],"description":"Harmonics 8-16"},"harm9":{"frequencies":[261.6255653006,294.32876096318,305.22982618403,327.03195662575,348.83408706747,356.10146388137,392.4383479509,406.97310157871,457.84473927605,465.11211608996,523.2511306012],"description":"6/7/8/9 harmonics, First 9 overtones of 5th through 9th harmonics"},"harm_bastard":{"frequencies":[261.6255653006,299.00064605783,322.00069575458,348.83408706747,380.54627680087,418.60090448096,465.11211608996,523.2511306012],"description":"Schlesinger's \"Bastard\" Hypodorian Harmonia & inverse 1)7 from 1.3.5.7.9.11.13"},"harm_bastinv":{"frequencies":[261.6255653006,294.32876096318,327.03195662575,359.73515228832,392.4383479509,425.14154361347,457.84473927605,523.2511306012],"description":"Inverse Schlesinger's \"Bastard\" Hypodorian Harmonia & 1)7 from 1.3.5.7.9.11.13"},"harm_darreg":{"frequencies":[261.6255653006,1046.5022612024,1308.127826503,1569.7533918036,1831.3789571042,2093.0045224048,2354.6300877054,2616.255653006,2877.8812183066,3139.5067836072,3401.1323489078,3662.7579142084,3924.383479509,4186.0090448096,5232.511306012,6279.0135672144,7325.5158284168,8372.0180896192,9418.5203508216,10465.022612024,11511.5248732264,12558.0271344288,13604.5293956312,14651.0316568336,15697.533918036],"description":"Darreg Harmonics 4-15"},"harm_mean":{"frequencies":[261.6255653006,270.06509966514,279.06726965397,299.00064605783,348.83408706747,392.4383479509,405.0976494977,418.60090448096,448.50096908674,523.2511306012],"description":"Harm. Mean 9-tonic 8/7 is HM of 1/1 and 4/3, etc."},"harmc-hypop":{"frequencies":[261.6255653006,319.76457981184,334.29933343966,348.83408706747,363.36884069528,377.90359432309,406.97310157871,465.11211608996,494.18162334558,523.2511306012],"description":"HarmC-Hypophrygian"},"harmd-15":{"frequencies":[261.6255653006,279.06726965397,313.95067836072,348.83408706747,383.71749577421,418.60090448096,453.48431318771,523.2511306012],"description":"HarmD-15-Harmonia"},"harmd-conmix":{"frequencies":[261.6255653006,299.00064605783,336.37572681506,392.4383479509,411.12588832951,448.50096908674,485.87604984397,523.2511306012],"description":"HarmD-ConMixolydian"},"harmd-hypod":{"frequencies":[261.6255653006,294.32876096318,327.03195662575,359.73515228832,376.08675011961,392.4383479509,425.14154361347,457.84473927605,490.54793493862,523.2511306012],"description":"HarmD-Hypodorian"},"harmd-hypol":{"frequencies":[261.6255653006,287.78812183066,313.95067836072,340.11323489078,366.27579142084,392.4383479509,418.60090448096,470.92601754108,523.2511306012],"description":"HarmD-Hypolydian"},"harmd-hypop":{"frequencies":[261.6255653006,290.69507255622,319.76457981184,348.83408706747,363.36884069528,377.90359432309,406.97310157871,436.04260883433,465.11211608996,523.2511306012],"description":"HarmD-Hypophrygian"},"harmd-lyd":{"frequencies":[261.6255653006,281.75060878526,301.87565226992,322.00069575458,362.25078272391,382.37582620857,402.50086969323,442.75095666255,483.00104363188,523.2511306012],"description":"HarmD-Lydian"},"harmd-mix":{"frequencies":[261.6255653006,299.00064605783,336.37572681506,373.75080757229,411.12588832951,448.50096908674,485.87604984397,523.2511306012],"description":"HarmD-Mixolydian. Harmonics 7-14"},"harmd-phr":{"frequencies":[261.6255653006,272.52663052146,283.42769574232,294.32876096318,305.22982618403,348.83408706747,327.03195662575,392.4383479509,414.24047839262,436.04260883433,457.84473927605,479.64686971777,523.2511306012],"description":"HarmD-Phryg (with 5 extra tones)"},"harme-hypod":{"frequencies":[261.6255653006,343.38355445704,351.55935337268,359.73515228832,376.08675011961,392.4383479509,490.54793493862,506.89953276991,523.2511306012],"description":"HarmE-Hypodorian"},"harme-hypol":{"frequencies":[261.6255653006,281.24748269815,274.70684356563,340.11323489078,366.27579142084,392.4383479509,405.51962621593,418.60090448096,523.2511306012],"description":"HarmE-Hypolydian"},"harme-hypop":{"frequencies":[261.6255653006,334.29933343966,341.56671025356,348.83408706747,363.36884069528,377.90359432309,406.97310157871,494.18162334558,508.71637697339,523.2511306012],"description":"HarmE-Hypophrygian"},"harmjc-15":{"frequencies":[261.6255653006,280.31310567921,301.87565226992,313.95067836072,327.03195662575,356.76213450082,373.75080757229,392.4383479509,413.09299784305,436.04260883433,461.69217405988,490.54793493862,523.2511306012],"description":"Rationalized JC Sub-15 Harmonia on C. MD=15, No planetary assignment."},"harmjc-17-2":{"frequencies":[261.6255653006,277.97716313189,296.50897400735,317.68818643644,342.12573923925,370.63621750918,386.75083566176,404.33041910093,423.58424858192,444.76346101102,468.17206422213,494.18162334558,523.2511306012],"description":"Rationalized JC Sub-17 Harmonia on C. MD=17, No planetary assignment."},"harmjc-17":{"frequencies":[261.6255653006,269.55361273395,277.97716313189,296.50897400735,317.68818643644,342.12573923925,355.81076880882,370.63621750918,386.75083566176,404.33041910093,423.58424858192,444.76346101102,523.2511306012],"description":"Rationalized JC Sub-17 Harmonia on C. MD=17, No planetary assignment."},"harmjc-19-2":{"frequencies":[261.6255653006,276.16031892841,292.40504357126,310.68035879446,331.39238271409,355.06326719367,368.21375857121,382.37582620857,397.67085925691,414.24047839262,432.2509339749,451.89870370104,523.2511306012],"description":"Rationalized JC Sub-19 Harmonia on C. MD=19, No planetary assignment."},"harmjc-19":{"frequencies":[261.6255653006,276.16031892841,292.40504357126,310.68035879446,331.39238271409,355.06326719367,382.37582620857,414.24047839262,432.2509339749,451.89870370104,473.41768959156,497.08857407114,523.2511306012],"description":"Rationalized JC Sub-19 Harmonia on C. MD=19, No planetary assignment."},"harmjc-21":{"frequencies":[261.6255653006,268.0066766494,274.70684356563,289.16509849014,305.22982618403,343.38355445704,366.27579142084,392.4383479509,406.97310157871,422.62591317789,439.53094970501,457.84473927605,523.2511306012],"description":"Rationalized JC Sub-21 Harmonia on C. MD=21, No planetary assignment."},"harmjc-23-2":{"frequencies":[261.6255653006,273.51763645063,286.54228580542,300.86940009569,316.70463167967,334.29933343966,353.96400011258,376.08675011961,401.15920012759,429.81342870813,462.87600014722,501.44900015948,523.2511306012],"description":"Rationalized JC Sub-23 Harmonia on C. MD=23, No planetary assignment."},"harmjc-23":{"frequencies":[261.6255653006,273.51763645063,300.86940009569,316.70463167967,334.29933343966,376.08675011961,401.15920012759,429.81342870813,445.73244458621,462.87600014722,481.3910401531,501.44900015948,523.2511306012],"description":"Rationalized JC Sub-23 Harmonia on C. MD=23, No planetary assignment."},"harmjc-25":{"frequencies":[261.6255653006,272.52663052146,297.30177875068,311.45900631024,327.03195662575,363.36884069528,384.74347838324,408.78994578219,436.04260883433,467.18850946536,484.4917875937,503.12608711654,523.2511306012],"description":"Rationalized JC Sub-25 Harmonia on C. MD=25, No planetary assignment."},"harmjc-27":{"frequencies":[261.6255653006,271.68808704293,294.32876096318,307.12566361375,321.08592105074,353.19451315581,371.78369805875,392.4383479509,415.52295665389,441.49314144476,470.92601754108,504.56359022259,523.2511306012],"description":"Rationalized JC Sub-27 Harmonia on C. MD=27, No planetary assignment."},"harmjc-hypod16":{"frequencies":[261.6255653006,279.06726965397,299.00064605783,310.07474405997,322.00069575458,348.83408706747,364.00078650518,380.54627680087,398.6675280771,418.60090448096,440.63253103259,465.11211608996,523.2511306012],"description":"Rationalized JC Hypodorian Harmonia on C. Saturn Scale on C, MD=16. (Steiner)"},"harmjc-hypol20":{"frequencies":[261.6255653006,275.39533189537,290.69507255622,307.79478270659,327.03195662575,348.83408706747,373.75080757229,402.50086969323,418.60090448096,436.04260883433,455.00098313148,575.57624366132,523.2511306012],"description":"Rationalized JC Hypolydian Harmonia on C. Mars scale on C., MD=20"},"harmjc-hypop18":{"frequencies":[261.6255653006,277.01530443593,294.32876096318,313.95067836072,336.37572681506,362.25078272391,376.74081403286,392.4383479509,409.50088481833,428.11456140098,448.50096908674,470.92601754108,523.2511306012],"description":"Rationalized JC Hypophrygian Harmonia on C. Jupiter scale on C, MD =18"},"harmjc-lydian13":{"frequencies":[261.6255653006,272.09058791262,283.42769574232,295.75063903546,309.19384990071,340.11323489078,358.01393146398,377.90359432309,400.13321751856,425.14154361347,453.48431318771,485.87604984397,523.2511306012],"description":"Rationalized JC Lydian Harmonia on C. Mercury scale on C, MD = 26 or 13"},"harmjc-mix14":{"frequencies":[261.6255653006,271.31540105247,281.75060878526,293.02063313667,305.22982618403,332.97799220076,348.83408706747,366.27579142084,385.55346465352,406.97310157871,430.91269578922,457.84473927605,523.2511306012],"description":"Rationalized JC Mixolydian Harmonia on C. Moon Scale on C, MD = 14"},"harmjc-phryg12":{"frequencies":[261.6255653006,273.00058987889,285.40970760065,299.00064605783,313.95067836072,348.83408706747,369.35373924791,392.4383479509,418.60090448096,448.50096908674,465.11211608996,483.00104363188,523.2511306012],"description":"Rationalized JC Phrygian Harmonia on C. Venus scale on C, MD = 24 or 12"},"harmonical":{"frequencies":[261.6255653006,290.69507255622,294.32876096318,313.95067836072,327.03195662575,348.83408706747,392.4383479509,418.60090448096,436.04260883433,457.84473927605,470.92601754108,490.54793493862,523.2511306012],"description":"See pp 17 and 466-468 Helmholtz. lower 4 oct. Instr. designed & tuned by Ellis"},"harmonical_up":{"frequencies":[261.6255653006,277.97716313189,294.32876096318,310.68035879446,327.03195662575,359.73515228832,457.84473927605,392.4383479509,408.78994578219,425.14154361347,474.19633710734,490.54793493862,523.2511306012],"description":"Upper 2 octaves of Ellis's Harmonical"},"harmsub16":{"frequencies":[261.6255653006,280.31310567921,294.32876096318,301.87565226992,327.03195662575,356.76213450082,359.73515228832,392.4383479509,425.14154361347,436.04260883433,457.84473927605,490.54793493862,523.2511306012],"description":"16 harmonics on 1/1 and 16 subharmonics on 15/8"},"harrison_16":{"frequencies":[261.6255653006,279.06726965397,290.69507255622,299.00064605783,305.22982618403,313.95067836072,327.03195662575,348.83408706747,370.63621750918,392.4383479509,418.60090448096,436.04260883433,448.50096908674,457.84473927605,470.92601754108,490.54793493862,523.2511306012],"description":"Lou Harrison 16-tone superparticular \"Ptolemy Duple\""},"harrison_5":{"frequencies":[261.6255653006,279.06726965397,313.95067836072,392.4383479509,418.60090448096,523.2511306012],"description":"From Lou Harrison, a pelog style pentatonic"},"harrison_5_1":{"frequencies":[261.6255653006,285.40970760065,313.95067836072,392.4383479509,418.60090448096,523.2511306012],"description":"From Lou Harrison, a pelog style pentatonic"},"harrison_5_3":{"frequencies":[261.6255653006,271.31540105247,348.83408706747,392.4383479509,406.97310157871,523.2511306012],"description":"From Lou Harrison, a pelog style pentatonic"},"harrison_5_4":{"frequencies":[261.6255653006,279.06726965397,313.95067836072,392.4383479509,490.54793493862,523.2511306012],"description":"From Lou Harrison, a pelog style pentatonic"},"harrison_8":{"frequencies":[261.6255653006,279.06726965397,313.95067836072,327.03195662575,367.91095120397,392.4383479509,436.04260883433,465.11211608996,523.2511306012],"description":"Lou Harrison 8-tone tuning for \"Serenade for Guitar\""},"harrison_cinna":{"frequencies":[261.6255653006,272.52663052146,294.32876096318,313.95067836072,327.03195662575,343.38355445704,367.91095120397,392.4383479509,418.60090448096,436.04260883433,457.84473927605,490.54793493862,523.2511306012],"description":"Lou Harrison, \"Incidental Music for Corneille's Cinna\" (1955-56) 1/1=C"},"harrison_diat":{"frequencies":[261.6255653006,274.70684356563,313.95067836072,348.83408706747,392.4383479509,412.06026534844,470.92601754108,523.2511306012],"description":"From Lou Harrison, a soft diatonic"},"harrison_joy":{"frequencies":[261.6255653006,294.32876096318,327.03195662575,392.4383479509,436.04260883433,490.54793493862,523.2511306012],"description":"Lou Harrison's Joyous 6"},"harrison_mid":{"frequencies":[261.6255653006,294.32876096318,313.95067836072,348.83408706747,392.4383479509,436.04260883433,457.84473927605,523.2511306012],"description":"Lou Harrison mid mode"},"harrison_mid2":{"frequencies":[261.6255653006,294.32876096318,313.95067836072,348.83408706747,392.4383479509,448.50096908674,470.92601754108,523.2511306012],"description":"Lou Harrison mid mode 2"},"harrison_min":{"frequencies":[261.6255653006,313.95067836072,348.83408706747,392.4383479509,436.04260883433,523.2511306012],"description":"From Lou Harrison, a symmetrical pentatonic with minor thirds"},"harrison_mix1":{"frequencies":[261.6255653006,285.40970760065,313.95067836072,392.4383479509,425.14154361347,523.2511306012],"description":"A \"mixed type\" pentatonic, Lou Harrison"},"harrison_mix2":{"frequencies":[261.6255653006,313.95067836072,348.83408706747,392.4383479509,490.54793493862,523.2511306012],"description":"A \"mixed type\" pentatonic, Lou Harrison"},"harrison_mix3":{"frequencies":[261.6255653006,313.95067836072,336.37572681506,392.4383479509,418.60090448096,523.2511306012],"description":"A \"mixed type\" pentatonic, Lou Harrison"},"harrison_mix4":{"frequencies":[261.6255653006,280.31310567921,327.03195662575,392.4383479509,448.50096908674,523.2511306012],"description":"A \"mixed type\" pentatonic, Lou Harrison"},"harrison_songs":{"frequencies":[261.6255653006,271.31540105247,294.32876096318,310.07474405997,327.03195662575,348.83408706747,367.91095120397,392.4383479509,406.97310157871,441.49314144476,465.11211608996,490.54793493862,523.2511306012],"description":"Shared gamut of \"Four Strict Songs\" (1951-55), each pentatonic"},"harrisonj":{"frequencies":[261.6255653006,272.17712546173,292.13970819848,313.56642833783,326.21280531667,350.13858362887,364.25994396351,390.97625694066,406.744629928,436.57694340361,468.59728067062,487.49616921257,523.2511306012],"description":"John Harrison's temperament (1775), almost 3/10-comma. Third = 1200/pi"},"harrisonm_rev":{"frequencies":[261.6255653006,257.53766584278,294.32876096318,289.72987407313,331.11985608357,343.38355445704,372.50983809402,392.4383479509,386.30649876417,441.49314144476,457.84473927605,496.67978412536,523.2511306012],"description":"Michael Harrison, piano tuning for \"Revelation\" (2001), 1/1=F"},"haverstick13":{"frequencies":[261.6255653006,283.85429714132,301.75671459889,307.97166902637,320.78822215662,341.02002673508,362.52783176564,377.61479489998,401.43059675514,426.7484383229,444.50800708553,482.27514684959,502.34551296122,523.2511306012],"description":"Neil Haverstick, scale in 34-tET, MMM 21-5-2006"},"hawkes":{"frequencies":[261.6255653006,274.56549986328,292.86986732103,310.24975557428,327.84547867349,349.70184487387,366.99801003998,391.46454285105,411.84824958905,438.2147004401,467.42901507992,490.54793493862,523.2511306012],"description":"William Hawkes' modified 1/5-comma meantone (1807)"},"hawkes2":{"frequencies":[261.6255653006,275.15193010334,293.04845178801,312.10900487995,328.24542585003,349.59527202198,367.66978141816,391.58387939843,411.8292495232,438.61558204759,467.14415995873,491.2960898965,523.2511306012],"description":"Meantone with fifth tempered 1/6 of 53-tET step by William Hawkes (1808)"},"hawkes3":{"frequencies":[261.6255653006,274.56549986328,292.86986732103,311.6193417424,327.84547867349,349.70184487387,366.99801003998,391.46454285105,411.84824958905,438.2147004401,467.42901237995,490.54793493862,523.2511306012],"description":"William Hawkes' modified 1/5-comma meantone (1811)"},"hbarnes":{"frequencies":[261.6255653006,276.71351472429,293.33333347996,310.95136287868,328.88393162803,349.42547049952,369.15973155124,391.77416758435,414.83597850347,439.25532436715,466.16376151809,493.04743111995,523.2511306012],"description":"Variation on Barnes with 1/6P -> 1/8P. OdC '99"},"hebdome1":{"frequencies":[261.6255653006,265.71346475842,267.23182741418,269.80136421624,273.30527803723,280.31310567921,283.42769574232,287.78812183066,289.07289023169,292.28481123426,294.32876096318,300.63580584096,303.67253115248,308.34441624714,311.77046531655,315.35224388912,318.85615771011,323.76163705949,327.03195662575,334.03978426773,336.37572681506,340.11323489078,341.63159754654,346.88746827803,350.74177348112,359.73515228832,364.40703738298,367.91095120397,370.01329949656,375.7947573012,382.62738925213,385.43052030892,389.71308164569,392.4383479509,400.84774112128,404.70204632437,409.95791705585,411.12588832951,417.54973033466,420.46965851882,425.14154361347,431.68218274599,437.28844485957,441.49314144476,445.38637902364,449.66894036041,455.50879672872,462.5166243707,467.65569797482,470.92601754108,478.28423656516,479.64686971777,485.87604984397,490.54793493862,501.0596764016,504.56359022259,510.16985233617,513.90736041189,523.2511306012],"description":"Wilson 1.3.5.7.9.11.13.15 hebdomekontany, 1.3.5.7 tonic"},"helmholtz":{"frequencies":[261.6255653006,279.06726965397,327.03195662575,348.83408706747,392.4383479509,418.60090448096,490.54793493862,523.2511306012],"description":"Helmholtz's Chromatic scale and Gipsy major from Slovakia"},"helmholtz_24":{"frequencies":[261.6255653006,275.93321340298,279.06726965397,290.69507255622,294.32876096318,306.59245933664,310.07474405997,327.03195662575,331.11985608357,344.91651675372,348.83408706747,367.91095120397,372.50983809402,388.03108134794,392.4383479509,408.78994578219,413.89982010446,436.04260883433,441.49314144476,459.88868900496,465.63729761752,490.54793493862,496.67978412536,517.37477513058,523.2511306012],"description":"Simplified Helmholtz 24"},"helmholtz_hd":{"frequencies":[261.6255653006,294.32876096318,313.95067836072,327.03195662575,348.83408706747,392.4383479509,418.60090448096,436.04260883433,470.92601754108,523.2511306012],"description":"Helmholtz Harmonic Decad"},"helmholtz_pure":{"frequencies":[261.6255653006,275.93321340298,279.06726965397,290.69507255622,294.32876096318,306.59245933664,310.07474405997,327.03195662575,330.74639366397,344.91651675372,348.83408706747,367.91095120397,372.08969287196,387.59343007496,392.4383479509,408.78994578219,413.43299207996,436.04260883433,441.49314144476,459.88868900496,465.11211608996,490.54793493862,496.11959049595,516.79124009995,523.2511306012],"description":"Helmholtz's two-keyboard harmonium tuning untempered"},"helmholtz_temp":{"frequencies":[261.6255653006,275.81645389904,279.10671937395,290.77707354032,294.24580701304,306.54917537161,310.20605716322,327.03195662575,330.9330448436,344.77062435684,348.88325535732,367.80710710303,372.19474608839,387.75741156435,392.38304142029,408.78994578219,413.66637442451,436.10414127513,441.30625330017,459.75895986689,465.24324076996,490.4788828408,496.3296094287,517.08305349316,523.2511306012],"description":"Helmholtz's two-keyboard harmonium tuning"},"hem_chrom":{"frequencies":[261.6255653006,269.55361273395,285.40970760065,348.83408706747,392.4383479509,404.33041910093,428.11456140098,523.2511306012],"description":"Hemiolic Chromatic genus has the strong or 1:2 division of the 12/11 pyknon"},"hem_chrom11":{"frequencies":[261.6255653006,273.00058987889,285.40970760065,348.83408706747,392.4383479509,409.50088481833,428.11456140098,523.2511306012],"description":"11'al Hemiolic Chromatic genus with a CI of 11/9, Winnington-Ingram"},"hem_chrom13":{"frequencies":[261.6255653006,272.09058791262,283.42769574232,348.83408706747,392.4383479509,408.13588186894,425.14154361347,523.2511306012],"description":"13'al Hemiolic Chromatic or neutral-third genus has a CI of 16/13"},"hem_chrom2":{"frequencies":[261.6255653006,269.29177952703,285.30470202322,349.22823143301,391.99543598175,403.48177901006,427.47405410759,523.2511306012],"description":"1:2 Hemiolic Chromatic genus 3 + 6 + 21 parts"},"hemiwuer24":{"frequencies":[261.6255653006,274.60778382002,280.48822448524,286.49458884928,292.62957327549,307.15025309186,313.72755695954,320.44570714783,327.30771955335,350.90592546776,358.42021185082,366.09540888186,373.9349620795,392.49012653442,400.89489544613,409.47964376542,418.24822532303,439.00227453173,448.4030528436,458.00513880662,467.8128437444,491.02635713596,501.54117720983,512.28116095218,523.2511306012],"description":"Hemiw�rschmidt[24] in 229-tET tuning."},"hen12":{"frequencies":[261.6255653006,280.31310567921,299.00064605783,313.95067836072,327.03195662575,348.83408706747,366.27579142084,392.4383479509,418.60090448096,448.50096908674,457.84473927605,490.54793493862,523.2511306012],"description":"Adjusted Hahn12"},"hen22":{"frequencies":[261.6255653006,272.52663052146,280.31310567921,290.69507255622,299.00064605783,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,363.36884069528,366.27579142084,381.53728273004,392.4383479509,415.27867508032,418.60090448096,436.04260883433,448.50096908674,457.84473927605,484.4917875937,490.54793493862,508.71637697339,523.2511306012],"description":"Adjusted Hahn22"},"hept_diamond":{"frequencies":[261.6255653006,269.10058145205,271.31540105247,279.06726965397,294.32876096318,305.22982618403,313.95067836072,316.53463456122,325.57848126297,327.03195662575,334.88072358477,336.37572681506,348.83408706747,392.4383479509,406.97310157871,408.78994578219,418.60090448096,420.46965851882,432.48307733364,436.04260883433,448.50096908674,465.11211608996,490.54793493862,504.56359022259,508.71637697339,523.2511306012],"description":"Inverted-Prime Heptatonic Diamond based on Archytas's Enharmonic"},"hept_diamondi":{"frequencies":[261.6255653006,269.10058145205,271.31540105247,279.06726965397,281.36411960997,289.40309445597,294.32876096318,297.67175429757,327.03195662575,336.37572681506,348.83408706747,361.75386806997,367.91095120397,372.08969287196,378.42269266694,392.4383479509,406.97310157871,418.60090448096,459.88868900496,465.11211608996,473.02836583367,486.54346200035,490.54793493862,504.56359022259,508.71637697339,523.2511306012],"description":"Prime-Inverted Heptatonic Diamond based on Archytas's Enharmonic"},"hept_diamondp":{"frequencies":[261.6255653006,269.10058145205,271.31540105247,279.06726965397,294.32876096318,305.22982618403,313.95067836072,327.03195662575,336.37572681506,339.14425131559,348.83408706747,358.80077526939,361.75386806997,367.91095120397,372.08969287196,378.42269266694,381.53728273004,392.4383479509,403.65087217807,406.97310157871,418.60090448096,436.04260883433,448.50096908674,465.11211608996,490.54793493862,504.56359022259,508.71637697339,523.2511306012],"description":"Heptatonic Diamond based on Archytas's Enharmonic, 27 tones"},"herf":{"frequencies":[261.6255653006,269.80136421624,277.97716313189,294.32876096318,310.68035879446,327.03195662575,343.38355445704,359.73515228832,376.08675011961,392.4383479509,425.14154361347,441.49314144476,457.84473927605,490.54793493862,523.2511306012],"description":"Sims:Reflections on This and That, 1991. Used by Herf in Ekmelischer Gesang"},"heun":{"frequencies":[261.6255653006,275.15237829755,293.0485888979,312.10878854255,328.24573110938,349.59519124833,367.67029324081,391.58396987353,411.83001550364,438.61588607285,467.14394139401,491.29666030217,523.2511306012],"description":"Well temperament for organ of Jan Heun (1805), subset of 55-tET"},"hexagonal13":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,290.69507255622,313.95067836072,327.03195662575,348.83408706747,392.4383479509,418.60090448096,436.04260883433,470.92601754108,490.54793493862,502.32108537715,523.2511306012],"description":"Star hexagonal 13-tone scale"},"hexagonal37":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,282.55561052465,283.88190679319,290.69507255622,294.32876096318,297.67175429757,301.39265122629,306.59245933664,313.95067836072,322.99452506247,327.03195662575,334.88072358477,340.65828815182,348.83408706747,353.19451315581,363.36884069528,367.91095120397,372.08969287196,376.74081403286,387.59343007496,392.4383479509,401.85686830172,408.78994578219,418.60090448096,423.83341578697,436.04260883433,446.50763144636,454.2110508691,459.88868900496,465.11211608996,470.92601754108,482.22824196207,484.4917875937,490.54793493862,502.32108537715,523.2511306012],"description":"Star hexagonal 37-tone scale"},"hexany1":{"frequencies":[261.6255653006,305.22982618403,327.03195662575,381.53728273004,436.04260883433,457.84473927605,523.2511306012],"description":"Two out of 1 3 5 7 hexany on 1.3"},"hexany10":{"frequencies":[261.6255653006,294.32876096318,327.03195662575,392.4383479509,436.04260883433,490.54793493862,523.2511306012],"description":"1.3.5.9 Hexany"},"hexany11":{"frequencies":[261.6255653006,294.32876096318,305.22982618403,343.38355445704,392.4383479509,457.84473927605,523.2511306012],"description":"1.3.7.9 Hexany on 1.3"},"hexany12":{"frequencies":[261.6255653006,290.69507255622,305.22982618403,339.14425131559,406.97310157871,436.04260883433,523.2511306012],"description":"3.5.7.9 Hexany on 3.9"},"hexany13":{"frequencies":[261.6255653006,285.40970760065,327.03195662575,356.76213450082,392.4383479509,475.68284600109,523.2511306012],"description":"1.3.5.11 Hexany on 1.11"},"hexany14":{"frequencies":[261.6255653006,287.78812183066,340.11323489078,383.71749577421,453.48431318771,498.83274450648,523.2511306012],"description":"5.11.13.15 Hexany (5.15), used in The Giving, by Stephen J. Taylor"},"hexany15":{"frequencies":[261.6255653006,327.03195662575,348.83408706747,392.4383479509,418.60090448096,523.2511306012],"description":"1.3.5.15 2)4 hexany (1.15 tonic) degenerate, symmetrical pentatonic"},"hexany16":{"frequencies":[261.6255653006,294.32876096318,348.83408706747,392.4383479509,465.11211608996,523.2511306012],"description":"1.3.9.27 Hexany, a degenerate pentatonic form"},"hexany17":{"frequencies":[261.6255653006,327.03195662575,334.88072358477,408.78994578219,418.60090448096,523.2511306012],"description":"1.5.25.125 Hexany, a degenerate pentatonic form"},"hexany18":{"frequencies":[261.6255653006,299.00064605783,341.71502406609,400.61414686654,457.84473927605,523.2511306012],"description":"1.7.49.343 Hexany, a degenerate pentatonic form"},"hexany19":{"frequencies":[261.6255653006,299.00064605783,327.03195662575,418.60090448096,457.84473927605,523.2511306012],"description":"1.5.7.35 Hexany, a degenerate pentatonic form"},"hexany2":{"frequencies":[261.6255653006,272.52663052146,294.32876096318,313.95067836072,327.03195662575,340.65828815182,348.83408706747,363.36884069528,392.4383479509,408.78994578219,436.04260883433,490.54793493862,523.2511306012],"description":"Hexany Cluster 2"},"hexany20":{"frequencies":[261.6255653006,279.06726965397,305.22982618403,398.6675280771,436.04260883433,465.11211608996,523.2511306012],"description":"3.5.7.105 Hexany"},"hexany21":{"frequencies":[261.6255653006,279.06726965397,310.07474405997,392.4383479509,436.04260883433,465.11211608996,523.2511306012],"description":"3.5.9.135 Hexany"},"hexany21a":{"frequencies":[261.6255653006,279.06726965397,310.07474405997,348.83408706747,392.4383479509,436.04260883433,465.11211608996,523.2511306012],"description":"3.5.9.135 Hexany + 4/3. Is Didymos Diatonic tetrachord on 1/1 and inv. on 3/2"},"hexany22":{"frequencies":[261.6255653006,276.76092858245,359.73515228832,380.54627680087,494.63583439645,523.2511306012],"description":"1.11.121.1331 Hexany, a degenerate pentatonic form"},"hexany23":{"frequencies":[261.6255653006,348.83408706747,359.73515228832,380.54627680087,392.4383479509,523.2511306012],"description":"1.3.11.33 Hexany, degenerate pentatonic form"},"hexany24":{"frequencies":[261.6255653006,327.03195662575,359.73515228832,380.54627680087,418.60090448096,523.2511306012],"description":"1.5.11.55 Hexany, a degenerate pentatonic form"},"hexany25":{"frequencies":[261.6255653006,299.00064605783,359.73515228832,380.54627680087,457.84473927605,523.2511306012],"description":"1.7.11.77 Hexany, a degenerate pentatonic form"},"hexany26":{"frequencies":[261.6255653006,294.32876096318,359.73515228832,380.54627680087,465.11211608996,523.2511306012],"description":"1.9.11.99 Hexany, a degenerate pentatonic form"},"hexany3":{"frequencies":[261.6255653006,272.52663052146,290.69507255622,313.95067836072,327.03195662575,348.83408706747,392.4383479509,418.60090448096,436.04260883433,470.92601754108,490.54793493862,502.32108537715,523.2511306012],"description":"Hexany Cluster 3"},"hexany4":{"frequencies":[261.6255653006,272.52663052146,294.32876096318,313.95067836072,327.03195662575,348.83408706747,376.74081403286,392.4383479509,418.60090448096,436.04260883433,470.92601754108,490.54793493862,523.2511306012],"description":"Hexany Cluster 4"},"hexany49":{"frequencies":[261.6255653006,299.00064605783,305.22982618403,392.4383479509,400.61414686654,457.84473927605,523.2511306012],"description":"1.3.21.49 2)4 hexany (1.21 tonic)"},"hexany5":{"frequencies":[261.6255653006,294.32876096318,313.95067836072,327.03195662575,348.83408706747,392.4383479509,408.78994578219,418.60090448096,436.04260883433,470.92601754108,490.54793493862,502.32108537715,523.2511306012],"description":"Hexany Cluster 5"},"hexany6":{"frequencies":[261.6255653006,272.52663052146,290.69507255622,294.32876096318,313.95067836072,327.03195662575,348.83408706747,392.4383479509,408.78994578219,418.60090448096,436.04260883433,490.54793493862,523.2511306012],"description":"Hexany Cluster 6"},"hexany7":{"frequencies":[261.6255653006,272.52663052146,313.95067836072,327.03195662575,348.83408706747,363.36884069528,392.4383479509,408.78994578219,418.60090448096,436.04260883433,470.92601754108,490.54793493862,523.2511306012],"description":"Hexany Cluster 7"},"hexany8":{"frequencies":[261.6255653006,272.52663052146,313.95067836072,327.03195662575,340.65828815182,348.83408706747,392.4383479509,408.78994578219,418.60090448096,436.04260883433,490.54793493862,502.32108537715,523.2511306012],"description":"Hexany Cluster 8"},"hexany9":{"frequencies":[261.6255653006,299.00064605783,313.95067836072,358.80077526939,418.60090448096,448.50096908674,523.2511306012],"description":"1.3.5.7 Hexany on 5.7"},"hexany_cl":{"frequencies":[261.6255653006,294.32876096318,301.39265122629,313.95067836072,327.03195662575,348.83408706747,353.19451315581,376.74081403286,392.4383479509,418.60090448096,470.92601754108,502.32108537715,523.2511306012],"description":"Hexany Cluster 1"},"hexany_cl2":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,313.95067836072,327.03195662575,348.83408706747,392.4383479509,408.78994578219,418.60090448096,490.54793493862,502.32108537715,523.2511306012],"description":"Composed of 1.3.5.45, 1.3.5.75, 1.3.5.9, and 1.3.5.25 hexanies"},"hexany_flank":{"frequencies":[261.6255653006,267.07609791103,299.00064605783,305.22982618403,327.03195662575,348.83408706747,373.75080757229,381.53728273004,427.14378008261,436.04260883433,457.84473927605,498.33441009638,523.2511306012],"description":"Hexany Flanker, 7-limit, from Wilson"},"hexany_tetr":{"frequencies":[261.6255653006,269.10058145205,279.06726965397,336.37572681506,348.83408706747,358.80077526939,523.2511306012],"description":"Complex 12 of p. 115, a hexany based on Archytas's Enharmonic"},"hexany_trans":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,339.14425131559,348.83408706747,361.75386806997,523.2511306012],"description":"Complex 1 of p. 115, a hexany based on Archytas's Enharmonic"},"hexany_trans2":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,348.83408706747,358.80077526939,372.08969287196,523.2511306012],"description":"Complex 2 of p. 115, a hexany based on Archytas's Enharmonic"},"hexany_trans3":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,327.03195662575,336.37572681506,348.83408706747,523.2511306012],"description":"Complex 9 of p. 115, a hexany based on Archytas's Enharmonic"},"hexany_u2":{"frequencies":[261.6255653006,274.70684356563,279.06726965397,280.31310567921,286.15296204753,299.00064605783,305.22982618403,313.95067836072,327.03195662575,343.38355445704,348.83408706747,358.80077526939,366.27579142084,373.75080757229,381.53728273004,392.4383479509,398.6675280771,418.60090448096,436.04260883433,448.50096908674,457.84473927605,478.40103369253,488.36772189445,490.54793493862,498.33441009638,523.2511306012],"description":"Hexany union = genus [335577] minus two corners"},"hexany_union":{"frequencies":[261.6255653006,274.70684356563,280.31310567921,299.00064605783,305.22982618403,313.95067836072,327.03195662575,348.83408706747,358.80077526939,366.27579142084,373.75080757229,381.53728273004,392.4383479509,418.60090448096,436.04260883433,448.50096908674,457.84473927605,488.36772189445,498.33441009638,523.2511306012],"description":"The union of all of the pitches of the 1.3.5.7 hexany on each tone as 1/1"},"hexany_urot":{"frequencies":[261.6255653006,267.07609791103,280.31310567921,286.15296204753,290.69507255622,299.00064605783,305.22982618403,327.03195662575,333.84512238879,343.38355445704,348.83408706747,356.10146388137,373.75080757229,381.53728273004,392.4383479509,400.61414686654,406.97310157871,436.04260883433,445.12682985172,448.50096908674,457.84473927605,490.54793493862,498.33441009638,508.71637697339,523.2511306012],"description":"Aggregate rotations of 1.3.5.7 hexany, 1.3 = 1/1"},"hexanys":{"frequencies":[261.6255653006,286.15296204753,294.32876096318,327.03195662575,343.38355445704,367.91095120397,392.4383479509,429.2294430713,441.49314144476,457.84473927605,490.54793493862,515.07533168556,523.2511306012],"description":"Hexanys 1 3 5 7 9"},"hexanys2":{"frequencies":[261.6255653006,314.76825825228,425.14154361347,457.84473927605,269.80136421624,371.99885066179,392.4383479509,472.15238737843,318.85615771011,359.73515228832,343.38355445704,292.28481123426,523.2511306012],"description":"Hexanys 1 3 7 11 13"},"higgs":{"frequencies":[261.6255653006,392.4383479509,418.60090448096,422.62591317789,423.58424858192,425.14154361347,436.04260883433,523.2511306012],"description":"From Greg Higgs announcement of the formation of an Internet Tuning list"},"hinsz_gr":{"frequencies":[261.6255653006,274.68983337859,292.34127285051,310.07474405997,326.6631048533,348.83408706747,366.25311135453,391.11111150212,412.03474986192,437.02884834934,465.11211608996,489.99465727995,523.2511306012],"description":"Reconstructed Hinsz temperament, organ Pelstergasthuiskerk Groningen. Ortgies,2002"},"hipkins":{"frequencies":[261.6255653006,275.62199471997,299.00064605783,348.83408706747,392.4383479509,413.43299207996,448.50096908674,523.2511306012],"description":"Hipkins' Chromatic"},"hirajoshi":{"frequencies":[261.6255653006,291.13134764929,317.84796618517,388.16504068057,412.91271853531,523.2511306012],"description":"Observed Japanese pentatonic koto scale. Helmholtz/Ellis p.519, nr.112"},"hirajoshi2":{"frequencies":[261.6255653006,294.32876096318,313.95067836072,392.4383479509,418.60090448096,523.2511306012],"description":"Japanese pentatonic koto scale, theoretical. Helmholz/Ellis p.519, nr.110"},"hirajoshi3":{"frequencies":[261.6255653006,292.47977325983,321.54118165335,396.32121331049,415.54465627623,522.94897617031],"description":"Observed Japanese pentatonic koto scale. Helmholtz/Ellis p.519, nr.111"},"hirashima":{"frequencies":[261.6255653006,277.33928225406,292.50627485027,312.00669222389,327.03195662575,349.91912034749,369.78570985692,391.22147055517,416.00892317314,437.39889945791,468.01003810189,489.02683710225,523.2511306012],"description":"Tatsushi Hirashima, temperament of chapel organ of Kobe Shoin Women's Univ."},"hjelmboogie":{"frequencies":[261.6255653006,294.32876096318,327.03195662575,343.38355445704,367.91095120397,392.4383479509,441.49314144476,457.84473927605,490.54793493862,515.07533168556,523.2511306012],"description":"Paul Hjelmstad's \"Boogie Woogie\" scale, TL 20-3-2006"},"ho_mai_nhi":{"frequencies":[261.6255653006,287.78812183066,348.83408706747,392.4383479509,431.68218274599,523.2511306012],"description":"Ho Mai Nhi (Nam Hue) dan tranh scale, Vietnam"},"hochgartz":{"frequencies":[261.6255653006,274.56549986328,292.86986732103,309.86458629683,327.84547867349,349.70184487387,366.99801003998,391.46454285105,412.49999887294,438.2147004401,465.53241962975,490.54793493862,523.2511306012],"description":"Michael Hochgartz, modified 1/5-comma meantone temperament"},"hofmann1":{"frequencies":[261.6255653006,262.65154790962,279.06726965397,348.83408706747,392.4383479509,393.97732186443,418.60090448096,523.2511306012],"description":"Hofmann's Enharmonic #1, Dorian mode"},"hofmann2":{"frequencies":[261.6255653006,263.56353245097,279.06726965397,348.83408706747,392.4383479509,395.34529867646,418.60090448096,523.2511306012],"description":"Hofmann's Enharmonic #2, Dorian mode"},"hofmann_chrom":{"frequencies":[261.6255653006,264.26824777838,290.69507255622,348.83408706747,392.4383479509,396.40237166758,436.04260883433,523.2511306012],"description":"Hofmann's Chromatic"},"holder":{"frequencies":[261.6255653006,274.23214485994,292.57879058083,312.45989404005,327.40114268825,349.76744711215,366.57630213591,391.03837375367,409.94826565972,437.46806069696,467.28984664562,489.70152554512,523.2511306012],"description":"William Holder's equal beating meantone temperament (1694). 3/2 beats 2.8 Hz"},"holder2":{"frequencies":[261.6255653006,274.23214485994,292.57879058083,312.45989404005,327.40114268825,349.76744711215,366.57630213591,391.03837375367,410.64811919433,437.46806069696,467.46154552107,489.70152554512,523.2511306012],"description":"Holder's irregular e.b. temperament with improved Eb and G#"},"hummel":{"frequencies":[261.6255653006,277.1703574486,293.54676487235,311.03465677994,329.45811370906,349.13199096171,369.8583804246,391.99149393462,415.308682162,439.8732919971,466.10512967869,493.74031485884,523.2511306012],"description":"Johann Nepomuk Hummel's quasi-equal temperament (1829)"},"hummel2":{"frequencies":[261.6255653006,277.22760066578,293.66431501254,311.21660561883,329.70790803338,349.18845812715,369.99117208793,391.90679138833,415.30984563838,439.96491544382,466.29335337935,494.03030700757,523.2511306012],"description":"Johann Nepomuk Hummel's temperament according to the second bearing plan"},"husmann":{"frequencies":[261.6255653006,275.62199471997,294.32876096318,310.07474405997,314.30517589183,331.11985608357,348.83408706747],"description":"Tetrachord division according to Husmann"},"hwerck3":{"frequencies":[261.6255653006,276.40121172404,293.00227310437,310.60041853231,328.69828757761,349.03110370139,368.74309237173,391.5530240856,414.36778843034,438.51190905657,465.63764214343,492.7691222293,523.2511306012],"description":"Variation on Werckmeister III with 1/4P -> 1/6P and 0P -> 1/24P. OdC '99"},"hyper_enh":{"frequencies":[261.6255653006,264.93728131706,268.33391312882,348.83408706747,392.4383479509,397.40592197559,402.50086969323,523.2511306012],"description":"13/10 HyperEnharmonic. This genus is at the limit of usable tunings"},"hyper_enh2":{"frequencies":[261.6255653006,267.19206668997,273.00058987889,348.83408706747,392.4383479509,400.78810003496,409.50088481833,523.2511306012],"description":"Hyperenharmonic genus from Kathleen Schlesinger's enharmonic Phrygian Harmonia"},"hypo_chrom":{"frequencies":[261.6255653006,275.39533189537,282.83844897362,290.69507255622,348.83408706747,373.75080757229,387.59343007496,402.50086969323,418.60090448096,427.14378008261,436.04260883433,455.00098313148,523.2511306012],"description":"Hypolydian Chromatic Tonos"},"hypo_diat":{"frequencies":[261.6255653006,290.69507255622,307.79478270659,327.03195662575,348.83408706747,373.75080757229,387.59343007496,402.50086969323,436.04260883433,455.00098313148,475.68284600109,498.33441009638,523.2511306012],"description":"Hypolydian Diatonic Tonos"},"hypo_enh":{"frequencies":[261.6255653006,268.33391312882,271.81876914348,275.39533189537,348.83408706747,373.75080757229,387.59343007496,402.50086969323,410.39304360878,414.45634107026,418.60090448096,465.11211608996,523.2511306012],"description":"Hypolydian Enharmonic Tonos"},"hypod_chrom":{"frequencies":[261.6255653006,279.06726965397,288.69027895239,299.00064605783,322.00069575458,348.83408706747,364.00078650518,380.54627680087,398.6675280771,408.39112632289,418.60090448096,465.11211608996,523.2511306012],"description":"Hypodorian Chromatic Tonos"},"hypod_chrom2":{"frequencies":[261.6255653006,279.06726965397,299.00064605783,348.83408706747,380.54627680087,398.6675280771,418.60090448096,523.2511306012],"description":"Schlesinger's Chromatic Hypodorian Harmonia"},"hypod_chrom2inv":{"frequencies":[261.6255653006,327.03195662575,343.38355445704,359.73515228832,392.4383479509,457.84473927605,490.54793493862,523.2511306012],"description":"Inverted Schlesinger's Chromatic Hypodorian Harmonia"},"hypod_chromenh":{"frequencies":[261.6255653006,270.06509966514,279.06726965397,348.83408706747,380.54627680087,398.6675280771,418.60090448096,523.2511306012],"description":"Schlesinger's Hypodorian Harmonia in a mixed chromatic-enharmonic genus"},"hypod_chrominv":{"frequencies":[261.6255653006,277.97716313189,294.32876096318,359.73515228832,392.4383479509,408.78994578219,425.14154361347,523.2511306012],"description":"A harmonic form of Schlesinger's Chromatic Hypodorian Inverted"},"hypod_diat":{"frequencies":[261.6255653006,279.06726965397,299.00064605783,322.00069575458,334.88072358477,348.83408706747,364.00078650518,380.54627680087,418.60090448096,440.63253103259,465.11211608996,492.47165233054,523.2511306012],"description":"Hypodorian Diatonic Tonos"},"hypod_diat2":{"frequencies":[261.6255653006,279.06726965397,322.00069575458,348.83408706747,364.00078650518,380.54627680087,418.60090448096,465.11211608996,523.2511306012],"description":"Schlesinger's Hypodorian Harmonia, a subharmonic series through 13 from 16"},"hypod_diatcon":{"frequencies":[261.6255653006,279.06726965397,322.00069575458,348.83408706747,364.00078650518,418.60090448096,465.11211608996,523.2511306012],"description":"A Hypodorian Diatonic with its own trite synemmenon replacing paramese"},"hypod_diatinv":{"frequencies":[261.6255653006,294.32876096318,327.03195662575,359.73515228832,376.08675011961,392.4383479509,425.14154361347,457.84473927605,490.54793493862,523.2511306012],"description":"Inverted Schlesinger's Hypodorian Harmonia, a harmonic series from 8 from 16"},"hypod_enh":{"frequencies":[261.6255653006,270.06509966514,274.49239638096,279.06726965397,310.07474405997,348.83408706747,364.00078650518,380.54627680087,389.39619021485,393.97732186443,398.6675280771,452.54151835779,523.2511306012],"description":"Hypodorian Enharmonic Tonos"},"hypod_enhinv":{"frequencies":[261.6255653006,343.38355445704,351.55935337268,359.73515228832,392.4383479509,490.54793493862,506.89953276991,523.2511306012],"description":"Inverted Schlesinger's Enharmonic Hypodorian Harmonia"},"hypod_enhinv2":{"frequencies":[261.6255653006,269.80136421624,277.97716313189,359.73515228832,392.4383479509,400.61414686654,408.78994578219,523.2511306012],"description":"A harmonic form of Schlesinger's Hypodorian enharmonic inverted"},"hypodorian_pis":{"frequencies":[261.6255653006,285.40970760065,313.95067836072,348.83408706747,392.4383479509,418.60090448096,483.00104363188,523.2511306012,546.00117975777,570.81941520131,627.90135672144,697.66817413493,784.8766959018,897.00193817349,966.00208726375,1046.5022612024],"description":"Diatonic Perfect Immutable System in the Hypodorian Tonos"},"hypol_chrom":{"frequencies":[261.6255653006,275.39533189537,290.69507255622,348.83408706747,373.75080757229,402.50086969323,418.60090448096,436.04260883433,523.2511306012],"description":"Schlesinger's Hypolydian Harmonia in the chromatic genus"},"hypol_chrominv":{"frequencies":[261.6255653006,313.95067836072,327.03195662575,340.11323489078,366.27579142084,392.4383479509,470.92601754108,497.08857407114,523.2511306012],"description":"Inverted Schlesinger's Chromatic Hypolydian Harmonia"},"hypol_chrominv2":{"frequencies":[261.6255653006,274.70684356563,287.78812183066,340.11323489078,366.27579142084,392.4383479509,418.60090448096,523.2511306012],"description":"harmonic form of Schlesinger's Chromatic Hypolydian inverted"},"hypol_chrominv3":{"frequencies":[261.6255653006,274.70684356563,287.78812183066,340.11323489078,392.4383479509,418.60090448096,444.76346101102,523.2511306012],"description":"A harmonic form of Schlesinger's Chromatic Hypolydian inverted"},"hypol_diat":{"frequencies":[261.6255653006,290.69507255622,327.03195662575,348.83408706747,373.75080757229,402.50086969323,436.04260883433,475.68284600109,523.2511306012],"description":"Schlesinger's Hypolydian Harmonia, a subharmonic series through 13 from 20"},"hypol_diatcon":{"frequencies":[261.6255653006,290.69507255622,327.03195662575,348.83408706747,402.50086969323,436.04260883433,475.68284600109,523.2511306012],"description":"A Hypolydian Diatonic with its own trite synemmenon replacing paramese"},"hypol_diatinv":{"frequencies":[261.6255653006,287.78812183066,313.95067836072,340.11323489078,366.27579142084,392.4383479509,418.60090448096,470.92601754108,523.2511306012],"description":"Inverted Schlesinger's Hypolydian Harmonia, a harmonic series from 10 from 20"},"hypol_enh":{"frequencies":[261.6255653006,268.33391312882,275.39533189537,348.83408706747,373.75080757229,402.50086969323,418.60090448096,436.04260883433,523.2511306012],"description":"Schlesinger's Hypolydian Harmonia in the enharmonic genus"},"hypol_enhinv":{"frequencies":[261.6255653006,327.03195662575,333.57259575826,340.11323489078,366.27579142084,392.4383479509,497.08857407114,510.16985233617,523.2511306012],"description":"Inverted Schlesinger's Enharmonic Hypolydian Harmonia"},"hypol_enhinv2":{"frequencies":[261.6255653006,268.16620443312,274.70684356563,340.11323489078,366.27579142084,379.35706968587,392.4383479509,523.2511306012],"description":"A harmonic form of Schlesinger's Hypolydian enharmonic inverted"},"hypol_enhinv3":{"frequencies":[261.6255653006,268.16620443312,274.70684356563,340.11323489078,392.4383479509,405.51962621593,418.60090448096,523.2511306012],"description":"A harmonic form of Schlesinger's Hypolydian enharmonic inverted"},"hypol_pent":{"frequencies":[261.6255653006,272.52663052146,290.69507255622,348.83408706747,373.75080757229,402.50086969323,415.27867508032,436.04260883433,523.2511306012],"description":"Schlesinger's Hypolydian Harmonia in the pentachromatic genus"},"hypol_tri":{"frequencies":[261.6255653006,270.64713651786,280.31310567921,348.83408706747,373.75080757229,402.50086969323,413.09299784305,424.25767346043,523.2511306012],"description":"Schlesinger's Hypolydian Harmonia in the first trichromatic genus"},"hypol_tri2":{"frequencies":[261.6255653006,270.64713651786,290.69507255622,348.83408706747,373.75080757229,402.50086969323,413.09299784305,436.04260883433,2093.0045224048],"description":"Schlesinger's Hypolydian Harmonia in the second trichromatic genus"},"hypolydian_pis":{"frequencies":[261.6255653006,281.75060878526,305.22982618403,332.97799220076,366.27579142084,406.97310157871,457.84473927605,488.36772189445,523.2511306012,563.50121757052,610.45965236807,665.95598440153,732.55158284168,813.94620315742,915.6894785521,1046.5022612024],"description":"The Diatonic Perfect Immutable System in the Hypolydian Tonos"},"hypop_chrom":{"frequencies":[261.6255653006,277.01530443593,285.40970760065,294.32876096318,336.37572681506,362.25078272391,376.74081403286,392.4383479509,409.50088481833,418.60090448096,428.11456140098,470.92601754108,523.2511306012],"description":"Hypophrygian Chromatic Tonos"},"hypop_chromenh":{"frequencies":[261.6255653006,269.10058145205,277.01530443593,362.25078272391,392.4383479509,409.50088481833,428.11456140098,523.2511306012],"description":"Schlesinger's Hypophrygian Harmonia in a mixed chromatic-enharmonic genus"},"hypop_chrominv":{"frequencies":[261.6255653006,319.76457981184,334.29933343966,348.83408706747,377.90359432309,465.11211608996,494.18162334558,523.2511306012],"description":"Inverted Schlesinger's Chromatic Hypophrygian Harmonia"},"hypop_chrominv2":{"frequencies":[261.6255653006,276.16031892841,290.69507255622,348.83408706747,377.90359432309,406.97310157871,436.04260883433,523.2511306012],"description":"A harmonic form of Schlesinger's Chromatic Hypophrygian inverted"},"hypop_diat":{"frequencies":[261.6255653006,294.32876096318,303.82323712328,313.95067836072,336.37572681506,362.25078272391,376.74081403286,392.4383479509,428.11456140098,448.50096908674,470.92601754108,495.71159741166,523.2511306012],"description":"Hypophrygian Diatonic Tonos"},"hypop_diat2":{"frequencies":[261.6255653006,294.32876096318,313.95067836072,362.25078272391,376.74081403286,392.4383479509,428.11456140098,470.92601754108,523.2511306012],"description":"Schlesinger's Hypophrygian Harmonia"},"hypop_diat2inv":{"frequencies":[261.6255653006,290.69507255622,319.76457981184,348.83408706747,363.36884069528,377.90359432309,436.04260883433,465.11211608996,523.2511306012],"description":"Inverted Schlesinger's Hypophrygian Harmonia, a harmonic series from 9 from 18"},"hypop_diatcon":{"frequencies":[261.6255653006,294.32876096318,313.95067836072,362.25078272391,376.74081403286,428.11456140098,470.92601754108,523.2511306012],"description":"A Hypophrygian Diatonic with its own trite synemmenon replacing paramese"},"hypop_enh":{"frequencies":[261.6255653006,269.10058145205,273.00058987889,277.01530443593,313.95067836072,362.25078272391,376.74081403286,392.4383479509,400.78810003496,405.0976494977,409.50088481833,470.92601754108,523.2511306012],"description":"Hypophrygian Enharmonic Tonos"},"hypop_enhinv":{"frequencies":[261.6255653006,334.29933343966,341.56671025356,348.83408706747,377.90359432309,494.18162334558,508.71637697339,523.2511306012],"description":"Inverted Schlesinger's Enharmonic Hypophrygian Harmonia"},"hypop_enhinv2":{"frequencies":[261.6255653006,268.89294211451,276.16031892841,348.83408706747,377.90359432309,392.4383479509,406.97310157871,523.2511306012],"description":"A harmonic form of Schlesinger's Hypophrygian enharmonic inverted"},"hypophryg_pis":{"frequencies":[261.6255653006,283.42769574232,309.19384990071,340.11323489078,377.90359432309,425.14154361347,453.48431318771,523.2511306012,544.18117582525,566.85539148463,618.38769980142,680.22646978156,755.80718864618,850.28308722695,971.75209968794,1046.5022612024],"description":"The Diatonic Perfect Immutable System in the Hypophrygian Tonos"},"kanzelmeyer_11":{"frequencies":[261.6255653006,277.97716313189,310.68035879446,327.03195662575,359.73515228832,376.08675011961,392.4383479509,425.14154361347,457.84473927605,474.19633710734,506.89953276991,523.2511306012],"description":"Bruce Kanzelmeyer, 11 harmonics from 16 to 32. Base 388.3614815 Hz"},"kanzelmeyer_18":{"frequencies":[261.6255653006,277.97716313189,302.50455987882,310.68035879446,327.03195662575,335.20775554139,351.55935337268,359.73515228832,376.08675011961,384.26254903526,392.4383479509,425.14154361347,433.31734252912,457.84473927605,474.19633710734,482.37213602298,498.72373385427,506.89953276991,523.2511306012],"description":"Bruce Kanzelmeyer, 18 harmonics from 32 to 64. Base 388.3614815 Hz"},"kayolonian":{"frequencies":[261.6255653006,267.90457886781,279.06726965397,294.32876096318,306.59245933664,313.95067836072,327.03195662575,334.88072358477,348.83408706747,357.20610515709,372.08969287196,392.4383479509,408.78994578219,418.60090448096,436.04260883433,446.50763144636,465.11211608996,490.54793493862,510.98743222773,523.2511306012],"description":"19-tone 5-limit scale of the Kayenian Imperium on Kayolonia (reeks van Sjauriek)"},"kayolonian_12":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,313.95067836072,327.03195662575,348.83408706747,392.4383479509,408.78994578219,418.60090448096,436.04260883433,465.11211608996,490.54793493862,523.2511306012],"description":"See Barnard: De Keiaanse Muziek, p. 11. (uitgebreide reeks)"},"kayolonian_40":{"frequencies":[261.6255653006,267.90457886781,272.52663052146,275.93321340298,279.06726965397,290.69507255622,294.32876096318,297.67175429757,306.59245933664,310.07474405997,313.95067836072,319.36714514233,327.03195662575,331.11985608357,334.88072358477,340.65828815182,348.83408706747,353.19451315581,357.20610515709,363.36884069528,367.91095120397,372.08969287196,376.74081403286,383.2405741708,387.59343007496,392.4383479509,401.85686830172,408.78994578219,413.43299207996,418.60090448096,436.04260883433,441.49314144476,446.50763144636,459.88868900496,465.11211608996,470.92601754108,490.54793493862,496.11959049595,502.32108537715,510.98743222773,523.2511306012],"description":"See Barnard: De Keiaanse Muziek"},"kayolonian_f":{"frequencies":[261.6255653006,279.06726965397,306.59245933664,327.03195662575,348.83408706747,392.4383479509,418.60090448096,446.50763144636,490.54793493862,523.2511306012],"description":"Kayolonian scale F and periodicity block (128/125, 16875/16384)"},"kayolonian_p":{"frequencies":[261.6255653006,279.06726965397,306.59245933664,327.03195662575,348.83408706747,392.4383479509,418.60090448096,459.88868900496,490.54793493862,523.2511306012],"description":"Kayolonian scale P"},"kayolonian_s":{"frequencies":[261.6255653006,287.4304306281,306.59245933664,327.03195662575,359.28803828513,392.4383479509,418.60090448096,459.88868900496,490.54793493862,523.2511306012],"description":"Kayolonian scale S"},"kayolonian_t":{"frequencies":[261.6255653006,279.06726965397,297.67175429757,317.51653791741,348.83408706747,381.01984550089,418.60090448096,446.50763144636,476.27480687611,523.2511306012],"description":"Kayolonian scale T"},"kayolonian_z":{"frequencies":[261.6255653006,279.06726965397,297.67175429757,327.03195662575,348.83408706747,392.4383479509,418.60090448096,446.50763144636,476.27480687611,523.2511306012],"description":"Kayolonian scale Z"},"kayoloniana":{"frequencies":[261.6255653006,267.90457886781,279.06726965397,294.32876096318,306.59245933664,313.95067836072,327.03195662575,334.88072358477,348.83408706747,367.91095120397,372.08969287196,392.4383479509,408.78994578219,418.60090448096,436.04260883433,446.50763144636,465.11211608996,490.54793493862,510.98743222773,523.2511306012],"description":"Amendment by Rasch of Kayolonian scale's note 9"},"kebyar-b":{"frequencies":[261.6255653006,280.40333801024,299.48910562989,384.37207420335,402.78320381033,523.2511306012],"description":"Gamelan Kebyar tuning begbeg, Andrew Toth, 1993"},"kebyar-s":{"frequencies":[261.6255653006,283.00682726281,309.51375468789,385.26118901859,416.26536455926,523.2511306012],"description":"Gamelan kebyar tuning sedung, Andrew Toth, 1993"},"kebyar-t":{"frequencies":[261.6255653006,293.15632631094,325.27731021818,397.46748834812,422.07621250312,523.2511306012],"description":"Gamelan kebyar tuning tirus, Andrew Toth, 1993"},"keenan":{"frequencies":[261.6255653006,279.77706779472,292.57243455474,305.95298478736,327.17991022208,349.87955533643,365.88099775759,391.26571058456,418.41160951721,437.54730686196,457.55816161244,489.30340830564,523.2511306012],"description":"Dave Keenan 31-ET mode has 3 4:5:6:7 tetrads + 3 inv. is Fokker's 12-tone mode"},"keenan2":{"frequencies":[261.6255653006,278.14493936283,295.70736791055,306.84360659709,326.21810583671,346.81593583087,369.99442271164,393.35634555235,418.19337019276,433.94238997708,461.34206956593,490.47180009913,523.2511306012],"description":"Dave Keenan strange 9-limit temperament TL 19-11-98"},"keenan3":{"frequencies":[261.6255653006,272.10155294862,282.99701916355,314.19580976213,326.77681046955,339.86157848985,377.32935907335,392.4383479509,408.1523292189,453.14877154631,471.29371440761,523.2511306012],"description":"Chain of 1/6 kleisma tempered 6/5s, 10 tetrads, Dave Keenan, 30-Jun-99, TD235"},"keenan3eb":{"frequencies":[261.6255653006,272.52625793573,283.88113057344,314.31833892864,327.41448875753,341.05629284549,377.62371824792,393.35750206077,409.74683779238,453.67913385439,472.5817850056,523.2511306012],"description":"Chain of 11 equal beating minor thirds, 6/5=3/2 same"},"keenan3eb2":{"frequencies":[261.6255653006,271.88912362492,282.55531921581,314.13446783,326.45794787121,339.26487744082,377.18204004818,391.97887331053,407.35618327602,452.88341485066,470.6500094,523.2511306012],"description":"Chain of 11 equal beating minor thirds, 6/5=3/2 opposite"},"keenan3j":{"frequencies":[261.6255653006,291.88463270656,302.72962012827,313.97755176024,350.29154279212,363.30663963964,405.32593044476,420.38583225541,436.00528786292,486.43275040712,504.50618240233,523.2511306012],"description":"Chain of 11 nearly just 19-tET minor thirds, Dave Keenan, 1-Jul-99"},"keenan7":{"frequencies":[261.6255653006,269.29177952703,279.86396690685,288.06460709314,296.5055443788,305.19382000629,314.13668154225,326.46944327063,336.03572815422,349.22823143301,359.46139971304,369.99442271164,380.8360868427,391.99543598175,407.38487419079,419.32216217931,435.78442404634,448.5538823653,461.69751437372,475.22628419761,489.15147723638,508.3551866238,523.2511306012],"description":"Dave Keenan, 22 out of 72-tET periodicity block. TL 29-04-2001"},"keenanmt":{"frequencies":[261.6255653006,279.93529690293,292.50627485027,305.64177427204,327.03195662575,349.91912034749,365.63284274659,391.22147055517,418.60090448096,437.39890198442,457.04105241293,489.02683710225,523.2511306012],"description":"Dave Keenan 1/4-comma tempered version of keenan with 6 7-limit tetrads"},"keenanst":{"frequencies":[261.6255653006,268.50609092997,277.46533822773,286.72352888229,294.26410920268,304.08282473376,314.22916151277,322.49311613356,333.25374941849,342.01803421352,353.43015577174,365.22306367425,374.82811589307,387.33500976677,397.52158713557,410.7856943143,424.4923875554,435.65616946139,450.19271626925,462.0323945472,477.44903730562,493.38008744487,506.35555615636,523.2511306012],"description":"Dave Keenan, 7-limit temperament, g=260.353"},"kelletat":{"frequencies":[261.6255653006,275.58617649731,292.98704147282,310.05056613125,327.14272545641,348.82502010853,367.43868454848,391.99543598175,413.39000965417,437.97145880542,465.08793784701,489.90551202062,523.2511306012],"description":"Herbert Kelletat's Bach-tuning (1967)"},"kellner":{"frequencies":[261.6255653006,275.62199471997,292.73769384471,310.07474405997,327.54963108844,348.83408706747,367.49599295996,391.37619916626,413.43299207996,437.91808280662,465.11211608996,491.32444638706,523.2511306012],"description":"Herbert Anton Kellner's Bach tuning. 5 1/5 Pyth. comma and 7 pure fifths"},"kellners":{"frequencies":[261.6255653006,275.84425785506,292.86986732103,310.2247482054,327.84547867349,348.89032888179,367.85164222246,391.46454285105,413.69968681881,438.2147004401,465.26210635182,491.68894399626,523.2511306012],"description":"Kellner's temperament with 1/5 synt. comma instead of 1/5 Pyth. comma"},"kepler1":{"frequencies":[261.6255653006,275.93321340298,294.32876096318,313.95067836072,327.03195662575,348.83408706747,367.91095120397,392.4383479509,413.89982010446,441.49314144476,470.92601754108,490.54793493862,523.2511306012],"description":"Kepler's Monochord no.1, Harmonices Mundi (1619)"},"kepler2":{"frequencies":[261.6255653006,275.93321340298,294.32876096318,313.95067836072,327.03195662575,348.83408706747,367.91095120397,392.4383479509,418.60090448096,441.49314144476,470.92601754108,490.54793493862,523.2511306012],"description":"Kepler's Monochord no.2"},"kepler3":{"frequencies":[261.6255653006,275.93321340298,294.32876096318,313.95067836072,327.03195662575,348.83408706747,367.91095120397,392.4383479509,413.89982010446,441.49314144476,470.92601754108,496.67978412536,523.2511306012],"description":"Kepler's choice system, Harmonices Mundi, Liber III (1619)"},"kilroy":{"frequencies":[261.6255653006,294.32876096318,313.95067836072,327.03195662575,348.83408706747,367.91095120397,392.4383479509,418.60090448096,436.04260883433,441.49314144476,465.11211608996,490.54793493862,523.2511306012],"description":"Kilroy"},"kimball":{"frequencies":[261.6255653006,272.52663052146,275.93321340298,290.69507255622,294.32876096318,306.59245933664,327.03195662575,331.11985608357,348.83408706747,363.36884069528,367.91095120397,392.4383479509,408.78994578219,436.04260883433,441.49314144476,459.88868900496,465.11211608996,490.54793493862,523.2511306012],"description":"Buzz Kimball 18-note just scale"},"kimball_53":{"frequencies":[261.6255653006,277.01530443593,277.97716313189,279.06726965397,281.75060878526,283.42769574232,285.40970760065,287.78812183066,296.50897400735,299.00064605783,305.22982618403,307.79478270659,309.19384990071,313.95067836072,317.68818643644,319.76457981184,322.00069575458,327.03195662575,332.97799220076,338.57426097725,340.11323489078,342.12573923925,348.83408706747,359.73515228832,362.25078272391,366.27579142084,369.35373924791,370.63621750918,373.75080757229,377.90359432309,380.54627680087,392.4383479509,400.13321751856,402.50086969323,404.33041910093,411.12588832951,418.60090448096,425.14154361347,428.11456140098,430.91269578922,436.04260883433,442.75095666255,444.76346101102,448.50096908674,457.84473927605,461.69217405988,475.68284600109,479.64686971777,483.00104363188,485.87604984397,490.54793493862,492.47165233054,494.18162334558,523.2511306012],"description":"Buzz Kimball 53-note just scale"},"kirkwood":{"frequencies":[261.6255653006,294.32876096318,305.22982618403,327.03195662575,348.83408706747,392.4383479509,436.04260883433,457.84473927605,523.2511306012],"description":"Scale based on Kirkwood gaps of the asteroid belt"},"kirn-stan":{"frequencies":[261.6255653006,276.16031892841,292.60754013883,310.68035879446,327.03195662575,348.83408706747,368.21375857121,392.4383479509,414.24047839262,437.1900893839,465.11211608996,490.54793493862,523.2511306012],"description":"Kirnberger temperament improved by Charles Earl Stanhope (1806)"},"kirnberger":{"frequencies":[261.6255653006,275.62199471997,292.50627485027,310.07474405997,327.03195662575,348.83408706747,367.91095120397,391.22147055517,413.43299207996,437.39890198442,465.11211608996,490.54793493862,523.2511306012],"description":"Kirnberger's well-temperament, also called Kirnberger III, letter to Forkel 1779"},"kirnberger1":{"frequencies":[261.6255653006,275.62199471997,294.32876096318,310.07474405997,327.03195662575,348.83408706747,367.91095120397,392.4383479509,413.43299207996,438.75944753732,465.11211608996,490.54793493862,523.2511306012],"description":"Kirnberger's temperament 1 (1766)"},"kirnberger2":{"frequencies":[261.6255653006,275.93321340298,294.32876096318,310.07474405997,327.03195662575,348.83408706747,367.91095120397,392.4383479509,413.89982010446,438.75941205608,465.11211608996,490.54793493862,523.2511306012],"description":"Kirnberger 2: 1/2 synt. comma. \"Die Kunst des reinen Satzes\" (1774)"},"kirnberger3":{"frequencies":[261.6255653006,275.93321340298,292.50627485027,310.07474405997,327.03195662575,348.83408706747,367.91095120397,391.22147055517,413.89982010446,437.39890198442,465.11211608996,490.54793493862,523.2511306012],"description":"Kirnberger 3: 1/4 synt. comma (1744)"},"kirnberger3v":{"frequencies":[261.6255653006,275.93321340298,292.50063201309,310.07474405997,327.03195662575,348.83408706747,367.91095120397,391.21579858034,413.43299207996,437.39258595147,465.11211608996,490.54793493862,523.2511306012],"description":"Variant well-temperament like Kirnberger 3, Kenneth Scholz, MTO 4.4, 1998"},"klais":{"frequencies":[261.6255653006,275.62199471997,293.00227310437,310.07474405997,327.21690075602,348.83408706747,367.49599295996,391.99543598175,413.43299207996,438.01699797506,465.11211608996,489.99465727995,523.2511306012],"description":"Johannes Klais, Bach temperament"},"klonaris":{"frequencies":[261.6255653006,277.97716313189,294.32876096318,310.68035879446,327.03195662575,343.38355445704,359.73515228832,392.4383479509,408.78994578219,425.14154361347,457.84473927605,490.54793493862,523.2511306012],"description":"Johnny Klonaris, 19-limit harmonic scale"},"knot":{"frequencies":[261.6255653006,268.26840191956,280.31310567921,286.15296204753,294.32876096318,299.00064605783,306.59245933664,327.03195662575,348.83408706747,357.69120255941,366.27579142084,367.91095120397,381.53728273004,392.4383479509,408.78994578219,418.60090448096,429.2294430713,436.04260883433,448.50096908674,457.84473927605,459.88868900496,476.92160341255,478.40103369253,490.54793493862,523.2511306012],"description":"Smallest knot in 3-D, American Scientist, Nov-Dec '97 p506-510, trefoil knot"},"koepf_36":{"frequencies":[261.6255653006,272.26348829648,274.95017225036,277.18263097687,288.45311779165,291.29956028699,293.66476791741,305.60543275312,308.62113352716,311.12698372208,323.77767743764,326.97270111135,329.62755691287,343.03050002254,346.41550969045,349.22823143301,363.4281550135,367.0144478307,369.99442271164,385.03871768789,388.83826257328,391.99543598175,407.93431128975,411.95978887118,415.30469757995,432.19134773437,436.45619266906,440,457.89078262597,462.40922843744,466.16376151809,485.11838543951,489.90551202062,493.88330125613,513.96502576833,519.03680970905,523.2511306012],"description":"Siegfried Koepf, 36-tone subset of 48-tone scale (1991)"},"koepf_48":{"frequencies":[261.6255653006,269.44737349144,272.26348829648,274.95017225036,277.18263097687,285.46954808622,288.45311779165,291.29956028699,293.66476791741,302.44445076078,305.60543275312,308.62113352716,311.12698372208,320.42873367481,323.77767743764,326.97270111135,329.62755691287,339.48241770075,343.03050002254,346.41550969045,349.22823143301,359.66909273781,363.4281550135,367.0144478307,369.99442271164,381.0561299374,385.03871768789,388.83826257328,391.99543598175,403.71490654806,407.93431128975,411.95978887118,415.30469757995,427.72104413038,432.19134773437,436.45619266906,440,453.15466093696,457.89078262597,462.40922843744,466.16376151809,480.10063929961,485.11838543951,489.90551202062,493.88330125613,508.64890891624,513.96502576833,519.03680970905,523.2511306012],"description":"Siegfried Koepf, 48-tone scale (1991)"},"kolinsky":{"frequencies":[261.6255653006,277.2273508585,293.75953199293,311.27759533081,329.84032939425,349.51003591412,370.35272620855,392.4383479509,415.84102607989,440.63929776914,466.91639276282,494.76049384407,524.26505360912],"description":"Kolinsky's 7th root of 3/2, also invented by Augusto Novaro"},"kora1":{"frequencies":[261.6255653006,293.66476791741,326.78388880949,349.22823143301,391.99543598175,440,489.62261321254,523.2511306012],"description":"Kora tuning Tomora Ba, also called Silaba, 1/1=F, R. King"},"kora2":{"frequencies":[261.6255653006,298.79793764201,315.65242990842,349.22823143301,391.99543598175,447.69106452518,472.94426956511,523.2511306012],"description":"Kora tuning Tomora Mesengo, also called Tomora, 1/1=F, R. King"},"kora3":{"frequencies":[261.6255653006,291.13134764929,330.58093469714,349.22823143301,391.99543598175,436.20415848357,495.31175393723,523.2511306012],"description":"Kora tuning Hardino, 1/1=F, R.King"},"kora4":{"frequencies":[261.6255653006,291.13134764929,330.58093469714,371.06455309218,391.99543598175,436.20415848357,495.31175393723,523.2511306012],"description":"Kora tuning Sauta, 1/1=F, R. King"},"korea_5":{"frequencies":[261.6255653006,294.32876096318,348.83408706747,392.4383479509,470.92601754108,523.2511306012],"description":"According to Lou Harrison, called \"the Delightful\" in Korea"},"kornerup":{"frequencies":[261.6255653006,272.97226153513,280.22976278938,292.38332274669,305.0639823888,313.17470478367,326.75708630452,340.92853547661,349.99278713323,365.17196824772,374.88056242272,391.13935185123,408.10305876469,418.95303445734,437.12302030357,456.08130156398,468.2068441924,488.51296691354,509.70006023951,523.2511306012],"description":"Kornerup's temperament with fifth of (15 - sqrt 5) / 22 octaves"},"kornerup_11":{"frequencies":[261.6255653006,279.06726965397,290.69507255622,313.95067836072,327.03195662575,348.83408706747,392.4383479509,418.60090448096,436.04260883433,470.92601754108,490.54793493862,523.2511306012],"description":"Kornerup's doric minor"},"kraeh_22":{"frequencies":[261.6255653006,267.07609791103,274.70684356563,286.15296204753,294.32876096318,305.22982618403,313.95067836072,320.49131749323,336.37572681506,343.38355445704,353.19451315581,366.27579142084,381.53728273004,392.4383479509,400.61414686654,412.06026534844,436.04260883433,441.49314144476,457.84473927605,470.92601754108,488.36772189445,504.56359022259,523.2511306012],"description":"Kraehenbuehl & Schmidt 7-limit 22-tone tuning"},"kraeh_22a":{"frequencies":[261.6255653006,267.07609791103,269.10058145205,272.52663052146,274.70684356563,279.06726965397,280.31310567921,286.15296204753,294.32876096318,299.00064605783,305.22982618403,311.45900631024,313.95067836072,318.93402246168,320.49131749323,327.03195662575,336.37572681506,343.38355445704,348.83408706747,350.39138209902,353.19451315581,358.80077526939,366.27579142084,367.91095120397,373.75080757229,381.53728273004,392.4383479509,398.6675280771,400.61414686654,403.65087217807,408.78994578219,412.06026534844,418.60090448096,420.46965851882,436.04260883433,441.49314144476,448.50096908674,457.84473927605,467.18850946536,470.92601754108,476.92160341255,478.40103369253,488.36772189445,490.54793493862,498.33441009638,504.56359022259,523.2511306012],"description":"Kraehenbuehl & Schmidt 7-limit 22-tone tuning with \"inflections\" for some tones"},"kraeh_22b":{"frequencies":[261.6255653006,269.10058145205,279.06726965397,286.15296204753,299.00064605783,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,358.80077526939,367.91095120397,381.53728273004,392.4383479509,408.78994578219,420.46965851882,436.04260883433,448.50096908674,457.84473927605,476.92160341255,490.54793493862,504.56359022259,523.2511306012],"description":"Best 22-tET approximation of KRAEH_22A"},"kring1":{"frequencies":[261.6255653006,313.95067836072,327.03195662575,348.83408706747,392.4383479509,418.60090448096,436.04260883433,523.2511306012],"description":"Double-tie circular mirroring of 4:5:6 and Partch's 5-limit tonality Diamond"},"kring1p3":{"frequencies":[261.6255653006,267.90457886781,272.52663052146,279.06726965397,282.55561052465,290.69507255622,294.32876096318,301.39265122629,306.59245933664,310.07474405997,313.95067836072,327.03195662575,334.88072358477,340.65828815182,348.83408706747,353.19451315581,363.36884069528,367.91095120397,372.08969287196,376.74081403286,387.59343007496,392.4383479509,401.85686830172,408.78994578219,418.60090448096,436.04260883433,441.49314144476,446.50763144636,454.2110508691,465.11211608996,470.92601754108,484.4917875937,490.54793493862,502.32108537715,510.98743222773,523.2511306012],"description":"Third carthesian power of double-tie mirroring of 4:5:6 with kleismas removed"},"kring2":{"frequencies":[261.6255653006,299.00064605783,305.22982618403,348.83408706747,392.4383479509,448.50096908674,457.84473927605,523.2511306012],"description":"Double-tie circular mirroring of 6:7:8"},"kring2p3":{"frequencies":[261.6255653006,265.7783520514,271.31540105247,288.32205155576,294.32876096318,299.00064605783,305.22982618403,310.07474405997,329.51091606373,336.37572681506,343.38355445704,348.83408706747,356.10146388137,384.42940207435,392.4383479509,398.6675280771,406.97310157871,415.4517078616,441.49314144476,448.50096908674,457.84473927605,465.11211608996,474.80195184183,504.56359022259,515.07533168556,523.2511306012],"description":"Third power of 6:7:8 mirroring with 1029/1024 intervals removed"},"kring3":{"frequencies":[261.6255653006,305.22982618403,313.95067836072,366.27579142084,373.75080757229,436.04260883433,448.50096908674,523.2511306012],"description":"Double-tie circular mirroring of 3:5:7"},"kring3bp":{"frequencies":[261.6255653006,336.37572681506,366.27579142084,436.04260883433,470.92601754108,560.62621135843,610.45965236807,784.8766959018],"description":"Double-tie BP circular mirroring of 3:5:7"},"kring4":{"frequencies":[261.6255653006,299.00064605783,327.03195662575,366.27579142084,373.75080757229,418.60090448096,457.84473927605,523.2511306012],"description":"Double-tie circular mirroring of 4:5:7"},"kring4p3":{"frequencies":[261.6255653006,267.90457886781,273.37201925287,280.42990280658,286.15296204753,293.02063313667,299.00064605783,305.10270005901,320.49131749323,327.03195662575,334.88072358477,341.71502406609,350.53737850823,357.69120255941,366.27579142084,373.75080757229,382.72082695402,390.53145607553,400.61414686654,408.78994578219,418.60090448096,427.14378008261,448.68784449053,457.84473927605,467.18850946536,478.40103369253,488.16432009441,500.76768358318,510.98743222773,523.2511306012],"description":"Third power of 4:5:7 mirroring with 3136/3125 intervals removed"},"kring5":{"frequencies":[261.6255653006,290.69507255622,336.37572681506,366.27579142084,373.75080757229,406.97310157871,470.92601754108,523.2511306012],"description":"Double-tie circular mirroring of 5:7:9"},"kring5p3":{"frequencies":[261.6255653006,266.96486255163,272.4643387202,278.02483542877,284.8811711051,290.69507255622,296.68339105088,302.73815413355,308.91648380975,316.53463456122,322.99452506247,329.64821227876,336.37572681506,343.24053756638,351.70514951247,358.88280562497,366.27579142084,373.75080757229,381.45007420827,389.23476960028,398.83363954714,406.97310157871,415.27867508032,423.83341578697,432.48307733364,443.14848838571,452.19233508746,461.42075008924,470.92601754108,480.53675259294,492.38720931745,502.43592787495,512.78610798918,523.2511306012],"description":"Third power of 5:7:9 mirroring with 250047/250000 intervals removed"},"kring6":{"frequencies":[261.6255653006,305.22982618403,336.37572681506,348.83408706747,392.4383479509,406.97310157871,448.50096908674,523.2511306012],"description":"Double-tie circular mirroring of 6:7:9"},"kring6p3":{"frequencies":[261.6255653006,267.07609791103,271.31540105247,276.96780524107,288.32205155576,294.32876096318,299.00064605783,305.22982618403,310.07474405997,316.53463456122,324.36230800023,329.51091606373,336.37572681506,343.38355445704,348.83408706747,356.10146388137,361.75386806997,369.29040698809,378.42269266694,384.42940207435,392.4383479509,398.6675280771,406.97310157871,415.4517078616,422.04617941496,432.48307733364,441.49314144476,448.50096908674,457.84473927605,465.11211608996,474.80195184183,494.26637409559,504.56359022259,512.57253609913,523.2511306012],"description":"Third power of 6:7:9 mirroring with 118098/117649 intervals removed"},"krousseau":{"frequencies":[261.6255653006,274.70684356563,294.32876096318,305.22982618403,343.38355445704,348.83408706747,366.27579142084,392.4383479509,406.97310157871,457.84473927605,465.11211608996,488.36772189445,523.2511306012],"description":"Kami Rousseau's tri-blues scale"},"krousseau2":{"frequencies":[261.6255653006,271.34627406517,291.88463270656,302.72962012827,337.74269681563,350.29154279212,363.30663963964,390.80553229045,405.32593044476,452.20508247496,469.00678383895,486.43275040712,523.2511306012],"description":"19-tET version of Kami Rousseau's tri-blues scale"},"kukuya":{"frequencies":[261.6255653006,307.37578701508,361.96165147221,412.67427966689,460.80941404108],"description":"African Kukuya Horns (aerophone, ivory, one note only)"},"kurzw_arab":{"frequencies":[261.6255653006,282.02769802256,290.29174037004,302.26980244078,321.16993719469,349.63190883464,374.94271441196,393.35634555235,411.95978887118,429.20598402782,447.69106452518,496.7443381147,523.2511306012],"description":"Kurzweil \"Empirical Arabic\""},"kurzw_harmp":{"frequencies":[261.6255653006,285.46954808622,287.62123438446,306.48933163909,308.79945157961,324.90175210669,345.81573716922,348.42227432308,427.72104413038,430.94493093825,458.94995811222,462.40922843744,523.2511306012],"description":"Kurzweil \"Empirical Bali/Java Harmonic Pelog\""},"kurzw_melp":{"frequencies":[261.6255653006,281.53940445957,283.98935579354,303.66981774726,307.02089761314,323.96475278212,344.02264297658,347.0163224393,421.10213511252,424.76655906637,451.06547253417,454.99063696457,523.2511306012],"description":"Kurzweil \"Empirical Bali/Java Melodic Pelog\""},"kurzw_slen":{"frequencies":[261.6255653006,266.96862289802,288.95340229325,306.66641795878,318.95145438803,352.26720984209,352.26720984209,389.06292924114,404.41509766528,429.20598402782,464.81937009253,474.03826620294,523.2511306012],"description":"Kurzweil \"Empirical Bali/Java Slendro, Siam 7\""},"kurzw_tibet":{"frequencies":[261.6255653006,270.53905136894,299.14332201883,312.9293240034,325.46525203475,353.69443592699,373.86139962101,397.69714089209,408.87792937274,438.98455767189,471.30800669535,489.90551202062,523.2511306012],"description":"Kurzweil \"Empirical Tibetian Ceremonial\""},"kwazy":{"frequencies":[13.75,13.8425266748,13.92142234948,14.00076777204,14.0805654254,14.16081788707,14.25610896047,14.337361936,14.41907801447,14.50125983535,14.58391005315,14.66703125278,14.76572882594,14.84988638999,14.93452361174,15.01964313826,15.10524789197,15.20689431811,15.29356631363,15.38073220905,15.46839499707,15.55655742089,15.66124080485,15.75050226619,15.84027256598,15.93055451337,16.0213510245,16.11266503216,16.22109048883,16.31354291552,16.40652227664,16.50003157548,16.59407373656,16.70573878851,16.80095347779,16.89671084507,16.99301388521,17.08986590459,17.18726993397,17.30292672931,17.40154500258,17.50072545316,17.60047118468,17.70078541898,17.81989766631,17.92146252619,18.023606257,18.12633215803,18.22964354736,18.35231459047,18.45691397115,18.56210951808,18.66790462912,18.77430261304,18.88130712282,19.00836345475,19.11670199894,19.22565790976,19.335234928,19.44543648263,19.57628896102,19.68786429416,19.80007566685,19.91292659048,20.02642071019,20.16118263857,20.27609169854,20.39165568498,20.50787833065,20.62476338959,20.74231451743,20.88189396397,21.00091073243,21.12060583931,21.24098302814,21.36204643183,21.50579618625,21.62836889778,21.75164008927,21.875613993,22.00029448845,22.14833914981,22.27457391904,22.40152829449,22.52920624893,22.65761190639,22.78674941445,22.94008616579,23.07083364148,23.202326315,23.33456843363,23.46756413327,23.62548236417,23.76013626908,23.89555763659,24.03175070206,24.16872014141,24.30647024079,24.47003364934,24.60950094889,24.74976328722,24.89082505353,25.03269080417,25.2011409598,25.3447753621,25.48922841152,25.63450477396,25.78060914191,25.95409219477,26.10201805756,26.25078702673,26.40040390759,26.55087337946,26.70220060843,26.88188539622,27.03509923475,27.18918616153,27.34415146685,27.5],"description":"Kwazy temperament, g=162.741892, p=600, 5-limit"},"lambdoma5_12":{"frequencies":[261.6255653006,21.80213044172,23.78414230005,26.16255653006,29.06950725562,32.70319566257,37.37508075723,43.60426088343,47.56828460011,52.32511306012,58.13901451124,65.40639132515,71.35242690016,74.75016151446,78.48766959018,87.20852176687,95.13656920022,98.10958698772,104.65022612024,109.01065220858,112.12524227169,116.27802902249,118.92071150027,130.8127826503,145.34753627811,149.50032302891,156.97533918036,163.51597831288,174.41704353373,186.87540378614,196.21917397545,209.30045224048,218.02130441717,261.6255653006,327.03195662575,348.83408706747,392.4383479509,436.04260883433,523.2511306012,654.0639132515,784.8766959018,1046.5022612024,1308.127826503],"description":"5x12 Lambdoma"},"lambdoma_prim":{"frequencies":[261.6255653006,8.43953436454,9.02157121726,11.37502457829,13.76976659477,15.38973913533,16.87906872907,18.04314243452,20.12504348466,22.75004915657,23.78414230005,25.31860309361,27.06471365179,27.53953318954,30.77947827066,34.12507373486,37.37508075723,40.25008696932,41.30929978431,42.19767182268,45.10785608631,46.16921740599,47.56828460011,52.32511306012,56.87512289143,59.07674055175,60.37513045398,63.15099852083,68.84883297384,71.35242690016,74.75016151446,76.94869567665,79.62517204801,87.20852176687,96.38836616338,100.62521742331,104.65022612024,107.72817394731,112.12524227169,118.92071150027,130.8127826503,140.87530439263,156.97533918036,166.48899610038,174.41704353373,186.87540378614,261.6255653006,366.27579142084,392.4383479509,436.04260883433,523.2511306012,610.45965236807,654.0639132515,784.8766959018,915.6894785521,1308.127826503,1831.3789571042],"description":"Prime Lambdoma"},"lambert":{"frequencies":[261.6255653006,276.15600972046,293.19138048956,310.67551062492,328.56569462012,349.50994910362,368.20801314466,391.67947347082,414.23401437362,438.93663604468,466.01326570444,491.89550004992,523.2511306012],"description":"Lambert's temperament (1774) 1/7 Pyth. comma, 5 pure"},"lara":{"frequencies":[261.6255653006,286.4606265643,298.28060863281,313.11013128311,341.05478972476,377.11473546037,395.40657391157,420.13030572059,450.02449304881,492.74350578058,523.2511306012,577.23956595248,599.67057787333],"description":"Sundanese 'multi-laras' gamelan Ki Barong tuning, Weintraub, TL 15-2-99 1/1=497"},"lebanon":{"frequencies":[261.6255653006,285.30470202322,311.12698372208,349.22823143301,391.99543598175,415.30469757995,466.16376151809,523.2511306012],"description":"Lebanese scale? Dastgah Shur"},"leedy":{"frequencies":[261.6255653006,269.80136421624,290.69507255622,294.32876096318,305.22982618403,327.03195662575,348.83408706747,359.73515228832,392.4383479509,436.04260883433,441.49314144476,457.84473927605,490.54793493862,523.2511306012],"description":"Douglas Leedy, scale for \"Pastorale\" (1987), 1/1=f, 10/9 only in vocal parts"},"leeuw1":{"frequencies":[261.6255653006,311.12698372208,349.22823143301,380.8360868427,415.30469757995,466.16376151809,508.3551866238,554.36526195375,604.53960488156,659.25511382574,739.98884542327,806.96355802011,880,987.76660251225],"description":"Ton de Leeuw: non-oct. mode from \"Car nos vignes sont en fleurs\",part 5. 1/1=A"},"leftpistol":{"frequencies":[261.6255653006,275.93321340298,279.06726965397,294.32876096318,327.03195662575,348.83408706747,367.91095120397,392.4383479509,418.60090448096,436.04260883433,441.49314144476,490.54793493862,523.2511306012],"description":"Left Pistol"},"legros1":{"frequencies":[261.6255653006,274.22463192287,292.50627485027,309.49749487796,327.03195662575,348.83408706747,365.63284274659,391.22147055517,411.33694767869,437.39890198442,465.11211608996,489.02683710225,523.2511306012],"description":"Example of temperament with 3 just major thirds"},"legros2":{"frequencies":[261.6255653006,275.07759559501,292.50627485027,309.49749487796,327.03195662575,348.83408706747,366.77012764335,391.22147055517,412.61639318626,437.39890198442,465.11211608996,489.02683710225,523.2511306012],"description":"Example of temperament with 2 just major thirds"},"lehman-bach":{"frequencies":[261.6255653006,276.86979852503,293.00227310437,310.77584116741,328.14198392915,349.6228209638,369.15973155124,391.5530240856,414.83597850347,438.51190905657,465.63764214343,492.21297564769,523.2511306012],"description":"Brad Lehman's Bach keyboard temperament"},"lemba10":{"frequencies":[261.6255653006,283.65327551057,298.9489942119,324.1191713102,341.59697290141,370.35792032269,401.5404117335,423.19307614937,458.82405293702,483.56568031466,524.27976214079],"description":"10-note Lemba scale, Herman Miller"},"lemba12":{"frequencies":[261.6255653006,276.1173031791,283.29759227608,298.9897683987,323.75689816556,341.69016129748,369.99442271164,390.48883496177,400.64329718448,422.83538548023,457.86139629758,483.22286023634,523.2511306012],"description":"Lemba[12] in 270-et (poptimal)"},"lemba22":{"frequencies":[261.6255653006,268.42900262332,276.1173031791,283.29759227608,298.9897683987,306.76484424299,315.55115201964,323.75689816556,341.69016129748,350.57563899649,360.61677037127,369.99442271164,379.61593604418,390.48883496177,400.64329718448,422.83538548023,433.83100318771,446.25671880862,457.86139629758,483.22286023634,495.78882330645,509.98912747823,523.2511306012],"description":"Lemba[22] in 270-et (poptimal)"},"lemba24":{"frequencies":[261.6255653006,275.73346179752,283.65327551057,290.60211247891,298.9489942119,307.53562105228,315.06951922004,324.1191713102,332.05932738876,341.59697290141,351.40856549044,360.01724743313,370.35792032269,390.32910012969,401.5404117335,411.37720579947,423.19307614937,435.34833037897,446.01333880095,458.82405293702,470.06416125332,483.56568031466,497.45499966368,509.64147516102,524.27976214079],"description":"24-note Lemba scale for mapping millerlemba24.kbm"},"lemba8":{"frequencies":[261.6255653006,275.73334871592,283.6533803711,298.94898212432,307.53584843097,324.11927802481,341.59694330429,351.4088110982,370.358025147],"description":"Lemba temperament (4 down, 3 up) TOP tuning, Herman Miller, TL 22-11-2004"},"leusden":{"frequencies":[261.6255653006,275.54404190554,292.50627485027,310.51268695591,327.03195662575,349.91912034749,367.08095907728,391.22147055517,413.66634097248,437.39890198442,466.16376151809,489.02683710225,523.2511306012],"description":"Organ in Gereformeerde kerk De Koningshof, Henk van Eeken, 1984, a'=415, modif. 1/4 mean"},"leven":{"frequencies":[261.6255653006,279.06726965397,298.97057995496,313.95067836072,330.39003879965,348.83408706747,369.35382642901,392.4383479509,418.60090448096,448.46752658184,465.11211608996,502.32108537715,523.2511306012],"description":"Leven's monochord ?"},"ligon":{"frequencies":[261.6255653006,279.66870773512,292.40504357126,309.19384990071,329.87571277032,342.12573923925,366.27579142084,392.4383479509,411.12588832951,436.04260883433,462.87600014722,485.87604984397,523.2511306012],"description":"Jacky Ligon, strictly proper all prime scale, TL 08-09-2000"},"ligon2":{"frequencies":[261.6255653006,276.16031892841,292.40504357126,310.68035879446,331.39238271409,355.06326719367,382.37582620857,411.78935130154,441.2028763945,470.61640148747,500.02992658044,529.4434516734,558.85697676637],"description":"Jacky Ligon, 19-limit symmetrical non-octave scale, 2001"},"ligon3":{"frequencies":[261.6255653006,273.51763645063,286.54228580542,300.86940009569,316.70463167967,334.29933343966,341.25073734861,376.08675011961,401.15920012759,427.90314680276,471.58492637221,481.3910401531,508.13498682828,534.87893350345,561.62288017862,588.36682685379,615.11077352897],"description":"Jacky Ligon, 23-limit non-octave scale (2001)"},"ligon4":{"frequencies":[261.6255653006,278.49926570678,289.46759601673,308.13698517552,320.27237341115,340.92853547661,362.91692931321,386.32347802158,401.53832428939,427.43578342293,444.26952759254,472.92296174596,491.54841572131,523.2511306012,556.99853141357,592.92249142473,616.27397035104,640.54474682231,681.85707095323,725.83385862642,754.41987838254,803.07664857879],"description":"Jacky Ligon, 2/1 Phi Scale, TL 12-04-2001"},"ligon5":{"frequencies":[261.6255653006,273.22765669781,280.653851324,293.09977429907,314.41721066027,328.36040925687,337.28508524374,352.24238645938,377.86132347501,394.61802538749,405.34378524393,423.31898451752,454.1076550834,474.24531572837,487.13535379632,508.73764640933,545.73895363303],"description":"Jacky Ligon, scale for \"Two Golden Flutes\" (2001)"},"ligon6":{"frequencies":[261.6255653006,280.653851324,293.09977429907,314.41721066027,328.36040925687,352.24238645938,377.86132347501,394.61802538749,423.31898451752,442.09155952525,474.24531572837,508.73764640933,531.29821178855,569.94005600595],"description":"Jacky Ligon, \"Primal Golden Tuning\" (2001)"},"ligon7":{"frequencies":[261.6255653006,294.32876096318,321.08592105074,361.22166118208,394.05999401681,443.31749326891,483.61908356609,527.58445479937],"description":"Jacky Ligon, 7 tone, 27/22=generator, MMM 22-01-2002"},"lindley_ea":{"frequencies":[261.6255653006,275.62199471997,293.00227310437,310.07474405997,328.14198392915,349.6228209638,367.9112241576,391.5530240856,413.43299207996,438.51190905657,465.63764214343,491.10256480205,523.2511306012],"description":"Mark Lindley +J. de Boer +W. Drake (1991), for organ Grosvenor Chapel, London"},"lindley_sf":{"frequencies":[261.6255653006,276.24519242498,293.00227310437,310.07474405997,328.14198392915,349.6228209638,368.32692341742,391.5530240856,413.90012676351,438.51190905657,465.63764214343,491.10256480205,523.2511306012],"description":"Lindley (1988) suggestion nr. 2 for Stanford Fisk organ"},"ling-lun":{"frequencies":[261.6255653006,279.38237857051,294.32876096318,314.30517589183,331.11985608357,353.59332287831,372.50983809402,392.4383479509,419.07356785577,441.49314144476,471.45776383774,496.67978412536,523.2511306012],"description":"Scale of Ling Lun from C"},"liu_major":{"frequencies":[261.6255653006,290.69507255622,322.99452506247,348.83408706747,392.4383479509,436.04260883433,484.4917875937,523.2511306012],"description":"Linus Liu's Major Scale, see his 1978 book, \"Intonation Theory\""},"liu_mel":{"frequencies":[261.6255653006,290.69507255622,313.95067836072,348.83408706747,392.4383479509,423.83341578697,436.04260883433,470.92601754108,484.4917875937,523.2511306012],"description":"Linus Liu's Melodic Minor, use 5 and 7 descending and 6 and 8 ascending"},"liu_minor":{"frequencies":[261.6255653006,290.69507255622,313.95067836072,348.83408706747,387.59343007496,418.60090448096,484.4917875937,523.2511306012],"description":"Linus Liu's Harmonic Minor"},"liu_pent":{"frequencies":[261.6255653006,294.32876096318,331.11985608357,353.19451315581,392.4383479509,441.49314144476,496.67978412536,529.79176973372],"description":"Linus Liu's \"pentatonic scale\""},"lorina":{"frequencies":[261.6255653006,271.31540105247,293.02063313667,305.22982618403,313.95067836072,348.83408706747,348.83408706747,385.55346465352,406.97310157871,457.84473927605,457.84473927605,465.11211608996,523.2511306012],"description":"Lorina"},"lt46a":{"frequencies":[261.6255653006,265.62583852249,273.73233506765,277.91772325275,286.39934942254,290.77841553921,299.65253047503,308.79746990018,313.51900484808,323.08712797864,328.02715279963,338.03804253716,348.35444940179,353.68081538041,364.47461587782,370.04745828823,381.3407438317,387.1714705201,398.98735486934,411.16384203565,417.45056598488,430.19052226982,436.76816801564,450.09766813034,463.83396431287,470.92601754108,485.29796386361,492.71820372913,507.75521382755,523.2511306012],"description":"13-limit temperament, minimax g=495.66296 cents"},"lucy_19":{"frequencies":[261.6255653006,272.17716319349,280.81422591737,292.13972001074,301.4102593031,313.56641022552,326.2128298123,336.56461921066,350.13857756143,364.25998604447,375.81913491042,390.97626371576,406.74469336313,419.65201956185,436.57696862128,450.43096951372,468.59726172356,487.49621708267,502.96605061019,523.2511306012],"description":"Lucy's 19-tone scale"},"lucy_24":{"frequencies":[261.6255653006,269.92785558198,272.17712546173,280.81425349217,292.13970819848,301.41031849758,303.92192719902,313.56642833783,326.21280343239,336.56467170065,339.36921655583,350.13858362887,364.25994396351,375.81917832675,390.97625694066,403.38329512334,406.744629928,419.65205349792,436.57694340361,450.43105016925,454.18442712942,468.59728067062,487.49616921257,502.96612033609,523.2511306012],"description":"Lucy/Harrison, meantone tuning from Bbb to Cx, third=1200.0/pi, 1/1=A"},"lucy_31":{"frequencies":[261.6255653006,269.92785558198,272.17712546173,280.81425349217,283.15423815518,292.13970819848,301.41031849758,303.92192719902,313.56642833783,323.51698308414,326.21280343239,336.56467170065,339.36921655583,350.13858362887,361.24970022276,364.25994396351,375.81917832675,378.95082751155,390.97625694066,403.38329512334,406.744629928,419.65205349792,432.96907456701,436.57694340361,450.43105016925,454.18442712942,468.59728067062,483.46750424654,487.49616921257,502.96612033609,507.15726445705,523.2511306012],"description":"Lucy/Harrison's meantone tuning, 1/1=A"},"lucy_7":{"frequencies":[261.6255653006,292.13972001074,326.2128298123,350.13857756143,390.97626371576,436.57696862128,487.49621708267,523.2511306012],"description":"Diatonic Lucy's scale"},"lumma5":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,306.59245933664,327.03195662575,348.83408706747,367.91095120397,392.4383479509,418.60090448096,436.04260883433,459.88868900496,490.54793493862,523.2511306012],"description":"Carl Lumma's 5-limit version of lumma7, also Fokker 12-tone just."},"lumma7":{"frequencies":[261.6255653006,279.06726965397,293.02063313667,305.22982618403,327.03195662575,348.83408706747,366.27579142084,390.69417751556,418.60090448096,436.04260883433,457.84473927605,488.36772189445,523.2511306012],"description":"Carl Lumma's 7-limit 12-tone scale, a.k.a GW Smith's Prism. TL 21-11-98"},"lumma7t":{"frequencies":[261.6255653006,279.68948643792,293.67396186758,305.56991806333,326.66797434652,349.22276480589,366.68390442934,392.00157215927,419.06732091375,436.04260883433,457.84473927605,489.45662770953,523.2511306012],"description":"Tempered lumma7, 6 tetrads + 4 triads within 2c of Just, TL 19-2-99"},"lumma7t72":{"frequencies":[261.6255653006,279.86396690685,293.66476791741,305.19382000629,326.46944327063,349.22823143301,366.44956000397,391.99543598175,419.32216217931,435.78442404634,457.27406033445,489.15147723638,523.2511306012],"description":"72-tET version of lumma7t"},"lumma7t_keen":{"frequencies":[261.6255653006,279.95098841649,293.39965821869,305.14186035122,326.51537799354,349.38597341375,366.17023517096,391.81845653432,419.26317124465,436.04260556019,456.98979229899,488.99939844699,523.2511306012],"description":"Dave Keenan's adaptation of lumma7t to include 6:8:11, TL 17-04-9"},"lumma_10":{"frequencies":[261.6255653006,281.2143451833,302.26980244078,324.90175210669,349.22823143301,375.37611551499,391.99543598175,421.34544350737,452.89298412314,486.80259447109,523.2511306012],"description":"Carl Lumma's 10-tone 125 cent Pyth. scale, TL 29-12-1999"},"lumma_12_fun":{"frequencies":[261.6255653006,276.16031892841,293.246794009,310.68035879446,327.94037872749,348.23056788569,368.93292606842,390.99572534534,413.52379936426,439.8701910135,464.30742384759,491.05951174505,522.34585182853],"description":"Rational well temperament based on 577/289, 3/2, and 19/16."},"lumma_12_moh-ha-ha":{"frequencies":[261.6255653006,276.16031892841,293.42033886144,310.68035879446,330.09788121912,349.51540364377,368.93292606842,391.72740891476,414.24047839262,440.13050829216,466.02053819169,493.4335110265,523.2511306012],"description":"Rational well temperament."},"lumma_12_strangeion":{"frequencies":[261.6255653006,277.97716313189,292.40504357126,310.68035879446,330.09788121912,349.23197505989,368.93292606842,391.9912339477,414.71297038361,440.63253103259,468.17206422213,492.47165233054,523.2511306012],"description":"19-limit \"dodekaphonic\" scale."},"lumma_22":{"frequencies":[261.6255653006,263.29318697558,262.98919438538,262.83732973433,262.68555277841,262.53386346698,263.29318697558,262.38226174944,262.98919438538,262.23074757519,263.29318697558,262.68555277841,262.07932089369,263.29318697558,262.83732973433,263.59753095473,262.38226174944,263.44531501617,262.68555277841,262.98919438538,263.29318697558,263.902226729,261.92798165442],"description":"Carl Lumma, intervals of attraction by trial and error, 1999."},"lumma_5151":{"frequencies":[261.6255653006,276.7826524273,292.81785438923,309.78204413166,327.729041887,346.71578592374,369.67398581173,391.09077971329,413.74834001613,437.71854962063,463.0774559108,489.90551202062,522.3451906503],"description":"Carl Lumma's 5151 temperament III (1197/709.5/696). June 2003"},"lumma_al1":{"frequencies":[261.6255653006,274.63272075836,292.81785438923,309.78204413166,327.729041887,346.71578592374,366.8025131876,391.09077971329,413.74834001613,437.71854962063,463.0774559108,489.90551202062,522.3451906503],"description":"Alaska I (1197/709.5/696), Carl Lumma, 6 June 2003."},"lumma_al2":{"frequencies":[261.6255653006,275.18850165466,292.98704147282,310.05056613125,328.10786809908,347.216824829,367.43868454848,391.20374747207,413.98739946535,438.09796819065,463.6127330944,490.61347436729,522.3451906503],"description":"Alaska II (1197/707/696.5), Carl Lumma, 6 June 2003."},"lumma_al3":{"frequencies":[261.6255653006,275.18850165466,292.98704147282,310.05056613125,328.10786809908,349.32910706765,367.43868454848,391.20374747207,413.98739946535,438.09796819065,463.6127330944,490.61347436729,522.3451906503],"description":"Alaska III (1197/707/696.5), Carl Lumma, 6 June 2003."},"lumma_al4":{"frequencies":[261.6255653006,276.38325105256,293.32570896007,309.87152561537,328.86683469969,349.02656754477,368.7143392539,391.31674786192,413.39000965417,438.73106346722,464.55095742407,491.89038573682,522.04355935974],"description":"Alaska IV (1196/701/697), Carl Lumma, 6 June 2003."},"lumma_al5":{"frequencies":[261.6255653006,276.84261239447,293.89809826895,310.99222741882,329.08061019985,349.35433052883,369.67398581173,391.17550247358,415.27471248744,439.42852501549,464.98720675925,493.63374591774,522.3451906503],"description":"Alaska V (1197/702/696.375), Carl Lumma, 6 June 2003."},"lumma_al6":{"frequencies":[261.6255653006,276.86260193655,293.83444433876,310.94732162256,329.05685050583,349.22823143301,369.56723519412,391.09077971329,415.06487744922,439.23819834286,464.81937009253,493.31307433255,522.04355935974],"description":"Alaska VI (1196/701/696), Carl Lumma, 6 June 2003."},"lumma_al7":{"frequencies":[261.6255653006,276.11677207256,293.26810788146,310.16878953668,328.73958549954,348.42227432308,368.499294457,391.39134599911,413.94674961638,438.72852926454,464.99660740427,491.79379203259,522.3451906503],"description":"Alaska VII, Carl Lumma, 27 Jan 2004"},"lumma_dec1":{"frequencies":[261.6255653006,286.10322937235,299.18791603519,327.17991022208,342.14320575162,374.15409293384,391.26571058456,427.87249484695,457.55816161244,489.30340830564,523.2511306012],"description":"Carl Lumma, two 5-tone 7/4-chains, 5/4 apart in 31-tET, TL 9-2-2000"},"lumma_dec2":{"frequencies":[261.6255653006,286.10322937235,292.57243455474,327.17991022208,342.14320575162,382.6142546815,391.26571058456,437.54730686196,457.55816161244,511.68128147674,523.2511306012],"description":"Carl Lumma, two 5-tone 3/2-chains, 7/4 apart in 31-tET, TL 9-2-2000"},"lumma_magic":{"frequencies":[261.6255653006,293.02063313667,299.00064605783,313.95067836072,327.03195662575,348.83408706747,366.27579142084,373.75080757229,418.60090448096,436.04260883433,457.84473927605,467.18850946536,523.2511306012],"description":"Magic chord test, Carl Lumma, TL 24-06-99"},"lumma_synchtrines+2":{"frequencies":[261.6255653006,277.1478691313,293.59111644706,311.009943641,329.46223568632,349.00930447981,369.71610741159,391.65144749868,414.88821865981,439.50363030131,465.57948255979,493.20241832805,522.46423212702],"description":"The 12-tone equal temperament with 2:3:4 brats of +2"},"lumma_synchtrines-2":{"frequencies":[261.6255653006,277.19623399848,293.69359242342,311.17279259662,329.69226891672,349.31393351076,370.10338321153,392.13011885309,415.46777761785,440.19437666896,466.39258399594,494.14997995304,523.55935978973],"description":"The 12-tone equal temperament with 2:3:4 brats of -2"},"lydian_chrom":{"frequencies":[261.6255653006,275.39533189537,290.69507255622,307.79478270659,317.12189733406,327.03195662575,373.75080757229,402.50086969323,418.60090448096,427.14378008261,436.04260883433,475.68284600109,523.2511306012,550.79066379074,581.39014511244,615.58956541318,634.24379466812,654.0639132515,747.50161514457,805.00173938646,837.20180896192,854.28756016522,872.08521766867,951.36569200218,1046.5022612024],"description":"Lydian Chromatic Tonos"},"lydian_chrom2":{"frequencies":[261.6255653006,272.09058791262,283.42769574232,340.11323489078,377.90359432309,400.13321751856,425.14154361347,523.2511306012],"description":"Schlesinger's Lydian Harmonia in the chromatic genus"},"lydian_chrominv":{"frequencies":[261.6255653006,271.68808704293,281.75060878526,362.25078272391,402.50086969323,422.62591317789,442.75095666255,523.2511306012],"description":"A harmonic form of Schlesinger's Chromatic Lydian inverted"},"lydian_diat":{"frequencies":[261.6255653006,275.39533189537,290.69507255622,327.03195662575,348.83408706747,373.75080757229,387.59343007496,402.50086969323,436.04260883433,455.00098313148,475.68284600109,498.33441009638,523.2511306012,550.79066379074,581.39014511244,654.0639132515,697.66817413493,747.50161514457,852.70554616492,805.00173938646,872.08521766867,910.00196626296,951.36569200218,996.66882019276,1046.5022612024],"description":"Lydian Diatonic Tonos"},"lydian_diat2":{"frequencies":[261.6255653006,283.42769574232,309.19384990071,340.11323489078,358.01393146398,377.90359432309,425.14154361347,485.87604984397,523.2511306012],"description":"Schlesinger's Lydian Harmonia, a subharmonic series through 13 from 26"},"lydian_diat2inv":{"frequencies":[261.6255653006,281.75060878526,322.00069575458,362.25078272391,382.37582620857,402.50086969323,442.75095666255,483.00104363188,523.2511306012],"description":"Inverted Schlesinger's Lydian Harmonia, a harmonic series from 13 from 26"},"lydian_diatcon":{"frequencies":[261.6255653006,283.42769574232,309.19384990071,340.11323489078,358.01393146398,425.14154361347,485.87604984397,523.2511306012],"description":"A Lydian Diatonic with its own trite synemmenon replacing paramese"},"lydian_enh":{"frequencies":[261.6255653006,275.39533189537,290.69507255622,299.00064605783,303.33398875432,307.79478270659,373.75080757229,402.50086969323,410.39304360878,414.45634107026,418.60090448096,475.68284600109,523.2511306012,550.79066379074,581.39014511244,598.00129211566,606.66797750864,615.58956541318,747.50161514457,805.00173938646,820.78608721757,828.91268214051,837.20180896192,951.36569200218,1046.5022612024],"description":"Lydian Enharmonic Tonos"},"lydian_enh2":{"frequencies":[261.6255653006,266.75547834571,272.09058791262,340.11323489078,377.90359432309,388.70083987518,400.13321751856,523.2511306012],"description":"Schlesinger's Lydian Harmonia in the enharmonic genus"},"lydian_enhinv":{"frequencies":[261.6255653006,266.65682617177,271.68808704293,362.25078272391,402.50086969323,412.56339143556,422.62591317789,523.2511306012],"description":"A harmonic form of Schlesinger's Enharmonic Lydian inverted"},"lydian_pent":{"frequencies":[261.6255653006,269.93113880221,283.42769574232,340.11323489078,377.90359432309,395.48050568695,425.14154361347,523.2511306012],"description":"Schlesinger's Lydian Harmonia in the pentachromatic genus"},"lydian_pis":{"frequencies":[261.6255653006,290.69507255622,327.03195662575,373.75080757229,402.50086969323,436.04260883433,475.68284600109,523.2511306012,550.79066379074,581.39014511244,654.0639132515,747.50161514457,805.00173938646,872.08521766867,951.36569200218,1046.5022612024],"description":"The Diatonic Perfect Immutable System in the Lydian Tonos"},"lydian_tri":{"frequencies":[261.6255653006,268.51044859798,275.76748774928,340.11323489078,377.90359432309,392.4383479509,408.13588186894,523.2511306012],"description":"Schlesinger's Lydian Harmonia in the first trichromatic genus"},"lydian_tri2":{"frequencies":[261.6255653006,268.51044859798,283.42769574232,340.11323489078,377.90359432309,392.4383479509,425.14154361347,523.2511306012],"description":"Schlesinger's Lydian Harmonia in the second trichromatic genus"},"nachbaur_6":{"frequencies":[261.6255653006,294.32876096318,327.03195662575,359.73515228832,392.4383479509,457.84473927605,523.2511306012],"description":"Fred Nachbaur's harmonic hexatonic, as used in \"Void of Sensation\""},"nassarre":{"frequencies":[261.6255653006,277.66336828161,294.34406205295,311.66659310186,331.15428443044,350.6431449633,372.56793743951,394.49404533893,419.16071913933,443.82887286778,471.58032351597,495.88429116026,523.2511306012],"description":"Nassarre's Equal Semitones"},"negri5_19":{"frequencies":[261.6255653006,271.22480440713,281.41555648081,291.74090527404,302.70251050738,313.80889368201,325.59966315504,337.54616011163,350.22880998446,363.07896889448,376.72096510961,390.54314115106,405.21705098851,420.08476989056,435.86864979507,451.86099895106,468.83881245397,486.04086171852,504.30291533224,523.2511306012],"description":"Negri temperament, g=126.238272, 5-limit"},"negri_19":{"frequencies":[261.6255653006,269.02825605326,281.18681366715,289.14299126725,302.21061955257,310.76166549402,324.80633749066,333.99672707734,349.09149261831,358.96903024071,375.19240283292,392.14898023137,403.24482870584,421.46921730446,433.39468387282,452.98167562873,465.79878414581,486.85025820508,500.62567766841,523.2511306012],"description":"Negri temperament, 13-limit, g=124.831"},"negri_29":{"frequencies":[261.6255653006,269.02825605326,276.64040740805,281.18681366715,289.14299126725,297.32428710198,302.21061955257,310.76166549402,319.55466133443,324.80633749066,333.99672707734,343.44715857517,349.09149261831,358.96903024071,369.1260526158,375.19240283292,385.80846524917,392.14898023137,403.24482870584,414.65463641221,421.46921730446,433.39468387282,445.65757880387,452.98167562873,465.79878414581,478.97855252217,486.85025820508,500.62567766841,514.79087238232,523.2511306012],"description":"Negri temperament, 13-limit, g=124.831"},"neid-mar-morg":{"frequencies":[261.6255653006,277.49581689502,293.99657683935,311.12698372208,329.99999983505,349.6228209638,369.99442271164,392.4383479509,415.77394625748,440,466.69047534984,494.44133512215,523.2511306012],"description":"Neidhardt-Marpurg-de Morgan temperament (1858)"},"neidhardt1":{"frequencies":[261.6255653006,276.24519242498,293.00227310437,310.42509491746,328.14198392915,348.83408706747,368.32692341742,391.5530240856,414.36778843034,438.51190905657,465.11211608996,491.65745674141,523.2511306012],"description":"Neidhardt I temperament (1724)"},"neidhardt2":{"frequencies":[261.6255653006,276.55731914056,293.00227310437,310.77584116741,328.51274831708,349.22823143301,369.15973155124,391.5530240856,414.36778843034,438.51190905657,466.16376151809,492.7691222293,523.2511306012],"description":"Neidhardt II temperament (1724)"},"neidhardt3":{"frequencies":[261.6255653006,276.55731914056,293.00227310437,310.77584116741,328.51274831708,348.83408706747,369.15973155124,391.5530240856,414.36778843034,438.51190905657,465.63764214343,492.7691222293,523.2511306012],"description":"Neidhardt III temperament (1724) 'Grosse Stadt'"},"neidhardt4":{"frequencies":[261.6255653006,277.18263097687,293.66476791741,311.12698372208,329.62755691287,349.22823143301,369.99442271164,391.99543598175,415.30469757995,440,466.16376151809,493.88330125613,523.2511306012],"description":"Neidhardt IV temperament (1724), equal temperament"},"neidhardtn":{"frequencies":[261.6255653006,276.86979852503,293.66476791741,310.77584116741,329.62755691287,348.83408706747,369.99442271164,391.5530240856,415.30469757995,439.50340943686,466.16376151809,493.32589719545,523.2511306012],"description":"Johann Georg Neidhardt's temperament (1732), alt. 1/6 & 0 P, also Marpurg nr.10"},"neogeb24":{"frequencies":[261.6255653006,270.11478301563,282.39420473706,291.55732426372,295.23185084282,304.81152420286,308.65309481038,318.66826025208,333.15492371116,343.96512368902,348.30015108876,359.6017829051,375.94928703407,388.14807710176,393.03994675222,405.79329398283,424.24066266408,438.00640969567,443.52664897728,457.91818970179,463.68937649142,478.73515685363,500.49846361623,516.73862125829,523.2511306012],"description":"Neo-Gothic e-based lineotuning (T/S or Blackwood's R=e, ~2.71828), 24 notes"},"neogji12":{"frequencies":[261.6255653006,282.52678126125,294.32876096318,317.84262891891,332.97799220076,348.83408706747,374.60024122586,392.4383479509,423.79017189188,441.49314144476,443.97065626768,499.46698830115,523.2511306012],"description":"M. Schulter, neo-Gothic 12-note JI (prim. 2/3/7/11) 1/1=F with Eb key as D+1"},"neogp16a":{"frequencies":[261.6255653006,274.38778799819,281.28352228595,295.02457363685,309.19384990071,317.19205704586,332.33517754401,348.83408706747,366.27579142084,374.86334014511,392.4383479509,411.12588832951,422.62591317789,442.75095666255,464.34856430463,498.91386871277,523.2511306012],"description":"M. Schulter, scale from mainly prime-to-prime ratios and octave complements (Gb-D#)"},"neutr_diat":{"frequencies":[261.6255653006,294.32876096318,320.24370022528,348.83408706747,392.4383479509,427.47405410759,479.82340237272,523.2511306012],"description":"Neutral Diatonic, 9 + 9 + 12 parts, geometric mean of major and minor"},"neutr_pent1":{"frequencies":[261.6255653006,302.32287545847,348.83408706747,392.4383479509,453.48431318771,523.2511306012],"description":"Quasi-Neutral Pentatonic 1, 15/13 x 52/45 in each trichord, after Dudon"},"neutr_pent2":{"frequencies":[261.6255653006,301.87565226992,348.83408706747,392.4383479509,452.81347840488,523.2511306012],"description":"Quasi-Neutral Pentatonic 2, 15/13 x 52/45 in each trichord, after Dudon"},"new_enh":{"frequencies":[261.6255653006,264.89588486686,279.06726965397,348.83408706747,392.4383479509,397.34382730029,418.60090448096,523.2511306012],"description":"New Enharmonic"},"new_enh2":{"frequencies":[261.6255653006,327.03195662575,331.11985608357,348.83408706747,392.4383479509,490.54793493862,496.67978412536,523.2511306012],"description":"New Enharmonic permuted"},"newcastle":{"frequencies":[261.6255653006,273.65745935891,291.9012907804,312.65334602246,327.03195662575,350.28154752005,366.3906401674,390.81668391305,410.48618883318,436.04260883433,467.04206359353,490.54793493862,523.2511306012],"description":"Newcastle modified 1/3-comma meantone"},"norden":{"frequencies":[261.6255653006,274.87601291722,292.73769384471,310.07474405997,327.54963108844,349.78078158391,366.5013507395,391.37619916626,412.31401916973,437.91808280662,466.37437567834,489.99465727995,523.2511306012],"description":"Reconstructed Schnitger temperament, organ in Norden. Ortgies, 2002"},"novaro":{"frequencies":[261.6255653006,274.70684356563,279.06726965397,290.69507255622,294.32876096318,299.00064605783,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,366.27579142084,373.75080757229,392.4383479509,406.97310157871,418.60090448096,436.04260883433,448.50096908674,457.84473927605,465.11211608996,470.92601754108,490.54793493862,498.33441009638,523.2511306012],"description":"9-limit diamond with 21/20, 16/15, 15/8 and 40/21 added for evenness"},"novaro15":{"frequencies":[261.6255653006,279.06726965397,280.31310567921,281.75060878526,283.42769574232,285.40970760065,287.78812183066,290.69507255622,294.32876096318,299.00064605783,301.87565226992,305.22982618403,309.19384990071,313.95067836072,319.76457981184,322.00069575458,327.03195662575,332.97799220076,336.37572681506,340.11323489078,348.83408706747,356.76213450082,359.73515228832,362.25078272391,366.27579142084,373.75080757229,377.90359432309,380.54627680087,383.71749577421,392.4383479509,402.50086969323,406.97310157871,411.12588832951,418.60090448096,425.14154361347,428.11456140098,436.04260883433,442.75095666255,448.50096908674,453.48431318771,457.84473927605,465.11211608996,470.92601754108,475.68284600109,479.64686971777,483.00104363188,485.87604984397,488.36772189445,490.54793493862,523.2511306012],"description":"1-15 diamond, see Novaro, 1927, Sistema Natural base del Natural-Aproximado, p"},"novaro_eb":{"frequencies":[261.6255653006,277.27733921611,293.70273468471,311.34510173929,329.85947563084,349.74559786079,370.61463194963,392.51515715445,416.03831243363,440.72414616847,467.23897542105,495.06435356607,524.26505360912],"description":"Novaro (?) equal beating 4/3 with strectched octave, almost pure 3/2"},"janke1":{"frequencies":[261.6255653006,276.38325105256,293.32570896007,310.58830860439,328.86683469969,349.02656754477,368.7143392539,391.76907592069,414.34624765043,439.23819834286,465.62553897253,492.45896815637,523.2511306012],"description":"Rainer Janke, Temperatur I"},"janke2":{"frequencies":[261.6255653006,276.38325105256,292.98704147282,310.58830860439,328.48713220126,349.02656754477,368.7143392539,391.54284657258,414.34624765043,438.73106346722,465.62553897253,491.89038573682,523.2511306012],"description":"Rainer Janke, Temperatur II"},"janke3":{"frequencies":[261.6255653006,276.22365192501,292.98704147282,310.40895756597,328.29744538229,349.02656754477,368.50142299854,391.54284657258,414.10698098223,438.47771564426,465.62553897253,491.60634075178,523.2511306012],"description":"Rainer Janke, Temperatur III"},"janke4":{"frequencies":[261.6255653006,275.90473010106,292.98704147282,310.76776326996,328.10786809908,349.22823143301,368.07595926604,391.54284657258,413.86785247997,438.47771564426,465.89457252293,491.32245979018,523.2511306012],"description":"Rainer Janke, Temperatur IV"},"janke5":{"frequencies":[261.6255653006,275.58617649731,292.98704147282,310.05056613125,328.10786809908,348.82502010853,367.43868454848,391.54284657258,413.39000965417,438.47771564426,465.08793784701,491.0387427573,523.2511306012],"description":"Rainer Janke, Temperatur V"},"janke6":{"frequencies":[261.6255653006,275.74540729824,292.98704147282,310.58830860439,328.10786809908,349.43001184052,367.65098676472,391.54284657258,413.86785247997,438.47771564426,465.89457252293,491.0387427573,523.2511306012],"description":"Rainer Janke, Temperatur VI"},"janke7":{"frequencies":[261.6255653006,275.42703764514,292.81785438923,311.12698372208,327.91840028839,349.63190883464,367.0144478307,391.54284657258,413.62886206386,438.22451411849,467.24207374344,490.75518955849,523.2511306012],"description":"Rainer Janke, Temperatur VII"},"jemblung1":{"frequencies":[261.6255653006,298.87388797409,337.89601991959,388.44742741354,452.30188977628,523.2511306012],"description":"Scale of bamboo gamelan jemblung from Kalijering, slendro-like. 1/1=590 Hz."},"jemblung2":{"frequencies":[261.6255653006,300.03885820455,355.06324470257,391.40016308218,451.61555914985,523.2511306012],"description":"Bamboo gamelan jemblung at Royal Batavia Society. 1/1=504 Hz."},"ji_10coh":{"frequencies":[261.6255653006,283.42769574232,299.7792935736,327.03195662575,348.83408706747,370.63621750918,392.4383479509,436.04260883433,457.84473927605,485.0974023282,523.2511306012],"description":"Differentially coherent 10-tone scale"},"ji_10coh2":{"frequencies":[261.6255653006,305.22982618403,313.95067836072,348.83408706747,366.27579142084,392.4383479509,418.60090448096,436.04260883433,470.92601754108,479.64686971777,523.2511306012],"description":"Other diff. coherent 10-tone scale"},"ji_11":{"frequencies":[261.6255653006,276.96780524107,294.32876096318,316.53463456122,336.37572681506,356.10146388137,384.42940207435,406.97310157871,432.48307733364,465.11211608996,494.26637409559,523.2511306012],"description":"3 and 7 prime rational interpretation of 11-tET. OdC 2000"},"ji_12":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,313.95067836072,327.03195662575,348.83408706747,366.27579142084,392.4383479509,418.60090448096,436.04260883433,470.92601754108,490.54793493862,523.2511306012],"description":"Basic JI with 7-limit tritone"},"ji_12a":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,305.22982618403,327.03195662575,348.83408706747,366.27579142084,392.4383479509,418.60090448096,448.50096908674,457.84473927605,490.54793493862,523.2511306012],"description":"7-limit 12-tone scale"},"ji_12b":{"frequencies":[261.6255653006,272.52663052146,290.69507255622,305.22982618403,327.03195662575,343.38355445704,366.27579142084,392.4383479509,418.60090448096,448.50096908674,457.84473927605,490.54793493862,523.2511306012],"description":"alternate 7-limit 12-tone scale"},"ji_12c":{"frequencies":[261.6255653006,272.52663052146,294.32876096318,313.95067836072,327.03195662575,348.83408706747,367.91095120397,392.4383479509,418.60090448096,436.04260883433,457.84473927605,490.54793493862,523.2511306012],"description":"Kurzweil \"Just with natural b7th\", is Sauveur Just with 7/4"},"ji_13":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,310.07474405997,327.03195662575,348.83408706747,367.91095120397,372.08969287196,392.4383479509,418.60090448096,441.49314144476,465.11211608996,490.54793493862,523.2511306012],"description":"5-limit 12-tone symmetrical scale with two tritones"},"ji_17":{"frequencies":[261.6255653006,271.31540105247,283.8170195002,294.32876096318,310.07474405997,321.55899383997,336.37572681506,348.83408706747,361.75386806997,378.42269266694,392.4383479509,406.97310157871,425.72552925031,441.49314144476,465.11211608996,482.33849075995,504.56359022259,523.2511306012],"description":"3 and 7 prime rational interpretation of 17-tET. OdC"},"ji_17a":{"frequencies":[261.6255653006,272.52663052146,282.55561052465,294.32876096318,310.07474405997,321.08592105074,334.88072358477,348.83408706747,363.36884069528,376.74081403286,392.4383479509,408.78994578219,426.35277308246,441.49314144476,465.11211608996,484.4917875937,502.32108537715,523.2511306012],"description":"3, 5 and 11 prime rational interpretation of 17-tET, OdC"},"ji_17b":{"frequencies":[261.6255653006,272.52663052146,285.40970760065,294.32876096318,310.07474405997,319.76457981184,334.88072358477,348.83408706747,359.73515228832,380.54627680087,392.4383479509,408.78994578219,428.11456140098,441.49314144476,465.11211608996,479.64686971777,502.32108537715,523.2511306012],"description":"Alt. 3, 5 and 11 prime rational interpretation of 17-tET, OdC"},"ji_19":{"frequencies":[261.6255653006,272.52663052146,275.93321340298,279.06726965397,294.32876096318,306.59245933664,313.95067836072,327.03195662575,348.83408706747,353.19451315581,367.91095120397,392.4383479509,408.78994578219,418.60090448096,436.04260883433,441.49314144476,459.88868900496,470.92601754108,490.54793493862,523.2511306012],"description":"5-limit 19-tone scale"},"ji_20":{"frequencies":[261.6255653006,271.31540105247,279.38237857051,288.32205155576,299.00064605783,310.07474405997,321.55899383997,331.11985608357,348.83408706747,356.10146388137,372.50983809402,384.42940207435,392.4383479509,413.43299207996,425.72552925031,441.49314144476,457.84473927605,474.80195184183,489.99465727995,504.56359022259,523.2511306012],"description":"3 and 7 prime rational interpretation of 20-tET. OdC"},"ji_21":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,290.69507255622,299.00064605783,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,366.27579142084,373.75080757229,392.4383479509,406.97310157871,418.60090448096,436.04260883433,448.50096908674,457.84473927605,470.92601754108,490.54793493862,504.56359022259,523.2511306012],"description":"7-limit 21-tone just scale, Op de Coul, 2001"},"ji_22":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,282.55561052465,294.32876096318,306.59245933664,313.95067836072,327.03195662575,334.88072358477,340.65828815182,348.83408706747,363.36884069528,376.74081403286,392.4383479509,408.78994578219,418.60090448096,436.04260883433,454.2110508691,470.92601754108,490.54793493862,502.32108537715,510.98743222773,523.2511306012],"description":"5-limit 22-tone scale (Zarlino?)"},"ji_27":{"frequencies":[261.6255653006,267.90457886781,275.62199471997,282.55561052465,290.69507255622,299.00064605783,305.22982618403,313.95067836072,320.49131749323,331.11985608357,336.37572681506,348.83408706747,356.10146388137,366.27579142084,373.75080757229,384.42940207435,392.4383479509,406.97310157871,413.43299207996,427.14378008261,436.04260883433,448.50096908674,457.84473927605,470.92601754108,484.4917875937,496.67978412536,510.98743222773,523.2511306012],"description":"7-limit rational interpretation of 27-tET, OdC"},"ji_29":{"frequencies":[261.6255653006,267.90457886781,275.62199471997,282.55561052465,287.78812183066,294.32876096318,301.39265122629,310.07474405997,317.12189733406,323.76163705949,331.11985608357,340.65828815182,348.83408706747,356.76213450082,367.91095120397,372.08969287196,383.71749577421,392.4383479509,401.85686830172,413.43299207996,422.82919644541,431.68218274599,441.49314144476,454.2110508691,465.11211608996,475.68284600109,484.4917875937,496.67978412536,510.98743222773,523.2511306012],"description":"3,5,11-prime rational interpretation of 29-tET, OdC"},"ji_30":{"frequencies":[261.6255653006,267.57160087561,274.70684356563,280.31310567921,286.15296204753,294.32876096318,299.7792935736,308.34441624714,313.95067836072,321.92208230347,329.64821227876,336.37572681506,344.91651675372,353.19451315581,360.81424763342,370.01329949656,379.40816842909,387.59343007496,396.89567239676,406.97310157871,415.27867508032,425.24536328225,436.04260883433,443.97065626768,456.65553216105,465.11211608996,478.40103369253,488.36772189445,498.33441009638,511.62332769895,523.2511306012],"description":"11-limit rational interpretation of 30-tET"},"ji_31":{"frequencies":[261.6255653006,267.57160087561,274.08392555301,280.31310567921,285.40970760065,293.02063313667,299.00064605783,305.22982618403,313.95067836072,319.76457981184,327.03195662575,334.88072358477,343.38355445704,348.83408706747,356.76213450082,366.27579142084,373.75080757229,383.71749577421,392.4383479509,398.6675280771,408.78994578219,418.60090448096,428.11456140098,436.04260883433,448.50096908674,457.84473927605,467.18850946536,479.64686971777,490.54793493862,499.46698830115,512.78610798918,523.2511306012],"description":"A just 11-limit 31-tone scale, optimized for Mann complexity"},"ji_31a":{"frequencies":[261.6255653006,267.90457886781,272.52663052146,279.06726965397,286.15296204753,294.32876096318,299.00064605783,305.22982618403,313.95067836072,318.93402246168,327.03195662575,334.88072358477,343.38355445704,348.83408706747,358.80077526939,366.27579142084,373.75080757229,381.53728273004,392.4383479509,398.6675280771,408.78994578219,418.60090448096,429.2294430713,436.04260883433,448.50096908674,457.84473927605,465.11211608996,478.40103369253,490.54793493862,502.32108537715,510.98743222773,523.2511306012],"description":"A just 7-limit 31-tone scale"},"ji_31b":{"frequencies":[261.6255653006,267.90457886781,275.93321340298,282.55561052465,287.4304306281,294.32876096318,301.39265122629,306.59245933664,313.95067836072,319.36714514233,327.03195662575,334.88072358477,344.91651675372,353.19451315581,359.28803828513,367.91095120397,376.74081403286,383.2405741708,392.4383479509,401.85686830172,408.78994578219,418.60090448096,431.14564594215,441.49314144476,452.08897683944,459.88868900496,470.92601754108,479.0507177135,490.54793493862,502.32108537715,510.98743222773,523.2511306012],"description":"A just 5-limit 31-tone scale, corner clipped genus"},"ji_31c":{"frequencies":[261.6255653006,267.57160087561,272.52663052146,279.06726965397,285.40970760065,294.32876096318,299.00064605783,305.22982618403,313.95067836072,319.76457981184,327.03195662575,334.88072358477,343.38355445704,348.83408706747,359.73515228832,366.27579142084,373.75080757229,380.54627680087,392.4383479509,398.6675280771,408.78994578219,418.60090448096,428.11456140098,436.04260883433,448.50096908674,457.84473927605,465.11211608996,479.64686971777,490.54793493862,502.32108537715,511.62332769895,523.2511306012],"description":"A just 11-limit 31-tone scale"},"ji_5coh":{"frequencies":[261.6255653006,305.22982618403,348.83408706747,381.53728273004,446.94367405519,523.2511306012],"description":"Differential fully coherent pentatonic scale"},"ji_6coh":{"frequencies":[261.6255653006,294.32876096318,330.74639366397,372.08969287196,418.60090448096,465.11211608996,523.2511306012],"description":"Differential coherent 6-tone scale, OdC 2003"},"ji_7":{"frequencies":[261.6255653006,290.69507255622,318.93402246168,348.83408706747,392.4383479509,429.2294430713,470.92601754108,523.2511306012],"description":"7-limit rational interpretation of 7-tET. OdC"},"ji_7a":{"frequencies":[261.6255653006,287.78812183066,319.76457981184,348.83408706747,392.4383479509,428.11456140098,470.92601754108,523.2511306012],"description":"Superparticular approximation to 7-tET. Op de Coul, 1998"},"ji_8coh":{"frequencies":[261.6255653006,286.99041781007,312.35527031954,339.96223546814,370.00947616612,405.83764015148,441.71144237774,480.75585116768,523.2511306012],"description":"Differential coherent 8-tone scale, OdC, 2003"},"ji_8coh3":{"frequencies":[261.6255653006,277.97716313189,302.50455987882,327.03195662575,359.73515228832,392.4383479509,425.14154361347,466.02053819169,523.2511306012],"description":"Differential fully coherent 8-tone scale, OdC, 2003"},"ji_9coh":{"frequencies":[261.6255653006,287.78812183066,313.95067836072,327.03195662575,366.27579142084,392.4383479509,418.60090448096,470.92601754108,497.08857407114,523.2511306012],"description":"Differentially coherent 9-tone scale"},"ji_ri24a":{"frequencies":[261.6255653006,269.10058145205,277.01530443593,285.40970760065,294.32876096318,301.87565226992,310.68035879446,319.76457981184,329.87571277032,340.11323489078,348.83408706747,359.73515228832,370.63621750918,380.54627680087,392.4383479509,402.50086969323,414.99227599406,428.11456140098,440.63253103259,453.48431318771,465.11211608996,479.64686971777,494.18162334558,508.71637697339,523.2511306012],"description":"M. Schulter, just/rational intonation system - with circulating 24-note set"},"jioct12":{"frequencies":[261.6255653006,272.52663052146,282.55561052465,302.80736724606,313.95067836072,327.03195662575,363.36884069528,376.74081403286,392.4383479509,436.04260883433,454.2110508691,470.92601754108,523.2511306012],"description":"12-tone JI version of Messiaen's octatonic scale, Erlich & Par�zek"},"jobin-bach":{"frequencies":[261.6255653006,275.07759559501,292.50627485027,309.76836826904,327.03195662575,348.83408706747,366.77012764335,391.22147055517,412.61639318626,437.39890198442,464.6525521713,489.02683710225,523.2511306012],"description":"Emile Jobin, WTC temperament after Bach's signet"},"johnson-secor_rwt":{"frequencies":[261.6255653006,276.16031892841,293.03678286293,310.07474405997,327.94037872749,348.83408706747,368.21375857121,391.52992584916,414.24047839262,438.40450629885,465.11211608996,490.95167809495,523.2511306012],"description":"Johnson/Secor proportional-beating well-temperament with five 24/19s."},"johnson_44":{"frequencies":[261.6255653006,265.7783520514,269.99705605222,274.2827236086,278.63641763414,283.05921791404,287.55222124002,292.11654190835,296.75331210627,301.46368356757,306.24882108355,311.17820103386,316.11753722951,321.13527558179,326.23266245367,331.4109583385,336.67144939063,342.01544029518,347.44425644654,352.9592442771,358.56177366235,364.2532300084,370.03502692537,375.90859839047,381.87540114246,387.93691728375,394.09464571975,400.35011587045,406.70487919155,413.16051176499,419.71861468993,426.38081694263,433.14876596753,440.02414274758,447.00865248514,454.10402744924,461.31203006992,468.63444275836,476.07308421189,483.62979961065,491.30646309654,499.10497838378,507.02727962797,515.07533168556,523.2511306012],"description":"Aaron Johnson, 44-tET approximation"},"johnson_7":{"frequencies":[261.6255653006,288.83389952765,318.87182567809,352.10227751942,388.71994014354,429.2294430713,473.86811641255,523.2511306012],"description":"Aaron Johnson, 7-tET approximation"},"johnson_eb":{"frequencies":[261.6255653006,273.1678696521,292.40504357126,312.71949922989,327.03195662575,349.65487315468,365.50630446407,390.89937403737,408.78994578219,437.06859144336,467.84806971401,488.62421754671,523.2511306012],"description":"Aaron Johnson, \"1/4-comma tempered\" equal beating C-G-D-A-E plus just thirds"},"johnson_ratwell":{"frequencies":[261.6255653006,276.16031892841,292.90688289089,310.07474405997,327.94037872749,348.83408706747,368.21375857121,391.49724879514,414.24047839262,438.30776524386,465.11211608996,490.95167809495,523.2511306012],"description":"Aaron Johnson, rational well-temperament with five 24/19's"},"johnson_temp":{"frequencies":[261.6255653006,275.52965735686,292.50638298357,309.88336774144,327.03195662575,348.76230617841,367.55223824197,391.22154286826,413.09299784305,437.39914452994,464.92072007996,490.30891677011,523.2511306012],"description":"Aaron Johnson, temperament with just 5/4, 24/19 and 19/15"},"johnston":{"frequencies":[261.6255653006,275.93321340298,294.32876096318,315.35224388912,327.03195662575,359.73515228832,367.91095120397,392.4383479509,401.35740131342,441.49314144476,457.84473927605,490.54793493862,523.2511306012],"description":"Ben Johnston's combined otonal-utonal scale"},"johnston_21":{"frequencies":[261.6255653006,272.52663052146,282.55561052465,294.32876096318,306.59245933664,313.95067836072,327.03195662575,334.88072358477,340.65828815182,348.83408706747,363.36884069528,376.74081403286,392.4383479509,408.78994578219,418.60090448096,436.04260883433,454.2110508691,470.92601754108,490.54793493862,502.32108537715,510.98743222773,523.2511306012],"description":"Johnston 21-note just enharmonic scale"},"johnston_22":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,290.69507255622,299.00064605783,305.22982618403,313.95067836072,327.03195662575,336.37572681506,343.38355445704,353.19451315581,367.91095120397,378.42269266694,392.4383479509,406.97310157871,418.60090448096,436.04260883433,448.50096908674,457.84473927605,470.92601754108,490.54793493862,504.56359022259,523.2511306012],"description":"Johnston 22-note scale from end of string quartet nr. 4"},"johnston_25":{"frequencies":[261.6255653006,272.52663052146,275.93321340298,279.06726965397,290.69507255622,294.32876096318,306.59245933664,313.95067836072,327.03195662575,331.11985608357,334.88072358477,348.83408706747,353.19451315581,367.91095120397,376.74081403286,392.4383479509,408.78994578219,418.60090448096,436.04260883433,441.49314144476,459.88868900496,465.11211608996,470.92601754108,490.54793493862,502.32108537715,523.2511306012],"description":"Johnston 25-note just enharmonic scale"},"johnston_6-qt":{"frequencies":[261.6255653006,262.79353657426,266.47048317654,267.57160087561,271.31540105247,272.52663052146,277.4816601673,280.31310567921,284.23518205497,290.69507255622,294.32876096318,297.30177875068,299.7792935736,300.33547037059,305.22982618403,306.59245933664,310.07474405997,311.45900631024,316.53463456122,317.12189733406,319.76457981184,322.99452506247,327.03195662575,334.46450109452,339.14425131559,342.60490694126,348.83408706747,350.39138209902,355.29397756872,356.76213450082,361.75386806997,363.36884069528,367.91095120397,373.75080757229,381.53728273004,382.24514410802,387.59343007496,390.82337532559,392.4383479509,396.40237166758,399.70572476481,406.97310157871,408.78994578219,413.43299207996,420.46965851882,426.35277308246,436.04260883433,445.95266812602,452.19233508746,459.88868900496,465.11211608996,467.18850946536,475.68284600109,479.64686971777,484.4917875937,486.49381977384,490.54793493862,248.7057842981,498.33441009638,508.71637697339,516.79124009995,523.2511306012],"description":"11-limit complete system from Ben Johnston's _6th Quartet_"},"johnston_6-qt_row":{"frequencies":[261.6255653006,272.52663052146,290.69507255622,306.59245933664,327.03195662575,350.39138209902,363.36884069528,399.70572476481,408.78994578219,436.04260883433,445.95266812602,490.54793493862,508.71637697339],"description":"11-limit 'prime row' from Ben Johnston's \"6th Quartet\""},"johnston_81":{"frequencies":[116.54094037952,117.99770213426,119.33792294863,119.89808681021,120.82964698549,121.39681289533,122.77564089365,122.91427305652,124.31033640482,124.45070146973,125.86421560988,127.43751830501,127.89129259755,128.03570110055,129.48993375502,131.10855792696,132.74741490105,134.25516331721,134.88534766148,135.93335285867,136.57141450725,138.12259600536,138.27855718859,139.84912845542,141.59724256112,142.26189011172,143.87770417225,145.6761754744,147.49712766783,149.17240368579,151.03705873186,151.74601611917,153.46955111706,155.38792050603,157.33026951235,159.11723059817,159.29689788126,161.10619598065,161.86241719378,163.70085452487,163.8856974087,165.74711520643,165.93426862631,167.81895414651,169.91669107334,170.71426813406,172.6532450067,174.81141056928,176.9965532014,179.00688442294,179.84713021531,181.24447047823,182.095219343,184.16346134048,184.37140958479,186.46550460723,188.79632341482,189.68252014896,191.15627745751,191.83693889633,194.23490063253,196.66283689044,198.89653824771,199.12112235157,199.83014468368,201.38274497581,202.32802149222,204.62606815608,204.85712176088,207.18389400804,207.41783578289,209.77369268314,212.39586384168,213.39283516758,215.81655625837,218.5142632116,221.24569150175,223.75860552868,226.55558809779,227.61902417875,230.2043266756,233.08188075904],"description":"Johnston 81-note 5-limit scale of Sonata for Microtonal Piano"},"jorgensen":{"frequencies":[261.6255653006,269.51415085551,288.85811466493,309.59046173614,318.92511007349,352.12195684808,355.62605411908,388.77403176757,408.50706336067,429.24143792307,469.25139168707,473.92081401802,523.2511306012],"description":"Jorgensen's 5&7 temperament"},"jousse":{"frequencies":[261.6255653006,276.90198715646,293.15566421679,311.51473523959,328.62702621286,349.28097970329,369.20264759391,391.76800554826,415.35298052707,439.0631553946,466.60176257857,492.27019703794,523.2511306012],"description":"Temperament of Jean Jousse (1832)"},"jousse2":{"frequencies":[261.6255653006,277.21176919085,293.63180098233,311.16627887077,329.63881547742,349.36510452864,370.14670828388,392.04008509316,415.41939014292,440.0494382652,466.3511549761,494.0599599767,523.2511306012],"description":"Jean Jousse's quasi-equal temperament"},"quasi_5":{"frequencies":[261.6255653006,302.26980244078,349.22823143301,391.99543598175,452.89298412314,523.2511306012],"description":"Quasi-Equal 5-Tone in 24-tET, 5 5 4 5 5 steps"},"quasi_9":{"frequencies":[261.6255653006,281.2143451833,302.26980244078,324.90175210669,349.22823143301,391.99543598175,421.34544350737,452.89298412314,486.80259447109,523.2511306012],"description":"Quasi-Equal Enneatonic, Each \"tetrachord\" has 125 + 125 + 125 + 125 cents"},"quint_chrom":{"frequencies":[261.6255653006,277.01530443593,294.32876096318,348.83408706747,392.4383479509,415.52295665389,441.49314144476,523.2511306012],"description":"Aristides Quintilianus' Chromatic genus"},"oconnell":{"frequencies":[261.6255653006,267.57429119961,272.27874977392,278.46970304972,283.3657217904,288.34782337261,294.90414810658,300.08911516052,305.36524364276,312.30850472426,317.79947295261,323.38698268281,330.74001416845,336.55504284097,344.20748191927,350.25929591231,356.41751010259,364.52157313929,370.93054700815,377.45220049416,386.03454097812,392.82175095637,399.72829510222,408.81713953112,416.00491024634,423.31905787312],"description":"Walter O'Connell, Pythagorean scale of 25 octaves reduced by Phi. XH 15 (1993)"},"oconnell_11":{"frequencies":[261.6255653006,272.27874977392,288.34782337261,300.08911516052,312.30850472426,323.38698268281,344.20748191927,356.41751010259,370.93054700815,386.03454097812,408.81713953112,423.31905787312],"description":"Walter O'Connell, 11-note mode of 25-tone scale"},"oconnell_14":{"frequencies":[261.6255653006,272.27874977392,283.3657217904,288.34782337261,300.08911516052,312.30850472426,323.38698268281,336.55504284097,344.20748191927,356.41751010259,370.93054700815,386.03454097812,399.72829510222,408.81713953112,423.31905787312],"description":"Walter O'Connell, 14-note mode of 25-tone scale"},"oconnell_7":{"frequencies":[261.6255653006,283.3657217904,300.08911516052,323.38698268281,344.20748191927,370.93054700815,392.82175095637,423.31905787312],"description":"Walter O'Connell, 7-note mode of 25-tone scale"},"oconnell_9":{"frequencies":[261.6255653006,278.46970304972,294.90414810658,305.36524364276,323.38698268281,344.20748191927,364.52157313929,377.45220049416,399.72829510222,423.31905787312],"description":"Walter O'Connell, 9-tone mode of 25-tone scale"},"oconnell_9a":{"frequencies":[261.6255653006,272.27874977392,288.34782337261,305.36524364276,323.38698268281,344.20748191927,356.41751010259,377.45220049416,399.72829510222,423.31905787312],"description":"Walter O'Connell, 7+2 major mode analogy for 25-tone scale"},"octony_min":{"frequencies":[261.6255653006,294.32876096318,313.95067836072,327.03195662575,348.83408706747,392.4383479509,418.60090448096,490.54793493862,523.2511306012],"description":"Octony on Harmonic Minor, from Palmer on an album of Turkish music"},"octony_rot":{"frequencies":[261.6255653006,327.03195662575,348.83408706747,392.4383479509,408.78994578219,418.60090448096,436.04260883433,490.54793493862,523.2511306012],"description":"Rotated Octony on Harmonic Minor"},"octony_trans":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,327.03195662575,348.83408706747,408.78994578219,420.46965851882,436.04260883433,523.2511306012],"description":"Complex 10 of p. 115, an Octony based on Archytas's Enharmonic,"},"octony_trans2":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,315.35224388912,324.36230800023,336.37572681506,348.83408706747,504.56359022259,523.2511306012],"description":"Complex 6 of p. 115 based on Archytas's Enharmonic, an Octony"},"octony_trans3":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,306.59245933664,315.35224388912,327.03195662575,348.83408706747,490.54793493862,523.2511306012],"description":"Complex 5 of p. 115 based on Archytas's Enharmonic, an Octony"},"octony_trans4":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,336.37572681506,348.83408706747,420.46965851882,432.48307733364,448.50096908674,523.2511306012],"description":"Complex 11 of p. 115, an Octony based on Archytas's Enharmonic, 8 tones"},"octony_trans5":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,317.94773560837,327.03195662575,339.14425131559,348.83408706747,508.71637697339,523.2511306012],"description":"Complex 15 of p. 115, an Octony based on Archytas's Enharmonic, 8 tones"},"octony_trans6":{"frequencies":[261.6255653006,269.10058145205,271.31540105247,279.06726965397,336.37572681506,345.98646186692,348.83408706747,358.80077526939,523.2511306012],"description":"Complex 14 of p. 115, an Octony based on Archytas's Enharmonic, 8 tones"},"octony_u":{"frequencies":[261.6255653006,280.31310567921,301.87565226992,327.03195662575,356.76213450082,392.4383479509,436.04260883433,490.54793493862,523.2511306012],"description":"7)8 octony from 1.3.5.7.9.11.13.15, 1.3.5.7.9.11.13 tonic (subharmonics 8-16)"},"odd1":{"frequencies":[261.6255653006,272.52663052146,313.95067836072,327.03195662575,376.74081403286,392.4383479509,408.78994578219,418.60090448096,436.04260883433,470.92601754108,490.54793493862,502.32108537715,523.2511306012],"description":"ODD-1"},"odd2":{"frequencies":[261.6255653006,290.69507255622,294.32876096318,306.59245933664,313.95067836072,327.03195662575,348.83408706747,363.36884069528,392.4383479509,436.04260883433,470.92601754108,490.54793493862,523.2511306012],"description":"ODD-2"},"oettingen":{"frequencies":[261.6255653006,264.89588486686,267.90457886781,272.52663052146,275.93321340298,279.06726965397,282.55561052465,287.4304306281,290.69507255622,294.32876096318,298.00787047521,301.39265122629,306.59245933664,310.42486507835,313.95067836072,317.87506184023,323.35923445661,327.03195662575,331.11985608357,334.88072358477,339.06673262958,344.91651675372,348.83408706747,353.19451315581,357.20610515709,363.36884069528,367.91095120397,372.50983809402,376.74081403286,383.2405741708,388.03108134794,392.4383479509,397.34382730029,401.85686830172,408.78994578219,413.89982010446,418.60090448096,423.83341578697,431.14564594215,436.04260883433,441.49314144476,446.50763144636,452.08897683944,459.88868900496,465.11211608996,470.92601754108,476.81259276034,485.03885168492,490.54793493862,496.67978412536,502.32108537715,510.98743222773,517.37477513058,523.2511306012],"description":"von Oettingen's Orthotonophonium tuning"},"oettingen2":{"frequencies":[261.6255653006,264.89588486686,267.90457886781,272.52663052146,275.93321340298,279.06726965397,282.55561052465,287.4304306281,290.69507255622,294.32876096318,297.67175429757,301.39265122629,306.59245933664,310.07474405997,313.95067836072,317.51653791741,322.99452506247,327.03195662575,331.11985608357,334.88072358477,340.65828815182,344.91651675372,348.83408706747,353.19451315581,357.20610515709,363.36884069528,367.91095120397,372.08969287196,376.74081403286,383.2405741708,387.59343007496,392.4383479509,396.89567239676,401.85686830172,408.78994578219,413.43299207996,418.60090448096,423.83341578697,431.14564594215,436.04260883433,441.49314144476,446.50763144636,454.2110508691,459.88868900496,465.11211608996,470.92601754108,476.27480687611,484.4917875937,490.54793493862,496.11959049595,502.32108537715,510.98743222773,516.79124009995,523.2511306012],"description":"von Oettingen's Orthotonophonium tuning with central 1/1"},"ogr10":{"frequencies":[261.6255653006,264.15640940857,271.89678302796,296.5055443788,342.56848033562,359.46139971304,411.32572372413,440,484.46499093218,513.27277840175,523.2511306012],"description":"Optimal Golomb Ruler of 10 segments, length 72"},"ogr10a":{"frequencies":[261.6255653006,264.15640940857,285.30470202322,314.13668154225,329.62755691287,352.60650301302,431.60923940535,448.5538823653,457.27406033445,508.3551866238,523.2511306012],"description":"2nd Optimal Golomb Ruler of 10 segments, length 72"},"ogr11":{"frequencies":[261.6255653006,265.92749183559,274.74472021414,318.1829357186,331.4244391468,362.52783176564,371.50609336774,409.69842558521,455.51656649021,482.27514684959,486.22402266421,523.2511306012],"description":"Optimal Golomb Ruler of 11 segments, length 85"},"ogr12":{"frequencies":[261.6255653006,265.06964174786,270.3209511875,308.09015504092,333.2396629384,346.57411320722,384.79959982017,413.49815209867,456.11269186454,468.20039948765,496.58195036371,499.83980314828,523.2511306012],"description":"Optimal Golomb Ruler of 12 segments, length 106"},"ogr2":{"frequencies":[261.6255653006,329.62755691287,523.2511306012],"description":"Optimal Golomb Ruler of 2 segments, length 3"},"ogr3":{"frequencies":[261.6255653006,293.66476791741,415.30469757995,523.2511306012],"description":"Optimal Golomb Ruler of 3 segments, length 6"},"ogr4":{"frequencies":[261.6255653006,278.64197723942,336.62443200122,461.29362042034,523.2511306012],"description":"Optimal Golomb Ruler of 4 segments, length 11"},"ogr4a":{"frequencies":[261.6255653006,296.76515515861,406.67242132093,433.12283887627,523.2511306012],"description":"2nd Optimal Golomb Ruler of 4 segments, length 11"},"ogr5":{"frequencies":[261.6255653006,272.51337835337,307.97166902637,393.32961502355,426.7484383229,523.2511306012],"description":"Optimal Golomb Ruler of 5 segments, length 17"},"ogr5a":{"frequencies":[261.6255653006,272.51337835337,307.97166902637,393.32961502355,482.27514684959,523.2511306012],"description":"2nd Optimal Golomb Ruler of 5 segments, length 17"},"ogr5b":{"frequencies":[261.6255653006,272.51337835337,362.52783176564,426.7484383229,463.0066556268,523.2511306012],"description":"3rd Optimal Golomb Ruler of 5 segments, length 17"},"ogr5c":{"frequencies":[261.6255653006,272.51337835337,362.52783176564,409.69842558521,444.50800708553,523.2511306012],"description":"4th Optimal Golomb Ruler of 5 segments, length 17"},"ogr6":{"frequencies":[261.6255653006,268.98086109226,292.31087910123,345.21700307457,430.94493093825,495.02573326308,523.2511306012],"description":"Optimal Golomb Ruler of 6 segments, length 25"},"ogr6a":{"frequencies":[261.6255653006,276.5429423948,284.31762274025,345.21700307457,407.69874723177,468.32288027948,523.2511306012],"description":"2nd Optimal Golomb Ruler of 6 segments, length 25"},"ogr6b":{"frequencies":[261.6255653006,268.98086109226,354.92237405774,407.69874723177,443.06044202496,495.02573326308,523.2511306012],"description":"3rd Optimal Golomb Ruler of 6 segments, length 25"},"ogr6c":{"frequencies":[261.6255653006,268.98086109226,317.66442301495,354.92237405774,455.51656649021,495.02573326308,523.2511306012],"description":"4th Optimal Golomb Ruler of 6 segments, length 25"},"ogr6d":{"frequencies":[261.6255653006,276.5429423948,317.66442301495,375.1593523779,468.32288027948,481.48922855473,523.2511306012],"description":"5th Optimal Golomb Ruler of 6 segments, length 25"},"ogr7":{"frequencies":[261.6255653006,267.01398215014,283.85429714132,314.3146261019,355.21191871351,409.69842558521,502.34551296122,523.2511306012],"description":"Optimal Golomb Ruler of 7 segments, length 34"},"ogr8":{"frequencies":[261.6255653006,265.77967818767,283.06627815664,316.06708432391,387.90015179087,400.3161696196,454.08364189083,499.09751029017,523.2511306012],"description":"Optimal Golomb Ruler of 8 segments, length 44"},"ogr9":{"frequencies":[261.6255653006,264.94361147373,282.17583275232,296.76515515861,349.59519124833,363.06573983159,401.57942110183,438.61588607285,510.2272282764,523.2511306012],"description":"Optimal Golomb Ruler of 9 segments, length 55"},"oldani":{"frequencies":[261.6255653006,272.52663052146,294.32876096318,310.07474405997,327.03195662575,348.83408706747,367.91095120397,392.4383479509,408.78994578219,436.04260883433,465.11211608996,490.54793493862,523.2511306012],"description":"This scale by Norbert L. Oldani appeared in Interval 5(3), p.10-11"},"oljare":{"frequencies":[261.6255653006,286.15296204753,305.22982618403,327.03195662575,348.83408706747,381.53728273004,392.4383479509,406.97310157871,436.04260883433,457.84473927605,490.54793493862,508.71637697339,523.2511306012],"description":"Mats �ljare, scale for \"Tampere\" (2001)"},"oljare17":{"frequencies":[261.6255653006,272.51337835337,320.78822215662,334.13814720468,393.32961502355,409.69842558521,426.7484383229,502.34551296122,523.2511306012],"description":"Mats �ljare, scale for \"Fafner\" (2001), MOS in 17-tET"},"olympos":{"frequencies":[261.6255653006,279.06726965397,348.83408706747,372.08969287196,465.11211608996,523.2511306012],"description":"Scale of ancient Greek flutist Olympos, 6th century BC as reported by Partch"},"opelt":{"frequencies":[261.6255653006,272.52663052146,282.55561052465,294.32876096318,306.59245933664,313.95067836072,327.03195662575,334.88072358477,348.83408706747,363.36884069528,376.74081403286,392.4383479509,408.78994578219,418.60090448096,436.04260883433,454.2110508691,470.92601754108,490.54793493862,502.32108537715,523.2511306012],"description":"Friederich Wilhelm Opelt 19-tone"},"organ1373a":{"frequencies":[261.6255653006,277.01530443593,294.32876096318,311.64221749042,331.11985608357,348.83408706747,369.35373924791,392.4383479509,415.52295665389,441.49314144476,465.11211608996,496.67978412536,523.2511306012],"description":"English organ tuning (1373) with 18:17:16 ficta semitones (Eb-G#)"},"organ1373b":{"frequencies":[261.6255653006,277.01530443593,294.32876096318,311.64221749042,331.11985608357,348.83408706747,369.35373924791,392.4383479509,415.52295665389,441.49314144476,467.46332623563,496.67978412536,523.2511306012],"description":"English organ tuning (1373) with 18:17:16 accidental semitones (Eb-G#)"},"ragib":{"frequencies":[261.6255653006,269.99542342683,281.01564479119,288.12007609225,294.32876096318,303.49446183192,311.45900631024,323.77767743764,335.77702597132,341.99420300732,348.83408706747,360.36579242507,371.06455309218,381.37837507376,392.4383479509,407.46331920162,417.22825371678,432.79663407874,450.28451247858,458.15534711532,465.11211608996,476.50902003141,487.19844562495,503.12608711654,523.2511306012],"description":"Idris Ragib Bey, vol.5 d'Erlanger, p 40. Idris Rag'ib Bey"},"ragib7":{"frequencies":[261.6255653006,270.30192333353,281.29980781121,288.32205155576,294.32876096318,303.74668805875,311.45900631024,324.36230800023,336.37572681506,341.71502406609,348.83408706747,360.4025644447,370.6997805717,381.53728273004,392.4383479509,406.97310157871,417.13259773693,432.48307733364,450.69091522486,457.84473927605,465.11211608996,476.92160341255,486.65469735975,502.32108537715,523.2511306012],"description":"7-limit version of Idris Rag'ib Bey scale"},"rameau-flat":{"frequencies":[261.6255653006,276.01120901503,292.50629850443,312.00666699279,327.03195662575,349.91920725962,366.20974703841,391.22137338448,415.30469757995,437.39882871549,468.01000025525,489.02679755603,523.2511306012],"description":"Rameau bemols, see Pierre-Yves Asselin in \"Musique et temperament\""},"rameau-gall":{"frequencies":[261.6255653006,274.65078342868,292.50627485027,310.49874388777,327.03195662575,349.91912034749,366.20104475463,391.22147055517,412.61639318626,437.39890198442,468.01003810189,489.02683710225,523.2511306012],"description":"Rameau's temperament, after Gallimard (1st solution)"},"rameau-merc":{"frequencies":[261.6255653006,273.37431312998,292.50627485027,308.72950296259,327.03195662575,348.83408706747,365.63284274659,391.22147055517,409.55238583376,437.39890198442,464.53468854848,489.02683710225,523.2511306012],"description":"Rameau's temperament, after Mercadier"},"rameau-minor":{"frequencies":[261.6255653006,294.32876096318,313.95067836072,353.19451315581,392.4383479509,418.60090448096,441.49314144476,470.92601754108,490.54793493862,523.2511306012],"description":"Rameau's systeme diatonique mineur on E. Asc. 4-6-8-9, desc. 9-7-5-4"},"rameau-nouv":{"frequencies":[261.6255653006,275.98004852257,292.50627485027,311.49614460359,327.03195662575,349.91912034749,367.37127028704,391.22147055517,414.64857675456,437.39890198442,468.01003810189,489.02683710225,523.2511306012],"description":"Temperament by Rameau in Nouveau Systeme (1726)"},"rameau-sharp":{"frequencies":[261.6255653006,273.37431312998,292.50629850443,308.54983514133,327.03195662575,348.83408706747,365.63293356166,391.22137338448,409.42528169498,437.39882871549,464.33633889105,489.02679755603,523.2511306012],"description":"Rameau dieses, see Pierre-Yves Asselin in \"Musique et temperament\""},"rameau":{"frequencies":[261.6255653006,275.07757335026,292.50629850443,310.73186404381,327.03195662575,349.91920725962,366.77009798369,391.22137338448,412.61635981914,437.39882871549,468.01000025525,489.02679755603,523.2511306012],"description":"Rameau's modified meantone temperament (1725)"},"ramis":{"frequencies":[261.6255653006,275.93321340298,290.69507255622,310.07474405997,327.03195662575,348.83408706747,367.91095120397,392.4383479509,413.43299207996,436.04260883433,465.11211608996,490.54793493862,523.2511306012],"description":"Monochord of Ramos de Pareja (Ramis de Pareia), Musica practica (1482). Carlos: Switched on Bach"},"rapoport_8":{"frequencies":[261.6255653006,297.86386736488,316.53463456122,336.37572681506,382.96782946913,406.97310157871,432.48307733364,492.38720931745,523.2511306012],"description":"Paul Rapoport, cycle of 14/9 close to 8 out of 11-tET, XH 13, 1991"},"rast_moha":{"frequencies":[261.6255653006,293.66476791741,320.24370022528,349.22823143301,391.99543598175,427.47405410759,479.82340237272,523.2511306012],"description":"Rast + Mohajira (Dudon) 4 + 3 + 3 Rast and 3 + 4 + 3 Mohajira tetrachords"},"rat_dorenh":{"frequencies":[261.6255653006,267.70988077271,274.08392555301,359.73515228832,411.12588832951,418.60090448096,426.35277308246,523.2511306012],"description":"Rationalized Schlesinger's Dorian Harmonia in the enharmonic genus"},"rat_hypodenh":{"frequencies":[261.6255653006,270.06509966514,279.06726965397,348.83408706747,380.54627680087,389.39619021485,398.6675280771,523.2511306012],"description":"1+1 rationalized enharmonic genus derived from K.S.'s 'Bastard' Hypodorian"},"rat_hypodenh2":{"frequencies":[261.6255653006,270.06509966514,288.69027895239,348.83408706747,380.54627680087,389.39619021485,408.39112632289,523.2511306012],"description":"1+2 rationalized enharmonic genus derived from K.S.'s 'Bastard' Hypodorian"},"rat_hypodenh3":{"frequencies":[261.6255653006,270.06509966514,299.00064605783,348.83408706747,380.54627680087,389.39619021485,418.60090448096,523.2511306012],"description":"1+3 rationalized enharmonic genus derived from K.S.'s 'Bastard' Hypodorian"},"rat_hypodhex":{"frequencies":[261.6255653006,267.19206668997,273.00058987889,348.83408706747,380.54627680087,386.4008349055,392.4383479509,523.2511306012],"description":"1+1 rationalized hexachromatic/hexenharmonic genus derived from K.S.'Bastard'"},"rat_hypodhex2":{"frequencies":[261.6255653006,267.19206668997,279.06726965397,348.83408706747,380.54627680087,386.4008349055,398.6675280771,523.2511306012],"description":"1+2 rat. hexachromatic/hexenharmonic genus derived from K.S.'s 'Bastard' Hypodo"},"rat_hypodhex3":{"frequencies":[261.6255653006,267.19206668997,285.40970760065,348.83408706747,380.54627680087,386.4008349055,405.0976494977,523.2511306012],"description":"1+3 rat. hexachromatic/hexenharmonic genus from K.S.'s 'Bastard' Hypodorian"},"rat_hypodhex4":{"frequencies":[261.6255653006,267.19206668997,292.04714266113,348.83408706747,380.54627680087,386.4008349055,411.73859457144,523.2511306012],"description":"1+4 rat. hexachromatic/hexenharmonic genus from K.S.'s 'Bastard' Hypodorian"},"rat_hypodhex5":{"frequencies":[261.6255653006,267.19206668997,299.00064605783,348.83408706747,380.54627680087,386.4008349055,418.60090448096,523.2511306012],"description":"1+5 rat. hexachromatic/hexenharmonic genus from K.S.'s 'Bastard' Hypodorian"},"rat_hypodhex6":{"frequencies":[261.6255653006,273.00058987889,292.04714266113,348.83408706747,380.54627680087,392.4383479509,411.73859457144,523.2511306012],"description":"2+3 rationalized hexachromatic/hexenharmonic genus from K.S.'s 'Bastard' hypod"},"rat_hypodpen":{"frequencies":[261.6255653006,268.33391312882,275.39533189537,348.83408706747,380.54627680087,387.59343007496,394.90651366128,523.2511306012],"description":"1+1 rationalized pentachromatic/pentenharmonic genus derived from K.S.'s 'Bastar"},"rat_hypodpen2":{"frequencies":[261.6255653006,268.33391312882,282.83844897362,348.83408706747,380.54627680087,387.59343007496,402.50086969323,523.2511306012],"description":"1+2 rationalized pentachromatic/pentenharmonic genus from K.S.'s 'Bastard' hyp"},"rat_hypodpen3":{"frequencies":[261.6255653006,268.33391312882,290.69507255622,348.83408706747,380.54627680087,387.59343007496,410.39304360878,523.2511306012],"description":"1+3 rationalized pentachromatic/pentenharmonic genus from 'Bastard' Hypodorian"},"rat_hypodpen4":{"frequencies":[261.6255653006,268.33391312882,299.00064605783,348.83408706747,380.54627680087,387.59343007496,418.60090448096,523.2511306012],"description":"1+4 rationalized pentachromatic/pentenharmonic genus from 'Bastard' Hypodorian"},"rat_hypodpen5":{"frequencies":[261.6255653006,275.39533189537,290.69507255622,348.83408706747,380.54627680087,394.90651366128,410.39304360878,523.2511306012],"description":"2+3 rationalized pentachromatic/pentenharmonic genus from 'Bastard' Hypodorian"},"rat_hypodpen6":{"frequencies":[261.6255653006,268.33391312882,299.00064605783,348.83408706747,380.54627680087,394.90651366128,418.60090448096,523.2511306012],"description":"2+3 rationalized pentachromatic/pentenharmonic genus from 'Bastard' Hypodorian"},"rat_hypodtri":{"frequencies":[261.6255653006,273.00058987889,285.40970760065,348.83408706747,380.54627680087,392.4383479509,405.0976494977,523.2511306012],"description":"rationalized first (1+1) trichromatic genus derived from K.S.'s 'Bastard' hyp"},"rat_hypodtri2":{"frequencies":[261.6255653006,273.00058987889,299.00064605783,348.83408706747,380.54627680087,392.4383479509,418.60090448096,523.2511306012],"description":"rationalized second (1+2) trichromatic genus derived from K.S.'s 'Bastard' hyp"},"rat_hypolenh":{"frequencies":[261.6255653006,268.33391312882,275.39533189537,348.83408706747,373.75080757229,402.50086969323,410.39304360878,418.60090448096,523.2511306012],"description":"Rationalized Schlesinger's Hypolydian Harmonia in the enharmonic genus"},"rat_hypopchrom":{"frequencies":[261.6255653006,277.01530443593,294.32876096318,362.25078272391,392.4383479509,409.50088481833,428.11456140098,523.2511306012],"description":"Rationalized Schlesinger's Hypophrygian Harmonia in the chromatic genus"},"rat_hypopenh":{"frequencies":[261.6255653006,269.10058145205,277.01530443593,362.25078272391,392.4383479509,400.78810003496,409.50088481833,523.2511306012],"description":"Rationalized Schlesinger's Hypophrygian Harmonia in the enharmonic genus"},"rat_hypoppen":{"frequencies":[261.6255653006,273.79419624481,294.32876096318,362.25078272391,392.4383479509,405.97070477679,428.11456140098,523.2511306012],"description":"Rationalized Schlesinger's Hypophrygian Harmonia in the pentachromatic genus"},"rat_hypoptri":{"frequencies":[261.6255653006,271.68808704293,282.55561052465,362.25078272391,392.4383479509,403.65087217807,415.52295665389,523.2511306012],"description":"Rationalized Schlesinger's Hypophrygian Harmonia in first trichromatic genus"},"rat_hypoptri2":{"frequencies":[261.6255653006,271.68808704293,294.32876096318,362.25078272391,392.4383479509,403.65087217807,428.11456140098,523.2511306012],"description":"Rationalized Schlesinger's Hypophrygian Harmonia in second trichromatic genus"},"rectsp10":{"frequencies":[261.6255653006,287.78812183066,290.69507255622,294.32876096318,299.00064605783,305.22982618403,313.95067836072,319.76457981184,327.03195662575,336.37572681506,340.11323489078,348.83408706747,359.73515228832,366.27579142084,373.75080757229,377.90359432309,392.4383479509,406.97310157871,411.12588832951,418.60090448096,425.14154361347,436.04260883433,444.76346101102,448.50096908674,457.84473927605,465.11211608996,470.92601754108,479.64686971777,485.87604984397,490.54793493862,494.18162334558,497.08857407114,523.2511306012],"description":"Rectangle minimal beats spectrum of order 10"},"rectsp10a":{"frequencies":[261.6255653006,275.39533189537,277.01530443593,279.06726965397,281.75060878526,285.40970760065,287.78812183066,290.69507255622,294.32876096318,299.00064605783,305.22982618403,307.79478270659,313.95067836072,319.76457981184,322.00069575458,327.03195662575,332.97799220076,336.37572681506,340.11323489078,348.83408706747,359.73515228832,362.25078272391,366.27579142084,373.75080757229,377.90359432309,380.54627680087,392.4383479509,402.50086969323,406.97310157871,411.12588832951,418.60090448096,425.14154361347,428.11456140098,436.04260883433,444.76346101102,448.50096908674,457.84473927605,465.11211608996,470.92601754108,475.68284600109,479.64686971777,485.87604984397,490.54793493862,494.18162334558,497.08857407114,523.2511306012],"description":"Rectangle minimal beats spectrum of order 10 union with inversion"},"rectsp11":{"frequencies":[261.6255653006,285.40970760065,287.78812183066,290.69507255622,294.32876096318,299.00064605783,305.22982618403,309.19384990071,313.95067836072,319.76457981184,327.03195662575,332.97799220076,336.37572681506,340.11323489078,348.83408706747,356.76213450082,359.73515228832,366.27579142084,373.75080757229,377.90359432309,380.54627680087,392.4383479509,404.33041910093,406.97310157871,411.12588832951,418.60090448096,425.14154361347,428.11456140098,436.04260883433,444.76346101102,448.50096908674,451.89870370104,457.84473927605,465.11211608996,470.92601754108,475.68284600109,479.64686971777,485.87604984397,490.54793493862,494.18162334558,497.08857407114,499.46698830115,523.2511306012],"description":"Rectangle minimal beats spectrum of order 11"},"rectsp12":{"frequencies":[261.6255653006,283.42769574232,285.40970760065,287.78812183066,290.69507255622,294.32876096318,299.00064605783,305.22982618403,309.19384990071,313.95067836072,319.76457981184,327.03195662575,332.97799220076,336.37572681506,340.11323489078,348.83408706747,356.76213450082,359.73515228832,366.27579142084,370.63621750918,373.75080757229,377.90359432309,380.54627680087,392.4383479509,404.33041910093,406.97310157871,411.12588832951,414.24047839262,418.60090448096,425.14154361347,428.11456140098,436.04260883433,444.76346101102,448.50096908674,451.89870370104,457.84473927605,465.11211608996,470.92601754108,475.68284600109,479.64686971777,485.87604984397,490.54793493862,494.18162334558,497.08857407114,499.46698830115,501.44900015948,523.2511306012],"description":"Rectangle minimal beats spectrum of order 12"},"rectsp6":{"frequencies":[261.6255653006,305.22982618403,313.95067836072,327.03195662575,348.83408706747,366.27579142084,392.4383479509,418.60090448096,436.04260883433,457.84473927605,470.92601754108,479.64686971777,523.2511306012],"description":"Rectangle minimal beats spectrum of order 6 (=songlines)"},"rectsp6a":{"frequencies":[261.6255653006,285.40970760065,290.69507255622,299.00064605783,305.22982618403,313.95067836072,327.03195662575,348.83408706747,366.27579142084,373.75080757229,392.4383479509,418.60090448096,436.04260883433,448.50096908674,457.84473927605,470.92601754108,479.64686971777,523.2511306012],"description":"Rectangle minimal beats spectrum of order 6 union with inversion"},"rectsp7":{"frequencies":[261.6255653006,299.00064605783,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,366.27579142084,373.75080757229,392.4383479509,411.12588832951,418.60090448096,436.04260883433,448.50096908674,457.84473927605,470.92601754108,479.64686971777,485.87604984397,523.2511306012],"description":"Rectangle minimal beats spectrum of order 7"},"rectsp7a":{"frequencies":[261.6255653006,281.75060878526,285.40970760065,290.69507255622,299.00064605783,305.22982618403,313.95067836072,327.03195662575,332.97799220076,336.37572681506,348.83408706747,366.27579142084,373.75080757229,392.4383479509,406.97310157871,411.12588832951,418.60090448096,436.04260883433,448.50096908674,457.84473927605,470.92601754108,479.64686971777,485.87604984397,523.2511306012],"description":"Rectangle minimal beats spectrum of order 7 union with inversion"},"rectsp8":{"frequencies":[261.6255653006,294.32876096318,299.00064605783,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,359.73515228832,366.27579142084,373.75080757229,392.4383479509,411.12588832951,418.60090448096,425.14154361347,436.04260883433,448.50096908674,457.84473927605,470.92601754108,479.64686971777,485.87604984397,490.54793493862,523.2511306012],"description":"Rectangle minimal beats spectrum of order 8"},"rectsp8a":{"frequencies":[261.6255653006,279.06726965397,281.75060878526,285.40970760065,290.69507255622,294.32876096318,299.00064605783,305.22982618403,313.95067836072,322.00069575458,327.03195662575,332.97799220076,336.37572681506,348.83408706747,359.73515228832,366.27579142084,373.75080757229,380.54627680087,392.4383479509,406.97310157871,411.12588832951,418.60090448096,425.14154361347,436.04260883433,448.50096908674,457.84473927605,465.11211608996,470.92601754108,479.64686971777,485.87604984397,490.54793493862,523.2511306012],"description":"Rectangle minimal beats spectrum of order 8 union with inversion"},"rectsp9":{"frequencies":[261.6255653006,290.69507255622,294.32876096318,299.00064605783,305.22982618403,313.95067836072,319.76457981184,327.03195662575,336.37572681506,348.83408706747,359.73515228832,366.27579142084,373.75080757229,377.90359432309,392.4383479509,406.97310157871,411.12588832951,418.60090448096,425.14154361347,436.04260883433,448.50096908674,457.84473927605,465.11211608996,470.92601754108,479.64686971777,485.87604984397,490.54793493862,494.18162334558,523.2511306012],"description":"Rectangle minimal beats spectrum of order 9"},"rectsp9a":{"frequencies":[261.6255653006,277.01530443593,279.06726965397,281.75060878526,285.40970760065,290.69507255622,294.32876096318,299.00064605783,305.22982618403,313.95067836072,319.76457981184,322.00069575458,327.03195662575,332.97799220076,336.37572681506,348.83408706747,359.73515228832,362.25078272391,366.27579142084,373.75080757229,377.90359432309,380.54627680087,392.4383479509,406.97310157871,411.12588832951,418.60090448096,425.14154361347,428.11456140098,436.04260883433,448.50096908674,457.84473927605,465.11211608996,470.92601754108,479.64686971777,485.87604984397,490.54793493862,494.18162334558,523.2511306012],"description":"Rectangle minimal beats spectrum of order 9 union with inversion"},"redfield":{"frequencies":[261.6255653006,290.69507255622,327.03195662575,348.83408706747,392.4383479509,436.04260883433,490.54793493862,523.2511306012],"description":"Redfield New Diatonic"},"reinhard":{"frequencies":[261.6255653006,277.01530443593,294.32876096318,309.81974838229,327.03195662575,348.83408706747,369.35373924791,392.4383479509,413.09299784305,436.04260883433,461.69217405988,490.54793493862,523.2511306012],"description":"Reinhard 19-limit superparticular"},"reinhard17":{"frequencies":[261.6255653006,277.01530443593,277.97716313189,286.94416839421,292.40504357126,296.50897400735,307.79478270659,317.68818643644,338.57426097725,342.12573923925,369.35373924791,400.13321751856,404.33041910093,430.91269578922,444.76346101102,477.08191319521,492.47165233054,523.2511306012],"description":"Reinhard's Harmonic-17 tuning for \"Tresspass\", 1998"},"renteng1":{"frequencies":[261.6255653006,285.40970760065,313.15788183285,391.64553850062,426.52890806662,523.2511306012],"description":"Gamelan Renteng from Chileunyi (Tg. Sari). 1/1=330 Hz"},"renteng2":{"frequencies":[261.6255653006,294.32876096318,311.77048523333,396.07199334683,425.86840190162,523.2511306012],"description":"Gamelan Renteng from Chikebo (Tg. Sari). 1/1=360 Hz"},"renteng3":{"frequencies":[261.6255653006,278.97471276149,312.97903559457,379.60005211265,409.44065404912,468.42785143649,523.2511306012],"description":"Gamelan Renteng from Lebakwangi (Pameungpeuk). 1/1=377 Hz"},"renteng4":{"frequencies":[261.6255653006,296.45730715573,311.93819010347,397.0826586675,424.17395032031,523.2511306012],"description":"Gamelan Renteng Bale` bandung from Kanoman (Cheribon). 1/1=338 Hz"},"robot":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,294.32876096318,306.59245933664,313.95067836072,327.03195662575,348.83408706747,367.91095120397,392.4383479509,436.04260883433,490.54793493862,523.2511306012],"description":"Dead Robot (see lattice)"},"robot_live":{"frequencies":[261.6255653006,294.32876096318,313.95067836072,327.03195662575,334.88072358477,348.83408706747,376.74081403286,392.4383479509,418.60090448096,446.50763144636,490.54793493862,502.32108537715,523.2511306012],"description":"Live Robot"},"romieu":{"frequencies":[261.6255653006,272.52663052146,294.32876096318,313.95067836072,327.03195662575,348.83408706747,367.91095120397,392.4383479509,408.78994578219,436.04260883433,465.11211608996,490.54793493862,523.2511306012],"description":"Romieu's Monochord, Memoire theorique & pratique (1758)"},"romieu_inv":{"frequencies":[261.6255653006,272.52663052146,290.69507255622,313.95067836072,327.03195662575,348.83408706747,367.91095120397,392.4383479509,418.60090448096,436.04260883433,465.11211608996,490.54793493862,523.2511306012],"description":"Romieu inverted, Pure (just) C minor in Wilkinson: Tuning In"},"rosati_21":{"frequencies":[261.6255653006,279.06726965397,290.69507255622,294.32876096318,299.00064605783,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,366.27579142084,373.75080757229,392.4383479509,406.97310157871,418.60090448096,436.04260883433,448.50096908674,457.84473927605,465.11211608996,470.92601754108,490.54793493862,523.2511306012],"description":"Dante Rosati, JI guitar tuning"},"rosati_21a":{"frequencies":[261.6255653006,280.31310567921,290.69507255622,294.32876096318,299.00064605783,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,366.27579142084,373.75080757229,392.4383479509,406.97310157871,418.60090448096,436.04260883433,448.50096908674,457.84473927605,465.11211608996,470.92601754108,488.36772189445,523.2511306012],"description":"Alternative version of rosati_21 with more tetrads"},"rousseau":{"frequencies":[261.6255653006,272.52663052146,294.32876096318,313.95067836072,327.03195662575,348.83408706747,363.36884069528,392.4383479509,418.60090448096,436.04260883433,470.92601754108,490.54793493862,523.2511306012],"description":"Rousseau's Monochord, Dictionnaire de musique (1768)"},"rousseauw":{"frequencies":[261.6255653006,276.81658657456,293.31219032635,311.14941643136,328.83652403056,349.33732971591,369.19521129916,391.76004912942,415.1051791302,439.20783490896,466.32059269121,492.40223109551,523.2511306012],"description":"Jean-Jacques Rousseau's temperament (1768)"},"rsr_12":{"frequencies":[261.6255653006,279.06726965397,299.00064605783,313.95067836072,327.03195662575,348.83408706747,366.27579142084,392.4383479509,418.60090448096,436.04260883433,470.92601754108,490.54793493862,523.2511306012],"description":"RSR - 7 limit JI"},"rvf-1":{"frequencies":[261.6255653006,272.14556467328,280.20095193414,292.09989854643,304.19649364034,313.29104303136,326.0297292803,340.21856244106,350.08660369014,364.11104988921,374.67209286633,390.97784457618,406.87534373272,419.03967825638,436.39317047385,454.92493848389,468.39051363853,487.22455955444,508.94280091833,523.2511306012],"description":"D-A 695 cents, the increment is 0.25 cents, interval range 49.5 to 75.5"},"rvf-2":{"frequencies":[261.6255653006,272.87751533003,278.75612859219,292.27711197479,305.71136588092,312.51386339015,326.29348693151,342.97106251658,349.87433921674,364.79522794952,372.13777859784,391.13596290168,408.38225803817,417.4934384938,436.65792486176,457.83788806384,467.7011114131,487.81592522452,513.9947144098,523.2511306012],"description":"695 cents, 0.607 cents, 31-90 cents, C-A# is 7/4."},"rvf-3":{"frequencies":[261.6255653006,272.98787180262,278.19314238431,292.29399505039,306.11778315204,312.24320803046,326.25579420701,343.90343447252,349.81371586656,364.81629995674,371.08598724028,391.15855645336,408.71263878415,416.89098941754,436.60748307387,458.73792719255,467.48503753613,487.78774868553,515.83876338215,523.2511306012],"description":"694.737, 0.082, 25-97, the fifth E#-B# is 3/2."},"majmin":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,290.69507255622,294.32876096318,313.95067836072,327.03195662575,348.83408706747,363.36884069528,367.91095120397,392.4383479509,408.78994578219,418.60090448096,436.04260883433,465.11211608996,470.92601754108,490.54793493862,523.2511306012],"description":"Malcolm & Marpurg 4 (Yamaha major & minor) mixed. Mersenne/Ban without D#"},"major_clus":{"frequencies":[261.6255653006,275.93321340298,290.69507255622,294.32876096318,327.03195662575,348.83408706747,367.91095120397,392.4383479509,436.04260883433,441.49314144476,465.11211608996,490.54793493862,523.2511306012],"description":"Chalmers' Major Mode Cluster"},"major_wing":{"frequencies":[261.6255653006,272.52663052146,294.32876096318,313.95067836072,327.03195662575,348.83408706747,392.4383479509,408.78994578219,418.60090448096,436.04260883433,470.92601754108,490.54793493862,523.2511306012],"description":"Chalmers' Major Wing with 7 major and 6 minor triads"},"malcolm":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,313.95067836072,327.03195662575,348.83408706747,367.91095120397,392.4383479509,418.60090448096,436.04260883433,465.11211608996,490.54793493862,523.2511306012],"description":"Malcolm's Monochord (1721), and C major in Yamaha synths, Wilkinson: Tuning In"},"malcolm2":{"frequencies":[261.6255653006,277.97716313189,294.32876096318,310.68035879446,327.03195662575,348.83408706747,370.63621750918,392.4383479509,414.24047839262,436.04260883433,463.29527188648,490.54793493862,523.2511306012],"description":"Malcolm 2"},"malcolm_ap":{"frequencies":[261.6255653006,279.47938236087,293.66476791741,313.97746652079,326.1838132033,349.22823143301,369.99442271164,391.99543598175,419.68935090103,436.0054062308,466.16376151809,489.82458627646,523.2511306012],"description":"Best approximations in mix of all ETs from 12-23 to Malcolm's Monochord"},"malcolm_me":{"frequencies":[261.6255653006,294.32876096318,327.03195662575,359.73515228832,392.4383479509,457.84473927605,490.54793493862,523.2511306012],"description":"Malcolm's Mid-East"},"malcolme":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,313.95067836072,327.03195662575,348.83408706747,372.08969287196,392.4383479509,418.60090448096,436.04260883433,465.11211608996,496.11959049595,523.2511306012],"description":"Most equal interval permutation of Malcolm's Monochord"},"malcolme2":{"frequencies":[261.6255653006,275.93321340298,294.32876096318,313.95067836072,327.03195662575,348.83408706747,367.91095120397,392.4383479509,418.60090448096,436.04260883433,465.11211608996,490.54793493862,523.2511306012],"description":"Inverse most equal interval permutation of Malcolm's Monochord"},"malcolms":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,313.95067836072,327.03195662575,348.83408706747,369.99442271164,392.4383479509,418.60090448096,436.04260883433,465.11211608996,490.54793493862,523.2511306012],"description":"Symmetrical version of Malcolm's Monochord and Albion scale"},"malerbi":{"frequencies":[261.6255653006,275.62199471997,292.73769384471,310.07474405997,327.54963108844,348.83408706747,367.49599295996,391.37619916626,413.43299207996,437.91808280662,465.11211608996,489.99465727995,523.2511306012],"description":"Luigi Malerbi's well-temperament nr.1 (1794) (nr.2 = Young)"},"malgache":{"frequencies":[261.6255653006,275.93321340298,294.32876096318,306.59245933664,327.03195662575,353.19451315581,367.91095120397,392.4383479509,413.89982010446,441.49314144476,459.88868900496,490.54793493862,523.2511306012],"description":"tuning from Madagascar"},"malgache1":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,310.07474405997,327.03195662575,353.19451315581,376.74081403286,392.4383479509,418.60090448096,441.49314144476,465.11211608996,490.54793493862,523.2511306012],"description":"tuning from Madagascar"},"malgache2":{"frequencies":[261.6255653006,275.93321340298,294.32876096318,313.95067836072,327.03195662575,353.19451315581,367.91095120397,392.4383479509,408.78994578219,441.49314144476,470.92601754108,490.54793493862,523.2511306012],"description":"tuning from Madagascar"},"malkauns":{"frequencies":[261.6255653006,313.95067836072,348.83408706747,418.60090448096,465.11211608996,523.2511306012],"description":"Raga Malkauns, inverse of prime_5"},"mambuti":{"frequencies":[261.6255653006,294.34406205295,331.72862856444,394.26624244126,466.16376151809,525.06772693396,590.39077962608,792.18471060794,999.82182774046],"description":"African Mambuti Flutes (aerophone; vertical wooden; one note each)"},"mandelbaum5":{"frequencies":[261.6255653006,272.52663052146,282.55561052465,290.69507255622,302.80736724606,313.95067836072,327.03195662575,340.65828815182,348.83408706747,363.36884069528,376.74081403286,392.4383479509,403.74315632809,418.60090448096,436.04260883433,454.2110508691,470.92601754108,484.4917875937,502.32108537715,523.2511306012],"description":"Mandelbaum's 5-limit 19-tone scale, kleismic detempered circle of minor thirds"},"mandelbaum7":{"frequencies":[261.6255653006,272.52663052146,280.31310567921,294.32876096318,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,366.27579142084,376.74081403286,392.4383479509,406.97310157871,418.60090448096,436.04260883433,457.84473927605,470.92601754108,490.54793493862,504.56359022259,523.2511306012],"description":"Mandelbaum's 7-limit 19-tone scale"},"marimba1":{"frequencies":[261.6255653006,284.4818984792,319.50463429683,342.83241505062,371.92288545737,411.72190027758,457.09800545097,500.48847822777,547.68138927822,612.97866327818,651.68292300609,728.11694797601,807.8963375694,903.69557412727,1013.19282257599,1069.7265813247,1225.95732655636,1303.36584601218],"description":"Marimba of the Bakwese, SW Belgian Congo (Zaire). 1/1=140.5 Hz"},"marimba2":{"frequencies":[261.6255653006,279.11058864149,318.03161540472,343.03050002254,379.95718438213,421.58889248327,458.6849347701,519.33670373121,571.2689787911,613.68721319418,694.83488613378,761.23234162637,846.59395682498,953.56868388592,1049.52904699774,1145.8425062572,1271.3918647407,1389.66977226756],"description":"Marimba of the Bakubu, S. Belgian Congo (Zaire). 1/1=141.5 Hz"},"marimba3":{"frequencies":[261.6255653006,296.73398952435,348.2210758395,420.13030572059,476.50902003141,518.73708886244,603.49292471609,696.44215167899,840.26061144117,953.01804006282,1037.47417772488],"description":"Marimba from the Yakoma tribe, Zaire. 1/1=185.5 Hz"},"marion":{"frequencies":[261.6255653006,269.91407136119,278.46532473603,287.28749371714,296.38899008685,305.77900572762,315.46632790985,325.46074015958,335.7715953476,346.4093067252,357.3838291689,368.70624618807,380.38737313392,392.4383479509,411.71310103548,431.93429139282,453.14890242083,475.40520223986,498.75490298644,523.2511306012],"description":"scale with two different ET step sizes"},"marion1":{"frequencies":[261.6255653006,262.79353657426,272.52663052146,280.31310567921,286.15296204753,294.32876096318,305.22982618403,311.45900631024,327.03195662575,336.37572681506,343.38355445704,350.39138209902,367.91095120397,373.75080757229,381.53728273004,392.4383479509,408.78994578219,420.46965851882,436.04260883433,457.84473927605,467.18850946536,476.92160341255,490.54793493862,515.07533168556,523.2511306012],"description":"Marion's 7-limit Scale # 1"},"marion10":{"frequencies":[261.6255653006,267.07609791103,272.52663052146,286.15296204753,290.69507255622,296.75121990114,305.22982618403,317.94773560837,327.03195662575,339.14425131559,356.10146388137,363.36884069528,370.93902487643,381.53728273004,400.61414686654,406.97310157871,408.78994578219,423.93031414449,436.04260883433,445.12682985172,457.84473927605,474.80195184183,476.92160341255,484.4917875937,508.71637697339,523.2511306012],"description":"Marion's 7-limit Scale # 10"},"marion15":{"frequencies":[261.6255653006,269.10058145205,280.31310567921,288.32205155576,299.00064605783,313.95067836072,320.35783506196,327.03195662575,336.37572681506,353.19451315581,358.80077526939,360.4025644447,373.75080757229,384.42940207435,392.4383479509,403.65087217807,418.60090448096,420.46965851882,427.14378008261,448.50096908674,461.31528248922,470.92601754108,480.53675259294,504.56359022259,523.2511306012],"description":"Marion's 7-limit Scale # 15"},"marion19":{"frequencies":[261.6255653006,274.70684356563,280.31310567921,286.15296204753,294.32876096318,309.04519901133,313.95067836072,315.35224388912,327.03195662575,336.37572681506,343.38355445704,353.19451315581,366.27579142084,367.91095120397,373.75080757229,392.4383479509,403.65087217807,412.06026534844,420.46965851882,441.49314144476,457.84473927605,470.92601754108,490.54793493862,504.56359022259,515.07533168556,523.2511306012],"description":"Marion's 7-limit Scale # 19"},"marion26":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,284.8811711051,293.02063313667,303.87324917877,305.22982618403,310.07474405997,325.57848126297,334.88072358477,341.85740532612,348.83408706747,366.27579142084,379.84156147346,390.69417751556,406.97310157871,418.60090448096,427.32175665765,434.10464168396,455.80987376816,465.11211608996,474.80195184183,488.36772189445,512.78610798918,523.2511306012],"description":"Marion's 7-limit Scale # 26"},"marissing":{"frequencies":[261.6255653006,290.69507255622,294.32876096318,313.95067836072,327.03195662575,348.83408706747,367.91095120397,392.4383479509,436.04260883433,441.49314144476,465.11211608996,490.54793493862,523.2511306012],"description":"Peter van Marissing, just scale, Mens en Melodie, 1979"},"marpurg-1":{"frequencies":[261.6255653006,276.86979852503,294.32876096318,311.47852302926,329.62755691287,348.83408706747,370.83100115625,392.4383479509,415.30469757995,439.50340943686,467.21778431035,494.44133512215,523.2511306012],"description":"Other temperament by Marpurg, 3 fifths 1/3 Pyth. comma flat"},"marpurg-t1":{"frequencies":[261.6255653006,275.62199471997,294.32876096318,310.07474405997,327.03195662575,348.83408706747,367.91095120397,392.4383479509,413.43299207996,436.04260883433,465.11211608996,490.54793493862,523.2511306012],"description":"Marpurg's temperament nr.1, Kirnbergersche Temperatur (1766)"},"marpurg-t11":{"frequencies":[261.6255653006,278.12325072816,294.32876096318,311.47852302926,331.11985608357,348.83408706747,371.66947115233,392.4383479509,416.24372513446,441.49314144476,466.16376151809,496.67978412536,523.2511306012],"description":"Marpurg's temperament nr.11, 6 tempered fifths"},"marpurg-t12":{"frequencies":[261.6255653006,279.06706247425,294.66131982972,310.42509491746,330.74614861362,349.22823143301,372.08941681833,392.88175996935,418.60059350213,441.99197952365,465.63764214343,496.11922267243,523.2511306012],"description":"Marpurg's temperament nr.12, 4 tempered fifths"},"marpurg-t2":{"frequencies":[261.6255653006,278.75210322491,294.32876096318,313.59611581451,331.11985608357,348.83408706747,371.66947115233,392.4383479509,418.12815462835,441.49314144476,470.39417348663,495.55929511749,523.2511306012],"description":"Marpurg's temperament nr.2, 2 tempered fifths, Neue Methode (1790)"},"marpurg-t3":{"frequencies":[261.6255653006,276.55731914056,294.32876096318,311.12698372208,331.11985608357,348.83408706747,368.74309237173,392.4383479509,414.83597850347,441.49314144476,465.11211608996,491.65745674141,523.2511306012],"description":"Marpurg's temperament nr.3, 2 tempered fifths"},"marpurg-t4":{"frequencies":[261.6255653006,276.86979852503,294.32876096318,310.07474405997,331.11985608357,348.83408706747,369.15973155124,392.4383479509,415.30469757995,441.49314144476,465.11211608996,492.21297564769,523.2511306012],"description":"Marpurg's temperament nr.4, 2 tempered fifths"},"marpurg-t5":{"frequencies":[261.6255653006,277.80935667884,294.32876096318,312.53552595124,331.11985608357,348.83408706747,370.41247575694,392.4383479509,416.71403480995,441.49314144476,468.80328869252,493.88330125613,523.2511306012],"description":"Marpurg's temperament nr.5, 2 tempered fifths"},"marpurg-t7":{"frequencies":[261.6255653006,276.86979852503,293.00227310437,310.07474405997,329.62755691287,348.83408706747,369.15973155124,390.66969766777,415.30469757995,439.50340943686,465.11211608996,492.21297564769,523.2511306012],"description":"Marpurg's temperament nr.7, 3 tempered fifths"},"marpurg-t8":{"frequencies":[261.6255653006,277.49581689502,293.33333347996,311.12698372208,329.99999983505,348.83408706747,369.99442271164,391.11111150212,414.83597850347,440,466.69047534984,493.32589719545,523.2511306012],"description":"Marpurg's temperament nr.8, 4 tempered fifths"},"marpurg-t9":{"frequencies":[261.6255653006,277.49581689502,294.32876096318,312.18279369479,331.11985608357,350.01785633742,371.24999944327,392.4383479509,416.24372513446,441.49314144476,468.27419030811,496.67978412536,523.2511306012],"description":"Marpurg's temperament nr.9, 4 tempered fifths"},"marpurg":{"frequencies":[261.6255653006,277.49581689502,293.83071040301,311.12698372208,329.99999983505,349.42557141756,369.99442271164,392.4383479509,415.53937569366,440,466.69047534984,494.16238213869,523.2511306012],"description":"Marpurg, Versuch ueber die musikalische Temperatur (1776), p. 153"},"marpurg1":{"frequencies":[261.6255653006,272.52663052146,294.32876096318,313.95067836072,327.03195662575,348.83408706747,367.91095120397,392.4383479509,408.78994578219,436.04260883433,470.92601754108,490.54793493862,523.2511306012],"description":"Marpurg's Monochord no.1 (1776)"},"marpurg3":{"frequencies":[261.6255653006,272.52663052146,294.32876096318,313.95067836072,327.03195662575,348.83408706747,367.91095120397,392.4383479509,408.78994578219,441.49314144476,465.11211608996,490.54793493862,523.2511306012],"description":"Marpurg 3"},"marpurg4":{"frequencies":[261.6255653006,272.52663052146,290.69507255622,313.95067836072,327.03195662575,348.83408706747,363.36884069528,392.4383479509,408.78994578219,436.04260883433,470.92601754108,490.54793493862,523.2511306012],"description":"Marpurg 4, also Yamaha Pure Minor"},"marsh":{"frequencies":[261.6255653006,275.50659558095,293.15632631094,311.93674864629,328.48713220126,349.53094576004,368.07595926604,391.65594491223,412.43597848639,438.85779226656,466.97226207056,491.74834273545,523.2511306012],"description":"John Marsh's meantone temperament (1809)"},"marsh2":{"frequencies":[261.6255653006,277.22760066578,293.66431501254,311.21660561883,329.70790803338,349.18845812715,369.99117208793,391.90679138833,415.30984563838,439.96491544382,466.29335337935,494.03030700757,523.2511306012],"description":"John Marsh's quasi-equal temperament (1840)"},"mavila12":{"frequencies":[261.6255653006,256.98292999787,287.53945699376,321.72930260925,316.02010771872,353.59644178868,347.32175377489,388.62000642034,381.72381344999,427.11263899087,477.89842030218,469.41794908116,525.2340355968],"description":"A 12-note mavila scale (for warping meantone-based music)"},"mavila9":{"frequencies":[261.6255653006,287.53945699376,316.02010771872,321.72930260925,353.59644178868,388.62000642034,427.11263899087,434.82882549415,477.89842030218,525.2340355968],"description":"9-note scale of mavila temperament (TOP tuning)"},"mavlim1":{"frequencies":[261.6255653006,294.32876096318,313.95067836072,327.03195662575,348.83408706747,392.4383479509,418.60090448096,436.04260883433,465.11211608996,523.2511306012],"description":"First 27/25&135/128 scale"},"mbira_banda":{"frequencies":[261.6255653006,291.13134764929,327.53979283172,368.50142299854,404.88256627495,443.57258128492,480.10063929961,555.00605988575],"description":"Mubayiwa Bandambira's tuning of keys R2-R9 from Berliner: The soul of mbira."},"mbira_banda2":{"frequencies":[261.6255653006,321.16993719469,360.29289210659,380.8360868427,422.32008370967,461.34206956593,587.32953583482,513.96502576833,761.67217368541,711.48673390068,849.04255025658,936.10488897708,1046.50286568598,633.49659152295,1055.60951665979,1174.65975017952,1321.5609185619,1486.83332446121,1633.62433483289,1789.73120457747,1937.11498804338,2239.34414798534],"description":"Mubayiwa Bandambira's Mbira DzaVadzimu tuning B1=114 Hz"},"mbira_gondo":{"frequencies":[261.6255653006,315.28798447451,345.21700307457,379.51849407657,422.56409582244,461.07566488503,564.05539604512,516.94239487354,778.57545143809,697.24717811406,842.69088701475,926.42243447898,1029.11884353824,628.3943418294,1040.47545270591,1153.813137635,1308.64724593201,1415.59600512246,1572.51770682594,1715.83353717518,1883.05646656025,2103.91477035149],"description":"John Gondo's Mbira DzaVadzimu tuning B1=122 Hz"},"mbira_kunaka":{"frequencies":[261.6255653006,292.98704147282,325.27731021818,350.44066402496,386.59871897734,434.19311733646,479.82340237272,507.76825077597],"description":"John Kunaka's mbira tuning of keys R2-R9"},"mbira_kunaka2":{"frequencies":[261.6255653006,340.26769547546,358.83903996308,405.11650317313,448.98591596033,490.75518955849,622.61349925697,541.70354187177,817.28364083393,724.3415782324,907.35693646861,997.5144154576,1094.73088724383,673.88551872153,1085.91380691742,1216.08403680913,1350.10935126711,1454.55340013417,1604.63250673428,1802.17976955899,1991.5747030301,2107.56373750553],"description":"John Kunaka's Mbira DzaVadzimu tuning B1=113 Hz"},"mbira_mude":{"frequencies":[261.6255653006,289.28740724512,309.15639683494,364.68988616898,372.56793743951,408.17001145418,507.1819925915,459.74594725879,689.63684605432,610.50517472746,760.79276355093,824.39562982862,887.65774573556,562.75365576207,888.68380073365,1015.53708814899,1126.80895076279,1206.28956516212,1365.00817887311,1507.58874420517,1666.02447560859,1935.99638964471],"description":"Hakurotwi Mude's Mbira DzaVadzimu tuning B1=132 Hz"},"mbira_mujuru":{"frequencies":[261.6255653006,281.37682788104,301.05008478933,329.43721154897,394.9500460767,419.64523240241,533.01280425363,488.77489658044,700.88132804992,602.10016957865,765.19999119503,809.29752893,942.6160133907,577.57308891646,937.72844143307,1046.50286568598,1145.18149427149,1243.7900049313,1411.51350174391,1540.15576038017,1658.34356815416,1904.9365287586],"description":"Ephat Mujuru's Mbira DzaVadzimu tuning, B1=106 Hz"},"mbira_zimb":{"frequencies":[261.6255653006,276.86260193655,305.95868600104,343.62544191138,379.08031027329,408.40584780369,453.41648894489,507.76825077597],"description":"Shona mbira scale"},"mboko_bow":{"frequencies":[261.6255653006,347.61817721989,375.37611551499],"description":"African Mboko Mouth Bow (chordophone, single string, plucked)"},"mboko_zither":{"frequencies":[261.6255653006,294.68429813772,319.3201344739,354.92237405774,396.55020354877,418.67676528474,472.67116512585,513.07516347663],"description":"African Mboko Zither (chordophone; idiochordic palm fibre, plucked)"},"mcclain":{"frequencies":[261.6255653006,275.93321340298,294.32876096318,306.59245933664,327.03195662575,331.11985608357,367.91095120397,392.4383479509,408.78994578219,441.49314144476,490.54793493862,510.98743222773,523.2511306012],"description":"McClain's 12-tone scale, see page 119 of The Myth of Invariance"},"mcclain_18":{"frequencies":[261.6255653006,275.93321340298,294.32876096318,306.59245933664,319.36714514233,327.03195662575,331.11985608357,344.91651675372,367.91095120397,383.2405741708,392.4383479509,408.78994578219,413.89982010446,441.49314144476,459.88868900496,490.54793493862,496.67978412536,510.98743222773,523.2511306012],"description":"McClain's 18-tone scale, see page 143 of The Myth of Invariance"},"mcclain_8":{"frequencies":[261.6255653006,294.32876096318,327.03195662575,367.91095120397,392.4383479509,408.78994578219,441.49314144476,490.54793493862,523.2511306012],"description":"McClain's 8-tone scale, see page 51 of The Myth of Invariance"},"mccoskey_22":{"frequencies":[261.6255653006,270.06509966514,279.06726965397,287.78812183066,299.00064605783,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,359.73515228832,366.27579142084,382.37582620857,392.4383479509,406.97310157871,418.60090448096,436.04260883433,448.50096908674,457.84473927605,470.92601754108,490.54793493862,506.89953276991,523.2511306012],"description":"31-limit rational interpretation of 22-tET, Marion McCoskey"},"mclaren_bar":{"frequencies":[261.6255653006,281.77400528964,292.14326370913,304.76756192248,325.50548568708,328.66136118639,353.45752508165,360.67039921732,379.1552038283,397.63971531932,405.75513620619,436.411067852,476.98680497297,521.16951219839],"description":"Metal bar scale. see McLaren, Xenharmonicon 15, pp.31-33"},"mclaren_cps":{"frequencies":[261.6255653006,275.93321340298,286.15296204753,294.32876096318,306.59245933664,327.03195662575,343.38355445704,367.91095120397,392.4383479509,408.78994578219,429.2294430713,441.49314144476,457.84473927605,490.54793493862,515.07533168556,523.2511306012],"description":"2)12 [1,2,3,4,5,6,8,9,10,12,14,15] a degenerate CPS"},"mclaren_harm":{"frequencies":[261.6255653006,279.06726965397,299.00064605783,304.4370214407,307.2300216374,348.83408706747,380.54627680087,389.39619021485,393.97732186443,398.6675280771,465.11211608996,523.2511306012],"description":"from \"Wilson part 9\", claimed to be Schlesingers Dorian Enharmonic, prov. unkn"},"mclaren_rath1":{"frequencies":[261.6255653006,279.06726965397,299.00064605783,334.88072358477,341.71502406609,348.83408706747,372.08969287196,380.54627680087,389.39619021485,398.6675280771,492.47165233054,507.3950357345,523.2511306012],"description":"McLaren Rat H1"},"mclaren_rath2":{"frequencies":[261.6255653006,279.06726965397,299.00064605783,334.88072358477,341.71502406609,348.83408706747,380.54627680087,389.39619021485,398.6675280771,440.63253103259,452.54151835779,465.11211608996,523.2511306012],"description":"McLaren Rat H2"},"mean10":{"frequencies":[261.6255653006,272.18829429226,292.14313377277,313.56091500001,326.220453695,350.13653284039,364.27275363262,390.97854693193,406.76370320307,436.58461973079,468.59178605305,487.51045723915,523.2511306012],"description":"3/10-comma meantone scale"},"mean11":{"frequencies":[261.6255653006,272.83457350033,292.34115464648,313.24237654315,326.6628419965,350.01792709981,365.01399145768,391.11103243201,407.86767761879,437.02858581415,468.2743796482,488.33699124025,523.2511306012],"description":"3/11-comma meantone scale. A.J. Ellis no. 10"},"mean11ls_19":{"frequencies":[261.6255653006,272.93479580544,280.25721516838,292.37183188538,305.01012622427,313.1930753928,326.73140514978,340.85495140859,349.99956372811,365.12891753666,374.92476290643,391.13155279262,408.03891236124,418.98596425085,437.09738047696,455.99169236578,468.2252457596,488.46511500326,509.57988860269,523.2511306012],"description":"Least squares appr. to 3/2, 5/4, 7/6, 15/14 and 11/8, Petr Par�zek"},"mean13":{"frequencies":[261.6255653006,273.83184954717,292.64606374809,312.75295135888,327.34460995374,349.8355370417,366.15730590163,391.31494185909,409.57195510156,437.7124891801,467.78648270341,489.61131479929,523.2511306012],"description":"3/13-comma meantone scale"},"mean14":{"frequencies":[261.6255653006,274.22463192287,292.76593693997,312.56088569186,327.61283758281,349.76390952171,366.60744235102,391.39507854003,410.24343789088,437.98145930734,467.59494724206,490.11285326462,523.2511306012],"description":"3/14-comma meantone scale (Giordano Riccati, 1762)"},"mean14_15":{"frequencies":[261.6255653006,274.22463192287,279.31500250577,292.76593693997,306.86462618694,312.56088569186,327.61283758281,349.76390952171,366.60744235102,391.39507854003,410.24343789088,417.8586951835,437.98145930734,467.59494724206,490.11285326462,523.2511306012],"description":"15 of 3/14-comma meantone scale"},"mean14_19":{"frequencies":[261.6255653006,274.22463192287,279.31500250577,292.76593693997,306.86462618694,312.56088569186,327.61283758281,343.38964426558,349.76390952171,366.60744235102,373.41269440635,391.39507854003,410.24343789088,417.8586951835,437.98145930734,459.07327263526,467.59494724206,490.11285326462,513.71515101261,523.2511306012],"description":"19 of 3/14-comma meantone scale"},"mean14_7":{"frequencies":[261.6255653006,292.76593693997,327.61283758281,349.76390952171,391.39507854003,437.98145930734,490.11285326462,523.2511306012],"description":"Least squares appr. of 5L+2S to Ptolemy's Intense Diatonic scale"},"mean14a":{"frequencies":[261.6255653006,274.24690838881,292.77273178776,312.55000460003,327.62804498858,349.75985073129,366.63296888199,391.39962048672,410.28152481852,437.9967071602,467.58409501387,490.1412915133,523.2511306012],"description":"fifth of sqrt(5/2)-1 octave \"recursive\" meantone, Paul Hahn"},"mean16":{"frequencies":[261.6255653006,274.864106667,292.9608347655,312.24903186879,328.04917632434,349.64754658398,367.34009701877,391.52533508436,411.33694767869,438.41888642025,467.28387071703,490.92894854125,523.2511306012],"description":"3/16-comma meantone scale"},"mean17":{"frequencies":[261.6255653006,273.72412433093,292.61316553779,312.80569569783,327.2710181906,349.85520131118,366.03383354947,391.29294726693,409.38781813791,437.63868343995,467.83907547741,489.47372981579,523.2511306012],"description":"4/17-comma meantone scale, least squares error of 5/4 and 3/2"},"mean17_17":{"frequencies":[261.6255653006,273.72412433093,279.67971414776,292.61316553779,306.14471057197,312.80569569783,327.2710181906,349.85520131118,366.03383354947,373.99786656393,391.29294726693,409.38781813791,418.29512920081,437.63868343995,457.8767570375,467.83907547741,489.47372981579,523.2511306012],"description":"4/17-comma meantone scale with split C#/Db, D#/Eb, F#/Gb, G#/Ab and A#/Bb"},"mean17_19":{"frequencies":[261.6255653006,273.72412433093,279.67971414776,292.61316553779,306.14471057197,312.80569569783,327.2710181906,342.40527209253,349.85520131118,366.03383354947,373.99786656393,391.29294726693,409.38781813791,418.29512920081,437.63868343995,457.8767570375,467.83907547741,489.47372981579,512.10885267608,523.2511306012],"description":"4/17-comma meantone scale, least squares error of 5/4 and 3/2"},"mean18":{"frequencies":[261.6255653006,272.71477685134,292.30447317753,313.30134186202,326.58087306932,350.03988839382,364.87661266094,391.0864943589,407.66301227525,436.94633423564,468.33314368944,488.18382342185,523.2511306012],"description":"5/18-comma meantone scale (Smith). 3/2 and 5/3 eq. beat. A.J. Ellis no. 9"},"mean19":{"frequencies":[261.6255653006,273.06170311607,292.41066686775,313.13068664042,326.81820677503,349.97632128221,365.27443420834,391.15752841841,408.25574814862,437.18446858874,468.16306089008,488.62733218513,523.2511306012],"description":"5/19-comma meantone scale, fifths beats three times third. A.J. Ellis no. 11"},"mean19r":{"frequencies":[261.6255653006,273.04332227389,292.40504357126,313.13971948727,326.80563693258,349.97968716666,365.25335892465,391.15376651139,408.22434232755,437.17185753972,468.17206422213,488.60384173026,523.2511306012],"description":"Approximate 5/19-comma meantone with 19/17 tone, Petr Parizek, 2002"},"mean23":{"frequencies":[261.6255653006,274.15058593695,292.74334833321,312.59706303545,327.56228503462,349.77740346966,366.52259116395,391.37997903742,410.11684180717,437.93077103284,467.63102771476,490.01832104213,523.2511306012],"description":"5/23-comma meantone scale, A.J. Ellis no. 4"},"mean23six":{"frequencies":[261.6255653006,273.11604376732,292.42729246507,313.10398392891,326.85537164611,349.96637341293,365.33674088125,391.16864715511,408.34860251967,437.22175336101,468.13644404983,488.69678846289,523.2511306012],"description":"6/23-comma meantone scale"},"mean25":{"frequencies":[261.6255653006,272.66208311698,292.28833573479,313.32728859832,326.54481265413,350.04955123355,364.81618195011,391.07569872695,407.57299290994,436.91015056532,468.35900068872,488.11644468937,523.2511306012],"description":"7/25-comma meantone scale, least square weights 3/2:0 5/4:1 6/5:1"},"mean26":{"frequencies":[261.6255653006,272.91754119498,292.36655103694,313.20156187458,326.7196004604,350.00272362315,365.10913291207,391.12802157824,408.00943064927,437.08553692506,468.23370304224,488.44305713046,523.2511306012],"description":"7/26-comma meantone scale (Woolhouse 1835). Almost equal to meaneb742"},"mean26_21":{"frequencies":[261.6255653006,272.91754592428,280.26986822267,292.36655272572,304.98534036063,313.20156006546,326.71960423481,335.52133892506,340.8210986211,350.00272362315,365.10913712997,374.9450750913,391.12802157824,408.00943771953,419.00109777107,437.08553944976,455.95052092314,468.23370033762,488.44306277317,501.60158217053,509.52467838008,523.2511306012],"description":"21 of 7/26-comma meantone scale (Woolhouse 1835)"},"mean27":{"frequencies":[261.6255653006,273.15429014256,292.43899158768,313.08519355925,326.88152513903,349.9593710588,365.38059276675,391.17647406766,408.41395592075,437.24799400905,468.11771609009,488.74567091648,523.2511306012],"description":"7/27-comma meantone scale, least square weights 3/2:2 5/4:1 6/5:1"},"mean29":{"frequencies":[261.6255653006,273.57932033947,292.56893127899,312.87664195194,327.1720749345,349.88164908166,365.86785468743,391.26336919078,409.14031659695,437.53944680455,467.90980928584,489.28875967044,523.2511306012],"description":"7/29-comma meantone scale, least square weights 3/2:4 5/4:1 6/5:1"},"mean2sev":{"frequencies":[261.6255653006,272.52663052146,292.24684137387,313.39402123097,326.45210604021,350.07440004945,364.66083404534,391.04793957621,407.34160211012,436.81711699543,468.42550014967,487.94322738789,523.2511306012],"description":"2/7-comma meantone scale. Zarlino's temperament (1558). See also meaneb371"},"mean2sev_15":{"frequencies":[261.6255653006,272.52663052146,280.55692507618,292.24689370448,304.42377254813,313.39402847191,326.45203249943,350.07447082328,364.66081719444,391.04786051887,407.34165622677,419.34452602299,436.81710690282,468.42541627199,487.94330348661,523.2511306012],"description":"15 of 2/7-comma meantone scale"},"mean2sev_19":{"frequencies":[261.6255653006,272.52663052146,280.55692507618,292.24689370448,304.42377254813,313.39402847191,326.45203249943,340.0543130973,350.07447082328,364.66081719444,375.40603866065,391.04786051887,407.34165622677,419.34452602299,436.81710690282,455.01770749831,468.42541627199,487.94330348661,508.27414914183,523.2511306012],"description":"19 of 2/7-comma meantone scale"},"mean2sev_31":{"frequencies":[261.6255653006,264.72620698393,272.52663052146,280.55692507618,283.88190679319,292.24689370448,300.8583415146,304.42377254813,313.39402847191,317.10820138491,326.45203249943,336.07138073182,340.0543130973,350.07447082328,354.22315547012,364.66081719444,375.40603866065,379.85514366424,391.04786051887,395.6823437549,407.34165622677,419.34452602299,424.31412061457,436.81710690282,449.68851049921,455.01770749831,468.42541627199,473.97693555703,487.94330348661,502.32108537715,508.27414914183,523.2511306012],"description":"31 of 2/7-comma meantone scale"},"mean2seveb":{"frequencies":[261.6255653006,274.26749945295,292.59076110537,312.44357330613,327.42660602987,349.76102048238,366.6169314736,391.04794861134,410.01084835752,437.49574139527,467.27496094916,489.74950989452,523.2511306012],"description":"\"2/7-comma\" meantone with equal beating fifths. A.J. Ellis no. 8"},"mean2sevr":{"frequencies":[261.6255653006,272.52663052146,292.24289114742,313.39346366789,326.45152465405,350.07234194042,364.65868952128,391.04531121882,407.33886585294,436.81651812993,468.41855142334,487.93599106598,523.2511306012],"description":"Rational approximation to 2/7-comma meantone, 1/1 = 262.9333"},"mean9":{"frequencies":[261.6255653006,274.03547926168,292.70827332867,306.59245933664,327.48360691354,349.79835961887,366.39065074918,391.35653176554,409.92008797511,437.85206746661,467.68706357679,489.87127257422,523.2511306012],"description":"2/9-comma meantone scale, Lemme Rossi, Sistema musico (1666)"},"mean94":{"frequencies":[261.6255653006,268.79084150406,291.09659021292,315.25339315665,323.88740273232,350.76536842075,360.37196303797,390.27761906502,400.96635635801,434.24075936811,470.27645613296,483.15616342113,523.2511306012],"description":"4/9-comma meantone scale"},"mean9_15":{"frequencies":[261.6255653006,274.03547926168,279.45274708261,292.70827332867,306.59245933664,312.65343270838,327.48360691354,349.79835961887,366.39065074918,391.35653176554,409.92008797511,418.0235894185,437.85206746661,467.68706357679,489.87127257422,523.2511306012],"description":"15 of 2/9-comma meantone scale"},"mean9_19":{"frequencies":[261.6255653006,274.03547926168,279.45274708261,292.70827332867,306.59245933664,312.65343270838,327.48360691354,343.0174228875,349.79835961887,366.39065074918,373.63364091796,391.35653176554,409.92008797511,418.0235894185,437.85206746661,458.62082212371,467.68706357679,489.87127257422,513.10776453427,523.2511306012],"description":"19 of 2/9-comma meantone scale"},"mean9_31":{"frequencies":[261.6255653006,268.72322665693,274.03547926168,279.45274708261,287.03404351137,292.70827332867,298.49467410529,306.59245933664,312.65343270838,321.13524775754,327.48360691354,333.95746354843,343.0174228875,349.79835961887,359.28803828513,366.39065074918,373.63364091796,383.76997851754,391.35653176554,401.97367512027,409.92008797511,418.0235894185,429.36393755067,437.85181455341,446.50763144636,458.62082212371,467.68706357679,480.3749841712,489.87127257422,499.55528826613,513.10776453427,523.2511306012],"description":"31 of 2/9-comma meantone scale"},"meaneb1071":{"frequencies":[261.6255653006,273.45959631537,292.5323192343,305.76452283047,327.09038632535,349.9034421565,365.73073124967,391.23900009103,408.93579686983,437.45744778434,457.24482979639,489.13584427285,523.2511306012],"description":"Equal beating 7/4 = 3/2 same."},"meaneb1071a":{"frequencies":[261.6255653006,273.94115519525,292.67936294368,306.45675889694,327.41929816594,349.81553441422,366.28252094772,391.33731744348,409.75863641311,437.78732645584,458.39517452459,489.75074612717,523.2511306012],"description":"Equal beating 7/4 = 3/2 opposite."},"meaneb341":{"frequencies":[261.6255653006,272.43747957464,292.21954801903,313.43802026715,326.39113133433,350.09085029289,364.55867287416,391.02956482064,407.18921698842,436.75579855003,468.46925117002,487.82916876009,523.2511306012],"description":"Equal beating 6/5 = 5/4 same. Almost 4/15 Pyth. comma"},"meaneb371":{"frequencies":[261.6255653006,272.52577151658,292.24657972098,313.39444482621,326.45151771442,350.07455777399,364.65985037488,391.0477633913,407.34013625771,436.81652657765,468.42591953828,487.94213100406,523.2511306012],"description":"Equal beating 6/5 = 3/2 same. Practically 2/7-comma (Zarlino)"},"meaneb371a":{"frequencies":[261.6255653006,269.83862220337,291.42039690163,314.72828847419,324.6081803116,350.57044084899,361.57569171511,390.49462500658,421.72650333798,434.96526321606,469.75391665508,484.50062400899,523.2511306012],"description":"Equal beating 6/5 = 3/2 opposite. Almost 2/5-comma"},"meaneb381":{"frequencies":[261.6255653006,275.92799893014,293.28437056932,311.73248946737,328.77414682856,349.45463702831,368.55847249214,391.74146894101,416.38271791821,439.14534885862,466.76838786866,492.28548089506,523.2511306012],"description":"Equal beating 6/5 = 8/5 same. Almost 1/7-comma"},"meaneb451":{"frequencies":[261.6255653006,274.36682021224,292.8092284668,312.49148032108,327.70992276921,349.73795145032,366.77030983847,391.42412846541,410.48661799548,438.07873640926,467.5258138363,490.29448158868,523.2511306012],"description":"Equal beating 5/4 = 4/3 same, 5/24 comma meantone. A.J. Ellis no. 6"},"meaneb471":{"frequencies":[261.6255653006,272.3284467197,292.18612898941,313.49179640307,326.31648163178,350.11087068539,364.43361138613,391.00720457415,407.00321492741,436.68087780422,468.52283272721,487.68970701588,523.2511306012],"description":"Equal beating 5/4 = 3/2 same. Almost 5/17-comma"},"meaneb471a":{"frequencies":[261.6255653006,274.14912748586,292.7429036132,312.59777626068,327.56128980523,349.7776701617,366.52092076205,391.37968062521,410.11434970273,437.92977184699,467.63173811584,490.01645860508,523.2511306012],"description":"Equal beating 5/4 = 3/2 opposite. Almost 1/5 Pyth. Gottfried Keller (1707)"},"meaneb471b":{"frequencies":[261.6255653006,272.31089540773,292.18072491748,313.50040506268,326.30440921209,350.11400731728,364.41338872146,391.00370158472,406.97310157871,436.668886633,468.53149836075,487.66729542944,523.2511306012],"description":"21/109-comma meantone with 9/7 major thirds, almost equal beating 5/4 and 3/2"},"meaneb472":{"frequencies":[261.6255653006,270.83769079127,291.72826852127,314.23020335825,325.29440843388,350.38540704884,362.72286472858,390.7008399429,404.45761497645,435.65472502222,469.25816799182,485.78126704788,523.2511306012],"description":"Beating of 5/4 = twice 3/2 same. Almost 5/14-comma"},"meaneb472_19":{"frequencies":[261.6255653006,270.8378472333,281.80541953687,291.72826852127,302.00051792575,314.23002185182,325.29459633135,336.74877333101,350.38540704884,362.72307424558,377.41153667283,390.7008399429,404.45808222448,420.83660282593,435.65497666633,450.99513069838,469.25816799182,485.78154764623,502.88674365212,523.2511306012],"description":"Beating of 5/4 = twice 3/2 same, 19 tones"},"meaneb472a":{"frequencies":[261.6255653006,274.74648495017,292.92493846141,312.30633997417,327.96897748493,349.66886860972,367.20529370531,391.50146074488,411.13561642091,438.33843670622,467.34113372786,490.7787182415,523.2511306012],"description":"Beating of 5/4 = twice 3/2 opposite. Almost 3/17-comma"},"meaneb591":{"frequencies":[261.6255653006,273.06215106005,292.41085266114,313.13038820279,326.81843330822,349.97621009739,365.27491737756,391.15765268623,418.87439289145,437.18488525956,468.16276342643,488.62782610925,523.2511306012],"description":"Equal beating 4/3 = 5/3 same."},"meaneb732":{"frequencies":[261.6255653006,272.00548436883,292.08705896894,313.65121264041,326.09523618955,350.1701397801,364.06303937825,390.94102347986,406.4514961644,436.45893055948,468.68174619223,487.27655969467,523.2511306012],"description":"Beating of 3/2 = twice 6/5 same. Almost 4/13-comma"},"meaneb732_19":{"frequencies":[261.6255653006,272.00553778846,280.94077405591,292.08707584055,303.67560621907,313.65118727632,326.09527197795,339.03307470248,350.17012966679,364.06310036266,376.02237826726,390.94103477068,406.45158772689,419.80330474394,436.45896585468,453.77543893118,468.68171912011,487.27662724555,506.60928680033,523.2511306012],"description":"Beating of 3/2 = twice 6/5 same, 19 tones"},"meaneb732a":{"frequencies":[261.6255653006,270.68848625127,291.6822692306,314.3042667302,325.1920204578,350.41293324447,362.5515203525,390.67014898736,404.20304509584,435.55206635241,469.33217160858,485.59021720901,523.2511306012],"description":"Beating of 3/2 = twice 6/5 opposite. Almost 1/3 Pyth. comma"},"meaneb742":{"frequencies":[261.6255653006,272.89343543801,292.35917287023,313.21341909223,326.70311046689,350.00714105462,365.08148980199,391.12308516115,407.96824372307,437.06899032128,468.24551969328,488.41224041213,523.2511306012],"description":"Beating of 3/2 = twice 5/4 same."},"meaneb742a":{"frequencies":[261.6255653006,273.78850133971,292.63287562287,312.77409391616,327.31510698093,349.84341999552,366.10759179471,391.30612443552,409.49789158088,437.68290117536,467.80756449982,489.55615570194,523.2511306012],"description":"Beating of 3/2 = twice 5/4 opposite. Almost 3/13-comma, 3/14 Pyth. comma"},"meaneb781":{"frequencies":[261.6255653006,273.88372205101,292.66195046404,312.72748571568,327.38015167213,349.82604176358,366.21672762941,391.32556326448,418.15568884829,437.74813244966,467.76108961433,489.67748280644,523.2511306012],"description":"Equal beating 3/2 = 8/5 same."},"meaneb891":{"frequencies":[261.6255653006,272.7426257605,292.31307409948,313.28760473417,326.59990179186,350.03483972175,364.90860969063,391.092135133,419.1546662649,436.96549358815,468.31936361194,488.21959184068,523.2511306012],"description":"Equal beating 8/5 = 5/3 same. Almost 5/18-comma"},"meaneight":{"frequencies":[261.6255653006,276.08926119362,293.33333347996,311.65444160511,328.88393162803,349.42547049952,368.74309237173,391.77416758435,413.43299207996,439.25532436715,466.69047534984,492.49097043477,523.2511306012],"description":"1/8 Pyth. comma meantone scale"},"meanfifth":{"frequencies":[261.6255653006,274.56546814423,292.86978442859,312.39456569414,327.84548435462,349.70179235499,366.99791252626,391.46460164194,410.82629477826,438.21464222188,467.42914467878,490.54793493862,523.2511306012],"description":"1/5-comma meantone scale (Verheijen)"},"meanfifth2":{"frequencies":[261.6255653006,279.06726965397,292.86986732103,312.39452419152,327.84547867349,349.70184487387,366.99801003998,391.46454285105,417.56218018201,438.2147004401,467.42901237995,490.54793493862,523.2511306012],"description":"1/5-comma meantone by John Holden (1770)"},"meanfifth_19":{"frequencies":[261.6255653006,274.56546814423,279.06726965397,292.86978442859,307.35519222791,312.39456569414,327.84548435462,344.06059968708,349.70179235499,366.99791252626,373.01539917593,391.46460164194,410.82629477826,417.56217294621,438.21464222188,459.88868900496,467.42914467878,490.54793493862,514.81033759999,523.2511306012],"description":"19 of 1/5-comma meantone scale"},"meanfifth_43":{"frequencies":[261.6255653006,265.91515911649,270.13633240739,274.56546814423,279.06726965397,283.49717461664,288.14537375445,292.86978442859,297.67175429757,302.39711110066,307.35519222791,312.39456569414,317.35355938713,322.556865357,327.84548435462,333.22081516619,338.51040756711,344.06059968708,349.70179235499,355.43547760922,361.07770857381,366.99791252626,373.01539917593,378.93660287884,385.14971481892,391.46460164194,397.88302689184,404.19904307077,410.82629477826,417.56217294621,424.19061149626,431.14564594215,438.21464222188,445.39957775044,452.46991103879,459.88868900496,467.42914467878,475.09307907327,482.63477102771,490.54793493862,498.59100550039,506.50570672499,514.81033759999,523.2511306012],"description":"Complete 1/5-comma meantone scale"},"meanfiftheb":{"frequencies":[261.6255653006,275.80023422757,293.11157312801,311.73372470712,328.53333183909,349.48325286892,368.3828117434,391.46459711956,412.7266004334,438.69360944226,466.62683936965,491.82624824197,523.2511306012],"description":"\"1/5-comma\" meantone with equal beating fifths"},"meangold":{"frequencies":[261.6255653006,272.97231199113,292.38331430233,313.17462880702,326.75706743029,349.99269211627,365.17193449866,391.13923210785,408.10300926149,437.12312635029,468.20685771475,488.51307131873,523.2511306012],"description":"Meantone scale with Blackwood's R = phi, and diat./chrom. ST = phi, ~4/15-comma"},"meanhalf":{"frequencies":[261.6255653006,267.49544939623,290.69507255622,315.90677595028,322.99452506247,351.00752840096,358.88280562497,390.00836666198,398.75867291663,433.34262909025,470.92601754108,481.49180950675,523.2511306012],"description":"1/2-comma meantone scale"},"meanhar2":{"frequencies":[261.6255653006,273.08769296879,292.41861893027,305.22982618403,326.83598255713,349.97156260351,365.30423365264,391.16284711627,408.30015740759,437.20230245522,456.35665612784,488.66055322307,523.2511306012],"description":"1/9-Harrison's comma meantone scale"},"meanhar3":{"frequencies":[261.6255653006,274.22153683641,292.76499331753,306.86017365004,327.61072570921,343.38355445704,366.60389537541,391.39444778107,410.23814647641,437.9793418028,459.06587176894,490.10890120058,523.2511306012],"description":"1/11-Harrison's comma meantone scale"},"meanharris":{"frequencies":[261.6255653006,273.71072489962,292.60907359238,306.12544311476,327.26186315247,349.85764856047,366.01847563765,391.29021017831,409.36491649663,437.62950220286,457.84473927605,489.45661357347,523.2511306012],"description":"1/10-Harrison's comma meantone scale"},"meanhsev":{"frequencies":[261.6255653006,265.69493617871,271.18768033644,275.4057836544,279.68949451567,284.03983498254,289.91182549392,294.4211659268,299.00064605783,305.1819244006,309.92877868547,314.74946639166,321.25632089757,326.25319922315,331.32779988873,336.4813337451,343.43745382287,348.77934146077,354.20431777528,361.52682728594,367.15008027699,372.86080050545,378.66034414493,386.48843610249,392.49994642563,398.60496085649,406.84537033315,413.17351844213,419.60009331305,426.12662827999,434.93599657884,441.70106893056,448.57136642871,457.84473927605,464.96613926104,472.19830582795,481.96011959425,489.45661357347,497.06970936204,504.80122352123,515.23704142273,523.2511306012],"description":"1/14-septimal schisma tempered meantone scale"},"meanhskl":{"frequencies":[261.6255653006,275.0605216927,293.02063313667,312.15345277639,328.18310911307,349.61186736411,367.56508220664,391.56529173291,411.67289207144,438.55312706018,467.18850946536,491.17950266504,523.2511306012],"description":"Half septimal kleisma meantone"},"meanlst357_19":{"frequencies":[261.6255653006,273.71260157103,279.68803244686,292.60971924044,306.12821574316,312.81131320311,327.26311833974,342.38279105966,349.85736361975,366.02068710341,374.01129952811,391.29052886394,409.36829077259,418.30522648629,437.63082426891,457.84952434322,467.84458559023,489.45917220726,512.07206464598,523.2511306012],"description":"19 of mean-tone scale, least square error in 3/2, 5/4 and 7/4"},"meanmalc":{"frequencies":[261.6255653006,279.16226462633,292.82999876562,312.45832383396,327.75622702832,349.72564885805,366.84815356577,391.43789792004,417.67588698136,438.12522309524,467.49265244264,490.38100841085,523.2511306012],"description":"Meantone approximation to Malcolm's Monochord, 3/16 Pyth. comma"},"meannkleis":{"frequencies":[261.6255653006,277.55670411237,293.77792781181,311.66693695111,329.88161264913,349.96913477239,370.42222384066,392.07096746411,415.94530241673,440.25439013544,467.06275302556,494.35929617392,523.2511306012],"description":"1/5 kleisma tempered meantone scale"},"meanpi":{"frequencies":[261.6255653006,275.38456311745,294.43027471344,309.91448590794,326.2128298123,348.77404705732,367.11600789597,392.50613131028,413.14795414706,434.87532652316,464.95175460796,489.40347900327,523.2511306012],"description":"Pi-based meantone with Harrison's major third by Erv Wilson"},"meanpi2":{"frequencies":[261.6255653006,287.5806999253,296.7710142931,326.2128298123,336.6377243117,370.0346037192,381.85992557156,394.06315326167,433.15704755212,446.99959483943,491.34516423327,507.04724898227,523.2511306012],"description":"Pi-based meantone by Erv Wilson analogous to 22-tET"},"meanpkleis":{"frequencies":[261.6255653006,274.33428876064,294.88060759996,309.2047285643,324.22465805628,348.50752497012,365.43662717622,392.80607455881,411.88702081614,442.73537947933,464.24169412807,486.7926967469,523.2511306012],"description":"1/5 kleisma positive temperament"},"meanquar":{"frequencies":[261.6255653006,273.37431312998,292.50627485027,312.977175335,327.03195662575,349.91912034749,365.63284274659,391.22147055517,408.78994578219,437.39890198442,468.01003810189,489.02683710225,523.2511306012],"description":"1/4-comma meantone scale. Pietro Aaron's temp. (1523). 6/5 beats twice 3/2"},"meanquar_14":{"frequencies":[261.6255653006,273.37431312998,292.50627485027,305.64177427204,312.977175335,327.03195662575,349.91912034749,365.63284274659,391.22147055517,408.78994578219,418.60090448096,437.39890198442,468.01003810189,489.02683710225,523.2511306012],"description":"1/4-comma meantone scale with split D#/Eb and G#/Ab, Otto Gibelius (1666)"},"meanquar_15":{"frequencies":[261.6255653006,273.37431312998,279.93529690293,292.50627485027,305.64177427204,312.977175335,327.03195662575,349.91912034749,365.63284274659,391.22147055517,408.78994578219,418.60090448096,437.39890198442,468.01003810189,489.02683710225,523.2511306012],"description":"1/4-comma meantone scale with split C#/Db, D#/Eb and G#/Ab"},"meanquar_16":{"frequencies":[261.6255653006,273.37431312998,279.93548123753,292.50629850443,305.64179898843,312.97722776199,327.03195662575,349.91920725962,365.63293356166,391.22137338448,408.78994578219,418.60090448096,437.39882871549,457.04097849371,468.01000025525,489.02679755603,523.2511306012],"description":"1/4-comma meantone scale with split C#/Db, D#/Eb, G#/Ab and A#/Bb"},"meanquar_17":{"frequencies":[261.6255653006,273.37431312998,279.93529690293,292.50627485027,305.64177250659,312.977175335,327.03195662575,349.91912034749,365.63284274659,374.40803131735,391.22147055517,408.78994578219,418.60090448096,437.39889945791,457.04105241293,468.01003810189,489.02683710225,523.2511306012],"description":"1/4-comma meantone scale with split C#/Db, D#/Eb, F#/Gb, G#/Ab and A#/Bb"},"meanquar_19":{"frequencies":[261.6255653006,273.37431312998,279.93529690293,292.50627485027,305.64177427204,312.977175335,327.03195662575,341.71789064962,349.91912034749,365.63284274659,374.40803131735,391.22147055517,408.78994578219,418.60090448096,437.39890198442,457.04105241293,468.01003810189,489.02683710225,510.98743222773,523.2511306012],"description":"19 of 1/4-comma meantone scale"},"meanquar_27":{"frequencies":[261.6255653006,273.37431312998,279.93529690293,285.65065877038,292.50627485027,299.52642572255,305.64177427204,312.977175335,327.03195662575,334.88072358477,341.71789064962,349.91912034749,365.63284274659,374.40803131735,382.05221698715,391.22147055517,400.61078621746,408.78994578219,418.60090448096,427.14736482575,437.39890198442,447.89647345742,457.04105241293,468.01003810189,489.02683710225,500.76348165392,510.98743222773,523.2511306012],"description":"27 of 1/4-comma meantone scale"},"meanquar_31":{"frequencies":[261.6255653006,267.90457886781,273.37431312998,279.93529690293,285.65065877038,292.50627485027,299.52642572255,305.64177427204,312.977175335,320.48862783822,327.03195662575,334.88072358477,341.71789064962,349.91912034749,358.31717956585,365.63284274659,374.40803131735,382.05221698715,391.22147055517,400.61078621746,408.78994578219,418.60090448096,427.14736482575,437.39890198442,447.89647345742,457.04105241293,468.01003810189,479.24227945773,489.02683710225,500.76348165392,510.98743222773,523.2511306012],"description":"31 of 1/4-comma meantone scale"},"meanquareb":{"frequencies":[261.6255653006,274.90575459855,292.80763523599,312.14798050979,327.88746490679,349.6453532581,367.3522744581,391.22144795733,411.14173398328,437.99455416256,467.00507093977,490.61429903129,523.2511306012],"description":"Variation on 1/4-comma meantone with equal beating fifths"},"meanquarm23":{"frequencies":[261.6255653006,273.51763645063,292.40504357126,313.95067836072,327.03195662575,348.83408706747,366.27579142084,392.4383479509,408.78994578219,436.04260883433,468.17206422213,489.12605686634,523.2511306012],"description":"1/4-comma meantone approximation with minimal order 23 beatings"},"meanquarr":{"frequencies":[261.6255653006,273.37036621967,292.50063201309,312.98169478553,327.03195662575,349.92419358955,365.62579001637,391.21579858034,408.78994578219,437.39258595147,468.01906681552,489.01974822542,523.2511306012],"description":"Rational approximation to 1/4-comma meantone, Kenneth Scholz, MTO 4.4, 1998"},"meansabat":{"frequencies":[261.6255653006,279.13726386405,294.25495796556,313.95067836072,330.95382015833,348.87783040382,372.229687597,392.38914286775,418.65339720992,441.32709511026,470.8669722571,496.36848628125,523.2511306012],"description":"1/9-schisma meantone scale of Eduard Sa'bat-Garibaldi"},"meansabat_53":{"frequencies":[261.6255653006,264.79625752493,268.00537599851,271.25338610366,275.79485124716,279.13726386405,282.52018221184,285.94410045135,290.73152483281,294.25495796556,297.82109228474,301.4304452945,305.08354077075,310.19140758515,313.95067836072,317.75550958044,321.60645175541,326.99095182327,330.95382015833,334.96471528237,339.02421924159,343.13292113612,348.87783040382,353.10595017045,357.38531136087,361.71653498009,367.77258074571,372.229687597,376.74081403286,381.30660995465,385.92774054592,392.38914286775,397.14458487807,401.95765903525,406.82906379475,413.640406907,418.65339720992,423.72714093867,428.86237189887,436.04260883433,441.32709511026,446.67562589029,452.08897683944,457.56793273834,465.22877230071,470.8669722571,476.57350267936,482.349191678,490.42492909292,496.36848628125,502.38407462043,508.4725670703,514.63484717027,523.2511306012],"description":"53-tone 1/9-schisma meantone scale"},"meanschis":{"frequencies":[261.6255653006,275.81646505128,294.24573392894,310.20599265769,327.03195662575,348.88329767713,367.80716871461,392.38299382393,413.66634097248,436.10412364188,465.24335632603,490.47874118496,523.2511306012],"description":"1/8-schisma temperament, Helmholtz"},"meanschis7":{"frequencies":[261.6255653006,275.84425785506,294.23387584933,310.2247482054,327.0846843223,348.89032888179,367.85164222246,392.37508610937,413.69968681881,436.18322603255,465.26210635182,490.54793493862,523.2511306012],"description":"1/7-schisma linear temperament"},"meanschis_17":{"frequencies":[261.6255653006,275.81646505128,290.77709705464,294.24573392894,310.20599265769,327.03195662575,330.93307160522,348.88329767713,367.80716871461,372.19468374184,392.38299382393,413.66634097248,436.10412364188,441.30634506723,465.24335632603,490.47874118496,496.32958936031,523.2511306012],"description":"17-tone 1/8-schisma linear temperament"},"meansept":{"frequencies":[261.6255653006,273.93523095528,292.67762672082,312.70235991264,327.41522444303,349.81667202162,366.27579142084,391.33604481052,409.74867679276,437.78330574787,467.73603562223,489.74334292241,523.2511306012],"description":"Meantone scale with septimal diminished fifth"},"meansept2":{"frequencies":[261.6255653006,273.61459551034,286.15296204753,292.57963558274,305.98714063953,320.00886175336,327.19620693615,342.18982383643,349.87514759905,365.9082279648,382.67602660872,391.27063976147,409.20043831214,427.95210889573,437.56358849756,457.61500463173,478.58500343311,489.333659422,511.75744671018,523.2511306012],"description":"Meantone scale with septimal neutral second"},"meansept3":{"frequencies":[261.6255653006,267.11515986718,271.23581508831,275.42019673559,281.19923906193,285.53716249988,289.94217244295,296.02592413073,300.59257160392,305.22982618403,309.9384746623,316.44180152381,321.32358037849,326.28048244956,333.12670774706,338.26588629419,343.48414905091,348.7829114007,356.10146388137,361.59490682213,367.17305499414,374.87731434423,380.66058361349,386.53284867747,394.643327573,400.73152907611,406.91341882127,413.19091223118,421.86074762795,428.36858751681,434.97682067587,444.1040384307,450.95501471222,457.91167766162,464.97592623609,474.73234784313,482.05581210758,489.49253462334,499.76337935275,507.47298512535,515.30182087389,523.2511306012],"description":"Pythagorean scale with septimal minor third"},"meansept4":{"frequencies":[261.6255653006,266.94086705872,271.13211808455,275.38917613856,280.98410555769,285.39585012732,289.87686370457,295.76613145071,300.40996929954,305.12672026341,309.91752915454,316.21395200486,321.17884203959,326.22168604472,332.8493514236,338.07543464185,343.38355445704,348.77505435772,355.86092403367,361.44831302863,367.12342987925,374.58207334188,380.46340397682,386.43730087372,394.28810581018,400.47907310734,406.76701374557,413.15368163355,421.54749623588,428.16623317002,434.88889120201,443.72428802318,450.69091522486,457.76754776364,464.95497741911,474.40121026751,481.84980583512,489.41535214975,499.35853288878,507.19898454493,515.16253949886,523.2511306012],"description":"Pythagorean scale with septimal narrow fourth"},"meansev":{"frequencies":[261.6255653006,275.93321340298,293.28595453555,311.72996498387,328.77769811601,349.45369437647,368.5644419122,391.74252566418,413.16594588103,439.14890519043,466.76586696593,492.29212632197,523.2511306012],"description":"1/7-comma meantone scale, Jean-Baptiste Romieu (1755)"},"meansev2":{"frequencies":[261.6255653006,273.98141462199,292.76593693997,312.83835055233,327.61283758281,350.07440004945,366.60744235102,391.74252566418,410.24343789088,438.37026184168,468.42550014967,490.54793493862,524.18054130269],"description":"Meantone scale with 1/7-comma stretched octave (stretched meansept)"},"meansev_19":{"frequencies":[261.6255653006,275.93321340298,278.07859353335,293.28589524255,309.32501829942,311.72996858511,328.77775508885,346.75764506664,349.4536277652,368.56443339655,371.42996022741,391.74260033637,413.16585280598,416.37814821359,439.14890011719,463.16493144882,466.76596133102,492.29202110912,496.11959049595,523.2511306012],"description":"19 of 1/7-comma meantone scale"},"meanseveb":{"frequencies":[261.6255653006,276.822915312,293.45907344559,311.2600957924,329.2717708679,349.29792128041,369.56105314287,391.74259807358,414.53862252605,439.49286138442,466.19439430972,493.21190508606,523.2511306012],"description":"\"1/7-comma\" meantone with equal beating fifths"},"meansixth":{"frequencies":[261.6255653006,275.36245350283,293.11247215425,312.00666699279,328.38886075091,349.55699144229,367.91095120397,391.62676241399,412.18948168074,438.75944753732,467.04212833931,491.56459996916,523.2511306012],"description":"1/6-comma meantone scale (tritonic temperament of Salinas)"},"meansixth_19":{"frequencies":[261.6255653006,275.36245350283,278.49009641114,293.11247215425,308.50278723002,312.00666699279,328.38886075091,345.6314161331,349.55699144229,367.91095120397,372.08969287196,391.62676241399,412.18948168074,416.87124381956,438.75944753732,461.79691129422,467.04212833931,491.56459996916,517.37477513058,523.2511306012],"description":"19 of 1/6-comma meantone scale"},"meansixtheb":{"frequencies":[261.6255653006,276.39673661379,293.31426069206,311.4574698476,328.96404447481,349.37515437283,369.07004939896,391.62674884124,413.78350416977,439.15979251365,466.37460465854,492.63446576705,523.2511306012],"description":"\"1/6-comma\" meantone with equal beating fifths"},"meansixthm":{"frequencies":[261.6255653006,275.36250599118,293.11251278827,312.00669222389,328.38895179964,349.55706816887,367.91095120397,391.62667645325,414.52369088643,438.75941205608,467.04206359353,491.56462836305,523.2511306012],"description":"modified 1/6-comma meantone scale, wolf spread over 2 fifths"},"meansixthm2":{"frequencies":[261.6255653006,276.14113065853,293.11251278827,310.24975557428,328.38895179964,349.55706816887,367.91095120397,391.62667645325,414.52380581681,438.75941205608,465.72523006308,491.56462836305,523.2511306012],"description":"modified 1/6-comma meantone scale, wolf spread over 4 fifths"},"meansixthpm":{"frequencies":[261.6255653006,275.00020270933,293.00227310437,309.72478954314,328.14198392915,348.83408706747,367.49599295996,391.5530240856,412.50030385781,438.51190905657,465.11211608996,491.10256480205,523.2511306012],"description":"modified 1/6P-comma temperament, French 18th century"},"meansixthso":{"frequencies":[261.6255653006,273.09145986506,292.50627485027,313.30134186202,327.03195662575,350.28154752005,365.63284274659,391.62667645325,408.78994578219,437.85193595173,468.98001879925,489.53334447372,524.3356019912],"description":"1/6-comma meantone scale with 1/6-comma stretched oct, Dave Keenan TL 13-12-99"},"meanstr":{"frequencies":[261.6255653006,272.52663052146,292.30447317753,313.51763757869,326.58087306932,350.28154752005,364.87661266094,391.35649333595,407.66301227525,437.24799400905,468.98001879925,488.52085380073,523.97386302914],"description":"Meantone with 1/9-comma stretched octave, Petr Parizek (2006)"},"meanten":{"frequencies":[261.6255653006,276.96346718799,293.59840699152,311.2324721493,329.47860040677,349.26769656434,369.74365294187,391.95114287501,414.92943551322,439.85086739936,466.26912673157,493.60433806962,523.2511306012],"description":"1/10-comma meantone scale"},"meanthird":{"frequencies":[261.6255653006,271.40047399919,291.9012907804,313.95067836072,325.68056936328,350.28154752005,363.36884069528,390.81668391305,405.4184580124,436.04260883433,468.98001879925,486.50215045777,523.2511306012],"description":"1/3-comma meantone scale (Salinas)"},"meanthird_19":{"frequencies":[261.6255653006,271.40047399919,281.38801176707,291.9012907804,302.80736724606,313.95067836072,325.68056936328,337.848714425,350.28154752005,363.36884069528,376.74081403286,390.81668391305,405.4184580124,420.33785775232,436.04260883433,452.33412516107,468.98001879925,486.50215045777,504.40543017669,523.2511306012],"description":"Complete 1/3-comma meantone scale"},"meanthirdeb":{"frequencies":[261.6255653006,273.41679662438,292.30169912182,312.83755546226,326.81234905863,349.91518709086,365.63683018302,390.81669745772,408.5035451685,436.83089868331,467.63468237516,488.59687355467,523.2511306012],"description":"\"1/3-comma\" meantone with equal beating fifths"},"meanvar1":{"frequencies":[261.6255653006,274.22463192287,292.50627485027,312.00669222389,327.03195662575,349.55706816887,366.3906401674,391.22147055517,410.48618883318,437.39890198442,467.04206359353,489.53334447372,523.2511306012],"description":"Variable meantone 1: C-G-D-A-E 1/4, others 1/6"},"meanvar2":{"frequencies":[261.6255653006,274.19219069011,292.50627485027,312.04360750473,327.03195662575,349.70184487387,366.23895640989,391.22147055517,410.65012590831,437.39890198442,467.23549927892,489.3306802979,523.2511306012],"description":"Variable meantone 2: C..E 1/4, 1/5-1/6-1/7-1/8 outward both directions"},"meanvar3":{"frequencies":[261.6255653006,275.36250599118,292.50627485027,310.71739423852,327.03195662575,349.55706816887,367.15000817177,391.22147055517,413.04376116614,437.39890198442,466.0760911248,489.53334447372,523.2511306012],"description":"Variable meantone 3: C..E 1/4, 1/6 next, then Pyth."},"meanvar4":{"frequencies":[261.6255653006,275.07759559501,292.50627485027,311.03921839762,327.03195662575,349.91912034749,366.77012764335,391.22147055517,412.61639318626,437.39890198442,466.55882736321,489.02683710225,523.2511306012],"description":"Variable meantone 4: naturals 1/4-comma, accidentals Pyth."},"mediant16":{"frequencies":[261.6255653006,313.95067836072,327.03195662575,336.37572681506,348.83408706747,359.73515228832,366.27579142084,373.75080757229,392.4383479509,411.12588832951,418.60090448096,425.14154361347,436.04260883433,448.50096908674,457.84473927605,470.92601754108,523.2511306012],"description":"Mediant doubling of octave done four times"},"mercadier":{"frequencies":[261.6255653006,276.24519242498,293.00227310437,310.42509491746,328.14198392915,349.22823143301,368.74309237173,391.5530240856,413.90012676351,438.51190905657,465.63764214343,492.21297564769,523.2511306012],"description":"Mercadier's well-temperament (1777), 1/12 and 1/6 Pyth. comma"},"mercadier2":{"frequencies":[261.6255653006,276.14388692511,292.95319623755,310.40895756597,328.03206784165,349.20805980193,368.45885450371,391.49761638186,413.86785247997,438.37641748302,465.57175090792,491.63473786767,523.2511306012],"description":"Mercadier de Belestas (1776)"},"mercator":{"frequencies":[261.6255653006,272.09448029963,279.3054110864,290.48161516351,306.08206748155,318.32990397837,326.76614606023,335.42596179815,348.84778913489,362.80689075348,372.42184279259,387.32403355801,408.12545368833,418.94141877379,435.70530841001,453.13974129598,465.14865565404,490.12996697565,509.74216322321,523.2511306012],"description":"19 out of 53-tET, see Mandelbaum p. 331"},"merrick":{"frequencies":[261.6255653006,278.62147458377,295.28844751169,312.94924079019,329.91874474504,349.29981986967,371.62722343835,394.01440557319,416.60121863153,438.96906929631,468.0242659544,493.6331420766,523.2511306012],"description":"A. Merrick's melodically tuned equal temperament (1811)"},"mersen_l1":{"frequencies":[261.6255653006,279.06726965397,290.69507255622,313.95067836072,327.03195662575,348.83408706747,372.08969287196,392.4383479509,418.60090448096,436.04260883433,470.92601754108,490.54793493862,523.2511306012],"description":"Mersenne lute 1"},"mersen_l2":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,313.95067836072,327.03195662575,348.83408706747,372.08969287196,392.4383479509,418.60090448096,436.04260883433,470.92601754108,490.54793493862,523.2511306012],"description":"Mersenne lute 2"},"mersen_s1":{"frequencies":[261.6255653006,279.06726965397,290.69507255622,313.95067836072,327.03195662575,348.83408706747,372.08969287196,392.4383479509,418.60090448096,436.04260883433,465.11211608996,490.54793493862,523.2511306012],"description":"Mersenne spinet 1"},"mersen_s2":{"frequencies":[261.6255653006,272.52663052146,294.32876096318,306.59245933664,327.03195662575,348.83408706747,363.36884069528,392.4383479509,408.78994578219,436.04260883433,465.11211608996,490.54793493862,523.2511306012],"description":"Mersenne spinet 2"},"mersenmt1":{"frequencies":[261.6255653006,273.37431312998,292.50627485027,311.03921839762,327.03195662575,349.91912034749,365.63284274659,391.22147055517,408.78994578219,437.39890198442,466.55882736321,489.02683710225,523.2511306012],"description":"Mersenne's Improved Meantone 1"},"mersenmt2":{"frequencies":[261.6255653006,273.37431312998,292.50627485027,309.11326130363,327.03195662575,349.91912034749,365.63284274659,391.22147055517,408.78994578219,437.39890198442,465.11211608996,489.02683710225,523.2511306012],"description":"Mersenne's Improved Meantone 2"},"mersenne":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,290.69507255622,294.32876096318,306.59245933664,310.07474405997,313.95067836072,322.99452506247,327.03195662575,340.65828815182,344.52749339997,348.83408706747,363.36884069528,367.91095120397,372.08969287196,376.74081403286,387.59343007496,392.4383479509,408.78994578219,413.43299207996,418.60090448096,430.65936674996,436.04260883433,454.2110508691,459.88868900496,465.11211608996,470.92601754108,484.4917875937,490.54793493862,510.98743222773,523.2511306012],"description":"31-note choice system of Mersenne, Harmonie universelle (1636)"},"meyer":{"frequencies":[261.6255653006,279.06726965397,290.69507255622,294.32876096318,299.00064605783,305.22982618403,313.95067836072,327.03195662575,348.83408706747,366.27579142084,373.75080757229,392.4383479509,418.60090448096,436.04260883433,448.50096908674,457.84473927605,465.11211608996,470.92601754108,490.54793493862,523.2511306012],"description":"Max Meyer, see Doty, David, 1/1 August 1992 (7:4) p.1 and 10-14"},"meyer_29":{"frequencies":[261.6255653006,268.26840191956,275.93321340298,286.15296204753,289.72987407313,294.32876096318,306.59245933664,321.92208230347,327.03195662575,331.11985608357,343.38355445704,344.91651675372,357.69120255941,367.91095120397,372.50983809402,383.2405741708,386.30649876417,392.4383479509,408.78994578219,413.89982010446,429.2294430713,441.49314144476,457.84473927605,459.88868900496,482.88312345521,490.54793493862,496.67978412536,510.98743222773,515.07533168556,523.2511306012],"description":"Max Meyer, see Doty, David, 1/1 August 1992 (7:4) p.1 and 10-14"},"mid_enh1":{"frequencies":[261.6255653006,269.10058145205,336.37572681506,348.83408706747,392.4383479509,403.65087217807,504.56359022259,523.2511306012],"description":"Mid-Mode1 Enharmonic, permutation of Archytas's with the 5/4 lying medially"},"mid_enh2":{"frequencies":[261.6255653006,271.31540105247,339.14425131559,348.83408706747,392.4383479509,406.97310157871,508.71637697339,523.2511306012],"description":"Permutation of Archytas' Enharmonic with the 5/4 medially and 28/27 first"},"miller19":{"frequencies":[261.6255653006,271.16557874802,283.07475767856,293.39690257971,304.09543631541,315.18408718336,326.67707691855,338.58915326012,350.93559605343,363.73224209988,376.99551198295,390.74241649248,407.9032302438,422.77716528297,438.1934715504,454.17192383337,470.73301771751,487.89800430439,505.68889852562,524.12852955557],"description":"TOP tempered nr. 64 [1202.9, 570.4479508], 7-limit {225/224, 1029/1000}"},"miller7":{"frequencies":[261.6255653006,274.70684356563,294.32876096318,313.95067836072,329.64821227876,353.19451315581,366.27579142084,392.4383479509,412.06026534844,439.53094970501,470.92601754108,494.47231841813,523.2511306012],"description":"Herman Miller, 7-limit JI. mode of parizek_ji1"},"miller_12":{"frequencies":[261.6255653006,273.36657578691,291.63627719304,313.29104303136,327.35065305942,349.22823143301,364.90060015836,391.99543598175,418.19337019276,436.9606979923,456.57025003029,487.08386390194,523.2511306012],"description":"Herman Miller, scale with appr. to three 7/4 and one 11/8. Tuning List 19-11-99"},"miller_12a":{"frequencies":[261.6255653006,273.46133384191,291.68681828778,313.23675853409,327.40738352015,349.22823143301,365.02708698668,391.99543598175,418.12090908234,437.03642407223,456.80766452229,487.25270356141,523.85596330884],"description":"Herman Miller, \"Starling\" scale, alternative version TL 25-11-99"},"miller_12r":{"frequencies":[261.6255653006,272.52663052146,290.69507255622,313.95067836072,327.03195662575,348.83408706747,363.36884069528,392.4383479509,418.60090448096,436.04260883433,454.2110508691,484.4917875937,523.2511306012],"description":"Herman Miller, \"Starling\" scale rational version"},"miller_ar1":{"frequencies":[261.6255653006,276.1828093671,293.13465239421,310.07474405997,327.9937953665,348.83408706747,368.24374600687,391.64146650178,414.27421384356,438.21489534465,465.11211608996,490.99166158792,523.2511306012],"description":"Herman Miller, \"Arrow I\" well-temperament"},"miller_ar2":{"frequencies":[261.6255653006,276.1828093671,293.13465239421,310.2849072826,328.2161033156,349.07052034394,368.24374600687,391.64146650178,414.27421384356,438.51190905657,465.42736069124,491.32444638706,523.2511306012],"description":"Herman Miller, \"Arrow II\" well-temperament"},"miller_b1":{"frequencies":[261.6255653006,276.37000081643,292.93610587951,310.49521248455,328.2161033156,348.83408706747,368.4933346061,391.64146650178,413.993616853,438.80912407872,465.11211608996,491.32444638706,523.2511306012],"description":"Herman Miller, \"Butterfly I\" well-temperament"},"miller_b2":{"frequencies":[261.6255653006,276.55731914056,293.13465239421,310.70566022736,328.2161033156,349.07052034394,368.74309237173,392.17254067411,414.27421384356,439.10654054756,465.42736069124,491.99069280383,523.2511306012],"description":"Herman Miller, \"Butterfly II\" well-temperament"},"miller_bug":{"frequencies":[261.6255653006,275.99574470663,292.73769384471,310.49521248455,327.54963108844,348.83408706747,368.4933346061,391.64146650178,413.993616853,437.62147130622,465.11211608996,491.32444638706,523.2511306012],"description":"Herman Miller, \"Bug I\" well-temperament"},"miller_dim":{"frequencies":[261.6255653006,272.37088095799,275.97178311718,291.10467300644,307.06737543415,311.12698372208,323.9053895548,328.18760802294,346.1837483498,365.1667076515,369.99442271164,385.1905938463,390.2830385166,411.68417663589,434.25884690128,440,458.07139483414,464.12736626882,489.57775198944,516.42371048788,523.2511306012],"description":"Diminished temperament, g=92.421, oct=1/4, 7-limit"},"miller_nikta":{"frequencies":[261.6255653006,272.78230567952,282.82337239762,292.30660227893,305.1368529352,315.1779191367,326.89249731477,341.39626079795,349.76381456689,364.82541608424,379.88701473,391.60159255926,407.77886614283,422.28262813098,436.22855406869,456.86852448015,469.69877536137,488.10739794888,508.74736733766,523.2511306012],"description":"Herman Miller, 19-tone scale of \"Nikta\". Tuning List 22-1-99"},"miller_sp":{"frequencies":[261.6255653006,276.74268633071,292.73329748773,304.15432597486,321.72882314722,340.31880135827,353.5963846,374.02771873076,395.63960626236,411.07553805605,434.82810464551,459.95313047266,477.89826295658,505.51194770063,525.23456349057],"description":"Herman Miller, Superpelog temperament, TOP tuning"},"minor_5":{"frequencies":[261.6255653006,299.00064605783,348.83408706747,418.60090448096,465.11211608996,523.2511306012],"description":"A minor pentatonic"},"minor_clus":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,313.95067836072,348.83408706747,353.19451315581,372.08969287196,392.4383479509,418.60090448096,441.49314144476,465.11211608996,470.92601754108,523.2511306012],"description":"Chalmers' Minor Mode Cluster, Genus [333335]"},"minor_wing":{"frequencies":[261.6255653006,294.32876096318,313.95067836072,327.03195662575,348.83408706747,376.74081403286,392.4383479509,418.60090448096,436.04260883433,470.92601754108,490.54793493862,502.32108537715,523.2511306012],"description":"Chalmers' Minor Wing with 7 minor and 6 major triads"},"minortone":{"frequencies":[261.6255653006,264.87670583656,269.18630372462,273.56601964703,276.96554054138,281.47182622933,286.05143175444,290.70554674078,294.31805527354,299.10666990622,303.97319627313,307.75057781118,312.75774231814,317.84637624619,323.01780144749,327.03184444407,332.35271908155,337.76016543181,341.95740725719,347.52112383796,353.17536321933,358.9216002989,363.3818066762,369.29410472703,375.30259493676,379.96636500161,386.14849505708,392.43120962619,398.81614754309,403.7721109712,410.34156772664,417.0179085097,422.20006196255,429.06934285921,436.05038835349,443.14501943782,448.65184388114,455.95150328441,463.36992699746,469.12808274602,476.76089208744,484.51788878959,492.4010934061,498.52001054206,506.63103252794,514.8740254656,523.2511306012],"description":"Minortone temperament, g=182.466089, 5-limit"},"miracle1":{"frequencies":[261.6255653006,266.71173418545,279.86396690685,285.30470202322,299.37379946195,305.19382000629,320.24370022528,326.46944327063,342.56848033562,349.22823143301,366.44956000397,373.57357677338,391.99543598175,399.61607881612,419.32216217931,427.47405410759,448.5538823653,457.27406033445,479.82340237272,489.15147723638,513.27277840175,523.2511306012],"description":"21 out of 72-tET Pyth. scale \"Miracle/Blackjack\", Keenan & Erlich, TL 2-5-2001"},"miracle1a":{"frequencies":[261.6255653006,266.57640943865,279.87817034289,285.17441410431,299.40418912991,305.0699313594,320.29246281951,326.35348199782,342.63803067389,349.1219037468,366.54256247747,373.47879032775,392.11482112276,399.53496279579,419.47115746916,427.40897376302,448.73603972606,457.22764679928,480.04261976898,489.12665346498,513.5333359992,523.2511306012],"description":"Version of Blackjack with just 11/8 intervals"},"miracle2":{"frequencies":[261.6255653006,266.71172956369,274.52699087907,279.86396690685,285.30469707927,293.66477470251,299.3738011912,305.19381471768,314.13668880034,320.24370207508,326.46943949911,336.03573785931,342.56848231438,349.22822739856,359.4614100947,366.44956423737,373.57357245769,380.83607584373,391.99544051026,399.61607650784,407.38486242506,419.32216702351,427.4740516384,435.78441397758,448.55389013814,457.27405769313,466.16375074742,479.82341068742,489.15147723638,498.66088722045,513.27278729609,523.2511306012],"description":"31 out of 72-tET Pythagorean scale \"Miracle/Canasta\", tempered Fokker-M, 36 7-limit tetrads"},"miracle24":{"frequencies":[261.6255653006,266.71173418545,274.52698453615,279.86396690685,285.30470202322,299.37379946195,305.19382000629,320.24370022528,326.46944327063,342.56848033562,349.22823143301,366.44956000397,373.57357677338,391.99543598175,399.61607881612,419.32216217931,427.47405410759,448.5538823653,457.27406033445,466.16376151809,479.82340237272,489.15147723638,498.66089874196,513.27277840175,523.2511306012],"description":"Miracle[24] in 72-tET tuning."},"miracle2a":{"frequencies":[261.6255653006,266.57640943865,274.68028654691,279.87817034289,285.17441410431,293.84366906071,299.40418912991,305.0699313594,314.34400674513,320.29246281951,326.35348199782,336.27457379784,342.63803067389,349.1219037468,359.73515228832,366.54256247747,373.47879032775,380.54627680087,392.11482112276,399.53496279579,407.09552105481,419.47115746916,427.40897376302,435.49700296564,448.73603972606,457.22764679928,465.87994655565,480.04261976898,489.12665346498,498.38259075187,513.5333359992,523.2511306012],"description":"Version of Canasta with just 11/8 intervals"},"miracle3":{"frequencies":[261.6255653006,266.71172956369,271.8967720342,274.52699087907,279.86396690685,285.30469707927,290.85119844166,293.66477470251,299.3738011912,305.19381471768,311.12697293924,314.13668880034,320.24370207508,326.46943949911,332.81620914398,336.03573785931,342.56848231438,349.22822739856,356.01744208336,359.4614100947,366.44956423737,373.57357245769,380.83607584373,384.52012922913,391.99544051026,399.61607650784,407.38486242506,411.32573797959,419.32216702351,427.4740516384,435.78441397758,440.00001524924,448.55389013814,457.27405769313,466.16375074742,470.67322937359,479.82341068742,489.15147723638,498.66088722045,503.48472993456,513.27278729609,523.2511306012],"description":"41 out of 72-tET Pythagorean scale \"Miracle/Studloco\", Erlich/Keenan 2001"},"miracle31s":{"frequencies":[261.6255653006,266.63636836248,274.61234258734,279.87187586531,285.23214274484,293.7643779857,299.39072204343,305.12482507342,314.2521161294,320.27085311289,326.40486440328,336.1687117034,342.60720791066,349.16901789451,359.61381619398,366.50134650551,373.52079096839,380.6746756467,392.06191220286,399.57090708206,407.22371854314,419.40512463865,427.43781242392,435.62434685833,448.6553095271,457.24821364991,466.00569400686,479.94546308962,489.13765420145,498.50589943595,513.41785698047,523.2511306012],"description":"Canasta with Secor's minimax generator of 116.7155941 cents (5:9 exact). XH5, 1976"},"miracle3a":{"frequencies":[261.6255653006,266.57640943865,271.6209387912,274.68028654691,279.87817034289,285.17441410431,290.57088243021,293.84366906071,299.40418912991,305.0699313594,310.84289043406,314.34400674513,320.29246281951,326.35348199782,332.52919812642,336.27457379784,342.63803067389,349.1219037468,355.72847573316,359.73515228832,366.54256247747,373.47879032775,380.54627680087,384.83248369581,392.11482112276,399.53496279579,407.09552105481,411.6807594913,419.47115746916,427.40897376302,435.49700296564,440.40213577526,448.73603972606,457.22764679928,465.87994655565,471.12729153307,480.04261976898,489.12665346498,498.38259075187,503.99602271809,513.5333359992,523.2511306012],"description":"Version of Studloco with just 11/8 intervals"},"miracle3ls":{"frequencies":[261.6255653006,266.8561524992,272.19132869617,274.36355553357,279.84880885615,285.44374339214,291.1505189834,293.47406686496,299.34138986722,305.32601617869,311.43030899178,313.91568307924,320.1916880693,326.59318586748,333.12264767748,335.78115718319,342.4943108472,349.34167821305,356.32594256772,359.16962765504,366.35037871957,373.67471357934,381.14545968569,384.18721873359,391.86813762951,399.70261841457,407.69373119716,410.94736065575,419.16328558448,427.54349328421,436.09121881038,439.57145109254,448.35967321435,457.32356924795,466.46667727785,470.18934850506,479.58967749961,489.177972196,498.95793401383,502.93987502638,512.99500332159,523.2511306012],"description":"Miracle-41 in a 7-limit least-squares tuning, Gene Ward Smith, 2001"},"miracle3p":{"frequencies":[261.6255653006,266.34679554672,270.06721067987,274.94077677072,279.90228841312,284.95333588433,290.09553330897,294.14767822015,299.45579274291,304.85969791727,310.36112062791,314.69634158508,320.37527393455,326.15668500873,332.04242788125,336.6805001021,342.75615313904,348.94144590806,355.2383548887,360.20043713509,366.70052302062,373.3179099666,380.0547104455,385.36343543368,392.31760641523,399.39727291251,406.60469732047,412.28427858225,419.7242587073,427.29849640545,435.00941939202,441.0857666732,449.04549132915,457.14885520764,465.39844769831,471.89927840742,480.41505607532,489.08450736089,497.91040254418,504.86537329764,513.97604599191,523.2511306012],"description":"Least squares Pythagorean approximation to partch_43"},"miracle41s":{"frequencies":[261.6255653006,266.63636836248,269.45164985995,274.61234258734,279.87187586531,285.23214274484,290.69507255622,293.7643779857,299.39072204343,305.12482507342,310.96875093738,314.2521161294,320.27085311289,326.40486440328,332.65635780028,336.1687117034,342.60720791066,349.16901789451,355.85650343121,359.61381619398,366.50134650551,373.52079096839,380.6746756467,384.69403121132,392.06191220286,399.57090708206,407.22371854314,411.52339231679,419.40512463865,427.43781242392,435.62434685833,440.22388881539,448.6553095271,457.24821364991,466.00569400686,470.92601754108,479.94546308962,489.13765420145,498.50589943595,503.76937659657,513.41785698047,523.2511306012],"description":"StudLoco with Secor's minimax generator of 116.7155941 cents (5:9 exact). XH5, 1976"},"miracle_12":{"frequencies":[261.6255653006,279.86396690685,299.37379946195,320.24370022528,336.03572815422,342.56848033562,359.46139971304,366.44956000397,384.52011812375,411.32572372413,440,470.6732130613,523.2511306012],"description":"A 12-tone subset of Blackjack with six 4-7-9-11 tetrads"},"miracle_12a":{"frequencies":[261.6255653006,279.86396690685,299.37379946195,320.24370022528,342.56848033562,366.44956000397,391.99543598175,419.32216217931,448.5538823653,479.82339960115,489.15147723638,513.27277840175,523.2511306012],"description":"A 12-tone chain of Miracle generators and subset of Blackjack"},"24erlich-keenan":{"frequencies":[261.6255653006,266.71173469898,279.86396636799,285.30470202322,290.8512090818,299.37380003836,305.19381941867,320.24370022528,326.46944389922,342.56847967604,349.22823143301,356.01745305102,366.44956070954,373.5735760541,391.99543598175,399.61607958554,407.38487340641,419.32216137194,427.47405410759,448.55388322895,457.27405945401,479.82340237272,489.15147817819,498.66089778183,523.2511306012],"description":"24 note mapping for Erlich/Keenan Miracle scale low version, tuned to 72-equal"},"miracle_8":{"frequencies":[261.6255653006,279.86396690685,314.13668154225,336.03572815422,366.44956000397,391.99543598175,419.32216217931,448.5538823653,523.2511306012],"description":"tet3a in 72-et"},"miring1":{"frequencies":[261.6255653006,285.29448470177,307.6953604706,387.15515639797,420.96788906714,523.2511306012],"description":"Gamelan Miring from Serdang wetan, Tangerang. 1/1=309.5 Hz"},"miring2":{"frequencies":[261.6255653006,279.34865171253,304.66723527068,384.42070010042,412.69311132744,523.2511306012],"description":"Gamelan Miring (Melog gender) from Serdang wetan"},"misca":{"frequencies":[261.6255653006,274.70684356563,289.16509849014,305.22982618403,348.83408706747,392.4383479509,412.06026534844,433.74764773521,457.84473927605,523.2511306012],"description":"21/20 x 20/19 x 19/18=7/6 7/6 x 8/7=4/3"},"miscb":{"frequencies":[261.6255653006,269.80136421624,278.50463402967,319.76457981184,348.83408706747,392.4383479509,404.70204632437,417.75695104451,479.64686971777,523.2511306012],"description":"33/32 x 32/31x 31/27=11/9 11/9 x 12/11=4/3"},"miscc":{"frequencies":[261.6255653006,276.00059636107,292.04714266113,310.07474405997,348.83408706747,392.4383479509,414.00089454161,438.0707139917,465.11211608996,523.2511306012],"description":"96/91 x 91/86 x 86/54=32/27. 32/27 x 9/8=4/3."},"miscd":{"frequencies":[261.6255653006,271.68808704293,282.55561052465,294.32876096318,348.83408706747,392.4383479509,407.5321305644,423.83341578697,441.49314144476,523.2511306012],"description":"27/26 x 26/25 x 25/24=9/8. 9/8 x 32/27=4/3."},"misce":{"frequencies":[261.6255653006,280.31310567921,301.87565226992,327.03195662575,348.83408706747,392.4383479509,420.46965851882,452.81347840488,490.54793493862,523.2511306012],"description":"15/14 x 14/13 x 13/12=5/4. 5/4 x 16/15= 4/3."},"miscf":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,348.83408706747,378.42269266694,392.4383479509,406.97310157871,418.60090448096,504.56359022259,523.2511306012],"description":"SupraEnh1"},"miscg":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,336.37572681506,348.83408706747,392.4383479509,406.97310157871,418.60090448096,504.56359022259,523.2511306012],"description":"SupraEnh 2"},"misch":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,336.37572681506,348.83408706747,392.4383479509,406.97310157871,490.54793493862,504.56359022259,523.2511306012],"description":"SupraEnh 3"},"misty":{"frequencies":[261.6255653006,268.57642185399,270.57706033988,272.59260010205,274.62315370363,276.66883458144,284.01936005382,286.13503371773,288.26646546986,290.41377434565,292.57708030445,300.35025535204,302.58757688062,304.84156607104,307.11234355974,309.40003795144,311.70477168653,319.9861304005,322.36972224007,324.77106769218,327.19030275625,329.62755691287,338.38508739928,340.90573394089,343.44515491415,346.00349213972,348.58088853904,357.84197030948,360.50755209334,363.19298782427,365.89842747751,368.62402219236,378.41760905933,381.23645754858,384.07630597582,386.93730633346,389.81962065329,392.72340320054,403.157261366,406.16039889903,409.18590458221,412.23394976407,415.30469757995,426.33849458487,429.51431022199,432.71378016074,435.93708308397,439.18439906139,450.85263092877,454.21105352848,457.59449053401,461.00313090234,464.43716505707,476.77631130474,480.3278378528,483.9058226648,487.51045723915,491.14194572312,494.80048247871,507.94632001299,511.73003620658,515.54193450341,519.38223078906,523.2511306012],"description":"Misty temperament, g=96.787939, p=400, 5-limit"},"mistyschism":{"frequencies":[261.6255653006,278.75251614148,294.32876096318,310.42486507835,330.74639366397,348.83408706747,372.08969287196,392.4383479509,418.12877421223,440.99519155196,465.63729761752,496.11959049595,523.2511306012],"description":"Mistyschism scale 32805/32768 and 67108864/66430125"},"mixed9_3":{"frequencies":[261.6255653006,273.20871865617,285.30470202322,311.12698372208,349.22823143301,391.99543598175,409.35055662695,427.47405410759,466.16376151809,523.2511306012],"description":"A mixture of the hemiolic chromatic and diatonic genera, 75 + 75 + 150 + 200 c"},"mixed9_4":{"frequencies":[261.6255653006,271.89678302796,282.57123920205,305.19382000629,349.22823143301,391.99543598175,407.38487419079,423.37848741825,457.27406033445,523.2511306012],"description":"Mixed enneatonic 4, each \"tetrachord\" contains 67 + 67 + 133 + 233 cents."},"mixed9_5":{"frequencies":[261.6255653006,277.18263097687,293.66476791741,329.62755691287,349.22823143301,391.99543598175,415.30469757995,440,493.88330125613,523.2511306012],"description":"A mixture of the intense chromatic genus and the permuted intense diatonic"},"mixed9_6":{"frequencies":[261.6255653006,277.18263097687,293.66476791741,311.12698372208,349.22823143301,391.99543598175,415.30469757995,440,466.16376151809,523.2511306012],"description":"Mixed 9-tonic 6, Mixture of Chromatic and Diatonic"},"mixed9_7":{"frequencies":[261.6255653006,277.18263097687,311.12698372208,329.62755691287,349.22823143301,391.99543598175,415.30469757995,466.16376151809,493.88330125613,523.2511306012],"description":"Mixed 9-tonic 7, Mixture of Chromatic and Diatonic"},"mixed9_8":{"frequencies":[261.6255653006,293.66476791741,311.12698372208,329.62755691287,349.22823143301,391.99543598175,440,466.16376151809,493.88330125613,523.2511306012],"description":"Mixed 9-tonic 8, Mixture of Chromatic and Diatonic"},"mixol_chrom":{"frequencies":[261.6255653006,274.08392555301,287.78812183066,302.93486508491,311.12229387098,319.76457981184,359.73515228832,411.12588832951,426.35277308246,434.39716502741,442.75095666255,479.64686971777,523.2511306012,548.16785110602,575.57624366132,605.86973016981,622.24458774197,639.52915962369,719.47030457665,822.25177665903,852.70554616492,868.79433005482,885.50191332511,959.29373943553,1046.5022612024],"description":"Mixolydian chromatic tonos"},"mixol_chrom2":{"frequencies":[261.6255653006,271.31540105247,281.75060878526,332.97799220076,366.27579142084,385.55346465352,406.97310157871,523.2511306012],"description":"Schlesinger's Mixolydian Harmonia in the chromatic genus"},"mixol_chrominv":{"frequencies":[261.6255653006,279.06726965397,299.00064605783,373.75080757229,411.12588832951,429.81342870813,448.50096908674,523.2511306012],"description":"A harmonic form of Schlesinger's Chromatic Mixolydian inverted"},"mixol_diat":{"frequencies":[261.6255653006,274.08392555301,287.78812183066,319.76457981184,338.57426097725,359.73515228832,383.71749577421,411.12588832951,442.75095666255,460.46099492906,479.64686971777,500.50108144463,523.2511306012,548.16785110602,575.57624366132,639.52915962369,677.14852195449,719.47030457665,767.43499154843,822.25177665903,885.50191332511,920.92198985811,959.29373943553,1001.00216288925,1046.5022612024],"description":"Mixolydian diatonic tonos"},"mixol_diat2":{"frequencies":[261.6255653006,281.75060878526,305.22982618403,332.97799220076,348.83408706747,366.27579142084,406.97310157871,457.84473927605,523.2511306012],"description":"Schlesinger's Mixolydian Harmonia, a subharmonic series though 13 from 28"},"mixol_diatcon":{"frequencies":[261.6255653006,281.75060878526,305.22982618403,332.97799220076,392.4383479509,406.97310157871,457.84473927605,523.2511306012],"description":"A Mixolydian Diatonic with its own trite synemmenon replacing paramese"},"mixol_diatinv":{"frequencies":[261.6255653006,299.00064605783,336.37572681506,348.83408706747,411.12588832951,448.50096908674,485.87604984397,523.2511306012],"description":"A Mixolydian Diatonic with its own trite synemmenon replacing paramese"},"mixol_diatinv2":{"frequencies":[261.6255653006,299.00064605783,336.37572681506,348.83408706747,373.75080757229,411.12588832951,448.50096908674,485.87604984397,523.2511306012],"description":"Inverted Schlesinger's Mixolydian Harmonia, a harmonic series from 14 from 28"},"mixol_enh":{"frequencies":[261.6255653006,274.08392555301,287.78812183066,295.1673044417,299.00064605783,302.93486508491,348.83408706747,411.12588832951,418.60090448096,422.44127975143,426.35277308246,469.85815809087,523.2511306012,548.16785110602,575.57624366132,590.33460888341,598.00129211566,605.86973016981,697.66817413493,822.25177665903,837.20180896192,844.88255950285,852.70554616492,939.71631618175,1046.5022612024],"description":"Mixolydian Enharmonic Tonos"},"mixol_enh2":{"frequencies":[261.6255653006,266.38239376061,271.31540105247,332.97799220076,366.27579142084,375.66747838035,385.55346465352,523.2511306012],"description":"Schlesinger's Mixolydian Harmonia in the enharmonic genus"},"mixol_enhinv":{"frequencies":[261.6255653006,270.34641747729,279.06726965397,373.75080757229,411.12588832951,420.46965851882,429.81342870813,523.2511306012],"description":"A harmonic form of Schlesinger's Mixolydian inverted"},"mixol_penta":{"frequencies":[261.6255653006,269.32043486826,281.75060878526,332.97799220076,366.27579142084,381.53728273004,406.97310157871,523.2511306012],"description":"Schlesinger's Mixolydian Harmonia in the pentachromatic genus"},"mixol_pis":{"frequencies":[261.6255653006,287.78812183066,319.76457981184,359.73515228832,411.12588832951,442.75095666255,479.64686971777,523.2511306012,548.16785110602,575.57624366132,639.52915962369,719.47030457665,822.25177665903,885.50191332511,959.29373943553,1046.5022612024],"description":"The Diatonic Perfect Immutable System in the Mixolydian Tonos"},"mixol_tri1":{"frequencies":[261.6255653006,268.0066766494,274.70684356563,332.97799220076,366.27579142084,378.90599112501,392.4383479509,523.2511306012],"description":"Schlesinger's Mixolydian Harmonia in the first trichromatic genus"},"mixol_tri2":{"frequencies":[261.6255653006,268.0066766494,281.75060878526,332.97799220076,366.27579142084,378.90599112501,406.97310157871,523.2511306012],"description":"Schlesinger's Mixolydian Harmonia in the second trichromatic genus"},"mmmgeo1":{"frequencies":[261.6255653006,291.52662303231,317.822348206,348.40303271111,392.9238840789,423.23948674937,463.96335069158,523.2511306012],"description":"Scale for MakeMicroMusic in Peppermint 24, maybe a bit like Georgian tunings"},"mmmgeo2":{"frequencies":[261.6255653006,295.05751399041,323.4477810403,352.62279726972,392.9238840789,430.73079539701,485.77193724523,529.58860866211],"description":"Scale for MakeMicroMusic in Peppermint 24, maybe a bit like Georgian tunings"},"mmmgeo3a":{"frequencies":[261.6255653006,281.81099471089,317.822348206,348.40303271111,392.9238840789,423.23948674937,463.96335069158,523.2511306012],"description":"Peppermint 24 scale for MakeMicroMusic, maybe a bit \"Georgian-like\"?"},"mmmgeo4a":{"frequencies":[261.6255653006,281.81099471089,317.822348206,348.40303271111,392.9238840789,423.23948674937,477.32335087626,523.2511306012],"description":"Peppermint 24 scale for MakeMicroMusic, maybe a bit \"Georgian-like\"?"},"mmmgeo4b":{"frequencies":[261.6255653006,295.05751399041,323.4477810403,348.40303271111,392.9238840789,430.73079539701,485.77193724523,523.2511306012],"description":"Peppermint 24 scale for MakeMicroMusic, maybe a bit \"Georgian-like\"?"},"mmswap":{"frequencies":[261.6255653006,251.16054268858,294.32876096318,282.55561052465,313.95067836072,348.83408706747,353.19451315581,392.4383479509,376.74081403286,418.60090448096,423.83341578697,470.92601754108,523.2511306012],"description":"Swapping major and minor in 5-limit JI"},"mokhalif":{"frequencies":[261.6255653006,293.66476791741,329.62755691287,349.22823143301,391.99543598175,425.01198472693,477.05982293263,523.2511306012],"description":"Iranian mode Mokhalif from C"},"montvallon":{"frequencies":[261.6255653006,275.93321340298,294.32876096318,313.95067836072,327.03195662575,348.83408706747,367.91095120397,392.4383479509,413.89982010446,436.04260883433,465.11211608996,490.54793493862,523.2511306012],"description":"Montvallon's Monochord, Nouveau sisteme de musique (1742)"},"monzismic":{"frequencies":[261.6255653006,265.20988799749,268.52946324281,272.20837072565,275.61554447717,279.39153269358,282.88861654172,286.76424730356,290.69297498385,294.33151655947,298.3639173457,302.09847446042,306.23728412706,310.07039048391,314.31841699833,318.25267316085,322.61279858837,327.03265671938,331.12605620426,335.66254762155,339.86396564906,344.52016812641,348.83245514045,353.61152766937,358.03760933268,362.94279426564,367.48567344471,372.52029869489,377.62390147213,382.35053879638,387.58881783384,392.44018387738,397.81669307529,402.79607923799,408.31446627855,413.42525081527,419.08925963743,424.33490995001,430.14838328955,436.04150237937,441.49934027584,447.54796975207,453.14983163098,459.35807517454,465.10776160818,471.47983118983,477.38124304179,483.92146177974,489.97860285142,496.69140794435,503.49617981289,509.7983334288,516.78267280423,523.2511306012],"description":"Monzismic temperament, g=249.018448, 5-limit"},"sevengroups":{"frequencies":[261.6255653006,261.6255653006,275.62199471997,265.19499215873,270.69536599394,266.7406479561],"description":"Here are some suggestions for a logical system encompassing intervals into seven broad groups: skhisma, kleisma, comma,"},"monzo-sym-11":{"frequencies":[261.6255653006,269.80136421624,276.76092858245,279.06726965397,285.40970760065,286.15296204753,287.78812183066,294.32876096318,299.00064605783,304.4370214407,305.22982618403,313.95067836072,314.76825825228,327.03195662575,332.97799220076,334.88072358477,341.71502406609,343.38355445704,348.83408706747,359.73515228832,366.27579142084,373.75080757229,380.54627680087,392.4383479509,398.6675280771,400.61414686654,408.78994578219,411.12588832951,418.60090448096,434.91003062957,436.04260883433,448.50096908674,449.66894036041,457.84473927605,465.11211608996,475.68284600109,478.40103369253,479.64686971777,490.54793493862,494.63583439645,507.3950357345,523.2511306012],"description":"Monzo symmetrical system: 11-limit"},"monzo-sym-5":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,313.95067836072,327.03195662575,334.88072358477,348.83408706747,392.4383479509,408.78994578219,418.60090448096,436.04260883433,465.11211608996,490.54793493862,523.2511306012],"description":"Monzo symmetrical system: 5-limit"},"monzo-sym-7":{"frequencies":[261.6255653006,279.06726965397,286.15296204753,294.32876096318,299.00064605783,305.22982618403,313.95067836072,327.03195662575,334.88072358477,341.71502406609,343.38355445704,348.83408706747,366.27579142084,373.75080757229,392.4383479509,398.6675280771,400.61414686654,408.78994578219,418.60090448096,436.04260883433,448.50096908674,457.84473927605,465.11211608996,478.40103369253,490.54793493862,523.2511306012],"description":"Monzo symmetrical system: 7-limit"},"monzo_sumerian_2place12":{"frequencies":[261.6255653006,277.17835052447,293.68632213351,311.15032543183,329.66469551353,349.22211163595,369.93402791915,391.94841243536,415.27867508032,439.91220695103,466.03267445926,493.6331420766,523.2511306012],"description":"Monzo - most accurate 2-place sexagesimal 12-tET approximation"},"monzo_sumerian_simp12":{"frequencies":[261.6255653006,277.34158865788,293.41184893525,310.84225580269,329.78012432849,348.83408706747,370.22485655745,392.4383479509,415.27867508032,440.11777340288,466.26338370404,493.6331420766,523.2511306012],"description":"Monzo - simplified 2-place sexagesimal 12-tET approximation"},"morgan":{"frequencies":[261.6255653006,277.18263097687,294.07958763262,310.86358783941,330.18637907377,349.03110370139,370.30791823326,392.32757291716,415.07027187895,440.74593809176,465.76911360306,494.58094207912,523.2511306012],"description":"Augustus de Morgan's temperament (1843)"},"mos11-34":{"frequencies":[261.6255653006,272.51337835337,301.75671459889,314.3146261019,348.04364484358,362.52783176564,377.61479489998,418.13653788176,435.53771116377,453.66305442345,502.34551296122,523.2511306012],"description":"Wilson 11 of 34-tET, G=9, Chain of minor & major thirds with Kleismatic fusion"},"mos12-17":{"frequencies":[261.6255653006,272.51337835337,283.85429714132,307.97166902637,320.78822215662,348.04364484358,362.52783176564,377.61479489998,409.69842558521,426.7484383229,463.0066556268,482.27514684959,523.2511306012],"description":"MOS 12 of 17, generator 7"},"mos12-22":{"frequencies":[261.6255653006,287.56082683758,296.76515515861,326.18384711731,336.62443200122,347.39920007397,381.83730669135,394.05926325844,433.12283887627,446.9863572706,491.29666030217,507.02222283506,523.2511306012],"description":"MOS 12 of 22, contains nearly just, recognizable diatonic, and pentatonic scales"},"mos13-22":{"frequencies":[261.6255653006,278.64197723942,296.76515515861,316.06708432391,326.18384711731,347.39920007397,369.99442271164,381.83730669135,406.67242132093,433.12283887627,446.9863572706,476.05883716226,507.02222283506,523.2511306012],"description":"MOS 13 of 22, contains 5 and 9 tone MOS as well. G=5 or 17"},"mos15-22":{"frequencies":[261.6255653006,278.64197723942,287.56082683758,306.26409645618,316.06708432391,336.62443200122,347.39920007397,369.99442271164,381.83730669135,406.67242132093,419.68930726506,446.9863572706,461.29362042034,491.29666030217,507.02222283506,523.2511306012],"description":"MOS 15 in 22, contains 7 and 8 tone MOS as well. G= 3 or 19"},"moscow":{"frequencies":[261.6255653006,277.4816141504,293.64820765919,311.48626315692,329.67368081467,349.7414907984,370.88289054572,392.4383479509,416.22242101754,440.4723112686,467.22939450183,494.51052097482,523.2511306012],"description":"Charles E. Moscow's equal beating piano tuning (1895)"},"mundeuc45":{"frequencies":[261.6255653006,267.57160087561,269.80136421624,271.31540105247,274.70684356563,280.31310567921,285.40970760065,287.78812183066,290.69507255622,294.32876096318,299.00064605783,305.22982618403,310.07474405997,313.95067836072,319.76457981184,327.03195662575,332.97799220076,336.37572681506,343.38355445704,348.83408706747,356.76213450082,359.73515228832,366.27579142084,373.75080757229,380.54627680087,383.71749577421,392.4383479509,398.6675280771,406.97310157871,411.12588832951,418.60090448096,428.11456140098,436.04260883433,441.49314144476,448.50096908674,457.84473927605,465.11211608996,470.92601754108,475.68284600109,479.64686971777,488.36772189445,499.46698830115,504.56359022259,507.3950357345,513.90736041189,523.2511306012],"description":"Euclidean reduced detempered Miracle[45] with Tenney tie-breaker"},"musaqa":{"frequencies":[261.6255653006,293.66476791741,320.24370022528,349.22823143301,391.99543598175,427.47405410759,466.16376151809,523.2511306012],"description":"Egyptian scale by Miha'il Musaqa"},"musaqa_24":{"frequencies":[261.6255653006,269.02051582234,276.67624041581,284.6011815168,292.80374147632,300.29158209195,310.07474405997,319.15917884888,328.55303549378,338.26335715633,348.29659232622,358.65845048745,369.35373924791,380.38618160659,391.75821216589,403.47075130695,415.52295665389,427.91195157543,440.63253103259,453.67684579974,467.03406698289,480.69003385373,494.62688932105,508.8227088795,523.2511306012],"description":"from d'Erlanger vol.5, p.34, after Mih.a'il Mu^saqah, 1899, a Lebanese scholar"},"myna23":{"frequencies":[261.6255653006,267.85369360167,274.23008563259,291.58574485564,298.52709031489,305.63367799752,312.90944157785,320.35840837329,327.98470157359,348.7424193045,357.04440817535,365.54403007102,374.24598974517,383.15510395049,392.27630410488,417.10295228105,427.03229805648,437.19801690717,447.60573581317,458.26121570764,469.17035466565,498.86352554567,510.73922293119,522.89762727195],"description":"23 notes of Myna temperament, 7-limit TOP tuning (Paul Erlich)"},"mystic-r":{"frequencies":[261.6255653006,367.91095120397,465.11211608996,654.0639132515,872.08521766867,1177.3150438527],"description":"Skriabin's mystic chord, op. 60 rationalised"},"mystic":{"frequencies":[261.6255653006,369.99442271164,466.16376151809,659.25511382574,880,1174.65907166964],"description":"Skriabin's mystic chord, op. 60"},"urmawi":{"frequencies":[261.6255653006,294.32876096318,326.6631048533,348.83408706747,392.4383479509,441.49314144476,471.45776383774,523.2511306012],"description":"al-Urmawi, one of twelve maqam rows. First tetrachord is Rast"},"valentine":{"frequencies":[261.6255653006,276.16031892841,294.32876096318,310.68035879446,330.47439827444,348.83408706747,371.78369805875,392.4383479509,414.24047839262,440.63253103259,466.02053819169,495.71159741166,523.2511306012],"description":"Robert Valentine, tuning with primes 3 & 19, TL 7-2-2002"},"valentine2":{"frequencies":[261.6255653006,286.10322937235,312.87102146627,349.87955533643,382.6142546815,418.41160951721,467.90420651233,511.68128147674,559.55413558945,625.74204293254,684.28641150324,748.30818586768,782.53142116911,855.74498969389,935.80841302466,1046.5022612024],"description":"Robert Valentine, two octave 31-tET subset for guitar, TL 10-5-2002"},"vallotti":{"frequencies":[261.6255653006,276.24519242498,293.00227310437,310.77584116741,328.14198392915,349.6228209638,368.32692341742,391.5530240856,414.36778843034,438.51190905657,466.16376151809,491.10256480205,523.2511306012],"description":"Vallotti & Young scale (Vallotti version)"},"vavoom":{"frequencies":[164.81377845643,165.83014536684,167.75567809608,168.79018601865,170.75008918846,172.7327497266,173.79795102719,175.81600173949,176.90021569146,178.95428827501,180.05785630665,182.14859375797,184.26360775673,185.39991601304,187.55268266167,188.70927492235,190.90046811205,192.07770535997,194.30800987601,196.56421264146,197.77637683895,200.07285246365,201.3066535986,203.64411977036,206.00872855044,207.27913480479,209.68595147418,210.9790342774,213.42881100738,214.74497512464,217.23848121866,219.76094059848,221.11615343515,223.68363702025,225.06304018178,227.6763542391,229.0803795269,231.74034082302,234.43118684139,235.87686755635,238.61574610914,240.08723199411,242.87499909192,244.37274935352,247.21027763268,250.08075380295,251.62294163139,254.54465534315,256.1143694988,259.0882353168,260.68597011615,263.71291896434,266.77501515601,268.42015092639,271.53690502834,273.21140777811,276.38379544331,278.08818779989,281.31720045362,284.58370833477,286.33866758091,289.66348210637,291.44976709494,294.83392732599,296.65209720599,300.09666587055,303.58123106099,305.45334345815,309.00010579622,310.90563508986,314.51570836542,316.45525105281,320.12976356015,323.84694071013,325.84402686189,329.62755691286],"description":"Vavoom temperament, g=111.875426, 5-limit"},"veroli":{"frequencies":[261.6255653006,276.87699530057,293.57148765354,310.97965314221,329.42008585855,349.28270065725,369.64409253099,391.93430587921,414.97617910427,439.79164309579,466.09106516521,493.49262474744,523.2511306012],"description":"Claudio di Veroli's well temperament (1978)"},"vertex_chrom":{"frequencies":[261.6255653006,271.89678302796,317.17549194805,349.22823143301,391.99543598175,407.38487419079,448.5538823653,523.2511306012],"description":"A vertex tetrachord from Chapter 5, 66.7 + 266.7 + 166.7 cents"},"vertex_chrom2":{"frequencies":[261.6255653006,274.52698453615,323.3415889232,349.22823143301,391.99543598175,411.32572372413,484.46499093218,523.2511306012],"description":"A vertex tetrachord from Chapter 5, 83.3 + 283.3 + 133.3 cents"},"vertex_chrom3":{"frequencies":[261.6255653006,275.18850165466,324.90175210669,349.22823143301,391.99543598175,412.31687950427,486.80259447109,523.2511306012],"description":"A vertex tetrachord from Chapter 5, 87.5 + 287.5 + 125 cents"},"vertex_chrom4":{"frequencies":[261.6255653006,275.40936140075,325.42347822215,349.22823143301,391.99543598175,412.64779522483,487.58430040208,523.2511306012],"description":"A vertex tetrachord from Chapter 5, 88.9 + 288.9 + 122.2 cents"},"vertex_chrom5":{"frequencies":[261.6255653006,282.57123920205,329.62755691287,349.22823143301,391.99543598175,423.37848741825,493.88330125613,523.2511306012],"description":"A vertex tetrachord from Chapter 5, 133.3 + 266.7 + 100 cents"},"vertex_diat":{"frequencies":[261.6255653006,299.37379946195,323.3415889232,349.22823143301,391.99543598175,448.5538823653,484.46499932732,523.2511306012],"description":"A vertex tetrachord from Chapter 5, 233.3 + 133.3 + 133.3 cents"},"vertex_diat10":{"frequencies":[261.6255653006,295.79278388132,324.90175210669,349.22823143301,391.99543598175,443.18842137843,486.80259447109,523.2511306012],"description":"A vertex tetrachord from Chapter 5, 212.5 + 162.5 + 125 cents"},"vertex_diat11":{"frequencies":[261.6255653006,295.79278388132,306.66641795878,349.22823143301,391.99543598175,443.18842137843,459.48046426806,523.2511306012],"description":"A vertex tetrachord from Chapter 5, 212.5 + 62.5 + 225 cents"},"vertex_diat12":{"frequencies":[261.6255653006,293.66476791741,315.65242990842,349.22823143301,391.99543598175,440,472.94426956511,523.2511306012],"description":"A vertex tetrachord from Chapter 5, 200 + 125 + 175 cents"},"vertex_diat2":{"frequencies":[261.6255653006,299.37379946195,329.62755691287,349.22823143301,391.99543598175,448.5538823653,493.88330125613,523.2511306012],"description":"A vertex tetrachord from Chapter 5, 233.3 + 166.7 + 100 cents"},"vertex_diat3":{"frequencies":[261.6255653006,273.20871865617,311.12698372208,349.22823143301,391.99543598175,409.35055662695,466.16376151809,523.2511306012],"description":"A vertex tetrachord from Chapter 5, 75 + 225 + 200 cents"},"vertex_diat4":{"frequencies":[261.6255653006,297.93622032612,329.62755691287,349.22823143301,391.99543598175,446.39994737251,493.88330125613,523.2511306012],"description":"A vertex tetrachord from Chapter 5, 225 + 175 + 100 cents"},"vertex_diat5":{"frequencies":[261.6255653006,275.18850165466,315.65242990842,349.22823143301,391.99543598175,412.31687950427,472.94426956511,523.2511306012],"description":"A vertex tetrachord from Chapter 5, 87.5 + 237.5 + 175 cents"},"vertex_diat7":{"frequencies":[261.6255653006,293.66476791741,306.66641795878,349.22823143301,391.99543598175,440,459.48046426806,523.2511306012],"description":"A vertex tetrachord from Chapter 5, 200 + 75 + 225 cents"},"vertex_diat8":{"frequencies":[261.6255653006,277.18263097687,306.66641795878,349.22823143301,391.99543598175,415.30469757995,459.48046426806,523.2511306012],"description":"A vertex tetrachord from Chapter 5, 100 + 175 + 225 cents"},"vertex_diat9":{"frequencies":[261.6255653006,295.79278388132,320.24370022528,349.22823143301,391.99543598175,443.18842137843,479.82340237272,523.2511306012],"description":"A vertex tetrachord from Chapter 5, 212.5 + 137.5 + 150 cents"},"vertex_sdiat":{"frequencies":[261.6255653006,275.18850165466,306.66641795878,349.22823143301,391.99543598175,412.31687950427,459.48046426806,523.2511306012],"description":"A vertex tetrachord from Chapter 5, 87.5 + 187.5 + 225 cents"},"vertex_sdiat2":{"frequencies":[261.6255653006,273.20871865617,302.26980244078,349.22823143301,391.99543598175,409.35055662695,452.89298412314,523.2511306012],"description":"A vertex tetrachord from Chapter 5, 75 + 175 + 250 cents"},"vertex_sdiat3":{"frequencies":[261.6255653006,265.43099677612,302.26980244078,349.22823143301,391.99543598175,397.69714089209,452.89298412314,523.2511306012],"description":"A vertex tetrachord from Chapter 5, 25 + 225 + 250 cents"},"vertex_sdiat4":{"frequencies":[261.6255653006,271.8968348557,302.26980244078,349.22823143301,391.99543598175,407.38495184466,452.89298412314,523.2511306012],"description":"A vertex tetrachord from Chapter 5, 66.7 + 183.3 + 250 cents"},"vertex_sdiat5":{"frequencies":[261.6255653006,299.37374239667,302.26980244078,349.22823143301,391.99543598175,448.55379686399,452.89298412314,523.2511306012],"description":"A vertex tetrachord from Chapter 5, 233.33 + 16.67 + 250 cents"},"vicentino1":{"frequencies":[261.6255653006,267.54129532085,273.59078691818,279.77706779472,286.10322937235,292.57243455474,295.8616864168,299.18791603519,305.95298478736,312.87102146627,319.94548489658,327.17991022208,330.85823737058,334.57791819083,342.14320575162,349.87955533643,357.79083283678,365.88099775759,374.15409293384,382.6142546815,391.26571058456,395.66452371628,400.11279059885,409.15991580663,418.41160951721,427.87249484695,437.54730686196,442.46644183113,447.44088028055,457.55816161244,467.90420651233,478.48419305869,489.30340830564,494.80441235385,500.36726155789,511.68128147674,523.2511306012],"description":"Usual Archicembalo tuning, 31-tET plus D,E,G,A,B a 10th tone higher"},"vicentino2":{"frequencies":[261.6255653006,262.40966637115,273.59078691818,274.41074818102,279.77706779472,280.61556956011,292.57243455474,293.44928279173,305.95298478736,306.86993670158,312.87102146627,313.80870698104,327.17991022208,328.16047998243,342.14320575162,343.16862103779,349.87955533643,350.92815470883,365.88099775759,366.97755604579,374.15409293384,391.26571058456,392.4383479509,409.15991580663,410.38618254261,418.41160951721,419.66560148231,437.54730686196,438.85865161274,457.55816161244,458.92947695163,467.90420651233,469.30653196482,489.30340830564,490.7698679226,511.68128147674,523.2511306012],"description":"Alternative Archicembalo tuning, lower 3 rows the same upper 3 rows 3/2 higher"},"vicentino2q217":{"frequencies":[261.6255653006,262.46259217279,273.59078691818,274.46609608433,279.77706779472,280.67216895906,292.57243455474,293.50847071582,305.95298478736,306.93183153514,312.87102146627,313.87199953275,327.17991022208,328.2266690608,342.14320575162,343.23783523487,349.87955533643,350.99893596542,365.88099775759,367.05157442308,374.15409293384,391.26571058456,392.51750150462,409.15991580663,410.46895395112,418.41160951721,419.7502468954,437.54730686196,438.9471656765,457.55816161244,459.02204178186,467.90420651233,469.40118981889,489.30340830564,490.86885203792,511.68128147674,523.2511306012],"description":"Vicentino's second tuning, 217-tET version"},"vicentino36":{"frequencies":[261.6255653006,262.43934012943,273.37431312998,274.22463192287,279.93529690293,280.80602334765,292.50627485027,293.41610276971,305.64177427204,306.59245933664,312.97717714283,313.95067836072,327.03195662575,328.04917632434,341.71789064962,349.91912034749,351.00752840096,365.63284274659,366.77012764335,374.40803131735,375.5726110527,391.22147055517,392.4383479509,408.78994578219,410.06146948999,418.60090448096,419.90294514449,437.39889945791,438.75941205608,457.04105505291,458.46266117889,468.01003810189,469.46576276783,489.02683710225,490.54793493862,510.98743222773,523.2511306012],"description":"Vicentino's second tuning of 1555"},"victor_eb":{"frequencies":[261.6255653006,276.45300885359,293.16631378471,311.00963644582,328.52867116285,348.83408706747,368.60401198904,391.83966133014,414.6795130731,439.03603741286,465.77732204887,492.79300649794,523.2511306012],"description":"Equal beating Victorian piano temperament, interpr. by Bill Bremmer (improved)"},"victorian":{"frequencies":[261.6255653006,276.5429423948,293.32570896007,310.76776326996,328.29744538229,349.22823143301,368.92737853004,391.99543598175,414.58565256441,438.73106346722,465.89457252293,492.17459484008,523.2511306012],"description":"Form of Victorian temperament (1885)"},"vitale1":{"frequencies":[261.6255653006,280.31310567921,294.32876096318,305.22982618403,327.03195662575,336.37572681506,343.38355445704,348.83408706747,373.75080757229,392.4383479509,420.46965851882,441.49314144476,457.84473927605,490.54793493862,504.56359022259,515.07533168556,523.2511306012],"description":"Rami Vitale's 7-limit just scale"},"vitale2":{"frequencies":[261.6255653006,274.70684356563,294.32876096318,299.00064605783,305.22982618403,313.95067836072,336.37572681506,348.83408706747,366.27579142084,392.4383479509,412.06026534844,441.49314144476,448.50096908674,457.84473927605,470.92601754108,504.56359022259,523.2511306012],"description":"Rami Vitale, inverse mode of vitale1"},"vitale3":{"frequencies":[261.6255653006,274.70684356563,280.31310567921,294.32876096318,299.00064605783,305.22982618403,313.95067836072,327.03195662575,336.37572681506,343.38355445704,348.83408706747,366.27579142084,373.75080757229,392.4383479509,412.06026534844,420.46965851882,441.49314144476,448.50096908674,457.84473927605,470.92601754108,490.54793493862,504.56359022259,515.07533168556,523.2511306012],"description":"Superset of several Byzantine scales by Rami Vitale, TL 29-Aug-2001"},"vogel_21":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,294.32876096318,305.22982618403,310.07474405997,313.95067836072,321.55899383997,330.74639366397,348.83408706747,361.75386806997,372.08969287196,392.4383479509,406.97310157871,413.43299207996,418.60090448096,428.74532511996,440.99519155196,465.11211608996,482.33849075995,496.11959049595,523.2511306012],"description":"Martin Vogel's 21-tone Archytas system, see Divisions of the tetrachord"},"vogelh_b":{"frequencies":[261.6255653006,276.37000081643,292.73769384471,310.07474405997,327.54963108844,349.78078158391,367.49599295996,391.37619916626,413.43299207996,437.91808280662,465.11211608996,489.99465727995,523.2511306012],"description":"Harald Vogel's temperament, van Eeken organ in Bunschoten, Immanuelkerk, 1992"},"vogelh_fisk":{"frequencies":[261.6255653006,274.01856817608,292.73769384471,312.85332572834,327.54963108844,349.78078158391,366.49445363528,391.37619916626,409.75340805561,437.91808280662,467.82492621575,489.99465727995,523.2511306012],"description":"Modified meantone tuning of Fisk organ in Memorial Church at Stanford"},"vogelh_hb":{"frequencies":[261.6255653006,276.50527247638,293.79744652436,312.85332572834,329.92547760025,349.78078158391,369.82037393809,392.08397832814,413.47189899094,440.29822362186,467.82492621575,494.44133512215,523.2511306012],"description":"Harald Vogel hybrid meantone (1984)"},"vogelh_jakobi":{"frequencies":[261.6255653006,275.2485073924,292.86986732103,310.4251397446,327.84547867349,349.70184487387,366.99801003998,391.46454285105,412.87276088221,438.2147004401,466.26912673157,490.54793493862,523.2511306012],"description":"Harald Vogel's temperament for the Schnitger organ in St. Jakobi, Hamburg"},"volans":{"frequencies":[261.6255653006,288.78654445823,322.09885310804,352.06379107796,388.6137256405,429.95038611107,482.60299106564,523.2511306012],"description":"African scale according to Kevin Volans 1/1=G"},"vong":{"frequencies":[261.6255653006,287.78812183066,324.77656382143,353.19451315581,392.4383479509,431.68218274599,476.53227965466,523.2511306012],"description":"Vong Co Dan Tranh scale, Vietnam"},"vries19-72":{"frequencies":[261.6255653006,271.89678302796,282.57123920205,293.66476791741,305.19382000629,314.13668154225,326.46944327063,339.28638158975,352.60650301302,366.44956000397,377.18735172911,391.99543598175,407.38487419079,423.37848741825,452.89298412314,470.6732130613,489.15147723638,508.3551866238,523.2511306012],"description":"Leo de Vries 19/72 Through-Transposing-Tonality 18 tone scale"},"vries35-72":{"frequencies":[261.6255653006,320.24370022528,326.46944327063,332.81622067851,339.28638158975,345.88232658126,352.60650301302,359.46139971304,366.44956000397,448.5538823653,457.27406033445,466.16376151809,475.22628419761,484.46499093218,493.88330125613,503.48470957687,513.27277840175,523.2511306012],"description":"Leo de Vries 35/72 Through-Transposing-Tonality 17 tone scale"},"vries5-72":{"frequencies":[261.6255653006,269.29177952703,274.52698453615,282.57123920205,288.06460709314,296.5055443788,302.26980244078,317.17549194805,332.81622067851,349.22823143301,366.44956000397,384.52011812375,403.48177901006,423.37848741825,444.25635547592,466.16376151809,489.15147723638,513.27277840175,523.2511306012],"description":"Leo de Vries 5/72 Through-Transposing-Tonality 18 tone scale"},"vries6-31":{"frequencies":[261.6255653006,292.57243455474,299.18791603519,334.57791819083,342.14320575162,382.6142546815,391.26571058456,437.54730686196,447.44088028055,500.36726155789,511.68128147674,523.2511306012],"description":"Leo de Vries 6/31 TTT used in \"For 31-tone organ\" (1995)"},"vulture":{"frequencies":[261.6255653006,265.58852967049,269.02996542365,272.51599294435,276.04719319079,279.62414831161,283.24745441839,286.9177088442,290.63552324927,294.40151054717,298.21629835234,302.73351960911,306.6562716924,310.62985211059,314.65492307423,318.73214815075,322.86220682342,327.0457799678,331.28356479042,335.57625992643,339.9245807679,344.32924417279,349.54496173019,354.07428378691,358.66229781376,363.30976018416,368.01744541334,372.78612960355,377.61660747204,382.50967536449,387.46614872711,392.486844677,398.43202813578,403.59481739244,408.82450722915,414.12195980508,419.48805795853,424.92368633675,430.42975080549,436.00715908665,441.65684067409,447.37972696622,453.17677170128,460.0412514682,466.0023613576,472.04071122634,478.15730738573,484.35315820906,490.6292962557,496.98675620078,503.42659462849,509.94988192555,516.55769649554,523.2511306012],"description":"Vulture temperament, g=475.542233, 5-limit"},"walker_21":{"frequencies":[261.6255653006,279.06726965397,290.69507255622,294.32876096318,299.00064605783,305.22982618403,310.07474405997,313.95067836072,327.03195662575,336.37572681506,348.83408706747,392.4383479509,406.97310157871,418.60090448096,436.04260883433,441.49314144476,448.50096908674,457.84473927605,465.11211608996,470.92601754108,490.54793493862,523.2511306012],"description":"Douglas Walker, 1977, for \"out of the fathomless dark/into the limitless light"},"walkerr_11":{"frequencies":[261.6255653006,291.47537246454,299.00064605783,333.11471138804,341.71502406609,380.70252730062,390.53145607553,435.08860262928,484.72943438718,497.2441172906,510.08190181294,523.2511306012],"description":"Robert Walker, \"Seven to Pi\" scale, TL 09-07-2002"},"wauchope":{"frequencies":[261.6255653006,274.70684356563,305.22982618403,327.03195662575,366.27579142084,392.4383479509,436.04260883433,457.84473927605,523.2511306012],"description":"Symmetrical 7-limit JI whole-half step scale, Ken Wauchope"},"wendell1":{"frequencies":[261.6255653006,276.25045813601,293.35468319005,310.78176509232,328.42642049784,348.83408706747,369.47972269069,391.8804287311,414.37568699689,438.92294511207,466.17264740545,492.63963050051,523.2511306012],"description":"Robert Wendell's Natural Synchronous well-temperament (2003)"},"wendell1r":{"frequencies":[261.6255653006,276.25560153172,293.36810129327,310.78755172318,328.43721515437,348.83408706747,369.49186704867,391.89926583958,414.38340229758,438.93945576706,466.18132758477,492.65582273156,523.2511306012],"description":"Rational version of wendell1 by Gene Ward Smith"},"wendell2":{"frequencies":[261.6255653006,276.37223575148,293.46077701205,310.91876490958,328.50868755512,348.91469434159,369.57235851938,392.00856887742,414.55835341999,438.92345217603,466.37814713124,492.76314493882,523.2511306012],"description":"Robert Wendell's Very Mild Synchronous well-temperament (2003)"},"werck1":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,290.69507255622,294.32876096318,306.59245933664,313.95067836072,327.03195662575,348.83408706747,363.36884069528,367.91095120397,392.4383479509,408.78994578219,418.60090448096,436.04260883433,441.49314144476,459.88868900496,465.11211608996,470.92601754108,490.54793493862,523.2511306012],"description":"Werckmeister I (just intonation)"},"werck3":{"frequencies":[261.6255653006,275.62199471997,292.34127285051,310.07474405997,327.77163799145,348.83408706747,367.49599295996,391.11111150212,413.43299207996,437.02884834934,465.11211608996,491.65745674141,523.2511306012],"description":"Andreas Werckmeister's temperament III (the most famous one, 1681)"},"werck3_eb":{"frequencies":[261.6255653006,275.62199471997,292.52927773082,310.07474405997,328.06371231954,348.83408706747,367.49599295996,391.41011079897,413.43299207996,437.41828331138,465.11211608996,492.10978071589,523.2511306012],"description":"Werckmeister III equal beating version, 5/4 beats twice 3/2"},"werck3_mod":{"frequencies":[261.6255653006,275.62199471997,292.34127285051,310.07474405997,327.77163799145,348.83408706747,367.49599295996,391.11111150212,413.43299207996,437.02884834934,465.11211608996,490.82535372381,523.2511306012],"description":"Modified Werckmeister III with B between E and F#, Nijsse (1997), organ Soest"},"werck4":{"frequencies":[261.6255653006,274.37997440822,293.00227310437,310.07474405997,328.14198392915,348.83408706747,367.49599295996,390.66969766777,411.5699614066,437.52264545758,467.21778431035,489.99465727995,523.2511306012],"description":"Andreas Werckmeister's temperament IV"},"werck5":{"frequencies":[261.6255653006,276.55731914056,294.32876096318,311.12698372208,328.88393162803,350.01785633742,369.99442271164,392.4383479509,413.43299207996,440,466.69047534984,493.32589719545,523.2511306012],"description":"Andreas Werckmeister's temperament V"},"werck6":{"frequencies":[261.6255653006,275.69145590816,291.35574317567,310.77945938738,328.70904358281,348.83408706747,368.91086905696,391.43977709097,413.53718386224,438.27872477707,466.16918908107,493.06356537421,523.2511306012],"description":"Andreas Werckmeister's \"septenarius\" tuning VI"},"werck6_dup":{"frequencies":[261.6255653006,275.62199471997,291.49363009634,310.67551062492,328.56569462012,348.83408706747,368.92162485303,391.67947347082,413.43299207996,438.08759304581,466.01326570444,492.84854168382,523.2511306012],"description":"Andreas Werckmeister's VI in the interpretation by Dupont (1935)"},"werck_cl5":{"frequencies":[261.6255653006,274.56549986328,292.86986732103,309.97737261399,327.84547867349,349.70184487387,366.99801003998,391.46454285105,412.14811800305,438.2147004401,466.26912673157,490.54793493862,523.2511306012],"description":"Werckmeister Clavier temperament (Nothw. Anm.) Poletti reconstr. 1/5-comma"},"werck_cl6":{"frequencies":[261.6255653006,275.36250599118,293.11251278827,310.35057963607,328.38895179964,349.55706816887,367.91095120397,391.62667645325,413.31226430431,438.75941205608,466.0760911248,491.56462836305,523.2511306012],"description":"Werckmeister Clavier temperament (Nothw. Anm.) Poletti reconstr. 1/6-comma"},"werck_puzzle":{"frequencies":[261.6255653006,272.52663052146,291.60349465796,306.59245933664,327.03195662575,347.47145391486,365.18568489875,389.71308164569,408.78994578219,436.04260883433,461.93263873387,490.54793493862,523.2511306012],"description":"From Hypomnemata Musica, 1697, p. 49, 1/1=192, fifths tempered superparticular"},"white":{"frequencies":[261.6255653006,275.93321340298,289.72987407313,294.32876096318,305.22982618403,310.42486507835,327.03195662575,331.11985608357,343.38355445704,348.83408706747,367.91095120397,386.30649876417,392.4383479509,406.97310157871,413.89982010446,436.04260883433,441.49314144476,457.84473927605,465.11211608996,490.54793493862,496.67978412536,515.07533168556,523.2511306012],"description":"Justin White's 22-tone scale based on Al-Farabi's tetrachord"},"wicks":{"frequencies":[261.6255653006,276.65728054629,293.45376109391,310.36444075595,329.26048109616,348.28499607284,369.54304125029,391.93835601961,414.48592121967,439.68064187634,465.04666232412,493.39072329352,523.2511306012],"description":"Mark Wicks' equal beating temperament for organs (1887)"},"wier_cl":{"frequencies":[261.6255653006,276.16031892841,290.69507255622,305.22982618403,319.76457981184,348.83408706747,370.63621750918,392.4383479509,414.24047839262,436.04260883433,457.84473927605,479.64686971777,523.2511306012],"description":"Danny Wier, ClownTone (2003)"},"wiesse":{"frequencies":[261.6255653006,277.49581689502,294.32876096318,312.18279369479,331.11985608357,348.83408706747,369.99442271164,392.4383479509,416.24372513446,441.49314144476,465.11211608996,496.67978412536,523.2511306012],"description":"Von Wiesse's 1/2 Pyth. comma tuning"},"wilson1":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,294.32876096318,306.59245933664,313.95067836072,327.03195662575,334.88072358477,348.83408706747,367.91095120397,376.74081403286,392.4383479509,408.78994578219,418.60090448096,436.04260883433,459.88868900496,470.92601754108,490.54793493862,502.32108537715,523.2511306012],"description":"Wilson's 19-tone Scott scale (1976)"},"wilson11":{"frequencies":[261.6255653006,271.31540105247,277.4816601673,291.35574317567,305.22982618403,312.16686768822,325.57848126297,332.97799220076,348.83408706747,366.27579142084,374.60024122586,392.4383479509,406.97310157871,416.22249025095,437.0336147635,457.84473927605,468.25030153232,488.36772189445,499.46698830115,523.2511306012],"description":"Wilson 11-limit 19-tone scale, 1977"},"wilson1t":{"frequencies":[261.6255653006,273.34666024156,279.64601698606,292.92954243175,306.05308604033,313.10617410217,327.13365148064,334.67254769546,349.66622272551,366.27579142084,374.71672979763,391.50442319155,409.04422481132,418.47077311482,437.21869500104,457.98711402938,468.54156606881,489.53271107931,500.81414097667,523.2511306012],"description":"Wilson's Scott scale, wilson1, in minimax minerva tempering"},"wilson2":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,294.32876096318,305.22982618403,313.95067836072,327.03195662575,339.14425131559,348.83408706747,361.75386806997,372.08969287196,392.4383479509,406.97310157871,418.60090448096,441.49314144476,457.84473927605,470.92601754108,490.54793493862,508.71637697339,523.2511306012],"description":"Wilson 19-tone, 1975"},"wilson3":{"frequencies":[261.6255653006,274.70684356563,286.15296204753,294.32876096318,305.22982618403,313.95067836072,327.03195662575,343.38355445704,348.83408706747,366.27579142084,381.53728273004,392.4383479509,412.06026534844,429.2294430713,441.49314144476,457.84473927605,470.92601754108,490.54793493862,515.07533168556,523.2511306012],"description":"Wilson 19-tone"},"wilson5":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,290.69507255622,294.32876096318,306.59245933664,313.95067836072,327.03195662575,334.88072358477,348.83408706747,353.19451315581,367.91095120397,376.74081403286,392.4383479509,408.78994578219,418.60090448096,436.04260883433,441.49314144476,459.88868900496,470.92601754108,490.54793493862,502.32108537715,523.2511306012],"description":"Wilson's 22-tone 5-limit scale"},"wilson7":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,290.69507255622,294.32876096318,305.22982618403,313.95067836072,327.03195662575,339.14425131559,348.83408706747,353.19451315581,367.91095120397,381.53728273004,392.4383479509,406.97310157871,418.60090448096,436.04260883433,441.49314144476,457.84473927605,470.92601754108,490.54793493862,508.71637697339,523.2511306012],"description":"Wilson's 22-tone 7-limit 'marimba' scale"},"wilson7_2":{"frequencies":[261.6255653006,263.718569823,274.70684356563,286.15296204753,294.32876096318,305.22982618403,313.95067836072,327.03195662575,329.64821227876,343.38355445704,353.19451315581,366.27579142084,376.74081403286,392.4383479509,408.78994578219,412.06026534844,436.04260883433,439.53094970501,457.84473927605,470.92601754108,490.54793493862,494.47231841813,523.2511306012],"description":"Wilson 7-limit scale"},"wilson7_3":{"frequencies":[261.6255653006,267.90457886781,279.06726965397,290.69507255622,294.32876096318,310.07474405997,313.95067836072,327.03195662575,334.88072358477,348.83408706747,353.19451315581,372.08969287196,376.74081403286,392.4383479509,408.78994578219,418.60090448096,436.04260883433,446.50763144636,465.11211608996,470.92601754108,490.54793493862,502.32108537715,523.2511306012],"description":"Wilson 7-limit scale"},"wilson7_4":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,290.69507255622,294.32876096318,305.22982618403,313.95067836072,327.03195662575,339.14425131559,348.83408706747,361.75386806997,372.08969287196,387.59343007496,392.4383479509,406.97310157871,418.60090448096,436.04260883433,441.49314144476,457.84473927605,470.92601754108,490.54793493862,508.71637697339,523.2511306012],"description":"Wilson 7-limit 22-tone scale XH 3, 1975"},"wilson_17":{"frequencies":[261.6255653006,275.93321340298,290.69507255622,294.32876096318,310.42486507835,327.03195662575,331.11985608357,348.83408706747,367.91095120397,372.50983809402,392.4383479509,413.89982010446,436.04260883433,441.49314144476,465.11211608996,490.54793493862,496.67978412536,523.2511306012],"description":"Wilson's 17-tone 5-limit scale"},"wilson_31":{"frequencies":[261.6255653006,265.7783520514,271.31540105247,279.06726965397,285.40970760065,294.32876096318,299.00064605783,305.22982618403,313.95067836072,321.08592105074,327.03195662575,332.22294006425,339.14425131559,348.83408706747,354.37113606854,361.75386806997,372.08969287196,380.54627680087,392.4383479509,398.6675280771,406.97310157871,418.60090448096,428.11456140098,441.49314144476,448.50096908674,457.84473927605,470.92601754108,481.6288815761,490.54793493862,498.33441009638,508.71637697339,523.2511306012],"description":"Wilson 11-limit 31-tone scale XH 3, 1975"},"wilson_41":{"frequencies":[261.6255653006,265.7783520514,271.31540105247,275.62199471997,279.06726965397,285.40970760065,290.69507255622,294.32876096318,299.00064605783,305.22982618403,310.07474405997,313.95067836072,321.08592105074,327.03195662575,331.11985608357,336.37572681506,343.38355445704,348.83408706747,354.37113606854,361.75386806997,367.49599295996,372.08969287196,380.54627680087,387.59343007496,392.4383479509,398.6675280771,406.97310157871,413.43299207996,418.60090448096,428.11456140098,436.04260883433,441.49314144476,448.50096908674,457.84473927605,465.11211608996,470.92601754108,481.6288815761,490.54793493862,496.67978412536,504.56359022259,515.07533168556,523.2511306012],"description":"Wilson 11-limit 41-tone scale XH 3, 1975"},"wilson_alessandro":{"frequencies":[261.6255653006,265.58571790036,269.80136421624,270.50397193556,275.93321340298,278.232656848,284.55612632182,286.15296204753,288.53757006459,294.32876096318,295.09524211152,303.52653474327,304.3169684275,305.22982618403,309.14739649778,314.76825825228,321.92208230347,324.60476632267,327.03195662575,331.98214737546,337.2517052703,340.06213614756,343.38355445704,347.79082106,351.18772614924,354.11429053382,359.73515228832,365.180362113,367.91095120397,370.97687579734,379.40816842909,386.30649876417,391.2646736925,392.4383479509,393.46032281536,404.70204632437,405.75595790334,413.89982010446,417.348985272,419.69101100305,429.2294430713,432.80635509689,441.49314144476,442.64286316727,449.66894036041,456.47545264125,457.84473927605,463.72109474667,472.15238737843,482.88312345521,486.907149484,490.54793493862,494.63583439645,505.87755790546,515.07533168556,521.68623159,523.2511306012],"description":"D'Alessandro, genus [3 3 3 5 7 11 11] plus 8 pigtails, XH 12, 1989"},"wilson_bag":{"frequencies":[261.6255653006,294.32876096318,318.85615771011,349.51540364377,392.4383479509,425.14154361347,466.02053819169,523.2511306012],"description":"Erv's bagpipe, mar '97, after Theodore Podnos (37-39)."},"wilson_class":{"frequencies":[261.6255653006,272.52663052146,293.02063313667,305.22982618403,327.03195662575,348.83408706747,366.27579142084,381.53728273004,418.60090448096,436.04260883433,457.84473927605,488.36772189445,523.2511306012],"description":"Class Scale, Erv Wilson, 9 july 1967"},"wilson_dia1":{"frequencies":[261.6255653006,269.10058145205,277.01530443593,285.40970760065,294.32876096318,303.82323712328,313.95067836072,324.77656382143,336.37572681506,348.83408706747,362.25078272391,371.78369805875,381.83190611439,392.4383479509,403.65087217807,415.52295665389,428.11456140098,441.49314144476,455.73485568492,470.92601754108,487.16484573215,504.56359022259,523.2511306012],"description":"Wilson Diaphonic cycles, tetrachordal form"},"wilson_dia2":{"frequencies":[261.6255653006,268.51044859798,275.76748774928,283.42769574232,291.52562990638,300.09991313892,309.19384990071,318.85615771011,329.14184021688,340.11323489078,351.84127747322,364.40703738298,377.90359432309,388.70083987518,400.13321751856,412.25846653428,425.14154361347,438.85578695585,453.48431318771,469.12170329763,485.87604984397,503.87145909745,523.2511306012],"description":"Wilson Diaphonic cycle, conjunctive form"},"wilson_dia3":{"frequencies":[261.6255653006,268.51044859798,275.76748774928,283.42769574232,291.52562990638,300.09991313892,309.19384990071,318.85615771011,329.14184021688,340.11323489078,351.84127747322,364.40703738298,377.90359432309,392.4383479509,403.65087217807,415.52295665389,428.11456140098,441.49314144476,455.73485568492,470.92601754108,487.16484573215,504.56359022259,523.2511306012],"description":"Wilson Diaphonic cycle on 3/2"},"wilson_dia4":{"frequencies":[261.6255653006,269.10058145205,277.01530443593,285.40970760065,294.32876096318,303.82323712328,313.95067836072,324.77656382143,336.37572681506,348.83408706747,358.01393146398,381.83190611439,377.90359432309,388.70083987518,400.13321751856,412.25846653428,425.14154361347,438.85578695585,453.48431318771,469.12170329763,485.87604984397,503.87145909745,523.2511306012],"description":"Wilson Diaphonic cycle on 4/3"},"wilson_duo":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,286.15296204753,294.32876096318,305.22982618403,313.95067836072,327.03195662575,339.14425131559,348.83408706747,361.75386806997,367.91095120397,381.53728273004,392.4383479509,406.97310157871,418.60090448096,436.04260883433,441.49314144476,457.84473927605,470.92601754108,490.54793493862,508.71637697339,523.2511306012],"description":"Wilson 'duovigene'"},"wilson_enh":{"frequencies":[261.6255653006,264.37951861955,279.06726965397,348.83408706747,392.4383479509,396.56927792933,418.60090448096,523.2511306012],"description":"Wilson's Enharmonic & 3rd new Enharmonic on Hofmann's list of superp. 4chords"},"wilson_enh2":{"frequencies":[261.6255653006,265.7783520514,275.62199471997,348.83408706747,392.4383479509,398.6675280771,413.43299207996,523.2511306012],"description":"Wilson's 81/64 Enharmonic, a strong division of the 256/243 pyknon"},"wilson_facet":{"frequencies":[261.6255653006,271.31540105247,274.70684356563,290.69507255622,294.32876096318,305.22982618403,313.95067836072,327.03195662575,339.14425131559,348.83408706747,353.19451315581,366.27579142084,387.59343007496,392.4383479509,406.97310157871,412.06026534844,436.04260883433,452.19233508746,457.84473927605,470.92601754108,488.36772189445,508.71637697339,523.2511306012],"description":"Wilson study in 'conjunct facets', Hexany based"},"wilson_gh1":{"frequencies":[261.6255653006,286.54684077898,313.84200313831,343.73718179912,398.2573899082,436.19359890902,477.74343791599,523.2511306012],"description":"Golden Horagram nr.1: 1phi+0 / 7phi+1"},"wilson_gh11":{"frequencies":[261.6255653006,294.51148904212,316.87124012705,356.70145865606,383.78276711707,432.02365977685,464.82353976398,523.2511306012],"description":"Golden Horagram nr.11: 1phi+0 / 3phi+1"},"wilson_gh2":{"frequencies":[261.6255653006,290.51361927671,322.59142140135,358.21117585067,382.16527586729,424.3630293795,471.22015545621,523.2511306012],"description":"Golden Horagram nr.2: 1phi+0 / 6phi+1"},"wilson_gh50":{"frequencies":[261.6255653006,270.80964219588,280.31611759965,306.81496952381,317.58537244461,347.60736272384,359.80973785756,372.44046183271,407.64801512355,421.95805149354,461.8466031062,478.05922145,523.2511306012],"description":"Golden Horagram nr.50: 7phi+2 / 17phi+5"},"wilson_helix":{"frequencies":[261.6255653006,283.42769574232,294.32876096318,305.22982618403,327.03195662575,348.83408706747,359.73515228832,392.4383479509,425.14154361347,436.04260883433,457.84473927605,479.64686971777,523.2511306012],"description":"Wilson's Helix Song, see David Rosenthal, Helix Song, XH 7&8, 1979. Also Secor, 1964"},"wilson_hypenh":{"frequencies":[261.6255653006,266.38239376061,271.31540105247,348.83408706747,392.4383479509,399.57359064092,406.97310157871,523.2511306012],"description":"Wilson's Hyperenharmonic, this genus has a CI of 9/7"},"wilson_l1":{"frequencies":[261.6255653006,269.80136421624,274.70684356563,286.15296204753,294.32876096318,305.22982618403,314.76825825228,327.03195662575,337.2517052703,343.38355445704,359.73515228832,366.27579142084,377.72190990274,392.4383479509,404.70204632437,419.69101100305,431.68218274599,449.66894036041,457.84473927605,472.15238737843,490.54793493862,503.62921320365,523.2511306012],"description":"Wilson 11-limit scale"},"wilson_l2":{"frequencies":[261.6255653006,267.07609791103,279.79400733536,287.78812183066,294.32876096318,305.22982618403,314.76825825228,327.03195662575,335.75280880244,348.83408706747,359.73515228832,373.05867644715,381.53728273004,392.4383479509,411.12588832951,419.69101100305,436.04260883433,447.67041173658,457.84473927605,479.64686971777,490.54793493862,503.62921320365,523.2511306012],"description":"Wilson 11-limit scale"},"wilson_l3":{"frequencies":[261.6255653006,269.80136421624,274.70684356563,286.15296204753,294.32876096318,305.22982618403,313.95067836072,327.03195662575,332.97799220076,343.38355445704,359.73515228832,366.27579142084,381.53728273004,392.4383479509,406.97310157871,418.60090448096,429.2294430713,441.49314144476,457.84473927605,470.92601754108,490.54793493862,499.46698830115,523.2511306012],"description":"Wilson 11-limit scale"},"wilson_l4":{"frequencies":[261.6255653006,267.07609791103,274.70684356563,290.69507255622,299.00064605783,305.22982618403,313.95067836072,327.03195662575,339.14425131559,348.83408706747,356.10146388137,366.27579142084,381.53728273004,392.4383479509,406.97310157871,418.60090448096,436.04260883433,448.50096908674,457.84473927605,470.92601754108,488.36772189445,508.71637697339,523.2511306012],"description":"Wilson 11-limit scale"},"wilson_l5":{"frequencies":[261.6255653006,267.07609791103,279.79400733536,285.40970760065,299.00064605783,305.22982618403,313.95067836072,327.03195662575,332.97799220076,348.83408706747,356.10146388137,366.27579142084,381.53728273004,392.4383479509,406.97310157871,418.60090448096,436.04260883433,448.50096908674,457.84473927605,479.64686971777,488.36772189445,508.71637697339,523.2511306012],"description":"Wilson 11-limit scale"},"wilson_l6":{"frequencies":[261.6255653006,267.57160087561,277.4816601673,285.40970760065,294.32876096318,305.22982618403,312.16686768822,327.03195662575,332.97799220076,348.83408706747,356.76213450082,369.97554688974,381.53728273004,392.4383479509,406.97310157871,416.22249025095,436.04260883433,443.97065626768,457.84473927605,475.68284600109,490.54793493862,499.46698830115,523.2511306012],"description":"Wilson 1 3 7 9 11 15 eikosany plus 9/8 and tritone. Used Stearns: Jewel"},"window":{"frequencies":[261.6255653006,272.52663052146,290.69507255622,294.32876096318,297.67175429757,306.59245933664,327.03195662575,334.88072358477,348.83408706747,363.36884069528,367.91095120397,372.08969287196,376.74081403286,392.4383479509,408.78994578219,418.60090448096,446.50763144636,459.88868900496,465.11211608996,470.92601754108,502.32108537715,523.2511306012],"description":"Window lattice"},"wonder1":{"frequencies":[261.6255653006,272.72256190885,277.86237426839,283.09905309511,288.43442562998,293.8703485525,299.4087202614,312.10830899518,317.99039712482,323.98334274799,330.08923137594,336.31019538088,342.64839962317,357.18202566262,363.91358676728,370.77201292014,377.75969724053,384.87907140314,392.13262172187,408.76514672187,416.46885901676,424.31776026786,432.3145818485,440.46211650535,448.76319953449,467.79774494453,476.61400354229,485.59641603135,494.74811665626,504.07229015717,513.57219283465,523.2511306012],"description":"Wonder Scale, gen=~233.54 cents, 8/7+1029/1024^7/25, LS 12:14:18:21, M.Schulter"},"wonder36":{"frequencies":[261.6255653006,271.89678302796,277.18263097687,282.57123920205,288.06460709314,293.66476791741,299.37379946195,311.12698372208,317.17549194805,323.3415889232,329.62755691287,336.03572815422,342.56848033562,356.01745236555,362.93866220634,369.99442271164,377.18735172911,384.52011812375,391.99543598175,407.38487419079,415.30469757995,423.37848741825,431.60923940535,440,448.5538823653,466.16376151809,475.22628419761,484.46499093218,493.88330125613,503.48470957687,513.27277840175,523.2511306012],"description":"Wonder Scale, 36-tET version"},"wronski":{"frequencies":[261.6255653006,277.97716313189,294.32876096318,308.86351459099,327.03195662575,348.83408706747,370.63621750918,392.4383479509,416.96574469783,441.49314144476,463.29527188648,494.18162334558,523.2511306012],"description":"Wronski's scale, from Jocelyn Godwin, \"Music and the Occult\", p. 105."},"wurschmidt":{"frequencies":[261.6255653006,275.93321340298,294.32876096318,313.95067836072,331.11985608357,353.19451315581,367.91095120397,392.4383479509,413.89982010446,441.49314144476,470.92601754108,490.54793493862,523.2511306012],"description":"W�rschmidt's normalised 12-tone system"},"wurschmidt1":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,294.32876096318,306.59245933664,313.95067836072,327.03195662575,334.88072358477,348.83408706747,363.36884069528,376.74081403286,392.4383479509,408.78994578219,418.60090448096,436.04260883433,446.50763144636,465.11211608996,490.54793493862,502.32108537715,523.2511306012],"description":"W�rschmidt-1 19-tone scale"},"wurschmidt2":{"frequencies":[261.6255653006,272.52663052146,282.55561052465,294.32876096318,306.59245933664,313.95067836072,327.03195662575,334.88072358477,348.83408706747,363.36884069528,376.74081403286,392.4383479509,408.78994578219,418.60090448096,436.04260883433,446.50763144636,465.11211608996,484.4917875937,502.32108537715,523.2511306012],"description":"W�rschmidt-2 19-tone scale"},"wurschmidt_31":{"frequencies":[261.6255653006,267.90457886781,272.52663052146,279.06726965397,287.4304306281,294.32876096318,301.39265122629,306.59245933664,313.95067836072,319.36714514233,327.03195662575,334.88072358477,340.65828815182,348.83408706747,357.20610515709,363.36884069528,376.74081403286,383.2405741708,392.4383479509,401.85686830172,408.78994578219,418.60090448096,428.6473261885,436.04260883433,446.50763144636,454.2110508691,465.11211608996,476.27480687611,490.54793493862,502.32108537715,510.98743222773,523.2511306012],"description":"W�rschmidt's 31-tone system"},"wurschmidt_31a":{"frequencies":[261.6255653006,267.90457886781,272.52663052146,279.06726965397,287.4304306281,294.32876096318,301.39265122629,306.59245933664,313.95067836072,319.36714514233,327.03195662575,334.88072358477,340.65828815182,348.83408706747,357.20610515709,363.36884069528,372.08969287196,383.2405741708,392.4383479509,401.85686830172,408.78994578219,418.60090448096,428.6473261885,436.04260883433,446.50763144636,454.2110508691,465.11211608996,476.27480687611,490.54793493862,502.32108537715,510.98743222773,523.2511306012],"description":"W�rschmidt's 31-tone system with alternative tritone"},"wurschmidt_53":{"frequencies":[261.6255653006,264.89588486686,267.90457886781,272.52663052146,275.93321340298,279.06726965397,282.55561052465,287.4304306281,290.69507255622,294.32876096318,297.67175429757,301.39265122629,306.59245933664,310.07474405997,313.95067836072,319.36714514233,321.48549464138,327.03195662575,331.11985608357,334.88072358477,340.65828815182,344.91651675372,348.83408706747,353.19451315581,357.20610515709,363.36884069528,367.91095120397,372.08969287196,376.74081403286,383.2405741708,387.59343007496,392.4383479509,396.89567239676,401.85686830172,408.78994578219,413.43299207996,418.60090448096,425.82286018978,428.6473261885,436.04260883433,441.49314144476,446.50763144636,454.2110508691,459.88868900496,465.11211608996,470.92601754108,476.27480687611,484.4917875937,490.54793493862,496.11959049595,502.32108537715,510.98743222773,516.79124009995,523.2511306012],"description":"W�rschmidt's 53-tone system"},"wurschmidt_temp":{"frequencies":[261.6255653006,270.6876810201,276.46178051834,282.35904862511,288.38211267756,294.53365605714,300.81641938515,307.23320174366,313.78686192261,320.48031969341,327.31655710978,338.6540596739,345.87796520471,353.25596548096,360.79134753214,368.48746850413,376.34775715481,384.37571538166,392.57491978195,400.94902556208,409.5017589506,423.68596790742,432.72370810117,441.95423435346,451.38165902684,461.01018486849,470.84409628664,480.88777706987,491.14570185547,501.62244073019,512.32266126632,523.2511306012],"description":"W�rschmidt temperament, 5-limit, g=387.744375, 5-limit"},"t-side":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,294.32876096318,327.03195662575,348.83408706747,367.91095120397,392.4383479509,408.78994578219,418.60090448096,436.04260883433,490.54793493862,523.2511306012],"description":"Tau-on-Side"},"t-side2":{"frequencies":[261.6255653006,294.32876096318,306.59245933664,313.95067836072,327.03195662575,348.83408706747,367.91095120397,392.4383479509,436.04260883433,459.88868900496,470.92601754108,490.54793493862,523.2511306012],"description":"Tau-on-Side opposite"},"tagawa_55":{"frequencies":[261.6255653006,277.01530443593,277.97716313189,279.06726965397,280.31310567921,281.75060878526,283.42769574232,285.40970760065,287.78812183066,290.69507255622,294.32876096318,296.50897400735,299.00064605783,301.87565226992,305.22982618403,307.79478270659,309.19384990071,313.95067836072,319.76457981184,327.03195662575,332.97799220076,336.37572681506,348.83408706747,356.76213450082,359.73515228832,362.25078272391,366.27579142084,369.35373924791,370.63621750918,373.75080757229,377.90359432309,380.54627680087,383.71749577421,392.4383479509,406.97310157871,411.12588832951,418.60090448096,428.11456140098,436.04260883433,442.75095666255,444.76346101102,448.50096908674,453.48431318771,457.84473927605,461.69217405988,465.11211608996,470.92601754108,475.68284600109,479.64686971777,483.00104363188,485.87604984397,488.36772189445,490.54793493862,492.47165233054,494.18162334558,523.2511306012],"description":"Rick Tagawa, 17-limit diamond subset with good 72-tET approximation, 2003"},"tamil":{"frequencies":[261.6255653006,275.62199471997,279.06726965397,290.69507255622,294.32876096318,310.07474405997,313.95067836072,327.03195662575,331.11985608357,348.83408706747,353.19451315581,372.50983809402,387.59343007496,392.4383479509,413.43299207996,418.60090448096,436.04260883433,441.49314144476,465.11211608996,470.92601754108,490.54793493862,496.67978412536,523.2511306012],"description":"Possible Tamil sruti scale. Alternative 11th sruti is 45/32 or 64/45"},"tamil_vi":{"frequencies":[261.6255653006,275.62199471997,290.69507255622,310.07474405997,327.03195662575,348.83408706747,367.91095120397,387.59343007496,413.43299207996,436.04260883433,465.11211608996,490.54793493862,523.2511306012],"description":"Vilarippalai scale in Tamil music, Vidyasankar Sundaresan"},"tamil_vi2":{"frequencies":[261.6255653006,275.62199471997,290.69507255622,310.07474405997,327.03195662575,348.83408706747,367.49599295996,387.59343007496,413.43299207996,436.04260883433,465.11211608996,490.54793493862,523.2511306012],"description":"Vilarippalai scale with 1024/729 tritone"},"tanaka":{"frequencies":[261.6255653006,272.52663052146,275.93321340298,279.06726965397,290.69507255622,294.32876096318,306.59245933664,313.95067836072,327.03195662575,331.11985608357,344.91651675372,348.83408706747,353.19451315581,363.36884069528,367.91095120397,372.08969287196,387.59343007496,392.4383479509,408.78994578219,418.60090448096,436.04260883433,441.49314144476,459.88868900496,465.11211608996,470.92601754108,490.54793493862,523.2511306012],"description":"26-note choice system of Shoh� Tanaka, Studien i.G.d. reinen Stimmung (1890)"},"tanbur":{"frequencies":[261.6255653006,268.33391312882,275.39533189537,282.83844897362,290.69507255622,299.00064605783,306.66732929008,314.73752216614,323.24394168414,332.22294006425,341.71502406609,351.76546595039,523.2511306012],"description":"Sub-40 tanbur scale"},"tansur":{"frequencies":[261.6255653006,275.71279889585,293.19126194179,310.07474405997,328.21516866261,348.83408706747,367.61706537823,391.78834765065,413.56919813705,438.48689188122,465.11211608996,491.022754507,523.2511306012],"description":"William Tans'ur temperament from A New Musical Grammar (1746) p. 73"},"tartini_7":{"frequencies":[261.6255653006,294.32876096318,313.95067836072,367.91095120397,392.4383479509,418.60090448096,490.54793493862,523.2511306012],"description":"Tartini (1754) with 2 neochromatic tetrachords, 1/1=d, Minor Gipsy (Slovakia)"},"taylor_g":{"frequencies":[261.6255653006,274.70684356563,287.78812183066,294.32876096318,313.95067836072,353.19451315581,366.27579142084,392.4383479509,412.06026534844,418.60090448096,431.68218274599,470.92601754108,523.2511306012],"description":"Gregory Taylor's Dutch train ride scale based on pelog_schmidt"},"taylor_n":{"frequencies":[261.6255653006,275.93341798027,292.67158636845,310.42509491746,327.40170814054,348.83408706747,367.9112241576,391.33200541501,413.90012676351,437.76975193523,465.63764214343,491.10256480205,523.2511306012],"description":"Nigel Taylor's Circulating Balanced temperament (20th cent.)"},"telemann":{"frequencies":[261.6255653006,264.94361147373,271.70648167539,275.15237829755,278.64197723942,282.17583275232,289.3785657319,293.0485888979,296.76515515861,300.52885648597,304.34029066685,308.20006306951,312.10878854255,316.06708432391,324.13491490251,328.24573110938,332.40868242763,336.62443200122,345.21700307457,349.59519124833,354.02890545793,363.06573983159,367.67029324081,372.33324354561,377.05533136015,386.67993129161,391.58396987353,396.55020354877,406.67242132093,411.83001550364,417.05301810033,422.34226102699,433.12283887627,438.61588607285,444.17860098504,449.81186203693,461.29362042034,467.14394139401,473.06846134744,485.14386048744,491.29666030217,497.52749252881,503.83734680745,516.69814597997,523.2511306012],"description":"G.Ph. Telemann (1767). 55-tET interpretation of Klang- und Intervallen-Tafel"},"telemann_28":{"frequencies":[261.6255653006,264.94361147373,275.15237829755,278.64197723942,293.0485888979,296.76515515861,308.20006306951,312.10878854255,328.24573110938,332.40868242763,345.21700307457,349.59519124833,354.02890545793,367.67029324081,372.33324354561,386.67993129161,391.58396987353,396.55020354877,406.67242132093,411.83001550364,438.61588607285,444.17860098504,461.29362042034,467.14394139401,473.06846134744,491.29666030217,497.52749252881,516.69814597997,523.2511306012],"description":"Telemann's tuning as described on Sorge's monochord, 1746, 1748, 1749"},"temes-mix":{"frequencies":[261.6255653006,306.31659399917,323.38698268281,342.47239171077,361.55773069062,378.62819763364,399.72843132859,423.31905787312,446.91000942727,523.2511306012],"description":"Temes' 5-tone Phi scale mixed with its octave inverse"},"temes-ur":{"frequencies":[261.6255653006,306.31659399917,323.38703872151,342.47239171077,361.55773069062,423.31905787312],"description":"Temes' Ur 5-tone phi scale"},"temes":{"frequencies":[261.6255653006,306.31659399917,323.38703872151,342.47239171077,361.55773069062,423.31905787312,495.63057556553,523.2511306012,554.13187513888,585.01259700885,684.94462120932],"description":"Temes' 5-tone Phi scale / 2 cycle"},"temes2-mix":{"frequencies":[261.6255653006,306.31659399917,323.38698268281,342.47239171077,361.55773069062,399.72843132859,423.31905787312,468.0102705885,495.63057556553,523.2511306012,552.41124604023,585.01259700885,646.77396536561,684.94438778203,757.25639526728,799.45686265718,846.63811574624,893.82001885454,1046.5022612024],"description":"Temes' 2 cycle Phi scale mixed with its 4/1 inverse"},"temp10coh":{"frequencies":[261.6255653006,279.06726965397,299.10339764541,320.57805584394,343.5945271479,368.2635494613,394.70435354475,423.05284121745,453.57582505819,488.36772189445,523.2511306012],"description":"Differential coherent 10-tone scale, OdC, 2003"},"temp10ebss":{"frequencies":[261.6255653006,280.43397904206,300.58585223371,322.17714382919,345.31067040124,370.09659148016,396.65293718743,425.1061627261,455.59176355181,488.25490599611,523.2511306012],"description":"Cycle of 10 equal \"beating\" 15/14's"},"temp11ebst":{"frequencies":[261.6255653006,278.68301283272,296.80966039395,316.07252488244,336.70993118161,358.64093492832,381.94662420398,406.71316497313,433.24697173408,461.44397806515,491.40843569917,523.2511306012],"description":"Cycle of 11 equal beating 9/7's"},"temp12coh3":{"frequencies":[261.6255653006,279.8393060116,294.68135606466,311.32770136359,332.21069717879,353.56473801237,370.2386298036,397.61708850394,418.97112933752,440.1984563065,471.2874275201,496.80305467842,523.2511306012],"description":"Differential coherent scale, interval=3, OdC, 2003"},"temp12ebf":{"frequencies":[261.6255653006,277.18807786937,293.58315284916,311.09098010692,329.5354160273,349.23174343306,369.98176018664,391.84186131702,415.18563115404,439.77824302677,466.03998256716,493.70667148145,523.2511306012],"description":"Equal beating temperament tuned by The Best Factory Tuners (1840)"},"temp12ebf4":{"frequencies":[261.6255653006,276.98801737971,293.51517393789,310.79793252689,329.39098365485,348.83408706747,369.75126958642,391.78747833067,414.83115644933,439.62189128662,465.54602917011,493.43560586205,523.2511306012],"description":"Eleven equal beating fifths and just fourth"},"temp12ebfo":{"frequencies":[261.6255653006,277.20265787963,293.64844512428,311.16011036869,329.64835309433,349.33484978517,370.11921182839,392.06266066657,415.42830219132,440.09698059047,466.36447845344,494.0968438935,523.62658899088],"description":"Equal beating fifths and fifth beats twice octave at C"},"temp12ebfp":{"frequencies":[261.6255653006,277.75307788644,293.77513637875,310.82931496301,329.94340332986,349.12935317325,370.63270249518,391.99544730302,416.18671544528,440.21980402758,465.80107112682,494.47220378931,523.2511306012],"description":"All fifths except G#-Eb beat same as 700 c. C-G"},"temp12ebfr":{"frequencies":[261.6255653006,277.1880780098,293.58315312731,311.09097992515,329.53543943235,349.23174457993,369.98176152553,391.84186168221,415.185630746,439.77824342227,466.03998361904,493.70667287983,523.2511306012],"description":"Exact values of equal beating temperament of Best Factory Tuners (1840)"},"temp12ep":{"frequencies":[261.6255653006,277.19910487213,293.6996776193,311.18246278326,329.70593120198,349.3320268423,370.12638880276,392.15855510068,415.50221189151,440.23542223935,466.44090588941,494.20629608476,523.62445363767],"description":"Pythagorean comma distributed equally over octave and fifth: 1/19-Pyth comma"},"temp12fo1o":{"frequencies":[261.6255653006,277.20349049726,293.7089710611,311.19723286579,329.72679517909,349.35966199273,370.1615231373,392.20198585541,415.5548023839,440.29810917508,466.51470234738,494.29230838881,523.72386870485],"description":"Fifth beats same octave opposite"},"temp12fo2o":{"frequencies":[261.6255653006,277.19623399848,293.69359242342,311.17279259662,329.69226891672,349.31393351076,370.10338107372,392.13011658806,415.46777521802,440.19437666896,466.39258399594,494.14997995304,523.55935978973],"description":"Fifth beats twice octave opposite"},"temp12p10":{"frequencies":[261.6255653006,277.12003622197,293.53214922797,310.91625060765,329.32990524605,349.3071136959,369.493381814,391.90691363044,415.11714643072,439.70197837153,465.74281849401,493.32589719545,523.2511306012],"description":"1/10-Pyth. comma well temperament"},"temp12p6":{"frequencies":[261.6255653006,275.62199471997,293.00227310437,310.07474405997,328.14198392915,349.6228209638,367.9112241576,391.5530240856,413.43299207996,438.51190905657,466.16376151809,491.10256480205,523.2511306012],"description":"Modified 1/6-Pyth. comma temperament"},"temp12p8":{"frequencies":[261.6255653006,277.02617059261,293.33333347996,310.60041853231,328.88393162803,349.42547049952,369.36822764145,391.77416758435,414.83597850347,439.25532436715,465.90062756558,492.49097043477,523.2511306012],"description":"1/8-Pyth. comma well temperament"},"temp12p8a":{"frequencies":[261.6255653006,276.55731914056,293.33333347996,311.12698372208,328.88393162803,349.42547049952,368.74309237173,391.77416758435,414.83597850347,439.25532436715,466.69047534984,492.49097043477,523.2511306012],"description":"1/8-Pyth. comma well temperament, consecutive just fifths"},"temp12s17":{"frequencies":[261.6255653006,275.41266079541,292.61316553779,309.9334225479,327.2710181906,348.78108411875,367.16108497228,391.29294726693,413.18177371806,437.63868343995,464.97078294553,490.98112850332,523.2511306012],"description":"4/17th synt. comma \"well\"-temperament. OdC 1999"},"temp12s3":{"frequencies":[261.6255653006,275.79485124716,293.07576161921,310.19140758515,326.99095182327,348.87783040382,367.77258074571,390.81668391305,413.640406907,437.79703699716,465.22877230071,490.42492909292,523.2511306012],"description":"1/3 synt. comma \"well\"-temperament. OdC 1999"},"temp12septendec":{"frequencies":[261.6255653006,277.01530443593,293.31032234393,310.5638707171,328.83233370046,348.17541215342,368.65631875068,390.34198455955,413.30334035457,437.61515184999,463.35732874365,494.18162334558,523.2511306012],"description":"Scale with 18/17 steps"},"temp12w2b":{"frequencies":[261.6255653006,276.80621914251,293.38957467182,310.9374037046,329.12408537692,349.33498699812,369.32540968366,391.68699838314,414.83365420901,439.33301386008,466.03043161756,492.93477894539,523.2511306012],"description":"The fifths on white keys beat twice the amount of fifths on black keys"},"temp15coh":{"frequencies":[261.6255653006,273.98642352939,286.93424587686,300.52595924487,314.76156220527,329.6715499436,345.28562122078,360.48992106995,377.61407292725,395.54746439596,414.33033691342,434.93480826785,455.53927928881,477.11963158959,499.65025190386,523.2511306012],"description":"Differential coherent 15-tone scale, OdC, 2003"},"temp15ebmt":{"frequencies":[261.6255653006,274.13344448045,287.10161388969,300.54701305042,315.02372625978,330.03318193885,345.59498492211,361.72946206059,379.10151766291,397.1128647533,415.78702800292,435.14840215297,455.99486887387,477.60848441971,500.01748339385,523.2511306012],"description":"Cycle of 15 equal beating minor thirds"},"temp15ebsi":{"frequencies":[261.6255653006,274.09084013406,287.01483652929,300.41443756554,314.84183942382,329.80016763418,345.30896502873,361.38848559819,378.7013656391,396.65136316555,415.2619179078,434.55734100747,455.33280077531,476.87279531786,499.20546063174,523.2511306012],"description":"Cycle of 15 equal beating major sixths"},"temp15mt":{"frequencies":[261.6255653006,272.10155294862,290.46827626332,302.09918118188,314.19580976213,326.77681046955,348.83408706747,362.80207077951,377.32935907335,392.4383479509,418.92774655891,435.70241417719,453.14877154631,471.29371440761,503.10581234929,523.2511306012],"description":"Cycle of 15 minor thirds, Petr Parizek"},"temp16d3":{"frequencies":[261.6255653006,272.52663052146,287.69189096389,299.67905363019,312.16568143019,325.17258353382,338.72144179457,352.83483584176,372.46899992671,387.98854005196,404.15472995283,420.99451113006,438.53594735503,462.93911228358,482.22824196207,502.32108537715,523.2511306012],"description":"Cycle of 16 thirds tempered by 1/3 small diesis"},"temp16d4":{"frequencies":[261.6255653006,271.36369423603,291.82218013836,302.68427617679,313.95067836072,325.63643364742,337.75715313333,350.32902355546,376.74081403286,390.76372105392,405.30858212106,420.39482899491,436.04260883433,468.91646607712,486.37029938793,504.47379566792,523.2511306012],"description":"Cycle of 16 thirds tempered by 1/4 small diesis"},"temp16ebs":{"frequencies":[261.6255653006,273.35566334732,285.38860666159,297.73221513295,311.13803992337,324.88997598926,338.996955196,354.31789928052,370.0343963911,386.15666093499,403.66631166114,421.62802297921,440.05346707662,460.0644954801,480.59216613216,501.64981691394,523.2511306012],"description":"Cycle of 16 equal beating sevenths"},"temp16ebt":{"frequencies":[261.6255653006,273.54317752885,285.74681450472,298.24333695649,311.03977535434,324.14332902314,339.04034606654,354.29488987405,369.91554384313,385.91109319424,402.29053605603,420.91180538217,439.97998583037,459.50580330844,479.50024102158,499.97454326842,523.2511306012],"description":"Cycle of 16 equal beating thirds"},"temp16l4":{"frequencies":[261.6255653006,278.81939890042,286.59644689091,305.43134787805,313.95067836072,322.70763593891,343.91573686494,353.50850469302,376.74081403286,387.24916379762,412.69888495295,424.21020636659,436.04260883433,464.69899736225,477.66074674968,509.05224558146,523.2511306012],"description":"Cycle of 16 fifths tempered by 1/4 major limma"},"temp17c10":{"frequencies":[261.6255653006,278.13248184697,287.25399162485,296.67464640038,315.39293803189,325.73642523995,336.41913481987,347.45218787195,369.37422084479,381.48805431277,393.9991677018,418.85802036446,432.59470262079,446.78188702878,474.97099505857,490.54793493862,506.63572944675,523.2511306012],"description":"Cycle of 17 fifths tempered by 1/10 of \"17-tET comma\""},"temp17c11":{"frequencies":[261.6255653006,276.93071634298,286.5293181416,296.46061382736,313.80362259461,324.68026371274,335.93389640617,347.57758745223,367.91095120397,380.66298908833,393.8570200719,416.89773925535,431.34769064645,446.29848691039,472.40704302301,488.78098359819,505.72245578392,523.2511306012],"description":"Cycle of 17 fifths tempered by 1/11 of \"17-tET comma\""},"temp17c12":{"frequencies":[261.6255653006,275.93321340298,285.92682111936,296.28237159295,312.48531442823,323.80274674587,335.53006800342,347.68212334757,366.69599021774,379.97679689512,393.73860099464,415.27118158544,430.3112595477,445.8960513142,470.2809925818,487.31338757149,504.96265307831,523.2511306012],"description":"Cycle of 17 fifths tempered by 1/12 of \"17-tET comma\""},"temp17c13":{"frequencies":[261.6255653006,275.09197878886,285.41800532755,296.13163442011,311.37414725128,323.06208421743,335.18874504319,347.77059980835,365.67107999768,379.3971387881,393.63842979584,413.89982010446,429.43622376713,445.55581352332,468.48950048969,486.07501593832,504.32063522708,523.2511306012],"description":"Cycle of 17 fifths tempered by 1/13 of \"17-tET comma\""},"temp17c14":{"frequencies":[261.6255653006,274.37296298479,284.98259752889,296.00249241327,310.42486507835,322.42857866752,334.89645942743,347.84645641687,364.79486552165,378.90099378095,393.5525871037,412.72797362103,428.68761089217,445.26438593469,466.95936897503,485.01606158014,503.77098227424,523.2511306012],"description":"Cycle of 17 fifths tempered by 1/14 of \"17-tET comma\""},"temp17c15":{"frequencies":[261.6255653006,273.75133628611,284.60578240525,295.8906154666,309.60449456672,321.88054534371,334.64335075548,347.91221098893,364.0371787025,378.47152629398,393.47820661021,411.71505587788,428.03986711385,445.01196937812,465.63729761752,484.10016650719,503.29510175355,523.2511306012],"description":"Cycle of 17 fifths tempered by 1/15 of \"17-tET comma\""},"temp17ebf":{"frequencies":[261.6255653006,272.44226039746,283.83762774933,295.84262353625,308.01140541539,320.83119298602,334.33681303028,348.02669374128,362.44895565855,377.64277622383,393.64943714798,409.87448211667,426.96753159265,444.97502525992,463.22819966593,482.45788080796,502.71631088044,523.2511306012],"description":"Cycle of 17 equal beating fifths"},"temp17ebs":{"frequencies":[261.6255653006,272.25303191034,284.09302419378,294.99486987374,307.14054534497,320.67196534338,333.1312181383,347.01199086095,362.47647062671,376.71561430061,392.57935523584,410.25304697073,426.52635565248,444.65634289229,464.854847056,483.45291583119,504.17290303449,523.2511306012],"description":"Cycle of 17 equal beating sevenths"},"temp17fo2":{"frequencies":[261.6255653006,272.49443630436,283.81483782984,295.60553136463,307.88605111976,320.67674980257,333.99881838086,347.87433573796,362.32629011314,377.37863296804,393.05630224552,409.38528080469,426.39262165238,444.10651133426,462.55629730628,481.77255670213,501.78712602614,522.6331757532],"description":"Fifth beats twice octave"},"temp17nt":{"frequencies":[261.6255653006,272.67141175251,283.62400127587,295.59862296305,308.07881564783,321.08592105074,333.98321109015,348.08400151932,362.78013022893,377.35217954558,393.28401259522,409.88848628312,426.35277308246,444.35341180422,463.11404114636,482.66674266598,502.05436630802,523.2511306012],"description":"17-tone temperament with 27/22 neutral thirds"},"temp17s":{"frequencies":[261.6255653006,272.47577100117,283.83144686231,295.66037914716,307.98229466369,320.75501909295,334.12277657932,348.04764753103,362.48197303348,377.58873713905,393.32509157531,409.63717539588,426.70917767843,444.49267120113,463.01730800927,482.21968335939,502.31662775181,523.2511306012],"description":"Cycle of 17 fifths tempered by 2 schismas. Schulter, Tuning List 10-9-98"},"temp19d5":{"frequencies":[261.6255653006,270.66831710441,280.02362001571,289.70227696231,304.50185643804,315.02657220273,325.91506125677,337.17989695691,348.83408706747,360.89108965294,379.3273836973,392.4383479509,406.00247545366,420.03542981361,434.55341522625,449.57319616728,472.53985806789,488.87259164079,505.76984518255,523.2511306012],"description":"Cycle of 19 thirds tempered by 1/5 small diesis. Third = 3\\5"},"temp19ebf":{"frequencies":[261.6255653006,271.21349495395,281.45216719787,291.55303152151,302.33945232218,313.85796000757,325.22143162672,337.35615460362,350.31447634238,363.09838134063,376.74994653359,390.21776437961,404.59965986997,419.95766938963,435.10896436483,451.288596451,468.56635736893,485.61156561298,503.81364896584,523.2511306012],"description":"Cycle of 19 equal beating fifths"},"temp19ebmt":{"frequencies":[261.6255653006,271.3515811897,281.43551369743,291.89053542337,302.73030209663,313.98726376766,325.65848288741,337.75920164946,350.30522706536,363.3129458114,376.82130195458,390.82676353803,405.34762742982,420.40285701732,436.01212051281,452.22214724761,469.0287008844,486.45373685079,504.52001310976,523.2511306012],"description":"Cycle of 19 equal beating minor thirds"},"temp19ebo":{"frequencies":[261.6255653006,277.22364042749,293.65618047886,311.2040149966,329.6906225544,349.43193638686,370.22936988938,392.1394232912,415.53653598153,440.18534605859,466.50709783521,494.2370091719,523.84897992059,555.04513017437,587.91021027711,623.0058793126,659.97909442818,699.46172209312,741.05658909815,784.8766959018],"description":"Cycle of 19 equal beating octaves in twelfth"},"temp19ebt":{"frequencies":[261.6255653006,271.59402175166,281.80172126331,292.25440577595,302.95795550425,313.91838845704,325.14187338321,337.60244413755,350.36206814823,363.42792409681,376.80735887968,390.50790160795,404.53725818867,420.11297167574,436.06250107414,452.39482160095,469.11911613638,486.2447950704,503.78149001575,523.2511306012],"description":"Cycle of 19 equal beating thirds"},"temp19k10":{"frequencies":[261.6255653006,271.76196854941,282.29109592175,293.22816309454,304.58897525989,314.09773337131,326.2671147593,338.90798583865,352.03861397416,365.67797428016,377.09383089344,391.70392883316,406.88007915549,422.6442137645,439.01911266466,452.72455471179,470.26488431194,488.48479525859,507.41061720556,523.2511306012],"description":"Chain of 19 minor thirds tempered by 1/10 kleisma"},"temp19k3":{"frequencies":[261.6255653006,272.95237156345,284.76956174698,297.09836322231,309.96092731219,314.44113201634,328.05453510669,342.25731432435,357.07498823553,372.53417996774,377.91882441317,394.28042610165,411.35038641496,429.15937528906,447.73938330242,454.2110508691,473.87564511273,494.39160029408,515.79576952378,523.2511306012],"description":"Chain of 19 minor thirds tempered by 1/3 kleisma"},"temp19k4":{"frequencies":[261.6255653006,272.52663052146,283.88190679319,295.71031957624,308.03158289191,314.31844786309,327.4150485592,341.05734286691,355.26806612985,370.07090075127,377.62397563434,393.35830866491,409.74823893478,426.8210805314,444.6052930255,453.67960031314,472.58291784883,492.27387080735,512.78528301977,523.2511306012],"description":"Chain of 19 minor thirds tempered by 1/4 kleisma"},"temp19k5":{"frequencies":[261.6255653006,272.27150423996,283.35064249518,294.88062803952,306.8797443789,314.24485853342,327.03195662575,340.33937954017,354.18830437416,368.6007608062,377.44717941318,392.80607455881,408.78994578219,425.42422593284,442.73537947933,453.36102900438,471.8089732132,491.00759210237,510.98743222773,523.2511306012],"description":"Chain of 19 minor thirds tempered by 1/5 kleisma"},"temp19k6":{"frequencies":[261.6255653006,272.10155294862,282.99701916355,294.32876096318,306.11424676116,314.19580976213,326.77681046955,339.86157848985,353.47028562902,367.62391141072,377.32935907335,392.4383479509,408.1523292189,424.49552853314,441.49314144476,453.14877154631,471.29371440761,490.16521545931,509.79236747994,523.2511306012],"description":"Chain of 19 minor thirds tempered by 1/6 kleisma"},"temp19k7":{"frequencies":[261.6255653006,271.9802243463,282.7447017667,293.93521741989,305.56863311614,314.16077935352,326.59468561952,339.52070304385,352.95830848174,366.92774752709,377.24522513926,392.17589782962,407.69749910471,423.83341578697,440.60837682578,452.99722066906,470.92601754108,489.56440442681,508.94046380742,523.2511306012],"description":"Chain of 19 minor thirds tempered by 1/7 kleisma"},"temp19k8":{"frequencies":[261.6255653006,271.88926339885,282.55561052465,293.64040364533,305.16005936662,314.13450956378,326.45815718343,339.26526937521,352.57481080357,366.4064920117,377.18213591051,391.97917444376,407.35670799125,423.33750965456,439.94524339387,452.88359011983,470.65043349884,489.11427877975,508.30246674991,523.2511306012],"description":"Chain of 19 minor thirds tempered by 1/8 kleisma"},"temp19k9":{"frequencies":[261.6255653006,271.81853598083,282.40862793607,293.41130980736,304.84265779003,314.11407882217,326.35200974457,339.06673262958,352.27682225125,366.00158141044,377.13307501509,391.82623534045,407.09184571451,422.95220417284,439.43048454013,452.79523167251,470.4362008006,488.76446469244,507.80680338678,523.2511306012],"description":"Chain of 19 minor thirds tempered by 1/9 kleisma"},"temp19lst":{"frequencies":[261.6255653006,270.56149416036,279.80263334807,289.3594074481,304.78245180412,315.19242188443,325.95794877725,337.09117667186,348.60466454729,360.5114003397,379.7268899367,392.69661814622,406.10933276067,419.98016416303,434.32475952075,449.15930043669,473.09978287909,489.25870067642,505.96953296163,523.2511306012],"description":"Cycle of 19 least squares thirds 5/4^5 = 3/2"},"temp19lst2":{"frequencies":[261.6255653006,270.86681403244,280.43448605562,290.34011310859,303.98143643885,314.71879896063,325.83542931914,337.34472599098,349.26055890156,361.59728998429,378.58655645252,391.95915298383,405.80409975455,420.1380835834,434.97837844393,450.34287106955,471.50175486263,488.15634183652,505.39920634693,523.2511306012],"description":"Cycle of 19 least squares thirds 5/4, 3/2 (5), 6/5 (4)"},"temp21ebs":{"frequencies":[261.6255653006,270.48603901573,279.57527100587,288.89916626223,298.46378542286,308.59004184051,318.97773454914,329.63361550747,340.56460989801,352.13747205507,364.00912264098,376.18727282918,388.67983604901,401.90596519454,415.47356606258,429.3914526989,443.66866815503,458.78424493347,474.29007331382,490.19622772738,506.51304733863,523.2511306012],"description":"Cycle of 21 equal beating sevenths"},"temp22ebf":{"frequencies":[261.6255653006,269.81217946012,278.43675961795,287.52273893052,297.09479717246,306.30473778727,316.00739221221,326.22911792828,336.99768333647,347.35886661388,358.27435338478,369.77379349451,381.88843101834,394.65117841871,406.93109909525,419.8679691216,433.49693671533,447.85502662133,461.66993710068,476.2239184443,491.55650493929,507.70935693135,523.2511306012],"description":"Cycle of 22 equal beating fifths"},"temp22ebt":{"frequencies":[261.6255653006,270.16401944699,278.90739732088,287.86061708193,297.02871287074,306.4168425362,316.03028815926,325.87445510174,336.54752540671,347.4767459334,358.66827061689,370.12838991426,381.86355177507,393.88036006393,406.18556836568,419.52690380046,433.1884314408,447.17783799964,461.50298590676,476.17193984405,491.19294816955,506.57446222015,523.2511306012],"description":"Cycle of 22 equal beating thirds"},"temp22fo2":{"frequencies":[261.6255653006,269.97341665226,278.58762814388,287.47669703533,296.64939669548,306.114775449,315.88217199169,325.96122111215,336.36187067071,347.09438029185,358.16933884319,369.59767092309,381.39065611261,393.55992749281,406.11749146369,419.07573510033,432.44744798202,446.24582051114,460.48446638525,475.17743368268,490.33921589034,505.98477744485,522.12955176559],"description":"Fifth beats twice opposite rate as octave"},"temp23ebs":{"frequencies":[261.6255653006,269.54528659271,277.75645349026,286.26979186473,295.09642104593,304.24787054065,313.41421505132,322.9178815064,332.77128133421,342.98728793362,353.5792427091,364.56098080918,375.56059498003,386.96499273375,398.78907363541,411.04828247111,423.75862731373,436.93671323096,450.13624919654,463.82153026575,478.01042762353,492.72147385367,507.97388874722,523.2511306012],"description":"Cycle of 23 equal beating major sixths"},"temp24ebaf":{"frequencies":[261.6255653006,269.28287293678,277.23083697142,285.33112867981,293.73889258015,302.30779732819,311.20195864933,320.26658492056,329.67528611807,339.26431305611,349.21731641877,359.36108127338,369.88988063787,380.8183283077,391.95623237686,403.5169050439,415.29914897519,427.52862168357,439.9924847314,452.92944495636,466.1143590732,479.79973930305,493.74741628009,508.22451419243,523.2511306012],"description":"Cycle of 24 equal beating 11/8's"},"temp24ebf":{"frequencies":[261.6255653006,269.29177952703,277.18807786937,285.37455545576,293.58315284916,302.20762754558,311.09098010692,320.17688686519,329.5354160273,339.23795459232,349.23174343306,359.45337270909,369.98176018664,380.89707445632,391.84186131702,403.3411703213,415.18563115404,427.4653330282,439.77824302677,452.71493931339,466.03998256716,479.66882917609,493.70667148145,508.26043277122,523.2511306012],"description":"24-tone ET with 23 equal beatings fifths. Fifth on 17 slightly smaller."},"temp25ebt":{"frequencies":[261.6255653006,269.07040607882,276.69392272178,284.50040351526,292.49424189123,300.67993013952,309.06207502162,317.64539198503,326.43470939254,335.74076076764,345.27015661764,355.02825763358,365.02055286832,375.25266439783,385.73034580726,396.45949385543,407.44613828076,419.07870286007,430.99044652419,443.18807578441,455.67844358274,468.46858279232,481.56568677979,494.97711759939,508.71042703507,523.2511306012],"description":"Cycle of 25 equal beating thirds"},"temp26eb3":{"frequencies":[261.6255653006,268.53506427639,276.23413316293,283.52944261778,291.01742029734,298.70315454572,307.26715974579,315.38204761281,323.71124866952,332.26042290088,341.78653782772,350.81307822085,360.07800843467,370.40166886388,380.18393134541,390.22454217496,400.5303243006,412.0137801623,422.89501338113,434.06361862988,445.5271853685,458.30072684004,470.40439262311,482.82771472967,495.57913524385,509.78770018956,523.2511306012],"description":"Cycle of 26 fifths, 5/4 beats three times 3/2"},"temp26ebf":{"frequencies":[261.6255653006,268.42568455944,275.6873347244,283.44184249631,290.6057533496,298.25588724353,306.42524452376,315.14906491362,323.2084665433,331.81486605817,341.00539333861,350.8196903474,359.88651586494,369.56871668171,379.90806097321,389.45994242989,399.66012078319,410.55259814459,422.18435687733,432.93022440227,444.40542617247,456.65946119637,469.74519313893,481.83429211771,494.74389287961,508.52968420524,523.2511306012],"description":"Cycle of 26 equal beating fifths"},"temp26ebmt":{"frequencies":[261.6255653006,268.65375733515,276.22103845862,283.50786797993,291.35362426947,298.90860888253,307.04308924768,315.80151824033,324.23534814673,333.31608510092,342.06028051348,351.47518831899,360.54116941247,370.30254728737,380.81265974123,390.93325547321,401.83014055422,412.32317421544,423.62106542614,434.50024245702,446.21389528982,458.82603004394,470.97074536855,484.04700949484,496.63864979835,510.1961187079,523.2511306012],"description":"Cycle of 26 equal beating minor thirds"},"temp26ebs":{"frequencies":[261.6255653006,268.70854008298,275.97438147252,283.42781183148,291.07367309004,298.91693448926,307.01176285104,315.31558194419,323.83378869523,332.57191674,341.53564330438,350.78687613393,360.27695513986,370.01204624828,379.9984780646,390.24273934583,400.81557597059,411.66137956276,422.7871998129,434.200265189,445.90799193987,457.99123299379,470.38643795716,483.10166179174,496.14516363988,509.5254229925,523.2511306012],"description":"Cycle of 26 equal beating sevenths"},"temp27c8":{"frequencies":[261.6255653006,268.8683660761,273.88218275531,281.46429379013,289.25630678777,297.26403435806,305.49344487497,313.95067836072,319.80518189674,328.65861797738,337.75715313333,347.10756874671,356.7168418477,363.36884069528,373.42828707985,383.76621672426,394.39034225616,405.30858212106,412.86671295557,424.29645219584,436.04260883433,448.1139452722,460.51946086698,473.26841152735,482.09384659572,495.44005640506,509.15574351714,523.2511306012],"description":"Cycle of 27 fifths tempered by 1/8 of difference between augm. 2nd and 5/4"},"temp27eb2":{"frequencies":[261.6255653006,268.46319812592,275.47953375729,282.6792426258,290.06711722511,297.6480770209,305.21714541248,313.19405229436,321.37943712173,329.77875040935,338.39757940759,347.00289091411,356.07187808578,365.37788286775,374.92710181611,384.72589137834,394.78077412888,404.81988946592,415.39993259502,426.25648711974,437.39677971686,448.82822593369,460.24174609969,472.27024976331,484.61312060812,497.27857467888,510.27504274822,523.2511306012],"description":"Cycle of 27 fourths, 5/4 beats twice 4/3"},"temp28ebt":{"frequencies":[261.6255653006,268.20719354764,274.94677993062,281.84811597329,288.91508487862,296.15166190523,303.56191452522,311.15001492268,318.92023016627,326.87692943437,335.10396312415,343.5284476344,352.15511767098,360.98882840285,370.03454814671,379.29736707683,388.78249121135,398.49525813745,408.44113355924,418.72492751128,429.25553103998,440.03886948281,451.08100913788,462.38815755283,473.96667987616,485.82308640697,497.96404651665,510.39638953936,523.2511306012],"description":"Cycle of 28 equal beating thirds"},"temp29c14":{"frequencies":[261.6255653006,268.03384168485,274.59908446169,281.12309545065,288.00894581307,294.85155418799,302.07367045706,309.47268578827,316.82523654187,324.58557784847,332.29718551084,340.4364979057,348.77517523396,357.06148706459,365.80737813473,374.49834647311,383.67133729641,392.78672100419,402.40767098088,412.26427490957,422.0589810157,432.39692561869,442.66994710331,453.51274088813,464.62111626441,475.65973015548,487.31057837675,498.88825560972,511.10806227553,523.2511306012],"description":"Cycle of 29 fifths 1/14 comma positive"},"temp29ebf":{"frequencies":[261.6255653006,267.97141371953,274.40384216744,281.08918054527,287.86573007783,294.90872015661,302.04780073409,309.28428172011,316.80528774769,324.42890571749,332.35226986162,340.383734589,348.52477529448,356.98590767403,365.56247629567,374.47626314535,383.51165984234,392.90231649713,402.42108995343,412.06973029551,422.09773822292,432.26256191617,442.8270465847,453.53566813958,464.39038927288,475.67189906986,487.10732348594,498.99237046175,511.03956815915,523.2511306012],"description":"Cycle of 29 equal beating fifths"},"temp29fo":{"frequencies":[261.6255653006,267.94780983951,274.42283293416,281.05432651499,287.84607006616,294.80193939197,301.92589896847,309.2220107369,316.69443479624,324.34743177532,332.18536334326,340.21270232633,348.43402388135,356.85401564372,365.47747852664,374.30932945854,383.35460418662,392.61845788025,402.10617708826,411.82316930666,421.77497497272,431.96726840975,442.4058610624,453.0967048103,464.04589268124,475.25967298378,486.74443697706,498.50673304697,510.55326782272,522.89091000079],"description":"Fifth beats with opposite equal rate as octave"},"temp31c51":{"frequencies":[261.6255653006,267.17944246504,273.80687224646,279.61933836952,286.55534345926,292.63843680803,298.85066583755,306.26370726525,312.76517639908,319.40466275447,327.32754956004,334.27616903285,342.56794607269,349.84009583671,357.26662128823,366.1286782788,373.90098334082,383.17565840352,391.30984260196,399.61670205031,409.52926208827,418.22288720188,428.59697681668,437.69538032917,446.98692528774,458.07451174337,467.79867446983,477.72926229583,489.57941763243,499.97237729845,512.37427391379,523.2511306012],"description":"Cycle of 31 51/220-comma tempered fifths (twice diff. of 31-tET and 1/4-comma)"},"temp31coh":{"frequencies":[261.6255653006,267.17903658035,272.71444919697,278.8328003927,286.67318542907,292.31259119845,298.22448926086,305.9625493141,312.79375273624,319.37019903425,325.99008611032,333.53448283298,342.55073731576,349.35067604096,356.49690427728,365.94514964733,373.94225818849,381.74854907994,389.68867781295,401.66236977474,409.34549662494,417.52928752537,426.20510506248,437.61344561246,447.02040600938,456.30467151405,466.17931462488,479.8608061495,489.18804557359,499.02680928636,509.58872491278,523.2511306012],"description":"Differential coherent 31-tone scale, interval=8, OdC, 2003"},"temp31eb1":{"frequencies":[261.6255653006,267.35556661283,273.21106374578,279.19480525048,287.36432599524,293.65804565963,300.08960744161,306.66203029506,313.37839929357,320.24186707858,327.25565533923,334.42305632458,341.74743438901,349.23222958864,356.8809512704,367.32364464292,375.36859607341,383.58974428421,391.99094825517,400.57615379751,409.34938620036,418.31476585427,427.47650107887,436.83889236244,446.40633438056,459.46863260649,469.5317006585,479.81516534138,490.32385367952,501.06269841655,512.03674033076,523.2511306012],"description":"Cycle of 31 thirds, 3/2 beats equal 5/4. Third 1/18 synt. comma higher"},"temp31eb1a":{"frequencies":[261.6255653006,267.52830363402,273.56421824856,279.73631545395,286.19123047598,292.64821393201,299.25087842544,306.00251077972,312.90647197491,319.96619882071,327.18520755731,334.56708808783,342.11551697966,349.83425186023,357.90667665031,365.98168819447,374.23888853079,382.68238383924,391.31637942763,400.14517332125,409.17316051655,418.40483516889,427.84479530109,437.49773526159,447.36846272566,457.69148927209,468.01782376277,478.57713873597,489.37469064597,500.41585743254,511.7061296998,523.2511306012],"description":"Cycle of 31 thirds, 5/4 beats equal 7/4"},"temp31eb2":{"frequencies":[261.6255653006,267.43633367564,273.37616065041,279.44791264824,286.8151286113,293.18536340431,299.69708268426,306.35342885652,313.15761412007,320.11292201761,327.22270902014,334.4904061467,341.91952062013,349.51363755953,357.2764217104,366.69546492458,374.83986170174,383.16514754137,391.67534003419,400.37454600262,409.26696348258,418.35688374945,427.64869338884,437.14687641357,446.85601642745,458.63669049374,468.82312458207,479.23580188553,489.87974732177,500.7600974131,511.88210276525,523.2511306012],"description":"Cycle of 31 thirds, 3/2 beats twice 5/4"},"temp31eb2a":{"frequencies":[261.6255653006,267.30377559621,273.10522335955,279.03258328435,287.71713441117,293.9616250555,300.34164347605,306.86013111019,313.520093235,320.3246003528,327.27678960683,334.37986622751,341.63710501026,349.05185182525,356.62752721996,367.72712485201,375.70811839104,383.86232802855,392.19351543866,400.70551714108,409.40225971792,418.28775270674,427.36609266644,436.64146506587,446.11814621352,460.00303307438,469.98674378481,480.18713671772,490.60891465214,501.25688243424,512.13594919255,523.2511306012],"description":"Cycle of 31 thirds, 5/4 beats twice 3/2"},"temp31eb2b":{"frequencies":[261.6255653006,267.52098517401,273.5492512983,279.71335720518,286.24081966732,292.69091492047,299.28635537219,306.03041620307,312.92644639599,319.97787039914,327.18818982659,334.56098519707,342.09991771207,349.80873107384,357.97195918064,366.0384300542,374.28666922186,382.72077261519,391.34492846269,400.16341936959,409.18062444454,418.40102147414,427.82918914659,437.46980932536,447.32766937413,457.76662230541,468.08184681118,478.62951259033,489.41485742956,500.44323714283,511.72012823096,523.2511306012],"description":"Cycle of 31 thirds, 5/4 beats twice 7/4 (7/4 beats twice 5/4 gives 31-tET)"},"temp31ebf":{"frequencies":[261.6255653006,267.58895287558,273.47207673981,279.84020613447,286.1226232561,292.32048149598,299.02929415269,305.64780689513,312.81195283539,319.87967238294,326.85226402826,334.39967773649,341.84550545999,349.90516819854,357.85635261941,365.7005167875,374.19135817901,382.56791460144,390.83172556312,399.77680617055,408.60149248083,418.153686518,427.57731316062,436.87410111252,446.93731687602,456.86508723973,467.61130449655,478.21288647115,488.67177324268,499.99289085438,511.16163412976,523.2511306012],"description":"Cycle of 31 equal beating fifths"},"temp31ebf2":{"frequencies":[261.6255653006,268.47208070676,273.9410776603,281.1098810272,286.83632036086,292.67941197057,300.33857976184,306.45672349367,312.69950064833,320.88257689406,327.41921873353,335.98749730659,342.8318387903,349.81560715632,358.96997989875,366.28249344322,375.86779039798,383.5245262314,391.33723606718,401.57819634767,409.75867428285,420.48170539436,429.04726334649,437.78730875453,449.24382765192,458.39529367535,467.73318258368,479.97335657757,489.75080836323,502.56716753771,512.80487382351,523.2511306012],"description":"Cycle of 31 fifths, 3/2 beats equal 7/4"},"temp31ebs":{"frequencies":[261.6255653006,267.49970467488,273.5255021102,279.70687352555,286.04783307233,292.55250379055,299.22511217624,305.93841412724,312.82503848113,319.88946348152,327.13627425327,334.57018402367,342.19602042672,349.86836735032,357.73879552978,365.81242398075,374.09449397971,382.59039112658,391.30563169636,400.0740276901,409.06880268892,418.29580572823,427.76103041037,437.4706255228,447.4309015606,457.4519243295,467.73166961576,478.27681510244,489.09421437332,500.19089295757,511.57406697079,523.2511306012],"description":"Cycle of 31 equal beating sevenths"},"temp31ebs1":{"frequencies":[261.6255653006,267.15774161678,272.80689957055,278.57550963341,287.00766304701,293.07655388437,299.27377555355,305.60203820353,312.06411627904,318.6628357552,328.30838543699,335.25059642555,342.33960321815,349.5785118895,356.97048813578,364.51877275634,375.55232561156,383.49353066309,391.60265342908,399.88324912115,408.33893898267,416.9734277591,429.59472356821,438.6786743379,447.954711436,457.42689142912,467.09936712211,476.97636845082,491.41388278482,501.80502418824,512.41589335668,523.2511306012],"description":"Cycle of 31 sevenths, 3/2 beats equal 7/4. 17/9 schisma fifth"},"temp31ebs2":{"frequencies":[261.6255653006,267.52957387699,273.56681763873,279.74030009523,286.13080593576,292.58781532731,299.19053769144,305.94226304679,312.84635035505,319.90623967996,327.21431324819,334.59843914397,342.14920188821,349.87035796113,357.76575454309,365.83932576918,374.19671203989,382.64107477964,391.27599615891,400.10577865514,409.13482199124,418.3676180873,427.92498506647,437.58181190976,447.45656083737,457.55415226032,467.87960969795,478.43807796233,489.36771995709,500.41110255739,511.70370009509,523.2511306012],"description":"Cycle of 31 sevenths, 3/2 beats twice 7/4. Almost 31-tET"},"temp31ebsi":{"frequencies":[261.6255653006,267.31506098272,273.2139312212,279.32987994092,285.67089487749,292.24525964349,299.06156112772,306.12870201667,312.71376833043,319.5411631371,326.61980701828,333.95894503443,341.56816427739,349.45740040562,357.63696227352,366.11753111539,374.01961057916,382.2124855973,390.7068565555,399.51382386635,408.64488423766,418.11197066674,427.92744450622,438.10412760018,447.58662182594,457.41807184609,467.61131789159,478.17967690081,489.136951815,500.49745466086,512.27602199232,523.2511306012],"description":"Cycle of 31 equal beating major sixths"},"temp31ebt":{"frequencies":[261.6255653006,267.508686718,273.53300221315,279.70190221389,286.0188552526,292.48741633838,299.11122072338,305.89399777728,312.83956126154,319.95181832117,327.23477005018,334.588671338,342.11906613961,349.83019225353,357.72638299858,365.81208378543,374.09184045976,382.57031224079,391.25226584136,400.14258695229,409.24627647794,418.43865241641,427.85164834976,437.49055334209,447.36079317794,457.46791872903,467.81761394993,478.41570188597,489.26814549043,500.38104816704,511.76065992154,523.2511306012],"description":"Cycle of 31 equal beating thirds"},"temp31g3":{"frequencies":[261.6255653006,266.21023205793,270.87523947024,275.62199471997,289.25983723073,294.32876096318,299.48651076576,304.73464409936,310.07474405997,315.5084236529,331.11985608357,336.92232427465,342.82647426905,348.83408706747,354.94697625466,361.16698614085,379.03761443004,385.6797831671,392.4383479509,399.31534788729,406.31285900225,413.43299207996,433.88975562921,441.49314144476,449.22976592409,457.10196592055,465.11211608996,473.26263524279,496.67978412536,505.38348615935,514.23971114652,523.2511306012],"description":"Wonder Scale, cycle of 31 sevenths tempered by 1/3 gamelan residue, s.wonder1"},"temp31g4":{"frequencies":[261.6255653006,266.75106828164,271.97698492363,277.30528403104,287.97116616014,293.61280545832,299.36497003718,305.22982618403,311.20958045219,317.30648321666,329.51091606373,335.96636137331,342.54827390456,349.25913259695,356.10146388137,363.07784268567,377.0427625798,384.42940207435,391.96075366681,399.63965159508,407.46898671086,415.4517078616,431.43106138252,439.88322158593,448.50096908674,457.28754710584,466.24626137824,475.38048570318,493.66485502092,503.33623955776,513.19709315346,523.2511306012],"description":"Cycle of 31 sevenths tempered by 1/4 gamelan residue"},"temp31g5":{"frequencies":[261.6255653006,267.07609791103,272.64018328418,278.3201871026,287.20071989568,293.1840695693,299.2920706603,305.52732176658,311.89247392994,318.39023342226,328.54930692245,335.39408374843,342.38146206091,349.5144087687,356.79595852417,364.22920722399,375.85089312601,383.68111960674,391.67447579625,399.83436022994,408.16424460367,416.66766586736,429.96253800336,438.92009035289,448.06425836543,457.39892986705,466.92807368021,476.65574406444,491.86469103391,502.11187209711,512.57253609913,523.2511306012],"description":"Cycle of 31 sevenths tempered by 1/5 gamelan residue"},"temp31g6":{"frequencies":[261.6255653006,267.29300481931,273.08321314304,278.9988528944,286.68823620156,292.89859205665,299.24348036203,305.72581270733,312.34856974117,319.11478979112,327.9097940226,335.01310892782,342.27029731995,349.68469585889,357.2597060542,364.99881126821,375.05840734677,383.18307527508,391.48374080678,399.96422099622,408.62840644009,417.48028065389,428.98629965513,438.27917301224,447.77335490729,457.47320099372,467.3831713443,477.50781354513,490.66822826519,501.2972832058,512.15658610391,523.2511306012],"description":"Cycle of 31 sevenths tempered by 1/6 gamelan residue"},"temp31g7":{"frequencies":[261.6255653006,267.44804485495,273.40010374961,279.48462577409,286.32273545638,292.69485077785,299.20877758909,305.86767190621,312.6747599825,319.63333987564,327.45376040978,334.74124806474,342.19091885571,349.80638115363,357.59132564064,365.54952414453,374.49336901227,382.82772265927,391.34755742947,400.0570012071,408.96027492626,418.06169111145,428.2903432132,437.821949061,447.565680886,457.52625955954,467.70851101039,478.11736856842,489.81539667363,500.71624319167,511.85968815724,523.2511306012],"description":"Cycle of 31 sevenths tempered by 1/7 gamelan residue"},"temp31h10":{"frequencies":[261.6255653006,267.8597617245,273.71072489962,279.68949451567,286.35413084244,292.60907359238,299.00064605783,306.12544311476,312.81225819702,320.26616683613,327.26186315247,334.41036913783,342.37893460431,349.85764856047,358.19430059608,366.01847563765,374.01355928612,382.92581520849,391.29021017831,400.61414686654,409.36491649663,418.30683086326,428.27453775026,437.62950220286,447.18881072031,457.84473927605,467.84561789912,478.99376955124,489.45661357347,500.14800438647,512.06587983104,523.2511306012],"description":"Cycle of 31 fifths tempered by 1/10 Harrison's comma"},"temp31h11":{"frequencies":[261.6255653006,269.21878403965,274.22153683641,279.31725480271,287.42394184039,292.76499331753,298.20529308835,306.86017365004,312.56239683413,321.63396690808,327.61072570921,333.69854562169,343.38355445704,349.7644731902,359.91576765193,366.60389537541,373.41630725864,384.25405432087,391.39444778107,402.75397853578,410.23814647641,417.86138882164,429.98907567166,437.9793418028,446.11808436842,459.06587176894,467.59645436585,481.16761342105,490.10890120058,499.21634316923,513.70521350358,523.2511306012],"description":"Cycle of 31 fifths tempered by 1/11 Harrison's comma"},"temp31h12":{"frequencies":[261.6255653006,270.35656674398,274.64794212014,279.0074329748,288.31850430385,292.89498819461,297.54411640065,307.47379627264,312.35433239663,322.77826253379,327.90172667751,333.10651564349,344.2229903876,349.68684701428,361.35664068489,367.0924599966,372.91932620731,385.3644371109,391.48133253101,404.54589939324,410.96726244836,417.49055189439,431.4231018689,438.27108715714,445.22777061734,460.08596806997,467.38892215786,482.98668436162,490.65313915878,498.44128370652,515.07533168556,523.2511306012],"description":"Cycle of 31 fifths tempered by 1/12 Harrison's comma"},"temp31h8":{"frequencies":[261.6255653006,264.15772162327,272.31089540773,280.71571360382,283.4326348965,292.18072491748,301.19882119914,304.11398928909,313.50040506268,316.53463456122,326.30440921209,336.37572681506,339.63135730234,350.11400731728,353.50260556257,364.41338872146,375.66093089504,379.29678648678,391.00370158472,394.788050771,406.97310157871,419.5342415638,423.59472503043,436.668886633,450.14658206855,454.50334862767,468.53149836075,473.06620699858,487.66729542944,502.71904336675,507.58463809481,523.2511306012],"description":"Cycle of 31 fifths tempered by 1/8 Harrison's comma"},"temp31h9":{"frequencies":[261.6255653006,266.20804854623,273.08769296879,280.14512719472,285.05198845745,292.41861893027,299.97562432697,305.22982618403,313.11791376428,318.60230743232,326.83598255713,335.28243953396,341.15505431438,349.97156260351,356.10146388137,365.30423365264,374.74482972428,381.30864508241,391.16284711627,398.01423104415,408.30015740759,418.85190169901,426.18827121524,437.20230245522,448.50096908674,456.35665612784,468.15032961482,476.35018210031,488.66055322307,501.28905975035,510.06935121341,523.2511306012],"description":"Cycle of 31 fifths tempered by 1/9 Harrison's comma"},"temp31ms":{"frequencies":[261.6255653006,267.90457886781,273.56603860918,280.13162379381,286.05147140959,292.91670530125,299.10673210371,306.2852939563,312.75782903301,320.26401722477,327.03195662575,334.88072358477,341.95754947331,350.16453098318,357.56433846376,366.14588292411,373.88341429498,382.85661659068,390.94728541851,400.33002063726,408.78994578219,418.60090448096,427.44693588739,437.70566275183,446.9554220819,457.68235263341,467.35426952494,478.57076966998,488.68410850494,500.41252756995,510.98743222773,523.2511306012],"description":"Cycle of 31 5th root of 5/4 chromatic semitones"},"temp31mt":{"frequencies":[261.6255653006,267.90457886781,274.33428876064,280.9183116909,285.65057792122,292.50627485027,299.52642572255,306.71505845072,314.07622014281,319.36714514233,327.03195662575,334.88072358477,342.9178609508,351.14788961362,359.57543896435,365.63273925968,374.40803131735,383.39382442208,392.5952765698,402.01756125559,408.78994578219,418.60090448096,428.6473261885,438.93486201703,449.46929870544,457.04092569426,468.01003810189,479.24227945773,490.7440946167,502.52195335034,510.98743222773,523.2511306012],"description":"Cycle of 31 square root of 5/4 meantones"},"temp31to":{"frequencies":[261.6255653006,267.53589118464,273.57973594714,279.76011588387,286.08011543105,292.54288870475,299.15166280294,305.90973254237,312.82047235615,319.88733118052,327.11383586587,334.50359293692,342.06029039257,349.78769954651,357.68967690936,365.77016611333,374.03319988033,382.48290424395,391.12349182016,399.95927701915,408.9946695077,418.23417857039,427.68241536008,437.34409519915,447.22403993284,457.32718033558,467.65855857191,478.22333071276,489.02676930874,500.07426891005,511.37133726836,522.92361522538],"description":"Third beats with opposite equal rate as octave"},"temp31w10":{"frequencies":[261.6255653006,267.37376533775,273.24825962152,279.25182297475,287.24047076273,293.55146000581,300.00110689476,306.59245933664,313.32863150945,320.21280450383,327.24823031411,334.4382321302,341.78620813039,349.29562523194,356.97015906904,367.18199034811,375.24938058245,383.49402021056,391.91980359563,400.53071066429,409.33081115087,418.32425711308,427.51529892703,436.90827798988,446.50763144636,459.28102021135,469.37192694062,479.68454193593,490.22373920221,500.99449133668,512.00188868489,523.2511306012],"description":"Cycle of 31 thirds tempered by 1/10 Wuerschmidt comma"},"temp31w11":{"frequencies":[261.6255653006,267.42197848694,273.34681181717,279.40291364591,286.91265577589,293.26931399985,299.76680465545,306.40825140143,313.19684009872,320.13583435099,327.22856275086,334.47843511672,341.88893114233,349.46360748692,357.20610515709,366.80702823839,374.93377645155,383.2405741708,391.73141324262,400.41036830387,409.28161120445,418.34939984118,427.61808628905,437.09212645494,446.77606497733,458.78443573652,468.94897543376,479.33871705477,489.95864449434,500.81386326642,511.90958055231,523.2511306012],"description":"Cycle of 31 thirds tempered by 1/11 Wuerschmidt comma"},"temp31w12":{"frequencies":[261.6255653006,267.46216197987,273.42896553533,279.52888390694,286.63976159726,293.03439921138,299.57169286871,306.25482853931,313.08705807777,320.0717057658,327.2121755928,334.51194000906,341.9745565771,349.60365642833,357.40295156876,366.49485373999,374.67097398132,383.02949720151,391.57448819698,400.31011139524,409.24061734241,418.37035125513,427.70376253715,437.24539007841,446.99988402026,458.37102198078,468.59680699416,479.0507177135,489.73784363297,500.66339010461,511.83267129957,523.2511306012],"description":"Cycle of 31 thirds tempered by 1/12 Wuerschmidt comma"},"temp31w13":{"frequencies":[261.6255653006,267.49616787535,273.49850059869,279.63551774138,286.40905375482,292.83577174957,299.40669857094,306.12507001426,312.99419468163,320.01745343487,327.19830857776,334.54029455907,342.04702698539,349.72220057363,357.56974544479,366.23091133098,374.44874787361,382.85098402684,391.44175752404,400.22529663315,409.2059314354,418.38808223908,427.77627085136,437.37511801764,447.18935574711,458.02150335998,468.29902426597,478.80716193382,489.55109116118,500.53609997149,511.7676037195,523.2511306012],"description":"Cycle of 31 thirds tempered by 1/13 Wuerschmidt comma"},"temp31w14":{"frequencies":[261.6255653006,267.52531966849,273.55811412425,279.72695193191,286.21145362846,292.66562728487,299.26534666214,306.01389218024,312.91461811683,319.97095981222,327.18642276261,334.56459899164,342.10915585471,349.82384327668,357.71250180664,366.00482869479,374.25837321367,382.69803863807,391.32802257119,400.15261355898,409.17620468607,418.4030501472,427.83842920638,437.48634583318,447.35182400506,457.72212848121,468.04393370572,478.5984967348,489.39107187298,500.42702361787,511.71183724724,523.2511306012],"description":"Cycle of 31 thirds tempered by 1/14 Wuerschmidt comma"},"temp31w15":{"frequencies":[261.6255653006,267.55058630145,273.60979095449,279.80621811014,286.0403087015,292.51824916652,299.142895223,305.91756930507,312.84566908988,319.93066920159,327.176122954,334.58566413263,342.16300881716,349.91195724514,357.83639571789,365.80900091179,374.09345893182,382.56553686518,391.22947931103,400.08963362509,409.15044340767,418.41645289306,427.89230922859,437.58276480531,447.49267964143,457.46282942114,467.82296651709,478.41773025336,489.25243249537,500.33250769337,511.66351279634,523.2511306012],"description":"Cycle of 31 thirds tempered by 1/15 Wuerschmidt comma, almost 31-tET"},"temp31w8":{"frequencies":[261.6255653006,267.24122592191,272.97742543896,278.83674800471,288.14389744169,294.32876096318,300.64638059818,307.09960331181,313.69134300364,320.42456924675,327.30232268102,334.32770172848,341.50387698892,348.83408706747,356.32163474066,368.21511264804,376.11866406852,384.19186344763,392.4383479509,400.86184099795,409.46613795376,418.25512179799,427.23275920923,436.40309460541,445.77026919414,460.64940473745,470.53701427025,480.63685362987,490.95348377613,501.49155234204,512.25581818623,523.2511306012],"description":"Cycle of 31 thirds tempered by 1/8 Wuerschmidt comma"},"temp31w9":{"frequencies":[261.6255653006,267.31485098896,273.12785536516,279.06726965397,287.64164332106,293.89667226994,300.28772424256,306.81775371411,313.48978461115,320.30690488373,327.27226963218,334.38910256736,341.66069947616,349.09042189481,356.68171037974,367.64079770339,375.63548096925,383.80401588848,392.15018302326,400.67784514756,409.39095139962,418.29352970104,427.38970265849,436.68368016368,446.1797636563,459.88868900496,469.88938665048,480.10755840871,490.54793493862,501.21534712998,512.11473036853,523.2511306012],"description":"Cycle of 31 thirds tempered by 1/9 Wuerschmidt comma"},"temp32ebf":{"frequencies":[261.6255653006,266.99024669658,272.64192755012,278.59596223891,284.86852586219,291.47665855944,298.4383110444,304.47357861204,310.83171904039,317.53000821614,324.58664278196,332.02079024875,339.85265231199,346.64232633314,353.79523650997,361.33080945807,369.26952339658,377.6329406438,386.44378308989,395.72598875513,403.77301123196,412.25053247262,421.18158418009,430.59042797451,440.50262726312,450.945108697,459.9980085603,469.53522100534,479.58265227668,490.16760508681,501.31882698223,513.0666164148,523.2511306012],"description":"Cycle of 32 equal beating fifths"},"temp33a12":{"frequencies":[261.6255653006,266.94139439278,272.36523138282,277.89927397158,284.73748648557,290.5229142688,296.42589304627,302.44880952638,308.5941041528,316.1876182869,322.61206437627,329.16704532903,335.85521147284,342.67927280589,351.11151394887,358.24555988319,365.52455654698,372.95145333883,382.12859604556,389.89286138208,397.81488464837,405.89786889835,414.14508930077,424.3358756666,432.95772800787,441.75476312782,450.73053786756,459.88868900496,471.20507923536,480.77924170569,490.54793493862,500.51511311891,512.83118959171,523.2511306012],"description":"Cycle of 33 fifths tempered by 1/12 \"11 fifths\" comma"},"temp34eb2a":{"frequencies":[261.6255653006,267.30377714022,273.10522651459,279.03258811962,285.08859470169,291.27603831759,293.96161656556,300.34163653669,306.86012579271,313.52008961307,320.32459850253,327.27678960683,334.37986815896,341.63710895701,349.05185787385,356.62753339984,364.36762821878,372.27571081823,375.70810971034,383.86232137672,392.19350864246,400.70551251195,409.40225735312,418.28775270674,427.36609513501,436.64147011015,446.11815394416,455.80051576031,465.69301950749,469.98673021106,480.18712562304,490.60890615053,501.2568766435,512.13594623433,523.2511306012],"description":"Cycle of 34 thirds, 5/4 beats twice 3/2"},"temp34ebsi":{"frequencies":[261.6255653006,266.99788221884,272.57696520339,278.14698300137,283.93137567849,289.70637009331,295.70363067102,301.69114426564,307.90910207865,314.36637542255,320.81315450625,327.50805511637,334.19207543599,341.13334896852,348.06334108321,355.26005273528,362.44506998142,369.90662102486,377.65534755435,385.39148338011,393.42536256589,401.44618836017,409.77571602141,418.09170597447,426.72775997548,435.3497813463,444.30364141769,453.60211446558,462.88547695756,472.52613162558,482.15112257833,492.14655599832,502.125745683,512.48900933996,523.2511306012],"description":"Cycle of 34 equal beating major sixths"},"temp34ebt":{"frequencies":[261.6255653006,266.93199967636,272.36578831151,277.92998813547,283.62773001764,289.46221547291,295.43672985114,301.55463262869,307.81936583026,314.23445063866,320.80349820247,327.5302045997,334.16324661664,340.95548417522,347.91073392156,355.03290870525,362.32601803901,369.79415983503,377.44153922514,385.2724539348,393.29131162714,401.50262139782,409.91100286066,418.20230551726,426.69260242977,435.3866631899,444.28938530291,453.40576935587,462.74094691381,472.3001707563,482.08881469934,492.11238732973,502.37652397446,512.8870010249,523.2511306012],"description":"Cycle of 34 equal beating thirds"},"temp34w10":{"frequencies":[261.6255653006,267.37376533775,273.24825962152,279.25182297475,281.06516151868,287.24047076273,293.55146000581,300.00110689476,306.59245933664,313.32863150945,320.21280450383,327.24823031411,334.4382321302,341.78620813039,349.29562523194,351.5637974276,359.28803828513,367.18199034811,375.24938058245,383.49402021056,391.91980359563,400.53071066429,409.33081115087,418.32425711308,427.51529892703,436.90827798988,446.50763144636,449.40705529895,459.28102021135,469.37192694062,479.68454193593,490.22373920221,500.99449133668,512.00188868489,523.2511306012],"description":"Cycle of 34 thirds tempered by 1/10 Wuerschmidt comma"},"temp34w5":{"frequencies":[261.6255653006,266.84400329087,272.16653090376,277.59522118835,285.18293865736,290.87125860088,296.67303727804,302.5905394405,308.62607485572,314.78199505921,321.06070411799,327.46464776022,333.99632772474,340.65828815182,347.45313114562,356.95032497057,364.07013256472,371.33195122039,378.73861781039,386.29301712643,393.99809806388,401.85686830172,409.8723892274,418.04779164423,426.38625992488,434.89105154177,443.56547936435,455.68978545099,464.77906877635,474.04965097839,483.50514461458,493.14924173292,502.98569917153,513.01835960126,523.2511306012],"description":"Cycle of 34 thirds tempered by 1/5 Wuerschmidt comma"},"temp34w6":{"frequencies":[261.6255653006,267.02047390967,272.52663052146,278.06968704778,283.80368699438,289.65592453275,295.6288411546,301.72492193478,307.94670831505,314.29679425134,320.77782174252,327.39249271371,334.14356492035,341.03384719449,348.06621207862,355.14570764395,362.46906930947,369.94344613252,377.57194788125,385.35775486011,393.30411308867,401.41432870635,409.69178284295,418.13992649314,426.76227456772,435.56242170336,444.42154779224,453.58584388327,462.93911228358,472.48525217168,482.22824196207,492.17213857029,502.32108537715,512.67931193931,523.2511306012],"description":"Cycle of 34 thirds tempered by 1/6 Wuerschmidt comma"},"temp34w7":{"frequencies":[261.6255653006,267.14659557842,272.78413659373,276.97759061533,282.82259314675,288.79093992594,294.88523549471,301.10813946365,307.46236235072,313.95067836072,320.57591524951,327.34096447962,334.24877325582,341.30235609413,348.50479124753,353.86228320674,361.3297679824,368.9548354601,376.74081403286,384.69109896591,392.80915578714,401.0985286019,409.56282802254,418.20574780595,427.03105980737,436.04260883433,442.74580331919,452.08897683944,461.62931955889,471.37098776125,481.31823237599,491.47539447856,501.84689823661,512.43727265667,523.2511306012],"description":"Cycle of 34 thirds tempered by 1/7 Wuerschmidt comma"},"temp34w8":{"frequencies":[261.6255653006,267.24122592191,272.97742543896,276.16133434798,282.08899791039,288.14389744169,294.32876096318,300.64638059818,307.09960331181,313.69134300364,320.42456924675,327.30232268102,334.32770172848,341.50387698892,348.83408706747,352.90276052629,360.47764004221,368.21511264804,376.11866406852,384.19186344763,392.4383479509,400.86184099795,409.46613795376,418.25512179799,427.23275920923,436.40309460541,441.49314144476,450.96957067185,460.64940473745,470.53701427025,480.63685362987,490.95348377613,501.49155234204,512.25581818623,523.2511306012],"description":"Cycle of 34 thirds tempered by 1/8 Wuerschmidt comma"},"temp34w9":{"frequencies":[261.6255653006,267.31485098896,273.12785536516,279.06726965397,281.5197407082,287.64164332106,293.89667226994,300.28772424256,306.81775371411,313.48978461115,320.30690488373,327.27226963218,334.38910256736,341.66069947616,349.09042189481,352.15826244648,359.81626391233,367.64079770339,375.63548096925,383.80401588848,392.15018302326,400.67784514756,409.39095139962,418.29352970104,427.38970265849,436.68368016368,440.52130132575,450.10083737825,459.88868900496,469.88938665048,480.10755840871,490.54793493862,501.21534712998,512.11473036853,523.2511306012],"description":"Cycle of 34 thirds tempered by 1/9 Wuerschmidt comma"},"temp35ebsi":{"frequencies":[261.6255653006,266.57889315685,271.71450319234,277.03910343536,282.55964921963,288.28335166643,294.21768457231,300.3704033182,306.74954035112,312.48255822683,318.42655208483,324.58928450704,330.97880464114,337.6034601246,344.47190142434,351.59310182482,358.97636423712,366.63132974323,373.51095055492,380.64374131787,388.03901984907,395.70644562254,403.65603146762,411.89816253905,420.4436041444,429.30351656419,438.48947534443,446.74502047858,455.30437022365,464.17870575399,473.37961532931,482.91911915131,492.80967579032,503.06420520117,513.69610107468,523.2511306012],"description":"Cycle of 35 equal beating major sixths"},"temp37ebs":{"frequencies":[261.6255653006,266.54882370674,271.76117582243,276.81154351547,282.15846820925,287.3392230449,292.82419544994,298.13870690002,303.76528724985,309.7222634282,315.49411047005,321.60488016898,327.52574544851,333.79428377068,339.86801168664,346.29839044807,353.1063601343,359.70275861181,366.68649693083,373.45319917734,380.61724149647,387.55864668979,394.907650003,402.68818871569,410.22692643911,418.2083422233,425.94171605945,434.12919568644,442.06222705415,450.46108885682,459.35313199837,467.96883572953,477.09045247204,485.92859505436,495.28571063961,504.35203618851,513.95073426779,523.2511306012],"description":"Cycle of 37 equal beating sevenths"},"temp37ebt":{"frequencies":[261.6255653006,266.44794669373,271.38606435347,276.44269655507,281.62068893017,286.92295259461,292.35247205526,297.91229840101,303.60556084342,309.43546158348,315.40528084,321.51837488336,327.7781831369,333.8061589736,339.9788066307,346.29959662983,352.77208770341,359.39991652139,366.18681567584,373.13659908053,380.25317623321,387.54055229398,395.00282568127,402.64419215928,410.46895395112,418.00392297279,425.71973353547,433.62072344005,441.71133574434,449.99612361773,458.47974493329,467.16697490003,476.06269518051,485.17191513214,494.49975815874,504.05146656861,513.83241864047,523.2511306012],"description":"Cycle of 37 equal beating thirds"},"temp3ebt":{"frequencies":[261.6255653006,330.24866439584,416.02753826489,523.2511306012],"description":"Cycle of 3 equal beating thirds"},"temp4ebmt":{"frequencies":[261.6255653006,310.36356181711,368.84915763691,439.03187262068,523.2511306012],"description":"Cycle of 4 equal beating minor thirds"},"temp4ebsi":{"frequencies":[261.6255653006,310.92686529443,370.08842528703,441.08229727815,523.2511306012],"description":"Cycle of 4 equal beating major sixths"},"temp53ebs":{"frequencies":[261.6255653006,264.97369574946,268.51842903659,272.2713107977,275.7058824095,279.342132921,283.19190440533,286.71515038985,290.44528277978,294.39444663109,298.00865518834,301.83509073593,305.88621462445,310.17522146598,314.10044576101,318.25616227247,322.65590013911,326.68246801001,330.94547393755,335.45880590636,339.58933056423,343.96239778214,348.59225483118,353.4939765515,357.97994689961,362.72933676467,367.75761084241,372.35940104854,377.23140801172,382.38950169412,387.11009989437,392.10789272021,397.3991578827,403.00112480292,408.12795020911,413.55582307376,419.3024201087,424.56160969567,430.12961973912,436.02458225248,441.41955172249,447.13131541518,453.17847579573,459.58072182695,465.43995070361,471.64323472325,478.21077610462,484.22127701861,490.5847168482,497.32181757346,503.48749858841,510.01522804676,516.92626488088,523.2511306012],"description":"Cycle of 53 equal beating harmonic sevenths"},"temp53ebsi":{"frequencies":[261.6255653006,265.08815342092,268.54511416675,272.14096825888,275.73097879106,279.31515577755,283.04333763043,286.76545980208,290.48153462492,294.34691329876,298.20601137227,302.05883614112,306.06646174912,310.06757319581,314.22944103195,318.38454699407,322.53289853772,326.84792360782,331.1559371129,335.45694960827,339.93076775401,344.39731584765,348.85660497561,353.49505873963,358.12597594237,362.74936749482,367.55851619873,372.35985057275,377.35409330215,382.34021841275,387.3182413058,392.49627136254,397.66588656991,402.8271015422,408.19568270781,413.55554119639,418.90668980097,424.47283359145,430.02993471298,435.57800299537,441.34898312942,447.11058430799,453.10367443873,459.08702461554,465.06065502782,471.27428848056,477.47782740925,483.67128540638,490.11358366391,496.54541154487,502.96678854317,509.64616466331,516.31468511822,523.2511306012],"description":"Cycle of 53 equal beating major sixths"},"temp53ebt":{"frequencies":[261.6255653006,265.06408390481,268.61942739596,272.14046995187,275.78114176924,279.3866896354,283.11473715719,286.8068186786,290.62433945466,294.40503066492,298.31417332138,302.18560037327,306.18856199636,310.15290198883,314.25193588094,318.31142144389,322.50883104059,326.66574402863,330.9638909587,335.40807143415,339.80937339101,344.36021509659,348.86714800611,353.52720940583,358.14231011275,362.91421253104,367.64007568808,372.5265022753,377.36578530136,382.3694885676,387.32491504393,392.44870495902,397.52306357866,402.76982394565,407.96596497751,413.33865052838,418.89387526617,424.39550434456,430.08405345947,435.71772111176,441.54279782575,447.31167294612,453.27655186057,459.18388087721,465.29191391782,471.34101945319,477.59564801313,483.78993007475,490.19466758193,496.53761595054,503.09606844751,509.59124455492,516.30709807412,523.2511306012],"description":"Cycle of 53 equal beating thirds"},"temp57ebs":{"frequencies":[261.6255653006,264.8277951114,268.04955507264,271.33445958124,274.63939933433,278.00911284632,281.39937814535,284.85609135359,288.33388628378,291.8798428433,295.4474281527,299.08493440323,302.74462553584,306.42663750246,310.18081323211,313.95788745209,317.80898926922,321.68357852782,325.63410692083,329.60872876069,333.66125215256,337.73849074816,341.89564167341,346.07814569972,350.28615866377,354.57664765081,358.89330206442,363.2945606359,367.72266219717,372.23755268366,376.77997919433,381.41143316036,386.07113633698,390.82216502962,395.60217018381,400.41132814233,405.3147417445,410.24806349136,415.27807310888,420.33876095689,425.4986359826,430.68997922537,435.98307052812,441.30844296951,446.73819252663,452.20105472878,457.69723413281,463.30113726238,468.93921588924,474.68780077646,480.47144432851,486.36844238798,492.30140788993,498.35065469266,504.4367956254,510.6422225112,516.88549425379,523.2511306012],"description":"Cycle of 57 equal beating harmonic sevenths"},"temp59ebt":{"frequencies":[261.6255653006,264.71774803536,267.84005552541,271.00645194849,274.20369404321,277.44608402629,280.72006081878,284.04026812198,287.39281927261,290.79271098314,294.22572486522,297.70721418515,301.22261902261,304.78766466692,308.38743972219,312.03804524126,315.72421513091,319.46243532331,323.23707283878,327.06501147453,330.93024062011,334.83312418563,338.79111909993,342.78767359614,346.84065928187,350.93313112856,355.08338946648,359.27407840069,363.52394351295,367.81521017702,372.16707169716,376.56132871014,381.01763522853,385.51735474883,390.08061088885,394.68832388107,399.36109834092,404.07939600279,408.86431870994,413.69585627072,418.57446131049,423.52195428502,428.51764625978,433.58387848862,438.69946807471,443.88729218006,449.12565432864,454.4379830027,459.80206875391,465.24189440938,470.73471441434,476.30509804765,481.92974808423,487.63381799831,493.39345924022,499.23442935246,505.13230099895,511.11345315981,517.15287439575,523.2511306012],"description":"Cycle of 59 equal beating thirds"},"temp5ebf":{"frequencies":[261.6255653006,300.99242152138,345.28013476976,397.76927639746,456.81956072863,523.2511306012],"description":"Cycle of 5 equal beating fifths"},"temp5ebs":{"frequencies":[261.6255653006,300.72264357012,345.40501873528,396.4705903526,454.83124362955,523.2511306012],"description":"Cycle of 5 equal beating harmonic sevenths"},"temp6":{"frequencies":[261.6255653006,292.50629174609,327.17562781541,373.91502405318,418.23333786749,467.5991148023,523.2511306012],"description":"Tempered wholetone scale with approximations to 5/4 (4), 7/5 (4) and 7/4 (1)"},"temp65ebf":{"frequencies":[261.6255653006,264.41601755103,267.24454169377,270.11165630441,273.01788702098,275.96376822181,278.903505094,281.88335012505,284.90384796088,287.96555727487,291.06903608099,294.16604397209,297.30530343106,300.48739162418,303.71289539257,306.98240612292,310.29652144782,313.60372560746,316.95605020285,320.35411162765,323.7985328567,327.28994911888,330.77408078649,334.30574717623,337.88559766085,341.51429052286,345.19248907458,348.92086961342,352.64147345074,356.41283883338,360.23565716142,364.11063345825,368.0384739541,371.95812372083,375.93124824951,379.95858022583,384.04085801267,388.17883226226,392.30817269042,396.49385281186,400.73664000181,405.03730976228,409.39665754461,413.81548025993,418.22508312451,422.69484912531,427.22559773342,431.81816208034,436.47338166162,441.11888946365,445.82778005125,450.60091414809,455.43916939942,460.34343547357,465.31460883154,470.27541574397,475.30390033467,480.4009926512,485.56762723834,490.80474851567,496.03094699932,501.32844669322,506.69822455894,512.14126217109,517.65855736571,523.2511306012],"description":"Cycle of 65 equal beating fifths"},"temp65ebt":{"frequencies":[261.6255653006,264.43406811535,267.2034679247,270.07937559507,272.91523803531,275.86016780291,278.76409255008,281.77970028627,284.75331888701,287.84130158502,290.886287826,294.04838131756,297.16644728835,300.4044304772,303.59732911309,306.91302510559,310.18255295306,313.57782661988,316.92582314139,320.40258196387,323.83093239735,327.39113302053,330.90176198948,334.36350914498,337.95839429282,341.50322405771,345.18438591943,348.81429298672,352.58380229516,356.30082494405,360.1608038988,363.96703524466,367.91965255368,371.81723365001,375.86471396542,379.85583700975,384.00045811272,388.08736764479,392.33145942297,396.5164558179,400.86240365726,405.1478399234,409.59809307723,413.98637838791,418.31356254814,422.80716945583,427.23820566351,431.83965831621,436.37704077554,441.08892851835,445.73520856761,450.56017999004,455.31796985254,460.25874195194,465.13071889642,470.19006822446,475.1789734801,480.35974823468,485.46838574269,490.77349931217,496.0047455553,501.43718079349,506.7939752079,512.35679191473,517.84214996629,523.2511306012],"description":"Cycle of 65 equal beating thirds"},"temp6eb2":{"frequencies":[261.6255653006,293.46010680596,329.2739659995,369.56455759223,414.89147313404,465.88425311859,523.2511306012],"description":"Cycle of 6 equal beating 9/8 seconds"},"temp6s":{"frequencies":[261.6255653006,271.93638072959,309.96730300827,353.31693843766,402.72911708552,459.05170412301,523.2511306012],"description":"Cycle of 6 tempered harmonic sevenths, 6/5 and 4/3 minimax, Op de Coul, 2002"},"temp6teb":{"frequencies":[261.6255653006,314.31996068356,377.55323514312,453.43316449459,544.48907971635,653.75617798246,784.8766959018],"description":"Cycle of 6 equal beating 6/5's in a twelfth"},"temp7-5ebf":{"frequencies":[261.6255653006,272.53310095338,288.29512120063,313.54121701986,318.29837158817,352.05202827415,359.67534615791,387.61143614087,414.35283422339,427.61576999092,475.86500581459,472.62064557223,523.2511306012],"description":"7 equal beating fifths on white, 5 equal beating fifths on black"},"temp7ebf":{"frequencies":[261.6255653006,288.29512120063,318.29837158817,352.05202827415,387.61143614087,427.61576999092,472.62064557223,523.2511306012],"description":"Cycle of 7 equal beating fifths"},"temp7ebnt":{"frequencies":[261.6255653006,288.84289825546,318.65722544634,351.9228541964,388.36258888271,429.02057812008,473.55803233064,523.2511306012],"description":"Cycle of 7 equal beating 11/9 neutral thirds"},"temp8eb3q":{"frequencies":[261.6255653006,285.27029088455,311.06453578321,339.20371183191,369.9009952302,403.38894083349,439.92124473489,479.77466958441,523.2511306012],"description":"Cycle of 8 equal \"beating\" 12/11's"},"temp9ebmt":{"frequencies":[261.6255653006,282.57058469242,305.18178513943,329.6176429161,355.99737593287,384.50587463168,415.28223014648,448.54214811156,484.4478959333,523.2511306012],"description":"Cycle of 9 equal beating 7/6 septimal minor thirds"},"tenney_11":{"frequencies":[261.6255653006,277.97716313189,294.32876096318,310.68035879446,327.03195662575,343.38355445704,359.73515228832,392.4383479509,408.78994578219,425.14154361347,457.84473927605,523.2511306012],"description":"Scale of James Tenney's \"Spectrum II\" for wind quintet"},"tertiadia":{"frequencies":[261.6255653006,279.06726965397,297.67175429757,306.59245933664,327.03195662575,348.83408706747,372.08969287196,392.4383479509,418.60090448096,431.14564594215,459.88868900496,490.54793493862,523.2511306012],"description":"Tertiadia 2048/2025 and 262144/253125 scale"},"tertiadie":{"frequencies":[261.6255653006,279.06726965397,297.67175429757,306.59245933664,327.03195662575,348.83408706747,372.08969287196,383.2405741708,408.78994578219,436.04260883433,476.27480687611,490.54793493862,523.2511306012],"description":"First Tertiadie 262144/253125 and 128/125 scale"},"tet3a":{"frequencies":[261.6255653006,280.31310567921,313.95067836072,336.37572681506,366.27579142084,392.4383479509,418.60090448096,448.50096908674,523.2511306012],"description":"Eight notes, two major one minor tetrad"},"tetracot":{"frequencies":[261.6255653006,266.81074454173,272.09868928948,277.49143626213,289.66902367154,295.4099985897,301.26475437609,307.23554606336,320.71844041089,327.07478634962,333.55710924695,340.16790585091,355.09602205939,362.13370020095,369.31085868177,376.6302618745,393.15851224787,400.95055410677,408.89702710335,417.00099192139,435.30089370336,443.92815899023,452.72640877864,461.69903182491,481.96048707062,491.51250279099,501.25383072009,523.2511306012],"description":"tetracot temperament, g=176.28227, 5-limit"},"tetragam-di":{"frequencies":[261.6255653006,279.06726965397,290.69507255622,290.69507255622,327.03195662575,348.83408706747,372.08969287196,392.4383479509,418.60090448096,436.04260883433,436.04260883433,457.84473927605,523.2511306012],"description":"Tetragam Dia2"},"tetragam-enh":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,279.06726965397,327.03195662575,348.83408706747,366.27579142084,392.4383479509,406.97310157871,418.60090448096,418.60090448096,457.84473927605,523.2511306012],"description":"Tetragam Enharm."},"tetragam-hex":{"frequencies":[261.6255653006,271.31540105247,294.32876096318,305.22982618403,327.03195662575,343.38355445704,381.53728273004,392.4383479509,406.97310157871,436.04260883433,457.84473927605,490.54793493862,523.2511306012],"description":"Tetragam/Hexgam"},"tetragam-py":{"frequencies":[261.6255653006,275.62199471997,294.32876096318,294.32876096318,331.11985608357,348.83408706747,372.50983809402,392.4383479509,413.43299207996,441.49314144476,441.49314144476,465.11211608996,523.2511306012],"description":"Tetragam Pyth."},"tetragam-slpe":{"frequencies":[261.6255653006,261.6255653006,300.52885648597,300.52885648597,279.06726965397,345.21700307457,348.83408706747,396.55020354877,455.51656649021,392.4383479509,455.51656649021,418.60090448096,523.2511306012],"description":"Tetragam Slendro as 5-tET, Pelog-like pitches on C# E F# A B"},"tetragam-slpe2":{"frequencies":[261.6255653006,261.6255653006,300.52885648597,300.52885648597,286.29520819723,345.21700307457,313.29104303136,396.55020354877,396.55020354877,387.04559340587,455.51656649021,423.54155496477,523.2511306012],"description":"Tetragam Slendro as 5-tET, Pelog-like pitches on C# E F# A B"},"tetragam-sp":{"frequencies":[261.6255653006,271.31540105247,271.31540105247,271.31540105247,336.37572681506,348.83408706747,366.27579142084,392.4383479509,406.97310157871,406.97310157871,406.97310157871,457.84473927605,523.2511306012],"description":"Tetragam Septimal"},"tetragam-un":{"frequencies":[261.6255653006,269.80136421624,285.40970760065,285.40970760065,319.76457981184,348.83408706747,359.73515228832,392.4383479509,404.70204632437,428.11456140098,428.11456140098,479.64686971777,523.2511306012],"description":"Tetragam Undecimal"},"tetragam13":{"frequencies":[261.6255653006,275.95382006469,307.00724256551,307.00724256551,341.55514486295,341.55514486295,400.80167111126,400.80167111126,445.90437572008,445.90437572008,445.90437572008,496.08254310677,523.2511306012],"description":"Tetragam (13-tET)"},"tetragam5":{"frequencies":[261.6255653006,300.52885648597,300.52885648597,300.52885648597,300.52885648597,345.21700307457,345.21700307457,396.55020354877,455.51656649021,455.51656649021,455.51656649021,455.51656649021,523.2511306012],"description":"Tetragam (5-tET)"},"tetragam7":{"frequencies":[261.6255653006,288.85811466493,288.85811466493,288.85811466493,318.92511007349,352.12195684808,352.12195684808,388.77403176757,429.24143792307,429.24143792307,429.24143792307,473.92081401802,523.2511306012],"description":"Tetragam (7-tET)"},"tetragam8":{"frequencies":[261.6255653006,285.30470202322,311.12698372208,311.12698372208,339.28638158975,339.28638158975,403.48177901006,403.48177901006,440,440,440,440,523.2511306012],"description":"Tetragam (8-tET)"},"tetragam9a":{"frequencies":[261.6255653006,282.57118533961,305.19387818096,305.19387818096,329.62755691287,356.01738450312,415.30469757995,415.30469757995,448.55379686399,448.55379686399,448.55379686399,484.46508327871,523.2511306012],"description":"Tetragam (9-tET) A"},"tetragam9b":{"frequencies":[261.6255653006,282.57118533961,282.57118533961,282.57118533961,305.19387818096,305.19387818096,384.52019141924,384.52019141924,415.30469757995,415.30469757995,415.30469757995,448.55379686399,523.2511306012],"description":"Tetragam (9-tET) B"},"tetraphonic_31":{"frequencies":[261.6255653006,266.96486255163,272.52663052146,278.32506946872,284.37561445717,290.69507255622,297.30177875068,304.21577360535,311.45900631024,319.05556743976,327.03195662575,333.99008336247,341.25073734861,348.83408706747,356.76213450082,365.05892832642,373.75080757229,382.86668092771,392.4383479509,400.61414686654,409.13785211902,418.03215325205,427.32175665765,437.0336147635,447.19718719986,457.84473927605,467.58611670746,477.75103228805,488.36772189445,499.46698830115,511.08249965699,523.2511306012],"description":"31-tone Tetraphonic Cycle, conjunctive form on 5/4, 6/5, 7/6 and 8/7"},"tetratriad":{"frequencies":[261.6255653006,294.32876096318,327.03195662575,348.83408706747,367.91095120397,392.4383479509,436.04260883433,441.49314144476,490.54793493862,523.2511306012],"description":"4:5:6 Tetratriadic scale"},"tetratriad1":{"frequencies":[261.6255653006,290.69507255622,294.32876096318,327.03195662575,348.83408706747,392.4383479509,436.04260883433,441.49314144476,490.54793493862,523.2511306012],"description":"3:5:9 Tetratriadic scale"},"tetratriad2":{"frequencies":[261.6255653006,296.75121990114,305.22982618403,356.10146388137,373.75080757229,415.4517078616,436.04260883433,448.50096908674,508.71637697339,523.2511306012],"description":"3:5:7 Tetratriadic scale"},"thailand":{"frequencies":[261.6255653006,281.86483947605,307.02089761314,350.84574289301,397.92692612688,408.40584780369,474.03826620294,539.82938999168],"description":"Observed ranat tuning from Thailand, Helmholtz/Ellis p. 518, nr.85"},"thailand2":{"frequencies":[261.6255653006,293.66476791741,318.39923223688,356.77227917518,391.76907592069,435.19747628762,477.88722128969,525.37110555681],"description":"Observed ranat t'hong tuning, Helmholtz/Ellis p. 518"},"thailand3":{"frequencies":[261.6255653006,293.32570896007,322.47117131255,354.92237405774,396.55020354877,437.46578647972,488.21056770985,538.58355905405],"description":"Observed tak'hay tuning. Helmholtz, p. 518"},"thailand4":{"frequencies":[261.6255653006,281.88044777549,304.38587215019,332.5176539627,392.71966479735,416.35036198375,461.923848369,523.2511306012,563.76089555097,608.77174430039,665.59794246809,786.00196746963,831.57545378481,924.97296635309,1046.5022612024,1127.52179110194],"description":"Khong mon (bronze percussion vessels) tuning, Gemeentemuseum Den Haag 1/1=465"},"thirds":{"frequencies":[261.6255653006,272.52663052146,290.69507255622,313.95067836072,327.03195662575,348.83408706747,363.36884069528,392.4383479509,418.60090448096,436.04260883433,454.2110508691,502.32108537715,523.2511306012],"description":"Major and minor thirds parallellogram"},"thomas":{"frequencies":[261.6255653006,280.80530480292,294.66217084622,313.95044496966,332.05645032639,350.21604710412,374.62015588545,391.99543598175,420.73257541073,441.99197952365,468.79922683914,499.49209883845,523.2511306012],"description":"Tuning of the Thomas/Philpott organ, Gereformeerde Kerk, St. Jansklooster"},"tiby1":{"frequencies":[261.6255653006,295.66718139806,337.56154978455,348.04364484358,393.32961502355,444.50800708553,507.49227916989,523.2511306012],"description":"Tiby's 1st Byzantine Liturgical genus, 12 + 13 + 3 parts"},"tiby2":{"frequencies":[261.6255653006,295.66718139806,311.12698372208,348.04364484358,393.32961502355,444.50800708553,467.75037672729,523.2511306012],"description":"Tiby's second Byzantine Liturgical genus, 12 + 5 + 11 parts"},"tiby3":{"frequencies":[261.6255653006,295.66718139806,324.07484847125,348.04364484358,393.32961502355,444.50800708553,487.21628271135,523.2511306012],"description":"Tiby's third Byzantine Liturgical genus, 12 + 9 + 7 parts"},"tiby4":{"frequencies":[261.6255653006,286.76251801126,324.07484847125,348.04364484358,393.32961502355,431.12067692221,487.21628271135,523.2511306012],"description":"Tiby's fourth Byzantine Liturgical genus, 9 + 12 + 7 parts"},"todi_av":{"frequencies":[261.6255653006,276.38325105256,310.05056613125,371.27895029721,392.44854854484,413.39000965417,495.88429116026,523.2511306012],"description":"Average of 8 interpretations of raga Todi, in B. Bel, 1988."},"tonos15_pis":{"frequencies":[261.6255653006,287.78812183066,319.76457981184,359.73515228832,383.71749577421,442.75095666255,479.64686971777,523.2511306012,548.16785110602,575.57624366132,639.52915962369,719.47030457665,767.43499154843,885.50191332511,959.29373943553,1046.5022612024],"description":"Diatonic Perfect Immutable System in the new Tonos-15"},"tonos17_pis":{"frequencies":[261.6255653006,285.40970760065,313.95067836072,348.83408706747,369.35373924791,418.60090448096,483.00104363188,523.2511306012,546.00117975777,570.81941520131,627.90135672144,697.66817413493,738.70747849581,784.8766959018,897.00193817349,1046.5022612024],"description":"Diatonic Perfect Immutable System in the new Tonos-17"},"tonos19_pis":{"frequencies":[261.6255653006,281.75060878526,305.22982618403,332.97799220076,385.55346465352,406.97310157871,457.84473927605,523.2511306012,542.63080210495,563.50121757052,610.45965236807,665.95598440153,771.10692930703,813.94620315742,915.6894785521,1046.5022612024],"description":"Diatonic Perfect Immutable System in the new Tonos-19"},"tonos21_pis":{"frequencies":[261.6255653006,299.00064605783,322.00069575458,348.83408706747,398.6675280771,440.63253103259,465.11211608996,523.2511306012,558.13453930795,598.00129211566,644.00139150917,697.66817413493,797.33505615421,881.26506206518,930.22423217991,1046.5022612024],"description":"Diatonic Perfect Immutable System in the new Tonos-21"},"tonos23_pis":{"frequencies":[261.6255653006,294.32876096318,336.37572681506,362.25078272391,409.50088481833,448.50096908674,470.92601754108,523.2511306012,554.03060887186,588.65752192635,672.75145363011,724.50156544782,819.00176963666,897.00193817349,941.85203508216,1046.5022612024],"description":"Diatonic Perfect Immutable System in the new Tonos-23"},"tonos25_pis":{"frequencies":[261.6255653006,294.32876096318,336.37572681506,362.25078272391,376.74081403286,428.11456140098,470.92601754108,523.2511306012,554.03060887186,588.65752192635,672.75145363011,724.50156544782,753.48162806573,856.22912280196,941.85203508216,1046.5022612024],"description":"Diatonic Perfect Immutable System in the new Tonos-25"},"tonos27_pis":{"frequencies":[261.6255653006,290.69507255622,327.03195662575,373.75080757229,387.59343007496,436.04260883433,498.33441009638,523.2511306012,550.79066379074,581.39014511244,654.0639132515,747.50161514457,775.18686014993,872.08521766867,996.66882019276,1046.5022612024],"description":"Diatonic Perfect Immutable System in the new Tonos-27"},"tonos29_pis":{"frequencies":[261.6255653006,287.78812183066,319.76457981184,359.73515228832,396.94913355953,442.75095666255,479.64686971777,523.2511306012,548.16785110602,575.57624366132,639.52915962369,719.47030457665,793.89826711906,885.50191332511,959.29373943553,1046.5022612024],"description":"Diatonic Perfect Immutable System in the new Tonos-29"},"tonos31_pis":{"frequencies":[261.6255653006,273.51763645063,300.86940009569,334.29933343966,388.21858076863,429.81342870813,462.87600014722,501.44900015948,523.2511306012,547.03527290125,601.73880019138,668.59866687931,776.43716153726,859.62685741626,925.75200029443,1046.5022612024],"description":"Diatonic Perfect Immutable System in the new Tonos-31"},"tonos31_pis2":{"frequencies":[261.6255653006,285.40970760065,313.95067836072,348.83408706747,405.0976494977,448.50096908674,483.00104363188,523.2511306012,546.00117975777,570.81941520131,627.90135672144,697.66817413493,810.19529899541,897.00193817349,966.00208726375,1046.5022612024],"description":"Diatonic Perfect Immutable System in the new Tonos-31B"},"tonos33_pis":{"frequencies":[261.6255653006,285.40970760065,313.95067836072,348.83408706747,380.54627680087,418.60090448096,465.11211608996,523.2511306012,546.00117975777,570.81941520131,627.90135672144,697.66817413493,761.09255360175,837.20180896192,930.22423217991,1046.5022612024],"description":"Diatonic Perfect Immutable System in the new Tonos-33"},"top31":{"frequencies":[261.6255653006,267.49189720203,273.48976766293,279.62212612306,285.89198815637,292.30243695391,298.85662483994,305.55777482212,312.40918217641,319.41421606749,326.57632120555,333.89901954025,341.38591199258,349.04068022565,358.99452880887,367.04412845091,375.2742212459,383.6888543241,392.29216556304,401.08838562235,410.08184002413,419.27695128006,428.67824106611,438.29033244612,448.11795214515,458.16593287385,468.4392157049,478.94285250284,489.68200840824,500.66196437769,511.88811978069,523.36599505479],"description":"Top temperament, 11-limit, {225/224, 385/384, 1331/1323}, Gene Ward Smith"},"trab19":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,297.67175429757,306.59245933664,313.95067836072,327.03195662575,334.88072358477,348.83408706747,367.91095120397,372.08969287196,392.4383479509,408.78994578219,418.60090448096,436.04260883433,446.50763144636,459.88868900496,465.11211608996,490.54793493862,523.2511306012],"description":"Diamond {1,3,5,45,75,225}"},"trab19a":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,297.67175429757,306.59245933664,313.95067836072,327.03195662575,344.91651675372,348.83408706747,367.91095120397,372.08969287196,392.4383479509,396.89567239676,418.60090448096,436.04260883433,446.50763144636,459.88868900496,465.11211608996,490.54793493862,523.2511306012],"description":"Diamond {1,3,9,15,675}"},"tranh":{"frequencies":[261.6255653006,290.69507255622,348.83408706747,392.4383479509,436.04260883433,523.2511306012],"description":"Bac Dan Tranh scale, Vietnam"},"tranh2":{"frequencies":[261.6255653006,290.69507255622,307.79478270659,392.4383479509,436.04260883433,523.2511306012],"description":"Dan Ca Dan Tranh Scale"},"tranh3":{"frequencies":[261.6255653006,317.68818643644,348.83408706747,392.4383479509,473.41768959156,476.53227965466,523.2511306012],"description":"Sa Mac Dan Tranh scale"},"tri12-1":{"frequencies":[261.6255653006,264.29521392612,275.21650375777,319.76457981184,323.02748368748,332.97799220076,336.37572681506,406.97310157871,411.12588832951,428.11456140098,432.48307733364,502.48719684718,523.2511306012],"description":"12-tone Tritriadic of 7:9:11"},"tri12-2":{"frequencies":[261.6255653006,294.32876096318,305.22982618403,336.37572681506,348.83408706747,356.10146388137,392.4383479509,406.97310157871,448.50096908674,457.84473927605,474.80195184183,504.56359022259,523.2511306012],"description":"12-tone Tritriadic of 6:7:9"},"tri19-1":{"frequencies":[261.6255653006,266.96486255163,269.10058145205,305.22982618403,311.45900631024,313.95067836072,320.35783506196,356.10146388137,363.36884069528,366.27579142084,373.75080757229,376.74081403286,384.42940207435,427.32175665765,436.04260883433,439.53094970501,448.50096908674,508.71637697339,512.78610798918,523.2511306012],"description":"3:5:7 Tritriadic 19-Tone Matrix"},"tri19-2":{"frequencies":[261.6255653006,282.55561052465,290.69507255622,294.32876096318,313.95067836072,322.99452506247,327.03195662575,348.83408706747,353.19451315581,363.36884069528,376.74081403286,387.59343007496,392.4383479509,418.60090448096,423.83341578697,436.04260883433,465.11211608996,470.92601754108,484.4917875937,523.2511306012],"description":"3:5:9 Tritriadic 19-Tone Matrix"},"tri19-3":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,290.69507255622,294.32876096318,313.95067836072,327.03195662575,334.88072358477,348.83408706747,363.36884069528,376.74081403286,392.4383479509,408.78994578219,418.60090448096,436.04260883433,465.11211608996,470.92601754108,490.54793493862,502.32108537715,523.2511306012],"description":"4:5:6 Tritriadic 19-Tone Matrix"},"tri19-4":{"frequencies":[261.6255653006,264.89588486686,290.69507255622,294.32876096318,322.99452506247,327.03195662575,331.11985608357,334.88072358477,363.36884069528,367.91095120397,372.08969287196,376.74081403286,408.78994578219,413.43299207996,418.60090448096,423.83341578697,465.11211608996,470.92601754108,516.79124009995,523.2511306012],"description":"4:5:9 Tritriadic 19-Tone Matrix"},"tri19-5":{"frequencies":[261.6255653006,266.96486255163,284.8811711051,290.69507255622,302.73815413355,316.53463456122,322.99452506247,329.64821227876,336.37572681506,366.27579142084,373.75080757229,406.97310157871,415.27867508032,423.83341578697,432.48307733364,452.19233508746,470.92601754108,480.53675259294,512.78610798918,523.2511306012],"description":"5:7:9 Tritriadic 19-Tone Matrix"},"tri19-6":{"frequencies":[261.6255653006,267.07609791103,294.32876096318,299.00064605783,305.22982618403,336.37572681506,341.71502406609,343.38355445704,348.83408706747,356.10146388137,384.42940207435,392.4383479509,398.6675280771,400.61414686654,406.97310157871,448.50096908674,457.84473927605,465.11211608996,512.57253609913,523.2511306012],"description":"6:7:8 Tritriadic 19-Tone Matrix"},"tri19-7":{"frequencies":[261.6255653006,271.31540105247,288.32205155576,294.32876096318,299.00064605783,305.22982618403,316.53463456122,336.37572681506,348.83408706747,356.10146388137,384.42940207435,392.4383479509,406.97310157871,432.48307733364,448.50096908674,457.84473927605,465.11211608996,474.80195184183,504.56359022259,523.2511306012],"description":"6:7:9 Tritriadic 19-Tone Matrix"},"tri19-8":{"frequencies":[261.6255653006,264.29521392612,272.43653907335,275.21650375777,316.53463456122,319.76457981184,323.02748368748,332.97799220076,336.37572681506,350.27555023717,390.82337532559,406.97310157871,411.12588832951,423.79017189188,428.11456140098,432.48307733364,497.4115685962,502.48719684718,517.96576564563,523.2511306012],"description":"7:9:11 Tritriadic 19-Tone Matrix"},"tri19-9":{"frequencies":[261.6255653006,266.96486255163,286.15296204753,293.02063313667,299.00064605783,320.49131749323,327.03195662575,334.88072358477,341.71502406609,366.27579142084,373.75080757229,400.61414686654,408.78994578219,418.60090448096,427.14378008261,457.84473927605,467.18850946536,478.40103369253,512.78610798918,523.2511306012],"description":"4:5:7 Tritriadic 19-Tone Matrix"},"triang11":{"frequencies":[261.6255653006,294.32876096318,305.22982618403,313.95067836072,327.03195662575,348.83408706747,359.73515228832,366.27579142084,373.75080757229,380.54627680087,392.4383479509,418.60090448096,436.04260883433,448.50096908674,465.11211608996,523.2511306012],"description":"11-limit triangular diamond lattice with 64/63 intervals removed"},"triaphonic_12":{"frequencies":[261.6255653006,275.39533189537,290.69507255622,307.79478270659,327.03195662575,348.83408706747,367.19377586049,387.59343007496,410.39304360878,436.04260883433,461.69217405988,490.54793493862,523.2511306012],"description":"12-tone Triaphonic Cycle, conjunctive form on 4/3, 5/4 and 6/5"},"triaphonic_17":{"frequencies":[261.6255653006,271.31540105247,281.75060878526,293.02063313667,305.22982618403,318.50068819203,332.97799220076,348.83408706747,361.75386806997,375.66747838035,390.69417751556,406.97310157871,422.62591317789,439.53094970501,457.84473927605,477.75103228805,499.46698830115,523.2511306012],"description":"17-tone Triaphonic Cycle, conjunctive form on 4/3, 7/6 and 9/7"},"trichord7":{"frequencies":[261.6255653006,294.32876096318,305.22982618403,327.03195662575,343.38355445704,348.83408706747,392.4383479509,436.04260883433,441.49314144476,457.84473927605,490.54793493862,523.2511306012],"description":"Trichordal undecatonic, 7-limit"},"tricot":{"frequencies":[261.6255653006,264.94025538413,268.70564228797,272.11003565477,275.55755973666,279.4738436282,283.01466417842,286.6003471482,290.673570175,294.35628843049,298.08566525814,302.32211998602,306.15242072385,310.03124984507,314.43747949204,318.42127516569,322.45554578164,327.03835025925,331.18179578139,335.37773516927,339.62683737367,344.45368576554,348.81777463097,353.23715677741,358.25743790514,362.79641682209,367.39290067029,372.61436622199,377.33523951767,382.11592657559,387.54663888312,392.45669803325,397.4289679423,403.0773124301,408.18413893183,413.35566924724,419.23036738005,424.541846554,429.92062250389,436.03074525334,441.55507841911,447.14940523431,453.50438708518,459.25010687752,465.06861996272,470.9608512551,477.65424916833,483.70593529179,489.8342966599,496.79592520903,503.09012862502,509.46407999504,516.70469117363,523.2511306012],"description":"Tricot temperament, g=565.988015, 5-limit"},"tritriad":{"frequencies":[261.6255653006,294.32876096318,313.95067836072,348.83408706747,392.4383479509,418.60090448096,470.92601754108,523.2511306012],"description":"Tritriadic scale of the 10:12:15 triad, natural minor mode"},"tritriad10":{"frequencies":[261.6255653006,274.70684356563,294.32876096318,348.83408706747,366.27579142084,392.4383479509,488.36772189445,523.2511306012],"description":"Tritriadic scale of the 10:14:15 triad"},"tritriad11":{"frequencies":[261.6255653006,309.19384990071,356.76213450082,383.71749577421,421.62797713733,453.48431318771,486.49381977384,523.2511306012],"description":"Tritriadic scale of the 11:13:15 triad"},"tritriad13":{"frequencies":[261.6255653006,294.32876096318,340.11323489078,348.83408706747,392.4383479509,453.48431318771,510.16985233617,523.2511306012],"description":"Tritriadic scale of the 10:13:15 triad"},"tritriad14":{"frequencies":[261.6255653006,294.32876096318,336.37572681506,348.83408706747,392.4383479509,448.50096908674,504.56359022259,523.2511306012],"description":"Tritriadic scale of the 14:18:21 triad"},"tritriad18":{"frequencies":[261.6255653006,294.32876096318,319.76457981184,348.83408706747,392.4383479509,426.35277308246,479.64686971777,523.2511306012],"description":"Tritriadic scale of the 18:22:27 triad"},"tritriad22":{"frequencies":[261.6255653006,294.32876096318,321.08592105074,348.83408706747,392.4383479509,428.11456140098,481.6288815761,523.2511306012],"description":"Tritriadic scale of the 22:27:33 triad"},"tritriad26":{"frequencies":[261.6255653006,294.32876096318,301.87565226992,348.83408706747,392.4383479509,402.50086969323,452.81347840488,523.2511306012],"description":"Tritriadic scale of the 26:30:39 triad"},"tritriad3":{"frequencies":[261.6255653006,305.22982618403,356.10146388137,373.75080757229,436.04260883433,448.50096908674,508.71637697339,523.2511306012],"description":"Tritriadic scale of the 3:5:7 triad. Possibly Mathews's 3.5.7a"},"tritriad32":{"frequencies":[261.6255653006,294.32876096318,322.00069575458,348.83408706747,392.4383479509,429.33426100611,483.00104363188,523.2511306012],"description":"Tritriadic scale of the 26:32:39 triad"},"tritriad3c":{"frequencies":[261.6255653006,305.22982618403,366.27579142084,373.75080757229,427.32175665765,436.04260883433,512.78610798918,523.2511306012],"description":"From 1/1 7/6 7/5, a variant of the 3.5.7 triad"},"tritriad3d":{"frequencies":[261.6255653006,305.22982618403,313.95067836072,363.36884069528,366.27579142084,436.04260883433,508.71637697339,523.2511306012],"description":"From 1/1 7/6 5/3, a variant of the 3.5.7 triad"},"tritriad5":{"frequencies":[261.6255653006,290.69507255622,329.64821227876,366.27579142084,406.97310157871,423.83341578697,470.92601754108,523.2511306012],"description":"Tritriadic scale of the 5:7:9 triad. Possibly Mathews's 5.7.9a."},"tritriad68":{"frequencies":[261.6255653006,305.22982618403,348.83408706747,392.4383479509,406.97310157871,457.84473927605,465.11211608996,523.2511306012],"description":"Tritriadic scale of the 6:7:8 triad"},"tritriad68i":{"frequencies":[261.6255653006,299.00064605783,348.83408706747,392.4383479509,398.6675280771,448.50096908674,465.11211608996,523.2511306012],"description":"Tritriadic scale of the subharmonic 6:7:8 triad"},"tritriad69":{"frequencies":[261.6255653006,294.32876096318,305.22982618403,348.83408706747,392.4383479509,406.97310157871,457.84473927605,523.2511306012],"description":"Tritriadic scale of the 6:7:9 triad, septimal natural minor"},"tritriad7":{"frequencies":[261.6255653006,264.29521392612,323.02748368748,332.97799220076,336.37572681506,411.12588832951,428.11456140098,523.2511306012],"description":"Tritriadic scale of the 7:9:11 triad"},"tritriad9":{"frequencies":[261.6255653006,272.93037367779,319.76457981184,362.25078272391,377.90359432309,442.75095666255,461.88217083933,523.2511306012],"description":"Tritriadic scale of the 9:11:13 triad"},"tsjerepnin":{"frequencies":[261.6255653006,290.69507255622,313.95067836072,348.83408706747,367.91095120397,392.4383479509,418.60090448096,470.92601754108,490.54793493862,523.2511306012],"description":"Scale from Ivan Tsjerepnin's Santur Opera (1977) & suite from it Santur Live!"},"tsuda13":{"frequencies":[261.6255653006,281.75060878526,283.42769574232,322.00069575458,340.11323489078,362.25078272391,377.90359432309,402.50086969323,425.14154361347,442.75095666255,485.87604984397,518.26778650024,523.2511306012],"description":"Mayumi Tsuda's Harmonic-13 scale. 1/1=440 Hz."},"tuneable3":{"frequencies":[36.70809598968,41.95210970249,42.82611198796,43.59086398774,44.04971518762,44.86545065405,45.8851199871,46.71939489596,47.1961234153,47.72052478658,48.94412798624,49.55592958607,50.47363198581,51.39133438555,52.00313598538,52.44013712811,53.02280531843,53.39359416681,55.06214398452,57.10148265061,57.68415084093,58.73295358349,59.65065598323,61.1801599828,62.40376318246,62.92816455374,64.23916798194,66.07457278142,66.74199270851,67.29817598108,68.17217826655,68.82767998065,70.35718398022,73.41619197936,79.53420797764,80.7578111773,82.59321597678,85.65222397592,87.18172797549,88.09943037523,89.14823311779,89.73090130811,90.10169015649,91.7702399742,94.39224683061,95.44104957317,96.35875197291,97.88825597248,100.94726397162,102.7826687711,104.00627197076,104.88027425623,105.53577597033,110.12428796904,114.20296530123,114.71279996775,115.36830168185,116.24230396732,117.46590716698,119.30131196646,120.61231539466,122.3603199656,123.88982396517,124.80752636491,125.85632910747,128.47833596388,132.14914556285,134.59635196216,137.6553599613,139.49076476078,140.71436796044,141.58837024591,146.83238395872,152.950399957,154.17400315666,156.00940795614,159.06841595528,161.51562235459,165.18643195356,168.85724155253,171.30444795184,174.36345595098,176.19886075046,183.5404799484,190.88209914634,192.71750394582,195.77651194496,201.89452794324,205.56533754221,208.01254394152,211.07155194066,220.24857593808,229.4255999355,232.48460793464,238.60262393292,244.7206399312,247.77964793034,256.95667192776,269.19270392432,275.3107199226,281.42873592088,293.66476791744],"description":"Marc Sabat, 3 octaves of intervals tuneable by ear"},"tuners1":{"frequencies":[261.6255653006,276.50456653385,293.15590636358,311.0676370396,328.627540632,349.28088891463,369.11955599459,391.76814585061,414.75684959346,439.06365754828,466.60145532616,492.6062100846,523.2511306012],"description":"The Tuner's Guide well temperament no. 1 (1840)"},"tuners2":{"frequencies":[261.6255653006,276.9861853325,293.55936848273,311.27971878774,329.48489606404,349.42029142443,369.90111701824,391.99869425741,415.03962525779,439.89939957166,466.4799232208,493.78769382322,523.2511306012],"description":"The Tuner's Guide well temperament no. 2 (1840)"},"tuners3":{"frequencies":[261.6255653006,276.9180796764,293.64050032496,311.25753558078,329.38199580693,349.20116137147,369.59117881045,391.8877401954,415.37711930697,439.91014033466,466.33569310799,493.52238512763,523.2511306012],"description":"The Tuner's Guide well temperament no. 3 (1840)"},"turkish":{"frequencies":[261.6255653006,279.06726965397,327.03195662575,348.83408706747,392.4383479509,436.04260883433,465.11211608996,523.2511306012],"description":"Turkish, 5-limit from Palmer on a Turkish music record, harmonic minor inverse"},"turkish_24":{"frequencies":[261.6255653006,275.62199471997,279.38237857051,290.36720431405,294.32876096318,310.07474405997,314.30517589183,326.6631048533,331.11985608357,344.13890881665,348.83408706747,367.49599295996,372.50983809402,387.15627241873,392.4383479509,413.43299207996,419.07356785577,435.55080647107,441.49314144476,458.8518784222,465.11211608996,489.99465727995,496.67978412536,516.20836322497,523.2511306012],"description":"Ra'uf Yekta, 24-tone Pythagorean Turkish Theoretical Gamut, 1/1=D (perde yegah) at 294 Hz"},"turkish_24a":{"frequencies":[261.6255653006,275.62199471997,279.06726965397,290.69507255622,294.32876096318,310.07474405997,313.95067836072,327.03195662575,331.11985608357,344.52749339997,348.83408706747,367.91095120397,372.08969287196,387.59343007496,392.4383479509,413.43299207996,418.60090448096,436.04260883433,441.49314144476,459.36999119996,465.11211608996,490.54793493862,496.67978412536,516.79124009995,523.2511306012],"description":"Turkish gamut with schismatic simplifications"},"turkish_41":{"frequencies":[261.6255653006,266.80864394988,272.09440643071,275.67629620338,281.13773466533,286.70737164501,290.48162858661,294.30556868769,300.13607443832,306.08208692954,310.11139540064,316.25503135793,322.52037740267,326.76608188608,333.2396629384,339.84149442859,344.31521657963,348.8478314504,355.75887527351,362.80683626646,367.58287746967,374.8650823332,382.29155536296,387.32409620162,392.42288612931,400.19720009986,408.12552912594,413.49815209867,421.6899870258,430.04411333507,435.70527569249,441.44096240275,450.1863739015,459.10504388656,465.14876849982,474.36385666592,483.76150545705,490.12981126508,499.83980314828,509.74215733443,516.45247616827,523.2511306012],"description":"Abd�lkadir T�re and M. Ekrem Karadeniz theoretical Turkish gamut"},"turkish_41a":{"frequencies":[261.6255653006,268.5590565112,272.09440643071,275.67629620338,279.3053384865,286.70737164501,290.48162858661,294.30556868769,298.17984938441,306.08208692954,310.11139540064,314.19374626607,322.52037740267,326.76608188608,335.42589979828,339.84149442859,344.31521657963,348.8478314504,353.4401143131,362.80683626646,367.58287746967,377.32440283229,382.29155536296,387.32409620162,392.42288612931,402.82271318249,408.12552912594,413.49815209867,424.45650702809,430.04411333507,435.70527569249,441.44096240275,453.1398459935,459.10504388656,465.14876849982,477.47594368525,483.76150545705,490.12981126508,503.11902634639,509.74215733443,516.45247616827,523.2511306012],"description":"Karadeniz's theoretical Turkish gamut, quantized to subset of 53-tET"},"turkish_aeu":{"frequencies":[261.6255653006,275.62199471997,279.38237857051,290.36720431405,294.32876096318,310.07474405997,314.30517589183,326.6631048533,331.11985608357,348.83408706747,353.59332287831,367.49599295996,372.50983809402,387.15627241873,392.4383479509,413.43299207996,419.07356785577,435.55080647107,441.49314144476,465.11211608996,471.45776383774,489.99465727995,496.67978412536,516.20836322497,523.2511306012],"description":"Arel-Ezgi-Uzdilek (AEU) 24 tone theoretical system"},"turkish_bagl":{"frequencies":[261.6255653006,277.01530443593,285.40970760065,294.32876096318,311.64221749042,321.08592105074,331.11985608357,348.83408706747,369.35373924791,380.54627680087,392.4383479509,415.52295665389,428.11456140098,441.49314144476,465.11211608996,492.47165233054,507.3950357345,523.2511306012],"description":"Ratios of the 17 frets on the neck of \"Baglama\" (\"saz\") according to Yal��n Tura"},"two29":{"frequencies":[261.6255653006,265.43099677612,267.95417262175,271.85165581044,274.43586616969,278.42762776199,281.0743490329,285.16266958193,287.87341387594,292.06062910037,294.83694510625,299.12544722478,301.96892109338,306.36116019141,309.2734164419,313.77190187131,316.75460431924,321.36190613206,324.41675883995,329.13550925662,332.26425750751,337.09715242073,340.3015837153,345.25138423021,348.53332930799,353.60286331966,356.96419720496,362.15636101402,365.59900408717,370.91676405444,374.44268531179,379.88907958456,383.50028913155,389.07842928561,392.77699240278,398.49006531303,402.2780950448,408.12936467525,412.00902517967,418.00183444819,421.97534223334,428.1131149215,432.1827401118,438.46898282094,442.63705045414,449.07535460876,453.34424596425,459.9382898638,464.31044382305,471.06399474345,475.54190918343,482.45882552933,487.04505874954,494.12929225872,498.82646444278,506.0820624438,510.89285715645,518.32396488098,523.2511306012],"description":"Two 29-tET scales 25 cents shifted, many near just intervals"},"two29a":{"frequencies":[261.6255653006,264.02813680074,267.95417262175,270.41486126945,274.43586616969,276.95607779319,281.0743490329,283.65552346679,287.87341387594,290.51702578379,294.83694510625,297.54450482308,301.96892109338,304.74197548856,309.2734164419,312.11354980287,316.75460431924,319.66343925668,324.41675883995,327.39595721478,332.26425750751,335.31552138031,340.3015837153,343.42665631876,348.53332930799,351.73399604284,356.96419720496,360.24228665998,365.59900408717,368.95638908389,374.44268531179,377.88128181162,383.50028913155,387.02206376789,392.77699240278,396.38395721814,402.2780950448,405.97231075214,412.00902517967,415.79260233969,421.97534223334,425.85044246025,432.1827401118,436.15157730833,442.63705045414,446.70189207635,453.34424596425,457.50741431695,464.31044382305,468.5743173866,475.54190918343,479.90892674463,487.04505874954,491.51771254425,498.82646444278,503.40730976502,510.89285715645,515.58451111167,523.2511306012],"description":"Two 29-tET scales 15.826 cents shifted, 13-limit chords, Mystery temperament, Gene Ward Smith"},"xenakis_chrom":{"frequencies":[261.6255653006,274.52698453615,329.62755691287,349.22823143301,391.99543598175,411.32572372413,493.88330125613,523.2511306012],"description":"Xenakis's Byzantine Liturgical mode, 5 + 19 + 6 parts"},"xenakis_diat":{"frequencies":[261.6255653006,293.66476791741,326.46944327063,349.22823143301,391.99543598175,440,489.15147723638,523.2511306012],"description":"Xenakis's Byzantine Liturgical mode, 12 + 11 + 7 parts"},"xenakis_schrom":{"frequencies":[261.6255653006,279.86396690685,326.46944327063,349.22823143301,391.99543598175,419.32216217931,489.15147723638,523.2511306012],"description":"Xenakis's Byzantine Liturgical mode, 7 + 16 + 7 parts"},"xenoga24":{"frequencies":[261.6255653006,265.7783520514,279.38237857051,283.8170195002,294.32876096318,299.00064605783,310.07474405997,314.99656539426,331.11985608357,336.37572681506,348.83408706747,354.37113606854,372.50983809402,378.42269266694,392.4383479509,398.6675280771,419.07356785577,425.72552925031,441.49314144476,448.50096908674,465.11211608996,472.49484809138,496.67978412536,504.56359022259,523.2511306012],"description":"M. Schulter, 3+7 ratios Xeno-Gothic adaptive tuning (keyboards 64:63 apart)"},"xylophone2":{"frequencies":[261.6255653006,295.19538981304,332.68808325276,388.83826257328,446.65787257783,506.59641128799,527.19506190947,579.57827742703,633.13077520476,751.1860077911,842.69088701475],"description":"African Yaswa xylophones (idiophone; calbash resonators with membrane)"},"xylophone3":{"frequencies":[261.6255653006,292.47977325983,348.01999353916,392.4383479509,442.29334161825,523.2511306012],"description":"African Banyoro xylophone (idiophone; loose log)"},"xylophone4":{"frequencies":[261.6255653006,281.70207497315,314.1971709147,349.63190883464,391.76907592069,436.9606979923,505.71930677521,568.9637969584,597.94115990992,660.7800775993,716.43551549302],"description":"African Bapare xylophone (idiophone, loose-log)"},"zalzal":{"frequencies":[261.6255653006,294.32876096318,321.08592105074,348.83408706747,392.4383479509,428.11456140098,465.11211608996,523.2511306012],"description":"Tuning of popular flute by Al Farabi & Zalzal. First tetrachord is modern Rast"},"zalzal2":{"frequencies":[261.6255653006,294.32876096318,331.11985608357,348.83408706747,387.59343007496,419.89288258121,465.11211608996,523.2511306012],"description":"Zalzal's Scale, a medieval Islamic with Ditone Diatonic & 10/9 x 13/12 x 72/65"},"zarlino":{"frequencies":[261.6255653006,294.32876096318,327.03195662575,348.83408706747,392.4383479509,436.04260883433,490.54793493862,523.2511306012],"description":"Ptolemy's Intense Diatonic Systonon, also Zarlino's scale"},"zarlino2":{"frequencies":[261.6255653006,272.52663052146,290.69507255622,294.32876096318,310.07474405997,313.95067836072,327.03195662575,348.83408706747,363.36884069528,367.91095120397,392.4383479509,408.78994578219,436.04260883433,465.11211608996,470.92601754108,490.54793493862,523.2511306012],"description":"16-note choice system of Zarlino, Sopplimenti musicali (1588)"},"zartehijaz1":{"frequencies":[261.6255653006,280.55696721076,336.07142343876,350.07440004945,375.4060213132,393.89732161404,446.43551156053,468.42549744394,502.32108537715,523.2511306012],"description":"Scale from Zarlino temperament extraordinaire -- lower Hijaz tetrachord"},"zesster_a":{"frequencies":[261.6255653006,279.06726965397,313.95067836072,334.88072358477,348.83408706747,392.4383479509,418.60090448096,502.32108537715,523.2511306012],"description":"Harmonic six-star, group A, from Fokker"},"zesster_b":{"frequencies":[261.6255653006,293.02063313667,299.00064605783,334.88072358477,366.27579142084,418.60090448096,457.84473927605,478.40103369253,523.2511306012],"description":"Harmonic six-star, group B, from Fokker"},"zesster_c":{"frequencies":[261.6255653006,299.00064605783,305.22982618403,348.83408706747,398.6675280771,406.97310157871,457.84473927605,465.11211608996,523.2511306012],"description":"Harmonic six-star, group C on Eb, from Fokker"},"zesster_mix":{"frequencies":[261.6255653006,274.70684356563,279.06726965397,293.02063313667,299.00064605783,313.95067836072,334.88072358477,348.83408706747,358.80077526939,366.27579142084,392.4383479509,418.60090448096,457.84473927605,478.40103369253,488.36772189445,502.32108537715,523.2511306012],"description":"Harmonic six-star, groups A, B and C mixed, from Fokker"},"zest24":{"frequencies":[261.6255653006,269.33468959023,272.52663052146,280.55696721076,292.24684137387,300.8582598368,308.87634556583,317.97777315513,326.45210604021,336.07142343876,350.07440004945,360.38977980792,364.66083404534,375.4060213132,391.04793957621,402.57065589001,410.30971075781,422.39999923493,436.81711699543,449.68847932918,465.03699205118,478.73988827571,487.94322738789,502.32108537715,523.2511306012],"description":"Zarlino Extraordinaire Spectrum Temperament (two circles at ~50.28c apart)"},"zir_bouzourk":{"frequencies":[261.6255653006,281.75060878526,305.22982618403,313.95067836072,353.19451315581,392.4383479509,523.2511306012],"description":"Zirafkend Bouzourk (IG #3, DF #9), from both Rouanet and Safi al-Din"},"zwolle":{"frequencies":[261.6255653006,275.62199471997,294.32876096318,310.07474405997,331.11985608357,348.83408706747,367.49599295996,392.4383479509,413.43299207996,441.49314144476,465.11211608996,496.67978412536,523.2511306012],"description":"Henri Arnaut De Zwolle. Pythagorean on G flat."},"zwolle2":{"frequencies":[261.6255653006,273.37431312998,292.50627485027,311.68386704488,327.03195662575,349.91912034749,365.63284274659,391.22147055517,408.78994578219,437.39890198442,467.04206359353,489.02683710225,523.2511306012],"description":"Henri Arnaut De Zwolle's modified meantone tuning (c. 1440)"},"yarman12":{"frequencies":[261.6255653006,283.42769574232,294.32876096318,309.19384990071,332.97799220076,348.83408706747,377.90359432309,392.4383479509,411.12588832951,442.75095666255,465.11211608996,499.46698830115,523.2511306012],"description":"Detempered Yarman 13-limit, [<1 1 -20 -6 -3 -1|, <0 1 38 15 11 8|]"},"yarman12_80":{"frequencies":[261.6255653006,282.84340331238,295.36595061166,319.3201344739,333.45764463229,348.2210758395,376.46181130035,393.12919962609,425.01198472693,443.82887286778,479.82340237272,501.06699929295,523.2511306012],"description":"Ozan Yarman MOS, 80-et version"},"yarman17":{"frequencies":[261.6255653006,274.08392555301,283.42769574232,294.32876096318,309.19384990071,322.00069575458,332.97799220076,348.83408706747,362.25078272391,377.90359432309,392.4383479509,411.12588832951,425.14154361347,442.75095666255,465.11211608996,485.87604984397,499.46698830115,523.2511306012],"description":"80-et commas 13-limit detempering of a chain of 16 fifths"},"yarman_ney-ahengs":{"frequencies":[261.6255653006,275.39533189537,294.32876096318,310.07474405997,327.03195662575,348.83408706747,367.91095120397,392.4383479509,413.43299207996,436.04260883433,465.11211608996,494.18162334558,523.2511306012],"description":"Well Temperament for piano by Ozan Yarman from Ney Ahengs"},"yasser_6":{"frequencies":[261.6255653006,291.88463270656,325.64340264099,363.30663963964,405.32593044476,452.20508247496,523.2511306012],"description":"Yasser Hexad, 6 of 19 as whole tone scale"},"yasser_diat":{"frequencies":[261.6255653006,281.42815779395,291.88463270656,313.97755176024,325.64340264099,350.29154279212,376.80531512858,390.80553229045,420.38583225541,436.00528786292,469.00678383895,486.43275040712,523.2511306012],"description":"Yasser's Supra-Diatonic, the flat notes are V,W,X,Y,and Z"},"yasser_ji":{"frequencies":[261.6255653006,282.64904822654,294.32876096318,304.39128270551,327.03195662575,347.87575166344,359.73515228832,391.36022062136,425.14154361347,434.84468957929,457.84473927605,478.32915853722,523.2511306012],"description":"Yasser's just scale, 2 Yasser hexads, 121/91 apart"},"yekta":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,313.95067836072,327.03195662575,348.83408706747,372.08969287196,392.4383479509,418.60090448096,436.04260883433,470.92601754108,502.32108537715,523.2511306012],"description":"Rauf Yekta's 12-tone tuning suggested in 1922 Lavignac Music Encyclopedia"},"young-g":{"frequencies":[261.6255653006,299.07507698093,319.76457981184,341.88537054616,390.82337532559,446.76650366117,477.67301428683,510.71739232152,583.82257301724,667.39198333921,713.56092257662,762.92356430953,872.13001648254,996.96833978235,1065.93668681199,1139.67601990796,1302.81150610354,1489.29848625885,1592.32474578757,1702.47910946196,1946.17475603251,2224.75468143463,2378.65811671778,2543.20970830682,2907.24890901465,3323.39919648924,3553.30434397593,3799.11599765247,4342.92768045015],"description":"Gayle Young's Harmonium, see PNM 26(2): 204-212 (1988)"},"young-lm_guitar":{"frequencies":[261.6255653006,279.06726965397,290.69507255622,313.95067836072,327.03195662575,348.83408706747,367.91095120397,392.4383479509,418.60090448096,436.04260883433,470.92601754108,490.54793493862,523.2511306012],"description":"LaMonte Young, Tuning of For Guitar '58. 1/1 March '92, inv.of Mersenne lute 1"},"young-lm_piano":{"frequencies":[261.6255653006,289.72987407313,294.32876096318,300.46061014991,343.38355445704,338.01818641865,386.30649876417,392.4383479509,400.61414686654,457.84473927605,450.69091522486,515.07533168556,523.2511306012],"description":"LaMonte Young's Well-Tempered Piano"},"young-w10":{"frequencies":[261.6255653006,277.18263097687,302.26980244078,320.24370022528,349.22823143301,369.99442271164,391.99543598175,427.47405410759,452.89298412314,493.88330125613,523.2511306012],"description":"William Lyman Young 10 out of 24-tET (1961)"},"young-w14":{"frequencies":[261.6255653006,277.18263097687,293.66476791741,302.26980244078,320.24370022528,339.28638158975,359.46139971304,369.99442271164,391.99543598175,415.30469757995,427.47405410759,452.89298412314,479.82340237272,508.3551866238,523.2511306012],"description":"William Lyman Young 14 out of 24-tET (1961)"},"young-wt":{"frequencies":[261.6255653006,285.40970760065,309.19384990071,348.83408706747,392.4383479509,428.11456140098,463.79077485106,523.2511306012],"description":"William Lyman Young \"exquisite 3/4 tone Hellenic Lyre\" dorian"},"young":{"frequencies":[261.6255653006,275.62199471997,293.00227310437,310.07474405997,328.14198392915,348.83408706747,367.49599295996,391.5530240856,413.43299207996,438.51190905657,465.11211608996,491.10256480205,523.2511306012],"description":"Thomas Young well temperament (1807), also Luigi Malerbi nr.2 (1794)"},"young2":{"frequencies":[261.6255653006,276.24519242498,293.00227310437,310.77584116741,328.14198392915,349.22823143301,368.32692341742,391.5530240856,414.36778843034,438.51190905657,466.16376151809,491.65745674141,523.2511306012],"description":"Thomas Young well temperament no.2 (1799)"},"yugo_bagpipe":{"frequencies":[261.6255653006,277.02257024271,294.00421879736,322.47117131255,341.84370465044,381.9375744369,404.41509766528,430.1988069325,452.63145841613,463.74664903953,478.99265177484,502.22604835608,523.2511306012],"description":"Yugoslavian Bagpipe"},"yves":{"frequencies":[261.6255653006,290.69507255622,327.03195662575,348.83408706747,392.4383479509,436.04260883433,465.11211608996,523.2511306012],"description":"St Yves's scale II from Jocelyn Godwin, \"Music and the Occult\", 1995."},"saba_sup":{"frequencies":[261.6255653006,287.78812183066,313.95067836072,327.03195662575,392.4383479509,418.60090448096,470.92601754108,497.08857407114,523.2511306012],"description":"Superparticular version of maqam Sab"},"sabagh":{"frequencies":[261.6255653006,275.67629620338,279.3053384865,286.70737164501,294.30556868769,310.11139540064,314.19374626607,322.52037740267,326.76608188608,331.06767743197,348.8478314504,362.80683626646,367.58287746967,372.42178901277,392.42288612931,413.49815209867,418.94150105041,430.04411333507,441.44096240275,465.14876849982,471.27205084813,483.76150545705,490.12981126508,496.58195036371,523.2511306012],"description":"Twfiq Al-Sabagh, Arabic master musical scale in 53-tET (1954)"},"sabbagh":{"frequencies":[261.6255653006,294.30556868769,321.46759848648,348.8478314504,392.42288612931,428.64035280622,465.14876849982,523.2511306012],"description":"Tawfiq as-Sabbagh, a composer from Syria. 1/1=G"},"safi_diat":{"frequencies":[261.6255653006,276.16031892841,305.22982618403,348.83408706747,392.4383479509,414.24047839262,457.84473927605,523.2511306012],"description":"Safi al-Din's Diatonic, also the strong form of Avicenna's 8/7 diatonic"},"safi_diat2":{"frequencies":[261.6255653006,283.79722337692,310.07474405997,348.83408706747,392.4383479509,425.69583506538,465.11211608996,523.2511306012],"description":"Safi al-Din's 2nd Diatonic, a 3/4 tone diatonic like Ptolemy's Equable Diatonic"},"safi_major":{"frequencies":[261.6255653006,281.75060878526,322.00069575458,348.83408706747,375.66747838035,392.4383479509,523.2511306012],"description":"Singular Major (DF #6), from Safi al-Din, strong 32/27 chromatic"},"salinas_19":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,294.32876096318,306.59245933664,313.95067836072,327.03195662575,340.65828815182,348.83408706747,363.36884069528,372.08969287196,392.4383479509,408.78994578219,418.60090448096,436.04260883433,454.2110508691,465.11211608996,490.54793493862,510.98743222773,523.2511306012],"description":"Salinas' enharmonic tuning for his 19-tone instr. \"instrumentum imperfectum\""},"salinas_24":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,290.69507255622,294.32876096318,306.59245933664,313.95067836072,327.03195662575,340.65828815182,348.83408706747,363.36884069528,367.91095120397,372.08969287196,376.74081403286,392.4383479509,408.78994578219,418.60090448096,436.04260883433,454.2110508691,459.88868900496,465.11211608996,470.92601754108,490.54793493862,510.98743222773,523.2511306012],"description":"Salinas enharmonic system \"instrumentum perfectum\". Subset of Mersenne"},"salinas_enh":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,348.83408706747,392.4383479509,408.78994578219,418.60090448096,523.2511306012],"description":"Salinas's and Euler's enharmonic"},"salunding":{"frequencies":[261.6255653006,282.38958039978,310.76686573877,390.36201910543,419.43149305958,523.2511306012],"description":"Gamelan slunding, Kengetan, South-Bali. 1/1=378 Hz"},"sankey":{"frequencies":[261.6255653006,274.88665260982,292.54735824399,309.58527581215,327.03195662575,348.83408706747,366.73895666255,391.24894371175,412.31687950427,437.13741259348,464.79252184829,489.99465727995,523.2511306012],"description":"John Sankey's Scarlatti tuning, personal evaluation based on d'Alembert's"},"santur1":{"frequencies":[261.6255653006,282.02765077995,319.3201344739,347.21689301951,376.46192220133,427.47393558663,475.68393915562,504.55222794679,523.2511306012],"description":"Persian santur tuning. 1/1=E"},"santur2":{"frequencies":[261.6255653006,281.2143451833,317.48098583281,345.21700307457,375.37611551499,423.78627283082,475.68393915562,498.18106573801,523.2511306012],"description":"Persian santur tuning. 1/1=E"},"sanza":{"frequencies":[261.6255653006,293.15632631094,308.97787266236,346.21547002486,390.18821123181,462.40922843744,524.46149515038,595.18445928535,620.10113226249],"description":"African N'Gundi Sanza (idiophone; set of lamellas, thumb-plucked)"},"sanza2":{"frequencies":[261.6255653006,390.63923480058,465.35666077712,523.2511306012,588.68812410589,663.45725712889,702.9084786129,783.08569314515],"description":"African Baduma Sanza (idiophone, like mbira)"},"sauveur":{"frequencies":[261.6255653006,274.85950244128,292.7026939092,313.25286195357,328.80795208256,349.69755047152,367.27338607435,391.35133250294,417.15885134862,438.29716799286,468.84228427561,491.11646492505,523.2511306012],"description":"Sauveur's tempered system of the harpsichord. Trait� (1697)"},"sauveur2":{"frequencies":[261.6255653006,278.64199172491,293.04864983565,312.10886966906,328.2456799168,349.5951549002,372.33322418948,391.58401058733,417.05308314313,438.61577206336,467.14384425417,491.2966347616,523.2511306012],"description":"Sauveur's Syste^me Chromatique des Musiciens (Memoires 1701), 12 out of 55."},"sauveur_17":{"frequencies":[261.6255653006,275.62199471997,290.36720431405,294.32876096318,310.07474405997,326.6631048533,331.11985608357,348.83408706747,367.49599295996,372.50983809402,392.4383479509,413.43299207996,419.07356785577,441.49314144476,465.11211608996,489.99465727995,496.67978412536,523.2511306012],"description":"Sauveur's oriental system, aft. Kitab al-adwar (Bagdad 1294) by Safi al-Din"},"sauveur_ji":{"frequencies":[261.6255653006,272.52663052146,294.32876096318,313.95067836072,327.03195662575,348.83408706747,367.91095120397,392.4383479509,418.60090448096,436.04260883433,470.92601754108,490.54793493862,523.2511306012],"description":"Aplication des sons harmoniques aux jeux d'orgues (1702) (PB 81/80 & 128/125)"},"savas_bardiat":{"frequencies":[261.6255653006,282.57123920205,317.17549194805,349.22823143301,391.99543598175,423.37848741825,475.22628419761,523.2511306012],"description":"Savas's Byzantine Liturgical mode, 8 + 12 + 10 parts"},"savas_barenh":{"frequencies":[261.6255653006,282.57123920205,329.62755691287,349.22823143301,391.99543598175,423.37848741825,493.88330125613,523.2511306012],"description":"Savas's Byzantine Liturgical mode, 8 + 16 + 6 parts"},"savas_chrom":{"frequencies":[261.6255653006,282.57123920205,323.3415889232,349.22823143301,391.99543598175,423.37848741825,484.46499093218,523.2511306012],"description":"Savas's Chromatic, Byzantine Liturgical mode, 8 + 14 + 8 parts"},"savas_diat":{"frequencies":[261.6255653006,288.06460709314,311.12698372208,349.22823143301,391.99543598175,431.60923940535,466.16376151809,523.2511306012],"description":"Savas's Diatonic, Byzantine Liturgical mode, 10 + 8 + 12 parts"},"savas_palace":{"frequencies":[261.6255653006,277.18263097687,336.03572815422,349.22823143301,391.99543598175,415.30469757995,503.48470957687,523.2511306012],"description":"Savas's Byzantine Liturgical mode, 6 + 20 + 4 parts"},"scalatron":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,294.32876096318,306.59245933664,313.95067836072,327.03195662575,340.65828815182,348.83408706747,367.91095120397,376.74081403286,392.4383479509,408.78994578219,418.60090448096,436.04260883433,459.88868900496,470.92601754108,490.54793493862,510.98743222773,523.2511306012],"description":"Scalatron (tm) 19-tone scale, see manual, 1974"},"scheengaas":{"frequencies":[261.6255653006,273.84069463911,292.6487650037,312.74862113192,327.53979283172,350.03605285217,366.8025131876,391.54284657258,418.19337019276,437.97145880542,467.51204131067,489.62261321254,523.2511306012],"description":"Scheengaas' variation"},"scheffer":{"frequencies":[261.6255653006,274.56546814423,292.86978442859,309.86465789076,327.84548435462,349.70179235499,366.99791252626,391.46460164194,410.82629477826,438.21464222188,467.42914467878,490.54793493862,523.2511306012],"description":"H.Th. Scheffer (1748) modified 1/5-comma temperament, Sweden"},"schidlof":{"frequencies":[261.6255653006,264.89588486686,274.70684356563,280.31310567921,294.32876096318,305.22982618403,315.35224388912,322.99452506247,327.03195662575,348.83408706747,353.19451315581,366.27579142084,373.75080757229,392.4383479509,406.97310157871,420.46965851882,436.04260883433,457.84473927605,467.18850946536,484.4917875937,490.54793493862,523.2511306012],"description":"Schidlof"},"schillinger":{"frequencies":[261.6255653006,262.8879410321,275.85161280553,277.18263097687,278.52007147562,292.25460328695,293.66476791741,295.08173676673,309.63296633914,311.12698372208,312.62820992379,328.04470063332,329.62755691287,331.21805066987,347.55125362114,349.22823143301,350.91330087035,368.21772660991,369.99442271164,371.77969159194,390.11309203208,391.99543598175,393.88686247394,413.31042363438,415.30469757995,417.30859414412,437.88714035463,440,442.12305445465,463.92526470026,466.16376151809,468.41305936011,491.51169649079,493.88330125613,496.26634930797,520.73850287792,523.2511306012],"description":"Joseph Schillinger's double equal temperament, p.664 Mathematical Basis..."},"schis41":{"frequencies":[261.6255653006,266.96486255163,272.52663052146,275.21650375777,280.31310567921,285.40970760065,290.69507255622,294.32876096318,299.00064605783,305.22982618403,311.45900631024,313.95067836072,321.08592105074,327.03195662575,329.64821227876,336.37572681506,343.38355445704,348.83408706747,355.95315006884,363.36884069528,366.27579142084,373.75080757229,380.54627680087,387.59343007496,392.4383479509,398.6675280771,406.97310157871,415.27867508032,418.60090448096,428.11456140098,436.04260883433,441.49314144476,448.50096908674,457.84473927605,465.11211608996,470.92601754108,484.4917875937,490.54793493862,497.4115685962,504.56359022259,512.78610798918,523.2511306012],"description":"41&53 <<1 -8 -14 23 -15 -25 33 -10 81 113||"},"schisynch17":{"frequencies":[261.6255653006,275.80289341725,290.74848220557,294.25152581512,310.19683462128,327.0062098829,330.94609980123,348.87986495302,367.78544978395,387.71551660339,392.38685458718,413.65005636851,436.06549769577,441.31937388998,465.23419873014,490.4449531872,496.35401261224,523.2511306012],"description":"fifth satisfies f^9 + f^8 - 64 = 0"},"schlick":{"frequencies":[261.6255653006,275.62199471997,293.00227310437,311.47852302926,328.14198392915,349.6228209638,367.9112241576,391.5530240856,414.36778843034,438.51190905657,466.69047534984,491.10256480205,523.2511306012],"description":"Reconstructed temp. A. Schlick, Spiegel d. Orgelmacher und Organisten (1511)"},"schlick2":{"frequencies":[261.6255653006,275.31092272332,293.00227310437,311.83045953724,328.14198392915,349.6228209638,367.9112241576,391.5530240856,415.30469757995,438.51190905657,466.69047534984,491.10256480205,523.2511306012],"description":"Schlick's temperament reconstructed by F.J. Ratte (1991)"},"schlick3":{"frequencies":[261.6255653006,275.31092431358,293.00227310437,311.83045953724,328.14198392915,349.6228209638,367.70355049744,391.5530240856,415.07027187895,438.51190905657,466.95405539699,491.10256480205,523.2511306012],"description":"Possible well-tempered interpretation of 1555 tuning, Margo Schulter"},"schlick4":{"frequencies":[261.6255653006,275.29566620843,293.00166043901,311.83758337792,328.14192706649,349.6222474261,367.6987228158,391.55300599201,415.35839309639,438.51185079886,466.95962791236,491.10245700671,523.2511306012],"description":"Another reconstructed Schlick's modified meantone (Poletti?)"},"scholz":{"frequencies":[261.6255653006,271.31540105247,299.00064605783,305.22982618403,348.83408706747,392.4383479509,406.97310157871,457.84473927605,523.2511306012],"description":"Simple Tune #1 Carter Scholz"},"scholz_epi":{"frequencies":[261.6255653006,1046.5022612024,1308.127826503,1569.7533918036,1831.3789571042,2093.0045224048,2354.6300877054,2616.255653006,2877.8812183066,3139.5067836072,3401.1323489078,3662.7579142084,3924.383479509,4186.0090448096,4709.2601754108,5232.511306012,5494.1368713126,5755.7624366132,6279.0135672144,6540.639132515,6802.2646978156,7063.8902631162,7325.5158284168,8372.0180896192,8633.6436549198,9156.894785521,9418.5203508216,10203.3970467234,10465.022612024,10988.2737426252,11511.5248732264,11773.150438527,12558.0271344288,12819.6526997294,13081.27826503,14127.7805262324,14389.406091533,14651.0316568336,16482.4106139378,16744.0361792384,17005.661744539],"description":"Carter Scholz, Epimore"},"schulter":{"frequencies":[261.6255653006,277.184065539,293.66520219021,311.12905403417,329.62853176407,349.23107169224,369.99606406306,391.99572582396,415.30715405467,440.00097595231,466.1672081452,493.88512703986,523.25577305438],"description":"Margo Schulter's 5-limit JI virt. ET, \"scintilla of Artusi\" tempered 22-08-98"},"schulter_17":{"frequencies":[261.6255653006,272.43653907335,282.13181390574,295.15344695336,308.77608605158,319.09647917983,332.97799220076,348.34640884647,361.82138782225,375.64984936577,392.98775403209,410.26687922759,423.79017189188,443.34998408798,463.81254988138,480.53289366295,500.16624277499,523.2511306012],"description":"Neo-Gothic well-temperament (14:11, 9:7 hypermeantone fifths) TL 04-09-2000"},"schulter_24":{"frequencies":[261.6255653006,270.06509966514,283.8170195002,292.97240722602,295.75063903546,305.22982618403,307.79478270659,317.68818643644,334.29933343966,345.08318290545,348.06842720833,359.29644098925,377.90359432309,390.09403284964,393.30161007617,406.07983174306,426.86276443782,440.63253103259,444.76346101102,458.66231916761,462.87600014722,477.80748402293,502.32108537715,518.89070451286,523.2511306012],"description":"Rational intonation (RI) scale with some \"17-ish\" features (24 notes)"},"schulter_cart34":{"frequencies":[261.6255653006,270.08718526646,272.51337835337,281.3271372098,283.85429714132,293.03484945212,295.66718139806,305.22982618403,307.97166902637,317.93223698752,320.78822215662,331.16330924834,334.13814720468,344.94500399825,348.04364484358,359.30023993517,362.52783176564,374.2528814026,377.61479489998,389.82779436071,393.32961502355,406.05087076101,409.69842558521,422.94908927295,426.7484383229,440.55054172958,444.50800708553,458.88449901367,463.0066556268,477.98143975034,482.27514684959,497.87312179111,502.34551296122,518.59261334435,523.2511306012],"description":"\"Carthesian tuning\" with two 17-tET chains 55.106 cents apart"},"schulter_diat7":{"frequencies":[261.6255653006,295.1673044417,332.97799220076,348.83408706747,392.4383479509,442.75095666255,499.46698830115,523.2511306012],"description":"Diatonic scale, symmetrical tetrachords based on 14/11 and 13/11 triads"},"schulter_ham":{"frequencies":[261.6255653006,272.52663052146,283.8170195002,295.75063903546,307.79478270659,320.70230585235,334.29933343966,348.01136516401,362.25078272391,377.90359432309,393.36609818246,409.50088481833,426.86276443782,444.76346101102,462.87600014722,482.33849075995,502.32108537715,523.2511306012],"description":"New rational tuning of \"Hammond organ type\", TL 01-03-2002"},"schulter_jot17a":{"frequencies":[261.6255653006,271.31540105247,281.75060878526,295.1673044417,305.22982618403,318.50068819203,332.97799220076,348.83408706747,361.75386806997,375.66747838035,392.4383479509,406.97310157871,422.62591317789,442.75095666255,457.84473927605,477.75103228805,499.46698830115,523.2511306012],"description":"Just octachord tuning -- 4:3-9:8-4:3 division, 17 steps (7 + 3 + 7), Bb-Bb"},"schulter_jot17bb":{"frequencies":[261.6255653006,271.31540105247,281.75060878526,295.15228855401,305.22982618403,318.50068819203,332.97799220076,348.83408706747,361.75386806997,375.66747838035,392.4383479509,406.97310157871,422.62591317789,442.72843283101,457.84473927605,477.75103228805,499.46698830115,523.2511306012],"description":"\"Just Octachord Tuning\" (Bb-Eb, F-Bb) -- 896:891 divided into 1792:1787:1782"},"schulter_jwt17":{"frequencies":[261.6255653006,272.43653907335,282.34838235411,295.1673044417,308.34441624714,319.76457981184,332.97799220076,347.8430811383,362.25078272391,376.08675011961,393.55640592227,409.81906732402,425.14154361347,443.97065626768,462.87600014722,481.6288815761,500.8899711738,523.2511306012],"description":"\"Just well-tuned 17\" circulating system"},"schulter_lin76-34":{"frequencies":[261.6255653006,270.6250663876,281.88470155261,291.58108453077,295.07956188513,305.22982618403,308.89206602106,319.51745915009,332.81131277165,344.25948974019,348.39001840879,360.3740779397,375.36781334896,388.27986588625,392.93856423817,406.45502016129,423.36600317146,437.92911415628,443.18352164838,458.42832346067,463.9286840578,479.88708893184,499.85328649772,517.04744024951,523.2511306012],"description":"Two 12-note chains, ~704.160 cents, 34 4ths apart (32 4ths = 7:6), TL 29-11-02"},"schulter_pel":{"frequencies":[261.6255653006,271.31540105247,305.22982618403,392.4383479509,406.97310157871,523.2511306012],"description":"Just pelog-style Phrygian pentatonic"},"schulter_pepr":{"frequencies":[261.6255653006,270.64528702739,281.81099471089,291.52662303231,295.05751399041,305.22982618403,308.92668738628,319.57714790608,332.76158224462,344.23376719628,348.40303271111,360.41446953256,375.28368107222,388.22184469544,392.9238840789,406.47020586181,423.23948674937,437.83095983374,443.13385158124,458.41119660824,463.96335069158,479.95880706014,499.75992392917,516.98949183803,523.2511306012],"description":"Peppermint 24: Wilson/Pepper apotome/limma=Phi, 2 chains spaced for pure 7:6"},"schulter_qcm62a":{"frequencies":[261.6255653006,262.43934012943,267.90457886781,268.73788454005,273.37431312998,274.22463192287,279.93529690293,280.80602334765,285.65065877038,286.53916259713,292.50627485027,293.41610276971,299.52642572255,300.45808951291,305.64177427204,306.59245933664,312.977175335,313.95067836072,320.36052345918,320.48862783822,327.03195662575,328.04917632434,334.88072358477,335.92235492515,341.71789064962,342.78078913836,349.91912034749,351.00752840096,358.31717956585,359.43170941363,365.63284274659,366.77012764335,374.40803131735,375.5726110527,382.05221698715,383.2405741708,391.22147055517,392.4383479509,400.61078621746,401.85686830172,408.78994578219,410.06146948999,418.60090448096,419.90294514449,427.14736482575,428.47598794138,437.39890198442,438.75941205608,447.89647345742,449.28963835923,457.04105241293,458.46266117889,468.01003810189,469.46576276783,479.24227945773,480.73294151703,489.02683710225,490.54793493862,500.76348165392,502.32108537715,510.98743222773,512.57683571821,523.2511306012],"description":"1/4-comma meantone, two 31-notes at 1/4-comma (Vicentino-like system)"},"schulter_qcmlji24":{"frequencies":[261.6255653006,262.43934012943,273.37431312998,274.22463192287,292.50627485027,293.41610276971,306.59245933664,312.977175335,327.03195662575,328.04917632434,349.91912034749,351.00752840096,365.63284274659,366.77012764335,391.22147055517,392.4383479509,408.78994578219,410.06146948999,437.39890198442,438.75941205608,458.46266117889,468.01003810189,489.02683710225,490.54793493862,523.2511306012],"description":"24-note adaptive JI (Eb-G#/F'-A#') for Lasso's Prologue to _Prophetiae_"},"schulter_qcmqd8_4":{"frequencies":[261.6255653006,273.37431312998,292.50627485027,309.28772967674,327.03195662575,349.91912034749,365.63284274659,391.22147055517,411.22091428214,437.39890198442,465.24335632603,489.02683710225,523.2511306012],"description":"F-C# in 1/4-comma meantone, other 5ths ~4.888 cents wide or (2048/2025)^(1/4)"},"schulter_sq":{"frequencies":[261.6255653006,271.31540105247,279.38237857051,289.72987407313,294.32876096318,305.22982618403,310.07474405997,325.94610833227,331.11985608357,343.38355445704,348.83408706747,361.75386806997,372.50983809402,386.30649876417,392.4383479509,406.97310157871,419.07356785577,434.59481110969,441.49314144476,457.84473927605,465.11211608996,488.9191624984,496.67978412536,515.07533168556,523.2511306012],"description":"\"Sesquisexta\" tuning, two 12-tone Pyth. manuals a 7/6 apart. TL 16-5-2001"},"schulter_tedorian":{"frequencies":[261.6255653006,295.99553712036,309.28772789022,347.85054122562,393.54796334264,442.61656607198,462.49302735707,523.2511306012],"description":"Eb Dorian in temperament extraordinaire -- neo-medieval style"},"schulter_zarte84":{"frequencies":[261.6255653006,272.52663052146,292.24684137387,308.87634556583,326.45210604021,350.07440004945,364.66083404534,391.04793957621,410.30971075781,436.81711699543,465.03699205118,487.94322738789,523.2511306012],"description":"Temperament extraordinaire, Zarlino's 2/7-comma meantone (F-C#)"},"schulter_zarte84n":{"frequencies":[261.6255653006,272.46997760396,292.1447183254,308.81896225817,326.44489157977,350.01709816983,364.52535053201,391.11195868293,410.09013064752,436.73596474349,465.11312402839,488.01232708701,523.2511306012],"description":"Zarlino temperament extraordinaire, 1024-tET mapping"},"scotbag":{"frequencies":[261.6255653006,290.69507255622,327.03195662575,356.76213450082,387.59343007496,436.04260883433,479.64686971777,523.2511306012],"description":"Scottish bagpipe tuning"},"scotbag2":{"frequencies":[261.6255653006,290.69507255622,319.76457981184,348.83408706747,392.4383479509,428.11456140098,470.92601754108,523.2511306012],"description":"Scottish bagpipe tuning 2"},"scotbag3":{"frequencies":[261.6255653006,294.32876096318,327.03195662575,359.73515228832,392.4383479509,441.49314144476,479.64686971777,523.2511306012],"description":"Scottish bagpipe tuning 3"},"scotbag4":{"frequencies":[261.6255653006,293.15632631094,318.58319997217,348.2210758395,392.67530119805,428.21545238314,468.59347232539,523.2511306012],"description":"Scottish Higland Bagpipe by Macdonald, Edinburgh. Helmholtz/Ellis p. 515, nr.52"},"scottd1":{"frequencies":[261.6255653006,275.93341798027,292.67158636845,310.42509491746,327.40170814054,349.22823143301,367.9112241576,391.5530240856,413.90012676351,437.52264545758,465.63764214343,490.54829628849,523.2511306012],"description":"Dale Scott's temperament 1, TL 9-6-1999"},"scottd2":{"frequencies":[261.6255653006,276.1828093671,292.93610587951,310.70566022736,327.9937953665,349.3071136959,368.24374600687,391.64146650178,414.27421384356,438.21489534465,466.05849010807,491.32444638706,523.2511306012],"description":"Dale Scott's temperament 2, TL 9-6-1999"},"scottd3":{"frequencies":[261.6255653006,276.40121172404,293.16775656083,310.95136287868,328.51274831708,349.22813057195,368.53494914961,391.77416758435,414.60181737882,438.75957425603,466.42704408487,491.93513777943,523.2511306012],"description":"Dale Scott's temperament 3, TL 9-6-1999"},"scottd4":{"frequencies":[261.6255653006,276.60439543337,293.30494246724,310.98285414553,328.78580734933,349.37474066871,369.05201453919,391.83105388699,414.77686160481,439.10664961187,466.16991430388,492.5350487994,523.2511306012],"description":"Dale Scott's temperament 4, TL 9-6-1999"},"scottj":{"frequencies":[261.6255653006,294.32876096318,336.37572681506,348.83408706747,392.4383479509],"description":"Jeff Scott's \"seven and five\" tuning, fifth-repeating. TL 20-04-99"},"scottj2":{"frequencies":[261.6255653006,290.69507255622,299.00064605783,305.22982618403,313.95067836072,348.83408706747,366.27579142084,406.97310157871,418.60090448096,428.11456140098,436.04260883433,485.87604984397,523.2511306012,566.85539148463,581.39014511244,598.00129211566,610.45965236807,680.22646978156,719.47030457665,784.8766959018],"description":"Jeff Scott's \"just tritone/13\" tuning. TL 17-03-2001"},"secor12_1":{"frequencies":[261.6255653006,275.03488264166,292.74290192225,310.07362690431,327.56128791316,349.21167447253,366.91716522699,391.37968062521,412.76363757129,437.92977184699,465.61556619611,490.01645577464,523.2511306012],"description":"George Secor's 12-tone temperament ordinaire #1, proportional beating"},"secor12_2":{"frequencies":[261.6255653006,275.62199471997,292.79557634972,310.07474405997,327.35540669465,348.83408706747,367.49599295996,391.60840570078,413.43299207996,437.83150862942,465.11211608996,489.99465727995,523.2511306012],"description":"George Secor's closed 12-tone well-temperament #2, with 7 just fifths"},"secor12_3":{"frequencies":[261.6255653006,274.49585366342,292.50627485027,309.76836826904,327.03195662575,349.57337698802,365.99447173417,391.22147055517,411.74378028931,437.39890198442,466.09783352473,489.02683710225,523.2511306012],"description":"George Secor's closed 12-tone temperament #3 with 5 meantone, 3 just, and 2 wide fifths"},"secor17htt1":{"frequencies":[261.6255653006,266.21235100401,283.6936382117,294.88137067808,304.94368688875,319.75456524059,327.03195662575,348.50707605838,360.3992766165,372.69727792826,392.80658053205,399.69321489333,425.93975025566,435.63385416574,457.84473927605,480.08189580921,491.0082387498,523.2511306012],"description":"George Secor's 17-tone high-tolerance temperament subset #1 on C (5/4 & 7/4 exact)"},"secor17htt2":{"frequencies":[261.6255653006,266.21235100401,279.78524030783,294.88137067808,300.05119287674,319.75456524059,327.03195662575,348.50707605838,360.3992766165,372.69727792826,392.80658053205,399.69321489333,425.93975025566,442.73709545768,457.84473927605,480.08189580921,491.0082387498,523.2511306012],"description":"George Secor's 17-tone high-tolerance temperament subset #2 on Eo (5/4 & 7/4 exact)"},"secor17htt3":{"frequencies":[261.6255653006,270.55308473255,279.78524030783,294.88137067808,300.05119287674,319.75456524059,327.03195662575,343.70575469589,360.3992766165,368.60172104124,392.80658053205,399.69321489333,425.93975025566,442.73709545768,457.84473927605,480.08189580921,491.0082387498,523.2511306012],"description":"George Secor's 17-tone high-tolerance temperament subset #3 on G (5/4 & 7/4 exact)"},"secor17htt4":{"frequencies":[261.6255653006,270.55308473255,279.78524030783,294.88137067808,300.05119287674,319.75456524059,332.36439517321,343.70575469589,360.3992766165,368.60172104124,392.80658053205,399.69321489333,420.07165483694,442.73709545768,450.49910517366,480.08189580921,491.0082387498,523.2511306012],"description":"George Secor's 17-tone high-tolerance temperament subset #4 on Bo (5/4 & 7/4 exact)"},"secor17wt":{"frequencies":[261.6255653006,271.90848849519,284.45827635845,296.12458543709,307.25838681362,320.91221742866,335.17278980765,347.77473997341,362.0378075073,378.74746489181,393.63374363584,408.43373030454,427.2847686483,445.53990619223,462.29147990415,482.0422296857,504.29062567056,523.2511306012],"description":"George Secor's well temperament with 5 pure 11/7 and 3 near just 11/6"},"secor19wt":{"frequencies":[261.6255653006,272.32755795875,282.27948808054,292.18583194851,304.13791554835,314.37102040472,326.31582004031,339.6640167515,350.11094753355,364.43250202589,378.27942889874,391.0071187494,407.00156221801,421.24111755476,436.68033801788,454.54308187078,469.17957429271,487.6886112017,506.92782577841,523.2511306012],"description":"George Secor's 19-tone well temperament with ten 5/17-comma fifths"},"secor19wt1":{"frequencies":[261.6255653006,272.32845615788,282.22605479514,292.18610873661,304.13920677667,314.3856167727,326.31643450984,339.6657766488,350.11078170334,364.43353349925,378.23315721313,391.00730395019,407.00309738029,421.33223555387,436.68095599763,454.54522431957,469.16941157468,487.689760539,506.89867708289,523.2511306012],"description":"George Secor's 19-tone proportional-beating (5/17-comma) well temperament (v.1)"},"secor19wt2":{"frequencies":[261.6255653006,272.32845615788,282.22605479514,292.18610873661,304.13920677667,314.27577204952,326.31643450984,339.6657766488,350.11078170334,364.43353349925,378.23315721313,391.00730395019,407.00309738029,421.20165315727,436.68095599763,454.54522431957,469.03541436973,487.689760539,506.89867708289,523.2511306012],"description":"George Secor's 19-tone proportional-beating (5/17-comma) well temperament (v.2)"},"secor1_4tx":{"frequencies":[261.6255653006,274.52656755164,292.65557420835,309.65910769439,327.20096538886,349.14957009195,366.50113643833,391.42429537222,412.04336447213,437.62002395673,465.5327601226,489.58458498887,523.2511306012],"description":"George Secor's rational 1/4-comma temperament extraordinaire"},"secor1_5tx":{"frequencies":[261.6255653006,275.23833828784,292.86443876933,310.12174699459,327.84546895566,349.26796031009,366.98445105045,391.462133155,412.85750743176,438.21197504744,465.69061374678,490.54793493862,523.2511306012],"description":"George Secor's 1/5-comma temperament extraordinaire (ratios supplied by G. W. Smith)"},"secor1_5wt":{"frequencies":[261.6255653006,275.62199471997,292.86443876933,310.07474405997,327.84546895566,348.83408706747,367.44664657419,391.462133155,413.43299207996,438.21197504744,465.11211608996,490.54793493862,523.2511306012],"description":"George Secor's 1/5-comma well-temperament (ratios supplied by G. W. Smith)"},"secor1_7wt":{"frequencies":[261.6255653006,276.40791719395,293.28186156416,310.6264877857,328.77715667764,349.45479875891,368.54388959194,391.74026793015,414.61187579093,439.14616729155,465.93973167855,492.29203182992,523.2511306012],"description":"George Secor's 1/7-comma well-temperament (ratios supplied by G. W. Smith)"},"secor22_19p3":{"frequencies":[261.6255653006,266.86058412305,272.32845615788,282.28026746552,292.18610873661,304.13920677667,314.37137994881,326.31643450984,339.6657766488,350.11078170334,357.11635499175,364.43353349925,378.28077924825,391.00730395019,407.00309738029,421.28573964817,436.68095599763,454.54522431957,469.17973147781,477.89781576412,487.689760539,506.93004530576,523.2511306012],"description":"George Secor's 19+3 well temperament with ten ~5/17-comma (equal-beating) fifths and 3 pure 9:11. TL 28-6-2002,26-10-2006. Aux=1,10,19"},"secor22_ji29":{"frequencies":[261.6255653006,272.52663052146,283.42769574232,286.15296204753,294.32876096318,305.22982618403,316.13089140489,327.03195662575,340.65828815182,348.83408706747,359.73515228832,370.63621750918,381.53728273004,392.4383479509,414.24047839262,425.14154361347,436.04260883433,441.49314144476,457.84473927605,479.64686971777,490.54793493862,501.44900015948,523.2511306012],"description":"George Secor's 22-tone just intonation (29-limit otonality on 4/3)"},"secor29htt":{"frequencies":[261.6255653006,270.55308473255,276.71069203503,283.6936382117,290.1503157249,294.88137067808,304.94368688875,310.54087273367,319.75456524059,327.03195662575,332.36439517321,343.70575469589,348.50707605838,360.3992766165,368.60172104124,377.19539564757,387.3949548402,392.80658053205,406.21042497925,415.4555026381,425.93975025566,435.63385416574,442.73709545768,457.84473927605,464.24049278842,480.08189580921,491.0082387498,499.01438878341,516.04239079678,523.2511306012],"description":"George Secor's 29-tone 13-limit high-tolerance temperament (5/4 & 7/4 exact)"},"secor2_11wt":{"frequencies":[261.6255653006,275.91396717201,292.9984614786,310.40321306851,328.14053952957,349.20361470207,367.88528956268,391.55148162785,413.87095075801,438.50612639837,465.60481960276,491.10222639053,523.2511306012],"description":"George Secor's rational 2/11-comma well-temperament"},"secor41htt":{"frequencies":[261.6255653006,266.21235100401,270.55308473255,276.71069203503,279.78524030783,283.6936382117,290.1503157249,294.88137067808,300.05119287674,304.94368688875,310.54087273367,315.34936221801,319.75456524059,327.03195662575,332.36439517321,338.19136297459,343.70575469589,348.50707605838,354.61705516636,360.3992766165,368.60172104124,372.69727792826,377.90358994896,387.3949548402,392.80658053205,399.69321489333,406.21042497925,415.4555026381,420.07165483694,425.93975025566,435.63385416574,442.73709545768,450.49910517366,457.84473927605,464.24049278842,473.46789104304,480.08189580921,491.0082387498,499.01438878341,507.7630447553,516.04239079678,523.2511306012],"description":"George Secor's 13-limit high-tolerance temperament superset (5/4 & 7/4 exact)"},"secor5_23tx":{"frequencies":[261.6255653006,275.02417915696,292.7420830065,310.0721322444,327.56084927797,349.21018850905,366.91927748105,391.38056264645,412.75664067387,437.92311604224,465.61358467873,490.0190422864,523.2511306012],"description":"George Secor's rational 5/23-comma temperament extraordinaire"},"secor5_23wt":{"frequencies":[261.6255653006,275.62199471997,292.75872440224,310.07474405997,327.56278518065,348.83408706747,367.49599295996,391.3766908411,413.43299207996,437.81158306864,465.11211608996,489.99465727995,523.2511306012],"description":"George Secor's rational 5/23-comma proportional-beating well-temperament"},"secor7p":{"frequencies":[261.6255653006,281.10327891957,302.03108525935,356.94582815655,383.52002471837,412.07263653985,442.75095666255,523.2511306012],"description":"George Secor's pelog-like MOS with near just 11:13:15:19 tetrads (1979)"},"secor_vrwt":{"frequencies":[261.6255653006,276.32932769153,293.15777167588,310.55777256823,328.11844153148,349.04269216937,368.62018440632,392.00375398861,414.25255044712,438.65017260809,465.6191423793,491.6947801169,523.2511306012],"description":"George Secor's Victorian rational well-temperament (based on Ellis #2)"},"secor_wt1-7":{"frequencies":[261.6255653006,276.2204353545,293.2843722634,310.74798946314,328.77415062671,349.45463702831,368.55847674989,391.74146894101,414.33065282463,439.14535139523,466.13275379077,492.28548658217,523.2511306012],"description":"George Secor's 1/7-comma well-temperament"},"secor_wt10":{"frequencies":[261.6255653006,276.4188590209,293.2843722634,310.62634254146,328.77415062671,349.45463500978,368.55847887877,391.7414712038,414.6282883241,439.14535393183,465.93951357928,492.28548942572,523.2511306012],"description":"George Secor's 12-tone well-temperament, proportional beating"},"secor_wtpb-24a":{"frequencies":[261.6255653006,275.62199471997,292.84836938997,310.07474405997,327.30111872997,348.83408706747,367.49599295996,391.90002374246,413.43299207996,437.54991661796,465.11211608996,490.95167809495,523.2511306012],"description":"George Secor's 24-triad proportional-beating well-temperament (24a)"},"secor_wtpb-24b":{"frequencies":[261.6255653006,275.62199471997,292.56126314547,310.07474405997,327.51644841334,348.83408706747,367.49599295996,391.46936437571,413.43299207996,437.76524630133,465.11211608996,490.37746560595,523.2511306012],"description":"George Secor's 24-triad proportional-beating well-temperament (24b)"},"segah":{"frequencies":[261.6255653006,293.66476791741,320.24370022528,349.22823143301,391.99543598175,440,479.82340237272,523.2511306012],"description":"Arabic SEGAH (Dudon) Two 4 + 3 + 3 tetrachords"},"segah2":{"frequencies":[261.6255653006,293.66476791741,318.39923223688,349.22823143301,391.99543598175,425.01198472693,466.16376151809,523.2511306012],"description":"Iranian mode Segah from C"},"segah_rat":{"frequencies":[261.6255653006,294.32876096318,319.76457981184,348.83408706747,392.4383479509,441.49314144476,479.64686971777,523.2511306012],"description":"Rationalized Arabic Seg�h\r"},"seidel974":{"frequencies":[261.6255653006,262.64754016506,266.73543962288,267.75741448733,268.77938935179,273.88926367407,274.91123853852,276.95518826743,277.97716313189,280.0211128608,283.08703745416,284.10901231862,285.13098718308,287.17493691199,289.2188866409,290.24086150535,294.32876096318,457.84473927605,461.93263873387,463.97658846278,468.0644879206,474.19633710734,476.24028683625,482.37213602298,486.4600354808,488.50398520971,492.59188466754,498.72373385427,506.89953276991,513.03138195665,515.07533168556,519.16323114338,523.2511306012],"description":"Dave Seidel, Base 9:7:4 Symmetry, scale for Passacaglia and Fugue State (2005)"},"seikilos":{"frequencies":[261.6255653006,271.31540105247,294.32876096318,305.22982618403,336.37572681506,348.83408706747,356.10146388137,392.4383479509,406.97310157871,441.49314144476,457.84473927605,504.56359022259,523.2511306012],"description":"Seikilos Tuning"},"sekati1":{"frequencies":[261.6255653006,285.2147362526,318.99014578736,340.97107458785,383.86043226246,424.60539155549,468.56721805116,523.2511306012],"description":"Gamelan sekati from Sumenep, East-Madura. 1/1=244 Hz."},"sekati2":{"frequencies":[261.6255653006,288.87830434024,317.34219433319,357.31261688157,393.64955765984,420.29657220667,469.35141988267,523.2511306012],"description":"Gamelan Kyahi Sepuh from kraton Solo. 1/1=216 Hz."},"sekati3":{"frequencies":[261.6255653006,291.90272733088,308.20569577938,369.53649673407,403.69531865382,425.43272843735,475.11832680028,523.2511306012],"description":"Gamelan Kyahi Henem from kraton Solo. 1/1=168.5 Hz."},"sekati4":{"frequencies":[261.6255653006,271.36353278789,288.89182053123,342.12578909252,379.12979967788,410.29128883625,439.50493264224,523.2511306012],"description":"Gamelan Kyahi Guntur madu from kraton Jogya. 1/1=201.5 Hz."},"sekati5":{"frequencies":[261.6255653006,274.79663866182,311.31645994273,355.61927540077,375.97459751383,397.52718524897,433.44837981883,523.2511306012],"description":"Gamelan Kyahi Naga Ilaga from kraton Jogya. 1/1=218.5 Hz."},"sekati6":{"frequencies":[261.6255653006,284.57524936299,310.80330758934,358.01400474517,390.79902205709,427.51850178351,468.18764285778,523.2511306012],"description":"Gamelan Kyahi Munggang from Paku Alaman, Jogya. 1/1=199.5 Hz."},"sekati7":{"frequencies":[261.6255653006,286.67481979642,318.21831168293,371.10013445627,390.58282835584,422.12643845206,463.87524473877,523.2511306012],"description":"Gamelan of Sultan Anom from Cheribon. 1/1=282 Hz."},"sekati8":{"frequencies":[261.6255653006,287.04067548259,315.94410704802,350.82750428678,381.72407804086,425.57749367468,447.5043967797,523.2511306012],"description":"The old Sultans-gamelan Kyahi Suka rame from Banten. 1/1=262.5 Hz."},"sekati9":{"frequencies":[261.6255653006,280.44107893528,310.90439774384,346.74342440827,376.31071188751,412.14996063869,455.1567650372,523.2511306012],"description":"Gamelan Sekati from Katjerbonan, Cheribon. 1/1=292 Hz."},"selisir":{"frequencies":[261.6255653006,278.78833362316,320.24370022528,380.8360868427,417.71053321823,524.76452349887],"description":"Gamelan semara pagulingan, Bali. Pagan Kelod"},"selisir2":{"frequencies":[261.6255653006,279.59466973861,299.66214729245,376.46181130035,408.17001145418,520.23742585195],"description":"Gamelan semara pagulingan, Bali. Kamasan"},"selisir3":{"frequencies":[261.6255653006,284.98499077387,305.5412851438,378.42269266694,406.45400323486,523.2511306012],"description":"Gamelan gong, Pliatan, Bali. 1/1=280 Hz, McPhee, 1966"},"selisir4":{"frequencies":[261.6255653006,277.23130136276,295.59098907682,376.373620257,399.32323124828,523.2511306012],"description":"Gamelan gong, Apuan, Bali. 1/1=285 Hz. McPhee, 1966"},"selisir5":{"frequencies":[261.6255653006,275.89605068063,309.19384990071,383.40037296022,406.23315014465,523.2511306012],"description":"Gamelan gong, Sayan, Bali. 1/1=275 Hz. McPhee, 1966"},"selisir6":{"frequencies":[261.6255653006,282.63199755101,312.23197007902,396.25769882774,415.35445602102,523.2511306012],"description":"Gamelan gong, Gianyar, Bali. 1/1=274 Hz. McPhee, 1966"},"semipor1":{"frequencies":[261.6255653006,290.69507255622,313.95067836072,327.03195662575,353.19451315581,392.4383479509,436.04260883433,470.92601754108,523.2511306012],"description":"First 16/15&250/243 = 648/625&250/243 scale"},"semisixths":{"frequencies":[261.6255653006,264.19830736984,270.23055453212,272.88791531122,275.57140613391,281.86332858923,284.63508234504,291.13394747727,293.99686553194,300.70948316519,303.66656221886,306.65272199551,313.65430163898,316.7386758187,323.97054074552,327.15636145846,330.37351240232,337.91669168384,341.23965429995,349.03093233441,352.46319080675,360.51072564419,364.05587272954,367.63587953306,376.02984347246,379.72760059524,388.39764380609,392.21702191873,396.07395857323,405.11722624758,409.10101938242,418.44172684717,422.55654641528,426.71183224275,436.45463212963,440.74658728358,450.80983509489,455.24295209046,465.63718490681,470.21611194415,474.84006394159,485.68174342829,490.45777940536,501.656046885,506.58917188228,511.57080469686,523.2511306012],"description":"Semisixths temperament, 13-limit, g=443.0"},"scalamakesrc2\\semisixths_8":{"frequencies":[261.6255653006,282.20554108354,304.40437778605,337.94858305883,364.53227585368,393.20709362444,436.53702313055,470.87587163898,522.76460573117],"description":"8-note MOS of Semisixths [7, 9, 13, -2, 1, 5] temperament, TOP tuning"},"semisuper":{"frequencies":[261.6255653006,267.78942821112,272.60119889127,277.49943141001,284.03728045772,289.141002119,295.95312328758,301.27095467792,308.36885759663,313.90977919898,321.30545111289,327.07882560827,334.78475653951,340.80033382945,348.82954357113,355.09748450744,363.46353108469,369.99442271164,378.7114412363,385.5163125912,392.44345945086,401.68937424288,408.90712663484,418.54092077997,426.06147005461,436.09942062666,443.93546710474,454.39452662825,462.55931114028,473.45714317395,481.96445416288,493.31947147471,502.18367855499,514.01505508798,523.2511306012],"description":"Semisuper temperament, g=71.146064, p=600, 5-limit"},"semithirds":{"frequencies":[13.75,13.81661017188,13.90316796691,13.99026794524,14.07791366516,14.14611237417,14.23473442257,14.3239115844,14.41364750281,14.48347263281,14.57420816344,14.665512046,14.73655738771,14.82887834882,14.92177776458,15.01525908647,15.08799873642,15.18252139242,15.27763629821,15.37334698758,15.4478213521,15.54459820959,15.64198144101,15.73997475533,15.81622511342,15.91530993122,16.01501558389,16.11534586889,16.19341466585,16.29486248479,16.39694594444,16.47637891809,16.57959953527,16.68346670883,16.78798468204,16.86931199442,16.97499424439,17.08133847,17.18834901569,17.27161584349,17.37981843193,17.48869878298,17.59826134469,17.68351394199,17.7942969746,17.90577393328,18.01794937217,18.10523509614,18.21866011204,18.33279560295,18.42160666689,18.53701356879,18.6531435747,18.77000099922,18.86093005309,18.97908920954,19.09798871479,19.21763298632,19.3107305405,19.43170758802,19.55344264036,19.67594033402,19.77125798984,19.89512013023,20.01975835255,20.14517740386,20.24276822054,20.36958425827,20.49719488615,20.62560496443,20.72552315291,20.85536353332,20.98601745346,21.08768161561,21.21979095359,21.352727802,21.48649759166,21.59058626784,21.72584618454,21.86195334633,21.99891331359,22.10548432428,22.24396995552,22.38332303719,22.52354926226,22.63266180681,22.7744500803,22.91712649141,23.06069686887,23.17241155847,23.3175812365,23.46366023269,23.57732716458,23.72503340608,23.87366512928,24.02322785632,24.1396055475,24.29083432682,24.44301065897,24.59614033986,24.71529329517,24.87012861873,25.02593409262,25.18271565096,25.30471019771,25.46323807533,25.62275923969,25.78327976642,25.90818367164,26.07049216435,26.23381763196,26.36090411207,26.52604894185,26.69222821075,26.85944870765,26.98956598001,27.15864922771,27.32879158412,27.5],"description":"Semithirds temperament, g=193.199615, 5-limit"},"sensisynch19":{"frequencies":[261.6255653006,272.4389540986,281.73678149918,293.38139793239,303.39395317428,313.74821628003,326.71591476706,337.86611241253,351.83064080634,363.83795665907,376.25506171692,391.80626469239,405.17787315281,421.92450060765,436.32398762558,454.35793210906,469.86431365505,485.89989602801,505.98288939536,523.2511306012],"description":"Sensi[19] in synch (brat=-1) tuning, generator ~162/125 satisfies g^9-g^7-4=0"},"serre_enh":{"frequencies":[261.6255653006,265.7783520514,279.06726965397,348.83408706747,392.4383479509,398.6675280771,418.60090448096,523.2511306012],"description":"Dorian mode of the Serre's Enharmonic"},"sev-elev":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,305.22982618403,327.03195662575,336.37572681506,359.73515228832,392.4383479509,406.97310157871,436.04260883433,457.84473927605,490.54793493862,523.2511306012],"description":"\"Seven-Eleven Blues\" of Pitch Palette"},"sha":{"frequencies":[261.6255653006,266.96486255163,280.31310567921,284.82183961519,290.63452941521,294.32876096318,300.33547037059,305.16625703708,320.42456924675,326.96384715385,343.31203882349,348.83408706747,355.95315006884,373.75080757229,392.4383479509,400.44729382745,406.8883429195,420.46965851882,427.23275920923,435.9517939049,457.74938532681,480.63685362987,490.44577048562,498.33441009638,523.2511306012],"description":"Three chains of sqrt(3/2) separated by 10/7"},"shahin":{"frequencies":[261.6255653006,277.01530443593,282.55561052465,294.32876096318,310.50067090621,317.47821407264,328.55303549378,348.83408706747,357.66532977804,371.78369805875,376.74081403286,392.4383479509,415.52295665389,428.11456140098,441.49314144476,463.20591889287,478.90781444856,495.71159741166,523.2511306012],"description":"Mohajeri Shahin Iranian style scale, TL 9-4-2006"},"shahin_wt":{"frequencies":[261.6255653006,276.93928561067,294.25491037444,311.47852302926,329.62755691287,348.92163548373,370.73795561568,392.4383479509,415.30469757995,439.61371330969,467.10055427519,494.44133512215,523.2511306012],"description":"Mohajeri Shahin, well temperament, TL 28-12-2006"},"shalfun":{"frequencies":[261.6255653006,269.43930514995,277.46904793785,285.74220762407,294.32876096318,302.80736724606,311.45900631024,320.30554027987,329.50323085718,338.98103822311,348.83408706747,359.12912189513,369.78878487717,380.87868001252,392.4383479509,404.24222079821,416.2697936366,428.68354137408,441.49314144476,454.4477424016,467.68960547122,481.19471271032,494.94053216156,508.90014647073,523.2511306012],"description":"d'Erlanger vol.5, p.40. After Alexandre ^Salfun (Chalfoun)"},"sharm1c-conm":{"frequencies":[261.6255653006,305.22982618403,318.50068819203,332.97799220076,406.97310157871,430.91269578922,457.84473927605,523.2511306012],"description":"Subharm1C-ConMixolydian"},"sharm1c-conp":{"frequencies":[261.6255653006,313.95067836072,330.47439827444,348.83408706747,418.60090448096,448.50096908674,483.00104363188,523.2511306012],"description":"Subharm1C-ConPhryg"},"sharm1c-dor":{"frequencies":[261.6255653006,319.76457981184,338.57426097725,359.73515228832,383.71749577421,411.12588832951,479.64686971777,547.03527290125,523.2511306012],"description":"Subharm1C-Dorian"},"sharm1c-lyd":{"frequencies":[261.6255653006,309.19384990071,323.91736656265,340.11323489078,382.37582620857,377.90359432309,485.87604984397,503.87145909745,523.2511306012],"description":"Subharm1C-Lydian"},"sharm1c-mix":{"frequencies":[261.6255653006,305.22982618403,318.50068819203,332.97799220076,366.27579142084,457.84473927605,488.36772189445,523.2511306012],"description":"Subharm1C-Mixolydian"},"sharm1c-phr":{"frequencies":[261.6255653006,313.95067836072,330.47439827444,348.83408706747,392.4383479509,483.00104363188,502.32108537715,523.2511306012],"description":"Subharm1C-Phrygian"},"sharm1e-conm":{"frequencies":[261.6255653006,318.50068819203,325.57848126297,332.97799220076,430.91269578922,443.97065626768,457.84473927605,523.2511306012],"description":"Subharm1E-ConMixolydian"},"sharm1e-conp":{"frequencies":[261.6255653006,330.47439827444,339.40613876835,348.83408706747,448.50096908674,465.11211608996,483.00104363188,523.2511306012],"description":"Subharm1E-ConPhrygian"},"sharm1e-dor":{"frequencies":[261.6255653006,338.57426097725,348.83408706747,359.73515228832,383.71749577421,411.12588832951,500.50108144463,511.62332769895,523.2511306012],"description":"Subharm1E-Dorian"},"sharm1e-lyd":{"frequencies":[261.6255653006,323.91736656265,331.81779013735,340.11323489078,382.37582620857,377.90359432309,503.87145909745,513.37846775967,523.2511306012],"description":"Subharm1E-Lydian"},"sharm1e-mix":{"frequencies":[261.6255653006,318.50068819203,325.57848126297,332.97799220076,366.27579142084,488.36772189445,505.20798816668,523.2511306012],"description":"Subharm1E-Mixolydian"},"sharm1e-phr":{"frequencies":[261.6255653006,330.47439827444,339.40613876835,348.83408706747,392.4383479509,502.32108537715,512.57253609913,523.2511306012],"description":"Subharm1E-Phrygian"},"sharm2c-15":{"frequencies":[261.6255653006,327.03195662575,341.25073734861,356.76213450082,392.4383479509,461.69217405988,490.54793493862,523.2511306012],"description":"Subharm2C-15-Harmonia"},"sharm2c-hypod":{"frequencies":[261.6255653006,322.00069575458,334.88072358477,348.83408706747,364.00078650518,380.54627680087,465.11211608996,492.47165233054,523.2511306012],"description":"SHarm2C-Hypodorian"},"sharm2c-hypol":{"frequencies":[261.6255653006,307.79478270659,327.03195662575,348.83408706747,373.75080757229,402.50086969323,475.68284600109,498.33441009638,523.2511306012],"description":"SHarm2C-Hypolydian"},"sharm2c-hypop":{"frequencies":[261.6255653006,336.37572681506,348.83408706747,362.25078272391,376.74081403286,392.4383479509,470.92601754108,495.71159741166,523.2511306012],"description":"SHarm2C-Hypophrygian"},"sharm2e-15":{"frequencies":[261.6255653006,341.25073734861,348.83408706747,356.76213450082,392.4383479509,490.54793493862,506.37206187213,523.2511306012],"description":"Subharm2E-15-Harmonia"},"sharm2e-hypod":{"frequencies":[261.6255653006,334.88072358477,341.71502406609,348.83408706747,364.00078650518,380.54627680087,492.47165233054,507.3950357345,523.2511306012],"description":"SHarm2E-Hypodorian"},"sharm2e-hypol":{"frequencies":[261.6255653006,327.03195662575,337.58137458142,348.83408706747,373.75080757229,402.50086969323,498.33441009638,510.48890790361,523.2511306012],"description":"SHarm2E-Hypolydian"},"sharm2e-hypop":{"frequencies":[261.6255653006,348.83408706747,355.41586229515,362.25078272391,376.74081403286,392.4383479509,495.71159741166,509.10920815252,523.2511306012],"description":"SHarm2E-Hypophrygian"},"sherwood":{"frequencies":[261.6255653006,279.50101530337,292.73346657716,312.73435005323,327.54017122074,349.91920725962,366.48547573919,391.52543233055,418.27599117656,438.07873640926,468.01000025525,490.16733894289,523.65750116998],"description":"Sherwood's improved meantone temperament"},"shrutar":{"frequencies":[261.6255653006,269.80136421624,277.49581689502,285.40970760065,294.32876096318,304.37698984459,313.95067836072,327.03195662575,336.37572681506,348.83408706747,359.73515228832,368.95121675679,379.48299988042,392.4383479509,405.83598431812,417.42065019394,428.11456140098,441.49314144476,457.84473927605,470.92601754108,490.54793493862,505.97733342682,523.2511306012],"description":"Paul Erlich's Shrutar tuning (from 9th fret) tempered with Dave Keenan"},"shrutar_temp":{"frequencies":[261.6255653006,269.67683152447,277.97586744827,286.53029793775,295.34798250635,304.4370214407,313.80576690868,327.74897996102,337.83512841993,348.23166805304,358.94815083964,369.99442271164,381.38063259971,393.11724175776,405.21503337437,417.68512248001,430.53896367224,443.78837151315,463.50705251482,477.77102045752,492.47394780842,507.62934310616,523.2511306012],"description":"Shrutar temperament, 11-limit, g=52.474, 1/2 oct."},"shrutart":{"frequencies":[261.6255653006,269.83675183105,278.27349931787,286.14641333958,294.32706056425,305.2349557921,313.94319125793,327.02936607233,337.2932679302,348.82502010853,358.79758764604,369.99442271164,381.540672377,392.44854854484,405.86600994967,418.6042204156,436.0530078362,448.49343183014,465.11480315564,478.41198231361,491.94721442498,507.32849364948,523.2511306012],"description":"Paul Erlich's 'Shrutar' tuning tempered by Dave Keenan, TL 29-12-2000"},"siamese":{"frequencies":[261.6255653006,269.26067151764,288.95340229325,296.22023396764,319.13574119147,352.26720984209,362.5475414329,388.79334481031,400.18585940536,429.40436513853,443.77760270734,473.98350631811,523.2511306012],"description":"Siamese Tuning, after Clem Fortuna's Microtonal Guide"},"silbermann1":{"frequencies":[261.6255653006,275.15551885617,293.66476791741,312.53552595124,327.77163799145,349.82028288879,367.9112241576,391.99543598175,411.56972129721,438.75957425603,467.74568907204,491.10256480205,523.2511306012],"description":"Gottfried Silbermann's temperament nr. 1"},"silbermann2":{"frequencies":[261.6255653006,275.00020270933,293.00227310437,312.18279369479,328.14198392915,349.6228209638,367.49599295996,391.5530240856,411.56972129721,438.51190905657,467.21778431035,491.10256480205,523.2511306012],"description":"Gottfried Silbermann's temperament nr. 2, 1/6 Pyth. comma meantone"},"silbermann2a":{"frequencies":[261.6255653006,275.00020270933,293.00227310437,310.77584116741,328.14198392915,349.6228209638,367.49599295996,391.5530240856,411.56972129721,438.51190905657,467.21778431035,491.10256480205,523.2511306012],"description":"Modified Silbermann's temperament nr. 2, also used by Hinsz in Midwolda"},"silver":{"frequencies":[261.6255653006,277.18807786937,293.58315284916,311.09098010692,329.53543886896,349.23174545031,369.98176232374,391.84186131702,415.18563115404,439.77824302677,466.03998256716,493.70667148145,523.2511306012],"description":"Equal beating chromatic scale, A.L.Leigh Silver JASA 29/4, 476-481, 1957"},"silver_10":{"frequencies":[261.6255653006,270.26884019355,294.27266239927,320.41022551991,330.99364634362,360.39280035711,392.40094712608,405.36462386145,441.36692569059,480.56953386201,523.2511306012],"description":"Ten-tone MOS from 350.9 cents"},"silver_11":{"frequencies":[261.6255653006,277.73657748574,294.83971256733,315.81001885226,335.25773244276,355.90304440354,381.21644531515,404.69191411574,429.61301214396,460.16899244324,488.50639225338,523.2511306012],"description":"Eleven-tone MOS from 1+sqr(2), 1525.864 cents"},"silver_11a":{"frequencies":[261.6255653006,272.21316796874,283.22923537857,314.22802528801,326.94437231289,340.17533123945,377.40674067136,392.67983758722,408.5710143206,453.28817432381,471.63208149661,523.2511306012],"description":"Eleven-tone MOS from 317.17 cents"},"silver_11b":{"frequencies":[261.6255653006,281.48899567641,302.85877036442,316.87090334834,340.92873240472,366.81310701257,383.78194911277,412.91987382947,444.27004083312,464.82473992747,500.11279777071,523.2511306012],"description":"Eleven-tone MOS from 331.67 cents"},"silver_7":{"frequencies":[261.6255653006,277.73649727228,315.81000061035,335.2576162513,381.21640127531,404.69175048432,460.16888612163,523.2511306012],"description":"Seven-tone MOS from 1+sqr(2), 1525.864 cents"},"silver_8":{"frequencies":[261.6255653006,288.49477506296,306.46277751246,337.93681424842,358.98416079003,395.852196628,420.50662316693,492.57276348379,523.2511306012],"description":"Eight-tone MOS from 273.85 cents"},"silver_9":{"frequencies":[261.6255653006,294.18258755347,307.6617709921,345.94759796409,361.79860795042,406.82129262791,425.46148093979,478.40645551359,500.32661205896,523.2511306012],"description":"Nine-tone MOS from 280.61 cents"},"silvermean":{"frequencies":[261.6255653006,286.15296204753,327.03195662575,345.42750418595,392.4383479509,416.96574469783,474.19633710734,523.2511306012],"description":"First 6 approximants to the Silver Mean, 1+ sqr(2) reduced by 2/1"},"simonton":{"frequencies":[261.6255653006,277.97716313189,294.32876096318,310.68035879446,327.03195662575,348.83408706747,370.63621750918,392.4383479509,414.24047839262,436.04260883433,465.11211608996,494.18162334558,523.2511306012],"description":"Simonton Integral Ratio Scale, JASA 25/6 (1953): A new integral ratio scale"},"sims":{"frequencies":[261.6255653006,272.52663052146,283.42769574232,294.32876096318,305.22982618403,316.13089140489,327.03195662575,343.38355445704,359.73515228832,376.08675011961,392.4383479509,408.78994578219,425.14154361347,441.49314144476,457.84473927605,474.19633710734,490.54793493862,506.89953276991,523.2511306012],"description":"Ezra Sims' 18-tone mode"},"sims2":{"frequencies":[261.6255653006,269.80136421624,277.97716313189,286.15296204753,294.32876096318,302.50455987882,310.68035879446,318.85615771011,327.03195662575,343.38355445704,359.73515228832,376.08675011961,392.4383479509,408.78994578219,425.14154361347,441.49314144476,457.84473927605,474.19633710734,490.54793493862,506.89953276991,523.2511306012],"description":"Sims II"},"sims_24":{"frequencies":[261.6255653006,269.80136421624,272.52663052146,277.97716313189,283.42769574232,286.15296204753,294.32876096318,302.50455987882,305.22982618403,310.68035879446,316.13089140489,318.85615771011,327.03195662575,343.38355445704,359.73515228832,376.08675011961,392.4383479509,408.78994578219,425.14154361347,441.49314144476,457.84473927605,474.19633710734,490.54793493862,506.89953276991,523.2511306012],"description":"See his article, Reflections on This and That, 1991 p.93-106"},"sin":{"frequencies":[261.6255653006,275.08939827539,302.09917071192,334.63165645627,369.99442271164,407.01712569342,445.10399729103,483.9175316883,523.2511306012,562.97086325858,602.98541169118,643.23087116255,683.66056756853,724.23972686276,764.94197926416,805.74682982871,846.63811574624,887.6028851904,928.63083777952,969.71346974542,1010.84345850104,1052.01529432917],"description":"1/sin(2pi/n), n=4..25"},"sinemod12":{"frequencies":[261.6255653006,270.6035983646,282.0485507085,292.16840832754,301.82804372114,314.42520179993,326.24260278214,336.76433478807,350.4641458176,364.21811789193,375.86233664064,390.61306119732,406.50371126161,419.61372202861,435.38454314112,453.55584308858,468.551249676,485.36279478778,505.89080731022,523.2511306012],"description":"Sine modulated F=12, A=-.08203754"},"sinemod8":{"frequencies":[261.6255653006,272.43905323978,281.98404270447,290.99567087708,301.68076007415,314.40050256998,326.99158834066,337.97331861211,348.96407538813,362.38276875396,377.76595534172,392.29216556304,405.04934945717,418.6525822649,435.418746849,453.77727371169,470.43955130022,485.47382867757,502.48255971303,523.2511306012],"description":"Sine modulated F=8, A=.11364155. Deviation minimal3/2, 4/3, 5/4, 6/5, 5/3, 8/5"},"singapore":{"frequencies":[261.6255653006,291.46787011619,321.35550581422,354.51258839996,385.70651737906,428.95813651779,462.1422075194,523.2511306012],"description":"An observed xylophone tuning from Singapore"},"sintemp6":{"frequencies":[261.6255653006,277.18263097687,292.42974339757,312.08834713741,327.870830746,349.91196330865,369.15973155124,391.11111150212,416.11779639122,437.6550518996,467.60417912673,491.80624587316,523.2511306012],"description":"Sine modulated fifths, A=1/6 Pyth, one cycle, f0=-90 degrees"},"sintemp6a":{"frequencies":[261.6255653006,276.17281343288,293.21211353711,310.64741311165,328.42667470471,349.22823143301,368.43838932195,391.77416758435,414.19655102258,438.82595961933,465.90062756558,491.80624587316,523.2511306012],"description":"Sine modulated fifths, A=1/12 Pyth, one cycle, f0= D-A"},"sintemp_19":{"frequencies":[261.6255653006,272.86445838226,281.30973389888,292.50627485027,304.14845459111,313.56198179795,327.03195662575,338.65502209741,350.02113164026,365.30494475029,376.98581738134,391.19763056219,407.47965586966,419.94695489748,437.42555500456,453.91586039553,468.43012697388,488.88431353627,505.29249383438,523.2511306012],"description":"Sine modulated thirds, A=7.366 cents, one cycle over fifths, f0=90 degrees"},"sintemp_7":{"frequencies":[261.6255653006,291.06608881088,319.67397341855,351.09362859375,390.60192440975,432.07134328681,473.03044489876,523.2511306012],"description":"Sine modulated fifths, A=8.12 cents, one cycle, f0=90 degrees"},"slen_pel":{"frequencies":[261.6255653006,261.6255653006,283.17034563789,298.45295203849,338.50336851425,364.68988616898,346.01554587335,389.06292924114,398.38689497567,420.13030572059,455.51656649021,493.31307433255,523.2511306012],"description":"Pelog white, Slendro black"},"slen_pel16":{"frequencies":[261.6255653006,261.6255653006,285.30470202322,285.30470202322,297.93622032612,311.12698372208,339.28638158975,386.37547528213,386.37547528213,403.48177901006,421.34544350737,440,523.2511306012],"description":"16-tET Slendro and Pelog"},"slen_pel23":{"frequencies":[261.6255653006,261.6255653006,295.14355885465,295.14355885465,286.38154466424,343.14246862785,313.47984535337,398.94762483098,398.94762483098,387.10394860926,450.05828708186,423.73315704439,523.2511306012],"description":"23-tET Slendro and Pelog"},"slen_pel_jc":{"frequencies":[261.6255653006,261.6255653006,299.00064605783,299.00064605783,279.06726965397,341.71502406609,348.83408706747,392.4383479509,392.4383479509,392.4383479509,448.50096908674,418.60090448096,523.2511306012],"description":"Slendro/JC PELOG S1c,P1c#,S2d,eb,P2e,S3f,P3f#,S4g,ab,P4a,S5bb,P5b"},"slen_pel_schmidt":{"frequencies":[261.6255653006,261.6255653006,294.32876096318,305.22982618403,327.03195662575,348.83408706747,359.73515228832,392.4383479509,392.4383479509,457.84473927605,457.84473927605,490.54793493862,523.2511306012],"description":"Dan Schmidt (Pelog white, Slendro black)"},"slendro":{"frequencies":[261.6255653006,298.45295203849,346.01554587335,398.38689497567,455.51656649021,523.2511306012],"description":"Observed Javanese Slendro scale, Helmholtz/Ellis p. 518, nr.94"},"slendro10":{"frequencies":[261.6255653006,304.21577360535,342.24274530602,391.67780832635,463.92905474816,523.2511306012],"description":"Low gender from Singaraja (banjar Lod Peken), Bali. 1/1=172 Hz. McPhee, 1966."},"slendro11":{"frequencies":[261.6255653006,299.11221417218,343.62760815601,387.36203100102,452.96366529656,523.2511306012],"description":"Low gender from Sawan, Bali. 1/1=167.5 Hz. McPhee, 1966."},"slendro2":{"frequencies":[261.6255653006,299.13295468097,343.58614396263,395.91119354826,450.08870388136,523.2511306012],"description":"Gamelan slendro from Ranchaiyuh, distr. Tanggerang, Batavia. 1/1=282.5 Hz"},"slendro3":{"frequencies":[261.6255653006,298.44694115772,339.14425131559,391.46936437571,453.48431318771,522.28214737536],"description":"Gamelan kodok ngorek. 1/1=270 Hz"},"slendro4":{"frequencies":[261.6255653006,294.5074669504,344.54514337401,400.3014113889,467.49486258632,523.2511306012],"description":"Low gender in saih lima from Kuta, Bali. 1/1=183 Hz. McPhee, 1966"},"slendro5_1":{"frequencies":[261.6255653006,299.00064605783,336.37572681506,392.4383479509,448.50096908674,523.2511306012],"description":"A slendro type pentatonic which is based on intervals of 7; from Lou Harrison"},"slendro5_2":{"frequencies":[261.6255653006,305.22982618403,348.83408706747,392.4383479509,457.84473927605,523.2511306012],"description":"A slendro type pentatonic which is based on intervals of 7, no. 2"},"slendro5_4":{"frequencies":[261.6255653006,294.32876096318,348.83408706747,392.4383479509,448.50096908674,523.2511306012],"description":"A slendro type pentatonic which is based on intervals of 7, no. 4"},"slendro6":{"frequencies":[261.6255653006,295.05549864457,341.56671025356,398.25224940202,461.478427683,523.2511306012],"description":"Low gender from Klandis, Bali. 1/1=180 Hz. McPhee, 1966"},"slendro8":{"frequencies":[261.6255653006,309.85821141747,350.78288084997,406.32350365121,467.71050779996,523.2511306012],"description":"Low gender from Tabanan, Bali. 1/1=179 Hz. McPhee, 1966."},"slendro9":{"frequencies":[261.6255653006,299.00064605783,336.37572681506,388.70083987518,448.50096908674,523.2511306012],"description":"Low gender from Singaraja (banjar Panataran), Bali. 1/1=175 Hz. McPhee, 1966."},"slendro_7_1":{"frequencies":[261.6255653006,299.00064605783,341.71502406609,392.4383479509,448.50096908674,523.2511306012],"description":"Septimal Slendro 1, From HMSL Manual, also Lou Harrison, Jacques Dudon"},"slendro_7_2":{"frequencies":[261.6255653006,294.32876096318,343.38355445704,392.4383479509,448.50096908674,523.2511306012],"description":"Septimal Slendro 2, From Lou Harrison, Jacques Dudon's APTOS"},"slendro_7_3":{"frequencies":[261.6255653006,294.32876096318,336.37572681506,392.4383479509,448.50096908674,523.2511306012],"description":"Septimal Slendro 3, Harrison, Dudon, called \"MILLS\" after Mills Gamelan"},"slendro_7_4":{"frequencies":[261.6255653006,294.32876096318,343.38355445704,392.4383479509,457.84473927605,523.2511306012],"description":"Septimal Slendro 4, from Lou Harrison, Jacques Dudon, called \"NAT\""},"slendro_7_5":{"frequencies":[261.6255653006,305.22982618403,343.38355445704,400.61414686654,467.3831713443,523.2511306012],"description":"Septimal Slendro 5, from Jacques Dudon"},"slendro_7_6":{"frequencies":[261.6255653006,299.00064605783,341.71502406609,390.53145607553,455.62003208812,523.2511306012],"description":"Septimal Slendro 6, from Robert Walker"},"slendro_a1":{"frequencies":[261.6255653006,299.00064605783,348.83408706747,392.4383479509,457.84473927605,523.2511306012],"description":"Dudon's Slendro A1, \"Seven-Limit Slendro Mutations\", 1/1 8:2'94 hexany 1.3.7.21"},"slendro_a2":{"frequencies":[261.6255653006,299.00064605783,341.71502406609,398.6675280771,448.50096908674,523.2511306012],"description":"Dudon's Slendro A2 from \"Seven-Limit Slendro Mutations\", 1/1 8:2 Jan 1994"},"slendro_alv":{"frequencies":[261.6255653006,299.00064605783,348.83408706747,406.97310157871,465.11211608996,523.2511306012],"description":"Bill Alves, slendro for Gender Barung, 1/1 vol.9 no.4, 1997. 1/1=282.86"},"slendro_ang":{"frequencies":[261.6255653006,299.00064605783,340.82516392797,388.43396508487,445.83123341082,523.2511306012],"description":"Gamelan Angklung Sangsit, North Bali. 1/1=294 Hz"},"slendro_av":{"frequencies":[261.6255653006,298.97057995496,344.02264297658,395.86362945285,454.20288100724,525.67465946865],"description":"Average of 30 measured slendro gamelans, W. Surjodiningrat et al., 1993."},"slendro_dudon":{"frequencies":[261.6255653006,305.22982618403,348.83408706747,399.70572476481,457.84473927605,523.2511306012],"description":"Dudon's Slendro from \"Fleurs de lumie`re\""},"slendro_gum":{"frequencies":[261.6255653006,305.03156112838,348.43777142572,394.8168394034,470.92601754108,525.62941881859],"description":"Gumbeng, bamboo idiochord from Banyumas. 1/1=440 Hz"},"slendro_ky1":{"frequencies":[261.6255653006,297.58776037991,344.33874539242,394.68595744625,449.52853279627,523.2511306012],"description":"Kyahi Kanyut Me`sem slendro, Mangku Nagaran, Solo. 1/1=291 Hz"},"slendro_ky2":{"frequencies":[261.6255653006,302.42139140287,345.87786599062,395.54249276388,453.1886900261,523.2511306012],"description":"Kyahi Pengawe' sari, Paku Alaman, Jogya. 1/1=295 Hz"},"slendro_laras":{"frequencies":[261.6255653006,299.00064605783,348.83408706747,392.4383479509,448.50096908674,523.2511306012,598.00129211566,697.66817413493],"description":"Lou Harrison, gamelan \"Si Betty\""},"slendro_m":{"frequencies":[261.6255653006,299.00064605783,348.83408706747,392.4383479509,448.50096908674,523.2511306012],"description":"Dudon's Slendro M from \"Seven-Limit Slendro Mutations\", 1/1 8:2 Jan 1994"},"slendro_madu":{"frequencies":[261.6255653006,300.52885648597,345.61604384578,394.49404533893,447.94973572445,522.94897617031],"description":"Sultan's gamelan Madoe kentir, Jogjakarta, Jaap Kunst"},"slendro_mat":{"frequencies":[261.6255653006,261.6255653006,299.00064605783,299.00064605783,341.71502406609,343.38355445704,348.83408706747,392.4383479509,398.6675280771,448.50096908674,455.62003208812,457.84473927605,523.2511306012],"description":"Dudon's Slendro Matrix from \"Seven-Limit Slendro Mutations\", 1/1 8:2 Jan 1994"},"slendro_pa":{"frequencies":[261.6255653006,304.19649364034,353.69443592699,411.24653512154,478.16333951147,523.2511306012],"description":"\"Blown fifth\" primitive slendro, von Hornbostel"},"slendro_pas":{"frequencies":[261.6255653006,300.35531433711,343.03050002254,393.12919962609,450.54468214486,523.2511306012],"description":"Gamelan slendro of regent of Pasoeroean, Jaap Kunst"},"slendro_pb":{"frequencies":[261.6255653006,304.72408298441,342.83241505062,399.30842833955,449.24533531117,523.2511306012],"description":"\"Blown fifth\" medium slendro, von Hornbostel"},"slendro_pc":{"frequencies":[261.6255653006,299.48910562989,342.83241505062,392.44854854484,449.24533531117,523.2511306012],"description":"\"Blown fifth\" modern slendro, von Hornbostel"},"slendro_pliat":{"frequencies":[261.6255653006,299.73468146833,339.98478643783,393.08060743874,447.03290350508,523.2511306012,599.46936293666,679.96957287566,786.16121487749,894.06580701017],"description":"Gender wayang from Pliatan, South Bali (Slendro), 1/1=305.5 Hz"},"slendro_q13":{"frequencies":[261.6255653006,307.00725675226,360.2608752926,400.8015646157,470.32478922042,523.2511306012],"description":"13-tET quasi slendro, Blackwood"},"slendro_s1":{"frequencies":[261.6255653006,299.00064605783,348.83408706747,398.6675280771,457.84473927605,523.2511306012],"description":"Dudon's Slendro S1 from \"Seven-Limit Slendro Mutations\", 1/1 8:2 Jan 1994"},"slendro_s2":{"frequencies":[261.6255653006,299.00064605783,341.71502406609,398.6675280771,455.62003208812,523.2511306012],"description":"Dudon's Slendro S2"},"slendro_udan":{"frequencies":[261.6255653006,305.22982618403,351.32575911795,402.50086969323,465.11211608996,523.2511306012],"description":"Slendro Udan Mas (approx)"},"slendro_wolf":{"frequencies":[261.6255653006,298.18866107946,339.86157848985,395.0032340925,450.20632964813,523.2511306012],"description":"Daniel Wolf's slendro. Tuning List 30 5 1997"},"slendrob1":{"frequencies":[261.6255653006,307.44024341205,355.66611281954,409.9203247543,476.83364134848,523.2511306012],"description":"Gamelan miring of Musadikrama, desa Katur, Bajanegara. 1/1=434 Hz"},"slendrob2":{"frequencies":[261.6255653006,307.55978097874,346.50416420081,398.42969909174,449.35693171058,523.2511306012],"description":"Gamelan miring from Bajanegara. 1/1=262 Hz"},"slendrob3":{"frequencies":[261.6255653006,304.90191053936,342.27700149692,398.33972372326,447.51732140012,523.2511306012],"description":"Gamelan miring from Ngumpak, Bajanegara. 1/1=266 Hz"},"slendroc1":{"frequencies":[261.6255653006,297.59222964268,344.42030317161,394.72197985873,449.50490455178,523.2511306012],"description":"Kyahi Kanyut mesem slendro (Mangku Nagaran Solo). 1/1=291 Hz"},"slendroc2":{"frequencies":[261.6255653006,302.44445076078,346.01554587335,396.09235530397,453.15466093696,523.2511306012],"description":"Kyahi Pengawe sari (Paku Alaman, Jogja). 1/1=295 Hz."},"slendroc3":{"frequencies":[261.6255653006,301.39807245198,344.42030317161,395.40657391157,451.84778706363,523.2511306012],"description":"Gamelan slendro of R.M. Jayadipura, Jogja. 1/1=231 Hz"},"slendroc4":{"frequencies":[261.6255653006,299.14332201883,343.8239850859,396.09235530397,450.28451247858,523.2511306012],"description":"Gamelan slendro, Rancha iyuh, Tanggerang, Batavia. 1/1=282.5 Hz"},"slendroc5":{"frequencies":[261.6255653006,299.83528893666,340.07120590121,393.12919962609,447.17417015401,523.2511306012],"description":"Gender wayang from Pliatan, South Bali. 1/1=611 Hz"},"slendroc6":{"frequencies":[261.6255653006,296.73398952435,343.8239850859,396.7793260952,453.9405988926,527.19506190947,607.33963549452,696.44215167899,797.23415748628,918.4302691641,1071.58188326661],"description":"from William Malm: Music Cultures of the Pacific, the Near East and Asia."},"slendrod1":{"frequencies":[261.6255653006,292.47977325983,340.6610152784,389.06292924114,444.85552088095,523.2511306012],"description":"Gender wayang from Ubud (S. Bali). 1/1=347 Hz"},"smith_eh":{"frequencies":[261.6255653006,272.7117507892,292.30354792656,313.30283124826,326.5788018031,350.04044239751,364.87314355143,391.08587539224,407.65784362321,436.94425707006,468.33462614046,488.17995458879,523.2511306012],"description":"Robert Smith's Equal Harmony temperament (1749)"},"smith_mq":{"frequencies":[261.6255653006,273.37438418823,292.50629623572,312.97714101186,327.03200500996,349.91910755601,365.63292511375,391.22148485648,408.79006910398,437.39894995248,468.01000388518,489.02693031834,523.2511306012],"description":"Robert Smith approximation of quarter comma meantone fifth"},"scalamakesrc2\\smithgw-ball":{"frequencies":[261.6255653006,267.07609791103,272.52663052146,274.70684356563,280.31310567921,286.15296204753,294.32876096318,300.46061014991,305.22982618403,306.59245933664,313.95067836072,320.49131749323,327.03195662575,333.84512238879,336.37572681506,343.38355445704,350.39138209902,357.69120255941,366.27579142084,367.91095120397,373.75080757229,381.53728273004,392.4383479509,400.61414686654,408.78994578219,412.06026534844,420.46965851882,429.2294430713,436.04260883433,448.50096908674,457.84473927605,467.18850946536,470.92601754108,476.92160341255,480.73697623985,490.54793493862,500.76768358318,515.07533168556,523.2511306012],"description":"Ball 2 around tetrad lattice hole"},"smithgw46":{"frequencies":[261.6255653006,273.72380653152,313.47993226845,327.97605323154,364.46098649856,392.98113253789,436.69740466987,456.89141950378,523.2511306012],"description":"Gene Ward Smith 46-tET subset \"Star\""},"smithgw46a":{"frequencies":[261.6255653006,282.09853500802,313.47993226845,327.97605323154,375.61187043063,392.98113253789,436.69740466987,470.87026054824,523.2511306012],"description":"46-tET version of \"Star\", alternative version"},"smithgw72a":{"frequencies":[261.6255653006,285.30470202322,299.37379946195,326.46944327063,342.56848033562,373.57357677338,391.99543598175,427.47405410759,435.78442404634,457.27406033445,498.66089874196,523.2511306012],"description":"Gene Ward Smith 72-tET subset, TL 04-01-2002"},"smithgw72c":{"frequencies":[261.6255653006,279.86396690685,305.19382000629,326.46944327063,349.22823143301,391.99543598175,419.32216217931,457.27406033445,489.15147723638,523.2511306012],"description":"Gene Ward Smith 72-tET subset, TL 04-01-2002"},"smithgw72d":{"frequencies":[261.6255653006,305.19382000629,326.46944327063,349.22823143301,366.44956000397,391.99543598175,419.32216217931,489.15147723638,523.2511306012],"description":"Gene Ward Smith 72-tET subset, TL 04-01-2002"},"smithgw72e":{"frequencies":[261.6255653006,279.86396690685,326.46944327063,349.22823143301,366.44956000397,391.99543598175,419.32216217931,489.15147723638,523.2511306012],"description":"Gene Ward Smith 72-tET subset, TL 04-01-2002"},"smithgw72f":{"frequencies":[261.6255653006,326.46944327063,349.22823143301,435.78442404634,466.16376151809,523.2511306012],"description":"Gene Ward Smith 72-tET subset, TL 04-01-2002"},"smithgw72g":{"frequencies":[261.6255653006,326.46944327063,349.22823143301,391.99543598175,419.32216217931,523.2511306012],"description":"Gene Ward Smith 72-tET subset, TL 04-01-2002"},"smithgw72h":{"frequencies":[261.6255653006,279.86396690685,314.13668154225,349.22823143301,391.99543598175,435.78442404634,489.15147723638,523.2511306012],"description":"Gene Ward Smith 72-tET subset, TL 09-01-2002"},"smithgw72i":{"frequencies":[261.6255653006,279.86396690685,293.66476791741,314.13668154225,326.46944327063,349.22823143301,366.44956000397,391.99543598175,419.32216217931,435.78442404634,470.6732130613,489.15147723638,523.2511306012],"description":"Gene Ward Smith 72-tET subset version of Duodene, TL 02-06-2002"},"smithgw72j":{"frequencies":[261.6255653006,274.52698453615,305.19382000629,326.46944327063,349.22823143301,366.44956000397,391.99543598175,435.78442404634,457.27406033445,489.15147723638,523.2511306012],"description":"{225/224, 441/440} tempering of decad, 72-et version (2002)"},"smithgw84":{"frequencies":[261.6255653006,286.48426603331,306.03443598155,335.11270457212,357.98136125932,391.99543598175,418.74586628806,458.53356119912,489.82466832727,523.2511306012],"description":"Gene Ward Smith 84-tET subset, 11-limit temperament \"Orwell\", 2002"},"smithgw_18":{"frequencies":[261.6255653006,272.52663052146,280.31310567921,286.15296204753,294.32876096318,306.59245933664,327.03195662575,343.38355445704,350.39138209902,367.91095120397,381.53728273004,392.4383479509,408.78994578219,420.46965851882,436.04260883433,457.84473927605,467.18850946536,490.54793493862,523.2511306012],"description":"Gene Ward Smith chord analogue to periodicity blocks, TL 12-07-2002"},"smithgw_21":{"frequencies":[261.6255653006,267.07609791103,280.31310567921,286.15296204753,299.00064605783,305.22982618403,320.49131749323,327.03195662575,343.38355445704,348.83408706747,366.27579142084,373.75080757229,392.4383479509,398.6675280771,418.60090448096,427.14378008261,448.50096908674,457.84473927605,478.40103369253,488.36772189445,512.57253609913,523.2511306012],"description":"Gene Ward Smith symmetrical 7-limit JI version of Blackjack, TL 10-5-2002"},"smithgw_45":{"frequencies":[261.6255653006,267.02002970726,269.13627541126,274.68560334708,276.86260193655,282.57123920205,288.39758300936,290.68325478745,296.67686217097,299.02814898089,305.19382000629,311.48661940174,313.95528147508,320.42873367481,322.96826575344,329.62755691287,336.42415617173,339.09045868095,346.08217376006,348.82502010853,356.01745236555,363.35818557229,366.23795155866,373.78942366597,376.75185941212,384.52011812375,392.44854854484,395.55886785613,403.71490654806,406.9145164708,415.30469757995,423.86787605389,427.22720671064,436.03621571368,439.49198556474,448.5538823653,457.80262665414,461.43090443914,470.94516310483,474.67759826036,484.46499093218,494.45418731234,498.37294408452,508.64890891624,512.68016480935,523.2511306012],"description":"Gene Ward Smith large limma repeating 5-tone MOS"},"smithgw_58":{"frequencies":[261.6255653006,264.89588486686,267.57160087561,269.80136421624,274.70684356563,279.06726965397,282.55561052465,285.40970760065,287.78812183066,290.69507255622,294.32876096318,299.00064605783,301.49231810831,305.22982618403,310.07474405997,313.95067836072,317.12189733406,319.76457981184,323.76163705949,327.03195662575,332.97799220076,336.37572681506,340.54567384169,343.38355445704,348.83408706747,353.19451315581,356.76213450082,359.73515228832,366.27579142084,370.01329949656,373.75080757229,380.54627680087,383.71749577421,387.59343007496,392.4383479509,398.6675280771,401.98975747775,406.97310157871,411.12588832951,418.60090448096,423.83341578697,428.11456140098,431.68218274599,436.04260883433,441.49314144476,448.50096908674,452.23847716247,457.84473927605,465.11211608996,470.92601754108,475.68284600109,479.64686971777,484.4917875937,490.54793493862,498.33441009638,507.3950357345,511.62332769895,516.79124009995,523.2511306012],"description":"Gene Ward Smith 58-tone epimorphic superset of Partch's 43-tone scale"},"smithgw_9":{"frequencies":[261.6255653006,279.06726965397,305.22982618403,327.03195662575,348.83408706747,392.4383479509,418.60090448096,448.50096908674,490.54793493862,523.2511306012],"description":"Gene Ward Smith \"Miracle-Magic square\" tuning, genus chromaticum of ji_12a"},"smithgw_al-baked":{"frequencies":[261.6255653006,277.59364499865,293.85651796007,311.0721560172,330.05816364769,349.39467974592,369.86402907174,392.4383479509,415.42941801053,439.76742419786,466.60823379256,493.94455998605,522.88238970142],"description":"Baked alaska, with beat ratios of 2 and 3/2"},"smithgw_al-fried":{"frequencies":[261.6255653006,277.00141553195,293.28091128458,310.96067952124,329.23597434237,348.58531822795,369.59898601143,391.32048195179,414.31855981944,439.29480556849,465.11235566178,492.44721175277,522.13326741512],"description":"Fried alaska, with octave-fifth brats of 1 and 2"},"smithgw_asbru":{"frequencies":[261.6255653006,275.52281548997,293.66476791741,313.00128725319,329.62755691287,351.33206601369,367.77883484915,391.99543598175,415.30469757995,440,468.97204376297,490.92584627687,523.2511306012],"description":"Modified bifrost (2003)"},"smithgw_bifrost":{"frequencies":[261.6255653006,275.07759559501,292.50627485027,311.03921839762,327.03195662575,349.91912034749,366.77012764335,391.22147055517,413.66634097248,437.39889945791,466.55882736321,489.02683710225,523.2511306012],"description":"Six meantone fifths, four pure, two of sqrt(2048/2025 sqrt(5))"},"smithgw_cauldron":{"frequencies":[261.6255653006,275.03056468741,291.83931845209,312.58541512404,325.54230007562,350.31873582686,364.83969341757,390.77519652096,414.65779561271,435.90375768372,469.07960710644,486.243977751,523.2511306012],"description":"Circulating temperament with two pure 9/7 thirds"},"smithgw_ck":{"frequencies":[195.99771799087,198.06437430898,200.15282320192,202.2632921446,203.72940721765,205.87758869102,208.04842120778,210.24214482145,211.76609376362,213.99901760782,216.25548480725,218.5357448459,220.11981156469,222.44081817627,224.78629944762,227.15651084977,228.80306427848,231.21563094,233.65363506284,235.34728316698,237.82885399313,240.33658984216,242.87076938222,244.63122826831,247.21069030843,249.81735238129,252.45149840587,254.28140507407,256.96262135434,259.67210915034,262.4101678886,264.31225911206,267.09924514556,269.91561641866,272.7616843206,274.73881033537,277.63573538138,280.56320805899,282.59688215652,285.57666497222,288.58786914203,291.63082264784,293.74472081062,296.84205135845,299.9720393359,303.13503255793,305.33231946532,308.55183127196,311.80529233825,315.09305703284,317.37702217863,320.72353853051,324.10533989702,327.52280172307,329.89686439088,333.37539375097,336.89059979959,339.33256534187,342.91058750208,346.52633537645,350.18021075922,352.71850659998,356.43767199462,360.19605541958,363.99406623991,366.6324923874,370.49837299068,374.40501441099,378.35285076765,381.09535716275,385.11373623244,389.17448849491,391.99543598174],"description":"Catakleismic temperament, g=316.745, 11-limit"},"smithgw_decab":{"frequencies":[261.6255653006,274.70684356563,293.02063313667,313.95067836072,348.83408706747,366.27579142084,392.4383479509,418.60090448096,439.53094970501,488.36772189445,523.2511306012],"description":"(10/9) <==> (16/15) transform of decaa"},"smithgw_decac":{"frequencies":[261.6255653006,280.31310567921,299.00064605783,313.95067836072,348.83408706747,373.75080757229,392.4383479509,418.60090448096,448.50096908674,498.33441009638,523.2511306012],"description":"inversion of decaa"},"smithgw_decad":{"frequencies":[261.6255653006,280.31310567921,311.45900631024,327.03195662575,348.83408706747,373.75080757229,392.4383479509,436.04260883433,467.18850946536,498.33441009638,523.2511306012],"description":"inversion of decab"},"smithgw_diff13":{"frequencies":[261.6255653006,274.70684356563,280.31310567921,299.00064605783,313.95067836072,320.35783506196,336.37572681506,406.97310157871,427.32175665765,436.04260883433,457.84473927605,488.36772189445,498.33441009638,523.2511306012],"description":"mod 13 perfect difference set, 7-limit"},"smithgw_dwarf6_7":{"frequencies":[261.6255653006,299.00064605783,327.03195662575,373.75080757229,392.4383479509,448.50096908674,523.2511306012],"description":"Dwarf(<6 10 14 17|)"},"smithgw_exotic1":{"frequencies":[261.6255653006,274.95996987324,293.39100498914,313.05750197389,327.96500300935,349.94905375768,367.78508905896,392.4383479509,411.12588832951,438.68435539504,468.09011223803,491.94750426812,523.2511306012],"description":"Exotic temperament featuring four pure 14/11 thirds and two pure fifths"},"smithgw_glumma":{"frequencies":[261.6255653006,269.10058145205,299.00064605783,313.95067836072,327.03195662575,358.80077526939,373.75080757229,392.4383479509,436.04260883433,448.50096908674,457.84473927605,512.57253609913,523.2511306012],"description":"Gene Smith's Glumma scale, 7-limit, 2002"},"smithgw_gm":{"frequencies":[261.6255653006,264.89588486686,269.80136421624,274.70684356563,279.06726965397,285.40970760065,290.69507255622,294.32876096318,299.00064605783,305.22982618403,310.07474405997,313.95067836072,319.76457981184,327.03195662575,332.97799220076,336.37572681506,343.38355445704,348.83408706747,353.19451315581,359.73515228832,366.27579142084,373.75080757229,380.54627680087,387.59343007496,392.4383479509,398.6675280771,406.97310157871,411.12588832951,418.60090448096,428.11456140098,436.04260883433,441.49314144476,448.50096908674,457.84473927605,465.11211608996,470.92601754108,479.64686971777,490.54793493862,498.33441009638,507.3950357345,516.79124009995,523.2511306012],"description":"Gene Ward Smith \"Genesis Minus\" periodicity block"},"smithgw_graileq":{"frequencies":[261.6255653006,274.83794140225,293.02845982215,312.42294214419,328.20064112269,350.39711148969,365.67350481015,391.53226450123,414.40482204179,438.61355268439,469.63029662389,490.10494633744,523.2511306012],"description":"56% RMS grail + 44% JI grail"},"smithgw_grailrms":{"frequencies":[261.6255653006,274.64037495938,293.11160698959,312.82513967025,328.38692028068,350.6222941497,365.93760986436,391.94882001935,414.52240989365,438.39608269016,469.55771333591,490.068176414,523.2511306012],"description":"RMS optimized Holy Grail"},"smithgw_hahn12":{"frequencies":[261.6255653006,280.31310567921,299.00064605783,313.95067836072,327.03195662575,348.83408706747,366.27579142084,392.4383479509,418.60090448096,436.04260883433,457.84473927605,490.54793493862,523.2511306012],"description":"Hahn-reduced 12 note scale, Fokker block 225/224, 126/125, 64/63"},"smithgw_hahn15":{"frequencies":[261.6255653006,279.06726965397,290.69507255622,305.22982618403,313.95067836072,327.03195662575,348.83408706747,366.27579142084,373.75080757229,392.4383479509,418.60090448096,436.04260883433,457.84473927605,470.92601754108,490.54793493862,523.2511306012],"description":"Hahn-reduced 15 note scale"},"smithgw_hahn16":{"frequencies":[261.6255653006,280.31310567921,294.32876096318,299.00064605783,313.95067836072,327.03195662575,343.38355445704,348.83408706747,366.27579142084,392.4383479509,408.78994578219,418.60090448096,436.04260883433,457.84473927605,488.36772189445,490.54793493862,523.2511306012],"description":"Hahn-reduced 16 note scale"},"smithgw_hahn19":{"frequencies":[261.6255653006,274.70684356563,280.31310567921,294.32876096318,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,366.27579142084,373.75080757229,392.4383479509,406.97310157871,418.60090448096,436.04260883433,457.84473927605,470.92601754108,490.54793493862,508.71637697339,523.2511306012],"description":"Hahn-reduced 19 note scale"},"smithgw_hahn22":{"frequencies":[261.6255653006,272.52663052146,280.31310567921,290.69507255622,299.00064605783,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,363.36884069528,366.27579142084,381.53728273004,392.4383479509,406.97310157871,418.60090448096,436.04260883433,448.50096908674,457.84473927605,470.92601754108,490.54793493862,508.71637697339,523.2511306012],"description":"Hahn-reduced 22 note scale"},"smithgw_indianred":{"frequencies":[261.6255653006,275.93321340298,279.06726965397,290.69507255622,294.32876096318,310.07474405997,313.95067836072,327.03195662575,331.11985608357,348.83408706747,353.19451315581,367.91095120397,372.08969287196,392.4383479509,413.43299207996,418.60090448096,436.04260883433,441.49314144476,465.11211608996,470.92601754108,490.54793493862,496.11959049595,523.2511306012],"description":"32805/32768 Hahn-reduced"},"smithgw_klv":{"frequencies":[261.6255653006,271.78681896552,282.34272472006,293.30861211826,314.10491445143,326.30440921209,338.97771913949,352.14324873572,377.11107157735,391.75765725694,406.97310157871,422.77949745352,452.75560414132,470.34014155688,488.60764618722,523.2511306012],"description":"Variant of kleismic with 9/7 thirds, g=316.492"},"smithgw_meandin":{"frequencies":[261.6255653006,280.31310567921,299.00064605783,313.95067836072,336.37572681506,348.83408706747,373.75080757229,392.4383479509,418.60090448096,448.50096908674,470.92601754108,504.56359022259,523.2511306012],"description":"Gene Smith, inverted detempered 7-limit meantone"},"smithgw_meanred":{"frequencies":[261.6255653006,281.29980781121,291.99281841585,313.95067836072,325.57848126297,350.39138209902,363.36884069528,390.69417751556,420.46965851882,436.04260883433,468.83301301868,486.65469735975,523.2511306012],"description":"171-et Hahn reduced rational Meantone[12]"},"smithgw_meantune":{"frequencies":[261.6255653006,273.55401844854,279.77233440758,292.56174910339,312.85829351777,327.16018629281,334.59705725462,349.85254391288,365.77071543428,374.29488261541,391.03456781852,418.40555295943,437.51985793188,468.14464283802,489.08159472971,500.47948461038,523.2511306012],"description":"Meantune scale/temperament, Gene Ward Smith, 2003"},"smithgw_mir22":{"frequencies":[261.6255653006,267.57160087561,274.70684356563,280.31310567921,285.40970760065,299.00064605783,305.22982618403,319.76457981184,327.03195662575,343.38355445704,348.83408706747,366.27579142084,373.75080757229,392.4383479509,398.6675280771,418.60090448096,428.11456140098,448.50096908674,457.84473927605,479.64686971777,490.54793493862,512.78610798918,523.2511306012],"description":"11-limit Miracle[22]"},"smithgw_mmt":{"frequencies":[261.6255653006,273.37431312998,292.50627485027,307.38829724655,327.03195662575,349.91912034749,365.63284274659,391.22147055517,411.12588832951,437.39890198442,459.65271605653,489.02683710225,523.2511306012],"description":"Modified meantone with 5/4, 14/11 and 44/35 major thirds, TL 17-03-2003"},"smithgw_modmos12a":{"frequencies":[261.6255653006,265.27772209197,292.31087910123,304.72408298441,326.59518553839,340.46429857933,364.90060015836,391.09077971329,407.69874723177,425.01198472693,455.51656649021,488.21056770985,523.2511306012],"description":"A 12-note modmos in 50-et meantone"},"smithgw_octoid":{"frequencies":[261.6255653006,272.34559486824,274.88944875317,277.45706359738,280.04865972334,282.66446436432,285.30470202322,296.99497716113,299.76906949343,302.56907333554,305.39522895084,308.24778413898,311.12698372208,323.87531915696,326.90048829645,329.95391413777,333.03585868997,336.14659218049,339.28638158975,353.18853996009,356.48751029933,359.81729479041,363.17817915623,366.5704580819,369.99442271164,385.15483391523,388.75238658,392.38354231563,396.04861270515,399.74791910495,403.48177901006,420.01432465796,423.93748365756,427.89728706578,431.89407466632,435.9281969008,440,458.02886886968,462.30710409523,466.62530033172,470.98382811593,475.38306960714,479.82340237272,499.48402328631,504.14947188193,508.85849826899,513.6115065207,518.40891338474,523.2511306012],"description":"Octoid temperament, g=16.096, oct=1/8, 11-limit"},"smithgw_orw18r":{"frequencies":[261.6255653006,269.10058145205,280.31310567921,286.15296204753,299.00064605783,305.22982618403,327.03195662575,336.37572681506,348.83408706747,358.80077526939,381.53728273004,392.4383479509,406.97310157871,418.60090448096,448.50096908674,457.84473927605,474.80195184183,490.54793493862,523.2511306012],"description":"Rational version of two cycles of 9-tone \"Orwell\""},"smithgw_pel1":{"frequencies":[261.6255653006,272.52663052146,290.69507255622,294.32876096318,327.03195662575,348.83408706747,363.36884069528,392.4383479509,408.78994578219,418.60090448096,436.04260883433,490.54793493862,523.2511306012],"description":"125/108, 135/128 periodicity block no. 1"},"smithgw_pel2":{"frequencies":[261.6255653006,272.52663052146,290.69507255622,294.32876096318,313.95067836072,327.03195662575,348.83408706747,392.4383479509,408.78994578219,418.60090448096,436.04260883433,490.54793493862,523.2511306012],"description":"125/108, 135/128 periodicity block no. 2"},"smithgw_pel3":{"frequencies":[261.6255653006,290.69507255622,294.32876096318,313.95067836072,327.03195662575,348.83408706747,392.4383479509,408.78994578219,418.60090448096,436.04260883433,470.92601754108,490.54793493862,523.2511306012],"description":"125/108, 135/128 periodicity block no. 3"},"smithgw_pk":{"frequencies":[261.6255653006,271.01659746112,280.74472171431,290.822034715,313.8821415949,325.1489200649,336.82012073975,348.91025643633,376.57634157395,390.09352641046,404.09590743895,418.60090448096,451.79296003201,468.01003810189,484.80922990434,523.2511306012],"description":"Parakleismic temperament, g=315.263, 5-limit"},"smithgw_pris":{"frequencies":[261.6255653006,279.06726965397,293.02063313667,305.22982618403,327.03195662575,348.83408706747,366.27579142084,392.4383479509,418.60090448096,436.04260883433,457.84473927605,488.36772189445,523.2511306012],"description":"optimized (15/14)^3 (16/15)^4 (21/20)^3 (25/24)^2 scale"},"smithgw_prisa":{"frequencies":[261.6255653006,274.70684356563,293.02063313667,313.95067836072,327.03195662575,343.38355445704,366.27579142084,392.4383479509,418.60090448096,439.53094970501,457.84473927605,488.36772189445,523.2511306012],"description":"optimized (15/14)^3 (16/15)^4 (21/20)^3 (25/24)^2 scale"},"smithgw_pum13marv":{"frequencies":[261.6255653006,293.67396865289,305.56991629828,343.00138030143,326.66798000724,366.68389807519,349.22276077151,392.00157668785,407.88051296056,457.84473927605,436.04260883433,489.45661357347,549.41368713126,523.2511306012],"description":"pum13 marvel tempered and in epimorphic order"},"smithgw_qm3a":{"frequencies":[261.6255653006,279.86396690685,305.19382000629,326.46944327063,349.22823143301,366.44956000397,391.99543598175,419.32216217931,457.27406033445,489.15147723638,523.2511306012],"description":"Qm(3) 10-note quasi-miracle scale, mode A, 72-tET, TL 04-01-2002"},"smithgw_qm3b":{"frequencies":[261.6255653006,279.86396690685,299.37379946195,326.46944327063,349.22823143301,373.57357677338,391.99543598175,419.32216217931,448.5538823653,489.15147723638,523.2511306012],"description":"Qm(3) 10-note quasi-miracle scale, mode B"},"smithgw_ragasyn1":{"frequencies":[261.6255653006,269.16210421872,290.69507255622,313.95067836072,322.99452506247,348.83408706747,363.36884069528,392.4383479509,403.74315632809,436.04260883433,470.92601754108,484.4917875937,523.2511306012],"description":"Ragasyn 6561/6250 81/80 scale"},"smithgw_rainbow":{"frequencies":[261.6255653006,273.37431312998,292.50627485027,310.51268695591,327.03195662575,349.91912034749,365.63284274659,391.22147055517,412.03444522126,437.39889945791,468.01003810189,489.02683710225,523.2511306012],"description":"Circulating 1/4-comma meantone, Gene Ward SMith"},"smithgw_ratwell":{"frequencies":[261.6255653006,275.62199471997,293.02063313667,310.07474405997,326.72451751701,348.83408706747,367.49599295996,392.4383479509,413.43299207996,437.57747881743,465.11211608996,489.99465727995,523.2511306012],"description":"7-limit rational well-temperament"},"smithgw_ratwolf":{"frequencies":[261.6255653006,272.55669785235,292.25605339318,313.37920299881,326.47268679644,350.06888377949,364.69531895389,391.05410158062,407.39296674476,436.83777202739,468.410735204,487.98168129749,523.2511306012],"description":"Eleven fifths of (418/5)^(1/11) and one 20/13 wolf, G.W. Smith 2003"},"smithgw_rectoo":{"frequencies":[261.6255653006,290.69507255622,299.00064605783,313.95067836072,327.03195662575,348.83408706747,392.4383479509,408.78994578219,418.60090448096,436.04260883433,457.84473927605,470.92601754108,523.2511306012],"description":"Hahn-reduced circle of fifths via <12 19 27 34| kernel"},"smithgw_sc19":{"frequencies":[261.6255653006,269.16210421872,282.55561052465,290.69507255622,302.80736724606,313.95067836072,327.03195662575,339.06673262958,348.83408706747,363.36884069528,376.74081403286,392.4383479509,403.74315632809,418.60090448096,436.04260883433,452.08897683944,470.92601754108,484.4917875937,508.60009894437,523.2511306012],"description":"Fokker block from commas <81/80, 78732/78125>, Gene Ward Smith 2002"},"smithgw_sch13":{"frequencies":[261.6255653006,269.71217215021,278.04872701265,282.14859498561,290.86954990528,295.15846273282,304.2815407612,313.68660297237,318.31195648825,328.15068782436,332.98931632582,343.28171142549,353.89223299652,359.11042631209,370.21019888355,375.66900084958,387.28058594818,392.99109319609,405.13808832031,417.66053353744,423.81899742763,436.9188548657,443.36128543927,457.06517711961,471.19264083172,478.14044600934,492.91932687455,500.18749236202,515.64783010531,523.2511306012],"description":"13-limit schismic temperament, g=704.3917, TL 31-10-2002"},"smithgw_sch13a":{"frequencies":[261.6255653006,266.49502311502,271.45511438723,280.18048669638,285.39529457963,294.56874561631,300.051354061,305.6360048159,315.46005229837,321.33149462105,331.66004360268,337.8330052901,344.12086009392,355.18192699392,361.79268541866,373.4217751344,380.37201938485,392.59830625439,399.90547017058,407.34863733398,420.4420328577,428.26743302475,442.03321824291,450.26048038501,458.64087358289,473.38295124548,482.19370453904,497.69284002863,506.95605959354,523.2511306012],"description":"13-limit schismic temperament, g=702.660507, TL 31-10-2002"},"smithgw_scj22a":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,290.69507255622,294.32876096318,301.39265122629,313.95067836072,327.03195662575,334.88072358477,348.83408706747,361.67118147155,363.36884069528,376.74081403286,392.4383479509,408.78994578219,418.60090448096,436.04260883433,454.2110508691,465.11211608996,470.92601754108,490.54793493862,502.32108537715,523.2511306012],"description":"225/224 ^ 15625/15552 = [6,5,22,37,-18,-6] catakleismic"},"smithgw_scj22b":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,290.69507255622,294.32876096318,310.07474405997,313.95067836072,327.03195662575,334.88072358477,348.83408706747,353.19451315581,372.08969287196,387.59343007496,392.4383479509,408.78994578219,418.60090448096,436.04260883433,441.49314144476,465.11211608996,470.92601754108,490.54793493862,502.32108537715,523.2511306012],"description":"5120/5103 ^ 225/224 = [1,-8,-14,-10,25,-15] schismic candidate"},"smithgw_scj22c":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,290.69507255622,294.32876096318,306.59245933664,313.95067836072,327.03195662575,334.88072358477,348.83408706747,357.20610515709,367.91095120397,383.2405741708,392.4383479509,408.78994578219,418.60090448096,436.04260883433,446.50763144636,465.11211608996,470.92601754108,490.54793493862,502.32108537715,523.2511306012],"description":"225/224 ^ 65625/65536 = [7,-3,827,7,-21] orwell candidate"},"smithgw_secab":{"frequencies":[261.6255653006,274.07613169002,291.39807132323,313.10572011471,348.73657263424,365.33268718488,392.54808236386,417.35759110361,437.21932894603,486.97408086388,523.2511306012],"description":"{126/125, 176/175} tempering of decab, 328-et version"},"smithgw_secac":{"frequencies":[261.6255653006,281.11531641881,298.8821409504,313.10572011471,348.73657263424,374.71564313773,392.54808236386,417.35759110361,448.44857247831,499.48119153644,523.2511306012],"description":"{126/125, 176/175} tempering of decac, 328-et version"},"smithgw_secad":{"frequencies":[261.6255653006,281.11531641881,313.10572011471,328.00618883132,348.73657263424,374.71564313773,392.54808236386,437.21932894603,469.78990700991,499.48119153644,523.2511306012],"description":"{126/125, 176/175} tempering of decad, 328-et version"},"smithgw_smalldi11":{"frequencies":[261.6255653006,269.10058145205,305.22982618403,313.95067836072,322.92069774245,366.27579142084,373.75080757229,423.93031414449,436.04260883433,448.50096908674,508.71637697339,523.2511306012],"description":"Small diesic 11-note block, <10/9, 126/125, 1728/1715> commas"},"smithgw_smalldi19a":{"frequencies":[261.6255653006,269.10058145205,272.52663052146,299.00064605783,305.22982618403,313.95067836072,317.94773560837,327.03195662575,358.80077526939,366.27579142084,373.75080757229,381.53728273004,418.60090448096,430.56093032327,436.04260883433,448.50096908674,457.84473927605,502.32108537715,508.71637697339,523.2511306012],"description":"Small diesic 19-note block, <16/15, 126/125, 1728/1715> commas"},"smithgw_smalldi19b":{"frequencies":[261.6255653006,266.96486255163,274.70684356563,299.00064605783,305.22982618403,313.95067836072,320.49131749323,327.03195662575,358.80077526939,366.27579142084,373.75080757229,381.53728273004,418.60090448096,427.14378008261,436.04260883433,448.50096908674,457.84473927605,498.33441009638,512.78610798918,523.2511306012],"description":"Small diesic 19-note block, <16/15, 126/125, 2401/2400> commas"},"smithgw_smalldi19c":{"frequencies":[261.6255653006,267.07609791103,274.70684356563,280.31310567921,286.15296204753,313.95067836072,320.49131749323,327.03195662575,336.37572681506,343.38355445704,373.75080757229,381.53728273004,392.4383479509,400.61414686654,436.04260883433,448.50096908674,457.84473927605,470.92601754108,508.71637697339,523.2511306012],"description":"Small diesic 19-note scale containing glumma"},"smithgw_smalldiglum19":{"frequencies":[261.6255653006,267.74077300753,273.99891691894,280.40333801024,286.95745534843,312.9293240034,320.24370022528,327.729041887,335.38934511627,343.22869944589,374.29355081838,383.0422478503,391.99543598175,401.15789496562,437.46578647972,447.69106452518,458.15534711532,468.86422071654,511.30005826145,523.2511306012],"description":"Small diesic \"glumma\" variant of 19-note MOS, 31/120 version"},"smithgw_smalldimos11":{"frequencies":[261.6255653006,267.74077300753,305.78200836532,312.9293240034,320.24370022528,365.74467430283,374.29355081838,427.47405410759,437.46578647972,447.69106452518,511.30005826145,523.2511306012],"description":"Small diesic 11-note MOS, 31/120 version"},"smithgw_smalldimos19":{"frequencies":[261.6255653006,267.74077300753,273.99891691894,298.79793764201,305.78200836532,312.9293240034,320.24370022528,327.729041887,357.39105439675,365.74467430283,374.29355081838,383.0422478503,417.71053321823,427.47405410759,437.46578647972,447.69106452518,458.15534711532,499.62194879119,511.30005826145,523.2511306012],"description":"Small diesic 19-note MOS, 31/120 version"},"smithgw_star":{"frequencies":[261.6255653006,272.52663052146,313.95067836072,327.03195662575,376.74081403286,392.4383479509,436.04260883433,470.92601754108,523.2511306012],"description":"Gene Ward Smith \"Star\" scale, untempered version"},"smithgw_star2":{"frequencies":[261.6255653006,282.55561052465,313.95067836072,327.03195662575,376.74081403286,392.4383479509,436.04260883433,470.92601754108,523.2511306012],"description":"Gene Ward Smith \"Star\" scale, alternative untempered version"},"starra":{"frequencies":[261.6255653006,274.07613169002,294.49338559574,313.10572011471,328.00618883132,343.61575980934,374.71564313773,392.54808236386,411.22915413197,437.21932894603,458.02627217006,492.14685988839,523.2511306012],"description":"12 note {126/125, 176/175} scale, 328-et version"},"smithgw_starrb":{"frequencies":[261.6255653006,274.07613169002,287.1192112957,305.26548915336,328.00618883132,343.61575980934,365.33268718488,392.54808236386,411.22915413197,437.21932894603,458.02627217006,479.82340237272,523.2511306012],"description":"12 note {126/125, 176/175} scale, 328-et version"},"smithgw_starrc":{"frequencies":[261.6255653006,274.07613169002,287.1192112957,313.10572011471,328.00618883132,343.61575980934,365.33268718488,392.54808236386,411.22915413197,437.21932894603,458.02627217006,492.14685988839,523.2511306012],"description":"12 note {126/125, 176/175} scale, 328-et version"},"smithgw_tetra":{"frequencies":[261.6255653006,274.84135386022,293.90210492181,314.2847539672,326.44746606412,342.93767672779,366.7210324511,392.15380743582,419.35039192746,435.57910814854,457.58200907672,489.31615916483,523.2511306012],"description":"{225/224, 385/384} tempering of two-tetrachord 12-note scale"},"smithgw_tr31":{"frequencies":[261.6255653006,267.54129532085,292.57243455474,299.18791603519,305.95298478736,334.57791819083,342.14320575162,349.87955533643,391.26571058456,400.11279059885,409.15991580663,447.44088028055,457.55816161244,467.90420651233,511.68128147674,523.2511306012],"description":"6/31 generator supermajor seconds tripentatonic scale"},"smithgw_tr7_13":{"frequencies":[261.6255653006,183.87449048025,346.05860897284,243.21533855007,457.74028507734,321.70694650116,605.46440189891,425.52973856044,299.06887661109,562.85871464284,395.58580335293,744.50714985079,523.2511306012],"description":"81/80 ==> 28561/28672"},"smithgw_tr7_13b":{"frequencies":[261.6255653006,372.25357492539,395.58580335293,281.42935732142,299.06887661109,425.52973856044,302.73220094945,321.70694650116,457.74028507734,486.43067710015,346.05860897284,367.7489809605,523.2511306012],"description":"reverse reduced 81/80 ==> 28561/28672"},"smithgw_tr7_13r":{"frequencies":[261.6255653006,367.7489809605,346.05860897284,486.43067710015,457.74028507734,321.70694650116,302.73220094945,425.52973856044,299.06887661109,281.42935732142,395.58580335293,372.25357492539,523.2511306012],"description":"reduced 81/80 ==> 28561/28672"},"smithgw_tra":{"frequencies":[261.6255653006,128.35937755236,399.56478905052,196.03545836752,610.23096296248,299.39301413087,931.96857771927,457.24471305759,224.33452437931,698.32199734535,342.61245382262,1066.50464849657,523.2511306012],"description":"81/80 ==> 1029/512"},"smithgw_tre":{"frequencies":[261.6255653006,256.71872396454,399.56476227799,392.07084290614,305.11544059319,299.39293769309,465.98419519089,457.24482979639,448.66910888407,349.16106442144,342.6124767791,533.2523889322,523.2511306012],"description":"81/80 ==> 1029/512 ==> reduction"},"smithgw_treb":{"frequencies":[261.6255653006,266.6261944661,342.6124767791,349.16106442144,448.66910888407,457.24482979639,465.98419519089,299.39293769309,305.11544059319,392.07084290614,399.56476227799,513.43744792908,523.2511306012],"description":"reversed 81/80 ==> 1029/512 ==> reduction"},"smithgw_trx":{"frequencies":[261.6255653006,490.17835855476,354.35176059633,331.954494127,479.94227969828,449.60690021487,325.02250210538,304.47902995326,285.23403465053,412.39349145653,386.32762147798,279.2776760715,523.2511306012],"description":"reduced 3/2->7/6 5/4->11/6 scale"},"smithgw_trxb":{"frequencies":[261.6255653006,279.2776760715,386.32762147798,412.39349145653,285.23403465053,304.47902995326,325.02250210538,449.60690021487,479.94227969828,331.954494127,354.35176059633,490.17835855476,523.2511306012],"description":"reversed reduced 3/2->7/6 5/4->11/6 scale"},"smithgw_wa":{"frequencies":[261.6255653006,273.6474362764,299.37379946195,313.13022722746,327.51877211613,349.22823143301,374.77430422696,391.99543598175,417.97870684853,437.18511000944,469.1652354389,500.26367760099,523.2511306012],"description":"Wreckmeister A temperament, TL 2-6-2002"},"smithgw_wa120":{"frequencies":[261.6255653006,273.99891691894,298.79793764201,312.9293240034,327.729041887,349.22823143301,374.29355081838,391.99543598175,417.71053321823,437.46578647972,468.86422071654,499.62194879119,523.2511306012],"description":"120-tET version of Wreckmeister A temperament"},"smithgw_wb":{"frequencies":[261.6255653006,280.76349612739,291.78605424516,313.13022722746,327.51877211613,349.22823143301,365.2755039332,391.99543598175,417.97870684853,437.18511000944,469.1652354389,487.58430040208,523.2511306012],"description":"Wreckmeister B temperament, TL 2-6-2002"},"smithgw_well1":{"frequencies":[261.6255653006,275.92984511873,292.92635710626,310.42107575858,327.5229776175,349.2237102284,367.90646015831,391.734151992,413.8947676781,437.99072463899,465.63161363786,490.54194687775,523.2511306012],"description":"Well-temperament, Gene Ward Smith (2005)"},"smithgw_whelp1":{"frequencies":[261.6255653006,275.93321340298,292.50627485027,310.07474405997,327.03195662575,348.05120395042,368.50381975103,390.45372436301,413.66634097248,438.25895612273,464.36382062247,491.65133958137,523.2511306012],"description":"well-temperament with one pure third, Gene Ward Smith, 2003"},"smithgw_whelp2":{"frequencies":[261.6255653006,275.85000668176,292.43269265164,309.98104674077,327.03195662575,347.97308568611,368.21146504308,391.7894791814,413.34036955908,438.14417346548,464.48314871299,489.73685071229,523.2511306012],"description":"well-temperament with two pure thirds"},"smithgw_whelp3":{"frequencies":[261.6255653006,275.96871294479,292.50627485027,310.03485655885,327.03195662575,349.46135677641,368.11883862276,391.73393619399,413.66634097248,436.82669499534,464.84945270756,489.66742197778,523.2511306012],"description":"well-temperament with three pure thirds"},"smithgw_wiz28":{"frequencies":[261.6255653006,269.80136421624,277.4816601673,280.31310567921,287.78812183066,297.30177875068,305.22982618403,308.34441624714,317.12189733406,327.03195662575,336.37572681506,345.34574619679,348.83408706747,359.73515228832,370.01329949656,380.54627680087,392.4383479509,396.40237166758,406.97310157871,418.60090448096,431.68218274599,436.04260883433,448.50096908674,460.46099492906,475.68284600109,490.54793493862,493.35106599542,508.71637697339,523.2511306012],"description":"11-limit Wizard[28]"},"smithgw_wiz34":{"frequencies":[261.6255653006,269.80136421624,272.52663052146,277.4816601673,280.31310567921,287.78812183066,297.30177875068,305.22982618403,308.34441624714,313.95067836072,317.12189733406,327.03195662575,336.37572681506,345.34574619679,348.83408706747,356.76213450082,359.73515228832,370.01329949656,380.54627680087,383.71749577421,392.4383479509,396.40237166758,406.97310157871,418.60090448096,431.68218274599,436.04260883433,443.97065626768,448.50096908674,460.46099492906,475.68284600109,490.54793493862,493.35106599542,504.56359022259,508.71637697339,523.2511306012],"description":"11-limit Wizard[34]"},"smithgw_wiz38":{"frequencies":[261.6255653006,269.80136421624,272.52663052146,277.4816601673,280.31310567921,285.40970760065,287.78812183066,297.30177875068,305.22982618403,308.34441624714,313.95067836072,317.12189733406,327.03195662575,336.37572681506,339.14425131559,345.34574619679,348.83408706747,356.76213450082,359.73515228832,370.01329949656,380.54627680087,383.71749577421,392.4383479509,396.40237166758,403.65087217807,406.97310157871,418.60090448096,431.68218274599,436.04260883433,443.97065626768,448.50096908674,460.46099492906,475.68284600109,479.64686971777,490.54793493862,493.35106599542,504.56359022259,508.71637697339,523.2511306012],"description":"11-limit Wizard[38]"},"smithgw_wreckpop":{"frequencies":[261.6255653006,272.73569398658,292.31087910123,313.29104303136,326.59518553839,350.03605285217,364.90060015836,391.09077971329,419.16071913933,436.9606979923,455.51656649021,501.93603498211,523.2511306012],"description":"\"Wreckmeister\" 13-limit meanpop (50-et) tempered thirds"},"smithj12":{"frequencies":[261.6255653006,272.52663052146,294.32876096318,306.59245933664,331.11985608357,344.91651675372,363.36884069528,392.4383479509,408.78994578219,441.49314144476,459.88868900496,496.67978412536,523.2511306012],"description":"J. Smith, 5-limit JI scale, MMM 21-3-2006"},"smithj17":{"frequencies":[261.6255653006,272.57820116223,283.17034563789,295.02492750576,308.97787266236,319.3201344739,332.68808325276,348.42227432308,363.00854876594,377.11473546037,392.90218486657,411.48414905414,425.25755219187,443.06044202496,464.01459698705,479.54632553791,499.62194879119,523.2511306012],"description":"J. Smith 17-tone well temperament, MMM 12-2006"},"smithrk_19":{"frequencies":[261.6255653006,274.68253637698,286.11368885031,294.3308008075,305.19387818096,313.95878694534,327.0246436172,343.34529416761,348.83287827711,366.24211271841,381.48359653409,392.43970784476,406.92376081862,418.61050714007,436.03134720211,457.79213919624,470.93981233279,488.32112480698,508.64303280756,523.2511306012],"description":"19 out of 612-tET by Roger K. Smith, 1978"},"smithrk_mult":{"frequencies":[261.6255653006,274.70684356563,286.15296204753,294.32876096318,305.22982618403,313.95067836072,327.03195662575,343.38355445704,348.83408706747,366.27579142084,381.53728273004,392.4383479509,406.97310157871,418.60090448096,436.04260883433,457.84473927605,470.92601754108,488.36772189445,508.71637697339,523.2511306012],"description":"Roger K. Smith, \"Multitonic\" scale, just version"},"solar":{"frequencies":[261.6255653006,394.58976180129,774.00176545642,2207.36533954793,5481.83445910426,34573.03685904828,65024.37680021134,105705.6559450381],"description":"Solar system scale: 0=Pluto, 8=Mercury. 1/1=248.54 years period"},"solemn":{"frequencies":[261.6255653006,313.95067836072,348.83408706747,392.4383479509,418.60090448096,470.92601754108,523.2511306012],"description":"Solemn 6"},"songlines":{"frequencies":[261.6255653006,305.22982618403,313.95067836072,327.03195662575,348.83408706747,366.27579142084,392.4383479509,418.60090448096,436.04260883433,457.84473927605,470.92601754108,479.64686971777,523.2511306012],"description":"Songlines.DEM, Bill Thibault and Scott Gresham-Lancaster. 1992 ICMC (=rectsp6)"},"sorge":{"frequencies":[261.6255653006,272.52663052146,294.32876096318,306.59245933664,327.03195662575,348.83408706747,367.91095120397,392.4383479509,408.78994578219,436.04260883433,470.92601754108,490.54793493862,523.2511306012],"description":"Sorge's Monochord (1756)"},"sorge1":{"frequencies":[261.6255653006,276.86979852503,293.00227310437,311.47852302926,328.88393162803,349.6228209638,369.57684148724,391.5530240856,415.30469757995,439.00737933323,466.69047534984,493.32589719545,523.2511306012],"description":"Georg Andreas Sorge, 1744 (A)"},"sorge2":{"frequencies":[261.6255653006,276.24519242498,293.00227310437,310.77584116741,328.88393162803,348.83408706747,368.74309237173,391.5530240856,414.36778843034,438.51190905657,465.63764214343,492.21297564769,523.2511306012],"description":"Georg Andreas Sorge, 1744 (B)"},"sorge3":{"frequencies":[261.6255653006,276.55731914056,293.00227310437,310.77584116741,328.51274831708,348.83408706747,369.15973155124,391.5530240856,414.83597850347,438.51190905657,465.63764214343,492.7691222293,523.2511306012],"description":"Georg Andreas Sorge, well temperament, (1756, 1758)"},"sparschuh":{"frequencies":[261.6255653006,276.27659695743,293.02063313667,310.81117157711,328.60171001755,349.008504111,368.36879594324,391.3918456897,414.41489543615,439.53094970501,465.69350623507,491.85606276513,523.2511306012],"description":"Andreas Sparschuh WTC temperament, 1/1=C=250, modified Collatz sequence"},"sparschuh2":{"frequencies":[261.6255653006,276.27659695743,293.02063313667,310.81117157711,328.60171001755,349.008504111,368.36879594324,391.3918456897,414.41489543615,438.48444744381,465.69350623507,491.85606276513,523.2511306012],"description":"Modified Sparschuh temperament with A=419Hz by Tom Dent"},"spec1_14":{"frequencies":[261.6255653006,277.97716313189,294.32876096318,310.68035879446,327.03195662575,343.38355445704,359.73515228832,392.4383479509,408.78994578219,425.14154361347,441.49314144476,457.84473927605,523.2511306012],"description":"Spectrum sequence of 8/7: 1 to 27 reduced by 2/1"},"spec1_17":{"frequencies":[261.6255653006,277.97716313189,294.32876096318,310.68035879446,327.03195662575,359.73515228832,376.08675011961,392.4383479509,408.78994578219,425.14154361347,441.49314144476,490.54793493862,523.2511306012],"description":"Spectrum sequence of 7/6: 1 to 27 reduced by 2/1"},"spec1_25":{"frequencies":[261.6255653006,277.97716313189,294.32876096318,327.03195662575,343.38355445704,359.73515228832,376.08675011961,392.4383479509,408.78994578219,425.14154361347,457.84473927605,490.54793493862,523.2511306012],"description":"Spectrum sequence of 5/4: 1 to 25 reduced by 2/1"},"spec1_33":{"frequencies":[261.6255653006,277.97716313189,294.32876096318,327.03195662575,343.38355445704,359.73515228832,392.4383479509,408.78994578219,425.14154361347,457.84473927605,474.19633710734,490.54793493862,523.2511306012],"description":"Spectrum sequence of 4/3: 1 to 29 reduced by 2/1"},"spec1_4":{"frequencies":[261.6255653006,294.32876096318,310.68035879446,327.03195662575,343.38355445704,359.73515228832,376.08675011961,392.4383479509,408.78994578219,425.14154361347,457.84473927605,490.54793493862,523.2511306012],"description":"Spectrum sequence of 7/5: 1 to 25 reduced by 2/1"},"spec1_5":{"frequencies":[261.6255653006,294.32876096318,310.68035879446,327.03195662575,343.38355445704,359.73515228832,392.4383479509,408.78994578219,425.14154361347,441.49314144476,457.84473927605,490.54793493862,523.2511306012],"description":"Spectrum sequence of 1.5: 1 to 27 reduced by 2/1"},"specr2":{"frequencies":[261.6255653006,294.32876096318,310.68035879446,327.03195662575,343.38355445704,359.73515228832,392.4383479509,408.78994578219,425.14154361347,457.84473927605,474.19633710734,490.54793493862,523.2511306012],"description":"Spectrum sequence of sqrt(2): 1 to 29 reduced by 2/1"},"specr3":{"frequencies":[261.6255653006,277.97716313189,310.68035879446,327.03195662575,359.73515228832,392.4383479509,408.78994578219,425.14154361347,441.49314144476,474.19633710734,490.54793493862,506.89953276991,523.2511306012],"description":"Spectrum sequence of sqrt(3): 1 to 31 reduced by 2/1"},"spon_chal1":{"frequencies":[261.6255653006,280.31310567921,285.40970760065,286.15296204753,348.83408706747,392.4383479509,420.46965851882,428.11456140098,429.2294430713,523.2511306012],"description":"JC Spondeion, from discussions with George Kahrimanis about tritone of spondeion"},"spon_chal2":{"frequencies":[261.6255653006,275.62199471997,279.06726965397,285.40970760065,348.83408706747,392.4383479509,413.43299207996,418.60090448096,428.11456140098,523.2511306012],"description":"JC Spondeion II, 10 May 1997. Various tunings for the parhypatai and hence trito"},"spon_mont":{"frequencies":[261.6255653006,271.31540105247,348.83408706747,392.4383479509,428.11456140098,523.2511306012],"description":"Montford's Spondeion, a mixed septimal and undecimal pentatonic, 1923"},"spon_terp":{"frequencies":[261.6255653006,285.40970760065,348.83408706747,392.4383479509,428.11456140098,523.2511306012],"description":"Subharm. 6-tone series, guess at Greek poet Terpander's, 6th c. BC & Spondeion, Winnington-Ingram (1928)"},"stade":{"frequencies":[261.6255653006,274.22463192287,292.50627485027,309.28772967674,327.03195662575,348.83408706747,365.63284274659,391.22147055517,411.33694767869,437.39890198442,465.11211608996,489.02683710225,523.2511306012],"description":"Organs in St. Cosmae, Stade; Magnuskerk, Anloo; H.K. Sluipwijk, modif. 1/4 mean"},"stanhope":{"frequencies":[261.6255653006,275.62199471997,293.00227310437,310.07474405997,326.6631048533,348.83408706747,367.49599295996,392.4383479509,413.43299207996,437.52264545758,465.11211608996,489.99465727995,523.2511306012],"description":"Well temperament of Charles, third earl of Stanhope (1806)"},"stanhope2":{"frequencies":[261.6255653006,275.85537639807,293.11251278827,310.16223770573,327.03195662575,348.83408706747,367.91095120397,392.4383479509,413.66634097248,437.85193595173,465.11211608996,490.54793493862,523.2511306012],"description":"Stanhope temperament (real version?) with 1/3 synt. comma temp."},"stanhope_f":{"frequencies":[261.6255653006,275.62199471997,292.46014274879,310.07474405997,326.6631048533,348.83408706747,367.49599295996,392.4383479509,413.43299207996,436.79202494356,465.11211608996,489.99465727995,523.2511306012],"description":"Stanhope temperament, equal beating version by Farey (1807)"},"stanhope_s":{"frequencies":[261.6255653006,275.77758308753,293.11247215425,310.2497806633,327.03195662575,348.83408706747,367.7034443005,392.4383479509,413.66637442451,437.85181455341,465.11211608996,490.54793493862,523.2511306012],"description":"Stanhope temperament, alt. version with 1/3 syntonic comma"},"starling":{"frequencies":[261.6255653006,278.9816419584,293.66476791741,313.14630527334,327.50195613664,349.22823143301,367.60851651046,391.99543598175,418.00016846495,437.16266336983,466.16376151809,490.69849857048,523.2511306012],"description":"Starling temperament, Herman Miller (1999)"},"stearns":{"frequencies":[261.6255653006,299.00064605783,336.37572681506,366.27579142084,398.6675280771,448.50096908674,504.56359022259,523.2511306012],"description":"Dan Stearns, guitar scale"},"stearns2":{"frequencies":[261.6255653006,280.31310567921,287.78812183066,299.00064605783,313.95067836072,317.68818643644,336.37572681506,340.11323489078,355.06326719367,366.27579142084,373.75080757229,392.4383479509,411.12588832951,418.60090448096,429.81342870813,444.76346101102,448.50096908674,467.18850946536,470.92601754108,485.87604984397,497.08857407114,504.56359022259,523.2511306012],"description":"Dan Stearns, scale for \"At A Day Job\" based on harmonics 10-20 and 14-28"},"stearns3":{"frequencies":[261.6255653006,304.11599009871,327.88291945286,364.30920726489,423.47641042702,470.52269644143,546.93995798074,607.70247408742,706.39900722312,784.8766959018],"description":"Dan Stearns, trivalent version of Bohlen's Lambda scale"},"stearns4":{"frequencies":[261.6255653006,296.65550714972,336.37572681506,347.46339693852,393.986457405,446.73865184892,461.46412096988,523.2511306012],"description":"Dan Stearns, 1/4-septimal comma temperament, tuning-math 2-12-2001"},"steldek1":{"frequencies":[261.6255653006,274.70684356563,275.93321340298,280.31310567921,286.15296204753,294.32876096318,305.22982618403,309.04519901133,315.35224388912,321.92208230347,327.03195662575,331.11985608357,343.38355445704,353.19451315581,367.91095120397,381.53728273004,386.30649876417,392.4383479509,400.61414686654,408.78994578219,412.06026534844,420.46965851882,429.2294430713,436.04260883433,441.49314144476,457.84473927605,490.54793493862,504.56359022259,508.71637697339,515.07533168556,523.2511306012],"description":"Stellated two out of 1 3 5 7 9 dekany"},"steldek1s":{"frequencies":[261.6255653006,274.70684356563,275.93321340298,280.31310567921,286.15296204753,294.32876096318,305.22982618403,309.04519901133,315.35224388912,321.92208230347,327.03195662575,331.11985608357,339.14425131559,343.38355445704,353.19451315581,360.4025644447,367.91095120397,381.53728273004,386.30649876417,392.4383479509,400.61414686654,408.78994578219,412.06026534844,420.46965851882,429.2294430713,436.04260883433,441.49314144476,457.84473927605,482.88312345521,490.54793493862,494.47231841813,504.56359022259,508.71637697339,515.07533168556,523.2511306012],"description":"Superstellated two out of 1 3 5 7 9 dekany"},"steldek2":{"frequencies":[261.6255653006,262.3068818769,269.80136421624,274.70684356563,280.31310567921,286.15296204753,294.32876096318,299.7792935736,308.34441624714,312.16686768822,314.76825825228,327.03195662575,337.2517052703,343.38355445704,356.76213450082,359.73515228832,377.72190990274,381.53728273004,385.43052030892,392.4383479509,393.46032281536,400.61414686654,408.78994578219,416.22249025095,419.69101100305,429.2294430713,431.68218274599,449.66894036041,457.84473927605,472.15238737843,490.54793493862,494.63583439645,499.46698830115,503.62921320365,513.90736041189,523.2511306012],"description":"Stellated two out of 1 3 5 7 11 dekany"},"steldek2s":{"frequencies":[261.6255653006,262.3068818769,269.80136421624,274.70684356563,280.31310567921,286.15296204753,294.32876096318,295.09524211152,299.7792935736,302.17752792219,308.34441624714,312.16686768822,314.76825825228,327.03195662575,337.2517052703,343.38355445704,349.7425091692,356.76213450082,359.73515228832,377.72190990274,381.53728273004,385.43052030892,392.4383479509,393.46032281536,400.61414686654,408.78994578219,416.22249025095,419.69101100305,429.2294430713,431.68218274599,440.49202321019,449.66894036041,454.06089845559,457.84473927605,472.15238737843,490.54793493862,494.63583439645,499.46698830115,503.62921320365,513.90736041189,523.2511306012],"description":"Superstellated two out of 1 3 5 7 11 dekany"},"steleik1":{"frequencies":[220,220.57291666667,224.58333333333,225,226.875,229.16666666667,232.03125,235.27777777778,238.21875,240.625,242.63020833333,243.08035714286,247.5,248.14453125,252.08333333333,252.65625,255.234375,256.66666666667,257.8125,262.5,264.6875,270.703125,272.25,275,277.29166666667,278.4375,280.72916666667,283.59375,288.75,294.09722222222,297.7734375,302.5,308.80208333333,309.375,311.953125,315,315.10416666667,317.625,320.83333333333,324.10714285714,324.84375,330,330.859375,336.11111111111,336.875,340.3125,343.75,346.5,346.61458333333,350,352.91666666667,353.57142857143,360.9375,366.66666666667,371.25,378.125,385,388.92857142857,392.12962962963,393.75,397.03125,401.04166666667,403.33333333333,412.5,415.9375,423.5,425.390625,427.77777777778,432.14285714286,433.125,440],"description":"Stellated Eikosany 3 out of 1 3 5 7 9 11"},"steleik1s":{"frequencies":[123.47082531403,123.79236392162,125.33976847064,127.32928860509,129.9819821177,130.22313607339,131.308328874,132.59082945654,132.63467563031,133.69575303535,135.04621518722,136.42423779117,136.73429287706,138.90467847828,139.26640941182,141.47698733899,141.79852594658,143.24544968073,144.69237341488,145.8499124022,145.89814319334,147.3231438406,148.55083670594,148.82644122673,151.92699208562,154.33853164254,156.26776328807,156.6747105883,159.16161075637,160.43490364242,160.48795751267,162.05545822466,163.70908534941,165.05648522882,165.43161360434,165.73853682068,167.11969129419,168.80776898403,169.77238480679,173.63084809785,175.077771832,175.80123369908,178.26100404713,179.05681210091,180.06162024963,181.89898372156,182.31239050275,185.20623797104,185.68854588243,189.06470126211,189.41547065221,190.99393290764,192.92316455317,195.33470411009,198.06778227459,200.54362955302,202.56932278083,204.25740047067,204.63635668676,208.35701771743,208.89961411773,212.21548100849,212.69778891987,214.8681745211,216.07394429955,217.03856012232,220.07531363843,220.98471576091,222.82625505891,227.89048812843,229.19271948917,231.50779746381,233.43702910934,233.87012192772,234.4016449321,236.33087657764,238.74241613455,241.07423537553,241.15395569146,243.083187337,246.94165062806],"description":"Superstellated Eikosany 3 out of 1 3 5 7 9 11"},"steleik2":{"frequencies":[123.47082531403,124.49974885831,126.04313417474,126.11662871362,127.68005799519,128.74405847848,129.64436657973,130.41605923794,132.04518818306,132.96858110742,133.76006075687,135.81790784543,137.94006265552,138.64744759221,140.44806379471,141.47698733899,144.0492961997,145.92006628022,146.26543921816,147.13606683255,148.16499037684,148.55083670594,151.25176100969,152.15206911093,154.33853164254,154.49287017418,155.62468607289,156.05340421634,157.14468676331,157.64578589202,158.45422581967,160.51207290824,160.9300730981,163.85607442716,164.62776708537,167.20007594608,169.77238480679,170.24007732692,171.65874463798,172.85915543964,173.88807898393,175.56007974339,176.56328019906,180.06162024963,181.09054379391,182.8317990227,183.92008354069,185.20623797104,186.74962328747,187.26408505961,190.14507098361,193.11608771773,194.02558263633,197.55332050245,198.06778227459,200.6400911353,201.66901467958,202.31209189476,203.72686176815,204.2880927923,205.78470885672,205.99049356557,208.95062745451,210.19438118936,214.01609721099,214.57343079747,216.07394429955,217.36009872991,217.87456050205,220.70410024883,224.71690207153,226.36317974239,229.30296129748,230.47887391952,234.08010632452,237.68133872951,239.0961086029,240.76810936236,243.77573203026,245.22677805425,246.94165062806],"description":"Stellated Eikosany 3 out of 1 3 5 7 11 13"},"steleik2s":{"frequencies":[61.73541265702,61.89618196081,62.32902239411,62.70002847979,63.66464430255,64.65940436978,64.99099105886,65.83502990378,66.22690508177,66.31733781516,67.05419712422,67.52310759362,68.40003106886,68.56192463352,68.97003132776,69.45233923915,69.63320470592,70.8992629733,71.32128239576,72.34618670745,72.41853289415,72.94907159667,73.15003322642,73.66157192031,73.89646213689,74.27541835298,75.24003417574,75.43597176474,76.80753488774,77.16926582128,78.37503559973,79.58080537819,79.800036247,80.24397875634,80.46503654906,81.02772911234,81.51003702372,82.29378737972,82.71580680218,82.76403759332,84.40388449202,84.45309958502,84.8861924034,85.7024057919,86.21253915971,86.81542404893,87.05458499673,87.53888591601,87.7800398717,89.13050202357,90.52316611769,90.94949186079,92.60311898553,92.84427294122,94.05004271968,94.53235063106,94.83379307568,95.49696645383,95.7600434964,96.46158227659,96.55804385887,97.94560661931,98.52861618252,100.32004556766,100.58129568632,101.28466139042,101.88754627965,102.12870023534,103.45504699165,104.17850885872,105.33604784604,105.47988405157,106.10774050425,107.4857631082,108.03697214979,109.72504983963,111.41312752947,112.07630090762,112.86005126361,113.15395764711,114.2698743892,114.95005221294,115.75389873191,115.86965263064,116.71851455468,118.16543828883,118.23433941902,119.7000543705,120.57697784574,120.69755482359,121.54159366851,122.26505553558,123.47082531404],"description":"Superstellated Eikosany 3 out of 1 3 5 7 11 13"},"stelhex1":{"frequencies":[261.6255653006,274.70684356563,280.31310567921,286.15296204753,294.32876096318,327.03195662575,343.38355445704,381.53728273004,392.4383479509,400.61414686654,408.78994578219,429.2294430713,457.84473927605,490.54793493862,523.2511306012],"description":"Stellated two out of 1 3 5 7 hexany, also dekatesserany, mandala, tetradekany"},"stelhex2":{"frequencies":[261.6255653006,275.93321340298,294.32876096318,327.03195662575,331.11985608357,353.19451315581,367.91095120397,392.4383479509,408.78994578219,436.04260883433,441.49314144476,490.54793493862,523.2511306012],"description":"Stellated two out of 1 3 5 9 hexany"},"stelhex3":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,281.36411960997,289.40309445597,297.67175429757,339.14425131559,348.83408706747,358.80077526939,361.75386806997,372.08969287196,385.87079260796,434.10464168396,465.11211608996,523.2511306012],"description":"Stellated Tetrachordal Hexany based on Archytas's Enharmonic"},"stelhex4":{"frequencies":[261.6255653006,269.10058145205,276.78916949353,279.06726965397,287.04062021552,297.67175429757,336.37572681506,348.83408706747,358.80077526939,361.75386806997,372.08969287196,382.72082695402,430.56093032327,465.11211608996,523.2511306012],"description":"Stellated Tetrachordal Hexany based on the 1/1 35/36 16/15 4/3 tetrachord"},"stelhex5":{"frequencies":[261.6255653006,294.32876096318,305.22982618403,331.11985608357,343.38355445704,386.30649876417,392.4383479509,400.61414686654,441.49314144476,457.84473927605,504.56359022259,515.07533168556,523.2511306012],"description":"Stellated two out of 1 3 7 9 hexany, stellation is degenerate"},"stelhex6":{"frequencies":[261.6255653006,269.80136421624,294.32876096318,299.7792935736,327.03195662575,337.2517052703,356.76213450082,359.73515228832,392.4383479509,408.78994578219,431.68218274599,449.66894036041,490.54793493862,494.63583439645,523.2511306012],"description":"Stellated two out of 1 3 5 11 hexany, from The Giving, by Stephen J. Taylor"},"stelpd1":{"frequencies":[207.65234878997,208.19311011494,212.37172035338,214.14148468966,218.03496622947,219.00833661442,222.07265078927,222.48465941783,222.99030637105,224.84855892414,227.11975648903,229.43730502463,233.60889238872,237.93498298851,240.90917027586,242.2610735883,244.73312535961,245.28933700815,247.76700707894,249.83173213793,250.29524184505,254.84606442405,255.50972605016,256.96978162759,259.56543598746,262.81000393731,267.67685586207,272.54370778684,275.32476602956,277.59081348659,280.33067086646,281.06069865517,283.1622938045,285.52197958621,292.0111154859,297.32040849473,299.79807856552,302.82634198537,305.91640669951,306.61167126019,311.47852318496,312.28966517242,317.24664398468,317.96765908464,318.55758053007,321.21222703448,324.45679498433,327.0524493442,330.35600943859,333.10897618391,333.72698912674,340.67963473354,342.62637550345,346.08724798328,350.41333858307,356.90247448276,363.39161038245,367.09968803941,371.65051061841,374.7475982069,380.69597278161,385.45467244138,389.34815398119,392.59272193104,396.42721132631,399.73077142069,400.47238695209,401.51528379311,403.7684559805,407.88854226601,408.81556168025,415.30469757994],"description":"Stellated two out of 1 3 5 7 9 11 pentadekany"},"stelpd1s":{"frequencies":[21.82676446456,21.88360499702,22.15715005948,22.2309638065,22.3228272933,22.50885085408,22.68892166091,22.91810268779,23.02041564622,23.14959867453,23.15196087848,23.34251199682,23.38581906917,23.43896865797,23.624449876,23.63429339678,23.87302363311,24.11662591508,24.35217522905,24.55511002263,24.61905562165,25.00983428231,25.20991295657,25.32245721084,25.46455854199,25.72440097609,25.78286552376,25.93612444091,26.04329850885,26.26032599642,26.30904645282,26.78739275196,26.85715158725,27.01062102489,27.2834555807,27.56185818867,27.62449877546,27.69643757435,28.01101439619,28.1360635676,28.29395393554,28.36115207614,28.41087110056,28.58266775121,28.64762835974,28.9399510981,29.17813999603,29.29871082246,29.46613202716,29.54286674598,29.7637697244,30.01180113877,30.06748166036,30.69388752829,30.99367756425,31.12334932909,31.25195821062,31.51239119571,31.65307151355,31.83069817748,32.15550122011,32.2285819047,32.41274522987,32.74014669684,32.82540749553,33.0742298264,33.34644570974,33.42223308636,33.48424093995,33.76327628112,34.09304532068,34.10431947588,34.37715403168,34.58149925455,34.7243980118,35.01376799523,35.07872860376,35.45144009517,35.80953544967,36.01416136652,36.17493887262,36.37794077427,36.74914425156,36.83266503394,36.92858343247,37.50234985274,37.51475142346,37.81486943485,37.88116146742,38.19683781298,38.26770393137,38.58660146413,38.90418666137,39.06494776328,39.39048899464,40.01573485169,40.28572738088,40.51593153734,40.92518337105,41.25258483802,41.26622656581,41.342787283,41.66927761416,42.01652159428,42.09447432451,42.2040953514,42.44093090331,42.61630665085,42.87400162681,42.9714425396,43.65352892912],"description":"Superstellated two out of 1 3 5 7 9 11 pentadekany"},"stelpent1":{"frequencies":[261.6255653006,274.70684356563,280.31310567921,286.15296204753,290.69507255622,294.32876096318,305.22982618403,313.95067836072,327.03195662575,336.37572681506,343.38355445704,348.83408706747,353.19451315581,366.27579142084,367.91095120397,373.75080757229,381.53728273004,392.4383479509,406.97310157871,412.06026534844,420.46965851882,436.04260883433,441.49314144476,448.50096908674,457.84473927605,470.92601754108,490.54793493862,504.56359022259,508.71637697339,515.07533168556,523.2511306012],"description":"Stellated one out of 1 3 5 7 9 pentany"},"stelpent1s":{"frequencies":[261.6255653006,271.31540105247,274.70684356563,275.93321340298,280.31310567921,282.55561052465,286.15296204753,288.32205155576,290.69507255622,294.32876096318,301.46155672497,305.22982618403,309.04519901133,313.95067836072,315.35224388912,320.35783506196,321.92208230347,327.03195662575,329.64821227876,336.37572681506,339.14425131559,343.38355445704,348.83408706747,353.19451315581,360.4025644447,366.27579142084,367.91095120397,373.75080757229,381.53728273004,386.30649876417,387.59343007496,392.4383479509,395.57785473451,403.65087217807,406.97310157871,411.88864507966,412.06026534844,420.46965851882,429.2294430713,436.04260883433,439.53094970501,441.49314144476,448.50096908674,452.19233508746,457.84473927605,470.92601754108,480.53675259294,482.88312345521,488.36772189445,490.54793493862,494.47231841813,498.33441009638,504.56359022259,508.71637697339,515.07533168556,523.2511306012],"description":"Superstellated one out of 1 3 5 7 9 pentany"},"steltet1":{"frequencies":[261.6255653006,274.70684356563,280.31310567921,286.15296204753,305.22982618403,313.95067836072,327.03195662575,343.38355445704,366.27579142084,373.75080757229,381.53728273004,392.4383479509,436.04260883433,448.50096908674,457.84473927605,490.54793493862,523.2511306012],"description":"Stellated one out of 1 3 5 7 tetrany"},"steltet1s":{"frequencies":[261.6255653006,274.70684356563,280.31310567921,286.15296204753,305.22982618403,313.95067836072,320.35783506196,327.03195662575,343.38355445704,366.27579142084,373.75080757229,381.53728273004,392.4383479509,429.2294430713,436.04260883433,439.53094970501,448.50096908674,457.84473927605,490.54793493862,508.71637697339,523.2511306012],"description":"Superstellated one out of 1 3 5 7 tetrany"},"steltet2":{"frequencies":[261.6255653006,267.07609791103,272.52663052146,286.15296204753,305.22982618403,327.03195662575,333.84512238879,343.38355445704,381.53728273004,392.4383479509,400.61414686654,408.78994578219,436.04260883433,457.84473927605,476.92160341255,490.54793493862,523.2511306012],"description":"Stellated three out of 1 3 5 7 tetrany"},"steltet2s":{"frequencies":[261.6255653006,286.15296204753,294.32876096318,300.46061014991,306.59245933664,327.03195662575,343.38355445704,350.53737850823,357.69120255941,367.91095120397,392.4383479509,400.61414686654,408.78994578219,429.2294430713,441.49314144476,457.84473927605,490.54793493862,500.76768358318,510.98743222773,515.07533168556,523.2511306012],"description":"Superstellated three out of 1 3 5 7 tetrany"},"steltri1":{"frequencies":[261.6255653006,313.95067836072,327.03195662575,392.4383479509,436.04260883433,490.54793493862,523.2511306012],"description":"Stellated one out of 1 3 5 triany"},"steltri2":{"frequencies":[261.6255653006,294.32876096318,327.03195662575,392.4383479509,408.78994578219,490.54793493862,523.2511306012],"description":"Stellated two out of 1 3 5 triany"},"stevin":{"frequencies":[261.6255653006,277.20445571159,293.66434538175,311.1256573916,329.66931111467,349.25319089654,369.99797100919,392.00714009679,415.41055144586,440.15068186507,466.27261682516,494.00597677606,523.2511306012],"description":"Simon Stevin, monochord division of 10000 parts for 12-tET (1585)"},"stopper":{"frequencies":[261.6255653006,277.19910487213,293.6996776193,311.18246278326,329.70593120198,349.3320268423,370.12638880276,392.15855510068,415.50221189151,440.23542223935,466.44090588941,494.20629608476,523.62445363767,554.79375523088,587.81844599272,622.80896314278,659.88233179115,699.16252826162,740.78092441407,784.8766959018],"description":"Bernard Stopper, piano tuning with 19th root of 3 (1988)"},"storbeck":{"frequencies":[261.6255653006,290.69507255622,294.32876096318,299.00064605783,305.22982618403,313.95067836072,327.03195662575,339.14425131559,348.83408706747,353.19451315581,358.80077526939,381.53728273004,387.59343007496,392.4383479509,403.65087217807,418.60090448096,436.04260883433,448.50096908674,457.84473927605,465.11211608996,470.92601754108,523.2511306012],"description":"Ulrich Storbeck, 2001"},"strahle":{"frequencies":[261.6255653006,278.94941459687,296.90543930973,315.65242990842,335.0021118691,355.12744448111,376.24442122187,398.15684412917,421.10213511252,444.85552088095,469.94877954106,496.17080790016,523.2511306012],"description":"Strahle's Geometrical scale"},"sub24-12":{"frequencies":[261.6255653006,273.00058987889,285.40970760065,299.00064605783,313.95067836072,330.47439827444,348.83408706747,369.35373924791,392.4383479509,418.60090448096,448.50096908674,483.00104363188,523.2511306012],"description":"Subharmonics 24-12"},"sub24":{"frequencies":[261.6255653006,10.90106522086,11.37502457829,11.89207115003,12.45836025241,13.08127826503,13.76976659477,14.53475362781,15.38973913533,16.35159783129,17.44170435337,18.68754037861,20.12504348466,21.80213044172,23.78414230005,26.16255653006,29.06950725562,32.70319566257,37.37508075723,43.60426088343,52.32511306012,65.40639132515,87.20852176687,130.8127826503,261.6255653006],"description":"Subharmonics 24-1"},"sub40":{"frequencies":[261.6255653006,275.39533189537,290.69507255622,307.79478270659,327.03195662575,348.83408706747,373.75080757229,402.50086969323,418.60090448096,436.04260883433,475.68284600109,498.33441009638,523.2511306012],"description":"sub 40-20"},"sub48":{"frequencies":[261.6255653006,279.06726965397,299.00064605783,313.95067836072,330.47439827444,348.83408706747,369.35373924791,392.4383479509,418.60090448096,448.50096908674,465.11211608996,502.32108537715,523.2511306012],"description":"12 of sub 48 (Leven)"},"sub50":{"frequencies":[261.6255653006,272.52663052146,290.69507255622,311.45900631024,327.03195662575,344.24416486921,373.75080757229,384.74347838324,408.78994578219,436.04260883433,467.18850946536,484.4917875937,523.2511306012],"description":"12 of sub 50"},"sub8":{"frequencies":[261.6255653006,279.06726965397,299.00064605783,322.00069575458,348.83408706747,380.54627680087,418.60090448096,465.11211608996,523.2511306012],"description":"Subharmonic series 1/16 - 1/8"},"sumatra":{"frequencies":[261.6255653006,266.79889483106,324.44528279699,356.96377863828,390.9602296356,474.47355835313,530.64156666967,639.28283484968,713.92755727656,784.8766959018],"description":"\"Archeological\" tuning of Pasirah Rus orch. in Muaralakitan, Sumatra. 1/1=354 Hz"},"super_10":{"frequencies":[261.6255653006,283.42769574232,305.22982618403,327.03195662575,348.83408706747,370.63621750918,392.4383479509,425.14154361347,457.84473927605,490.54793493862,523.2511306012],"description":"A superparticular 10-tone scale"},"super_11":{"frequencies":[261.6255653006,283.42769574232,305.22982618403,327.03195662575,348.83408706747,370.63621750918,392.4383479509,418.60090448096,444.76346101102,470.92601754108,497.08857407114,523.2511306012],"description":"A superparticular 11-tone scale"},"super_12":{"frequencies":[261.6255653006,279.06726965397,296.50897400735,313.95067836072,331.39238271409,348.83408706747,372.08969287196,395.34529867646,418.60090448096,441.85651028546,465.11211608996,494.18162334558,523.2511306012],"description":"A superparticular 12-tone scale"},"super_12_1":{"frequencies":[261.6255653006,280.31310567921,299.00064605783,317.68818643644,336.37572681506,355.06326719367,373.75080757229,392.4383479509,418.60090448096,444.76346101102,470.92601754108,497.08857407114,523.2511306012],"description":"Another superparticular 12-tone scale"},"super_12_2":{"frequencies":[261.6255653006,280.31310567921,299.00064605783,317.68818643644,336.37572681506,355.06326719367,373.75080757229,392.4383479509,420.46965851882,448.50096908674,473.41768959156,498.33441009638,523.2511306012],"description":"Another superparticular 12-tone scale"},"super_13":{"frequencies":[261.6255653006,277.97716313189,294.32876096318,310.68035879446,327.03195662575,343.38355445704,359.73515228832,376.08675011961,392.4383479509,418.60090448096,444.76346101102,470.92601754108,497.08857407114,523.2511306012],"description":"A superparticular 13-tone scale"},"super_14":{"frequencies":[261.6255653006,277.97716313189,294.32876096318,310.68035879446,327.03195662575,343.38355445704,359.73515228832,376.08675011961,392.4383479509,414.24047839262,436.04260883433,457.84473927605,479.64686971777,501.44900015948,523.2511306012],"description":"A superparticular 14-tone scale"},"super_15":{"frequencies":[261.6255653006,276.16031892841,290.69507255622,305.22982618403,319.76457981184,334.29933343966,348.83408706747,363.36884069528,381.53728273004,399.70572476481,417.87416679957,436.04260883433,457.84473927605,479.64686971777,501.44900015948,523.2511306012],"description":"A superparticular 15-tone scale"},"super_17":{"frequencies":[261.6255653006,274.08392555301,286.54228580542,299.00064605783,311.45900631024,323.91736656265,336.37572681506,348.83408706747,363.36884069528,377.90359432309,392.4383479509,411.12588832951,429.81342870813,448.50096908674,467.18850946536,485.87604984397,504.56359022259,523.2511306012],"description":"Superparticular 17-tone scale"},"super_19":{"frequencies":[261.6255653006,272.52663052146,283.42769574232,294.32876096318,305.22982618403,316.13089140489,327.03195662575,340.11323489078,353.19451315581,366.27579142084,379.35706968587,392.4383479509,408.13588186894,423.83341578697,439.53094970501,455.22848362304,470.92601754108,488.36772189445,505.80942624783,523.2511306012],"description":"Superparticular 19-tone scale"},"super_19_1":{"frequencies":[261.6255653006,272.09058791262,282.55561052465,293.02063313667,303.4856557487,313.95067836072,325.57848126297,337.20628416522,348.83408706747,363.36884069528,377.90359432309,392.4383479509,408.13588186894,423.83341578697,439.53094970501,455.22848362304,470.92601754108,488.36772189445,505.80942624783,523.2511306012],"description":"Superparticular 19-tone scale"},"super_19_2":{"frequencies":[261.6255653006,269.80136421624,277.97716313189,294.32876096318,302.50455987882,310.68035879446,318.85615771011,327.03195662575,343.38355445704,359.73515228832,376.08675011961,392.4383479509,408.78994578219,425.14154361347,441.49314144476,457.84473927605,474.19633710734,490.54793493862,506.89953276991,523.2511306012],"description":"Superparticular 19-tone scale"},"super_22":{"frequencies":[261.6255653006,270.96933548991,280.31310567921,289.65687586852,299.00064605783,308.34441624714,317.68818643644,327.03195662575,337.93302184661,348.83408706747,359.73515228832,370.63621750918,381.53728273004,392.4383479509,406.45400323486,420.46965851882,434.48531380278,448.50096908674,463.45100138963,478.40103369253,493.35106599542,508.30109829831,523.2511306012],"description":"Superparticular 22-tone scale"},"super_22_1":{"frequencies":[261.6255653006,272.09058791262,282.55561052465,293.02063313667,303.4856557487,313.95067836072,325.16320258789,336.37572681506,347.58825104223,358.80077526939,370.01329949656,381.22582372373,392.4383479509,405.51962621593,418.60090448096,431.68218274599,444.76346101102,457.84473927605,470.92601754108,484.00729580611,497.08857407114,510.16985233617,523.2511306012],"description":"Superparticular 22-tone scale"},"super_24":{"frequencies":[261.6255653006,270.34641747729,279.06726965397,287.78812183066,296.50897400735,305.22982618403,313.95067836072,322.67153053741,331.39238271409,340.11323489078,348.83408706747,359.73515228832,370.63621750918,381.53728273004,392.4383479509,405.51962621593,418.60090448096,431.68218274599,444.76346101102,457.84473927605,470.92601754108,484.00729580611,497.08857407114,510.16985233617,523.2511306012],"description":"Superparticular 24-tone scale, inverse of Mans.ur 'Awad"},"super_7":{"frequencies":[261.6255653006,287.78812183066,313.95067836072,353.19451315581,392.4383479509,431.68218274599,470.92601754108,523.2511306012],"description":"A superparticular 7-tone scale"},"super_8":{"frequencies":[261.6255653006,287.78812183066,313.95067836072,340.11323489078,366.27579142084,392.4383479509,436.04260883433,479.64686971777,523.2511306012],"description":"A superparticular 8 tone scale"},"super_9":{"frequencies":[261.6255653006,287.78812183066,313.95067836072,340.11323489078,366.27579142084,392.4383479509,425.14154361347,457.84473927605,490.54793493862,523.2511306012],"description":"A superparticular 9-tone scale"},"suppig":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,294.32876096318,306.59245933664,313.95067836072,327.03195662575,340.65828815182,348.83408706747,367.91095120397,376.74081403286,392.4383479509,408.78994578219,418.60090448096,436.04260883433,459.88868900496,470.92601754108,490.54793493862,502.32108537715,523.2511306012],"description":"Friedrich Suppig's 19-tone JI scale. Calculus Musicus, Berlin 1722"},"sur_7":{"frequencies":[261.6255653006,280.40333801024,327.729041887,351.25128999693,383.0422478503,410.5345162762,479.82340237272,523.2511306012],"description":"7-tone surupan"},"sur_9":{"frequencies":[261.6255653006,280.40333801024,305.78200836532,327.729041887,351.25128999693,383.0422478503,410.5345162762,447.69106452518,479.82340237272,523.2511306012],"description":"Theoretical nine-tone surupan gamut"},"sur_ajeng":{"frequencies":[261.6255653006,285.30470202322,305.78200836532,383.0422478503,417.71053321823,523.2511306012],"description":"Surupan ajeng"},"sur_degung":{"frequencies":[261.6255653006,322.09885310804,345.21700307457,396.55020354877,488.21056770985,523.2511306012],"description":"Surupan degung"},"sur_madenda":{"frequencies":[261.6255653006,322.09885310804,345.21700307457,425.01198472693,488.21056770985,523.2511306012],"description":"Surupan madenda"},"sur_melog":{"frequencies":[261.6255653006,280.40333801024,305.78200836532,383.0422478503,410.5345162762,523.2511306012],"description":"Surupan melog"},"sur_miring":{"frequencies":[261.6255653006,285.30470202322,305.78200836532,389.73770840504,417.71053321823,523.2511306012],"description":"Surupan miring"},"sur_x":{"frequencies":[261.6255653006,280.40333801024,305.78200836532,383.0422478503,417.71053321823,523.2511306012],"description":"Surupan tone-gender X (= unmodified nyorog)"},"sur_y":{"frequencies":[261.6255653006,280.40333801024,300.52885648597,383.0422478503,410.5345162762,523.2511306012],"description":"Surupan tone-gender Y (= mode on pamiring)"},"sverige":{"frequencies":[261.6255653006,293.66476791741,329.62755691287,349.22823143301,391.99543598175,440,466.16376151809,493.88330125613,523.2511306012,554.36526195375,587.32953583482,622.25396744417,659.25511382574,698.45646286601,739.98884542327,783.9908719635,830.60939515989,880,932.32752303618,987.76660251225,1046.5022612024,1174.65907166964,1318.51022765149,1396.91292573202,1567.98174392701],"description":"Scale on Swedish 50 crown banknote of some kind of violin."},"syntonolydian":{"frequencies":[261.6255653006,294.32876096318,331.11985608357,372.50983809402,392.4383479509,441.49314144476,496.67978412536,523.2511306012],"description":"Greek Syntonolydian, also genus duplicatum medium, or ditonum (Al-Farabi)"},"syrian":{"frequencies":[261.6255653006,268.67837258085,275.62199471997,279.38237857051,286.74979536837,294.32876096318,302.10804307229,310.07474405997,314.30517589183,322.59351978942,326.6631048533,331.11985608357,339.85160932548,348.83408706747,358.05397697456,367.49599295996,372.50983809402,382.33306049116,392.4383479509,402.81072409638,413.43299207996,419.07356785577,430.12469305256,441.49314144476,453.13547910064,465.11211608996,477.40530263275,489.99465727995,496.67978412536,509.77741398822,523.2511306012],"description":"After ^Sayh.'Ali ad-Darwis^ (Shaykh Darvish) from d'Erlanger vol.5, p.29"},"szpak_24":{"frequencies":[261.6255653006,270.98948203641,277.18263097687,287.10335517712,293.66476791741,304.17540907689,311.12698372208,322.26262012861,329.62755691287,341.42535271779,349.22823143301,361.7275606831,369.99442271164,383.23700075636,391.99543598175,406.02545869431,415.30469757995,430.16898885692,440,455.74816803176,466.16376151809,482.84836435151,493.88330125613,511.56002220218,523.2511306012],"description":"Stephen Szpak's scale, TL 2-1-2004"},"pagano_b":{"frequencies":[261.6255653006,277.97716313189,289.55954492905,312.72430852337,333.57259575826,351.8148470888,370.63621750918,389.16802838464,416.96574469783,444.76346101102,463.29527188648,486.4600354808,523.2511306012],"description":"Pat Pagano and David Beardsley, 17-limit scale, TL 27-2-2001"},"palace":{"frequencies":[261.6255653006,277.01530443593,294.32876096318,299.00064605783,336.37572681506,348.83408706747,373.75080757229,392.4383479509,409.50088481833,428.11456140098,448.50096908674,470.92601754108,523.2511306012],"description":"Palace mode+"},"palace2":{"frequencies":[261.6255653006,277.01530443593,336.37572681506,348.83408706747,392.4383479509,428.11456140098,470.92601754108,523.2511306012],"description":"Byzantine Palace mode, 17-limit"},"panpipe1":{"frequencies":[261.6255653006,305.78200836532,346.61566493686,386.59871897734,424.03113209229,475.68400784708,523.2511306012],"description":"Palina panpipe of Solomon Islands. 1/1=f+45c. From Ocora CD Guadalcanal"},"panpipe2":{"frequencies":[261.6255653006,301.39807245198,340.46429857933,389.512652082,435.70052664441,481.48922855473,540.45338572244,606.98892366383,675.83458963267,749.45240308975,819.17415016614,915.78156525194,979.24522642508,1073.44040298899,1178.73719255088,1360.28482360484],"description":"Lalave panpipe of Solomon Islands. 1/1=f'+47c."},"panpipe3":{"frequencies":[261.6255653006,302.44445076078,341.44901934006,382.59999559751,433.19107626846,482.88183400971,542.01653249392,602.10016957865,677.78929781797,755.1012944609,822.018116801,906.30932187391,994.06270356141,1067.87449159209,1155.14617783291,1300.35790771888],"description":"Tenaho panpipe of Solomon Islands. 1/1=f'+67c."},"parachrom":{"frequencies":[261.6255653006,274.52698453615,288.06460709314,349.22823143301,391.99543598175,411.32572372413,431.60923940535,523.2511306012],"description":"Parachromatic, new genus 5 + 5 + 20 parts"},"parakleismic":{"frequencies":[261.6255653006,269.41173453909,271.00883762044,279.07425994419,280.72864356353,282.39283618632,290.79705467987,292.52093234567,301.22657042972,303.0122754386,312.03014360907,313.87989341557,323.22118988972,325.13728335605,327.06473376202,336.79842078181,338.79499972275,348.87778808468,350.94597487438,361.39038519337,363.53274806687,374.35175001315,376.5709514911,387.77797996035,390.07677146523,392.38919046486,404.06698135965,406.46233589795,418.55895395107,421.04021853379,433.57068509561,436.14094342919,449.12081866987,451.783257426,465.22865943552,467.98658728446,470.76086444006,484.77105399159,487.64483417146,502.15750307968,505.13434926963,520.16751901001,523.2511306012],"description":"Parakleismic temperament, g=315.250913, 5-limit"},"parizek":{"frequencies":[261.6255653006,277.97716313189,294.32876096318,310.68035879446,327.03195662575,343.38355445704,359.73515228832,392.4383479509,425.14154361347,441.49314144476,457.84473927605,490.54793493862,523.2511306012],"description":"Petr Parizek, 12-tone Linear Level tuning, 1/1=Ab"},"parizek_13lqmt":{"frequencies":[261.6255653006,272.70676208351,292.18581651805,313.05623198362,325.57848126297,348.83408706747,365.23227064756,391.32028997953,406.97310157871,436.04260883433,467.18850946536,486.97636086341,523.2511306012],"description":"April 2003 - Petr Parizek"},"parizek_17lqmt":{"frequencies":[261.6255653006,272.52663052146,291.99281841585,312.60407618638,327.03195662575,350.39138209902,364.70475555078,390.75509523297,408.78994578219,436.04260883433,467.18850946536,488.44386904122,523.2511306012],"description":"To tune the scale by ear, please choose the intervals in the following order:"},"parizek_7lmtd1":{"frequencies":[261.6255653006,280.31310567921,293.02063313667,313.95067836072,327.03195662575,350.39138209902,366.27579142084,392.4383479509,418.60090448096,437.98922762377,468.83301301868,490.54793493862,523.2511306012],"description":"Use SET MIDDLE 62"},"parizek_7lqmtd2":{"frequencies":[261.6255653006,280.31310567921,293.02063313667,313.95067836072,327.03195662575,350.39138209902,366.27579142084,390.69417751556,418.60090448096,437.98922762377,468.83301301868,488.36772189445,523.2511306012],"description":"Use SET MIDDLE 62"},"parizek_cirot":{"frequencies":[261.6255653006,273.76082553017,293.33333347996,307.98092841354,327.40170814054,348.04713286849,366.66693712906,392.88175996935,409.71484950008,438.01699797506,463.01593599647,491.10256480205,523.2511306012],"description":"Overtempered circular tuning (1/1 is F)"},"parizek_epi":{"frequencies":[261.6255653006,283.42769574232,305.22982618403,313.95067836072,327.03195662575,348.83408706747,366.27579142084,392.4383479509,418.60090448096,436.04260883433,457.84473927605,479.64686971777,523.2511306012],"description":"In The Epimoric World"},"parizek_epi2":{"frequencies":[261.6255653006,283.42769574232,287.78812183066,290.69507255622,294.32876096318,299.00064605783,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,359.73515228832,366.27579142084,373.75080757229,392.4383479509,406.97310157871,418.60090448096,436.04260883433,448.50096908674,457.84473927605,465.11211608996,470.92601754108,479.64686971777,523.2511306012,523.2511306012],"description":"In the Epimoric World - extended (version for two keyboards)"},"parizek_epi2a":{"frequencies":[261.6255653006,283.42769574232,287.78812183066,294.32876096318,299.00064605783,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,359.73515228832,366.27579142084,373.75080757229,392.4383479509,411.12588832951,418.60090448096,425.14154361347,436.04260883433,448.50096908674,457.84473927605,470.92601754108,479.64686971777,485.87604984397,523.2511306012,523.2511306012],"description":"April 2003 - Petr Parizek"},"parizek_ji1":{"frequencies":[261.6255653006,274.70684356563,294.32876096318,305.22982618403,327.03195662575,343.38355445704,366.27579142084,392.4383479509,412.06026534844,436.04260883433,457.84473927605,490.54793493862,523.2511306012],"description":"Petr Parizek, 12-tone septimal tuning, 2002."},"parizek_jiweltmp":{"frequencies":[261.6255653006,277.97716313189,294.32876096318,310.68035879446,329.45441556372,348.83408706747,370.63621750918,392.4383479509,416.96574469783,440.63253103259,465.11211608996,494.18162334558,523.2511306012],"description":"April 2003 - Petr Parizek"},"jiwt2":{"frequencies":[261.6255653006,277.97716313189,294.32876096318,310.68035879446,331.11985608357,348.83408706747,372.08969287196,392.4383479509,415.8649508569,441.49314144476,465.11211608996,496.67978412536,523.2511306012],"description":"June 2003 - Petr Parizek"},"parizek_llt7":{"frequencies":[261.6255653006,283.42769574232,327.03195662575,359.73515228832,392.4383479509,425.14154361347,479.64686971777,523.2511306012],"description":"7-tone mode of Linear Level Tuning 2000 (= wilson_helix)"},"parizek_qmeb1":{"frequencies":[261.6255653006,273.53155294581,293.066620053,305.25690181412,326.9069921792,350.33366042609,366.2083106197,392.1884190578,408.50877577745,437.87542071709,457.7197748295,488.61098601707,523.2511306012],"description":"Equal beating quasi-meantone tuning no. 1 - F...A# (1/1 = 261.7Hz)(3/2 5/3 5/4 7/4 7/6)"},"parizek_qmeb2":{"frequencies":[261.6255653006,274.12423619715,293.39509530855,306.21121252767,327.1564453797,350.32795211486,366.55713600477,391.6914154272,409.44351174042,438.20041390279,457.4712730142,489.73875803795,523.2511306012],"description":"Equal beating quasi-meantone tuning no. 2 - F...A# (1/1 = 262.7Hz)"},"parizek_qmeb3":{"frequencies":[261.6255653006,274.23252240717,293.57983281823,306.4052273004,327.28159934073,350.29865766202,366.78755898655,391.93906252094,409.53887392713,438.37260750749,457.59509656107,490.04864950866,523.2511306012],"description":"Equal beating quasi-meantone tuning no. 3 - F...A#. 1/1 = 262Hz"},"parizek_qmtp12":{"frequencies":[261.6255653006,273.55480692456,293.00227310437,305.44101254122,326.6631048533,350.4133380576,366.39100206434,391.84790908124,408.48291326839,437.52264545758,457.47219685667,489.2574430773,523.2511306012],"description":"12-tone quasi-meantone tuning with 1/9 Pyth. comma as basic tempering unit (F...A#)"},"parizek_qmtp24":{"frequencies":[261.6255653006,273.14323313659,280.64720643091,285.59764149034,293.00227310437,305.44101254122,313.83229199844,326.6631048533,335.63741195089,341.5578378819,350.4133380576,365.83975262993,375.89034660662,381.37064019061,391.84790908124,407.86833637529,419.07356785577,437.52264545758,448.86620556368,457.47219685667,469.33298761093,489.2574430773,502.69865025911,510.02774559919,523.2511306012],"description":"24-tone quasi-meantone tuning with 1/9 Pyth. comma as basic tempering unit (Bbb...C##)"},"parizek_syndiat":{"frequencies":[261.6255653006,290.69507255622,294.32876096318,327.03195662575,348.83408706747,353.19451315581,387.59343007496,392.4383479509,436.04260883433,441.49314144476,484.4917875937,490.54793493862,523.2511306012],"description":"Petr Parizek, diatonic scale with syntonic alternatives"},"parizek_syntonal":{"frequencies":[261.6255653006,272.52663052146,290.69507255622,294.32876096318,327.03195662575,348.83408706747,367.91095120397,392.4383479509,408.78994578219,436.04260883433,441.49314144476,490.54793493862,523.2511306012],"description":"Petr Parizek, Syntonic corrections in JI tonality, Jan. 2004"},"parizek_temp19":{"frequencies":[261.6255653006,276.69969455132,294.32876096318,310.68035879446,328.58088727969,349.51540364377,368.93292606842,392.4383479509,415.04954182698,438.10784970625,466.02053819169,492.87133091954,523.2511306012],"description":"Petr Parizek, genus [3 3 19 19 19] well temperament"},"partch-barstow":{"frequencies":[261.6255653006,279.06726965397,287.78812183066,290.69507255622,294.32876096318,299.00064605783,313.95067836072,327.03195662575,348.83408706747,359.73515228832,373.75080757229,392.4383479509,418.60090448096,436.04260883433,448.50096908674,470.92601754108,479.64686971777,490.54793493862,523.2511306012],"description":"Guitar scale for Partch's Barstow (1941, 1968)"},"partch-greek":{"frequencies":[261.6255653006,261.6255653006,271.31540105247,294.32876096318,279.06726965397,348.83408706747,313.95067836072,392.4383479509,392.4383479509,406.97310157871,418.60090448096,418.60090448096,523.2511306012],"description":"Partch Greek scales from \"Two Studies on Ancient Greek Scales\" on black/white"},"partch-grm":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,294.32876096318,313.95067836072,348.83408706747,392.4383479509,406.97310157871,418.60090448096,523.2511306012],"description":"Partch Greek scales from \"Two Studies on Ancient Greek Scales\" mixed"},"partch-indian":{"frequencies":[261.6255653006,269.80136421624,277.97716313189,285.40970760065,294.32876096318,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,359.73515228832,366.27579142084,383.71749577421,392.4383479509,406.97310157871,411.12588832951,428.11456140098,441.49314144476,457.84473927605,475.68284600109,490.54793493862,507.3950357345,523.2511306012],"description":"Partch's Indian Chromatic, Exposition of Monophony, 1933."},"partch-ur":{"frequencies":[261.6255653006,267.07609791103,269.80136421624,274.08392555301,279.06726965397,285.40970760065,290.69507255622,294.32876096318,299.00064605783,305.22982618403,313.95067836072,319.76457981184,327.03195662575,332.97799220076,336.37572681506,343.38355445704,348.83408706747,356.76213450082,359.73515228832,366.27579142084,373.75080757229,380.54627680087,383.71749577421,392.4383479509,398.6675280771,406.97310157871,411.12588832951,418.60090448096,428.11456140098,436.04260883433,448.50096908674,457.84473927605,465.11211608996,470.92601754108,479.64686971777,490.54793493862,499.46698830115,507.3950357345,512.57253609913,523.2511306012],"description":"Ur-Partch curved keyboard, published in Interval"},"partch_29-av":{"frequencies":[261.6255653006,269.80136421624,274.70684356563,280.31310567921,285.40970760065,290.69507255622,299.00064605783,305.22982618403,313.95067836072,319.76457981184,327.03195662575,336.37572681506,348.83408706747,359.73515228832,366.27579142084,373.75080757229,380.54627680087,392.4383479509,406.97310157871,418.60090448096,428.11456140098,436.04260883433,448.50096908674,457.84473927605,470.92601754108,479.64686971777,488.36772189445,498.33441009638,507.3950357345,523.2511306012],"description":"29-tone JI scale from Partch's Adapted Viola 1928-30"},"partch_29":{"frequencies":[261.6255653006,285.40970760065,287.78812183066,290.69507255622,294.32876096318,299.00064605783,305.22982618403,313.95067836072,319.76457981184,327.03195662575,332.97799220076,336.37572681506,348.83408706747,359.73515228832,366.27579142084,373.75080757229,380.54627680087,392.4383479509,406.97310157871,411.12588832951,418.60090448096,428.11456140098,436.04260883433,448.50096908674,457.84473927605,465.11211608996,470.92601754108,475.68284600109,479.64686971777,523.2511306012],"description":"Partch/Ptolemy 11-limit Diamond"},"partch_37":{"frequencies":[261.6255653006,267.07609791103,269.80136421624,274.08392555301,279.06726965397,285.40970760065,287.78812183066,290.69507255622,294.32876096318,299.00064605783,305.22982618403,313.95067836072,319.76457981184,327.03195662575,332.97799220076,336.37572681506,348.83408706747,359.73515228832,366.27579142084,373.75080757229,380.54627680087,392.4383479509,406.97310157871,411.12588832951,418.60090448096,428.11456140098,436.04260883433,448.50096908674,457.84473927605,465.11211608996,470.92601754108,475.68284600109,479.64686971777,490.54793493862,499.46698830115,507.3950357345,512.57253609913,523.2511306012],"description":"From \"Exposition on Monophony\" 1933, unp. see Ayers, 1/1 vol.9(2)"},"partch_39":{"frequencies":[261.6255653006,267.07609791103,269.80136421624,274.08392555301,279.06726965397,285.40970760065,290.69507255622,294.32876096318,299.00064605783,305.22982618403,313.95067836072,319.76457981184,327.03195662575,332.97799220076,336.37572681506,343.38355445704,348.83408706747,356.76213450082,359.73515228832,366.27579142084,373.75080757229,380.54627680087,383.71749577421,392.4383479509,398.6675280771,406.97310157871,411.12588832951,418.60090448096,428.11456140098,436.04260883433,448.50096908674,457.84473927605,465.11211608996,470.92601754108,479.64686971777,490.54793493862,499.46698830115,507.3950357345,512.57253609913,523.2511306012],"description":"Ur-Partch Keyboard 39 tones, published in Interval"},"partch_41":{"frequencies":[261.6255653006,281.75060878526,283.42769574232,285.40970760065,287.78812183066,290.69507255622,294.32876096318,299.00064605783,305.22982618403,309.19384990071,313.95067836072,319.76457981184,322.00069575458,327.03195662575,332.97799220076,336.37572681506,340.11323489078,348.83408706747,359.73515228832,362.25078272391,366.27579142084,373.75080757229,377.90359432309,380.54627680087,392.4383479509,402.50086969323,406.97310157871,411.12588832951,418.60090448096,425.14154361347,428.11456140098,436.04260883433,442.75095666255,448.50096908674,457.84473927605,465.11211608996,470.92601754108,475.68284600109,479.64686971777,483.00104363188,485.87604984397,523.2511306012],"description":"13-limit Diamond after Partch, Genesis of a Music, p 454, 2nd edition"},"partch_41a":{"frequencies":[261.6255653006,267.07609791103,269.80136421624,274.08392555301,279.06726965397,285.40970760065,287.78812183066,290.69507255622,294.32876096318,299.00064605783,305.22982618403,313.95067836072,319.76457981184,327.03195662575,332.97799220076,336.37572681506,343.38355445704,348.83408706747,356.76213450082,359.73515228832,366.27579142084,373.75080757229,380.54627680087,383.71749577421,392.4383479509,398.6675280771,406.97310157871,411.12588832951,418.60090448096,428.11456140098,436.04260883433,448.50096908674,457.84473927605,465.11211608996,470.92601754108,475.68284600109,479.64686971777,490.54793493862,499.46698830115,507.3950357345,512.57253609913,523.2511306012],"description":"From \"Exposition on Monophony\" 1933, unp. see Ayers, 1/1 vol. 9(2)"},"partch_41comb":{"frequencies":[261.6255653006,267.07609791103,269.80136421624,274.08392555301,274.70684356563,279.06726965397,280.31310567921,285.40970760065,287.78812183066,290.69507255622,294.32876096318,299.00064605783,305.22982618403,313.95067836072,319.76457981184,327.03195662575,332.97799220076,336.37572681506,348.83408706747,359.73515228832,366.27579142084,373.75080757229,380.54627680087,392.4383479509,406.97310157871,411.12588832951,418.60090448096,428.11456140098,436.04260883433,448.50096908674,457.84473927605,465.11211608996,470.92601754108,475.68284600109,479.64686971777,488.36772189445,490.54793493862,498.33441009638,499.46698830115,507.3950357345,512.57253609913,523.2511306012],"description":"41-tone JI combination from Partch's 29-tone and 37-tone scales"},"partch_43":{"frequencies":[261.6255653006,264.89588486686,269.80136421624,274.70684356563,279.06726965397,285.40970760065,287.78812183066,290.69507255622,294.32876096318,299.00064605783,305.22982618403,310.07474405997,313.95067836072,319.76457981184,327.03195662575,332.97799220076,336.37572681506,343.38355445704,348.83408706747,353.19451315581,359.73515228832,366.27579142084,373.75080757229,380.54627680087,387.59343007496,392.4383479509,398.6675280771,406.97310157871,411.12588832951,418.60090448096,428.11456140098,436.04260883433,441.49314144476,448.50096908674,457.84473927605,465.11211608996,470.92601754108,475.68284600109,479.64686971777,490.54793493862,498.33441009638,507.3950357345,516.79124009995,523.2511306012],"description":"Harry Partch's 43-tone pure scale"},"partch_43a":{"frequencies":[261.6255653006,267.07609791103,269.80136421624,274.70684356563,279.06726965397,285.40970760065,287.78812183066,290.69507255622,294.32876096318,299.00064605783,305.22982618403,310.07474405997,313.95067836072,319.76457981184,327.03195662575,332.97799220076,336.37572681506,343.38355445704,348.83408706747,356.76213450082,359.73515228832,366.27579142084,373.75080757229,380.54627680087,383.71749577421,392.4383479509,398.6675280771,406.97310157871,411.12588832951,418.60090448096,428.11456140098,436.04260883433,441.49314144476,448.50096908674,457.84473927605,465.11211608996,470.92601754108,475.68284600109,479.64686971777,490.54793493862,498.33441009638,507.3950357345,512.57253609913,523.2511306012],"description":"From \"Exposition on Monophony\" 1933, unp. see Ayers, 1/1 vol. 9(2)"},"patala":{"frequencies":[261.6255653006,289.6217982776,320.24370022528,355.94891173479,393.58362272115,439.74591942221,480.6555937997,537.34060327431],"description":"Observed patala tuning from Burma, Helmholtz/Ellis p. 518, nr.83"},"pelog1":{"frequencies":[261.6255653006,285.79952600623,313.83440569119,359.87690576543,393.35634555235,426.98050185716,482.04578814299,523.2511306012],"description":"Gamelan Saih pitu from Ksatria, Den Pasar (South Bali). 1/1=312.5 Hz"},"pelog10":{"frequencies":[261.6255653006,290.16653606067,310.14521470005,342.49164912079,385.30310526088,418.60090448096,442.38504678101,523.2511306012],"description":"Balinese saih 7 scale, Krobokan. 1/1=275 Hz. McPhee, 1966"},"pelog11":{"frequencies":[261.6255653006,289.11520789678,327.03195662575,352.6257619269,388.64667309147,441.73012112348,478.69895237627,523.2511306012],"description":"Balinese saih pitu, gamelan luang, banjar Se`se'h. 1/1=276 Hz. McPhee, 1966"},"pelog11i":{"frequencies":[261.6255653006,267.83009854382,287.76973397991,309.19384990071,332.21296611011,356.94582815655,383.52002471837,392.61532371972,421.84506978464,453.25093845942,486.99493426005,523.2511306012],"description":"George Secor's isopelogic scale with ~537.84194 generator and just 13/11"},"pelog12":{"frequencies":[261.6255653006,284.41230790592,308.04300430555,358.68021049276,385.68672051706,409.31741667997,472.61392441399,523.2511306012],"description":"Balinese saih pitu, gamelan Semar Pegulingan, Tampak Gangsai, 1/1=310, McPhee"},"pelog13":{"frequencies":[261.6255653006,289.80062617913,323.61069924911,351.78575931905,394.45085229937,454.02098012766,494.27106657141,523.2511306012],"description":"Balinese saih pitu, gamelan Semar Pegulingan, Klungkung, 1/1=325. McPhee, 1966"},"pelog14":{"frequencies":[261.6255653006,287.66412867175,309.98289727559,347.18084494866,375.69927149802,402.97776645827,427.77639824032,523.2511306012],"description":"Balinese saih pitu, suling gambuh, Tabanan, 1/1=211 Hz, McPhee, 1966"},"pelog15":{"frequencies":[261.6255653006,284.9387344858,307.6043148279,344.51683351465,375.60105909492,407.98046074103,427.4081017287,523.2511306012],"description":"Balinese saih pitu, suling gambuh, Batuan, 1/1=202 Hz. McPhee, 1966"},"pelog2":{"frequencies":[261.6255653006,285.30470202322,314.92395982138,345.81573716922,388.6137256405,424.52127512829,466.97226207056,523.2511306012],"description":"Bamboo gambang from Batu lulan (South Bali). 1/1=315 Hz"},"pelog3":{"frequencies":[261.6255653006,285.63448939555,315.83481057014,390.18821123181,421.34544350737,523.2511306012],"description":"Gamelan Gong from Padangtegal, distr. Ubud (South Bali). 1/1=555 Hz"},"pelog4":{"frequencies":[261.6255653006,290.96323214696,317.29765457754,352.87817160549,385.03871768789,434.94616895528,470.49199937597,523.2511306012],"description":"Hindu-Jav. demung, excavated in Banjarnegara. 1/1=427 Hz"},"pelog5":{"frequencies":[261.6255653006,284.64626913494,310.94732162256,358.21775774651,390.8649420513,427.47405410759,468.32288027948,523.2511306012],"description":"Gamelan Kyahi Munggang (Paku Alaman, Jogja). 1/1=199.5 Hz"},"pelog6":{"frequencies":[261.6255653006,282.02769802256,315.83481057014,354.51258839996,386.37547528213,413.39000965417,523.2511306012],"description":"Gamelan Semar pegulingan, Ubud (S. Bali). 1/1=263.5 Hz"},"pelog7":{"frequencies":[261.6255653006,281.2143451833,303.31920717687,353.89879686059,384.81637482457,412.43597848639,448.72664641273,523.2511306012],"description":"Gamelan Kantjilbelik (kraton Jogja). Measured by Surjodiningrat, 1972."},"pelog8":{"frequencies":[261.6255653006,281.2143451833,305.0763174688,362.1707891162,386.59871897734,415.30469757995,456.83405152976,529.33101587613,573.91491069685,623.33318620372,730.64478690489,786.25839925218,840.74610520523,945.88853913022,1075.30214607265],"description":"from William Malm: Music Cultures of the Pacific, the Near East and Asia."},"pelog9":{"frequencies":[261.6255653006,282.57123920205,305.19382000629,356.01745236555,384.52011812375,415.30469757995,448.5538823653,523.2511306012],"description":"9-tET Pelog"},"pelog9i":{"frequencies":[261.6255653006,287.76973397991,309.19384990071,332.21296611011,356.94582815655,383.52002471837,421.84506978464,453.25093845942,486.99493426005,523.2511306012],"description":"George Secor's isopelogic scale with ~537.84194 generator and just 13/11"},"pelog_24":{"frequencies":[261.6255653006,293.66476791741,320.24370022528,349.22823143301,391.99543598175,440,479.82340237272,523.2511306012],"description":"Subset of 24-tET (Sumatra?)"},"pelog_a":{"frequencies":[261.6255653006,280.7274598329,305.95868600104,363.84824628932,386.82209166041,411.72190027758,452.10885997356,523.2511306012],"description":"Pelog, average class A. Kunst 1949"},"pelog_alv":{"frequencies":[261.6255653006,299.00064605783,313.95067836072,343.38355445704,392.4383479509,418.60090448096,457.84473927605,523.2511306012],"description":"Bill Alves JI Pelog, 1/1 vol. 9 no. 4, 1997. 1/1=293.33"},"pelog_av":{"frequencies":[261.6255653006,280.40333801024,305.78200836532,357.39105439675,385.26118901859,411.72190027758,452.89298412314,523.2511306012],"description":"\"Normalised Pelog\", Kunst, 1949. Average of 39 Javanese gamelans"},"pelog_b":{"frequencies":[261.6255653006,280.07959041159,302.79405018898,354.30787302884,382.82105786018,408.64182041696,451.58686491179,523.2511306012],"description":"Pelog, average class B. Kunst 1949"},"pelog_c":{"frequencies":[261.6255653006,279.91785681123,304.37225518229,350.84574289301,384.81637482457,410.29745071461,451.58686491179,523.2511306012],"description":"Pelog, average class C. Kunst 1949"},"pelog_he":{"frequencies":[261.6255653006,283.17034563789,338.50336851425,364.68988616898,389.06292924114,420.13030572059,493.31307433255,523.2511306012],"description":"Observed Javanese Pelog scale, Helmholtz/Ellis p. 518, nr.96"},"pelog_jc":{"frequencies":[261.6255653006,294.32876096318,313.95067836072,392.4383479509,418.60090448096,523.2511306012],"description":"John Chalmers' Pelog, on keys C# E F# A B c#, like Olympos' Enharmonic on 4/3"},"pelog_laras":{"frequencies":[261.6255653006,283.42769574232,305.22982618403,370.63621750918,392.4383479509,414.24047839262,457.84473927605,523.2511306012],"description":"Lou Harrison, gamelan \"Si Betty\""},"pelog_me1":{"frequencies":[261.6255653006,281.13654920971,305.96893643544,353.85975480175,389.33427481332,412.3928606827,454.07565526112,523.2511306012],"description":"Gamelan Kyahi Kanyut Mesem pelog (Mangku Nagaran). 1/1=295 Hz"},"pelog_me2":{"frequencies":[261.6255653006,277.86440299076,299.96729002515,349.58586605592,383.41679241104,405.97081699752,447.47001910635,523.2511306012],"description":"Gamelan Kyahi Bermara (kraton Jogja). 1/1=290 Hz"},"pelog_me3":{"frequencies":[261.6255653006,281.75056896146,306.90688773629,358.59164065877,385.12012728597,411.64865826518,457.38747412584,523.2511306012],"description":"Gamelan Kyahi Pangasih (kraton Solo). 1/1=286 Hz"},"pelog_pa":{"frequencies":[261.6255653006,286.29520819723,313.29104303136,342.83241505062,387.04559340587,423.54155496477,463.47885582013,523.2511306012],"description":"\"Blown fifth\" pelog, von Hornbostel, type a."},"pelog_pa2":{"frequencies":[261.6255653006,286.29520819723,313.29104303136,353.69443592699,387.04559340587,423.54155496477,463.47885582013,523.2511306012],"description":"New mixed gender Pelog"},"pelog_pb":{"frequencies":[261.6255653006,277.98432293805,304.19649364034,353.69443592699,387.04559340587,411.24653512154,450.02449304881,523.2511306012],"description":"\"Primitive\" Pelog, step of blown semi-fourths, von Hornbostel, type b."},"pelog_pb2":{"frequencies":[261.6255653006,277.50302994288,303.66981774726,353.69443592699,387.04559340587,410.5345162762,449.24533531117,523.2511306012],"description":"\"Primitive\" Pelog, Kunst: Music in Java, p. 28"},"pelog_schmidt":{"frequencies":[261.6255653006,287.78812183066,313.95067836072,366.27579142084,392.4383479509,418.60090448096,470.92601754108,523.2511306012],"description":"Modern Pelog designed by Dan Schmidt and used by Berkeley Gamelan"},"pelog_selun":{"frequencies":[261.6255653006,281.10829462369,350.68958753059,378.52209447746,416.55977244877,523.2511306012,562.21664032682,701.37917506118,757.04418895493,833.11970794305,1046.5022612024,1124.43328065364],"description":"Gamelan selunding from Kengetan, South Bali (Pelog), 1/1=141 Hz"},"pelog_slen":{"frequencies":[261.6255653006,289.4545544734,306.66641795878,334.42210013281,344.22141564971,354.30787302884,386.37547528213,397.69714089209,446.39994737251,459.48046426806,493.88330125613,523.2511306012],"description":"W.P. Malm, pelog+slendro, Musical Cultures Of The Pacific, The Near East, And Asia. P: 1,3,5,6,8,10; S: 2,4,7,9"},"pelog_str":{"frequencies":[261.6255653006,282.73796785026,305.22982618403,329.86096249197,356.10146388137,384.83778957396,415.4517078616,448.97742116962,484.69365917187,523.80699136456],"description":"JI Pelog with stretched 2/1 and extra tones between 2-3, 6-7. Wolf, XH 11, '87"},"pelogic":{"frequencies":[261.6255653006,268.93425429917,294.59920226397,322.71340889889,353.51061198674,363.38617257172,398.06486099125,436.0530078362,477.66644151787,523.2511306012],"description":"Pelogic temperament, g=521.1, 5-limit"},"pelogic2":{"frequencies":[261.6255653006,252.56770712848,285.96465797334,276.06414495892,312.56802260838,301.74646235804,341.64630500046,386.82209166041,373.42974737602,422.80824892286,408.17001145418,462.1422075194,523.2511306012],"description":"Pelogic temperament, g=677.0 in cycle of fifths order"},"penta1":{"frequencies":[261.6255653006,282.55561052465,294.32876096318,313.95067836072,331.11985608357,372.50983809402,376.74081403286,397.34382730029,423.83341578697,441.49314144476,470.92601754108,496.67978412536,523.2511306012],"description":"Pentagonal scale 9/8 3/2 16/15 4/3 5/3"},"penta2":{"frequencies":[261.6255653006,267.07609791103,286.15296204753,305.22982618403,312.97980223949,333.84512238879,356.10146388137,363.36884069528,400.61414686654,436.04260883433,457.84473927605,476.92160341255,523.2511306012],"description":"Pentagonal scale 7/4 4/3 15/8 32/21 6/5"},"penta_opt":{"frequencies":[261.6255653006,292.5084949701,327.03692214239,391.62201198054,436.95817401562,523.2511306012],"description":"Optimally consonant major pentatonic, John deLaubenfels, 2001"},"pentadekany":{"frequencies":[261.6255653006,283.42769574232,299.7792935736,305.22982618403,327.03195662575,354.2846196779,359.73515228832,381.53728273004,389.71308164569,419.69101100305,425.14154361347,436.04260883433,457.84473927605,479.64686971777,495.99846754905,523.2511306012],"description":"2)6 1.3.5.7.11.13 Pentadekany (1.3 tonic)"},"pentadekany2":{"frequencies":[261.6255653006,269.80136421624,294.32876096318,299.7792935736,305.22982618403,327.03195662575,343.38355445704,359.73515228832,381.53728273004,392.4383479509,419.69101100305,436.04260883433,457.84473927605,479.64686971777,490.54793493862,523.2511306012],"description":"2)6 1.3.5.7.9.11 Pentadekany (1.3 tonic)"},"pentadekany3":{"frequencies":[261.6255653006,277.97716313189,278.79474302345,287.78812183066,291.4672313427,300.86940009569,305.77487944508,319.67373760167,359.73515228832,376.08675011961,405.51962621593,413.69542513157,430.86460285443,444.76346101102,506.89953276991,523.2511306012],"description":"2)6 1.5.11.17.23.31 Pentadekany (1.5 tonic)"},"pentatetra1":{"frequencies":[261.6255653006,275.39533189537,290.69507255622,327.03195662575,348.83408706747,392.4383479509,413.09299784305,436.04260883433,490.54793493862,523.2511306012],"description":"Penta-tetrachord 20/19 x 19/18 x 18/17 x 17/16 = 5/4. 5/4 x 16/15 = 4/3"},"pentatetra2":{"frequencies":[261.6255653006,275.39533189537,307.79478270659,327.03195662575,348.83408706747,392.4383479509,413.09299784305,461.69217405988,490.54793493862,523.2511306012],"description":"Penta-tetrachord 20/19 x 19/18 x 18/17 x 17/16 = 5/4. 5/4 x 16/15 = 4/3"},"pentatetra3":{"frequencies":[261.6255653006,290.69507255622,307.79478270659,327.03195662575,348.83408706747,392.4383479509,436.04260883433,461.69217405988,490.54793493862,523.2511306012],"description":"Penta-tetrachord 20/19 x 19/18 x 18/17 x 17/16 = 5/4. 5/4 x 16/15 = 4/3"},"pentatriad":{"frequencies":[261.6255653006,290.69507255622,294.32876096318,327.03195662575,348.83408706747,367.91095120397,392.4383479509,436.04260883433,441.49314144476,465.11211608996,490.54793493862,523.2511306012],"description":"4:5:6 Pentatriadic scale"},"pentatriad1":{"frequencies":[261.6255653006,290.69507255622,294.32876096318,327.03195662575,348.83408706747,387.59343007496,392.4383479509,436.04260883433,441.49314144476,465.11211608996,490.54793493862,523.2511306012],"description":"3:5:9 Pentatriadic scale"},"pepper":{"frequencies":[261.6255653006,274.70684356563,290.69507255622,294.32876096318,305.22982618403,327.03195662575,343.38355445704,348.83408706747,367.91095120397,392.4383479509,406.97310157871,436.04260883433,441.49314144476,457.84473927605,465.11211608996,490.54793493862,515.07533168556,523.2511306012],"description":"Keenan Pepper's 17-tone jazz tuning, TL 07-06-2000"},"pepper2":{"frequencies":[261.6255653006,281.81099471089,295.05751399041,308.92668738628,332.76158224462,348.40303271111,375.28368107222,392.9238840789,423.23948674937,443.13385158124,463.96335069158,499.75992392917,523.2511306012],"description":"Keenan Pepper's \"Noble Fifth\" with chromatic/diatonic semitone = Phi (12)"},"peprmint":{"frequencies":[261.6255653006,270.64528749638,281.81099405977,291.52662269553,295.0575145017,305.22982618403,308.92668738628,319.57714845986,332.76158147578,344.23376699744,348.40303331485,360.41446869983,375.28368085545,388.22184514393,392.92388339801,406.47020562703,423.23948723831,437.83096109824,443.13385158124,458.41119713782,463.9633498876,479.95880678291,499.75992479518,516.98949333115,523.2511306012],"description":"Peppermint 24: Wilson/Pepper apotome/limma=Phi, 2 chains spaced for pure 7:6"},"perkis-indian":{"frequencies":[261.6255653006,269.10058145205,277.01530443593,285.40970760065,294.32876096318,303.82323712328,313.95067836072,327.03195662575,336.37572681506,348.83408706747,358.01393146398,369.99442271164,377.90359432309,388.70083987518,400.13321751856,412.18367363396,425.14154361347,438.99882991118,453.48431318771,469.12170329763,485.27322596079,503.87145909745,523.2511306012],"description":"Indian 22 Perkis"},"perrett-tt":{"frequencies":[261.6255653006,274.70684356563,286.15296204753,294.32876096318,305.22982618403,313.95067836072,327.03195662575,343.38355445704,348.83408706747,366.27579142084,381.53728273004,392.4383479509,412.06026534844,418.60090448096,436.04260883433,457.84473927605,470.92601754108,490.54793493862,515.07533168556,523.2511306012],"description":"Perrett Tierce-Tone"},"perrett":{"frequencies":[261.6255653006,274.70684356563,279.06726965397,348.83408706747,392.4383479509,412.06026534844,418.60090448096,523.2511306012],"description":"Perrett / Tartini / Pachymeres Enharmonic"},"perrett_14":{"frequencies":[261.6255653006,274.70684356563,294.32876096318,305.22982618403,327.03195662575,343.38355445704,348.83408706747,366.27579142084,392.4383479509,412.06026534844,436.04260883433,457.84473927605,490.54793493862,515.07533168556,523.2511306012],"description":"Perrett's 14-tone system (subscale of tierce-tone)"},"perrett_chrom":{"frequencies":[261.6255653006,274.70684356563,294.32876096318,348.83408706747,392.4383479509,412.06026534844,441.49314144476,523.2511306012],"description":"Perrett's Chromatic"},"perry":{"frequencies":[261.6255653006,294.32876096318,313.95067836072,327.03195662575,348.83408706747,392.4383479509,418.60090448096,436.04260883433,448.50096908674,457.84473927605,470.92601754108,490.54793493862,523.2511306012],"description":"Robin Perry, Tuning List 22-9-'98"},"perry2":{"frequencies":[261.6255653006,274.70684356563,290.69507255622,305.22982618403,327.03195662575,348.83408706747,373.75080757229,392.4383479509,415.27867508032,436.04260883433,457.84473927605,498.33441009638,523.2511306012],"description":"Robin Perry, 7-limit scale, TL 22-10-2006"},"perry3":{"frequencies":[261.6255653006,277.97716313189,294.32876096318,307.79478270659,327.03195662575,348.83408706747,369.35373924791,370.63621750918,392.4383479509,418.60090448096,444.76346101102,465.11211608996,492.47165233054,523.2511306012],"description":"Robin Perry, symmetrical 3,5,17 scale, TL 22-10-2006"},"persian-far":{"frequencies":[261.6255653006,275.58617649731,282.84340331238,294.51413096332,310.22971009486,318.39923223688,331.53706992441,349.22823143301,362.58942698662,376.46181130035,391.99543598175,412.91271853531,423.78627283082,441.27260666252,464.81937009253,477.05982293263,496.7443381147,523.2511306012],"description":"Hormoz Farhat, average of observed Persian tar and sehtar tunings (1966)"},"persian-vaz":{"frequencies":[261.6255653006,277.18263097687,285.30470202322,293.66476791741,311.12698372208,320.24370022528,329.62755691287,349.22823143301,359.46139971304,380.8360868427,391.99543598175,415.30469757995,427.47405410759,440,466.16376151809,479.82340237272,493.88330125613,523.2511306012],"description":"Vaziri's Persian tuning, using quartertones"},"persian":{"frequencies":[261.6255653006,275.62199471997,282.55561052465,294.32876096318,310.07474405997,317.87506184023,331.11985608357,348.83408706747,363.36884069528,376.74081403286,392.4383479509,413.43299207996,423.83341578697,441.49314144476,465.11211608996,476.81259276034,496.67978412536,523.2511306012],"description":"Persian Tar Scale, from Dariush Anooshfar, Internet Tuning List 2/10/94"},"persian2":{"frequencies":[261.6255653006,275.62199471997,288.32205155576,294.32876096318,310.07474405997,321.08592105074,331.11985608357,348.83408706747,367.49599295996,384.42940207435,392.4383479509,413.43299207996,428.11456140098,441.49314144476,465.11211608996,489.99465727995,512.57253609913,523.2511306012],"description":"Traditional Persian scale, from Mark Rankin"},"phi1_13":{"frequencies":[261.6255653006,272.27874348295,293.41755524936,305.36527715608,329.07281683115,342.47239171077,356.41758627629,384.088434771,399.72820043646,416.00480451705,448.3020273708,466.55651779723,502.7784067407,523.2511306012],"description":"Pythagorean scale with (Phi + 1) / 2 as fifth"},"phi_10":{"frequencies":[261.6255653006,277.06593756944,293.41755524936,323.38703872151,342.47239171077,362.68389667063,399.72820043646,423.31898451752,448.3020273708,494.09131284284,523.2511306012],"description":"Pythagorean scale with Phi as fifth"},"phi_12":{"frequencies":[261.6255653006,280.653851324,301.06608340242,314.41721066027,337.28508524374,352.24238645938,377.86132347501,405.34355110824,423.31898451752,454.10739278061,474.24531572837,508.73764640933,531.29821178855],"description":"Non-Octave Pythagorean scale with Phi as fourth. Jacky Ligon TL 12-04-2001"},"phi_13":{"frequencies":[261.6255653006,277.06593756944,293.41755524936,305.36527715608,323.38703872151,342.47239171077,362.68389667063,377.45230514615,399.72820043646,423.31898451752,448.3020273708,466.55651779723,494.09131284284,523.2511306012],"description":"Pythagorean scale with Phi as fifth"},"phi_13a":{"frequencies":[261.6255653006,280.653851324,293.09977429907,314.41721066027,328.36040925687,352.24238645938,377.86132347501,394.61802538749,423.31898451752,442.09155952525,474.24531572837,508.73764640933,531.29821178855,569.94005600595],"description":"Non-Octave Pythagorean scale with Phi as fifth, Jacky Ligon TL 12-04-2001"},"phi_13b":{"frequencies":[261.6255653006,277.56939878091,287.90530191745,305.45065986668,316.82478268872,336.13253486432,356.61692887617,369.89633953852,392.4383479509,407.05164722964,431.8579526603,458.17598957099,475.23717379553,504.19880204444],"description":"Non-Octave Pythagorean scale with 12 3/2s, Jacky Ligon, TL 12-04-2001"},"phi_17":{"frequencies":[261.6255653006,276.86436108535,292.99059544936,310.05629713556,328.11582814217,347.22745468775,367.4522682176,388.8548834608,411.50435256812,435.47307590797,460.83762934409,487.67984759381,516.08523529366,546.14543793146,577.9565447239,611.62018657326,647.24497389216,684.94478342154],"description":"Phi + 1 equal division by 17, Brouncker (1653)"},"phi_7b":{"frequencies":[261.6255653006,277.06593756944,299.7954575021,323.38703872151,342.47239171077,369.42210382256,399.72820043646,423.31898451752],"description":"Heinz Bohlen's Pythagorean scale with Phi as fifth (1999)"},"phi_7be":{"frequencies":[261.6255653006,277.18263097687,299.37379946195,323.3415889232,342.56848033562,369.99442271164,399.61607881612,423.37848741825],"description":"36-tET approximation of phi_7b"},"phi_8":{"frequencies":[261.6255653006,280.010356995,292.01318753119,312.53354015396,325.93049860793,348.83408706747,373.34714284662,389.35091690288,416.71138708025],"description":"Non-Octave Pythagorean scale with 4/3s, Jacky Ligon, TL 12-04-2001"},"phi_8a":{"frequencies":[261.6255653006,275.77662731691,284.90271245142,300.31281179658,310.2506767011,327.03195662575,344.72084112096,356.12824371673,375.39107678967],"description":"Non-Octave Pythagorean scale with 5/4s, Jacky Ligon, TL 12-04-2001"},"phillips_19":{"frequencies":[261.6255653006,274.63272075836,286.12988535196,293.66476791741,305.42895910556,326.59518553839,329.62755691287,342.83241505062,349.22823143301,366.5907009274,384.81637482457,391.99543598175,407.69874723177,428.71043212875,440,457.62637091093,489.33987776603,493.88330125613,513.66823365307,523.2511306012],"description":"Pauline Phillips, organ manual scale, TL 7-10-2002"},"phillips_19a":{"frequencies":[261.6255653006,274.58143914872,285.65749968142,293.61100773131,305.45468261618,326.62388782443,329.50688232588,342.79852229325,349.26020182051,366.55580177366,381.34192228364,391.95955371998,407.7704102616,427.96347506501,439.87918162894,457.62301915088,489.33808574423,493.65730140218,509.07699553894,523.2511306012],"description":"Adaptation by Gene Ward Smith with more consonant chords, TL 25-10-2002"},"phillips_22":{"frequencies":[261.6255653006,275.93321340298,286.15296204753,294.32876096318,305.5744765615,306.59245933664,327.03195662575,331.11985608357,343.38355445704,349.22797321314,367.91095120397,392.4383479509,407.76797091773,408.78994578219,416.96574469783,429.2294430713,441.49314144476,457.84473927605,459.88868900496,490.54793493862,496.67978412536,515.07533168556,523.2511306012],"description":"All-key 19-limit JI scale (2002), TL 21-10-2002"},"phillips_ji":{"frequencies":[261.6255653006,275.93321340298,286.15296204753,294.32876096318,305.5744765615,306.59245933664,327.03195662575,331.11985608357,349.22797321314,367.91095120397,386.30649876417,392.4383479509,407.76797091773,408.78994578219,429.2294430713,441.49314144476,457.84473927605,459.88868900496,490.54793493862,496.67978412536,515.07533168556,523.2511306012],"description":"Pauline Phillips, JI 0 #/b \"C\" scale (2002), TL 8-10-2002"},"phryg_chromcon2":{"frequencies":[261.6255653006,283.42769574232,294.32876096318,305.22982618403,392.4383479509,414.24047839262,436.04260883433,523.2511306012],"description":"Harmonic Conjunct Chromatic Phrygian"},"phryg_chromconi":{"frequencies":[261.6255653006,283.42769574232,348.83408706747,370.63621750918,392.4383479509,479.64686971777,501.44900015948,523.2511306012],"description":"Inverted Conjunct Chromatic Phrygian"},"phryg_chrominv":{"frequencies":[261.6255653006,272.52663052146,283.42769574232,348.83408706747,392.4383479509,414.24047839262,436.04260883433,523.2511306012],"description":"Inverted Schlesinger's Chromatic Phrygian"},"phryg_chromt":{"frequencies":[261.6255653006,277.01530443593,294.32876096318,313.95067836072,324.77656382143,336.37572681506,362.25078272391,392.4383479509,409.50088481833,418.60090448096,428.11456140098,470.92601754108,523.2511306012,554.03060887186,588.65752192635,627.90135672144,649.55312764287,672.75145363011,724.50156544782,784.8766959018,819.00176963666,837.20180896192,856.22912280196,941.85203508216,1046.5022612024],"description":"Phrygian Chromatic Tonos"},"phryg_diat":{"frequencies":[261.6255653006,285.40970760065,313.95067836072,348.83408706747,369.35373924791,392.4383479509,448.50096908674,483.00104363188,523.2511306012],"description":"Schlesinger's Phrygian Harmonia, a subharmonic series through 13 from 24"},"phryg_diatcon":{"frequencies":[261.6255653006,285.40970760065,313.95067836072,348.83408706747,369.35373924791,448.50096908674,483.00104363188,523.2511306012],"description":"A Phrygian Diatonic with its own trite synemmenon replacing paramese"},"phryg_diatinv":{"frequencies":[261.6255653006,283.42769574232,305.22982618403,370.63621750918,392.4383479509,436.04260883433,479.64686971777,523.2511306012],"description":"Inverted Conjunct Phrygian Harmonia with 17, the local Trite Synemmenon"},"phryg_diatsinv":{"frequencies":[261.6255653006,283.42769574232,305.22982618403,348.83408706747,370.63621750918,392.4383479509,436.04260883433,479.64686971777,523.2511306012],"description":"Inverted Schlesinger's Phrygian Harmonia, a harmonic series from 12 from 24"},"phryg_enh":{"frequencies":[261.6255653006,267.19206668997,273.00058987889,348.83408706747,392.4383479509,405.0976494977,418.60090448096,523.2511306012],"description":"Schlesinger's Phrygian Harmonia in the enharmonic genus"},"phryg_enhcon":{"frequencies":[261.6255653006,283.42769574232,288.87822835275,294.32876096318,392.4383479509,403.33941317176,414.24047839262,523.2511306012],"description":"Harmonic Conjunct Enharmonic Phrygian"},"phryg_enhinv":{"frequencies":[261.6255653006,327.03195662575,337.93302184661,348.83408706747,392.4383479509,501.44900015948,512.35006538034,523.2511306012],"description":"Inverted Schlesinger's Enharmonic Phrygian Harmonia"},"phryg_enhinv2":{"frequencies":[261.6255653006,267.07609791103,272.52663052146,348.83408706747,392.4383479509,403.33941317176,414.24047839262,523.2511306012],"description":"Inverted harmonic form of Schlesinger's Enharmonic Phrygian"},"phryg_penta":{"frequencies":[261.6255653006,270.64713651786,285.40970760065,348.83408706747,392.4383479509,413.09299784305,448.50096908674,523.2511306012],"description":"Schlesinger's Phrygian Harmonia in the pentachromatic genus"},"phryg_pis":{"frequencies":[261.6255653006,294.32876096318,336.37572681506,362.25078272391,392.4383479509,428.11456140098,470.92601754108,523.2511306012,554.03060887186,588.65752192635,672.75145363011,724.50156544782,784.8766959018,856.22912280196,941.85203508216,1046.5022612024],"description":"The Diatonic Perfect Immutable System in the Phrygian Tonos"},"phryg_tri1":{"frequencies":[261.6255653006,273.00058987889,285.40970760065,348.83408706747,392.4383479509,418.60090448096,448.50096908674,523.2511306012],"description":"Schlesinger's Phrygian Harmonia in the chromatic genus"},"phryg_tri1inv":{"frequencies":[261.6255653006,305.22982618403,327.03195662575,348.83408706747,392.4383479509,479.64686971777,501.44900015948,523.2511306012],"description":"Inverted Schlesinger's Chromatic Phrygian Harmonia"},"phryg_tri2":{"frequencies":[261.6255653006,269.10058145205,285.40970760065,348.83408706747,392.4383479509,409.50088481833,448.50096908674,523.2511306012],"description":"Schlesinger's Phrygian Harmonia in the second trichromatic genus"},"phryg_tri3":{"frequencies":[261.6255653006,269.10058145205,277.01530443593,348.83408706747,392.4383479509,409.50088481833,428.11456140098,523.2511306012],"description":"Schlesinger's Phrygian Harmonia in the first trichromatic genus"},"phrygian":{"frequencies":[261.6255653006,290.69507255622,313.95067836072,327.03195662575,348.83408706747,353.19451315581,387.59343007496,392.4383479509,418.60090448096,436.04260883433,465.11211608996,470.92601754108,523.2511306012],"description":"Old Phrygian ??"},"phrygian_diat":{"frequencies":[261.6255653006,277.01530443593,294.32876096318,336.37572681506,348.83408706747,362.25078272391,376.74081403286,392.4383479509,428.11456140098,448.50096908674,470.92601754108,495.71159741166,523.2511306012,554.03060887186,588.65752192635,672.75145363011,697.66817413493,724.50156544782,753.48162806573,784.8766959018,856.22912280196,897.00193817349,941.85203508216,991.42319482333,1046.5022612024],"description":"Phrygian Diatonic Tonos"},"phrygian_enh":{"frequencies":[261.6255653006,277.01530443593,294.32876096318,303.82323712328,308.80394592858,313.95067836072,348.83408706747,392.4383479509,400.78810003496,405.0976494977,409.50088481833,459.44001711325,523.2511306012],"description":"Phrygian Enharmonic Tonos"},"phrygian_harm":{"frequencies":[261.6255653006,273.00058987889,285.40970760065,299.00064605783,313.95067836072,330.47439827444,348.83408706747,369.35373924791,392.4383479509,418.60090448096,448.50096908674,483.00104363188,523.2511306012],"description":"Phrygian Harmonia-Aliquot 24 (flute tuning)"},"piano":{"frequencies":[261.6255653006,275.93321340298,279.06726965397,294.32876096318,305.22982618403,313.95067836072,327.03195662575,348.83408706747,367.91095120397,372.08969287196,392.4383479509,406.97310157871,418.60090448096,436.04260883433,441.49314144476,457.84473927605,465.11211608996,490.54793493862,515.07533168556,523.2511306012],"description":"Enhanced Piano Total Gamut, see 1/1 vol. 8/2 January 1994"},"piano7":{"frequencies":[261.6255653006,275.93321340298,294.32876096318,305.22982618403,327.03195662575,348.83408706747,367.91095120397,392.4383479509,406.97310157871,441.49314144476,457.84473927605,490.54793493862,523.2511306012],"description":"Enhanced piano 7-limit"},"pipedum_10":{"frequencies":[261.6255653006,279.06726965397,306.59245933664,327.03195662575,348.83408706747,372.08969287196,396.89567239676,431.14564594215,459.88868900496,490.54793493862,523.2511306012],"description":"2048/2025 and 34171875/33554432 are homophonic intervals"},"pipedum_10a":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,327.03195662575,348.83408706747,372.08969287196,392.4383479509,418.60090448096,465.11211608996,490.54793493862,523.2511306012],"description":"2048/2025 and 25/24, Manuel Op de Coul, 2001"},"pipedum_10b":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,313.95067836072,348.83408706747,367.91095120397,392.4383479509,418.60090448096,446.50763144636,490.54793493862,523.2511306012],"description":"225/224, 64/63 and 25/24 are homophonic intervals"},"pipedum_10c":{"frequencies":[261.6255653006,280.31310567921,305.22982618403,327.03195662575,348.83408706747,373.75080757229,392.4383479509,429.2294430713,457.84473927605,490.54793493862,523.2511306012],"description":"225/224, 64/63 and 49/48 are homophonic intervals"},"pipedum_10d":{"frequencies":[261.6255653006,279.06726965397,299.00064605783,318.93402246168,343.38355445704,372.08969287196,392.4383479509,425.24536328225,448.50096908674,488.36772189445,523.2511306012],"description":"1029/1024, 2048/2025 and 64/63 are homophonic intervals"},"pipedum_10e":{"frequencies":[261.6255653006,286.15296204753,305.22982618403,327.03195662575,348.83408706747,367.91095120397,406.97310157871,429.2294430713,465.11211608996,490.54793493862,523.2511306012],"description":"2048/2025, 64/63 and 49/48 are homophonic intervals"},"pipedum_10f":{"frequencies":[261.6255653006,280.31310567921,294.32876096318,327.03195662575,348.83408706747,373.75080757229,392.4383479509,420.46965851882,465.11211608996,490.54793493862,523.2511306012],"description":"225/224, 64/63 and 28/27 are homophonic intervals"},"pipedum_10g":{"frequencies":[261.6255653006,280.31310567921,299.00064605783,325.57848126297,348.83408706747,372.08969287196,398.6675280771,425.24536328225,457.84473927605,490.54793493862,523.2511306012],"description":"225/224, 1029/1024 and 2048/2025 are homophonic intervals"},"pipedum_10h":{"frequencies":[261.6255653006,286.15296204753,305.22982618403,327.03195662575,348.83408706747,373.75080757229,400.61414686654,429.2294430713,457.84473927605,490.54793493862,523.2511306012],"description":"225/224, 1029/1024 and 64/63 are homophonic intervals"},"pipedum_10i":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,321.92208230347,343.38355445704,367.91095120397,392.4383479509,418.60090448096,457.84473927605,488.36772189445,523.2511306012],"description":"225/224, 2048/2025 and 49/48 are homophonic intervals"},"pipedum_10j":{"frequencies":[261.6255653006,269.10058145205,305.22982618403,313.95067836072,348.83408706747,366.27579142084,392.4383479509,418.60090448096,457.84473927605,488.36772189445,523.2511306012],"description":"25/24, 28/27 and 49/48, Gene Ward Smith, 2002"},"pipedum_10k":{"frequencies":[261.6255653006,280.31310567921,299.00064605783,320.49131749323,343.38355445704,367.91095120397,394.1903048614,420.46965851882,455.80987376816,488.36772189445,523.2511306012],"description":"2048/2025, 225/224 and 2401/2400"},"pipedum_11":{"frequencies":[261.6255653006,272.52663052146,282.55561052465,313.95067836072,327.03195662575,363.36884069528,376.74081403286,392.4383479509,436.04260883433,454.2110508691,470.92601754108,523.2511306012],"description":"16/15 and 15625/15552 are homophonic intervals"},"pipedum_11a":{"frequencies":[261.6255653006,269.10058145205,305.22982618403,313.95067836072,322.92069774245,366.27579142084,376.74081403286,381.53728273004,436.04260883433,448.50096908674,508.71637697339,523.2511306012],"description":"126/125, 1728/1715 and 10/9, Gene Ward Smith, 2002"},"pipedum_12":{"frequencies":[261.6255653006,275.93321340298,294.32876096318,306.59245933664,327.03195662575,348.83408706747,367.91095120397,392.4383479509,413.89982010446,436.04260883433,465.11211608996,490.54793493862,523.2511306012],"description":"81/80 and 2048/2025 are homophonic intervals"},"pipedum_12a":{"frequencies":[261.6255653006,279.06726965397,297.67175429757,306.59245933664,327.03195662575,348.83408706747,372.08969287196,392.4383479509,418.60090448096,436.04260883433,465.11211608996,490.54793493862,523.2511306012],"description":"81/80 and 2048/2025 are homophonic intervals"},"pipedum_12b":{"frequencies":[261.6255653006,274.70684356563,299.00064605783,313.95067836072,320.49131749323,348.83408706747,366.27579142084,392.4383479509,418.60090448096,448.50096908674,457.84473927605,488.36772189445,523.2511306012],"description":"64/63, 50/49 comma and 36/35 chroma"},"pipedum_12c":{"frequencies":[261.6255653006,280.31310567921,294.32876096318,315.35224388912,327.03195662575,348.83408706747,367.91095120397,392.4383479509,420.46965851882,448.50096908674,457.84473927605,490.54793493862,523.2511306012],"description":"225/224, 64/63 and 36/35 are homophonic intervals"},"pipedum_12d":{"frequencies":[261.6255653006,280.31310567921,293.02063313667,313.95067836072,327.03195662575,350.39138209902,366.27579142084,392.4383479509,418.60090448096,448.50096908674,457.84473927605,490.54793493862,523.2511306012],"description":"50/49, 128/125 and 225/224 are homophonic intervals"},"pipedum_12e":{"frequencies":[261.6255653006,280.31310567921,293.02063313667,313.95067836072,327.03195662575,350.39138209902,373.75080757229,392.4383479509,418.60090448096,439.53094970501,467.18850946536,500.55911728431,523.2511306012],"description":"50/49, 225/224 and 3136/3125 are homophonic intervals"},"pipedum_12f":{"frequencies":[261.6255653006,273.74326726486,293.02063313667,313.95067836072,327.03195662575,350.39138209902,366.27579142084,392.4383479509,408.78994578219,437.98922762377,468.83301301868,490.54793493862,523.2511306012],"description":"128/125, 3136/3125 and 703125/702464 are homophonic intervals"},"pipedum_12g":{"frequencies":[261.6255653006,279.06726965397,286.15296204753,306.59245933664,327.03195662575,348.83408706747,366.27579142084,390.69417751556,408.78994578219,437.98922762377,457.84473927605,488.36772189445,523.2511306012],"description":"50/49, 225/224 and 28672/28125 are homophonic intervals"},"pipedum_12h":{"frequencies":[261.6255653006,275.93321340298,291.02331101095,310.42486507835,330.74639366397,348.83408706747,367.91095120397,392.4383479509,413.89982010446,436.53496651643,465.11211608996,496.11959049595,523.2511306012],"description":"2048/2025 and 67108864/66430125, Gene Ward Smith, 2004"},"pipedum_12i":{"frequencies":[261.6255653006,271.31540105247,294.32876096318,305.22982618403,336.37572681506,348.83408706747,378.42269266694,392.4383479509,406.97310157871,441.49314144476,465.11211608996,504.56359022259,523.2511306012],"description":"64/63 and 6561/6272, Gene Ward Smith, 2004"},"pipedum_12j":{"frequencies":[261.6255653006,283.8170195002,285.83021674664,310.07474405997,336.37572681506,348.83408706747,378.42269266694,392.4383479509,413.43299207996,448.50096908674,465.11211608996,504.56359022259,523.2511306012],"description":"6561/6272 and 59049/57344"},"pipedum_12k":{"frequencies":[261.6255653006,271.31540105247,294.32876096318,305.22982618403,336.37572681506,348.83408706747,356.10146388137,392.4383479509,406.97310157871,448.50096908674,457.84473927605,474.80195184183,523.2511306012],"description":"64/63 and 729/686, Gene Ward Smith, 2004"},"pipedum_12l":{"frequencies":[261.6255653006,276.16031892841,294.32876096318,310.68035879446,331.39238271409,348.83408706747,368.21375857121,392.4383479509,414.24047839262,441.49314144476,465.11211608996,497.08857407114,523.2511306012],"description":"81/80, 361/360 and 513/512, Gene Ward Smith"},"pipedum_13":{"frequencies":[261.6255653006,276.76092858245,287.78812183066,309.14739649778,327.03195662575,345.95116072807,359.73515228832,380.54627680087,408.78994578219,418.60090448096,449.66894036041,475.68284600109,494.63583439645,523.2511306012],"description":"33275/32768 and 163840/161051 are homophonic intervals. Op de Coul, 2001"},"pipedum_13a":{"frequencies":[261.6255653006,266.96486255163,293.02063313667,299.00064605783,327.03195662575,334.88072358477,366.27579142084,373.75080757229,408.78994578219,418.60090448096,457.84473927605,467.18850946536,512.78610798918,523.2511306012],"description":"15/14, 3136/3125, 2401/2400, Gene Ward Smith, 2002"},"pipedum_13b":{"frequencies":[261.6255653006,267.90457886781,293.02063313667,299.00064605783,327.03195662575,334.88072358477,366.27579142084,373.75080757229,408.78994578219,418.60090448096,457.84473927605,467.18850946536,510.98743222773,523.2511306012],"description":"15/14, 3136/3125, 6144/6125, Gene Ward Smith, 2002"},"pipedum_13bp":{"frequencies":[261.6255653006,282.55561052465,305.16005936662,336.45263027341,363.36884069528,392.4383479509,436.04260883433,470.92601754108,508.60009894437,545.05326104292,605.61473449213,654.0639132515,706.38902631162,784.8766959018],"description":"78732/78125 and 250/243, twelfth based, Manuel Op de Coul, 2003"},"pipedum_13bp2":{"frequencies":[261.6255653006,290.69507255622,313.95067836072,348.83408706747,376.74081403286,392.4383479509,436.04260883433,470.92601754108,523.2511306012,565.1112210493,627.90135672144,678.13346525916,726.73768139056,784.8766959018],"description":"250/243 and 648/625, twelfth based, Manuel Op de Coul, 2003"},"pipedum_13c":{"frequencies":[261.6255653006,267.07609791103,293.02063313667,299.00064605783,327.03195662575,334.88072358477,366.27579142084,373.75080757229,408.78994578219,418.60090448096,457.84473927605,467.18850946536,512.57253609913,523.2511306012],"description":"15/14, 2401/2400, 6144/6125, Gene Ward Smith, 2002"},"pipedum_13d":{"frequencies":[261.6255653006,281.04308772525,287.78812183066,309.14739649778,327.03195662575,334.88072358477,359.73515228832,380.54627680087,408.78994578219,418.60090448096,449.66894036041,475.68284600109,494.63583439645,523.2511306012],"description":"125/121 and 33275/32768, Joe Monzo, 2003"},"pipedum_13e":{"frequencies":[261.6255653006,276.76092858245,287.78812183066,304.4370214407,327.03195662575,334.88072358477,359.73515228832,380.54627680087,408.78994578219,418.60090448096,449.66894036041,475.68284600109,494.63583439645,523.2511306012],"description":"33275/32768 and 163840/161051, Manuel Op de Coul, 2004"},"pipedum_14":{"frequencies":[261.6255653006,274.70684356563,284.76252005507,305.22982618403,320.49131749323,336.37572681506,348.83408706747,373.90653707544,392.4383479509,406.97310157871,427.14378008261,448.50096908674,480.73697623985,498.33441009638,523.2511306012],"description":"81/80, 49/48 and 2401/2400, Paul Erlich, TL 17-1-2001"},"pipedum_14a":{"frequencies":[261.6255653006,274.70684356563,284.8811711051,305.22982618403,320.35783506196,336.37572681506,348.83408706747,366.27579142084,392.4383479509,406.97310157871,427.32175665765,448.50096908674,480.53675259294,498.33441009638,523.2511306012],"description":"81/80, 50/49 and 2401/2400, Paul Erlich, 2001"},"pipedum_14b":{"frequencies":[261.6255653006,274.70684356563,294.32876096318,305.22982618403,313.95067836072,339.14425131559,353.19451315581,366.27579142084,392.4383479509,406.97310157871,418.60090448096,457.84473927605,470.92601754108,508.71637697339,523.2511306012],"description":"245/243, 81/80 comma and 25/24 chroma"},"pipedum_14c":{"frequencies":[261.6255653006,280.31310567921,282.55561052465,305.22982618403,327.03195662575,336.37572681506,363.36884069528,366.27579142084,392.4383479509,403.65087217807,436.04260883433,467.18850946536,470.92601754108,508.71637697339,523.2511306012],"description":"245/243, 50/49 comma and 25/24 chroma"},"pipedum_15":{"frequencies":[261.6255653006,272.52663052146,290.69507255622,301.39265122629,313.95067836072,327.03195662575,348.83408706747,363.36884069528,376.74081403286,392.4383479509,418.60090448096,436.04260883433,454.2110508691,470.92601754108,502.32108537715,523.2511306012],"description":"126/125, 128/125 and 875/864, 5-limit, Paul Erlich, 2001"},"pipedum_15a":{"frequencies":[261.6255653006,274.70684356563,290.69507255622,305.22982618403,313.95067836072,327.03195662575,348.83408706747,366.27579142084,381.53728273004,392.4383479509,418.60090448096,436.04260883433,457.84473927605,488.36772189445,502.32108537715,523.2511306012],"description":"Septimal version of pipedum_15, Manuel Op de Coul, 2001"},"pipedum_15b":{"frequencies":[261.6255653006,274.70684356563,286.15296204753,299.00064605783,311.45900631024,327.03195662575,343.38355445704,357.69120255941,382.72082695402,398.6675280771,418.60090448096,439.53094970501,457.84473927605,478.40103369253,498.33441009638,523.2511306012],"description":"126/125, 128/125 and 1029/1024, Paul Erlich, 2001"},"pipedum_15c":{"frequencies":[261.6255653006,274.70684356563,284.76252005507,299.00064605783,313.95067836072,327.03195662575,341.71502406609,358.80077526939,381.53728273004,400.61414686654,418.60090448096,436.04260883433,457.84473927605,480.73697623985,498.33441009638,523.2511306012],"description":"49/48, 126/125 and 1029/1024, Paul Erlich, 2001"},"pipedum_15d":{"frequencies":[261.6255653006,274.70684356563,286.15296204753,299.00064605783,313.95067836072,327.03195662575,343.38355445704,360.55273217989,379.68336007343,398.6675280771,418.60090448096,436.04260883433,457.84473927605,478.40103369253,498.33441009638,523.2511306012],"description":"64/63, 126/125 and 1029/1024, Paul Erlich, 2001"},"pipedum_15e":{"frequencies":[261.6255653006,273.37201925287,286.15296204753,299.00064605783,313.95067836072,332.22294006425,343.38355445704,358.80077526939,381.53728273004,398.6675280771,412.06026534844,436.04260883433,457.84473927605,478.40103369253,500.76768358318,523.2511306012],"description":"64/63, 875/864 and 1029/1024, Paul Erlich, 2001"},"pipedum_15f":{"frequencies":[261.6255653006,274.70684356563,290.69507255622,305.22982618403,313.95067836072,327.03195662575,348.83408706747,366.27579142084,387.59343007496,392.4383479509,418.60090448096,436.04260883433,465.11211608996,488.36772189445,490.54793493862,523.2511306012],"description":"126/125, 64/63 comma and 28/27 chroma"},"pipedum_15g":{"frequencies":[261.6255653006,279.06726965397,290.69507255622,294.32876096318,313.95067836072,327.03195662575,348.83408706747,363.36884069528,376.74081403286,392.4383479509,418.60090448096,436.04260883433,465.11211608996,470.92601754108,502.32108537715,523.2511306012],"description":"128/125 and 250/243"},"pipedum_16":{"frequencies":[261.6255653006,274.70684356563,286.15296204753,299.00064605783,313.95067836072,327.03195662575,343.38355445704,355.95315006884,373.75080757229,384.58958099188,400.61414686654,418.60090448096,439.53094970501,457.84473927605,480.73697623985,498.33441009638,523.2511306012],"description":"50/49, 126/125 and 1029/1024, Paul Erlich, 2001"},"pipedum_16a":{"frequencies":[261.6255653006,272.52663052146,283.88190679319,301.39265122629,313.95067836072,327.03195662575,340.65828815182,354.85238349148,363.36884069528,385.78259356965,401.85686830172,418.60090448096,436.04260883433,454.2110508691,482.22824196207,502.32108537715,523.2511306012],"description":"3125/3072 and 1990656/1953125, OdC 2004"},"pipedum_17":{"frequencies":[261.6255653006,269.10058145205,286.15296204753,294.32876096318,305.22982618403,318.93402246168,336.37572681506,348.83408706747,358.80077526939,381.53728273004,392.4383479509,406.97310157871,429.2294430713,448.50096908674,465.11211608996,478.40103369253,508.71637697339,523.2511306012],"description":"245/243, 64/63 and 525/512, Paul Erlich, 2001"},"pipedum_17a":{"frequencies":[261.6255653006,271.31540105247,286.15296204753,296.75121990114,305.22982618403,318.93402246168,336.37572681506,348.83408706747,358.80077526939,381.53728273004,392.4383479509,406.97310157871,429.2294430713,448.50096908674,461.31528248922,478.40103369253,504.56359022259,523.2511306012],"description":"245/243, 525/512 and 1728/1715, Paul Erlich, 2001"},"pipedum_17b":{"frequencies":[261.6255653006,264.89588486686,286.15296204753,294.32876096318,305.22982618403,327.03195662575,339.14425131559,343.38355445704,367.91095120397,381.53728273004,392.4383479509,406.97310157871,436.04260883433,441.49314144476,457.84473927605,490.54793493862,508.71637697339,523.2511306012],"description":"245/243, 64/63 comma and 25/24 chroma"},"pipedum_17c":{"frequencies":[261.6255653006,273.6806973752,285.83021674664,299.00064605783,310.07474405997,321.55899383997,336.37572681506,348.83408706747,364.90759650026,378.42269266694,392.4383479509,413.43299207996,428.74532511996,448.50096908674,465.11211608996,486.54346200035,504.56359022259,523.2511306012],"description":"1605632/1594323 and 177147/175616, Manuel Op de Coul, 2002"},"pipedum_17d":{"frequencies":[261.6255653006,274.08392555301,284.23518205497,299.00064605783,308.34441624714,319.76457981184,336.37572681506,348.83408706747,365.44523407068,373.05867644715,392.4383479509,411.12588832951,426.35277308246,448.50096908674,465.11211608996,479.64686971777,504.56359022259,523.2511306012],"description":"243/242, 99/98 and 64/63, Manuel Op de Coul, 2002"},"pipedum_17e":{"frequencies":[261.6255653006,271.31540105247,286.15296204753,296.75121990114,310.07474405997,321.92208230347,336.37572681506,348.83408706747,362.16234259141,378.42269266694,395.66829320152,413.43299207996,429.2294430713,445.12682985172,465.11211608996,482.88312345521,504.56359022259,523.2511306012],"description":"245/243, 1728/1715 and 32805/32768, Manuel Op de Coul, 2003"},"pipedum_17f":{"frequencies":[261.6255653006,269.80136421624,285.40970760065,294.32876096318,310.07474405997,319.76457981184,331.11985608357,348.83408706747,359.73515228832,380.54627680087,392.4383479509,413.43299207996,428.11456140098,441.49314144476,465.11211608996,479.64686971777,507.3950357345,523.2511306012],"description":"243/242 and 8192/8019, Manuel Op de Coul"},"pipedum_17g":{"frequencies":[261.6255653006,274.08392555301,285.40970760065,299.00064605783,305.22982618403,319.76457981184,336.37572681506,348.83408706747,359.73515228832,380.54627680087,392.4383479509,406.97310157871,428.11456140098,448.50096908674,457.84473927605,479.64686971777,499.46698830115,523.2511306012],"description":"243/242, 896/891 and 99/98, Manuel Op de Coul"},"pipedum_18":{"frequencies":[261.6255653006,272.52663052146,280.31310567921,296.75121990114,305.22982618403,317.94773560837,327.03195662575,340.65828815182,350.39138209902,379.84156147346,390.69417751556,406.97310157871,418.60090448096,436.04260883433,448.50096908674,474.80195184183,488.36772189445,508.71637697339,523.2511306012],"description":"875/864, 686/675 and 128/125, Paul Erlich, 2001"},"pipedum_18a":{"frequencies":[261.6255653006,269.10058145205,280.31310567921,293.02063313667,305.22982618403,313.95067836072,327.03195662575,341.85740532612,356.10146388137,366.27579142084,384.42940207435,400.44729382745,418.60090448096,436.04260883433,448.50096908674,467.18850946536,488.36772189445,508.71637697339,523.2511306012],"description":"875/864, 686/675 and 50/49, Paul Erlich, 2001"},"pipedum_18b":{"frequencies":[261.6255653006,272.52663052146,280.31310567921,296.75121990114,305.22982618403,317.94773560837,327.03195662575,346.20975655133,356.10146388137,373.75080757229,384.42940207435,400.44729382745,418.60090448096,436.04260883433,448.50096908674,467.18850946536,488.36772189445,508.71637697339,523.2511306012],"description":"1728/1715, 875/864 and 686/675, Paul Erlich, 2001"},"pipedum_19":{"frequencies":[261.6255653006,272.52663052146,282.55561052465,290.69507255622,301.39265122629,313.95067836072,327.03195662575,339.06673262958,348.83408706747,363.36884069528,376.74081403286,392.4383479509,401.85686830172,418.60090448096,436.04260883433,452.08897683944,470.92601754108,484.4917875937,502.32108537715,523.2511306012],"description":"81/80 and 15625/15552 are homophonic intervals, inverse of Mandelbaum"},"pipedum_19a":{"frequencies":[261.6255653006,271.25338610366,282.55561052465,294.32876096318,301.39265122629,313.95067836072,327.03195662575,339.06673262958,353.19451315581,361.67118147155,376.74081403286,392.4383479509,408.78994578219,416.64520105522,434.00541776586,452.08897683944,470.92601754108,490.54793493862,502.32108537715,523.2511306012],"description":"3125/3072 and 15625/15552 are homophonic intervals"},"pipedum_19b":{"frequencies":[261.6255653006,272.52663052146,282.55561052465,290.69507255622,302.80736724606,313.95067836072,327.03195662575,339.06673262958,348.83408706747,363.36884069528,376.74081403286,392.4383479509,403.74315632809,418.60090448096,436.04260883433,452.08897683944,470.92601754108,484.4917875937,502.32108537715,523.2511306012],"description":"15625/15552 and 78732/78125, Paul Erlich, TL 19-2-2001"},"pipedum_19c":{"frequencies":[261.6255653006,269.10058145205,280.31310567921,290.69507255622,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,363.36884069528,376.74081403286,392.4383479509,406.97310157871,418.60090448096,436.04260883433,448.50096908674,470.92601754108,488.36772189445,508.71637697339,523.2511306012],"description":"Periodicity block by Paul Erlich, 2001"},"pipedum_19d":{"frequencies":[261.6255653006,271.31540105247,280.31310567921,290.69507255622,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,363.36884069528,376.74081403286,392.4383479509,406.97310157871,418.60090448096,436.04260883433,448.50096908674,470.92601754108,488.36772189445,504.56359022259,523.2511306012],"description":"Periodicity block by Paul Erlich, 2001"},"pipedum_19e":{"frequencies":[261.6255653006,269.10058145205,280.31310567921,287.04062021552,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,358.80077526939,381.53728273004,392.4383479509,406.97310157871,418.60090448096,436.04260883433,448.50096908674,476.92160341255,488.36772189445,508.71637697339,523.2511306012],"description":"Periodicity block by Paul Erlich, 2001"},"pipedum_19f":{"frequencies":[261.6255653006,269.10058145205,279.06726965397,287.04062021552,305.22982618403,315.35224388912,327.03195662575,336.37572681506,348.83408706747,358.80077526939,381.53728273004,392.4383479509,406.97310157871,418.60090448096,434.10464168396,448.50096908674,476.92160341255,490.54793493862,508.71637697339,523.2511306012],"description":"Periodicity block by Paul Erlich, 2001"},"pipedum_19g":{"frequencies":[261.6255653006,269.10058145205,280.31310567921,288.32205155576,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,360.4025644447,379.84156147346,392.4383479509,406.97310157871,418.60090448096,436.04260883433,448.50096908674,474.80195184183,488.36772189445,508.71637697339,523.2511306012],"description":"Periodicity block by Paul Erlich, 2001"},"pipedum_19h":{"frequencies":[261.6255653006,274.70684356563,286.15296204753,294.32876096318,305.22982618403,313.95067836072,327.03195662575,343.38355445704,353.19451315581,366.27579142084,381.53728273004,392.4383479509,412.06026534844,415.27867508032,436.04260883433,457.84473927605,470.92601754108,490.54793493862,508.71637697339,523.2511306012],"description":"126/125, 81/80 comma and 49/48 chroma"},"pipedum_19i":{"frequencies":[261.6255653006,275.93321340298,286.15296204753,294.32876096318,305.22982618403,321.92208230347,327.03195662575,343.38355445704,348.83408706747,367.91095120397,381.53728273004,392.4383479509,406.97310157871,429.2294430713,436.04260883433,457.84473927605,465.11211608996,490.54793493862,515.07533168556,523.2511306012],"description":"225/224, 81/80 comma and 49/48 chroma"},"pipedum_19j":{"frequencies":[261.6255653006,266.96486255163,286.15296204753,293.02063313667,299.00064605783,320.49131749323,327.03195662575,333.70607818954,358.95027559242,366.27579142084,373.75080757229,381.37837507376,410.22888639134,418.60090448096,427.14378008261,457.84473927605,467.18850946536,478.40103369253,512.78610798918,523.2511306012],"description":"21/20, 3136/3125 and 2401/2400, Gene Ward Smith, 2002"},"pipedum_19k":{"frequencies":[261.6255653006,267.90457886781,286.15296204753,293.02063313667,299.00064605783,320.49131749323,327.03195662575,334.88072358477,357.69120255941,366.27579142084,373.75080757229,382.72082695402,408.78994578219,418.60090448096,427.14378008261,457.84473927605,467.18850946536,478.40103369253,510.98743222773,523.2511306012],"description":"21/20, 3136/3125 and 6144/6125, Gene Ward Smith, 2002"},"pipedum_19l":{"frequencies":[261.6255653006,267.07609791103,286.15296204753,293.02063313667,299.00064605783,320.49131749323,327.03195662575,333.84512238879,358.80077526939,366.27579142084,373.75080757229,381.53728273004,410.05802887931,418.60090448096,427.14378008261,457.84473927605,467.18850946536,478.40103369253,512.57253609913,523.2511306012],"description":"21/20, 2401/2400 and 6144/6125, Gene Ward Smith, 2002"},"pipedum_19m":{"frequencies":[261.6255653006,269.10058145205,293.02063313667,299.00064605783,305.22982618403,313.95067836072,317.94773560837,348.83408706747,358.80077526939,366.27579142084,373.75080757229,406.97310157871,418.60090448096,430.56093032327,436.04260883433,448.50096908674,488.36772189445,502.32108537715,508.71637697339,523.2511306012],"description":"126/125, 1728/1715 and 16/15, Gene Ward Smith, 2002"},"pipedum_19n":{"frequencies":[261.6255653006,267.07609791103,274.70684356563,280.31310567921,305.22982618403,313.95067836072,320.49131749323,327.03195662575,333.70607818954,366.27579142084,373.75080757229,381.53728273004,392.4383479509,427.32175665765,436.04260883433,448.50096908674,457.84473927605,467.18850946536,512.78610798918,523.2511306012],"description":"126/125, 2401/2400 and 16/15, Gene Ward Smith, 2002"},"pipedum_19o":{"frequencies":[261.6255653006,272.52663052146,280.31310567921,290.69507255622,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,363.36884069528,376.74081403286,392.4383479509,406.97310157871,418.60090448096,436.04260883433,448.50096908674,470.92601754108,488.36772189445,502.32108537715,523.2511306012],"description":"225/224, 3136/3125 and 4375/4374, OdC 2000"},"pipedum_21":{"frequencies":[261.6255653006,267.07609791103,280.31310567921,284.8811711051,299.00064605783,305.22982618403,320.35783506196,327.03195662575,341.85740532612,348.83408706747,366.27579142084,373.75080757229,392.4383479509,400.44729382745,418.60090448096,427.32175665765,448.50096908674,457.84473927605,480.53675259294,488.36772189445,512.57253609913,523.2511306012],"description":"36/35, 225/224 and 2401/2400, P. Erlich, 2001. Just PB version of miracle1"},"pipedum_21a":{"frequencies":[261.6255653006,265.7783520514,286.15296204753,290.69507255622,299.00064605783,305.22982618403,327.03195662575,332.22294006425,343.38355445704,348.83408706747,373.75080757229,381.53728273004,392.4383479509,398.6675280771,429.2294430713,436.04260883433,448.50096908674,457.84473927605,490.54793493862,498.33441009638,515.07533168556,523.2511306012],"description":"1029/1024, 81/80 comma and 25/24 chroma"},"pipedum_21b":{"frequencies":[261.6255653006,267.07609791103,279.06726965397,284.8811711051,299.00064605783,305.22982618403,318.93402246168,325.57848126297,343.38355445704,348.83408706747,366.27579142084,372.08969287196,392.4383479509,398.6675280771,418.60090448096,427.32175665765,448.50096908674,457.84473927605,478.40103369253,488.36772189445,496.11959049595,523.2511306012],"description":"36/35, 225/224 and 1029/1024, Gene Ward Smith, 2002"},"pipedum_21c":{"frequencies":[261.6255653006,269.46602871384,279.06726965397,287.4304306281,297.67175429757,306.59245933664,317.51653791741,327.03195662575,344.91651675372,348.83408706747,367.91095120397,372.08969287196,392.4383479509,396.89567239676,418.60090448096,431.14564594215,446.50763144636,459.88868900496,476.27480687611,490.54793493862,508.02646066786,523.2511306012],"description":"First 128/125 and ampersand comma Fokker block"},"pipedum_22":{"frequencies":[261.6255653006,267.90457886781,279.06726965397,285.76488412567,299.40669857094,306.59245933664,313.95067836072,327.03195662575,334.88072358477,348.83408706747,357.20610515709,365.77905168086,383.2405741708,392.4383479509,408.78994578219,418.60090448096,436.04260883433,446.50763144636,457.22381460107,479.0507177135,490.54793493862,510.98743222773,523.2511306012],"description":"3125/3072 and 2109375/2097152 are homophonic intervals"},"pipedum_22a":{"frequencies":[261.6255653006,267.90457886781,279.06726965397,287.4304306281,297.67175429757,306.59245933664,317.51653791741,327.03195662575,334.88072358477,348.83408706747,357.20610515709,372.08969287196,381.01984550089,392.4383479509,408.78994578219,418.60090448096,436.04260883433,446.50763144636,459.88868900496,476.27480687611,490.54793493862,508.02646066786,523.2511306012],"description":"2048/2025 and 2109375/2097152 are homophonic intervals"},"pipedum_22b":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,286.15296204753,294.32876096318,305.22982618403,313.95067836072,327.03195662575,339.14425131559,348.83408706747,357.69120255941,367.91095120397,381.53728273004,392.4383479509,406.97310157871,418.60090448096,429.2294430713,441.49314144476,457.84473927605,470.92601754108,490.54793493862,508.71637697339,523.2511306012],"description":"2025/2048, 245/243 and 64/63. P. Erlich \"7-limit Indian\", TL 19-12-2000"},"pipedum_22b2":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,286.15296204753,294.32876096318,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,358.80077526939,367.91095120397,381.53728273004,392.4383479509,406.97310157871,418.60090448096,429.2294430713,448.50096908674,465.11211608996,478.40103369253,490.54793493862,504.56359022259,523.2511306012],"description":"Version of pipedum_22b with other shape, Paul Erlich"},"pipedum_22c":{"frequencies":[261.6255653006,267.07609791103,274.70684356563,290.69507255622,299.00064605783,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,358.80077526939,366.27579142084,381.53728273004,392.4383479509,406.97310157871,418.60090448096,436.04260883433,448.50096908674,457.84473927605,470.92601754108,498.33441009638,512.57253609913,523.2511306012],"description":"1728/1715, 64/63 and 50/49, Paul Erlich, 2001"},"pipedum_22d":{"frequencies":[261.6255653006,269.10058145205,274.70684356563,290.69507255622,299.00064605783,305.22982618403,313.95067836072,327.03195662575,333.84512238879,348.83408706747,358.80077526939,366.27579142084,381.53728273004,392.4383479509,410.05802887931,418.60090448096,436.04260883433,448.50096908674,457.84473927605,470.92601754108,498.33441009638,508.71637697339,523.2511306012],"description":"1728/1715, 875/864 and 64/63, Paul Erlich, 2001"},"pipedum_22e":{"frequencies":[261.6255653006,269.10058145205,274.70684356563,290.69507255622,299.00064605783,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,356.10146388137,366.27579142084,384.42940207435,392.4383479509,406.97310157871,418.60090448096,436.04260883433,448.50096908674,457.84473927605,470.92601754108,498.33441009638,508.71637697339,523.2511306012],"description":"1728/1715, 245/243 and 50/49, Paul Erlich, 2001"},"pipedum_22f":{"frequencies":[261.6255653006,269.10058145205,276.78916949353,290.69507255622,296.75121990114,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,358.80077526939,366.27579142084,381.53728273004,392.4383479509,406.97310157871,418.60090448096,436.04260883433,448.50096908674,461.31528248922,470.92601754108,494.58536650191,508.71637697339,523.2511306012],"description":"1728/1715, 245/243 and 875/864, Paul Erlich, 2001"},"pipedum_22g":{"frequencies":[261.6255653006,267.07609791103,279.06726965397,286.15296204753,299.00064605783,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,358.80077526939,366.27579142084,381.53728273004,392.4383479509,406.97310157871,418.60090448096,436.04260883433,448.50096908674,457.84473927605,478.40103369253,490.54793493862,512.57253609913,523.2511306012],"description":"225/224, 1728/1715 and 64/63, Paul Erlich, 2001"},"pipedum_22h":{"frequencies":[261.6255653006,269.10058145205,280.31310567921,287.04062021552,296.75121990114,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,358.80077526939,366.27579142084,381.53728273004,392.4383479509,406.97310157871,418.60090448096,436.04260883433,448.50096908674,461.31528248922,476.92160341255,488.36772189445,508.71637697339,523.2511306012],"description":"225/224, 1728/1715 and 875/864, Paul Erlich, 2001"},"pipedum_22i":{"frequencies":[261.6255653006,269.10058145205,279.06726965397,288.32205155576,296.75121990114,305.22982618403,313.95067836072,327.03195662575,336.37572681506,348.83408706747,358.80077526939,366.27579142084,381.53728273004,392.4383479509,406.97310157871,418.60090448096,436.04260883433,448.50096908674,461.31528248922,474.80195184183,490.54793493862,508.71637697339,523.2511306012],"description":"1728/1715, 245/243 and 245/243, Paul Erlich, 2001"},"pipedum_22j":{"frequencies":[261.6255653006,271.31540105247,280.31310567921,290.69507255622,299.00064605783,305.22982618403,320.35783506196,332.22294006425,336.37572681506,348.83408706747,353.19451315581,373.75080757229,387.59343007496,392.4383479509,406.97310157871,427.14378008261,436.04260883433,448.50096908674,465.11211608996,480.53675259294,498.33441009638,504.56359022259,523.2511306012],"description":"50/49, 64/63 and 245/243, Gene Ward Smith, 2002"},"pipedum_22k":{"frequencies":[261.6255653006,272.52663052146,279.06726965397,290.69507255622,294.32876096318,310.07474405997,313.95067836072,327.03195662575,334.88072358477,348.83408706747,359.73515228832,367.91095120397,380.54627680087,392.4383479509,408.78994578219,418.60090448096,436.04260883433,441.49314144476,465.11211608996,470.92601754108,490.54793493862,502.32108537715,523.2511306012],"description":"121/120, 2048/2025 and 4125/4096, Manuel Op de Coul"},"pipedum_22l":{"frequencies":[261.6255653006,275.62199471997,284.23518205497,290.69507255622,303.18419419197,310.07474405997,319.76457981184,330.74639366397,341.08221846597,348.83408706747,363.82103303037,372.08969287196,387.59343007496,404.24559225596,413.43299207996,426.35277308246,440.99519155196,454.77629128796,465.11211608996,485.09471070715,496.11959049595,511.62332769895,523.2511306012],"description":"121/120, 736/729, 100/99 and 2048/2025"},"pipedum_23":{"frequencies":[261.6255653006,271.25338610366,276.85245005354,287.04062021552,297.60371503945,302.80736724606,313.95067836072,325.50406332439,332.22294006425,344.44874425862,348.83408706747,363.36884069528,376.74081403286,384.51729174103,398.6675280771,413.33849311034,420.56578784176,436.04260883433,452.08897683944,461.42075008924,478.40103369253,496.00619173241,504.67894541011,523.2511306012],"description":"6144/6125, 15625/1552 and 5103/5000, Manuel Op de Coul, 2003"},"pipedum_24":{"frequencies":[261.6255653006,267.57160087561,275.93321340298,285.40970760065,290.69507255622,299.7792935736,310.07474405997,319.76457981184,327.03195662575,338.26335715633,348.83408706747,356.76213450082,367.91095120397,380.54627680087,392.4383479509,401.35740131342,413.43299207996,426.35277308246,436.04260883433,449.66894036041,465.11211608996,479.64686971777,490.54793493862,507.3950357345,523.2511306012],"description":"121/120, 16384/16335 and 32805/32768. Manuel Op de Coul, 2001"},"pipedum_24a":{"frequencies":[261.6255653006,272.52663052146,274.70684356563,286.15296204753,294.32876096318,305.22982618403,313.95067836072,321.92208230347,327.03195662575,343.38355445704,348.83408706747,366.27579142084,367.91095120397,381.53728273004,392.4383479509,412.06026534844,418.60090448096,429.2294430713,436.04260883433,457.84473927605,470.92601754108,488.36772189445,490.54793493862,515.07533168556,523.2511306012],"description":"49/48, 81/80 and 128/125, Gene Ward Smith, 2002"},"pipedum_24b":{"frequencies":[261.6255653006,271.31540105247,275.62199471997,289.72987407313,294.32876096318,305.22982618403,310.07474405997,325.94610833227,331.11985608357,343.38355445704,348.83408706747,361.75386806997,372.50983809402,386.30649876417,392.4383479509,406.97310157871,413.43299207996,434.59481110969,441.49314144476,457.84473927605,465.11211608996,482.33849075995,496.67978412536,515.07533168556,523.2511306012],"description":"49/48, 81/80 and 531441/524288"},"pipedum_25":{"frequencies":[261.6255653006,268.26840191956,274.70684356563,281.29980781121,291.99281841585,299.00064605783,306.17666156322,313.95067836072,327.03195662575,335.33550239945,343.38355445704,351.62475976401,364.99102301981,373.75080757229,382.72082695402,392.4383479509,408.78994578219,418.60090448096,429.2294430713,439.53094970501,447.89271634391,467.18850946536,478.40103369253,490.54793493862,502.32108537715,523.2511306012],"description":"65625/65536, 1029/1024 and 3125/3072, Manuel Op de Coul, 2003"},"pipedum_26":{"frequencies":[261.6255653006,267.07609791103,274.70684356563,286.15296204753,292.89859205665,299.00064605783,305.22982618403,313.95067836072,327.03195662575,333.84512238879,341.71502406609,348.83408706747,358.80077526939,366.27579142084,381.53728273004,392.4383479509,400.61414686654,410.05802887931,418.60090448096,436.04260883433,448.50096908674,457.84473927605,467.3831713443,478.40103369253,498.33441009638,512.57253609913,523.2511306012],"description":"1029/1024, 1728/1715 and 50/49, Paul Erlich, 2001"},"pipedum_26a":{"frequencies":[261.6255653006,272.52663052146,274.70684356563,286.15296204753,294.32876096318,305.22982618403,306.59245933664,321.92208230347,325.57848126297,327.03195662575,343.38355445704,348.83408706747,366.27579142084,367.91095120397,381.53728273004,392.4383479509,408.78994578219,412.06026534844,429.2294430713,436.04260883433,457.84473927605,459.88868900496,465.11211608996,488.36772189445,490.54793493862,515.07533168556,523.2511306012],"description":"50/49, 81/80 and 525/512, Gene Ward Smith, 2002"},"pipedum_26b":{"frequencies":[261.6255653006,267.90457886781,272.52663052146,279.06726965397,290.69507255622,301.39265122629,306.59245933664,313.95067836072,327.03195662575,334.88072358477,340.65828815182,348.83408706747,357.20610515709,363.36884069528,376.74081403286,392.4383479509,401.85686830172,408.78994578219,418.60090448096,436.04260883433,446.50763144636,454.2110508691,470.92601754108,490.54793493862,502.32108537715,510.98743222773,523.2511306012],"description":"81/80 and 78125/73728, Gene Ward Smith, 2005"},"pipedum_27":{"frequencies":[261.6255653006,271.20240005245,278.95104005395,284.76252005507,292.89859205665,299.00064605783,307.54352165948,316.40280006119,325.44288006294,332.22294006425,341.71502406609,351.47831046798,358.80077526939,369.05222599138,379.68336007343,390.53145607553,398.6675280771,410.05802887931,418.60090448096,430.56093032327,442.86267118965,455.62003208812,468.63774729064,478.40103369253,492.06963465517,502.32108537715,516.67311638793,523.2511306012],"description":"126/125, 1728/1715 and 4000/3969 are homophonic intervals, Paul Erlich"},"pipedum_27a":{"frequencies":[261.6255653006,269.10058145205,274.70684356563,280.31310567921,290.69507255622,299.00064605783,305.22982618403,313.95067836072,320.49131749323,327.03195662575,336.37572681506,348.83408706747,358.80077526939,366.27579142084,373.75080757229,381.53728273004,392.4383479509,406.97310157871,418.60090448096,427.14378008261,436.04260883433,448.50096908674,457.84473927605,470.92601754108,488.36772189445,498.33441009638,508.71637697339,523.2511306012],"description":"126/126, 1728/1715 and 64/63, Paul Erlich, 2001"},"pipedum_27b":{"frequencies":[261.6255653006,266.96486255163,272.52663052146,280.31310567921,293.02063313667,299.00064605783,305.22982618403,313.95067836072,320.49131749323,327.03195662575,333.70607818954,348.83408706747,358.80077526939,366.27579142084,373.75080757229,381.53728273004,392.4383479509,410.22888639134,418.60090448096,427.14378008261,436.04260883433,448.50096908674,457.84473927605,467.18850946536,488.36772189445,502.32108537715,512.78610798918,523.2511306012],"description":"2401/2400, 126/125 and 128/125, Paul Erlich, 2001"},"pipedum_27c":{"frequencies":[261.6255653006,266.96486255163,274.70684356563,280.31310567921,290.69507255622,299.00064605783,305.22982618403,313.95067836072,320.35783506196,327.03195662575,336.37572681506,348.83408706747,356.10146388137,366.27579142084,373.75080757229,384.42940207435,392.4383479509,406.97310157871,418.60090448096,427.32175665765,436.04260883433,448.50096908674,457.84473927605,470.92601754108,488.36772189445,498.33441009638,512.78610798918,523.2511306012],"description":"2401/2400, 126/125 and 686/675, Paul Erlich, 2001"},"pipedum_27d":{"frequencies":[261.6255653006,266.96486255163,274.70684356563,280.31310567921,290.69507255622,299.00064605783,305.22982618403,313.95067836072,320.49131749323,327.03195662575,336.37572681506,348.83408706747,355.95315006884,366.27579142084,373.75080757229,384.58958099188,392.4383479509,406.97310157871,418.60090448096,427.14378008261,436.04260883433,448.50096908674,457.84473927605,470.92601754108,488.36772189445,498.33441009638,512.78610798918,523.2511306012],"description":"2401/2400, 126/125 and 64/63, Paul Erlich, 2001"},"pipedum_27e":{"frequencies":[261.6255653006,269.10058145205,274.70684356563,282.55561052465,290.69507255622,299.00064605783,305.22982618403,313.95067836072,320.35783506196,329.64821227876,336.37572681506,348.83408706747,356.10146388137,366.27579142084,373.75080757229,384.42940207435,392.4383479509,406.97310157871,415.27867508032,427.32175665765,436.04260883433,448.50096908674,457.84473927605,470.92601754108,484.4917875937,498.33441009638,508.71637697339,523.2511306012],"description":"2401/2400, 126/125 and 245/243, Paul Erlich, 2001"},"pipedum_27f":{"frequencies":[261.6255653006,267.07609791103,272.52663052146,280.31310567921,293.02063313667,299.00064605783,305.22982618403,313.95067836072,320.35783506196,327.03195662575,333.84512238879,348.83408706747,358.80077526939,366.27579142084,373.75080757229,381.53728273004,392.4383479509,410.05802887931,418.60090448096,427.32175665765,436.04260883433,448.50096908674,457.84473927605,467.18850946536,488.36772189445,502.32108537715,512.57253609913,523.2511306012],"description":"2401/2400, 1728/1715 and 128/125, Paul Erlich, 2001"},"pipedum_27g":{"frequencies":[261.6255653006,267.07609791103,274.59243005311,280.31310567921,290.81619550312,299.00064605783,305.22982618403,313.95067836072,320.35783506196,327.03195662575,336.37572681506,348.83408706747,356.10146388137,366.27579142084,373.75080757229,384.42940207435,392.4383479509,406.97310157871,418.60090448096,427.32175665765,436.04260883433,448.50096908674,457.84473927605,470.72988009104,488.36772189445,498.54204943392,512.57253609913,523.2511306012],"description":"2401/2400, 1728/1715 and 686/675, Paul Erlich, 2001"},"pipedum_27h":{"frequencies":[261.6255653006,267.07609791103,274.70684356563,280.31310567921,290.69507255622,299.00064605783,305.22982618403,313.95067836072,320.49131749323,327.03195662575,336.37572681506,348.83408706747,356.10146388137,366.27579142084,373.75080757229,384.42940207435,392.4383479509,406.97310157871,418.60090448096,427.14378008261,436.04260883433,448.50096908674,457.84473927605,470.92601754108,488.36772189445,498.33441009638,512.57253609913,523.2511306012],"description":"2401/2400, 1728/1715 and 64/63, Paul Erlich, 2001"},"pipedum_27i":{"frequencies":[261.6255653006,269.10058145205,274.70684356563,282.43792805463,290.69507255622,299.00064605783,305.22982618403,313.95067836072,320.49131749323,329.51091606373,336.37572681506,348.83408706747,356.10146388137,366.27579142084,373.75080757229,384.42940207435,392.4383479509,406.97310157871,415.4517078616,427.14378008261,436.04260883433,448.50096908674,457.84473927605,470.92601754108,484.69365917187,498.33441009638,508.71637697339,523.2511306012],"description":"2401/2400, 1728/1715 and 245/243, Paul Erlich, 2001"},"pipedum_27j":{"frequencies":[261.6255653006,269.16210421872,276.91574508099,282.55561052465,290.69507255622,299.06900468747,305.16005936662,313.95067836072,322.99452506247,329.57286411595,339.06673262958,348.83408706747,358.88280562497,366.19207123994,376.74081403286,387.59343007496,395.48743693914,406.88007915549,418.60090448096,423.83341578697,436.04260883433,448.60350703121,461.52624180165,470.92601754108,484.4917875937,498.44834114579,508.60009894437,523.2511306012],"description":"78732/78125 and 390625000/387420489"},"pipedum_27k":{"frequencies":[261.6255653006,264.89588486686,275.62199471997,279.38237857051,290.69507255622,294.32876096318,298.00787047521,310.07474405997,313.95067836072,331.11985608357,344.52749339997,348.83408706747,353.19451315581,367.49599295996,372.50983809402,387.59343007496,392.4383479509,397.34382730029,413.43299207996,418.60090448096,441.49314144476,447.01180571282,459.36999119996,465.11211608996,470.92601754108,496.67978412536,516.79124009995,523.2511306012],"description":"67108864/66430125 and 25/24"},"pipedum_28":{"frequencies":[261.6255653006,267.90457886781,272.52663052146,279.06726965397,285.76488412567,299.40669857094,306.59245933664,313.95067836072,319.36714514233,327.03195662575,334.88072358477,340.65828815182,348.83408706747,357.20610515709,363.36884069528,383.2405741708,392.4383479509,401.85686830172,408.78994578219,418.60090448096,428.6473261885,436.04260883433,446.50763144636,457.22381460107,479.0507177135,490.54793493862,502.32108537715,510.98743222773,523.2511306012],"description":"393216/390625 and 16875/16384"},"pipedum_29":{"frequencies":[261.6255653006,266.96486255163,274.70684356563,280.31310567921,288.44218574391,294.32876096318,300.33547037059,310.07474405997,316.40280006119,325.57848126297,332.22294006425,341.85740532612,348.83408706747,355.95315006884,366.27579142084,373.75080757229,384.58958099188,392.4383479509,400.44729382745,412.06026534844,420.46965851882,434.10464168396,442.96392008567,455.80987376816,465.11211608996,474.60420009179,488.36772189445,498.33441009638,512.78610798918,523.2511306012],"description":"5120/5103, 225/224 and 50421/50000, Manuel Op de Coul, 2003"},"pipedum_29a":{"frequencies":[261.6255653006,272.52663052146,274.70684356563,286.15296204753,290.69507255622,294.32876096318,305.22982618403,313.95067836072,317.94773560837,327.03195662575,339.14425131559,343.38355445704,348.83408706747,363.36884069528,366.27579142084,372.60080508745,381.53728273004,392.4383479509,408.78994578219,412.06026534844,429.2294430713,436.04260883433,441.49314144476,457.84473927605,470.92601754108,476.92160341255,490.54793493862,508.71637697339,515.07533168556,523.2511306012],"description":"49/48, 55/54, 65/64, 91/90 and 100/99"},"pipedum_31":{"frequencies":[261.6255653006,271.62175694356,275.93321340298,281.68182201554,289.72987407313,294.32876096318,300.46061014991,310.42486507835,316.89204976748,321.92208230347,331.11985608357,338.01818641865,343.38355445704,356.50355598842,362.16234259141,367.91095120397,380.27045972098,386.30649876417,392.4383479509,407.43263541533,413.89982010446,422.52273302331,434.59481110969,441.49314144476,450.69091522486,465.63729761752,475.33807465122,482.88312345521,496.67978412536,507.02727962797,515.07533168556,523.2511306012],"description":"81/80, 225/224 and 1029/1024 are homophonic intervals"},"pipedum_31a":{"frequencies":[261.6255653006,269.46602871384,275.93321340298,282.55561052465,287.4304306281,294.32876096318,301.39265122629,306.59245933664,313.95067836072,321.48549464138,329.20114651277,336.83253589231,344.91651675372,353.19451315581,359.28803828513,367.91095120397,376.74081403286,385.78259356965,392.4383479509,401.85686830172,411.50143314096,421.04066986538,431.14564594215,441.49314144476,452.08897683944,459.88868900496,470.92601754108,482.22824196207,490.54793493862,502.32108537715,514.3767914262,523.2511306012],"description":"393216/390625 and 2109375/2097152 are homophonic intervals"},"pipedum_31b":{"frequencies":[261.6255653006,267.07609791103,280.31310567921,286.15296204753,290.69507255622,294.32876096318,299.00064605783,305.22982618403,307.54352165948,327.03195662575,333.84512238879,339.14425131559,343.38355445704,348.83408706747,356.10146388137,373.75080757229,381.53728273004,387.59343007496,392.4383479509,400.61414686654,406.97310157871,429.2294430713,436.04260883433,445.12682985172,448.50096908674,457.84473927605,465.11211608996,490.54793493862,498.33441009638,508.71637697339,515.07533168556,523.2511306012],"description":"245/243, 1029/1024 comma and 25/24 chroma"},"pipedum_31c":{"frequencies":[261.6255653006,265.7783520514,274.70684356563,279.06726965397,286.15296204753,293.02063313667,299.00064605783,305.22982618403,313.95067836072,320.49131749323,327.03195662575,334.88072358477,343.38355445704,348.83408706747,360.55273217989,366.27579142084,373.75080757229,384.58958099188,392.4383479509,398.6675280771,412.06026534844,418.60090448096,429.2294430713,439.53094970501,448.50096908674,457.84473927605,470.92601754108,480.73697623985,490.54793493862,502.32108537715,515.07533168556,523.2511306012],"description":"126/125, 225/224 and 1029/1024, Op de Coul"},"pipedum_31d":{"frequencies":[261.6255653006,269.10058145205,274.70684356563,280.31310567921,286.15296204753,294.32876096318,299.00064605783,305.22982618403,313.95067836072,316.53463456122,327.03195662575,336.37572681506,343.38355445704,348.83408706747,358.80077526939,366.27579142084,373.75080757229,381.53728273004,392.4383479509,403.65087217807,406.97310157871,418.60090448096,429.2294430713,436.04260883433,448.50096908674,457.84473927605,470.92601754108,478.40103369253,490.54793493862,504.56359022259,508.71637697339,523.2511306012],"description":"1728/1715, 225/224 and 81/80"},"pipedum_31e":{"frequencies":[261.6255653006,267.07609791103,272.52663052146,276.85245005354,286.15296204753,290.69507255622,299.00064605783,305.22982618403,311.45900631024,317.94773560837,327.03195662575,332.22294006425,343.38355445704,348.83408706747,357.69120255941,363.36884069528,373.75080757229,381.53728273004,392.4383479509,398.6675280771,408.78994578219,415.27867508032,429.2294430713,436.04260883433,448.50096908674,457.84473927605,467.18850946536,476.92160341255,490.54793493862,498.33441009638,508.71637697339,523.2511306012],"description":"81/80, 126/125 and 1029/1024, Gene Smith (2005) \"Synstargam\""},"pipedum_32":{"frequencies":[261.6255653006,267.07609791103,270.30192333353,280.31310567921,286.15296204753,292.11448209019,299.00064605783,305.22982618403,311.5887808962,315.35224388912,325.57848126297,333.84512238879,337.87740416691,348.83408706747,356.10146388137,360.4025644447,367.91095120397,379.84156147346,384.42940207435,394.1903048614,406.97310157871,415.4517078616,420.46965851882,429.2294430713,443.14848838571,448.50096908674,457.84473927605,474.80195184183,480.53675259294,490.54793493862,500.76768358318,512.57253609913,523.2511306012],"description":"225/224, 2048/2025 and 117649/116640"},"pipedum_32a":{"frequencies":[261.6255653006,268.26840191956,274.59243005311,280.31310567921,286.15296204753,292.89859205665,299.00064605783,305.22982618403,311.5887808962,320.35783506196,327.03195662575,333.84512238879,341.71502406609,348.83408706747,356.10146388137,364.4960256705,372.08969287196,381.53728273004,390.53145607553,398.6675280771,406.97310157871,416.56688648057,425.24536328225,434.10464168396,438.17172313528,450.50320555588,459.88868900496,469.46970335923,480.53675259294,490.54793493862,500.76768358318,512.57253609913,523.2511306012],"description":"589824/588245, 225/224 and 2048/2025"},"pipedum_34":{"frequencies":[261.6255653006,267.90457886781,272.52663052146,279.06726965397,283.88190679319,290.69507255622,294.32876096318,301.39265122629,306.59245933664,313.95067836072,321.48549464138,327.03195662575,334.88072358477,340.65828815182,348.83408706747,354.85238349148,363.36884069528,367.91095120397,376.74081403286,385.78259356965,392.4383479509,401.85686830172,408.78994578219,418.60090448096,425.82286018978,436.04260883433,446.50763144636,454.2110508691,465.11211608996,470.92601754108,482.22824196207,490.54793493862,502.32108537715,510.98743222773,523.2511306012],"description":"15625/15552 and 393216/390625 are homophonic intervals"},"pipedum_34a":{"frequencies":[261.6255653006,264.89588486686,272.52663052146,279.06726965397,282.55561052465,290.69507255622,294.32876096318,301.39265122629,306.59245933664,313.95067836072,317.87506184023,327.03195662575,334.88072358477,340.65828815182,348.83408706747,353.19451315581,363.36884069528,367.91095120397,376.74081403286,387.59343007496,392.4383479509,401.85686830172,408.78994578219,418.60090448096,423.83341578697,436.04260883433,441.49314144476,452.08897683944,465.11211608996,470.92601754108,484.4917875937,490.54793493862,502.32108537715,510.98743222773,523.2511306012],"description":"15625/15552 and 2048/2025, Manuel Op de Coul, 2001"},"pipedum_34b":{"frequencies":[261.6255653006,267.57160087561,272.52663052146,279.06726965397,285.40970760065,290.69507255622,294.32876096318,299.7792935736,310.07474405997,313.95067836072,319.76457981184,327.03195662575,334.88072358477,342.49164912079,348.83408706747,356.76213450082,359.73515228832,367.91095120397,380.54627680087,383.71749577421,392.4383479509,399.70572476481,408.78994578219,418.60090448096,428.11456140098,436.04260883433,441.49314144476,449.66894036041,465.11211608996,470.92601754108,479.64686971777,490.54793493862,502.32108537715,511.62332769895,523.2511306012],"description":"100/99, 243/242 and 5632/5625, Manuel Op de Coul"},"pipedum_36":{"frequencies":[261.6255653006,267.07609791103,269.10058145205,280.31310567921,286.15296204753,290.69507255622,294.32876096318,300.46061014991,305.22982618403,311.5887808962,320.35783506196,327.03195662575,333.84512238879,336.37572681506,343.38355445704,348.83408706747,356.10146388137,367.91095120397,373.75080757229,381.53728273004,384.42940207435,392.4383479509,400.61414686654,406.97310157871,420.46965851882,429.2294430713,436.04260883433,445.12682985172,448.50096908674,457.84473927605,467.3831713443,480.53675259294,490.54793493862,498.33441009638,508.71637697339,515.07533168556,523.2511306012],"description":"1029/1024, 245/243 comma and 50/49 chroma, Gene Ward Smith, 2001"},"pipedum_36a":{"frequencies":[261.6255653006,264.89588486686,275.62199471997,275.93321340298,279.06726965397,290.69507255622,293.99679436797,294.32876096318,310.07474405997,310.42486507835,313.95067836072,327.03195662575,330.74639366397,331.11985608357,348.83408706747,349.22797321314,353.19451315581,367.91095120397,372.08969287196,372.50983809402,387.59343007496,392.4383479509,397.34382730029,413.43299207996,413.89982010446,418.60090448096,436.04260883433,440.99519155196,441.49314144476,465.11211608996,465.63729761752,470.92601754108,490.54793493862,496.11959049595,496.67978412536,516.79124009995,523.2511306012],"description":"1125/1024 and 531441/524288, Op de Coul"},"pipedum_37":{"frequencies":[261.6255653006,263.718569823,276.85245005354,279.06726965397,280.31310567921,290.69507255622,293.02063313667,299.00064605783,308.98710943476,311.45900631024,313.95067836072,325.57848126297,332.22294006425,333.70607818954,346.06556256693,348.83408706747,351.62475976401,353.19451315581,370.78453132171,373.75080757229,376.74081403286,390.69417751556,392.4383479509,400.44729382745,415.27867508032,418.60090448096,421.94971171681,436.04260883433,444.94143758605,448.50096908674,465.11211608996,467.18850946536,470.92601754108,494.37937509562,498.33441009638,502.32108537715,519.0983438504,523.2511306012],"description":"250/243, 3136/3125 and 3125/3087, Gene Ward Smith, 2002"},"pipedum_38":{"frequencies":[261.6255653006,271.25338610366,272.52663052146,280.3771918945,282.55561052465,290.69507255622,292.95365699196,301.39265122629,302.80736724606,313.95067836072,315.42434088132,325.50406332439,327.03195662575,336.45263027341,339.06673262958,348.83408706747,350.47148986813,361.67118147155,363.36884069528,376.74081403286,378.50920905758,390.60487598927,392.4383479509,403.74315632809,406.88007915549,418.60090448096,420.56578784176,434.00541776586,436.04260883433,452.08897683944,454.2110508691,467.29531982417,470.92601754108,484.4917875937,488.25609498659,502.32108537715,504.67894541011,519.21702202686,523.2511306012],"description":"81/80 and 1224440064/1220703125, Manuel Op de Coul, 2001"},"pipedum_38a":{"frequencies":[261.6255653006,268.26840191956,272.52663052146,274.70684356563,279.06726965397,286.15296204753,293.02063313667,294.32876096318,305.22982618403,306.59245933664,313.95067836072,321.92208230347,327.03195662575,329.64821227876,340.65828815182,343.38355445704,348.83408706747,357.69120255941,366.27579142084,367.91095120397,381.53728273004,383.2405741708,390.69417751556,392.4383479509,408.78994578219,412.06026534844,418.60090448096,429.2294430713,436.04260883433,439.53094970501,457.84473927605,459.88868900496,470.92601754108,476.92160341255,488.36772189445,490.54793493862,510.98743222773,515.07533168556,523.2511306012],"description":"50/49, 81/80 and 3125/3072, Gene Ward Smith, 2002"},"pipedum_41":{"frequencies":[261.6255653006,265.71346475842,269.80136421624,274.70684356563,280.31310567921,286.15296204753,290.69507255622,294.32876096318,299.00064605783,303.67253115248,308.34441624714,313.95067836072,320.49131749323,327.03195662575,331.11985608357,336.37572681506,343.38355445704,348.83408706747,354.2846196779,359.73515228832,366.27579142084,373.75080757229,381.53728273004,387.40708707973,392.4383479509,400.61414686654,406.97310157871,412.06026534844,418.60090448096,425.14154361347,436.04260883433,441.49314144476,448.50096908674,457.84473927605,465.11211608996,470.92601754108,479.64686971777,485.87604984397,495.99846754905,503.62921320365,513.90736041189,523.2511306012],"description":"100/99 105/104 196/195 275/273 385/384, Paul Erlich, TL 3-11-2000"},"pipedum_41a":{"frequencies":[261.6255653006,265.71346475842,269.80136421624,274.70684356563,280.31310567921,285.40970760065,290.69507255622,294.32876096318,299.00064605783,305.22982618403,309.19384990071,313.95067836072,319.76457981184,327.03195662575,332.97799220076,336.37572681506,343.38355445704,348.83408706747,353.19451315581,359.73515228832,366.27579142084,373.75080757229,380.54627680087,387.59343007496,392.4383479509,400.61414686654,406.97310157871,411.12588832951,418.60090448096,425.14154361347,436.04260883433,441.49314144476,448.50096908674,457.84473927605,465.11211608996,470.92601754108,479.64686971777,485.87604984397,495.99846754905,503.62921320365,513.90736041189,523.2511306012],"description":"pipedum_41 improved shape by Manuel Op de Coul, all intervals superparticular"},"pipedum_41b":{"frequencies":[261.6255653006,265.7783520514,271.31540105247,274.70684356563,279.06726965397,284.8811711051,290.69507255622,294.32876096318,299.00064605783,305.22982618403,310.07474405997,313.95067836072,319.76457981184,327.03195662575,331.11985608357,336.37572681506,343.38355445704,348.83408706747,353.19451315581,359.73515228832,366.27579142084,373.75080757229,381.53728273004,387.59343007496,392.4383479509,398.6675280771,406.97310157871,412.06026534844,418.60090448096,425.14154361347,436.04260883433,441.49314144476,448.50096908674,457.84473927605,465.11211608996,470.92601754108,479.64686971777,490.54793493862,498.33441009638,504.56359022259,515.07533168556,523.2511306012],"description":"pipedum_41 more improved shape by M. OdC, all intervals superparticular"},"pipedum_41c":{"frequencies":[261.6255653006,267.07609791103,271.31540105247,275.93321340298,280.31310567921,286.15296204753,290.69507255622,294.32876096318,299.00064605783,305.22982618403,310.07474405997,315.35224388912,320.35783506196,327.03195662575,333.84512238879,336.37572681506,343.38355445704,348.83408706747,356.10146388137,360.4025644447,367.91095120397,373.75080757229,381.53728273004,384.42940207435,392.4383479509,398.6675280771,406.97310157871,410.05802887931,420.46965851882,429.2294430713,436.04260883433,445.12682985172,448.50096908674,457.84473927605,465.11211608996,474.80195184183,480.53675259294,490.54793493862,498.33441009638,508.71637697339,512.57253609913,523.2511306012],"description":"225/224, 245/243 and 1029/1024, Gene Ward Smith, 2002"},"pipedum_41d":{"frequencies":[261.6255653006,264.89588486686,272.52663052146,275.93321340298,279.06726965397,282.55561052465,290.69507255622,294.32876096318,297.67175429757,306.59245933664,310.07474405997,313.95067836072,317.51653791741,327.03195662575,331.11985608357,334.88072358477,344.91651675372,348.83408706747,353.19451315581,363.36884069528,367.91095120397,372.08969287196,376.74081403286,387.59343007496,392.4383479509,396.89567239676,408.78994578219,413.89982010446,418.60090448096,423.83341578697,436.04260883433,441.49314144476,446.50763144636,459.88868900496,465.11211608996,470.92601754108,484.4917875937,490.54793493862,496.11959049595,502.32108537715,517.37477513058,523.2511306012],"description":"3125/3072 and 32805/32768"},"pipedum_43":{"frequencies":[261.6255653006,269.10058145205,273.37201925287,274.70684356563,282.55561052465,286.15296204753,287.04062021552,290.69507255622,299.00064605783,305.22982618403,307.54352165948,313.95067836072,322.92069774245,327.03195662575,328.04642310345,332.22294006425,341.71502406609,343.38355445704,348.83408706747,358.80077526939,366.27579142084,369.05222599138,376.74081403286,379.68336007343,381.53728273004,392.4383479509,398.6675280771,410.05802887931,412.06026534844,418.60090448096,423.93031414449,430.56093032327,436.04260883433,448.50096908674,455.62003208812,457.84473927605,470.92601754108,478.40103369253,492.06963465517,494.47231841813,498.33441009638,508.71637697339,512.57253609913,523.2511306012],"description":"81/80, 126/125 and 12288/12005, Gene Ward Smith, 2002"},"pipedum_45":{"frequencies":[261.6255653006,265.7783520514,267.07609791103,274.70684356563,279.06726965397,280.31310567921,284.8811711051,293.02063313667,294.32876096318,299.00064605783,303.74668805875,305.22982618403,313.95067836072,320.49131749323,325.57848126297,327.03195662575,336.37572681506,341.85740532612,343.38355445704,348.83408706747,356.10146388137,358.80077526939,366.27579142084,372.08969287196,373.75080757229,384.58958099188,392.4383479509,398.6675280771,400.61414686654,406.97310157871,418.60090448096,420.46965851882,427.32175665765,436.04260883433,439.53094970501,448.50096908674,455.80987376816,457.84473927605,465.11211608996,478.40103369253,480.73697623985,488.36772189445,498.33441009638,512.78610798918,515.07533168556,523.2511306012],"description":"81/80, 525/512 and 2401/2400, Gene Ward Smith, 2002"},"scala205pipedum_45a":{"frequencies":[261.6255653006,267.07609791103,269.10058145205,274.70684356563,276.85245005354,282.55561052465,288.32205155576,290.69507255622,296.75121990114,299.00064605783,305.22982618403,311.45900631024,313.95067836072,320.49131749323,322.99452506247,329.64821227876,336.37572681506,339.14425131559,345.98646186692,348.83408706747,356.10146388137,363.28578496026,366.27579142084,373.75080757229,376.82694590621,384.42940207435,392.4383479509,395.66829320152,403.65087217807,406.97310157871,415.27867508032,423.83341578697,427.14378008261,436.04260883433,439.53094970501,448.50096908674,457.84473927605,461.31528248922,470.92601754108,474.80195184183,484.4917875937,494.47231841813,498.33441009638,508.71637697339,512.57253609913,523.2511306012],"description":"81/80, 2401/2400 and 4375/4374, Gene Ward Smith"},"pipedum_46":{"frequencies":[261.6255653006,265.7783520514,270.41454913492,274.70684356563,279.06726965397,280.31310567921,286.15296204753,290.69507255622,295.30928005711,300.46061014991,305.22982618403,310.07474405997,313.95067836072,320.49131749323,325.57848126297,327.03195662575,332.22294006425,339.14425131559,343.38355445704,348.83408706747,354.37113606854,360.55273217989,366.27579142084,372.08969287196,373.75080757229,381.53728273004,387.59343007496,392.4383479509,398.6675280771,406.97310157871,412.06026534844,418.60090448096,427.32175665765,429.2294430713,436.04260883433,442.96392008567,450.69091522486,457.84473927605,465.11211608996,470.92601754108,480.73697623985,488.36772189445,490.54793493862,498.33441009638,508.71637697339,515.07533168556,523.2511306012],"description":"126/125, 1029/1024 and 5120/5103. Manuel Op de Coul, 2001"},"pipedum_46a":{"frequencies":[261.6255653006,267.07609791103,269.10058145205,274.70684356563,279.06726965397,280.31310567921,286.15296204753,290.69507255622,294.32876096318,299.00064605783,305.22982618403,307.54352165948,313.95067836072,320.35783506196,320.49131749323,327.03195662575,332.22294006425,336.37572681506,343.38355445704,348.83408706747,353.19451315581,358.80077526939,366.12324007081,366.27579142084,373.75080757229,381.53728273004,387.59343007496,392.4383479509,398.6675280771,406.97310157871,412.06026534844,418.60090448096,427.14378008261,427.32175665765,436.04260883433,445.12682985172,448.50096908674,457.84473927605,465.11211608996,470.92601754108,478.40103369253,488.36772189445,490.54793493862,498.33441009638,508.71637697339,512.57253609913,523.2511306012],"description":"126/125, 1029/1024 and 245/243, Gene Ward Smith, 2002"},"pipedum_46b":{"frequencies":[261.6255653006,264.89588486686,271.25338610366,272.52663052146,279.06726965397,282.55561052465,283.88190679319,290.69507255622,294.32876096318,301.39265122629,302.80736724606,310.07474405997,313.95067836072,317.87506184023,322.99452506247,327.03195662575,334.88072358477,339.06673262958,340.65828815182,348.83408706747,353.19451315581,361.67118147155,363.36884069528,372.08969287196,376.74081403286,381.45007420827,387.59343007496,392.4383479509,401.85686830172,403.74315632809,408.78994578219,418.60090448096,423.83341578697,430.65936674996,436.04260883433,441.49314144476,452.08897683944,454.2110508691,465.11211608996,470.92601754108,482.22824196207,484.4917875937,490.54793493862,502.32108537715,508.60009894437,516.79124009995,523.2511306012],"description":"2048/2025 and 78732/78125"},"pipedum_46c":{"frequencies":[261.6255653006,266.47048317654,271.31540105247,274.08392555301,279.06726965397,282.62020942966,287.78812183066,290.69507255622,297.67175429757,299.7792935736,306.97399661937,310.07474405997,313.95067836072,319.76457981184,325.57848126297,328.90071066361,332.22294006425,339.14425131559,342.60490694126,348.83408706747,355.29397756872,359.73515228832,363.36884069528,372.08969287196,374.72411696701,383.71749577421,387.59343007496,394.68085279633,399.70572476481,406.97310157871,411.12588832951,418.60090448096,426.35277308246,431.68218274599,436.04260883433,446.50763144636,449.66894036041,460.46099492906,465.11211608996,467.18850946536,479.64686971777,484.4917875937,496.11959049595,499.63215595601,511.62332769895,516.79124009995,523.2511306012],"description":"126/125, 176/175, 385/384 and 896/891, Paul Erlich"},"pipedum_46d":{"frequencies":[261.6255653006,267.23182741418,272.79915715198,274.70684356563,278.36648688978,283.42769574232,287.78812183066,291.52562990638,297.59908052943,299.7792935736,303.67253115248,311.77046531655,313.95067836072,320.67819289702,324.7609013714,327.03195662575,334.03978426773,340.11323489078,343.04051394309,345.34574619679,354.2846196779,359.73515228832,366.27579142084,374.12455837986,376.74081403286,381.53728273004,389.71308164569,392.4383479509,402.90337056292,408.13588186894,411.12588832951,419.69101100305,425.14154361347,431.68218274599,439.53094970501,445.38637902364,448.50096908674,457.84473927605,467.65569797482,470.92601754108,479.64686971777,485.87604984397,490.54793493862,503.62921320365,510.16985233617,519.61744219425,523.2511306012],"description":"91/90, 121/120, 126/125, 169/168 and 176/175"},"pipedum_5":{"frequencies":[261.6255653006,313.95067836072,348.83408706747,392.4383479509,436.04260883433,523.2511306012],"description":"16/15 and 27/25"},"pipedum_50":{"frequencies":[261.6255653006,267.07609791103,269.10058145205,273.37201925287,274.70684356563,276.85245005354,284.76252005507,286.15296204753,290.69507255622,299.00064605783,300.46061014991,305.22982618403,307.54352165948,313.95067836072,316.40280006119,320.49131749323,327.03195662575,332.22294006425,333.84512238879,341.71502406609,343.38355445704,348.83408706747,358.80077526939,360.55273217989,361.60320006994,366.27579142084,373.75080757229,379.68336007343,381.53728273004,392.4383479509,398.6675280771,400.61414686654,410.05802887931,412.06026534844,418.60090448096,423.93031414449,427.14378008261,436.04260883433,445.12682985172,448.50096908674,455.62003208812,457.84473927605,470.92601754108,478.40103369253,480.73697623985,484.4917875937,498.33441009638,500.76768358318,508.71637697339,512.57253609913,523.2511306012],"description":"81/80, 126/125 and 16807/16384, Gene Ward Smith, 2002"},"pipedum_53":{"frequencies":[261.6255653006,264.89588486686,269.16210421872,272.52663052146,275.93321340298,279.06726965397,282.55561052465,287.4304306281,290.69507255622,294.32876096318,298.00787047521,302.80736724606,306.59245933664,310.07474405997,313.95067836072,317.87506184023,322.99452506247,327.03195662575,331.11985608357,334.88072358477,340.65828815182,344.91651675372,348.83408706747,353.19451315581,357.20610515709,363.36884069528,367.91095120397,372.08969287196,376.74081403286,383.2405741708,387.59343007496,392.4383479509,397.34382730029,403.74315632809,408.78994578219,413.89982010446,418.60090448096,423.83341578697,430.65936674996,436.04260883433,441.49314144476,446.50763144636,454.2110508691,459.88868900496,465.11211608996,470.92601754108,476.81259276034,484.4917875937,490.54793493862,496.67978412536,502.32108537715,510.98743222773,516.79124009995,523.2511306012],"description":"15625/15552 and 32805/32768, Manuel Op de Coul, 2001"},"pipedum_53a":{"frequencies":[261.6255653006,266.96486255163,269.10058145205,272.52663052146,276.85245005354,280.31310567921,282.55561052465,288.32205155576,290.69507255622,294.32876096318,299.00064605783,302.80736724606,305.22982618403,311.45900631024,313.95067836072,320.35783506196,322.99452506247,327.03195662575,332.22294006425,336.37572681506,339.14425131559,346.06556256693,348.83408706747,353.19451315581,358.80077526939,363.36884069528,366.27579142084,373.75080757229,376.74081403286,384.42940207435,387.59343007496,392.4383479509,398.6675280771,403.65087217807,406.97310157871,415.27867508032,418.60090448096,423.83341578697,430.56093032327,436.04260883433,441.49314144476,448.50096908674,454.2110508691,457.84473927605,467.18850946536,470.92601754108,480.53675259294,484.4917875937,490.54793493862,498.33441009638,504.56359022259,508.71637697339,519.0983438504,523.2511306012],"description":"225/224, 1728/1715 and 4375/4374, Manuel Op de Coul, 2001"},"pipedum_53b":{"frequencies":[261.6255653006,266.96486255163,269.10058145205,272.52663052146,274.70684356563,280.31310567921,286.03378130532,288.32205155576,290.69507255622,293.02063313667,299.00064605783,301.39265122629,305.22982618403,311.45900631024,313.95067836072,320.35783506196,322.92069774245,327.03195662575,333.70607818954,336.37572681506,341.85740532612,343.24053756638,348.83408706747,351.62475976401,358.80077526939,363.36884069528,366.27579142084,373.75080757229,376.74081403286,384.42940207435,389.3237578878,392.4383479509,400.44729382745,403.65087217807,406.97310157871,410.22888639134,418.60090448096,427.14378008261,430.56093032327,436.04260883433,439.53094970501,448.50096908674,457.65405008851,457.84473927605,467.18850946536,470.92601754108,478.60036745656,480.53675259294,488.36772189445,498.33441009638,502.32108537715,512.57253609913,512.78610798918,523.2511306012],"description":"225/224, 1728/1715 and 3125/3087, Gene Ward Smith, 2002"},"pipedum_55":{"frequencies":[261.6255653006,267.07609791103,269.10058145205,272.52663052146,274.70684356563,279.06726965397,280.31310567921,286.15296204753,293.02063313667,294.32876096318,296.75121990114,299.00064605783,305.22982618403,306.59245933664,313.95067836072,317.94773560837,320.49131749323,325.57848126297,327.03195662575,333.84512238879,336.37572681506,340.65828815182,343.38355445704,348.83408706747,356.10146388137,358.80077526939,366.27579142084,367.91095120397,373.75080757229,376.74081403286,381.53728273004,390.69417751556,392.4383479509,400.61414686654,403.65087217807,406.97310157871,408.78994578219,418.60090448096,427.32175665765,429.2294430713,436.04260883433,439.53094970501,445.12682985172,448.50096908674,457.84473927605,459.88868900496,470.92601754108,474.80195184183,476.92160341255,488.36772189445,490.54793493862,502.32108537715,504.56359022259,508.71637697339,520.92557002075,523.2511306012],"description":"81/80, 686/675 and 6144/6125, Gene Ward Smith, 2002"},"pipedum_58":{"frequencies":[261.6255653006,264.29521392612,268.60224704195,271.31540105247,275.62199471997,277.50997462242,280.31310567921,284.8811711051,287.78812183066,292.35618725654,295.30928005711,297.33211566688,302.17752792219,305.22982618403,310.07474405997,313.23877206058,315.35224388912,320.49131749323,323.76163705949,328.90071066361,332.22294006425,337.63694353197,339.94971891247,343.38355445704,348.83408706747,352.39361856816,358.13632938927,361.75386806997,364.23184169193,370.01329949656,373.75080757229,379.84156147346,383.71749577421,389.80824967539,392.4383479509,396.44282088917,402.90337056292,406.97310157871,413.43299207996,417.65169608078,420.46965851882,427.32175665765,431.68218274599,438.53428088482,442.96392008567,445.99817350032,453.26629188329,457.84473927605,465.11211608996,469.85815809087,477.51510585235,480.73697623985,485.64245558924,493.35106599542,498.33441009638,506.45541529795,511.62332769895,515.07533168556,523.2511306012],"description":"9801/9800, 2401/2400, 5120/5103 and 896/891"},"pipedum_58a":{"frequencies":[261.6255653006,265.65057399753,267.66008354786,270.48058443385,272.52663052146,277.4816601673,281.75060878526,285.40970760065,287.78812183066,293.02063313667,295.1673044417,297.30177875068,301.87565226992,305.22982618403,309.92566966379,313.95067836072,316.2506833304,322.00069575458,323.72860352852,327.03195662575,332.97799220076,338.10073054231,342.60490694126,344.24801655217,348.83408706747,352.18826098158,358.59168390851,362.25078272391,366.27579142084,368.95913055213,375.66747838035,379.50081999647,381.53728273004,388.47432423422,392.4383479509,399.57359064092,402.50086969323,406.97310157871,411.12588832951,418.60090448096,422.62591317789,428.25613367658,430.31002069022,436.04260883433,442.75095666255,450.80097405642,455.40098399577,457.84473927605,466.16918908107,469.58434797544,475.68284600109,483.00104363188,488.36772189445,495.88107146206,499.46698830115,503.12608711654,512.27383415502,516.54278277298,523.2511306012],"description":"126/125, 144/143, 176/175, 196/195 and 364/363"},"pipedum_5a":{"frequencies":[261.6255653006,290.69507255622,348.83408706747,392.4383479509,470.92601754108,523.2511306012],"description":"27/25 and 81/80"},"pipedum_64":{"frequencies":[261.6255653006,267.90457886781,266.96486255163,273.37201925287,274.70684356563,273.74326726486,280.31310567921,280.42990280658,284.76252005507,286.15296204753,294.32876096318,300.05312833195,299.00064605783,300.46061014991,307.67166479351,306.59245933664,313.95067836072,312.84944830269,320.35783506196,320.49131749323,328.18310911307,327.03195662575,336.37572681506,336.5158833679,341.71502406609,343.38355445704,351.62475976401,348.83408706747,358.80077526939,358.95027559242,366.12324007081,366.27579142084,375.06641041494,373.75080757229,382.72082695402,384.58958099188,383.2405741708,392.4383479509,392.60186392921,398.6675280771,400.61414686654,412.06026534844,408.78994578219,418.60090448096,428.6473261885,427.14378008261,429.2294430713,439.53094970501,437.98922762377,448.50096908674,448.68784449053,455.62003208812,457.84473927605,468.83301301868,467.18850946536,478.40103369253,480.73697623985,488.16432009441,490.54793493862,502.32108537715,500.55911728431,512.57253609913,512.78610798918,520.70860810071,523.2511306012],"description":"225/224 235298/234375 and 67108864/66706983"},"pipedum_65":{"frequencies":[261.6255653006,264.59711493117,267.38234771992,270.72462706642,273.0589090967,275.93321340298,279.06726965397,282.00481986086,285.20783756792,287.99181818792,291.26283636981,294.32876096318,297.67175429757,300.80514118491,303.39878788522,306.84479880935,310.42486507835,313.95067836072,317.25542234346,320.85881726391,323.62537374423,327.30111872997,331.11985608357,334.60532825287,338.40578383303,341.32363637087,345.20039866051,348.83408706747,352.79615324157,356.9123501364,360.9661694219,364.07854546226,367.91095120397,372.08969287196,376.00642648114,380.70650681216,383.98909091723,388.35044849308,392.4383479509,396.89567239676,401.07352157989,404.53171718029,409.58836364504,413.89982010446,418.60090448096,423.00722979129,427.81175635188,431.50049832564,436.89425455471,441.49314144476,446.50763144636,451.20771177737,455.09818182783,460.26719821402,465.11211608996,470.92601754108,475.8831335152,481.28822589586,485.43806061635,490.95167809495,496.11959049595,501.90799237931,507.60867574954,511.9854545563,517.80059799077,523.2511306012],"description":"1216/1215, 32805/32768 and 39858075/39845888. Manuel Op de Coul, 2001"},"pipedum_65a":{"frequencies":[261.6255653006,264.89588486686,267.90457886781,269.16210421872,272.52663052146,275.93321340298,279.06726965397,282.55561052465,286.08755565621,287.10624449997,290.69507255622,294.32876096318,298.00787047521,301.39265122629,302.80736724606,306.59245933664,310.07474405997,313.95067836072,317.87506184023,319.0069383333,322.99452506247,327.03195662575,331.11985608357,334.88072358477,339.06673262958,340.65828815182,344.52749339997,348.83408706747,353.19451315581,357.60944457026,358.88280562497,363.36884069528,367.91095120397,372.08969287196,376.74081403286,381.45007420827,383.2405741708,387.59343007496,392.4383479509,397.34382730029,401.85686830172,403.74315632809,408.78994578219,413.43299207996,418.60090448096,423.83341578697,429.13133348431,430.65936674996,436.04260883433,441.49314144476,446.50763144636,452.08897683944,454.2110508691,459.88868900496,465.11211608996,470.92601754108,476.81259276034,478.51040749995,484.4917875937,490.54793493862,496.67978412536,502.32108537715,508.60009894437,510.98743222773,516.79124009995,523.2511306012],"description":"78732/78125 and 32805/32768"},"pipedum_67":{"frequencies":[261.6255653006,262.79353657426,266.96486255163,267.07609791103,272.52663052146,274.70684356563,279.06726965397,280.31310567921,284.8811711051,286.15296204753,293.02063313667,294.32876096318,299.00064605783,299.12522966035,300.33547037059,305.22982618403,306.59245933664,311.45900631024,313.95067836072,320.35783506196,320.49131749323,325.57848126297,327.03195662575,332.22294006425,336.5158833679,339.00300006557,341.85740532612,343.38355445704,348.83408706747,350.39138209902,355.95315006884,360.55273217989,366.27579142084,367.91095120397,373.75080757229,373.90653707544,381.53728273004,384.58958099188,390.69417751556,392.4383479509,398.83363954714,400.44729382745,400.61414686654,406.97310157871,408.78994578219,418.60090448096,420.46965851882,427.32175665765,429.2294430713,436.04260883433,439.53094970501,448.50096908674,448.68784449053,455.80987376816,457.84473927605,459.88868900496,465.11211608996,467.18850946536,474.60420009179,480.73697623985,488.36772189445,490.54793493862,498.33441009638,504.77382505185,512.78610798918,515.07533168556,520.92557002075,523.2511306012],"description":"81/80, 1029/1024 and 9604/9375, Gene Ward Smith, 2002"},"pipedum_68":{"frequencies":[246.94165062806,250.86135936819,252.08626834948,253.99712636029,258.02882677871,259.28873315946,263.4044273366,264.58033995864,268.89201957278,272.13977824317,273.16014686758,276.57464870343,277.80935695657,282.21902928921,286.81815421096,288.0985923994,291.6998248044,292.67158592955,296.32998075367,301.03363124183,302.50352201937,307.30516522603,308.67706328508,311.01688942076,316.08531280392,317.49640795036,322.53603347338,324.11091644933,329.25553417075,333.37122834788,334.48181249092,338.66283514705,340.17472280396,345.71831087928,351.20590311546,352.77378661151,357.18345894416,358.5226927637,362.85303765756,368.76619827124,370.41247594209,376.29203905228,378.12940252422,384.13145653254,387.04324016806,388.93309973919,395.1066410049,396.87050993795,403.33802935916,409.74022030137,411.56941771343,414.86197305514,416.71403543485,423.32854393382,430.22723131644,432.1478885991,439.00737889433,441.15096961159,444.49497113051,451.55044686274,453.56629707195,460.95774783905,468.27453748728,470.36504881535,474.12796920588,476.24461192554,483.80405021008,491.68826436165,493.88330125612],"description":"245/243, 2048/2025 and 2401/2400, Gene Ward Smith, 2002"},"pipedum_7":{"frequencies":[261.6255653006,290.69507255622,317.94773560837,347.75533582165,392.4383479509,429.2294430713,476.92160341255,523.2511306012],"description":"81/80, 64/63 and 6144/6125, Manuel Op de Coul"},"pipedum_72":{"frequencies":[195.99771799087,198.44768946576,200.08100378235,201.59765279061,204.16428957382,205.79760389041,208.41771227328,209.06423252359,211.67753543014,214.37250405251,216.08748408493,217.77524221208,220.49743273973,222.31222642483,223.99739198957,226.79735938944,228.66400432268,231.52230437672,232.29359169288,235.19726158904,238.19167116946,240.09720453882,241.91718334873,244.99714748859,246.9571246685,250.10125472793,251.99706598826,254.07111591409,257.24700486302,258.04499557198,261.33029065449,264.59691928767,266.7746717098,268.79687038748,272.2190527651,274.39680518722,277.89028303104,279.99673998696,282.23671390685,285.83000540335,289.40288047089,290.3669896161,293.99657698631,296.41630189977,300.12150567352,302.39647918591,304.88533909691,308.69640583562,311.1074888744,313.59634878539,317.58889489261,321.55875607877,322.55624446497,326.66286331812,329.27616622466,333.46833963724,335.99608798435,338.76148788545,342.99600648402,347.28345656507,348.44038753932,352.79589238357,357.28750675419,360.14580680822,362.95873702013,365.86240691629,370.43568700274,373.32898664928,376.31561854247,381.10667387114,385.87050729453,387.1559861548,391.99543598174],"description":"225/224, 1029/1024 and 4375/4374, Gene Ward Smith, 2002"},"pipedum_72a":{"frequencies":[195.99771799087,197.5656997348,200.08100378235,201.59765279061,203.21043401293,205.79760389041,207.44398472154,209.99755499022,211.67753543014,213.41973736784,216.04686727389,217.77524221208,219.51744414977,222.31222642483,223.99739198957,226.84921063758,228.66400432268,230.49331635726,233.3306166558,235.19726158904,237.07883968176,240.09720453882,241.91718334873,244.99714748859,246.9571246685,248.93278166584,251.99706598826,254.07111591409,256.1036848414,259.25624072866,261.33029065449,264.65741241051,266.7746717098,268.79687038748,272.2190527651,274.39680518722,276.59197962872,279.99673998696,282.23671390685,285.83000540335,288.11664544658,290.30062001848,293.99657698631,296.3485496022,298.59492344758,302.46561418344,304.88533909691,308.7669811456,311.1074888744,313.59634878539,317.58889489261,320.12960605175,322.55624446497,326.66286331812,329.27616622466,333.46833963724,335.99608798435,338.68405668822,342.99600648402,345.73997453589,348.36074402217,352.79589238357,355.69956227973,360.07811212314,362.95873702013,365.86240691629,370.52037737472,373.32898664928,376.31561854247,381.10667387114,384.15552726211,388.884361093,391.99543598174],"description":"4375/4374, 2401/2400 and 15625/15552, Manuel Op de Coul, 2002"},"pipedum_72b":{"frequencies":[195.99771799087,197.5656997348,200.51849868858,202.12264667808,204.16428957382,205.79760389041,207.94510975112,209.60867062912,211.67753543014,213.41973736784,215.59748978996,218.74745311481,220.49743273973,222.7983318762,224.58071853121,226.79735938944,228.66400432268,230.99731048924,232.89852292125,235.19726158904,238.19167116946,240.62219842629,242.5471760137,244.99714748859,246.9571246685,249.53413170134,251.53040475495,254.07111591409,256.1036848414,259.87197430039,262.49694373777,264.59691928767,267.35799825143,269.49686223745,272.2190527651,274.39680518722,277.19677258709,279.4782275055,283.49669923679,285.83000540335,288.74663811155,291.12315365156,293.99657698631,296.3485496022,299.44095804161,301.83648570594,304.88533909691,309.37139797666,311.91766462667,314.99633248533,317.51630314521,320.82959790172,323.39623468494,326.66286331812,329.27616622466,332.71217560179,336.87107779681,340.19603908415,342.99600648402,346.49596573386,349.34778438187,352.79589238357,355.69956227973,359.32914964993,362.08404605941,367.49572123288,371.24567757199,374.30119755201,377.99559898239,381.10667387114,384.99551748207,388.16420486875,391.99543598174],"description":"225/224, 3025/3024, 1375/1372 and 4375/4374"},"pipedum_72b2":{"frequencies":[195.99771799087,198.44768946576,200.45221158157,202.12264667808,204.16428957382,205.79760389041,207.87636756607,209.06423252359,211.67753543014,213.81569235368,215.59748978996,217.77524221208,220.49743273973,222.72467953508,223.99739198957,226.79735938944,228.66400432268,230.99731048924,233.3306166558,235.19726158904,237.57299150408,239.55276643329,241.97249134675,244.99714748859,246.39713118852,249.45164107929,251.99706598826,254.07111591409,257.24700486302,258.71698774795,261.33029065449,264.59691928767,267.2696154421,269.49686223745,272.2190527651,274.39680518722,277.19677258709,279.99673998696,282.23671390685,285.0875898049,287.46331971994,290.3669896161,293.99657698631,296.96623938011,298.66318931942,302.39647918591,304.88533909691,307.99641398565,311.81455134911,313.59634878539,317.51630314521,320.72353853051,323.39623468494,326.66286331812,329.27616622466,332.60218810572,335.99608798435,338.76148788545,342.99600648402,344.95598366393,348.44038753932,352.79589238357,356.35948725613,359.32914964993,362.95873702013,367.49572123288,369.59569678278,374.17746161893,376.31561854247,380.11678640654,383.28442629326,387.1559861548,391.99543598174],"description":"Optimised version of pipedum_72b, Manuel Op de Coul"},"pipedum_72c":{"frequencies":[195.99771799087,197.5656997348,199.99767141926,201.59765279061,203.25689273127,205.79760389041,207.40499258293,209.99755499022,211.67753543014,213.41973736784,215.9974851328,217.77524221208,219.51744414977,222.31222642483,223.99739198957,226.79735938944,228.66400432268,230.49331635726,233.3306166558,235.19726158904,237.13304151982,239.99720570311,241.91718334873,244.99714748859,246.9571246685,248.88599109952,251.99706598826,254.07111591409,256.1036848414,259.19698215935,261.33029065449,264.59691928767,266.7746717098,268.79687038748,272.2190527651,274.39680518722,276.47678096998,279.99673998696,282.23671390685,285.83000540335,287.99664684373,290.3669896161,293.99657698631,296.41630189977,298.66318931942,302.39647918591,304.88533909691,308.69640583562,311.1074888744,313.59634878539,317.58889489261,320.12960605175,322.55624446497,326.66286331812,329.27616622466,333.32945236543,335.99608798435,338.76148788545,342.99600648402,345.59597621247,348.44038753932,352.79589238357,355.69956227973,359.99580855466,362.95873702013,365.86240691629,370.43568700274,373.32898664928,376.31561854247,381.10667387114,384.15552726211,388.884361093,391.99543598174],"description":"441/440, 2401/2400, 4375/4374 and 1375/1372"},"pipedum_74":{"frequencies":[174.6141157165,175.4667237034,177.38576834692,178.25190979393,182.45393315683,183.34482150233,186.25505676427,187.16450528362,187.6669026756,191.57662981467,192.51206257744,194.01568412944,194.96302633711,195.48635695375,199.55898939029,200.53339851817,202.72659239648,203.71646833592,208.51878075067,209.5369388598,210.56006844408,212.8629220163,213.90229175271,216.62558481901,218.9447197882,220.01378580279,221.73221043365,222.81488724241,228.06741644604,229.18102687791,231.68753416741,232.81882095533,233.95563160453,239.47078726834,240.6400782218,243.27191087578,244.4597620031,249.5526737115,250.2225369008,251.44432663176,253.4082404956,254.6455854199,259.95070178281,260.64847593833,261.92117357475,266.07865252038,267.37786469089,273.68089973525,275.01723225349,278.02504100089,279.3825851464,280.74675792544,285.20305567028,287.36494472201,291.02352619417,291.92629305093,292.44453950566,297.08651632321,299.33848408543,304.08988859472,305.57470250388,310.42509460711,311.94084213937,312.778171126,319.29438302446,320.85343762907,325.94634933747,328.4170796823,333.63004920107,334.22233086361,335.25910217568,339.52744722653,342.10112466906,347.53130125111,349.228231433],"description":"81/80, 126/125 and 4194304/4117715, Gene Ward Smith, 2002"},"pipedum_81":{"frequencies":[116.54094037952,117.10998793997,118.96887663743,119.87068153322,121.77339076391,122.3679873985,122.96548733697,124.86529326377,124.9173204693,126.84728204574,127.4666535401,128.08904930934,130.12220882219,130.47149010419,131.10855792696,133.18964614802,133.83998621711,135.96443044277,136.62831926329,136.99506460939,139.16958944446,139.84912845542,140.53198552796,142.70319230145,142.76265196491,144.96832233798,145.6761754744,146.38748492496,148.71109579678,149.83835191653,152.21673845488,152.95998424812,153.70685917121,155.38792050603,156.14665058662,156.56578812502,159.82757537763,160.60798346053,163.08936263023,163.15731653133,163.95398311595,166.48705768503,167.29998277138,169.12970939431,169.95553805347,170.78539907912,173.96198680558,174.81141056928,175.66498190995,177.58619486403,178.45331495614,182.66008614586,183.55198109774,184.08675852442,184.44823100545,186.46550460723,187.37598070395,190.2709230686,191.19998031015,193.29109645065,194.23490063253,195.18331323328,199.78446922203,200.75997932566,202.95565127318,203.94664566416,204.94247889494,208.7543841667,209.77369268314,210.79797829194,213.10343383684,214.14397794737,217.45248350698,218.5142632116,218.60531082127,221.98274358004,223.06664369518,227.71386543882,228.32510768232,229.43997637218,231.94931574077,233.08188075904],"description":"81/80, 126/125 and 17294403/16777216, Gene Ward Smith, 2002"},"pipedum_87":{"frequencies":[82.40688922822,83.34286871081,83.43697534357,84.3846545697,84.87648045204,85.84050961273,86.81548824043,86.91351598289,87.90068184343,87.99993493267,88.99944036648,90.43280025045,90.53491248218,91.56321025358,92.60318745646,92.70775038175,93.76072729966,93.86659726152,95.37834401414,96.46165360048,96.57057331432,97.66742427048,97.77770548075,98.88826707386,100.01144245297,100.59434720242,101.73690028175,101.85177654245,103.00861153527,104.17858588852,104.29621917947,105.48081821212,105.59992191921,107.30063701591,108.51936030054,108.64189497861,109.87585230429,111.12382494775,111.2493004581,112.5128727596,113.16864060272,114.45401281697,115.75398432057,115.88468797718,117.20090912458,117.3332465769,118.66592048864,120.5770670006,120.7132166429,122.0842803381,122.22213185094,123.61033384233,125.01430306622,125.15546301536,127.17112535219,128.61553813397,128.76076441909,130.22323236064,130.37027397433,131.85102276515,133.3485899373,133.49916054972,135.64920037567,135.80236872326,137.34481538037,138.90478118469,139.06162557262,140.6410909495,140.79989589228,143.06751602122,144.69248040072,144.85585997148,146.50113640572,146.66655822112,148.3324006108,150.01716367946,150.89152080363,152.60535042263,154.33864576076,154.51291730291,156.26787883277,156.4443287692,158.22122731818,160.76942266746,160.95095552387,162.7790404508,162.96284246792,164.81377845644],"description":"67108864/66430125 and 15625/15552, Op de Coul"},"pipedum_9":{"frequencies":[261.6255653006,280.31310567921,305.22982618403,327.03195662575,348.83408706747,392.4383479509,420.46965851882,448.50096908674,490.54793493862,523.2511306012],"description":"225/224, 49/48 and 36/35 are homophonic intervals"},"pipedum_99":{"frequencies":[41.20344461411,41.53307217102,41.72802550619,42.06184971024,42.3806858888,42.72949811834,42.92025480636,43.26361684482,43.60972577957,43.95034092172,44.14654780083,44.49972018324,44.86597302425,45.06626754668,45.407877738,45.78160512679,46.1478579678,46.35387519087,46.73538856693,47.08965098755,47.46636819545,47.68917200707,48.07068538313,48.45525086619,48.65129757643,49.0517197787,49.44413353693,49.83968660523,50.07363060743,50.47421965228,50.85682306656,51.275397742,51.50430576764,51.91634021378,52.34363519496,52.55541404861,52.975857361,53.41187264792,53.8391676291,54.07952105602,54.50191086522,54.93792615215,55.37742956136,55.62465022905,56.08246628032,56.50758118507,56.7598471725,57.22700640849,57.68482245975,58.14630103943,58.41923570866,58.86206373444,59.33296024432,59.82129736567,60.08835672891,60.56906358274,61.04214016905,61.31464972338,61.80516692116,62.29960825653,62.81236223395,63.06649685833,63.5710288332,64.0942471775,64.60700115492,64.89542526722,65.40229303827,65.92551138258,66.21982170125,66.7648408099,67.29895953638,67.80909742208,68.12738858153,68.67240769018,69.2217869517,69.77556124732,70.1030828504,70.63447648133,71.19955229318,71.53375801061,72.10602807469,72.68287629929,73.25056820286,73.57757966805,74.1662003054,74.77662170709,75.37483468075,75.67979623,76.30267521131,76.91309661301,77.25645865146,77.87451032067,78.48275164592,79.11061365909,79.4637860415,80.11780897188,80.75875144366,81.37091690649,81.75286629784,82.40688922822],"description":"2401/2400, 3136/3125 and 4375/4374, Gene Ward Smith, 2002"},"pipedum_9a":{"frequencies":[261.6255653006,282.62020942966,305.22982618403,329.72357766794,356.10146388137,384.67750727926,415.4517078616,448.79042515914,484.69365917187,523.2511306012],"description":"4375/4374, 2401/2400 and 21/20 are homophonic intervals"},"pipedum_9b":{"frequencies":[261.6255653006,279.06726965397,306.59245933664,327.03195662575,357.20610515709,383.2405741708,418.60090448096,446.50763144636,490.54793493862,523.2511306012],"description":"128/125 and 2109375/2097152 are homophonic intervals"},"pipedum_9c":{"frequencies":[261.6255653006,285.40970760065,305.22982618403,332.97799220076,348.83408706747,392.4383479509,411.12588832951,448.50096908674,479.64686971777,523.2511306012],"description":"49/48, 21/20, 99/98 and 121/120, Gene Ward Smith, 2002"},"pipedum_9d":{"frequencies":[261.6255653006,277.4816601673,308.34441624714,327.03195662575,346.85207520913,394.68085279633,418.60090448096,443.97065626768,493.35106599542,523.2511306012],"description":"128/125, 36/35, 99/98 and 121/120, Gene Ward Smith, 2002"},"pipedum_9e":{"frequencies":[261.6255653006,272.52663052146,313.95067836072,327.03195662575,348.83408706747,392.4383479509,418.60090448096,436.04260883433,502.32108537715,523.2511306012],"description":"21/20, 27/25 and 128/125"},"polansky_ps":{"frequencies":[261.6255653006,523.2511306012,784.8766959018,1046.5022612024,1308.127826503,1569.7533918036,1831.3789571042,2093.0045224048,2354.6300877054,2616.255653006,2877.8812183066,3139.5067836072,3401.1323489078,3662.7579142084,3924.383479509,4186.0090448096,4447.6346101102,327.03195662575,654.0639132515,981.09586987725,1308.127826503,1635.15978312875,1962.1917397545,2289.22369638025,2616.255653006,2943.28760963175,3270.3195662575,3597.35152288325,3924.383479509,4251.41543613475,4578.4473927605,4905.47934938625,5232.511306012,5559.54326263775,392.4383479509,784.8766959018,1177.3150438527,1569.7533918036,1962.1917397545,2354.6300877054,2747.0684356563,3139.5067836072,3531.9451315581,3924.383479509,4316.8218274599,4709.2601754108,5101.6985233617,5494.1368713126,5886.5752192635,6279.0135672144,6671.4519151653],"description":"Three interlocking harmonic series on 1:5:3 by Larry Polansky in Psaltery"},"poole":{"frequencies":[261.6255653006,294.32876096318,327.03195662575,348.83408706747,392.4383479509,436.04260883433,457.84473927605,523.2511306012],"description":"Poole's double diatonic or dichordal scale"},"porcupine":{"frequencies":[261.6255653006,268.5059110196,275.56719913678,277.81869773502,285.12489766782,287.45448663717,295.01409284105,302.77250493809,305.24628043356,313.27378316024,315.83336022842,324.13928669805,332.66364612382,335.38164643474,344.20166244741,347.01393314922,356.13986022226,365.50578499276,368.49211923405,378.18288921726,381.27279846892,391.29968045081,401.5902538439,404.87141319969,415.51890206933,418.91386427268,429.93064777916,441.23715556831,444.84224659643,456.54090625717,460.27103529174,472.37544811397,484.79818817936,488.75918813348,501.6127950959,505.71118020326,519.01059820838,523.2511306012],"description":"porcupine temperament, g=162.996, 5-limit"},"portbag1":{"frequencies":[261.6255653006,281.75060878526,311.64221749042,334.88072358477,376.74081403286,413.43299207996,457.84473927605,523.2511306012],"description":"Portugese bagpipe tuning"},"portbag2":{"frequencies":[261.6255653006,274.70684356563,281.75060878526,310.07474405997,317.68818643644,343.38355445704,372.08969287196,392.4383479509,408.78994578219,482.37213602298,523.2511306012],"description":"Portugese bagpipe tuning 2"},"prelleur":{"frequencies":[261.6255653006,276.42153822591,293.20376052703,310.91918875105,328.72923110101,349.43408698743,368.89538496172,391.53834819612,414.55891854195,438.90564190541,466.17878415199,492.19384741628,523.2511306012],"description":"Peter Prelleur's well temperament (1731)"},"preston":{"frequencies":[261.6255653006,276.24946721727,293.45376109391,311.26733605541,328.91048112005,349.30075403587,368.79929095641,391.73834630677,413.67420227347,439.48064068428,466.20100528964,492.6657196346,523.2511306012],"description":"Preston's equal beating temperament (1785)"},"preston2":{"frequencies":[261.6255653006,276.2302000593,293.37610901672,311.58628319174,328.97985807656,349.39999567988,368.9044325484,391.80273191286,413.67420227347,439.35140993827,466.62242981045,492.67053466508,523.2511306012],"description":"Preston's theoretically correct well temperament"},"prime_10":{"frequencies":[261.6255653006,277.97716313189,310.68035879446,327.03195662575,359.73515228832,376.08675011961,392.4383479509,425.14154361347,457.84473927605,474.19633710734,523.2511306012],"description":"First 10 prime numbers reduced by 2/1"},"prime_5":{"frequencies":[261.6255653006,294.32876096318,327.03195662575,392.4383479509,436.04260883433,523.2511306012],"description":"What Lou Harrison calls \"the Prime Pentatonic\", a widely used scale"},"primes6":{"frequencies":[261.6255653006,523.2511306012,784.8766959018,1308.127826503,1831.3789571042,2877.8812183066,3401.1323489078],"description":"First 6 primes"},"prinz":{"frequencies":[261.6255653006,275.62199471997,292.50627485027,310.07474405997,327.03195662575,348.83408706747,367.49599295996,391.22147055517,413.43299207996,437.39890198442,465.11211608996,490.54793493862,523.2511306012],"description":"Prinz well-tempermament (1808)"},"prinz2":{"frequencies":[261.6255653006,275.62199471997,291.81313052759,310.07474405997,327.03195662575,348.83408706747,367.49599295996,390.42584360243,413.43299207996,436.71344361716,465.11211608996,490.54793493862,523.2511306012],"description":"Prinz equal beating temperament (1808)"},"prod13-2":{"frequencies":[261.6255653006,265.71346475842,269.80136421624,286.15296204753,292.28481123426,294.32876096318,314.76825825228,318.85615771011,327.03195662575,343.38355445704,345.42750418595,359.73515228832,371.99885066179,392.4383479509,400.61414686654,408.78994578219,425.14154361347,449.66894036041,457.84473927605,490.54793493862,494.63583439645,523.2511306012],"description":"13-limit binary products [1 3 5 7 11 13]"},"prod13":{"frequencies":[261.6255653006,265.71346475842,269.80136421624,286.15296204753,292.28481123426,294.32876096318,314.76825825228,318.85615771011,327.03195662575,331.11985608357,343.38355445704,345.42750418595,359.73515228832,367.91095120397,371.99885066179,392.4383479509,400.61414686654,404.70204632437,408.78994578219,425.14154361347,441.49314144476,449.66894036041,457.84473927605,478.28423656516,490.54793493862,494.63583439645,515.07533168556,523.2511306012],"description":"13-limit binary products [1 3 5 7 9 11 13]"},"prod7d":{"frequencies":[261.6255653006,265.7783520514,267.90457886781,273.37201925287,279.06726965397,286.15296204753,294.32876096318,299.00064605783,300.46061014991,306.59245933664,310.07474405997,318.93402246168,327.03195662575,334.88072358477,341.71502406609,343.38355445704,348.83408706747,350.53737850823,357.69120255941,367.91095120397,372.08969287196,382.72082695402,390.53145607553,392.4383479509,398.6675280771,400.61414686654,408.78994578219,418.60090448096,429.2294430713,441.49314144476,446.50763144636,455.62003208812,457.84473927605,465.11211608996,478.40103369253,490.54793493862,500.76768358318,510.98743222773,515.07533168556,523.2511306012],"description":"Double Cubic Corner 7-limit. Chalmers '96"},"prod7s":{"frequencies":[261.6255653006,286.15296204753,294.32876096318,300.46061014991,306.59245933664,327.03195662575,343.38355445704,350.53737850823,357.69120255941,367.91095120397,392.4383479509,400.61414686654,408.78994578219,429.2294430713,441.49314144476,457.84473927605,490.54793493862,500.76768358318,510.98743222773,515.07533168556,523.2511306012],"description":"Single Cubic Corner 7-limit"},"prodq13":{"frequencies":[261.6255653006,265.71346475842,269.80136421624,276.76092858245,279.06726965397,286.15296204753,292.28481123426,294.32876096318,299.00064605783,304.4370214407,314.76825825228,318.85615771011,322.00069575458,327.03195662575,334.88072358477,341.71502406609,343.38355445704,345.42750418595,348.83408706747,359.73515228832,368.0007951481,371.99885066179,380.54627680087,392.4383479509,396.30854862103,400.61414686654,408.78994578219,418.60090448096,425.14154361347,429.33426100611,434.91003062957,449.66894036041,457.84473927605,465.11211608996,468.3646483703,478.40103369253,490.54793493862,494.63583439645,507.3950357345,515.20111320734,523.2511306012],"description":"13-limit Binary products and quotients. Chalmers '96"},"prog_ennea":{"frequencies":[261.6255653006,269.29177952703,285.30470202322,311.12698372208,349.22823143301,391.99543598175,403.48177901006,427.47405410759,466.16376151809,523.2511306012],"description":"Progressive Enneatonic, 50+100+150+200 cents in each half (500 cents)"},"prog_ennea1":{"frequencies":[261.6255653006,269.10058145205,285.40970760065,310.68035879446,348.83408706747,392.4383479509,404.33041910093,428.11456140098,465.11211608996,523.2511306012],"description":"Progressive Enneatonic, appr. 50+100+150+200 cents in each half (500 cents)"},"prog_ennea2":{"frequencies":[261.6255653006,269.55361273395,285.40970760065,321.08592105074,348.83408706747,392.4383479509,404.33041910093,428.11456140098,481.6288815761,523.2511306012],"description":"Progressive Enneatonic, appr. 50+100+200+150 cents in each half (500 cents)"},"prog_ennea3":{"frequencies":[261.6255653006,269.55361273395,285.40970760065,310.07474405997,348.83408706747,392.4383479509,404.33041910093,428.11456140098,465.11211608996,523.2511306012],"description":"Progressive Enneatonic, appr. 50+100+150+200 cents in each half (500 cents)"},"prooijen1":{"frequencies":[261.6255653006,339.14425131559,366.27579142084,436.04260883433,470.92601754108,610.45965236807,726.73768139056,784.8766959018],"description":"Kees van Prooijen, major mode of Bohlen-Pierce"},"prooijen2":{"frequencies":[261.6255653006,311.45900631024,336.37572681506,436.04260883433,470.92601754108,560.62621135843,726.73768139056,784.8766959018],"description":"Kees van Prooijen, minor mode of Bohlen-Pierce"},"ps-dorian":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,348.83408706747,392.4383479509,490.54793493862,504.56359022259,523.2511306012],"description":"Complex 4 of p. 115 based on Archytas's Enharmonic"},"ps-enh":{"frequencies":[261.6255653006,266.38239376061,279.06726965397,348.83408706747,392.4383479509,399.57359064092,418.60090448096,523.2511306012],"description":"Dorian mode of an Enharmonic genus found in Ptolemy's Harmonics"},"ps-hypod":{"frequencies":[261.6255653006,294.32876096318,367.91095120397,378.42269266694,392.4383479509,406.97310157871,418.60090448096,523.2511306012],"description":"Complex 7 of p. 115 based on Archytas's Enharmonic"},"ps-hypod2":{"frequencies":[261.6255653006,294.32876096318,305.22982618403,313.95067836072,392.4383479509,490.54793493862,504.56359022259,523.2511306012],"description":"Complex 8 of p. 115 based on Archytas's Enharmonic"},"ps-mixol":{"frequencies":[261.6255653006,271.31540105247,279.06726965397,348.83408706747,436.04260883433,448.50096908674,465.11211608996,523.2511306012],"description":"Complex 3 of p. 115 based on Archytas's Enharmonic"},"ptolemy":{"frequencies":[261.6255653006,294.32876096318,327.03195662575,348.83408706747,392.4383479509,436.04260883433,490.54793493862,523.2511306012],"description":"Intense Diatonic Syntonon, also Zarlino's scale"},"ptolemy_chrom":{"frequencies":[261.6255653006,271.31540105247,290.69507255622,348.83408706747,392.4383479509,406.97310157871,436.04260883433,523.2511306012],"description":"Ptolemy Soft Chromatic"},"ptolemy_ddiat":{"frequencies":[261.6255653006,271.31540105247,310.07474405997,348.83408706747,392.4383479509,413.43299207996,465.11211608996,523.2511306012],"description":"Lyra tuning, Dorian mode, comb. of diatonon toniaion & diatonon ditoniaion"},"ptolemy_diat":{"frequencies":[261.6255653006,290.69507255622,313.95067836072,348.83408706747,392.4383479509,436.04260883433,470.92601754108,523.2511306012],"description":"Ptolemy's Diatonon Ditoniaion & Archytas' Diatonic, also Lyra tuning"},"ptolemy_diat2":{"frequencies":[261.6255653006,271.31540105247,305.22982618403,348.83408706747,392.4383479509,406.97310157871,457.84473927605,523.2511306012],"description":"Dorian mode of a permutation of Ptolemy's Tonic Diatonic"},"ptolemy_diat3":{"frequencies":[261.6255653006,294.32876096318,313.95067836072,348.83408706747,392.4383479509,441.49314144476,470.92601754108,523.2511306012],"description":"Dorian mode of the remaining permutation of Ptolemy's Intense Diatonic"},"ptolemy_diat4":{"frequencies":[261.6255653006,299.00064605783,310.07474405997,348.83408706747,392.4383479509,448.50096908674,465.11211608996,523.2511306012],"description":"permuted Ptolemy's diatonic"},"ptolemy_diat5":{"frequencies":[261.6255653006,271.31540105247,310.07474405997,348.83408706747,392.4383479509,406.97310157871,465.11211608996,523.2511306012],"description":"Sterea lyra, Dorian, comb. of 2 Tonic Diatonic 4chords, also Archytas' diatonic"},"ptolemy_diff":{"frequencies":[261.6255653006,294.32876096318,327.03195662575,343.38355445704,392.4383479509,425.14154361347,490.54793493862,523.2511306012],"description":"Difference tones of Intense Diatonic reduced by 2/1"},"ptolemy_enh":{"frequencies":[261.6255653006,267.43946675172,279.06726965397,348.83408706747,392.4383479509,401.15920012759,418.60090448096,523.2511306012],"description":"Dorian mode of Ptolemy's Enharmonic"},"ptolemy_exp":{"frequencies":[261.6255653006,272.52663052146,275.93321340298,287.4304306281,290.69507255622,294.32876096318,306.59245933664,327.03195662575,340.65828815182,344.91651675372,348.83408706747,363.36884069528,367.91095120397,383.2405741708,392.4383479509,408.78994578219,413.89982010446,431.14564594215,436.04260883433,441.49314144476,459.88868900496,490.54793493862,510.98743222773,517.37477513058,523.2511306012],"description":"Intense Diatonic expanded: all interval combinations"},"ptolemy_hom":{"frequencies":[261.6255653006,285.40970760065,313.95067836072,348.83408706747,392.4383479509,428.11456140098,470.92601754108,523.2511306012],"description":"Dorian mode of Ptolemy's Equable Diatonic or Diatonon Homalon"},"ptolemy_iast":{"frequencies":[261.6255653006,271.31540105247,310.07474405997,348.83408706747,392.4383479509,418.60090448096,470.92601754108,523.2511306012],"description":"Ptolemy's Iastia or Lydia tuning, mixture of Tonic Diatonic & Intense Diatonic"},"ptolemy_iastaiol":{"frequencies":[261.6255653006,271.31540105247,310.07474405997,348.83408706747,392.4383479509,441.49314144476,465.11211608996,523.2511306012],"description":"Ptolemy's kithara tuning, mixture of Tonic Diatonic and Ditone Diatonic"},"ptolemy_ichrom":{"frequencies":[261.6255653006,274.08392555301,299.00064605783,348.83408706747,392.4383479509,411.12588832951,448.50096908674,523.2511306012],"description":"Dorian mode of Ptolemy's Intense Chromatic"},"ptolemy_idiat":{"frequencies":[261.6255653006,279.06726965397,313.95067836072,348.83408706747,392.4383479509,418.60090448096,470.92601754108,523.2511306012],"description":"Dorian mode of Ptolemy's Intense Diatonic (Diatonon Syntonon)"},"ptolemy_imix":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,313.95067836072,327.03195662575,348.83408706747,392.4383479509,418.60090448096,436.04260883433,465.11211608996,490.54793493862,523.2511306012],"description":"Ptolemy Intense Diatonic mixed with its inverse"},"ptolemy_malak":{"frequencies":[261.6255653006,274.08392555301,299.00064605783,348.83408706747,392.4383479509,406.97310157871,465.11211608996,523.2511306012],"description":"Ptolemy's Malaka lyra tuning, a mixture of Intense Chrom. & Tonic Diatonic"},"ptolemy_malak2":{"frequencies":[261.6255653006,271.31540105247,290.69507255622,348.83408706747,392.4383479509,406.97310157871,465.11211608996,523.2511306012],"description":"Malaka lyra, mixture of his Soft Chromatic and Tonic Diatonic."},"ptolemy_mdiat":{"frequencies":[261.6255653006,274.70684356563,305.22982618403,348.83408706747,392.4383479509,412.06026534844,457.84473927605,523.2511306012],"description":"Ptolemy soft diatonic"},"ptolemy_mdiat2":{"frequencies":[261.6255653006,290.69507255622,305.22982618403,348.83408706747,392.4383479509,436.04260883433,457.84473927605,523.2511306012],"description":"permuted Ptolemy soft diatonic"},"ptolemy_mdiat3":{"frequencies":[261.6255653006,299.00064605783,313.95067836072,348.83408706747,392.4383479509,448.50096908674,470.92601754108,523.2511306012],"description":"permuted Ptolemy soft diatonic"},"ptolemy_meta":{"frequencies":[261.6255653006,274.70684356563,305.22982618403,348.83408706747,392.4383479509,406.97310157871,465.11211608996,523.2511306012],"description":"Metabolika lyra tuning, mixture of Soft Diatonic & Tonic Diatonic"},"ptolemy_mix":{"frequencies":[261.6255653006,279.06726965397,290.69507255622,294.32876096318,310.07474405997,313.95067836072,327.03195662575,348.83408706747,353.19451315581,367.91095120397,372.08969287196,387.59343007496,392.4383479509,418.60090448096,436.04260883433,441.49314144476,465.11211608996,470.92601754108,490.54793493862,523.2511306012],"description":"All modes of Ptolemy Intense Diatonic mixed"},"ptolemy_prod":{"frequencies":[261.6255653006,272.52663052146,275.93321340298,279.06726965397,290.69507255622,294.32876096318,313.95067836072,327.03195662575,331.11985608357,348.83408706747,363.36884069528,367.91095120397,372.08969287196,387.59343007496,392.4383479509,418.60090448096,436.04260883433,441.49314144476,465.11211608996,484.4917875937,490.54793493862,523.2511306012],"description":"Product of Intense Diatonic with its intervals"},"ptolemy_tree":{"frequencies":[261.6255653006,294.32876096318,299.00064605783,305.22982618403,313.95067836072,327.03195662575,348.83408706747,392.4383479509,436.04260883433,457.84473927605,470.92601754108,479.64686971777,485.87604984397,490.54793493862,523.2511306012],"description":"Intense Diatonic with all their Farey parent fractions"},"pygmie":{"frequencies":[261.6255653006,299.00064605783,343.38355445704,392.4383479509,457.84473927605,523.2511306012],"description":"Pygmie scale"},"pyle":{"frequencies":[261.6255653006,277.19063644077,293.6461094938,311.15753660095,329.66944764997,349.23831768549,369.99228554622,391.93430587921,415.28070933274,439.96441988338,466.23108306565,493.99742571239,523.2511306012],"description":"Howard Willet Pyle quasi equal temperament"},"pyramid":{"frequencies":[261.6255653006,294.32876096318,306.59245933664,327.03195662575,348.83408706747,367.91095120397,392.4383479509,408.78994578219,436.04260883433,441.49314144476,465.11211608996,490.54793493862,523.2511306012],"description":"This scale may also be called the \"Wedding Cake\""},"pyramid_down":{"frequencies":[261.6255653006,279.06726965397,294.32876096318,313.95067836072,334.88072358477,348.83408706747,392.4383479509,418.60090448096,441.49314144476,465.11211608996,470.92601754108,502.32108537715,523.2511306012],"description":"Upside-Down Wedding Cake (divorce cake)"},"pyth_12":{"frequencies":[261.6255653006,279.38237857051,294.32876096318,310.07474405997,331.11985608357,348.83408706747,372.50983809402,392.4383479509,419.07356785577,441.49314144476,465.11211608996,496.67978412536,523.2511306012],"description":"12-tone Pythagorean scale"},"pyth_12s":{"frequencies":[261.6255653006,279.38237857051,294.32876096318,314.30517589183,326.6631048533,348.83408706747,367.49599295996,392.4383479509,419.07356785577,435.55080647107,471.45776383774,489.99465727995,523.2511306012],"description":"Scale with major thirds flat by a schisma"},"pyth_17":{"frequencies":[261.6255653006,275.62199471997,279.38237857051,294.32876096318,310.07474405997,314.30517589183,331.11985608357,348.83408706747,367.49599295996,372.50983809402,392.4383479509,413.43299207996,419.07356785577,441.49314144476,465.11211608996,471.45776383774,496.67978412536,523.2511306012],"description":"17-tone Pythagorean scale"},"pyth_17s":{"frequencies":[261.6255653006,275.62199471997,279.06726965397,294.32876096318,310.07474405997,313.95067836072,331.11985608357,348.83408706747,367.49599295996,372.08969287196,392.4383479509,413.43299207996,418.60090448096,441.49314144476,465.11211608996,470.92601754108,496.67978412536,523.2511306012],"description":"Schismatically altered 17-tone Pythagorean scale"},"pyth_22":{"frequencies":[261.6255653006,275.62199471997,279.38237857051,290.36720431405,294.32876096318,310.07474405997,314.30517589183,326.6631048533,331.11985608357,348.83408706747,353.59332287831,367.49599295996,372.50983809402,392.4383479509,413.43299207996,419.07356785577,435.55080647107,441.49314144476,465.11211608996,471.45776383774,489.99465727995,496.67978412536,523.2511306012],"description":"Pythagorean shrutis"},"pyth_27":{"frequencies":[261.6255653006,265.19499215873,275.62199471997,279.38237857051,290.36720431405,294.32876096318,298.34436617857,310.07474405997,314.30517589183,326.6631048533,331.11985608357,348.83408706747,353.59332287831,367.49599295996,372.50983809402,387.15627241873,392.4383479509,397.79248823809,413.43299207996,419.07356785577,435.55080647107,441.49314144476,447.51654926786,465.11211608996,471.45776383774,489.99465727995,496.67978412536,523.2511306012],"description":"27-tone Pythagorean scale"},"pyth_31":{"frequencies":[261.6255653006,265.19499215873,275.62199471997,279.38237857051,283.19406633357,294.32876096318,298.34436617857,310.07474405997,314.30517589183,318.59332496145,326.6631048533,331.11985608357,335.63741195089,348.83408706747,353.59332287831,367.49599295996,372.50983809402,377.59208844475,392.4383479509,397.79248823809,413.43299207996,419.07356785577,424.79110016094,441.49314144476,447.51654926786,465.11211608996,471.45776383774,477.8899872033,489.99465727995,496.67978412536,503.45611792634,523.2511306012],"description":"31-tone Pythagorean scale"},"pyth_7a":{"frequencies":[261.6255653006,277.97716313189,294.32876096318,312.72430852337,331.11985608357,348.83408706747,370.63621750918,392.4383479509,416.96574469783,441.49314144476,469.08646278506,496.67978412536,523.2511306012],"description":"Pythagorean 7-tone with whole tones divided arithmetically"},"pyth_7h":{"frequencies":[261.6255653006,277.01530443593,294.32876096318,311.64221749042,331.11985608357,348.83408706747,369.35373924791,392.4383479509,415.52295665389,441.49314144476,467.46332623563,496.67978412536,523.2511306012],"description":"Pythagorean 7-tone with whole tones divided harmonically"},"pyth_chrom":{"frequencies":[261.6255653006,275.62199471997,294.32876096318,348.83408706747,392.4383479509,413.43299207996,441.49314144476,465.11211608996,523.2511306012],"description":"Dorian mode of the so-called Pythagorean chromatic, recorded by Gaudentius"},"pyth_sev":{"frequencies":[261.6255653006,268.38018042036,275.30918532257,282.41708286353,291.47537246454,299.00064605783,306.7202061947,314.63906894008,322.76237975718,333.11471138804,341.71502406609,350.53737850823,359.58750736009,368.87129039875,380.70252730062,390.53145607553,400.61414686654,410.95715126868,421.56719060242,435.08860262928,446.32166408632,457.84473927605,469.66531573563,481.7910743145,497.2441172906,510.08190181294,523.2511306012],"description":"26-tone Pythagorean scale based on 7/4"},"pyth_sev_16":{"frequencies":[261.6255653006,268.38018042036,275.30918532257,282.41708286353,306.7202061947,314.63906894008,322.76237975718,350.53737850823,359.58750736009,368.87129039875,400.61414686654,410.95715126868,421.56719060242,457.84473927605,469.66531573563,481.7910743145,523.2511306012],"description":"16-tone Pythagorean scale based on 7/4, \"Armodue\""},"pyth_third":{"frequencies":[261.6255653006,267.90457886781,274.33428876064,280.9183116909,287.66035117148,290.46272611903,297.43383186155,304.57224382623,311.88197767806,319.36714514233,327.03195662575,334.88072358477,342.9178609508,351.14788961362,359.57543896435,363.07840893547,371.79228894479,380.71530478279,389.85247209758,399.20893142792,408.78994578219,418.60090448096,428.6473261885,438.93486201703,449.46929870544,453.84801015616,464.74036282794,475.89413097849,487.31559012197,499.0111642849,510.98743222773,523.2511306012],"description":"Cycle of 5/4 thirds"}} - - - diff --git a/docs/dist/tunes.js b/docs/dist/tunes.js deleted file mode 100644 index 17017200..00000000 --- a/docs/dist/tunes.js +++ /dev/null @@ -1,632 +0,0 @@ -export const timeCatMini = `stack( - "c3@3 [eb3, g3, [c4 d4]/2]", - "c2 g2", - "[eb4@5 [f4 eb4 d4]@3] [eb4 c4]/2".slow(8) -)`; -export const timeCat = `stack( - timeCat([3, c3], [1, stack(eb3, g3, cat(c4, d4).slow(2))]), - cat(c2, g2), - sequence( - timeCat([5, eb4], [3, cat(f4, eb4, d4)]), - cat(eb4, c4).slow(2) - ).slow(4) -)`; -export const shapeShifted = `stack( - sequence( - e5, [b4, c5], d5, [c5, b4], - a4, [a4, c5], e5, [d5, c5], - b4, [r, c5], d5, e5, - c5, a4, a4, r, - [r, d5], [r, f5], a5, [g5, f5], - e5, [r, c5], e5, [d5, c5], - b4, [b4, c5], d5, e5, - c5, a4, a4, r, - ).rev(), - sequence( - e2, e3, e2, e3, e2, e3, e2, e3, - a2, a3, a2, a3, a2, a3, a2, a3, - gs2, gs3, gs2, gs3, e2, e3, e2, e3, - a2, a3, a2, a3, a2, a3, b1, c2, - d2, d3, d2, d3, d2, d3, d2, d3, - c2, c3, c2, c3, c2, c3, c2, c3, - b1, b2, b1, b2, e2, e3, e2, e3, - a1, a2, a1, a2, a1, a2, a1, a2, - ).rev() -).slow(16)`; -export const tetrisWithFunctions = `stack(sequence( - 'e5', sequence('b4', 'c5'), 'd5', sequence('c5', 'b4'), - 'a4', sequence('a4', 'c5'), 'e5', sequence('d5', 'c5'), - 'b4', sequence(silence, 'c5'), 'd5', 'e5', - 'c5', 'a4', 'a4', silence, - sequence(silence, 'd5'), sequence(silence, 'f5'), 'a5', sequence('g5', 'f5'), - 'e5', sequence(silence, 'c5'), 'e5', sequence('d5', 'c5'), - 'b4', sequence('b4', 'c5'), 'd5', 'e5', - 'c5', 'a4', 'a4', silence), - sequence( - 'e2', 'e3', 'e2', 'e3', 'e2', 'e3', 'e2', 'e3', - 'a2', 'a3', 'a2', 'a3', 'a2', 'a3', 'a2', 'a3', - 'g#2', 'g#3', 'g#2', 'g#3', 'e2', 'e3', 'e2', 'e3', - 'a2', 'a3', 'a2', 'a3', 'a2', 'a3', 'b1', 'c2', - 'd2', 'd3', 'd2', 'd3', 'd2', 'd3', 'd2', 'd3', - 'c2', 'c3', 'c2', 'c3', 'c2', 'c3', 'c2', 'c3', - 'b1', 'b2', 'b1', 'b2', 'e2', 'e3', 'e2', 'e3', - 'a1', 'a2', 'a1', 'a2', 'a1', 'a2', 'a1', 'a2', - ) -).slow(16)`; -export const tetris = `stack( - cat( - "e5 [b4 c5] d5 [c5 b4]", - "a4 [a4 c5] e5 [d5 c5]", - "b4 [~ c5] d5 e5", - "c5 a4 a4 ~", - "[~ d5] [~ f5] a5 [g5 f5]", - "e5 [~ c5] e5 [d5 c5]", - "b4 [b4 c5] d5 e5", - "c5 a4 a4 ~" - ), - cat( - "e2 e3 e2 e3 e2 e3 e2 e3", - "a2 a3 a2 a3 a2 a3 a2 a3", - "g#2 g#3 g#2 g#3 e2 e3 e2 e3", - "a2 a3 a2 a3 a2 a3 b1 c2", - "d2 d3 d2 d3 d2 d3 d2 d3", - "c2 c3 c2 c3 c2 c3 c2 c3", - "b1 b2 b1 b2 e2 e3 e2 e3", - "a1 a2 a1 a2 a1 a2 a1 a2", - ) -).slow(16)`; -export const tetrisMini = `\`[[e5 [b4 c5] d5 [c5 b4]] -[a4 [a4 c5] e5 [d5 c5]] -[b4 [~ c5] d5 e5] -[c5 a4 a4 ~] -[[~ d5] [~ f5] a5 [g5 f5]] -[e5 [~ c5] e5 [d5 c5]] -[b4 [b4 c5] d5 e5] -[c5 a4 a4 ~]], -[[e2 e3]*4] -[[a2 a3]*4] -[[g#2 g#3]*2 [e2 e3]*2] -[a2 a3 a2 a3 a2 a3 b1 c2] -[[d2 d3]*4] -[[c2 c3]*4] -[[b1 b2]*2 [e2 e3]*2] -[[a1 a2]*4]\`.slow(16) -`; -export const whirlyStrudel = `sequence(e4, [b2, b3], c4) -.every(4, fast(2)) -.every(3, slow(1.5)) -.fast(slowcat(1.25, 1, 1.5)) -.every(2, _ => sequence(e4, r, e3, d4, r))`; -export const swimming = `stack( - cat( - "~", - "~", - "~", - "A5 [F5@2 C5] [D5@2 F5] F5", - "[C5@2 F5] [F5@2 C6] A5 G5", - "A5 [F5@2 C5] [D5@2 F5] F5", - "[C5@2 F5] [Bb5 A5 G5] F5@2", - "A5 [F5@2 C5] [D5@2 F5] F5", - "[C5@2 F5] [F5@2 C6] A5 G5", - "A5 [F5@2 C5] [D5@2 F5] F5", - "[C5@2 F5] [Bb5 A5 G5] F5@2", - "A5 [F5@2 C5] A5 F5", - "Ab5 [F5@2 Ab5] G5@2", - "A5 [F5@2 C5] A5 F5", - "Ab5 [F5@2 C5] C6@2", - "A5 [F5@2 C5] [D5@2 F5] F5", - "[C5@2 F5] [Bb5 A5 G5] F5@2" - ), - cat( - "[F4,Bb4,D5] [[D4,G4,Bb4]@2 [Bb3,D4,F4]] [[G3,C4,E4]@2 [[Ab3,F4] [A3,Gb4]]] [Bb3,E4,G4]", - "[~ [F3, A3, C3] [F3, A3, C3]] [~ [F3, A3, C3] [F3, A3, C3]] [~ [F3, Bb3, D3] [F3, Bb3, D3]] [~ [F3, Bb3, Db3] [F3, Bb3, Db3]]", - "[~ [F3, A3, C3] [F3, A3, C3]] [~ [F3, A3, C3] [F3, A3, C3]] [~ [F3, Bb3, D3] [F3, Bb3, D3]] [~ [F3, B3, D3] [F3, B3, D3]]", - "[~ [F3, A3, C3] [F3, A3, C3]] [~ [F3, A3, C3] [F3, A3, C3]] [~ [F3, Bb3, D3] [F3, Bb3, D3]] [~ [F3, B3, D3] [F3, B3, D3]]", - "[~ [A3, C4, E4] [A3, C4, E4]] [~ [Ab3, C4, Eb4] [Ab3, C4, Eb4]] [~ [F3, Bb3, D3] [F3, Bb3, D3]] [~ [G3, C4, E4] [G3, C4, E4]]", - "[~ [F3, A3, C4] [F3, A3, C4]] [~ [F3, A3, C4] [F3, A3, C4]] [~ [F3, Bb3, D3] [F3, Bb3, D3]] [~ [F3, B3, D3] [F3, B3, D3]]", - "[~ [F3, Bb3, D4] [F3, Bb3, D4]] [~ [F3, Bb3, C4] [F3, Bb3, C4]] [~ [F3, A3, C4] [F3, A3, C4]] [~ [F3, A3, C4] [F3, A3, C4]]", - "[~ [F3, A3, C3] [F3, A3, C3]] [~ [F3, A3, C3] [F3, A3, C3]] [~ [F3, Bb3, D3] [F3, Bb3, D3]] [~ [F3, B3, D3] [F3, B3, D3]]", - "[~ [A3, C4, E4] [A3, C4, E4]] [~ [Ab3, C4, Eb4] [Ab3, C4, Eb4]] [~ [F3, Bb3, D3] [F3, Bb3, D3]] [~ [G3, C4, E4] [G3, C4, E4]]", - "[~ [F3, A3, C3] [F3, A3, C3]] [~ [F3, A3, C3] [F3, A3, C3]] [~ [F3, Bb3, D3] [F3, Bb3, D3]] [~ [F3, B3, D3] [F3, B3, D3]]", - "[~ [F3, Bb3, D4] [F3, Bb3, D4]] [~ [F3, Bb3, C4] [F3, Bb3, C4]] [~ [F3, A3, C4] [F3, A3, C4]] [~ [F3, A3, C4] [F3, A3, C4]]", - "[~ [Bb3, D3, F4] [Bb3, D3, F4]] [~ [Bb3, D3, F4] [Bb3, D3, F4]] [~ [A3, C4, F4] [A3, C4, F4]] [~ [A3, C4, F4] [A3, C4, F4]]", - "[~ [Ab3, B3, F4] [Ab3, B3, F4]] [~ [Ab3, B3, F4] [Ab3, B3, F4]] [~ [G3, Bb3, F4] [G3, Bb3, F4]] [~ [G3, Bb3, E4] [G3, Bb3, E4]]", - "[~ [Bb3, D3, F4] [Bb3, D3, F4]] [~ [Bb3, D3, F4] [Bb3, D3, F4]] [~ [A3, C4, F4] [A3, C4, F4]] [~ [A3, C4, F4] [A3, C4, F4]]", - "[~ [Ab3, B3, F4] [Ab3, B3, F4]] [~ [Ab3, B3, F4] [Ab3, B3, F4]] [~ [G3, Bb3, F4] [G3, Bb3, F4]] [~ [G3, Bb3, E4] [G3, Bb3, E4]]", - "[~ [F3, A3, C3] [F3, A3, C3]] [~ [F3, A3, C3] [F3, A3, C3]] [~ [F3, Bb3, D3] [F3, Bb3, D3]] [~ [F3, B3, D3] [F3, B3, D3]]", - "[~ [F3, Bb3, D4] [F3, Bb3, D4]] [~ [F3, Bb3, C4] [F3, Bb3, C4]] [~ [F3, A3, C4] [F3, A3, C4]] [~ [F3, A3, C4] [F3, A3, C4]]" - ), - cat( - "[G3 G3 C3 E3]", - "[F2 D2 G2 C2]", - "[F2 D2 G2 C2]", - "[F2 A2 Bb2 B2]", - "[A2 Ab2 G2 C2]", - "[F2 A2 Bb2 B2]", - "[G2 C2 F2 F2]", - "[F2 A2 Bb2 B2]", - "[A2 Ab2 G2 C2]", - "[F2 A2 Bb2 B2]", - "[G2 C2 F2 F2]", - "[Bb2 Bb2 A2 A2]", - "[Ab2 Ab2 G2 [C2 D2 E2]]", - "[Bb2 Bb2 A2 A2]", - "[Ab2 Ab2 G2 [C2 D2 E2]]", - "[F2 A2 Bb2 B2]", - "[G2 C2 F2 F2]" - ) -).slow(51); -`; -export const giantSteps = `stack( - // melody - cat( - "[F#5 D5] [B4 G4] Bb4 [B4 A4]", - "[D5 Bb4] [G4 Eb4] F#4 [G4 F4]", - "Bb4 [B4 A4] D5 [D#5 C#5]", - "F#5 [G5 F5] Bb5 [F#5 F#5]", - ), - // chords - cat( - "[B^7 D7] [G^7 Bb7] Eb^7 [Am7 D7]", - "[G^7 Bb7] [Eb^7 F#7] B^7 [Fm7 Bb7]", - "Eb^7 [Am7 D7] G^7 [C#m7 F#7]", - "B^7 [Fm7 Bb7] Eb^7 [C#m7 F#7]" - ).voicings(['E3', 'G4']), - // bass - cat( - "[B2 D2] [G2 Bb2] [Eb2 Bb3] [A2 D2]", - "[G2 Bb2] [Eb2 F#2] [B2 F#2] [F2 Bb2]", - "[Eb2 Bb2] [A2 D2] [G2 D2] [C#2 F#2]", - "[B2 F#2] [F2 Bb2] [Eb2 Bb3] [C#2 F#2]" - ) -).slow(20);`; -export const giantStepsReggae = `stack( - // melody - cat( - "[F#5 D5] [B4 G4] Bb4 [B4 A4]", - "[D5 Bb4] [G4 Eb4] F#4 [G4 F4]", - "Bb4 [B4 A4] D5 [D#5 C#5]", - "F#5 [G5 F5] Bb5 [F#5 [F#5 ~@3]]", - ), - // chords - cat( - "[B^7 D7] [G^7 Bb7] Eb^7 [Am7 D7]", - "[G^7 Bb7] [Eb^7 F#7] B^7 [Fm7 Bb7]", - "Eb^7 [Am7 D7] G^7 [C#m7 F#7]", - "B^7 [Fm7 Bb7] Eb^7 [C#m7 F#7]" - ) - .struct("~ [x ~]".fast(4*8)) - .voicings(['E3', 'G4']), - // bass - cat( - "[B2 D2] [G2 D2] [Eb2 Bb2] [A2 D2]", - "[G2 Bb2] [Eb2 F#2] [B2 F#2] [F2 Bb2]", - "[Eb2 Bb2] [A2 D2] [G2 D2] [C#2 F#2]", - "[B2 F#2] [F2 Bb2] [Eb2 Bb2] [C#2 F#2]" - ) - .struct("x ~".fast(4*8)) -).slow(25)`; -export const transposedChordsHacked = `stack( - "c2 eb2 g2", - "Cm7".voicings(['g2','c4']).slow(2) -).transpose( - slowcat(1, 2, 3, 2).slow(2) -).transpose(5)`; -export const scaleTranspose = `stack(f2, f3, c4, ab4) -.scale(sequence('F minor', 'F harmonic minor').slow(4)) -.scaleTranspose(sequence(0, -1, -2, -3).slow(4)) -.transpose(sequence(0, 1).slow(16))`; -export const struct = `stack( - "c2 g2 a2 [e2@2 eb2] d2 a2 g2 [d2 ~ db2]", - "[C^7 A7] [Dm7 G7]".struct("[x@2 x] [~@2 x] [~ x@2]@2 [x ~@2] ~ [~@2 x@4]@2") - .voicings(['G3','A4']) -).slow(4)`; -export const magicSofa = `stack( - " " - .every(2, fast(2)) - .voicings(), - " " -).slow(1).transpose(slowcat(0, 2, 3, 4))`; -export const confusedPhone = `"[g2 ~@1.3] [c3 ~@1.3]" -.superimpose( - transpose(-12).late(0), - transpose(7).late(0.1), - transpose(10).late(0.2), - transpose(12).late(0.3), - transpose(24).late(0.4) -) -.scale(slowcat('C dorian', 'C mixolydian')) -.scaleTranspose(slowcat(0,1,2,1)) -.slow(2)`; -export const zeldasRescue = `stack( - // melody - \`[B3@2 D4] [A3@2 [G3 A3]] [B3@2 D4] [A3] - [B3@2 D4] [A4@2 G4] [D4@2 [C4 B3]] [A3] - [B3@2 D4] [A3@2 [G3 A3]] [B3@2 D4] [A3] - [B3@2 D4] [A4@2 G4] D5@2 - [D5@2 [C5 B4]] [[C5 B4] G4@2] [C5@2 [B4 A4]] [[B4 A4] E4@2] - [D5@2 [C5 B4]] [[C5 B4] G4 C5] [G5] [~ ~ B3]\`, - // bass - \`[[C2 G2] E3@2] [[C2 G2] F#3@2] [[C2 G2] E3@2] [[C2 G2] F#3@2] - [[B1 D3] G3@2] [[Bb1 Db3] G3@2] [[A1 C3] G3@2] [[D2 C3] F#3@2] - [[C2 G2] E3@2] [[C2 G2] F#3@2] [[C2 G2] E3@2] [[C2 G2] F#3@2] - [[B1 D3] G3@2] [[Bb1 Db3] G3@2] [[A1 C3] G3@2] [[D2 C3] F#3@2] - [[F2 C3] E3@2] [[E2 B2] D3@2] [[D2 A2] C3@2] [[C2 G2] B2@2] - [[F2 C3] E3@2] [[E2 B2] D3@2] [[Eb2 Bb2] Db3@2] [[D2 A2] C3 [F3,G2]]\` -).transpose(12).slow(48).tone( - new PolySynth().chain( - new Gain(0.3), - new Chorus(2, 2.5, 0.5).start(), - new Freeverb(), - getDestination()) -)`; -export const technoDrums = `stack( - "c1*2".tone(new Tone.MembraneSynth().toDestination()), - "~ x".tone(new Tone.NoiseSynth().toDestination()), - "[~ c4]*2".tone(new Tone.MetalSynth().set({envelope:{decay:0.06,sustain:0}}).chain(new Gain(0.5),getDestination())) -)`; -export const loungerave = `const delay = new FeedbackDelay(1/8, .2).chain(vol(0.5), out()); -const kick = new MembraneSynth().chain(vol(.8), out()); -const snare = new NoiseSynth().chain(vol(.8), out()); -const hihat = new MetalSynth().set(adsr(0, .08, 0, .1)).chain(vol(.3).connect(delay),out()); -const bass = new Synth().set({ ...osc('sawtooth'), ...adsr(0, .1, .4) }).chain(lowpass(900), vol(.5), out()); -const keys = new PolySynth().set({ ...osc('sawtooth'), ...adsr(0, .5, .2, .7) }).chain(lowpass(1200), vol(.5), out()); - -const drums = stack( - "c1*2".tone(kick).mask("/8"), - "~ ".tone(snare).mask("/4"), - "[~ c4]*2".tone(hihat) -); - -const thru = (x) => x.transpose("<0 1>/8").transpose(1); -const synths = stack( - "/2".struct("[x [~ x] <[~ [~ x]]!3 [x x]>@2]/2").edit(thru).tone(bass), - "/2".struct("~ [x@0.1 ~]").voicings().edit(thru).every(2, early(1/4)).tone(keys).mask("/8".early(1/4)) -) -stack( - drums, - synths -)`; -export const caverave = `const delay = new FeedbackDelay(1/8, .4).chain(vol(0.5), out()); -const kick = new MembraneSynth().chain(vol(.8), out()); -const snare = new NoiseSynth().chain(vol(.8), out()); -const hihat = new MetalSynth().set(adsr(0, .08, 0, .1)).chain(vol(.3).connect(delay),out()); -const bass = new Synth().set({ ...osc('sawtooth'), ...adsr(0, .1, .4) }).chain(lowpass(900), vol(.5), out()); -const keys = new PolySynth().set({ ...osc('sawtooth'), ...adsr(0, .5, .2, .7) }).chain(lowpass(1200), vol(.5), out()); - -const drums = stack( - "c1*2".tone(kick).mask("/8"), - "~ ".tone(snare).mask("/4"), - "[~ c4]*2".tone(hihat) -); - -const thru = (x) => x.transpose("<0 1>/8").transpose(-1); -const synths = stack( - "/2".scale(timeCat([3,'C minor'],[1,'C melodic minor']).slow(8)).struct("[~ x]*2") - .edit( - scaleTranspose(0).early(0), - scaleTranspose(2).early(1/8), - scaleTranspose(7).early(1/4), - scaleTranspose(8).early(3/8) - ).apply(thru).tone(keys).mask("<~ x>/16"), - "/2".struct("[x [~ x] <[~ [~ x]]!3 [x x]>@2]/2".fast(2)).apply(thru).tone(bass), - "/2".struct("~ [x@0.1 ~]".fast(2)).voicings().apply(thru).every(2, early(1/8)).tone(keys).mask("/8".early(1/4)) -) -stack( - drums.fast(2), - synths -).slow(2)`; -export const callcenterhero = `const bpm = 90; -const lead = polysynth().set({...osc('sine4'),...adsr(.004)}).chain(vol(0.15),out()) -const bass = fmsynth({...osc('sawtooth6'),...adsr(0.05,.6,0.8,0.1)}).chain(vol(0.6), out()); -const s = scale(slowcat('F3 minor', 'Ab3 major', 'Bb3 dorian', 'C4 phrygian dominant').slow(4)); -stack( - "0 2".struct(" [x ~]").apply(s).scaleTranspose(stack(0,2)).tone(lead), - "<6 7 9 7>".struct("[~ [x ~]*2]*2").apply(s).scaleTranspose("[0,2] [2,4]".fast(2).every(4,rev)).tone(lead), - "-14".struct("[~ x@0.8]*2".early(0.01)).apply(s).tone(bass), - "c2*2".tone(membrane().chain(vol(0.6), out())), - "~ c2".tone(noise().chain(vol(0.2), out())), - "c4*4".tone(metal(adsr(0,.05,0)).chain(vol(0.03), out())) -) -.slow(120 / bpm)`; -export const primalEnemy = `const f = fast("<1 <2 [4 8]>>"); -stack( - "c3,g3,c4".struct("[x ~]*2").apply(f).transpose("<0 <3 [5 [7 [9 [11 13]]]]>>"), - "c2 [c2 ~]*2".tone(synth(osc('sawtooth8')).chain(vol(0.8),out())), - "c1*2".tone(membrane().chain(vol(0.8),out())) -).slow(1)`; -export const synthDrums = `stack( - "c1*2".tone(membrane().chain(vol(0.8),out())), - "~ c3".tone(noise().chain(vol(0.8),out())), - "c3*4".transpose("[-24 0]*2").tone(metal(adsr(0,.015)).chain(vol(0.8),out())) -) -`; -export const sampleDrums = `const drums = await players({ - bd: 'bd/BT0A0D0.wav', - sn: 'sn/ST0T0S3.wav', - hh: 'hh/000_hh3closedhh.wav' -}, 'https://loophole-letters.vercel.app/samples/tidal/') - -stack( - "", - "hh*4", - "~ " -).tone(drums.chain(out())) -`; -export const xylophoneCalling = `const t = x => x.scaleTranspose("<0 2 4 3>/4").transpose(-2) -const s = x => x.scale(slowcat('C3 minor pentatonic','G3 minor pentatonic').slow(4)) -const delay = new FeedbackDelay(1/8, .6).chain(vol(0.1), out()); -const chorus = new Chorus(1,2.5,0.5).start(); -stack( - // melody - "<<10 7> <8 3>>/4".struct("x*3").apply(s) - .scaleTranspose("<0 3 2> <1 4 3>") - .superimpose(scaleTranspose(2).early(1/8)) - .apply(t).tone(polysynth().set({ - ...osc('triangle4'), - ...adsr(0,.08,0) - }).chain(vol(0.2).connect(delay),chorus,out())).mask("<~@3 x>/16".early(1/8)), - // pad - "[1,3]/4".scale('G3 minor pentatonic').apply(t).tone(polysynth().set({ - ...osc('square2'), - ...adsr(0.1,.4,0.8) - }).chain(vol(0.2),chorus,out())).mask("<~ x>/32"), - // xylophone - "c3,g3,c4".struct("").fast("<1 <2!3 [4 8]>>").apply(s).scaleTranspose("<0 <1 [2 [3 <4 5>]]>>").apply(t).tone(polysynth().set({ - ...osc('sawtooth4'), - ...adsr(0,.1,0) - }).chain(vol(0.4).connect(delay),out())).mask("/16".early(1/8)), - // bass - "c2 [c2 ~]*2".scale('C hirajoshi').apply(t).tone(synth({ - ...osc('sawtooth6'), - ...adsr(0,.03,.4,.1) - }).chain(vol(0.4),out())), - // kick - "*2".tone(membrane().chain(vol(0.8),out())), - // snare - "~ ".tone(noise().chain(vol(0.8),out())), - // hihat - "c3*4".transpose("[-24 0]*2").tone(metal(adsr(0,.02)).chain(vol(0.5).connect(delay),out())) -).slow(1)`; -export const sowhatelse = `// mixer -const mix = (key) => vol({ - chords: .2, - lead: 0.8, - bass: .4, - snare: .95, - kick: .9, - hihat: .35, -}[key]||0); -const delay = new FeedbackDelay(1/6, .3).chain(vol(.7), out()); -const delay2 = new FeedbackDelay(1/6, .2).chain(vol(.15), out()); -const chorus = new Chorus(1,2.5,0.5).start(); -// instruments -const instr = (instrument) => ({ - organ: polysynth().set({...osc('sawtooth4'), ...adsr(.01,.2,0)}).chain(mix('chords').connect(delay),out()), - lead: polysynth().set({...osc('triangle4'),...adsr(0.01,.05,0)}).chain(mix('lead').connect(delay2), out()), - bass: polysynth().set({...osc('sawtooth8'),...adsr(.02,.05,.3,.2)}).chain(mix('bass'),lowpass(3000), out()), - pad: polysynth().set({...osc('square2'),...adsr(0.1,.4,0.8)}).chain(vol(0.15),chorus,out()), - hihat: metal(adsr(0, .02, 0)).chain(mix('hihat'), out()), - snare: noise(adsr(0, .15, 0.01)).chain(mix('snare'), lowpass(5000), out()), - kick: membrane().chain(mix('kick'), out()) -}[instrument]); -// harmony -const t = transpose("<0 0 1 0>/8"); -const sowhat = scaleTranspose("0,3,6,9,11"); -// track -stack( - "[<0 4 [3 [2 1]]>]/4".struct("[x]*3").mask("[~ x ~]").scale('D5 dorian').off(1/6, scaleTranspose(-7)).off(1/3, scaleTranspose(-5)).apply(t).tone(instr('lead')).mask("<~ ~ x x>/8"), - "< <[d3 ~] [c3 f3] g3>>".scale('D dorian').apply(sowhat).apply(t).tone(instr('organ')).mask("/8"), - "<[d2 [d2 ~]*3]!3 >".apply(t).tone(instr('bass')), - "c1*6".tone(instr('hihat')), - "~ c3".tone(instr('snare')), - "<[c1@5 c1] >".tone(instr('kick')), - "[2,4]/4".scale('D dorian').apply(t).tone(instr('pad')).mask("/8") -).fast(6/8)`; -export const barryHarris = `backgroundImage( - 'https://media.npr.org/assets/img/2017/02/03/barryharris_600dpi_wide-7eb49998aa1af377d62bb098041624c0a0d1a454.jpg', - {style:'background-size:cover'}) - -"0,2,[7 6]" - .add("<0 1 2 3 4 5 7 8>") - .scale('C bebop major') - .transpose("<0 1 2 1>/8") - .slow(2) - .tone((await piano()).toDestination()) -`; -export const blippyRhodes = `const delay = new FeedbackDelay(1/12, .4).chain(vol(0.3), out()); - -const drums = await players({ - bd: 'samples/tidal/bd/BT0A0D0.wav', - sn: 'samples/tidal/sn/ST0T0S3.wav', - hh: 'samples/tidal/hh/000_hh3closedhh.wav' -}, 'https://loophole-letters.vercel.app/') - -const rhodes = await sampler({ - E1: 'samples/rhodes/MK2Md2000.mp3', - E2: 'samples/rhodes/MK2Md2012.mp3', - E3: 'samples/rhodes/MK2Md2024.mp3', - E4: 'samples/rhodes/MK2Md2036.mp3', - E5: 'samples/rhodes/MK2Md2048.mp3', - E6: 'samples/rhodes/MK2Md2060.mp3', - E7: 'samples/rhodes/MK2Md2072.mp3' -}, 'https://loophole-letters.vercel.app/') - -const bass = synth(osc('sawtooth8')).chain(vol(.5),out()) -const scales = sequence('C major', 'C mixolydian', 'F lydian', ['F minor', slowcat('Db major','Db mixolydian')]).slow(4) - -stack( - " " - .tone(drums.chain(out())), - "]>" - .scale(scales) - .struct("x*8") - .scaleTranspose("0 [-5,-2] -7 [-9,-2]") - .legato(.3) - .slow(2) - .tone(rhodes.chain(vol(0.5).connect(delay), out())), - //"]>".slow(2).voicings().struct("~ x").legato(.25).tone(rhodes), - "" - .legato("<1@3 [.3 1]>") - .slow(2) - .tone(bass), -).fast(3/2)`; -export const wavyKalimba = `const delay = new FeedbackDelay(1/3, .5).chain(vol(.2), out()); -let kalimba = await sampler({ - C5: 'https://freesound.org/data/previews/536/536549_11935698-lq.mp3' -}) -kalimba = kalimba.chain(vol(0.6).connect(delay),out()); -const scales = sequence('C major', 'C mixolydian', 'F lydian', ['F minor', 'Db major']).slow(4); - -stack( - "[0 2 4 6 9 2 0 -2]*3" - .add("<0 2>/4") - .scale(scales) - .struct("x*8") - .velocity("<.8 .3 .6>*8") - .slow(2) - .tone(kalimba), - "" - .scale(scales) - .scaleTranspose("[0 <2 4>]*2") - .struct("x*4") - .velocity("<.8 .5>*4") - .velocity(0.8) - .slow(2) - .tone(kalimba) -) - .legato("<.4 .8 1 1.2 1.4 1.6 1.8 2>/8") - .fast(1)`; -export const jemblung = `const delay = new FeedbackDelay(1/8, .6).chain(vol(0.15), out()); -const snare = noise({type:'white',...adsr(0,0.2,0)}).chain(lowpass(5000),vol(1.8),out()); -const s = polysynth().set({...osc('sawtooth4'),...adsr(0.01,.2,.6,0.2)}).chain(vol(.23).connect(delay),out()); -stack( - stack( - "0 1 4 [3!2 5]".edit( - // chords - x=>x.add("0,3").duration("0.05!3 0.02"), - // bass - x=>x.add("-8").struct("x*8").duration(0.1) - ), - // melody - "12 11*3 12 ~".duration(0.005) - ) - .add("<0 1>") - .tune("jemblung2") - //.mul(22/5).round().xen("22edo") - //.mul(12/5).round().xen("12edo") - .tone(s), - // kick - "[c2 ~]*2".duration(0.05).tone(membrane().chain(out())), - // snare - "[~ c1]*2".early(0.001).tone(snare), - // hihat - "c2*8".tone(noise().chain(highpass(6000),vol(0.5).connect(delay),out())), -).slow(3)`; -export const risingEnemy = `stack( - "2,6" - .scale('F3 dorian') - .transpose(sine2.struct("x*64").slow(4).mul(2).round()) - .fast(2) - .struct("x x*3") - .legato(".9 .3"), - "0@3 -3*3".legato(".95@3 .4").scale('F2 dorian') -) - .transpose("<0 1 2 1>/2".early(0.5)) - .transpose(5) - .fast(2 / 3) - .tone((await piano()).toDestination())`; -export const festivalOfFingers = `const chords = ""; -stack( - chords.voicings().struct("x(3,8,-1)").velocity(.5).off(1/7,x=>x.transpose(12).velocity(.2)), - chords.rootNotes(2).struct("x(4,8,-2)"), - chords.rootNotes(4) - .scale(slowcat('C minor','F dorian','G dorian','F# mixolydian')) - .struct("x(3,8,-2)".fast(2)) - .scaleTranspose("0 4 0 6".early(".125 .5")).layer(scaleTranspose("0,<2 [4,6] [5,7]>/4")) -).slow(2) - .velocity(sine.struct("x*8").add(3/5).mul(2/5).fast(8)) - .tone((await piano()).chain(out()))`; -export const festivalOfFingers2 = `const chords = ""; -const scales = slowcat('C minor','F dorian','G dorian','F# mixolydian') -stack( - chords.voicings().struct("x(3,8,-1)").velocity(.5).off(1/7,x=>x.transpose(12).velocity(.2)), - chords.rootNotes(2).struct("x(4,8)"), - chords.rootNotes(4) - .scale(scales) - .struct("x(3,8,-2)".fast(2)) - .scaleTranspose("0 4 0 6".early(".125 .5")).layer(scaleTranspose("0,<2 [4,6] [5,7]>/3")) -).slow(2).transpose(-1) - .legato(cosine.struct("x*8").add(4/5).mul(4/5).fast(8)) - .velocity(sine.struct("x*8").add(3/5).mul(2/5).fast(8)) - .tone((await piano()).chain(out())).fast(3/4)`; -export const undergroundPlumber = `backgroundImage('https://images.nintendolife.com/news/2016/08/video_exploring_the_funky_inspiration_for_the_super_mario_bros_underground_theme/large.jpg',{ className:'darken' }) - -const drums = await players({ - bd: 'bd/BT0A0D0.wav', - sn: 'sn/ST0T0S3.wav', - hh: 'hh/000_hh3closedhh.wav', - cp: 'cp/HANDCLP0.wav', -}, 'https://loophole-letters.vercel.app/samples/tidal/') -stack( -"< sn> hh".fast(4).slow(2).tone(drums.chain(vol(.5),out())), - stack( - "[c2 a1 bb1 ~] ~" - .stut(2, .6, 1/16) - .legato(.4) - .slow(2) - .tone(synth({...osc('sawtooth7'),...adsr(0,.3,0)}).chain(out())), - "[g2,[c3 eb3]]".iter(4) - .stutWith(4, 1/8, (x,n)=>x.transpose(n*12).velocity(Math.pow(.4,n))) - .legato(.1) - ) - .transpose("<0@2 5 0 7 5 0 -5>/2") - -) - .fast(2/3) - .pianoroll({minMidi:21,maxMidi:180, background:'transparent',inactive:'#3F8F90',active:'#DE3123'})`; -export const bridgeIsOver = `const breaks = (await players({mad:'https://freesound.org/data/previews/22/22274_109943-lq.mp3'})).chain(out()) -stack( - stack( - "c3*2 [[c3@1.4 bb2] ab2] gb2*2 <[[gb2@1.4 ab2] bb2] gb2>".legato(".5 1".fast(2)).velocity(.8), - "0 ~".scale('c4 whole tone') - .euclidLegato(3,8).slow(2).mask("x ~") - .stutWith(8, 1/16, (x,n)=>x.scaleTranspose(n).velocity(Math.pow(.7,n))) - .scaleTranspose("<0 1 2 3 4 3 2 1>") - .fast(2) - .velocity(.7) - .legato(.5) - .stut(3, .5, 1/8) - ).transpose(-1).tone((await piano()).chain(out())), - "mad".slow(2).tone(breaks) -).cpm(78).slow(4).pianoroll() -`; -export const goodTimes = `const scale = slowcat('C3 dorian','Bb2 major').slow(4); -stack( - "2*4".add(12).scale(scale) - .off(1/8,x=>x.scaleTranspose("2")).fast(2) - .scaleTranspose("<0 1 2 1>").hush(), - "<0 1 2 3>(3,8,2)" - .scale(scale) - .off(1/4,x=>x.scaleTranspose("2,4")), - "<0 4>(5,8)".scale(scale).transpose(-12) -) - .velocity(".6 .7".fast(4)) - .legato("2") - .scale(scale) -.scaleTranspose("<0>".slow(4)) -.tone((await piano()).chain(out())) -//.midi() -.velocity(.8) -.transpose(5) -.slow(2) -.pianoroll({maxMidi:100,minMidi:20})`; -export const echoPiano = `"<0 2 [4 6](3,4,1) 3*2>" -.scale('D minor') -.color('salmon') -.off(1/4, x=>x.scaleTranspose(2).color('green')) -.off(1/2, x=>x.scaleTranspose(6).color('steelblue')) -.legato(.5) -.echo(4, 1/8, .5) -.tone((await piano()).chain(out())) -.pianoroll()`; diff --git a/docs/dist/ui.js b/docs/dist/ui.js deleted file mode 100644 index ff70be7b..00000000 --- a/docs/dist/ui.js +++ /dev/null @@ -1,43 +0,0 @@ -import * as Tone from "../_snowpack/pkg/tone.js"; -export const hideHeader = () => { - document.getElementById("header").style = "display:none"; -}; -function frame(callback) { - if (window.strudelAnimation) { - cancelAnimationFrame(window.strudelAnimation); - } - const animate = (animationTime) => { - const toneTime = Tone.getTransport().seconds; - callback(animationTime, toneTime); - window.strudelAnimation = requestAnimationFrame(animate); - }; - requestAnimationFrame(animate); -} -export const backgroundImage = function(src, animateOptions = {}) { - const container = document.getElementById("code"); - const bg = "background-image:url(" + src + ");background-size:contain;"; - container.style = bg; - const {className: initialClassName} = container; - const handleOption = (option, value) => { - ({ - style: () => container.style = bg + ";" + value, - className: () => container.className = value + " " + initialClassName - })[option](); - }; - const funcOptions = Object.entries(animateOptions).filter(([_, v]) => typeof v === "function"); - const stringOptions = Object.entries(animateOptions).filter(([_, v]) => typeof v === "string"); - stringOptions.forEach(([option, value]) => handleOption(option, value)); - if (funcOptions.length === 0) { - return; - } - frame((_, t) => funcOptions.forEach(([option, value]) => { - handleOption(option, value(t)); - })); -}; -export const cleanup = () => { - const container = document.getElementById("code"); - if (container) { - container.style = ""; - container.className = "grow relative"; - } -}; diff --git a/docs/dist/useCycle.js b/docs/dist/useCycle.js deleted file mode 100644 index 3ac1df87..00000000 --- a/docs/dist/useCycle.js +++ /dev/null @@ -1,59 +0,0 @@ -import {useEffect, useState} from "../_snowpack/pkg/react.js"; -import * as Tone from "../_snowpack/pkg/tone.js"; -import {TimeSpan, State} from "../_snowpack/link/strudel.js"; -function useCycle(props) { - const {onEvent, onQuery, onSchedule, ready = true, onDraw} = props; - const [started, setStarted] = useState(false); - const cycleDuration = 1; - const activeCycle = () => Math.floor(Tone.getTransport().seconds / cycleDuration); - const query = (cycle = activeCycle()) => { - const timespan = new TimeSpan(cycle, cycle + 1); - const events = onQuery?.(new State(timespan)) || []; - onSchedule?.(events, cycle); - const cancelFrom = timespan.begin.valueOf(); - Tone.getTransport().cancel(cancelFrom); - const queryNextTime = (cycle + 1) * cycleDuration - 0.5; - const t = Math.max(Tone.getTransport().seconds, queryNextTime) + 0.1; - Tone.getTransport().schedule(() => { - query(cycle + 1); - }, t); - events?.filter((event) => event.part.begin.equals(event.whole.begin)).forEach((event) => { - Tone.getTransport().schedule((time) => { - const toneEvent = { - time: event.whole.begin.valueOf(), - duration: event.whole.end.sub(event.whole.begin).valueOf(), - value: event.value, - context: event.context - }; - onEvent(time, toneEvent); - Tone.Draw.schedule(() => { - onDraw?.(time, toneEvent); - }, time); - }, event.part.begin.valueOf()); - }); - }; - useEffect(() => { - ready && query(); - }, [onEvent, onSchedule, onQuery, onDraw, ready]); - const start = async () => { - setStarted(true); - await Tone.start(); - Tone.getTransport().start("+0.1"); - }; - const stop = () => { - Tone.getTransport().pause(); - setStarted(false); - }; - const toggle = () => started ? stop() : start(); - return { - start, - stop, - onEvent, - started, - setStarted, - toggle, - query, - activeCycle - }; -} -export default useCycle; diff --git a/docs/dist/usePostMessage.js b/docs/dist/usePostMessage.js deleted file mode 100644 index 05bc17ab..00000000 --- a/docs/dist/usePostMessage.js +++ /dev/null @@ -1,9 +0,0 @@ -import {useEffect} from "../_snowpack/pkg/react.js"; -function usePostMessage(listener) { - useEffect(() => { - window.addEventListener("message", listener); - return () => window.removeEventListener("message", listener); - }, [listener]); - return (data) => window.postMessage(data, "*"); -} -export default usePostMessage; diff --git a/docs/dist/useRepl.js b/docs/dist/useRepl.js deleted file mode 100644 index cbdef5fd..00000000 --- a/docs/dist/useRepl.js +++ /dev/null @@ -1,120 +0,0 @@ -import {useCallback, useState, useMemo} from "../_snowpack/pkg/react.js"; -import {getPlayableNoteValue} from "../_snowpack/link/util.js"; -import {evaluate} from "./evaluate.js"; -import useCycle from "./useCycle.js"; -import usePostMessage from "./usePostMessage.js"; -let s4 = () => { - return Math.floor((1 + Math.random()) * 65536).toString(16).substring(1); -}; -function useRepl({tune, defaultSynth, autolink = true, onEvent, onDraw}) { - const id = useMemo(() => s4(), []); - const [code, setCode] = useState(tune); - const [activeCode, setActiveCode] = useState(); - const [log, setLog] = useState(""); - const [error, setError] = useState(); - const [pending, setPending] = useState(false); - const [hash, setHash] = useState(""); - const [pattern, setPattern] = useState(); - const dirty = code !== activeCode || error; - const generateHash = () => encodeURIComponent(btoa(code)); - const activateCode = async (_code = code) => { - if (activeCode && !dirty) { - setError(void 0); - cycle.start(); - return; - } - try { - setPending(true); - const parsed = await evaluate(_code); - cycle.start(); - broadcast({type: "start", from: id}); - setPattern(() => parsed.pattern); - if (autolink) { - window.location.hash = "#" + encodeURIComponent(btoa(code)); - } - setHash(generateHash()); - setError(void 0); - setActiveCode(_code); - setPending(false); - } catch (err) { - err.message = "evaluation error: " + err.message; - console.warn(err); - setError(err); - } - }; - const pushLog = (message) => setLog((log2) => log2 + `${log2 ? "\n\n" : ""}${message}`); - const logCycle = (_events, cycle2) => { - if (_events.length) { - } - }; - onDraw = useMemo(() => { - if (activeCode && !activeCode.includes("strudel disable-highlighting")) { - return onDraw; - } - }, [activeCode]); - const cycle = useCycle({ - onDraw, - onEvent: useCallback((time, event) => { - try { - onEvent?.(event); - const {onTrigger, velocity} = event.context; - if (!onTrigger) { - if (defaultSynth) { - const note = getPlayableNoteValue(event); - defaultSynth.triggerAttackRelease(note, event.duration, time, velocity); - } else { - throw new Error("no defaultSynth passed to useRepl."); - } - } else { - onTrigger(time, event); - } - } catch (err) { - console.warn(err); - err.message = "unplayable event: " + err?.message; - pushLog(err.message); - } - }, [onEvent]), - onQuery: useCallback((state) => { - try { - return pattern?.query(state) || []; - } catch (err) { - console.warn(err); - err.message = "query error: " + err.message; - setError(err); - return []; - } - }, [pattern]), - onSchedule: useCallback((_events, cycle2) => logCycle(_events, cycle2), [pattern]), - ready: !!pattern && !!activeCode - }); - const broadcast = usePostMessage(({data: {from, type}}) => { - if (type === "start" && from !== id) { - cycle.setStarted(false); - setActiveCode(void 0); - } - }); - const togglePlay = () => { - if (!cycle.started) { - activateCode(); - } else { - cycle.stop(); - } - }; - return { - pending, - code, - setCode, - pattern, - error, - cycle, - setPattern, - dirty, - log, - togglePlay, - activateCode, - activeCode, - pushLog, - hash - }; -} -export default useRepl; diff --git a/docs/dist/voicings.js b/docs/dist/voicings.js deleted file mode 100644 index f88f5653..00000000 --- a/docs/dist/voicings.js +++ /dev/null @@ -1,34 +0,0 @@ -import {Pattern as _Pattern, stack, Hap, reify} from "../_snowpack/link/strudel.js"; -import _voicings from "../_snowpack/pkg/chord-voicings.js"; -const {dictionaryVoicing, minTopNoteDiff, lefthand} = _voicings; -const getVoicing = (chord, lastVoicing, range = ["F3", "A4"]) => dictionaryVoicing({ - chord, - dictionary: lefthand, - range, - picker: minTopNoteDiff, - lastVoicing -}); -const Pattern = _Pattern; -Pattern.prototype.fmapNested = function(func) { - return new Pattern((span) => this.query(span).map((event) => reify(func(event)).query(span).map((hap) => new Hap(event.whole, event.part, hap.value, hap.context))).flat()); -}; -Pattern.prototype.voicings = function(range) { - let lastVoicing; - if (!range?.length) { - range = ["F3", "A4"]; - } - return this.fmapNested((event) => { - lastVoicing = getVoicing(event.value, lastVoicing, range); - return stack(...lastVoicing)._withContext(() => ({ - locations: event.context.locations || [] - })); - }); -}; -Pattern.prototype._rootNotes = function(octave = 2) { - return this.fmap((value) => { - const [_, root] = value.match(/^([a-gA-G][b#]?).*$/); - return root + octave; - }); -}; -Pattern.prototype.define("voicings", (range, pat) => pat.voicings(range), {composable: true}); -Pattern.prototype.define("rootNotes", (oct, pat) => pat.rootNotes(oct), {composable: true, patternified: true}); diff --git a/docs/dist/xen.js b/docs/dist/xen.js deleted file mode 100644 index 2b857281..00000000 --- a/docs/dist/xen.js +++ /dev/null @@ -1,52 +0,0 @@ -import {Pattern} from "../_snowpack/link/strudel.js"; -import {mod} from "../_snowpack/link/util.js"; -function edo(name) { - if (!/^[1-9]+[0-9]*edo$/.test(name)) { - throw new Error('not an edo scale: "' + name + '"'); - } - const [_, divisions] = name.match(/^([1-9]+[0-9]*)edo$/); - return Array.from({length: divisions}, (_2, i) => Math.pow(2, i / divisions)); -} -const presets = { - "12ji": [1 / 1, 16 / 15, 9 / 8, 6 / 5, 5 / 4, 4 / 3, 45 / 32, 3 / 2, 8 / 5, 5 / 3, 16 / 9, 15 / 8] -}; -function withBase(freq, scale) { - return scale.map((r) => r * freq); -} -const defaultBase = 220; -function getXenScale(scale, indices) { - if (typeof scale === "string") { - if (/^[1-9]+[0-9]*edo$/.test(scale)) { - scale = edo(scale); - } else if (presets[scale]) { - scale = presets[scale]; - } else { - throw new Error('unknown scale name: "' + scale + '"'); - } - } - scale = withBase(defaultBase, scale); - if (!indices) { - return scale; - } - return scale.filter((_, i) => indices.includes(i)); -} -function xenOffset(xenScale, offset, index = 0) { - const i = mod(index + offset, xenScale.length); - const oct = Math.floor(offset / xenScale.length); - return xenScale[i] * Math.pow(2, oct); -} -Pattern.prototype._xen = function(scaleNameOrRatios, steps) { - return this._asNumber()._withEvent((event) => { - const scale = getXenScale(scaleNameOrRatios); - steps = steps || scale.length; - const frequency = xenOffset(scale, event.value); - return event.withValue(() => frequency).setContext({...event.context, type: "frequency"}); - }); -}; -Pattern.prototype.tuning = function(steps) { - return this._asNumber()._withEvent((event) => { - const frequency = xenOffset(steps, event.value); - return event.withValue(() => frequency).setContext({...event.context, type: "frequency"}); - }); -}; -Pattern.prototype.define("xen", (scale, pat) => pat.xen(scale), {composable: true, patternified: true}); diff --git a/docs/global.css b/docs/global.css deleted file mode 100644 index e310941b..00000000 --- a/docs/global.css +++ /dev/null @@ -1,1242 +0,0 @@ -/* -! tailwindcss v3.0.18 | MIT License | https://tailwindcss.com -*//* -1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4) -2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116) -*/ - -*, -::before, -::after { - box-sizing: border-box; /* 1 */ - border-width: 0; /* 2 */ - border-style: solid; /* 2 */ - border-color: #e5e7eb; /* 2 */ -} - -::before, -::after { - --tw-content: ''; -} - -/* -1. Use a consistent sensible line-height in all browsers. -2. Prevent adjustments of font size after orientation changes in iOS. -3. Use a more readable tab size. -4. Use the user's configured `sans` font-family by default. -*/ - -html { - line-height: 1.5; /* 1 */ - -webkit-text-size-adjust: 100%; /* 2 */ - -moz-tab-size: 4; /* 3 */ - -o-tab-size: 4; - tab-size: 4; /* 3 */ - font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */ -} - -/* -1. Remove the margin in all browsers. -2. Inherit line-height from `html` so users can set them as a class directly on the `html` element. -*/ - -body { - margin: 0; /* 1 */ - line-height: inherit; /* 2 */ -} - -/* -1. Add the correct height in Firefox. -2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655) -3. Ensure horizontal rules are visible by default. -*/ - -hr { - height: 0; /* 1 */ - color: inherit; /* 2 */ - border-top-width: 1px; /* 3 */ -} - -/* -Add the correct text decoration in Chrome, Edge, and Safari. -*/ - -abbr:where([title]) { - -webkit-text-decoration: underline dotted; - text-decoration: underline dotted; -} - -/* -Remove the default font size and weight for headings. -*/ - -h1, -h2, -h3, -h4, -h5, -h6 { - font-size: inherit; - font-weight: inherit; -} - -/* -Reset links to optimize for opt-in styling instead of opt-out. -*/ - -a { - color: inherit; - text-decoration: inherit; -} - -/* -Add the correct font weight in Edge and Safari. -*/ - -b, -strong { - font-weight: bolder; -} - -/* -1. Use the user's configured `mono` font family by default. -2. Correct the odd `em` font sizing in all browsers. -*/ - -code, -kbd, -samp, -pre { - font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 1 */ - font-size: 1em; /* 2 */ -} - -/* -Add the correct font size in all browsers. -*/ - -small { - font-size: 80%; -} - -/* -Prevent `sub` and `sup` elements from affecting the line height in all browsers. -*/ - -sub, -sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; -} - -sub { - bottom: -0.25em; -} - -sup { - top: -0.5em; -} - -/* -1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297) -2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016) -3. Remove gaps between table borders by default. -*/ - -table { - text-indent: 0; /* 1 */ - border-color: inherit; /* 2 */ - border-collapse: collapse; /* 3 */ -} - -/* -1. Change the font styles in all browsers. -2. Remove the margin in Firefox and Safari. -3. Remove default padding in all browsers. -*/ - -button, -input, -optgroup, -select, -textarea { - font-family: inherit; /* 1 */ - font-size: 100%; /* 1 */ - line-height: inherit; /* 1 */ - color: inherit; /* 1 */ - margin: 0; /* 2 */ - padding: 0; /* 3 */ -} - -/* -Remove the inheritance of text transform in Edge and Firefox. -*/ - -button, -select { - text-transform: none; -} - -/* -1. Correct the inability to style clickable types in iOS and Safari. -2. Remove default button styles. -*/ - -button, -[type='button'], -[type='reset'], -[type='submit'] { - -webkit-appearance: button; /* 1 */ - background-color: transparent; /* 2 */ - background-image: none; /* 2 */ -} - -/* -Use the modern Firefox focus style for all focusable elements. -*/ - -:-moz-focusring { - outline: auto; -} - -/* -Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737) -*/ - -:-moz-ui-invalid { - box-shadow: none; -} - -/* -Add the correct vertical alignment in Chrome and Firefox. -*/ - -progress { - vertical-align: baseline; -} - -/* -Correct the cursor style of increment and decrement buttons in Safari. -*/ - -::-webkit-inner-spin-button, -::-webkit-outer-spin-button { - height: auto; -} - -/* -1. Correct the odd appearance in Chrome and Safari. -2. Correct the outline style in Safari. -*/ - -[type='search'] { - -webkit-appearance: textfield; /* 1 */ - outline-offset: -2px; /* 2 */ -} - -/* -Remove the inner padding in Chrome and Safari on macOS. -*/ - -::-webkit-search-decoration { - -webkit-appearance: none; -} - -/* -1. Correct the inability to style clickable types in iOS and Safari. -2. Change font properties to `inherit` in Safari. -*/ - -::-webkit-file-upload-button { - -webkit-appearance: button; /* 1 */ - font: inherit; /* 2 */ -} - -/* -Add the correct display in Chrome and Safari. -*/ - -summary { - display: list-item; -} - -/* -Removes the default spacing and border for appropriate elements. -*/ - -blockquote, -dl, -dd, -h1, -h2, -h3, -h4, -h5, -h6, -hr, -figure, -p, -pre { - margin: 0; -} - -fieldset { - margin: 0; - padding: 0; -} - -legend { - padding: 0; -} - -ol, -ul, -menu { - list-style: none; - margin: 0; - padding: 0; -} - -/* -Prevent resizing textareas horizontally by default. -*/ - -textarea { - resize: vertical; -} - -/* -1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300) -2. Set the default placeholder color to the user's configured gray 400 color. -*/ - -input::-moz-placeholder, textarea::-moz-placeholder { - opacity: 1; /* 1 */ - color: #9ca3af; /* 2 */ -} - -input:-ms-input-placeholder, textarea:-ms-input-placeholder { - opacity: 1; /* 1 */ - color: #9ca3af; /* 2 */ -} - -input::placeholder, -textarea::placeholder { - opacity: 1; /* 1 */ - color: #9ca3af; /* 2 */ -} - -/* -Set the default cursor for buttons. -*/ - -button, -[role="button"] { - cursor: pointer; -} - -/* -Make sure disabled buttons don't get the pointer cursor. -*/ -:disabled { - cursor: default; -} - -/* -1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14) -2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210) - This can trigger a poorly considered lint error in some tools but is included by design. -*/ - -img, -svg, -video, -canvas, -audio, -iframe, -embed, -object { - display: block; /* 1 */ - vertical-align: middle; /* 2 */ -} - -/* -Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14) -*/ - -img, -video { - max-width: 100%; - height: auto; -} - -/* -Ensure the default browser behavior of the `hidden` attribute. -*/ - -[hidden] { - display: none; -} - -[type='text'],[type='email'],[type='url'],[type='password'],[type='number'],[type='date'],[type='datetime-local'],[type='month'],[type='search'],[type='tel'],[type='time'],[type='week'],[multiple],textarea,select { - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - background-color: #fff; - border-color: #6b7280; - border-width: 1px; - border-radius: 0px; - padding-top: 0.5rem; - padding-right: 0.75rem; - padding-bottom: 0.5rem; - padding-left: 0.75rem; - font-size: 1rem; - line-height: 1.5rem; - --tw-shadow: 0 0 #0000; -} - -[type='text']:focus, [type='email']:focus, [type='url']:focus, [type='password']:focus, [type='number']:focus, [type='date']:focus, [type='datetime-local']:focus, [type='month']:focus, [type='search']:focus, [type='tel']:focus, [type='time']:focus, [type='week']:focus, [multiple]:focus, textarea:focus, select:focus { - outline: 2px solid transparent; - outline-offset: 2px; - --tw-ring-inset: var(--tw-empty,/*!*/ /*!*/); - --tw-ring-offset-width: 0px; - --tw-ring-offset-color: #fff; - --tw-ring-color: #2563eb; - --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); - --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color); - box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow); - border-color: #2563eb; -} - -input::-moz-placeholder, textarea::-moz-placeholder { - color: #6b7280; - opacity: 1; -} - -input:-ms-input-placeholder, textarea:-ms-input-placeholder { - color: #6b7280; - opacity: 1; -} - -input::placeholder,textarea::placeholder { - color: #6b7280; - opacity: 1; -} - -::-webkit-datetime-edit-fields-wrapper { - padding: 0; -} - -::-webkit-date-and-time-value { - min-height: 1.5em; -} - -select { - background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e"); - background-position: right 0.5rem center; - background-repeat: no-repeat; - background-size: 1.5em 1.5em; - padding-right: 2.5rem; - -webkit-print-color-adjust: exact; - color-adjust: exact; -} - -[multiple] { - background-image: initial; - background-position: initial; - background-repeat: unset; - background-size: initial; - padding-right: 0.75rem; - -webkit-print-color-adjust: unset; - color-adjust: unset; -} - -[type='checkbox'],[type='radio'] { - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - padding: 0; - -webkit-print-color-adjust: exact; - color-adjust: exact; - display: inline-block; - vertical-align: middle; - background-origin: border-box; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - flex-shrink: 0; - height: 1rem; - width: 1rem; - color: #2563eb; - background-color: #fff; - border-color: #6b7280; - border-width: 1px; - --tw-shadow: 0 0 #0000; -} - -[type='checkbox'] { - border-radius: 0px; -} - -[type='radio'] { - border-radius: 100%; -} - -[type='checkbox']:focus,[type='radio']:focus { - outline: 2px solid transparent; - outline-offset: 2px; - --tw-ring-inset: var(--tw-empty,/*!*/ /*!*/); - --tw-ring-offset-width: 2px; - --tw-ring-offset-color: #fff; - --tw-ring-color: #2563eb; - --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); - --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color); - box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow); -} - -[type='checkbox']:checked,[type='radio']:checked { - border-color: transparent; - background-color: currentColor; - background-size: 100% 100%; - background-position: center; - background-repeat: no-repeat; -} - -[type='checkbox']:checked { - background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e"); -} - -[type='radio']:checked { - background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e"); -} - -[type='checkbox']:checked:hover,[type='checkbox']:checked:focus,[type='radio']:checked:hover,[type='radio']:checked:focus { - border-color: transparent; - background-color: currentColor; -} - -[type='checkbox']:indeterminate { - background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e"); - border-color: transparent; - background-color: currentColor; - background-size: 100% 100%; - background-position: center; - background-repeat: no-repeat; -} - -[type='checkbox']:indeterminate:hover,[type='checkbox']:indeterminate:focus { - border-color: transparent; - background-color: currentColor; -} - -[type='file'] { - background: unset; - border-color: inherit; - border-width: 0; - border-radius: 0; - padding: 0; - font-size: unset; - line-height: inherit; -} - -[type='file']:focus { - outline: 1px auto -webkit-focus-ring-color; -} - -*, ::before, ::after { - --tw-translate-x: 0; - --tw-translate-y: 0; - --tw-rotate: 0; - --tw-skew-x: 0; - --tw-skew-y: 0; - --tw-scale-x: 1; - --tw-scale-y: 1; - --tw-pan-x: ; - --tw-pan-y: ; - --tw-pinch-zoom: ; - --tw-scroll-snap-strictness: proximity; - --tw-ordinal: ; - --tw-slashed-zero: ; - --tw-numeric-figure: ; - --tw-numeric-spacing: ; - --tw-numeric-fraction: ; - --tw-ring-inset: ; - --tw-ring-offset-width: 0px; - --tw-ring-offset-color: #fff; - --tw-ring-color: rgb(59 130 246 / 0.5); - --tw-ring-offset-shadow: 0 0 #0000; - --tw-ring-shadow: 0 0 #0000; - --tw-shadow: 0 0 #0000; - --tw-shadow-colored: 0 0 #0000; - --tw-blur: ; - --tw-brightness: ; - --tw-contrast: ; - --tw-grayscale: ; - --tw-hue-rotate: ; - --tw-invert: ; - --tw-saturate: ; - --tw-sepia: ; - --tw-drop-shadow: ; - --tw-backdrop-blur: ; - --tw-backdrop-brightness: ; - --tw-backdrop-contrast: ; - --tw-backdrop-grayscale: ; - --tw-backdrop-hue-rotate: ; - --tw-backdrop-invert: ; - --tw-backdrop-opacity: ; - --tw-backdrop-saturate: ; - --tw-backdrop-sepia: ; -} -.prose { - color: var(--tw-prose-body); - max-width: 65ch; -} -.prose :where([class~="lead"]):not(:where([class~="not-prose"] *)) { - color: var(--tw-prose-lead); - font-size: 1.25em; - line-height: 1.6; - margin-top: 1.2em; - margin-bottom: 1.2em; -} -.prose :where(a):not(:where([class~="not-prose"] *)) { - color: var(--tw-prose-links); - text-decoration: underline; - font-weight: 500; -} -.prose :where(strong):not(:where([class~="not-prose"] *)) { - color: var(--tw-prose-bold); - font-weight: 600; -} -.prose :where(ol):not(:where([class~="not-prose"] *)) { - list-style-type: decimal; - padding-left: 1.625em; -} -.prose :where(ol[type="A"]):not(:where([class~="not-prose"] *)) { - list-style-type: upper-alpha; -} -.prose :where(ol[type="a"]):not(:where([class~="not-prose"] *)) { - list-style-type: lower-alpha; -} -.prose :where(ol[type="A" s]):not(:where([class~="not-prose"] *)) { - list-style-type: upper-alpha; -} -.prose :where(ol[type="a" s]):not(:where([class~="not-prose"] *)) { - list-style-type: lower-alpha; -} -.prose :where(ol[type="I"]):not(:where([class~="not-prose"] *)) { - list-style-type: upper-roman; -} -.prose :where(ol[type="i"]):not(:where([class~="not-prose"] *)) { - list-style-type: lower-roman; -} -.prose :where(ol[type="I" s]):not(:where([class~="not-prose"] *)) { - list-style-type: upper-roman; -} -.prose :where(ol[type="i" s]):not(:where([class~="not-prose"] *)) { - list-style-type: lower-roman; -} -.prose :where(ol[type="1"]):not(:where([class~="not-prose"] *)) { - list-style-type: decimal; -} -.prose :where(ul):not(:where([class~="not-prose"] *)) { - list-style-type: disc; - padding-left: 1.625em; -} -.prose :where(ol > li):not(:where([class~="not-prose"] *))::marker { - font-weight: 400; - color: var(--tw-prose-counters); -} -.prose :where(ul > li):not(:where([class~="not-prose"] *))::marker { - color: var(--tw-prose-bullets); -} -.prose :where(hr):not(:where([class~="not-prose"] *)) { - border-color: var(--tw-prose-hr); - border-top-width: 1px; - margin-top: 3em; - margin-bottom: 3em; -} -.prose :where(blockquote):not(:where([class~="not-prose"] *)) { - font-weight: 500; - font-style: italic; - color: var(--tw-prose-quotes); - border-left-width: 0.25rem; - border-left-color: var(--tw-prose-quote-borders); - quotes: "\201C""\201D""\2018""\2019"; - margin-top: 1.6em; - margin-bottom: 1.6em; - padding-left: 1em; -} -.prose :where(blockquote p:first-of-type):not(:where([class~="not-prose"] *))::before { - content: open-quote; -} -.prose :where(blockquote p:last-of-type):not(:where([class~="not-prose"] *))::after { - content: close-quote; -} -.prose :where(h1):not(:where([class~="not-prose"] *)) { - color: var(--tw-prose-headings); - font-weight: 800; - font-size: 2.25em; - margin-top: 0; - margin-bottom: 0.8888889em; - line-height: 1.1111111; -} -.prose :where(h1 strong):not(:where([class~="not-prose"] *)) { - font-weight: 900; -} -.prose :where(h2):not(:where([class~="not-prose"] *)) { - color: var(--tw-prose-headings); - font-weight: 700; - font-size: 1.5em; - margin-top: 2em; - margin-bottom: 1em; - line-height: 1.3333333; -} -.prose :where(h2 strong):not(:where([class~="not-prose"] *)) { - font-weight: 800; -} -.prose :where(h3):not(:where([class~="not-prose"] *)) { - color: var(--tw-prose-headings); - font-weight: 600; - font-size: 1.25em; - margin-top: 1.6em; - margin-bottom: 0.6em; - line-height: 1.6; -} -.prose :where(h3 strong):not(:where([class~="not-prose"] *)) { - font-weight: 700; -} -.prose :where(h4):not(:where([class~="not-prose"] *)) { - color: var(--tw-prose-headings); - font-weight: 600; - margin-top: 1.5em; - margin-bottom: 0.5em; - line-height: 1.5; -} -.prose :where(h4 strong):not(:where([class~="not-prose"] *)) { - font-weight: 700; -} -.prose :where(figure > *):not(:where([class~="not-prose"] *)) { - margin-top: 0; - margin-bottom: 0; -} -.prose :where(figcaption):not(:where([class~="not-prose"] *)) { - color: var(--tw-prose-captions); - font-size: 0.875em; - line-height: 1.4285714; - margin-top: 0.8571429em; -} -.prose :where(code):not(:where([class~="not-prose"] *)) { - color: var(--tw-prose-code); - font-weight: 600; - font-size: 0.875em; -} -.prose :where(code):not(:where([class~="not-prose"] *))::before { - content: "`"; -} -.prose :where(code):not(:where([class~="not-prose"] *))::after { - content: "`"; -} -.prose :where(a code):not(:where([class~="not-prose"] *)) { - color: var(--tw-prose-links); -} -.prose :where(pre):not(:where([class~="not-prose"] *)) { - color: var(--tw-prose-pre-code); - background-color: var(--tw-prose-pre-bg); - overflow-x: auto; - font-weight: 400; - font-size: 0.875em; - line-height: 1.7142857; - margin-top: 1.7142857em; - margin-bottom: 1.7142857em; - border-radius: 0.375rem; - padding-top: 0.8571429em; - padding-right: 1.1428571em; - padding-bottom: 0.8571429em; - padding-left: 1.1428571em; -} -.prose :where(pre code):not(:where([class~="not-prose"] *)) { - background-color: transparent; - border-width: 0; - border-radius: 0; - padding: 0; - font-weight: inherit; - color: inherit; - font-size: inherit; - font-family: inherit; - line-height: inherit; -} -.prose :where(pre code):not(:where([class~="not-prose"] *))::before { - content: none; -} -.prose :where(pre code):not(:where([class~="not-prose"] *))::after { - content: none; -} -.prose :where(table):not(:where([class~="not-prose"] *)) { - width: 100%; - table-layout: auto; - text-align: left; - margin-top: 2em; - margin-bottom: 2em; - font-size: 0.875em; - line-height: 1.7142857; -} -.prose :where(thead):not(:where([class~="not-prose"] *)) { - border-bottom-width: 1px; - border-bottom-color: var(--tw-prose-th-borders); -} -.prose :where(thead th):not(:where([class~="not-prose"] *)) { - color: var(--tw-prose-headings); - font-weight: 600; - vertical-align: bottom; - padding-right: 0.5714286em; - padding-bottom: 0.5714286em; - padding-left: 0.5714286em; -} -.prose :where(tbody tr):not(:where([class~="not-prose"] *)) { - border-bottom-width: 1px; - border-bottom-color: var(--tw-prose-td-borders); -} -.prose :where(tbody tr:last-child):not(:where([class~="not-prose"] *)) { - border-bottom-width: 0; -} -.prose :where(tbody td):not(:where([class~="not-prose"] *)) { - vertical-align: baseline; - padding-top: 0.5714286em; - padding-right: 0.5714286em; - padding-bottom: 0.5714286em; - padding-left: 0.5714286em; -} -.prose { - --tw-prose-body: #374151; - --tw-prose-headings: #111827; - --tw-prose-lead: #4b5563; - --tw-prose-links: #111827; - --tw-prose-bold: #111827; - --tw-prose-counters: #6b7280; - --tw-prose-bullets: #d1d5db; - --tw-prose-hr: #e5e7eb; - --tw-prose-quotes: #111827; - --tw-prose-quote-borders: #e5e7eb; - --tw-prose-captions: #6b7280; - --tw-prose-code: #111827; - --tw-prose-pre-code: #e5e7eb; - --tw-prose-pre-bg: #1f2937; - --tw-prose-th-borders: #d1d5db; - --tw-prose-td-borders: #e5e7eb; - --tw-prose-invert-body: #d1d5db; - --tw-prose-invert-headings: #fff; - --tw-prose-invert-lead: #9ca3af; - --tw-prose-invert-links: #fff; - --tw-prose-invert-bold: #fff; - --tw-prose-invert-counters: #9ca3af; - --tw-prose-invert-bullets: #4b5563; - --tw-prose-invert-hr: #374151; - --tw-prose-invert-quotes: #f3f4f6; - --tw-prose-invert-quote-borders: #374151; - --tw-prose-invert-captions: #9ca3af; - --tw-prose-invert-code: #fff; - --tw-prose-invert-pre-code: #d1d5db; - --tw-prose-invert-pre-bg: rgb(0 0 0 / 50%); - --tw-prose-invert-th-borders: #4b5563; - --tw-prose-invert-td-borders: #374151; - font-size: 1rem; - line-height: 1.75; -} -.prose :where(p):not(:where([class~="not-prose"] *)) { - margin-top: 1.25em; - margin-bottom: 1.25em; -} -.prose :where(img):not(:where([class~="not-prose"] *)) { - margin-top: 2em; - margin-bottom: 2em; -} -.prose :where(video):not(:where([class~="not-prose"] *)) { - margin-top: 2em; - margin-bottom: 2em; -} -.prose :where(figure):not(:where([class~="not-prose"] *)) { - margin-top: 2em; - margin-bottom: 2em; -} -.prose :where(h2 code):not(:where([class~="not-prose"] *)) { - font-size: 0.875em; -} -.prose :where(h3 code):not(:where([class~="not-prose"] *)) { - font-size: 0.9em; -} -.prose :where(li):not(:where([class~="not-prose"] *)) { - margin-top: 0.5em; - margin-bottom: 0.5em; -} -.prose :where(ol > li):not(:where([class~="not-prose"] *)) { - padding-left: 0.375em; -} -.prose :where(ul > li):not(:where([class~="not-prose"] *)) { - padding-left: 0.375em; -} -.prose > :where(ul > li p):not(:where([class~="not-prose"] *)) { - margin-top: 0.75em; - margin-bottom: 0.75em; -} -.prose > :where(ul > li > *:first-child):not(:where([class~="not-prose"] *)) { - margin-top: 1.25em; -} -.prose > :where(ul > li > *:last-child):not(:where([class~="not-prose"] *)) { - margin-bottom: 1.25em; -} -.prose > :where(ol > li > *:first-child):not(:where([class~="not-prose"] *)) { - margin-top: 1.25em; -} -.prose > :where(ol > li > *:last-child):not(:where([class~="not-prose"] *)) { - margin-bottom: 1.25em; -} -.prose :where(ul ul, ul ol, ol ul, ol ol):not(:where([class~="not-prose"] *)) { - margin-top: 0.75em; - margin-bottom: 0.75em; -} -.prose :where(hr + *):not(:where([class~="not-prose"] *)) { - margin-top: 0; -} -.prose :where(h2 + *):not(:where([class~="not-prose"] *)) { - margin-top: 0; -} -.prose :where(h3 + *):not(:where([class~="not-prose"] *)) { - margin-top: 0; -} -.prose :where(h4 + *):not(:where([class~="not-prose"] *)) { - margin-top: 0; -} -.prose :where(thead th:first-child):not(:where([class~="not-prose"] *)) { - padding-left: 0; -} -.prose :where(thead th:last-child):not(:where([class~="not-prose"] *)) { - padding-right: 0; -} -.prose :where(tbody td:first-child):not(:where([class~="not-prose"] *)) { - padding-left: 0; -} -.prose :where(tbody td:last-child):not(:where([class~="not-prose"] *)) { - padding-right: 0; -} -.prose > :where(:first-child):not(:where([class~="not-prose"] *)) { - margin-top: 0; -} -.prose > :where(:last-child):not(:where([class~="not-prose"] *)) { - margin-bottom: 0; -} -.pointer-events-none { - pointer-events: none; -} -.static { - position: static; -} -.fixed { - position: fixed; -} -.absolute { - position: absolute; -} -.relative { - position: relative; -} -.sticky { - position: -webkit-sticky; - position: sticky; -} -.top-0 { - top: 0px; -} -.right-0 { - right: 0px; -} -.right-2 { - right: 0.5rem; -} -.bottom-2 { - bottom: 0.5rem; -} -.right-4 { - right: 1rem; -} -.z-\[10\] { - z-index: 10; -} -.z-\[11\] { - z-index: 11; -} -.block { - display: block; -} -.flex { - display: flex; -} -.inline-flex { - display: inline-flex; -} -.contents { - display: contents; -} -.h-14 { - height: 3.5rem; -} -.h-12 { - height: 3rem; -} -.h-5 { - height: 1.25rem; -} -.h-full { - height: 100%; -} -.h-16 { - height: 4rem; -} -.min-h-screen { - min-height: 100vh; -} -.w-full { - width: 100%; -} -.w-12 { - width: 3rem; -} -.w-16 { - width: 4rem; -} -.w-5 { - width: 1.25rem; -} -.max-w-3xl { - max-width: 48rem; -} -.flex-none { - flex: none; -} -.grow { - flex-grow: 1; -} -.transform { - transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); -} -@-webkit-keyframes pulse { - - 50% { - opacity: .5; - } -} -@keyframes pulse { - - 50% { - opacity: .5; - } -} -.animate-pulse { - -webkit-animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; - animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; -} -.cursor-not-allowed { - cursor: not-allowed; -} -.resize-none { - resize: none; -} -.flex-col { - flex-direction: column; -} -.items-center { - align-items: center; -} -.justify-center { - justify-content: center; -} -.justify-between { - justify-content: space-between; -} -.space-x-2 > :not([hidden]) ~ :not([hidden]) { - --tw-space-x-reverse: 0; - margin-right: calc(0.5rem * var(--tw-space-x-reverse)); - margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse))); -} -.space-x-4 > :not([hidden]) ~ :not([hidden]) { - --tw-space-x-reverse: 0; - margin-right: calc(1rem * var(--tw-space-x-reverse)); - margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse))); -} -.space-y-0 > :not([hidden]) ~ :not([hidden]) { - --tw-space-y-reverse: 0; - margin-top: calc(0px * calc(1 - var(--tw-space-y-reverse))); - margin-bottom: calc(0px * var(--tw-space-y-reverse)); -} -.overflow-auto { - overflow: auto; -} -.overflow-hidden { - overflow: hidden; -} -.truncate { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} -.whitespace-pre { - white-space: pre; -} -.rounded-md { - border-radius: 0.375rem; -} -.border-0 { - border-width: 0px; -} -.border { - border-width: 1px; -} -.border-b { - border-bottom-width: 1px; -} -.border-t { - border-top-width: 1px; -} -.border-r { - border-right-width: 1px; -} -.border-gray-200 { - --tw-border-opacity: 1; - border-color: rgb(229 231 235 / var(--tw-border-opacity)); -} -.border-slate-600 { - --tw-border-opacity: 1; - border-color: rgb(71 85 105 / var(--tw-border-opacity)); -} -.border-slate-500 { - --tw-border-opacity: 1; - border-color: rgb(100 116 139 / var(--tw-border-opacity)); -} -.bg-transparent { - background-color: transparent; -} -.bg-white { - --tw-bg-opacity: 1; - background-color: rgb(255 255 255 / var(--tw-bg-opacity)); -} -.bg-\[transparent\] { - background-color: transparent; -} -.bg-slate-700 { - --tw-bg-opacity: 1; - background-color: rgb(51 65 85 / var(--tw-bg-opacity)); -} -.bg-slate-600 { - --tw-bg-opacity: 1; - background-color: rgb(71 85 105 / var(--tw-bg-opacity)); -} -.p-4 { - padding: 1rem; -} -.p-1 { - padding: 0.25rem; -} -.px-2 { - padding-left: 0.5rem; - padding-right: 0.5rem; -} -.pr-2 { - padding-right: 0.5rem; -} -.text-right { - text-align: right; -} -.text-2xl { - font-size: 1.5rem; - line-height: 2rem; -} -.text-xs { - font-size: 0.75rem; - line-height: 1rem; -} -.text-sm { - font-size: 0.875rem; - line-height: 1.25rem; -} -.text-white { - --tw-text-opacity: 1; - color: rgb(255 255 255 / var(--tw-text-opacity)); -} -.text-gray-100 { - --tw-text-opacity: 1; - color: rgb(243 244 246 / var(--tw-text-opacity)); -} -.text-red-500 { - --tw-text-opacity: 1; - color: rgb(239 68 68 / var(--tw-text-opacity)); -} -.text-slate-400 { - --tw-text-opacity: 1; - color: rgb(148 163 184 / var(--tw-text-opacity)); -} -.text-red-200 { - --tw-text-opacity: 1; - color: rgb(254 202 202 / var(--tw-text-opacity)); -} -.opacity-0 { - opacity: 0; -} -.opacity-100 { - opacity: 1; -} -.outline { - outline-style: solid; -} -.filter { - filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); -} -.transition-opacity { - transition-property: opacity; - transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); - transition-duration: 150ms; -} - -body { - background-color: #2a3236; -} - -.react-codemirror2, -.CodeMirror { - height: 100% !important; - background-color: transparent !important; - font-size: 15px; - z-index:20 -} - -.CodeMirror-line > span { - background-color: #2a323699; -} - -.darken::before { - content: ' '; - position: absolute; - top: 0; - left: 0; - width: 100vw; - height: 100vh; - display: block; - background: black; - opacity: 0.5; -} - -.hover\:bg-slate-600:hover { - --tw-bg-opacity: 1; - background-color: rgb(71 85 105 / var(--tw-bg-opacity)); -} - -.focus\:ring-red-500:focus { - --tw-ring-opacity: 1; - --tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity)); -} - -.focus\:ring-slate-800:focus { - --tw-ring-opacity: 1; - --tw-ring-color: rgb(30 41 59 / var(--tw-ring-opacity)); -} diff --git a/docs/hot.js b/docs/hot.js deleted file mode 100644 index 7ba68d64..00000000 --- a/docs/hot.js +++ /dev/null @@ -1,45 +0,0 @@ -// this file can be used to livecode from the comfort of your editor. -// just export a pattern from export default -// enable hot mode by pressing "toggle hot mode" on the top right of the repl - -import { mini, h } from './dist/parse.js'; -import { sequence, pure, reify, slowcat, fastcat, cat, stack, silence } from './_snowpack/link/strudel.js'; -import { gain, filter } from './dist/tone.js'; - -export default stack( - sequence( - mini( - 'e5 [b4 c5] d5 [c5 b4]', - 'a4 [a4 c5] e5 [d5 c5]', - 'b4 [~ c5] d5 e5', - 'c5 a4 a4 ~', - '[~ d5] [~ f5] a5 [g5 f5]', - 'e5 [~ c5] e5 [d5 c5]', - 'b4 [b4 c5] d5 e5', - 'c5 a4 a4 ~' - ) - .synth({ - oscillator: { type: 'sine' }, - envelope: { attack: 0.1 }, - }) - .rev() - ), - sequence( - mini( - 'e2 e3 e2 e3 e2 e3 e2 e3', - 'a2 a3 a2 a3 a2 a3 a2 a3', - 'g#2 g#3 g#2 g#3 e2 e3 e2 e3', - 'a2 a3 a2 a3 a2 a3 b1 c2', - 'd2 d3 d2 d3 d2 d3 d2 d3', - 'c2 c3 c2 c3 c2 c3 c2 c3', - 'b1 b2 b1 b2 e2 e3 e2 e3', - 'a1 a2 a1 a2 a1 a2 a1 a2' - ) - .synth({ - oscillator: { type: 'sawtooth' }, - envelope: { attack: 0.1 }, - }) - .chain(gain(0.7), filter(2000)) - .rev() - ) -).slow(16); diff --git a/docs/index.html b/docs/index.html index 0e7db17b..e2a307c0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,16 +1 @@ - - - - - - - - - Strudel REPL - - -
- - - - +Strudel REPL
\ No newline at end of file diff --git a/docs/manifest.json b/docs/manifest.json new file mode 100644 index 00000000..7b904b61 --- /dev/null +++ b/docs/manifest.json @@ -0,0 +1,15 @@ +{ + "short_name": "Strudel REPL", + "name": "Strudel REPL - Tidal Patterns in JavaScript", + "icons": [ + { + "src": "favicon.ico", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/docs/robots.txt b/docs/robots.txt new file mode 100644 index 00000000..e9e57dc4 --- /dev/null +++ b/docs/robots.txt @@ -0,0 +1,3 @@ +# https://www.robotstxt.org/robotstxt.html +User-agent: * +Disallow: diff --git a/docs/static/css/main.0d689283.css b/docs/static/css/main.0d689283.css new file mode 100644 index 00000000..adca1241 --- /dev/null +++ b/docs/static/css/main.0d689283.css @@ -0,0 +1,6 @@ +body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}.CodeMirror{color:#000;direction:ltr;font-family:monospace;height:300px}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{background-color:#f7f7f7;border-right:1px solid #ddd;white-space:nowrap}.CodeMirror-linenumber{color:#999;min-width:20px;padding:0 3px 0 5px;text-align:right;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{background:#7e7;border:0!important;width:auto}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor .CodeMirror-line::selection,.cm-fat-cursor .CodeMirror-line>span::selection,.cm-fat-cursor .CodeMirror-line>span>span::selection{background:transparent}.cm-fat-cursor .CodeMirror-line::-moz-selection,.cm-fat-cursor .CodeMirror-line>span::-moz-selection,.cm-fat-cursor .CodeMirror-line>span>span::-moz-selection{background:transparent}.cm-fat-cursor{caret-color:transparent}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{bottom:0;left:0;overflow:hidden;position:absolute;right:0;top:-50px}.CodeMirror-ruler{border-left:1px solid #ccc;bottom:0;position:absolute;top:0}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-type,.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{background:#fff;overflow:hidden;position:relative}.CodeMirror-scroll{height:100%;margin-bottom:-50px;margin-right:-50px;outline:none;overflow:scroll!important;padding-bottom:50px;position:relative;z-index:0}.CodeMirror-sizer{border-right:50px solid transparent;position:relative}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{display:none;outline:none;position:absolute;z-index:6}.CodeMirror-vscrollbar{overflow-x:hidden;overflow-y:scroll;right:0;top:0}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-x:scroll;overflow-y:hidden}.CodeMirror-scrollbar-filler{bottom:0;right:0}.CodeMirror-gutter-filler{bottom:0;left:0}.CodeMirror-gutters{left:0;min-height:100%;position:absolute;top:0;z-index:3}.CodeMirror-gutter{display:inline-block;height:100%;margin-bottom:-50px;vertical-align:top;white-space:normal}.CodeMirror-gutter-wrapper{background:none!important;border:none!important;position:absolute;z-index:4}.CodeMirror-gutter-background{bottom:0;position:absolute;top:0;z-index:4}.CodeMirror-gutter-elt{cursor:default;position:absolute;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{word-wrap:normal;-webkit-tap-highlight-color:transparent;-webkit-font-feature-settings:"calt";font-feature-settings:"calt";background:transparent;border-radius:0;border-width:0;color:inherit;font-family:inherit;font-size:inherit;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual;line-height:inherit;margin:0;overflow:visible;position:relative;white-space:pre;z-index:2}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{bottom:0;left:0;position:absolute;right:0;top:0;z-index:0}.CodeMirror-linewidget{padding:.1px;position:relative;z-index:2}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{box-sizing:content-box}.CodeMirror-measure{height:0;overflow:hidden;position:absolute;visibility:hidden;width:100%}.CodeMirror-cursor{pointer-events:none;position:absolute}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{position:relative;visibility:hidden;z-index:3}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}.cm-s-material.CodeMirror{background-color:#263238;color:#eff}.cm-s-material .CodeMirror-gutters{background:#263238;border:none;color:#546e7a}.cm-s-material .CodeMirror-guttermarker,.cm-s-material .CodeMirror-guttermarker-subtle,.cm-s-material .CodeMirror-linenumber{color:#546e7a}.cm-s-material .CodeMirror-cursor{border-left:1px solid #fc0}.cm-s-material .cm-animate-fat-cursor,.cm-s-material.cm-fat-cursor .CodeMirror-cursor{background-color:#5d6d5c80!important}.cm-s-material div.CodeMirror-selected,.cm-s-material.CodeMirror-focused div.CodeMirror-selected{background:rgba(128,203,196,.2)}.cm-s-material .CodeMirror-line::selection,.cm-s-material .CodeMirror-line>span::selection,.cm-s-material .CodeMirror-line>span>span::selection{background:rgba(128,203,196,.2)}.cm-s-material .CodeMirror-line::-moz-selection,.cm-s-material .CodeMirror-line>span::-moz-selection,.cm-s-material .CodeMirror-line>span>span::-moz-selection{background:rgba(128,203,196,.2)}.cm-s-material .CodeMirror-activeline-background{background:rgba(0,0,0,.5)}.cm-s-material .cm-keyword{color:#c792ea}.cm-s-material .cm-operator{color:#89ddff}.cm-s-material .cm-variable-2{color:#eff}.cm-s-material .cm-type,.cm-s-material .cm-variable-3{color:#f07178}.cm-s-material .cm-builtin{color:#ffcb6b}.cm-s-material .cm-atom{color:#f78c6c}.cm-s-material .cm-number{color:#ff5370}.cm-s-material .cm-def{color:#82aaff}.cm-s-material .cm-string{color:#c3e88d}.cm-s-material .cm-string-2{color:#f07178}.cm-s-material .cm-comment{color:#546e7a}.cm-s-material .cm-variable{color:#f07178}.cm-s-material .cm-tag{color:#ff5370}.cm-s-material .cm-meta{color:#ffcb6b}.cm-s-material .cm-attribute,.cm-s-material .cm-property{color:#c792ea}.cm-s-material .cm-qualifier,.cm-s-material .cm-type,.cm-s-material .cm-variable-3{color:#decb6b}.cm-s-material .cm-error{background-color:#ff5370;color:#fff}.cm-s-material .CodeMirror-matchingbracket{color:#fff!important;text-decoration:underline} + +/* +! tailwindcss v3.0.23 | MIT License | https://tailwindcss.com +*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}html{-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-size:100%;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:#9ca3af;opacity:1}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*,:after,:before{--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where([class~=lead]):not(:where([class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-bottom:1.2em;margin-top:1.2em}.prose :where(a):not(:where([class~=not-prose] *)){color:var(--tw-prose-links);font-weight:500;text-decoration:underline}.prose :where(strong):not(:where([class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(ol):not(:where([class~=not-prose] *)){list-style-type:decimal;padding-left:1.625em}.prose :where(ol[type=A]):not(:where([class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose] *)){list-style-type:disc;padding-left:1.625em}.prose :where(ol>li):not(:where([class~=not-prose] *))::marker{color:var(--tw-prose-counters);font-weight:400}.prose :where(ul>li):not(:where([class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(hr):not(:where([class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-bottom:3em;margin-top:3em}.prose :where(blockquote):not(:where([class~=not-prose] *)){border-left-color:var(--tw-prose-quote-borders);border-left-width:.25rem;color:var(--tw-prose-quotes);font-style:italic;font-weight:500;margin-bottom:1.6em;margin-top:1.6em;padding-left:1em;quotes:"\201C""\201D""\2018""\2019"}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose] *)):before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose] *)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose] *)){color:var(--tw-prose-headings);font-size:2.25em;font-weight:800;line-height:1.1111111;margin-bottom:.8888889em;margin-top:0}.prose :where(h1 strong):not(:where([class~=not-prose] *)){font-weight:900}.prose :where(h2):not(:where([class~=not-prose] *)){color:var(--tw-prose-headings);font-size:1.5em;font-weight:700;line-height:1.3333333;margin-bottom:1em;margin-top:2em}.prose :where(h2 strong):not(:where([class~=not-prose] *)){font-weight:800}.prose :where(h3):not(:where([class~=not-prose] *)){color:var(--tw-prose-headings);font-size:1.25em;font-weight:600;line-height:1.6;margin-bottom:.6em;margin-top:1.6em}.prose :where(h3 strong):not(:where([class~=not-prose] *)){font-weight:700}.prose :where(h4):not(:where([class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;line-height:1.5;margin-bottom:.5em;margin-top:1.5em}.prose :where(h4 strong):not(:where([class~=not-prose] *)){font-weight:700}.prose :where(figure>*):not(:where([class~=not-prose] *)){margin-bottom:0;margin-top:0}.prose :where(figcaption):not(:where([class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.prose :where(code):not(:where([class~=not-prose] *)){color:var(--tw-prose-code);font-size:.875em;font-weight:600}.prose :where(code):not(:where([class~=not-prose] *)):before{content:"`"}.prose :where(code):not(:where([class~=not-prose] *)):after{content:"`"}.prose :where(a code):not(:where([class~=not-prose] *)){color:var(--tw-prose-links)}.prose :where(pre):not(:where([class~=not-prose] *)){background-color:var(--tw-prose-pre-bg);border-radius:.375rem;color:var(--tw-prose-pre-code);font-size:.875em;font-weight:400;line-height:1.7142857;margin-bottom:1.7142857em;margin-top:1.7142857em;overflow-x:auto;padding:.8571429em 1.1428571em}.prose :where(pre code):not(:where([class~=not-prose] *)){background-color:transparent;border-radius:0;border-width:0;color:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit;padding:0}.prose :where(pre code):not(:where([class~=not-prose] *)):before{content:none}.prose :where(pre code):not(:where([class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose] *)){font-size:.875em;line-height:1.7142857;margin-bottom:2em;margin-top:2em;table-layout:auto;text-align:left;width:100%}.prose :where(thead):not(:where([class~=not-prose] *)){border-bottom-color:var(--tw-prose-th-borders);border-bottom-width:1px}.prose :where(thead th):not(:where([class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;padding-bottom:.5714286em;padding-left:.5714286em;padding-right:.5714286em;vertical-align:bottom}.prose :where(tbody tr):not(:where([class~=not-prose] *)){border-bottom-color:var(--tw-prose-td-borders);border-bottom-width:1px}.prose :where(tbody tr:last-child):not(:where([class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose] *)){padding:.5714286em;vertical-align:baseline}.prose{--tw-prose-body:#374151;--tw-prose-headings:#111827;--tw-prose-lead:#4b5563;--tw-prose-links:#111827;--tw-prose-bold:#111827;--tw-prose-counters:#6b7280;--tw-prose-bullets:#d1d5db;--tw-prose-hr:#e5e7eb;--tw-prose-quotes:#111827;--tw-prose-quote-borders:#e5e7eb;--tw-prose-captions:#6b7280;--tw-prose-code:#111827;--tw-prose-pre-code:#e5e7eb;--tw-prose-pre-bg:#1f2937;--tw-prose-th-borders:#d1d5db;--tw-prose-td-borders:#e5e7eb;--tw-prose-invert-body:#d1d5db;--tw-prose-invert-headings:#fff;--tw-prose-invert-lead:#9ca3af;--tw-prose-invert-links:#fff;--tw-prose-invert-bold:#fff;--tw-prose-invert-counters:#9ca3af;--tw-prose-invert-bullets:#4b5563;--tw-prose-invert-hr:#374151;--tw-prose-invert-quotes:#f3f4f6;--tw-prose-invert-quote-borders:#374151;--tw-prose-invert-captions:#9ca3af;--tw-prose-invert-code:#fff;--tw-prose-invert-pre-code:#d1d5db;--tw-prose-invert-pre-bg:rgba(0,0,0,.5);--tw-prose-invert-th-borders:#4b5563;--tw-prose-invert-td-borders:#374151;font-size:1rem;line-height:1.75}.prose :where(p):not(:where([class~=not-prose] *)){margin-bottom:1.25em;margin-top:1.25em}.prose :where(img):not(:where([class~=not-prose] *)){margin-bottom:2em;margin-top:2em}.prose :where(video):not(:where([class~=not-prose] *)){margin-bottom:2em;margin-top:2em}.prose :where(figure):not(:where([class~=not-prose] *)){margin-bottom:2em;margin-top:2em}.prose :where(h2 code):not(:where([class~=not-prose] *)){font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose] *)){font-size:.9em}.prose :where(li):not(:where([class~=not-prose] *)){margin-bottom:.5em;margin-top:.5em}.prose :where(ol>li):not(:where([class~=not-prose] *)){padding-left:.375em}.prose :where(ul>li):not(:where([class~=not-prose] *)){padding-left:.375em}.prose>:where(ul>li p):not(:where([class~=not-prose] *)){margin-bottom:.75em;margin-top:.75em}.prose>:where(ul>li>:first-child):not(:where([class~=not-prose] *)){margin-top:1.25em}.prose>:where(ul>li>:last-child):not(:where([class~=not-prose] *)){margin-bottom:1.25em}.prose>:where(ol>li>:first-child):not(:where([class~=not-prose] *)){margin-top:1.25em}.prose>:where(ol>li>:last-child):not(:where([class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose] *)){margin-bottom:.75em;margin-top:.75em}.prose :where(hr+*):not(:where([class~=not-prose] *)){margin-top:0}.prose :where(h2+*):not(:where([class~=not-prose] *)){margin-top:0}.prose :where(h3+*):not(:where([class~=not-prose] *)){margin-top:0}.prose :where(h4+*):not(:where([class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose] *)){padding-left:0}.prose :where(thead th:last-child):not(:where([class~=not-prose] *)){padding-right:0}.prose :where(tbody td:first-child):not(:where([class~=not-prose] *)){padding-left:0}.prose :where(tbody td:last-child):not(:where([class~=not-prose] *)){padding-right:0}.prose>:where(:first-child):not(:where([class~=not-prose] *)){margin-top:0}.prose>:where(:last-child):not(:where([class~=not-prose] *)){margin-bottom:0}.pointer-events-none{pointer-events:none}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.top-0{top:0}.right-0{right:0}.right-2{right:.5rem}.bottom-2{bottom:.5rem}.right-4{right:1rem}.z-\[10\]{z-index:10}.z-\[11\]{z-index:11}.flex{display:flex}.inline-flex{display:inline-flex}.h-14{height:3.5rem}.h-12{height:3rem}.h-5{height:1.25rem}.h-full{height:100%}.h-16{height:4rem}.min-h-screen{min-height:100vh}.w-full{width:100%}.w-12{width:3rem}.w-16{width:4rem}.w-5{width:1.25rem}.max-w-3xl{max-width:48rem}.flex-none{flex:none}.grow{flex-grow:1}@-webkit-keyframes pulse{50%{opacity:.5}}@keyframes pulse{50%{opacity:.5}}.animate-pulse{-webkit-animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite;animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.cursor-not-allowed{cursor:not-allowed}.resize-none{resize:none}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(1rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(1rem*var(--tw-space-x-reverse))}.space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(0px*var(--tw-space-y-reverse));margin-top:calc(0px*(1 - var(--tw-space-y-reverse)))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-pre{white-space:pre}.rounded-md{border-radius:.375rem}.border-0{border-width:0}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-r{border-right-width:1px}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity))}.border-slate-600{--tw-border-opacity:1;border-color:rgb(71 85 105/var(--tw-border-opacity))}.border-slate-500{--tw-border-opacity:1;border-color:rgb(100 116 139/var(--tw-border-opacity))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-\[transparent\]{background-color:transparent}.bg-slate-700{--tw-bg-opacity:1;background-color:rgb(51 65 85/var(--tw-bg-opacity))}.bg-slate-600{--tw-bg-opacity:1;background-color:rgb(71 85 105/var(--tw-bg-opacity))}.p-4{padding:1rem}.p-1{padding:.25rem}.px-2{padding-left:.5rem}.pr-2,.px-2{padding-right:.5rem}.text-right{text-align:right}.text-2xl{font-size:1.5rem;line-height:2rem}.text-xs{font-size:.75rem;line-height:1rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.text-gray-100{--tw-text-opacity:1;color:rgb(243 244 246/var(--tw-text-opacity))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity))}.text-slate-400{--tw-text-opacity:1;color:rgb(148 163 184/var(--tw-text-opacity))}.text-red-200{--tw-text-opacity:1;color:rgb(254 202 202/var(--tw-text-opacity))}.opacity-0{opacity:0}.opacity-100{opacity:1}.outline{outline-style:solid}.filter{-webkit-filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}body{background-color:#2a3236}.CodeMirror,.react-codemirror2{background-color:transparent!important;font-size:15px;height:100%!important;z-index:20}.CodeMirror-line>span{background-color:#2a323699}.darken:before{background:#000;content:" ";display:block;height:100vh;left:0;opacity:.5;position:absolute;top:0;width:100vw}.hover\:bg-slate-600:hover{--tw-bg-opacity:1;background-color:rgb(71 85 105/var(--tw-bg-opacity))}.focus\:ring-red-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(239 68 68/var(--tw-ring-opacity))}.focus\:ring-slate-800:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(30 41 59/var(--tw-ring-opacity))} +/*# sourceMappingURL=main.0d689283.css.map*/ \ No newline at end of file diff --git a/docs/static/css/main.0d689283.css.map b/docs/static/css/main.0d689283.css.map new file mode 100644 index 00000000..4c3ab00e --- /dev/null +++ b/docs/static/css/main.0d689283.css.map @@ -0,0 +1 @@ +{"version":3,"file":"static/css/main.0d689283.css","mappings":"AAAA,KAKE,kCAAmC,CACnC,iCAAkC,CAJlC,mIAKF,CAEA,KACE,uEAEF,CCVA,YAIE,UAAY,CACZ,aAAc,CAHd,qBAAsB,CACtB,YAGF,CAIA,kBACE,aACF,CACA,qEAEE,aACF,CAEA,uDACE,qBACF,CAIA,oBAEE,wBAAyB,CADzB,2BAA4B,CAE5B,kBACF,CAEA,uBAIE,UAAW,CAFX,cAAe,CADf,mBAAoB,CAEpB,gBAAiB,CAEjB,kBACF,CAEA,yBAA2B,UAAc,CACzC,gCAAkC,UAAa,CAI/C,mBACE,0BAA4B,CAC5B,iBAAkB,CAClB,OACF,CAEA,2CACE,4BACF,CACA,kCAGE,eAAgB,CADhB,kBAAoB,CADpB,UAGF,CACA,sCACE,SACF,CACA,gJAE2D,sBAAyB,CACpF,+JAEgE,sBAAyB,CACzF,eAAiB,uBAA0B,CAM3C,yBAEE,IAAM,4BAA+B,CAEvC,CACA,iBAEE,IAAM,4BAA+B,CAEvC,CAKA,QAAU,oBAAqB,CAAE,uBAA0B,CAE3D,mBAEiC,QAAS,CAAxC,MAAO,CACP,eAAgB,CAFhB,iBAAkB,CACT,OAAQ,CAAE,SAErB,CACA,kBACE,0BAA2B,CACnB,QAAS,CACjB,iBAAkB,CADlB,KAEF,CAIA,yBAA0B,UAAY,CACtC,wBAAyB,UAAY,CACrC,aAAc,UAAY,CAC1B,aAAc,UAAY,CAC1B,sBAAwB,eAAkB,CAC1C,OAAQ,iBAAmB,CAC3B,SAAU,yBAA2B,CACrC,kBAAmB,4BAA8B,CAEjD,0BAA2B,UAAY,CACvC,uBAAwB,UAAY,CACpC,yBAA0B,UAAY,CACtC,sBAAuB,UAAY,CAKnC,6BAA8B,UAAY,CAC1C,oDAAsD,UAAY,CAClE,0BAA2B,UAAY,CACvC,yBAA0B,UAAY,CACtC,2BAA4B,UAAY,CAExC,mDAA6B,UAAY,CACzC,0BAA2B,UAAY,CACvC,0BAA2B,UAAY,CACvC,sBAAuB,UAAY,CACnC,4BAA6B,UAAY,CACzC,qBAAsB,UAAY,CAClC,uBAAwB,UAAY,CAGpC,wCAAiB,SAAY,CAE7B,sBAAwB,uBAA0B,CAIlD,+CAAgD,UAAY,CAC5D,kDAAmD,UAAY,CAC/D,wBAA0B,6BAAmC,CAC7D,kCAAmC,kBAAoB,CAOvD,YAGE,eAAiB,CADjB,eAAgB,CADhB,iBAGF,CAEA,mBAME,WAAY,CAFZ,mBAAoB,CAAE,kBAAmB,CAGzC,YAAa,CANb,yBAA2B,CAI3B,mBAAoB,CAGpB,iBAAkB,CAClB,SACF,CACA,kBAEE,mCAAoC,CADpC,iBAEF,CAKA,qGAGE,YAAa,CACb,YAAa,CAHb,iBAAkB,CAClB,SAGF,CACA,uBAEE,iBAAkB,CAClB,iBAAkB,CAFlB,OAAQ,CAAE,KAGZ,CACA,uBACE,QAAS,CAAE,MAAO,CAElB,iBAAkB,CADlB,iBAEF,CACA,6BACY,QAAS,CAAnB,OACF,CACA,0BACW,QAAS,CAAlB,MACF,CAEA,oBACsB,MAAO,CAC3B,eAAgB,CADhB,iBAAkB,CAAW,KAAM,CAEnC,SACF,CACA,mBAGE,oBAAqB,CADrB,WAAY,CAGZ,mBAAoB,CADpB,kBAAmB,CAHnB,kBAKF,CACA,2BAGE,yBAA2B,CAC3B,qBAAuB,CAHvB,iBAAkB,CAClB,SAGF,CACA,8BAEU,QAAS,CADjB,iBAAkB,CAClB,KAAM,CACN,SACF,CACA,uBAEE,cAAe,CADf,iBAAkB,CAElB,SACF,CACA,uCAAyC,4BAA8B,CACvE,4CAA8C,4BAA8B,CAE5E,kBACE,WAAY,CACZ,cACF,CACA,qEAUE,gBAAiB,CAMjB,uCAAwC,CAExC,oCAAkC,CAAlC,4BAAkC,CAblC,sBAAuB,CAF0B,eAAgB,CACjE,cAAe,CAQf,aAAc,CANd,mBAAoB,CACpB,iBAAkB,CAUlB,yCAA0C,CAC1C,iCAAkC,CAPlC,mBAAoB,CAHpB,QAAS,CAOT,gBAAiB,CADjB,iBAAkB,CALlB,eAAgB,CAIhB,SAMF,CACA,+EAEE,oBAAqB,CACrB,oBAAqB,CACrB,iBACF,CAEA,2BAE6B,QAAS,CAApC,MAAO,CADP,iBAAkB,CACT,OAAQ,CAAE,KAAM,CACzB,SACF,CAEA,uBAGE,YAAc,CAFd,iBAAkB,CAClB,SAEF,CAIA,oBAAsB,aAAgB,CAEtC,iBACE,YACF,CAGA,mGAME,sBACF,CAEA,oBAGE,QAAS,CACT,eAAgB,CAHhB,iBAAkB,CAIlB,iBAAkB,CAHlB,UAIF,CAEA,mBAEE,mBAAoB,CADpB,iBAEF,CACA,wBAA0B,eAAkB,CAE5C,uBAEE,iBAAkB,CADlB,iBAAkB,CAElB,SACF,CAKA,sEACE,kBACF,CAEA,qBAAuB,kBAAqB,CAC5C,yCAA2C,kBAAqB,CAChE,sBAAwB,gBAAmB,CAC3C,mGAA6G,kBAAqB,CAClI,kHAA4H,kBAAqB,CAEjJ,cACE,qBAAsB,CACtB,mCACF,CAGA,iBAAmB,kBAAqB,CAExC,aAEE,mCACE,iBACF,CACF,CAGA,wBAA0B,UAAa,CAGvC,6BAA+B,eAAkB,CCjVjD,0BACE,wBAAyB,CACzB,UACF,CAEA,mCACE,kBAAmB,CAEnB,WAAY,CADZ,aAEF,CAEA,6HAGE,aACF,CAEA,kCACE,0BACF,CAIA,sFACE,oCACF,CAMA,iGACE,+BACF,CAEA,gJAGE,+BACF,CAEA,+JAGE,+BACF,CAEA,iDACE,yBACF,CAEA,2BACE,aACF,CAEA,4BACE,aACF,CAEA,8BACE,UACF,CAEA,sDAEE,aACF,CAEA,2BACE,aACF,CAEA,wBACE,aACF,CAEA,0BACE,aACF,CAEA,uBACE,aACF,CAEA,0BACE,aACF,CAEA,4BACE,aACF,CAEA,2BACE,aACF,CAEA,4BACE,aACF,CAEA,uBACE,aACF,CAEA,wBACE,aACF,CAMA,yDACE,aACF,CAMA,mFAEE,aACF,CAGA,yBAEE,wBAAyB,CADzB,UAEF,CAEA,2CAEE,oBAAuB,CADvB,yBAEF;;AC5IA;;CAAc,CAAd,iBCWE,sBAAwD,CAHxD,qBDRY,CAAd,eCgBE,eDhBY,CAAd,KC4BE,6BAA8B,CAG9B,gMAAsP,CAJtP,eAAgB,CAGhB,UD9BY,CAAd,KCyCE,mBAAoB,CADpB,QDxCY,CAAd,GCqDE,oBAAqB,CADrB,aAAc,CADd,QDnDY,CAAd,oBC6DE,wCAAiC,CAAjC,gCD7DY,CAAd,kBC0EE,iBAAkB,CAClB,mBD3EY,CAAd,ECmFE,aAAc,CACd,uBDpFY,CAAd,SC6FE,kBD7FY,CAAd,kBCyGE,mGAAyI,CACzI,aD1GY,CAAd,MCkHE,aDlHY,CAAd,QC2HE,aAAc,CACd,aAAc,CACd,iBAAkB,CAClB,uBD9HY,CAAd,ICkIE,aDlIY,CAAd,ICsIE,SDtIY,CAAd,MCkJE,wBAAyB,CADzB,oBAAqB,CADrB,aDhJY,CAAd,sCCmKE,aAAc,CAHd,mBAAoB,CACpB,cAAe,CACf,mBAAoB,CAEpB,QAAS,CACT,SDrKY,CAAd,cC8KE,mBD9KY,CAAd,gDC0LE,yBAA0B,CAC1B,4BAA6B,CAC7B,qBD5LY,CAAd,gBCoME,YDpMY,CAAd,iBC4ME,eD5MY,CAAd,SCoNE,uBDpNY,CAAd,wDC6NE,WD7NY,CAAd,cCsOE,4BAA6B,CAC7B,mBDvOY,CAAd,4BC+OE,uBD/OY,CAAd,6BCwPE,yBAA0B,CAC1B,YDzPY,CAAd,QCiQE,iBDjQY,CAAd,mDCqRE,QDrRY,CAAd,SCyRE,QDzRY,CAAd,gBC0RE,SD1RY,CAAd,WCoSE,eAAgB,CAChB,QAAS,CACT,SDtSY,CAAd,SC8SE,eD9SY,CAAd,qECyTE,aAAwC,CADxC,SDxTY,CAAd,2DCyTE,aAAwC,CADxC,SDxTY,CAAd,yCCyTE,aAAwC,CADxC,SDxTY,CAAd,qBCkUE,cDlUY,CAAd,UCyUE,cDzUY,CAAd,+CC0VE,aAAc,CACd,qBD3VY,CAAd,UCqWE,WAAY,CADZ,cDpWY,CAAd,SC6WE,YD7WY,CEAd,i4B,CFCA,OEDA,yCFCoB,CAApB,+DEDA,gGFCoB,CAApB,mDEDA,qEFCoB,CAApB,wDEDA,0CFCoB,CAApB,oDEDA,4CFCoB,CAApB,4DEDA,2BFCoB,CAApB,4DEDA,2BFCoB,CAApB,8DEDA,2BFCoB,CAApB,8DEDA,2BFCoB,CAApB,4DEDA,2BFCoB,CAApB,4DEDA,2BFCoB,CAApB,8DEDA,2BFCoB,CAApB,8DEDA,2BFCoB,CAApB,8DEDA,uBFCoB,CAApB,oDEDA,yCFCoB,CAApB,+DEDA,8CFCoB,CAApB,+DEDA,6BFCoB,CAApB,oDEDA,qFFCoB,CAApB,4DEDA,iOFCoB,CAApB,mFEDA,kBFCoB,CAApB,iFEDA,mBFCoB,CAApB,oDEDA,2HFCoB,CAApB,2DEDA,eFCoB,CAApB,oDEDA,qHFCoB,CAApB,2DEDA,eFCoB,CAApB,oDEDA,mHFCoB,CAApB,2DEDA,eFCoB,CAApB,oDEDA,kGFCoB,CAApB,2DEDA,eFCoB,CAApB,0DEDA,4BFCoB,CAApB,4DEDA,2FFCoB,CAApB,sDEDA,2DFCoB,CAApB,6DEDA,WFCoB,CAApB,4DEDA,WFCoB,CAApB,wDEDA,2BFCoB,CAApB,qDEDA,mPFCoB,CAApB,0DEDA,iKFCoB,CAApB,iEEDA,YFCoB,CAApB,gEEDA,YFCoB,CAApB,uDEDA,oHFCoB,CAApB,uDEDA,sEFCoB,CAApB,0DEDA,+IFCoB,CAApB,0DEDA,sEFCoB,CAApB,qEEDA,qBFCoB,CAApB,0DEDA,0CFCoB,CAApB,OEDA,g+BFCoB,CAApB,mDEDA,sCFCoB,CAApB,qDEDA,gCFCoB,CAApB,uDEDA,gCFCoB,CAApB,wDEDA,gCFCoB,CAApB,yDEDA,gBFCoB,CAApB,yDEDA,cFCoB,CAApB,oDEDA,kCFCoB,CAApB,uDEDA,mBFCoB,CAApB,uDEDA,mBFCoB,CAApB,yDEDA,oCFCoB,CAApB,oEEDA,iBFCoB,CAApB,mEEDA,oBFCoB,CAApB,oEEDA,iBFCoB,CAApB,mEEDA,oBFCoB,CAApB,yEEDA,oCFCoB,CAApB,sDEDA,YFCoB,CAApB,sDEDA,YFCoB,CAApB,sDEDA,YFCoB,CAApB,sDEDA,YFCoB,CAApB,sEEDA,cFCoB,CAApB,qEEDA,eFCoB,CAApB,sEEDA,cFCoB,CAApB,qEEDA,eFCoB,CAApB,8DEDA,YFCoB,CAApB,6DEDA,eFCoB,CACpB,qBEFA,mBFEmB,CAAnB,QEFA,eFEmB,CAAnB,OEFA,cFEmB,CAAnB,UEFA,iBFEmB,CAAnB,UEFA,iBFEmB,CAAnB,OEFA,KFEmB,CAAnB,SEFA,OFEmB,CAAnB,SEFA,WFEmB,CAAnB,UEFA,YFEmB,CAAnB,SEFA,UFEmB,CAAnB,UEFA,UFEmB,CAAnB,UEFA,UFEmB,CAAnB,MEFA,YFEmB,CAAnB,aEFA,mBFEmB,CAAnB,MEFA,aFEmB,CAAnB,MEFA,WFEmB,CAAnB,KEFA,cFEmB,CAAnB,QEFA,WFEmB,CAAnB,MEFA,WFEmB,CAAnB,cEFA,gBFEmB,CAAnB,QEFA,UFEmB,CAAnB,MEFA,UFEmB,CAAnB,MEFA,UFEmB,CAAnB,KEFA,aFEmB,CAAnB,WEFA,eFEmB,CAAnB,WEFA,SFEmB,CAAnB,MEFA,WFEmB,CAAnB,yBEFA,c,CFEmB,CAAnB,iBEFA,c,CFEmB,CAAnB,eEFA,+GFEmB,CAAnB,oBEFA,kBFEmB,CAAnB,aEFA,WFEmB,CAAnB,UEFA,qBFEmB,CAAnB,cEFA,kBFEmB,CAAnB,gBEFA,sBFEmB,CAAnB,iBEFA,6BFEmB,CAAnB,yCEFA,iIFEmB,CAAnB,yCEFA,+HFEmB,CAAnB,yCEFA,6HFEmB,CAAnB,eEFA,aFEmB,CAAnB,iBEFA,eFEmB,CAAnB,gBEFA,eFEmB,CAAnB,YEFA,qBFEmB,CAAnB,UEFA,cFEmB,CAAnB,UEFA,uBFEmB,CAAnB,UEFA,oBFEmB,CAAnB,UEFA,sBFEmB,CAAnB,iBEFA,4EFEmB,CAAnB,kBEFA,0EFEmB,CAAnB,kBEFA,4EFEmB,CAAnB,gBEFA,4BFEmB,CAAnB,UEFA,wEFEmB,CAAnB,oBEFA,4BFEmB,CAAnB,cEFA,qEFEmB,CAAnB,cEFA,sEFEmB,CAAnB,KEFA,YFEmB,CAAnB,KEFA,cFEmB,CAAnB,MEFA,kBFEmB,CAAnB,YEFA,mBFEmB,CAAnB,YEFA,gBFEmB,CAAnB,UEFA,iCFEmB,CAAnB,SEFA,iCFEmB,CAAnB,SEFA,qCFEmB,CAAnB,YEFA,iEFEmB,CAAnB,eEFA,iEFEmB,CAAnB,cEFA,+DFEmB,CAAnB,gBEFA,iEFEmB,CAAnB,cEFA,iEFEmB,CAAnB,WEFA,SFEmB,CAAnB,aEFA,SFEmB,CAAnB,SEFA,mBFEmB,CAAnB,QEFA,yWFEmB,CAAnB,oBEFA,uGFEmB,CAEnB,KACE,wBACF,CAEA,+BAGE,sCAAwC,CACxC,cAAe,CAFf,qBAAuB,CAGvB,UACF,CAEA,sBACE,0BACF,CAEA,eAQE,eAAiB,CAPjB,WAAY,CAMZ,aAAc,CADd,YAAa,CAFb,MAAO,CAKP,UAAY,CAPZ,iBAAkB,CAClB,KAAM,CAEN,WAKF,CA9BA,2BEAA,sE,CFAA,2BEAA,yE,CFAA,6BEAA,wE","sources":["index.css","../node_modules/codemirror/lib/codemirror.css","../node_modules/codemirror/theme/material.css","App.css","%3Cinput%20css%20JYKPI-%3E","../"],"sourcesContent":["body {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n monospace;\n}\n","/* 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 .CodeMirror-line::selection,\n.cm-fat-cursor .CodeMirror-line > span::selection, \n.cm-fat-cursor .CodeMirror-line > span > span::selection { background: transparent; }\n.cm-fat-cursor .CodeMirror-line::-moz-selection,\n.cm-fat-cursor .CodeMirror-line > span::-moz-selection,\n.cm-fat-cursor .CodeMirror-line > span > span::-moz-selection { background: transparent; }\n.cm-fat-cursor { caret-color: transparent; }\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 z-index: 0;\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 outline: 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","/*\n Name: material\n Author: Mattia Astorino (http://github.com/equinusocio)\n Website: https://material-theme.site/\n*/\n\n.cm-s-material.CodeMirror {\n background-color: #263238;\n color: #EEFFFF;\n}\n\n.cm-s-material .CodeMirror-gutters {\n background: #263238;\n color: #546E7A;\n border: none;\n}\n\n.cm-s-material .CodeMirror-guttermarker,\n.cm-s-material .CodeMirror-guttermarker-subtle,\n.cm-s-material .CodeMirror-linenumber {\n color: #546E7A;\n}\n\n.cm-s-material .CodeMirror-cursor {\n border-left: 1px solid #FFCC00;\n}\n.cm-s-material.cm-fat-cursor .CodeMirror-cursor {\n background-color: #5d6d5c80 !important;\n}\n.cm-s-material .cm-animate-fat-cursor {\n background-color: #5d6d5c80 !important;\n}\n\n.cm-s-material div.CodeMirror-selected {\n background: rgba(128, 203, 196, 0.2);\n}\n\n.cm-s-material.CodeMirror-focused div.CodeMirror-selected {\n background: rgba(128, 203, 196, 0.2);\n}\n\n.cm-s-material .CodeMirror-line::selection,\n.cm-s-material .CodeMirror-line>span::selection,\n.cm-s-material .CodeMirror-line>span>span::selection {\n background: rgba(128, 203, 196, 0.2);\n}\n\n.cm-s-material .CodeMirror-line::-moz-selection,\n.cm-s-material .CodeMirror-line>span::-moz-selection,\n.cm-s-material .CodeMirror-line>span>span::-moz-selection {\n background: rgba(128, 203, 196, 0.2);\n}\n\n.cm-s-material .CodeMirror-activeline-background {\n background: rgba(0, 0, 0, 0.5);\n}\n\n.cm-s-material .cm-keyword {\n color: #C792EA;\n}\n\n.cm-s-material .cm-operator {\n color: #89DDFF;\n}\n\n.cm-s-material .cm-variable-2 {\n color: #EEFFFF;\n}\n\n.cm-s-material .cm-variable-3,\n.cm-s-material .cm-type {\n color: #f07178;\n}\n\n.cm-s-material .cm-builtin {\n color: #FFCB6B;\n}\n\n.cm-s-material .cm-atom {\n color: #F78C6C;\n}\n\n.cm-s-material .cm-number {\n color: #FF5370;\n}\n\n.cm-s-material .cm-def {\n color: #82AAFF;\n}\n\n.cm-s-material .cm-string {\n color: #C3E88D;\n}\n\n.cm-s-material .cm-string-2 {\n color: #f07178;\n}\n\n.cm-s-material .cm-comment {\n color: #546E7A;\n}\n\n.cm-s-material .cm-variable {\n color: #f07178;\n}\n\n.cm-s-material .cm-tag {\n color: #FF5370;\n}\n\n.cm-s-material .cm-meta {\n color: #FFCB6B;\n}\n\n.cm-s-material .cm-attribute {\n color: #C792EA;\n}\n\n.cm-s-material .cm-property {\n color: #C792EA;\n}\n\n.cm-s-material .cm-qualifier {\n color: #DECB6B;\n}\n\n.cm-s-material .cm-variable-3,\n.cm-s-material .cm-type {\n color: #DECB6B;\n}\n\n\n.cm-s-material .cm-error {\n color: rgba(255, 255, 255, 1.0);\n background-color: #FF5370;\n}\n\n.cm-s-material .CodeMirror-matchingbracket {\n text-decoration: underline;\n color: white !important;\n}\n","@tailwind base;\n@tailwind components;\n@tailwind utilities;\n\nbody {\n background-color: #2a3236;\n}\n\n.react-codemirror2,\n.CodeMirror {\n height: 100% !important;\n background-color: transparent !important;\n font-size: 15px;\n z-index:20\n}\n\n.CodeMirror-line > span {\n background-color: #2a323699;\n}\n\n.darken::before {\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n display: block;\n background: black;\n opacity: 0.5;\n}","/*\n1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)\n2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)\n*/\n\n*,\n::before,\n::after {\n box-sizing: border-box; /* 1 */\n border-width: 0; /* 2 */\n border-style: solid; /* 2 */\n border-color: theme('borderColor.DEFAULT', currentColor); /* 2 */\n}\n\n::before,\n::after {\n --tw-content: '';\n}\n\n/*\n1. Use a consistent sensible line-height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n3. Use a more readable tab size.\n4. Use the user's configured `sans` font-family by default.\n*/\n\nhtml {\n line-height: 1.5; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n -moz-tab-size: 4; /* 3 */\n tab-size: 4; /* 3 */\n font-family: theme('fontFamily.sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Noto Sans\", sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"); /* 4 */\n}\n\n/*\n1. Remove the margin in all browsers.\n2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.\n*/\n\nbody {\n margin: 0; /* 1 */\n line-height: inherit; /* 2 */\n}\n\n/*\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n3. Ensure horizontal rules are visible by default.\n*/\n\nhr {\n height: 0; /* 1 */\n color: inherit; /* 2 */\n border-top-width: 1px; /* 3 */\n}\n\n/*\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/\n\nabbr:where([title]) {\n text-decoration: underline dotted;\n}\n\n/*\nRemove the default font size and weight for headings.\n*/\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/*\nReset links to optimize for opt-in styling instead of opt-out.\n*/\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\n/*\nAdd the correct font weight in Edge and Safari.\n*/\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/*\n1. Use the user's configured `mono` font family by default.\n2. Correct the odd `em` font sizing in all browsers.\n*/\n\ncode,\nkbd,\nsamp,\npre {\n font-family: theme('fontFamily.mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace); /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/*\nAdd the correct font size in all browsers.\n*/\n\nsmall {\n font-size: 80%;\n}\n\n/*\nPrevent `sub` and `sup` elements from affecting the line height in all browsers.\n*/\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/*\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n3. Remove gaps between table borders by default.\n*/\n\ntable {\n text-indent: 0; /* 1 */\n border-color: inherit; /* 2 */\n border-collapse: collapse; /* 3 */\n}\n\n/*\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n3. Remove default padding in all browsers.\n*/\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-size: 100%; /* 1 */\n line-height: inherit; /* 1 */\n color: inherit; /* 1 */\n margin: 0; /* 2 */\n padding: 0; /* 3 */\n}\n\n/*\nRemove the inheritance of text transform in Edge and Firefox.\n*/\n\nbutton,\nselect {\n text-transform: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Remove default button styles.\n*/\n\nbutton,\n[type='button'],\n[type='reset'],\n[type='submit'] {\n -webkit-appearance: button; /* 1 */\n background-color: transparent; /* 2 */\n background-image: none; /* 2 */\n}\n\n/*\nUse the modern Firefox focus style for all focusable elements.\n*/\n\n:-moz-focusring {\n outline: auto;\n}\n\n/*\nRemove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)\n*/\n\n:-moz-ui-invalid {\n box-shadow: none;\n}\n\n/*\nAdd the correct vertical alignment in Chrome and Firefox.\n*/\n\nprogress {\n vertical-align: baseline;\n}\n\n/*\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/\n\n::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n height: auto;\n}\n\n/*\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/\n\n[type='search'] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/*\nRemove the inner padding in Chrome and Safari on macOS.\n*/\n\n::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to `inherit` in Safari.\n*/\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/*\nAdd the correct display in Chrome and Safari.\n*/\n\nsummary {\n display: list-item;\n}\n\n/*\nRemoves the default spacing and border for appropriate elements.\n*/\n\nblockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nlegend {\n padding: 0;\n}\n\nol,\nul,\nmenu {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n/*\nPrevent resizing textareas horizontally by default.\n*/\n\ntextarea {\n resize: vertical;\n}\n\n/*\n1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)\n2. Set the default placeholder color to the user's configured gray 400 color.\n*/\n\ninput::placeholder,\ntextarea::placeholder {\n opacity: 1; /* 1 */\n color: theme('colors.gray.400', #9ca3af); /* 2 */\n}\n\n/*\nSet the default cursor for buttons.\n*/\n\nbutton,\n[role=\"button\"] {\n cursor: pointer;\n}\n\n/*\nMake sure disabled buttons don't get the pointer cursor.\n*/\n:disabled {\n cursor: default;\n}\n\n/*\n1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)\n2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)\n This can trigger a poorly considered lint error in some tools but is included by design.\n*/\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block; /* 1 */\n vertical-align: middle; /* 2 */\n}\n\n/*\nConstrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)\n*/\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n/*\nEnsure the default browser behavior of the `hidden` attribute.\n*/\n\n[hidden] {\n display: none;\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/docs/static/js/787.8f7ec9e0.chunk.js b/docs/static/js/787.8f7ec9e0.chunk.js new file mode 100644 index 00000000..9b686689 --- /dev/null +++ b/docs/static/js/787.8f7ec9e0.chunk.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunk_strudel_repl=self.webpackChunk_strudel_repl||[]).push([[787],{787:function(e,t,n){n.r(t),n.d(t,{getCLS:function(){return y},getFCP:function(){return g},getFID:function(){return C},getLCP:function(){return P},getTTFB:function(){return D}});var i,r,a,o,u=function(e,t){return{name:e,value:void 0===t?-1:t,delta:0,entries:[],id:"v2-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12)}},c=function(e,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){if("first-input"===e&&!("PerformanceEventTiming"in self))return;var n=new PerformanceObserver((function(e){return e.getEntries().map(t)}));return n.observe({type:e,buffered:!0}),n}}catch(e){}},f=function(e,t){var n=function n(i){"pagehide"!==i.type&&"hidden"!==document.visibilityState||(e(i),t&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},s=function(e){addEventListener("pageshow",(function(t){t.persisted&&e(t)}),!0)},m=function(e,t,n){var i;return function(r){t.value>=0&&(r||n)&&(t.delta=t.value-(i||0),(t.delta||void 0===i)&&(i=t.value,e(t)))}},v=-1,p=function(){return"hidden"===document.visibilityState?0:1/0},d=function(){f((function(e){var t=e.timeStamp;v=t}),!0)},l=function(){return v<0&&(v=p(),d(),s((function(){setTimeout((function(){v=p(),d()}),0)}))),{get firstHiddenTime(){return v}}},g=function(e,t){var n,i=l(),r=u("FCP"),a=function(e){"first-contentful-paint"===e.name&&(f&&f.disconnect(),e.startTime-1&&e(t)},r=u("CLS",0),a=0,o=[],v=function(e){if(!e.hadRecentInput){var t=o[0],i=o[o.length-1];a&&e.startTime-i.startTime<1e3&&e.startTime-t.startTime<5e3?(a+=e.value,o.push(e)):(a=e.value,o=[e]),a>r.value&&(r.value=a,r.entries=o,n())}},p=c("layout-shift",v);p&&(n=m(i,r,t),f((function(){p.takeRecords().map(v),n(!0)})),s((function(){a=0,T=-1,r=u("CLS",0),n=m(i,r,t)})))},E={passive:!0,capture:!0},w=new Date,L=function(e,t){i||(i=t,r=e,a=new Date,F(removeEventListener),S())},S=function(){if(r>=0&&r1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){L(e,t),r()},i=function(){r()},r=function(){removeEventListener("pointerup",n,E),removeEventListener("pointercancel",i,E)};addEventListener("pointerup",n,E),addEventListener("pointercancel",i,E)}(t,e):L(t,e)}},F=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,b,E)}))},C=function(e,t){var n,a=l(),v=u("FID"),p=function(e){e.startTimeperformance.now())return;n.entries=[t],e(n)}catch(e){}},"complete"===document.readyState?setTimeout(t,0):addEventListener("load",(function(){return setTimeout(t,0)}))}}}]); +//# sourceMappingURL=787.8f7ec9e0.chunk.js.map \ No newline at end of file diff --git a/docs/static/js/787.8f7ec9e0.chunk.js.map b/docs/static/js/787.8f7ec9e0.chunk.js.map new file mode 100644 index 00000000..eb3cae2a --- /dev/null +++ b/docs/static/js/787.8f7ec9e0.chunk.js.map @@ -0,0 +1 @@ +{"version":3,"file":"static/js/787.8f7ec9e0.chunk.js","mappings":"+QAAA,IAAIA,EAAEC,EAAEC,EAAEC,EAAEC,EAAE,SAASJ,EAAEC,GAAG,MAAM,CAACI,KAAKL,EAAEM,WAAM,IAASL,GAAG,EAAEA,EAAEM,MAAM,EAAEC,QAAQ,GAAGC,GAAG,MAAMC,OAAOC,KAAKC,MAAM,KAAKF,OAAOG,KAAKC,MAAM,cAAcD,KAAKE,UAAU,QAAQC,EAAE,SAAShB,EAAEC,GAAG,IAAI,GAAGgB,oBAAoBC,oBAAoBC,SAASnB,GAAG,CAAC,GAAG,gBAAgBA,KAAK,2BAA2BoB,MAAM,OAAO,IAAIlB,EAAE,IAAIe,qBAAqB,SAASjB,GAAG,OAAOA,EAAEqB,aAAaC,IAAIrB,MAAM,OAAOC,EAAEqB,QAAQ,CAACC,KAAKxB,EAAEyB,UAAS,IAAKvB,GAAG,MAAMF,MAAM0B,EAAE,SAAS1B,EAAEC,GAAG,IAAIC,EAAE,SAASA,EAAEC,GAAG,aAAaA,EAAEqB,MAAM,WAAWG,SAASC,kBAAkB5B,EAAEG,GAAGF,IAAI4B,oBAAoB,mBAAmB3B,GAAE,GAAI2B,oBAAoB,WAAW3B,GAAE,MAAO4B,iBAAiB,mBAAmB5B,GAAE,GAAI4B,iBAAiB,WAAW5B,GAAE,IAAK6B,EAAE,SAAS/B,GAAG8B,iBAAiB,YAAY,SAAS7B,GAAGA,EAAE+B,WAAWhC,EAAEC,MAAK,IAAKgC,EAAE,SAASjC,EAAEC,EAAEC,GAAG,IAAIC,EAAE,OAAO,SAASC,GAAGH,EAAEK,OAAO,IAAIF,GAAGF,KAAKD,EAAEM,MAAMN,EAAEK,OAAOH,GAAG,IAAIF,EAAEM,YAAO,IAASJ,KAAKA,EAAEF,EAAEK,MAAMN,EAAEC,OAAOiC,GAAG,EAAEC,EAAE,WAAW,MAAM,WAAWR,SAASC,gBAAgB,EAAE,KAAKQ,EAAE,WAAWV,GAAG,SAAS1B,GAAG,IAAIC,EAAED,EAAEqC,UAAUH,EAAEjC,KAAI,IAAKqC,EAAE,WAAW,OAAOJ,EAAE,IAAIA,EAAEC,IAAIC,IAAIL,GAAG,WAAWQ,YAAY,WAAWL,EAAEC,IAAIC,MAAM,OAAO,CAAKI,sBAAkB,OAAON,KAAKO,EAAE,SAASzC,EAAEC,GAAG,IAAIC,EAAEC,EAAEmC,IAAIZ,EAAEtB,EAAE,OAAO8B,EAAE,SAASlC,GAAG,2BAA2BA,EAAEK,OAAO+B,GAAGA,EAAEM,aAAa1C,EAAE2C,UAAUxC,EAAEqC,kBAAkBd,EAAEpB,MAAMN,EAAE2C,UAAUjB,EAAElB,QAAQoC,KAAK5C,GAAGE,GAAE,MAAOiC,EAAEU,OAAOC,aAAaA,YAAYC,kBAAkBD,YAAYC,iBAAiB,0BAA0B,GAAGX,EAAED,EAAE,KAAKnB,EAAE,QAAQkB,IAAIC,GAAGC,KAAKlC,EAAE+B,EAAEjC,EAAE0B,EAAEzB,GAAGkC,GAAGD,EAAEC,GAAGJ,GAAG,SAAS5B,GAAGuB,EAAEtB,EAAE,OAAOF,EAAE+B,EAAEjC,EAAE0B,EAAEzB,GAAG+C,uBAAuB,WAAWA,uBAAuB,WAAWtB,EAAEpB,MAAMwC,YAAYlC,MAAMT,EAAEkC,UAAUnC,GAAE,cAAe+C,GAAE,EAAGC,GAAG,EAAEC,EAAE,SAASnD,EAAEC,GAAGgD,IAAIR,GAAG,SAASzC,GAAGkD,EAAElD,EAAEM,SAAS2C,GAAE,GAAI,IAAI/C,EAAEC,EAAE,SAASF,GAAGiD,GAAG,GAAGlD,EAAEC,IAAIiC,EAAE9B,EAAE,MAAM,GAAG+B,EAAE,EAAEC,EAAE,GAAGE,EAAE,SAAStC,GAAG,IAAIA,EAAEoD,eAAe,CAAC,IAAInD,EAAEmC,EAAE,GAAGjC,EAAEiC,EAAEA,EAAEiB,OAAO,GAAGlB,GAAGnC,EAAE2C,UAAUxC,EAAEwC,UAAU,KAAK3C,EAAE2C,UAAU1C,EAAE0C,UAAU,KAAKR,GAAGnC,EAAEM,MAAM8B,EAAEQ,KAAK5C,KAAKmC,EAAEnC,EAAEM,MAAM8B,EAAE,CAACpC,IAAImC,EAAED,EAAE5B,QAAQ4B,EAAE5B,MAAM6B,EAAED,EAAE1B,QAAQ4B,EAAElC,OAAOiD,EAAEnC,EAAE,eAAesB,GAAGa,IAAIjD,EAAE+B,EAAE9B,EAAE+B,EAAEjC,GAAGyB,GAAG,WAAWyB,EAAEG,cAAchC,IAAIgB,GAAGpC,GAAE,MAAO6B,GAAG,WAAWI,EAAE,EAAEe,GAAG,EAAEhB,EAAE9B,EAAE,MAAM,GAAGF,EAAE+B,EAAE9B,EAAE+B,EAAEjC,QAAQsD,EAAE,CAACC,SAAQ,EAAGC,SAAQ,GAAIC,EAAE,IAAI/C,KAAKgD,EAAE,SAASxD,EAAEC,GAAGJ,IAAIA,EAAEI,EAAEH,EAAEE,EAAED,EAAE,IAAIS,KAAKiD,EAAE/B,qBAAqBgC,MAAMA,EAAE,WAAW,GAAG5D,GAAG,GAAGA,EAAEC,EAAEwD,EAAE,CAAC,IAAItD,EAAE,CAAC0D,UAAU,cAAczD,KAAKL,EAAEwB,KAAKuC,OAAO/D,EAAE+D,OAAOC,WAAWhE,EAAEgE,WAAWrB,UAAU3C,EAAEqC,UAAU4B,gBAAgBjE,EAAEqC,UAAUpC,GAAGE,EAAE+D,SAAS,SAASlE,GAAGA,EAAEI,MAAMD,EAAE,KAAKgE,EAAE,SAASnE,GAAG,GAAGA,EAAEgE,WAAW,CAAC,IAAI/D,GAAGD,EAAEqC,UAAU,KAAK,IAAI1B,KAAKmC,YAAYlC,OAAOZ,EAAEqC,UAAU,eAAerC,EAAEwB,KAAK,SAASxB,EAAEC,GAAG,IAAIC,EAAE,WAAWyD,EAAE3D,EAAEC,GAAGG,KAAKD,EAAE,WAAWC,KAAKA,EAAE,WAAWyB,oBAAoB,YAAY3B,EAAEqD,GAAG1B,oBAAoB,gBAAgB1B,EAAEoD,IAAIzB,iBAAiB,YAAY5B,EAAEqD,GAAGzB,iBAAiB,gBAAgB3B,EAAEoD,GAA9N,CAAkOtD,EAAED,GAAG2D,EAAE1D,EAAED,KAAK4D,EAAE,SAAS5D,GAAG,CAAC,YAAY,UAAU,aAAa,eAAekE,SAAS,SAASjE,GAAG,OAAOD,EAAEC,EAAEkE,EAAEZ,OAAOa,EAAE,SAASlE,EAAEgC,GAAG,IAAIC,EAAEC,EAAEE,IAAIG,EAAErC,EAAE,OAAO6C,EAAE,SAASjD,GAAGA,EAAE2C,UAAUP,EAAEI,kBAAkBC,EAAEnC,MAAMN,EAAEiE,gBAAgBjE,EAAE2C,UAAUF,EAAEjC,QAAQoC,KAAK5C,GAAGmC,GAAE,KAAMe,EAAElC,EAAE,cAAciC,GAAGd,EAAEF,EAAE/B,EAAEuC,EAAEP,GAAGgB,GAAGxB,GAAG,WAAWwB,EAAEI,cAAchC,IAAI2B,GAAGC,EAAER,gBAAe,GAAIQ,GAAGnB,GAAG,WAAW,IAAIf,EAAEyB,EAAErC,EAAE,OAAO+B,EAAEF,EAAE/B,EAAEuC,EAAEP,GAAG/B,EAAE,GAAGF,GAAG,EAAED,EAAE,KAAK4D,EAAE9B,kBAAkBd,EAAEiC,EAAE9C,EAAEyC,KAAK5B,GAAG6C,QAAQQ,EAAE,GAAGC,EAAE,SAAStE,EAAEC,GAAG,IAAIC,EAAEC,EAAEmC,IAAIJ,EAAE9B,EAAE,OAAO+B,EAAE,SAASnC,GAAG,IAAIC,EAAED,EAAE2C,UAAU1C,EAAEE,EAAEqC,kBAAkBN,EAAE5B,MAAML,EAAEiC,EAAE1B,QAAQoC,KAAK5C,GAAGE,MAAMkC,EAAEpB,EAAE,2BAA2BmB,GAAG,GAAGC,EAAE,CAAClC,EAAE+B,EAAEjC,EAAEkC,EAAEjC,GAAG,IAAIwC,EAAE,WAAW4B,EAAEnC,EAAEzB,MAAM2B,EAAEkB,cAAchC,IAAIa,GAAGC,EAAEM,aAAa2B,EAAEnC,EAAEzB,KAAI,EAAGP,GAAE,KAAM,CAAC,UAAU,SAASgE,SAAS,SAASlE,GAAG8B,iBAAiB9B,EAAEyC,EAAE,CAAC8B,MAAK,EAAGd,SAAQ,OAAQ/B,EAAEe,GAAE,GAAIV,GAAG,SAAS5B,GAAG+B,EAAE9B,EAAE,OAAOF,EAAE+B,EAAEjC,EAAEkC,EAAEjC,GAAG+C,uBAAuB,WAAWA,uBAAuB,WAAWd,EAAE5B,MAAMwC,YAAYlC,MAAMT,EAAEkC,UAAUgC,EAAEnC,EAAEzB,KAAI,EAAGP,GAAE,cAAesE,EAAE,SAASxE,GAAG,IAAIC,EAAEC,EAAEE,EAAE,QAAQH,EAAE,WAAW,IAAI,IAAIA,EAAE6C,YAAY2B,iBAAiB,cAAc,IAAI,WAAW,IAAIzE,EAAE8C,YAAY4B,OAAOzE,EAAE,CAAC6D,UAAU,aAAanB,UAAU,GAAG,IAAI,IAAIzC,KAAKF,EAAE,oBAAoBE,GAAG,WAAWA,IAAID,EAAEC,GAAGW,KAAK8D,IAAI3E,EAAEE,GAAGF,EAAE4E,gBAAgB,IAAI,OAAO3E,EAAhL,GAAqL,GAAGC,EAAEI,MAAMJ,EAAEK,MAAMN,EAAE4E,cAAc3E,EAAEI,MAAM,GAAGJ,EAAEI,MAAMwC,YAAYlC,MAAM,OAAOV,EAAEM,QAAQ,CAACP,GAAGD,EAAEE,GAAG,MAAMF,MAAM,aAAa2B,SAASmD,WAAWvC,WAAWtC,EAAE,GAAG6B,iBAAiB,QAAQ,WAAW,OAAOS,WAAWtC,EAAE","sources":["../node_modules/web-vitals/dist/web-vitals.js"],"sourcesContent":["var e,t,n,i,r=function(e,t){return{name:e,value:void 0===t?-1:t,delta:0,entries:[],id:\"v2-\".concat(Date.now(),\"-\").concat(Math.floor(8999999999999*Math.random())+1e12)}},a=function(e,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){if(\"first-input\"===e&&!(\"PerformanceEventTiming\"in self))return;var n=new PerformanceObserver((function(e){return e.getEntries().map(t)}));return n.observe({type:e,buffered:!0}),n}}catch(e){}},o=function(e,t){var n=function n(i){\"pagehide\"!==i.type&&\"hidden\"!==document.visibilityState||(e(i),t&&(removeEventListener(\"visibilitychange\",n,!0),removeEventListener(\"pagehide\",n,!0)))};addEventListener(\"visibilitychange\",n,!0),addEventListener(\"pagehide\",n,!0)},u=function(e){addEventListener(\"pageshow\",(function(t){t.persisted&&e(t)}),!0)},c=function(e,t,n){var i;return function(r){t.value>=0&&(r||n)&&(t.delta=t.value-(i||0),(t.delta||void 0===i)&&(i=t.value,e(t)))}},f=-1,s=function(){return\"hidden\"===document.visibilityState?0:1/0},m=function(){o((function(e){var t=e.timeStamp;f=t}),!0)},v=function(){return f<0&&(f=s(),m(),u((function(){setTimeout((function(){f=s(),m()}),0)}))),{get firstHiddenTime(){return f}}},d=function(e,t){var n,i=v(),o=r(\"FCP\"),f=function(e){\"first-contentful-paint\"===e.name&&(m&&m.disconnect(),e.startTime-1&&e(t)},f=r(\"CLS\",0),s=0,m=[],v=function(e){if(!e.hadRecentInput){var t=m[0],i=m[m.length-1];s&&e.startTime-i.startTime<1e3&&e.startTime-t.startTime<5e3?(s+=e.value,m.push(e)):(s=e.value,m=[e]),s>f.value&&(f.value=s,f.entries=m,n())}},h=a(\"layout-shift\",v);h&&(n=c(i,f,t),o((function(){h.takeRecords().map(v),n(!0)})),u((function(){s=0,l=-1,f=r(\"CLS\",0),n=c(i,f,t)})))},T={passive:!0,capture:!0},y=new Date,g=function(i,r){e||(e=r,t=i,n=new Date,w(removeEventListener),E())},E=function(){if(t>=0&&t1e12?new Date:performance.now())-e.timeStamp;\"pointerdown\"==e.type?function(e,t){var n=function(){g(e,t),r()},i=function(){r()},r=function(){removeEventListener(\"pointerup\",n,T),removeEventListener(\"pointercancel\",i,T)};addEventListener(\"pointerup\",n,T),addEventListener(\"pointercancel\",i,T)}(t,e):g(t,e)}},w=function(e){[\"mousedown\",\"keydown\",\"touchstart\",\"pointerdown\"].forEach((function(t){return e(t,S,T)}))},L=function(n,f){var s,m=v(),d=r(\"FID\"),p=function(e){e.startTimeperformance.now())return;n.entries=[t],e(n)}catch(e){}},\"complete\"===document.readyState?setTimeout(t,0):addEventListener(\"load\",(function(){return setTimeout(t,0)}))};export{h as getCLS,d as getFCP,L as getFID,F as getLCP,P as getTTFB};\n"],"names":["e","t","n","i","r","name","value","delta","entries","id","concat","Date","now","Math","floor","random","a","PerformanceObserver","supportedEntryTypes","includes","self","getEntries","map","observe","type","buffered","o","document","visibilityState","removeEventListener","addEventListener","u","persisted","c","f","s","m","timeStamp","v","setTimeout","firstHiddenTime","d","disconnect","startTime","push","window","performance","getEntriesByName","requestAnimationFrame","p","l","h","hadRecentInput","length","takeRecords","T","passive","capture","y","g","w","E","entryType","target","cancelable","processingStart","forEach","S","L","b","F","once","P","getEntriesByType","timing","max","navigationStart","responseStart","readyState"],"sourceRoot":""} \ No newline at end of file diff --git a/docs/static/js/main.77e38ada.js b/docs/static/js/main.77e38ada.js new file mode 100644 index 00000000..c3d7db08 --- /dev/null +++ b/docs/static/js/main.77e38ada.js @@ -0,0 +1,3 @@ +/*! For license information please see main.77e38ada.js.LICENSE.txt */ +(function(){var __webpack_modules__={935:function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0&&h<=127?h:null,v=void 0===s?null:440*Math.pow(2,(h-69)/12);var y,g;return{empty:!1,acc:r,alt:a,chroma:p,coord:u,freq:v,height:h,letter:n,midi:d,name:c,oct:s,pc:l,step:o}}(e):c(e)?E(function(e){var t=e.step,n=e.alt,r=e.oct,i=y(t);if(!i)return"";var o=i+g(n);return r||0===r?o+r:o}(e)):u(e)?E(e.name):m;return v.set(e,n),n}var b=/^([a-gA-G]?)(#{1,}|b{1,}|x{1,}|)(-?\d*)\s*(.*)$/;function D(e){var t=b.exec(e);return[t[1].toUpperCase(),t[2].replace(/x/g,"##"),t[3],t[4]]}function A(e){return E(d(e))}var k=[0,2,4,5,7,9,11];var C={empty:!0,name:"",acc:""},x=new RegExp("^([-+]?\\d+)(d{1,4}|m|M|P|A{1,4})|(AA|A|P|M|m|d|dd)([-+]?\\d+)$");function w(e){var t=x.exec("".concat(e));return null===t?["",""]:t[1]?[t[1],t[2]]:[t[4],t[3]]}var S={};function T(e){return"string"===typeof e?S[e]||(S[e]=function(e){var t=w(e);if(""===t[0])return C;var n=+t[0],r=t[1],i=(Math.abs(n)-1)%7,o=M[i];if("M"===o&&"P"===r)return C;var a="M"===o?"majorable":"perfectable",s=""+n+r,u=n<0?-1:1,c=8===n||-8===n?n:u*(i+1),l=function(e,t){return"M"===t&&"majorable"===e||"P"===t&&"perfectable"===e?0:"m"===t&&"majorable"===e?-1:/^A+$/.test(t)?t.length:/^d+$/.test(t)?-1*("perfectable"===e?t.length:t.length+1):0}(a,r),p=Math.floor((Math.abs(n)-1)/7),h=u*(F[i]+l+12*p),d=(u*(F[i]+l)%12+12)%12,m=f({step:i,alt:l,oct:p,dir:u});return{empty:!1,name:s,num:n,q:r,step:i,alt:l,dir:u,type:a,simple:c,semitones:h,chroma:d,coord:m,oct:p}}(e)):c(e)?T(function(e){var t=e.step,n=e.alt,r=e.oct,i=void 0===r?0:r,o=e.dir;if(!o)return"";var s=t+1+7*i;return(o<0?"-":"")+(0===s?t+1:s)+function(e,t){return 0===t?"majorable"===e?"M":"P":-1===t&&"majorable"===e?"m":t>0?a("A",t):a("d","perfectable"===e?t:t+1)}("M"===M[t]?"majorable":"perfectable",n)}(e)):u(e)?T(e.name):C}var F=[0,2,4,5,7,9,11],M="PMMPPMM";function q(e,t){var n=(0,o.Z)(e,2),r=n[0],i=n[1],a=void 0===i?0:i;return T(d(t||7*r+12*a<0?[-r,-a,-1]:[r,a,1]))}function B(e,t){var n=E(e),r=T(t);if(n.empty||r.empty)return"";var i=n.coord,o=r.coord;return A(1===i.length?[i[0]+o[0]]:[i[0]+o[0],i[1]+o[1]]).name}function O(e,t){var n=E(e),r=E(t);if(n.empty||r.empty)return"";var i=n.coord,o=r.coord,a=o[0]-i[0];return q([a,2===i.length&&2===o.length?o[1]-i[1]:-Math.floor(7*a/12)],r.height===n.height&&null!==r.midi&&null!==n.midi&&n.step>r.step).name}var P=function(e,t){return Array(t+1).join(e)},I=/^(_{1,}|=|\^{1,}|)([abcdefgABCDEFG])([,']*)$/;function N(e){var t=I.exec(e);return t?[t[1],t[2],t[3]]:["","",""]}function R(e){var t=N(e),n=(0,o.Z)(t,3),r=n[0],i=n[1],a=n[2];if(""===i)return"";for(var s=4,u=0;u96?i.toUpperCase()+c+(s+1):i+c+s}function L(e){var t=E(e);if(t.empty||!t.oct&&0!==t.oct)return"";var n=t.letter,r=t.acc,i=t.oct;return("b"===r[0]?r.replace(/b/g,"_"):r.replace(/#/g,"^"))+(i>4?n.toLowerCase():n)+(5===i?"":i>4?P("'",i-5):P(",",4-i))}var j={abcToScientificNotation:R,scientificToAbcNotation:L,tokenize:N,transpose:function(e,t){return L(B(R(e),t))},distance:function(e,t){return O(R(e),R(t))}};function W(e,t){return e1&&void 0!==arguments[1]?arguments[1]:Math.random,i=e.length;i;)t=Math.floor(r()*i--),n=e[i],e[i]=e[t],e[t]=n;return e}function U(e){return 0===e.length?[[]]:U(e.slice(1)).reduce((function(t,n){return t.concat(e.map((function(t,r){var i=n.slice();return i.splice(r,0,e[0]),i})))}),[])}var Y=n(1413),K=n(4942);function X(e,t){return e1&&void 0!==arguments[1]?arguments[1]:Math.random,i=e.length;i;)t=Math.floor(r()*i--),n=e[i],e[i]=e[t],e[t]=n;return e}},ee=$,te={empty:!0,name:"",setNum:0,chroma:"000000000000",normalized:"000000000000",intervals:[]},ne=function(e){return Number(e).toString(2)},re=function(e){return parseInt(e,2)},ie=/^[01]{12}$/;function oe(e){return ie.test(e)}var ae=(0,K.Z)({},te.chroma,te);function se(e){var t,n=oe(e)?e:"number"===typeof(t=e)&&t>=0&&t<=4095?ne(e):Array.isArray(e)?function(e){if(0===e.length)return te.chroma;for(var t,n=[0,0,0,0,0,0,0,0,0,0,0,0],r=0;r=2048})).sort()[0],r=ne(n),i=function(e){for(var t=[],n=0;n<12;n++)"1"===e.charAt(n)&&t.push(ce[n]);return t}(e);return{empty:!1,name:"",setNum:t,chroma:e,normalized:r,intervals:i}}(n)}var ue=s("Pcset.pcset","Pcset.get",se),ce=["1P","2m","2M","3m","3M","4P","5d","5P","6m","6M","7m","7M"];function le(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=se(e),r=n.chroma.split("");return Q(r.map((function(e,n){var i=J(n,r);return t&&"0"===i[0]?null:i.join("")})))}function pe(e){var t=se(e).setNum;return function(e){var n=se(e).setNum;return t&&t!==n&&(n&t)===n}}function fe(e){var t=se(e).setNum;return function(e){var n=se(e).setNum;return t&&t!==n&&(n|t)===n}}function he(e){var t=se(e);return function(e){var n=E(e);return t&&!n.empty&&"1"===t.chroma.charAt(n.chroma)}}var de={get:se,chroma:function(e){return se(e).chroma},num:function(e){return se(e).setNum},intervals:function(e){return se(e).intervals},chromas:function(){return X(2048,4095).map(ne)},isSupersetOf:fe,isSubsetOf:pe,isNoteIncludedIn:he,isEqual:function(e,t){return se(e).setNum===se(t).setNum},filter:function(e){var t=he(e);return function(e){return e.filter(t)}},modes:le,pcset:ue};var me=(0,Y.Z)((0,Y.Z)({},te),{},{name:"",quality:"Unknown",intervals:[],aliases:[]}),ve=[],ye={};function ge(e){return ye[e]||me}var _e=s("ChordType.chordType","ChordType.get",ge);function Ee(){return ve.slice()}var be=s("ChordType.entries","ChordType.all",Ee);function De(e,t,n){var r=function(e){var t=function(t){return-1!==e.indexOf(t)};return t("5A")?"Augmented":t("3M")?"Major":t("5d")?"Diminished":t("3m")?"Minor":"Unknown"}(e),i=(0,Y.Z)((0,Y.Z)({},se(e)),{},{name:n||"",quality:r,intervals:e,aliases:t});ve.push(i),i.name&&(ye[i.name]=i),ye[i.setNum]=i,ye[i.chroma]=i,i.aliases.forEach((function(e){return function(e,t){ye[t]=e}(i,e)}))}[["1P 3M 5P","major","M ^ "],["1P 3M 5P 7M","major seventh","maj7 \u0394 ma7 M7 Maj7 ^7"],["1P 3M 5P 7M 9M","major ninth","maj9 \u03949 ^9"],["1P 3M 5P 7M 9M 13M","major thirteenth","maj13 Maj13 ^13"],["1P 3M 5P 6M","sixth","6 add6 add13 M6"],["1P 3M 5P 6M 9M","sixth/ninth","6/9 69 M69"],["1P 3M 6m 7M","major seventh flat sixth","M7b6 ^7b6"],["1P 3M 5P 7M 11A","major seventh sharp eleventh","maj#4 \u0394#4 \u0394#11 M7#11 ^7#11 maj7#11"],["1P 3m 5P","minor","m min -"],["1P 3m 5P 7m","minor seventh","m7 min7 mi7 -7"],["1P 3m 5P 7M","minor/major seventh","m/ma7 m/maj7 mM7 mMaj7 m/M7 -\u03947 m\u0394 -^7"],["1P 3m 5P 6M","minor sixth","m6 -6"],["1P 3m 5P 7m 9M","minor ninth","m9 -9"],["1P 3m 5P 7M 9M","minor/major ninth","mM9 mMaj9 -^9"],["1P 3m 5P 7m 9M 11P","minor eleventh","m11 -11"],["1P 3m 5P 7m 9M 13M","minor thirteenth","m13 -13"],["1P 3m 5d","diminished","dim \xb0 o"],["1P 3m 5d 7d","diminished seventh","dim7 \xb07 o7"],["1P 3m 5d 7m","half-diminished","m7b5 \xf8 -7b5 h7 h"],["1P 3M 5P 7m","dominant seventh","7 dom"],["1P 3M 5P 7m 9M","dominant ninth","9"],["1P 3M 5P 7m 9M 13M","dominant thirteenth","13"],["1P 3M 5P 7m 11A","lydian dominant seventh","7#11 7#4"],["1P 3M 5P 7m 9m","dominant flat ninth","7b9"],["1P 3M 5P 7m 9A","dominant sharp ninth","7#9"],["1P 3M 7m 9m","altered","alt7"],["1P 4P 5P","suspended fourth","sus4 sus"],["1P 2M 5P","suspended second","sus2"],["1P 4P 5P 7m","suspended fourth seventh","7sus4 7sus"],["1P 5P 7m 9M 11P","eleventh","11"],["1P 4P 5P 7m 9m","suspended fourth flat ninth","b9sus phryg 7b9sus 7b9sus4"],["1P 5P","fifth","5"],["1P 3M 5A","augmented","aug + +5 ^#5"],["1P 3m 5A","minor augmented","m#5 -#5 m+"],["1P 3M 5A 7M","augmented seventh","maj7#5 maj7+5 +maj7 ^7#5"],["1P 3M 5P 7M 9M 11A","major sharp eleventh (lydian)","maj9#11 \u03949#11 ^9#11"],["1P 2M 4P 5P","","sus24 sus4add9"],["1P 3M 5A 7M 9M","","maj9#5 Maj9#5"],["1P 3M 5A 7m","","7#5 +7 7+ 7aug aug7"],["1P 3M 5A 7m 9A","","7#5#9 7#9#5 7alt"],["1P 3M 5A 7m 9M","","9#5 9+"],["1P 3M 5A 7m 9M 11A","","9#5#11"],["1P 3M 5A 7m 9m","","7#5b9 7b9#5"],["1P 3M 5A 7m 9m 11A","","7#5b9#11"],["1P 3M 5A 9A","","+add#9"],["1P 3M 5A 9M","","M#5add9 +add9"],["1P 3M 5P 6M 11A","","M6#11 M6b5 6#11 6b5"],["1P 3M 5P 6M 7M 9M","","M7add13"],["1P 3M 5P 6M 9M 11A","","69#11"],["1P 3m 5P 6M 9M","","m69 -69"],["1P 3M 5P 6m 7m","","7b6"],["1P 3M 5P 7M 9A 11A","","maj7#9#11"],["1P 3M 5P 7M 9M 11A 13M","","M13#11 maj13#11 M13+4 M13#4"],["1P 3M 5P 7M 9m","","M7b9"],["1P 3M 5P 7m 11A 13m","","7#11b13 7b5b13"],["1P 3M 5P 7m 13M","","7add6 67 7add13"],["1P 3M 5P 7m 9A 11A","","7#9#11 7b5#9 7#9b5"],["1P 3M 5P 7m 9A 11A 13M","","13#9#11"],["1P 3M 5P 7m 9A 11A 13m","","7#9#11b13"],["1P 3M 5P 7m 9A 13M","","13#9"],["1P 3M 5P 7m 9A 13m","","7#9b13"],["1P 3M 5P 7m 9M 11A","","9#11 9+4 9#4"],["1P 3M 5P 7m 9M 11A 13M","","13#11 13+4 13#4"],["1P 3M 5P 7m 9M 11A 13m","","9#11b13 9b5b13"],["1P 3M 5P 7m 9m 11A","","7b9#11 7b5b9 7b9b5"],["1P 3M 5P 7m 9m 11A 13M","","13b9#11"],["1P 3M 5P 7m 9m 11A 13m","","7b9b13#11 7b9#11b13 7b5b9b13"],["1P 3M 5P 7m 9m 13M","","13b9"],["1P 3M 5P 7m 9m 13m","","7b9b13"],["1P 3M 5P 7m 9m 9A","","7b9#9"],["1P 3M 5P 9M","","Madd9 2 add9 add2"],["1P 3M 5P 9m","","Maddb9"],["1P 3M 5d","","Mb5"],["1P 3M 5d 6M 7m 9M","","13b5"],["1P 3M 5d 7M","","M7b5"],["1P 3M 5d 7M 9M","","M9b5"],["1P 3M 5d 7m","","7b5"],["1P 3M 5d 7m 9M","","9b5"],["1P 3M 7m","","7no5"],["1P 3M 7m 13m","","7b13"],["1P 3M 7m 9M","","9no5"],["1P 3M 7m 9M 13M","","13no5"],["1P 3M 7m 9M 13m","","9b13"],["1P 3m 4P 5P","","madd4"],["1P 3m 5P 6m 7M","","mMaj7b6"],["1P 3m 5P 6m 7M 9M","","mMaj9b6"],["1P 3m 5P 7m 11P","","m7add11 m7add4"],["1P 3m 5P 9M","","madd9"],["1P 3m 5d 6M 7M","","o7M7"],["1P 3m 5d 7M","","oM7"],["1P 3m 6m 7M","","mb6M7"],["1P 3m 6m 7m","","m7#5"],["1P 3m 6m 7m 9M","","m9#5"],["1P 3m 5A 7m 9M 11P","","m11A"],["1P 3m 6m 9m","","mb6b9"],["1P 2M 3m 5d 7m","","m9b5"],["1P 4P 5A 7M","","M7#5sus4"],["1P 4P 5A 7M 9M","","M9#5sus4"],["1P 4P 5A 7m","","7#5sus4"],["1P 4P 5P 7M","","M7sus4"],["1P 4P 5P 7M 9M","","M9sus4"],["1P 4P 5P 7m 9M","","9sus4 9sus"],["1P 4P 5P 7m 9M 13M","","13sus4 13sus"],["1P 4P 5P 7m 9m 13m","","7sus4b9b13 7b9b13sus4"],["1P 4P 7m 10m","","4 quartal"],["1P 5P 7m 9m 11P","","11b9"]].forEach((function(e){var t=(0,o.Z)(e,3),n=t[0],r=t[1],i=t[2];return De(n.split(" "),i.split(" "),r)})),ve.sort((function(e,t){return e.setNum-t.setNum}));var Ae={names:function(){return ve.map((function(e){return e.name})).filter((function(e){return e}))},symbols:function(){return ve.map((function(e){return e.aliases[0]})).filter((function(e){return e}))},get:ge,all:Ee,add:De,removeAll:function(){ve=[],ye={}},keys:function(){return Object.keys(ye)},entries:be,chordType:_e};function ke(e){var t=e.map((function(e){return E(e).pc})).filter((function(e){return e}));if(0===E.length)return[];var n=function(e,t){var n=e[0],r=E(n).chroma,i=function(e){var t=e.reduce((function(e,t){var n=E(t).chroma;return void 0!==n&&(e[n]=e[n]||E(t).name),e}),{});return function(e){return t[e]}}(e),o=le(e,!1),a=[];return o.forEach((function(e,o){var s=Ee().filter((function(t){return t.chroma===e}));s.forEach((function(e){var s=e.aliases[0],u=i(o);o!==r?a.push({weight:.5*t,name:"".concat(u).concat(s,"/").concat(n)}):a.push({weight:1*t,name:"".concat(u).concat(s)})}))})),a}(t,1);return n.filter((function(e){return e.weight})).sort((function(e,t){return t.weight-e.weight})).map((function(e){return e.name}))}var Ce=n(3878),xe=n(9199),we=n(181),Se=n(5267);var Te=(0,Y.Z)((0,Y.Z)({},te),{},{intervals:[],aliases:[]}),Fe=[],Me={};function qe(){return Fe.map((function(e){return e.name}))}function Be(e){return Me[e]||Te}var Oe=s("ScaleDictionary.scaleType","ScaleType.get",Be);function Pe(){return Fe.slice()}var Ie=s("ScaleDictionary.entries","ScaleType.all",Pe);function Ne(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=(0,Y.Z)((0,Y.Z)({},se(e)),{},{name:t,intervals:e,aliases:n});return Fe.push(r),Me[r.name]=r,Me[r.setNum]=r,Me[r.chroma]=r,r.aliases.forEach((function(e){return Re(r,e)})),r}function Re(e,t){Me[t]=e}[["1P 2M 3M 5P 6M","major pentatonic","pentatonic"],["1P 3M 4P 5P 7M","ionian pentatonic"],["1P 3M 4P 5P 7m","mixolydian pentatonic","indian"],["1P 2M 4P 5P 6M","ritusen"],["1P 2M 4P 5P 7m","egyptian"],["1P 3M 4P 5d 7m","neopolitan major pentatonic"],["1P 3m 4P 5P 6m","vietnamese 1"],["1P 2m 3m 5P 6m","pelog"],["1P 2m 4P 5P 6m","kumoijoshi"],["1P 2M 3m 5P 6m","hirajoshi"],["1P 2m 4P 5d 7m","iwato"],["1P 2m 4P 5P 7m","in-sen"],["1P 3M 4A 5P 7M","lydian pentatonic","chinese"],["1P 3m 4P 6m 7m","malkos raga"],["1P 3m 4P 5d 7m","locrian pentatonic","minor seven flat five pentatonic"],["1P 3m 4P 5P 7m","minor pentatonic","vietnamese 2"],["1P 3m 4P 5P 6M","minor six pentatonic"],["1P 2M 3m 5P 6M","flat three pentatonic","kumoi"],["1P 2M 3M 5P 6m","flat six pentatonic"],["1P 2m 3M 5P 6M","scriabin"],["1P 3M 5d 6m 7m","whole tone pentatonic"],["1P 3M 4A 5A 7M","lydian #5P pentatonic"],["1P 3M 4A 5P 7m","lydian dominant pentatonic"],["1P 3m 4P 5P 7M","minor #7M pentatonic"],["1P 3m 4d 5d 7m","super locrian pentatonic"],["1P 2M 3m 4P 5P 7M","minor hexatonic"],["1P 2A 3M 5P 5A 7M","augmented"],["1P 2M 3m 3M 5P 6M","major blues"],["1P 2M 4P 5P 6M 7m","piongio"],["1P 2m 3M 4A 6M 7m","prometheus neopolitan"],["1P 2M 3M 4A 6M 7m","prometheus"],["1P 2m 3M 5d 6m 7m","mystery #1"],["1P 2m 3M 4P 5A 6M","six tone symmetric"],["1P 2M 3M 4A 5A 7m","whole tone","messiaen's mode #1"],["1P 2m 4P 4A 5P 7M","messiaen's mode #5"],["1P 3m 4P 5d 5P 7m","minor blues","blues"],["1P 2M 3M 4P 5d 6m 7m","locrian major","arabian"],["1P 2m 3M 4A 5P 6m 7M","double harmonic lydian"],["1P 2M 3m 4P 5P 6m 7M","harmonic minor"],["1P 2m 2A 3M 4A 6m 7m","altered","super locrian","diminished whole tone","pomeroy"],["1P 2M 3m 4P 5d 6m 7m","locrian #2","half-diminished","aeolian b5"],["1P 2M 3M 4P 5P 6m 7m","mixolydian b6","melodic minor fifth mode","hindu"],["1P 2M 3M 4A 5P 6M 7m","lydian dominant","lydian b7","overtone"],["1P 2M 3M 4A 5P 6M 7M","lydian"],["1P 2M 3M 4A 5A 6M 7M","lydian augmented"],["1P 2m 3m 4P 5P 6M 7m","dorian b2","phrygian #6","melodic minor second mode"],["1P 2M 3m 4P 5P 6M 7M","melodic minor"],["1P 2m 3m 4P 5d 6m 7m","locrian"],["1P 2m 3m 4d 5d 6m 7d","ultralocrian","superlocrian bb7","superlocrian diminished"],["1P 2m 3m 4P 5d 6M 7m","locrian 6","locrian natural 6","locrian sharp 6"],["1P 2A 3M 4P 5P 5A 7M","augmented heptatonic"],["1P 2M 3m 4A 5P 6M 7m","dorian #4","ukrainian dorian","romanian minor","altered dorian"],["1P 2M 3m 4A 5P 6M 7M","lydian diminished"],["1P 2m 3m 4P 5P 6m 7m","phrygian"],["1P 2M 3M 4A 5A 7m 7M","leading whole tone"],["1P 2M 3M 4A 5P 6m 7m","lydian minor"],["1P 2m 3M 4P 5P 6m 7m","phrygian dominant","spanish","phrygian major"],["1P 2m 3m 4P 5P 6m 7M","balinese"],["1P 2m 3m 4P 5P 6M 7M","neopolitan major"],["1P 2M 3m 4P 5P 6m 7m","aeolian","minor"],["1P 2M 3M 4P 5P 6m 7M","harmonic major"],["1P 2m 3M 4P 5P 6m 7M","double harmonic major","gypsy"],["1P 2M 3m 4P 5P 6M 7m","dorian"],["1P 2M 3m 4A 5P 6m 7M","hungarian minor"],["1P 2A 3M 4A 5P 6M 7m","hungarian major"],["1P 2m 3M 4P 5d 6M 7m","oriental"],["1P 2m 3m 3M 4A 5P 7m","flamenco"],["1P 2m 3m 4A 5P 6m 7M","todi raga"],["1P 2M 3M 4P 5P 6M 7m","mixolydian","dominant"],["1P 2m 3M 4P 5d 6m 7M","persian"],["1P 2M 3M 4P 5P 6M 7M","major","ionian"],["1P 2m 3M 5d 6m 7m 7M","enigmatic"],["1P 2M 3M 4P 5A 6M 7M","major augmented","major #5","ionian augmented","ionian #5"],["1P 2A 3M 4A 5P 6M 7M","lydian #9"],["1P 2m 2M 4P 4A 5P 6m 7M","messiaen's mode #4"],["1P 2m 3M 4P 4A 5P 6m 7M","purvi raga"],["1P 2m 3m 3M 4P 5P 6m 7m","spanish heptatonic"],["1P 2M 3M 4P 5P 6M 7m 7M","bebop"],["1P 2M 3m 3M 4P 5P 6M 7m","bebop minor"],["1P 2M 3M 4P 5P 5A 6M 7M","bebop major"],["1P 2m 3m 4P 5d 5P 6m 7m","bebop locrian"],["1P 2M 3m 4P 5P 6m 7m 7M","minor bebop"],["1P 2M 3m 4P 5d 6m 6M 7M","diminished","whole-half diminished"],["1P 2M 3M 4P 5d 5P 6M 7M","ichikosucho"],["1P 2M 3m 4P 5P 6m 6M 7M","minor six diminished"],["1P 2m 3m 3M 4A 5P 6M 7m","half-whole diminished","dominant diminished","messiaen's mode #2"],["1P 3m 3M 4P 5P 6M 7m 7M","kafi raga"],["1P 2M 3M 4P 4A 5A 6A 7M","messiaen's mode #6"],["1P 2M 3m 3M 4P 5d 5P 6M 7m","composite blues"],["1P 2M 3m 3M 4A 5P 6m 7m 7M","messiaen's mode #3"],["1P 2m 2M 3m 4P 4A 5P 6m 6M 7M","messiaen's mode #7"],["1P 2m 2M 3m 3M 4P 5d 5P 6m 6M 7m 7M","chromatic"]].forEach((function(e){var t,n=(t=e,(0,Ce.Z)(t)||(0,xe.Z)(t)||(0,we.Z)(t)||(0,Se.Z)()),r=n[0],i=n[1],o=n.slice(2);return Ne(r.split(" "),i,o)}));var Le={names:qe,get:Be,all:Pe,add:Ne,removeAll:function(){Fe=[],Me={}},keys:function(){return Object.keys(Me)},entries:Ie,scaleType:Oe},je={empty:!0,name:"",symbol:"",root:"",rootDegree:0,type:"",tonic:null,setNum:NaN,quality:"Unknown",chroma:"",normalized:"",aliases:[],notes:[],intervals:[]},We=/^(6|64|7|9|11|13)$/;function Ge(e){var t=D(e),n=(0,o.Z)(t,4),r=n[0],i=n[1],a=n[2],s=n[3];return""===r?["",e]:"A"===r&&"ug"===s?["","aug"]:s||"4"!==a&&"5"!==a?We.test(a)?[r+i,a+s]:[r+i+a,s]:[r+i,a]}function He(e){if(""===e)return je;if(Array.isArray(e)&&2===e.length)return Ze(e[1],e[0]);var t=Ge(e),n=(0,o.Z)(t,2),r=n[0],i=Ze(n[1],r);return i.empty?Ze(e):i}function Ze(e,t,n){var r=ge(e),i=E(t||""),o=E(n||"");if(r.empty||t&&i.empty||n&&o.empty)return je;var a=O(i.pc,o.pc),s=r.intervals.indexOf(a)+1;if(!o.empty&&!s)return je;for(var u=Array.from(r.intervals),c=1;c1&&n?" over "+o.pc:"");return(0,Y.Z)((0,Y.Z)({},r),{},{name:m,symbol:d,type:r.name,root:o.name,intervals:u,rootDegree:s,tonic:i.name,notes:h})}var Ve={getChord:Ze,get:He,detect:ke,chordScales:function(e){var t=fe(He(e).chroma);return Pe().filter((function(e){return t(e.chroma)})).map((function(e){return e.name}))},extended:function(e){var t=He(e),n=fe(t.chroma);return Ee().filter((function(e){return n(e.chroma)})).map((function(e){return t.tonic+e.aliases[0]}))},reduced:function(e){var t=He(e),n=pe(t.chroma);return Ee().filter((function(e){return n(e.chroma)})).map((function(e){return t.tonic+e.aliases[0]}))},tokenize:Ge,transpose:function(e,t){var n=Ge(e),r=(0,o.Z)(n,2),i=r[0],a=r[1];return i?B(i,t)+a:e},chord:s("Chord.chord","Chord.get",He)},ze=[];[[.125,"dl",["large","duplex longa","maxima","octuple","octuple whole"]],[.25,"l",["long","longa"]],[.5,"d",["double whole","double","breve"]],[1,"w",["whole","semibreve"]],[2,"h",["half","minim"]],[4,"q",["quarter","crotchet"]],[8,"e",["eighth","quaver"]],[16,"s",["sixteenth","semiquaver"]],[32,"t",["thirty-second","demisemiquaver"]],[64,"sf",["sixty-fourth","hemidemisemiquaver"]],[128,"h",["hundred twenty-eighth"]],[256,"th",["two hundred fifty-sixth"]]].forEach((function(e){var t=(0,o.Z)(e,3);return function(e,t,n){ze.push({empty:!1,dots:"",name:"",value:1/e,fraction:e<1?[1/e,1]:[1,e],shorthand:t,names:n})}(t[0],t[1],t[2])}));var Ue={empty:!0,name:"",value:0,fraction:[0,0],shorthand:"",dots:"",names:[]};var Ye=/^([^.]+)(\.*)$/;function Ke(e){var t=Ye.exec(e)||[],n=(0,o.Z)(t,3),r=(n[0],n[1]),i=n[2],a=ze.find((function(e){return e.shorthand===r||e.names.includes(r)}));if(!a)return Ue;var s=function(e,t){for(var n=Math.pow(2,t),r=e[0]*n,i=e[1]*n,o=r,a=0;a=0&&+e<=127}function ct(e){if(ut(e))return+e;var t=E(e);return t.empty?null:t.midi}var lt=Math.log(2),pt=Math.log(440);function ft(e){var t=12*(Math.log(e)-pt)/lt+69;return Math.round(100*t)/100}var ht="C C# D D# E F F# G G# A A# B".split(" "),dt="C Db D Eb E F Gb G Ab A Bb B".split(" ");function mt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(isNaN(e)||e===-1/0||e===1/0)return"";e=Math.round(e);var n=!0===t.sharps?ht:dt,r=n[e%12];if(t.pitchClass)return r;var i=Math.floor(e/12)-1;return r+i}var vt={isMidi:ut,toMidi:ct,midiToFreq:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:440;return Math.pow(2,(e-69)/12)*t},midiToNoteName:mt,freqToMidi:ft},yt=["C","D","E","F","G","A","B"],gt=function(e){return e.name},_t=function(e){return e.map(E).filter((function(e){return!e.empty}))};var Et=E;function bt(e){return mt(e)}var Dt=B,At=function(e){return function(t){return Dt(t,e)}},kt=function(e){return function(t){return Dt(e,t)}};function Ct(e,t){var n=Et(e);if(n.empty)return"";var r=(0,o.Z)(n.coord,2),i=r[0],a=r[1];return A(void 0===a?[i+t]:[i+t,a]).name}var xt=function(e,t){return e.height-t.height};function wt(e,t){return t=t||xt,_t(e).sort(t).map(gt)}function St(e){return wt(e,xt).filter((function(e,t,n){return 0===t||e!==n[t-1]}))}function Tt(e,t){var n=Et(e);if(n.empty)return"";var r=Et(t||mt(n.midi||n.chroma,{sharps:n.alt<0,pitchClass:!0}));if(r.empty||r.chroma!==n.chroma)return"";if(void 0===n.oct)return r.pc;var i=n.chroma-n.alt,o=r.chroma-r.alt,a=i>11||o<0?-1:i<0||o>11?1:0,s=n.oct+a;return r.pc+s}var Ft={names:function(e){return void 0===e?yt.slice():Array.isArray(e)?_t(e).map(gt):[]},get:Et,name:function(e){return Et(e).name},pitchClass:function(e){return Et(e).pc},accidentals:function(e){return Et(e).acc},octave:function(e){return Et(e).oct},midi:function(e){return Et(e).midi},ascending:xt,descending:function(e,t){return t.height-e.height},sortedNames:wt,sortedUniqNames:St,fromMidi:bt,fromMidiSharps:function(e){return mt(e,{sharps:!0})},freq:function(e){return Et(e).freq},fromFreq:function(e){return mt(ft(e))},fromFreqSharps:function(e){return mt(ft(e),{sharps:!0})},chroma:function(e){return Et(e).chroma},transpose:Dt,tr:B,transposeBy:At,trBy:At,transposeFrom:kt,trFrom:kt,transposeFifths:Ct,trFifths:Ct,simplify:function(e){var t=Et(e);return t.empty?"":mt(t.midi||t.chroma,{sharps:t.alt>0,pitchClass:null===t.midi})},enharmonic:Tt},Mt={empty:!0,name:"",chordType:""},qt={};function Bt(e){return"string"===typeof e?qt[e]||(qt[e]=function(e){var t=(u=e,Pt.exec(u)||["","","",""]),n=(0,o.Z)(t,4),r=n[0],i=n[1],a=n[2],s=n[3];var u;if(!a)return Mt;var c=a.toUpperCase(),l=Nt.indexOf(c),p=_(i),f=1;return{empty:!1,name:r,roman:a,interval:T({step:l,alt:p,dir:f}).name,acc:i,chordType:s,alt:p,step:l,major:a===c,oct:0,dir:f}}(e)):"number"===typeof e?Bt(Nt[e]||""):c(e)?Bt(g((t=e).alt)+Nt[t.step]):u(e)?Bt(e.name):Mt;var t}var Ot=s("RomanNumeral.romanNumeral","RomanNumeral.get",Bt);var Pt=/^(#{1,}|b{1,}|x{1,}|)(IV|I{1,3}|VI{0,2}|iv|i{1,3}|vi{0,2})([^IViv]*)$/;var It="I II III IV V VI VII",Nt=It.split(" "),Rt=It.toLowerCase().split(" ");var Lt={names:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return(e?Nt:Rt).slice()},get:Bt,romanNumeral:Ot},jt=Object.freeze([]),Wt={type:"major",tonic:"",alteration:0,keySignature:""},Gt={tonic:"",grades:jt,intervals:jt,scale:jt,chords:jt,chordsHarmonicFunction:jt,chordScales:jt},Ht=(0,Y.Z)((0,Y.Z)((0,Y.Z)({},Wt),Gt),{},{type:"major",minorRelative:"",scale:jt,secondaryDominants:jt,secondaryDominantsMinorRelative:jt,substituteDominants:jt,substituteDominantsMinorRelative:jt}),Zt=(0,Y.Z)((0,Y.Z)({},Wt),{},{type:"minor",relativeMajor:"",natural:Gt,harmonic:Gt,melodic:Gt}),Vt=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return t.map((function(t,r){return"".concat(e[r]).concat(n).concat(t)}))};function zt(e,t,n,r){return function(i){var o=e.map((function(e){return Bt(e).interval||""})),a=o.map((function(e){return B(i,e)}));return{tonic:i,grades:e,intervals:o,scale:a,chords:Vt(a,t),chordsHarmonicFunction:n.slice(),chordScales:Vt(a,r," ")}}}var Ut=function(e,t){var n=E(e),r=E(t);return n.empty||r.empty?0:r.coord[0]-n.coord[0]},Yt=zt("I II III IV V VI VII".split(" "),"maj7 m7 m7 maj7 7 m7 m7b5".split(" "),"T SD T SD D T D".split(" "),"major,dorian,phrygian,lydian,mixolydian,minor,locrian".split(",")),Kt=zt("I II bIII IV V bVI bVII".split(" "),"m7 m7b5 maj7 m7 m7 maj7 7".split(" "),"T SD T SD D SD SD".split(" "),"minor,locrian,major,dorian,phrygian,lydian,mixolydian".split(",")),Xt=zt("I II bIII IV V bVI VII".split(" "),"mMaj7 m7b5 +maj7 m7 7 maj7 o7".split(" "),"T SD T SD D SD D".split(" "),"harmonic minor,locrian 6,major augmented,lydian diminished,phrygian dominant,lydian #9,ultralocrian".split(",")),Jt=zt("I II bIII IV V VI VII".split(" "),"m6 m7 +maj7 7 7 m7b5 m7b5".split(" "),"T SD T SD D ".split(" "),"melodic minor,dorian b2,lydian augmented,lydian dominant,mixolydian b6,locrian #2,altered".split(","));var Qt={majorKey:function(e){var t=E(e).pc;if(!t)return Ht;var n=Yt(t),r=Ut("C",t),i=function(t){var n=Bt(t);return n.empty?"":B(e,n.interval)+n.chordType};return(0,Y.Z)((0,Y.Z)({},n),{},{type:"major",minorRelative:B(t,"-3m"),alteration:r,keySignature:g(r),secondaryDominants:"- VI7 VII7 I7 II7 III7 -".split(" ").map(i),secondaryDominantsMinorRelative:"- IIIm7b5 IV#m7 Vm7 VIm7 VIIm7b5 -".split(" ").map(i),substituteDominants:"- bIII7 IV7 bV7 bVI7 bVII7 -".split(" ").map(i),substituteDominantsMinorRelative:"- IIIm7 Im7 IIbm7 VIm7 IVm7 -".split(" ").map(i)})},majorTonicFromKeySignature:function(e){return"number"===typeof e?Ct("C",e):"string"===typeof e&&/^b+|#+$/.test(e)?Ct("C",_(e)):null},minorKey:function(e){var t=E(e).pc;if(!t)return Zt;var n=Ut("C",t)-3;return{type:"minor",tonic:t,relativeMajor:B(t,"3m"),alteration:n,keySignature:g(n),natural:Kt(t),harmonic:Xt(t),melodic:Jt(t)}}},$t=[[0,2773,0,"ionian","","Maj7","major"],[1,2902,2,"dorian","m","m7"],[2,3418,4,"phrygian","m","m7"],[3,2741,-1,"lydian","","Maj7"],[4,2774,1,"mixolydian","","7"],[5,2906,3,"aeolian","m","m7","minor"],[6,3434,5,"locrian","dim","m7b5"]],en=(0,Y.Z)((0,Y.Z)({},te),{},{name:"",alt:0,modeNum:NaN,triad:"",seventh:"",aliases:[]}),tn=$t.map((function(e){var t=(0,o.Z)(e,7),n=t[0],r=t[1],i=t[2],a=t[3],s=t[4],u=t[5],c=t[6],l=c?[c]:[],p=Number(r).toString(2);return{empty:!1,intervals:Be(a).intervals,modeNum:n,chroma:p,normalized:p,name:a,setNum:r,alt:i,triad:s,seventh:u,aliases:l}})),nn={};function rn(e){return"string"===typeof e?nn[e.toLowerCase()]||en:e&&e.name?rn(e.name):en}tn.forEach((function(e){nn[e.name]=e,e.aliases.forEach((function(t){nn[t]=e}))}));var on=s("Mode.mode","Mode.get",rn);function an(){return tn.slice()}var sn=s("Mode.mode","Mode.all",an);function un(e){return function(t,n){var r=rn(t);if(r.empty)return[];var i=J(r.modeNum,e),o=r.intervals.map((function(e){return B(n,e)}));return i.map((function(e,t){return o[t]+e}))}}function cn(e,t){var n=rn(t),r=rn(e);return n.empty||r.empty?"":$e(ot("1P",r.alt-n.alt))}var ln={get:rn,names:function(){return tn.map((function(e){return e.name}))},all:an,distance:cn,relativeTonic:function(e,t,n){return B(n,cn(e,t))},notes:function(e,t){return rn(e).intervals.map((function(e){return B(t,e)}))},triads:un($t.map((function(e){return e[4]}))),seventhChords:un($t.map((function(e){return e[5]}))),entries:sn,mode:on};var pn={fromRomanNumerals:function(e,t){return t.map(Bt).map((function(t){return B(e,T(t))+t.chordType}))},toRomanNumerals:function(e,t){return t.map((function(t){var n=Ge(t),r=(0,o.Z)(n,2),i=r[0],a=r[1];return Bt(T(O(e,i))).name+a}))}};function fn(e){var t=Q(e.map(ct));return e.length&&t.length===e.length?t.reduce((function(e,t){var n=e[e.length-1];return e.concat(X(n,t).slice(1))}),[t[0]]):[]}var hn={numeric:fn,chromatic:function(e,t){return fn(e).map((function(e){return mt(e,t)}))}},dn={empty:!0,name:"",type:"",tonic:null,setNum:NaN,chroma:"",normalized:"",aliases:[],notes:[],intervals:[]};function mn(e){if("string"!==typeof e)return["",""];var t=e.indexOf(" "),n=E(e.substring(0,t));if(n.empty){var r=E(e);return r.empty?["",e]:[r.name,""]}var i=e.substring(n.name.length+1);return[n.name,i.length?i:""]}function vn(e){var t=Array.isArray(e)?e:mn(e),n=E(t[0]).name,r=Be(t[1]);if(r.empty)return dn;var i=r.name,o=n?r.intervals.map((function(e){return B(n,e)})):[],a=n?n+" "+i:i;return(0,Y.Z)((0,Y.Z)({},r),{},{name:a,type:i,tonic:n,notes:o})}function yn(e){var t=e.map((function(e){return E(e).pc})).filter((function(e){return e})),n=t[0],r=St(t);return J(r.indexOf(n),r)}var gn={get:vn,names:qe,extended:function(e){var t=fe(vn(e).chroma);return Pe().filter((function(e){return t(e.chroma)})).map((function(e){return e.name}))},modeNames:function(e){var t=vn(e);if(t.empty)return[];var n=t.tonic?t.notes:t.intervals;return le(t.chroma).map((function(e,t){var r=vn(e).name;return r?[n[t],r]:["",""]})).filter((function(e){return e[0]}))},reduced:function(e){var t=pe(vn(e).chroma);return Pe().filter((function(e){return t(e.chroma)})).map((function(e){return e.name}))},scaleChords:function(e){var t=pe(vn(e).chroma);return Ee().filter((function(e){return t(e.chroma)})).map((function(e){return e.aliases[0]}))},scaleNotes:yn,tokenize:mn,rangeOf:function(e){var t=function(e){var t=Array.isArray(e)?yn(e):vn(e).notes,n=t.map((function(e){return E(e).chroma}));return function(e){var r=E("number"===typeof e?bt(e):e),i=r.height;if(void 0!==i){var o=i%12,a=n.indexOf(o);if(-1!==a)return Tt(r.name,t[a])}}}(e);return function(e,n){var r=E(e).height,i=E(n).height;return void 0===r||void 0===i?[]:X(r,i).map(t).filter((function(e){return e}))}},scale:s("Scale.scale","Scale.get",vn)},_n={empty:!0,name:"",upper:void 0,lower:void 0,type:void 0,additive:[]},En=["4/4","3/4","2/4","2/2","12/8","9/8","6/8","3/8"];var bn=/^(\d?\d(?:\+\d)*)\/(\d)$/,Dn=new Map;function An(e){if("string"===typeof e){var t=bn.exec(e)||[],n=(0,o.Z)(t,3);n[0];return An([n[1],n[2]])}var r=(0,o.Z)(e,2),i=r[0],a=+r[1];if("number"===typeof i)return[i,a];var s=i.split("+").map((function(e){return+e}));return 1===s.length?[s[0],a]:[s,a]}var kn={names:function(){return En.slice()},parse:An,get:function(e){var t=Dn.get(e);if(t)return t;var n=function(e){var t=(0,o.Z)(e,2),n=t[0],r=t[1],i=Array.isArray(n)?n.reduce((function(e,t){return e+t}),0):n,a=r;if(0===i||0===a)return _n;var s=Array.isArray(n)?"".concat(n.join("+"),"/").concat(r):"".concat(n,"/").concat(r),u=Array.isArray(n)?n:[];return{empty:!1,name:s,type:4===a||2===a?"simple":8===a&&i%3===0?"compound":"irregular",upper:i,lower:a,additive:u}}(An(e));return Dn.set(e,n),n}},Cn=r,xn=de,wn=Ae,Sn=Le},9273:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&a.length>i&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=a.length,c=l,console&&console.warn&&console.warn(c)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=l.bind(r);return i.listener=n,r.wrapFn=i,i}function f(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"===typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=o[e];if(void 0===u)return!1;if("function"===typeof u)r(u,this,t);else{var c=u.length,l=d(u,c);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return f(this,e,!0)},o.prototype.rawListeners=function(e){return f(this,e,!1)},o.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},o.prototype.listenerCount=h,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},3835:function(e){function t(e,t){for(var n=[],r=[],i=[t],o=e-t,a=0;i[a]>1;)r.push(Math.floor(o/i[a])),i.push(o%i[a]),o=i[a],a++;return r.push(o),function e(t){if(-1==t)n.push(0);else if(-2==t)n.push(1);else{for(var o=0;on?t(e,n):t(n,e)}},2034:function(e,t){var n;!function(r){"use strict";var i={s:1,n:0,d:1};function o(e,t){if(isNaN(e=parseInt(e,10)))throw l.InvalidParameter;return e*t}function a(e,t){if(0===t)throw l.DivisionByZero;var n=Object.create(l.prototype);n.s=e<0?-1:1;var r=c(e=e<0?-e:e,t);return n.n=e/r,n.d=t/r,n}function s(e){for(var t={},n=e,r=2,i=4;i<=n;){for(;n%r===0;)n/=r,t[r]=(t[r]||0)+1;i+=1+2*r++}return n!==e?n>1&&(t[n]=(t[n]||0)+1):t[e]=(t[e]||0)+1,t}var u=function(e,t){var n,r=0,a=1,s=1,u=0,c=0,p=0,f=1,h=1,d=0,m=1,v=1,y=1,g=1e7;if(void 0===e||null===e);else if(void 0!==t){if(s=(r=e)*(a=t),r%1!==0||a%1!==0)throw l.NonIntegerParameter}else switch(typeof e){case"object":if("d"in e&&"n"in e)r=e.n,a=e.d,"s"in e&&(r*=e.s);else{if(!(0 in e))throw l.InvalidParameter;r=e[0],1 in e&&(a=e[1])}s=r*a;break;case"number":if(e<0&&(s=e,e=-e),e%1===0)r=e;else if(e>0){for(e>=1&&(e/=h=Math.pow(10,Math.floor(1+Math.log(e)/Math.LN10)));m<=g&&y<=g;){if(e===(n=(d+v)/(m+y))){m+y<=g?(r=d+v,a=m+y):y>m?(r=v,a=y):(r=d,a=m);break}e>n?(d+=v,m+=y):(v+=d,y+=m),m>g?(r=v,a=y):(r=d,a=m)}r*=h}else(isNaN(e)||isNaN(t))&&(a=r=NaN);break;case"string":if(null===(m=e.match(/\d+|./g)))throw l.InvalidParameter;if("-"===m[d]?(s=-1,d++):"+"===m[d]&&d++,m.length===d+1?c=o(m[d++],s):"."===m[d+1]||"."===m[d]?("."!==m[d]&&(u=o(m[d++],s)),(++d+1===m.length||"("===m[d+1]&&")"===m[d+3]||"'"===m[d+1]&&"'"===m[d+3])&&(c=o(m[d],s),f=Math.pow(10,m[d].length),d++),("("===m[d]&&")"===m[d+2]||"'"===m[d]&&"'"===m[d+2])&&(p=o(m[d+1],s),h=Math.pow(10,m[d+1].length)-1,d+=3)):"/"===m[d+1]||":"===m[d+1]?(c=o(m[d],s),f=o(m[d+2],1),d+=3):"/"===m[d+3]&&" "===m[d+1]&&(u=o(m[d],s),c=o(m[d+2],s),f=o(m[d+4],1),d+=5),m.length<=d){s=r=p+(a=f*h)*u+h*c;break}default:throw l.InvalidParameter}if(0===a)throw l.DivisionByZero;i.s=s<0?-1:1,i.n=Math.abs(r),i.d=Math.abs(a)};function c(e,t){if(!e)return t;if(!t)return e;for(;;){if(!(e%=t))return t;if(!(t%=e))return e}}function l(e,t){if(u(e,t),!(this instanceof l))return a(i.s*i.n,i.d);e=c(i.d,i.n),this.s=i.s,this.n=i.n/e,this.d=i.d/e}l.DivisionByZero=new Error("Division by Zero"),l.InvalidParameter=new Error("Invalid argument"),l.NonIntegerParameter=new Error("Parameters must be integer"),l.prototype={s:1,n:0,d:1,abs:function(){return a(this.n,this.d)},neg:function(){return a(-this.s*this.n,this.d)},add:function(e,t){return u(e,t),a(this.s*this.n*i.d+i.s*this.d*i.n,this.d*i.d)},sub:function(e,t){return u(e,t),a(this.s*this.n*i.d-i.s*this.d*i.n,this.d*i.d)},mul:function(e,t){return u(e,t),a(this.s*i.s*this.n*i.n,this.d*i.d)},div:function(e,t){return u(e,t),a(this.s*i.s*this.n*i.d,this.d*i.n)},clone:function(){return a(this.s*this.n,this.d)},mod:function(e,t){if(isNaN(this.n)||isNaN(this.d))return new l(NaN);if(void 0===e)return a(this.s*this.n%this.d,1);if(u(e,t),0===i.n&&0===this.d)throw l.DivisionByZero;return a(this.s*(i.d*this.n)%(i.n*this.d),i.d*this.d)},gcd:function(e,t){return u(e,t),a(c(i.n,this.n)*c(i.d,this.d),i.d*this.d)},lcm:function(e,t){return u(e,t),0===i.n&&0===this.n?a(0,1):a(i.n*this.n,c(i.n,this.n)*c(i.d,this.d))},ceil:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new l(NaN):a(Math.ceil(e*this.s*this.n/this.d),e)},floor:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new l(NaN):a(Math.floor(e*this.s*this.n/this.d),e)},round:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new l(NaN):a(Math.round(e*this.s*this.n/this.d),e)},inverse:function(){return a(this.s*this.d,this.n)},pow:function(e,t){if(u(e,t),1===i.d)return i.s<0?a(Math.pow(this.s*this.d,i.n),Math.pow(this.n,i.n)):a(Math.pow(this.s*this.n,i.n),Math.pow(this.d,i.n));if(this.s<0)return null;var n=s(this.n),r=s(this.d),o=1,c=1;for(var l in n)if("1"!==l){if("0"===l){o=0;break}if(n[l]*=i.n,n[l]%i.d!==0)return null;n[l]/=i.d,o*=Math.pow(l,n[l])}for(var l in r)if("1"!==l){if(r[l]*=i.n,r[l]%i.d!==0)return null;r[l]/=i.d,c*=Math.pow(l,r[l])}return i.s<0?a(c,o):a(o,c)},equals:function(e,t){return u(e,t),this.s*this.n*i.d===i.s*i.n*this.d},compare:function(e,t){u(e,t);var n=this.s*this.n*i.d-i.s*i.n*this.d;return(0=0;o--)i=i.inverse().add(n[o]);if(i.sub(t).abs().valueOf()0&&(n+=t,n+=" ",r%=i),n+=r,n+="/",n+=i),n},toLatex:function(e){var t,n="",r=this.n,i=this.d;return this.s<0&&(n+="-"),1===i?n+=r:(e&&(t=Math.floor(r/i))>0&&(n+=t,r%=i),n+="\\frac{",n+=r,n+="}{",n+=i,n+="}"),n},toContinued:function(){var e,t=this.n,n=this.d,r=[];if(isNaN(t)||isNaN(n))return r;do{r.push(Math.floor(t/n)),e=t%n,t=n,n=e}while(1!==t);return r},toString:function(e){var t=this.n,n=this.d;if(isNaN(t)||isNaN(n))return"NaN";e=e||15;var r=function(e,t){for(;t%2===0;t/=2);for(;t%5===0;t/=5);if(1===t)return 0;for(var n=10%t,r=1;1!==n;r++)if(n=10*n%t,r>2e3)return 0;return r}(0,n),i=function(e,t,n){for(var r=1,i=function(e,t,n){for(var r=1;t>0;e=e*e%n,t>>=1)1&t&&(r=r*e%n);return r}(10,n,t),o=0;o<300;o++){if(r===i)return o;r=10*r%t,i=10*i%t}return 0}(0,n,r),o=this.s<0?"-":"";if(o+=t/n|0,t%=n,(t*=10)&&(o+="."),r){for(var a=i;a--;)o+=t/n|0,t%=n,t*=10;o+="(";for(a=r;a--;)o+=t/n|0,t%=n,t*=10;o+=")"}else for(a=e;t&&a--;)o+=t/n|0,t%=n,t*=10;return o}},void 0===(n=function(){return l}.apply(t,[]))||(e.exports=n)}()},3162:function(e,t){!function e(t){"use strict";var n,r,i,o,a,s;function u(e){var t,n,r={};for(t in e)e.hasOwnProperty(t)&&(n=e[t],r[t]="object"===typeof n&&null!==n?u(n):n);return r}function c(e,t){this.parent=e,this.key=t}function l(e,t,n,r){this.node=e,this.path=t,this.wrap=n,this.ref=r}function p(){}function f(e){return null!=e&&("object"===typeof e&&"string"===typeof e.type)}function h(e,t){return(e===n.ObjectExpression||e===n.ObjectPattern)&&"properties"===t}function d(e,t){for(var n=e.length-1;n>=0;--n)if(e[n].node===t)return!0;return!1}function m(e,t){return(new p).traverse(e,t)}function v(e,t){var n;return n=function(e,t){var n,r,i,o;for(r=e.length,i=0;r;)t(e[o=i+(n=r>>>1)])?r=n:(i=o+1,r-=n+1);return i}(t,(function(t){return t.range[0]>e.range[0]})),e.extendedRange=[e.range[0],e.range[1]],n!==t.length&&(e.extendedRange[1]=t[n].range[0]),(n-=1)>=0&&(e.extendedRange[0]=t[n].range[1]),e}return n={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ChainExpression:"ChainExpression",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportExpression:"ImportExpression",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",PrivateIdentifier:"PrivateIdentifier",Program:"Program",Property:"Property",PropertyDefinition:"PropertyDefinition",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},i={AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportAllDeclaration:["source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportExpression:["source"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],Super:[],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},r={Break:o={},Skip:a={},Remove:s={}},c.prototype.replace=function(e){this.parent[this.key]=e},c.prototype.remove=function(){return Array.isArray(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)},p.prototype.path=function(){var e,t,n,r,i;function o(e,t){if(Array.isArray(t))for(n=0,r=t.length;n=0;)if(g=s[p=y[m]])if(Array.isArray(g)){for(v=g.length;(v-=1)>=0;)if(g[v]&&!d(r,g[v])){if(h(u,y[m]))i=new l(g[v],[p,v],"Property",null);else{if(!f(g[v]))continue;i=new l(g[v],[p,v],null,null)}n.push(i)}}else if(f(g)){if(d(r,g))continue;n.push(new l(g,p,null,null))}}}else if(i=r.pop(),c=this.__execute(t.leave,i),this.__state===o||c===o)return},p.prototype.replace=function(e,t){var n,r,i,u,p,d,m,v,y,g,_,E,b;function D(e){var t,r,i,o;if(e.ref.remove())for(r=e.ref.key,o=e.ref.parent,t=n.length;t--;)if((i=n[t]).ref&&i.ref.parent===o){if(i.ref.key=0;)if(g=i[b=y[m]])if(Array.isArray(g)){for(v=g.length;(v-=1)>=0;)if(g[v]){if(h(u,y[m]))d=new l(g[v],[b,v],"Property",new c(g,v));else{if(!f(g[v]))continue;d=new l(g[v],[b,v],null,new c(g,v))}n.push(d)}}else f(g)&&n.push(new l(g,b,null,new c(i,b)))}}else if(d=r.pop(),void 0!==(p=this.__execute(t.leave,d))&&p!==o&&p!==a&&p!==s&&d.ref.replace(p),this.__state!==s&&p!==s||D(d),this.__state===o||p===o)return E.root;return E.root},t.Syntax=n,t.traverse=m,t.replace=function(e,t){return(new p).replace(e,t)},t.attachComments=function(e,t,n){var i,o,a,s,c=[];if(!e.range)throw new Error("attachComments needs range information");if(!n.length){if(t.length){for(a=0,o=t.length;ae.range[0]);)t.extendedRange[1]===e.range[0]?(e.leadingComments||(e.leadingComments=[]),e.leadingComments.push(t),c.splice(s,1)):s+=1;return s===c.length?r.Break:c[s].extendedRange[0]>e.range[1]?r.Skip:void 0}}),s=0,m(e,{leave:function(e){for(var t;se.range[1]?r.Skip:void 0}}),e},t.VisitorKeys=i,t.VisitorOption=r,t.Controller=p,t.cloneEnvironment=function(){return e({})},t}(t)},1365:function(e){!function(){"use strict";function t(e){if(null==e)return!1;switch(e.type){case"BlockStatement":case"BreakStatement":case"ContinueStatement":case"DebuggerStatement":case"DoWhileStatement":case"EmptyStatement":case"ExpressionStatement":case"ForInStatement":case"ForStatement":case"IfStatement":case"LabeledStatement":case"ReturnStatement":case"SwitchStatement":case"ThrowStatement":case"TryStatement":case"VariableDeclaration":case"WhileStatement":case"WithStatement":return!0}return!1}function n(e){switch(e.type){case"IfStatement":return null!=e.alternate?e.alternate:e.consequent;case"LabeledStatement":case"ForStatement":case"ForInStatement":case"WhileStatement":case"WithStatement":return e.body}return null}e.exports={isExpression:function(e){if(null==e)return!1;switch(e.type){case"ArrayExpression":case"AssignmentExpression":case"BinaryExpression":case"CallExpression":case"ConditionalExpression":case"FunctionExpression":case"Identifier":case"Literal":case"LogicalExpression":case"MemberExpression":case"NewExpression":case"ObjectExpression":case"SequenceExpression":case"ThisExpression":case"UnaryExpression":case"UpdateExpression":return!0}return!1},isStatement:t,isIterationStatement:function(e){if(null==e)return!1;switch(e.type){case"DoWhileStatement":case"ForInStatement":case"ForStatement":case"WhileStatement":return!0}return!1},isSourceElement:function(e){return t(e)||null!=e&&"FunctionDeclaration"===e.type},isProblematicIfStatement:function(e){var t;if("IfStatement"!==e.type)return!1;if(null==e.alternate)return!1;t=e.consequent;do{if("IfStatement"===t.type&&null==t.alternate)return!0;t=n(t)}while(t);return!1},trailingStatement:n}}()},1129:function(e){!function(){"use strict";var t,n,r,i,o,a;function s(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(Math.floor((e-65536)/1024)+55296)+String.fromCharCode((e-65536)%1024+56320)}for(n={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,NonAsciiIdentifierPart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/},t={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},r=[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279],i=new Array(128),a=0;a<128;++a)i[a]=a>=97&&a<=122||a>=65&&a<=90||36===a||95===a;for(o=new Array(128),a=0;a<128;++a)o[a]=a>=97&&a<=122||a>=65&&a<=90||a>=48&&a<=57||36===a||95===a;e.exports={isDecimalDigit:function(e){return 48<=e&&e<=57},isHexDigit:function(e){return 48<=e&&e<=57||97<=e&&e<=102||65<=e&&e<=70},isOctalDigit:function(e){return e>=48&&e<=55},isWhiteSpace:function(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&r.indexOf(e)>=0},isLineTerminator:function(e){return 10===e||13===e||8232===e||8233===e},isIdentifierStartES5:function(e){return e<128?i[e]:n.NonAsciiIdentifierStart.test(s(e))},isIdentifierPartES5:function(e){return e<128?o[e]:n.NonAsciiIdentifierPart.test(s(e))},isIdentifierStartES6:function(e){return e<128?i[e]:t.NonAsciiIdentifierStart.test(s(e))},isIdentifierPartES6:function(e){return e<128?o[e]:t.NonAsciiIdentifierPart.test(s(e))}}}()},4288:function(e,t,n){!function(){"use strict";var t=n(1129);function r(e,t){return!(!t&&"yield"===e)&&i(e,t)}function i(e,t){if(t&&function(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"let":return!0;default:return!1}}(e))return!0;switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1}}function o(e,t){return"null"===e||"true"===e||"false"===e||r(e,t)}function a(e,t){return"null"===e||"true"===e||"false"===e||i(e,t)}function s(e){var n,r,i;if(0===e.length)return!1;if(i=e.charCodeAt(0),!t.isIdentifierStartES5(i))return!1;for(n=1,r=e.length;n=r)return!1;if(!(56320<=(o=e.charCodeAt(n))&&o<=57343))return!1;i=1024*(i-55296)+(o-56320)+65536}if(!a(i))return!1;a=t.isIdentifierPartES6}return!0}e.exports={isKeywordES5:r,isKeywordES6:i,isReservedWordES5:o,isReservedWordES6:a,isRestrictedWord:function(e){return"eval"===e||"arguments"===e},isIdentifierNameES5:s,isIdentifierNameES6:u,isIdentifierES5:function(e,t){return s(e)&&!o(e,t)},isIdentifierES6:function(e,t){return u(e)&&!a(e,t)}}}()},3180:function(e,t,n){!function(){"use strict";t.ast=n(1365),t.code=n(1129),t.keyword=n(4288)}()},1907:function(e,t,n){"use strict";var r;function i(e,t){for(var n,r=e.keys();!(n=r.next()).done;)t(e.get(n.value),n.value,e)}e=n.nmd(e);var o=function(){var e,t;function n(t){var r=this;r._map=e,n.Map&&(r._map=n.Map),r._=r._map?new r._map:{},t&&t.forEach((function(e){r.set(e[0],e[1])}))}"undefined"!==typeof Map&&(e=Map,Map.prototype.keys||(Map.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),e})),n.prototype.get=function(e){return this._map?this._.get(e):this._[e]},n.prototype.set=function(e,t){var n=Array.prototype.slice.call(arguments);e=n.shift();var r=this.get(e);return r||(r=[],this._map?this._.set(e,r):this._[e]=r),Array.prototype.push.apply(r,n),this},n.prototype.delete=function(e,t){if(!this.has(e))return!1;if(1==arguments.length)return this._map?this._.delete(e):delete this._[e],!0;var n=this.get(e),r=n.indexOf(t);return-1!=r&&(n.splice(r,1),!0)},n.prototype.has=function(e,t){var n=this._map?this._.has(e):this._.hasOwnProperty(e);if(1==arguments.length||!n)return n;var r=this.get(e)||[];return-1!=r.indexOf(t)},n.prototype.keys=function(){return this._map?r(this._.keys()):r(Object.keys(this._))},n.prototype.values=function(){var e=[];return this.forEachEntry((function(t){Array.prototype.push.apply(e,t)})),r(e)},n.prototype.forEachEntry=function(e){i(this,e)},n.prototype.forEach=function(e){var t=this;t.forEachEntry((function(n,r){n.forEach((function(n){e(n,r,t)}))}))},n.prototype.clear=function(){this._map?this._.clear():this._={}},Object.defineProperty(n.prototype,"size",{configurable:!1,enumerable:!0,get:function(){var e=0;return i(this,(function(t){e+=t.length})),e}}),Object.defineProperty(n.prototype,"count",{configurable:!1,enumerable:!0,get:function(){return this._.size}});try{t=new Function("iterator","makeIterator","var keysArray = []; for(var key of iterator){keysArray.push(key);} return makeIterator(keysArray).next;")}catch(o){}function r(e){if(Array.isArray(e)){var n=0;return{next:function(){return nn?"'":'"';t+=s;for(var u=0;u":a.Relational,"<=":a.Relational,">=":a.Relational,in:a.Relational,instanceof:a.Relational,"<<":a.BitwiseSHIFT,">>":a.BitwiseSHIFT,">>>":a.BitwiseSHIFT,"+":a.Additive,"-":a.Additive,"*":a.Multiplicative,"%":a.Multiplicative,"/":a.Multiplicative,"**":a.Exponential};var u=t.CodeRep=function(){function e(){o(this,e),this.containsIn=!1,this.containsGroup=!1,this.startsWithCurly=!1,this.startsWithFunctionOrClass=!1,this.startsWithLet=!1,this.startsWithLetSquareBracket=!1,this.endsWithMissingElse=!1}return n(e,[{key:"forEach",value:function(e){e(this)}}]),e}(),c=(t.Empty=function(e){function t(){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this))}return i(t,e),n(t,[{key:"emit",value:function(){}}]),t}(u),t.Token=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];o(this,t);var i=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return i.token=e,i.isRegExp=n,i}return i(t,e),n(t,[{key:"emit",value:function(e){e.put(this.token,this.isRegExp)}}]),t}(u));t.RawToken=function(e){function t(e){o(this,t);var n=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.token=e,n}return i(t,e),n(t,[{key:"emit",value:function(e){e.putRaw(this.token)}}]),t}(u),t.NumberCodeRep=function(e){function t(e){o(this,t);var n=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.number=e,n}return i(t,e),n(t,[{key:"emit",value:function(e){e.putNumber(this.number)}}]),t}(u),t.Paren=function(e){function t(e){o(this,t);var n=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.expr=e,n}return i(t,e),n(t,[{key:"emit",value:function(e){e.put("("),this.expr.emit(e,!1),e.put(")")}},{key:"forEach",value:function(e){e(this),this.expr.forEach(e)}}]),t}(u),t.Bracket=function(e){function t(e){o(this,t);var n=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.expr=e,n}return i(t,e),n(t,[{key:"emit",value:function(e){e.put("["),this.expr.emit(e,!1),e.put("]")}},{key:"forEach",value:function(e){e(this),this.expr.forEach(e)}}]),t}(u),t.Brace=function(e){function t(e){o(this,t);var n=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.expr=e,n}return i(t,e),n(t,[{key:"emit",value:function(e){e.put("{"),this.expr.emit(e,!1),e.put("}")}},{key:"forEach",value:function(e){e(this),this.expr.forEach(e)}}]),t}(u),t.NoIn=function(e){function t(e){o(this,t);var n=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.expr=e,n}return i(t,e),n(t,[{key:"emit",value:function(e){this.expr.emit(e,!0)}},{key:"forEach",value:function(e){e(this),this.expr.forEach(e)}}]),t}(u),t.ContainsIn=function(e){function t(e){o(this,t);var n=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.expr=e,n}return i(t,e),n(t,[{key:"emit",value:function(e,t){t?(e.put("("),this.expr.emit(e,!1),e.put(")")):this.expr.emit(e,!1)}},{key:"forEach",value:function(e){e(this),this.expr.forEach(e)}}]),t}(u),t.Seq=function(e){function t(e){o(this,t);var n=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.children=e,n}return i(t,e),n(t,[{key:"emit",value:function(e,t){this.children.forEach((function(n){return n.emit(e,t)}))}},{key:"forEach",value:function(e){e(this),this.children.forEach((function(t){return t.forEach(e)}))}}]),t}(u),t.Semi=function(e){function t(){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,";"))}return i(t,e),t}(c),t.CommaSep=function(e){function t(e){o(this,t);var n=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.children=e,n}return i(t,e),n(t,[{key:"emit",value:function(e,t){var n=!0;this.children.forEach((function(r){n?n=!1:e.put(","),r.emit(e,t)}))}},{key:"forEach",value:function(e){e(this),this.children.forEach((function(t){return t.forEach(e)}))}}]),t}(u),t.SemiOp=function(e){function t(){return o(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this))}return i(t,e),n(t,[{key:"emit",value:function(e){e.putOptionalSemi()}}]),t}(u)},6748:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FormattedCodeGen=t.ExtensibleCodeGen=t.Sep=void 0;var r,i=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1];return new u.Token(e,t)}},{key:"p",value:function(e,t,n){return(0,u.getPrecedence)(e)0&&null==r[r.length-1]&&(i=y(i,this.sep(_.ARRAY_BEFORE_COMMA),this.t(","),this.sep(_.ARRAY_AFTER_COMMA))),this.bracket(i,_.ARRAY_INITIAL,_.ARRAY_FINAL)}},{key:"reduceAwaitExpression",value:function(e,t){var n=t.expression;return y(this.t("await"),this.sep(_.AWAIT),this.p(e.expression,(0,u.getPrecedence)(e),n))}},{key:"reduceSpreadElement",value:function(e,t){var n=t.expression;return y(this.t("..."),this.sep(_.SPREAD),this.p(e.expression,u.Precedence.Assignment,n))}},{key:"reduceSpreadProperty",value:function(e,t){var n=t.expression;return y(this.t("..."),this.sep(_.SPREAD),this.getAssignmentExpr(n))}},{key:"reduceAssignmentExpression",value:function(e,t){var n=t.binding,r=t.expression,i=n,o=r,s=r.containsIn,c=n.startsWithCurly,l=n.startsWithLetSquareBracket,p=n.startsWithFunctionOrClass;return(0,u.getPrecedence)(e.expression)<(0,u.getPrecedence)(e)&&(o=this.paren(o,_.EXPRESSION_PAREN_BEFORE,_.EXPRESSION_PAREN_AFTER),s=!1),(0,a.default)(y(i,this.sep(_.BEFORE_ASSIGN_OP("=")),this.t("="),this.sep(_.AFTER_ASSIGN_OP("=")),o),{containsIn:s,startsWithCurly:c,startsWithLetSquareBracket:l,startsWithFunctionOrClass:p})}},{key:"reduceAssignmentTargetIdentifier",value:function(e){var t=this.t(e.name);return"let"===e.name&&(t.startsWithLet=!0),t}},{key:"reduceAssignmentTargetWithDefault",value:function(e,t){var n=t.binding,r=t.init;return y(n,this.sep(_.BEFORE_DEFAULT_EQUALS),this.t("="),this.sep(_.AFTER_DEFAULT_EQUALS),this.p(e.init,u.Precedence.Assignment,r))}},{key:"reduceCompoundAssignmentExpression",value:function(e,t){var n=t.binding,r=t.expression,i=n,o=r,s=r.containsIn,c=n.startsWithCurly,l=n.startsWithLetSquareBracket,p=n.startsWithFunctionOrClass;return(0,u.getPrecedence)(e.expression)<(0,u.getPrecedence)(e)&&(o=this.paren(o,_.EXPRESSION_PAREN_BEFORE,_.EXPRESSION_PAREN_AFTER),s=!1),(0,a.default)(y(i,this.sep(_.BEFORE_ASSIGN_OP(e.operator)),this.t(e.operator),this.sep(_.AFTER_ASSIGN_OP(e.operator)),o),{containsIn:s,startsWithCurly:c,startsWithLetSquareBracket:l,startsWithFunctionOrClass:p})}},{key:"reduceBinaryExpression",value:function(e,t){var n=t.left,r=t.right,i=n,o=n.startsWithCurly,s=n.startsWithLetSquareBracket,c=n.startsWithFunctionOrClass,l=n.containsIn,p="**"===e.operator;((0,u.getPrecedence)(e.left)<(0,u.getPrecedence)(e)||p&&((0,u.getPrecedence)(e.left)===(0,u.getPrecedence)(e)||"UnaryExpression"===e.left.type))&&(i=this.paren(i,_.EXPRESSION_PAREN_BEFORE,_.EXPRESSION_PAREN_AFTER),o=!1,s=!1,c=!1,l=!1);var f=r,h=r.containsIn;return((0,u.getPrecedence)(e.right)<(0,u.getPrecedence)(e)||!p&&(0,u.getPrecedence)(e.right)===(0,u.getPrecedence)(e))&&(f=this.paren(f,_.EXPRESSION_PAREN_BEFORE,_.EXPRESSION_PAREN_AFTER),h=!1),(0,a.default)(y(i,this.sep(_.BEFORE_BINOP(e.operator)),this.t(e.operator),this.sep(_.AFTER_BINOP(e.operator)),f),{containsIn:l||h||"in"===e.operator,containsGroup:","===e.operator,startsWithCurly:o,startsWithLetSquareBracket:s,startsWithFunctionOrClass:c})}},{key:"reduceBindingWithDefault",value:function(e,t){var n=t.binding,r=t.init;return y(n,this.sep(_.BEFORE_DEFAULT_EQUALS),this.t("="),this.sep(_.AFTER_DEFAULT_EQUALS),this.p(e.init,u.Precedence.Assignment,r))}},{key:"reduceBindingIdentifier",value:function(e){var t=this.t(e.name);return"let"===e.name&&(t.startsWithLet=!0),t}},{key:"reduceArrayAssignmentTarget",value:function(e,t){var n=this,r=t.elements,i=t.rest,o=void 0;return 0===r.length?o=null==i?d():y(this.t("..."),this.sep(_.REST),i):(r=r.concat(null==i?[]:[y(this.t("..."),this.sep(_.REST),i)]),o=this.commaSep(r.map((function(e){return n.getAssignmentExpr(e)})),_.ARRAY_BEFORE_COMMA,_.ARRAY_AFTER_COMMA),r.length>0&&null==r[r.length-1]&&(o=y(o,this.sep(_.ARRAY_BEFORE_COMMA),this.t(","),this.sep(_.ARRAY_AFTER_COMMA)))),this.bracket(o,_.ARRAY_INITIAL,_.ARRAY_FINAL,_.ARRAY_EMPTY)}},{key:"reduceArrayBinding",value:function(e,t){var n=this,r=t.elements,i=t.rest,o=void 0;return 0===r.length?o=null==i?d():y(this.t("..."),this.sep(_.REST),i):(r=r.concat(null==i?[]:[y(this.t("..."),this.sep(_.REST),i)]),o=this.commaSep(r.map((function(e){return n.getAssignmentExpr(e)})),_.ARRAY_BEFORE_COMMA,_.ARRAY_AFTER_COMMA),r.length>0&&null==r[r.length-1]&&(o=y(o,this.sep(_.ARRAY_BEFORE_COMMA),this.t(","),this.sep(_.ARRAY_AFTER_COMMA)))),this.bracket(o,_.ARRAY_INITIAL,_.ARRAY_FINAL,_.ARRAY_EMPTY)}},{key:"reduceObjectAssignmentTarget",value:function(e,t){var n=t.properties,r=t.rest,i=void 0;0===n.length?i=null==r?d():y(this.t("..."),this.sep(_.REST),r):(i=this.commaSep(n,_.OBJECT_BEFORE_COMMA,_.OBJECT_AFTER_COMMA),i=null==r?i:this.commaSep([i,y(this.t("..."),this.sep(_.REST),r)],_.OBJECT_BEFORE_COMMA,_.OBJECT_AFTER_COMMA));var o=this.brace(i,e,_.OBJECT_BRACE_INITIAL,_.OBJECT_BRACE_FINAL,_.OBJECT_EMPTY);return o.startsWithCurly=!0,o}},{key:"reduceObjectBinding",value:function(e,t){var n=t.properties,r=t.rest,i=void 0;0===n.length?i=null==r?d():y(this.t("..."),this.sep(_.REST),r):(i=this.commaSep(n,_.OBJECT_BEFORE_COMMA,_.OBJECT_AFTER_COMMA),i=null==r?i:this.commaSep([i,y(this.t("..."),this.sep(_.REST),r)],_.OBJECT_BEFORE_COMMA,_.OBJECT_AFTER_COMMA));var o=this.brace(i,e,_.OBJECT_BRACE_INITIAL,_.OBJECT_BRACE_FINAL,_.OBJECT_EMPTY);return o.startsWithCurly=!0,o}},{key:"reduceAssignmentTargetPropertyIdentifier",value:function(e,t){var n=t.binding,r=t.init;return null==e.init?n:y(n,this.sep(_.BEFORE_DEFAULT_EQUALS),this.t("="),this.sep(_.AFTER_DEFAULT_EQUALS),this.p(e.init,u.Precedence.Assignment,r))}},{key:"reduceAssignmentTargetPropertyProperty",value:function(e,t){var n=t.name,r=t.binding;return y(n,this.sep(_.BEFORE_PROP),this.t(":"),this.sep(_.AFTER_PROP),r)}},{key:"reduceBindingPropertyIdentifier",value:function(e,t){var n=t.binding,r=t.init;return null==e.init?n:y(n,this.sep(_.BEFORE_DEFAULT_EQUALS),this.t("="),this.sep(_.AFTER_DEFAULT_EQUALS),this.p(e.init,u.Precedence.Assignment,r))}},{key:"reduceBindingPropertyProperty",value:function(e,t){var n=t.name,r=t.binding;return y(n,this.sep(_.BEFORE_PROP),this.t(":"),this.sep(_.AFTER_PROP),r)}},{key:"reduceBlock",value:function(e,t){var n=t.statements;return this.brace(y.apply(void 0,c(n)),e,_.BLOCK_BRACE_INITIAL,_.BLOCK_BRACE_FINAL,_.BLOCK_EMPTY)}},{key:"reduceBlockStatement",value:function(e,t){return y(t.block,this.sep(_.AFTER_STATEMENT(e)))}},{key:"reduceBreakStatement",value:function(e){return y(this.t("break"),e.label?y(this.sep(_.BEFORE_JUMP_LABEL),this.t(e.label)):d(),this.semiOp(),this.sep(_.AFTER_STATEMENT(e)))}},{key:"reduceCallExpression",value:function(e,t){var n=this,r=t.callee,i=t.arguments.map((function(t,r){return n.p(e.arguments[r],u.Precedence.Assignment,t)}));return(0,a.default)(y(this.p(e.callee,(0,u.getPrecedence)(e),r),this.sep(_.CALL),this.paren(this.commaSep(i,_.ARGS_BEFORE_COMMA,_.ARGS_AFTER_COMMA),_.CALL_PAREN_BEFORE,_.CALL_PAREN_AFTER,_.CALL_PAREN_EMPTY)),{startsWithCurly:r.startsWithCurly,startsWithLet:r.startsWithLet,startsWithLetSquareBracket:r.startsWithLetSquareBracket,startsWithFunctionOrClass:r.startsWithFunctionOrClass})}},{key:"reduceCatchClause",value:function(e,t){var n=t.binding,r=t.body;return y(this.t("catch"),this.sep(_.BEFORE_CATCH_BINDING),this.paren(n,_.CATCH_PAREN_BEFORE,_.CATCH_PAREN_AFTER),this.sep(_.AFTER_CATCH_BINDING),r)}},{key:"reduceClassDeclaration",value:function(e,t){var n=t.name,r=t.super,i=t.elements,o=y(this.t("class"),"*default*"===e.name.name?d():y(this.sep(_.BEFORE_CLASS_NAME),n));return null!=r&&(o=y(o,this.sep(_.BEFORE_EXTENDS),this.t("extends"),this.sep(_.AFTER_EXTENDS),this.p(e.super,u.Precedence.New,r))),o=y(o,this.sep(_.BEFORE_CLASS_DECLARATION_ELEMENTS),this.brace(y.apply(void 0,c(i)),e,_.CLASS_BRACE_INITIAL,_.CLASS_BRACE_FINAL,_.CLASS_EMPTY),this.sep(_.AFTER_STATEMENT(e)))}},{key:"reduceClassExpression",value:function(e,t){var n=t.name,r=t.super,i=t.elements,o=this.t("class");return null!=n&&(o=y(o,this.sep(_.BEFORE_CLASS_NAME),n)),null!=r&&(o=y(o,this.sep(_.BEFORE_EXTENDS),this.t("extends"),this.sep(_.AFTER_EXTENDS),this.p(e.super,u.Precedence.New,r))),(o=y(o,this.sep(_.BEFORE_CLASS_EXPRESSION_ELEMENTS),this.brace(y.apply(void 0,c(i)),e,_.CLASS_EXPRESSION_BRACE_INITIAL,_.CLASS_EXPRESSION_BRACE_FINAL,_.CLASS_EXPRESSION_BRACE_EMPTY))).startsWithFunctionOrClass=!0,o}},{key:"reduceClassElement",value:function(e,t){var n=t.method;return n=y(this.sep(_.BEFORE_CLASS_ELEMENT),n,this.sep(_.AFTER_CLASS_ELEMENT)),e.isStatic?y(this.t("static"),this.sep(_.AFTER_STATIC),n):n}},{key:"reduceComputedMemberAssignmentTarget",value:function(e,t){var n=t.object,r=t.expression,i=n.startsWithLetSquareBracket||"IdentifierExpression"===e.object.type&&"let"===e.object.name;return(0,a.default)(y(this.p(e.object,(0,u.getPrecedence)(e),n),this.sep(_.COMPUTED_MEMBER_ASSIGNMENT_TARGET),this.bracket(r,_.COMPUTED_MEMBER_ASSIGNMENT_TARGET_BRACKET_INTIAL,_.COMPUTED_MEMBER_ASSIGNMENT_TARGET_BRACKET_FINAL)),{startsWithLet:n.startsWithLet,startsWithLetSquareBracket:i,startsWithCurly:n.startsWithCurly,startsWithFunctionOrClass:n.startsWithFunctionOrClass})}},{key:"reduceComputedMemberExpression",value:function(e,t){var n=t.object,r=t.expression,i=n.startsWithLetSquareBracket||"IdentifierExpression"===e.object.type&&"let"===e.object.name;return(0,a.default)(y(this.p(e.object,(0,u.getPrecedence)(e),n),this.sep(_.COMPUTED_MEMBER_EXPRESSION),this.bracket(r,_.COMPUTED_MEMBER_BRACKET_INTIAL,_.COMPUTED_MEMBER_BRACKET_FINAL)),{startsWithLet:n.startsWithLet,startsWithLetSquareBracket:i,startsWithCurly:n.startsWithCurly,startsWithFunctionOrClass:n.startsWithFunctionOrClass})}},{key:"reduceComputedPropertyName",value:function(e,t){var n=t.expression;return this.bracket(this.p(e.expression,u.Precedence.Assignment,n),_.COMPUTED_PROPERTY_BRACKET_INTIAL,_.COMPUTED_PROPERTY_BRACKET_FINAL)}},{key:"reduceConditionalExpression",value:function(e,t){var n=t.test,r=t.consequent,i=t.alternate,o=n.containsIn||i.containsIn,s=n.startsWithCurly,c=n.startsWithLetSquareBracket,l=n.startsWithFunctionOrClass;return(0,a.default)(y(this.p(e.test,u.Precedence.LogicalOR,n),this.sep(_.BEFORE_TERNARY_QUESTION),this.t("?"),this.sep(_.AFTER_TERNARY_QUESTION),this.p(e.consequent,u.Precedence.Assignment,r),this.sep(_.BEFORE_TERNARY_COLON),this.t(":"),this.sep(_.AFTER_TERNARY_COLON),this.p(e.alternate,u.Precedence.Assignment,i)),{containsIn:o,startsWithCurly:s,startsWithLetSquareBracket:c,startsWithFunctionOrClass:l})}},{key:"reduceContinueStatement",value:function(e){return y(this.t("continue"),e.label?y(this.sep(_.BEFORE_JUMP_LABEL),this.t(e.label)):d(),this.semiOp(),this.sep(_.AFTER_STATEMENT(e)))}},{key:"reduceDataProperty",value:function(e,t){var n=t.name,r=t.expression;return y(n,this.sep(_.BEFORE_PROP),this.t(":"),this.sep(_.AFTER_PROP),this.getAssignmentExpr(r))}},{key:"reduceDebuggerStatement",value:function(e){return y(this.t("debugger"),this.semiOp(),this.sep(_.AFTER_STATEMENT(e)))}},{key:"reduceDoWhileStatement",value:function(e,t){var n=t.body,r=t.test;return y(this.t("do"),this.sep(_.AFTER_DO),n,this.sep(_.BEFORE_DOWHILE_WHILE),this.t("while"),this.sep(_.AFTER_DOWHILE_WHILE),this.paren(r,_.DO_WHILE_TEST_PAREN_BEFORE,_.DO_WHILE_TEST_PAREN_AFTER),this.semiOp(),this.sep(_.AFTER_STATEMENT(e)))}},{key:"reduceEmptyStatement",value:function(e){return y(this.t(";"),this.sep(_.AFTER_STATEMENT(e)))}},{key:"reduceExpressionStatement",value:function(e,t){var n=t.expression;return y(n.startsWithCurly||n.startsWithLetSquareBracket||n.startsWithFunctionOrClass?this.paren(n,_.EXPRESSION_STATEMENT_PAREN_BEFORE,_.EXPRESSION_STATEMENT_PAREN_AFTER):n,this.semiOp(),this.sep(_.AFTER_STATEMENT(e)))}},{key:"reduceForInStatement",value:function(e,t){var n=t.left,r=t.right,i=t.body;return n="VariableDeclaration"===e.left.type?m(v(n)):n,(0,a.default)(y(this.t("for"),this.sep(_.AFTER_FORIN_FOR),this.paren(y(n.startsWithLet?this.paren(n,_.FOR_IN_LET_PAREN_BEFORE,_.FOR_IN_LET_PAREN_AFTER):n,this.sep(_.BEFORE_FORIN_IN),this.t("in"),this.sep(_.AFTER_FORIN_FOR),r),_.FOR_IN_PAREN_BEFORE,_.FOR_IN_PAREN_AFTER),this.sep(_.BEFORE_FORIN_BODY),i,this.sep(_.AFTER_STATEMENT(e))),{endsWithMissingElse:i.endsWithMissingElse})}},{key:"reduceForOfStatement",value:function(e,t){var n=t.left,r=t.right,i=t.body;return n="VariableDeclaration"===e.left.type?m(v(n)):n,(0,a.default)(y(this.t("for"),this.sep(_.AFTER_FOROF_FOR),this.paren(y(n.startsWithLet?this.paren(n,_.FOR_OF_LET_PAREN_BEFORE,_.FOR_OF_LET_PAREN_AFTER):n,this.sep(_.BEFORE_FOROF_OF),this.t("of"),this.sep(_.AFTER_FOROF_FOR),this.p(e.right,u.Precedence.Assignment,r)),_.FOR_OF_PAREN_BEFORE,_.FOR_OF_PAREN_AFTER),this.sep(_.BEFORE_FOROF_BODY),i,this.sep(_.AFTER_STATEMENT(e))),{endsWithMissingElse:i.endsWithMissingElse})}},{key:"reduceForStatement",value:function(e,t){var n=t.init,r=t.test,i=t.update,o=t.body;return n&&(n.startsWithLetSquareBracket&&(n=this.paren(n,_.FOR_LET_PAREN_BEFORE,_.FOR_LET_PAREN_AFTER)),n=m(v(n))),(0,a.default)(y(this.t("for"),this.sep(_.AFTER_FOR_FOR),this.paren(y(n?y(this.sep(_.BEFORE_FOR_INIT),n,this.sep(_.AFTER_FOR_INIT)):this.sep(_.EMPTY_FOR_INIT),this.t(";"),r?y(this.sep(_.BEFORE_FOR_TEST),r,this.sep(_.AFTER_FOR_TEST)):this.sep(_.EMPTY_FOR_TEST),this.t(";"),i?y(this.sep(_.BEFORE_FOR_UPDATE),i,this.sep(_.AFTER_FOR_UPDATE)):this.sep(_.EMPTY_FOR_UPDATE))),this.sep(_.BEFORE_FOR_BODY),o,this.sep(_.AFTER_STATEMENT(e))),{endsWithMissingElse:o.endsWithMissingElse})}},{key:"reduceForAwaitStatement",value:function(e,t){var n=t.left,r=t.right,i=t.body;return n="VariableDeclaration"===e.left.type?m(v(n)):n,(0,a.default)(y(this.t("for"),this.sep(_.AFTER_FOROF_FOR),this.t("await"),this.sep(_.AFTER_FORAWAIT_AWAIT),this.paren(y(n.startsWithLet?this.paren(n,_.FOR_OF_LET_PAREN_BEFORE,_.FOR_OF_LET_PAREN_AFTER):n,this.sep(_.BEFORE_FOROF_OF),this.t("of"),this.sep(_.AFTER_FOROF_FOR),this.p(e.right,u.Precedence.Assignment,r)),_.FOR_OF_PAREN_BEFORE,_.FOR_OF_PAREN_AFTER),this.sep(_.BEFORE_FOROF_BODY),i,this.sep(_.AFTER_STATEMENT(e))),{endsWithMissingElse:i.endsWithMissingElse})}},{key:"reduceFunctionBody",value:function(e,t){var n=t.directives,r=t.statements;return r.length&&(r[0]=this.parenToAvoidBeingDirective(e.statements[0],r[0])),y.apply(void 0,c(n).concat([n.length?this.sep(_.AFTER_FUNCTION_DIRECTIVES):d()],c(r)))}},{key:"reduceFunctionDeclaration",value:function(e,t){var n=t.name,r=t.params,i=t.body;return y(e.isAsync?this.t("async"):d(),this.t("function"),e.isGenerator?y(this.sep(_.BEFORE_GENERATOR_STAR),this.t("*"),this.sep(_.AFTER_GENERATOR_STAR)):d(),this.sep(_.BEFORE_FUNCTION_NAME(e)),"*default*"===e.name.name?d():n,this.sep(_.BEFORE_FUNCTION_PARAMS),this.paren(r,_.PARAMETERS_PAREN_BEFORE,_.PARAMETERS_PAREN_AFTER,_.PARAMETERS_PAREN_EMPTY),this.sep(_.BEFORE_FUNCTION_DECLARATION_BODY),this.brace(i,e,_.FUNCTION_BRACE_INITIAL,_.FUNCTION_BRACE_FINAL,_.FUNCTION_EMPTY),this.sep(_.AFTER_STATEMENT(e)))}},{key:"reduceFunctionExpression",value:function(e,t){var n=t.name,r=t.params,i=t.body,o=y(e.isAsync?this.t("async"):d(),this.t("function"),e.isGenerator?y(this.sep(_.BEFORE_GENERATOR_STAR),this.t("*"),this.sep(_.AFTER_GENERATOR_STAR)):d(),this.sep(_.BEFORE_FUNCTION_NAME(e)),n||d(),this.sep(_.BEFORE_FUNCTION_PARAMS),this.paren(r,_.PARAMETERS_PAREN_BEFORE,_.PARAMETERS_PAREN_AFTER,_.PARAMETERS_PAREN_EMPTY),this.sep(_.BEFORE_FUNCTION_EXPRESSION_BODY),this.brace(i,e,_.FUNCTION_EXPRESSION_BRACE_INITIAL,_.FUNCTION_EXPRESSION_BRACE_FINAL,_.FUNCTION_EXPRESSION_EMPTY));return o.startsWithFunctionOrClass=!0,o}},{key:"reduceFormalParameters",value:function(e,t){var n=t.items,r=t.rest;return this.commaSep(n.concat(null==r?[]:[y(this.t("..."),this.sep(_.REST),r)]),_.PARAMETER_BEFORE_COMMA,_.PARAMETER_AFTER_COMMA)}},{key:"reduceArrowExpression",value:function(e,t){var n=t.params,r=t.body;null==e.params.rest&&1===e.params.items.length&&"BindingIdentifier"===e.params.items[0].type||(n=this.paren(n,_.ARROW_PARAMETERS_PAREN_BEFORE,_.ARROW_PARAMETERS_PAREN_AFTER,_.ARROW_PARAMETERS_PAREN_EMPTY));var i=!1;return"FunctionBody"===e.body.type?r=this.brace(r,e,_.ARROW_BRACE_INITIAL,_.ARROW_BRACE_FINAL,_.ARROW_BRACE_EMPTY):r.startsWithCurly?r=this.paren(r,_.ARROW_BODY_PAREN_BEFORE,_.ARROW_BODY_PAREN_AFTER):r.containsIn&&(i=!0),(0,a.default)(y(e.isAsync?y(this.t("async"),this.sep(_.BEFORE_ARROW_ASYNC_PARAMS)):d(),n,this.sep(_.BEFORE_ARROW),this.t("=>"),this.sep(_.AFTER_ARROW),this.p(e.body,u.Precedence.Assignment,r)),{containsIn:i})}},{key:"reduceGetter",value:function(e,t){var n=t.name,r=t.body;return y(this.t("get"),this.sep(_.AFTER_GET),n,this.sep(_.BEFORE_GET_PARAMS),this.paren(d(),null,null,_.GETTER_PARAMS),this.sep(_.BEFORE_GET_BODY),this.brace(r,e,_.GET_BRACE_INTIAL,_.GET_BRACE_FINAL,_.GET_BRACE_EMPTY))}},{key:"reduceIdentifierExpression",value:function(e){var t=this.t(e.name);return"let"===e.name&&(t.startsWithLet=!0),t}},{key:"reduceIfStatement",value:function(e,t){var n=t.test,r=t.consequent,i=t.alternate;return i&&r.endsWithMissingElse&&(r=this.brace(r,e,_.MISSING_ELSE_INTIIAL,_.MISSING_ELSE_FINAL,_.MISSING_ELSE_EMPTY)),(0,a.default)(y(this.t("if"),this.sep(_.AFTER_IF),this.paren(n,_.IF_PAREN_BEFORE,_.IF_PAREN_AFTER),this.sep(_.AFTER_IF_TEST),r,i?y(this.sep(_.BEFORE_ELSE),this.t("else"),this.sep(_.AFTER_ELSE),i):d(),this.sep(_.AFTER_STATEMENT(e))),{endsWithMissingElse:!i||i.endsWithMissingElse})}},{key:"reduceImport",value:function(e,t){var n=t.defaultBinding,r=t.namedImports,i=[];return null!=n&&i.push(n),r.length>0&&i.push(this.brace(this.commaSep(r,_.NAMED_IMPORT_BEFORE_COMMA,_.NAMED_IMPORT_AFTER_COMMA),e,_.IMPORT_BRACE_INTIAL,_.IMPORT_BRACE_FINAL,_.IMPORT_BRACE_EMPTY)),0===i.length?y(this.t("import"),this.sep(_.BEFORE_IMPORT_MODULE),this.t((0,u.escapeStringLiteral)(e.moduleSpecifier)),this.semiOp(),this.sep(_.AFTER_STATEMENT(e))):y(this.t("import"),this.sep(_.BEFORE_IMPORT_BINDINGS),this.commaSep(i,_.IMPORT_BEFORE_COMMA,_.IMPORT_AFTER_COMMA),this.sep(_.AFTER_IMPORT_BINDINGS),this.t("from"),this.sep(_.AFTER_FROM),this.t((0,u.escapeStringLiteral)(e.moduleSpecifier)),this.semiOp(),this.sep(_.AFTER_STATEMENT(e)))}},{key:"reduceImportNamespace",value:function(e,t){var n=t.defaultBinding,r=t.namespaceBinding;return y(this.t("import"),this.sep(_.BEFORE_IMPORT_NAMESPACE),null==n?d():y(n,this.sep(_.IMPORT_BEFORE_COMMA),this.t(","),this.sep(_.IMPORT_AFTER_COMMA)),this.sep(_.BEFORE_IMPORT_STAR),this.t("*"),this.sep(_.AFTER_IMPORT_STAR),this.t("as"),this.sep(_.AFTER_IMPORT_AS),r,this.sep(_.AFTER_NAMESPACE_BINDING),this.t("from"),this.sep(_.AFTER_FROM),this.t((0,u.escapeStringLiteral)(e.moduleSpecifier)),this.semiOp(),this.sep(_.AFTER_STATEMENT(e)))}},{key:"reduceImportSpecifier",value:function(e,t){var n=t.binding;return null==e.name?n:y(this.t(e.name),this.sep(_.BEFORE_IMPORT_AS),this.t("as"),this.sep(_.AFTER_IMPORT_AS),n)}},{key:"reduceExportAllFrom",value:function(e){return y(this.t("export"),this.sep(_.BEFORE_EXPORT_STAR),this.t("*"),this.sep(_.AFTER_EXPORT_STAR),this.t("from"),this.sep(_.AFTER_FROM),this.t((0,u.escapeStringLiteral)(e.moduleSpecifier)),this.semiOp(),this.sep(_.AFTER_STATEMENT(e)))}},{key:"reduceExportFrom",value:function(e,t){var n=t.namedExports;return y(this.t("export"),this.sep(_.BEFORE_EXPORT_BINDINGS),this.brace(this.commaSep(n,_.EXPORTS_BEFORE_COMMA,_.EXPORTS_AFTER_COMMA),e,_.EXPORT_BRACE_INITIAL,_.EXPORT_BRACE_FINAL,_.EXPORT_BRACE_EMPTY),this.sep(_.AFTER_EXPORT_FROM_BINDINGS),this.t("from"),this.sep(_.AFTER_FROM),this.t((0,u.escapeStringLiteral)(e.moduleSpecifier)),this.semiOp(),this.sep(_.AFTER_STATEMENT(e)))}},{key:"reduceExportLocals",value:function(e,t){var n=t.namedExports;return y(this.t("export"),this.sep(_.BEFORE_EXPORT_BINDINGS),this.brace(this.commaSep(n,_.EXPORTS_BEFORE_COMMA,_.EXPORTS_AFTER_COMMA),e,_.EXPORT_BRACE_INITIAL,_.EXPORT_BRACE_FINAL,_.EXPORT_BRACE_EMPTY),this.sep(_.AFTER_EXPORT_LOCAL_BINDINGS),this.semiOp(),this.sep(_.AFTER_STATEMENT(e)))}},{key:"reduceExport",value:function(e,t){var n=t.declaration;switch(e.declaration.type){case"FunctionDeclaration":case"ClassDeclaration":break;default:n=y(n,this.semiOp(),this.sep(_.AFTER_STATEMENT(e)))}return y(this.t("export"),this.sep(_.AFTER_EXPORT),n)}},{key:"reduceExportDefault",value:function(e,t){var n=t.body;switch(n=n.startsWithFunctionOrClass?this.paren(n,_.EXPORT_PAREN_BEFORE,_.EXPORT_PAREN_AFTER):n,e.body.type){case"FunctionDeclaration":case"ClassDeclaration":return y(this.t("export"),this.sep(_.EXPORT_DEFAULT),this.t("default"),this.sep(_.AFTER_EXPORT_DEFAULT),n);default:return y(this.t("export"),this.sep(_.EXPORT_DEFAULT),this.t("default"),this.sep(_.AFTER_EXPORT_DEFAULT),this.p(e.body,u.Precedence.Assignment,n),this.semiOp(),this.sep(_.AFTER_STATEMENT(e)))}}},{key:"reduceExportFromSpecifier",value:function(e){return null==e.exportedName?this.t(e.name):y(this.t(e.name),this.sep(_.BEFORE_EXPORT_AS),this.t("as"),this.sep(_.AFTER_EXPORT_AS),this.t(e.exportedName))}},{key:"reduceExportLocalSpecifier",value:function(e,t){var n=t.name;return null==e.exportedName?n:y(n,this.sep(_.BEFORE_EXPORT_AS),this.t("as"),this.sep(_.AFTER_EXPORT_AS),this.t(e.exportedName))}},{key:"reduceLabeledStatement",value:function(e,t){var n=t.body;return(0,a.default)(y(this.t(e.label),this.sep(_.BEFORE_LABEL_COLON),this.t(":"),this.sep(_.AFTER_LABEL_COLON),n),{endsWithMissingElse:n.endsWithMissingElse})}},{key:"reduceLiteralBooleanExpression",value:function(e){return this.t(e.value.toString())}},{key:"reduceLiteralNullExpression",value:function(){return this.t("null")}},{key:"reduceLiteralInfinityExpression",value:function(){return this.t("2e308")}},{key:"reduceLiteralNumericExpression",value:function(e){return new u.NumberCodeRep(e.value)}},{key:"reduceLiteralRegExpExpression",value:function(e){return this.t("/"+e.pattern+"/"+(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiLine?"m":"")+(e.dotAll?"s":"")+(e.unicode?"u":"")+(e.sticky?"y":""),!0)}},{key:"reduceLiteralStringExpression",value:function(e){return this.t((0,u.escapeStringLiteral)(e.value))}},{key:"reduceMethod",value:function(e,t){var n=t.name,r=t.params,i=t.body;return y(e.isAsync?y(this.t("async"),this.sep(_.AFTER_METHOD_ASYNC)):d(),e.isGenerator?y(this.t("*"),this.sep(_.AFTER_METHOD_GENERATOR_STAR)):d(),n,this.sep(_.AFTER_METHOD_NAME),this.paren(r,_.PARAMETERS_PAREN_BEFORE,_.PARAMETERS_PAREN_AFTER,_.PARAMETERS_PAREN_EMPTY),this.sep(_.BEFORE_METHOD_BODY),this.brace(i,e,_.METHOD_BRACE_INTIAL,_.METHOD_BRACE_FINAL,_.METHOD_BRACE_EMPTY))}},{key:"reduceModule",value:function(e,t){var n=t.directives,r=t.items;return r.length&&(r[0]=this.parenToAvoidBeingDirective(e.items[0],r[0])),y.apply(void 0,c(n).concat([n.length?this.sep(_.AFTER_MODULE_DIRECTIVES):d()],c(r)))}},{key:"reduceNewExpression",value:function(e,t){var n=this,r=t.callee,i=t.arguments,o=i.map((function(t,r){return n.p(e.arguments[r],u.Precedence.Assignment,t)})),a=(0,u.getPrecedence)(e.callee)===u.Precedence.Call?this.paren(r,_.NEW_CALLEE_PAREN_BEFORE,_.NEW_CALLEE_PAREN_AFTER):this.p(e.callee,(0,u.getPrecedence)(e),r);return y(this.t("new"),this.sep(_.AFTER_NEW),a,0===i.length?this.sep(_.EMPTY_NEW_CALL):y(this.sep(_.BEFORE_NEW_ARGS),this.paren(this.commaSep(o,_.ARGS_BEFORE_COMMA,_.ARGS_AFTER_COMMA),_.NEW_PAREN_BEFORE,_.NEW_PAREN_AFTER,_.NEW_PAREN_EMPTY)))}},{key:"reduceNewTargetExpression",value:function(){return y(this.t("new"),this.sep(_.NEW_TARGET_BEFORE_DOT),this.t("."),this.sep(_.NEW_TARGET_AFTER_DOT),this.t("target"))}},{key:"reduceObjectExpression",value:function(e,t){var n=t.properties,r=this.brace(this.commaSep(n,_.OBJECT_BEFORE_COMMA,_.OBJECT_AFTER_COMMA),e,_.OBJECT_BRACE_INITIAL,_.OBJECT_BRACE_FINAL,_.OBJECT_EMPTY);return r.startsWithCurly=!0,r}},{key:"reduceUpdateExpression",value:function(e,t){var n=t.operand;return e.isPrefix?this.reduceUnaryExpression.apply(this,arguments):(0,a.default)(y(this.p(e.operand,u.Precedence.New,n),this.sep(_.BEFORE_POSTFIX(e.operator)),this.t(e.operator)),{startsWithCurly:n.startsWithCurly,startsWithLetSquareBracket:n.startsWithLetSquareBracket,startsWithFunctionOrClass:n.startsWithFunctionOrClass})}},{key:"reduceUnaryExpression",value:function(e,t){var n=t.operand;return y(this.t(e.operator),this.sep(_.UNARY(e.operator)),this.p(e.operand,(0,u.getPrecedence)(e),n))}},{key:"reduceReturnStatement",value:function(e,t){var n=t.expression;return y(this.t("return"),n?y(this.sep(_.RETURN),n):d(),this.semiOp(),this.sep(_.AFTER_STATEMENT(e)))}},{key:"reduceScript",value:function(e,t){var n=t.directives,r=t.statements;return r.length&&(r[0]=this.parenToAvoidBeingDirective(e.statements[0],r[0])),y.apply(void 0,c(n).concat([n.length?this.sep(_.AFTER_SCRIPT_DIRECTIVES):d()],c(r)))}},{key:"reduceSetter",value:function(e,t){var n=t.name,r=t.param,i=t.body;return y(this.t("set"),this.sep(_.AFTER_SET),n,this.sep(_.BEFORE_SET_PARAMS),this.paren(r,_.SETTER_PARAM_BEFORE,_.SETTER_PARAM_AFTER),this.sep(_.BEFORE_SET_BODY),this.brace(i,e,_.SET_BRACE_INTIIAL,_.SET_BRACE_FINAL,_.SET_BRACE_EMPTY))}},{key:"reduceShorthandProperty",value:function(e,t){return t.name}},{key:"reduceStaticMemberAssignmentTarget",value:function(e,t){var n=t.object,r=y(this.p(e.object,(0,u.getPrecedence)(e),n),this.sep(_.BEFORE_STATIC_MEMBER_ASSIGNMENT_TARGET_DOT),this.t("."),this.sep(_.AFTER_STATIC_MEMBER_ASSIGNMENT_TARGET_DOT),this.t(e.property));return r.startsWithLet=n.startsWithLet,r.startsWithCurly=n.startsWithCurly,r.startsWithLetSquareBracket=n.startsWithLetSquareBracket,r.startsWithFunctionOrClass=n.startsWithFunctionOrClass,r}},{key:"reduceStaticMemberExpression",value:function(e,t){var n=t.object,r=y(this.p(e.object,(0,u.getPrecedence)(e),n),this.sep(_.BEFORE_STATIC_MEMBER_DOT),this.t("."),this.sep(_.AFTER_STATIC_MEMBER_DOT),this.t(e.property));return r.startsWithLet=n.startsWithLet,r.startsWithCurly=n.startsWithCurly,r.startsWithLetSquareBracket=n.startsWithLetSquareBracket,r.startsWithFunctionOrClass=n.startsWithFunctionOrClass,r}},{key:"reduceStaticPropertyName",value:function(e){if(s.keyword.isIdentifierNameES6(e.value))return this.t(e.value);var t=parseFloat(e.value);return t>=0&&t.toString()===e.value?new u.NumberCodeRep(t):this.t((0,u.escapeStringLiteral)(e.value))}},{key:"reduceSuper",value:function(){return this.t("super")}},{key:"reduceSwitchCase",value:function(e,t){var n=t.test,r=t.consequent;return y(this.t("case"),this.sep(_.BEFORE_CASE_TEST),n,this.sep(_.AFTER_CASE_TEST),this.t(":"),this.sep(_.BEFORE_CASE_BODY),y.apply(void 0,c(r)),this.sep(_.AFTER_CASE_BODY))}},{key:"reduceSwitchDefault",value:function(e,t){var n=t.consequent;return y(this.t("default"),this.sep(_.DEFAULT),this.t(":"),this.sep(_.BEFORE_CASE_BODY),y.apply(void 0,c(n)),this.sep(_.AFTER_DEFAULT_BODY))}},{key:"reduceSwitchStatement",value:function(e,t){var n=t.discriminant,r=t.cases;return y(this.t("switch"),this.sep(_.BEFORE_SWITCH_DISCRIM),this.paren(n,_.SWITCH_DISCRIM_PAREN_BEFORE,_.SWITCH_DISCRIM_PAREN_AFTER),this.sep(_.BEFORE_SWITCH_BODY),this.brace(y.apply(void 0,c(r)),e,_.SWITCH_BRACE_INTIAL,_.SWITCH_BRACE_FINAL,_.SWITCH_BRACE_EMPTY),this.sep(_.AFTER_STATEMENT(e)))}},{key:"reduceSwitchStatementWithDefault",value:function(e,t){var n=t.discriminant,r=t.preDefaultCases,i=t.defaultCase,o=t.postDefaultCases;return y(this.t("switch"),this.sep(_.BEFORE_SWITCH_DISCRIM),this.paren(n,_.SWITCH_DISCRIM_PAREN_BEFORE,_.SWITCH_DISCRIM_PAREN_AFTER),this.sep(_.BEFORE_SWITCH_BODY),this.brace(y.apply(void 0,c(r).concat([i],c(o))),e,_.SWITCH_BRACE_INTIAL,_.SWITCH_BRACE_FINAL,_.SWITCH_BRACE_EMPTY),this.sep(_.AFTER_STATEMENT(e)))}},{key:"reduceTemplateExpression",value:function(e,t){var n=t.tag,r=t.elements,i=null==e.tag?d():y(this.p(e.tag,(0,u.getPrecedence)(e),n),this.sep(_.TEMPLATE_TAG));i=y(i,this.t("`"));for(var o=0,a=e.elements.length;o0&&(s+="}"),s+=e.elements[o].rawValue,o1&&void 0!==arguments[1]?arguments[1]:new c.default,n=new u.TokenStream,r=(0,s.default)(t,e);return r.emit(n),n.result};var r=n(3293);Object.defineProperty(t,"MinimalCodeGen",{enumerable:!0,get:function(){return l(r).default}});var i=n(6748);Object.defineProperty(t,"ExtensibleCodeGen",{enumerable:!0,get:function(){return i.ExtensibleCodeGen}}),Object.defineProperty(t,"FormattedCodeGen",{enumerable:!0,get:function(){return i.FormattedCodeGen}}),Object.defineProperty(t,"Sep",{enumerable:!0,get:function(){return i.Sep}});var o=n(98);Object.defineProperty(t,"Precedence",{enumerable:!0,get:function(){return o.Precedence}}),Object.defineProperty(t,"getPrecedence",{enumerable:!0,get:function(){return o.getPrecedence}}),Object.defineProperty(t,"escapeStringLiteral",{enumerable:!0,get:function(){return o.escapeStringLiteral}}),Object.defineProperty(t,"CodeRep",{enumerable:!0,get:function(){return o.CodeRep}}),Object.defineProperty(t,"Empty",{enumerable:!0,get:function(){return o.Empty}}),Object.defineProperty(t,"Token",{enumerable:!0,get:function(){return o.Token}}),Object.defineProperty(t,"NumberCodeRep",{enumerable:!0,get:function(){return o.NumberCodeRep}}),Object.defineProperty(t,"Paren",{enumerable:!0,get:function(){return o.Paren}}),Object.defineProperty(t,"Bracket",{enumerable:!0,get:function(){return o.Bracket}}),Object.defineProperty(t,"Brace",{enumerable:!0,get:function(){return o.Brace}}),Object.defineProperty(t,"NoIn",{enumerable:!0,get:function(){return o.NoIn}}),Object.defineProperty(t,"ContainsIn",{enumerable:!0,get:function(){return o.ContainsIn}}),Object.defineProperty(t,"Seq",{enumerable:!0,get:function(){return o.Seq}}),Object.defineProperty(t,"Semi",{enumerable:!0,get:function(){return o.Semi}}),Object.defineProperty(t,"CommaSep",{enumerable:!0,get:function(){return o.CommaSep}}),Object.defineProperty(t,"SemiOp",{enumerable:!0,get:function(){return o.SemiOp}});var a=n(1393);Object.defineProperty(t,"codeGenWithLocation",{enumerable:!0,get:function(){return l(a).default}});var s=l(n(6493)),u=n(6389),c=l(r);function l(e){return e&&e.__esModule?e:{default:e}}},3293:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1];return new u.Token(e,t)}function f(e){return new u.Paren(e)}function h(e){return new u.Brace(e)}function d(e){return new u.Bracket(e)}function m(e){return new u.NoIn(e)}function v(e){return e.containsIn?new u.ContainsIn(e):e}function y(){for(var e=arguments.length,t=Array(e),n=0;n0&&null==n[n.length-1]&&(r=y(r,p(","))),d(r)}},{key:"reduceAwaitExpression",value:function(e,t){var n=t.expression;return y(p("await"),l(e.expression,(0,u.getPrecedence)(e),n))}},{key:"reduceSpreadElement",value:function(e,t){var n=t.expression;return y(p("..."),l(e.expression,u.Precedence.Assignment,n))}},{key:"reduceSpreadProperty",value:function(e,t){var n=t.expression;return y(p("..."),D(n))}},{key:"reduceAssignmentExpression",value:function(e,t){var n=t.binding,r=t.expression,i=n,o=r,s=r.containsIn,c=n.startsWithCurly,l=n.startsWithLetSquareBracket,h=n.startsWithFunctionOrClass;return(0,u.getPrecedence)(e.expression)<(0,u.getPrecedence)(e)&&(o=f(o),s=!1),(0,a.default)(y(i,p("="),o),{containsIn:s,startsWithCurly:c,startsWithLetSquareBracket:l,startsWithFunctionOrClass:h})}},{key:"reduceAssignmentTargetIdentifier",value:function(e){var t=p(e.name);return"let"===e.name&&(t.startsWithLet=!0),t}},{key:"reduceAssignmentTargetWithDefault",value:function(e,t){var n=t.binding,r=t.init;return y(n,p("="),l(e.init,u.Precedence.Assignment,r))}},{key:"reduceCompoundAssignmentExpression",value:function(e,t){var n=t.binding,r=t.expression,i=n,o=r,s=r.containsIn,c=n.startsWithCurly,l=n.startsWithLetSquareBracket,h=n.startsWithFunctionOrClass;return(0,u.getPrecedence)(e.expression)<(0,u.getPrecedence)(e)&&(o=f(o),s=!1),(0,a.default)(y(i,p(e.operator),o),{containsIn:s,startsWithCurly:c,startsWithLetSquareBracket:l,startsWithFunctionOrClass:h})}},{key:"reduceBinaryExpression",value:function(e,t){var n=t.left,r=t.right,i=n,o=n.startsWithCurly,s=n.startsWithLetSquareBracket,c=n.startsWithFunctionOrClass,l=n.containsIn,h="**"===e.operator;((0,u.getPrecedence)(e.left)<(0,u.getPrecedence)(e)||h&&((0,u.getPrecedence)(e.left)===(0,u.getPrecedence)(e)||"UnaryExpression"===e.left.type))&&(i=f(i),o=!1,s=!1,c=!1,l=!1);var d=r,m=r.containsIn;return((0,u.getPrecedence)(e.right)<(0,u.getPrecedence)(e)||!h&&(0,u.getPrecedence)(e.right)===(0,u.getPrecedence)(e))&&(d=f(d),m=!1),(0,a.default)(y(i,p(e.operator),d),{containsIn:l||m||"in"===e.operator,containsGroup:","===e.operator,startsWithCurly:o,startsWithLetSquareBracket:s,startsWithFunctionOrClass:c})}},{key:"reduceBindingWithDefault",value:function(e,t){var n=t.binding,r=t.init;return y(n,p("="),l(e.init,u.Precedence.Assignment,r))}},{key:"reduceBindingIdentifier",value:function(e){var t=p(e.name);return"let"===e.name&&(t.startsWithLet=!0),t}},{key:"reduceArrayAssignmentTarget",value:function(e,t){var n=t.elements,r=t.rest,i=void 0;return 0===n.length?i=null==r?E():y(p("..."),r):(i=b((n=n.concat(null==r?[]:[y(p("..."),r)])).map(D)),n.length>0&&null==n[n.length-1]&&(i=y(i,p(",")))),d(i)}},{key:"reduceArrayBinding",value:function(e,t){var n=t.elements,r=t.rest,i=void 0;return 0===n.length?i=null==r?E():y(p("..."),r):(i=b((n=n.concat(null==r?[]:[y(p("..."),r)])).map(D)),n.length>0&&null==n[n.length-1]&&(i=y(i,p(",")))),d(i)}},{key:"reduceObjectAssignmentTarget",value:function(e,t){var n=t.properties,r=t.rest,i=b(n),o=h(i=0===n.length?null==r?E():y(p("..."),r):null==r?i:y(i,p(","),p("..."),r));return o.startsWithCurly=!0,o}},{key:"reduceObjectBinding",value:function(e,t){var n=t.properties,r=t.rest,i=b(n),o=h(i=0===n.length?null==r?E():y(p("..."),r):null==r?i:y(i,p(","),p("..."),r));return o.startsWithCurly=!0,o}},{key:"reduceAssignmentTargetPropertyIdentifier",value:function(e,t){var n=t.binding,r=t.init;return null==e.init?n:y(n,p("="),l(e.init,u.Precedence.Assignment,r))}},{key:"reduceAssignmentTargetPropertyProperty",value:function(e,t){var n=t.name,r=t.binding;return y(n,p(":"),r)}},{key:"reduceBindingPropertyIdentifier",value:function(e,t){var n=t.binding,r=t.init;return null==e.init?n:y(n,p("="),l(e.init,u.Precedence.Assignment,r))}},{key:"reduceBindingPropertyProperty",value:function(e,t){var n=t.name,r=t.binding;return y(n,p(":"),r)}},{key:"reduceBlock",value:function(e,t){var n=t.statements;return h(y.apply(void 0,c(n)))}},{key:"reduceBlockStatement",value:function(e,t){return t.block}},{key:"reduceBreakStatement",value:function(e){return y(p("break"),e.label?p(e.label):E(),_())}},{key:"reduceCallExpression",value:function(e,t){var n=t.callee,r=t.arguments.map((function(t,n){return l(e.arguments[n],u.Precedence.Assignment,t)}));return(0,a.default)(y(l(e.callee,(0,u.getPrecedence)(e),n),f(b(r))),{startsWithCurly:n.startsWithCurly,startsWithLet:n.startsWithLet,startsWithLetSquareBracket:n.startsWithLetSquareBracket,startsWithFunctionOrClass:n.startsWithFunctionOrClass})}},{key:"reduceCatchClause",value:function(e,t){var n=t.binding,r=t.body;return y(p("catch"),f(n),r)}},{key:"reduceClassDeclaration",value:function(e,t){var n=t.name,r=t.super,i=t.elements,o=y(p("class"),"*default*"===e.name.name?E():n);return null!=r&&(o=y(o,p("extends"),l(e.super,u.Precedence.New,r))),o=y.apply(void 0,[o,p("{")].concat(c(i),[p("}")]))}},{key:"reduceClassExpression",value:function(e,t){var n=t.name,r=t.super,i=t.elements,o=p("class");return null!=n&&(o=y(o,n)),null!=r&&(o=y(o,p("extends"),l(e.super,u.Precedence.New,r))),(o=y.apply(void 0,[o,p("{")].concat(c(i),[p("}")]))).startsWithFunctionOrClass=!0,o}},{key:"reduceClassElement",value:function(e,t){var n=t.method;return e.isStatic?y(p("static"),n):n}},{key:"reduceComputedMemberAssignmentTarget",value:function(e,t){var n=t.object,r=t.expression,i=n.startsWithLetSquareBracket||"IdentifierExpression"===e.object.type&&"let"===e.object.name;return(0,a.default)(y(l(e.object,(0,u.getPrecedence)(e),n),d(r)),{startsWithLet:n.startsWithLet,startsWithLetSquareBracket:i,startsWithCurly:n.startsWithCurly,startsWithFunctionOrClass:n.startsWithFunctionOrClass})}},{key:"reduceComputedMemberExpression",value:function(e,t){var n=t.object,r=t.expression,i=n.startsWithLetSquareBracket||"IdentifierExpression"===e.object.type&&"let"===e.object.name;return(0,a.default)(y(l(e.object,(0,u.getPrecedence)(e),n),d(r)),{startsWithLet:n.startsWithLet,startsWithLetSquareBracket:i,startsWithCurly:n.startsWithCurly,startsWithFunctionOrClass:n.startsWithFunctionOrClass})}},{key:"reduceComputedPropertyName",value:function(e,t){var n=t.expression;return d(l(e.expression,u.Precedence.Assignment,n))}},{key:"reduceConditionalExpression",value:function(e,t){var n=t.test,r=t.consequent,i=t.alternate,o=n.containsIn||i.containsIn,s=n.startsWithCurly,c=n.startsWithLetSquareBracket,f=n.startsWithFunctionOrClass;return(0,a.default)(y(l(e.test,u.Precedence.LogicalOR,n),p("?"),l(e.consequent,u.Precedence.Assignment,r),p(":"),l(e.alternate,u.Precedence.Assignment,i)),{containsIn:o,startsWithCurly:s,startsWithLetSquareBracket:c,startsWithFunctionOrClass:f})}},{key:"reduceContinueStatement",value:function(e){return y(p("continue"),e.label?p(e.label):E(),_())}},{key:"reduceDataProperty",value:function(e,t){var n=t.name,r=t.expression;return y(n,p(":"),D(r))}},{key:"reduceDebuggerStatement",value:function(){return y(p("debugger"),_())}},{key:"reduceDoWhileStatement",value:function(e,t){var n=t.body,r=t.test;return y(p("do"),n,p("while"),f(r),_())}},{key:"reduceEmptyStatement",value:function(){return g()}},{key:"reduceExpressionStatement",value:function(e,t){var n=t.expression;return y(n.startsWithCurly||n.startsWithLetSquareBracket||n.startsWithFunctionOrClass?f(n):n,_())}},{key:"reduceForInStatement",value:function(e,t){var n=t.left,r=t.right,i=t.body;return n="VariableDeclaration"===e.left.type?m(v(n)):n,(0,a.default)(y(p("for"),f(y(n.startsWithLet?f(n):n,p("in"),r)),i),{endsWithMissingElse:i.endsWithMissingElse})}},{key:"reduceForOfStatement",value:function(e,t){var n=t.left,r=t.right,i=t.body;return n="VariableDeclaration"===e.left.type?m(v(n)):n,(0,a.default)(y(p("for"),f(y(n.startsWithLet?f(n):n,p("of"),l(e.right,u.Precedence.Assignment,r))),i),{endsWithMissingElse:i.endsWithMissingElse})}},{key:"reduceForStatement",value:function(e,t){var n=t.init,r=t.test,i=t.update,o=t.body;return n&&(n.startsWithLetSquareBracket&&(n=f(n)),n=m(v(n))),(0,a.default)(y(p("for"),f(y(n||E(),g(),r||E(),g(),i||E())),o),{endsWithMissingElse:o.endsWithMissingElse})}},{key:"reduceForAwaitStatement",value:function(e,t){var n=t.left,r=t.right,i=t.body;return n="VariableDeclaration"===e.left.type?m(v(n)):n,(0,a.default)(y(p("for"),p("await"),f(y(n.startsWithLet?f(n):n,p("of"),l(e.right,u.Precedence.Assignment,r))),i),{endsWithMissingElse:i.endsWithMissingElse})}},{key:"reduceFunctionBody",value:function(e,t){var n=t.directives,r=t.statements;return r.length&&(r[0]=this.parenToAvoidBeingDirective(e.statements[0],r[0])),h(y.apply(void 0,c(n).concat(c(r))))}},{key:"reduceFunctionDeclaration",value:function(e,t){var n=t.name,r=t.params,i=t.body;return y(e.isAsync?p("async"):E(),p("function"),e.isGenerator?p("*"):E(),"*default*"===e.name.name?E():n,r,i)}},{key:"reduceFunctionExpression",value:function(e,t){var n=t.name,r=t.params,i=t.body,o=y(e.isAsync?p("async"):E(),p("function"),e.isGenerator?p("*"):E(),n||E(),r,i);return o.startsWithFunctionOrClass=!0,o}},{key:"reduceFormalParameters",value:function(e,t){var n=t.items,r=t.rest;return f(b(n.concat(null==r?[]:[y(p("..."),r)])))}},{key:"reduceArrowExpression",value:function(e,t){var n=t.params,r=t.body;n=this.regenerateArrowParams(e.params,n);var i=!1;return"FunctionBody"!==e.body.type&&(r.startsWithCurly?r=f(r):r.containsIn&&(i=!0)),(0,a.default)(y(e.isAsync?p("async"):E(),n,p("=>"),l(e.body,u.Precedence.Assignment,r)),{containsIn:i})}},{key:"reduceGetter",value:function(e,t){var n=t.name,r=t.body;return y(p("get"),n,f(E()),r)}},{key:"reduceIdentifierExpression",value:function(e){var t=p(e.name);return"let"===e.name&&(t.startsWithLet=!0),t}},{key:"reduceIfStatement",value:function(e,t){var n=t.test,r=t.consequent,i=t.alternate;return i&&r.endsWithMissingElse&&(r=h(r)),(0,a.default)(y(p("if"),f(n),r,i?y(p("else"),i):E()),{endsWithMissingElse:!i||i.endsWithMissingElse})}},{key:"reduceImport",value:function(e,t){var n=t.defaultBinding,r=t.namedImports,i=[];return null!=n&&i.push(n),r.length>0&&i.push(h(b(r))),0===i.length?y(p("import"),p((0,u.escapeStringLiteral)(e.moduleSpecifier)),_()):y(p("import"),b(i),p("from"),p((0,u.escapeStringLiteral)(e.moduleSpecifier)),_())}},{key:"reduceImportNamespace",value:function(e,t){var n=t.defaultBinding,r=t.namespaceBinding;return y(p("import"),null==n?E():y(n,p(",")),p("*"),p("as"),r,p("from"),p((0,u.escapeStringLiteral)(e.moduleSpecifier)),_())}},{key:"reduceImportSpecifier",value:function(e,t){var n=t.binding;return null==e.name?n:y(p(e.name),p("as"),n)}},{key:"reduceExportAllFrom",value:function(e){return y(p("export"),p("*"),p("from"),p((0,u.escapeStringLiteral)(e.moduleSpecifier)),_())}},{key:"reduceExportFrom",value:function(e,t){var n=t.namedExports;return y(p("export"),h(b(n)),p("from"),p((0,u.escapeStringLiteral)(e.moduleSpecifier)),_())}},{key:"reduceExportLocals",value:function(e,t){var n=t.namedExports;return y(p("export"),h(b(n)),_())}},{key:"reduceExport",value:function(e,t){var n=t.declaration;switch(e.declaration.type){case"FunctionDeclaration":case"ClassDeclaration":break;default:n=y(n,_())}return y(p("export"),n)}},{key:"reduceExportDefault",value:function(e,t){var n=t.body;switch(n=n.startsWithFunctionOrClass?f(n):n,e.body.type){case"FunctionDeclaration":case"ClassDeclaration":return y(p("export default"),n);default:return y(p("export default"),l(e.body,u.Precedence.Assignment,n),_())}}},{key:"reduceExportFromSpecifier",value:function(e){return null==e.exportedName?p(e.name):y(p(e.name),p("as"),p(e.exportedName))}},{key:"reduceExportLocalSpecifier",value:function(e,t){var n=t.name;return null==e.exportedName?n:y(n,p("as"),p(e.exportedName))}},{key:"reduceLabeledStatement",value:function(e,t){var n=t.body;return(0,a.default)(y(p(e.label+":"),n),{endsWithMissingElse:n.endsWithMissingElse})}},{key:"reduceLiteralBooleanExpression",value:function(e){return p(e.value.toString())}},{key:"reduceLiteralNullExpression",value:function(){return p("null")}},{key:"reduceLiteralInfinityExpression",value:function(){return p("2e308")}},{key:"reduceLiteralNumericExpression",value:function(e){return new u.NumberCodeRep(e.value)}},{key:"reduceLiteralRegExpExpression",value:function(e){return p("/"+e.pattern+"/"+(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiLine?"m":"")+(e.dotAll?"s":"")+(e.unicode?"u":"")+(e.sticky?"y":""),!0)}},{key:"reduceLiteralStringExpression",value:function(e){return p((0,u.escapeStringLiteral)(e.value))}},{key:"reduceMethod",value:function(e,t){var n=t.name,r=t.params,i=t.body;return y(e.isAsync?p("async"):E(),e.isGenerator?p("*"):E(),n,r,i)}},{key:"reduceModule",value:function(e,t){var n=t.directives,r=t.items;return r.length&&(r[0]=this.parenToAvoidBeingDirective(e.items[0],r[0])),y.apply(void 0,c(n).concat(c(r)))}},{key:"reduceNewExpression",value:function(e,t){var n=t.callee,r=t.arguments,i=r.map((function(t,n){return l(e.arguments[n],u.Precedence.Assignment,t)})),o=(0,u.getPrecedence)(e.callee)===u.Precedence.Call?f(n):l(e.callee,(0,u.getPrecedence)(e),n);return y(p("new"),o,0===r.length?E():f(b(i)))}},{key:"reduceNewTargetExpression",value:function(){return p("new.target")}},{key:"reduceObjectExpression",value:function(e,t){var n=h(b(t.properties));return n.startsWithCurly=!0,n}},{key:"reduceUpdateExpression",value:function(e,t){var n=t.operand;return e.isPrefix?this.reduceUnaryExpression.apply(this,arguments):(0,a.default)(y(l(e.operand,u.Precedence.New,n),p(e.operator)),{startsWithCurly:n.startsWithCurly,startsWithLetSquareBracket:n.startsWithLetSquareBracket,startsWithFunctionOrClass:n.startsWithFunctionOrClass})}},{key:"reduceUnaryExpression",value:function(e,t){var n=t.operand;return y(p(e.operator),l(e.operand,(0,u.getPrecedence)(e),n))}},{key:"reduceReturnStatement",value:function(e,t){var n=t.expression;return y(p("return"),n||E(),_())}},{key:"reduceScript",value:function(e,t){var n=t.directives,r=t.statements;return r.length&&(r[0]=this.parenToAvoidBeingDirective(e.statements[0],r[0])),y.apply(void 0,c(n).concat(c(r)))}},{key:"reduceSetter",value:function(e,t){var n=t.name,r=t.param,i=t.body;return y(p("set"),n,f(r),i)}},{key:"reduceShorthandProperty",value:function(e,t){return t.name}},{key:"reduceStaticMemberAssignmentTarget",value:function(e,t){var n=t.object,r=y(l(e.object,(0,u.getPrecedence)(e),n),p("."),p(e.property));return r.startsWithLet=n.startsWithLet,r.startsWithCurly=n.startsWithCurly,r.startsWithLetSquareBracket=n.startsWithLetSquareBracket,r.startsWithFunctionOrClass=n.startsWithFunctionOrClass,r}},{key:"reduceStaticMemberExpression",value:function(e,t){var n=t.object,r=y(l(e.object,(0,u.getPrecedence)(e),n),p("."),p(e.property));return r.startsWithLet=n.startsWithLet,r.startsWithCurly=n.startsWithCurly,r.startsWithLetSquareBracket=n.startsWithLetSquareBracket,r.startsWithFunctionOrClass=n.startsWithFunctionOrClass,r}},{key:"reduceStaticPropertyName",value:function(e){if(s.keyword.isIdentifierNameES6(e.value))return p(e.value);var t=parseFloat(e.value);return t>=0&&t.toString()===e.value?new u.NumberCodeRep(t):p((0,u.escapeStringLiteral)(e.value))}},{key:"reduceSuper",value:function(){return p("super")}},{key:"reduceSwitchCase",value:function(e,t){var n=t.test,r=t.consequent;return y(p("case"),n,p(":"),y.apply(void 0,c(r)))}},{key:"reduceSwitchDefault",value:function(e,t){var n=t.consequent;return y(p("default:"),y.apply(void 0,c(n)))}},{key:"reduceSwitchStatement",value:function(e,t){var n=t.discriminant,r=t.cases;return y(p("switch"),f(n),h(y.apply(void 0,c(r))))}},{key:"reduceSwitchStatementWithDefault",value:function(e,t){var n=t.discriminant,r=t.preDefaultCases,i=t.defaultCase,o=t.postDefaultCases;return y(p("switch"),f(n),h(y.apply(void 0,c(r).concat([i],c(o)))))}},{key:"reduceTemplateExpression",value:function(e,t){var n=t.tag,r=t.elements,i=null==e.tag?E():l(e.tag,(0,u.getPrecedence)(e),n);i=y(i,p("`"));for(var o=0,a=e.elements.length;o0?p("}"):E(),r[o],o=1e3&&e%10===0?(t=e.toString(10),/[eE]/.test(t)?t.replace(/[eE]\+/,"e"):e.toString(10).replace(/0{3,}$/,(function(e){return"e"+e.length}))):e%1===0?e>1e15&&e<1e20?"0x"+e.toString(16).toUpperCase():e.toString(10).replace(/[eE]\+/,"e"):e.toString(10).replace(/^0\./,".").replace(/[eE]\+/,"e")}(e);this.put(t),this.lastNumber=t}},{key:"putOptionalSemi",value:function(){this.optionalSemi=!0}},{key:"putRaw",value:function(e){this.result+=e,this.lastTokenStr=e}},{key:"put",value:function(e,t){if(this.optionalSemi&&(this.optionalSemi=!1,"}"!==e&&(this.result+=";",this.lastCodePoint=";",this.previousWasRegExp=!1)),null!==this.lastNumber&&1===e.length&&"."===e)return this.result+=a(this.lastNumber)?"..":".",this.lastNumber=null,void(this.lastCodePoint=".");var n=[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0){this.lastNumber=null;var r=String.fromCodePoint(e.codePointAt(0)),i=this.lastCodePoint;this.lastCodePoint=String.fromCodePoint(e.codePointAt(n-1));var s=this.previousWasRegExp;this.previousWasRegExp=t,i&&(("+"===i||"-"===i)&&i===r||o(i)&&o(r)||"/"===i&&"/"===r||s&&"i"===r||this.partialHtmlComment&&e.startsWith("--"))&&(this.result+=" ")}this.partialHtmlComment=this.lastTokenStr.endsWith("<")&&"!"===e,this.result+=e,this.lastTokenStr=e}}]),e}()},1664:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.whitespaceArray=[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279],t.whitespaceBool=[!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!1,!0,!0,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1],t.idStartLargeRegex=/^[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]$/,t.idStartBool=[!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!1,!1,!1,!1,!0,!1,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!1,!1,!1,!1,!1],t.idContinueLargeRegex=/^[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]$/,t.idContinueBool=[!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!1,!1,!1,!1,!1,!1,!1,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!1,!1,!1,!1,!0,!1,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!1,!1,!1,!1,!1]},1393:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:new c.default,n=new l,r=(0,a.reduce)(f(t),e);return r.emit(n),{source:n.result,locations:n.locations}};var o,a=n(6493),s=n(6389),u=n(3293),c=(o=u)&&o.__esModule?o:{default:o};var l=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.line=1,e.column=0,e.startingNodes=[],e.finishingStatements=[],e.lastNumberNode=null,e.locations=new WeakMap,e}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"putRaw",value:function(e){var n=this.result.length;i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"putRaw",this).call(this,e),this.startNodes(e,n)}},{key:"put",value:function(e,n){if(this.optionalSemi&&"}"!==e){var r=!0,o=!1,a=void 0;try{for(var u,c=this.finishingStatements[Symbol.iterator]();!(r=(u=c.next()).done);r=!0){var l=u.value;++l.end.column,++l.end.offset}}catch(h){o=!0,a=h}finally{try{!r&&c.return&&c.return()}finally{if(o)throw a}}}if(this.finishingStatements=[],null!==this.lastNumber&&"."===e&&(0,s.needsDoubleDot)(this.lastNumber)){var p=this.locations.get(this.lastNumberNode).end;++p.column,++p.offset}this.lastNumberNode=null;var f=this.result.length;i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"put",this).call(this,e,n),this.startNodes(e,f)}},{key:"startNodes",value:function(e,t){for(var n=/\r\n?|[\n\u2028\u2029]/g,r=!1,i=void 0,o=this.line,a=this.column;i=n.exec(e);)++this.line,this.column=e.length-i.index-i[0].length,r=!0;r||(this.column+=this.result.length-t,a=this.column-e.length);var s=!0,u=!1,c=void 0;try{for(var l,p=this.startingNodes[Symbol.iterator]();!(s=(l=p.next()).done);s=!0){var f=l.value;this.locations.set(f,{start:{line:o,column:a,offset:this.result.length-e.length},end:null})}}catch(h){u=!0,c=h}finally{try{!s&&p.return&&p.return()}finally{if(u)throw c}}this.startingNodes=[]}},{key:"startEmit",value:function(e){this.startingNodes.push(e)}},{key:"finishEmit",value:function(e){var t;this.locations.get(e).end={line:this.line,column:this.column,offset:this.result.length},t=e.type,/(Import)|(Export)|(Statement)|(Directive)|(SwitchCase)|(SwitchDefault)/.test(t)&&this.finishingStatements.push(this.locations.get(e))}}]),t}(s.TokenStream);function p(e,t){var n=e.emit.bind(e);return"Script"===t.type||"Module"===t.type?e.emit=function(e){for(var r=arguments.length,i=Array(r>1?r-1:0),o=1;o1?r-1:0),o=1;o1?r-1:0),o=1;o1?t-1:0),r=1;r1&&n.slice(1).forEach((function(n){t.addError(e(n))}))})),this}},{key:"enforceConflictingLexicallyDeclaredNames",value:function(e,t){var n=this;return this.lexicallyDeclaredNames.forEachEntry((function(r,i){e.has(i)&&r.forEach((function(e){n.addError(t(e))}))})),this}},{key:"observeFunctionDeclaration",value:function(){return this.observeVarBoundary(),u(this.functionDeclarationNames,this.boundNames),this.boundNames=new a.default,this}},{key:"functionDeclarationNamesAreLexical",value:function(){return u(this.lexicallyDeclaredNames,this.functionDeclarationNames),this.functionDeclarationNames=new a.default,this}},{key:"observeVarDeclaration",value:function(){return u(this.varDeclaredNames,this.boundNames),this.boundNames=new a.default,this}},{key:"recordForOfVars",value:function(){var e=this;return this.varDeclaredNames.forEach((function(t){e.forOfVarDeclaredNames.push(t)})),this}},{key:"observeVarBoundary",value:function(){return this.lexicallyDeclaredNames=new a.default,this.functionDeclarationNames=new a.default,this.varDeclaredNames=new a.default,this.forOfVarDeclaredNames=[],this}},{key:"exportName",value:function(e,t){return this.exportedNames.set(e,t),this}},{key:"exportDeclaredNames",value:function(){return u(this.exportedNames,this.lexicallyDeclaredNames,this.varDeclaredNames),u(this.exportedBindings,this.lexicallyDeclaredNames,this.varDeclaredNames),this}},{key:"exportBinding",value:function(e,t){return this.exportedBindings.set(e,t),this}},{key:"clearExportedBindings",value:function(){return this.exportedBindings=new a.default,this}},{key:"observeYieldExpression",value:function(e){return this.yieldExpressions.push(e),this}},{key:"clearYieldExpressions",value:function(){return this.yieldExpressions=[],this}},{key:"observeAwaitExpression",value:function(e){return this.awaitExpressions.push(e),this}},{key:"clearAwaitExpressions",value:function(){return this.awaitExpressions=[],this}},{key:"addError",value:function(e){return this.errors.push(e),this}},{key:"addStrictError",value:function(e){return this.strictErrors.push(e),this}},{key:"enforceStrictErrors",value:function(){return[].push.apply(this.errors,this.strictErrors),this.strictErrors=[],this}},{key:"concat",value:function(e){return this===c?e:(e===c||([].push.apply(this.errors,e.errors),[].push.apply(this.strictErrors,e.strictErrors),[].push.apply(this.usedLabelNames,e.usedLabelNames),[].push.apply(this.freeBreakStatements,e.freeBreakStatements),[].push.apply(this.freeContinueStatements,e.freeContinueStatements),[].push.apply(this.freeLabeledBreakStatements,e.freeLabeledBreakStatements),[].push.apply(this.freeLabeledContinueStatements,e.freeLabeledContinueStatements),[].push.apply(this.newTargetExpressions,e.newTargetExpressions),u(this.boundNames,e.boundNames),u(this.lexicallyDeclaredNames,e.lexicallyDeclaredNames),u(this.functionDeclarationNames,e.functionDeclarationNames),u(this.varDeclaredNames,e.varDeclaredNames),[].push.apply(this.forOfVarDeclaredNames,e.forOfVarDeclaredNames),u(this.exportedNames,e.exportedNames),u(this.exportedBindings,e.exportedBindings),[].push.apply(this.superCallExpressions,e.superCallExpressions),[].push.apply(this.superCallExpressionsInConstructorMethod,e.superCallExpressionsInConstructorMethod),[].push.apply(this.superPropertyExpressions,e.superPropertyExpressions),[].push.apply(this.yieldExpressions,e.yieldExpressions),[].push.apply(this.awaitExpressions,e.awaitExpressions)),this)}}],[{key:"empty",value:function(){return c}}]),e}();c=new l,Object.getOwnPropertyNames(l.prototype).forEach((function(e){"constructor"!==e&&Object.defineProperty(c,e,{value:function(){return l.prototype[e].apply(new l,arguments)},enumerable:!1,writable:!0,configurable:!0})}));t.EarlyError=function(e){function t(e,n){s(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,n));return r.node=e,r.message=n,r}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,Error),t}()},4292:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EarlyErrorChecker=void 0;var r,i=function(){function e(e,t){for(var n=0;n1&&n.slice(1).forEach((function(e){t=t.addError(new l.EarlyError(e,"Duplicate constructor method in class"))})),t}var y=function(e){return new l.EarlyError(e,c.ErrorMessages.ILLEGAL_SUPER_CALL)},g=function(e){return new l.EarlyError(e,"Member access on super must be in a method")},_=function(e){return new l.EarlyError(e,"Duplicate binding "+JSON.stringify(e.name))},E=function(e){return new l.EarlyError(e,"Continue statement must be nested within an iteration statement")},b=function(e){return new l.EarlyError(e,"Continue statement must be nested within an iteration statement with label "+JSON.stringify(e.label))},D=function(e){return new l.EarlyError(e,"Break statement must be nested within an iteration statement or a switch statement")},A=function(e){return new l.EarlyError(e,"Break statement must be nested within a statement with label "+JSON.stringify(e.label))};t.EarlyErrorChecker=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,l.EarlyErrorState))}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"reduceAssignmentExpression",value:function(){return o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceAssignmentExpression",this).apply(this,arguments).clearBoundNames()}},{key:"reduceAssignmentTargetIdentifier",value:function(e){var t=this.identity;return("eval"===e.name||"arguments"===e.name||(0,u.isStrictModeReservedWord)(e.name))&&(t=t.addStrictError(new l.EarlyError(e,"The identifier "+JSON.stringify(e.name)+" must not be in binding position in strict mode"))),t}},{key:"reduceArrowExpression",value:function(e,n){var r=n.params,i=n.body,a=null==e.params.rest&&e.params.items.every((function(e){return"BindingIdentifier"===e.type}));r=r.enforceDuplicateLexicallyDeclaredNames(_),"FunctionBody"===e.body.type&&(i=i.enforceConflictingLexicallyDeclaredNames(r.lexicallyDeclaredNames,_),f(e.body)&&(r=r.enforceStrictErrors(),i=i.enforceStrictErrors())),r.yieldExpressions.forEach((function(e){r=r.addError(new l.EarlyError(e,"Arrow parameters must not contain yield expressions"))})),r.awaitExpressions.forEach((function(e){r=r.addError(new l.EarlyError(e,"Arrow parameters must not contain await expressions"))}));var s=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceArrowExpression",this).call(this,e,{params:r,body:i});return!a&&"FunctionBody"===e.body.type&&f(e.body)&&(s=s.addError(new l.EarlyError(e,'Functions with non-simple parameter lists may not contain a "use strict" directive'))),s=(s=(s=s.clearYieldExpressions()).clearAwaitExpressions()).observeVarBoundary()}},{key:"reduceAwaitExpression",value:function(e,t){return t.expression.observeAwaitExpression(e)}},{key:"reduceBindingIdentifier",value:function(e){var t=this.identity;return("eval"===e.name||"arguments"===e.name||(0,u.isStrictModeReservedWord)(e.name))&&(t=t.addStrictError(new l.EarlyError(e,"The identifier "+JSON.stringify(e.name)+" must not be in binding position in strict mode"))),t=t.bindName(e.name,e)}},{key:"reduceBlock",value:function(){var e=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceBlock",this).apply(this,arguments);return e=(e=(e=(e=e.functionDeclarationNamesAreLexical()).enforceDuplicateLexicallyDeclaredNames(_)).enforceConflictingLexicallyDeclaredNames(e.varDeclaredNames,_)).observeLexicalBoundary()}},{key:"reduceBreakStatement",value:function(e){var n=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceBreakStatement",this).apply(this,arguments);return n=null==e.label?n.addFreeBreakStatement(e):n.addFreeLabeledBreakStatement(e)}},{key:"reduceCallExpression",value:function(e){var n=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceCallExpression",this).apply(this,arguments);return"Super"===e.callee.type&&(n=n.observeSuperCallExpression(e)),n}},{key:"reduceCatchClause",value:function(e,n){var r=n.binding,i=n.body;(r=(r=(r=r.observeLexicalDeclaration()).enforceDuplicateLexicallyDeclaredNames(_)).enforceConflictingLexicallyDeclaredNames(i.previousLexicallyDeclaredNames,_)).lexicallyDeclaredNames.forEachEntry((function(e,t){i.varDeclaredNames.has(t)&&i.varDeclaredNames.get(t).forEach((function(e){i.forOfVarDeclaredNames.indexOf(e)>=0&&(r=r.addError(_(e)))}))}));var a=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceCatchClause",this).call(this,e,{binding:r,body:i});return a=a.observeLexicalBoundary()}},{key:"reduceClassDeclaration",value:function(e,t){var n=t.name,r=t.super,i=t.elements,o=n.enforceStrictErrors(),a=this.append.apply(this,p(i));return a=a.enforceStrictErrors(),null!=e.super&&(r=r.enforceStrictErrors(),o=this.append(o,r),a=a.clearSuperCallExpressionsInConstructorMethod()),o=(o=v(e,o=this.append(o,a))).observeLexicalDeclaration()}},{key:"reduceClassElement",value:function(e){var n=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceClassElement",this).apply(this,arguments);return!e.isStatic&&m(e.method)&&(n=n.addError(new l.EarlyError(e,c.ErrorMessages.ILLEGAL_CONSTRUCTORS))),e.isStatic&&"StaticPropertyName"===e.method.name.type&&"prototype"===e.method.name.value&&(n=n.addError(new l.EarlyError(e,'Static class methods cannot be named "prototype"'))),n}},{key:"reduceClassExpression",value:function(e,t){var n=t.name,r=t.super,i=t.elements,o=null==e.name?this.identity:n.enforceStrictErrors(),a=this.append.apply(this,p(i));return a=a.enforceStrictErrors(),null!=e.super&&(r=r.enforceStrictErrors(),o=this.append(o,r),a=a.clearSuperCallExpressionsInConstructorMethod()),o=(o=v(e,o=this.append(o,a))).clearBoundNames()}},{key:"reduceCompoundAssignmentExpression",value:function(){return o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceCompoundAssignmentExpression",this).apply(this,arguments).clearBoundNames()}},{key:"reduceComputedMemberExpression",value:function(e){var n=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceComputedMemberExpression",this).apply(this,arguments);return"Super"===e.object.type&&(n=n.observeSuperPropertyExpression(e)),n}},{key:"reduceContinueStatement",value:function(e){var n=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceContinueStatement",this).apply(this,arguments);return n=null==e.label?n.addFreeContinueStatement(e):n.addFreeLabeledContinueStatement(e)}},{key:"reduceDoWhileStatement",value:function(e){var n=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceDoWhileStatement",this).apply(this,arguments);return h(e.body)&&(n=n.addError(new l.EarlyError(e.body,"The body of a do-while statement must not be a labeled function declaration"))),n=(n=n.clearFreeContinueStatements()).clearFreeBreakStatements()}},{key:"reduceExport",value:function(){var e=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceExport",this).apply(this,arguments);return e=(e=e.functionDeclarationNamesAreLexical()).exportDeclaredNames()}},{key:"reduceExportFrom",value:function(){var e=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceExportFrom",this).apply(this,arguments);return e=e.clearExportedBindings()}},{key:"reduceExportFromSpecifier",value:function(e){var n=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceExportFromSpecifier",this).apply(this,arguments);return n=(n=n.exportName(e.exportedName||e.name,e)).exportBinding(e.name,e)}},{key:"reduceExportLocalSpecifier",value:function(e){var n=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceExportLocalSpecifier",this).apply(this,arguments);return n=(n=n.exportName(e.exportedName||e.name.name,e)).exportBinding(e.name.name,e)}},{key:"reduceExportDefault",value:function(e){var n=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceExportDefault",this).apply(this,arguments);return n=(n=n.functionDeclarationNamesAreLexical()).exportName("default",e)}},{key:"reduceFormalParameters",value:function(){var e=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceFormalParameters",this).apply(this,arguments);return e=e.observeLexicalDeclaration()}},{key:"reduceForStatement",value:function(e,n){var r=n.init,i=n.test,a=n.update,s=n.body;null!=r&&(r=(r=r.enforceDuplicateLexicallyDeclaredNames(_)).enforceConflictingLexicallyDeclaredNames(s.varDeclaredNames,_));var u=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceForStatement",this).call(this,e,{init:r,test:i,update:a,body:s});return null!=e.init&&"VariableDeclaration"===e.init.type&&"const"===e.init.kind&&e.init.declarators.forEach((function(e){null==e.init&&(u=u.addError(new l.EarlyError(e,"Constant lexical declarations must have an initialiser")))})),h(e.body)&&(u=u.addError(new l.EarlyError(e.body,"The body of a for statement must not be a labeled function declaration"))),u=(u=(u=u.clearFreeContinueStatements()).clearFreeBreakStatements()).observeLexicalBoundary()}},{key:"reduceForInStatement",value:function(e,n){var r=n.left,i=n.right,a=n.body;r=(r=r.enforceDuplicateLexicallyDeclaredNames(_)).enforceConflictingLexicallyDeclaredNames(a.varDeclaredNames,_);var s=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceForInStatement",this).call(this,e,{left:r,right:i,body:a});return h(e.body)&&(s=s.addError(new l.EarlyError(e.body,"The body of a for-in statement must not be a labeled function declaration"))),s=(s=(s=s.clearFreeContinueStatements()).clearFreeBreakStatements()).observeLexicalBoundary()}},{key:"reduceForOfStatement",value:function(e,n){var r=n.left,i=n.right,a=n.body;r=(r=(r=r.recordForOfVars()).enforceDuplicateLexicallyDeclaredNames(_)).enforceConflictingLexicallyDeclaredNames(a.varDeclaredNames,_);var s=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceForOfStatement",this).call(this,e,{left:r,right:i,body:a});return h(e.body)&&(s=s.addError(new l.EarlyError(e.body,"The body of a for-of statement must not be a labeled function declaration"))),s=(s=(s=s.clearFreeContinueStatements()).clearFreeBreakStatements()).observeLexicalBoundary()}},{key:"reduceForAwaitStatement",value:function(e,n){var r=n.left,i=n.right,a=n.body;r=(r=(r=r.recordForOfVars()).enforceDuplicateLexicallyDeclaredNames(_)).enforceConflictingLexicallyDeclaredNames(a.varDeclaredNames,_);var s=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceForOfStatement",this).call(this,e,{left:r,right:i,body:a});return h(e.body)&&(s=s.addError(new l.EarlyError(e.body,"The body of a for-await statement must not be a labeled function declaration"))),s=(s=(s=s.clearFreeContinueStatements()).clearFreeBreakStatements()).observeLexicalBoundary()}},{key:"reduceFunctionBody",value:function(e){var n=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceFunctionBody",this).apply(this,arguments);return n=(n=(n=(n=(n=(n=(n=(n=(n=n.enforceDuplicateLexicallyDeclaredNames(_)).enforceConflictingLexicallyDeclaredNames(n.varDeclaredNames,_)).enforceFreeContinueStatementErrors(E)).enforceFreeLabeledContinueStatementErrors(b)).enforceFreeBreakStatementErrors(D)).enforceFreeLabeledBreakStatementErrors(A)).clearUsedLabelNames()).clearYieldExpressions()).clearAwaitExpressions(),f(e)&&(n=n.enforceStrictErrors()),n}},{key:"reduceFunctionDeclaration",value:function(e,n){var r=n.name,i=n.params,a=n.body,s=null==e.params.rest&&e.params.items.every((function(e){return"BindingIdentifier"===e.type})),u=!s||e.isGenerator?"addError":"addStrictError";i.lexicallyDeclaredNames.forEachEntry((function(e){e.length>1&&e.slice(1).forEach((function(e){i=i[u](_(e))}))})),a=(a=(a=a.enforceConflictingLexicallyDeclaredNames(i.lexicallyDeclaredNames,_)).enforceSuperCallExpressions(y)).enforceSuperPropertyExpressions(g),i=(i=i.enforceSuperCallExpressions(y)).enforceSuperPropertyExpressions(g),e.isGenerator&&i.yieldExpressions.forEach((function(e){i=i.addError(new l.EarlyError(e,"Generator parameters must not contain yield expressions"))})),e.isAsync&&i.awaitExpressions.forEach((function(e){i=i.addError(new l.EarlyError(e,"Async function parameters must not contain await expressions"))})),i=i.clearNewTargetExpressions(),a=a.clearNewTargetExpressions(),f(e.body)&&(i=i.enforceStrictErrors(),a=a.enforceStrictErrors());var c=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceFunctionDeclaration",this).call(this,e,{name:r,params:i,body:a});return!s&&f(e.body)&&(c=c.addError(new l.EarlyError(e,'Functions with non-simple parameter lists may not contain a "use strict" directive'))),c=(c=(c=c.clearYieldExpressions()).clearAwaitExpressions()).observeFunctionDeclaration()}},{key:"reduceFunctionExpression",value:function(e,n){var r=n.name,i=n.params,a=n.body,s=null==e.params.rest&&e.params.items.every((function(e){return"BindingIdentifier"===e.type})),u=!s||e.isGenerator?"addError":"addStrictError";i.lexicallyDeclaredNames.forEachEntry((function(e,t){e.length>1&&e.slice(1).forEach((function(e){i=i[u](new l.EarlyError(e,"Duplicate binding "+JSON.stringify(t)))}))})),a=(a=(a=a.enforceConflictingLexicallyDeclaredNames(i.lexicallyDeclaredNames,_)).enforceSuperCallExpressions(y)).enforceSuperPropertyExpressions(g),i=(i=i.enforceSuperCallExpressions(y)).enforceSuperPropertyExpressions(g),e.isGenerator&&i.yieldExpressions.forEach((function(e){i=i.addError(new l.EarlyError(e,"Generator parameters must not contain yield expressions"))})),e.isAsync&&i.awaitExpressions.forEach((function(e){i=i.addError(new l.EarlyError(e,"Async function parameters must not contain await expressions"))})),i=i.clearNewTargetExpressions(),a=a.clearNewTargetExpressions(),f(e.body)&&(i=i.enforceStrictErrors(),a=a.enforceStrictErrors());var c=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceFunctionExpression",this).call(this,e,{name:r,params:i,body:a});return!s&&f(e.body)&&(c=c.addError(new l.EarlyError(e,'Functions with non-simple parameter lists may not contain a "use strict" directive'))),c=(c=(c=(c=c.clearBoundNames()).clearYieldExpressions()).clearAwaitExpressions()).observeVarBoundary()}},{key:"reduceGetter",value:function(e,n){var r=n.name,i=n.body;i=(i=(i=i.enforceSuperCallExpressions(y)).clearSuperPropertyExpressions()).clearNewTargetExpressions(),f(e.body)&&(i=i.enforceStrictErrors());var a=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceGetter",this).call(this,e,{name:r,body:i});return a=a.observeVarBoundary()}},{key:"reduceIdentifierExpression",value:function(e){var t=this.identity;return(0,u.isStrictModeReservedWord)(e.name)&&(t=t.addStrictError(new l.EarlyError(e,"The identifier "+JSON.stringify(e.name)+" must not be in expression position in strict mode"))),t}},{key:"reduceIfStatement",value:function(e,n){var r=n.test,i=n.consequent,a=n.alternate;return h(e.consequent)&&(i=i.addError(new l.EarlyError(e.consequent,"The consequent of an if statement must not be a labeled function declaration"))),null!=e.alternate&&h(e.alternate)&&(a=a.addError(new l.EarlyError(e.alternate,"The alternate of an if statement must not be a labeled function declaration"))),"FunctionDeclaration"===e.consequent.type&&(i=(i=i.addStrictError(new l.EarlyError(e.consequent,"FunctionDeclarations in IfStatements are disallowed in strict mode"))).observeLexicalBoundary()),null!=e.alternate&&"FunctionDeclaration"===e.alternate.type&&(a=(a=a.addStrictError(new l.EarlyError(e.alternate,"FunctionDeclarations in IfStatements are disallowed in strict mode"))).observeLexicalBoundary()),o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceIfStatement",this).call(this,e,{test:r,consequent:i,alternate:a})}},{key:"reduceImport",value:function(){var e=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceImport",this).apply(this,arguments);return e=e.observeLexicalDeclaration()}},{key:"reduceImportNamespace",value:function(){var e=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceImportNamespace",this).apply(this,arguments);return e=e.observeLexicalDeclaration()}},{key:"reduceLabeledStatement",value:function(e){var n=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceLabeledStatement",this).apply(this,arguments);return("yield"===e.label||(0,u.isStrictModeReservedWord)(e.label))&&(n=n.addStrictError(new l.EarlyError(e,"The identifier "+JSON.stringify(e.label)+" must not be in label position in strict mode"))),n.usedLabelNames.indexOf(e.label)>=0&&(n=n.addError(new l.EarlyError(e,"Label "+JSON.stringify(e.label)+" has already been declared"))),"FunctionDeclaration"===e.body.type&&(n=n.addStrictError(new l.EarlyError(e,"Labeled FunctionDeclarations are disallowed in strict mode"))),n=d(e.body)?n.observeIterationLabel(e.label):n.observeNonIterationLabel(e.label)}},{key:"reduceLiteralRegExpExpression",value:function(){return this.identity}},{key:"reduceMethod",value:function(e,n){var r=n.name,i=n.params,a=n.body,s=null==e.params.rest&&e.params.items.every((function(e){return"BindingIdentifier"===e.type}));i=i.enforceDuplicateLexicallyDeclaredNames(_),a=a.enforceConflictingLexicallyDeclaredNames(i.lexicallyDeclaredNames,_),"StaticPropertyName"===e.name.type&&"constructor"===e.name.value?(a=a.observeConstructorMethod(),i=i.observeConstructorMethod()):(a=a.enforceSuperCallExpressions(y),i=i.enforceSuperCallExpressions(y)),e.isGenerator&&i.yieldExpressions.forEach((function(e){i=i.addError(new l.EarlyError(e,"Generator parameters must not contain yield expressions"))})),e.isAsync&&i.awaitExpressions.forEach((function(e){i=i.addError(new l.EarlyError(e,"Async function parameters must not contain await expressions"))})),a=a.clearSuperPropertyExpressions(),i=(i=i.clearSuperPropertyExpressions()).clearNewTargetExpressions(),a=a.clearNewTargetExpressions(),f(e.body)&&(i=i.enforceStrictErrors(),a=a.enforceStrictErrors());var u=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceMethod",this).call(this,e,{name:r,params:i,body:a});return!s&&f(e.body)&&(u=u.addError(new l.EarlyError(e,'Functions with non-simple parameter lists may not contain a "use strict" directive'))),u=(u=(u=u.clearYieldExpressions()).clearAwaitExpressions()).observeVarBoundary()}},{key:"reduceModule",value:function(){var e=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceModule",this).apply(this,arguments);return(e=(e=(e=e.functionDeclarationNamesAreLexical()).enforceDuplicateLexicallyDeclaredNames(_)).enforceConflictingLexicallyDeclaredNames(e.varDeclaredNames,_)).exportedNames.forEachEntry((function(t,n){t.length>1&&t.slice(1).forEach((function(t){e=e.addError(new l.EarlyError(t,"Duplicate export "+JSON.stringify(n)))}))})),e.exportedBindings.forEachEntry((function(t,n){e.lexicallyDeclaredNames.has(n)||e.varDeclaredNames.has(n)||t.forEach((function(t){e=e.addError(new l.EarlyError(t,"Exported binding "+JSON.stringify(n)+" is not declared"))}))})),e.newTargetExpressions.forEach((function(t){e=e.addError(new l.EarlyError(t,"new.target must be within function (but not arrow expression) code"))})),e=(e=(e=(e=(e=(e=(e=e.enforceFreeContinueStatementErrors(E)).enforceFreeLabeledContinueStatementErrors(b)).enforceFreeBreakStatementErrors(D)).enforceFreeLabeledBreakStatementErrors(A)).enforceSuperCallExpressions(y)).enforceSuperPropertyExpressions(g)).enforceStrictErrors()}},{key:"reduceNewTargetExpression",value:function(e){return this.identity.observeNewTargetExpression(e)}},{key:"reduceObjectExpression",value:function(e){var n=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceObjectExpression",this).apply(this,arguments);n=n.enforceSuperCallExpressionsInConstructorMethod(y);var r=e.properties.filter((function(e){return"DataProperty"===e.type&&"StaticPropertyName"===e.name.type&&"__proto__"===e.name.value}));return r.slice(1).forEach((function(e){n=n.addError(new l.EarlyError(e,"Duplicate __proto__ property in object literal not allowed"))})),n}},{key:"reduceUpdateExpression",value:function(){var e=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceUpdateExpression",this).apply(this,arguments);return e=e.clearBoundNames()}},{key:"reduceUnaryExpression",value:function(e){var n=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceUnaryExpression",this).apply(this,arguments);return"delete"===e.operator&&"IdentifierExpression"===e.operand.type&&(n=n.addStrictError(new l.EarlyError(e,"Identifier expressions must not be deleted in strict mode"))),n}},{key:"reduceScript",value:function(e){var n=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceScript",this).apply(this,arguments);return(n=(n=n.enforceDuplicateLexicallyDeclaredNames(_)).enforceConflictingLexicallyDeclaredNames(n.varDeclaredNames,_)).newTargetExpressions.forEach((function(e){n=n.addError(new l.EarlyError(e,"new.target must be within function (but not arrow expression) code"))})),n=(n=(n=(n=(n=(n=n.enforceFreeContinueStatementErrors(E)).enforceFreeLabeledContinueStatementErrors(b)).enforceFreeBreakStatementErrors(D)).enforceFreeLabeledBreakStatementErrors(A)).enforceSuperCallExpressions(y)).enforceSuperPropertyExpressions(g),f(e)&&(n=n.enforceStrictErrors()),n}},{key:"reduceSetter",value:function(e,n){var r=n.name,i=n.param,a=n.body,s="BindingIdentifier"===e.param.type;i=(i=i.observeLexicalDeclaration()).enforceDuplicateLexicallyDeclaredNames(_),a=a.enforceConflictingLexicallyDeclaredNames(i.lexicallyDeclaredNames,_),i=i.enforceSuperCallExpressions(y),a=a.enforceSuperCallExpressions(y),i=i.clearSuperPropertyExpressions(),a=a.clearSuperPropertyExpressions(),i=i.clearNewTargetExpressions(),a=a.clearNewTargetExpressions(),f(e.body)&&(i=i.enforceStrictErrors(),a=a.enforceStrictErrors());var u=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceSetter",this).call(this,e,{name:r,param:i,body:a});return!s&&f(e.body)&&(u=u.addError(new l.EarlyError(e,'Functions with non-simple parameter lists may not contain a "use strict" directive'))),u=u.observeVarBoundary()}},{key:"reduceStaticMemberExpression",value:function(e){var n=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceStaticMemberExpression",this).apply(this,arguments);return"Super"===e.object.type&&(n=n.observeSuperPropertyExpression(e)),n}},{key:"reduceSwitchStatement",value:function(e,t){var n=t.discriminant,r=t.cases,i=this.append.apply(this,p(r));i=(i=(i=(i=i.functionDeclarationNamesAreLexical()).enforceDuplicateLexicallyDeclaredNames(_)).enforceConflictingLexicallyDeclaredNames(i.varDeclaredNames,_)).observeLexicalBoundary();var o=this.append(n,i);return o=o.clearFreeBreakStatements()}},{key:"reduceSwitchStatementWithDefault",value:function(e,t){var n=t.discriminant,r=t.preDefaultCases,i=t.defaultCase,o=t.postDefaultCases,a=this.append.apply(this,[i].concat(p(r),p(o)));a=(a=(a=(a=a.functionDeclarationNamesAreLexical()).enforceDuplicateLexicallyDeclaredNames(_)).enforceConflictingLexicallyDeclaredNames(a.varDeclaredNames,_)).observeLexicalBoundary();var s=this.append(n,a);return s=s.clearFreeBreakStatements()}},{key:"reduceVariableDeclaration",value:function(e){var n=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceVariableDeclaration",this).apply(this,arguments);switch(e.kind){case"const":case"let":(n=n.observeLexicalDeclaration()).lexicallyDeclaredNames.has("let")&&n.lexicallyDeclaredNames.get("let").forEach((function(e){n=n.addError(new l.EarlyError(e,'Lexical declarations must not have a binding named "let"'))}));break;case"var":n=n.observeVarDeclaration()}return n}},{key:"reduceVariableDeclarationStatement",value:function(e){var n=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceVariableDeclarationStatement",this).apply(this,arguments);return"const"===e.declaration.kind&&e.declaration.declarators.forEach((function(e){null==e.init&&(n=n.addError(new l.EarlyError(e,"Constant lexical declarations must have an initialiser")))})),n}},{key:"reduceWhileStatement",value:function(e){var n=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceWhileStatement",this).apply(this,arguments);return h(e.body)&&(n=n.addError(new l.EarlyError(e.body,"The body of a while statement must not be a labeled function declaration"))),n=n.clearFreeContinueStatements().clearFreeBreakStatements()}},{key:"reduceWithStatement",value:function(e){var n=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceWithStatement",this).apply(this,arguments);return h(e.body)&&(n=n.addError(new l.EarlyError(e.body,"The body of a with statement must not be a labeled function declaration"))),n=n.addStrictError(new l.EarlyError(e,"Strict mode code must not include a with statement"))}},{key:"reduceYieldExpression",value:function(e){var n=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceYieldExpression",this).apply(this,arguments);return n=n.observeYieldExpression(e)}},{key:"reduceYieldGeneratorExpression",value:function(e){var n=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reduceYieldGeneratorExpression",this).apply(this,arguments);return n=n.observeYieldExpression(e)}}],[{key:"check",value:function(e){return(0,s.default)(new t,e).errors}}]),t}(a.MonoidalReducer)},408:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.ErrorMessages={UNEXPECTED_TOKEN:function(e){return"Unexpected token "+JSON.stringify(e)},UNEXPECTED_ILLEGAL_TOKEN:function(e){return"Unexpected "+JSON.stringify(e)},UNEXPECTED_ESCAPED_KEYWORD:"Unexpected escaped keyword",UNEXPECTED_NUMBER:"Unexpected number",UNEXPECTED_STRING:"Unexpected string",UNEXPECTED_IDENTIFIER:"Unexpected identifier",UNEXPECTED_RESERVED_WORD:"Unexpected reserved word",UNEXPECTED_TEMPLATE:"Unexpected template",UNEXPECTED_EOS:"Unexpected end of input",UNEXPECTED_LINE_TERMINATOR:"Unexpected line terminator",UNEXPECTED_COMMA_AFTER_REST:"Unexpected comma after rest",UNEXPECTED_REST_PARAMETERS_INITIALIZATION:"Rest parameter may not have a default initializer",NEWLINE_AFTER_THROW:"Illegal newline after throw",UNTERMINATED_REGEXP:"Invalid regular expression: missing /",INVALID_LAST_REST_PARAMETER:"Rest parameter must be last formal parameter",INVALID_REST_PARAMETERS_INITIALIZATION:"Rest parameter may not have a default initializer",INVALID_REGEXP_FLAGS:"Invalid regular expression flags",INVALID_REGEX:"Invalid regular expression",INVALID_LHS_IN_ASSIGNMENT:"Invalid left-hand side in assignment",INVALID_LHS_IN_BINDING:"Invalid left-hand side in binding",INVALID_LHS_IN_FOR_IN:"Invalid left-hand side in for-in",INVALID_LHS_IN_FOR_OF:"Invalid left-hand side in for-of",INVALID_LHS_IN_FOR_AWAIT:"Invalid left-hand side in for-await",INVALID_UPDATE_OPERAND:"Increment/decrement target must be an identifier or member expression",INVALID_EXPONENTIATION_LHS:"Unary expressions as the left operand of an exponentation expression must be disambiguated with parentheses",MULTIPLE_DEFAULTS_IN_SWITCH:"More than one default clause in switch statement",NO_CATCH_OR_FINALLY:"Missing catch or finally after try",ILLEGAL_RETURN:"Illegal return statement",ILLEGAL_ARROW_FUNCTION_PARAMS:"Illegal arrow function parameter list",INVALID_ASYNC_PARAMS:"Async function parameters must not contain await expressions",INVALID_VAR_INIT_FOR_IN:"Invalid variable declaration in for-in statement",INVALID_VAR_INIT_FOR_OF:"Invalid variable declaration in for-of statement",INVALID_VAR_INIT_FOR_AWAIT:"Invalid variable declaration in for-await statement",UNINITIALIZED_BINDINGPATTERN_IN_FOR_INIT:"Binding pattern appears without initializer in for statement init",ILLEGAL_PROPERTY:"Illegal property initializer",INVALID_ID_BINDING_STRICT_MODE:function(e){return"The identifier "+JSON.stringify(e)+" must not be in binding position in strict mode"},INVALID_ID_IN_LABEL_STRICT_MODE:function(e){return"The identifier "+JSON.stringify(e)+" must not be in label position in strict mode"},INVALID_ID_IN_EXPRESSION_STRICT_MODE:function(e){return"The identifier "+JSON.stringify(e)+" must not be in expression position in strict mode"},INVALID_CALL_TO_SUPER:'Calls to super must be in the "constructor" method of a class expression or class declaration that has a superclass',INVALID_DELETE_STRICT_MODE:"Identifier expressions must not be deleted in strict mode",DUPLICATE_BINDING:function(e){return"Duplicate binding "+JSON.stringify(e)},ILLEGAL_ID_IN_LEXICAL_DECLARATION:function(e){return"Lexical declarations must not have a binding named "+JSON.stringify(e)},UNITIALIZED_CONST:"Constant lexical declarations must have an initialiser",ILLEGAL_LABEL_IN_BODY:function(e){return"The body of a "+e+" statement must not be a labeled function declaration"},ILLEGEAL_LABEL_IN_IF:"The consequent of an if statement must not be a labeled function declaration",ILLEGAL_LABEL_IN_ELSE:"The alternate of an if statement must not be a labeled function declaration",ILLEGAL_CONTINUE_WITHOUT_ITERATION_WITH_ID:function(e){return"Continue statement must be nested within an iteration statement with label "+JSON.stringify(e)},ILLEGAL_CONTINUE_WITHOUT_ITERATION:"Continue statement must be nested within an iteration statement",ILLEGAL_BREAK_WITHOUT_ITERATION_OR_SWITCH:"Break statement must be nested within an iteration statement or a switch statement",ILLEGAL_WITH_STRICT_MODE:"Strict mode code must not include a with statement",ILLEGAL_ACCESS_SUPER_MEMBER:"Member access on super must be in a method",ILLEGAL_SUPER_CALL:'Calls to super must be in the "constructor" method of a class expression or class declaration that has a superclass',DUPLICATE_LABEL_DECLARATION:function(e){return"Label "+JSON.stringify(e)+" has already been declared"},ILLEGAL_BREAK_WITHIN_LABEL:function(e){return"Break statement must be nested within a statement with label "+JSON.stringify(e)},ILLEGAL_YIELD_EXPRESSIONS:function(e){return e+" parameters must not contain yield expressions"},ILLEGAL_YIELD_IDENTIFIER:'"yield" may not be used as an identifier in this context',ILLEGAL_AWAIT_IDENTIFIER:'"await" may not be used as an identifier in this context',DUPLICATE_CONSTRUCTOR:"Duplicate constructor method in class",ILLEGAL_CONSTRUCTORS:"Constructors cannot be async, generators, getters or setters",ILLEGAL_STATIC_CLASS_NAME:'Static class methods cannot be named "prototype"',NEW_TARGET_ERROR:"new.target must be within function (but not arrow expression) code",DUPLICATE_EXPORT:function(e){return"Duplicate export "+JSON.stringify(e)},UNDECLARED_BINDING:function(e){return"Exported binding "+JSON.stringify(e)+" is not declared"},DUPLICATE_PROPTO_PROP:"Duplicate __proto__ property in object literal not allowed",ILLEGAL_LABEL_FUNC_DECLARATION:"Labeled FunctionDeclarations are disallowed in strict mode",ILLEGAL_FUNC_DECL_IF:"FunctionDeclarations in IfStatements are disallowed in strict mode",ILLEGAL_USE_STRICT:'Functions with non-simple parameter lists may not contain a "use strict" directive',ILLEGAL_EXPORTED_NAME:"Names of variables used in an export specifier from the current module must be identifiers",NO_OCTALS_IN_TEMPLATES:"Template literals may not contain octal escape sequences",NO_AWAIT_IN_ASYNC_PARAMS:'Async arrow parameters may not contain "await"'}},3875:function(e,t,n){"use strict";t.Mi=void 0;var r=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=n.earlyErrors,i=void 0===r||r,u=new a.GenericParser(t),c=u[e]();if(i){var l=s.EarlyErrorChecker.check(c);if(l.length>0)throw new o.JsError(0,1,0,l[0].message)}return c}}function p(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.earlyErrors,i=void 0===r||r,a=new c(t),u=a[e]();if(i){var l=s.EarlyErrorChecker.check(u);if(l.length>0){var p=l[0],f=p.node,h=p.message,d=a.locations.get(f).start,m=d.offset,v=d.line,y=d.column;throw new o.JsError(m,v,y,h)}}return{tree:u,locations:a.locations,comments:a.comments}}}l("parseModule");var f=l("parseScript");p("parseModule"),t.Mi=p("parseScript");s.EarlyErrorChecker,a.GenericParser},4732:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GenericParser=void 0;var r=function(){function e(e,t){for(var n=0;n":f,"<=":f,">=":f,in:f,instanceof:f,"<<":h,">>":h,">>>":h,"+":d,"-":d,"*":m,"%":m,"/":m};function y(e){if(null==e)return!1;switch(e.type){case"IdentifierExpression":case"ComputedMemberExpression":case"StaticMemberExpression":return!0}return!1}function g(e){return e.type===a.TokenType.INC||e.type===a.TokenType.DEC}t.GenericParser=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.allowIn=!0,n.inFunctionBody=!1,n.inParameter=!1,n.allowYieldExpression=!1,n.allowAwaitExpression=!1,n.firstAwaitLocation=null,n.module=!1,n.moduleIsTheGoalSymbol=!1,n.strict=!1,n.isBindingElement=!0,n.isAssignmentTarget=!0,n.firstExprError=null,n}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"match",value:function(e){return this.lookahead.type===e}},{key:"matchIdentifier",value:function(){switch(this.lookahead.type){case a.TokenType.IDENTIFIER:case a.TokenType.LET:case a.TokenType.YIELD:case a.TokenType.ASYNC:return!0;case a.TokenType.AWAIT:return!this.moduleIsTheGoalSymbol&&(null===this.firstAwaitLocation&&(this.firstAwaitLocation=this.getLocation()),!0);case a.TokenType.ESCAPED_KEYWORD:return"await"!==this.lookahead.value||this.moduleIsTheGoalSymbol?"let"===this.lookahead.value||"yield"===this.lookahead.value||"async"===this.lookahead.value:(null===this.firstAwaitLocation&&(this.firstAwaitLocation=this.getLocation()),!0)}return!1}},{key:"eat",value:function(e){return this.lookahead.type===e?this.lex():null}},{key:"expect",value:function(e){if(this.lookahead.type===e)return this.lex();throw this.createUnexpected(this.lookahead)}},{key:"matchContextualKeyword",value:function(e){return this.lookahead.type===a.TokenType.IDENTIFIER&&!this.lookahead.escaped&&this.lookahead.value===e}},{key:"expectContextualKeyword",value:function(e){if(this.lookahead.type===a.TokenType.IDENTIFIER&&!this.lookahead.escaped&&this.lookahead.value===e)return this.lex();throw this.createUnexpected(this.lookahead)}},{key:"eatContextualKeyword",value:function(e){return this.lookahead.type!==a.TokenType.IDENTIFIER||this.lookahead.escaped||this.lookahead.value!==e?null:this.lex()}},{key:"consumeSemicolon",value:function(){if(!this.eat(a.TokenType.SEMICOLON)&&!this.hasLineTerminatorBeforeNext&&!this.eof()&&!this.match(a.TokenType.RBRACE))throw this.createUnexpected(this.lookahead)}},{key:"startNode",value:function(e){return e}},{key:"copyNode",value:function(e,t){return t}},{key:"finishNode",value:function(e){return e}},{key:"parseModule",value:function(){this.moduleIsTheGoalSymbol=this.module=this.strict=!0,this.lookahead=this.advance();var e=this.startNode(),t=this.parseBody(),n=t.directives,r=t.statements;if(!this.match(a.TokenType.EOS))throw this.createUnexpected(this.lookahead);return this.finishNode(new u.Module({directives:n,items:r}),e)}},{key:"parseScript",value:function(){this.lookahead=this.advance();var e=this.startNode(),t=this.parseBody(),n=t.directives,r=t.statements;if(!this.match(a.TokenType.EOS))throw this.createUnexpected(this.lookahead);return this.finishNode(new u.Script({directives:n,statements:r}),e)}},{key:"parseFunctionBody",value:function(){var e=this.inFunctionBody,t=this.module,n=this.strict;this.inFunctionBody=!0,this.module=!1;var r=this.startNode();this.expect(a.TokenType.LBRACE);var i=new u.FunctionBody(this.parseBody());return this.expect(a.TokenType.RBRACE),i=this.finishNode(i,r),this.inFunctionBody=e,this.module=t,this.strict=n,i}},{key:"parseBody",value:function(){for(var e=[],t=[],n=!0,r=null;!this.eof()&&!this.match(a.TokenType.RBRACE);){var i=this.lookahead,o=i.slice.text,s=i.type===a.TokenType.STRING,c=this.module,l=this.getLocation(),p=this.startNode(),f=c?this.parseModuleItem():this.parseStatementListItem();if(n)if(s&&"ExpressionStatement"===f.type&&"LiteralStringExpression"===f.expression.type){!r&&i.octal&&(r=this.createErrorWithLocation(l,"Unexpected legacy octal escape sequence: \\"+i.octal));var h=o.slice(1,-1);"use strict"===h&&(this.strict=!0),e.push(this.finishNode(new u.Directive({rawValue:h}),p))}else{if(n=!1,r&&this.strict)throw r;t.push(f)}else t.push(f)}if(r&&this.strict)throw r;return{directives:e,statements:t}}},{key:"parseImportSpecifier",value:function(){var e=this.startNode(),t=void 0;if(this.matchIdentifier()){if(t=this.parseIdentifier(),!this.eatContextualKeyword("as"))return this.finishNode(new u.ImportSpecifier({name:null,binding:this.finishNode(new u.BindingIdentifier({name:t}),e)}),e)}else this.lookahead.type.klass.isIdentifierName&&(t=this.parseIdentifierName(),this.expectContextualKeyword("as"));return this.finishNode(new u.ImportSpecifier({name:t,binding:this.parseBindingIdentifier()}),e)}},{key:"parseNameSpaceBinding",value:function(){return this.expect(a.TokenType.MUL),this.expectContextualKeyword("as"),this.parseBindingIdentifier()}},{key:"parseNamedImports",value:function(){var e=[];for(this.expect(a.TokenType.LBRACE);!this.eat(a.TokenType.RBRACE);)if(e.push(this.parseImportSpecifier()),!this.eat(a.TokenType.COMMA)){this.expect(a.TokenType.RBRACE);break}return e}},{key:"parseFromClause",value:function(){return this.expectContextualKeyword("from"),this.expect(a.TokenType.STRING).str}},{key:"parseImportDeclaration",value:function(){var e=this.startNode(),t=null,n=void 0;if(this.expect(a.TokenType.IMPORT),this.match(a.TokenType.STRING))return n=this.lex().str,this.consumeSemicolon(),this.finishNode(new u.Import({defaultBinding:null,namedImports:[],moduleSpecifier:n}),e);if(this.matchIdentifier()&&(t=this.parseBindingIdentifier(),!this.eat(a.TokenType.COMMA))){var r=new u.Import({defaultBinding:t,namedImports:[],moduleSpecifier:this.parseFromClause()});return this.consumeSemicolon(),this.finishNode(r,e)}if(this.match(a.TokenType.MUL)){var i=new u.ImportNamespace({defaultBinding:t,namespaceBinding:this.parseNameSpaceBinding(),moduleSpecifier:this.parseFromClause()});return this.consumeSemicolon(),this.finishNode(i,e)}if(this.match(a.TokenType.LBRACE)){var o=new u.Import({defaultBinding:t,namedImports:this.parseNamedImports(),moduleSpecifier:this.parseFromClause()});return this.consumeSemicolon(),this.finishNode(o,e)}throw this.createUnexpected(this.lookahead)}},{key:"parseExportSpecifier",value:function(){var e=this.startNode(),t=this.finishNode({type:"ExportNameOfUnknownType",isIdentifier:this.matchIdentifier(),value:this.parseIdentifierName()},e);if(this.eatContextualKeyword("as")){var n=this.parseIdentifierName();return this.finishNode({name:t,exportedName:n},e)}return this.finishNode({name:t,exportedName:null},e)}},{key:"parseExportClause",value:function(){this.expect(a.TokenType.LBRACE);for(var e=[];!this.eat(a.TokenType.RBRACE);)if(e.push(this.parseExportSpecifier()),!this.eat(a.TokenType.COMMA)){this.expect(a.TokenType.RBRACE);break}return e}},{key:"parseExportDeclaration",value:function(){var e=this,t=this.startNode(),n=void 0;switch(this.expect(a.TokenType.EXPORT),this.lookahead.type){case a.TokenType.MUL:this.lex(),n=new u.ExportAllFrom({moduleSpecifier:this.parseFromClause()}),this.consumeSemicolon();break;case a.TokenType.LBRACE:var r=this.parseExportClause(),o=null;this.matchContextualKeyword("from")?(o=this.parseFromClause(),n=new u.ExportFrom({namedExports:r.map((function(t){return e.copyNode(t,new u.ExportFromSpecifier({name:t.name.value,exportedName:t.exportedName}))})),moduleSpecifier:o})):(r.forEach((function(t){if(!t.name.isIdentifier)throw e.createError(i.ErrorMessages.ILLEGAL_EXPORTED_NAME)})),n=new u.ExportLocals({namedExports:r.map((function(t){return e.copyNode(t,new u.ExportLocalSpecifier({name:e.copyNode(t.name,new u.IdentifierExpression({name:t.name.value})),exportedName:t.exportedName}))}))})),this.consumeSemicolon();break;case a.TokenType.CLASS:n=new u.Export({declaration:this.parseClass({isExpr:!1,inDefault:!1})});break;case a.TokenType.FUNCTION:n=new u.Export({declaration:this.parseFunction({isExpr:!1,inDefault:!1,allowGenerator:!0,isAsync:!1})});break;case a.TokenType.ASYNC:var s=this.startNode();this.lex(),n=new u.Export({declaration:this.parseFunction({isExpr:!1,inDefault:!1,allowGenerator:!0,isAsync:!0,startState:s})});break;case a.TokenType.DEFAULT:switch(this.lex(),this.lookahead.type){case a.TokenType.FUNCTION:n=new u.ExportDefault({body:this.parseFunction({isExpr:!1,inDefault:!0,allowGenerator:!0,isAsync:!1})});break;case a.TokenType.CLASS:n=new u.ExportDefault({body:this.parseClass({isExpr:!1,inDefault:!0})});break;case a.TokenType.ASYNC:var c=this.startNode(),l=this.saveLexerState();if(this.lex(),!this.hasLineTerminatorBeforeNext&&this.match(a.TokenType.FUNCTION)){n=new u.ExportDefault({body:this.parseFunction({isExpr:!1,inDefault:!0,allowGenerator:!1,isAsync:!0,startState:c})});break}this.restoreLexerState(l);default:n=new u.ExportDefault({body:this.parseAssignmentExpression()}),this.consumeSemicolon()}break;case a.TokenType.VAR:case a.TokenType.LET:case a.TokenType.CONST:n=new u.Export({declaration:this.parseVariableDeclaration(!0)}),this.consumeSemicolon();break;default:throw this.createUnexpected(this.lookahead)}return this.finishNode(n,t)}},{key:"parseModuleItem",value:function(){switch(this.lookahead.type){case a.TokenType.IMPORT:return this.parseImportDeclaration();case a.TokenType.EXPORT:return this.parseExportDeclaration();default:return this.parseStatementListItem()}}},{key:"lookaheadLexicalDeclaration",value:function(){if(this.match(a.TokenType.LET)||this.match(a.TokenType.CONST)){var e=this.saveLexerState();if(this.lex(),this.matchIdentifier()||this.match(a.TokenType.LBRACE)||this.match(a.TokenType.LBRACK))return this.restoreLexerState(e),!0;this.restoreLexerState(e)}return!1}},{key:"parseStatementListItem",value:function(){if(this.eof())throw this.createUnexpected(this.lookahead);switch(this.lookahead.type){case a.TokenType.FUNCTION:return this.parseFunction({isExpr:!1,inDefault:!1,allowGenerator:!0,isAsync:!1});case a.TokenType.CLASS:return this.parseClass({isExpr:!1,inDefault:!1});case a.TokenType.ASYNC:var e=this.getLocation(),t=this.saveLexerState();return this.lex(),!this.hasLineTerminatorBeforeNext&&this.match(a.TokenType.FUNCTION)?this.parseFunction({isExpr:!1,inDefault:!1,allowGenerator:!0,isAsync:!0,startState:e}):(this.restoreLexerState(t),this.parseStatement());default:if(this.lookaheadLexicalDeclaration()){var n=this.startNode();return this.finishNode(this.parseVariableDeclarationStatement(),n)}return this.parseStatement()}}},{key:"parseStatement",value:function(){var e=this.startNode(),t=this.isolateCoverGrammar(this.parseStatementHelper);return this.finishNode(t,e)}},{key:"parseStatementHelper",value:function(){if(this.eof())throw this.createUnexpected(this.lookahead);switch(this.lookahead.type){case a.TokenType.SEMICOLON:return this.parseEmptyStatement();case a.TokenType.LBRACE:return this.parseBlockStatement();case a.TokenType.LPAREN:return this.parseExpressionStatement();case a.TokenType.BREAK:return this.parseBreakStatement();case a.TokenType.CONTINUE:return this.parseContinueStatement();case a.TokenType.DEBUGGER:return this.parseDebuggerStatement();case a.TokenType.DO:return this.parseDoWhileStatement();case a.TokenType.FOR:return this.parseForStatement();case a.TokenType.IF:return this.parseIfStatement();case a.TokenType.RETURN:return this.parseReturnStatement();case a.TokenType.SWITCH:return this.parseSwitchStatement();case a.TokenType.THROW:return this.parseThrowStatement();case a.TokenType.TRY:return this.parseTryStatement();case a.TokenType.VAR:return this.parseVariableDeclarationStatement();case a.TokenType.WHILE:return this.parseWhileStatement();case a.TokenType.WITH:return this.parseWithStatement();case a.TokenType.FUNCTION:case a.TokenType.CLASS:throw this.createUnexpected(this.lookahead);default:var e=this.saveLexerState();if(this.eat(a.TokenType.LET)){if(this.match(a.TokenType.LBRACK))throw this.restoreLexerState(e),this.createUnexpected(this.lookahead);this.restoreLexerState(e)}else if(this.eat(a.TokenType.ASYNC)){if(!this.hasLineTerminatorBeforeNext&&this.match(a.TokenType.FUNCTION))throw this.createUnexpected(this.lookahead);this.restoreLexerState(e)}var t=this.parseExpression();if("IdentifierExpression"===t.type&&this.eat(a.TokenType.COLON)){var n=this.match(a.TokenType.FUNCTION)?this.parseFunction({isExpr:!1,inDefault:!1,allowGenerator:!1,isAsync:!1}):this.parseStatement();return new u.LabeledStatement({label:t.name,body:n})}return this.consumeSemicolon(),new u.ExpressionStatement({expression:t})}}},{key:"parseEmptyStatement",value:function(){return this.lex(),new u.EmptyStatement}},{key:"parseBlockStatement",value:function(){return new u.BlockStatement({block:this.parseBlock()})}},{key:"parseExpressionStatement",value:function(){var e=this.parseExpression();return this.consumeSemicolon(),new u.ExpressionStatement({expression:e})}},{key:"parseBreakStatement",value:function(){if(this.lex(),this.eat(a.TokenType.SEMICOLON)||this.hasLineTerminatorBeforeNext)return new u.BreakStatement({label:null});var e=null;return this.matchIdentifier()&&(e=this.parseIdentifier()),this.consumeSemicolon(),new u.BreakStatement({label:e})}},{key:"parseContinueStatement",value:function(){if(this.lex(),this.eat(a.TokenType.SEMICOLON)||this.hasLineTerminatorBeforeNext)return new u.ContinueStatement({label:null});var e=null;return this.matchIdentifier()&&(e=this.parseIdentifier()),this.consumeSemicolon(),new u.ContinueStatement({label:e})}},{key:"parseDebuggerStatement",value:function(){return this.lex(),this.consumeSemicolon(),new u.DebuggerStatement}},{key:"parseDoWhileStatement",value:function(){this.lex();var e=this.parseStatement();this.expect(a.TokenType.WHILE),this.expect(a.TokenType.LPAREN);var t=this.parseExpression();return this.expect(a.TokenType.RPAREN),this.eat(a.TokenType.SEMICOLON),new u.DoWhileStatement({body:e,test:t})}},{key:"parseForStatement",value:function(){this.lex();var e=this.allowAwaitExpression&&this.eat(a.TokenType.AWAIT);this.expect(a.TokenType.LPAREN);var t=null,n=null;if(e&&this.match(a.TokenType.SEMICOLON))throw this.createUnexpected(this.lookahead);if(this.eat(a.TokenType.SEMICOLON))return this.match(a.TokenType.SEMICOLON)||(t=this.parseExpression()),this.expect(a.TokenType.SEMICOLON),this.match(a.TokenType.RPAREN)||(n=this.parseExpression()),new u.ForStatement({init:null,test:t,update:n,body:this.getIteratorStatementEpilogue()});var r=this.match(a.TokenType.LET),o=this.lookaheadLexicalDeclaration(),s=this.startNode();if(this.match(a.TokenType.VAR)||o){var c=this.allowIn;this.allowIn=!1;var l=this.parseVariableDeclaration(!1);if(this.allowIn=c,1===l.declarators.length&&(this.match(a.TokenType.IN)||this.matchContextualKeyword("of"))){var p=void 0,f=l.declarators[0];if(this.match(a.TokenType.IN)){if(e)throw this.createUnexpected(this.lookahead);if(null!==f.init&&(this.strict||"var"!==l.kind||"BindingIdentifier"!==f.binding.type))throw this.createError(i.ErrorMessages.INVALID_VAR_INIT_FOR_IN);p=u.ForInStatement,this.lex(),n=this.parseExpression()}else{if(null!==f.init)throw this.createError(e?i.ErrorMessages.INVALID_VAR_INIT_FOR_AWAIT:i.ErrorMessages.INVALID_VAR_INIT_FOR_OF);p=e?u.ForAwaitStatement:u.ForOfStatement,this.lex(),n=this.parseAssignmentExpression()}return new p({left:l,right:n,body:this.getIteratorStatementEpilogue()})}if(e)throw this.createUnexpected(this.lookahead);if(this.expect(a.TokenType.SEMICOLON),l.declarators.some((function(e){return"BindingIdentifier"!==e.binding.type&&null===e.init})))throw this.createError(i.ErrorMessages.UNINITIALIZED_BINDINGPATTERN_IN_FOR_INIT);return this.match(a.TokenType.SEMICOLON)||(t=this.parseExpression()),this.expect(a.TokenType.SEMICOLON),this.match(a.TokenType.RPAREN)||(n=this.parseExpression()),new u.ForStatement({init:l,test:t,update:n,body:this.getIteratorStatementEpilogue()})}var h=this.allowIn;this.allowIn=!1;var d=this.inheritCoverGrammar(this.parseAssignmentExpressionOrTarget);if(this.allowIn=h,this.isAssignmentTarget&&"AssignmentExpression"!==d.type&&(this.match(a.TokenType.IN)||this.matchContextualKeyword("of"))){if("ObjectAssignmentTarget"!==d.type&&"ArrayAssignmentTarget"!==d.type||(this.firstExprError=null),r&&this.matchContextualKeyword("of"))throw this.createError(e?i.ErrorMessages.INVALID_LHS_IN_FOR_AWAIT:i.ErrorMessages.INVALID_LHS_IN_FOR_OF);var m=void 0;if(this.match(a.TokenType.IN)){if(e)throw this.createUnexpected(this.lookahead);m=u.ForInStatement,this.lex(),n=this.parseExpression()}else m=e?u.ForAwaitStatement:u.ForOfStatement,this.lex(),n=this.parseAssignmentExpression();return new m({left:this.transformDestructuring(d),right:n,body:this.getIteratorStatementEpilogue()})}if(e)throw this.createError(i.ErrorMessages.INVALID_LHS_IN_FOR_AWAIT);if(this.firstExprError)throw this.firstExprError;for(;this.eat(a.TokenType.COMMA);){var v=this.parseAssignmentExpression();d=this.finishNode(new u.BinaryExpression({left:d,operator:",",right:v}),s)}if(this.match(a.TokenType.IN))throw this.createError(i.ErrorMessages.INVALID_LHS_IN_FOR_IN);if(this.matchContextualKeyword("of"))throw this.createError(i.ErrorMessages.INVALID_LHS_IN_FOR_OF);return this.expect(a.TokenType.SEMICOLON),this.match(a.TokenType.SEMICOLON)||(t=this.parseExpression()),this.expect(a.TokenType.SEMICOLON),this.match(a.TokenType.RPAREN)||(n=this.parseExpression()),new u.ForStatement({init:d,test:t,update:n,body:this.getIteratorStatementEpilogue()})}},{key:"getIteratorStatementEpilogue",value:function(){return this.expect(a.TokenType.RPAREN),this.parseStatement()}},{key:"parseIfStatementChild",value:function(){return this.match(a.TokenType.FUNCTION)?this.parseFunction({isExpr:!1,inDefault:!1,allowGenerator:!1,isAsync:!1}):this.parseStatement()}},{key:"parseIfStatement",value:function(){this.lex(),this.expect(a.TokenType.LPAREN);var e=this.parseExpression();this.expect(a.TokenType.RPAREN);var t=this.parseIfStatementChild(),n=null;return this.eat(a.TokenType.ELSE)&&(n=this.parseIfStatementChild()),new u.IfStatement({test:e,consequent:t,alternate:n})}},{key:"parseReturnStatement",value:function(){if(!this.inFunctionBody)throw this.createError(i.ErrorMessages.ILLEGAL_RETURN);if(this.lex(),this.eat(a.TokenType.SEMICOLON)||this.hasLineTerminatorBeforeNext)return new u.ReturnStatement({expression:null});var e=null;return this.match(a.TokenType.RBRACE)||this.eof()||(e=this.parseExpression()),this.consumeSemicolon(),new u.ReturnStatement({expression:e})}},{key:"parseSwitchStatement",value:function(){this.lex(),this.expect(a.TokenType.LPAREN);var e=this.parseExpression();if(this.expect(a.TokenType.RPAREN),this.expect(a.TokenType.LBRACE),this.eat(a.TokenType.RBRACE))return new u.SwitchStatement({discriminant:e,cases:[]});var t=this.parseSwitchCases();if(this.match(a.TokenType.DEFAULT)){var n=this.parseSwitchDefault(),r=this.parseSwitchCases();if(this.match(a.TokenType.DEFAULT))throw this.createError(i.ErrorMessages.MULTIPLE_DEFAULTS_IN_SWITCH);return this.expect(a.TokenType.RBRACE),new u.SwitchStatementWithDefault({discriminant:e,preDefaultCases:t,defaultCase:n,postDefaultCases:r})}return this.expect(a.TokenType.RBRACE),new u.SwitchStatement({discriminant:e,cases:t})}},{key:"parseSwitchCases",value:function(){for(var e=[];!(this.eof()||this.match(a.TokenType.RBRACE)||this.match(a.TokenType.DEFAULT));)e.push(this.parseSwitchCase());return e}},{key:"parseSwitchCase",value:function(){var e=this.startNode();return this.expect(a.TokenType.CASE),this.finishNode(new u.SwitchCase({test:this.parseExpression(),consequent:this.parseSwitchCaseBody()}),e)}},{key:"parseSwitchDefault",value:function(){var e=this.startNode();return this.expect(a.TokenType.DEFAULT),this.finishNode(new u.SwitchDefault({consequent:this.parseSwitchCaseBody()}),e)}},{key:"parseSwitchCaseBody",value:function(){return this.expect(a.TokenType.COLON),this.parseStatementListInSwitchCaseBody()}},{key:"parseStatementListInSwitchCaseBody",value:function(){for(var e=[];!(this.eof()||this.match(a.TokenType.RBRACE)||this.match(a.TokenType.DEFAULT)||this.match(a.TokenType.CASE));)e.push(this.parseStatementListItem());return e}},{key:"parseThrowStatement",value:function(){var e=this.lex();if(this.hasLineTerminatorBeforeNext)throw this.createErrorWithLocation(e,i.ErrorMessages.NEWLINE_AFTER_THROW);var t=this.parseExpression();return this.consumeSemicolon(),new u.ThrowStatement({expression:t})}},{key:"parseTryStatement",value:function(){this.lex();var e=this.parseBlock();if(this.match(a.TokenType.CATCH)){var t=this.parseCatchClause();if(this.eat(a.TokenType.FINALLY)){var n=this.parseBlock();return new u.TryFinallyStatement({body:e,catchClause:t,finalizer:n})}return new u.TryCatchStatement({body:e,catchClause:t})}if(this.eat(a.TokenType.FINALLY)){var r=this.parseBlock();return new u.TryFinallyStatement({body:e,catchClause:null,finalizer:r})}throw this.createError(i.ErrorMessages.NO_CATCH_OR_FINALLY)}},{key:"parseVariableDeclarationStatement",value:function(){var e=this.parseVariableDeclaration(!0);return this.consumeSemicolon(),new u.VariableDeclarationStatement({declaration:e})}},{key:"parseWhileStatement",value:function(){this.lex(),this.expect(a.TokenType.LPAREN);var e=this.parseExpression(),t=this.getIteratorStatementEpilogue();return new u.WhileStatement({test:e,body:t})}},{key:"parseWithStatement",value:function(){this.lex(),this.expect(a.TokenType.LPAREN);var e=this.parseExpression();this.expect(a.TokenType.RPAREN);var t=this.parseStatement();return new u.WithStatement({object:e,body:t})}},{key:"parseCatchClause",value:function(){var e=this.startNode();if(this.lex(),this.expect(a.TokenType.LPAREN),this.match(a.TokenType.RPAREN)||this.match(a.TokenType.LPAREN))throw this.createUnexpected(this.lookahead);var t=this.parseBindingTarget();this.expect(a.TokenType.RPAREN);var n=this.parseBlock();return this.finishNode(new u.CatchClause({binding:t,body:n}),e)}},{key:"parseBlock",value:function(){var e=this.startNode();this.expect(a.TokenType.LBRACE);for(var t=[];!this.match(a.TokenType.RBRACE);)t.push(this.parseStatementListItem());return this.expect(a.TokenType.RBRACE),this.finishNode(new u.Block({statements:t}),e)}},{key:"parseVariableDeclaration",value:function(e){var t=this.startNode(),n=this.lex(),r=n.type===a.TokenType.VAR?"var":n.type===a.TokenType.CONST?"const":"let",i=this.parseVariableDeclaratorList(e);return this.finishNode(new u.VariableDeclaration({kind:r,declarators:i}),t)}},{key:"parseVariableDeclaratorList",value:function(e){var t=[];do{t.push(this.parseVariableDeclarator(e))}while(this.eat(a.TokenType.COMMA));return t}},{key:"parseVariableDeclarator",value:function(e){var t=this.startNode();if(this.match(a.TokenType.LPAREN))throw this.createUnexpected(this.lookahead);var n=this.allowIn;this.allowIn=!0;var r=this.parseBindingTarget();this.allowIn=n,e&&"BindingIdentifier"!==r.type&&!this.match(a.TokenType.ASSIGN)&&this.expect(a.TokenType.ASSIGN);var i=null;return this.eat(a.TokenType.ASSIGN)&&(i=this.parseAssignmentExpression()),this.finishNode(new u.VariableDeclarator({binding:r,init:i}),t)}},{key:"isolateCoverGrammar",value:function(e){var t,n=this.isBindingElement,r=this.isAssignmentTarget,i=this.firstExprError;if(this.isBindingElement=this.isAssignmentTarget=!0,this.firstExprError=null,t=e.call(this),null!==this.firstExprError)throw this.firstExprError;return this.isBindingElement=n,this.isAssignmentTarget=r,this.firstExprError=i,t}},{key:"inheritCoverGrammar",value:function(e){var t,n=this.isBindingElement,r=this.isAssignmentTarget,i=this.firstExprError;return this.isBindingElement=this.isAssignmentTarget=!0,this.firstExprError=null,t=e.call(this),this.isBindingElement=this.isBindingElement&&n,this.isAssignmentTarget=this.isAssignmentTarget&&r,this.firstExprError=i||this.firstExprError,t}},{key:"parseExpression",value:function(){var e=this.startNode(),t=this.parseAssignmentExpression();if(this.match(a.TokenType.COMMA))for(;!this.eof()&&this.match(a.TokenType.COMMA);){this.lex();var n=this.parseAssignmentExpression();t=this.finishNode(new u.BinaryExpression({left:t,operator:",",right:n}),e)}return t}},{key:"finishArrowParams",value:function(e){var t=e.params,n=void 0===t?null:t,r=e.rest,i=void 0===r?null:r;if(e.type!==l){if("IdentifierExpression"!==e.type)throw this.createUnexpected(this.lookahead);n=[this.targetToBinding(this.transformDestructuring(e))]}return this.copyNode(e,new u.FormalParameters({items:n,rest:i}))}},{key:"parseArrowExpressionTail",value:function(e,t,n){this.expect(a.TokenType.ARROW);var r=this.allowYieldExpression,i=this.allowAwaitExpression,o=this.firstAwaitLocation;this.allowYieldExpression=!1,this.allowAwaitExpression=t,this.firstAwaitLocation=null;var s=void 0;if(this.match(a.TokenType.LBRACE)){var c=this.allowIn;this.allowIn=!0,s=this.parseFunctionBody(),this.allowIn=c}else s=this.parseAssignmentExpression();return this.allowYieldExpression=r,this.allowAwaitExpression=i,this.firstAwaitLocation=o,this.finishNode(new u.ArrowExpression({isAsync:t,params:e,body:s}),n)}},{key:"parseAssignmentExpression",value:function(){return this.isolateCoverGrammar(this.parseAssignmentExpressionOrTarget)}},{key:"parseAssignmentExpressionOrTarget",value:function(){var e=this.startNode();if(this.allowYieldExpression&&this.match(a.TokenType.YIELD))return this.isBindingElement=this.isAssignmentTarget=!1,this.parseYieldExpression();var t=this.parseConditionalExpression();if(!this.hasLineTerminatorBeforeNext&&this.match(a.TokenType.ARROW)){this.isBindingElement=this.isAssignmentTarget=!1,this.firstExprError=null;var n=t.type===l&&t.isAsync;return this.parseArrowExpressionTail(this.finishArrowParams(t),n,e)}var r=!1,o=this.lookahead;switch(o.type){case a.TokenType.ASSIGN_BIT_OR:case a.TokenType.ASSIGN_BIT_XOR:case a.TokenType.ASSIGN_BIT_AND:case a.TokenType.ASSIGN_SHL:case a.TokenType.ASSIGN_SHR:case a.TokenType.ASSIGN_SHR_UNSIGNED:case a.TokenType.ASSIGN_ADD:case a.TokenType.ASSIGN_SUB:case a.TokenType.ASSIGN_MUL:case a.TokenType.ASSIGN_DIV:case a.TokenType.ASSIGN_MOD:case a.TokenType.ASSIGN_EXP:r=!0}if(r){if(!this.isAssignmentTarget||!y(t))throw this.createError(i.ErrorMessages.INVALID_LHS_IN_ASSIGNMENT);t=this.transformDestructuring(t)}else{if(o.type!==a.TokenType.ASSIGN)return t;if(!this.isAssignmentTarget)throw this.createError(i.ErrorMessages.INVALID_LHS_IN_ASSIGNMENT);t=this.transformDestructuring(t)}this.lex();var s=this.parseAssignmentExpression();this.firstExprError=null;var c=void 0;return o.type===a.TokenType.ASSIGN?c=new u.AssignmentExpression({binding:t,expression:s}):(c=new u.CompoundAssignmentExpression({binding:t,operator:o.type.name,expression:s}),this.isBindingElement=this.isAssignmentTarget=!1),this.finishNode(c,e)}},{key:"targetToBinding",value:function(e){var t=this;if(null===e)return null;switch(e.type){case"AssignmentTargetIdentifier":return this.copyNode(e,new u.BindingIdentifier({name:e.name}));case"ArrayAssignmentTarget":return this.copyNode(e,new u.ArrayBinding({elements:e.elements.map((function(e){return t.targetToBinding(e)})),rest:this.targetToBinding(e.rest)}));case"ObjectAssignmentTarget":return this.copyNode(e,new u.ObjectBinding({properties:e.properties.map((function(e){return t.targetToBinding(e)})),rest:this.targetToBinding(e.rest)}));case"AssignmentTargetPropertyIdentifier":return this.copyNode(e,new u.BindingPropertyIdentifier({binding:this.targetToBinding(e.binding),init:e.init}));case"AssignmentTargetPropertyProperty":return this.copyNode(e,new u.BindingPropertyProperty({name:e.name,binding:this.targetToBinding(e.binding)}));case"AssignmentTargetWithDefault":return this.copyNode(e,new u.BindingWithDefault({binding:this.targetToBinding(e.binding),init:e.init}))}throw new Error("Not reached")}},{key:"transformDestructuring",value:function(e){var t=this;switch(e.type){case"DataProperty":return this.copyNode(e,new u.AssignmentTargetPropertyProperty({name:e.name,binding:this.transformDestructuringWithDefault(e.expression)}));case"ShorthandProperty":return this.copyNode(e,new u.AssignmentTargetPropertyIdentifier({binding:this.copyNode(e,new u.AssignmentTargetIdentifier({name:e.name.name})),init:null}));case"ObjectExpression":var n=e.properties.length>0?e.properties[e.properties.length-1]:void 0;return null!=n&&"SpreadProperty"===n.type?this.copyNode(e,new u.ObjectAssignmentTarget({properties:e.properties.slice(0,-1).map((function(e){return e&&t.transformDestructuringWithDefault(e)})),rest:this.transformDestructuring(n.expression)})):this.copyNode(e,new u.ObjectAssignmentTarget({properties:e.properties.map((function(e){return e&&t.transformDestructuringWithDefault(e)})),rest:null}));case"ArrayExpression":var r=e.elements[e.elements.length-1];return null!=r&&"SpreadElement"===r.type?this.copyNode(e,new u.ArrayAssignmentTarget({elements:e.elements.slice(0,-1).map((function(e){return e&&t.transformDestructuringWithDefault(e)})),rest:this.copyNode(r.expression,this.transformDestructuring(r.expression))})):this.copyNode(e,new u.ArrayAssignmentTarget({elements:e.elements.map((function(e){return e&&t.transformDestructuringWithDefault(e)})),rest:null}));case"IdentifierExpression":return this.copyNode(e,new u.AssignmentTargetIdentifier({name:e.name}));case"StaticPropertyName":return this.copyNode(e,new u.AssignmentTargetIdentifier({name:e.value}));case"ComputedMemberExpression":return this.copyNode(e,new u.ComputedMemberAssignmentTarget({object:e.object,expression:e.expression}));case"StaticMemberExpression":return this.copyNode(e,new u.StaticMemberAssignmentTarget({object:e.object,property:e.property}));case"ArrayAssignmentTarget":case"ObjectAssignmentTarget":case"ComputedMemberAssignmentTarget":case"StaticMemberAssignmentTarget":case"AssignmentTargetIdentifier":case"AssignmentTargetPropertyIdentifier":case"AssignmentTargetPropertyProperty":case"AssignmentTargetWithDefault":return e}throw new Error("Not reached")}},{key:"transformDestructuringWithDefault",value:function(e){return"AssignmentExpression"===e.type?this.copyNode(e,new u.AssignmentTargetWithDefault({binding:this.transformDestructuring(e.binding),init:e.expression})):this.transformDestructuring(e)}},{key:"lookaheadAssignmentExpression",value:function(){if(this.matchIdentifier())return!0;switch(this.lookahead.type){case a.TokenType.ADD:case a.TokenType.ASSIGN_DIV:case a.TokenType.BIT_NOT:case a.TokenType.CLASS:case a.TokenType.DEC:case a.TokenType.DELETE:case a.TokenType.DIV:case a.TokenType.FALSE:case a.TokenType.FUNCTION:case a.TokenType.INC:case a.TokenType.LBRACE:case a.TokenType.LBRACK:case a.TokenType.LPAREN:case a.TokenType.NEW:case a.TokenType.NOT:case a.TokenType.NULL:case a.TokenType.NUMBER:case a.TokenType.STRING:case a.TokenType.SUB:case a.TokenType.SUPER:case a.TokenType.THIS:case a.TokenType.TRUE:case a.TokenType.TYPEOF:case a.TokenType.VOID:case a.TokenType.TEMPLATE:return!0}return!1}},{key:"parseYieldExpression",value:function(){var e=this.startNode();if(this.lex(),this.hasLineTerminatorBeforeNext)return this.finishNode(new u.YieldExpression({expression:null}),e);var t=!!this.eat(a.TokenType.MUL),n=null;(t||this.lookaheadAssignmentExpression())&&(n=this.parseAssignmentExpression());var r=t?u.YieldGeneratorExpression:u.YieldExpression;return this.finishNode(new r({expression:n}),e)}},{key:"parseConditionalExpression",value:function(){var e=this.startNode(),t=this.parseBinaryExpression();if(this.firstExprError)return t;if(this.eat(a.TokenType.CONDITIONAL)){this.isBindingElement=this.isAssignmentTarget=!1;var n=this.allowIn;this.allowIn=!0;var r=this.isolateCoverGrammar(this.parseAssignmentExpression);this.allowIn=n,this.expect(a.TokenType.COLON);var i=this.isolateCoverGrammar(this.parseAssignmentExpression);return this.finishNode(new u.ConditionalExpression({test:t,consequent:r,alternate:i}),e)}return t}},{key:"isBinaryOperator",value:function(e){switch(e){case a.TokenType.OR:case a.TokenType.AND:case a.TokenType.BIT_OR:case a.TokenType.BIT_XOR:case a.TokenType.BIT_AND:case a.TokenType.EQ:case a.TokenType.NE:case a.TokenType.EQ_STRICT:case a.TokenType.NE_STRICT:case a.TokenType.LT:case a.TokenType.GT:case a.TokenType.LTE:case a.TokenType.GTE:case a.TokenType.INSTANCEOF:case a.TokenType.SHL:case a.TokenType.SHR:case a.TokenType.SHR_UNSIGNED:case a.TokenType.ADD:case a.TokenType.SUB:case a.TokenType.MUL:case a.TokenType.DIV:case a.TokenType.MOD:return!0;case a.TokenType.IN:return this.allowIn;default:return!1}}},{key:"parseBinaryExpression",value:function(){var e=this,t=this.startNode(),n=this.parseExponentiationExpression();if(this.firstExprError)return n;var r=this.lookahead.type;if(!this.isBinaryOperator(r))return n;this.isBindingElement=this.isAssignmentTarget=!1,this.lex();var i=[];i.push({startState:t,left:n,operator:r,precedence:v[r.name]}),t=this.startNode();var o=this.isolateCoverGrammar(this.parseExponentiationExpression);for(r=this.lookahead.type;this.isBinaryOperator(r);){for(var a=v[r.name];i.length&&a<=i[i.length-1].precedence;){var s=i[i.length-1],c=s.operator;n=s.left,i.pop(),t=s.startState,o=this.finishNode(new u.BinaryExpression({left:n,operator:c.name,right:o}),t)}this.lex(),i.push({startState:t,left:o,operator:r,precedence:a}),t=this.startNode(),o=this.isolateCoverGrammar(this.parseExponentiationExpression),r=this.lookahead.type}return i.reduceRight((function(t,n){return e.finishNode(new u.BinaryExpression({left:n.left,operator:n.operator.name,right:t}),n.startState)}),o)}},{key:"parseExponentiationExpression",value:function(){var e=this.startNode(),t=this.lookahead.type===a.TokenType.LPAREN,n=this.parseUnaryExpression();if(this.lookahead.type!==a.TokenType.EXP)return n;if("UnaryExpression"===n.type&&!t)throw this.createError(i.ErrorMessages.INVALID_EXPONENTIATION_LHS);this.lex(),this.isBindingElement=this.isAssignmentTarget=!1;var r=this.isolateCoverGrammar(this.parseExponentiationExpression);return this.finishNode(new u.BinaryExpression({left:n,operator:"**",right:r}),e)}},{key:"parseUnaryExpression",value:function(){if(this.lookahead.type.klass!==a.TokenClass.Punctuator&&this.lookahead.type.klass!==a.TokenClass.Keyword)return this.parseUpdateExpression();var e=this.startNode();if(this.allowAwaitExpression&&this.eat(a.TokenType.AWAIT)){this.isBindingElement=this.isAssignmentTarget=!1;var t=this.isolateCoverGrammar(this.parseUnaryExpression);return this.finishNode(new u.AwaitExpression({expression:t}),e)}var n=this.lookahead;if(!function(e){switch(e.type){case a.TokenType.INC:case a.TokenType.DEC:case a.TokenType.ADD:case a.TokenType.SUB:case a.TokenType.BIT_NOT:case a.TokenType.NOT:case a.TokenType.DELETE:case a.TokenType.VOID:case a.TokenType.TYPEOF:return!0}return!1}(n))return this.parseUpdateExpression();this.lex(),this.isBindingElement=this.isAssignmentTarget=!1;var r=void 0;if(g(n)){var o=this.getLocation(),s=this.isolateCoverGrammar(this.parseUnaryExpression);if(!y(s))throw this.createErrorWithLocation(o,i.ErrorMessages.INVALID_UPDATE_OPERAND);s=this.transformDestructuring(s),r=new u.UpdateExpression({isPrefix:!0,operator:n.value,operand:s})}else{var c=this.isolateCoverGrammar(this.parseUnaryExpression);r=new u.UnaryExpression({operator:n.value,operand:c})}return this.finishNode(r,e)}},{key:"parseUpdateExpression",value:function(){var e=this.getLocation(),t=this.startNode(),n=this.parseLeftHandSideExpression({allowCall:!0});if(this.firstExprError||this.hasLineTerminatorBeforeNext)return n;var r=this.lookahead;if(!g(r))return n;if(this.lex(),this.isBindingElement=this.isAssignmentTarget=!1,!y(n))throw this.createErrorWithLocation(e,i.ErrorMessages.INVALID_UPDATE_OPERAND);return n=this.transformDestructuring(n),this.finishNode(new u.UpdateExpression({isPrefix:!1,operator:r.value,operand:n}),t)}},{key:"parseLeftHandSideExpression",value:function(e){var t=this,n=e.allowCall,r=this.startNode(),o=this.allowIn;this.allowIn=!0;var s=void 0,c=this.lookahead;if(this.eat(a.TokenType.SUPER))if(this.isBindingElement=!1,this.isAssignmentTarget=!1,s=this.finishNode(new u.Super,r),this.match(a.TokenType.LPAREN)){if(!n)throw this.createUnexpected(c);s=this.finishNode(new u.CallExpression({callee:s,arguments:this.parseArgumentList().args}),r)}else if(this.match(a.TokenType.LBRACK))s=this.finishNode(new u.ComputedMemberExpression({object:s,expression:this.parseComputedMember()}),r),this.isAssignmentTarget=!0;else{if(!this.match(a.TokenType.PERIOD))throw this.createUnexpected(c);s=this.finishNode(new u.StaticMemberExpression({object:s,property:this.parseStaticMember()}),r),this.isAssignmentTarget=!0}else if(this.match(a.TokenType.NEW))this.isBindingElement=this.isAssignmentTarget=!1,s=this.parseNewExpression();else if(this.match(a.TokenType.ASYNC)){if("IdentifierExpression"===(s=this.parsePrimaryExpression()).type&&n&&!this.hasLineTerminatorBeforeNext){if(this.matchIdentifier()){var p=this.startNode(),f=this.allowAwaitExpression;this.allowAwaitExpression=!0;var h=this.parseBindingIdentifier();return this.allowAwaitExpression=f,this.ensureArrow(),this.finishNode({type:l,params:[h],rest:null,isAsync:!0},p)}if(this.match(a.TokenType.LPAREN)){var d=this.startNode(),m=this.firstAwaitLocation;this.firstAwaitLocation=null;var v=this.parseArgumentList(),y=v.args,g=v.locationFollowingFirstSpread;if(this.isBindingElement&&!this.hasLineTerminatorBeforeNext&&this.match(a.TokenType.ARROW)){if(null!==g)throw this.createErrorWithLocation(g,i.ErrorMessages.UNEXPECTED_TOKEN(","));if(null!==this.firstAwaitLocation)throw this.createErrorWithLocation(this.firstAwaitLocation,i.ErrorMessages.NO_AWAIT_IN_ASYNC_PARAMS);var _=null;if(y.length>0&&"SpreadElement"===y[y.length-1].type){if(null!=(_=this.targetToBinding(this.transformDestructuringWithDefault(y[y.length-1].expression))).init)throw this.createError(i.ErrorMessages.UNEXPECTED_REST_PARAMETERS_INITIALIZATION);y=y.slice(0,-1)}var E=y.map((function(e){return t.targetToBinding(t.transformDestructuringWithDefault(e))}));return this.finishNode({type:l,params:E,rest:_,isAsync:!0},d)}this.firstAwaitLocation=m||this.firstAwaitLocation,this.isBindingElement=this.isAssignmentTarget=!1,s=this.finishNode(new u.CallExpression({callee:s,arguments:y}),r)}}}else if(s=this.parsePrimaryExpression(),this.firstExprError)return s;for(;;)if(n&&this.match(a.TokenType.LPAREN))this.isBindingElement=this.isAssignmentTarget=!1,s=this.finishNode(new u.CallExpression({callee:s,arguments:this.parseArgumentList().args}),r);else if(this.match(a.TokenType.LBRACK))this.isBindingElement=!1,this.isAssignmentTarget=!0,s=this.finishNode(new u.ComputedMemberExpression({object:s,expression:this.parseComputedMember()}),r);else if(this.match(a.TokenType.PERIOD))this.isBindingElement=!1,this.isAssignmentTarget=!0,s=this.finishNode(new u.StaticMemberExpression({object:s,property:this.parseStaticMember()}),r);else{if(!this.match(a.TokenType.TEMPLATE))break;this.isBindingElement=this.isAssignmentTarget=!1,s=this.finishNode(new u.TemplateExpression({tag:s,elements:this.parseTemplateElements()}),r)}return this.allowIn=o,s}},{key:"parseTemplateElements",value:function(){var e=this.startNode(),t=this.lookahead;if(t.tail)return this.lex(),[this.finishNode(new u.TemplateElement({rawValue:t.slice.text.slice(1,-1)}),e)];for(var n=[this.finishNode(new u.TemplateElement({rawValue:this.lex().slice.text.slice(1,-2)}),e)];;){if(n.push(this.parseExpression()),!this.match(a.TokenType.RBRACE))throw this.createILLEGAL();if(this.index=this.startIndex,this.line=this.startLine,this.lineStart=this.startLineStart,this.lookahead=this.scanTemplateElement(),e=this.startNode(),(t=this.lex()).tail)return n.push(this.finishNode(new u.TemplateElement({rawValue:t.slice.text.slice(1,-1)}),e)),n;n.push(this.finishNode(new u.TemplateElement({rawValue:t.slice.text.slice(1,-2)}),e))}}},{key:"parseStaticMember",value:function(){if(this.lex(),this.lookahead.type.klass.isIdentifierName)return this.lex().value;throw this.createUnexpected(this.lookahead)}},{key:"parseComputedMember",value:function(){this.lex();var e=this.parseExpression();return this.expect(a.TokenType.RBRACK),e}},{key:"parseNewExpression",value:function(){var e=this,t=this.startNode();if(this.lex(),this.eat(a.TokenType.PERIOD))return this.expectContextualKeyword("target"),this.finishNode(new u.NewTargetExpression,t);var n=this.isolateCoverGrammar((function(){return e.parseLeftHandSideExpression({allowCall:!1})}));return this.finishNode(new u.NewExpression({callee:n,arguments:this.match(a.TokenType.LPAREN)?this.parseArgumentList().args:[]}),t)}},{key:"parseRegexFlags",value:function(e){for(var t=!1,n=!1,r=!1,i=!1,o=!1,a=!1,s=0;s"},Ident:{name:"Identifier",isIdentifierName:!0},Keyword:{name:"Keyword",isIdentifierName:!0},NumericLiteral:{name:"Numeric"},TemplateElement:{name:"Template"},Punctuator:{name:"Punctuator"},StringLiteral:{name:"String"},RegularExpression:{name:"RegularExpression"},Illegal:{name:"Illegal"}},c=t.TokenType={EOS:{klass:u.Eof,name:"EOS"},LPAREN:{klass:u.Punctuator,name:"("},RPAREN:{klass:u.Punctuator,name:")"},LBRACK:{klass:u.Punctuator,name:"["},RBRACK:{klass:u.Punctuator,name:"]"},LBRACE:{klass:u.Punctuator,name:"{"},RBRACE:{klass:u.Punctuator,name:"}"},COLON:{klass:u.Punctuator,name:":"},SEMICOLON:{klass:u.Punctuator,name:";"},PERIOD:{klass:u.Punctuator,name:"."},ELLIPSIS:{klass:u.Punctuator,name:"..."},ARROW:{klass:u.Punctuator,name:"=>"},CONDITIONAL:{klass:u.Punctuator,name:"?"},INC:{klass:u.Punctuator,name:"++"},DEC:{klass:u.Punctuator,name:"--"},ASSIGN:{klass:u.Punctuator,name:"="},ASSIGN_BIT_OR:{klass:u.Punctuator,name:"|="},ASSIGN_BIT_XOR:{klass:u.Punctuator,name:"^="},ASSIGN_BIT_AND:{klass:u.Punctuator,name:"&="},ASSIGN_SHL:{klass:u.Punctuator,name:"<<="},ASSIGN_SHR:{klass:u.Punctuator,name:">>="},ASSIGN_SHR_UNSIGNED:{klass:u.Punctuator,name:">>>="},ASSIGN_ADD:{klass:u.Punctuator,name:"+="},ASSIGN_SUB:{klass:u.Punctuator,name:"-="},ASSIGN_MUL:{klass:u.Punctuator,name:"*="},ASSIGN_DIV:{klass:u.Punctuator,name:"/="},ASSIGN_MOD:{klass:u.Punctuator,name:"%="},ASSIGN_EXP:{klass:u.Punctuator,name:"**="},COMMA:{klass:u.Punctuator,name:","},OR:{klass:u.Punctuator,name:"||"},AND:{klass:u.Punctuator,name:"&&"},BIT_OR:{klass:u.Punctuator,name:"|"},BIT_XOR:{klass:u.Punctuator,name:"^"},BIT_AND:{klass:u.Punctuator,name:"&"},SHL:{klass:u.Punctuator,name:"<<"},SHR:{klass:u.Punctuator,name:">>"},SHR_UNSIGNED:{klass:u.Punctuator,name:">>>"},ADD:{klass:u.Punctuator,name:"+"},SUB:{klass:u.Punctuator,name:"-"},MUL:{klass:u.Punctuator,name:"*"},DIV:{klass:u.Punctuator,name:"/"},MOD:{klass:u.Punctuator,name:"%"},EXP:{klass:u.Punctuator,name:"**"},EQ:{klass:u.Punctuator,name:"=="},NE:{klass:u.Punctuator,name:"!="},EQ_STRICT:{klass:u.Punctuator,name:"==="},NE_STRICT:{klass:u.Punctuator,name:"!=="},LT:{klass:u.Punctuator,name:"<"},GT:{klass:u.Punctuator,name:">"},LTE:{klass:u.Punctuator,name:"<="},GTE:{klass:u.Punctuator,name:">="},INSTANCEOF:{klass:u.Keyword,name:"instanceof"},IN:{klass:u.Keyword,name:"in"},NOT:{klass:u.Punctuator,name:"!"},BIT_NOT:{klass:u.Punctuator,name:"~"},ASYNC:{klass:u.Keyword,name:"async"},AWAIT:{klass:u.Keyword,name:"await"},ENUM:{klass:u.Keyword,name:"enum"},DELETE:{klass:u.Keyword,name:"delete"},TYPEOF:{klass:u.Keyword,name:"typeof"},VOID:{klass:u.Keyword,name:"void"},BREAK:{klass:u.Keyword,name:"break"},CASE:{klass:u.Keyword,name:"case"},CATCH:{klass:u.Keyword,name:"catch"},CLASS:{klass:u.Keyword,name:"class"},CONTINUE:{klass:u.Keyword,name:"continue"},DEBUGGER:{klass:u.Keyword,name:"debugger"},DEFAULT:{klass:u.Keyword,name:"default"},DO:{klass:u.Keyword,name:"do"},ELSE:{klass:u.Keyword,name:"else"},EXPORT:{klass:u.Keyword,name:"export"},EXTENDS:{klass:u.Keyword,name:"extends"},FINALLY:{klass:u.Keyword,name:"finally"},FOR:{klass:u.Keyword,name:"for"},FUNCTION:{klass:u.Keyword,name:"function"},IF:{klass:u.Keyword,name:"if"},IMPORT:{klass:u.Keyword,name:"import"},LET:{klass:u.Keyword,name:"let"},NEW:{klass:u.Keyword,name:"new"},RETURN:{klass:u.Keyword,name:"return"},SUPER:{klass:u.Keyword,name:"super"},SWITCH:{klass:u.Keyword,name:"switch"},THIS:{klass:u.Keyword,name:"this"},THROW:{klass:u.Keyword,name:"throw"},TRY:{klass:u.Keyword,name:"try"},VAR:{klass:u.Keyword,name:"var"},WHILE:{klass:u.Keyword,name:"while"},WITH:{klass:u.Keyword,name:"with"},NULL:{klass:u.Keyword,name:"null"},TRUE:{klass:u.Keyword,name:"true"},FALSE:{klass:u.Keyword,name:"false"},YIELD:{klass:u.Keyword,name:"yield"},NUMBER:{klass:u.NumericLiteral,name:""},STRING:{klass:u.StringLiteral,name:""},REGEXP:{klass:u.RegularExpression,name:""},IDENTIFIER:{klass:u.Ident,name:""},CONST:{klass:u.Keyword,name:"const"},TEMPLATE:{klass:u.TemplateElement,name:""},ESCAPED_KEYWORD:{klass:u.Keyword,name:""},ILLEGAL:{klass:u.Illegal,name:""}},l=c.ILLEGAL,p=!1,f=!0,h=[l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,c.NOT,l,l,l,c.MOD,c.BIT_AND,l,c.LPAREN,c.RPAREN,c.MUL,c.ADD,c.COMMA,c.SUB,c.PERIOD,c.DIV,l,l,l,l,l,l,l,l,l,l,c.COLON,c.SEMICOLON,c.LT,c.ASSIGN,c.GT,c.CONDITIONAL,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,c.LBRACK,l,c.RBRACK,c.BIT_XOR,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,c.LBRACE,c.BIT_OR,c.RBRACE,c.BIT_NOT],d=[p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,f,p,p,p,f,f,p,f,f,f,f,f,f,p,f,p,p,p,p,p,p,p,p,p,p,f,f,f,f,f,f,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,f,p,f,f,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,f,f,f,f,p],m=t.JsError=function(e){function t(e,n,r,i){s(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,i));o.index=e;try{o.line=n,o.column=r}catch(a){}return o.parseErrorLine=n,o.parseErrorColumn=r,o.description=i,o.message="["+n+":"+r+"]: "+i,o}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,Error),t}();function v(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(Math.floor((e-65536)/1024)+55296)+String.fromCharCode((e-65536)%1024+56320)}var y=function(){function e(t){s(this,e),this.source=t,this.index=0,this.line=0,this.lineStart=0,this.startIndex=0,this.startLine=0,this.startLineStart=0,this.lastIndex=0,this.lastLine=0,this.lastLineStart=0,this.hasLineTerminatorBeforeNext=!1,this.tokenIndex=0}return i(e,[{key:"saveLexerState",value:function(){return{source:this.source,index:this.index,line:this.line,lineStart:this.lineStart,startIndex:this.startIndex,startLine:this.startLine,startLineStart:this.startLineStart,lastIndex:this.lastIndex,lastLine:this.lastLine,lastLineStart:this.lastLineStart,lookahead:this.lookahead,hasLineTerminatorBeforeNext:this.hasLineTerminatorBeforeNext,tokenIndex:this.tokenIndex}}},{key:"restoreLexerState",value:function(e){this.source=e.source,this.index=e.index,this.line=e.line,this.lineStart=e.lineStart,this.startIndex=e.startIndex,this.startLine=e.startLine,this.startLineStart=e.startLineStart,this.lastIndex=e.lastIndex,this.lastLine=e.lastLine,this.lastLineStart=e.lastLineStart,this.lookahead=e.lookahead,this.hasLineTerminatorBeforeNext=e.hasLineTerminatorBeforeNext,this.tokenIndex=e.tokenIndex}},{key:"createILLEGAL",value:function(){return this.startIndex=this.index,this.startLine=this.line,this.startLineStart=this.lineStart,this.index1?n-1:0),i=1;i10)return c.IDENTIFIER;switch(t.length){case 2:switch(t.charAt(0)){case"i":switch(t.charAt(1)){case"f":return c.IF;case"n":return c.IN}break;case"d":if("o"===t.charAt(1))return c.DO}break;case 3:switch(t.charAt(0)){case"v":if(e.cse2(t,"a","r"))return c.VAR;break;case"f":if(e.cse2(t,"o","r"))return c.FOR;break;case"n":if(e.cse2(t,"e","w"))return c.NEW;break;case"t":if(e.cse2(t,"r","y"))return c.TRY;break;case"l":if(e.cse2(t,"e","t"))return c.LET}break;case 4:switch(t.charAt(0)){case"t":if(e.cse3(t,"h","i","s"))return c.THIS;if(e.cse3(t,"r","u","e"))return c.TRUE;break;case"n":if(e.cse3(t,"u","l","l"))return c.NULL;break;case"e":if(e.cse3(t,"l","s","e"))return c.ELSE;if(e.cse3(t,"n","u","m"))return c.ENUM;break;case"c":if(e.cse3(t,"a","s","e"))return c.CASE;break;case"v":if(e.cse3(t,"o","i","d"))return c.VOID;break;case"w":if(e.cse3(t,"i","t","h"))return c.WITH}break;case 5:switch(t.charAt(0)){case"a":if(e.cse4(t,"s","y","n","c"))return c.ASYNC;if(e.cse4(t,"w","a","i","t"))return c.AWAIT;break;case"w":if(e.cse4(t,"h","i","l","e"))return c.WHILE;break;case"b":if(e.cse4(t,"r","e","a","k"))return c.BREAK;break;case"f":if(e.cse4(t,"a","l","s","e"))return c.FALSE;break;case"c":if(e.cse4(t,"a","t","c","h"))return c.CATCH;if(e.cse4(t,"o","n","s","t"))return c.CONST;if(e.cse4(t,"l","a","s","s"))return c.CLASS;break;case"t":if(e.cse4(t,"h","r","o","w"))return c.THROW;break;case"y":if(e.cse4(t,"i","e","l","d"))return c.YIELD;break;case"s":if(e.cse4(t,"u","p","e","r"))return c.SUPER}break;case 6:switch(t.charAt(0)){case"r":if(e.cse5(t,"e","t","u","r","n"))return c.RETURN;break;case"t":if(e.cse5(t,"y","p","e","o","f"))return c.TYPEOF;break;case"d":if(e.cse5(t,"e","l","e","t","e"))return c.DELETE;break;case"s":if(e.cse5(t,"w","i","t","c","h"))return c.SWITCH;break;case"e":if(e.cse5(t,"x","p","o","r","t"))return c.EXPORT;break;case"i":if(e.cse5(t,"m","p","o","r","t"))return c.IMPORT}break;case 7:switch(t.charAt(0)){case"d":if(e.cse6(t,"e","f","a","u","l","t"))return c.DEFAULT;break;case"f":if(e.cse6(t,"i","n","a","l","l","y"))return c.FINALLY;break;case"e":if(e.cse6(t,"x","t","e","n","d","s"))return c.EXTENDS}break;case 8:switch(t.charAt(0)){case"f":if(e.cse7(t,"u","n","c","t","i","o","n"))return c.FUNCTION;break;case"c":if(e.cse7(t,"o","n","t","i","n","u","e"))return c.CONTINUE;break;case"d":if(e.cse7(t,"e","b","u","g","g","e","r"))return c.DEBUGGER}break;case 10:if("instanceof"===t)return c.INSTANCEOF}return c.IDENTIFIER}},{key:"skipSingleLineComment",value:function(e){for(this.index+=e;this.index=t)break;if(47===(n=this.source.charCodeAt(this.index+1)))this.skipSingleLineComment(2),e=!0;else{if(42!==n)break;e=this.skipMultiLineComment()||e}}else if(!this.moduleIsTheGoalSymbol&&e&&45===n){if(this.index+2>=t)break;if("-"!==this.source.charAt(this.index+1)||">"!==this.source.charAt(this.index+2))break;this.skipSingleLineComment(3)}else{if(this.moduleIsTheGoalSymbol||60!==n)break;if("!--"!==this.source.slice(this.index+1,this.index+4))break;this.skipSingleLineComment(4),e=!0}}}},{key:"scanHexEscape2",value:function(){if(this.index+2>this.source.length)return-1;var e=(0,o.getHexValue)(this.source.charAt(this.index));if(-1===e)return-1;var t=(0,o.getHexValue)(this.source.charAt(this.index+1));return-1===t?-1:(this.index+=2,e<<4|t)}},{key:"scanUnicode",value:function(){if("{"===this.source.charAt(this.index)){for(var e=this.index+1,t=0,n=void 0;e1114111)throw this.createILLEGAL();e++}if("}"!==n)throw this.createILLEGAL();if(e===this.index+1)throw++this.index,this.createILLEGAL();return this.index=e+1,t}if(this.index+4>this.source.length)return-1;var i=(0,o.getHexValue)(this.source.charAt(this.index));if(-1===i)return-1;var a=(0,o.getHexValue)(this.source.charAt(this.index+1));if(-1===a)return-1;var s=(0,o.getHexValue)(this.source.charAt(this.index+2));if(-1===s)return-1;var u=(0,o.getHexValue)(this.source.charAt(this.index+3));return-1===u?-1:(this.index+=4,i<<12|a<<8|s<<4|u)}},{key:"getEscapedIdentifier",value:function(){for(var e="",t=o.isIdentifierStart;this.index=this.source.length)throw this.createILLEGAL();if("u"!==this.source.charAt(this.index))throw this.createILLEGAL();if(++this.index,(r=this.scanUnicode())<0)throw this.createILLEGAL();n=v(r)}else if(r>=55296&&r<=56319){if(this.index>=this.source.length)throw this.createILLEGAL();var a=this.source.charCodeAt(this.index);if(++this.index,!(a>=56320&&a<=57343))throw this.createILLEGAL();n=v(r=1024*(r-55296)+(a-56320)+65536)}if(!t(r)){if(e.length<1)throw this.createILLEGAL();return this.index=i,e}t=o.isIdentifierPart,e+=n}return e}},{key:"getIdentifier",value:function(){for(var e=this.index,t=this.source.length,n=this.index,r=o.isIdentifierStart;n=55296&&a<=56319)return this.index=e,this.getEscapedIdentifier();if(!r(a))return this.index=n,this.source.slice(e,n);++n,r=o.isIdentifierPart}return this.index=n,this.source.slice(e,n)}},{key:"scanIdentifier",value:function(){var e=this.getLocation(),t=this.index,n="\\"===this.source.charAt(this.index)?this.getEscapedIdentifier():this.getIdentifier(),r=this.getSlice(t,e);r.text=n;var i=this.index-t!==n.length,o=this.getKeyword(n);return i&&o!==c.IDENTIFIER&&(o=c.ESCAPED_KEYWORD),{type:o,value:n,slice:r,escaped:i}}},{key:"getLocation",value:function(){return{line:this.startLine+1,column:this.startIndex-this.startLineStart,offset:this.startIndex}}},{key:"getLastTokenEndLocation",value:function(){return{line:this.lastLine+1,column:this.lastIndex-this.lastLineStart,offset:this.lastIndex}}},{key:"getSlice",value:function(e,t){return{text:this.source.slice(e,this.index),start:e,startLocation:t,end:this.index}}},{key:"scanPunctuatorHelper",value:function(){var e=this.source.charAt(this.index);switch(e){case".":return"."!==this.source.charAt(this.index+1)||"."!==this.source.charAt(this.index+2)?c.PERIOD:c.ELLIPSIS;case"(":return c.LPAREN;case")":case";":case",":case"}":case"[":case"]":case":":case"?":case"~":return h[e.charCodeAt(0)];case"{":return c.LBRACE;default:if(this.index+1":return c.GTE;case"/":return c.ASSIGN_DIV;case"%":return c.ASSIGN_MOD;case"^":return c.ASSIGN_BIT_XOR;case"&":return c.ASSIGN_BIT_AND}}if(this.index+1"===e&&">"===n)return this.index+3"===e&&"="===n)return c.ASSIGN_SHR;if("*"===e&&"="===n)return c.ASSIGN_EXP}switch(e){case"*":return c.EXP;case"+":return c.INC;case"-":return c.DEC;case"<":return c.SHL;case">":return c.SHR;case"&":return c.AND;case"|":return c.OR}}else if("="===e&&">"===t)return c.ARROW}return h[e.charCodeAt(0)]}},{key:"scanPunctuator",value:function(){var e=this.getLocation(),t=this.index,n=this.scanPunctuatorHelper();return this.index+=n.name.length,{type:n,value:n.name,slice:this.getSlice(t,e)}}},{key:"scanHexLiteral",value:function(e,t){for(var n=this.index;n="0"&&n<="7")){if((0,o.isIdentifierPart)(n.charCodeAt(0)))throw this.createILLEGAL();break}this.index++}if(this.index-e===2)throw this.createILLEGAL();return{type:c.NUMBER,value:parseInt(this.getSlice(e,t).text.substr(2),8),slice:this.getSlice(e,t),octal:!1,noctal:!1}}},{key:"scanLegacyOctalLiteral",value:function(e,t){for(var n=!0;this.index="0"&&r<="7")this.index++;else{if("8"!==r&&"9"!==r){if((0,o.isIdentifierPart)(r.charCodeAt(0)))throw this.createILLEGAL();break}n=!1,this.index++}}var i=this.getSlice(e,t);return n?{type:c.NUMBER,slice:i,value:parseInt(i.text.substr(1),8),octal:!0,noctal:!n}:(this.eatDecimalLiteralSuffix(),{type:c.NUMBER,slice:i,value:+i.text,octal:!0,noctal:!n})}},{key:"scanNumericLiteral",value:function(){var e=this.source.charAt(this.index),t=this.getLocation(),n=this.index;if("0"===e){if(this.index++,!(this.index="0"&&e<="9")return this.scanLegacyOctalLiteral(n,t)}else if("."!==e)for(e=this.source.charAt(this.index);e>="0"&&e<="9";){if(this.index++,this.index===this.source.length){var i=this.getSlice(n,t);return{type:c.NUMBER,value:+i.text,slice:i,octal:!1,noctal:!1}}e=this.source.charAt(this.index)}if(this.eatDecimalLiteralSuffix(),this.index!==this.source.length&&(0,o.isIdentifierStart)(this.source.charCodeAt(this.index)))throw this.createILLEGAL();var a=this.getSlice(n,t);return{type:c.NUMBER,value:+a.text,slice:a,octal:!1,noctal:!1}}},{key:"eatDecimalLiteralSuffix",value:function(){var e=this.source.charAt(this.index);if("."===e){if(this.index++,this.index===this.source.length)return;for(e=this.source.charAt(this.index);e>="0"&&e<="9";){if(this.index++,this.index===this.source.length)return;e=this.source.charAt(this.index)}}if("e"===e||"E"===e){if(this.index++,this.index===this.source.length)throw this.createILLEGAL();if("+"===(e=this.source.charAt(this.index))||"-"===e){if(this.index++,this.index===this.source.length)throw this.createILLEGAL();e=this.source.charAt(this.index)}if(!(e>="0"&&e<="9"))throw this.createILLEGAL();for(;e>="0"&&e<="9"&&(this.index++,this.index!==this.source.length);)e=this.source.charAt(this.index)}}},{key:"scanStringEscape",value:function(e,t){if(this.index++,this.index===this.source.length)throw this.createILLEGAL();var n=this.source.charAt(this.index);if((0,o.isLineTerminator)(n.charCodeAt(0)))this.index++,"\r"===n&&"\n"===this.source.charAt(this.index)&&this.index++,this.lineStart=this.index,this.line++;else switch(n){case"n":e+="\n",this.index++;break;case"r":e+="\r",this.index++;break;case"t":e+="\t",this.index++;break;case"u":case"x":var r;if(this.index++,this.index>=this.source.length)throw this.createILLEGAL();if((r="u"===n?this.scanUnicode():this.scanHexEscape2())<0)throw this.createILLEGAL();e+=v(r);break;case"b":e+="\b",this.index++;break;case"f":e+="\f",this.index++;break;case"v":e+="\v",this.index++;break;default:if(n>="0"&&n<="7"){var i=this.index,a=1;n>="0"&&n<="3"&&(a=0);for(var s=0;a<3&&n>="0"&&n<="7";){if(this.index++,(a>0||"0"!==n)&&(t=this.source.slice(i,this.index)),s*=8,s+=n-"0",a++,this.index===this.source.length)throw this.createILLEGAL();n=this.source.charAt(this.index)}0!==s||1!==a||"8"!==n&&"9"!==n||(t=this.source.slice(i,this.index+1)),e+=String.fromCharCode(s)}else{if("8"===n||"9"===n)throw this.createILLEGAL();e+=n,this.index++}}return[e,t]}},{key:"scanStringLiteral",value:function(){var e="",t=this.source.charAt(this.index),n=this.getLocation(),i=this.index;this.index++;for(var a=null;this.index=this.source.length)return{type:c.EOS,slice:this.getSlice(this.index,e)};var t=this.source.charCodeAt(this.index);if(t<128){if(d[t])return this.scanPunctuator();if((0,o.isIdentifierStart)(t)||92===t)return this.scanIdentifier();if(46===t)return this.index+1=48&&t<=57)return this.scanNumericLiteral();throw this.createILLEGAL()}if((0,o.isIdentifierStart)(t)||t>=55296&&t<=56319)return this.scanIdentifier();throw this.createILLEGAL()}},{key:"eof",value:function(){return this.lookahead.type===c.EOS}},{key:"lex",value:function(){var e=this.lookahead;return this.lookahead=this.advance(),this.tokenIndex++,e}}],[{key:"cse2",value:function(e,t,n){return e.charAt(1)===t&&e.charAt(2)===n}},{key:"cse3",value:function(e,t,n,r){return e.charAt(1)===t&&e.charAt(2)===n&&e.charAt(3)===r}},{key:"cse4",value:function(e,t,n,r,i){return e.charAt(1)===t&&e.charAt(2)===n&&e.charAt(3)===r&&e.charAt(4)===i}},{key:"cse5",value:function(e,t,n,r,i,o){return e.charAt(1)===t&&e.charAt(2)===n&&e.charAt(3)===r&&e.charAt(4)===i&&e.charAt(5)===o}},{key:"cse6",value:function(e,t,n,r,i,o,a){return e.charAt(1)===t&&e.charAt(2)===n&&e.charAt(3)===r&&e.charAt(4)===i&&e.charAt(5)===o&&e.charAt(6)===a}},{key:"cse7",value:function(e,t,n,r,i,o,a,s){return e.charAt(1)===t&&e.charAt(2)===n&&e.charAt(3)===r&&e.charAt(4)===i&&e.charAt(5)===o&&e.charAt(6)===a&&e.charAt(7)===s}}]),e}();t.default=y},5151:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.whitespaceArray=[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279],t.whitespaceBool=[!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!1,!0,!0,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1],t.idStartLargeRegex=/^[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]$/,t.idStartBool=[!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!1,!1,!1,!1,!0,!1,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!1,!1,!1,!1,!1],t.idContinueLargeRegex=/^[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]$/,t.idContinueBool=[!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!1,!1,!1,!1,!1,!1,!1,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!1,!1,!1,!1,!0,!1,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!1,!1,!1,!1,!1]},3201:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isStrictModeReservedWord=function(e){return-1!==i.indexOf(e)},t.isWhiteSpace=function(e){return e<128?r.whitespaceBool[e]:160===e||e>5759&&-1!==r.whitespaceArray.indexOf(e)},t.isLineTerminator=function(e){return 10===e||13===e||8232===e||8233===e},t.isIdentifierStart=function(e){return e<128?r.idStartBool[e]:r.idStartLargeRegex.test(String.fromCodePoint(e))},t.isIdentifierPart=function(e){return e<128?r.idContinueBool[e]:r.idContinueLargeRegex.test(String.fromCodePoint(e))},t.isDecimalDigit=function(e){return e>=48&&e<=57},t.getHexValue=function(e){if(e>="0"&&e<="9")return e.charCodeAt(0)-48;if(e>="a"&&e<="f")return e.charCodeAt(0)-87;if(e>="A"&&e<="F")return e.charCodeAt(0)-55;return-1};var r=n(5151),i=["null","true","false","implements","interface","package","private","protected","public","static","let","if","in","do","var","for","new","try","this","else","case","void","with","enum","while","break","catch","throw","const","yield","class","super","return","typeof","delete","switch","export","import","default","finally","extends","function","continue","debugger","instanceof"]},7164:function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});t.ArrayAssignmentTarget=function e(t){var r=t.elements,i=t.rest;n(this,e),this.type="ArrayAssignmentTarget",this.elements=r,this.rest=i},t.ArrayBinding=function e(t){var r=t.elements,i=t.rest;n(this,e),this.type="ArrayBinding",this.elements=r,this.rest=i},t.ArrayExpression=function e(t){var r=t.elements;n(this,e),this.type="ArrayExpression",this.elements=r},t.ArrowExpression=function e(t){var r=t.isAsync,i=t.params,o=t.body;n(this,e),this.type="ArrowExpression",this.isAsync=r,this.params=i,this.body=o},t.AssignmentExpression=function e(t){var r=t.binding,i=t.expression;n(this,e),this.type="AssignmentExpression",this.binding=r,this.expression=i},t.AssignmentTargetIdentifier=function e(t){var r=t.name;n(this,e),this.type="AssignmentTargetIdentifier",this.name=r},t.AssignmentTargetPropertyIdentifier=function e(t){var r=t.binding,i=t.init;n(this,e),this.type="AssignmentTargetPropertyIdentifier",this.binding=r,this.init=i},t.AssignmentTargetPropertyProperty=function e(t){var r=t.name,i=t.binding;n(this,e),this.type="AssignmentTargetPropertyProperty",this.name=r,this.binding=i},t.AssignmentTargetWithDefault=function e(t){var r=t.binding,i=t.init;n(this,e),this.type="AssignmentTargetWithDefault",this.binding=r,this.init=i},t.AwaitExpression=function e(t){var r=t.expression;n(this,e),this.type="AwaitExpression",this.expression=r},t.BinaryExpression=function e(t){var r=t.left,i=t.operator,o=t.right;n(this,e),this.type="BinaryExpression",this.left=r,this.operator=i,this.right=o},t.BindingIdentifier=function e(t){var r=t.name;n(this,e),this.type="BindingIdentifier",this.name=r},t.BindingPropertyIdentifier=function e(t){var r=t.binding,i=t.init;n(this,e),this.type="BindingPropertyIdentifier",this.binding=r,this.init=i},t.BindingPropertyProperty=function e(t){var r=t.name,i=t.binding;n(this,e),this.type="BindingPropertyProperty",this.name=r,this.binding=i},t.BindingWithDefault=function e(t){var r=t.binding,i=t.init;n(this,e),this.type="BindingWithDefault",this.binding=r,this.init=i},t.Block=function e(t){var r=t.statements;n(this,e),this.type="Block",this.statements=r},t.BlockStatement=function e(t){var r=t.block;n(this,e),this.type="BlockStatement",this.block=r},t.BreakStatement=function e(t){var r=t.label;n(this,e),this.type="BreakStatement",this.label=r},t.CallExpression=function e(t){var r=t.callee,i=t.arguments;n(this,e),this.type="CallExpression",this.callee=r,this.arguments=i},t.CatchClause=function e(t){var r=t.binding,i=t.body;n(this,e),this.type="CatchClause",this.binding=r,this.body=i},t.ClassDeclaration=function e(t){var r=t.name,i=t.super,o=t.elements;n(this,e),this.type="ClassDeclaration",this.name=r,this.super=i,this.elements=o},t.ClassElement=function e(t){var r=t.isStatic,i=t.method;n(this,e),this.type="ClassElement",this.isStatic=r,this.method=i},t.ClassExpression=function e(t){var r=t.name,i=t.super,o=t.elements;n(this,e),this.type="ClassExpression",this.name=r,this.super=i,this.elements=o},t.CompoundAssignmentExpression=function e(t){var r=t.binding,i=t.operator,o=t.expression;n(this,e),this.type="CompoundAssignmentExpression",this.binding=r,this.operator=i,this.expression=o},t.ComputedMemberAssignmentTarget=function e(t){var r=t.object,i=t.expression;n(this,e),this.type="ComputedMemberAssignmentTarget",this.object=r,this.expression=i},t.ComputedMemberExpression=function e(t){var r=t.object,i=t.expression;n(this,e),this.type="ComputedMemberExpression",this.object=r,this.expression=i},t.ComputedPropertyName=function e(t){var r=t.expression;n(this,e),this.type="ComputedPropertyName",this.expression=r},t.ConditionalExpression=function e(t){var r=t.test,i=t.consequent,o=t.alternate;n(this,e),this.type="ConditionalExpression",this.test=r,this.consequent=i,this.alternate=o},t.ContinueStatement=function e(t){var r=t.label;n(this,e),this.type="ContinueStatement",this.label=r},t.DataProperty=function e(t){var r=t.name,i=t.expression;n(this,e),this.type="DataProperty",this.name=r,this.expression=i},t.DebuggerStatement=function e(){n(this,e),this.type="DebuggerStatement"},t.Directive=function e(t){var r=t.rawValue;n(this,e),this.type="Directive",this.rawValue=r},t.DoWhileStatement=function e(t){var r=t.body,i=t.test;n(this,e),this.type="DoWhileStatement",this.body=r,this.test=i},t.EmptyStatement=function e(){n(this,e),this.type="EmptyStatement"},t.Export=function e(t){var r=t.declaration;n(this,e),this.type="Export",this.declaration=r},t.ExportAllFrom=function e(t){var r=t.moduleSpecifier;n(this,e),this.type="ExportAllFrom",this.moduleSpecifier=r},t.ExportDefault=function e(t){var r=t.body;n(this,e),this.type="ExportDefault",this.body=r},t.ExportFrom=function e(t){var r=t.namedExports,i=t.moduleSpecifier;n(this,e),this.type="ExportFrom",this.namedExports=r,this.moduleSpecifier=i},t.ExportFromSpecifier=function e(t){var r=t.name,i=t.exportedName;n(this,e),this.type="ExportFromSpecifier",this.name=r,this.exportedName=i},t.ExportLocalSpecifier=function e(t){var r=t.name,i=t.exportedName;n(this,e),this.type="ExportLocalSpecifier",this.name=r,this.exportedName=i},t.ExportLocals=function e(t){var r=t.namedExports;n(this,e),this.type="ExportLocals",this.namedExports=r},t.ExpressionStatement=function e(t){var r=t.expression;n(this,e),this.type="ExpressionStatement",this.expression=r},t.ForAwaitStatement=function e(t){var r=t.left,i=t.right,o=t.body;n(this,e),this.type="ForAwaitStatement",this.left=r,this.right=i,this.body=o},t.ForInStatement=function e(t){var r=t.left,i=t.right,o=t.body;n(this,e),this.type="ForInStatement",this.left=r,this.right=i,this.body=o},t.ForOfStatement=function e(t){var r=t.left,i=t.right,o=t.body;n(this,e),this.type="ForOfStatement",this.left=r,this.right=i,this.body=o},t.ForStatement=function e(t){var r=t.init,i=t.test,o=t.update,a=t.body;n(this,e),this.type="ForStatement",this.init=r,this.test=i,this.update=o,this.body=a},t.FormalParameters=function e(t){var r=t.items,i=t.rest;n(this,e),this.type="FormalParameters",this.items=r,this.rest=i},t.FunctionBody=function e(t){var r=t.directives,i=t.statements;n(this,e),this.type="FunctionBody",this.directives=r,this.statements=i},t.FunctionDeclaration=function e(t){var r=t.isAsync,i=t.isGenerator,o=t.name,a=t.params,s=t.body;n(this,e),this.type="FunctionDeclaration",this.isAsync=r,this.isGenerator=i,this.name=o,this.params=a,this.body=s},t.FunctionExpression=function e(t){var r=t.isAsync,i=t.isGenerator,o=t.name,a=t.params,s=t.body;n(this,e),this.type="FunctionExpression",this.isAsync=r,this.isGenerator=i,this.name=o,this.params=a,this.body=s},t.Getter=function e(t){var r=t.name,i=t.body;n(this,e),this.type="Getter",this.name=r,this.body=i},t.IdentifierExpression=function e(t){var r=t.name;n(this,e),this.type="IdentifierExpression",this.name=r},t.IfStatement=function e(t){var r=t.test,i=t.consequent,o=t.alternate;n(this,e),this.type="IfStatement",this.test=r,this.consequent=i,this.alternate=o},t.Import=function e(t){var r=t.defaultBinding,i=t.namedImports,o=t.moduleSpecifier;n(this,e),this.type="Import",this.defaultBinding=r,this.namedImports=i,this.moduleSpecifier=o},t.ImportNamespace=function e(t){var r=t.defaultBinding,i=t.namespaceBinding,o=t.moduleSpecifier;n(this,e),this.type="ImportNamespace",this.defaultBinding=r,this.namespaceBinding=i,this.moduleSpecifier=o},t.ImportSpecifier=function e(t){var r=t.name,i=t.binding;n(this,e),this.type="ImportSpecifier",this.name=r,this.binding=i},t.LabeledStatement=function e(t){var r=t.label,i=t.body;n(this,e),this.type="LabeledStatement",this.label=r,this.body=i},t.LiteralBooleanExpression=function e(t){var r=t.value;n(this,e),this.type="LiteralBooleanExpression",this.value=r},t.LiteralInfinityExpression=function e(){n(this,e),this.type="LiteralInfinityExpression"},t.LiteralNullExpression=function e(){n(this,e),this.type="LiteralNullExpression"},t.LiteralNumericExpression=function e(t){var r=t.value;n(this,e),this.type="LiteralNumericExpression",this.value=r},t.LiteralRegExpExpression=function e(t){var r=t.pattern,i=t.global,o=t.ignoreCase,a=t.multiLine,s=t.dotAll,u=t.unicode,c=t.sticky;n(this,e),this.type="LiteralRegExpExpression",this.pattern=r,this.global=i,this.ignoreCase=o,this.multiLine=a,this.dotAll=s,this.unicode=u,this.sticky=c},t.LiteralStringExpression=function e(t){var r=t.value;n(this,e),this.type="LiteralStringExpression",this.value=r},t.Method=function e(t){var r=t.isAsync,i=t.isGenerator,o=t.name,a=t.params,s=t.body;n(this,e),this.type="Method",this.isAsync=r,this.isGenerator=i,this.name=o,this.params=a,this.body=s},t.Module=function e(t){var r=t.directives,i=t.items;n(this,e),this.type="Module",this.directives=r,this.items=i},t.NewExpression=function e(t){var r=t.callee,i=t.arguments;n(this,e),this.type="NewExpression",this.callee=r,this.arguments=i},t.NewTargetExpression=function e(){n(this,e),this.type="NewTargetExpression"},t.ObjectAssignmentTarget=function e(t){var r=t.properties,i=t.rest;n(this,e),this.type="ObjectAssignmentTarget",this.properties=r,this.rest=i},t.ObjectBinding=function e(t){var r=t.properties,i=t.rest;n(this,e),this.type="ObjectBinding",this.properties=r,this.rest=i},t.ObjectExpression=function e(t){var r=t.properties;n(this,e),this.type="ObjectExpression",this.properties=r},t.ReturnStatement=function e(t){var r=t.expression;n(this,e),this.type="ReturnStatement",this.expression=r},t.Script=function e(t){var r=t.directives,i=t.statements;n(this,e),this.type="Script",this.directives=r,this.statements=i},t.Setter=function e(t){var r=t.name,i=t.param,o=t.body;n(this,e),this.type="Setter",this.name=r,this.param=i,this.body=o},t.ShorthandProperty=function e(t){var r=t.name;n(this,e),this.type="ShorthandProperty",this.name=r},t.SpreadElement=function e(t){var r=t.expression;n(this,e),this.type="SpreadElement",this.expression=r},t.SpreadProperty=function e(t){var r=t.expression;n(this,e),this.type="SpreadProperty",this.expression=r},t.StaticMemberAssignmentTarget=function e(t){var r=t.object,i=t.property;n(this,e),this.type="StaticMemberAssignmentTarget",this.object=r,this.property=i},t.StaticMemberExpression=function e(t){var r=t.object,i=t.property;n(this,e),this.type="StaticMemberExpression",this.object=r,this.property=i},t.StaticPropertyName=function e(t){var r=t.value;n(this,e),this.type="StaticPropertyName",this.value=r},t.Super=function e(){n(this,e),this.type="Super"},t.SwitchCase=function e(t){var r=t.test,i=t.consequent;n(this,e),this.type="SwitchCase",this.test=r,this.consequent=i},t.SwitchDefault=function e(t){var r=t.consequent;n(this,e),this.type="SwitchDefault",this.consequent=r},t.SwitchStatement=function e(t){var r=t.discriminant,i=t.cases;n(this,e),this.type="SwitchStatement",this.discriminant=r,this.cases=i},t.SwitchStatementWithDefault=function e(t){var r=t.discriminant,i=t.preDefaultCases,o=t.defaultCase,a=t.postDefaultCases;n(this,e),this.type="SwitchStatementWithDefault",this.discriminant=r,this.preDefaultCases=i,this.defaultCase=o,this.postDefaultCases=a},t.TemplateElement=function e(t){var r=t.rawValue;n(this,e),this.type="TemplateElement",this.rawValue=r},t.TemplateExpression=function e(t){var r=t.tag,i=t.elements;n(this,e),this.type="TemplateExpression",this.tag=r,this.elements=i},t.ThisExpression=function e(){n(this,e),this.type="ThisExpression"},t.ThrowStatement=function e(t){var r=t.expression;n(this,e),this.type="ThrowStatement",this.expression=r},t.TryCatchStatement=function e(t){var r=t.body,i=t.catchClause;n(this,e),this.type="TryCatchStatement",this.body=r,this.catchClause=i},t.TryFinallyStatement=function e(t){var r=t.body,i=t.catchClause,o=t.finalizer;n(this,e),this.type="TryFinallyStatement",this.body=r,this.catchClause=i,this.finalizer=o},t.UnaryExpression=function e(t){var r=t.operator,i=t.operand;n(this,e),this.type="UnaryExpression",this.operator=r,this.operand=i},t.UpdateExpression=function e(t){var r=t.isPrefix,i=t.operator,o=t.operand;n(this,e),this.type="UpdateExpression",this.isPrefix=r,this.operator=i,this.operand=o},t.VariableDeclaration=function e(t){var r=t.kind,i=t.declarators;n(this,e),this.type="VariableDeclaration",this.kind=r,this.declarators=i},t.VariableDeclarationStatement=function e(t){var r=t.declaration;n(this,e),this.type="VariableDeclarationStatement",this.declaration=r},t.VariableDeclarator=function e(t){var r=t.binding,i=t.init;n(this,e),this.type="VariableDeclarator",this.binding=r,this.init=i},t.WhileStatement=function e(t){var r=t.test,i=t.body;n(this,e),this.type="WhileStatement",this.test=r,this.body=i},t.WithStatement=function e(t){var r=t.object,i=t.body;n(this,e),this.type="WithStatement",this.object=r,this.body=i},t.YieldExpression=function e(t){var r=t.expression;n(this,e),this.type="YieldExpression",this.expression=r},t.YieldGeneratorExpression=function e(t){var r=t.expression;n(this,e),this.type="YieldGeneratorExpression",this.expression=r}},7053:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(r):void 0};!function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);t.default=e}(n(569));t.default=function(e,t){var n;return n={__proto__:t,reduceArrayAssignmentTarget:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceArrayAssignmentTarget",this).call(this,t,i),t)},reduceArrayBinding:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceArrayBinding",this).call(this,t,i),t)},reduceArrayExpression:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceArrayExpression",this).call(this,t,i),t)},reduceArrowExpression:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceArrowExpression",this).call(this,t,i),t)},reduceAssignmentExpression:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceAssignmentExpression",this).call(this,t,i),t)},reduceAssignmentTargetIdentifier:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceAssignmentTargetIdentifier",this).call(this,t,i),t)},reduceAssignmentTargetPropertyIdentifier:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceAssignmentTargetPropertyIdentifier",this).call(this,t,i),t)},reduceAssignmentTargetPropertyProperty:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceAssignmentTargetPropertyProperty",this).call(this,t,i),t)},reduceAssignmentTargetWithDefault:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceAssignmentTargetWithDefault",this).call(this,t,i),t)},reduceAwaitExpression:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceAwaitExpression",this).call(this,t,i),t)},reduceBinaryExpression:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceBinaryExpression",this).call(this,t,i),t)},reduceBindingIdentifier:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceBindingIdentifier",this).call(this,t,i),t)},reduceBindingPropertyIdentifier:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceBindingPropertyIdentifier",this).call(this,t,i),t)},reduceBindingPropertyProperty:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceBindingPropertyProperty",this).call(this,t,i),t)},reduceBindingWithDefault:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceBindingWithDefault",this).call(this,t,i),t)},reduceBlock:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceBlock",this).call(this,t,i),t)},reduceBlockStatement:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceBlockStatement",this).call(this,t,i),t)},reduceBreakStatement:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceBreakStatement",this).call(this,t,i),t)},reduceCallExpression:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceCallExpression",this).call(this,t,i),t)},reduceCatchClause:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceCatchClause",this).call(this,t,i),t)},reduceClassDeclaration:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceClassDeclaration",this).call(this,t,i),t)},reduceClassElement:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceClassElement",this).call(this,t,i),t)},reduceClassExpression:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceClassExpression",this).call(this,t,i),t)},reduceCompoundAssignmentExpression:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceCompoundAssignmentExpression",this).call(this,t,i),t)},reduceComputedMemberAssignmentTarget:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceComputedMemberAssignmentTarget",this).call(this,t,i),t)},reduceComputedMemberExpression:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceComputedMemberExpression",this).call(this,t,i),t)},reduceComputedPropertyName:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceComputedPropertyName",this).call(this,t,i),t)},reduceConditionalExpression:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceConditionalExpression",this).call(this,t,i),t)},reduceContinueStatement:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceContinueStatement",this).call(this,t,i),t)},reduceDataProperty:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceDataProperty",this).call(this,t,i),t)},reduceDebuggerStatement:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceDebuggerStatement",this).call(this,t,i),t)},reduceDirective:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceDirective",this).call(this,t,i),t)},reduceDoWhileStatement:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceDoWhileStatement",this).call(this,t,i),t)},reduceEmptyStatement:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceEmptyStatement",this).call(this,t,i),t)},reduceExport:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceExport",this).call(this,t,i),t)},reduceExportAllFrom:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceExportAllFrom",this).call(this,t,i),t)},reduceExportDefault:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceExportDefault",this).call(this,t,i),t)},reduceExportFrom:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceExportFrom",this).call(this,t,i),t)},reduceExportFromSpecifier:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceExportFromSpecifier",this).call(this,t,i),t)},reduceExportLocalSpecifier:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceExportLocalSpecifier",this).call(this,t,i),t)},reduceExportLocals:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceExportLocals",this).call(this,t,i),t)},reduceExpressionStatement:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceExpressionStatement",this).call(this,t,i),t)},reduceForAwaitStatement:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceForAwaitStatement",this).call(this,t,i),t)},reduceForInStatement:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceForInStatement",this).call(this,t,i),t)},reduceForOfStatement:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceForOfStatement",this).call(this,t,i),t)},reduceForStatement:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceForStatement",this).call(this,t,i),t)},reduceFormalParameters:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceFormalParameters",this).call(this,t,i),t)},reduceFunctionBody:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceFunctionBody",this).call(this,t,i),t)},reduceFunctionDeclaration:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceFunctionDeclaration",this).call(this,t,i),t)},reduceFunctionExpression:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceFunctionExpression",this).call(this,t,i),t)},reduceGetter:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceGetter",this).call(this,t,i),t)},reduceIdentifierExpression:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceIdentifierExpression",this).call(this,t,i),t)},reduceIfStatement:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceIfStatement",this).call(this,t,i),t)},reduceImport:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceImport",this).call(this,t,i),t)},reduceImportNamespace:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceImportNamespace",this).call(this,t,i),t)},reduceImportSpecifier:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceImportSpecifier",this).call(this,t,i),t)},reduceLabeledStatement:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceLabeledStatement",this).call(this,t,i),t)},reduceLiteralBooleanExpression:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceLiteralBooleanExpression",this).call(this,t,i),t)},reduceLiteralInfinityExpression:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceLiteralInfinityExpression",this).call(this,t,i),t)},reduceLiteralNullExpression:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceLiteralNullExpression",this).call(this,t,i),t)},reduceLiteralNumericExpression:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceLiteralNumericExpression",this).call(this,t,i),t)},reduceLiteralRegExpExpression:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceLiteralRegExpExpression",this).call(this,t,i),t)},reduceLiteralStringExpression:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceLiteralStringExpression",this).call(this,t,i),t)},reduceMethod:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceMethod",this).call(this,t,i),t)},reduceModule:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceModule",this).call(this,t,i),t)},reduceNewExpression:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceNewExpression",this).call(this,t,i),t)},reduceNewTargetExpression:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceNewTargetExpression",this).call(this,t,i),t)},reduceObjectAssignmentTarget:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceObjectAssignmentTarget",this).call(this,t,i),t)},reduceObjectBinding:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceObjectBinding",this).call(this,t,i),t)},reduceObjectExpression:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceObjectExpression",this).call(this,t,i),t)},reduceReturnStatement:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceReturnStatement",this).call(this,t,i),t)},reduceScript:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceScript",this).call(this,t,i),t)},reduceSetter:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceSetter",this).call(this,t,i),t)},reduceShorthandProperty:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceShorthandProperty",this).call(this,t,i),t)},reduceSpreadElement:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceSpreadElement",this).call(this,t,i),t)},reduceSpreadProperty:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceSpreadProperty",this).call(this,t,i),t)},reduceStaticMemberAssignmentTarget:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceStaticMemberAssignmentTarget",this).call(this,t,i),t)},reduceStaticMemberExpression:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceStaticMemberExpression",this).call(this,t,i),t)},reduceStaticPropertyName:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceStaticPropertyName",this).call(this,t,i),t)},reduceSuper:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceSuper",this).call(this,t,i),t)},reduceSwitchCase:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceSwitchCase",this).call(this,t,i),t)},reduceSwitchDefault:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceSwitchDefault",this).call(this,t,i),t)},reduceSwitchStatement:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceSwitchStatement",this).call(this,t,i),t)},reduceSwitchStatementWithDefault:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceSwitchStatementWithDefault",this).call(this,t,i),t)},reduceTemplateElement:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceTemplateElement",this).call(this,t,i),t)},reduceTemplateExpression:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceTemplateExpression",this).call(this,t,i),t)},reduceThisExpression:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceThisExpression",this).call(this,t,i),t)},reduceThrowStatement:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceThrowStatement",this).call(this,t,i),t)},reduceTryCatchStatement:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceTryCatchStatement",this).call(this,t,i),t)},reduceTryFinallyStatement:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceTryFinallyStatement",this).call(this,t,i),t)},reduceUnaryExpression:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceUnaryExpression",this).call(this,t,i),t)},reduceUpdateExpression:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceUpdateExpression",this).call(this,t,i),t)},reduceVariableDeclaration:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceVariableDeclaration",this).call(this,t,i),t)},reduceVariableDeclarationStatement:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceVariableDeclarationStatement",this).call(this,t,i),t)},reduceVariableDeclarator:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceVariableDeclarator",this).call(this,t,i),t)},reduceWhileStatement:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceWhileStatement",this).call(this,t,i),t)},reduceWithStatement:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceWithStatement",this).call(this,t,i),t)},reduceYieldExpression:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceYieldExpression",this).call(this,t,i),t)},reduceYieldGeneratorExpression:function(t,i){return e(r(n.__proto__||Object.getPrototypeOf(n),"reduceYieldGeneratorExpression",this).call(this,t,i),t)}}}},7106:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n=this.pattern.length}},{key:"backreference",value:function(e){e>this.largestBackreference&&(this.largestBackreference=e)}},{key:"nextCodePoint",value:function(){return this.empty()?null:this.unicode?String.fromCodePoint(this.pattern.codePointAt(this.index)):this.pattern.charAt(this.index)}},{key:"skipCodePoint",value:function(){this.index+=this.nextCodePoint().length}},{key:"eat",value:function(e){return!(this.index+e.length>this.pattern.length||this.pattern.slice(this.index,this.index+e.length)!==e)&&(this.index+=e.length,!0)}},{key:"eatIdentifierCodePoint",value:function(){var e=void 0,t=this.index,n=void 0;if(this.match("\\u")){if(this.skipCodePoint(),!(e=A(this)).matched)return this.index=t,null;e=e.value,n=String.fromCodePoint(e)}else{if(null==(n=this.nextCodePoint()))return this.index=t,null;this.index+=n.length,e=n.codePointAt(0)}return{character:n,characterValue:e}}},{key:"eatIdentifierStart",value:function(){var e,t=this.index,n=this.eatIdentifierCodePoint();return null===n?(this.index=t,null):"_"===n.character||"$"===n.character||((e=n.characterValue)<128?u.idStartBool[e]:u.idStartLargeRegex.test(String.fromCodePoint(e)))?n.character:(this.index=t,null)}},{key:"eatIdentifierPart",value:function(){var e,t=this.index,n=this.eatIdentifierCodePoint();return null===n?(this.index=t,null):"\u200c"===n.character||"\u200d"===n.character||"$"===n.character||((e=n.characterValue)<128?u.idContinueBool[e]:u.idContinueLargeRegex.test(String.fromCodePoint(e)))?n.character:(this.index=t,null)}},{key:"eatAny",value:function(){for(var e=arguments.length,t=Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=t.unicode,r=void 0!==n&&n,i=new b(e,r),o=k(i);if(o.matched){if(i.unicode&&i.largestBackreference>i.capturingGroups)return!1;if(i.groupingNames.length>0||i.unicode){var a=!0,s=!1,u=void 0;try{for(var c,l=i.backreferenceNames[Symbol.iterator]();!(a=(c=l.next()).done);a=!0){var p=c.value;if(-1===i.groupingNames.indexOf(p))return!1}}catch(f){s=!0,u=f}finally{try{!a&&l.return&&l.return()}finally{if(s)throw u}}}}return o.matched};var D=function(e){return function(t){var n=t.index,r=t.largestBackreference,i=t.capturingGroups,o=e(t);return o.matched||(t.index=n,t.largestBackreference=r,t.capturingGroups=i),o}},A=D((function(e){if(!e.eat("u"))return{matched:!1};if(e.unicode&&e.eat("{")){for(var t=[];!e.eat("}");){var n=e.eatAny.apply(e,l(y));if(null===n)return{matched:!1};t.push(n)}var r=parseInt(t.join(""),16);return r>1114111?{matched:!1}:{matched:!0,value:r}}var i=[0,0,0,0].map((function(){return e.eatAny.apply(e,l(y))}));if(i.some((function(e){return null===e})))return{matched:!1};var o=parseInt(i.join(""),16);if(e.unicode&&o>=55296&&o<=56319){var a=D((function(e){if(!e.eat("\\u"))return{matched:!1};var t=[0,0,0,0].map((function(){return e.eatAny.apply(e,l(y))}));if(t.some((function(e){return null===e})))return{matched:!1};var n=parseInt(t.join(""),16);return n<56320||n>=57344?{matched:!1}:{matched:!0,value:65536+((1023&o)<<10)+(1023&n)}}))(e);if(a.matched)return a}return{matched:!0,value:o}})),k=function(e,t){do{if(void 0!==t&&e.eat(t))return{matched:!0};if(!e.match("|")&&!C(e,t).matched)return{matched:!1}}while(e.eat("|"));return{matched:void 0===t||!!e.eat(t)}},C=function(e,t){for(;!e.match("|")&&!e.empty()&&(void 0===t||!e.match(t));)if(!w(e).matched)return{matched:!1};return{matched:!0}},x=function(){for(var e=arguments.length,t=Array(e),n=0;nparseInt(n))return{matched:!1}}return e.eat("}")?(e.eat("?"),{matched:!0}):{matched:!1}}))(t);return n.matched?n:{matched:!t.unicode}}return t.eatAny("*","+","?")&&t.eat("?"),{matched:!0}}))},B=function(e){return function(t){var n=t.nextCodePoint();return null===n||-1!==e.indexOf(n)?{matched:!1}:(t.skipCodePoint(),{matched:!0})}},O=B(f),P=B(h),I=function(e){if(e.unicode)return x(O,(function(e){return{matched:!!e.eat(".")}}),D((function(e){return e.eat("\\")?Y(e):{matched:!1}})),K,S((function(e){return e.eat("?:")})),N)(e);var t=x((function(e){return{matched:!!e.eat(".")}}),D((function(e){return e.eat("\\")?Y(e):{matched:!1}})),D((function(e){return{matched:e.eat("\\")&&e.match("c")}})),K,S((function(e){return e.eat("?:")})),N)(e);return!t.matched&&function(e){return D((function(e){return{matched:!(!e.eat("{")||!M(e).matched||e.eat(",")&&!e.match("}")&&!M(e).matched||!e.eat("}"))}}))(e)}(e).matched?{matched:!1}:t.matched?t:P(e)},N=D((function(e){if(!e.eat("("))return{matched:!1};var t=D((function(t){return e.eat("?")?U(t):{matched:!1}}))(e);if(!k(e,")").matched)return{matched:!1};if(t.matched){if(-1!==e.groupingNames.indexOf(t.data))return{matched:!1};e.groupingNames.push(t.data)}return e.capturingGroups++,{matched:!0}})),R=D((function(e){var t=e.eatAny.apply(e,l(g));return null===t?{matched:!1}:("0"===t||e.backreference(parseInt(t+(e.eatNaturalNumber()||""))),{matched:!0})})),L=function(e){return e.eatAny("d","D","s","S","w","W")?{matched:!0}:e.unicode?D((function(e){return(e.eat("p{")||e.eat("P{"))&&Z(e).matched?{matched:!!e.eat("}")}:{matched:!1}}))(e):{matched:!1}},j=function(e){for(var t=[],n=void 0;n=e.eatAny.apply(e,l(v).concat(l(g),["_"]));)t.push(n);return{matched:t.length>0,data:t.join("")}},W=["General_Category","Script","Script_Extensions","scx","sc","gc"],G=o.default.get("General_Category"),H=function(e){var t=j(e);return!t.matched||W.includes(t.data)?{matched:!1}:{matched:p((function(){return(0,a.default)(t.data)}))||null!=G.get(t.data)}},Z=function(e){return x(D((function(e){var t=function(e){for(var t=[],n=void 0;n=e.eatAny.apply(e,l(v).concat(["_"]));)t.push(n);return{matched:t.length>0,data:t.join("")}}(e);if(!t.matched||!e.eat("="))return{matched:!1};var n=j(e);return n.matched?{matched:p((function(){return(0,i.default)(s.default.get(t.data)||t.data,n.data)}))}:{matched:!1}})),D(H))(e)},V=x((function(e){var t=e.eatAny.apply(e,l(d));return null===t?{matched:!1}:{matched:!0,value:m[t]}}),D((function(e){if(!e.eat("c"))return{matched:!1};var t=e.eatAny.apply(e,l(v));return null===t?{matched:!1}:{matched:!0,value:t.charCodeAt(0)%32}})),D((function(e){return!e.eat("0")||e.eatAny.apply(e,l(g))?{matched:!1}:{matched:!0,value:0}})),D((function(e){if(!e.eat("x"))return{matched:!1};var t=[0,0].map((function(){return e.eatAny.apply(e,l(y))}));return t.some((function(e){return null===e}))?{matched:!1}:{matched:!0,value:parseInt(t.join(""),16)}})),A,D((function(e){if(e.unicode)return{matched:!1};var t=e.eatAny.apply(e,l(_));if(null===t)return{matched:!1};var n=parseInt(t,8);if(-1===_.indexOf(e.nextCodePoint()))return{matched:!0,value:n};var r=e.eatAny.apply(e,l(_)),i=parseInt(r,8);if(n<4){if(-1===_.indexOf(e.nextCodePoint()))return{matched:!0,value:n<<3|i};var o=e.eatAny.apply(e,l(_));return{matched:!0,value:n<<6|i<<3|parseInt(o,8)}}return{matched:!0,value:n<<3|i}})),D((function(e){if(!e.unicode)return{matched:!1};var t=e.eatAny.apply(e,l(f));return null===t?{matched:!1}:{matched:!0,value:t.charCodeAt(0)}})),(function(e){return e.unicode&&e.eat("/")?{matched:!0,value:"/".charCodeAt(0)}:{matched:!1}}),D((function(e){if(e.unicode)return{matched:!1};var t=e.nextCodePoint();return null!==t&&"c"!==t&&"k"!==t?(e.skipCodePoint(),{matched:!0,value:t.codePointAt(0)}):{matched:!1}}))),z=D((function(e){if(!e.eat("k"))return{matched:!1};var t=U(e);return t.matched?(e.backreferenceNames.push(t.data),{matched:!0}):(e.backreferenceNames.push(E),{matched:!0})})),U=D((function(e){if(!e.eat("<"))return{matched:!1};var t=[],n=e.eatIdentifierStart();if(!n)return{matched:!1};t.push(n);for(var r=void 0;r=e.eatIdentifierPart();)t.push(r);return e.eat(">")?{matched:t.length>0,data:t.join("")}:{matched:!1}})),Y=x(R,L,V,z),K=D((function(e){if(!e.eat("["))return{matched:!1};e.eat("^");var t=x((function(e){return{matched:!!e.eat("b"),value:8}}),(function(e){return{matched:e.unicode&&!!e.eat("-"),value:"-".charCodeAt(0)}}),D((function(e){if(e.unicode||!e.eat("c"))return{matched:!1};var t=e.eatAny.apply(e,l(g).concat(["_"]));return null===t?{matched:!1}:{matched:!0,value:t.charCodeAt(0)%32}})),L,V,(function(e){return{matched:!e.unicode&&!!e.eat("k"),value:107}})),n=function(e){var n=e.nextCodePoint();if("]"===n||"-"===n||null===n)return{matched:!1};if("\\"!==n)return e.skipCodePoint(),{matched:!0,value:n.codePointAt(0)};e.eat("\\");var r=t(e);return r.matched||"c"!==e.nextCodePoint()||e.unicode?r:{matched:!0,value:"\\".charCodeAt(0)}},r=function(e){return e.eat("-")?{matched:!0,value:"-".charCodeAt(0)}:n(e)},i=function(e,t){var n=function(e){return void 0===e.value&&e.matched};if(e.eat("-")){if(e.match("]"))return{matched:!0};var i=r(e);return i.matched?e.unicode&&(n(t)||n(i))||(e.unicode||!n(t)&&!n(i))&&t.value>i.value?{matched:!1}:e.match("]")?{matched:!0}:o(e):{matched:!1}}return e.match("]")?{matched:!0}:a(e)},o=function(e){var t=r(e);return t.matched?i(e,t):{matched:!1}},a=function(e){var t=n(e);return t.matched?i(e,t):{matched:!1}};if(e.eat("]"))return{matched:!0};var s=o(e);return s.matched&&e.eat("]"),s}))},9508:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.whitespaceArray=[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279],t.whitespaceBool=[!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!1,!0,!0,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1],t.idStartLargeRegex=/^[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]$/,t.idStartBool=[!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!1,!1,!1,!1,!0,!1,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!1,!1,!1,!1,!1],t.idContinueLargeRegex=/^[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]$/,t.idContinueBool=[!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!1,!1,!1,!1,!1,!1,!1,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!1,!1,!1,!1,!0,!1,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!1,!1,!1,!1,!1]},8171:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e={},t={typeName:"Boolean"},n={typeName:"String"};function r(e){return{typeName:"Maybe",argument:e}}function i(e){return{typeName:"List",argument:e}}function o(e){return{typeName:"Const",argument:e}}function a(){return{typeName:"Union",arguments:[].slice.call(arguments,0)}}var s={typeName:"Enum",values:["ArrayAssignmentTarget","ArrayBinding","ArrayExpression","ArrowExpression","AssignmentExpression","AssignmentTargetIdentifier","AssignmentTargetPropertyIdentifier","AssignmentTargetPropertyProperty","AssignmentTargetWithDefault","AwaitExpression","BinaryExpression","BindingIdentifier","BindingPropertyIdentifier","BindingPropertyProperty","BindingWithDefault","Block","BlockStatement","BreakStatement","CallExpression","CatchClause","ClassDeclaration","ClassElement","ClassExpression","CompoundAssignmentExpression","ComputedMemberAssignmentTarget","ComputedMemberExpression","ComputedPropertyName","ConditionalExpression","ContinueStatement","DataProperty","DebuggerStatement","Directive","DoWhileStatement","EmptyStatement","Export","ExportAllFrom","ExportDefault","ExportFrom","ExportFromSpecifier","ExportLocalSpecifier","ExportLocals","ExpressionStatement","ForAwaitStatement","ForInStatement","ForOfStatement","ForStatement","FormalParameters","FunctionBody","FunctionDeclaration","FunctionExpression","Getter","IdentifierExpression","IfStatement","Import","ImportNamespace","ImportSpecifier","LabeledStatement","LiteralBooleanExpression","LiteralInfinityExpression","LiteralNullExpression","LiteralNumericExpression","LiteralRegExpExpression","LiteralStringExpression","Method","Module","NewExpression","NewTargetExpression","ObjectAssignmentTarget","ObjectBinding","ObjectExpression","ReturnStatement","Script","Setter","ShorthandProperty","SpreadElement","SpreadProperty","StaticMemberAssignmentTarget","StaticMemberExpression","StaticPropertyName","Super","SwitchCase","SwitchDefault","SwitchStatement","SwitchStatementWithDefault","TemplateElement","TemplateExpression","ThisExpression","ThrowStatement","TryCatchStatement","TryFinallyStatement","UnaryExpression","UpdateExpression","VariableDeclaration","VariableDeclarationStatement","VariableDeclarator","WhileStatement","WithStatement","YieldExpression","YieldGeneratorExpression"]},u=e.ArrayAssignmentTarget={},c=e.ArrayBinding={},l=e.ArrayExpression={},p=e.ArrowExpression={},f=e.AssignmentExpression={},h=e.AssignmentTargetIdentifier={},d=e.AssignmentTargetPropertyIdentifier={},m=e.AssignmentTargetPropertyProperty={},v=e.AssignmentTargetWithDefault={},y=e.AwaitExpression={},g=e.BinaryExpression={},_=e.BindingIdentifier={},E=e.BindingPropertyIdentifier={},b=e.BindingPropertyProperty={},D=e.BindingWithDefault={},A=e.Block={},k=e.BlockStatement={},C=e.BreakStatement={},x=e.CallExpression={},w=e.CatchClause={},S=e.ClassDeclaration={},T=e.ClassElement={},F=e.ClassExpression={},M=e.CompoundAssignmentExpression={},q=e.ComputedMemberAssignmentTarget={},B=e.ComputedMemberExpression={},O=e.ComputedPropertyName={},P=e.ConditionalExpression={},I=e.ContinueStatement={},N=e.DataProperty={},R=e.DebuggerStatement={},L=e.Directive={},j=e.DoWhileStatement={},W=e.EmptyStatement={},G=e.Export={},H=e.ExportAllFrom={},Z=e.ExportDefault={},V=e.ExportFrom={},z=e.ExportFromSpecifier={},U=e.ExportLocalSpecifier={},Y=e.ExportLocals={},K=e.ExpressionStatement={},X=e.ForAwaitStatement={},J=e.ForInStatement={},Q=e.ForOfStatement={},$=e.ForStatement={},ee=e.FormalParameters={},te=e.FunctionBody={},ne=e.FunctionDeclaration={},re=e.FunctionExpression={},ie=e.Getter={},oe=e.IdentifierExpression={},ae=e.IfStatement={},se=e.Import={},ue=e.ImportNamespace={},ce=e.ImportSpecifier={},le=e.LabeledStatement={},pe=e.LiteralBooleanExpression={},fe=e.LiteralInfinityExpression={},he=e.LiteralNullExpression={},de=e.LiteralNumericExpression={},me=e.LiteralRegExpExpression={},ve=e.LiteralStringExpression={},ye=e.Method={},ge=e.Module={},_e=e.NewExpression={},Ee=e.NewTargetExpression={},be=e.ObjectAssignmentTarget={},De=e.ObjectBinding={},Ae=e.ObjectExpression={},ke=e.ReturnStatement={},Ce=e.Script={},xe=e.Setter={},we=e.ShorthandProperty={},Se=e.SpreadElement={},Te=e.SpreadProperty={},Fe=e.StaticMemberAssignmentTarget={},Me=e.StaticMemberExpression={},qe=e.StaticPropertyName={},Be=e.Super={},Oe=e.SwitchCase={},Pe=e.SwitchDefault={},Ie=e.SwitchStatement={},Ne=e.SwitchStatementWithDefault={},Re=e.TemplateElement={},Le=e.TemplateExpression={},je=e.ThisExpression={},We=e.ThrowStatement={},Ge=e.TryCatchStatement={},He=e.TryFinallyStatement={},Ze=e.UnaryExpression={},Ve=e.UpdateExpression={},ze=e.VariableDeclaration={},Ue=e.VariableDeclarationStatement={},Ye=e.VariableDeclarator={},Ke=e.WhileStatement={},Xe=e.WithStatement={},Je=e.YieldExpression={},Qe=e.YieldGeneratorExpression={},$e=a(B,Me),et=a(d,m),tt=(a(S,F),a(G,H,Z,V,Y)),nt=a(O,qe),rt=(a(ne,re),a(se,ue)),it=a(j,X,J,Q,$,Ke),ot=a(q,Fe),at=a(E,b),st=a(ie,ye,xe),ut=a(ge,Ce),ct=a(h,_,oe),lt=a(N,st),pt=a(l,p,f,y,g,x,F,M,P,re,oe,pe,fe,he,de,me,ve,$e,_e,Ee,Ae,Le,je,Ze,Ve,Je,Qe),ft=a(k,C,S,I,R,W,K,ne,ae,it,le,ke,Ie,Ne,We,Ge,He,Ue,Xe),ht=a(lt,we,Te);a(u,c,et,v,at,D,A,w,T,L,tt,z,U,pt,ee,te,rt,ce,ot,be,De,ht,ut,nt,Se,ft,Be,Oe,Pe,Re,ze,Ye,ct);return u.typeName="ArrayAssignmentTarget",u.fields=[{name:"type",type:o(s),value:"ArrayAssignmentTarget"},{name:"elements",type:i(r(a(v,a(a(u,be),a(h,ot)))))},{name:"rest",type:r(a(a(u,be),a(h,ot)))}],c.typeName="ArrayBinding",c.fields=[{name:"type",type:o(s),value:"ArrayBinding"},{name:"elements",type:i(r(a(D,a(_,a(c,De)))))},{name:"rest",type:r(a(_,a(c,De)))}],l.typeName="ArrayExpression",l.fields=[{name:"type",type:o(s),value:"ArrayExpression"},{name:"elements",type:i(r(a(pt,Se)))}],p.typeName="ArrowExpression",p.fields=[{name:"type",type:o(s),value:"ArrowExpression"},{name:"isAsync",type:t},{name:"params",type:ee},{name:"body",type:a(pt,te)}],f.typeName="AssignmentExpression",f.fields=[{name:"type",type:o(s),value:"AssignmentExpression"},{name:"binding",type:a(a(u,be),a(h,ot))},{name:"expression",type:pt}],h.typeName="AssignmentTargetIdentifier",h.fields=[{name:"type",type:o(s),value:"AssignmentTargetIdentifier"},{name:"name",type:n}],d.typeName="AssignmentTargetPropertyIdentifier",d.fields=[{name:"type",type:o(s),value:"AssignmentTargetPropertyIdentifier"},{name:"binding",type:h},{name:"init",type:r(pt)}],m.typeName="AssignmentTargetPropertyProperty",m.fields=[{name:"type",type:o(s),value:"AssignmentTargetPropertyProperty"},{name:"name",type:nt},{name:"binding",type:a(v,a(a(u,be),a(h,ot)))}],v.typeName="AssignmentTargetWithDefault",v.fields=[{name:"type",type:o(s),value:"AssignmentTargetWithDefault"},{name:"binding",type:a(a(u,be),a(h,ot))},{name:"init",type:pt}],y.typeName="AwaitExpression",y.fields=[{name:"type",type:o(s),value:"AwaitExpression"},{name:"expression",type:pt}],g.typeName="BinaryExpression",g.fields=[{name:"type",type:o(s),value:"BinaryExpression"},{name:"left",type:pt},{name:"operator",type:{typeName:"Enum",values:["==","!=","===","!==","<","<=",">",">=","in","instanceof","<<",">>",">>>","+","-","*","/","%","**",",","||","&&","|","^","&"]}},{name:"right",type:pt}],_.typeName="BindingIdentifier",_.fields=[{name:"type",type:o(s),value:"BindingIdentifier"},{name:"name",type:n}],E.typeName="BindingPropertyIdentifier",E.fields=[{name:"type",type:o(s),value:"BindingPropertyIdentifier"},{name:"binding",type:_},{name:"init",type:r(pt)}],b.typeName="BindingPropertyProperty",b.fields=[{name:"type",type:o(s),value:"BindingPropertyProperty"},{name:"name",type:nt},{name:"binding",type:a(D,a(_,a(c,De)))}],D.typeName="BindingWithDefault",D.fields=[{name:"type",type:o(s),value:"BindingWithDefault"},{name:"binding",type:a(_,a(c,De))},{name:"init",type:pt}],A.typeName="Block",A.fields=[{name:"type",type:o(s),value:"Block"},{name:"statements",type:i(ft)}],k.typeName="BlockStatement",k.fields=[{name:"type",type:o(s),value:"BlockStatement"},{name:"block",type:A}],C.typeName="BreakStatement",C.fields=[{name:"type",type:o(s),value:"BreakStatement"},{name:"label",type:r(n)}],x.typeName="CallExpression",x.fields=[{name:"type",type:o(s),value:"CallExpression"},{name:"callee",type:a(pt,Be)},{name:"arguments",type:i(a(pt,Se))}],w.typeName="CatchClause",w.fields=[{name:"type",type:o(s),value:"CatchClause"},{name:"binding",type:a(_,a(c,De))},{name:"body",type:A}],S.typeName="ClassDeclaration",S.fields=[{name:"type",type:o(s),value:"ClassDeclaration"},{name:"name",type:_},{name:"super",type:r(pt)},{name:"elements",type:i(T)}],T.typeName="ClassElement",T.fields=[{name:"type",type:o(s),value:"ClassElement"},{name:"isStatic",type:t},{name:"method",type:st}],F.typeName="ClassExpression",F.fields=[{name:"type",type:o(s),value:"ClassExpression"},{name:"name",type:r(_)},{name:"super",type:r(pt)},{name:"elements",type:i(T)}],M.typeName="CompoundAssignmentExpression",M.fields=[{name:"type",type:o(s),value:"CompoundAssignmentExpression"},{name:"binding",type:a(h,ot)},{name:"operator",type:{typeName:"Enum",values:["+=","-=","*=","/=","%=","**=","<<=",">>=",">>>=","|=","^=","&="]}},{name:"expression",type:pt}],q.typeName="ComputedMemberAssignmentTarget",q.fields=[{name:"type",type:o(s),value:"ComputedMemberAssignmentTarget"},{name:"object",type:a(pt,Be)},{name:"expression",type:pt}],B.typeName="ComputedMemberExpression",B.fields=[{name:"type",type:o(s),value:"ComputedMemberExpression"},{name:"object",type:a(pt,Be)},{name:"expression",type:pt}],O.typeName="ComputedPropertyName",O.fields=[{name:"type",type:o(s),value:"ComputedPropertyName"},{name:"expression",type:pt}],P.typeName="ConditionalExpression",P.fields=[{name:"type",type:o(s),value:"ConditionalExpression"},{name:"test",type:pt},{name:"consequent",type:pt},{name:"alternate",type:pt}],I.typeName="ContinueStatement",I.fields=[{name:"type",type:o(s),value:"ContinueStatement"},{name:"label",type:r(n)}],N.typeName="DataProperty",N.fields=[{name:"type",type:o(s),value:"DataProperty"},{name:"name",type:nt},{name:"expression",type:pt}],R.typeName="DebuggerStatement",R.fields=[{name:"type",type:o(s),value:"DebuggerStatement"}],L.typeName="Directive",L.fields=[{name:"type",type:o(s),value:"Directive"},{name:"rawValue",type:n}],j.typeName="DoWhileStatement",j.fields=[{name:"type",type:o(s),value:"DoWhileStatement"},{name:"body",type:ft},{name:"test",type:pt}],W.typeName="EmptyStatement",W.fields=[{name:"type",type:o(s),value:"EmptyStatement"}],G.typeName="Export",G.fields=[{name:"type",type:o(s),value:"Export"},{name:"declaration",type:a(S,ne,ze)}],H.typeName="ExportAllFrom",H.fields=[{name:"type",type:o(s),value:"ExportAllFrom"},{name:"moduleSpecifier",type:n}],Z.typeName="ExportDefault",Z.fields=[{name:"type",type:o(s),value:"ExportDefault"},{name:"body",type:a(S,pt,ne)}],V.typeName="ExportFrom",V.fields=[{name:"type",type:o(s),value:"ExportFrom"},{name:"namedExports",type:i(z)},{name:"moduleSpecifier",type:n}],z.typeName="ExportFromSpecifier",z.fields=[{name:"type",type:o(s),value:"ExportFromSpecifier"},{name:"name",type:n},{name:"exportedName",type:r(n)}],U.typeName="ExportLocalSpecifier",U.fields=[{name:"type",type:o(s),value:"ExportLocalSpecifier"},{name:"name",type:oe},{name:"exportedName",type:r(n)}],Y.typeName="ExportLocals",Y.fields=[{name:"type",type:o(s),value:"ExportLocals"},{name:"namedExports",type:i(U)}],K.typeName="ExpressionStatement",K.fields=[{name:"type",type:o(s),value:"ExpressionStatement"},{name:"expression",type:pt}],X.typeName="ForAwaitStatement",X.fields=[{name:"type",type:o(s),value:"ForAwaitStatement"},{name:"left",type:a(a(a(u,be),a(h,ot)),ze)},{name:"right",type:pt},{name:"body",type:ft}],J.typeName="ForInStatement",J.fields=[{name:"type",type:o(s),value:"ForInStatement"},{name:"left",type:a(a(a(u,be),a(h,ot)),ze)},{name:"right",type:pt},{name:"body",type:ft}],Q.typeName="ForOfStatement",Q.fields=[{name:"type",type:o(s),value:"ForOfStatement"},{name:"left",type:a(a(a(u,be),a(h,ot)),ze)},{name:"right",type:pt},{name:"body",type:ft}],$.typeName="ForStatement",$.fields=[{name:"type",type:o(s),value:"ForStatement"},{name:"init",type:r(a(pt,ze))},{name:"test",type:r(pt)},{name:"update",type:r(pt)},{name:"body",type:ft}],ee.typeName="FormalParameters",ee.fields=[{name:"type",type:o(s),value:"FormalParameters"},{name:"items",type:i(a(D,a(_,a(c,De))))},{name:"rest",type:r(a(_,a(c,De)))}],te.typeName="FunctionBody",te.fields=[{name:"type",type:o(s),value:"FunctionBody"},{name:"directives",type:i(L)},{name:"statements",type:i(ft)}],ne.typeName="FunctionDeclaration",ne.fields=[{name:"type",type:o(s),value:"FunctionDeclaration"},{name:"isAsync",type:t},{name:"isGenerator",type:t},{name:"name",type:_},{name:"params",type:ee},{name:"body",type:te}],re.typeName="FunctionExpression",re.fields=[{name:"type",type:o(s),value:"FunctionExpression"},{name:"isAsync",type:t},{name:"isGenerator",type:t},{name:"name",type:r(_)},{name:"params",type:ee},{name:"body",type:te}],ie.typeName="Getter",ie.fields=[{name:"type",type:o(s),value:"Getter"},{name:"name",type:nt},{name:"body",type:te}],oe.typeName="IdentifierExpression",oe.fields=[{name:"type",type:o(s),value:"IdentifierExpression"},{name:"name",type:n}],ae.typeName="IfStatement",ae.fields=[{name:"type",type:o(s),value:"IfStatement"},{name:"test",type:pt},{name:"consequent",type:ft},{name:"alternate",type:r(ft)}],se.typeName="Import",se.fields=[{name:"type",type:o(s),value:"Import"},{name:"defaultBinding",type:r(_)},{name:"namedImports",type:i(ce)},{name:"moduleSpecifier",type:n}],ue.typeName="ImportNamespace",ue.fields=[{name:"type",type:o(s),value:"ImportNamespace"},{name:"defaultBinding",type:r(_)},{name:"namespaceBinding",type:_},{name:"moduleSpecifier",type:n}],ce.typeName="ImportSpecifier",ce.fields=[{name:"type",type:o(s),value:"ImportSpecifier"},{name:"name",type:r(n)},{name:"binding",type:_}],le.typeName="LabeledStatement",le.fields=[{name:"type",type:o(s),value:"LabeledStatement"},{name:"label",type:n},{name:"body",type:ft}],pe.typeName="LiteralBooleanExpression",pe.fields=[{name:"type",type:o(s),value:"LiteralBooleanExpression"},{name:"value",type:t}],fe.typeName="LiteralInfinityExpression",fe.fields=[{name:"type",type:o(s),value:"LiteralInfinityExpression"}],he.typeName="LiteralNullExpression",he.fields=[{name:"type",type:o(s),value:"LiteralNullExpression"}],de.typeName="LiteralNumericExpression",de.fields=[{name:"type",type:o(s),value:"LiteralNumericExpression"},{name:"value",type:{typeName:"Number"}}],me.typeName="LiteralRegExpExpression",me.fields=[{name:"type",type:o(s),value:"LiteralRegExpExpression"},{name:"pattern",type:n},{name:"global",type:t},{name:"ignoreCase",type:t},{name:"multiLine",type:t},{name:"dotAll",type:t},{name:"unicode",type:t},{name:"sticky",type:t}],ve.typeName="LiteralStringExpression",ve.fields=[{name:"type",type:o(s),value:"LiteralStringExpression"},{name:"value",type:n}],ye.typeName="Method",ye.fields=[{name:"type",type:o(s),value:"Method"},{name:"isAsync",type:t},{name:"isGenerator",type:t},{name:"name",type:nt},{name:"params",type:ee},{name:"body",type:te}],ge.typeName="Module",ge.fields=[{name:"type",type:o(s),value:"Module"},{name:"directives",type:i(L)},{name:"items",type:i(a(tt,rt,ft))}],_e.typeName="NewExpression",_e.fields=[{name:"type",type:o(s),value:"NewExpression"},{name:"callee",type:pt},{name:"arguments",type:i(a(pt,Se))}],Ee.typeName="NewTargetExpression",Ee.fields=[{name:"type",type:o(s),value:"NewTargetExpression"}],be.typeName="ObjectAssignmentTarget",be.fields=[{name:"type",type:o(s),value:"ObjectAssignmentTarget"},{name:"properties",type:i(et)},{name:"rest",type:r(a(a(u,be),a(h,ot)))}],De.typeName="ObjectBinding",De.fields=[{name:"type",type:o(s),value:"ObjectBinding"},{name:"properties",type:i(at)},{name:"rest",type:r(a(_,a(c,De)))}],Ae.typeName="ObjectExpression",Ae.fields=[{name:"type",type:o(s),value:"ObjectExpression"},{name:"properties",type:i(ht)}],ke.typeName="ReturnStatement",ke.fields=[{name:"type",type:o(s),value:"ReturnStatement"},{name:"expression",type:r(pt)}],Ce.typeName="Script",Ce.fields=[{name:"type",type:o(s),value:"Script"},{name:"directives",type:i(L)},{name:"statements",type:i(ft)}],xe.typeName="Setter",xe.fields=[{name:"type",type:o(s),value:"Setter"},{name:"name",type:nt},{name:"param",type:a(D,a(_,a(c,De)))},{name:"body",type:te}],we.typeName="ShorthandProperty",we.fields=[{name:"type",type:o(s),value:"ShorthandProperty"},{name:"name",type:oe}],Se.typeName="SpreadElement",Se.fields=[{name:"type",type:o(s),value:"SpreadElement"},{name:"expression",type:pt}],Te.typeName="SpreadProperty",Te.fields=[{name:"type",type:o(s),value:"SpreadProperty"},{name:"expression",type:pt}],Fe.typeName="StaticMemberAssignmentTarget",Fe.fields=[{name:"type",type:o(s),value:"StaticMemberAssignmentTarget"},{name:"object",type:a(pt,Be)},{name:"property",type:n}],Me.typeName="StaticMemberExpression",Me.fields=[{name:"type",type:o(s),value:"StaticMemberExpression"},{name:"object",type:a(pt,Be)},{name:"property",type:n}],qe.typeName="StaticPropertyName",qe.fields=[{name:"type",type:o(s),value:"StaticPropertyName"},{name:"value",type:n}],Be.typeName="Super",Be.fields=[{name:"type",type:o(s),value:"Super"}],Oe.typeName="SwitchCase",Oe.fields=[{name:"type",type:o(s),value:"SwitchCase"},{name:"test",type:pt},{name:"consequent",type:i(ft)}],Pe.typeName="SwitchDefault",Pe.fields=[{name:"type",type:o(s),value:"SwitchDefault"},{name:"consequent",type:i(ft)}],Ie.typeName="SwitchStatement",Ie.fields=[{name:"type",type:o(s),value:"SwitchStatement"},{name:"discriminant",type:pt},{name:"cases",type:i(Oe)}],Ne.typeName="SwitchStatementWithDefault",Ne.fields=[{name:"type",type:o(s),value:"SwitchStatementWithDefault"},{name:"discriminant",type:pt},{name:"preDefaultCases",type:i(Oe)},{name:"defaultCase",type:Pe},{name:"postDefaultCases",type:i(Oe)}],Re.typeName="TemplateElement",Re.fields=[{name:"type",type:o(s),value:"TemplateElement"},{name:"rawValue",type:n}],Le.typeName="TemplateExpression",Le.fields=[{name:"type",type:o(s),value:"TemplateExpression"},{name:"tag",type:r(pt)},{name:"elements",type:i(a(pt,Re))}],je.typeName="ThisExpression",je.fields=[{name:"type",type:o(s),value:"ThisExpression"}],We.typeName="ThrowStatement",We.fields=[{name:"type",type:o(s),value:"ThrowStatement"},{name:"expression",type:pt}],Ge.typeName="TryCatchStatement",Ge.fields=[{name:"type",type:o(s),value:"TryCatchStatement"},{name:"body",type:A},{name:"catchClause",type:w}],He.typeName="TryFinallyStatement",He.fields=[{name:"type",type:o(s),value:"TryFinallyStatement"},{name:"body",type:A},{name:"catchClause",type:r(w)},{name:"finalizer",type:A}],Ze.typeName="UnaryExpression",Ze.fields=[{name:"type",type:o(s),value:"UnaryExpression"},{name:"operator",type:{typeName:"Enum",values:["+","-","!","~","typeof","void","delete"]}},{name:"operand",type:pt}],Ve.typeName="UpdateExpression",Ve.fields=[{name:"type",type:o(s),value:"UpdateExpression"},{name:"isPrefix",type:t},{name:"operator",type:{typeName:"Enum",values:["++","--"]}},{name:"operand",type:a(h,ot)}],ze.typeName="VariableDeclaration",ze.fields=[{name:"type",type:o(s),value:"VariableDeclaration"},{name:"kind",type:{typeName:"Enum",values:["var","let","const"]}},{name:"declarators",type:i(Ye)}],Ue.typeName="VariableDeclarationStatement",Ue.fields=[{name:"type",type:o(s),value:"VariableDeclarationStatement"},{name:"declaration",type:ze}],Ye.typeName="VariableDeclarator",Ye.fields=[{name:"type",type:o(s),value:"VariableDeclarator"},{name:"binding",type:a(_,a(c,De))},{name:"init",type:r(pt)}],Ke.typeName="WhileStatement",Ke.fields=[{name:"type",type:o(s),value:"WhileStatement"},{name:"test",type:pt},{name:"body",type:ft}],Xe.typeName="WithStatement",Xe.fields=[{name:"type",type:o(s),value:"WithStatement"},{name:"object",type:pt},{name:"body",type:ft}],Je.typeName="YieldExpression",Je.fields=[{name:"type",type:o(s),value:"YieldExpression"},{name:"expression",type:r(pt)}],Qe.typeName="YieldGeneratorExpression",Qe.fields=[{name:"type",type:o(s),value:"YieldGeneratorExpression"},{name:"expression",type:pt}],e}()},8026:function(e){e.exports=new Set(["General_Category","Script","Script_Extensions","Alphabetic","Any","ASCII","ASCII_Hex_Digit","Assigned","Bidi_Control","Bidi_Mirrored","Case_Ignorable","Cased","Changes_When_Casefolded","Changes_When_Casemapped","Changes_When_Lowercased","Changes_When_NFKC_Casefolded","Changes_When_Titlecased","Changes_When_Uppercased","Dash","Default_Ignorable_Code_Point","Deprecated","Diacritic","Emoji","Emoji_Component","Emoji_Modifier","Emoji_Modifier_Base","Emoji_Presentation","Extended_Pictographic","Extender","Grapheme_Base","Grapheme_Extend","Hex_Digit","ID_Continue","ID_Start","Ideographic","IDS_Binary_Operator","IDS_Trinary_Operator","Join_Control","Logical_Order_Exception","Lowercase","Math","Noncharacter_Code_Point","Pattern_Syntax","Pattern_White_Space","Quotation_Mark","Radical","Regional_Indicator","Sentence_Terminal","Soft_Dotted","Terminal_Punctuation","Unified_Ideograph","Uppercase","Variation_Selector","White_Space","XID_Continue","XID_Start"])},6847:function(e,t,n){"use strict";var r=n(8026),i=n(3185);e.exports=function(e){if(r.has(e))return e;if(i.has(e))return i.get(e);throw new Error("Unknown property: ".concat(e))}},9222:function(e){e.exports=new Map([["General_Category",new Map([["C","Other"],["Cc","Control"],["cntrl","Control"],["Cf","Format"],["Cn","Unassigned"],["Co","Private_Use"],["Cs","Surrogate"],["L","Letter"],["LC","Cased_Letter"],["Ll","Lowercase_Letter"],["Lm","Modifier_Letter"],["Lo","Other_Letter"],["Lt","Titlecase_Letter"],["Lu","Uppercase_Letter"],["M","Mark"],["Combining_Mark","Mark"],["Mc","Spacing_Mark"],["Me","Enclosing_Mark"],["Mn","Nonspacing_Mark"],["N","Number"],["Nd","Decimal_Number"],["digit","Decimal_Number"],["Nl","Letter_Number"],["No","Other_Number"],["P","Punctuation"],["punct","Punctuation"],["Pc","Connector_Punctuation"],["Pd","Dash_Punctuation"],["Pe","Close_Punctuation"],["Pf","Final_Punctuation"],["Pi","Initial_Punctuation"],["Po","Other_Punctuation"],["Ps","Open_Punctuation"],["S","Symbol"],["Sc","Currency_Symbol"],["Sk","Modifier_Symbol"],["Sm","Math_Symbol"],["So","Other_Symbol"],["Z","Separator"],["Zl","Line_Separator"],["Zp","Paragraph_Separator"],["Zs","Space_Separator"],["Other","Other"],["Control","Control"],["Format","Format"],["Unassigned","Unassigned"],["Private_Use","Private_Use"],["Surrogate","Surrogate"],["Letter","Letter"],["Cased_Letter","Cased_Letter"],["Lowercase_Letter","Lowercase_Letter"],["Modifier_Letter","Modifier_Letter"],["Other_Letter","Other_Letter"],["Titlecase_Letter","Titlecase_Letter"],["Uppercase_Letter","Uppercase_Letter"],["Mark","Mark"],["Spacing_Mark","Spacing_Mark"],["Enclosing_Mark","Enclosing_Mark"],["Nonspacing_Mark","Nonspacing_Mark"],["Number","Number"],["Decimal_Number","Decimal_Number"],["Letter_Number","Letter_Number"],["Other_Number","Other_Number"],["Punctuation","Punctuation"],["Connector_Punctuation","Connector_Punctuation"],["Dash_Punctuation","Dash_Punctuation"],["Close_Punctuation","Close_Punctuation"],["Final_Punctuation","Final_Punctuation"],["Initial_Punctuation","Initial_Punctuation"],["Other_Punctuation","Other_Punctuation"],["Open_Punctuation","Open_Punctuation"],["Symbol","Symbol"],["Currency_Symbol","Currency_Symbol"],["Modifier_Symbol","Modifier_Symbol"],["Math_Symbol","Math_Symbol"],["Other_Symbol","Other_Symbol"],["Separator","Separator"],["Line_Separator","Line_Separator"],["Paragraph_Separator","Paragraph_Separator"],["Space_Separator","Space_Separator"]])],["Script",new Map([["Adlm","Adlam"],["Aghb","Caucasian_Albanian"],["Ahom","Ahom"],["Arab","Arabic"],["Armi","Imperial_Aramaic"],["Armn","Armenian"],["Avst","Avestan"],["Bali","Balinese"],["Bamu","Bamum"],["Bass","Bassa_Vah"],["Batk","Batak"],["Beng","Bengali"],["Bhks","Bhaiksuki"],["Bopo","Bopomofo"],["Brah","Brahmi"],["Brai","Braille"],["Bugi","Buginese"],["Buhd","Buhid"],["Cakm","Chakma"],["Cans","Canadian_Aboriginal"],["Cari","Carian"],["Cham","Cham"],["Cher","Cherokee"],["Copt","Coptic"],["Qaac","Coptic"],["Cprt","Cypriot"],["Cyrl","Cyrillic"],["Deva","Devanagari"],["Dogr","Dogra"],["Dsrt","Deseret"],["Dupl","Duployan"],["Egyp","Egyptian_Hieroglyphs"],["Elba","Elbasan"],["Ethi","Ethiopic"],["Geor","Georgian"],["Glag","Glagolitic"],["Gong","Gunjala_Gondi"],["Gonm","Masaram_Gondi"],["Goth","Gothic"],["Gran","Grantha"],["Grek","Greek"],["Gujr","Gujarati"],["Guru","Gurmukhi"],["Hang","Hangul"],["Hani","Han"],["Hano","Hanunoo"],["Hatr","Hatran"],["Hebr","Hebrew"],["Hira","Hiragana"],["Hluw","Anatolian_Hieroglyphs"],["Hmng","Pahawh_Hmong"],["Hrkt","Katakana_Or_Hiragana"],["Hung","Old_Hungarian"],["Ital","Old_Italic"],["Java","Javanese"],["Kali","Kayah_Li"],["Kana","Katakana"],["Khar","Kharoshthi"],["Khmr","Khmer"],["Khoj","Khojki"],["Knda","Kannada"],["Kthi","Kaithi"],["Lana","Tai_Tham"],["Laoo","Lao"],["Latn","Latin"],["Lepc","Lepcha"],["Limb","Limbu"],["Lina","Linear_A"],["Linb","Linear_B"],["Lisu","Lisu"],["Lyci","Lycian"],["Lydi","Lydian"],["Mahj","Mahajani"],["Maka","Makasar"],["Mand","Mandaic"],["Mani","Manichaean"],["Marc","Marchen"],["Medf","Medefaidrin"],["Mend","Mende_Kikakui"],["Merc","Meroitic_Cursive"],["Mero","Meroitic_Hieroglyphs"],["Mlym","Malayalam"],["Modi","Modi"],["Mong","Mongolian"],["Mroo","Mro"],["Mtei","Meetei_Mayek"],["Mult","Multani"],["Mymr","Myanmar"],["Narb","Old_North_Arabian"],["Nbat","Nabataean"],["Newa","Newa"],["Nkoo","Nko"],["Nshu","Nushu"],["Ogam","Ogham"],["Olck","Ol_Chiki"],["Orkh","Old_Turkic"],["Orya","Oriya"],["Osge","Osage"],["Osma","Osmanya"],["Palm","Palmyrene"],["Pauc","Pau_Cin_Hau"],["Perm","Old_Permic"],["Phag","Phags_Pa"],["Phli","Inscriptional_Pahlavi"],["Phlp","Psalter_Pahlavi"],["Phnx","Phoenician"],["Plrd","Miao"],["Prti","Inscriptional_Parthian"],["Rjng","Rejang"],["Rohg","Hanifi_Rohingya"],["Runr","Runic"],["Samr","Samaritan"],["Sarb","Old_South_Arabian"],["Saur","Saurashtra"],["Sgnw","SignWriting"],["Shaw","Shavian"],["Shrd","Sharada"],["Sidd","Siddham"],["Sind","Khudawadi"],["Sinh","Sinhala"],["Sogd","Sogdian"],["Sogo","Old_Sogdian"],["Sora","Sora_Sompeng"],["Soyo","Soyombo"],["Sund","Sundanese"],["Sylo","Syloti_Nagri"],["Syrc","Syriac"],["Tagb","Tagbanwa"],["Takr","Takri"],["Tale","Tai_Le"],["Talu","New_Tai_Lue"],["Taml","Tamil"],["Tang","Tangut"],["Tavt","Tai_Viet"],["Telu","Telugu"],["Tfng","Tifinagh"],["Tglg","Tagalog"],["Thaa","Thaana"],["Thai","Thai"],["Tibt","Tibetan"],["Tirh","Tirhuta"],["Ugar","Ugaritic"],["Vaii","Vai"],["Wara","Warang_Citi"],["Xpeo","Old_Persian"],["Xsux","Cuneiform"],["Yiii","Yi"],["Zanb","Zanabazar_Square"],["Zinh","Inherited"],["Qaai","Inherited"],["Zyyy","Common"],["Zzzz","Unknown"],["Adlam","Adlam"],["Caucasian_Albanian","Caucasian_Albanian"],["Arabic","Arabic"],["Imperial_Aramaic","Imperial_Aramaic"],["Armenian","Armenian"],["Avestan","Avestan"],["Balinese","Balinese"],["Bamum","Bamum"],["Bassa_Vah","Bassa_Vah"],["Batak","Batak"],["Bengali","Bengali"],["Bhaiksuki","Bhaiksuki"],["Bopomofo","Bopomofo"],["Brahmi","Brahmi"],["Braille","Braille"],["Buginese","Buginese"],["Buhid","Buhid"],["Chakma","Chakma"],["Canadian_Aboriginal","Canadian_Aboriginal"],["Carian","Carian"],["Cherokee","Cherokee"],["Coptic","Coptic"],["Cypriot","Cypriot"],["Cyrillic","Cyrillic"],["Devanagari","Devanagari"],["Dogra","Dogra"],["Deseret","Deseret"],["Duployan","Duployan"],["Egyptian_Hieroglyphs","Egyptian_Hieroglyphs"],["Elbasan","Elbasan"],["Ethiopic","Ethiopic"],["Georgian","Georgian"],["Glagolitic","Glagolitic"],["Gunjala_Gondi","Gunjala_Gondi"],["Masaram_Gondi","Masaram_Gondi"],["Gothic","Gothic"],["Grantha","Grantha"],["Greek","Greek"],["Gujarati","Gujarati"],["Gurmukhi","Gurmukhi"],["Hangul","Hangul"],["Han","Han"],["Hanunoo","Hanunoo"],["Hatran","Hatran"],["Hebrew","Hebrew"],["Hiragana","Hiragana"],["Anatolian_Hieroglyphs","Anatolian_Hieroglyphs"],["Pahawh_Hmong","Pahawh_Hmong"],["Katakana_Or_Hiragana","Katakana_Or_Hiragana"],["Old_Hungarian","Old_Hungarian"],["Old_Italic","Old_Italic"],["Javanese","Javanese"],["Kayah_Li","Kayah_Li"],["Katakana","Katakana"],["Kharoshthi","Kharoshthi"],["Khmer","Khmer"],["Khojki","Khojki"],["Kannada","Kannada"],["Kaithi","Kaithi"],["Tai_Tham","Tai_Tham"],["Lao","Lao"],["Latin","Latin"],["Lepcha","Lepcha"],["Limbu","Limbu"],["Linear_A","Linear_A"],["Linear_B","Linear_B"],["Lycian","Lycian"],["Lydian","Lydian"],["Mahajani","Mahajani"],["Makasar","Makasar"],["Mandaic","Mandaic"],["Manichaean","Manichaean"],["Marchen","Marchen"],["Medefaidrin","Medefaidrin"],["Mende_Kikakui","Mende_Kikakui"],["Meroitic_Cursive","Meroitic_Cursive"],["Meroitic_Hieroglyphs","Meroitic_Hieroglyphs"],["Malayalam","Malayalam"],["Mongolian","Mongolian"],["Mro","Mro"],["Meetei_Mayek","Meetei_Mayek"],["Multani","Multani"],["Myanmar","Myanmar"],["Old_North_Arabian","Old_North_Arabian"],["Nabataean","Nabataean"],["Nko","Nko"],["Nushu","Nushu"],["Ogham","Ogham"],["Ol_Chiki","Ol_Chiki"],["Old_Turkic","Old_Turkic"],["Oriya","Oriya"],["Osage","Osage"],["Osmanya","Osmanya"],["Palmyrene","Palmyrene"],["Pau_Cin_Hau","Pau_Cin_Hau"],["Old_Permic","Old_Permic"],["Phags_Pa","Phags_Pa"],["Inscriptional_Pahlavi","Inscriptional_Pahlavi"],["Psalter_Pahlavi","Psalter_Pahlavi"],["Phoenician","Phoenician"],["Miao","Miao"],["Inscriptional_Parthian","Inscriptional_Parthian"],["Rejang","Rejang"],["Hanifi_Rohingya","Hanifi_Rohingya"],["Runic","Runic"],["Samaritan","Samaritan"],["Old_South_Arabian","Old_South_Arabian"],["Saurashtra","Saurashtra"],["SignWriting","SignWriting"],["Shavian","Shavian"],["Sharada","Sharada"],["Siddham","Siddham"],["Khudawadi","Khudawadi"],["Sinhala","Sinhala"],["Sogdian","Sogdian"],["Old_Sogdian","Old_Sogdian"],["Sora_Sompeng","Sora_Sompeng"],["Soyombo","Soyombo"],["Sundanese","Sundanese"],["Syloti_Nagri","Syloti_Nagri"],["Syriac","Syriac"],["Tagbanwa","Tagbanwa"],["Takri","Takri"],["Tai_Le","Tai_Le"],["New_Tai_Lue","New_Tai_Lue"],["Tamil","Tamil"],["Tangut","Tangut"],["Tai_Viet","Tai_Viet"],["Telugu","Telugu"],["Tifinagh","Tifinagh"],["Tagalog","Tagalog"],["Thaana","Thaana"],["Tibetan","Tibetan"],["Tirhuta","Tirhuta"],["Ugaritic","Ugaritic"],["Vai","Vai"],["Warang_Citi","Warang_Citi"],["Old_Persian","Old_Persian"],["Cuneiform","Cuneiform"],["Yi","Yi"],["Zanabazar_Square","Zanabazar_Square"],["Inherited","Inherited"],["Common","Common"],["Unknown","Unknown"]])],["Script_Extensions",new Map([["Adlm","Adlam"],["Aghb","Caucasian_Albanian"],["Ahom","Ahom"],["Arab","Arabic"],["Armi","Imperial_Aramaic"],["Armn","Armenian"],["Avst","Avestan"],["Bali","Balinese"],["Bamu","Bamum"],["Bass","Bassa_Vah"],["Batk","Batak"],["Beng","Bengali"],["Bhks","Bhaiksuki"],["Bopo","Bopomofo"],["Brah","Brahmi"],["Brai","Braille"],["Bugi","Buginese"],["Buhd","Buhid"],["Cakm","Chakma"],["Cans","Canadian_Aboriginal"],["Cari","Carian"],["Cham","Cham"],["Cher","Cherokee"],["Copt","Coptic"],["Qaac","Coptic"],["Cprt","Cypriot"],["Cyrl","Cyrillic"],["Deva","Devanagari"],["Dogr","Dogra"],["Dsrt","Deseret"],["Dupl","Duployan"],["Egyp","Egyptian_Hieroglyphs"],["Elba","Elbasan"],["Ethi","Ethiopic"],["Geor","Georgian"],["Glag","Glagolitic"],["Gong","Gunjala_Gondi"],["Gonm","Masaram_Gondi"],["Goth","Gothic"],["Gran","Grantha"],["Grek","Greek"],["Gujr","Gujarati"],["Guru","Gurmukhi"],["Hang","Hangul"],["Hani","Han"],["Hano","Hanunoo"],["Hatr","Hatran"],["Hebr","Hebrew"],["Hira","Hiragana"],["Hluw","Anatolian_Hieroglyphs"],["Hmng","Pahawh_Hmong"],["Hrkt","Katakana_Or_Hiragana"],["Hung","Old_Hungarian"],["Ital","Old_Italic"],["Java","Javanese"],["Kali","Kayah_Li"],["Kana","Katakana"],["Khar","Kharoshthi"],["Khmr","Khmer"],["Khoj","Khojki"],["Knda","Kannada"],["Kthi","Kaithi"],["Lana","Tai_Tham"],["Laoo","Lao"],["Latn","Latin"],["Lepc","Lepcha"],["Limb","Limbu"],["Lina","Linear_A"],["Linb","Linear_B"],["Lisu","Lisu"],["Lyci","Lycian"],["Lydi","Lydian"],["Mahj","Mahajani"],["Maka","Makasar"],["Mand","Mandaic"],["Mani","Manichaean"],["Marc","Marchen"],["Medf","Medefaidrin"],["Mend","Mende_Kikakui"],["Merc","Meroitic_Cursive"],["Mero","Meroitic_Hieroglyphs"],["Mlym","Malayalam"],["Modi","Modi"],["Mong","Mongolian"],["Mroo","Mro"],["Mtei","Meetei_Mayek"],["Mult","Multani"],["Mymr","Myanmar"],["Narb","Old_North_Arabian"],["Nbat","Nabataean"],["Newa","Newa"],["Nkoo","Nko"],["Nshu","Nushu"],["Ogam","Ogham"],["Olck","Ol_Chiki"],["Orkh","Old_Turkic"],["Orya","Oriya"],["Osge","Osage"],["Osma","Osmanya"],["Palm","Palmyrene"],["Pauc","Pau_Cin_Hau"],["Perm","Old_Permic"],["Phag","Phags_Pa"],["Phli","Inscriptional_Pahlavi"],["Phlp","Psalter_Pahlavi"],["Phnx","Phoenician"],["Plrd","Miao"],["Prti","Inscriptional_Parthian"],["Rjng","Rejang"],["Rohg","Hanifi_Rohingya"],["Runr","Runic"],["Samr","Samaritan"],["Sarb","Old_South_Arabian"],["Saur","Saurashtra"],["Sgnw","SignWriting"],["Shaw","Shavian"],["Shrd","Sharada"],["Sidd","Siddham"],["Sind","Khudawadi"],["Sinh","Sinhala"],["Sogd","Sogdian"],["Sogo","Old_Sogdian"],["Sora","Sora_Sompeng"],["Soyo","Soyombo"],["Sund","Sundanese"],["Sylo","Syloti_Nagri"],["Syrc","Syriac"],["Tagb","Tagbanwa"],["Takr","Takri"],["Tale","Tai_Le"],["Talu","New_Tai_Lue"],["Taml","Tamil"],["Tang","Tangut"],["Tavt","Tai_Viet"],["Telu","Telugu"],["Tfng","Tifinagh"],["Tglg","Tagalog"],["Thaa","Thaana"],["Thai","Thai"],["Tibt","Tibetan"],["Tirh","Tirhuta"],["Ugar","Ugaritic"],["Vaii","Vai"],["Wara","Warang_Citi"],["Xpeo","Old_Persian"],["Xsux","Cuneiform"],["Yiii","Yi"],["Zanb","Zanabazar_Square"],["Zinh","Inherited"],["Qaai","Inherited"],["Zyyy","Common"],["Zzzz","Unknown"],["Adlam","Adlam"],["Caucasian_Albanian","Caucasian_Albanian"],["Arabic","Arabic"],["Imperial_Aramaic","Imperial_Aramaic"],["Armenian","Armenian"],["Avestan","Avestan"],["Balinese","Balinese"],["Bamum","Bamum"],["Bassa_Vah","Bassa_Vah"],["Batak","Batak"],["Bengali","Bengali"],["Bhaiksuki","Bhaiksuki"],["Bopomofo","Bopomofo"],["Brahmi","Brahmi"],["Braille","Braille"],["Buginese","Buginese"],["Buhid","Buhid"],["Chakma","Chakma"],["Canadian_Aboriginal","Canadian_Aboriginal"],["Carian","Carian"],["Cherokee","Cherokee"],["Coptic","Coptic"],["Cypriot","Cypriot"],["Cyrillic","Cyrillic"],["Devanagari","Devanagari"],["Dogra","Dogra"],["Deseret","Deseret"],["Duployan","Duployan"],["Egyptian_Hieroglyphs","Egyptian_Hieroglyphs"],["Elbasan","Elbasan"],["Ethiopic","Ethiopic"],["Georgian","Georgian"],["Glagolitic","Glagolitic"],["Gunjala_Gondi","Gunjala_Gondi"],["Masaram_Gondi","Masaram_Gondi"],["Gothic","Gothic"],["Grantha","Grantha"],["Greek","Greek"],["Gujarati","Gujarati"],["Gurmukhi","Gurmukhi"],["Hangul","Hangul"],["Han","Han"],["Hanunoo","Hanunoo"],["Hatran","Hatran"],["Hebrew","Hebrew"],["Hiragana","Hiragana"],["Anatolian_Hieroglyphs","Anatolian_Hieroglyphs"],["Pahawh_Hmong","Pahawh_Hmong"],["Katakana_Or_Hiragana","Katakana_Or_Hiragana"],["Old_Hungarian","Old_Hungarian"],["Old_Italic","Old_Italic"],["Javanese","Javanese"],["Kayah_Li","Kayah_Li"],["Katakana","Katakana"],["Kharoshthi","Kharoshthi"],["Khmer","Khmer"],["Khojki","Khojki"],["Kannada","Kannada"],["Kaithi","Kaithi"],["Tai_Tham","Tai_Tham"],["Lao","Lao"],["Latin","Latin"],["Lepcha","Lepcha"],["Limbu","Limbu"],["Linear_A","Linear_A"],["Linear_B","Linear_B"],["Lycian","Lycian"],["Lydian","Lydian"],["Mahajani","Mahajani"],["Makasar","Makasar"],["Mandaic","Mandaic"],["Manichaean","Manichaean"],["Marchen","Marchen"],["Medefaidrin","Medefaidrin"],["Mende_Kikakui","Mende_Kikakui"],["Meroitic_Cursive","Meroitic_Cursive"],["Meroitic_Hieroglyphs","Meroitic_Hieroglyphs"],["Malayalam","Malayalam"],["Mongolian","Mongolian"],["Mro","Mro"],["Meetei_Mayek","Meetei_Mayek"],["Multani","Multani"],["Myanmar","Myanmar"],["Old_North_Arabian","Old_North_Arabian"],["Nabataean","Nabataean"],["Nko","Nko"],["Nushu","Nushu"],["Ogham","Ogham"],["Ol_Chiki","Ol_Chiki"],["Old_Turkic","Old_Turkic"],["Oriya","Oriya"],["Osage","Osage"],["Osmanya","Osmanya"],["Palmyrene","Palmyrene"],["Pau_Cin_Hau","Pau_Cin_Hau"],["Old_Permic","Old_Permic"],["Phags_Pa","Phags_Pa"],["Inscriptional_Pahlavi","Inscriptional_Pahlavi"],["Psalter_Pahlavi","Psalter_Pahlavi"],["Phoenician","Phoenician"],["Miao","Miao"],["Inscriptional_Parthian","Inscriptional_Parthian"],["Rejang","Rejang"],["Hanifi_Rohingya","Hanifi_Rohingya"],["Runic","Runic"],["Samaritan","Samaritan"],["Old_South_Arabian","Old_South_Arabian"],["Saurashtra","Saurashtra"],["SignWriting","SignWriting"],["Shavian","Shavian"],["Sharada","Sharada"],["Siddham","Siddham"],["Khudawadi","Khudawadi"],["Sinhala","Sinhala"],["Sogdian","Sogdian"],["Old_Sogdian","Old_Sogdian"],["Sora_Sompeng","Sora_Sompeng"],["Soyombo","Soyombo"],["Sundanese","Sundanese"],["Syloti_Nagri","Syloti_Nagri"],["Syriac","Syriac"],["Tagbanwa","Tagbanwa"],["Takri","Takri"],["Tai_Le","Tai_Le"],["New_Tai_Lue","New_Tai_Lue"],["Tamil","Tamil"],["Tangut","Tangut"],["Tai_Viet","Tai_Viet"],["Telugu","Telugu"],["Tifinagh","Tifinagh"],["Tagalog","Tagalog"],["Thaana","Thaana"],["Tibetan","Tibetan"],["Tirhuta","Tirhuta"],["Ugaritic","Ugaritic"],["Vai","Vai"],["Warang_Citi","Warang_Citi"],["Old_Persian","Old_Persian"],["Cuneiform","Cuneiform"],["Yi","Yi"],["Zanabazar_Square","Zanabazar_Square"],["Inherited","Inherited"],["Common","Common"],["Unknown","Unknown"]])]])},826:function(e,t,n){"use strict";var r=n(9222);e.exports=function(e,t){var n=r.get(e);if(!n)throw new Error("Unknown property `".concat(e,"`."));var i=n.get(t);if(i)return i;throw new Error("Unknown value `".concat(t,"` for property `").concat(e,"`."))}},3185:function(e){e.exports=new Map([["scx","Script_Extensions"],["sc","Script"],["gc","General_Category"],["AHex","ASCII_Hex_Digit"],["Alpha","Alphabetic"],["Bidi_C","Bidi_Control"],["Bidi_M","Bidi_Mirrored"],["Cased","Cased"],["CI","Case_Ignorable"],["CWCF","Changes_When_Casefolded"],["CWCM","Changes_When_Casemapped"],["CWKCF","Changes_When_NFKC_Casefolded"],["CWL","Changes_When_Lowercased"],["CWT","Changes_When_Titlecased"],["CWU","Changes_When_Uppercased"],["Dash","Dash"],["Dep","Deprecated"],["DI","Default_Ignorable_Code_Point"],["Dia","Diacritic"],["Ext","Extender"],["Gr_Base","Grapheme_Base"],["Gr_Ext","Grapheme_Extend"],["Hex","Hex_Digit"],["IDC","ID_Continue"],["Ideo","Ideographic"],["IDS","ID_Start"],["IDSB","IDS_Binary_Operator"],["IDST","IDS_Trinary_Operator"],["Join_C","Join_Control"],["LOE","Logical_Order_Exception"],["Lower","Lowercase"],["Math","Math"],["NChar","Noncharacter_Code_Point"],["Pat_Syn","Pattern_Syntax"],["Pat_WS","Pattern_White_Space"],["QMark","Quotation_Mark"],["Radical","Radical"],["RI","Regional_Indicator"],["SD","Soft_Dotted"],["STerm","Sentence_Terminal"],["Term","Terminal_Punctuation"],["UIdeo","Unified_Ideograph"],["Upper","Uppercase"],["VS","Variation_Selector"],["WSpace","White_Space"],["space","White_Space"],["XIDC","XID_Continue"],["XIDS","XID_Start"]])},8345:function(e,t,n){!function(e,t,n,r){"use strict";function i(e){return e&&"object"===typeof e&&"default"in e?e:{default:e}}var o=i(t),a=i(n),s=i(r),u=function(e,t,n){return{endTime:t,insertTime:n,type:"exponentialRampToValue",value:e}},c=function(e,t,n){return{endTime:t,insertTime:n,type:"linearRampToValue",value:e}},l=function(e,t){return{startTime:t,type:"setValue",value:e}},p=function(e,t,n){return{duration:n,startTime:t,type:"setValueCurve",values:e}},f=function(e,t,n){var r=n.startTime,i=n.target,o=n.timeConstant;return i+(t-i)*Math.exp((r-e)/o)},h=function(e){return"exponentialRampToValue"===e.type},d=function(e){return"linearRampToValue"===e.type},m=function(e){return h(e)||d(e)},v=function(e){return"setValue"===e.type},y=function(e){return"setValueCurve"===e.type},g=function e(t,n,r,i){var o=t[n];return void 0===o?i:m(o)||v(o)?o.value:y(o)?o.values[o.values.length-1]:f(r,e(t,n-1,o.startTime,i),o)},_=function(e,t,n,r,i){return void 0===n?[r.insertTime,i]:m(n)?[n.endTime,n.value]:v(n)?[n.startTime,n.value]:y(n)?[n.startTime+n.duration,n.values[n.values.length-1]]:[n.startTime,g(e,t-1,n.startTime,i)]},E=function(e){return"cancelAndHold"===e.type},b=function(e){return"cancelScheduledValues"===e.type},D=function(e){return E(e)||b(e)?e.cancelTime:h(e)||d(e)?e.endTime:e.startTime},A=function(e,t,n,r){var i=r.endTime,o=r.value;return n===o?o:0=t:D(n)>=t})),r=this._automationEvents[n];if(-1!==n&&(this._automationEvents=this._automationEvents.slice(0,n)),E(e)){var i=this._automationEvents[this._automationEvents.length-1];if(void 0!==r&&m(r)){if(w(i))throw new Error("The internal list is malformed.");var o=y(i)?i.startTime+i.duration:D(i),a=y(i)?i.values[i.values.length-1]:i.value,s=h(r)?A(t,o,a,r):k(t,o,a,r),f=h(r)?u(s,t,this._currenTime):c(s,t,this._currenTime);this._automationEvents.push(f)}void 0!==i&&w(i)&&this._automationEvents.push(l(this.getValue(t),t)),void 0!==i&&y(i)&&i.startTime+i.duration>t&&(this._automationEvents[this._automationEvents.length-1]=p(new Float32Array([6,7]),i.startTime,t-i.startTime))}}else{var v=this._automationEvents.findIndex((function(e){return D(e)>t})),g=-1===v?this._automationEvents[this._automationEvents.length-1]:this._automationEvents[v-1];if(void 0!==g&&y(g)&&D(g)+g.duration>t)return!1;var _=h(e)?u(e.value,e.endTime,this._currenTime):d(e)?c(e.value,t,this._currenTime):e;if(-1===v)this._automationEvents.push(_);else{if(y(e)&&t+e.duration>D(this._automationEvents[v]))return!1;this._automationEvents.splice(v,0,_)}}return!0}},{key:"flush",value:function(e){var t=this._automationEvents.findIndex((function(t){return D(t)>e}));if(t>1){var n=this._automationEvents.slice(t-1),r=n[0];w(r)&&n.unshift(l(g(this._automationEvents,t-2,r.startTime,this._defaultValue),r.startTime)),this._automationEvents=n}}},{key:"getValue",value:function(e){if(0===this._automationEvents.length)return this._defaultValue;var t=this._automationEvents.findIndex((function(t){return D(t)>e})),n=this._automationEvents[t],r=(-1===t?this._automationEvents.length:t)-1,i=this._automationEvents[r];if(void 0!==i&&w(i)&&(void 0===n||!m(n)||n.insertTime>e))return f(e,g(this._automationEvents,r-1,i.startTime,this._defaultValue),i);if(void 0!==i&&v(i)&&(void 0===n||!m(n)))return i.value;if(void 0!==i&&y(i)&&(void 0===n||!m(n)||i.startTime+i.duration>e))return e>4,i=15&e.data[0],a=1+i;if(1=o.MIDI_NRPN_MESSAGES.increment&&t<=o.MIDI_NRPN_MESSAGES.parammsb||t===o.MIDI_NRPN_MESSAGES.entrymsb||t===o.MIDI_NRPN_MESSAGES.entrylsb)){var s={target:this,type:"controlchange",data:e.data,timestamp:e.timeStamp,channel:a,controller:{number:t,name:this.getCcNameByNumber(t)},value:n};if(s.controller.number===o.MIDI_NRPN_MESSAGES.parammsb&&s.value!=o.MIDI_NRPN_MESSAGES.nullactiveparameter)o._nrpnBuffer[i]=[],o._nrpnBuffer[i][0]=s;else if(1===o._nrpnBuffer[i].length&&s.controller.number===o.MIDI_NRPN_MESSAGES.paramlsb)o._nrpnBuffer[i].push(s);else if(2!==o._nrpnBuffer[i].length||s.controller.number!==o.MIDI_NRPN_MESSAGES.increment&&s.controller.number!==o.MIDI_NRPN_MESSAGES.decrement&&s.controller.number!==o.MIDI_NRPN_MESSAGES.entrymsb)if(3===o._nrpnBuffer[i].length&&o._nrpnBuffer[i][2].number===o.MIDI_NRPN_MESSAGES.entrymsb&&s.controller.number===o.MIDI_NRPN_MESSAGES.entrylsb)o._nrpnBuffer[i].push(s);else if(3<=o._nrpnBuffer[i].length&&o._nrpnBuffer[i].length<=4&&s.controller.number===o.MIDI_NRPN_MESSAGES.parammsb&&s.value===o.MIDI_NRPN_MESSAGES.nullactiveparameter)o._nrpnBuffer[i].push(s);else if(4<=o._nrpnBuffer[i].length&&o._nrpnBuffer[i].length<=5&&s.controller.number===o.MIDI_NRPN_MESSAGES.paramlsb&&s.value===o.MIDI_NRPN_MESSAGES.nullactiveparameter){o._nrpnBuffer[i].push(s);var u=[];o._nrpnBuffer[i].forEach((function(e){u.push(e.data)}));var c=o._nrpnBuffer[i][0].value<<7|o._nrpnBuffer[i][1].value,l=o._nrpnBuffer[i][2].value;6===o._nrpnBuffer[i].length&&(l=o._nrpnBuffer[i][2].value<<7|o._nrpnBuffer[i][3].value);var p="";switch(o._nrpnBuffer[i][2].controller.number){case o.MIDI_NRPN_MESSAGES.entrymsb:p=o._nrpnTypes[0];break;case o.MIDI_NRPN_MESSAGES.increment:p=o._nrpnTypes[1];break;case o.MIDI_NRPN_MESSAGES.decrement:p=o._nrpnTypes[2];break;default:throw new Error("The NPRN type was unidentifiable.")}var f={timestamp:s.timestamp,channel:s.channel,type:"nrpn",data:u,controller:{number:c,type:p,name:"Non-Registered Parameter "+c},value:l};o._nrpnBuffer[i]=[],this._userHandlers.channel[f.type]&&this._userHandlers.channel[f.type][f.channel]&&this._userHandlers.channel[f.type][f.channel].forEach((function(e){e(f)}))}else o._nrpnBuffer[i]=[];else o._nrpnBuffer[i].push(s)}},a.prototype._parseChannelEvent=function(e){var t,n,r=e.data[0]>>4,i=1+(15&e.data[0]);1>7&127,r=127&e;return this.send(o.MIDI_SYSTEM_MESSAGES.songposition,[n,r],this._parseTimeParameter(t.time)),this},s.prototype.sendSongSelect=function(e,t){if(t=t||{},!(0<=(e=Math.floor(e))&&e<=127))throw new RangeError("The song number must be between 0 and 127.");return this.send(o.MIDI_SYSTEM_MESSAGES.songselect,[e],this._parseTimeParameter(t.time)),this},s.prototype.sendTuningRequest=function(e){return e=e||{},this.send(o.MIDI_SYSTEM_MESSAGES.tuningrequest,void 0,this._parseTimeParameter(e.time)),this},s.prototype.sendClock=function(e){return e=e||{},this.send(o.MIDI_SYSTEM_MESSAGES.clock,void 0,this._parseTimeParameter(e.time)),this},s.prototype.sendStart=function(e){return e=e||{},this.send(o.MIDI_SYSTEM_MESSAGES.start,void 0,this._parseTimeParameter(e.time)),this},s.prototype.sendContinue=function(e){return e=e||{},this.send(o.MIDI_SYSTEM_MESSAGES.continue,void 0,this._parseTimeParameter(e.time)),this},s.prototype.sendStop=function(e){return e=e||{},this.send(o.MIDI_SYSTEM_MESSAGES.stop,void 0,this._parseTimeParameter(e.time)),this},s.prototype.sendActiveSensing=function(e){return e=e||{},this.send(o.MIDI_SYSTEM_MESSAGES.activesensing,[],this._parseTimeParameter(e.time)),this},s.prototype.sendReset=function(e){return e=e||{},this.send(o.MIDI_SYSTEM_MESSAGES.reset,void 0,this._parseTimeParameter(e.time)),this},s.prototype.stopNote=function(e,t,n){if("all"===e)return this.sendChannelMode("allnotesoff",0,t,n);var r=64;return(n=n||{}).rawVelocity?!isNaN(n.velocity)&&0<=n.velocity&&n.velocity<=127&&(r=n.velocity):!isNaN(n.velocity)&&0<=n.velocity&&n.velocity<=1&&(r=127*n.velocity),this._convertNoteToArray(e).forEach(function(e){o.toMIDIChannels(t).forEach(function(t){this.send((o.MIDI_CHANNEL_MESSAGES.noteoff<<4)+(t-1),[e,Math.round(r)],this._parseTimeParameter(n.time))}.bind(this))}.bind(this)),this},s.prototype.playNote=function(e,t,n){var r,i=64;if((n=n||{}).rawVelocity?!isNaN(n.velocity)&&0<=n.velocity&&n.velocity<=127&&(i=n.velocity):!isNaN(n.velocity)&&0<=n.velocity&&n.velocity<=1&&(i=127*n.velocity),r=this._parseTimeParameter(n.time),this._convertNoteToArray(e).forEach(function(e){o.toMIDIChannels(t).forEach(function(t){this.send((o.MIDI_CHANNEL_MESSAGES.noteon<<4)+(t-1),[e,Math.round(i)],r)}.bind(this))}.bind(this)),!isNaN(n.duration)){n.duration<=0&&(n.duration=0);var a=64;n.rawVelocity?!isNaN(n.release)&&0<=n.release&&n.release<=127&&(a=n.release):!isNaN(n.release)&&0<=n.release&&n.release<=1&&(a=127*n.release),this._convertNoteToArray(e).forEach(function(e){o.toMIDIChannels(t).forEach(function(t){this.send((o.MIDI_CHANNEL_MESSAGES.noteoff<<4)+(t-1),[e,Math.round(a)],(r||o.time)+n.duration)}.bind(this))}.bind(this))}return this},s.prototype.sendKeyAftertouch=function(e,t,n,r){var i=this;if(r=r||{},t<1||16>7&127,u=127&a;return o.toMIDIChannels(t).forEach((function(){r.setRegisteredParameter("channelcoarsetuning",i,t,{time:n.time}),r.setRegisteredParameter("channelfinetuning",[s,u],t,{time:n.time})})),this},s.prototype.setTuningProgram=function(e,t,n){var r=this;if(n=n||{},!(0<=(e=Math.floor(e))&&e<=127))throw new RangeError("The program value must be between 0 and 127");return o.toMIDIChannels(t).forEach((function(){r.setRegisteredParameter("tuningprogram",e,t,{time:n.time})})),this},s.prototype.setTuningBank=function(e,t,n){var r=this;if(n=n||{},!(0<=(e=Math.floor(e)||0)&&e<=127))throw new RangeError("The bank value must be between 0 and 127");return o.toMIDIChannels(t).forEach((function(){r.setRegisteredParameter("tuningbank",e,t,{time:n.time})})),this},s.prototype.sendChannelMode=function(e,t,n,r){if(r=r||{},"string"==typeof e){if(!(e=o.MIDI_CHANNEL_MODE_MESSAGES[e]))throw new TypeError("Invalid channel mode message name.")}else if(!(120<=(e=Math.floor(e))&&e<=127))throw new RangeError("Channel mode numerical identifiers must be between 120 and 127.");if((t=Math.floor(t)||0)<0||127>7&127,s=127&i;return o.toMIDIChannels(t).forEach((function(e){r.send((o.MIDI_CHANNEL_MESSAGES.pitchbend<<4)+(e-1),[s,a],r._parseTimeParameter(n.time))})),this},s.prototype._parseTimeParameter=function(e){var t,n=parseFloat(e);return"string"==typeof e&&"+"===e.substring(0,1)?n&&0o.time&&(t=n),t},s.prototype._convertNoteToArray=function(e){var t=[];return Array.isArray(e)||(e=[e]),e.forEach((function(e){t.push(o.guessNoteNumber(e))})),t},void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},3377:function(e,t,n){!function(e,t,n,r){"use strict";function i(e){return e&&"object"===typeof e&&"default"in e?e:{default:e}}var o=i(t),a=i(n),s=i(r),u=function(e,t,n){return{endTime:t,insertTime:n,type:"exponentialRampToValue",value:e}},c=function(e,t,n){return{endTime:t,insertTime:n,type:"linearRampToValue",value:e}},l=function(e,t){return{startTime:t,type:"setValue",value:e}},p=function(e,t,n){return{duration:n,startTime:t,type:"setValueCurve",values:e}},f=function(e,t,n){var r=n.startTime,i=n.target,o=n.timeConstant;return i+(t-i)*Math.exp((r-e)/o)},h=function(e){return"exponentialRampToValue"===e.type},d=function(e){return"linearRampToValue"===e.type},m=function(e){return h(e)||d(e)},v=function(e){return"setValue"===e.type},y=function(e){return"setValueCurve"===e.type},g=function e(t,n,r,i){var o=t[n];return void 0===o?i:m(o)||v(o)?o.value:y(o)?o.values[o.values.length-1]:f(r,e(t,n-1,o.startTime,i),o)},_=function(e,t,n,r,i){return void 0===n?[r.insertTime,i]:m(n)?[n.endTime,n.value]:v(n)?[n.startTime,n.value]:y(n)?[n.startTime+n.duration,n.values[n.values.length-1]]:[n.startTime,g(e,t-1,n.startTime,i)]},E=function(e){return"cancelAndHold"===e.type},b=function(e){return"cancelScheduledValues"===e.type},D=function(e){return E(e)||b(e)?e.cancelTime:h(e)||d(e)?e.endTime:e.startTime},A=function(e,t,n,r){var i=r.endTime,o=r.value;return n===o?o:0=t:D(n)>=t})),r=this._automationEvents[n];if(-1!==n&&(this._automationEvents=this._automationEvents.slice(0,n)),E(e)){var i=this._automationEvents[this._automationEvents.length-1];if(void 0!==r&&m(r)){if(w(i))throw new Error("The internal list is malformed.");var o=y(i)?i.startTime+i.duration:D(i),a=y(i)?i.values[i.values.length-1]:i.value,s=h(r)?A(t,o,a,r):k(t,o,a,r),f=h(r)?u(s,t,this._currenTime):c(s,t,this._currenTime);this._automationEvents.push(f)}void 0!==i&&w(i)&&this._automationEvents.push(l(this.getValue(t),t)),void 0!==i&&y(i)&&i.startTime+i.duration>t&&(this._automationEvents[this._automationEvents.length-1]=p(new Float32Array([6,7]),i.startTime,t-i.startTime))}}else{var v=this._automationEvents.findIndex((function(e){return D(e)>t})),g=-1===v?this._automationEvents[this._automationEvents.length-1]:this._automationEvents[v-1];if(void 0!==g&&y(g)&&D(g)+g.duration>t)return!1;var _=h(e)?u(e.value,e.endTime,this._currenTime):d(e)?c(e.value,t,this._currenTime):e;if(-1===v)this._automationEvents.push(_);else{if(y(e)&&t+e.duration>D(this._automationEvents[v]))return!1;this._automationEvents.splice(v,0,_)}}return!0}},{key:"flush",value:function(e){var t=this._automationEvents.findIndex((function(t){return D(t)>e}));if(t>1){var n=this._automationEvents.slice(t-1),r=n[0];w(r)&&n.unshift(l(g(this._automationEvents,t-2,r.startTime,this._defaultValue),r.startTime)),this._automationEvents=n}}},{key:"getValue",value:function(e){if(0===this._automationEvents.length)return this._defaultValue;var t=this._automationEvents.findIndex((function(t){return D(t)>e})),n=this._automationEvents[t],r=(-1===t?this._automationEvents.length:t)-1,i=this._automationEvents[r];if(void 0!==i&&w(i)&&(void 0===n||!m(n)||n.insertTime>e))return f(e,g(this._automationEvents,r-1,i.startTime,this._defaultValue),i);if(void 0!==i&&v(i)&&(void 0===n||!m(n)))return i.value;if(void 0!==i&&y(i)&&(void 0===n||!m(n)||i.startTime+i.duration>e))return e>4,i=15&e.data[0],a=1+i;if(1=o.MIDI_NRPN_MESSAGES.increment&&t<=o.MIDI_NRPN_MESSAGES.parammsb||t===o.MIDI_NRPN_MESSAGES.entrymsb||t===o.MIDI_NRPN_MESSAGES.entrylsb)){var s={target:this,type:"controlchange",data:e.data,timestamp:e.timeStamp,channel:a,controller:{number:t,name:this.getCcNameByNumber(t)},value:n};if(s.controller.number===o.MIDI_NRPN_MESSAGES.parammsb&&s.value!=o.MIDI_NRPN_MESSAGES.nullactiveparameter)o._nrpnBuffer[i]=[],o._nrpnBuffer[i][0]=s;else if(1===o._nrpnBuffer[i].length&&s.controller.number===o.MIDI_NRPN_MESSAGES.paramlsb)o._nrpnBuffer[i].push(s);else if(2!==o._nrpnBuffer[i].length||s.controller.number!==o.MIDI_NRPN_MESSAGES.increment&&s.controller.number!==o.MIDI_NRPN_MESSAGES.decrement&&s.controller.number!==o.MIDI_NRPN_MESSAGES.entrymsb)if(3===o._nrpnBuffer[i].length&&o._nrpnBuffer[i][2].number===o.MIDI_NRPN_MESSAGES.entrymsb&&s.controller.number===o.MIDI_NRPN_MESSAGES.entrylsb)o._nrpnBuffer[i].push(s);else if(3<=o._nrpnBuffer[i].length&&o._nrpnBuffer[i].length<=4&&s.controller.number===o.MIDI_NRPN_MESSAGES.parammsb&&s.value===o.MIDI_NRPN_MESSAGES.nullactiveparameter)o._nrpnBuffer[i].push(s);else if(4<=o._nrpnBuffer[i].length&&o._nrpnBuffer[i].length<=5&&s.controller.number===o.MIDI_NRPN_MESSAGES.paramlsb&&s.value===o.MIDI_NRPN_MESSAGES.nullactiveparameter){o._nrpnBuffer[i].push(s);var u=[];o._nrpnBuffer[i].forEach((function(e){u.push(e.data)}));var c=o._nrpnBuffer[i][0].value<<7|o._nrpnBuffer[i][1].value,l=o._nrpnBuffer[i][2].value;6===o._nrpnBuffer[i].length&&(l=o._nrpnBuffer[i][2].value<<7|o._nrpnBuffer[i][3].value);var p="";switch(o._nrpnBuffer[i][2].controller.number){case o.MIDI_NRPN_MESSAGES.entrymsb:p=o._nrpnTypes[0];break;case o.MIDI_NRPN_MESSAGES.increment:p=o._nrpnTypes[1];break;case o.MIDI_NRPN_MESSAGES.decrement:p=o._nrpnTypes[2];break;default:throw new Error("The NPRN type was unidentifiable.")}var f={timestamp:s.timestamp,channel:s.channel,type:"nrpn",data:u,controller:{number:c,type:p,name:"Non-Registered Parameter "+c},value:l};o._nrpnBuffer[i]=[],this._userHandlers.channel[f.type]&&this._userHandlers.channel[f.type][f.channel]&&this._userHandlers.channel[f.type][f.channel].forEach((function(e){e(f)}))}else o._nrpnBuffer[i]=[];else o._nrpnBuffer[i].push(s)}},a.prototype._parseChannelEvent=function(e){var t,n,r=e.data[0]>>4,i=1+(15&e.data[0]);1>7&127,r=127&e;return this.send(o.MIDI_SYSTEM_MESSAGES.songposition,[n,r],this._parseTimeParameter(t.time)),this},s.prototype.sendSongSelect=function(e,t){if(t=t||{},!(0<=(e=Math.floor(e))&&e<=127))throw new RangeError("The song number must be between 0 and 127.");return this.send(o.MIDI_SYSTEM_MESSAGES.songselect,[e],this._parseTimeParameter(t.time)),this},s.prototype.sendTuningRequest=function(e){return e=e||{},this.send(o.MIDI_SYSTEM_MESSAGES.tuningrequest,void 0,this._parseTimeParameter(e.time)),this},s.prototype.sendClock=function(e){return e=e||{},this.send(o.MIDI_SYSTEM_MESSAGES.clock,void 0,this._parseTimeParameter(e.time)),this},s.prototype.sendStart=function(e){return e=e||{},this.send(o.MIDI_SYSTEM_MESSAGES.start,void 0,this._parseTimeParameter(e.time)),this},s.prototype.sendContinue=function(e){return e=e||{},this.send(o.MIDI_SYSTEM_MESSAGES.continue,void 0,this._parseTimeParameter(e.time)),this},s.prototype.sendStop=function(e){return e=e||{},this.send(o.MIDI_SYSTEM_MESSAGES.stop,void 0,this._parseTimeParameter(e.time)),this},s.prototype.sendActiveSensing=function(e){return e=e||{},this.send(o.MIDI_SYSTEM_MESSAGES.activesensing,[],this._parseTimeParameter(e.time)),this},s.prototype.sendReset=function(e){return e=e||{},this.send(o.MIDI_SYSTEM_MESSAGES.reset,void 0,this._parseTimeParameter(e.time)),this},s.prototype.stopNote=function(e,t,n){if("all"===e)return this.sendChannelMode("allnotesoff",0,t,n);var r=64;return(n=n||{}).rawVelocity?!isNaN(n.velocity)&&0<=n.velocity&&n.velocity<=127&&(r=n.velocity):!isNaN(n.velocity)&&0<=n.velocity&&n.velocity<=1&&(r=127*n.velocity),this._convertNoteToArray(e).forEach(function(e){o.toMIDIChannels(t).forEach(function(t){this.send((o.MIDI_CHANNEL_MESSAGES.noteoff<<4)+(t-1),[e,Math.round(r)],this._parseTimeParameter(n.time))}.bind(this))}.bind(this)),this},s.prototype.playNote=function(e,t,n){var r,i=64;if((n=n||{}).rawVelocity?!isNaN(n.velocity)&&0<=n.velocity&&n.velocity<=127&&(i=n.velocity):!isNaN(n.velocity)&&0<=n.velocity&&n.velocity<=1&&(i=127*n.velocity),r=this._parseTimeParameter(n.time),this._convertNoteToArray(e).forEach(function(e){o.toMIDIChannels(t).forEach(function(t){this.send((o.MIDI_CHANNEL_MESSAGES.noteon<<4)+(t-1),[e,Math.round(i)],r)}.bind(this))}.bind(this)),!isNaN(n.duration)){n.duration<=0&&(n.duration=0);var a=64;n.rawVelocity?!isNaN(n.release)&&0<=n.release&&n.release<=127&&(a=n.release):!isNaN(n.release)&&0<=n.release&&n.release<=1&&(a=127*n.release),this._convertNoteToArray(e).forEach(function(e){o.toMIDIChannels(t).forEach(function(t){this.send((o.MIDI_CHANNEL_MESSAGES.noteoff<<4)+(t-1),[e,Math.round(a)],(r||o.time)+n.duration)}.bind(this))}.bind(this))}return this},s.prototype.sendKeyAftertouch=function(e,t,n,r){var i=this;if(r=r||{},t<1||16>7&127,u=127&a;return o.toMIDIChannels(t).forEach((function(){r.setRegisteredParameter("channelcoarsetuning",i,t,{time:n.time}),r.setRegisteredParameter("channelfinetuning",[s,u],t,{time:n.time})})),this},s.prototype.setTuningProgram=function(e,t,n){var r=this;if(n=n||{},!(0<=(e=Math.floor(e))&&e<=127))throw new RangeError("The program value must be between 0 and 127");return o.toMIDIChannels(t).forEach((function(){r.setRegisteredParameter("tuningprogram",e,t,{time:n.time})})),this},s.prototype.setTuningBank=function(e,t,n){var r=this;if(n=n||{},!(0<=(e=Math.floor(e)||0)&&e<=127))throw new RangeError("The bank value must be between 0 and 127");return o.toMIDIChannels(t).forEach((function(){r.setRegisteredParameter("tuningbank",e,t,{time:n.time})})),this},s.prototype.sendChannelMode=function(e,t,n,r){if(r=r||{},"string"==typeof e){if(!(e=o.MIDI_CHANNEL_MODE_MESSAGES[e]))throw new TypeError("Invalid channel mode message name.")}else if(!(120<=(e=Math.floor(e))&&e<=127))throw new RangeError("Channel mode numerical identifiers must be between 120 and 127.");if((t=Math.floor(t)||0)<0||127>7&127,s=127&i;return o.toMIDIChannels(t).forEach((function(e){r.send((o.MIDI_CHANNEL_MESSAGES.pitchbend<<4)+(e-1),[s,a],r._parseTimeParameter(n.time))})),this},s.prototype._parseTimeParameter=function(e){var t,n=parseFloat(e);return"string"==typeof e&&"+"===e.substring(0,1)?n&&0o.time&&(t=n),t},s.prototype._convertNoteToArray=function(e){var t=[];return Array.isArray(e)||(e=[e]),e.forEach((function(e){t.push(o.guessNoteNumber(e))})),t},void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},3668:function(e){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),a=r||i||o,s=a&&(r?document.documentMode||6:+(o||i)[1]),u=!o&&/WebKit\//.test(e),c=u&&/Qt\/\d+\.\d+/.test(e),l=!o&&/Chrome\//.test(e),p=/Opera\//.test(e),f=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),d=/PhantomJS/.test(e),m=f&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),v=/Android/.test(e),y=m||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),g=m||/Mac/.test(t),_=/\bCrOS\b/.test(e),E=/win/i.test(t),b=p&&e.match(/Version\/(\d*\.\d*)/);b&&(b=Number(b[1])),b&&b>=15&&(p=!1,u=!0);var D=g&&(c||p&&(null==b||b<12.11)),A=n||a&&s>=9;function k(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var C,x=function(e,t){var n=e.className,r=k(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function w(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function S(e,t){return w(e).appendChild(t)}function T(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}m?P=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(P=function(e){try{e.select()}catch(t){}});var L=function(){this.id=null,this.f=null,this.time=0,this.handler=I(this.onTimeout,this)};function j(e,t){for(var n=0;n=t)return r+Math.min(a,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}}var U=[""];function Y(e){for(;U.length<=e;)U.push(K(U)+" ");return U[e]}function K(e){return e[e.length-1]}function X(e,t){for(var n=[],r=0;r"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ee.test(e))}function ne(e,t){return t?!!(t.source.indexOf("\\w")>-1&&te(e))||t.test(e):te(e)}function re(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ie=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function oe(e){return e.charCodeAt(0)>=768&&ie.test(e)}function ae(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function ue(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;ot||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var ce=null;function le(e,t,n){var r;ce=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:ce=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:ce=i)}return null!=r?r:ce}var pe=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?e.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?t.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,s=/[1n]/;function u(e,t,n){this.level=e,this.from=t,this.to=n}return function(e,t){var c="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!r.test(e))return!1;for(var l=e.length,p=[],f=0;f-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function ye(e,t){var n=me(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function be(e){e.prototype.on=function(e,t){de(this,e,t)},e.prototype.off=function(e,t){ve(this,e,t)}}function De(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ae(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ke(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Ce(e){De(e),Ae(e)}function xe(e){return e.target||e.srcElement}function we(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),g&&e.ctrlKey&&1==t&&(t=3),t}var Se,Te,Fe=function(){if(a&&s<9)return!1;var e=T("div");return"draggable"in e||"dragDrop"in e}();function Me(e){if(null==Se){var t=T("span","\u200b");S(e,T("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Se=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var n=Se?T("span","\u200b"):T("span","\xa0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function qe(e){if(null!=Te)return Te;var t=S(e,document.createTextNode("A\u062eA")),n=C(t,0,1).getBoundingClientRect(),r=C(t,1,2).getBoundingClientRect();return w(e),!(!n||n.left==n.right)&&(Te=r.right-n.right<3)}var Be=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Oe=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(n){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Pe=function(){var e=T("div");return"oncopy"in e||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),Ie=null;function Ne(e){if(null!=Ie)return Ie;var t=S(e,T("span","x")),n=t.getBoundingClientRect(),r=C(t,0,1).getBoundingClientRect();return Ie=Math.abs(n.left-r.left)>1}var Re={},Le={};function je(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Re[e]=t}function We(e,t){Le[e]=t}function Ge(e){if("string"==typeof e&&Le.hasOwnProperty(e))e=Le[e];else if(e&&"string"==typeof e.name&&Le.hasOwnProperty(e.name)){var t=Le[e.name];"string"==typeof t&&(t={name:t}),(e=$(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ge("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ge("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function He(e,t){t=Ge(t);var n=Re[t.name];if(!n)return He(e,"text/plain");var r=n(e,t);if(Ze.hasOwnProperty(t.name)){var i=Ze[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var Ze={};function Ve(e,t){N(t,Ze.hasOwnProperty(e)?Ze[e]:Ze[e]={})}function ze(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Ue(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Ye(e,t,n){return!e.startState||e.startState(t,n)}var Ke=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Xe(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t=e.first&&tn?it(n,Xe(e,n).text.length):ft(t,Xe(e,t.line).text.length)}function ft(e,t){var n=e.ch;return null==n||n>t?it(e.line,t):n<0?it(e.line,0):e}function ht(e,t){for(var n=[],r=0;r=this.string.length},Ke.prototype.sol=function(){return this.pos==this.lineStart},Ke.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ke.prototype.next=function(){if(this.post},Ke.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ke.prototype.skipToEnd=function(){this.pos=this.string.length},Ke.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ke.prototype.backUp=function(e){this.pos-=e},Ke.prototype.column=function(){return this.lastColumnPos0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Ke.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ke.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ke.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ke.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var dt=function(e,t){this.state=e,this.lookAhead=t},mt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function vt(e,t,n,r){var i=[e.state.modeGen],o={};Ct(e,t.text,e.doc.mode,n,(function(e,t){return i.push(e,t)}),o,r);for(var a=n.state,s=function(r){n.baseTokens=i;var s=e.state.overlays[r],u=1,c=0;n.state=!0,Ct(e,t.text,s.mode,n,(function(e,t){for(var n=u;ce&&i.splice(u,1,e,i[u+1],r),u+=2,c=Math.min(e,r)}if(t)if(s.opaque)i.splice(n,u-n,e,"overlay "+t),u=n+2;else for(;ne.options.maxHighlightLength&&ze(e.doc.mode,r.state),o=vt(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function gt(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new mt(r,!0,t);var o=xt(e,t,n),a=o>r.first&&Xe(r,o-1).stateAfter,s=a?mt.fromSaved(r,a,o):new mt(r,Ye(r.mode),o);return r.iter(o,t,(function(n){_t(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&rt.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}mt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},mt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},mt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},mt.fromSaved=function(e,t,n){return t instanceof dt?new mt(e,ze(e.mode,t.state),n,t.lookAhead):new mt(e,ze(e.mode,t),n)},mt.prototype.save=function(e){var t=!1!==e?ze(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new dt(t,this.maxLookAhead):t};var Dt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function At(e,t,n,r){var i,o,a=e.doc,s=a.mode,u=Xe(a,(t=pt(a,t)).line),c=gt(e,t.line,n),l=new Ke(u.text,e.options.tabSize,c);for(r&&(o=[]);(r||l.pose.options.maxHighlightLength?(s=!1,a&&_t(e,t,r,p.pos),p.pos=t.length,u=null):u=kt(bt(n,p,r.state,f),o),f){var h=f[0].name;h&&(u="m-"+(u?h+" "+u:h))}if(!s||l!=u){for(;ca;--s){if(s<=o.first)return o.first;var u=Xe(o,s-1),c=u.stateAfter;if(c&&(!n||s+(c instanceof dt?c.lookAhead:0)<=o.modeFrontier))return s;var l=R(u.text,null,e.options.tabSize);(null==i||r>l)&&(i=s-1,r=l)}return i}function wt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=Xe(e,r).stateAfter;if(i&&(!(i instanceof dt)||r+i.lookAhead=t:o.to>t);(r||(r=[])).push(new qt(a,o.from,s?null:o.to))}}return r}function Nt(e,t,n){var r;if(e)for(var i=0;i=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from0&&s)for(var _=0;_0)){var l=[u,1],p=ot(c.from,s.from),f=ot(c.to,s.to);(p<0||!a.inclusiveLeft&&!p)&&l.push({from:c.from,to:s.from}),(f>0||!a.inclusiveRight&&!f)&&l.push({from:s.to,to:c.to}),i.splice.apply(i,l),u+=l.length-3}}return i}function Wt(e){var t=e.markedSpans;if(t){for(var n=0;nt)&&(!n||Vt(n,o.marker)<0)&&(n=o.marker)}return n}function Xt(e,t,n,r,i){var o=Xe(e,t),a=Tt&&o.markedSpans;if(a)for(var s=0;s=0&&p<=0||l<=0&&p>=0)&&(l<=0&&(u.marker.inclusiveRight&&i.inclusiveLeft?ot(c.to,n)>=0:ot(c.to,n)>0)||l>=0&&(u.marker.inclusiveRight&&i.inclusiveLeft?ot(c.from,r)<=0:ot(c.from,r)<0)))return!0}}}function Jt(e){for(var t;t=Ut(e);)e=t.find(-1,!0).line;return e}function Qt(e){for(var t;t=Yt(e);)e=t.find(1,!0).line;return e}function $t(e){for(var t,n;t=Yt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function en(e,t){var n=Xe(e,t),r=Jt(n);return n==r?t:et(r)}function tn(e,t){if(t>e.lastLine())return t;var n,r=Xe(e,t);if(!nn(e,r))return t;for(;n=Yt(r);)r=n.find(1,!0).line;return et(r)+1}function nn(e,t){var n=Tt&&t.markedSpans;if(n)for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var un=function(e,t,n){this.text=e,Gt(this,t),this.height=n?n(this):1};function cn(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Wt(e),Gt(e,n);var i=r?r(e):1;i!=e.height&&$e(e,i)}function ln(e){e.parent=null,Wt(e)}un.prototype.lineNo=function(){return et(this)},be(un);var pn={},fn={};function hn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?fn:pn;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function dn(e,t){var n=F("span",null,null,u?"padding-right: .1px":null),r={pre:F("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=vn,qe(e.display.measure)&&(a=fe(o,e.doc.direction))&&(r.addToken=gn(r.addToken,a)),r.map=[],En(o,r,yt(e,o,t!=e.display.externalMeasured&&et(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=O(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=O(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Me(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(u){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return ye(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=O(r.pre.className,r.textClass||"")),r}function mn(e){var t=T("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function vn(e,t,n,r,i,o,u){if(t){var c,l=e.splitSpaces?yn(t,e.trailingSpace):t,p=e.cm.state.specialChars,f=!1;if(p.test(t)){c=document.createDocumentFragment();for(var h=0;;){p.lastIndex=h;var d=p.exec(t),m=d?d.index-h:t.length-h;if(m){var v=document.createTextNode(l.slice(h,h+m));a&&s<9?c.appendChild(T("span",[v])):c.appendChild(v),e.map.push(e.pos,e.pos+m,v),e.col+=m,e.pos+=m}if(!d)break;h+=m+1;var y=void 0;if("\t"==d[0]){var g=e.cm.options.tabSize,_=g-e.col%g;(y=c.appendChild(T("span",Y(_),"cm-tab"))).setAttribute("role","presentation"),y.setAttribute("cm-text","\t"),e.col+=_}else"\r"==d[0]||"\n"==d[0]?((y=c.appendChild(T("span","\r"==d[0]?"\u240d":"\u2424","cm-invalidchar"))).setAttribute("cm-text",d[0]),e.col+=1):((y=e.cm.options.specialCharPlaceholder(d[0])).setAttribute("cm-text",d[0]),a&&s<9?c.appendChild(T("span",[y])):c.appendChild(y),e.col+=1);e.map.push(e.pos,e.pos+1,y),e.pos++}}else e.col+=t.length,c=document.createTextNode(l),e.map.push(e.pos,e.pos+t.length,c),a&&s<9&&(f=!0),e.pos+=t.length;if(e.trailingSpace=32==l.charCodeAt(t.length-1),n||r||i||f||o||u){var E=n||"";r&&(E+=r),i&&(E+=i);var b=T("span",[c],E,o);if(u)for(var D in u)u.hasOwnProperty(D)&&"style"!=D&&"class"!=D&&b.setAttribute(D,u[D]);return e.content.appendChild(b)}e.content.appendChild(c)}}function yn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;ic&&p.from<=c);f++);if(p.to>=l)return e(n,r,i,o,a,s,u);e(n,r.slice(0,p.to-c),i,o,null,s,u),o=null,r=r.slice(p.to-c),c=p.to}}}function _n(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function En(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,u,c,l,p,f,h=i.length,d=0,m=1,v="",y=0;;){if(y==d){u=c=l=s="",f=null,p=null,y=1/0;for(var g=[],_=void 0,E=0;Ed||D.collapsed&&b.to==d&&b.from==d)){if(null!=b.to&&b.to!=d&&y>b.to&&(y=b.to,c=""),D.className&&(u+=" "+D.className),D.css&&(s=(s?s+";":"")+D.css),D.startStyle&&b.from==d&&(l+=" "+D.startStyle),D.endStyle&&b.to==y&&(_||(_=[])).push(D.endStyle,b.to),D.title&&((f||(f={})).title=D.title),D.attributes)for(var A in D.attributes)(f||(f={}))[A]=D.attributes[A];D.collapsed&&(!p||Vt(p.marker,D)<0)&&(p=b)}else b.from>d&&y>b.from&&(y=b.from)}if(_)for(var k=0;k<_.length;k+=2)_[k+1]==y&&(c+=" "+_[k]);if(!p||p.from==d)for(var C=0;C=h)break;for(var x=Math.min(h,y);;){if(v){var w=d+v.length;if(!p){var S=w>x?v.slice(0,x-d):v;t.addToken(t,S,a?a+u:u,l,d+S.length==y?c:"",s,f)}if(w>=x){v=v.slice(x-d),d=x;break}d=w,l=""}v=i.slice(o,o=n[m++]),a=hn(n[m++],t.cm.options)}}else for(var T=1;T2&&o.push((u.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Jn(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;rn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function Qn(e,t){var n=et(t=Jt(t)),r=e.display.externalMeasured=new bn(e.doc,t,n);r.lineN=n;var i=r.built=dn(e,r);return r.text=i.pre,S(e.display.lineMeasure,i.pre),r}function $n(e,t,n,r){return nr(e,tr(e,t),n,r)}function er(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(i=(o=u-s)-1,t>=u&&(a="right")),null!=i){if(r=e[c+2],s==u&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[2+(c-=3)],a="left";if("right"==n&&i==u-s)for(;c=0&&(n=e[i]).left==n.right;i--);return n}function sr(e,t,n,r){var i,o=or(t.map,n,r),u=o.node,c=o.start,l=o.end,p=o.collapse;if(3==u.nodeType){for(var f=0;f<4;f++){for(;c&&oe(t.line.text.charAt(o.coverStart+c));)--c;for(;o.coverStart+l0&&(p=r="right"),i=e.options.lineWrapping&&(h=u.getClientRects()).length>1?h["right"==r?h.length-1:0]:u.getBoundingClientRect()}if(a&&s<9&&!c&&(!i||!i.left&&!i.right)){var d=u.parentNode.getClientRects()[0];i=d?{left:d.left,right:d.left+Tr(e.display),top:d.top,bottom:d.bottom}:ir}for(var m=i.top-t.rect.top,v=i.bottom-t.rect.top,y=(m+v)/2,g=t.view.measure.heights,_=0;_=r.text.length?(u=r.text.length,c="before"):u<=0&&(u=0,c="after"),!s)return a("before"==c?u-1:u,"before"==c);function l(e,t,n){return a(n?e-1:e,1==s[t].level!=n)}var p=le(s,u,c),f=ce,h=l(u,p,"before"==c);return null!=f&&(h.other=l(u,f,"before"!=c)),h}function _r(e,t){var n=0;t=pt(e.doc,t),e.options.lineWrapping||(n=Tr(e.display)*t.ch);var r=Xe(e.doc,t.line),i=on(r)+Zn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Er(e,t,n,r,i){var o=it(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function br(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return Er(r.first,0,null,-1,-1);var i=tt(r,n),o=r.first+r.size-1;if(i>o)return Er(r.first+r.size-1,Xe(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=Xe(r,i);;){var s=Cr(e,a,i,t,n),u=Kt(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!u)return s;var c=u.find(1);if(c.line==i)return c;a=Xe(r,i=c.line)}}function Dr(e,t,n,r){r-=dr(t);var i=t.text.length,o=se((function(t){return nr(e,n,t-1).bottom<=r}),i,0);return{begin:o,end:i=se((function(t){return nr(e,n,t).top>r}),o,i)}}function Ar(e,t,n,r){return n||(n=tr(e,t)),Dr(e,t,n,mr(e,t,nr(e,n,r),"line").top)}function kr(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function Cr(e,t,n,r,i){i-=on(t);var o=tr(e,t),a=dr(t),s=0,u=t.text.length,c=!0,l=fe(t,e.doc.direction);if(l){var p=(e.options.lineWrapping?wr:xr)(e,t,n,o,l,r,i);s=(c=1!=p.level)?p.from:p.to-1,u=c?p.to:p.from-1}var f,h,d=null,m=null,v=se((function(t){var n=nr(e,o,t);return n.top+=a,n.bottom+=a,!!kr(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(d=t,m=n),!0)}),s,u),y=!1;if(m){var g=r-m.left=E.bottom?1:0}return Er(n,v=ae(t.text,v,1),h,y,r-f)}function xr(e,t,n,r,i,o,a){var s=se((function(s){var u=i[s],c=1!=u.level;return kr(gr(e,it(n,c?u.to:u.from,c?"before":"after"),"line",t,r),o,a,!0)}),0,i.length-1),u=i[s];if(s>0){var c=1!=u.level,l=gr(e,it(n,c?u.from:u.to,c?"after":"before"),"line",t,r);kr(l,o,a,!0)&&l.top>a&&(u=i[s-1])}return u}function wr(e,t,n,r,i,o,a){var s=Dr(e,t,r,a),u=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var l=null,p=null,f=0;f=c||h.to<=u)){var d=nr(e,r,1!=h.level?Math.min(c,h.to)-1:Math.max(u,h.from)).right,m=dm)&&(l=h,p=m)}}return l||(l=i[i.length-1]),l.fromc&&(l={from:l.from,to:c,level:l.level}),l}function Sr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==rr){rr=T("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)rr.appendChild(document.createTextNode("x")),rr.appendChild(T("br"));rr.appendChild(document.createTextNode("x"))}S(e.measure,rr);var n=rr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),w(e.measure),n||1}function Tr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=T("span","xxxxxxxxxx"),n=T("pre",[t],"CodeMirror-line-like");S(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Fr(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=e.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+i,r[s]=o.clientWidth}return{fixedPos:Mr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Mr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function qr(e){var t=Sr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Tr(e.display)-3);return function(i){if(nn(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a0&&(u=Xe(e.doc,c.line).text).length==c.ch){var l=R(u,u.length,e.options.tabSize)-u.length;c=it(c.line,Math.max(0,Math.round((o-zn(e.display).left)/Tr(e.display))-l))}return c}function Pr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Tt&&en(e.doc,t)i.viewFrom?Rr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)Rr(e);else if(t<=i.viewFrom){var o=Lr(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):Rr(e)}else if(n>=i.viewTo){var a=Lr(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):Rr(e)}else{var s=Lr(e,t,t,-1),u=Lr(e,n,n+r,1);s&&u?(i.view=i.view.slice(0,s.index).concat(Dn(e,s.lineN,u.lineN)).concat(i.view.slice(u.index)),i.viewTo+=r):Rr(e)}var c=i.externalMeasured;c&&(n=i.lineN&&t=r.viewTo)){var o=r.view[Pr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==j(a,n)&&a.push(n)}}}function Rr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Lr(e,t,n,r){var i,o=Pr(e,t),a=e.display.view;if(!Tt||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,u=0;u0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;en(e.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function jr(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=Dn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Dn(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Pr(e,n)))),r.viewTo=n}function Wr(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||u.to().line0?a:e.defaultCharWidth())+"px"}if(r.other){var s=n.appendChild(T("div","\xa0","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=r.other.left+"px",s.style.top=r.other.top+"px",s.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function Vr(e,t){return e.top-t.top||e.left-t.left}function zr(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=zn(e.display),s=a.left,u=Math.max(r.sizerWidth,Yn(e)-r.sizer.offsetLeft)-a.right,c="ltr"==i.direction;function l(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),o.appendChild(T("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?u-e:n)+"px;\n height: "+(r-t)+"px"))}function p(t,n,r){var o,a,p=Xe(i,t),f=p.text.length;function h(n,r){return yr(e,it(t,n),"div",p,r)}function d(t,n,r){var i=Ar(e,p,null,t),o="ltr"==n==("after"==r)?"left":"right";return h("after"==r?i.begin:i.end-(/\s/.test(p.text.charAt(i.end-1))?2:1),o)[o]}var m=fe(p,i.direction);return ue(m,n||0,null==r?f:r,(function(e,t,i,p){var v="ltr"==i,y=h(e,v?"left":"right"),g=h(t-1,v?"right":"left"),_=null==n&&0==e,E=null==r&&t==f,b=0==p,D=!m||p==m.length-1;if(g.top-y.top<=3){var A=(c?E:_)&&D,k=(c?_:E)&&b?s:(v?y:g).left,C=A?u:(v?g:y).right;l(k,y.top,C-k,y.bottom)}else{var x,w,S,T;v?(x=c&&_&&b?s:y.left,w=c?u:d(e,i,"before"),S=c?s:d(t,i,"after"),T=c&&E&&D?u:g.right):(x=c?d(e,i,"before"):s,w=!c&&_&&b?u:y.right,S=!c&&E&&D?s:g.left,T=c?d(t,i,"after"):u),l(x,y.top,w-x,y.bottom),y.bottom0?t.blinker=setInterval((function(){e.hasFocus()||Jr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Yr(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Xr(e))}function Kr(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Jr(e))}),100)}function Xr(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(ye(e,"focus",e,t),e.state.focused=!0,B(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),u&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),Ur(e))}function Jr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ye(e,"blur",e,t),e.state.focused=!1,x(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Qr(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,u=0;u.005||m<-.005)&&(ie.display.sizerWidth){var y=Math.ceil(f/Tr(e.display));y>e.display.maxLineLength&&(e.display.maxLineLength=y,e.display.maxLine=c.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function $r(e){if(e.widgets)for(var t=0;t=a&&(o=tt(t,on(Xe(t,u))-e.wrapper.clientHeight),a=u)}return{from:o,to:Math.max(a,o+1)}}function ti(e,t){if(!ge(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!d){var o=T("div","\u200b",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Zn(e.display))+"px;\n height: "+(t.bottom-t.top+Un(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function ni(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==t.sticky?it(t.line,t.ch+1,"before"):t,t=t.ch?it(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var a=!1,s=gr(e,t),u=n&&n!=t?gr(e,n):s,c=ii(e,i={left:Math.min(s.left,u.left),top:Math.min(s.top,u.top)-r,right:Math.max(s.left,u.left),bottom:Math.max(s.bottom,u.bottom)+r}),l=e.doc.scrollTop,p=e.doc.scrollLeft;if(null!=c.scrollTop&&(pi(e,c.scrollTop),Math.abs(e.doc.scrollTop-l)>1&&(a=!0)),null!=c.scrollLeft&&(hi(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-p)>1&&(a=!0)),!a)break}return i}function ri(e,t){var n=ii(e,t);null!=n.scrollTop&&pi(e,n.scrollTop),null!=n.scrollLeft&&hi(e,n.scrollLeft)}function ii(e,t){var n=e.display,r=Sr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=Kn(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+Vn(n),u=t.tops-r;if(t.topi+o){var l=Math.min(t.top,(c?s:t.bottom)-o);l!=i&&(a.scrollTop=l)}var p=e.options.fixedGutter?0:n.gutters.offsetWidth,f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-p,h=Yn(e)-n.gutters.offsetWidth,d=t.right-t.left>h;return d&&(t.right=t.left+h),t.left<10?a.scrollLeft=0:t.lefth+f-3&&(a.scrollLeft=t.right+(d?0:10)-h),a}function oi(e,t){null!=t&&(ci(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function ai(e){ci(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function si(e,t,n){null==t&&null==n||ci(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function ui(e,t){ci(e),e.curOp.scrollToPos=t}function ci(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,li(e,_r(e,t.from),_r(e,t.to),t.margin))}function li(e,t,n,r){var i=ii(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});si(e,i.scrollLeft,i.scrollTop)}function pi(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||Gi(e,{top:t}),fi(e,t,!0),n&&Gi(e),Oi(e,100))}function fi(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function hi(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,zi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function di(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Vn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Un(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var mi=function(e,t,n){this.cm=n;var r=this.vert=T("div",[T("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=T("div",[T("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),de(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),de(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};mi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},mi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},mi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},mi.prototype.zeroWidthHack=function(){var e=g&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new L,this.disableVert=new L},mi.prototype.enableZeroWidthBar=function(e,t,n){function r(){var i=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)}e.style.pointerEvents="auto",t.set(1e3,r)},mi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var vi=function(){};function yi(e,t){t||(t=di(e));var n=e.display.barWidth,r=e.display.barHeight;gi(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Qr(e),gi(e,di(e)),n=e.display.barWidth,r=e.display.barHeight}function gi(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}vi.prototype.update=function(){return{bottom:0,right:0}},vi.prototype.setScrollLeft=function(){},vi.prototype.setScrollTop=function(){},vi.prototype.clear=function(){};var _i={native:mi,null:vi};function Ei(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&x(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new _i[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),de(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?hi(e,t):pi(e,t)}),e),e.display.scrollbars.addClass&&B(e.display.wrapper,e.display.scrollbars.addClass)}var bi=0;function Di(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++bi,markArrays:null},kn(e.curOp)}function Ai(e){var t=e.curOp;t&&xn(t,(function(e){for(var t=0;t=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Ii(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function xi(e){e.updatedDisplay=e.mustUpdate&&ji(e.cm,e.update)}function wi(e){var t=e.cm,n=t.display;e.updatedDisplay&&Qr(t),e.barMeasure=di(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=$n(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Un(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Yn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Si(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var n=+new Date+e.options.workTime,r=gt(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(r.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?ze(t.mode,r.state):null,u=vt(e,o,r,!0);s&&(r.state=s),o.styles=u.styles;var c=o.styleClasses,l=u.classes;l?o.styleClasses=l:c&&(o.styleClasses=null);for(var p=!a||a.length!=o.styles.length||c!=l&&(!c||!l||c.bgClass!=l.bgClass||c.textClass!=l.textClass),f=0;!p&&fn)return Oi(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Fi(e,(function(){for(var t=0;t=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Wr(e))return!1;Ui(e)&&(Rr(e),t.dims=Fr(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Tt&&(o=en(e.doc,o),a=tn(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;jr(e,o,a),n.viewOffset=on(Xe(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var u=Wr(e);if(!s&&0==u&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=Ri(e);return u>4&&(n.lineDiv.style.display="none"),Hi(e,n.updateLineNumbers,t.dims),u>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Li(c),w(n.cursorDiv),w(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Oi(e,400)),n.updateLineNumbers=null,!0}function Wi(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Yn(e))r&&(t.visible=ei(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Vn(e.display)-Kn(e),n.top)}),t.visible=ei(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!ji(e,t))break;Qr(e);var i=di(e);Gr(e),yi(e,i),Vi(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Gi(e,t){var n=new Ii(e,t);if(ji(e,n)){Qr(e),Wi(e,n);var r=di(e);Gr(e),yi(e,r),Vi(e,r),n.finish()}}function Hi(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function s(t){var n=t.nextSibling;return u&&g&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var c=r.view,l=r.viewFrom,p=0;p-1&&(h=!1),Fn(e,f,l,n)),h&&(w(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(rt(e.options,l)))),a=f.node.nextSibling}else{var d=Rn(e,f,l,n);o.insertBefore(d,a)}l+=f.size}for(;a;)a=s(a)}function Zi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",Sn(e,"gutterChanged",e)}function Vi(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Un(e)+"px"}function zi(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=Mr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;ac.clientWidth,f=c.scrollHeight>c.clientHeight;if(i&&l||o&&f){if(o&&g&&u)e:for(var h=t.target,d=s.view;h!=c;h=h.parentNode)for(var m=0;m=0&&ot(e,r.to())<=0)return n}return-1};var io=function(e,t){this.anchor=e,this.head=t};function oo(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort((function(e,t){return ot(e.from(),t.from())})),n=j(t,i);for(var o=1;o0:u>=0){var c=ct(s.from(),a.from()),l=ut(s.to(),a.to()),p=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,t.splice(--o,2,new io(p?l:c,p?c:l))}}return new ro(t,n)}function ao(e,t){return new ro([new io(e,t||e)],0)}function so(e){return e.text?it(e.from.line+e.text.length-1,K(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function uo(e,t){if(ot(e,t.from)<0)return e;if(ot(e,t.to)<=0)return so(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=so(t).ch-t.to.ch),it(n,r)}function co(e,t){for(var n=[],r=0;r1&&e.remove(s.line+1,d-1),e.insert(s.line+1,y)}Sn(e,"change",e,t)}function yo(e,t,n){function r(e,i,o){if(e.linked)for(var a=0;a1&&!e.done[e.done.length-2].ranges?(e.done.pop(),K(e.done)):void 0}function Co(e,t,n,r){var i=e.history;i.undone.length=0;var o,a,s=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=ko(i,i.lastOp==r)))a=K(o.changes),0==ot(t.from,t.to)&&0==ot(t.from,a.to)?a.to=so(t):o.changes.push(Do(e,t));else{var u=K(i.done);for(u&&u.ranges||So(e.sel,i.done),o={changes:[Do(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||ye(e,"historyAdded")}function xo(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function wo(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||xo(e,o,K(i.done),t))?i.done[i.done.length-1]=t:So(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&Ao(i.undone)}function So(e,t){var n=K(t);n&&n.ranges&&n.equals(e)||t.push(e)}function To(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function Fo(e){if(!e)return null;for(var t,n=0;n-1&&(K(s)[p]=c[p],delete c[p])}}}return r}function Oo(e,t,n,r){if(r){var i=e.anchor;if(n){var o=ot(t,i)<0;o!=ot(n,i)<0?(i=t,t=n):o!=ot(t,n)<0&&(t=n)}return new io(i,t)}return new io(n||t,t)}function Po(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Wo(e,new ro([Oo(e.sel.primary(),t,n,i)],0),r)}function Io(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:s.to>t.ch))){if(i&&(ye(u,"beforeCursorEnter"),u.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!u.atomic)continue;if(n){var p=u.find(r<0?1:-1),f=void 0;if((r<0?l:c)&&(p=Yo(e,p,-r,p&&p.line==t.line?o:null)),p&&p.line==t.line&&(f=ot(p,n))&&(r<0?f<0:f>0))return zo(e,p,t,r,i)}var h=u.find(r<0?-1:1);return(r<0?c:l)&&(h=Yo(e,h,r,h.line==t.line?o:null)),h?zo(e,h,t,r,i):null}}return t}function Uo(e,t,n,r,i){var o=r||1,a=zo(e,t,n,o,i)||!i&&zo(e,t,n,o,!0)||zo(e,t,n,-o,i)||!i&&zo(e,t,n,-o,!0);return a||(e.cantEdit=!0,it(e.first,0))}function Yo(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?pt(e,it(t.line-1)):null:n>0&&t.ch==(r||Xe(e,t.line)).text.length?t.line=0;--i)Qo(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Qo(e,t)}}function Qo(e,t){if(1!=t.text.length||""!=t.text[0]||0!=ot(t.from,t.to)){var n=co(e,t);Co(e,t,n,e.cm?e.cm.curOp.id:NaN),ta(e,t,n,Rt(e,t));var r=[];yo(e,(function(e,n){n||-1!=j(r,e.history)||(aa(e.history,t),r.push(e.history)),ta(e,t,null,Rt(e,t))}))}}function $o(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,a=e.sel,s="undo"==t?o.done:o.undone,u="undo"==t?o.undone:o.done,c=0;c=0;--h){var d=f(h);if(d)return d.v}}}}function ea(e,t){if(0!=t&&(e.first+=t,e.sel=new ro(X(e.sel.ranges,(function(e){return new io(it(e.anchor.line+t,e.anchor.ch),it(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){Ir(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:it(o,Xe(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Je(e,t.from,t.to),n||(n=co(e,t)),e.cm?na(e.cm,t,r):vo(e,t,r),Go(e,n,H),e.cantEdit&&Uo(e,it(e.firstLine(),0))&&(e.cantEdit=!1)}}function na(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,s=!1,u=o.line;e.options.lineWrapping||(u=et(Jt(Xe(r,o.line))),r.iter(u,a.line+1,(function(e){if(e==i.maxLine)return s=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&_e(e),vo(r,t,n,qr(e)),e.options.lineWrapping||(r.iter(u,o.line+t.text.length,(function(e){var t=an(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),wt(r,o.line),Oi(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?Ir(e):o.line!=a.line||1!=t.text.length||mo(e.doc,t)?Ir(e,o.line,a.line+1,c):Nr(e,o.line,"text");var l=Ee(e,"changes"),p=Ee(e,"change");if(p||l){var f={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};p&&Sn(e,"change",e,f),l&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}function ra(e,t,n,r,i){var o;r||(r=n),ot(r,n)<0&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),Jo(e,{from:n,to:r,text:t,origin:i})}function ia(e,t,n,r){n1||!(this.children[0]instanceof ua))){var s=[];this.collapse(s),this.children=[new ua(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var a=i.lines.length%25+25,s=a;s10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=F("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Xt(e,t.line,t,n,o)||t.line!=n.line&&Xt(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Mt()}o.addToHistory&&Co(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,u=t.line,c=e.cm;if(e.iter(u,n.line+1,(function(r){c&&o.collapsed&&!c.options.lineWrapping&&Jt(r)==c.display.maxLine&&(s=!0),o.collapsed&&u!=t.line&&$e(r,0),Pt(r,new qt(o,u==t.line?t.ch:null,u==n.line?n.ch:null),e.cm&&e.cm.curOp),++u})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){nn(e,t)&&$e(t,0)})),o.clearOnEnter&&de(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Ft(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ha,o.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),o.collapsed)Ir(c,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var l=t.line;l<=n.line;l++)Nr(c,l,"text");o.atomic&&Zo(c.doc),Sn(c,"markerAdded",c,o)}return o}da.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Di(e),Ee(this,"clear")){var n=this.find();n&&Sn(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=l,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Ir(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Zo(e.doc)),e&&Sn(e,"markerCleared",e,this,r,i),t&&Ai(e),this.parent&&this.parent.clear()}},da.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i=0;u--)Jo(this,r[u]);s?jo(this,s):this.cm&&ai(this.cm)})),undo:Bi((function(){$o(this,"undo")})),redo:Bi((function(){$o(this,"redo")})),undoSelection:Bi((function(){$o(this,"undo",!0)})),redoSelection:Bi((function(){$o(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=pt(this,e),t=pt(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s=u.to||null==u.from&&i!=e.line||null!=u.from&&i==t.line&&u.from>=t.ch||n&&!n(u.marker)||r.push(u.marker.parent||u.marker)}++i})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=o,++n})),pt(this,it(n,t))},indexFromPos:function(e){var t=(e=pt(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var p=e.dataTransfer.getData("Text");if(p){var f;if(t.state.draggingText&&!t.state.draggingText.copy&&(f=t.listSelections()),Go(t.doc,ao(n,n)),f)for(var h=0;h=0;t--)ra(e.doc,"",r[t].from,r[t].to,"+delete");ai(e)}))}function za(e,t,n){var r=ae(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Ua(e,t,n){var r=za(e,t.ch,n);return null==r?null:new it(t.line,r,n<0?"after":"before")}function Ya(e,t,n,r,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=fe(n,t.doc.direction);if(o){var a,s=i<0?K(o):o[0],u=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var c=tr(t,n);a=i<0?n.text.length-1:0;var l=nr(t,c,a).top;a=se((function(e){return nr(t,c,e).top==l}),i<0==(1==s.level)?s.from:s.to-1,a),"before"==u&&(a=za(n,a,1))}else a=i<0?s.to:s.from;return new it(r,a,u)}}return new it(r,i<0?n.text.length:0,i<0?"before":"after")}function Ka(e,t,n,r){var i=fe(t,e.doc.direction);if(!i)return Ua(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=le(i,n.ch,n.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from=a.from&&f>=l.begin)){var h=p?"before":"after";return new it(n.line,f,h)}}var d=function(e,t,r){for(var o=function(e,t){return t?new it(n.line,u(e,1),"before"):new it(n.line,e,"after")};e>=0&&e0==(1!=a.level),c=s?r.begin:u(r.end,-1);if(a.from<=c&&c0?l.end:u(l.begin,-1);return null==v||r>0&&v==t.text.length||!(m=d(r>0?0:i.length-1,r,c(v)))?null:m}Na.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Na.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Na.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Na.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Na.default=g?Na.macDefault:Na.pcDefault;var Xa={selectAll:Ko,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),H)},killLine:function(e){return Va(e,(function(t){if(t.empty()){var n=Xe(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new it(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),it(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Xe(e.doc,i.line-1).text;a&&(i=new it(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),it(i.line-1,a.length-1),i,"+transpose"))}n.push(new io(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){return Fi(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r-1&&(ot((i=s.ranges[i]).from(),t)<0||t.xRel>0)&&(ot(i.to(),t)>0||t.xRel<0)?bs(e,r,t,o):As(e,r,t,o)}function bs(e,t,n,r){var i=e.display,o=!1,c=Mi(e,(function(t){u&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Kr(e)),ve(i.wrapper.ownerDocument,"mouseup",c),ve(i.wrapper.ownerDocument,"mousemove",l),ve(i.scroller,"dragstart",p),ve(i.scroller,"drop",c),o||(De(t),r.addNew||Po(e.doc,n,null,null,r.extend),u&&!f||a&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),l=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},p=function(){return o=!0};u&&(i.scroller.draggable=!0),e.state.draggingText=c,c.copy=!r.moveOnDrag,de(i.wrapper.ownerDocument,"mouseup",c),de(i.wrapper.ownerDocument,"mousemove",l),de(i.scroller,"dragstart",p),de(i.scroller,"drop",c),e.state.delayingBlurEvent=!0,setTimeout((function(){return i.input.focus()}),20),i.scroller.dragDrop&&i.scroller.dragDrop()}function Ds(e,t,n){if("char"==n)return new io(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new io(it(t.line,0),pt(e.doc,it(t.line+1,0)));var r=n(e,t);return new io(r.from,r.to)}function As(e,t,n,r){a&&Kr(e);var i=e.display,o=e.doc;De(t);var s,u,c=o.sel,l=c.ranges;if(r.addNew&&!r.extend?(u=o.sel.contains(n),s=u>-1?l[u]:new io(n,n)):(s=o.sel.primary(),u=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(s=new io(n,n)),n=Or(e,t,!0,!0),u=-1;else{var p=Ds(e,n,r.unit);s=r.extend?Oo(s,p.anchor,p.head,r.extend):p}r.addNew?-1==u?(u=l.length,Wo(o,oo(e,l.concat([s]),u),{scroll:!1,origin:"*mouse"})):l.length>1&&l[u].empty()&&"char"==r.unit&&!r.extend?(Wo(o,oo(e,l.slice(0,u).concat(l.slice(u+1)),0),{scroll:!1,origin:"*mouse"}),c=o.sel):No(o,u,s,Z):(u=0,Wo(o,new ro([s],0),Z),c=o.sel);var f=n;function h(t){if(0!=ot(f,t))if(f=t,"rectangle"==r.unit){for(var i=[],a=e.options.tabSize,l=R(Xe(o,n.line).text,n.ch,a),p=R(Xe(o,t.line).text,t.ch,a),h=Math.min(l,p),d=Math.max(l,p),m=Math.min(n.line,t.line),v=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=v;m++){var y=Xe(o,m).text,g=z(y,h,a);h==d?i.push(new io(it(m,g),it(m,g))):y.length>g&&i.push(new io(it(m,g),it(m,z(y,d,a))))}i.length||i.push(new io(n,n)),Wo(o,oo(e,c.ranges.slice(0,u).concat(i),u),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var _,E=s,b=Ds(e,t,r.unit),D=E.anchor;ot(b.anchor,D)>0?(_=b.head,D=ct(E.from(),b.anchor)):(_=b.anchor,D=ut(E.to(),b.head));var A=c.ranges.slice(0);A[u]=ks(e,new io(pt(o,D),_)),Wo(o,oo(e,A,u),Z)}}var d=i.wrapper.getBoundingClientRect(),m=0;function v(t){var n=++m,a=Or(e,t,!0,"rectangle"==r.unit);if(a)if(0!=ot(a,f)){e.curOp.focus=q(),h(a);var s=ei(i,o);(a.line>=s.to||a.lined.bottom?20:0;u&&setTimeout(Mi(e,(function(){m==n&&(i.scroller.scrollTop+=u,v(t))})),50)}}function y(t){e.state.selectingText=!1,m=1/0,t&&(De(t),i.input.focus()),ve(i.wrapper.ownerDocument,"mousemove",g),ve(i.wrapper.ownerDocument,"mouseup",_),o.history.lastSelOrigin=null}var g=Mi(e,(function(e){0!==e.buttons&&we(e)?v(e):y(e)})),_=Mi(e,y);e.state.selectingText=_,de(i.wrapper.ownerDocument,"mousemove",g),de(i.wrapper.ownerDocument,"mouseup",_)}function ks(e,t){var n=t.anchor,r=t.head,i=Xe(e.doc,n.line);if(0==ot(n,r)&&n.sticky==r.sticky)return t;var o=fe(i);if(!o)return t;var a=le(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var u,c=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==c||c==o.length)return t;if(r.line!=n.line)u=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var l=le(o,r.ch,r.sticky),p=l-a||(r.ch-n.ch)*(1==s.level?-1:1);u=l==c-1||l==c?p<0:p>0}var f=o[c+(u?-1:0)],h=u==(1==f.level),d=h?f.from:f.to,m=h?"after":"before";return n.ch==d&&n.sticky==m?t:new io(new it(n.line,d,m),r)}function Cs(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(l){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&De(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!Ee(e,n))return ke(t);o-=s.top-a.viewOffset;for(var u=0;u=i)return ye(e,n,e,tt(e.doc,o),e.display.gutterSpecs[u].className,t),ke(t)}}function xs(e,t){return Cs(e,t,"gutterClick",!0)}function ws(e,t){Hn(e.display,t)||Ss(e,t)||ge(e,t,"contextmenu")||A||e.display.input.onContextMenu(t)}function Ss(e,t){return!!Ee(e,"gutterContextMenu")&&Cs(e,t,"gutterContextMenu",!1)}function Ts(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),pr(e)}ms.prototype.compare=function(e,t,n){return this.time+ds>e&&0==ot(t,this.pos)&&n==this.button};var Fs={toString:function(){return"CodeMirror.Init"}},Ms={},qs={};function Bs(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=Fs&&i(e,t,n)}:i)}e.defineOption=n,e.Init=Fs,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,fo(e)}),!0),n("indentUnit",2,fo,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){ho(e),pr(e),Ir(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(it(r,o))}r++}));for(var i=n.length-1;i>=0;i--)ra(e.doc,t,n[i],it(n[i].line,n[i].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Fs&&e.refresh()})),n("specialCharPlaceholder",mn,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",y?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!E),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){Ts(e),Xi(e)}),!0),n("keyMap","default",(function(e,t,n){var r=Za(t),i=n!=Fs&&Za(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ps,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=Yi(t,e.options.lineNumbers),Xi(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?Mr(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return yi(e)}),!0),n("scrollbarStyle","native",(function(e){Ei(e),yi(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=Yi(e.options.gutters,t),Xi(e)}),!0),n("firstLineNumber",1,Xi,!0),n("lineNumberFormatter",(function(e){return e}),Xi,!0),n("showCursorWhenSelecting",!1,Gr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Jr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,Os),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Gr,!0),n("singleCursorHeightPerLine",!0,Gr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,ho,!0),n("addModeClass",!1,ho,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,ho,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}function Os(e,t,n){if(!t!=!(n&&n!=Fs)){var r=e.display.dragFunctions,i=t?de:ve;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function Ps(e){e.options.lineWrapping?(B(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(x(e.display.wrapper,"CodeMirror-wrap"),sn(e)),Br(e),Ir(e),pr(e),setTimeout((function(){return yi(e)}),100)}function Is(e,t){var n=this;if(!(this instanceof Is))return new Is(e,t);this.options=t=t?N(t):{},N(Ms,t,!1);var r=t.value;"string"==typeof r?r=new Da(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Is.inputStyles[t.inputStyle](this),o=this.display=new Ji(e,r,i,t);for(var c in o.wrapper.CodeMirror=this,Ts(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ei(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new L,keySeq:null,specialChars:null},t.autofocus&&!y&&o.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),Ns(this),Fa(),Di(this),this.curOp.forceUpdate=!0,go(this,r),t.autofocus&&!y||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Xr(n)}),20):Jr(this),qs)qs.hasOwnProperty(c)&&qs[c](this,t[c],Fs);Ui(this),t.finishInit&&t.finishInit(this);for(var l=0;l400}de(t.scroller,"touchstart",(function(i){if(!ge(e,i)&&!o(i)&&!xs(e,i)){t.input.ensurePolled(),clearTimeout(n);var a=+new Date;t.activeTouch={start:a,moved:!1,prev:a-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),de(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),de(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!Hn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var o,a=e.coordsChar(t.activeTouch,"page");o=!r.prev||u(r,r.prev)?new io(a,a):!r.prev.prev||u(r,r.prev.prev)?e.findWordAt(a):new io(it(a.line,0),pt(e.doc,it(a.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),De(n)}i()})),de(t.scroller,"touchcancel",i),de(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(pi(e,t.scroller.scrollTop),hi(e,t.scroller.scrollLeft,!0),ye(e,"scroll",e))})),de(t.scroller,"mousewheel",(function(t){return no(e,t)})),de(t.scroller,"DOMMouseScroll",(function(t){return no(e,t)})),de(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){ge(e,t)||Ce(t)},over:function(t){ge(e,t)||(xa(e,t),Ce(t))},start:function(t){return Ca(e,t)},drop:Mi(e,ka),leave:function(t){ge(e,t)||wa(e)}};var c=t.input.getField();de(c,"keyup",(function(t){return ls.call(e,t)})),de(c,"keydown",Mi(e,us)),de(c,"keypress",Mi(e,ps)),de(c,"focus",(function(t){return Xr(e,t)})),de(c,"blur",(function(t){return Jr(e,t)}))}Is.defaults=Ms,Is.optionHandlers=qs;var Rs=[];function Ls(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=gt(e,t).state:n="prev");var a=e.options.tabSize,s=Xe(o,t),u=R(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,l=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((c=o.mode.indent(i,s.text.slice(l.length),s.text))==G||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?R(Xe(o,t-1).text,null,a):0:"add"==n?c=u+e.options.indentUnit:"subtract"==n?c=u-e.options.indentUnit:"number"==typeof n&&(c=u+n),c=Math.max(0,c);var p="",f=0;if(e.options.indentWithTabs)for(var h=Math.floor(c/a);h;--h)f+=a,p+="\t";if(fa,u=Be(t),c=null;if(s&&r.ranges.length>1)if(js&&js.text.join("\n")==t){if(r.ranges.length%js.text.length==0){c=[];for(var l=0;l=0;f--){var h=r.ranges[f],d=h.from(),m=h.to();h.empty()&&(n&&n>0?d=it(d.line,d.ch-n):e.state.overwrite&&!s?m=it(m.line,Math.min(Xe(o,m.line).text.length,m.ch+K(u).length)):s&&js&&js.lineWise&&js.text.join("\n")==u.join("\n")&&(d=m=it(d.line,0)));var v={from:d,to:m,text:c?c[f%c.length]:u,origin:i||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};Jo(e.doc,v),Sn(e,"inputRead",e,v)}t&&!s&&Zs(e,t),ai(e),e.curOp.updateInput<2&&(e.curOp.updateInput=p),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Hs(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Fi(t,(function(){return Gs(t,n,0,null,"paste")})),!0}function Zs(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s-1){a=Ls(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Xe(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Ls(e,i.head.line,"smart"));a&&Sn(e,"electricInput",e,i.head.line)}}}function Vs(e){for(var t=[],n=[],r=0;rn&&(Ls(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&ai(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var u=s;u0&&No(this.doc,r,new io(o,c[r].to()),H)}}})),getTokenAt:function(e,t){return At(this,e,t)},getLineTokens:function(e,t){return At(this,it(e),t,!0)},getTokenTypeAt:function(e){e=pt(this.doc,e);var t,n=yt(this,Xe(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]o&&(e=o,i=!0),r=Xe(this.doc,e)}else r=e;return mr(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-on(r):0)},defaultTextHeight:function(){return Sr(this.display)},defaultCharWidth:function(){return Tr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display,a=(e=gr(this,pt(this.doc,e))).bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)a=e.top;else if("above"==r||"near"==r){var u=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>u)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=u&&(a=e.bottom),s+t.offsetWidth>c&&(s=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),n&&ri(this,{left:s,top:a,right:s+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:qi(us),triggerOnKeyPress:qi(ps),triggerOnKeyUp:ls,triggerOnMouseDown:qi(ys),execCommand:function(e){if(Xa.hasOwnProperty(e))return Xa[e].call(null,this)},triggerElectric:qi((function(e){Zs(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=pt(this.doc,e),a=0;a0&&a(t.charAt(n-1));)--n;for(;r.5||this.options.lineWrapping)&&Br(this),ye(this,"refresh",this)})),swapDoc:qi((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),go(this,e),pr(this),this.display.input.reset(),si(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Sn(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},be(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}function Ks(e,t,n,r,i){var o=t,a=n,s=Xe(e,t.line),u=i&&"rtl"==e.direction?-n:n;function c(){var n=t.line+u;return!(n=e.first+e.size)&&(t=new it(n,t.ch,t.sticky),s=Xe(e,n))}function l(o){var a;if("codepoint"==r){var l=s.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(l))a=null;else{var p=n>0?l>=55296&&l<56320:l>=56320&&l<57343;a=new it(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(p?2:1))),-n)}}else a=i?Ka(e.cm,s,t,n):Ua(s,t,n);if(null==a){if(o||!c())return!1;t=Ya(i,e.cm,s,t.line,u)}else t=a;return!0}if("char"==r||"codepoint"==r)l();else if("column"==r)l(!0);else if("word"==r||"group"==r)for(var p=null,f="group"==r,h=e.cm&&e.cm.getHelper(t,"wordChars"),d=!0;!(n<0)||l(!d);d=!1){var m=s.text.charAt(t.ch)||"\n",v=ne(m,h)?"w":f&&"\n"==m?"n":!f||/\s/.test(m)?null:"p";if(!f||d||v||(v="s"),p&&p!=v){n<0&&(n=1,l(),t.sticky="after");break}if(v&&(p=v),n>0&&!l(!d))break}var y=Uo(e,t,o,a,!0);return at(o,y)&&(y.hitSide=!0),y}function Xs(e,t,n,r){var i,o,a=e.doc,s=t.left;if("page"==r){var u=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(u-.5*Sr(e.display),3);i=(n>0?t.bottom:t.top)+n*c}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(o=br(e,s,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}var Js=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new L,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Qs(e,t){var n=er(e,t.line);if(!n||n.hidden)return null;var r=Xe(e.doc,t.line),i=Jn(n,r,t.line),o=fe(r,e.doc.direction),a="left";o&&(a=le(o,t.ch)%2?"right":"left");var s=or(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function $s(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function eu(e,t){return t&&(e.bad=!0),e}function tu(e,t,n,r,i){var o="",a=!1,s=e.doc.lineSeparator(),u=!1;function c(e){return function(t){return t.id==e}}function l(){a&&(o+=s,u&&(o+=s),a=u=!1)}function p(e){e&&(l(),o+=e)}function f(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void p(n);var o,h=t.getAttribute("cm-marker");if(h){var d=e.findMarks(it(r,0),it(i+1,0),c(+h));return void(d.length&&(o=d[0].find(0))&&p(Je(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var m=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;m&&l();for(var v=0;v=t.display.viewTo||o.line=t.display.viewFrom&&Qs(t,i)||{node:u[0].measure.map[2],offset:0},l=o.liner.firstLine()&&(a=it(a.line-1,Xe(r.doc,a.line-1).length)),s.ch==Xe(r.doc,s.line).text.length&&s.linei.viewTo-1)return!1;a.line==i.viewFrom||0==(e=Pr(r,a.line))?(t=et(i.view[0].line),n=i.view[0].node):(t=et(i.view[e].line),n=i.view[e-1].node.nextSibling);var u,c,l=Pr(r,s.line);if(l==i.view.length-1?(u=i.viewTo-1,c=i.lineDiv.lastChild):(u=et(i.view[l+1].line)-1,c=i.view[l+1].node.previousSibling),!n)return!1;for(var p=r.doc.splitLines(tu(r,n,c,t,u)),f=Je(r.doc,it(t,0),it(u,Xe(r.doc,u).text.length));p.length>1&&f.length>1;)if(K(p)==K(f))p.pop(),f.pop(),u--;else{if(p[0]!=f[0])break;p.shift(),f.shift(),t++}for(var h=0,d=0,m=p[0],v=f[0],y=Math.min(m.length,v.length);ha.ch&&g.charCodeAt(g.length-d-1)==_.charCodeAt(_.length-d-1);)h--,d++;p[p.length-1]=g.slice(0,g.length-d).replace(/^\u200b+/,""),p[0]=p[0].slice(h).replace(/\u200b+$/,"");var b=it(t,h),D=it(u,f.length?K(f).length-d:0);return p.length>1||p[0]||ot(b,D)?(ra(r.doc,p,b,D,"+input"),!0):void 0},Js.prototype.ensurePolled=function(){this.forceCompositionEnd()},Js.prototype.reset=function(){this.forceCompositionEnd()},Js.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Js.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Js.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Fi(this.cm,(function(){return Ir(e.cm)}))},Js.prototype.setUneditable=function(e){e.contentEditable="false"},Js.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Mi(this.cm,Gs)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Js.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Js.prototype.onContextMenu=function(){},Js.prototype.resetPosition=function(){},Js.prototype.needsContentAttribute=!0;var iu=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new L,this.hasSelection=!1,this.composing=null};function ou(e,t){if((t=t?N(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=q();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=s.getValue()}var i;if(e.form&&(de(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(u){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(ve(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var s=Is((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s}function au(e){e.off=ve,e.on=de,e.wheelEventPixels=to,e.Doc=Da,e.splitLines=Be,e.countColumn=R,e.findColumn=z,e.isWordChar=te,e.Pass=G,e.signal=ye,e.Line=un,e.changeEnd=so,e.scrollbarModel=_i,e.Pos=it,e.cmpPos=ot,e.modes=Re,e.mimeModes=Le,e.resolveMode=Ge,e.getMode=He,e.modeExtensions=Ze,e.extendMode=Ve,e.copyState=ze,e.startState=Ye,e.innerMode=Ue,e.commands=Xa,e.keyMap=Na,e.keyName=Ha,e.isModifierKey=Wa,e.lookupKey=ja,e.normalizeKeyMap=La,e.StringStream=Ke,e.SharedTextMarker=va,e.TextMarker=da,e.LineWidget=la,e.e_preventDefault=De,e.e_stopPropagation=Ae,e.e_stop=Ce,e.addClass=B,e.contains=M,e.rmClass=x,e.keyNames=Ba}iu.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!ge(r,e)){if(r.somethingSelected())Ws({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=Vs(r);Ws({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,H):(n.prevInput="",i.value=t.text.join("\n"),P(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(i.style.width="0px"),de(i,"input",(function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),de(i,"paste",(function(e){ge(r,e)||Hs(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),de(i,"cut",o),de(i,"copy",o),de(e.scroller,"paste",(function(t){if(!Hn(e,t)&&!ge(r,t)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),de(e.lineSpace,"selectstart",(function(t){Hn(e,t)||De(t)})),de(i,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),de(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},iu.prototype.createField=function(e){this.wrapper=Us(),this.textarea=this.wrapper.firstChild},iu.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},iu.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Hr(e);if(e.options.moveInputWithCursor){var i=gr(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},iu.prototype.showSelection=function(e){var t=this.cm.display;S(t.cursorDiv,e.cursors),S(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},iu.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&P(this.textarea),a&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},iu.prototype.getField=function(){return this.textarea},iu.prototype.supportsTouch=function(){return!1},iu.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!y||q()!=this.textarea))try{this.textarea.focus()}catch(e){}},iu.prototype.blur=function(){this.textarea.blur()},iu.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},iu.prototype.receivedFocus=function(){this.slowPoll()},iu.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},iu.prototype.fastPoll=function(){var e=!1,t=this;function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}t.pollingFast=!0,t.polling.set(20,n)},iu.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Oe(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===i||g&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="\u200b"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var u=0,c=Math.min(r.length,i.length);u1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},iu.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},iu.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},iu.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=Or(n,e),c=r.scroller.scrollTop;if(o&&!p){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&Mi(n,Wo)(n.doc,ao(o),H);var l,f=i.style.cssText,h=t.wrapper.style.cssText,d=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-d.top-5)+"px; left: "+(e.clientX-d.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",u&&(l=window.scrollY),r.input.focus(),u&&window.scrollTo(null,l),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=v,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&s>=9&&m(),A?(Ce(e),de(window,"mouseup",(function e(){ve(window,"mouseup",e),setTimeout(v,20)}))):setTimeout(v,50)}function m(){if(null!=i.selectionStart){var e=n.somethingSelected(),o="\u200b"+(e?i.value:"");i.value="\u21da",i.value=o,t.prevInput=e?"":"\u200b",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=h,i.style.cssText=f,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=c),null!=i.selectionStart)){(!a||a&&s<9)&&m();var e=0,o=function o(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"\u200b"==t.prevInput?Mi(n,Ko)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},iu.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},iu.prototype.setUneditable=function(){},iu.prototype.needsContentAttribute=!1,Bs(Is),Ys(Is);var su="iter insert remove copy getEditor constructor".split(" ");for(var uu in Da.prototype)Da.prototype.hasOwnProperty(uu)&&j(su,uu)<0&&(Is.prototype[uu]=function(e){return function(){return e.apply(this.doc,arguments)}}(Da.prototype[uu]));return be(Da),Is.inputStyles={textarea:iu,contenteditable:Js},Is.defineMode=function(e){Is.defaults.mode||"null"==e||(Is.defaults.mode=e),je.apply(this,arguments)},Is.defineMIME=We,Is.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Is.defineMIME("text/plain","null"),Is.defineExtension=function(e,t){Is.prototype[e]=t},Is.defineDocExtension=function(e,t){Da.prototype[e]=t},Is.fromTextArea=ou,au(Is),Is.version="5.65.2",Is}()},5683:function(e,t,n){!function(e){"use strict";e.defineMode("javascript",(function(t,n){var r,i,o=t.indentUnit,a=n.statementIndent,s=n.jsonld,u=n.json||s,c=!1!==n.trackScope,l=n.typescript,p=n.wordCharacters||/[\w$\xa1-\uffff]/,f=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("keyword d"),o=e("operator"),a={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:n,do:n,try:n,finally:n,return:i,break:i,continue:i,new:e("new"),delete:r,void:r,throw:r,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:o,typeof:o,instanceof:o,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:e("this"),class:e("class"),super:e("atom"),yield:r,export:e("export"),import:e("import"),extends:r,await:r}}(),h=/[+\-*&%=<>!?|~^@]/,d=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function m(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}function v(e,t,n){return r=e,i=n,t}function y(e,t){var n=e.next();if('"'==n||"'"==n)return t.tokenize=g(n),t.tokenize(e,t);if("."==n&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return v("number","number");if("."==n&&e.match(".."))return v("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return v(n);if("="==n&&e.eat(">"))return v("=>","operator");if("0"==n&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return v("number","number");if(/\d/.test(n))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),v("number","number");if("/"==n)return e.eat("*")?(t.tokenize=_,_(e,t)):e.eat("/")?(e.skipToEnd(),v("comment","comment")):it(e,t,1)?(m(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),v("regexp","string-2")):(e.eat("="),v("operator","operator",e.current()));if("`"==n)return t.tokenize=E,E(e,t);if("#"==n&&"!"==e.peek())return e.skipToEnd(),v("meta","meta");if("#"==n&&e.eatWhile(p))return v("variable","property");if("<"==n&&e.match("!--")||"-"==n&&e.match("->")&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),v("comment","comment");if(h.test(n))return">"==n&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=n&&"="!=n||e.eat("="):/[<>*+\-|&?]/.test(n)&&(e.eat(n),">"==n&&e.eat(n))),"?"==n&&e.eat(".")?v("."):v("operator","operator",e.current());if(p.test(n)){e.eatWhile(p);var r=e.current();if("."!=t.lastType){if(f.propertyIsEnumerable(r)){var i=f[r];return v(i.type,i.style,r)}if("async"==r&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return v("async","keyword",r)}return v("variable","variable",r)}}function g(e){return function(t,n){var r,i=!1;if(s&&"@"==t.peek()&&t.match(d))return n.tokenize=y,v("jsonld-keyword","meta");for(;null!=(r=t.next())&&(r!=e||i);)i=!i&&"\\"==r;return i||(n.tokenize=y),v("string","string")}}function _(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=y;break}r="*"==n}return v("comment","comment")}function E(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=y;break}r=!r&&"\\"==n}return v("quasi","string-2",e.current())}var b="([{}])";function D(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(n<0)){if(l){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));r&&(n=r.index)}for(var i=0,o=!1,a=n-1;a>=0;--a){var s=e.string.charAt(a),u=b.indexOf(s);if(u>=0&&u<3){if(!i){++a;break}if(0==--i){"("==s&&(o=!0);break}}else if(u>=3&&u<6)++i;else if(p.test(s))o=!0;else if(/["'\/`]/.test(s))for(;;--a){if(0==a)return;if(e.string.charAt(a-1)==s&&"\\"!=e.string.charAt(a-2)){a--;break}}else if(o&&!i){++a;break}}o&&!i&&(t.fatArrowAt=a)}}var A={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function k(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function C(e,t){if(!c)return!1;for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==t)return!0}function x(e,t,n,r,i){var o=e.cc;for(w.state=e,w.stream=i,w.marked=null,w.cc=o,w.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():u?V:H)(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return w.marked?w.marked:"variable"==n&&C(e,r)?"variable-2":t}}var w={state:null,column:null,marked:null,cc:null};function S(){for(var e=arguments.length-1;e>=0;e--)w.cc.push(arguments[e])}function T(){return S.apply(null,arguments),!0}function F(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function M(e){var t=w.state;if(w.marked="def",c){if(t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var r=q(e,t.context);if(null!=r)return void(t.context=r)}else if(!F(e,t.localVars))return void(t.localVars=new P(e,t.localVars));n.globalVars&&!F(e,t.globalVars)&&(t.globalVars=new P(e,t.globalVars))}}function q(e,t){if(t){if(t.block){var n=q(e,t.prev);return n?n==t.prev?t:new O(n,t.vars,!0):null}return F(e,t.vars)?t:new O(t.prev,new P(e,t.vars),!1)}return null}function B(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function O(e,t,n){this.prev=e,this.vars=t,this.block=n}function P(e,t){this.name=e,this.next=t}var I=new P("this",new P("arguments",null));function N(){w.state.context=new O(w.state.context,w.state.localVars,!1),w.state.localVars=I}function R(){w.state.context=new O(w.state.context,w.state.localVars,!0),w.state.localVars=null}function L(){w.state.localVars=w.state.context.vars,w.state.context=w.state.context.prev}function j(e,t){var n=function(){var n=w.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new k(r,w.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function W(){var e=w.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function G(e){function t(n){return n==e?T():";"==e||"}"==n||")"==n||"]"==n?S():T(t)}return t}function H(e,t){return"var"==e?T(j("vardef",t),Se,G(";"),W):"keyword a"==e?T(j("form"),U,H,W):"keyword b"==e?T(j("form"),H,W):"keyword d"==e?w.stream.match(/^\s*$/,!1)?T():T(j("stat"),K,G(";"),W):"debugger"==e?T(G(";")):"{"==e?T(j("}"),R,fe,W,L):";"==e?T():"if"==e?("else"==w.state.lexical.info&&w.state.cc[w.state.cc.length-1]==W&&w.state.cc.pop()(),T(j("form"),U,H,W,Oe)):"function"==e?T(Re):"for"==e?T(j("form"),R,Pe,H,L,W):"class"==e||l&&"interface"==t?(w.marked="keyword",T(j("form","class"==e?e:t),He,W)):"variable"==e?l&&"declare"==t?(w.marked="keyword",T(H)):l&&("module"==t||"enum"==t||"type"==t)&&w.stream.match(/^\s*\w/,!1)?(w.marked="keyword","enum"==t?T(tt):"type"==t?T(je,G("operator"),ye,G(";")):T(j("form"),Te,G("{"),j("}"),fe,W,W)):l&&"namespace"==t?(w.marked="keyword",T(j("form"),V,H,W)):l&&"abstract"==t?(w.marked="keyword",T(H)):T(j("stat"),oe):"switch"==e?T(j("form"),U,G("{"),j("}","switch"),R,fe,W,W,L):"case"==e?T(V,G(":")):"default"==e?T(G(":")):"catch"==e?T(j("form"),N,Z,H,W,L):"export"==e?T(j("stat"),Ue,W):"import"==e?T(j("stat"),Ke,W):"async"==e?T(H):"@"==t?T(V,H):S(j("stat"),V,G(";"),W)}function Z(e){if("("==e)return T(We,G(")"))}function V(e,t){return Y(e,t,!1)}function z(e,t){return Y(e,t,!0)}function U(e){return"("!=e?S():T(j(")"),K,G(")"),W)}function Y(e,t,n){if(w.state.fatArrowAt==w.stream.start){var r=n?te:ee;if("("==e)return T(N,j(")"),le(We,")"),W,G("=>"),r,L);if("variable"==e)return S(N,Te,G("=>"),r,L)}var i=n?J:X;return A.hasOwnProperty(e)?T(i):"function"==e?T(Re,i):"class"==e||l&&"interface"==t?(w.marked="keyword",T(j("form"),Ge,W)):"keyword c"==e||"async"==e?T(n?z:V):"("==e?T(j(")"),K,G(")"),W,i):"operator"==e||"spread"==e?T(n?z:V):"["==e?T(j("]"),et,W,i):"{"==e?pe(se,"}",null,i):"quasi"==e?S(Q,i):"new"==e?T(ne(n)):T()}function K(e){return e.match(/[;\}\)\],]/)?S():S(V)}function X(e,t){return","==e?T(K):J(e,t,!1)}function J(e,t,n){var r=0==n?X:J,i=0==n?V:z;return"=>"==e?T(N,n?te:ee,L):"operator"==e?/\+\+|--/.test(t)||l&&"!"==t?T(r):l&&"<"==t&&w.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?T(j(">"),le(ye,">"),W,r):"?"==t?T(V,G(":"),i):T(i):"quasi"==e?S(Q,r):";"!=e?"("==e?pe(z,")","call",r):"."==e?T(ae,r):"["==e?T(j("]"),K,G("]"),W,r):l&&"as"==t?(w.marked="keyword",T(ye,r)):"regexp"==e?(w.state.lastType=w.marked="operator",w.stream.backUp(w.stream.pos-w.stream.start-1),T(i)):void 0:void 0}function Q(e,t){return"quasi"!=e?S():"${"!=t.slice(t.length-2)?T(Q):T(K,$)}function $(e){if("}"==e)return w.marked="string-2",w.state.tokenize=E,T(Q)}function ee(e){return D(w.stream,w.state),S("{"==e?H:V)}function te(e){return D(w.stream,w.state),S("{"==e?H:z)}function ne(e){return function(t){return"."==t?T(e?ie:re):"variable"==t&&l?T(Ce,e?J:X):S(e?z:V)}}function re(e,t){if("target"==t)return w.marked="keyword",T(X)}function ie(e,t){if("target"==t)return w.marked="keyword",T(J)}function oe(e){return":"==e?T(W,H):S(X,G(";"),W)}function ae(e){if("variable"==e)return w.marked="property",T()}function se(e,t){return"async"==e?(w.marked="property",T(se)):"variable"==e||"keyword"==w.style?(w.marked="property","get"==t||"set"==t?T(ue):(l&&w.state.fatArrowAt==w.stream.start&&(n=w.stream.match(/^\s*:\s*/,!1))&&(w.state.fatArrowAt=w.stream.pos+n[0].length),T(ce))):"number"==e||"string"==e?(w.marked=s?"property":w.style+" property",T(ce)):"jsonld-keyword"==e?T(ce):l&&B(t)?(w.marked="keyword",T(se)):"["==e?T(V,he,G("]"),ce):"spread"==e?T(z,ce):"*"==t?(w.marked="keyword",T(se)):":"==e?S(ce):void 0;var n}function ue(e){return"variable"!=e?S(ce):(w.marked="property",T(Re))}function ce(e){return":"==e?T(z):"("==e?S(Re):void 0}function le(e,t,n){function r(i,o){if(n?n.indexOf(i)>-1:","==i){var a=w.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),T((function(n,r){return n==t||r==t?S():S(e)}),r)}return i==t||o==t?T():n&&n.indexOf(";")>-1?S(e):T(G(t))}return function(n,i){return n==t||i==t?T():S(e,r)}}function pe(e,t,n){for(var r=3;r"),ye):"quasi"==e?S(be,ke):void 0}function ge(e){if("=>"==e)return T(ye)}function _e(e){return e.match(/[\}\)\]]/)?T():","==e||";"==e?T(_e):S(Ee,_e)}function Ee(e,t){return"variable"==e||"keyword"==w.style?(w.marked="property",T(Ee)):"?"==t||"number"==e||"string"==e?T(Ee):":"==e?T(ye):"["==e?T(G("variable"),de,G("]"),Ee):"("==e?S(Le,Ee):e.match(/[;\}\)\],]/)?void 0:T()}function be(e,t){return"quasi"!=e?S():"${"!=t.slice(t.length-2)?T(be):T(ye,De)}function De(e){if("}"==e)return w.marked="string-2",w.state.tokenize=E,T(be)}function Ae(e,t){return"variable"==e&&w.stream.match(/^\s*[?:]/,!1)||"?"==t?T(Ae):":"==e?T(ye):"spread"==e?T(Ae):S(ye)}function ke(e,t){return"<"==t?T(j(">"),le(ye,">"),W,ke):"|"==t||"."==e||"&"==t?T(ye):"["==e?T(ye,G("]"),ke):"extends"==t||"implements"==t?(w.marked="keyword",T(ye)):"?"==t?T(ye,G(":"),ye):void 0}function Ce(e,t){if("<"==t)return T(j(">"),le(ye,">"),W,ke)}function xe(){return S(ye,we)}function we(e,t){if("="==t)return T(ye)}function Se(e,t){return"enum"==t?(w.marked="keyword",T(tt)):S(Te,he,qe,Be)}function Te(e,t){return l&&B(t)?(w.marked="keyword",T(Te)):"variable"==e?(M(t),T()):"spread"==e?T(Te):"["==e?pe(Me,"]"):"{"==e?pe(Fe,"}"):void 0}function Fe(e,t){return"variable"!=e||w.stream.match(/^\s*:/,!1)?("variable"==e&&(w.marked="property"),"spread"==e?T(Te):"}"==e?S():"["==e?T(V,G("]"),G(":"),Fe):T(G(":"),Te,qe)):(M(t),T(qe))}function Me(){return S(Te,qe)}function qe(e,t){if("="==t)return T(z)}function Be(e){if(","==e)return T(Se)}function Oe(e,t){if("keyword b"==e&&"else"==t)return T(j("form","else"),H,W)}function Pe(e,t){return"await"==t?T(Pe):"("==e?T(j(")"),Ie,W):void 0}function Ie(e){return"var"==e?T(Se,Ne):"variable"==e?T(Ne):S(Ne)}function Ne(e,t){return")"==e?T():";"==e?T(Ne):"in"==t||"of"==t?(w.marked="keyword",T(V,Ne)):S(V,Ne)}function Re(e,t){return"*"==t?(w.marked="keyword",T(Re)):"variable"==e?(M(t),T(Re)):"("==e?T(N,j(")"),le(We,")"),W,me,H,L):l&&"<"==t?T(j(">"),le(xe,">"),W,Re):void 0}function Le(e,t){return"*"==t?(w.marked="keyword",T(Le)):"variable"==e?(M(t),T(Le)):"("==e?T(N,j(")"),le(We,")"),W,me,L):l&&"<"==t?T(j(">"),le(xe,">"),W,Le):void 0}function je(e,t){return"keyword"==e||"variable"==e?(w.marked="type",T(je)):"<"==t?T(j(">"),le(xe,">"),W):void 0}function We(e,t){return"@"==t&&T(V,We),"spread"==e?T(We):l&&B(t)?(w.marked="keyword",T(We)):l&&"this"==e?T(he,qe):S(Te,he,qe)}function Ge(e,t){return"variable"==e?He(e,t):Ze(e,t)}function He(e,t){if("variable"==e)return M(t),T(Ze)}function Ze(e,t){return"<"==t?T(j(">"),le(xe,">"),W,Ze):"extends"==t||"implements"==t||l&&","==e?("implements"==t&&(w.marked="keyword"),T(l?ye:V,Ze)):"{"==e?T(j("}"),Ve,W):void 0}function Ve(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||l&&B(t))&&w.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(w.marked="keyword",T(Ve)):"variable"==e||"keyword"==w.style?(w.marked="property",T(ze,Ve)):"number"==e||"string"==e?T(ze,Ve):"["==e?T(V,he,G("]"),ze,Ve):"*"==t?(w.marked="keyword",T(Ve)):l&&"("==e?S(Le,Ve):";"==e||","==e?T(Ve):"}"==e?T():"@"==t?T(V,Ve):void 0}function ze(e,t){if("!"==t)return T(ze);if("?"==t)return T(ze);if(":"==e)return T(ye,qe);if("="==t)return T(z);var n=w.state.lexical.prev;return S(n&&"interface"==n.info?Le:Re)}function Ue(e,t){return"*"==t?(w.marked="keyword",T($e,G(";"))):"default"==t?(w.marked="keyword",T(V,G(";"))):"{"==e?T(le(Ye,"}"),$e,G(";")):S(H)}function Ye(e,t){return"as"==t?(w.marked="keyword",T(G("variable"))):"variable"==e?S(z,Ye):void 0}function Ke(e){return"string"==e?T():"("==e?S(V):"."==e?S(X):S(Xe,Je,$e)}function Xe(e,t){return"{"==e?pe(Xe,"}"):("variable"==e&&M(t),"*"==t&&(w.marked="keyword"),T(Qe))}function Je(e){if(","==e)return T(Xe,Je)}function Qe(e,t){if("as"==t)return w.marked="keyword",T(Xe)}function $e(e,t){if("from"==t)return w.marked="keyword",T(V)}function et(e){return"]"==e?T():S(le(z,"]"))}function tt(){return S(j("form"),Te,G("{"),j("}"),le(nt,"}"),W,W)}function nt(){return S(Te,qe)}function rt(e,t){return"operator"==e.lastType||","==e.lastType||h.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}function it(e,t,n){return t.tokenize==y&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return N.lex=R.lex=!0,L.lex=!0,W.lex=!0,{startState:function(e){var t={tokenize:y,lastType:"sof",cc:[],lexical:new k((e||0)-o,0,"block",!1),localVars:n.localVars,context:n.localVars&&new O(null,null,!1),indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),D(e,t)),t.tokenize!=_&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==r?n:(t.lastType="operator"!=r||"++"!=i&&"--"!=i?r:"incdec",x(t,n,r,i,e))},indent:function(t,r){if(t.tokenize==_||t.tokenize==E)return e.Pass;if(t.tokenize!=y)return 0;var i,s=r&&r.charAt(0),u=t.lexical;if(!/^\s*else\b/.test(r))for(var c=t.cc.length-1;c>=0;--c){var l=t.cc[c];if(l==W)u=u.prev;else if(l!=Oe&&l!=L)break}for(;("stat"==u.type||"form"==u.type)&&("}"==s||(i=t.cc[t.cc.length-1])&&(i==X||i==J)&&!/^[,\.=+\-*:?[\(]/.test(r));)u=u.prev;a&&")"==u.type&&"stat"==u.prev.type&&(u=u.prev);var p=u.type,f=s==p;return"vardef"==p?u.indented+("operator"==t.lastType||","==t.lastType?u.info.length+1:0):"form"==p&&"{"==s?u.indented:"form"==p?u.indented+o:"stat"==p?u.indented+(rt(t,r)?a||o:0):"switch"!=u.info||f||0==n.doubleIndentSwitch?u.align?u.column+(f?0:1):u.indented+(f?0:o):u.indented+(/^(?:case|default)\b/.test(r)?o:2*o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:u?null:"/*",blockCommentEnd:u?null:"*/",blockCommentContinue:u?null:" * ",lineComment:u?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:u?"json":"javascript",jsonldMode:s,jsonMode:u,expressionAllowed:it,skipExpression:function(t){x(t,"atom","atom","true",new e.StringStream("",2,null))}}})),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/manifest+json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}(n(3668))},1629:function(e,t,n){!function(e){"use strict";e.defineMode("pegjs",(function(t){var n=e.getMode(t,"javascript");function r(e){return e.match(/^[a-zA-Z_][a-zA-Z0-9_]*/)}return{startState:function(){return{inString:!1,stringType:null,inComment:!1,inCharacterClass:!1,braced:0,lhs:!0,localState:null}},token:function(t,i){if(t&&(i.inString||i.inComment||'"'!=t.peek()&&"'"!=t.peek()||(i.stringType=t.peek(),t.next(),i.inString=!0)),i.inString||i.inComment||!t.match("/*")||(i.inComment=!0),i.inString){for(;i.inString&&!t.eol();)t.peek()===i.stringType?(t.next(),i.inString=!1):"\\"===t.peek()?(t.next(),t.next()):t.match(/^.[^\\\"\']*/);return i.lhs?"property string":"string"}if(i.inComment){for(;i.inComment&&!t.eol();)t.match("*/")?i.inComment=!1:t.match(/^.[^\*]*/);return"comment"}if(i.inCharacterClass)for(;i.inCharacterClass&&!t.eol();)t.match(/^[^\]\\]+/)||t.match(/^\\./)||(i.inCharacterClass=!1);else{if("["===t.peek())return t.next(),i.inCharacterClass=!0,"bracket";if(t.match("//"))return t.skipToEnd(),"comment";if(i.braced||"{"===t.peek()){null===i.localState&&(i.localState=e.startState(n));var o=n.token(t,i.localState),a=t.current();if(!o)for(var s=0;s