@sanity/cli 3.62.2 → 3.63.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/_chunks-cjs/cli.js +227 -207
- package/lib/_chunks-cjs/cli.js.map +1 -1
- package/lib/_chunks-cjs/cliWorker.js.map +1 -1
- package/lib/_chunks-cjs/generateAction.js.map +1 -1
- package/lib/_chunks-cjs/getCliConfig.js.map +1 -1
- package/lib/_chunks-cjs/journeyConfig.js.map +1 -1
- package/lib/_chunks-cjs/loadEnv.js.map +1 -1
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/index.mjs.map +1 -1
- package/lib/workers/getCliConfig.js.map +1 -1
- package/lib/workers/typegenGenerate.js.map +1 -1
- package/package.json +10 -10
- package/src/actions/init-project/templates/nextjs/index.ts +16 -0
package/lib/_chunks-cjs/cli.js
CHANGED
@@ -34043,15 +34043,12 @@ function requireLib$1() {
|
|
34043
34043
|
}) => `Unsyntactic ${type2 === "BreakStatement" ? "break" : "continue"}.`,
|
34044
34044
|
IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list.",
|
34045
34045
|
IllegalReturn: "'return' outside of function.",
|
34046
|
-
ImportAttributesUseAssert: "The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `
|
34046
|
+
ImportAttributesUseAssert: "The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedImportAssert` parser plugin to suppress this error.",
|
34047
34047
|
ImportBindingIsString: ({
|
34048
34048
|
importName
|
34049
34049
|
}) => `A string literal cannot be used as an imported binding.
|
34050
34050
|
- Did you mean \`import { "${importName}" as foo }\`?`,
|
34051
|
-
|
34052
|
-
ImportCallArity: ({
|
34053
|
-
maxArgumentCount
|
34054
|
-
}) => `\`import()\` requires exactly ${maxArgumentCount === 1 ? "one argument" : "one or two arguments"}.`,
|
34051
|
+
ImportCallArity: "`import()` requires exactly one or two arguments.",
|
34055
34052
|
ImportCallNotNewExpression: "Cannot use new with import(...).",
|
34056
34053
|
ImportCallSpreadArgument: "`...` is not allowed in `import()`.",
|
34057
34054
|
ImportJSONBindingNotDefault: "A JSON module can only be imported with `default`.",
|
@@ -34460,11 +34457,8 @@ function requireLib$1() {
|
|
34460
34457
|
finishCallExpression(unfinished, optional) {
|
34461
34458
|
const node = super.finishCallExpression(unfinished, optional);
|
34462
34459
|
if (node.callee.type === "Import") {
|
34463
|
-
|
34464
|
-
|
34465
|
-
node.options = (_ref = node.arguments[1]) != null ? _ref : null, node.attributes = (_ref2 = node.arguments[1]) != null ? _ref2 : null;
|
34466
|
-
}
|
34467
|
-
delete node.arguments, delete node.callee;
|
34460
|
+
var _ref, _ref2;
|
34461
|
+
node.type = "ImportExpression", node.source = node.arguments[0], node.options = (_ref = node.arguments[1]) != null ? _ref : null, node.attributes = (_ref2 = node.arguments[1]) != null ? _ref2 : null, delete node.arguments, delete node.callee;
|
34468
34462
|
}
|
34469
34463
|
return node;
|
34470
34464
|
}
|
@@ -34927,6 +34921,9 @@ function requireLib$1() {
|
|
34927
34921
|
name: createToken("name", {
|
34928
34922
|
startsExpr
|
34929
34923
|
}),
|
34924
|
+
placeholder: createToken("%%", {
|
34925
|
+
startsExpr: !0
|
34926
|
+
}),
|
34930
34927
|
string: createToken("string", {
|
34931
34928
|
startsExpr
|
34932
34929
|
}),
|
@@ -34953,22 +34950,19 @@ function requireLib$1() {
|
|
34953
34950
|
jsxTagStart: createToken("jsxTagStart", {
|
34954
34951
|
startsExpr: !0
|
34955
34952
|
}),
|
34956
|
-
jsxTagEnd: createToken("jsxTagEnd")
|
34957
|
-
placeholder: createToken("%%", {
|
34958
|
-
startsExpr: !0
|
34959
|
-
})
|
34953
|
+
jsxTagEnd: createToken("jsxTagEnd")
|
34960
34954
|
};
|
34961
34955
|
function tokenIsIdentifier(token2) {
|
34962
|
-
return token2 >= 93 && token2 <=
|
34956
|
+
return token2 >= 93 && token2 <= 133;
|
34963
34957
|
}
|
34964
34958
|
function tokenKeywordOrIdentifierIsKeyword(token2) {
|
34965
34959
|
return token2 <= 92;
|
34966
34960
|
}
|
34967
34961
|
function tokenIsKeywordOrIdentifier(token2) {
|
34968
|
-
return token2 >= 58 && token2 <=
|
34962
|
+
return token2 >= 58 && token2 <= 133;
|
34969
34963
|
}
|
34970
34964
|
function tokenIsLiteralPropertyName(token2) {
|
34971
|
-
return token2 >= 58 && token2 <=
|
34965
|
+
return token2 >= 58 && token2 <= 137;
|
34972
34966
|
}
|
34973
34967
|
function tokenComesBeforeExpression(token2) {
|
34974
34968
|
return tokenBeforeExprs[token2];
|
@@ -35024,7 +35018,7 @@ function requireLib$1() {
|
|
35024
35018
|
context.push(types2.brace);
|
35025
35019
|
}, tokenTypes[22].updateContext = (context) => {
|
35026
35020
|
context[context.length - 1] === types2.template ? context.pop() : context.push(types2.template);
|
35027
|
-
}, tokenTypes[
|
35021
|
+
}, tokenTypes[143].updateContext = (context) => {
|
35028
35022
|
context.push(types2.j_expr, types2.j_oTag);
|
35029
35023
|
};
|
35030
35024
|
let nonASCIIidentifierStartChars = "\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\u0560-\u0588\u05D0-\u05EA\u05EF-\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\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\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\u09FC\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\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\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\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\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-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\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-\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-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\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-\uAB69\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", nonASCIIidentifierChars = "\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65";
|
@@ -35216,6 +35210,12 @@ function requireLib$1() {
|
|
35216
35210
|
constructor() {
|
35217
35211
|
this.sawUnambiguousESM = !1, this.ambiguousScriptDifferentAst = !1;
|
35218
35212
|
}
|
35213
|
+
sourceToOffsetPos(sourcePos) {
|
35214
|
+
return sourcePos + this.startIndex;
|
35215
|
+
}
|
35216
|
+
offsetToSourcePos(offsetPos) {
|
35217
|
+
return offsetPos - this.startIndex;
|
35218
|
+
}
|
35219
35219
|
hasPlugin(pluginConfig) {
|
35220
35220
|
if (typeof pluginConfig == "string")
|
35221
35221
|
return this.plugins.has(pluginConfig);
|
@@ -35290,7 +35290,7 @@ function requireLib$1() {
|
|
35290
35290
|
containingNode: node,
|
35291
35291
|
start: commentStart
|
35292
35292
|
} = commentWS;
|
35293
|
-
if (this.input.charCodeAt(commentStart - 1) === 44)
|
35293
|
+
if (this.input.charCodeAt(this.offsetToSourcePos(commentStart) - 1) === 44)
|
35294
35294
|
switch (node.type) {
|
35295
35295
|
case "ObjectExpression":
|
35296
35296
|
case "ObjectPattern":
|
@@ -35417,10 +35417,10 @@ function requireLib$1() {
|
|
35417
35417
|
}
|
35418
35418
|
class State {
|
35419
35419
|
constructor() {
|
35420
|
-
this.flags = 1024, this.curLine = void 0, this.lineStart = void 0, this.startLoc = void 0, this.endLoc = void 0, this.errors = [], this.potentialArrowAt = -1, this.noArrowAt = [], this.noArrowParamsConversionAt = [], this.topicContext = {
|
35420
|
+
this.flags = 1024, this.startIndex = void 0, this.curLine = void 0, this.lineStart = void 0, this.startLoc = void 0, this.endLoc = void 0, this.errors = [], this.potentialArrowAt = -1, this.noArrowAt = [], this.noArrowParamsConversionAt = [], this.topicContext = {
|
35421
35421
|
maxNumOfResolvableTopics: 0,
|
35422
35422
|
maxTopicIndex: null
|
35423
|
-
}, this.labels = [], this.commentsLen = 0, this.commentStack = [], this.pos = 0, this.type =
|
35423
|
+
}, this.labels = [], this.commentsLen = 0, this.commentStack = [], this.pos = 0, this.type = 140, this.value = null, this.start = 0, this.end = 0, this.lastTokEndLoc = null, this.lastTokStartLoc = null, this.context = [types2.brace], this.firstInvalidTemplateEscapePos = null, this.strictErrors = /* @__PURE__ */ new Map(), this.tokensLength = 0;
|
35424
35424
|
}
|
35425
35425
|
get strict() {
|
35426
35426
|
return (this.flags & 1) > 0;
|
@@ -35431,10 +35431,11 @@ function requireLib$1() {
|
|
35431
35431
|
init({
|
35432
35432
|
strictMode,
|
35433
35433
|
sourceType,
|
35434
|
+
startIndex,
|
35434
35435
|
startLine,
|
35435
35436
|
startColumn
|
35436
35437
|
}) {
|
35437
|
-
this.strict = strictMode === !1 ? !1 : strictMode === !0 ? !0 : sourceType === "module", this.curLine = startLine, this.lineStart = -startColumn, this.startLoc = this.endLoc = new Position(startLine, startColumn,
|
35438
|
+
this.strict = strictMode === !1 ? !1 : strictMode === !0 ? !0 : sourceType === "module", this.startIndex = startIndex, this.curLine = startLine, this.lineStart = -startColumn, this.startLoc = this.endLoc = new Position(startLine, startColumn, startIndex);
|
35438
35439
|
}
|
35439
35440
|
get maybeInArrowParameters() {
|
35440
35441
|
return (this.flags & 2) > 0;
|
@@ -35509,11 +35510,11 @@ function requireLib$1() {
|
|
35509
35510
|
v ? this.flags |= 4096 : this.flags &= -4097;
|
35510
35511
|
}
|
35511
35512
|
curPosition() {
|
35512
|
-
return new Position(this.curLine, this.pos - this.lineStart, this.pos);
|
35513
|
+
return new Position(this.curLine, this.pos - this.lineStart, this.pos + this.startIndex);
|
35513
35514
|
}
|
35514
35515
|
clone() {
|
35515
35516
|
const state = new State();
|
35516
|
-
return state.flags = this.flags, state.curLine = this.curLine, state.lineStart = this.lineStart, state.startLoc = this.startLoc, state.endLoc = this.endLoc, state.errors = this.errors.slice(), state.potentialArrowAt = this.potentialArrowAt, state.noArrowAt = this.noArrowAt.slice(), state.noArrowParamsConversionAt = this.noArrowParamsConversionAt.slice(), state.topicContext = this.topicContext, state.labels = this.labels.slice(), state.commentsLen = this.commentsLen, state.commentStack = this.commentStack.slice(), state.pos = this.pos, state.type = this.type, state.value = this.value, state.start = this.start, state.end = this.end, state.lastTokEndLoc = this.lastTokEndLoc, state.lastTokStartLoc = this.lastTokStartLoc, state.context = this.context.slice(), state.firstInvalidTemplateEscapePos = this.firstInvalidTemplateEscapePos, state.strictErrors = this.strictErrors, state.tokensLength = this.tokensLength, state;
|
35517
|
+
return state.flags = this.flags, state.startIndex = this.startIndex, state.curLine = this.curLine, state.lineStart = this.lineStart, state.startLoc = this.startLoc, state.endLoc = this.endLoc, state.errors = this.errors.slice(), state.potentialArrowAt = this.potentialArrowAt, state.noArrowAt = this.noArrowAt.slice(), state.noArrowParamsConversionAt = this.noArrowParamsConversionAt.slice(), state.topicContext = this.topicContext, state.labels = this.labels.slice(), state.commentsLen = this.commentsLen, state.commentStack = this.commentStack.slice(), state.pos = this.pos, state.type = this.type, state.value = this.value, state.start = this.start, state.end = this.end, state.lastTokEndLoc = this.lastTokEndLoc, state.lastTokStartLoc = this.lastTokStartLoc, state.context = this.context.slice(), state.firstInvalidTemplateEscapePos = this.firstInvalidTemplateEscapePos, state.strictErrors = this.strictErrors, state.tokensLength = this.tokensLength, state;
|
35517
35518
|
}
|
35518
35519
|
}
|
35519
35520
|
var _isDigit = function(code2) {
|
@@ -35727,7 +35728,8 @@ function requireLib$1() {
|
|
35727
35728
|
const VALID_REGEX_FLAGS = /* @__PURE__ */ new Set([103, 109, 115, 105, 121, 117, 100, 118]);
|
35728
35729
|
class Token {
|
35729
35730
|
constructor(state) {
|
35730
|
-
|
35731
|
+
const startIndex = state.startIndex || 0;
|
35732
|
+
this.type = state.type, this.value = state.value, this.start = startIndex + state.start, this.end = startIndex + state.end, this.loc = new SourceLocation(state.startLoc, state.endLoc);
|
35731
35733
|
}
|
35732
35734
|
}
|
35733
35735
|
class Tokenizer extends CommentsParser {
|
@@ -35823,7 +35825,7 @@ function requireLib$1() {
|
|
35823
35825
|
}
|
35824
35826
|
nextToken() {
|
35825
35827
|
if (this.skipSpace(), this.state.start = this.state.pos, this.isLookahead || (this.state.startLoc = this.state.curPosition()), this.state.pos >= this.length) {
|
35826
|
-
this.finishToken(
|
35828
|
+
this.finishToken(140);
|
35827
35829
|
return;
|
35828
35830
|
}
|
35829
35831
|
this.getTokenFromCode(this.codePointAtPos(this.state.pos));
|
@@ -35840,8 +35842,8 @@ function requireLib$1() {
|
|
35840
35842
|
const comment = {
|
35841
35843
|
type: "CommentBlock",
|
35842
35844
|
value: this.input.slice(start + 2, end),
|
35843
|
-
start,
|
35844
|
-
end: end + commentEnd.length,
|
35845
|
+
start: this.sourceToOffsetPos(start),
|
35846
|
+
end: this.sourceToOffsetPos(end + commentEnd.length),
|
35845
35847
|
loc: new SourceLocation(startLoc, this.state.curPosition())
|
35846
35848
|
};
|
35847
35849
|
return this.options.tokens && this.pushToken(comment), comment;
|
@@ -35858,8 +35860,8 @@ function requireLib$1() {
|
|
35858
35860
|
const end = this.state.pos, comment = {
|
35859
35861
|
type: "CommentLine",
|
35860
35862
|
value: this.input.slice(start + startSkip, end),
|
35861
|
-
start,
|
35862
|
-
end,
|
35863
|
+
start: this.sourceToOffsetPos(start),
|
35864
|
+
end: this.sourceToOffsetPos(end),
|
35863
35865
|
loc: new SourceLocation(startLoc, this.state.curPosition())
|
35864
35866
|
};
|
35865
35867
|
return this.options.tokens && this.pushToken(comment), comment;
|
@@ -35920,8 +35922,8 @@ function requireLib$1() {
|
|
35920
35922
|
}
|
35921
35923
|
if (comments2.length > 0) {
|
35922
35924
|
const end = this.state.pos, commentWhitespace = {
|
35923
|
-
start: spaceStart,
|
35924
|
-
end,
|
35925
|
+
start: this.sourceToOffsetPos(spaceStart),
|
35926
|
+
end: this.sourceToOffsetPos(end),
|
35925
35927
|
comments: comments2,
|
35926
35928
|
leadingNode: null,
|
35927
35929
|
trailingNode: null,
|
@@ -35948,7 +35950,7 @@ function requireLib$1() {
|
|
35948
35950
|
if (this.expectPlugin("recordAndTuple"), this.getPluginOption("recordAndTuple", "syntaxType") === "bar")
|
35949
35951
|
throw this.raise(next === 123 ? Errors.RecordExpressionHashIncorrectStartSyntaxType : Errors.TupleExpressionHashIncorrectStartSyntaxType, this.state.curPosition());
|
35950
35952
|
this.state.pos += 2, next === 123 ? this.finishToken(7) : this.finishToken(1);
|
35951
|
-
} else isIdentifierStart(next) ? (++this.state.pos, this.finishToken(
|
35953
|
+
} else isIdentifierStart(next) ? (++this.state.pos, this.finishToken(139, this.readWord1(next))) : next === 92 ? (++this.state.pos, this.finishToken(139, this.readWord1())) : this.finishOp(27, 1);
|
35952
35954
|
}
|
35953
35955
|
readToken_dot() {
|
35954
35956
|
const next = this.input.charCodeAt(this.state.pos + 1);
|
@@ -36248,7 +36250,7 @@ function requireLib$1() {
|
|
36248
36250
|
break;
|
36249
36251
|
++pos2, mods2 += char;
|
36250
36252
|
}
|
36251
|
-
this.state.pos = pos2, this.finishToken(
|
36253
|
+
this.state.pos = pos2, this.finishToken(138, {
|
36252
36254
|
pattern: content,
|
36253
36255
|
flags: mods2
|
36254
36256
|
});
|
@@ -36261,7 +36263,7 @@ function requireLib$1() {
|
|
36261
36263
|
return this.state.pos = pos2, n;
|
36262
36264
|
}
|
36263
36265
|
readRadixNumber(radix) {
|
36264
|
-
const startLoc = this.state.curPosition();
|
36266
|
+
const start = this.state.pos, startLoc = this.state.curPosition();
|
36265
36267
|
let isBigInt = !1;
|
36266
36268
|
this.state.pos += 2;
|
36267
36269
|
const val = this.readInt(radix);
|
@@ -36276,11 +36278,11 @@ function requireLib$1() {
|
|
36276
36278
|
if (isIdentifierStart(this.codePointAtPos(this.state.pos)))
|
36277
36279
|
throw this.raise(Errors.NumberIdentifier, this.state.curPosition());
|
36278
36280
|
if (isBigInt) {
|
36279
|
-
const str2 = this.input.slice(
|
36280
|
-
this.finishToken(
|
36281
|
+
const str2 = this.input.slice(start, this.state.pos).replace(/[_n]/g, "");
|
36282
|
+
this.finishToken(136, str2);
|
36281
36283
|
return;
|
36282
36284
|
}
|
36283
|
-
this.finishToken(
|
36285
|
+
this.finishToken(135, val);
|
36284
36286
|
}
|
36285
36287
|
readNumber(startsWithDot) {
|
36286
36288
|
const start = this.state.pos, startLoc = this.state.curPosition();
|
@@ -36304,15 +36306,15 @@ function requireLib$1() {
|
|
36304
36306
|
throw this.raise(Errors.NumberIdentifier, this.state.curPosition());
|
36305
36307
|
const str2 = this.input.slice(start, this.state.pos).replace(/[_mn]/g, "");
|
36306
36308
|
if (isBigInt) {
|
36307
|
-
this.finishToken(
|
36309
|
+
this.finishToken(136, str2);
|
36308
36310
|
return;
|
36309
36311
|
}
|
36310
36312
|
if (isDecimal) {
|
36311
|
-
this.finishToken(
|
36313
|
+
this.finishToken(137, str2);
|
36312
36314
|
return;
|
36313
36315
|
}
|
36314
36316
|
const val = isOctal ? parseInt(str2, 8) : parseFloat(str2);
|
36315
|
-
this.finishToken(
|
36317
|
+
this.finishToken(135, val);
|
36316
36318
|
}
|
36317
36319
|
readCodePoint(throwOnInvalid) {
|
36318
36320
|
const {
|
@@ -36328,7 +36330,7 @@ function requireLib$1() {
|
|
36328
36330
|
curLine,
|
36329
36331
|
lineStart
|
36330
36332
|
} = readStringContents(quote === 34 ? "double" : "single", this.input, this.state.pos + 1, this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_string);
|
36331
|
-
this.state.pos = pos2 + 1, this.state.lineStart = lineStart, this.state.curLine = curLine, this.finishToken(
|
36333
|
+
this.state.pos = pos2 + 1, this.state.lineStart = lineStart, this.state.curLine = curLine, this.finishToken(134, str2);
|
36332
36334
|
}
|
36333
36335
|
readTemplateContinuation() {
|
36334
36336
|
this.match(8) || this.unexpected(null, 8), this.state.pos--, this.readTemplateToken();
|
@@ -36341,7 +36343,7 @@ function requireLib$1() {
|
|
36341
36343
|
curLine,
|
36342
36344
|
lineStart
|
36343
36345
|
} = readStringContents("template", this.input, this.state.pos + 1, this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_template);
|
36344
|
-
this.state.pos = pos2 + 1, this.state.lineStart = lineStart, this.state.curLine = curLine, firstInvalidLoc && (this.state.firstInvalidTemplateEscapePos = new Position(firstInvalidLoc.curLine, firstInvalidLoc.pos - firstInvalidLoc.lineStart, firstInvalidLoc.pos)), this.input.codePointAt(pos2) === 96 ? this.finishToken(24, firstInvalidLoc ? null : opening + str2 + "`") : (this.state.pos++, this.finishToken(25, firstInvalidLoc ? null : opening + str2 + "${"));
|
36346
|
+
this.state.pos = pos2 + 1, this.state.lineStart = lineStart, this.state.curLine = curLine, firstInvalidLoc && (this.state.firstInvalidTemplateEscapePos = new Position(firstInvalidLoc.curLine, firstInvalidLoc.pos - firstInvalidLoc.lineStart, this.sourceToOffsetPos(firstInvalidLoc.pos))), this.input.codePointAt(pos2) === 96 ? this.finishToken(24, firstInvalidLoc ? null : opening + str2 + "`") : (this.state.pos++, this.finishToken(25, firstInvalidLoc ? null : opening + str2 + "${"));
|
36345
36347
|
}
|
36346
36348
|
recordStrictModeErrors(toParseError, at) {
|
36347
36349
|
const index = at.index;
|
@@ -36632,10 +36634,10 @@ function requireLib$1() {
|
|
36632
36634
|
}
|
36633
36635
|
}
|
36634
36636
|
canInsertSemicolon() {
|
36635
|
-
return this.match(
|
36637
|
+
return this.match(140) || this.match(8) || this.hasPrecedingLineBreak();
|
36636
36638
|
}
|
36637
36639
|
hasPrecedingLineBreak() {
|
36638
|
-
return hasNewLine(this.input, this.state.lastTokEndLoc.index, this.state.start);
|
36640
|
+
return hasNewLine(this.input, this.offsetToSourcePos(this.state.lastTokEndLoc.index), this.state.start);
|
36639
36641
|
}
|
36640
36642
|
hasFollowingLineBreak() {
|
36641
36643
|
return hasNewLine(this.input, this.state.end, this.nextTokenStart());
|
@@ -36952,7 +36954,7 @@ function requireLib$1() {
|
|
36952
36954
|
return this.getPluginOption("flow", "all") || this.flowPragma === "flow";
|
36953
36955
|
}
|
36954
36956
|
finishToken(type2, val) {
|
36955
|
-
type2 !==
|
36957
|
+
type2 !== 134 && type2 !== 13 && type2 !== 28 && this.flowPragma === void 0 && (this.flowPragma = null), super.finishToken(type2, val);
|
36956
36958
|
}
|
36957
36959
|
addComment(comment) {
|
36958
36960
|
if (this.flowPragma === void 0) {
|
@@ -37015,7 +37017,7 @@ function requireLib$1() {
|
|
37015
37017
|
return this.next(), node.id = this.flowParseTypeAnnotatableIdentifier(!0), this.scope.declareName(node.id.name, 5, node.id.loc.start), this.semicolon(), this.finishNode(node, "DeclareVariable");
|
37016
37018
|
}
|
37017
37019
|
flowParseDeclareModule(node) {
|
37018
|
-
this.scope.enter(0), this.match(
|
37020
|
+
this.scope.enter(0), this.match(134) ? node.id = super.parseExprAtom() : node.id = this.parseIdentifier();
|
37019
37021
|
const bodyNode = node.body = this.startNode(), body = bodyNode.body = [];
|
37020
37022
|
for (this.expect(5); !this.match(8); ) {
|
37021
37023
|
let bodyNode2 = this.startNode();
|
@@ -37112,7 +37114,7 @@ function requireLib$1() {
|
|
37112
37114
|
}
|
37113
37115
|
flowParseTypeParameterDeclaration() {
|
37114
37116
|
const oldInType = this.state.inType, node = this.startNode();
|
37115
|
-
node.params = [], this.state.inType = !0, this.match(47) || this.match(
|
37117
|
+
node.params = [], this.state.inType = !0, this.match(47) || this.match(143) ? this.next() : this.unexpected();
|
37116
37118
|
let defaultRequired = !1;
|
37117
37119
|
do {
|
37118
37120
|
const typeParameter = this.flowParseTypeParameter(defaultRequired);
|
@@ -37149,7 +37151,7 @@ function requireLib$1() {
|
|
37149
37151
|
}), this.finishNode(node, "InterfaceTypeAnnotation");
|
37150
37152
|
}
|
37151
37153
|
flowParseObjectPropertyKey() {
|
37152
|
-
return this.match(
|
37154
|
+
return this.match(135) || this.match(134) ? super.parseExprAtom() : this.parseIdentifier(!0);
|
37153
37155
|
}
|
37154
37156
|
flowParseObjectTypeIndexer(node, isStatic, variance) {
|
37155
37157
|
return node.static = isStatic, this.lookahead().type === 14 ? (node.id = this.flowParseObjectPropertyKey(), node.key = this.flowParseTypeInitialiser()) : (node.id = null, node.key = this.flowParseType()), this.expect(3), node.value = this.flowParseTypeInitialiser(), node.variance = variance, this.finishNode(node, "ObjectTypeIndexer");
|
@@ -37331,24 +37333,24 @@ function requireLib$1() {
|
|
37331
37333
|
}
|
37332
37334
|
return type2 ? tmp2 = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type2)]) : tmp2 = this.flowParseFunctionTypeParams(), node2.params = tmp2.params, node2.rest = tmp2.rest, node2.this = tmp2._this, this.expect(11), this.expect(19), node2.returnType = this.flowParseType(), node2.typeParameters = null, this.finishNode(node2, "FunctionTypeAnnotation");
|
37333
37335
|
}
|
37334
|
-
case
|
37336
|
+
case 134:
|
37335
37337
|
return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation");
|
37336
37338
|
case 85:
|
37337
37339
|
case 86:
|
37338
37340
|
return node.value = this.match(85), this.next(), this.finishNode(node, "BooleanLiteralTypeAnnotation");
|
37339
37341
|
case 53:
|
37340
37342
|
if (this.state.value === "-") {
|
37341
|
-
if (this.next(), this.match(
|
37343
|
+
if (this.next(), this.match(135))
|
37342
37344
|
return this.parseLiteralAtNode(-this.state.value, "NumberLiteralTypeAnnotation", node);
|
37343
|
-
if (this.match(
|
37345
|
+
if (this.match(136))
|
37344
37346
|
return this.parseLiteralAtNode(-this.state.value, "BigIntLiteralTypeAnnotation", node);
|
37345
37347
|
throw this.raise(FlowErrors.UnexpectedSubtractionOperand, this.state.startLoc);
|
37346
37348
|
}
|
37347
37349
|
this.unexpected();
|
37348
37350
|
return;
|
37349
|
-
case 134:
|
37350
|
-
return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation");
|
37351
37351
|
case 135:
|
37352
|
+
return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation");
|
37353
|
+
case 136:
|
37352
37354
|
return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation");
|
37353
37355
|
case 88:
|
37354
37356
|
return this.next(), this.finishNode(node, "VoidTypeAnnotation");
|
@@ -37455,7 +37457,7 @@ function requireLib$1() {
|
|
37455
37457
|
const node = this.startNode();
|
37456
37458
|
return this.next(), this.flowParseInterface(node);
|
37457
37459
|
}
|
37458
|
-
} else if (this.
|
37460
|
+
} else if (this.isContextual(126)) {
|
37459
37461
|
const node = this.startNode();
|
37460
37462
|
return this.next(), this.flowParseEnumDeclaration(node);
|
37461
37463
|
}
|
@@ -37482,16 +37484,16 @@ function requireLib$1() {
|
|
37482
37484
|
const {
|
37483
37485
|
type: type2
|
37484
37486
|
} = this.state;
|
37485
|
-
return
|
37487
|
+
return type2 === 126 || tokenIsFlowInterfaceOrTypeOrOpaque(type2) ? !this.state.containsEsc : super.shouldParseExportDeclaration();
|
37486
37488
|
}
|
37487
37489
|
isExportDefaultSpecifier() {
|
37488
37490
|
const {
|
37489
37491
|
type: type2
|
37490
37492
|
} = this.state;
|
37491
|
-
return
|
37493
|
+
return type2 === 126 || tokenIsFlowInterfaceOrTypeOrOpaque(type2) ? this.state.containsEsc : super.isExportDefaultSpecifier();
|
37492
37494
|
}
|
37493
37495
|
parseExportDefaultExpression() {
|
37494
|
-
if (this.
|
37496
|
+
if (this.isContextual(126)) {
|
37495
37497
|
const node = this.startNode();
|
37496
37498
|
return this.next(), this.flowParseEnumDeclaration(node);
|
37497
37499
|
}
|
@@ -37550,7 +37552,7 @@ function requireLib$1() {
|
|
37550
37552
|
}
|
37551
37553
|
forwardNoArrowParamsConversionAt(node, parse4) {
|
37552
37554
|
let result;
|
37553
|
-
return this.state.noArrowParamsConversionAt.includes(node.start) ? (this.state.noArrowParamsConversionAt.push(this.state.start), result = parse4(), this.state.noArrowParamsConversionAt.pop()) : result = parse4(), result;
|
37555
|
+
return this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start)) ? (this.state.noArrowParamsConversionAt.push(this.state.start), result = parse4(), this.state.noArrowParamsConversionAt.pop()) : result = parse4(), result;
|
37554
37556
|
}
|
37555
37557
|
parseParenItem(node, startLoc) {
|
37556
37558
|
const newNode = super.parseParenItem(node, startLoc);
|
@@ -37576,7 +37578,7 @@ function requireLib$1() {
|
|
37576
37578
|
node.exportKind = "type";
|
37577
37579
|
const declarationNode = this.startNode();
|
37578
37580
|
return this.next(), this.flowParseInterface(declarationNode);
|
37579
|
-
} else if (this.
|
37581
|
+
} else if (this.isContextual(126)) {
|
37580
37582
|
node.exportKind = "value";
|
37581
37583
|
const declarationNode = this.startNode();
|
37582
37584
|
return this.next(), this.flowParseEnumDeclaration(declarationNode);
|
@@ -37783,7 +37785,7 @@ function requireLib$1() {
|
|
37783
37785
|
parseMaybeAssign(refExpressionErrors, afterLeftParse) {
|
37784
37786
|
var _jsx;
|
37785
37787
|
let state = null, jsx3;
|
37786
|
-
if (this.hasPlugin("jsx") && (this.match(
|
37788
|
+
if (this.hasPlugin("jsx") && (this.match(143) || this.match(47))) {
|
37787
37789
|
if (state = this.state.clone(), jsx3 = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state), !jsx3.error) return jsx3.node;
|
37788
37790
|
const {
|
37789
37791
|
context
|
@@ -37836,23 +37838,23 @@ function requireLib$1() {
|
|
37836
37838
|
return this.match(14) || super.shouldParseArrow(params);
|
37837
37839
|
}
|
37838
37840
|
setArrowFunctionParameters(node, params) {
|
37839
|
-
this.state.noArrowParamsConversionAt.includes(node.start) ? node.params = params : super.setArrowFunctionParameters(node, params);
|
37841
|
+
this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start)) ? node.params = params : super.setArrowFunctionParameters(node, params);
|
37840
37842
|
}
|
37841
37843
|
checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = !0) {
|
37842
|
-
if (!(isArrowFunction && this.state.noArrowParamsConversionAt.includes(node.start))) {
|
37844
|
+
if (!(isArrowFunction && this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start)))) {
|
37843
37845
|
for (let i = 0; i < node.params.length; i++)
|
37844
37846
|
this.isThisParam(node.params[i]) && i > 0 && this.raise(FlowErrors.ThisParamMustBeFirst, node.params[i]);
|
37845
37847
|
super.checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged);
|
37846
37848
|
}
|
37847
37849
|
}
|
37848
37850
|
parseParenAndDistinguishExpression(canBeArrow) {
|
37849
|
-
return super.parseParenAndDistinguishExpression(canBeArrow && !this.state.noArrowAt.includes(this.state.start));
|
37851
|
+
return super.parseParenAndDistinguishExpression(canBeArrow && !this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start)));
|
37850
37852
|
}
|
37851
37853
|
parseSubscripts(base2, startLoc, noCalls) {
|
37852
37854
|
if (base2.type === "Identifier" && base2.name === "async" && this.state.noArrowAt.includes(startLoc.index)) {
|
37853
37855
|
this.next();
|
37854
37856
|
const node = this.startNodeAt(startLoc);
|
37855
|
-
node.callee = base2, node.arguments = super.parseCallExpressionArguments(11
|
37857
|
+
node.callee = base2, node.arguments = super.parseCallExpressionArguments(11), base2 = this.finishNode(node, "CallExpression");
|
37856
37858
|
} else if (base2.type === "Identifier" && base2.name === "async" && this.match(47)) {
|
37857
37859
|
const state = this.state.clone(), arrow4 = this.tryParse((abort) => this.parseAsyncArrowWithTypeParameters(startLoc) || abort(), state);
|
37858
37860
|
if (!arrow4.error && !arrow4.aborted) return arrow4.node;
|
@@ -37872,11 +37874,11 @@ function requireLib$1() {
|
|
37872
37874
|
return subscriptState.stop = !0, base2;
|
37873
37875
|
this.next();
|
37874
37876
|
const node = this.startNodeAt(startLoc);
|
37875
|
-
return node.callee = base2, node.typeArguments = this.flowParseTypeParameterInstantiation(), this.expect(10), node.arguments = this.parseCallExpressionArguments(11
|
37877
|
+
return node.callee = base2, node.typeArguments = this.flowParseTypeParameterInstantiation(), this.expect(10), node.arguments = this.parseCallExpressionArguments(11), node.optional = !0, this.finishCallExpression(node, !0);
|
37876
37878
|
} else if (!noCalls && this.shouldParseTypes() && this.match(47)) {
|
37877
37879
|
const node = this.startNodeAt(startLoc);
|
37878
37880
|
node.callee = base2;
|
37879
|
-
const result = this.tryParse(() => (node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew(), this.expect(10), node.arguments = super.parseCallExpressionArguments(11
|
37881
|
+
const result = this.tryParse(() => (node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew(), this.expect(10), node.arguments = super.parseCallExpressionArguments(11), subscriptState.optionalChainMember && (node.optional = !1), this.finishCallExpression(node, subscriptState.optionalChainMember)));
|
37880
37882
|
if (result.node)
|
37881
37883
|
return result.error && (this.state = result.failState), result.node;
|
37882
37884
|
}
|
@@ -37958,7 +37960,7 @@ function requireLib$1() {
|
|
37958
37960
|
flowEnumMemberInit() {
|
37959
37961
|
const startLoc = this.state.startLoc, endOfInit = () => this.match(12) || this.match(8);
|
37960
37962
|
switch (this.state.type) {
|
37961
|
-
case
|
37963
|
+
case 135: {
|
37962
37964
|
const literal2 = this.parseNumericLiteral(this.state.value);
|
37963
37965
|
return endOfInit() ? {
|
37964
37966
|
type: "number",
|
@@ -37969,7 +37971,7 @@ function requireLib$1() {
|
|
37969
37971
|
loc: startLoc
|
37970
37972
|
};
|
37971
37973
|
}
|
37972
|
-
case
|
37974
|
+
case 134: {
|
37973
37975
|
const literal2 = this.parseStringLiteral(this.state.value);
|
37974
37976
|
return endOfInit() ? {
|
37975
37977
|
type: "string",
|
@@ -38484,10 +38486,10 @@ function requireLib$1() {
|
|
38484
38486
|
case 60:
|
38485
38487
|
case 123:
|
38486
38488
|
if (this.state.pos === this.state.start) {
|
38487
|
-
ch === 60 && this.state.canStartJSXElement ? (++this.state.pos, this.finishToken(
|
38489
|
+
ch === 60 && this.state.canStartJSXElement ? (++this.state.pos, this.finishToken(143)) : super.getTokenFromCode(ch);
|
38488
38490
|
return;
|
38489
38491
|
}
|
38490
|
-
out += this.input.slice(chunkStart, this.state.pos), this.finishToken(
|
38492
|
+
out += this.input.slice(chunkStart, this.state.pos), this.finishToken(142, out);
|
38491
38493
|
return;
|
38492
38494
|
case 38:
|
38493
38495
|
out += this.input.slice(chunkStart, this.state.pos), out += this.jsxReadEntity(), chunkStart = this.state.pos;
|
@@ -38515,7 +38517,7 @@ function requireLib$1() {
|
|
38515
38517
|
if (ch === quote) break;
|
38516
38518
|
ch === 38 ? (out += this.input.slice(chunkStart, this.state.pos), out += this.jsxReadEntity(), chunkStart = this.state.pos) : isNewLine(ch) ? (out += this.input.slice(chunkStart, this.state.pos), out += this.jsxReadNewLine(!1), chunkStart = this.state.pos) : ++this.state.pos;
|
38517
38519
|
}
|
38518
|
-
out += this.input.slice(chunkStart, this.state.pos++), this.finishToken(
|
38520
|
+
out += this.input.slice(chunkStart, this.state.pos++), this.finishToken(134, out);
|
38519
38521
|
}
|
38520
38522
|
jsxReadEntity() {
|
38521
38523
|
const startPos = ++this.state.pos;
|
@@ -38544,11 +38546,11 @@ function requireLib$1() {
|
|
38544
38546
|
do
|
38545
38547
|
ch = this.input.charCodeAt(++this.state.pos);
|
38546
38548
|
while (isIdentifierChar(ch) || ch === 45);
|
38547
|
-
this.finishToken(
|
38549
|
+
this.finishToken(141, this.input.slice(start, this.state.pos));
|
38548
38550
|
}
|
38549
38551
|
jsxParseIdentifier() {
|
38550
38552
|
const node = this.startNode();
|
38551
|
-
return this.match(
|
38553
|
+
return this.match(141) ? node.name = this.state.value : tokenIsKeyword(this.state.type) ? node.name = tokenLabelName(this.state.type) : this.unexpected(), this.next(), this.finishNode(node, "JSXIdentifier");
|
38552
38554
|
}
|
38553
38555
|
jsxParseNamespacedName() {
|
38554
38556
|
const startLoc = this.state.startLoc, name = this.jsxParseIdentifier();
|
@@ -38572,8 +38574,8 @@ function requireLib$1() {
|
|
38572
38574
|
switch (this.state.type) {
|
38573
38575
|
case 5:
|
38574
38576
|
return node = this.startNode(), this.setContext(types2.brace), this.next(), node = this.jsxParseExpressionContainer(node, types2.j_oTag), node.expression.type === "JSXEmptyExpression" && this.raise(JsxErrors.AttributeIsEmpty, node), node;
|
38575
|
-
case
|
38576
|
-
case
|
38577
|
+
case 143:
|
38578
|
+
case 134:
|
38577
38579
|
return this.parseExprAtom();
|
38578
38580
|
default:
|
38579
38581
|
throw this.raise(JsxErrors.UnsupportedJsxValue, this.state.startLoc);
|
@@ -38601,17 +38603,17 @@ function requireLib$1() {
|
|
38601
38603
|
}
|
38602
38604
|
jsxParseOpeningElementAt(startLoc) {
|
38603
38605
|
const node = this.startNodeAt(startLoc);
|
38604
|
-
return this.eat(
|
38606
|
+
return this.eat(144) ? this.finishNode(node, "JSXOpeningFragment") : (node.name = this.jsxParseElementName(), this.jsxParseOpeningElementAfterName(node));
|
38605
38607
|
}
|
38606
38608
|
jsxParseOpeningElementAfterName(node) {
|
38607
38609
|
const attributes = [];
|
38608
|
-
for (; !this.match(56) && !this.match(
|
38610
|
+
for (; !this.match(56) && !this.match(144); )
|
38609
38611
|
attributes.push(this.jsxParseAttribute());
|
38610
|
-
return node.attributes = attributes, node.selfClosing = this.eat(56), this.expect(
|
38612
|
+
return node.attributes = attributes, node.selfClosing = this.eat(56), this.expect(144), this.finishNode(node, "JSXOpeningElement");
|
38611
38613
|
}
|
38612
38614
|
jsxParseClosingElementAt(startLoc) {
|
38613
38615
|
const node = this.startNodeAt(startLoc);
|
38614
|
-
return this.eat(
|
38616
|
+
return this.eat(144) ? this.finishNode(node, "JSXClosingFragment") : (node.name = this.jsxParseElementName(), this.expect(144), this.finishNode(node, "JSXClosingElement"));
|
38615
38617
|
}
|
38616
38618
|
jsxParseElementAt(startLoc) {
|
38617
38619
|
const node = this.startNodeAt(startLoc), children = [], openingElement = this.jsxParseOpeningElementAt(startLoc);
|
@@ -38619,14 +38621,14 @@ function requireLib$1() {
|
|
38619
38621
|
if (!openingElement.selfClosing) {
|
38620
38622
|
contents: for (; ; )
|
38621
38623
|
switch (this.state.type) {
|
38622
|
-
case
|
38624
|
+
case 143:
|
38623
38625
|
if (startLoc = this.state.startLoc, this.next(), this.eat(56)) {
|
38624
38626
|
closingElement = this.jsxParseClosingElementAt(startLoc);
|
38625
38627
|
break contents;
|
38626
38628
|
}
|
38627
38629
|
children.push(this.jsxParseElementAt(startLoc));
|
38628
38630
|
break;
|
38629
|
-
case
|
38631
|
+
case 142:
|
38630
38632
|
children.push(this.parseLiteral(this.state.value, "JSXText"));
|
38631
38633
|
break;
|
38632
38634
|
case 5: {
|
@@ -38658,7 +38660,7 @@ function requireLib$1() {
|
|
38658
38660
|
context[context.length - 1] = newContext;
|
38659
38661
|
}
|
38660
38662
|
parseExprAtom(refExpressionErrors) {
|
38661
|
-
return this.match(
|
38663
|
+
return this.match(143) ? this.jsxParseElement() : this.match(47) && this.input.charCodeAt(this.state.pos) !== 33 ? (this.replaceToken(143), this.jsxParseElement()) : super.parseExprAtom(refExpressionErrors);
|
38662
38664
|
}
|
38663
38665
|
skipSpace() {
|
38664
38666
|
this.curContext().preserveSpace || super.skipSpace();
|
@@ -38675,7 +38677,7 @@ function requireLib$1() {
|
|
38675
38677
|
return;
|
38676
38678
|
}
|
38677
38679
|
if (code2 === 62) {
|
38678
|
-
++this.state.pos, this.finishToken(
|
38680
|
+
++this.state.pos, this.finishToken(144);
|
38679
38681
|
return;
|
38680
38682
|
}
|
38681
38683
|
if ((code2 === 34 || code2 === 39) && context === types2.j_oTag) {
|
@@ -38684,7 +38686,7 @@ function requireLib$1() {
|
|
38684
38686
|
}
|
38685
38687
|
}
|
38686
38688
|
if (code2 === 60 && this.state.canStartJSXElement && this.input.charCodeAt(this.state.pos + 1) !== 33) {
|
38687
|
-
++this.state.pos, this.finishToken(
|
38689
|
+
++this.state.pos, this.finishToken(143);
|
38688
38690
|
return;
|
38689
38691
|
}
|
38690
38692
|
super.getTokenFromCode(code2);
|
@@ -38694,11 +38696,11 @@ function requireLib$1() {
|
|
38694
38696
|
context,
|
38695
38697
|
type: type2
|
38696
38698
|
} = this.state;
|
38697
|
-
if (type2 === 56 && prevType ===
|
38699
|
+
if (type2 === 56 && prevType === 143)
|
38698
38700
|
context.splice(-2, 2, types2.j_cTag), this.state.canStartJSXElement = !1;
|
38699
|
-
else if (type2 ===
|
38701
|
+
else if (type2 === 143)
|
38700
38702
|
context.push(types2.j_oTag);
|
38701
|
-
else if (type2 ===
|
38703
|
+
else if (type2 === 144) {
|
38702
38704
|
const out = context[context.length - 1];
|
38703
38705
|
out === types2.j_oTag && prevType === 56 || out === types2.j_cTag ? (context.pop(), this.state.canStartJSXElement = context[context.length - 1] === types2.j_expr) : (this.setContext(types2.j_expr), this.state.canStartJSXElement = !0);
|
38704
38706
|
} else
|
@@ -38931,7 +38933,7 @@ function requireLib$1() {
|
|
38931
38933
|
if (type2 === 21)
|
38932
38934
|
return this.parseBindingRestProperty(this.startNode());
|
38933
38935
|
const prop = this.startNode();
|
38934
|
-
return type2 ===
|
38936
|
+
return type2 === 139 ? (this.expectPlugin("destructuringPrivate", startLoc), this.classScope.usePrivateName(this.state.value, startLoc), prop.key = this.parsePrivateName()) : this.parsePropertyName(prop), prop.method = !1, this.parseObjPropValue(prop, startLoc, !1, !1, !0, !1);
|
38935
38937
|
}
|
38936
38938
|
parseAssignableListItem(flags, decorators) {
|
38937
38939
|
const left = this.parseMaybeDefault();
|
@@ -39192,7 +39194,7 @@ function requireLib$1() {
|
|
39192
39194
|
return tokenIsIdentifier(this.state.type);
|
39193
39195
|
}
|
39194
39196
|
tsTokenCanFollowModifier() {
|
39195
|
-
return this.match(0) || this.match(5) || this.match(55) || this.match(21) || this.match(
|
39197
|
+
return this.match(0) || this.match(5) || this.match(55) || this.match(21) || this.match(139) || this.isLiteralPropertyName();
|
39196
39198
|
}
|
39197
39199
|
tsNextTokenOnSameLineAndCanFollowModifier() {
|
39198
39200
|
return this.next(), this.hasPrecedingLineBreak() ? !1 : this.tsTokenCanFollowModifier();
|
@@ -39290,7 +39292,7 @@ function requireLib$1() {
|
|
39290
39292
|
}
|
39291
39293
|
tsParseImportType() {
|
39292
39294
|
const node = this.startNode();
|
39293
|
-
return this.expect(83), this.expect(10), this.match(
|
39295
|
+
return this.expect(83), this.expect(10), this.match(134) || this.raise(TSErrors.UnsupportedImportTypeArgument, this.state.startLoc), node.argument = super.parseExprAtom(), this.eat(12) && !this.match(11) ? (node.options = super.parseMaybeAssignAllowIn(), this.eat(12)) : node.options = null, this.expect(11), this.eat(16) && (node.qualifier = this.tsParseEntityName()), this.match(47) && (node.typeParameters = this.tsParseTypeArguments()), this.finishNode(node, "TSImportType");
|
39294
39296
|
}
|
39295
39297
|
tsParseEntityName(allowReservedWords = !0) {
|
39296
39298
|
let entity = this.parseIdentifier(allowReservedWords);
|
@@ -39327,7 +39329,7 @@ function requireLib$1() {
|
|
39327
39329
|
}
|
39328
39330
|
tsParseTypeParameters(parseModifiers) {
|
39329
39331
|
const node = this.startNode();
|
39330
|
-
this.match(47) || this.match(
|
39332
|
+
this.match(47) || this.match(143) ? this.next() : this.unexpected();
|
39331
39333
|
const refTrailingCommaPos = {
|
39332
39334
|
value: -1
|
39333
39335
|
};
|
@@ -39480,9 +39482,9 @@ function requireLib$1() {
|
|
39480
39482
|
tsParseLiteralTypeNode() {
|
39481
39483
|
const node = this.startNode();
|
39482
39484
|
switch (this.state.type) {
|
39483
|
-
case 134:
|
39484
39485
|
case 135:
|
39485
|
-
case
|
39486
|
+
case 136:
|
39487
|
+
case 134:
|
39486
39488
|
case 85:
|
39487
39489
|
case 86:
|
39488
39490
|
node.literal = super.parseExprAtom();
|
@@ -39505,16 +39507,16 @@ function requireLib$1() {
|
|
39505
39507
|
}
|
39506
39508
|
tsParseNonArrayType() {
|
39507
39509
|
switch (this.state.type) {
|
39508
|
-
case 133:
|
39509
39510
|
case 134:
|
39510
39511
|
case 135:
|
39512
|
+
case 136:
|
39511
39513
|
case 85:
|
39512
39514
|
case 86:
|
39513
39515
|
return this.tsParseLiteralTypeNode();
|
39514
39516
|
case 53:
|
39515
39517
|
if (this.state.value === "-") {
|
39516
39518
|
const node = this.startNode(), nextToken = this.lookahead();
|
39517
|
-
return nextToken.type !==
|
39519
|
+
return nextToken.type !== 135 && nextToken.type !== 136 && this.unexpected(), node.literal = this.parseMaybeUnary(), this.finishNode(node, "TSLiteralType");
|
39518
39520
|
}
|
39519
39521
|
break;
|
39520
39522
|
case 78:
|
@@ -39770,7 +39772,7 @@ function requireLib$1() {
|
|
39770
39772
|
}
|
39771
39773
|
tsParseEnumMember() {
|
39772
39774
|
const node = this.startNode();
|
39773
|
-
return node.id = this.match(
|
39775
|
+
return node.id = this.match(134) ? super.parseStringLiteral(this.state.value) : this.parseIdentifier(!0), this.eat(29) && (node.initializer = super.parseMaybeAssignAllowIn()), this.finishNode(node, "TSEnumMember");
|
39774
39776
|
}
|
39775
39777
|
tsParseEnumDeclaration(node, properties = {}) {
|
39776
39778
|
return properties.const && (node.const = !0), properties.declare && (node.declare = !0), this.expectContextual(126), node.id = this.parseIdentifier(), this.checkIdentifier(node.id, node.const ? 8971 : 8459), this.expect(5), node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this)), this.expect(8), this.finishNode(node, "TSEnumDeclaration");
|
@@ -39788,7 +39790,7 @@ function requireLib$1() {
|
|
39788
39790
|
return this.finishNode(node, "TSModuleDeclaration");
|
39789
39791
|
}
|
39790
39792
|
tsParseAmbientExternalModuleDeclaration(node) {
|
39791
|
-
return this.isContextual(112) ? (node.global = !0, node.id = this.parseIdentifier()) : this.match(
|
39793
|
+
return this.isContextual(112) ? (node.kind = "global", node.global = !0, node.id = this.parseIdentifier()) : this.match(134) ? (node.kind = "module", node.id = super.parseStringLiteral(this.state.value)) : this.unexpected(), this.match(5) ? (this.scope.enter(256), this.prodParam.enter(0), node.body = this.tsParseModuleBlock(), this.prodParam.exit(), this.scope.exit()) : this.semicolon(), this.finishNode(node, "TSModuleDeclaration");
|
39792
39794
|
}
|
39793
39795
|
tsParseImportEqualsDeclaration(node, maybeDefaultIdentifier, isExport) {
|
39794
39796
|
node.isExport = isExport || !1, node.id = maybeDefaultIdentifier || this.parseIdentifier(), this.checkIdentifier(node.id, 4096), this.expect(29);
|
@@ -39803,7 +39805,7 @@ function requireLib$1() {
|
|
39803
39805
|
}
|
39804
39806
|
tsParseExternalModuleReference() {
|
39805
39807
|
const node = this.startNode();
|
39806
|
-
return this.expectContextual(119), this.expect(10), this.match(
|
39808
|
+
return this.expectContextual(119), this.expect(10), this.match(134) || this.unexpected(), node.expression = super.parseExprAtom(), this.expect(11), this.sawUnambiguousESM = !0, this.finishNode(node, "TSExternalModuleReference");
|
39807
39809
|
}
|
39808
39810
|
tsLookAhead(f) {
|
39809
39811
|
const state = this.state.clone(), res = f();
|
@@ -39867,7 +39869,7 @@ function requireLib$1() {
|
|
39867
39869
|
if (this.match(5)) {
|
39868
39870
|
this.scope.enter(256), this.prodParam.enter(0);
|
39869
39871
|
const mod = node;
|
39870
|
-
return mod.global = !0, mod.id = expr, mod.body = this.tsParseModuleBlock(), this.scope.exit(), this.prodParam.exit(), this.finishNode(mod, "TSModuleDeclaration");
|
39872
|
+
return mod.kind = "global", mod.global = !0, mod.id = expr, mod.body = this.tsParseModuleBlock(), this.scope.exit(), this.prodParam.exit(), this.finishNode(mod, "TSModuleDeclaration");
|
39871
39873
|
}
|
39872
39874
|
break;
|
39873
39875
|
default:
|
@@ -39882,15 +39884,15 @@ function requireLib$1() {
|
|
39882
39884
|
break;
|
39883
39885
|
case "module":
|
39884
39886
|
if (this.tsCheckLineTerminator(next)) {
|
39885
|
-
if (this.match(
|
39887
|
+
if (this.match(134))
|
39886
39888
|
return this.tsParseAmbientExternalModuleDeclaration(node);
|
39887
39889
|
if (tokenIsIdentifier(this.state.type))
|
39888
|
-
return this.tsParseModuleOrNamespaceDeclaration(node);
|
39890
|
+
return node.kind = "module", this.tsParseModuleOrNamespaceDeclaration(node);
|
39889
39891
|
}
|
39890
39892
|
break;
|
39891
39893
|
case "namespace":
|
39892
39894
|
if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type))
|
39893
|
-
return this.tsParseModuleOrNamespaceDeclaration(node);
|
39895
|
+
return node.kind = "namespace", this.tsParseModuleOrNamespaceDeclaration(node);
|
39894
39896
|
break;
|
39895
39897
|
case "type":
|
39896
39898
|
if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type))
|
@@ -40004,7 +40006,7 @@ function requireLib$1() {
|
|
40004
40006
|
}
|
40005
40007
|
if (!noCalls && this.eat(10)) {
|
40006
40008
|
const node2 = this.startNodeAt(startLoc);
|
40007
|
-
return node2.callee = base2, node2.arguments = this.parseCallExpressionArguments(11
|
40009
|
+
return node2.callee = base2, node2.arguments = this.parseCallExpressionArguments(11), this.tsCheckForInvalidTypeCasts(node2.arguments), node2.typeParameters = typeArguments, state.optionalChainMember && (node2.optional = isOptionalCall), this.finishCallExpression(node2, state.optionalChainMember);
|
40008
40010
|
}
|
40009
40011
|
const tokenType = this.state.type;
|
40010
40012
|
if (tokenType === 48 || tokenType === 52 || tokenType !== 10 && tokenCanStartExpression(tokenType) && !this.hasPrecedingLineBreak())
|
@@ -40055,7 +40057,7 @@ function requireLib$1() {
|
|
40055
40057
|
super.applyImportPhase(node, isExport, phase, loc), isExport ? node.exportKind = phase === "type" ? "type" : "value" : node.importKind = phase === "type" || phase === "typeof" ? phase : "value";
|
40056
40058
|
}
|
40057
40059
|
parseImport(node) {
|
40058
|
-
if (this.match(
|
40060
|
+
if (this.match(134))
|
40059
40061
|
return node.importKind = "value", super.parseImport(node);
|
40060
40062
|
let importNode;
|
40061
40063
|
if (tokenIsIdentifier(this.state.type) && this.lookaheadCharCode() === 61)
|
@@ -40207,7 +40209,7 @@ function requireLib$1() {
|
|
40207
40209
|
key: key2
|
40208
40210
|
} = node;
|
40209
40211
|
this.raise(TSErrors.AbstractPropertyHasInitializer, this.state.startLoc, {
|
40210
|
-
propertyName: key2.type === "Identifier" && !node.computed ? key2.name : `[${this.input.slice(key2.start, key2.end)}]`
|
40212
|
+
propertyName: key2.type === "Identifier" && !node.computed ? key2.name : `[${this.input.slice(this.offsetToSourcePos(key2.start), this.offsetToSourcePos(key2.end))}]`
|
40211
40213
|
});
|
40212
40214
|
}
|
40213
40215
|
return super.parseClassProperty(node);
|
@@ -40260,7 +40262,7 @@ function requireLib$1() {
|
|
40260
40262
|
parseMaybeAssign(refExpressionErrors, afterLeftParse) {
|
40261
40263
|
var _jsx, _jsx2, _typeCast, _jsx3, _typeCast2;
|
40262
40264
|
let state, jsx3, typeCast;
|
40263
|
-
if (this.hasPlugin("jsx") && (this.match(
|
40265
|
+
if (this.hasPlugin("jsx") && (this.match(143) || this.match(47))) {
|
40264
40266
|
if (state = this.state.clone(), jsx3 = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state), !jsx3.error) return jsx3.node;
|
40265
40267
|
const {
|
40266
40268
|
context
|
@@ -40504,7 +40506,7 @@ function requireLib$1() {
|
|
40504
40506
|
key: key2
|
40505
40507
|
} = method;
|
40506
40508
|
this.raise(TSErrors.AbstractMethodHasImplementation, method, {
|
40507
|
-
methodName: key2.type === "Identifier" && !method.computed ? key2.name : `[${this.input.slice(key2.start, key2.end)}]`
|
40509
|
+
methodName: key2.type === "Identifier" && !method.computed ? key2.name : `[${this.input.slice(this.offsetToSourcePos(key2.start), this.offsetToSourcePos(key2.end))}]`
|
40508
40510
|
});
|
40509
40511
|
}
|
40510
40512
|
return method;
|
@@ -40593,9 +40595,9 @@ function requireLib$1() {
|
|
40593
40595
|
});
|
40594
40596
|
var placeholders = (superClass) => class extends superClass {
|
40595
40597
|
parsePlaceholder(expectedNode) {
|
40596
|
-
if (this.match(
|
40598
|
+
if (this.match(133)) {
|
40597
40599
|
const node = this.startNode();
|
40598
|
-
return this.next(), this.assertNoSpace(), node.name = super.parseIdentifier(!0), this.assertNoSpace(), this.expect(
|
40600
|
+
return this.next(), this.assertNoSpace(), node.name = super.parseIdentifier(!0), this.assertNoSpace(), this.expect(133), this.finishPlaceholder(node, expectedNode);
|
40599
40601
|
}
|
40600
40602
|
}
|
40601
40603
|
finishPlaceholder(node, expectedNode) {
|
@@ -40603,7 +40605,7 @@ function requireLib$1() {
|
|
40603
40605
|
return (!placeholder.expectedNode || !placeholder.type) && (placeholder = this.finishNode(placeholder, "Placeholder")), placeholder.expectedNode = expectedNode, placeholder;
|
40604
40606
|
}
|
40605
40607
|
getTokenFromCode(code2) {
|
40606
|
-
code2 === 37 && this.input.charCodeAt(this.state.pos + 1) === 37 ? this.finishOp(
|
40608
|
+
code2 === 37 && this.input.charCodeAt(this.state.pos + 1) === 37 ? this.finishOp(133, 2) : super.getTokenFromCode(code2);
|
40607
40609
|
}
|
40608
40610
|
parseExprAtom(refExpressionErrors) {
|
40609
40611
|
return this.parsePlaceholder("Expression") || super.parseExprAtom(refExpressionErrors);
|
@@ -40624,7 +40626,7 @@ function requireLib$1() {
|
|
40624
40626
|
node && node.type === "Placeholder" && node.expectedNode === "Expression" ? node.expectedNode = "Pattern" : super.toAssignable(node, isLHS);
|
40625
40627
|
}
|
40626
40628
|
chStartsBindingIdentifier(ch, pos2) {
|
40627
|
-
return !!(super.chStartsBindingIdentifier(ch, pos2) || this.lookahead().type ===
|
40629
|
+
return !!(super.chStartsBindingIdentifier(ch, pos2) || this.lookahead().type === 133);
|
40628
40630
|
}
|
40629
40631
|
verifyBreakContinue(node, isBreak) {
|
40630
40632
|
node.label && node.label.type === "Placeholder" || super.verifyBreakContinue(node, isBreak);
|
@@ -40652,7 +40654,7 @@ function requireLib$1() {
|
|
40652
40654
|
this.next();
|
40653
40655
|
const oldStrict = this.state.strict, placeholder = this.parsePlaceholder("Identifier");
|
40654
40656
|
if (placeholder)
|
40655
|
-
if (this.match(81) || this.match(
|
40657
|
+
if (this.match(81) || this.match(133) || this.match(5))
|
40656
40658
|
node.id = placeholder;
|
40657
40659
|
else {
|
40658
40660
|
if (optionalId || !isStatement)
|
@@ -40676,7 +40678,7 @@ function requireLib$1() {
|
|
40676
40678
|
isExportDefaultSpecifier() {
|
40677
40679
|
if (this.match(65)) {
|
40678
40680
|
const next = this.nextTokenStart();
|
40679
|
-
if (this.isUnparsedContextual(next, "from") && this.input.startsWith(tokenLabelName(
|
40681
|
+
if (this.isUnparsedContextual(next, "from") && this.input.startsWith(tokenLabelName(133), this.nextTokenStartSince(next + 4)))
|
40680
40682
|
return !0;
|
40681
40683
|
}
|
40682
40684
|
return super.isExportDefaultSpecifier();
|
@@ -40703,7 +40705,7 @@ function requireLib$1() {
|
|
40703
40705
|
return this.parsePlaceholder("StringLiteral") || super.parseImportSource();
|
40704
40706
|
}
|
40705
40707
|
assertNoSpace() {
|
40706
|
-
this.state.start > this.state.lastTokEndLoc.index && this.raise(PlaceholderErrors.UnexpectedSpace, this.state.lastTokEndLoc);
|
40708
|
+
this.state.start > this.offsetToSourcePos(this.state.lastTokEndLoc.index) && this.raise(PlaceholderErrors.UnexpectedSpace, this.state.lastTokEndLoc);
|
40707
40709
|
}
|
40708
40710
|
}, v8intrinsic = (superClass) => class extends superClass {
|
40709
40711
|
parseV8Intrinsic() {
|
@@ -40761,14 +40763,14 @@ function requireLib$1() {
|
|
40761
40763
|
throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple", pluginsMap.get("recordAndTuple")])}\`.`);
|
40762
40764
|
}
|
40763
40765
|
if (pluginsMap.has("moduleAttributes")) {
|
40764
|
-
if (pluginsMap.has("
|
40765
|
-
throw new Error("Cannot combine importAssertions,
|
40766
|
+
if (pluginsMap.has("deprecatedImportAssert") || pluginsMap.has("importAssertions"))
|
40767
|
+
throw new Error("Cannot combine importAssertions, deprecatedImportAssert and moduleAttributes plugins.");
|
40766
40768
|
if (pluginsMap.get("moduleAttributes").version !== "may-2020")
|
40767
40769
|
throw new Error("The 'moduleAttributes' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is 'may-2020'.");
|
40768
40770
|
}
|
40769
|
-
if (pluginsMap.has("importAssertions") && pluginsMap.has("
|
40770
|
-
throw new Error("Cannot combine importAssertions and
|
40771
|
-
if (pluginsMap.has("recordAndTuple")) {
|
40771
|
+
if (pluginsMap.has("importAssertions") && pluginsMap.has("deprecatedImportAssert"))
|
40772
|
+
throw new Error("Cannot combine importAssertions and deprecatedImportAssert plugins.");
|
40773
|
+
if (!pluginsMap.has("deprecatedImportAssert") && pluginsMap.has("importAttributes") && pluginsMap.get("importAttributes").deprecatedAssertSyntax && pluginsMap.set("deprecatedImportAssert", {}), pluginsMap.has("recordAndTuple")) {
|
40772
40774
|
const syntaxType = pluginsMap.get("recordAndTuple").syntaxType;
|
40773
40775
|
if (syntaxType != null) {
|
40774
40776
|
const RECORD_AND_TUPLE_SYNTAX_TYPES = ["hash", "bar"];
|
@@ -40790,37 +40792,43 @@ function requireLib$1() {
|
|
40790
40792
|
typescript: typescript2,
|
40791
40793
|
v8intrinsic,
|
40792
40794
|
placeholders
|
40793
|
-
}, mixinPluginNames = Object.keys(mixinPlugins)
|
40794
|
-
|
40795
|
-
|
40796
|
-
|
40797
|
-
|
40798
|
-
|
40799
|
-
|
40800
|
-
|
40801
|
-
|
40802
|
-
|
40803
|
-
|
40804
|
-
|
40805
|
-
|
40806
|
-
|
40807
|
-
|
40808
|
-
|
40809
|
-
|
40810
|
-
|
40811
|
-
|
40812
|
-
|
40813
|
-
|
40795
|
+
}, mixinPluginNames = Object.keys(mixinPlugins);
|
40796
|
+
function createDefaultOptions() {
|
40797
|
+
return {
|
40798
|
+
sourceType: "script",
|
40799
|
+
sourceFilename: void 0,
|
40800
|
+
startIndex: 0,
|
40801
|
+
startColumn: 0,
|
40802
|
+
startLine: 1,
|
40803
|
+
allowAwaitOutsideFunction: !1,
|
40804
|
+
allowReturnOutsideFunction: !1,
|
40805
|
+
allowNewTargetOutsideFunction: !1,
|
40806
|
+
allowImportExportEverywhere: !1,
|
40807
|
+
allowSuperOutsideMethod: !1,
|
40808
|
+
allowUndeclaredExports: !1,
|
40809
|
+
plugins: [],
|
40810
|
+
strictMode: null,
|
40811
|
+
ranges: !1,
|
40812
|
+
tokens: !1,
|
40813
|
+
createImportExpressions: !1,
|
40814
|
+
createParenthesizedExpressions: !1,
|
40815
|
+
errorRecovery: !1,
|
40816
|
+
attachComment: !0,
|
40817
|
+
annexB: !0
|
40818
|
+
};
|
40819
|
+
}
|
40814
40820
|
function getOptions(opts) {
|
40821
|
+
const options2 = createDefaultOptions();
|
40815
40822
|
if (opts == null)
|
40816
|
-
return
|
40823
|
+
return options2;
|
40817
40824
|
if (opts.annexB != null && opts.annexB !== !1)
|
40818
40825
|
throw new Error("The `annexB` option can only be set to `false`.");
|
40819
|
-
const
|
40820
|
-
|
40821
|
-
|
40822
|
-
options2
|
40823
|
-
|
40826
|
+
for (const key2 of Object.keys(options2))
|
40827
|
+
opts[key2] != null && (options2[key2] = opts[key2]);
|
40828
|
+
if (options2.startLine === 1)
|
40829
|
+
opts.startIndex == null && options2.startColumn > 0 ? options2.startIndex = options2.startColumn : opts.startColumn == null && options2.startIndex > 0 && (options2.startColumn = options2.startIndex);
|
40830
|
+
else if ((opts.startColumn == null || opts.startIndex == null) && opts.startIndex != null)
|
40831
|
+
throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");
|
40824
40832
|
return options2;
|
40825
40833
|
}
|
40826
40834
|
class ExpressionParser extends LValParser {
|
@@ -40837,12 +40845,12 @@ function requireLib$1() {
|
|
40837
40845
|
}
|
40838
40846
|
}
|
40839
40847
|
shouldExitDescending(expr, potentialArrowAt) {
|
40840
|
-
return expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt;
|
40848
|
+
return expr.type === "ArrowFunctionExpression" && this.offsetToSourcePos(expr.start) === potentialArrowAt;
|
40841
40849
|
}
|
40842
40850
|
getExpression() {
|
40843
40851
|
this.enterInitialScopes(), this.nextToken();
|
40844
40852
|
const expr = this.parseExpression();
|
40845
|
-
return this.match(
|
40853
|
+
return this.match(140) || this.unexpected(), this.finalizeRemainingComments(), expr.comments = this.comments, expr.errors = this.state.errors, this.options.tokens && (expr.tokens = this.tokens), expr;
|
40846
40854
|
}
|
40847
40855
|
parseExpression(disallowIn, refExpressionErrors) {
|
40848
40856
|
return disallowIn ? this.disallowInAnd(() => this.parseExpressionBase(refExpressionErrors)) : this.allowInAnd(() => this.parseExpressionBase(refExpressionErrors));
|
@@ -40904,7 +40912,7 @@ function requireLib$1() {
|
|
40904
40912
|
return expr;
|
40905
40913
|
}
|
40906
40914
|
parseMaybeUnaryOrPrivate(refExpressionErrors) {
|
40907
|
-
return this.match(
|
40915
|
+
return this.match(139) ? this.parsePrivateName() : this.parseMaybeUnary(refExpressionErrors);
|
40908
40916
|
}
|
40909
40917
|
parseExprOps(refExpressionErrors) {
|
40910
40918
|
const startLoc = this.state.startLoc, potentialArrowAt = this.state.potentialArrowAt, expr = this.parseMaybeUnaryOrPrivate(refExpressionErrors);
|
@@ -41058,7 +41066,7 @@ function requireLib$1() {
|
|
41058
41066
|
}
|
41059
41067
|
parseMember(base2, startLoc, state, computed, optional) {
|
41060
41068
|
const node = this.startNodeAt(startLoc);
|
41061
|
-
return node.object = base2, node.computed = computed, computed ? (node.property = this.parseExpression(), this.expect(3)) : this.match(
|
41069
|
+
return node.object = base2, node.computed = computed, computed ? (node.property = this.parseExpression(), this.expect(3)) : this.match(139) ? (base2.type === "Super" && this.raise(Errors.SuperPrivateField, startLoc), this.classScope.usePrivateName(this.state.value, this.state.startLoc), node.property = this.parsePrivateName()) : node.property = this.parseIdentifier(!0), state.optionalChainMember ? (node.optional = optional, this.finishNode(node, "OptionalMemberExpression")) : this.finishNode(node, "MemberExpression");
|
41062
41070
|
}
|
41063
41071
|
parseBind(base2, startLoc, noCalls, state) {
|
41064
41072
|
const node = this.startNodeAt(startLoc);
|
@@ -41074,7 +41082,7 @@ function requireLib$1() {
|
|
41074
41082
|
maybeAsyncArrow,
|
41075
41083
|
optionalChainMember
|
41076
41084
|
} = state;
|
41077
|
-
maybeAsyncArrow && (this.expressionScope.enter(newAsyncArrowScope()), refExpressionErrors = new ExpressionErrors()), optionalChainMember && (node.optional = optional), optional ? node.arguments = this.parseCallExpressionArguments(11) : node.arguments = this.parseCallExpressionArguments(11, base2.type
|
41085
|
+
maybeAsyncArrow && (this.expressionScope.enter(newAsyncArrowScope()), refExpressionErrors = new ExpressionErrors()), optionalChainMember && (node.optional = optional), optional ? node.arguments = this.parseCallExpressionArguments(11) : node.arguments = this.parseCallExpressionArguments(11, base2.type !== "Super", node, refExpressionErrors);
|
41078
41086
|
let finishedNode = this.finishCallExpression(node, optionalChainMember);
|
41079
41087
|
return maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional ? (state.stop = !0, this.checkDestructuringPrivate(refExpressionErrors), this.expressionScope.validateAsPattern(), this.expressionScope.exit(), finishedNode = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startLoc), finishedNode)) : (maybeAsyncArrow && (this.checkExpressionErrors(refExpressionErrors, !0), this.expressionScope.exit()), this.toReferencedArguments(finishedNode)), this.state.maybeInArrowParameters = oldMaybeInArrowParameters, finishedNode;
|
41080
41088
|
}
|
@@ -41086,20 +41094,18 @@ function requireLib$1() {
|
|
41086
41094
|
return node.tag = base2, node.quasi = this.parseTemplate(!0), state.optionalChainMember && this.raise(Errors.OptionalChainingNoTemplate, startLoc), this.finishNode(node, "TaggedTemplateExpression");
|
41087
41095
|
}
|
41088
41096
|
atPossibleAsyncArrow(base2) {
|
41089
|
-
return base2.type === "Identifier" && base2.name === "async" && this.state.lastTokEndLoc.index === base2.end && !this.canInsertSemicolon() && base2.end - base2.start === 5 && base2.start === this.state.potentialArrowAt;
|
41097
|
+
return base2.type === "Identifier" && base2.name === "async" && this.state.lastTokEndLoc.index === base2.end && !this.canInsertSemicolon() && base2.end - base2.start === 5 && this.offsetToSourcePos(base2.start) === this.state.potentialArrowAt;
|
41090
41098
|
}
|
41091
41099
|
finishCallExpression(node, optional) {
|
41092
41100
|
if (node.callee.type === "Import")
|
41093
|
-
if (node.arguments.length ===
|
41094
|
-
this.raise(Errors.ImportCallArity, node
|
41095
|
-
maxArgumentCount: this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions") || this.hasPlugin("moduleAttributes") ? 2 : 1
|
41096
|
-
});
|
41101
|
+
if (node.arguments.length === 0 || node.arguments.length > 2)
|
41102
|
+
this.raise(Errors.ImportCallArity, node);
|
41097
41103
|
else
|
41098
41104
|
for (const arg of node.arguments)
|
41099
41105
|
arg.type === "SpreadElement" && this.raise(Errors.ImportCallSpreadArgument, arg);
|
41100
41106
|
return this.finishNode(node, optional ? "OptionalCallExpression" : "CallExpression");
|
41101
41107
|
}
|
41102
|
-
parseCallExpressionArguments(close,
|
41108
|
+
parseCallExpressionArguments(close, allowPlaceholder, nodeForExtra, refExpressionErrors) {
|
41103
41109
|
const elts = [];
|
41104
41110
|
let first2 = !0;
|
41105
41111
|
const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
|
@@ -41107,7 +41113,7 @@ function requireLib$1() {
|
|
41107
41113
|
if (first2)
|
41108
41114
|
first2 = !1;
|
41109
41115
|
else if (this.expect(12), this.match(close)) {
|
41110
|
-
|
41116
|
+
nodeForExtra && this.addTrailingCommaExtraToNode(nodeForExtra), this.next();
|
41111
41117
|
break;
|
41112
41118
|
}
|
41113
41119
|
elts.push(this.parseExprListItem(!1, refExpressionErrors, allowPlaceholder));
|
@@ -41142,11 +41148,11 @@ function requireLib$1() {
|
|
41142
41148
|
case 56:
|
41143
41149
|
case 31:
|
41144
41150
|
return this.readRegexp(), this.parseRegExpLiteral(this.state.value);
|
41145
|
-
case 134:
|
41146
|
-
return this.parseNumericLiteral(this.state.value);
|
41147
41151
|
case 135:
|
41152
|
+
return this.parseNumericLiteral(this.state.value);
|
41153
|
+
case 136:
|
41148
41154
|
return this.parseBigIntLiteral(this.state.value);
|
41149
|
-
case
|
41155
|
+
case 134:
|
41150
41156
|
return this.parseStringLiteral(this.state.value);
|
41151
41157
|
case 84:
|
41152
41158
|
return this.parseNullLiteral();
|
@@ -41186,7 +41192,7 @@ function requireLib$1() {
|
|
41186
41192
|
return this.finishNode(node, "BindExpression");
|
41187
41193
|
throw this.raise(Errors.UnsupportedBind, callee);
|
41188
41194
|
}
|
41189
|
-
case
|
41195
|
+
case 139:
|
41190
41196
|
return this.raise(Errors.PrivateInExpectedIn, this.state.startLoc, {
|
41191
41197
|
identifierName: this.state.value
|
41192
41198
|
}), this.parsePrivateName();
|
@@ -41212,7 +41218,7 @@ function requireLib$1() {
|
|
41212
41218
|
break;
|
41213
41219
|
}
|
41214
41220
|
default:
|
41215
|
-
if (type2 ===
|
41221
|
+
if (type2 === 137)
|
41216
41222
|
return this.parseDecimalLiteral(this.state.value);
|
41217
41223
|
if (tokenIsIdentifier(type2)) {
|
41218
41224
|
if (this.isContextual(127) && this.lookaheadInLineCharCode() === 123)
|
@@ -41314,7 +41320,7 @@ function requireLib$1() {
|
|
41314
41320
|
return this.parseMetaProperty(node, id, "meta");
|
41315
41321
|
}
|
41316
41322
|
parseLiteralAtNode(value, type2, node) {
|
41317
|
-
return this.addExtra(node, "rawValue", value), this.addExtra(node, "raw", this.input.slice(node.start, this.state.end)), node.value = value, this.next(), this.finishNode(node, type2);
|
41323
|
+
return this.addExtra(node, "rawValue", value), this.addExtra(node, "raw", this.input.slice(this.offsetToSourcePos(node.start), this.state.end)), node.value = value, this.next(), this.finishNode(node, type2);
|
41318
41324
|
}
|
41319
41325
|
parseLiteral(value, type2) {
|
41320
41326
|
const node = this.startNode();
|
@@ -41334,7 +41340,7 @@ function requireLib$1() {
|
|
41334
41340
|
}
|
41335
41341
|
parseRegExpLiteral(value) {
|
41336
41342
|
const node = this.startNode();
|
41337
|
-
return this.addExtra(node, "raw", this.input.slice(node.start, this.state.end)), node.pattern = value.pattern, node.flags = value.flags, this.next(), this.finishNode(node, "RegExpLiteral");
|
41343
|
+
return this.addExtra(node, "raw", this.input.slice(this.offsetToSourcePos(node.start), this.state.end)), node.pattern = value.pattern, node.flags = value.flags, this.next(), this.finishNode(node, "RegExpLiteral");
|
41338
41344
|
}
|
41339
41345
|
parseBooleanLiteral(value) {
|
41340
41346
|
const node = this.startNode();
|
@@ -41537,28 +41543,28 @@ function requireLib$1() {
|
|
41537
41543
|
key2 = this.parseIdentifier(!0);
|
41538
41544
|
else
|
41539
41545
|
switch (type2) {
|
41540
|
-
case
|
41546
|
+
case 135:
|
41541
41547
|
key2 = this.parseNumericLiteral(value);
|
41542
41548
|
break;
|
41543
|
-
case
|
41549
|
+
case 134:
|
41544
41550
|
key2 = this.parseStringLiteral(value);
|
41545
41551
|
break;
|
41546
|
-
case
|
41552
|
+
case 136:
|
41547
41553
|
key2 = this.parseBigIntLiteral(value);
|
41548
41554
|
break;
|
41549
|
-
case
|
41555
|
+
case 139: {
|
41550
41556
|
const privateKeyLoc = this.state.startLoc;
|
41551
41557
|
refExpressionErrors != null ? refExpressionErrors.privateKeyLoc === null && (refExpressionErrors.privateKeyLoc = privateKeyLoc) : this.raise(Errors.UnexpectedPrivateField, privateKeyLoc), key2 = this.parsePrivateName();
|
41552
41558
|
break;
|
41553
41559
|
}
|
41554
41560
|
default:
|
41555
|
-
if (type2 ===
|
41561
|
+
if (type2 === 137) {
|
41556
41562
|
key2 = this.parseDecimalLiteral(value);
|
41557
41563
|
break;
|
41558
41564
|
}
|
41559
41565
|
this.unexpected();
|
41560
41566
|
}
|
41561
|
-
prop.key = key2, type2 !==
|
41567
|
+
prop.key = key2, type2 !== 139 && (prop.computed = !1);
|
41562
41568
|
}
|
41563
41569
|
}
|
41564
41570
|
initFunction(node, isAsync) {
|
@@ -41714,7 +41720,7 @@ function requireLib$1() {
|
|
41714
41720
|
const {
|
41715
41721
|
type: type2
|
41716
41722
|
} = this.state;
|
41717
|
-
return type2 === 53 || type2 === 10 || type2 === 0 || tokenIsTemplate(type2) || type2 === 102 && !this.state.containsEsc || type2 ===
|
41723
|
+
return type2 === 53 || type2 === 10 || type2 === 0 || tokenIsTemplate(type2) || type2 === 102 && !this.state.containsEsc || type2 === 138 || type2 === 56 || this.hasPlugin("v8intrinsic") && type2 === 54;
|
41718
41724
|
}
|
41719
41725
|
parseYield() {
|
41720
41726
|
const node = this.startNode();
|
@@ -41723,7 +41729,7 @@ function requireLib$1() {
|
|
41723
41729
|
if (!this.hasPrecedingLineBreak())
|
41724
41730
|
switch (delegating = this.eat(55), this.state.type) {
|
41725
41731
|
case 13:
|
41726
|
-
case
|
41732
|
+
case 140:
|
41727
41733
|
case 8:
|
41728
41734
|
case 11:
|
41729
41735
|
case 3:
|
@@ -41737,7 +41743,13 @@ function requireLib$1() {
|
|
41737
41743
|
return node.delegate = delegating, node.argument = argument, this.finishNode(node, "YieldExpression");
|
41738
41744
|
}
|
41739
41745
|
parseImportCall(node) {
|
41740
|
-
|
41746
|
+
if (this.next(), node.source = this.parseMaybeAssignAllowIn(), node.options = null, this.eat(12) && !this.match(11) && (node.options = this.parseMaybeAssignAllowIn(), this.eat(12) && !this.match(11))) {
|
41747
|
+
do
|
41748
|
+
this.parseMaybeAssignAllowIn();
|
41749
|
+
while (this.eat(12) && !this.match(11));
|
41750
|
+
this.raise(Errors.ImportCallArity, node);
|
41751
|
+
}
|
41752
|
+
return this.expect(11), this.finishNode(node, "ImportExpression");
|
41741
41753
|
}
|
41742
41754
|
checkPipelineAtInfixOperator(left, leftStartLoc) {
|
41743
41755
|
this.hasPlugin(["pipelineOperator", {
|
@@ -41870,14 +41882,14 @@ function requireLib$1() {
|
|
41870
41882
|
}, switchLabel = {
|
41871
41883
|
kind: 2
|
41872
41884
|
}, loneSurrogate = /[\uD800-\uDFFF]/u, keywordRelationalOperator = /in(?:stanceof)?/y;
|
41873
|
-
function babel7CompatTokens(tokens, input2) {
|
41885
|
+
function babel7CompatTokens(tokens, input2, startIndex) {
|
41874
41886
|
for (let i = 0; i < tokens.length; i++) {
|
41875
41887
|
const token2 = tokens[i], {
|
41876
41888
|
type: type2
|
41877
41889
|
} = token2;
|
41878
41890
|
if (typeof type2 == "number") {
|
41879
41891
|
{
|
41880
|
-
if (type2 ===
|
41892
|
+
if (type2 === 139) {
|
41881
41893
|
const {
|
41882
41894
|
loc,
|
41883
41895
|
start,
|
@@ -41909,7 +41921,7 @@ function requireLib$1() {
|
|
41909
41921
|
end
|
41910
41922
|
} = token2, backquoteEnd = start + 1, backquoteEndLoc = createPositionWithColumnOffset(loc.start, 1);
|
41911
41923
|
let startToken;
|
41912
|
-
input2.charCodeAt(start) === 96 ? startToken = new Token({
|
41924
|
+
input2.charCodeAt(start - startIndex) === 96 ? startToken = new Token({
|
41913
41925
|
type: getExportedToken(22),
|
41914
41926
|
value: "`",
|
41915
41927
|
start,
|
@@ -41957,9 +41969,9 @@ function requireLib$1() {
|
|
41957
41969
|
}
|
41958
41970
|
class StatementParser extends ExpressionParser {
|
41959
41971
|
parseTopLevel(file, program) {
|
41960
|
-
return file.program = this.parseProgram(program), file.comments = this.comments, this.options.tokens && (file.tokens = babel7CompatTokens(this.tokens, this.input)), this.finishNode(file, "File");
|
41972
|
+
return file.program = this.parseProgram(program), file.comments = this.comments, this.options.tokens && (file.tokens = babel7CompatTokens(this.tokens, this.input, this.startIndex)), this.finishNode(file, "File");
|
41961
41973
|
}
|
41962
|
-
parseProgram(program, end =
|
41974
|
+
parseProgram(program, end = 140, sourceType = this.options.sourceType) {
|
41963
41975
|
if (program.sourceType = sourceType, program.interpreter = this.parseInterpreterDirective(), this.parseBlockBody(program, !0, !0, end), this.inModule) {
|
41964
41976
|
if (!this.options.allowUndeclaredExports && this.scope.undefinedExports.size > 0)
|
41965
41977
|
for (const [localName, at] of Array.from(this.scope.undefinedExports))
|
@@ -41969,12 +41981,12 @@ function requireLib$1() {
|
|
41969
41981
|
this.addExtra(program, "topLevelAwait", this.state.hasTopLevelAwait);
|
41970
41982
|
}
|
41971
41983
|
let finishedProgram;
|
41972
|
-
return end ===
|
41984
|
+
return end === 140 ? finishedProgram = this.finishNode(program, "Program") : finishedProgram = this.finishNodeAt(program, "Program", createPositionWithColumnOffset(this.state.startLoc, -1)), finishedProgram;
|
41973
41985
|
}
|
41974
41986
|
stmtToDirective(stmt) {
|
41975
41987
|
const directive = stmt;
|
41976
41988
|
directive.type = "Directive", directive.value = directive.expression, delete directive.expression;
|
41977
|
-
const directiveLiteral = directive.value, expressionValue = directiveLiteral.value, raw = this.input.slice(directiveLiteral.start, directiveLiteral.end), val = directiveLiteral.value = raw.slice(1, -1);
|
41989
|
+
const directiveLiteral = directive.value, expressionValue = directiveLiteral.value, raw = this.input.slice(this.offsetToSourcePos(directiveLiteral.start), this.offsetToSourcePos(directiveLiteral.end)), val = directiveLiteral.value = raw.slice(1, -1);
|
41978
41990
|
return this.addExtra(directiveLiteral, "raw", raw), this.addExtra(directiveLiteral, "rawValue", val), this.addExtra(directiveLiteral, "expressionValue", expressionValue), directiveLiteral.type = "DirectiveLiteral", directive;
|
41979
41991
|
}
|
41980
41992
|
parseInterpreterDirective() {
|
@@ -42155,7 +42167,7 @@ function requireLib$1() {
|
|
42155
42167
|
} else {
|
42156
42168
|
for (expr = this.parseIdentifier(!1); this.eat(16); ) {
|
42157
42169
|
const node2 = this.startNodeAt(startLoc);
|
42158
|
-
node2.object = expr, this.match(
|
42170
|
+
node2.object = expr, this.match(139) ? (this.classScope.usePrivateName(this.state.value, this.state.startLoc), node2.property = this.parsePrivateName()) : node2.property = this.parseIdentifier(!0), node2.computed = !1, expr = this.finishNode(node2, "MemberExpression");
|
42159
42171
|
}
|
42160
42172
|
node.expression = this.parseMaybeDecoratorArguments(expr);
|
42161
42173
|
}
|
@@ -42166,7 +42178,7 @@ function requireLib$1() {
|
|
42166
42178
|
parseMaybeDecoratorArguments(expr) {
|
42167
42179
|
if (this.eat(10)) {
|
42168
42180
|
const node = this.startNodeAtNode(expr);
|
42169
|
-
return node.callee = expr, node.arguments = this.parseCallExpressionArguments(11
|
42181
|
+
return node.callee = expr, node.arguments = this.parseCallExpressionArguments(11), this.toReferencedList(node.arguments), this.finishNode(node, "CallExpression");
|
42170
42182
|
}
|
42171
42183
|
return expr;
|
42172
42184
|
}
|
@@ -42284,14 +42296,14 @@ function requireLib$1() {
|
|
42284
42296
|
for (let i = this.state.labels.length - 1; i >= 0; i--) {
|
42285
42297
|
const label = this.state.labels[i];
|
42286
42298
|
if (label.statementStart === node.start)
|
42287
|
-
label.statementStart = this.state.start, label.kind = kind;
|
42299
|
+
label.statementStart = this.sourceToOffsetPos(this.state.start), label.kind = kind;
|
42288
42300
|
else
|
42289
42301
|
break;
|
42290
42302
|
}
|
42291
42303
|
return this.state.labels.push({
|
42292
42304
|
name: maybeName,
|
42293
42305
|
kind,
|
42294
|
-
statementStart: this.state.start
|
42306
|
+
statementStart: this.sourceToOffsetPos(this.state.start)
|
42295
42307
|
}), node.body = flags & 8 ? this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0) : this.parseStatement(), this.state.labels.pop(), node.label = expr, this.finishNode(node, "LabeledStatement");
|
42296
42308
|
}
|
42297
42309
|
parseExpressionStatement(node, expr, decorators) {
|
@@ -42446,7 +42458,7 @@ function requireLib$1() {
|
|
42446
42458
|
const publicMethod = member, privateMethod = member, publicProp = member, privateProp = member, accessorProp = member, method = publicMethod, publicMember = publicMethod;
|
42447
42459
|
if (member.static = isStatic, this.parsePropertyNamePrefixOperator(member), this.eat(55)) {
|
42448
42460
|
method.kind = "method";
|
42449
|
-
const isPrivateName = this.match(
|
42461
|
+
const isPrivateName = this.match(139);
|
42450
42462
|
if (this.parseClassElementName(method), isPrivateName) {
|
42451
42463
|
this.pushClassPrivateMethod(classBody, privateMethod, !0, !1);
|
42452
42464
|
return;
|
@@ -42469,15 +42481,15 @@ function requireLib$1() {
|
|
42469
42481
|
this.resetPreviousNodeTrailingComments(key2);
|
42470
42482
|
const isGenerator = this.eat(55);
|
42471
42483
|
publicMember.optional && this.unexpected(maybeQuestionTokenStartLoc), method.kind = "method";
|
42472
|
-
const isPrivate2 = this.match(
|
42484
|
+
const isPrivate2 = this.match(139);
|
42473
42485
|
this.parseClassElementName(method), this.parsePostMemberNameModifiers(publicMember), isPrivate2 ? this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, !0) : (this.isNonstaticConstructor(publicMethod) && this.raise(Errors.ConstructorIsAsync, publicMethod.key), this.pushClassMethod(classBody, publicMethod, isGenerator, !0, !1, !1));
|
42474
42486
|
} else if ((maybeContextualKw === "get" || maybeContextualKw === "set") && !(this.match(55) && this.isLineTerminator())) {
|
42475
42487
|
this.resetPreviousNodeTrailingComments(key2), method.kind = maybeContextualKw;
|
42476
|
-
const isPrivate2 = this.match(
|
42488
|
+
const isPrivate2 = this.match(139);
|
42477
42489
|
this.parseClassElementName(publicMethod), isPrivate2 ? this.pushClassPrivateMethod(classBody, privateMethod, !1, !1) : (this.isNonstaticConstructor(publicMethod) && this.raise(Errors.ConstructorIsAccessor, publicMethod.key), this.pushClassMethod(classBody, publicMethod, !1, !1, !1, !1)), this.checkGetterSetterParams(publicMethod);
|
42478
42490
|
} else if (maybeContextualKw === "accessor" && !this.isLineTerminator()) {
|
42479
42491
|
this.expectPlugin("decoratorAutoAccessors"), this.resetPreviousNodeTrailingComments(key2);
|
42480
|
-
const isPrivate2 = this.match(
|
42492
|
+
const isPrivate2 = this.match(139);
|
42481
42493
|
this.parseClassElementName(publicProp), this.pushClassAccessorProperty(classBody, accessorProp, isPrivate2);
|
42482
42494
|
} else this.isLineTerminator() ? isPrivate ? this.pushClassPrivateProperty(classBody, privateProp) : this.pushClassProperty(classBody, publicProp) : this.unexpected();
|
42483
42495
|
}
|
@@ -42486,7 +42498,7 @@ function requireLib$1() {
|
|
42486
42498
|
type: type2,
|
42487
42499
|
value
|
42488
42500
|
} = this.state;
|
42489
|
-
if ((type2 === 132 || type2 ===
|
42501
|
+
if ((type2 === 132 || type2 === 134) && member.static && value === "prototype" && this.raise(Errors.StaticPrototype, this.state.startLoc), type2 === 139) {
|
42490
42502
|
value === "constructor" && this.raise(Errors.ConstructorClassPrivateField, this.state.startLoc);
|
42491
42503
|
const key2 = this.parsePrivateName();
|
42492
42504
|
return member.key = key2, key2;
|
@@ -42735,7 +42747,7 @@ function requireLib$1() {
|
|
42735
42747
|
if (first2)
|
42736
42748
|
first2 = !1;
|
42737
42749
|
else if (this.expect(12), this.eat(8)) break;
|
42738
|
-
const isMaybeTypeOnly = this.isContextual(130), isString = this.match(
|
42750
|
+
const isMaybeTypeOnly = this.isContextual(130), isString = this.match(134), node = this.startNode();
|
42739
42751
|
node.local = this.parseModuleExportName(), nodes.push(this.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly));
|
42740
42752
|
}
|
42741
42753
|
return nodes;
|
@@ -42744,7 +42756,7 @@ function requireLib$1() {
|
|
42744
42756
|
return this.eatContextual(93) ? node.exported = this.parseModuleExportName() : isString ? node.exported = cloneStringLiteral(node.local) : node.exported || (node.exported = cloneIdentifier(node.local)), this.finishNode(node, "ExportSpecifier");
|
42745
42757
|
}
|
42746
42758
|
parseModuleExportName() {
|
42747
|
-
if (this.match(
|
42759
|
+
if (this.match(134)) {
|
42748
42760
|
const result = this.parseStringLiteral(this.state.value), surrogate = loneSurrogate.exec(result.value);
|
42749
42761
|
return surrogate && this.raise(Errors.ModuleExportNameHasLoneSurrogate, result, {
|
42750
42762
|
surrogateCharCode: surrogate[0].charCodeAt(0)
|
@@ -42807,7 +42819,7 @@ function requireLib$1() {
|
|
42807
42819
|
return tokenIsIdentifier(type2) ? type2 !== 98 || this.lookaheadCharCode() === 102 : type2 !== 12;
|
42808
42820
|
}
|
42809
42821
|
parseImport(node) {
|
42810
|
-
return this.match(
|
42822
|
+
return this.match(134) ? this.parseImportSourceAndAttributes(node) : this.parseImportSpecifiersAndAfter(node, this.parseMaybeImportPhase(node, !1));
|
42811
42823
|
}
|
42812
42824
|
parseImportSpecifiersAndAfter(node, maybeDefaultIdentifier) {
|
42813
42825
|
node.specifiers = [];
|
@@ -42819,7 +42831,7 @@ function requireLib$1() {
|
|
42819
42831
|
return (_node$specifiers2 = node.specifiers) != null || (node.specifiers = []), node.source = this.parseImportSource(), this.maybeParseImportAttributes(node), this.checkImportReflection(node), this.checkJSONModuleImport(node), this.semicolon(), this.finishNode(node, "ImportDeclaration");
|
42820
42832
|
}
|
42821
42833
|
parseImportSource() {
|
42822
|
-
return this.match(
|
42834
|
+
return this.match(134) || this.unexpected(), this.parseExprAtom();
|
42823
42835
|
}
|
42824
42836
|
parseImportSpecifierLocal(node, specifier, type2) {
|
42825
42837
|
specifier.local = this.parseIdentifier(), node.specifiers.push(this.finishImportSpecifier(specifier, type2));
|
@@ -42838,7 +42850,7 @@ function requireLib$1() {
|
|
42838
42850
|
const node = this.startNode(), keyName = this.state.value;
|
42839
42851
|
if (attrNames.has(keyName) && this.raise(Errors.ModuleAttributesWithDuplicateKeys, this.state.startLoc, {
|
42840
42852
|
key: keyName
|
42841
|
-
}), attrNames.add(keyName), this.match(
|
42853
|
+
}), attrNames.add(keyName), this.match(134) ? node.key = this.parseStringLiteral(keyName) : node.key = this.parseIdentifier(!0), this.expect(14), !this.match(134))
|
42842
42854
|
throw this.raise(Errors.ModuleAttributeInvalidValue, this.state.startLoc);
|
42843
42855
|
node.value = this.parseStringLiteral(this.state.value), attrs.push(this.finishNode(node, "ImportAttribute"));
|
42844
42856
|
} while (this.eat(12));
|
@@ -42850,7 +42862,7 @@ function requireLib$1() {
|
|
42850
42862
|
const node = this.startNode();
|
42851
42863
|
if (node.key = this.parseIdentifier(!0), node.key.name !== "type" && this.raise(Errors.ModuleAttributeDifferentFromType, node.key), attributes.has(node.key.name) && this.raise(Errors.ModuleAttributesWithDuplicateKeys, node.key, {
|
42852
42864
|
key: node.key.name
|
42853
|
-
}), attributes.add(node.key.name), this.expect(14), !this.match(
|
42865
|
+
}), attributes.add(node.key.name), this.expect(14), !this.match(134))
|
42854
42866
|
throw this.raise(Errors.ModuleAttributeInvalidValue, this.state.startLoc);
|
42855
42867
|
node.value = this.parseStringLiteral(this.state.value), attrs.push(this.finishNode(node, "ImportAttribute"));
|
42856
42868
|
} while (this.eat(12));
|
@@ -42862,14 +42874,8 @@ function requireLib$1() {
|
|
42862
42874
|
if (this.match(76)) {
|
42863
42875
|
if (this.hasPrecedingLineBreak() && this.lookaheadCharCode() === 40)
|
42864
42876
|
return;
|
42865
|
-
this.next(), this.hasPlugin("moduleAttributes") ? attributes = this.parseModuleAttributes() :
|
42866
|
-
} else
|
42867
|
-
this.hasPlugin("importAttributes") ? (this.getPluginOption("importAttributes", "deprecatedAssertSyntax") !== !0 && this.raise(Errors.ImportAttributesUseAssert, this.state.startLoc), this.addExtra(node, "deprecatedAssertSyntax", !0)) : this.expectOnePlugin(["importAttributes", "importAssertions"]), this.next(), attributes = this.parseImportAttributes();
|
42868
|
-
else if (this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions"))
|
42869
|
-
attributes = [];
|
42870
|
-
else if (this.hasPlugin("moduleAttributes"))
|
42871
|
-
attributes = [];
|
42872
|
-
else return;
|
42877
|
+
this.next(), this.hasPlugin("moduleAttributes") ? attributes = this.parseModuleAttributes() : attributes = this.parseImportAttributes(), useWith = !0;
|
42878
|
+
} else this.isContextual(94) && !this.hasPrecedingLineBreak() ? (!this.hasPlugin("deprecatedImportAssert") && !this.hasPlugin("importAssertions") && this.raise(Errors.ImportAttributesUseAssert, this.state.startLoc), this.hasPlugin("importAssertions") || this.addExtra(node, "deprecatedAssertSyntax", !0), this.next(), attributes = this.parseImportAttributes()) : attributes = [];
|
42873
42879
|
!useWith && this.hasPlugin("importAssertions") ? node.assertions = attributes : node.attributes = attributes;
|
42874
42880
|
}
|
42875
42881
|
maybeParseDefaultImportSpecifier(node, maybeDefaultIdentifier) {
|
@@ -42897,7 +42903,7 @@ function requireLib$1() {
|
|
42897
42903
|
throw this.raise(Errors.DestructureNamedImport, this.state.startLoc);
|
42898
42904
|
if (this.expect(12), this.eat(8)) break;
|
42899
42905
|
}
|
42900
|
-
const specifier = this.startNode(), importedIsString = this.match(
|
42906
|
+
const specifier = this.startNode(), importedIsString = this.match(134), isMaybeTypeOnly = this.isContextual(130);
|
42901
42907
|
specifier.imported = this.parseModuleExportName();
|
42902
42908
|
const importSpecifier = this.parseImportSpecifier(specifier, importedIsString, node.importKind === "type" || node.importKind === "typeof", isMaybeTypeOnly, void 0);
|
42903
42909
|
node.specifiers.push(importSpecifier);
|
@@ -42924,7 +42930,7 @@ function requireLib$1() {
|
|
42924
42930
|
}
|
42925
42931
|
class Parser extends StatementParser {
|
42926
42932
|
constructor(options2, input2, pluginsMap) {
|
42927
|
-
options2 = getOptions(options2), super(options2, input2), this.options = options2, this.initializeScopes(), this.plugins = pluginsMap, this.filename = options2.sourceFilename;
|
42933
|
+
options2 = getOptions(options2), super(options2, input2), this.options = options2, this.initializeScopes(), this.plugins = pluginsMap, this.filename = options2.sourceFilename, this.startIndex = options2.startIndex;
|
42928
42934
|
}
|
42929
42935
|
getScopeHandler() {
|
42930
42936
|
return ScopeHandler;
|
@@ -45158,6 +45164,19 @@ export const client = createClient({
|
|
45158
45164
|
apiVersion,
|
45159
45165
|
useCdn: true, // Set to false if statically generating pages, using ISR or tag-based revalidation
|
45160
45166
|
})
|
45167
|
+
`, live = `// Querying with "sanityFetch" will keep content automatically updated
|
45168
|
+
// Before using it, import and render "<SanityLive />" in your layout, see
|
45169
|
+
// https://github.com/sanity-io/next-sanity#live-content-api for more information.
|
45170
|
+
import { defineLive } from "next-sanity";
|
45171
|
+
import { client } from './client'
|
45172
|
+
|
45173
|
+
export const { sanityFetch, SanityLive } = defineLive({
|
45174
|
+
client: client.withConfig({
|
45175
|
+
// Live content is currently only available on the experimental API
|
45176
|
+
// https://www.sanity.io/docs/api-versioning
|
45177
|
+
apiVersion: 'vX'
|
45178
|
+
})
|
45179
|
+
});
|
45161
45180
|
`, imageTS = `import createImageUrlBuilder from '@sanity/image-url'
|
45162
45181
|
import { SanityImageSource } from "@sanity/image-url/lib/types/types";
|
45163
45182
|
|
@@ -45184,6 +45203,7 @@ export const urlFor = (source) => {
|
|
45184
45203
|
"env.": useTypeScript ? envTS : envJS,
|
45185
45204
|
lib: {
|
45186
45205
|
"client.": client,
|
45206
|
+
"live.": live,
|
45187
45207
|
"image.": useTypeScript ? imageTS : imageJS
|
45188
45208
|
}
|
45189
45209
|
};
|