diff --git a/data/definitions.md b/data/definitions.md
index 01398b4..cbcf790 100644
--- a/data/definitions.md
+++ b/data/definitions.md
@@ -4,6 +4,12 @@
# LUNCH'N'LEARNS
+If you're expecting people to give up their lunchtime, choose the type of activities and format sensitively so people have the opportunity to eat / draw breath.
+Set expectations around how people should engage and interact.
+https://www.hoppier.com/blog/lunch-and-learn
+https://www.mindtools.com/atv697v/how-to-run-successful-lunch-and-learn-events
+https://www.mindtools.com/akolpj7/how-to-run-a-world-cafe
+
# UNCONFERENCE
# PAIRING
@@ -106,3 +112,9 @@ A lightning talk is a short-form talk, usually lasting around 2-5 minutes. There
# DOCUMENTING
# CREATING SHARED RESOURCES
+
+# OBSERVABILITY TOOLS
+
+# TEAM HEALTH CHECKS
+
+
diff --git a/data/elements.json b/data/elements.json
new file mode 100644
index 0000000..8ea8b15
--- /dev/null
+++ b/data/elements.json
@@ -0,0 +1,273 @@
+[
+ {
+ "title" : "RETROSPECTIVES",
+ "description": "",
+ "links": [],
+ "icon": "bi-clock-history"
+ },
+ {
+ "title" : "DEMOS",
+ "description": "",
+ "links" :[],
+ "icon":"bi-tv"
+ },
+ {
+ "title" : "LUNCH'N'LEARNS",
+ "description": "If you're expecting people to give up their lunchtime, choose the type of activities and format sensitively so people have the opportunity to eat / draw breath. Set expectations around how people should engage and interact.",
+ "links": [
+ "https://www.hoppier.com/blog/lunch-and-learn",
+ "https://www.mindtools.com/atv697v/how-to-run-successful-lunch-and-learn-events",
+ "https://www.mindtools.com/akolpj7/how-to-run-a-world-cafe"
+ ]
+ },
+ {
+ "title" : "UNCONFERENCE",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "PAIRING",
+ "description": "Pairing essentially involves working in partnership with someone, in real-time, towards the same goal. It is typically practiced by developers when writing code, but you can pair on non-coding activities too. Pairing offers many benefits, not least in supporting person-to-person knowledge transfer and diversity of thinking. You should also consider the challenges associated with pairing and be mindful about when and how it is applied.",
+ "links" :[
+ "https://martinfowler.com/articles/on-pair-programming.html",
+ "https://sorrelharriet.medium.com/supporting-neurodiversity-in-paired-programming-8b250d2b5cab"
+ ]
+ },
+ {
+ "title" : "MOBBING",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "HACK DAYS",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "PEER REVIEW",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "SWARMING",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "GROUP COACHING",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "1-1 COACHING",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "TEAM COACHING",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "MENTORING",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "COMMUNITIES OF PRACTICE",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "WORKSHOPS",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "BLAMELESS POST-MORTEMS",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "GUEST SPEAKERS",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "BOOK CLUBS",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "DOJOS",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "SPECIAL INTEREST CHANNELS",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "'TODAY I LEARNED'",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "BRAINSTORMING",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "LEARNING BACKLOG",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "BLOGGING",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "SHARED SOURCE CODE REPOSITORY",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "TESTS AS DOCUMENTATION",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "CONFERENCES",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "WORK SHADOWING",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "GAME DAYS / SIMULATIONS",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "SCENARIO-BASED LEARNING",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "ONLINE COURSES",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "EXPERIMENTS",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "CODE REVIEW",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "WIKI / KNOWLEDGE BASE",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "GROUP PROBLEM-SOLVING",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "IMPROVEMENT BLITZES",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "SHATROOMS & CHATBOTS",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "GIVING & RECEIVING FEEDBACK",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "ASKING FOR HELP",
+ "description": "Sounds straightforward, yet people will often avoid asking for help for a multitude of reasons. Look for ways to normalise asking for help in your team(s), and ensure that the help people receive is actually helpful. For example, you might consider creating dedicated help channels where people can easily connect around a question or problem; you might work to foster a 'culture of help' in your organisation or team, which will most likely neccessitate a 'whole person' approach, as opposed to focusing soley on work matters; you might also give people a base level of teaching and mentoring skills to make them better helpers. Perhaps most importantly, foster a culture of collaboration and 'Teaming', whereby people will instinctively call on each other to solve a problem.",
+ "links" :[
+ "https://www.self.com/story/how-to-ask-for-help",
+ "https://www.youtube.com/watch?v=sZZHkqIY0Fo"
+ ]
+ },
+ {
+ "title" : "ASKING REFLECTIVE QUESTIONS",
+ "description": "This is a powerful skill for learning that anyone can use to promote reflection in others. Used in teams, it not only fosters reflective inquiry, but may also help build trust and encourage diversity of thought. There are many tools available to help us develop our reflective questioning capability.",
+ "links" :[
+ "https://www.laas.consulting/resources/4As-reflective-questioning-framework.pdf"
+ ]
+ },
+ {
+ "title" : "WALK & TALKS",
+ "description": "A walk and talk is simply a conversation away from the desk. You might combine it with another activity, such as walking the dog or visiting an art gallery. The change of environment and physical movement can stimulate fresh thinking and help you avoid other distractions and relational barriers associated with being in an office environment. Bear in mind this format may not be suitable for every topic of conversation, and that the activity and location should feel comfortable and accessible to all participants.",
+ "links" :[]
+ },
+ {
+ "title" : "PROCESSING PAUSES",
+ "description": "A processing pause means taking time to think and/or 'be' after an emotional or cognitively demanding experience. For example, processing pauses can be worked in and around meetings, workshops and other situations at work when you're having to react or problem-solve in the moment. During a processing pause you might want to write things down, reflect on a recent experience, or simply check in with yourself and how you are feeling in the moment.",
+ "links" :[]
+ },
+ {
+ "title" : "GUIDED EXPERIENCES",
+ "description": "A guided experience is a curated sequence of tasks that guide a person through a multistage process, possibly spanning multiple systems. For example, a guided experience could be used to support someone through their onboarding, run an experiment, or navigate a formal progression process. It's more than a 'to do' list, since it considers the goals and experiences of the person performing the tasks. Guided experiences can be administered in a multitude of ways, from a simple wiki page to a course on a company's Learning Management System (LMS).",
+ "links" :[]
+ },
+ {
+ "title" : "WATERCOOLER CHATS",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "READING",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "LIGHTNING TALKS",
+ "description": "A lightning talk is a short-form talk, usually lasting around 2-5 minutes. There are variations on the format, including the 'pecha kucha' and 'ignite talk' formats. Lightning talks are often given at conferences, but they can also be included in workplace events such as lunch'n'learns, demos and learning days. They are a great way to cultivate your presentation skills, consolidate and share learning, or invite feedback and discussion around a problem or idea. For those in the audience, lightning talks are an opportunity to practice active listening, reflective questioning and giving feedback.",
+ "links" :[
+ "https://ce.fresno.edu/news/what-is-a-pecha-kucha-presentation/",
+ "https://scottberkun.com/2009/how-to-give-a-great-ignite-talk"
+ ]
+ },
+ {
+ "title" : "DOCUMENTING",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "CREATING SHARED RESOURCES",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "OBSERVABILITY TOOLS",
+ "description": "",
+ "links" :[]
+ },
+ {
+ "title" : "TEAM HEALTH CHECKS",
+ "description": "",
+ "links" :[
+ "https://getdx.com/products/devex360/",
+ "https://https://www.teamperature.com/"
+ ]
+ }
+]
+
diff --git a/index.html b/index.html
index 6dffb42..dbf81bc 100644
--- a/index.html
+++ b/index.html
@@ -1,7 +1,7 @@
- Periodic Table of Learning Elements
+ A Toolbox for Continuous Learning
diff --git a/index.js b/index.js
index ba92dbb..a4f2125 100644
--- a/index.js
+++ b/index.js
@@ -2,14 +2,23 @@ const express = require("express");
const path = require('path');
const app = express();
const port = 3000;
+const data = require('./data/elements.json');
+const helpers = require("./modules/helpers");
app.use(express.static(__dirname + '/static'));
app.use(express.static(__dirname + '/node_modules/bootstrap/dist'));
app.use(express.static(__dirname + '/node_modules/bootstrap-icons'));
+app.set('views', './views')
+app.set('view engine', 'pug')
+
+//app.get("/", (req, res) => {
+// res.sendFile(path.join(__dirname, '/index.html'));
+//});
+
app.get("/", (req, res) => {
- res.sendFile(path.join(__dirname, '/index.html'));
-});
+ res.render('index', { title: 'Toolbox for Continuous Learning', data: data })
+})
app.listen(port, () => {
console.log(`Example app listening on port ${port}!`);
diff --git a/modules/helpers.js b/modules/helpers.js
new file mode 100644
index 0000000..9fca752
--- /dev/null
+++ b/modules/helpers.js
@@ -0,0 +1,9 @@
+function range(start, stop, step) {
+ return Array.from(
+ { length: (stop - start) / step + 1 },
+ (value, index) => start + index * step
+ );
+}
+
+module.exports = { range };
+
\ No newline at end of file
diff --git a/node_modules/.bin/acorn b/node_modules/.bin/acorn
new file mode 120000
index 0000000..cf76760
--- /dev/null
+++ b/node_modules/.bin/acorn
@@ -0,0 +1 @@
+../acorn/bin/acorn
\ No newline at end of file
diff --git a/node_modules/.bin/parser b/node_modules/.bin/parser
new file mode 120000
index 0000000..ce7bf97
--- /dev/null
+++ b/node_modules/.bin/parser
@@ -0,0 +1 @@
+../@babel/parser/bin/babel-parser.js
\ No newline at end of file
diff --git a/node_modules/.bin/resolve b/node_modules/.bin/resolve
new file mode 120000
index 0000000..b6afda6
--- /dev/null
+++ b/node_modules/.bin/resolve
@@ -0,0 +1 @@
+../resolve/bin/resolve
\ No newline at end of file
diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json
index 35ca248..88b3f9c 100644
--- a/node_modules/.package-lock.json
+++ b/node_modules/.package-lock.json
@@ -4,6 +4,49 @@
"lockfileVersion": 3,
"requires": true,
"packages": {
+ "node_modules/@babel/helper-string-parser": {
+ "version": "7.24.8",
+ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz",
+ "integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-validator-identifier": {
+ "version": "7.24.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz",
+ "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/parser": {
+ "version": "7.25.6",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.6.tgz",
+ "integrity": "sha512-trGdfBdbD0l1ZPmcJ83eNxB9rbEax4ALFTF7fN386TMYbeCQbyme5cOEXQhbGXKebwGaB/J52w1mrklMcbgy6Q==",
+ "dependencies": {
+ "@babel/types": "^7.25.6"
+ },
+ "bin": {
+ "parser": "bin/babel-parser.js"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@babel/types": {
+ "version": "7.25.6",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.6.tgz",
+ "integrity": "sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==",
+ "dependencies": {
+ "@babel/helper-string-parser": "^7.24.8",
+ "@babel/helper-validator-identifier": "^7.24.7",
+ "to-fast-properties": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
"node_modules/@popperjs/core": {
"version": "2.11.7",
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.7.tgz",
@@ -26,26 +69,58 @@
"node": ">= 0.6"
}
},
+ "node_modules/acorn": {
+ "version": "7.4.1",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
+ "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
+ "bin": {
+ "acorn": "bin/acorn"
+ },
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
"node_modules/array-flatten": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
"integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="
},
+ "node_modules/asap": {
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz",
+ "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA=="
+ },
+ "node_modules/assert-never": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/assert-never/-/assert-never-1.3.0.tgz",
+ "integrity": "sha512-9Z3vxQ+berkL/JJo0dK+EY3Lp0s3NtSnP3VCLsh5HDcZPrh0M+KQRK5sWhUeyPPH+/RCxZqOxLMR+YC6vlviEQ=="
+ },
+ "node_modules/babel-walk": {
+ "version": "3.0.0-canary-5",
+ "resolved": "https://registry.npmjs.org/babel-walk/-/babel-walk-3.0.0-canary-5.tgz",
+ "integrity": "sha512-GAwkz0AihzY5bkwIY5QDR+LvsRQgB/B+1foMPvi0FZPMl5fjD7ICiznUiBdLYMH1QYe6vqu4gWYytZOccLouFw==",
+ "dependencies": {
+ "@babel/types": "^7.9.6"
+ },
+ "engines": {
+ "node": ">= 10.0.0"
+ }
+ },
"node_modules/body-parser": {
- "version": "1.20.1",
- "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz",
- "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==",
+ "version": "1.20.3",
+ "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz",
+ "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==",
"dependencies": {
"bytes": "3.1.2",
- "content-type": "~1.0.4",
+ "content-type": "~1.0.5",
"debug": "2.6.9",
"depd": "2.0.0",
"destroy": "1.2.0",
"http-errors": "2.0.0",
"iconv-lite": "0.4.24",
"on-finished": "2.4.1",
- "qs": "6.11.0",
- "raw-body": "2.5.1",
+ "qs": "6.13.0",
+ "raw-body": "2.5.2",
"type-is": "~1.6.18",
"unpipe": "1.0.0"
},
@@ -86,17 +161,40 @@
}
},
"node_modules/call-bind": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
- "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz",
+ "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==",
"dependencies": {
- "function-bind": "^1.1.1",
- "get-intrinsic": "^1.0.2"
+ "es-define-property": "^1.0.0",
+ "es-errors": "^1.3.0",
+ "function-bind": "^1.1.2",
+ "get-intrinsic": "^1.2.4",
+ "set-function-length": "^1.2.1"
+ },
+ "engines": {
+ "node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/character-parser": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/character-parser/-/character-parser-2.2.0.tgz",
+ "integrity": "sha512-+UqJQjFEFaTAs3bNsF2j2kEN1baG/zghZbdqoYEDxGZtJo9LBzl1A+m0D4n3qKx8N2FNv8/Xp6yV9mQmBuptaw==",
+ "dependencies": {
+ "is-regex": "^1.0.3"
+ }
+ },
+ "node_modules/constantinople": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/constantinople/-/constantinople-4.0.1.tgz",
+ "integrity": "sha512-vCrqcSIq4//Gx74TXXCGnHpulY1dskqLTFGDmhrGxzeXL8lF8kvXv6mpNWlJj1uD4DW23D4ljAqbY4RRaaUZIw==",
+ "dependencies": {
+ "@babel/parser": "^7.6.0",
+ "@babel/types": "^7.6.1"
+ }
+ },
"node_modules/content-disposition": {
"version": "0.5.4",
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
@@ -117,9 +215,9 @@
}
},
"node_modules/cookie": {
- "version": "0.5.0",
- "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz",
- "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==",
+ "version": "0.6.0",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz",
+ "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==",
"engines": {
"node": ">= 0.6"
}
@@ -137,6 +235,22 @@
"ms": "2.0.0"
}
},
+ "node_modules/define-data-property": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz",
+ "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==",
+ "dependencies": {
+ "es-define-property": "^1.0.0",
+ "es-errors": "^1.3.0",
+ "gopd": "^1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
"node_modules/depd": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
@@ -154,19 +268,43 @@
"npm": "1.2.8000 || >= 1.4.16"
}
},
+ "node_modules/doctypes": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/doctypes/-/doctypes-1.1.0.tgz",
+ "integrity": "sha512-LLBi6pEqS6Do3EKQ3J0NqHWV5hhb78Pi8vvESYwyOy2c31ZEZVdtitdzsQsKb7878PEERhzUk0ftqGhG6Mz+pQ=="
+ },
"node_modules/ee-first": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
},
"node_modules/encodeurl": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
- "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",
+ "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",
"engines": {
"node": ">= 0.8"
}
},
+ "node_modules/es-define-property": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz",
+ "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==",
+ "dependencies": {
+ "get-intrinsic": "^1.2.4"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/es-errors": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
+ "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
"node_modules/escape-html": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
@@ -181,36 +319,36 @@
}
},
"node_modules/express": {
- "version": "4.18.2",
- "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz",
- "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==",
+ "version": "4.21.0",
+ "resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz",
+ "integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==",
"dependencies": {
"accepts": "~1.3.8",
"array-flatten": "1.1.1",
- "body-parser": "1.20.1",
+ "body-parser": "1.20.3",
"content-disposition": "0.5.4",
"content-type": "~1.0.4",
- "cookie": "0.5.0",
+ "cookie": "0.6.0",
"cookie-signature": "1.0.6",
"debug": "2.6.9",
"depd": "2.0.0",
- "encodeurl": "~1.0.2",
+ "encodeurl": "~2.0.0",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
- "finalhandler": "1.2.0",
+ "finalhandler": "1.3.1",
"fresh": "0.5.2",
"http-errors": "2.0.0",
- "merge-descriptors": "1.0.1",
+ "merge-descriptors": "1.0.3",
"methods": "~1.1.2",
"on-finished": "2.4.1",
"parseurl": "~1.3.3",
- "path-to-regexp": "0.1.7",
+ "path-to-regexp": "0.1.10",
"proxy-addr": "~2.0.7",
- "qs": "6.11.0",
+ "qs": "6.13.0",
"range-parser": "~1.2.1",
"safe-buffer": "5.2.1",
- "send": "0.18.0",
- "serve-static": "1.15.0",
+ "send": "0.19.0",
+ "serve-static": "1.16.2",
"setprototypeof": "1.2.0",
"statuses": "2.0.1",
"type-is": "~1.6.18",
@@ -222,12 +360,12 @@
}
},
"node_modules/finalhandler": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz",
- "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==",
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz",
+ "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==",
"dependencies": {
"debug": "2.6.9",
- "encodeurl": "~1.0.2",
+ "encodeurl": "~2.0.0",
"escape-html": "~1.0.3",
"on-finished": "2.4.1",
"parseurl": "~1.3.3",
@@ -255,32 +393,62 @@
}
},
"node_modules/function-bind": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
- "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
+ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
},
"node_modules/get-intrinsic": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz",
- "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==",
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz",
+ "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==",
"dependencies": {
- "function-bind": "^1.1.1",
- "has": "^1.0.3",
- "has-symbols": "^1.0.3"
+ "es-errors": "^1.3.0",
+ "function-bind": "^1.1.2",
+ "has-proto": "^1.0.1",
+ "has-symbols": "^1.0.3",
+ "hasown": "^2.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
- "node_modules/has": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
- "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
+ "node_modules/gopd": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz",
+ "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==",
"dependencies": {
- "function-bind": "^1.1.1"
+ "get-intrinsic": "^1.1.3"
},
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/has-property-descriptors": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz",
+ "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==",
+ "dependencies": {
+ "es-define-property": "^1.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/has-proto": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz",
+ "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==",
"engines": {
- "node": ">= 0.4.0"
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/has-symbols": {
@@ -294,6 +462,31 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/has-tostringtag": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz",
+ "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==",
+ "dependencies": {
+ "has-symbols": "^1.0.3"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/hasown": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
+ "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
+ "dependencies": {
+ "function-bind": "^1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
"node_modules/http-errors": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz",
@@ -333,6 +526,63 @@
"node": ">= 0.10"
}
},
+ "node_modules/is-core-module": {
+ "version": "2.15.1",
+ "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz",
+ "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==",
+ "dependencies": {
+ "hasown": "^2.0.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/is-expression": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/is-expression/-/is-expression-4.0.0.tgz",
+ "integrity": "sha512-zMIXX63sxzG3XrkHkrAPvm/OVZVSCPNkwMHU8oTX7/U3AL78I0QXCEICXUM13BIa8TYGZ68PiTKfQz3yaTNr4A==",
+ "dependencies": {
+ "acorn": "^7.1.1",
+ "object-assign": "^4.1.1"
+ }
+ },
+ "node_modules/is-promise": {
+ "version": "2.2.2",
+ "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz",
+ "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ=="
+ },
+ "node_modules/is-regex": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz",
+ "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==",
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "has-tostringtag": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/js-stringify": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/js-stringify/-/js-stringify-1.0.2.tgz",
+ "integrity": "sha512-rtS5ATOo2Q5k1G+DADISilDA6lv79zIiwFd6CcjuIxGKLFm5C+RLImRscVap9k55i+MOZwgliw+NejvkLuGD5g=="
+ },
+ "node_modules/jstransformer": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/jstransformer/-/jstransformer-1.0.0.tgz",
+ "integrity": "sha512-C9YK3Rf8q6VAPDCCU9fnqo3mAfOH6vUGnMcP4AQAYIEpWtfGLpwOTmZ+igtdK5y+VvI2n3CyYSzy4Qh34eq24A==",
+ "dependencies": {
+ "is-promise": "^2.0.0",
+ "promise": "^7.0.1"
+ }
+ },
"node_modules/media-typer": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
@@ -342,9 +592,12 @@
}
},
"node_modules/merge-descriptors": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
- "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w=="
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz",
+ "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==",
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
},
"node_modules/methods": {
"version": "1.1.2",
@@ -397,10 +650,21 @@
"node": ">= 0.6"
}
},
+ "node_modules/object-assign": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
+ "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
"node_modules/object-inspect": {
- "version": "1.12.3",
- "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz",
- "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==",
+ "version": "1.13.2",
+ "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz",
+ "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==",
+ "engines": {
+ "node": ">= 0.4"
+ },
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
@@ -424,10 +688,23 @@
"node": ">= 0.8"
}
},
+ "node_modules/path-parse": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
+ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="
+ },
"node_modules/path-to-regexp": {
- "version": "0.1.7",
- "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
- "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ=="
+ "version": "0.1.10",
+ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz",
+ "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w=="
+ },
+ "node_modules/promise": {
+ "version": "7.3.1",
+ "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz",
+ "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==",
+ "dependencies": {
+ "asap": "~2.0.3"
+ }
},
"node_modules/proxy-addr": {
"version": "2.0.7",
@@ -441,12 +718,124 @@
"node": ">= 0.10"
}
},
+ "node_modules/pug": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/pug/-/pug-3.0.3.tgz",
+ "integrity": "sha512-uBi6kmc9f3SZ3PXxqcHiUZLmIXgfgWooKWXcwSGwQd2Zi5Rb0bT14+8CJjJgI8AB+nndLaNgHGrcc6bPIB665g==",
+ "dependencies": {
+ "pug-code-gen": "^3.0.3",
+ "pug-filters": "^4.0.0",
+ "pug-lexer": "^5.0.1",
+ "pug-linker": "^4.0.0",
+ "pug-load": "^3.0.0",
+ "pug-parser": "^6.0.0",
+ "pug-runtime": "^3.0.1",
+ "pug-strip-comments": "^2.0.0"
+ }
+ },
+ "node_modules/pug-attrs": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pug-attrs/-/pug-attrs-3.0.0.tgz",
+ "integrity": "sha512-azINV9dUtzPMFQktvTXciNAfAuVh/L/JCl0vtPCwvOA21uZrC08K/UnmrL+SXGEVc1FwzjW62+xw5S/uaLj6cA==",
+ "dependencies": {
+ "constantinople": "^4.0.1",
+ "js-stringify": "^1.0.2",
+ "pug-runtime": "^3.0.0"
+ }
+ },
+ "node_modules/pug-code-gen": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/pug-code-gen/-/pug-code-gen-3.0.3.tgz",
+ "integrity": "sha512-cYQg0JW0w32Ux+XTeZnBEeuWrAY7/HNE6TWnhiHGnnRYlCgyAUPoyh9KzCMa9WhcJlJ1AtQqpEYHc+vbCzA+Aw==",
+ "dependencies": {
+ "constantinople": "^4.0.1",
+ "doctypes": "^1.1.0",
+ "js-stringify": "^1.0.2",
+ "pug-attrs": "^3.0.0",
+ "pug-error": "^2.1.0",
+ "pug-runtime": "^3.0.1",
+ "void-elements": "^3.1.0",
+ "with": "^7.0.0"
+ }
+ },
+ "node_modules/pug-error": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/pug-error/-/pug-error-2.1.0.tgz",
+ "integrity": "sha512-lv7sU9e5Jk8IeUheHata6/UThZ7RK2jnaaNztxfPYUY+VxZyk/ePVaNZ/vwmH8WqGvDz3LrNYt/+gA55NDg6Pg=="
+ },
+ "node_modules/pug-filters": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/pug-filters/-/pug-filters-4.0.0.tgz",
+ "integrity": "sha512-yeNFtq5Yxmfz0f9z2rMXGw/8/4i1cCFecw/Q7+D0V2DdtII5UvqE12VaZ2AY7ri6o5RNXiweGH79OCq+2RQU4A==",
+ "dependencies": {
+ "constantinople": "^4.0.1",
+ "jstransformer": "1.0.0",
+ "pug-error": "^2.0.0",
+ "pug-walk": "^2.0.0",
+ "resolve": "^1.15.1"
+ }
+ },
+ "node_modules/pug-lexer": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/pug-lexer/-/pug-lexer-5.0.1.tgz",
+ "integrity": "sha512-0I6C62+keXlZPZkOJeVam9aBLVP2EnbeDw3An+k0/QlqdwH6rv8284nko14Na7c0TtqtogfWXcRoFE4O4Ff20w==",
+ "dependencies": {
+ "character-parser": "^2.2.0",
+ "is-expression": "^4.0.0",
+ "pug-error": "^2.0.0"
+ }
+ },
+ "node_modules/pug-linker": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/pug-linker/-/pug-linker-4.0.0.tgz",
+ "integrity": "sha512-gjD1yzp0yxbQqnzBAdlhbgoJL5qIFJw78juN1NpTLt/mfPJ5VgC4BvkoD3G23qKzJtIIXBbcCt6FioLSFLOHdw==",
+ "dependencies": {
+ "pug-error": "^2.0.0",
+ "pug-walk": "^2.0.0"
+ }
+ },
+ "node_modules/pug-load": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pug-load/-/pug-load-3.0.0.tgz",
+ "integrity": "sha512-OCjTEnhLWZBvS4zni/WUMjH2YSUosnsmjGBB1An7CsKQarYSWQ0GCVyd4eQPMFJqZ8w9xgs01QdiZXKVjk92EQ==",
+ "dependencies": {
+ "object-assign": "^4.1.1",
+ "pug-walk": "^2.0.0"
+ }
+ },
+ "node_modules/pug-parser": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/pug-parser/-/pug-parser-6.0.0.tgz",
+ "integrity": "sha512-ukiYM/9cH6Cml+AOl5kETtM9NR3WulyVP2y4HOU45DyMim1IeP/OOiyEWRr6qk5I5klpsBnbuHpwKmTx6WURnw==",
+ "dependencies": {
+ "pug-error": "^2.0.0",
+ "token-stream": "1.0.0"
+ }
+ },
+ "node_modules/pug-runtime": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/pug-runtime/-/pug-runtime-3.0.1.tgz",
+ "integrity": "sha512-L50zbvrQ35TkpHwv0G6aLSuueDRwc/97XdY8kL3tOT0FmhgG7UypU3VztfV/LATAvmUfYi4wNxSajhSAeNN+Kg=="
+ },
+ "node_modules/pug-strip-comments": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/pug-strip-comments/-/pug-strip-comments-2.0.0.tgz",
+ "integrity": "sha512-zo8DsDpH7eTkPHCXFeAk1xZXJbyoTfdPlNR0bK7rpOMuhBYb0f5qUVCO1xlsitYd3w5FQTK7zpNVKb3rZoUrrQ==",
+ "dependencies": {
+ "pug-error": "^2.0.0"
+ }
+ },
+ "node_modules/pug-walk": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/pug-walk/-/pug-walk-2.0.0.tgz",
+ "integrity": "sha512-yYELe9Q5q9IQhuvqsZNwA5hfPkMJ8u92bQLIMcsMxf/VADjNtEYptU+inlufAFYcWdHlwNfZOEnOOQrZrcyJCQ=="
+ },
"node_modules/qs": {
- "version": "6.11.0",
- "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
- "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
+ "version": "6.13.0",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz",
+ "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==",
"dependencies": {
- "side-channel": "^1.0.4"
+ "side-channel": "^1.0.6"
},
"engines": {
"node": ">=0.6"
@@ -464,9 +853,9 @@
}
},
"node_modules/raw-body": {
- "version": "2.5.1",
- "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz",
- "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==",
+ "version": "2.5.2",
+ "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz",
+ "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==",
"dependencies": {
"bytes": "3.1.2",
"http-errors": "2.0.0",
@@ -477,6 +866,22 @@
"node": ">= 0.8"
}
},
+ "node_modules/resolve": {
+ "version": "1.22.8",
+ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz",
+ "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==",
+ "dependencies": {
+ "is-core-module": "^2.13.0",
+ "path-parse": "^1.0.7",
+ "supports-preserve-symlinks-flag": "^1.0.0"
+ },
+ "bin": {
+ "resolve": "bin/resolve"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
"node_modules/safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
@@ -502,9 +907,9 @@
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
"node_modules/send": {
- "version": "0.18.0",
- "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz",
- "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==",
+ "version": "0.19.0",
+ "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz",
+ "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==",
"dependencies": {
"debug": "2.6.9",
"depd": "2.0.0",
@@ -524,38 +929,66 @@
"node": ">= 0.8.0"
}
},
+ "node_modules/send/node_modules/encodeurl": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
+ "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
"node_modules/send/node_modules/ms": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
},
"node_modules/serve-static": {
- "version": "1.15.0",
- "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz",
- "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==",
+ "version": "1.16.2",
+ "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz",
+ "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==",
"dependencies": {
- "encodeurl": "~1.0.2",
+ "encodeurl": "~2.0.0",
"escape-html": "~1.0.3",
"parseurl": "~1.3.3",
- "send": "0.18.0"
+ "send": "0.19.0"
},
"engines": {
"node": ">= 0.8.0"
}
},
+ "node_modules/set-function-length": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz",
+ "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==",
+ "dependencies": {
+ "define-data-property": "^1.1.4",
+ "es-errors": "^1.3.0",
+ "function-bind": "^1.1.2",
+ "get-intrinsic": "^1.2.4",
+ "gopd": "^1.0.1",
+ "has-property-descriptors": "^1.0.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
"node_modules/setprototypeof": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
"integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="
},
"node_modules/side-channel": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
- "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz",
+ "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==",
"dependencies": {
- "call-bind": "^1.0.0",
- "get-intrinsic": "^1.0.2",
- "object-inspect": "^1.9.0"
+ "call-bind": "^1.0.7",
+ "es-errors": "^1.3.0",
+ "get-intrinsic": "^1.2.4",
+ "object-inspect": "^1.13.1"
+ },
+ "engines": {
+ "node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
@@ -569,6 +1002,25 @@
"node": ">= 0.8"
}
},
+ "node_modules/supports-preserve-symlinks-flag": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
+ "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/to-fast-properties": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
+ "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
"node_modules/toidentifier": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
@@ -577,6 +1029,11 @@
"node": ">=0.6"
}
},
+ "node_modules/token-stream": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/token-stream/-/token-stream-1.0.0.tgz",
+ "integrity": "sha512-VSsyNPPW74RpHwR8Fc21uubwHY7wMDeJLys2IX5zJNih+OnAnaifKHo+1LHT7DAdloQ7apeaaWg8l7qnf/TnEg=="
+ },
"node_modules/type-is": {
"version": "1.6.18",
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
@@ -612,6 +1069,28 @@
"engines": {
"node": ">= 0.8"
}
+ },
+ "node_modules/void-elements": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz",
+ "integrity": "sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/with": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/with/-/with-7.0.2.tgz",
+ "integrity": "sha512-RNGKj82nUPg3g5ygxkQl0R937xLyho1J24ItRCBTr/m1YnZkzJy1hUiHUJrc/VlsDQzsCnInEGSg3bci0Lmd4w==",
+ "dependencies": {
+ "@babel/parser": "^7.9.6",
+ "@babel/types": "^7.9.6",
+ "assert-never": "^1.2.1",
+ "babel-walk": "3.0.0-canary-5"
+ },
+ "engines": {
+ "node": ">= 10.0.0"
+ }
}
}
}
diff --git a/node_modules/@babel/helper-string-parser/LICENSE b/node_modules/@babel/helper-string-parser/LICENSE
new file mode 100644
index 0000000..f31575e
--- /dev/null
+++ b/node_modules/@babel/helper-string-parser/LICENSE
@@ -0,0 +1,22 @@
+MIT License
+
+Copyright (c) 2014-present Sebastian McKenzie and other contributors
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/@babel/helper-string-parser/README.md b/node_modules/@babel/helper-string-parser/README.md
new file mode 100644
index 0000000..771b470
--- /dev/null
+++ b/node_modules/@babel/helper-string-parser/README.md
@@ -0,0 +1,19 @@
+# @babel/helper-string-parser
+
+> A utility package to parse strings
+
+See our website [@babel/helper-string-parser](https://babeljs.io/docs/babel-helper-string-parser) for more information.
+
+## Install
+
+Using npm:
+
+```sh
+npm install --save @babel/helper-string-parser
+```
+
+or using yarn:
+
+```sh
+yarn add @babel/helper-string-parser
+```
diff --git a/node_modules/@babel/helper-string-parser/lib/index.js b/node_modules/@babel/helper-string-parser/lib/index.js
new file mode 100644
index 0000000..2d94115
--- /dev/null
+++ b/node_modules/@babel/helper-string-parser/lib/index.js
@@ -0,0 +1,295 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.readCodePoint = readCodePoint;
+exports.readInt = readInt;
+exports.readStringContents = readStringContents;
+var _isDigit = function isDigit(code) {
+ return code >= 48 && code <= 57;
+};
+const forbiddenNumericSeparatorSiblings = {
+ decBinOct: new Set([46, 66, 69, 79, 95, 98, 101, 111]),
+ hex: new Set([46, 88, 95, 120])
+};
+const isAllowedNumericSeparatorSibling = {
+ bin: ch => ch === 48 || ch === 49,
+ oct: ch => ch >= 48 && ch <= 55,
+ dec: ch => ch >= 48 && ch <= 57,
+ hex: ch => ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102
+};
+function readStringContents(type, input, pos, lineStart, curLine, errors) {
+ const initialPos = pos;
+ const initialLineStart = lineStart;
+ const initialCurLine = curLine;
+ let out = "";
+ let firstInvalidLoc = null;
+ let chunkStart = pos;
+ const {
+ length
+ } = input;
+ for (;;) {
+ if (pos >= length) {
+ errors.unterminated(initialPos, initialLineStart, initialCurLine);
+ out += input.slice(chunkStart, pos);
+ break;
+ }
+ const ch = input.charCodeAt(pos);
+ if (isStringEnd(type, ch, input, pos)) {
+ out += input.slice(chunkStart, pos);
+ break;
+ }
+ if (ch === 92) {
+ out += input.slice(chunkStart, pos);
+ const res = readEscapedChar(input, pos, lineStart, curLine, type === "template", errors);
+ if (res.ch === null && !firstInvalidLoc) {
+ firstInvalidLoc = {
+ pos,
+ lineStart,
+ curLine
+ };
+ } else {
+ out += res.ch;
+ }
+ ({
+ pos,
+ lineStart,
+ curLine
+ } = res);
+ chunkStart = pos;
+ } else if (ch === 8232 || ch === 8233) {
+ ++pos;
+ ++curLine;
+ lineStart = pos;
+ } else if (ch === 10 || ch === 13) {
+ if (type === "template") {
+ out += input.slice(chunkStart, pos) + "\n";
+ ++pos;
+ if (ch === 13 && input.charCodeAt(pos) === 10) {
+ ++pos;
+ }
+ ++curLine;
+ chunkStart = lineStart = pos;
+ } else {
+ errors.unterminated(initialPos, initialLineStart, initialCurLine);
+ }
+ } else {
+ ++pos;
+ }
+ }
+ return {
+ pos,
+ str: out,
+ firstInvalidLoc,
+ lineStart,
+ curLine,
+ containsInvalid: !!firstInvalidLoc
+ };
+}
+function isStringEnd(type, ch, input, pos) {
+ if (type === "template") {
+ return ch === 96 || ch === 36 && input.charCodeAt(pos + 1) === 123;
+ }
+ return ch === (type === "double" ? 34 : 39);
+}
+function readEscapedChar(input, pos, lineStart, curLine, inTemplate, errors) {
+ const throwOnInvalid = !inTemplate;
+ pos++;
+ const res = ch => ({
+ pos,
+ ch,
+ lineStart,
+ curLine
+ });
+ const ch = input.charCodeAt(pos++);
+ switch (ch) {
+ case 110:
+ return res("\n");
+ case 114:
+ return res("\r");
+ case 120:
+ {
+ let code;
+ ({
+ code,
+ pos
+ } = readHexChar(input, pos, lineStart, curLine, 2, false, throwOnInvalid, errors));
+ return res(code === null ? null : String.fromCharCode(code));
+ }
+ case 117:
+ {
+ let code;
+ ({
+ code,
+ pos
+ } = readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors));
+ return res(code === null ? null : String.fromCodePoint(code));
+ }
+ case 116:
+ return res("\t");
+ case 98:
+ return res("\b");
+ case 118:
+ return res("\u000b");
+ case 102:
+ return res("\f");
+ case 13:
+ if (input.charCodeAt(pos) === 10) {
+ ++pos;
+ }
+ case 10:
+ lineStart = pos;
+ ++curLine;
+ case 8232:
+ case 8233:
+ return res("");
+ case 56:
+ case 57:
+ if (inTemplate) {
+ return res(null);
+ } else {
+ errors.strictNumericEscape(pos - 1, lineStart, curLine);
+ }
+ default:
+ if (ch >= 48 && ch <= 55) {
+ const startPos = pos - 1;
+ const match = /^[0-7]+/.exec(input.slice(startPos, pos + 2));
+ let octalStr = match[0];
+ let octal = parseInt(octalStr, 8);
+ if (octal > 255) {
+ octalStr = octalStr.slice(0, -1);
+ octal = parseInt(octalStr, 8);
+ }
+ pos += octalStr.length - 1;
+ const next = input.charCodeAt(pos);
+ if (octalStr !== "0" || next === 56 || next === 57) {
+ if (inTemplate) {
+ return res(null);
+ } else {
+ errors.strictNumericEscape(startPos, lineStart, curLine);
+ }
+ }
+ return res(String.fromCharCode(octal));
+ }
+ return res(String.fromCharCode(ch));
+ }
+}
+function readHexChar(input, pos, lineStart, curLine, len, forceLen, throwOnInvalid, errors) {
+ const initialPos = pos;
+ let n;
+ ({
+ n,
+ pos
+ } = readInt(input, pos, lineStart, curLine, 16, len, forceLen, false, errors, !throwOnInvalid));
+ if (n === null) {
+ if (throwOnInvalid) {
+ errors.invalidEscapeSequence(initialPos, lineStart, curLine);
+ } else {
+ pos = initialPos - 1;
+ }
+ }
+ return {
+ code: n,
+ pos
+ };
+}
+function readInt(input, pos, lineStart, curLine, radix, len, forceLen, allowNumSeparator, errors, bailOnError) {
+ const start = pos;
+ const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct;
+ const isAllowedSibling = radix === 16 ? isAllowedNumericSeparatorSibling.hex : radix === 10 ? isAllowedNumericSeparatorSibling.dec : radix === 8 ? isAllowedNumericSeparatorSibling.oct : isAllowedNumericSeparatorSibling.bin;
+ let invalid = false;
+ let total = 0;
+ for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {
+ const code = input.charCodeAt(pos);
+ let val;
+ if (code === 95 && allowNumSeparator !== "bail") {
+ const prev = input.charCodeAt(pos - 1);
+ const next = input.charCodeAt(pos + 1);
+ if (!allowNumSeparator) {
+ if (bailOnError) return {
+ n: null,
+ pos
+ };
+ errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine);
+ } else if (Number.isNaN(next) || !isAllowedSibling(next) || forbiddenSiblings.has(prev) || forbiddenSiblings.has(next)) {
+ if (bailOnError) return {
+ n: null,
+ pos
+ };
+ errors.unexpectedNumericSeparator(pos, lineStart, curLine);
+ }
+ ++pos;
+ continue;
+ }
+ if (code >= 97) {
+ val = code - 97 + 10;
+ } else if (code >= 65) {
+ val = code - 65 + 10;
+ } else if (_isDigit(code)) {
+ val = code - 48;
+ } else {
+ val = Infinity;
+ }
+ if (val >= radix) {
+ if (val <= 9 && bailOnError) {
+ return {
+ n: null,
+ pos
+ };
+ } else if (val <= 9 && errors.invalidDigit(pos, lineStart, curLine, radix)) {
+ val = 0;
+ } else if (forceLen) {
+ val = 0;
+ invalid = true;
+ } else {
+ break;
+ }
+ }
+ ++pos;
+ total = total * radix + val;
+ }
+ if (pos === start || len != null && pos - start !== len || invalid) {
+ return {
+ n: null,
+ pos
+ };
+ }
+ return {
+ n: total,
+ pos
+ };
+}
+function readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors) {
+ const ch = input.charCodeAt(pos);
+ let code;
+ if (ch === 123) {
+ ++pos;
+ ({
+ code,
+ pos
+ } = readHexChar(input, pos, lineStart, curLine, input.indexOf("}", pos) - pos, true, throwOnInvalid, errors));
+ ++pos;
+ if (code !== null && code > 0x10ffff) {
+ if (throwOnInvalid) {
+ errors.invalidCodePoint(pos, lineStart, curLine);
+ } else {
+ return {
+ code: null,
+ pos
+ };
+ }
+ }
+ } else {
+ ({
+ code,
+ pos
+ } = readHexChar(input, pos, lineStart, curLine, 4, false, throwOnInvalid, errors));
+ }
+ return {
+ code,
+ pos
+ };
+}
+
+//# sourceMappingURL=index.js.map
diff --git a/node_modules/@babel/helper-string-parser/lib/index.js.map b/node_modules/@babel/helper-string-parser/lib/index.js.map
new file mode 100644
index 0000000..cd50797
--- /dev/null
+++ b/node_modules/@babel/helper-string-parser/lib/index.js.map
@@ -0,0 +1 @@
+{"version":3,"names":["isDigit","code","forbiddenNumericSeparatorSiblings","decBinOct","Set","hex","isAllowedNumericSeparatorSibling","bin","ch","oct","dec","readStringContents","type","input","pos","lineStart","curLine","errors","initialPos","initialLineStart","initialCurLine","out","firstInvalidLoc","chunkStart","length","unterminated","slice","charCodeAt","isStringEnd","res","readEscapedChar","str","containsInvalid","inTemplate","throwOnInvalid","readHexChar","String","fromCharCode","readCodePoint","fromCodePoint","strictNumericEscape","startPos","match","exec","octalStr","octal","parseInt","next","len","forceLen","n","readInt","invalidEscapeSequence","radix","allowNumSeparator","bailOnError","start","forbiddenSiblings","isAllowedSibling","invalid","total","i","e","Infinity","val","prev","numericSeparatorInEscapeSequence","Number","isNaN","has","unexpectedNumericSeparator","_isDigit","invalidDigit","indexOf","invalidCodePoint"],"sources":["../src/index.ts"],"sourcesContent":["// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charCodes from \"charcodes\";\n\n// The following character codes are forbidden from being\n// an immediate sibling of NumericLiteralSeparator _\nconst forbiddenNumericSeparatorSiblings = {\n decBinOct: new Set([\n charCodes.dot,\n charCodes.uppercaseB,\n charCodes.uppercaseE,\n charCodes.uppercaseO,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseB,\n charCodes.lowercaseE,\n charCodes.lowercaseO,\n ]),\n hex: new Set([\n charCodes.dot,\n charCodes.uppercaseX,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseX,\n ]),\n};\n\nconst isAllowedNumericSeparatorSibling = {\n // 0 - 1\n bin: (ch: number) => ch === charCodes.digit0 || ch === charCodes.digit1,\n\n // 0 - 7\n oct: (ch: number) => ch >= charCodes.digit0 && ch <= charCodes.digit7,\n\n // 0 - 9\n dec: (ch: number) => ch >= charCodes.digit0 && ch <= charCodes.digit9,\n\n // 0 - 9, A - F, a - f,\n hex: (ch: number) =>\n (ch >= charCodes.digit0 && ch <= charCodes.digit9) ||\n (ch >= charCodes.uppercaseA && ch <= charCodes.uppercaseF) ||\n (ch >= charCodes.lowercaseA && ch <= charCodes.lowercaseF),\n};\n\nexport type StringContentsErrorHandlers = EscapedCharErrorHandlers & {\n unterminated(\n initialPos: number,\n initialLineStart: number,\n initialCurLine: number,\n ): void;\n};\n\nexport function readStringContents(\n type: \"single\" | \"double\" | \"template\",\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n errors: StringContentsErrorHandlers,\n) {\n const initialPos = pos;\n const initialLineStart = lineStart;\n const initialCurLine = curLine;\n\n let out = \"\";\n let firstInvalidLoc = null;\n let chunkStart = pos;\n const { length } = input;\n for (;;) {\n if (pos >= length) {\n errors.unterminated(initialPos, initialLineStart, initialCurLine);\n out += input.slice(chunkStart, pos);\n break;\n }\n const ch = input.charCodeAt(pos);\n if (isStringEnd(type, ch, input, pos)) {\n out += input.slice(chunkStart, pos);\n break;\n }\n if (ch === charCodes.backslash) {\n out += input.slice(chunkStart, pos);\n const res = readEscapedChar(\n input,\n pos,\n lineStart,\n curLine,\n type === \"template\",\n errors,\n );\n if (res.ch === null && !firstInvalidLoc) {\n firstInvalidLoc = { pos, lineStart, curLine };\n } else {\n out += res.ch;\n }\n ({ pos, lineStart, curLine } = res);\n chunkStart = pos;\n } else if (\n ch === charCodes.lineSeparator ||\n ch === charCodes.paragraphSeparator\n ) {\n ++pos;\n ++curLine;\n lineStart = pos;\n } else if (ch === charCodes.lineFeed || ch === charCodes.carriageReturn) {\n if (type === \"template\") {\n out += input.slice(chunkStart, pos) + \"\\n\";\n ++pos;\n if (\n ch === charCodes.carriageReturn &&\n input.charCodeAt(pos) === charCodes.lineFeed\n ) {\n ++pos;\n }\n ++curLine;\n chunkStart = lineStart = pos;\n } else {\n errors.unterminated(initialPos, initialLineStart, initialCurLine);\n }\n } else {\n ++pos;\n }\n }\n return process.env.BABEL_8_BREAKING\n ? { pos, str: out, firstInvalidLoc, lineStart, curLine }\n : {\n pos,\n str: out,\n firstInvalidLoc,\n lineStart,\n curLine,\n containsInvalid: !!firstInvalidLoc,\n };\n}\n\nfunction isStringEnd(\n type: \"single\" | \"double\" | \"template\",\n ch: number,\n input: string,\n pos: number,\n) {\n if (type === \"template\") {\n return (\n ch === charCodes.graveAccent ||\n (ch === charCodes.dollarSign &&\n input.charCodeAt(pos + 1) === charCodes.leftCurlyBrace)\n );\n }\n return (\n ch === (type === \"double\" ? charCodes.quotationMark : charCodes.apostrophe)\n );\n}\n\ntype EscapedCharErrorHandlers = HexCharErrorHandlers &\n CodePointErrorHandlers & {\n strictNumericEscape(pos: number, lineStart: number, curLine: number): void;\n };\n\nfunction readEscapedChar(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n inTemplate: boolean,\n errors: EscapedCharErrorHandlers,\n) {\n const throwOnInvalid = !inTemplate;\n pos++; // skip '\\'\n\n const res = (ch: string | null) => ({ pos, ch, lineStart, curLine });\n\n const ch = input.charCodeAt(pos++);\n switch (ch) {\n case charCodes.lowercaseN:\n return res(\"\\n\");\n case charCodes.lowercaseR:\n return res(\"\\r\");\n case charCodes.lowercaseX: {\n let code;\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n 2,\n false,\n throwOnInvalid,\n errors,\n ));\n return res(code === null ? null : String.fromCharCode(code));\n }\n case charCodes.lowercaseU: {\n let code;\n ({ code, pos } = readCodePoint(\n input,\n pos,\n lineStart,\n curLine,\n throwOnInvalid,\n errors,\n ));\n return res(code === null ? null : String.fromCodePoint(code));\n }\n case charCodes.lowercaseT:\n return res(\"\\t\");\n case charCodes.lowercaseB:\n return res(\"\\b\");\n case charCodes.lowercaseV:\n return res(\"\\u000b\");\n case charCodes.lowercaseF:\n return res(\"\\f\");\n case charCodes.carriageReturn:\n if (input.charCodeAt(pos) === charCodes.lineFeed) {\n ++pos;\n }\n // fall through\n case charCodes.lineFeed:\n lineStart = pos;\n ++curLine;\n // fall through\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n return res(\"\");\n case charCodes.digit8:\n case charCodes.digit9:\n if (inTemplate) {\n return res(null);\n } else {\n errors.strictNumericEscape(pos - 1, lineStart, curLine);\n }\n // fall through\n default:\n if (ch >= charCodes.digit0 && ch <= charCodes.digit7) {\n const startPos = pos - 1;\n const match = /^[0-7]+/.exec(input.slice(startPos, pos + 2));\n\n let octalStr = match[0];\n\n let octal = parseInt(octalStr, 8);\n if (octal > 255) {\n octalStr = octalStr.slice(0, -1);\n octal = parseInt(octalStr, 8);\n }\n pos += octalStr.length - 1;\n const next = input.charCodeAt(pos);\n if (\n octalStr !== \"0\" ||\n next === charCodes.digit8 ||\n next === charCodes.digit9\n ) {\n if (inTemplate) {\n return res(null);\n } else {\n errors.strictNumericEscape(startPos, lineStart, curLine);\n }\n }\n\n return res(String.fromCharCode(octal));\n }\n\n return res(String.fromCharCode(ch));\n }\n}\n\ntype HexCharErrorHandlers = IntErrorHandlers & {\n invalidEscapeSequence(pos: number, lineStart: number, curLine: number): void;\n};\n\n// Used to read character escape sequences ('\\x', '\\u').\nfunction readHexChar(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n len: number,\n forceLen: boolean,\n throwOnInvalid: boolean,\n errors: HexCharErrorHandlers,\n) {\n const initialPos = pos;\n let n;\n ({ n, pos } = readInt(\n input,\n pos,\n lineStart,\n curLine,\n 16,\n len,\n forceLen,\n false,\n errors,\n /* bailOnError */ !throwOnInvalid,\n ));\n if (n === null) {\n if (throwOnInvalid) {\n errors.invalidEscapeSequence(initialPos, lineStart, curLine);\n } else {\n pos = initialPos - 1;\n }\n }\n return { code: n, pos };\n}\n\nexport type IntErrorHandlers = {\n numericSeparatorInEscapeSequence(\n pos: number,\n lineStart: number,\n curLine: number,\n ): void;\n unexpectedNumericSeparator(\n pos: number,\n lineStart: number,\n curLine: number,\n ): void;\n // It can return \"true\" to indicate that the error was handled\n // and the int parsing should continue.\n invalidDigit(\n pos: number,\n lineStart: number,\n curLine: number,\n radix: number,\n ): boolean;\n};\n\nexport function readInt(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n radix: number,\n len: number | undefined,\n forceLen: boolean,\n allowNumSeparator: boolean | \"bail\",\n errors: IntErrorHandlers,\n bailOnError: boolean,\n) {\n const start = pos;\n const forbiddenSiblings =\n radix === 16\n ? forbiddenNumericSeparatorSiblings.hex\n : forbiddenNumericSeparatorSiblings.decBinOct;\n const isAllowedSibling =\n radix === 16\n ? isAllowedNumericSeparatorSibling.hex\n : radix === 10\n ? isAllowedNumericSeparatorSibling.dec\n : radix === 8\n ? isAllowedNumericSeparatorSibling.oct\n : isAllowedNumericSeparatorSibling.bin;\n\n let invalid = false;\n let total = 0;\n\n for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {\n const code = input.charCodeAt(pos);\n let val;\n\n if (code === charCodes.underscore && allowNumSeparator !== \"bail\") {\n const prev = input.charCodeAt(pos - 1);\n const next = input.charCodeAt(pos + 1);\n\n if (!allowNumSeparator) {\n if (bailOnError) return { n: null, pos };\n errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine);\n } else if (\n Number.isNaN(next) ||\n !isAllowedSibling(next) ||\n forbiddenSiblings.has(prev) ||\n forbiddenSiblings.has(next)\n ) {\n if (bailOnError) return { n: null, pos };\n errors.unexpectedNumericSeparator(pos, lineStart, curLine);\n }\n\n // Ignore this _ character\n ++pos;\n continue;\n }\n\n if (code >= charCodes.lowercaseA) {\n val = code - charCodes.lowercaseA + charCodes.lineFeed;\n } else if (code >= charCodes.uppercaseA) {\n val = code - charCodes.uppercaseA + charCodes.lineFeed;\n } else if (charCodes.isDigit(code)) {\n val = code - charCodes.digit0; // 0-9\n } else {\n val = Infinity;\n }\n if (val >= radix) {\n // If we found a digit which is too big, errors.invalidDigit can return true to avoid\n // breaking the loop (this is used for error recovery).\n if (val <= 9 && bailOnError) {\n return { n: null, pos };\n } else if (\n val <= 9 &&\n errors.invalidDigit(pos, lineStart, curLine, radix)\n ) {\n val = 0;\n } else if (forceLen) {\n val = 0;\n invalid = true;\n } else {\n break;\n }\n }\n ++pos;\n total = total * radix + val;\n }\n if (pos === start || (len != null && pos - start !== len) || invalid) {\n return { n: null, pos };\n }\n\n return { n: total, pos };\n}\n\nexport type CodePointErrorHandlers = HexCharErrorHandlers & {\n invalidCodePoint(pos: number, lineStart: number, curLine: number): void;\n};\n\nexport function readCodePoint(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n throwOnInvalid: boolean,\n errors: CodePointErrorHandlers,\n) {\n const ch = input.charCodeAt(pos);\n let code;\n\n if (ch === charCodes.leftCurlyBrace) {\n ++pos;\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n input.indexOf(\"}\", pos) - pos,\n true,\n throwOnInvalid,\n errors,\n ));\n ++pos;\n if (code !== null && code > 0x10ffff) {\n if (throwOnInvalid) {\n errors.invalidCodePoint(pos, lineStart, curLine);\n } else {\n return { code: null, pos };\n }\n }\n } else {\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n 4,\n false,\n throwOnInvalid,\n errors,\n ));\n }\n return { code, pos };\n}\n"],"mappings":";;;;;;;;eAAA,SAASA,OAAOA,CAACC,IAAI,EAAE;EACrB,OAAOA,IAAI,MAAU,IAAIA,IAAI,MAAU;AACzC,CAAC;AAID,MAAMC,iCAAiC,GAAG;EACxCC,SAAS,EAAE,IAAIC,GAAG,CAAS,kCAS1B,CAAC;EACFC,GAAG,EAAE,IAAID,GAAG,CAAS,iBAKpB;AACH,CAAC;AAED,MAAME,gCAAgC,GAAG;EAEvCC,GAAG,EAAGC,EAAU,IAAKA,EAAE,OAAqB,IAAIA,EAAE,OAAqB;EAGvEC,GAAG,EAAGD,EAAU,IAAKA,EAAE,MAAoB,IAAIA,EAAE,MAAoB;EAGrEE,GAAG,EAAGF,EAAU,IAAKA,EAAE,MAAoB,IAAIA,EAAE,MAAoB;EAGrEH,GAAG,EAAGG,EAAU,IACbA,EAAE,MAAoB,IAAIA,EAAE,MAAoB,IAChDA,EAAE,MAAwB,IAAIA,EAAE,MAAyB,IACzDA,EAAE,MAAwB,IAAIA,EAAE;AACrC,CAAC;AAUM,SAASG,kBAAkBA,CAChCC,IAAsC,EACtCC,KAAa,EACbC,GAAW,EACXC,SAAiB,EACjBC,OAAe,EACfC,MAAmC,EACnC;EACA,MAAMC,UAAU,GAAGJ,GAAG;EACtB,MAAMK,gBAAgB,GAAGJ,SAAS;EAClC,MAAMK,cAAc,GAAGJ,OAAO;EAE9B,IAAIK,GAAG,GAAG,EAAE;EACZ,IAAIC,eAAe,GAAG,IAAI;EAC1B,IAAIC,UAAU,GAAGT,GAAG;EACpB,MAAM;IAAEU;EAAO,CAAC,GAAGX,KAAK;EACxB,SAAS;IACP,IAAIC,GAAG,IAAIU,MAAM,EAAE;MACjBP,MAAM,CAACQ,YAAY,CAACP,UAAU,EAAEC,gBAAgB,EAAEC,cAAc,CAAC;MACjEC,GAAG,IAAIR,KAAK,CAACa,KAAK,CAACH,UAAU,EAAET,GAAG,CAAC;MACnC;IACF;IACA,MAAMN,EAAE,GAAGK,KAAK,CAACc,UAAU,CAACb,GAAG,CAAC;IAChC,IAAIc,WAAW,CAAChB,IAAI,EAAEJ,EAAE,EAAEK,KAAK,EAAEC,GAAG,CAAC,EAAE;MACrCO,GAAG,IAAIR,KAAK,CAACa,KAAK,CAACH,UAAU,EAAET,GAAG,CAAC;MACnC;IACF;IACA,IAAIN,EAAE,OAAwB,EAAE;MAC9Ba,GAAG,IAAIR,KAAK,CAACa,KAAK,CAACH,UAAU,EAAET,GAAG,CAAC;MACnC,MAAMe,GAAG,GAAGC,eAAe,CACzBjB,KAAK,EACLC,GAAG,EACHC,SAAS,EACTC,OAAO,EACPJ,IAAI,KAAK,UAAU,EACnBK,MACF,CAAC;MACD,IAAIY,GAAG,CAACrB,EAAE,KAAK,IAAI,IAAI,CAACc,eAAe,EAAE;QACvCA,eAAe,GAAG;UAAER,GAAG;UAAEC,SAAS;UAAEC;QAAQ,CAAC;MAC/C,CAAC,MAAM;QACLK,GAAG,IAAIQ,GAAG,CAACrB,EAAE;MACf;MACA,CAAC;QAAEM,GAAG;QAAEC,SAAS;QAAEC;MAAQ,CAAC,GAAGa,GAAG;MAClCN,UAAU,GAAGT,GAAG;IAClB,CAAC,MAAM,IACLN,EAAE,SAA4B,IAC9BA,EAAE,SAAiC,EACnC;MACA,EAAEM,GAAG;MACL,EAAEE,OAAO;MACTD,SAAS,GAAGD,GAAG;IACjB,CAAC,MAAM,IAAIN,EAAE,OAAuB,IAAIA,EAAE,OAA6B,EAAE;MACvE,IAAII,IAAI,KAAK,UAAU,EAAE;QACvBS,GAAG,IAAIR,KAAK,CAACa,KAAK,CAACH,UAAU,EAAET,GAAG,CAAC,GAAG,IAAI;QAC1C,EAAEA,GAAG;QACL,IACEN,EAAE,OAA6B,IAC/BK,KAAK,CAACc,UAAU,CAACb,GAAG,CAAC,OAAuB,EAC5C;UACA,EAAEA,GAAG;QACP;QACA,EAAEE,OAAO;QACTO,UAAU,GAAGR,SAAS,GAAGD,GAAG;MAC9B,CAAC,MAAM;QACLG,MAAM,CAACQ,YAAY,CAACP,UAAU,EAAEC,gBAAgB,EAAEC,cAAc,CAAC;MACnE;IACF,CAAC,MAAM;MACL,EAAEN,GAAG;IACP;EACF;EACA,OAEI;IACEA,GAAG;IACHiB,GAAG,EAAEV,GAAG;IACRC,eAAe;IACfP,SAAS;IACTC,OAAO;IACPgB,eAAe,EAAE,CAAC,CAACV;EACrB,CAAC;AACP;AAEA,SAASM,WAAWA,CAClBhB,IAAsC,EACtCJ,EAAU,EACVK,KAAa,EACbC,GAAW,EACX;EACA,IAAIF,IAAI,KAAK,UAAU,EAAE;IACvB,OACEJ,EAAE,OAA0B,IAC3BA,EAAE,OAAyB,IAC1BK,KAAK,CAACc,UAAU,CAACb,GAAG,GAAG,CAAC,CAAC,QAA8B;EAE7D;EACA,OACEN,EAAE,MAAMI,IAAI,KAAK,QAAQ,UAAiD,CAAC;AAE/E;AAOA,SAASkB,eAAeA,CACtBjB,KAAa,EACbC,GAAW,EACXC,SAAiB,EACjBC,OAAe,EACfiB,UAAmB,EACnBhB,MAAgC,EAChC;EACA,MAAMiB,cAAc,GAAG,CAACD,UAAU;EAClCnB,GAAG,EAAE;EAEL,MAAMe,GAAG,GAAIrB,EAAiB,KAAM;IAAEM,GAAG;IAAEN,EAAE;IAAEO,SAAS;IAAEC;EAAQ,CAAC,CAAC;EAEpE,MAAMR,EAAE,GAAGK,KAAK,CAACc,UAAU,CAACb,GAAG,EAAE,CAAC;EAClC,QAAQN,EAAE;IACR;MACE,OAAOqB,GAAG,CAAC,IAAI,CAAC;IAClB;MACE,OAAOA,GAAG,CAAC,IAAI,CAAC;IAClB;MAA2B;QACzB,IAAI5B,IAAI;QACR,CAAC;UAAEA,IAAI;UAAEa;QAAI,CAAC,GAAGqB,WAAW,CAC1BtB,KAAK,EACLC,GAAG,EACHC,SAAS,EACTC,OAAO,EACP,CAAC,EACD,KAAK,EACLkB,cAAc,EACdjB,MACF,CAAC;QACD,OAAOY,GAAG,CAAC5B,IAAI,KAAK,IAAI,GAAG,IAAI,GAAGmC,MAAM,CAACC,YAAY,CAACpC,IAAI,CAAC,CAAC;MAC9D;IACA;MAA2B;QACzB,IAAIA,IAAI;QACR,CAAC;UAAEA,IAAI;UAAEa;QAAI,CAAC,GAAGwB,aAAa,CAC5BzB,KAAK,EACLC,GAAG,EACHC,SAAS,EACTC,OAAO,EACPkB,cAAc,EACdjB,MACF,CAAC;QACD,OAAOY,GAAG,CAAC5B,IAAI,KAAK,IAAI,GAAG,IAAI,GAAGmC,MAAM,CAACG,aAAa,CAACtC,IAAI,CAAC,CAAC;MAC/D;IACA;MACE,OAAO4B,GAAG,CAAC,IAAI,CAAC;IAClB;MACE,OAAOA,GAAG,CAAC,IAAI,CAAC;IAClB;MACE,OAAOA,GAAG,CAAC,QAAQ,CAAC;IACtB;MACE,OAAOA,GAAG,CAAC,IAAI,CAAC;IAClB;MACE,IAAIhB,KAAK,CAACc,UAAU,CAACb,GAAG,CAAC,OAAuB,EAAE;QAChD,EAAEA,GAAG;MACP;IAEF;MACEC,SAAS,GAAGD,GAAG;MACf,EAAEE,OAAO;IAEX;IACA;MACE,OAAOa,GAAG,CAAC,EAAE,CAAC;IAChB;IACA;MACE,IAAII,UAAU,EAAE;QACd,OAAOJ,GAAG,CAAC,IAAI,CAAC;MAClB,CAAC,MAAM;QACLZ,MAAM,CAACuB,mBAAmB,CAAC1B,GAAG,GAAG,CAAC,EAAEC,SAAS,EAAEC,OAAO,CAAC;MACzD;IAEF;MACE,IAAIR,EAAE,MAAoB,IAAIA,EAAE,MAAoB,EAAE;QACpD,MAAMiC,QAAQ,GAAG3B,GAAG,GAAG,CAAC;QACxB,MAAM4B,KAAK,GAAG,SAAS,CAACC,IAAI,CAAC9B,KAAK,CAACa,KAAK,CAACe,QAAQ,EAAE3B,GAAG,GAAG,CAAC,CAAC,CAAC;QAE5D,IAAI8B,QAAQ,GAAGF,KAAK,CAAC,CAAC,CAAC;QAEvB,IAAIG,KAAK,GAAGC,QAAQ,CAACF,QAAQ,EAAE,CAAC,CAAC;QACjC,IAAIC,KAAK,GAAG,GAAG,EAAE;UACfD,QAAQ,GAAGA,QAAQ,CAAClB,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;UAChCmB,KAAK,GAAGC,QAAQ,CAACF,QAAQ,EAAE,CAAC,CAAC;QAC/B;QACA9B,GAAG,IAAI8B,QAAQ,CAACpB,MAAM,GAAG,CAAC;QAC1B,MAAMuB,IAAI,GAAGlC,KAAK,CAACc,UAAU,CAACb,GAAG,CAAC;QAClC,IACE8B,QAAQ,KAAK,GAAG,IAChBG,IAAI,OAAqB,IACzBA,IAAI,OAAqB,EACzB;UACA,IAAId,UAAU,EAAE;YACd,OAAOJ,GAAG,CAAC,IAAI,CAAC;UAClB,CAAC,MAAM;YACLZ,MAAM,CAACuB,mBAAmB,CAACC,QAAQ,EAAE1B,SAAS,EAAEC,OAAO,CAAC;UAC1D;QACF;QAEA,OAAOa,GAAG,CAACO,MAAM,CAACC,YAAY,CAACQ,KAAK,CAAC,CAAC;MACxC;MAEA,OAAOhB,GAAG,CAACO,MAAM,CAACC,YAAY,CAAC7B,EAAE,CAAC,CAAC;EACvC;AACF;AAOA,SAAS2B,WAAWA,CAClBtB,KAAa,EACbC,GAAW,EACXC,SAAiB,EACjBC,OAAe,EACfgC,GAAW,EACXC,QAAiB,EACjBf,cAAuB,EACvBjB,MAA4B,EAC5B;EACA,MAAMC,UAAU,GAAGJ,GAAG;EACtB,IAAIoC,CAAC;EACL,CAAC;IAAEA,CAAC;IAAEpC;EAAI,CAAC,GAAGqC,OAAO,CACnBtC,KAAK,EACLC,GAAG,EACHC,SAAS,EACTC,OAAO,EACP,EAAE,EACFgC,GAAG,EACHC,QAAQ,EACR,KAAK,EACLhC,MAAM,EACY,CAACiB,cACrB,CAAC;EACD,IAAIgB,CAAC,KAAK,IAAI,EAAE;IACd,IAAIhB,cAAc,EAAE;MAClBjB,MAAM,CAACmC,qBAAqB,CAAClC,UAAU,EAAEH,SAAS,EAAEC,OAAO,CAAC;IAC9D,CAAC,MAAM;MACLF,GAAG,GAAGI,UAAU,GAAG,CAAC;IACtB;EACF;EACA,OAAO;IAAEjB,IAAI,EAAEiD,CAAC;IAAEpC;EAAI,CAAC;AACzB;AAuBO,SAASqC,OAAOA,CACrBtC,KAAa,EACbC,GAAW,EACXC,SAAiB,EACjBC,OAAe,EACfqC,KAAa,EACbL,GAAuB,EACvBC,QAAiB,EACjBK,iBAAmC,EACnCrC,MAAwB,EACxBsC,WAAoB,EACpB;EACA,MAAMC,KAAK,GAAG1C,GAAG;EACjB,MAAM2C,iBAAiB,GACrBJ,KAAK,KAAK,EAAE,GACRnD,iCAAiC,CAACG,GAAG,GACrCH,iCAAiC,CAACC,SAAS;EACjD,MAAMuD,gBAAgB,GACpBL,KAAK,KAAK,EAAE,GACR/C,gCAAgC,CAACD,GAAG,GACpCgD,KAAK,KAAK,EAAE,GACV/C,gCAAgC,CAACI,GAAG,GACpC2C,KAAK,KAAK,CAAC,GACT/C,gCAAgC,CAACG,GAAG,GACpCH,gCAAgC,CAACC,GAAG;EAE9C,IAAIoD,OAAO,GAAG,KAAK;EACnB,IAAIC,KAAK,GAAG,CAAC;EAEb,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEC,CAAC,GAAGd,GAAG,IAAI,IAAI,GAAGe,QAAQ,GAAGf,GAAG,EAAEa,CAAC,GAAGC,CAAC,EAAE,EAAED,CAAC,EAAE;IAC5D,MAAM5D,IAAI,GAAGY,KAAK,CAACc,UAAU,CAACb,GAAG,CAAC;IAClC,IAAIkD,GAAG;IAEP,IAAI/D,IAAI,OAAyB,IAAIqD,iBAAiB,KAAK,MAAM,EAAE;MACjE,MAAMW,IAAI,GAAGpD,KAAK,CAACc,UAAU,CAACb,GAAG,GAAG,CAAC,CAAC;MACtC,MAAMiC,IAAI,GAAGlC,KAAK,CAACc,UAAU,CAACb,GAAG,GAAG,CAAC,CAAC;MAEtC,IAAI,CAACwC,iBAAiB,EAAE;QACtB,IAAIC,WAAW,EAAE,OAAO;UAAEL,CAAC,EAAE,IAAI;UAAEpC;QAAI,CAAC;QACxCG,MAAM,CAACiD,gCAAgC,CAACpD,GAAG,EAAEC,SAAS,EAAEC,OAAO,CAAC;MAClE,CAAC,MAAM,IACLmD,MAAM,CAACC,KAAK,CAACrB,IAAI,CAAC,IAClB,CAACW,gBAAgB,CAACX,IAAI,CAAC,IACvBU,iBAAiB,CAACY,GAAG,CAACJ,IAAI,CAAC,IAC3BR,iBAAiB,CAACY,GAAG,CAACtB,IAAI,CAAC,EAC3B;QACA,IAAIQ,WAAW,EAAE,OAAO;UAAEL,CAAC,EAAE,IAAI;UAAEpC;QAAI,CAAC;QACxCG,MAAM,CAACqD,0BAA0B,CAACxD,GAAG,EAAEC,SAAS,EAAEC,OAAO,CAAC;MAC5D;MAGA,EAAEF,GAAG;MACL;IACF;IAEA,IAAIb,IAAI,MAAwB,EAAE;MAChC+D,GAAG,GAAG/D,IAAI,KAAuB,KAAqB;IACxD,CAAC,MAAM,IAAIA,IAAI,MAAwB,EAAE;MACvC+D,GAAG,GAAG/D,IAAI,KAAuB,KAAqB;IACxD,CAAC,MAAM,IAAIsE,QAAA,CAAkBtE,IAAI,CAAC,EAAE;MAClC+D,GAAG,GAAG/D,IAAI,KAAmB;IAC/B,CAAC,MAAM;MACL+D,GAAG,GAAGD,QAAQ;IAChB;IACA,IAAIC,GAAG,IAAIX,KAAK,EAAE;MAGhB,IAAIW,GAAG,IAAI,CAAC,IAAIT,WAAW,EAAE;QAC3B,OAAO;UAAEL,CAAC,EAAE,IAAI;UAAEpC;QAAI,CAAC;MACzB,CAAC,MAAM,IACLkD,GAAG,IAAI,CAAC,IACR/C,MAAM,CAACuD,YAAY,CAAC1D,GAAG,EAAEC,SAAS,EAAEC,OAAO,EAAEqC,KAAK,CAAC,EACnD;QACAW,GAAG,GAAG,CAAC;MACT,CAAC,MAAM,IAAIf,QAAQ,EAAE;QACnBe,GAAG,GAAG,CAAC;QACPL,OAAO,GAAG,IAAI;MAChB,CAAC,MAAM;QACL;MACF;IACF;IACA,EAAE7C,GAAG;IACL8C,KAAK,GAAGA,KAAK,GAAGP,KAAK,GAAGW,GAAG;EAC7B;EACA,IAAIlD,GAAG,KAAK0C,KAAK,IAAKR,GAAG,IAAI,IAAI,IAAIlC,GAAG,GAAG0C,KAAK,KAAKR,GAAI,IAAIW,OAAO,EAAE;IACpE,OAAO;MAAET,CAAC,EAAE,IAAI;MAAEpC;IAAI,CAAC;EACzB;EAEA,OAAO;IAAEoC,CAAC,EAAEU,KAAK;IAAE9C;EAAI,CAAC;AAC1B;AAMO,SAASwB,aAAaA,CAC3BzB,KAAa,EACbC,GAAW,EACXC,SAAiB,EACjBC,OAAe,EACfkB,cAAuB,EACvBjB,MAA8B,EAC9B;EACA,MAAMT,EAAE,GAAGK,KAAK,CAACc,UAAU,CAACb,GAAG,CAAC;EAChC,IAAIb,IAAI;EAER,IAAIO,EAAE,QAA6B,EAAE;IACnC,EAAEM,GAAG;IACL,CAAC;MAAEb,IAAI;MAAEa;IAAI,CAAC,GAAGqB,WAAW,CAC1BtB,KAAK,EACLC,GAAG,EACHC,SAAS,EACTC,OAAO,EACPH,KAAK,CAAC4D,OAAO,CAAC,GAAG,EAAE3D,GAAG,CAAC,GAAGA,GAAG,EAC7B,IAAI,EACJoB,cAAc,EACdjB,MACF,CAAC;IACD,EAAEH,GAAG;IACL,IAAIb,IAAI,KAAK,IAAI,IAAIA,IAAI,GAAG,QAAQ,EAAE;MACpC,IAAIiC,cAAc,EAAE;QAClBjB,MAAM,CAACyD,gBAAgB,CAAC5D,GAAG,EAAEC,SAAS,EAAEC,OAAO,CAAC;MAClD,CAAC,MAAM;QACL,OAAO;UAAEf,IAAI,EAAE,IAAI;UAAEa;QAAI,CAAC;MAC5B;IACF;EACF,CAAC,MAAM;IACL,CAAC;MAAEb,IAAI;MAAEa;IAAI,CAAC,GAAGqB,WAAW,CAC1BtB,KAAK,EACLC,GAAG,EACHC,SAAS,EACTC,OAAO,EACP,CAAC,EACD,KAAK,EACLkB,cAAc,EACdjB,MACF,CAAC;EACH;EACA,OAAO;IAAEhB,IAAI;IAAEa;EAAI,CAAC;AACtB","ignoreList":[]}
\ No newline at end of file
diff --git a/node_modules/@babel/helper-string-parser/package.json b/node_modules/@babel/helper-string-parser/package.json
new file mode 100644
index 0000000..8c7e067
--- /dev/null
+++ b/node_modules/@babel/helper-string-parser/package.json
@@ -0,0 +1,31 @@
+{
+ "name": "@babel/helper-string-parser",
+ "version": "7.24.8",
+ "description": "A utility package to parse strings",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/babel/babel.git",
+ "directory": "packages/babel-helper-string-parser"
+ },
+ "homepage": "https://babel.dev/docs/en/next/babel-helper-string-parser",
+ "license": "MIT",
+ "publishConfig": {
+ "access": "public"
+ },
+ "main": "./lib/index.js",
+ "devDependencies": {
+ "charcodes": "^0.2.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "author": "The Babel Team (https://babel.dev/team)",
+ "exports": {
+ ".": {
+ "types": "./lib/index.d.ts",
+ "default": "./lib/index.js"
+ },
+ "./package.json": "./package.json"
+ },
+ "type": "commonjs"
+}
\ No newline at end of file
diff --git a/node_modules/@babel/helper-validator-identifier/LICENSE b/node_modules/@babel/helper-validator-identifier/LICENSE
new file mode 100644
index 0000000..f31575e
--- /dev/null
+++ b/node_modules/@babel/helper-validator-identifier/LICENSE
@@ -0,0 +1,22 @@
+MIT License
+
+Copyright (c) 2014-present Sebastian McKenzie and other contributors
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/@babel/helper-validator-identifier/README.md b/node_modules/@babel/helper-validator-identifier/README.md
new file mode 100644
index 0000000..05c19e6
--- /dev/null
+++ b/node_modules/@babel/helper-validator-identifier/README.md
@@ -0,0 +1,19 @@
+# @babel/helper-validator-identifier
+
+> Validate identifier/keywords name
+
+See our website [@babel/helper-validator-identifier](https://babeljs.io/docs/babel-helper-validator-identifier) for more information.
+
+## Install
+
+Using npm:
+
+```sh
+npm install --save @babel/helper-validator-identifier
+```
+
+or using yarn:
+
+```sh
+yarn add @babel/helper-validator-identifier
+```
diff --git a/node_modules/@babel/helper-validator-identifier/lib/identifier.js b/node_modules/@babel/helper-validator-identifier/lib/identifier.js
new file mode 100644
index 0000000..8ef8303
--- /dev/null
+++ b/node_modules/@babel/helper-validator-identifier/lib/identifier.js
@@ -0,0 +1,70 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.isIdentifierChar = isIdentifierChar;
+exports.isIdentifierName = isIdentifierName;
+exports.isIdentifierStart = isIdentifierStart;
+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-\u1c88\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-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\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";
+let nonASCIIidentifierChars = "\u200c\u200d\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\u0898-\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";
+const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
+const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
+nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
+const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 4026, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 757, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191];
+const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 81, 2, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 9, 5351, 0, 7, 14, 13835, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 983, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
+function isInAstralSet(code, set) {
+ let pos = 0x10000;
+ for (let i = 0, length = set.length; i < length; i += 2) {
+ pos += set[i];
+ if (pos > code) return false;
+ pos += set[i + 1];
+ if (pos >= code) return true;
+ }
+ return false;
+}
+function isIdentifierStart(code) {
+ if (code < 65) return code === 36;
+ if (code <= 90) return true;
+ if (code < 97) return code === 95;
+ if (code <= 122) return true;
+ if (code <= 0xffff) {
+ return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));
+ }
+ return isInAstralSet(code, astralIdentifierStartCodes);
+}
+function isIdentifierChar(code) {
+ if (code < 48) return code === 36;
+ if (code < 58) return true;
+ if (code < 65) return false;
+ if (code <= 90) return true;
+ if (code < 97) return code === 95;
+ if (code <= 122) return true;
+ if (code <= 0xffff) {
+ return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));
+ }
+ return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
+}
+function isIdentifierName(name) {
+ let isFirst = true;
+ for (let i = 0; i < name.length; i++) {
+ let cp = name.charCodeAt(i);
+ if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {
+ const trail = name.charCodeAt(++i);
+ if ((trail & 0xfc00) === 0xdc00) {
+ cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);
+ }
+ }
+ if (isFirst) {
+ isFirst = false;
+ if (!isIdentifierStart(cp)) {
+ return false;
+ }
+ } else if (!isIdentifierChar(cp)) {
+ return false;
+ }
+ }
+ return !isFirst;
+}
+
+//# sourceMappingURL=identifier.js.map
diff --git a/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map b/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map
new file mode 100644
index 0000000..e2a9c30
--- /dev/null
+++ b/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map
@@ -0,0 +1 @@
+{"version":3,"names":["nonASCIIidentifierStartChars","nonASCIIidentifierChars","nonASCIIidentifierStart","RegExp","nonASCIIidentifier","astralIdentifierStartCodes","astralIdentifierCodes","isInAstralSet","code","set","pos","i","length","isIdentifierStart","test","String","fromCharCode","isIdentifierChar","isIdentifierName","name","isFirst","cp","charCodeAt","trail"],"sources":["../src/identifier.ts"],"sourcesContent":["// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charCodes from \"charcodes\";\n\n// ## Character categories\n\n// Big ugly regular expressions that match characters in the\n// whitespace, identifier, and identifier-start categories. These\n// are only applied when a character is found to actually have a\n// code point between 0x80 and 0xffff.\n// Generated by `scripts/generate-identifier-regex.js`.\n\n/* prettier-ignore */\nlet 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-\\u1c88\\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-\\ua7ca\\ua7d0\\ua7d1\\ua7d3\\ua7d5-\\ua7d9\\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\";\n/* prettier-ignore */\nlet nonASCIIidentifierChars = \"\\u200c\\u200d\\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\\u0898-\\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\";\n\nconst nonASCIIidentifierStart = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + \"]\",\n);\nconst nonASCIIidentifier = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\",\n);\n\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null;\n\n// These are a run-length and offset-encoded representation of the\n// >0xffff code points that are a valid part of identifiers. The\n// offset starts at 0x10000, and each pair of numbers represents an\n// offset to the next range, and then a size of the range. They were\n// generated by `scripts/generate-identifier-regex.js`.\n/* prettier-ignore */\nconst astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191];\n/* prettier-ignore */\nconst astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239];\n\n// This has a complexity linear to the value of the code. The\n// assumption is that looking up astral identifier characters is\n// rare.\nfunction isInAstralSet(code: number, set: readonly number[]): boolean {\n let pos = 0x10000;\n for (let i = 0, length = set.length; i < length; i += 2) {\n pos += set[i];\n if (pos > code) return false;\n\n pos += set[i + 1];\n if (pos >= code) return true;\n }\n return false;\n}\n\n// Test whether a given character code starts an identifier.\n\nexport function isIdentifierStart(code: number): boolean {\n if (code < charCodes.uppercaseA) return code === charCodes.dollarSign;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return (\n code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code))\n );\n }\n return isInAstralSet(code, astralIdentifierStartCodes);\n}\n\n// Test whether a given character is part of an identifier.\n\nexport function isIdentifierChar(code: number): boolean {\n if (code < charCodes.digit0) return code === charCodes.dollarSign;\n if (code < charCodes.colon) return true;\n if (code < charCodes.uppercaseA) return false;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n }\n return (\n isInAstralSet(code, astralIdentifierStartCodes) ||\n isInAstralSet(code, astralIdentifierCodes)\n );\n}\n\n// Test whether a given string is a valid identifier name\n\nexport function isIdentifierName(name: string): boolean {\n let isFirst = true;\n for (let i = 0; i < name.length; i++) {\n // The implementation is based on\n // https://source.chromium.org/chromium/chromium/src/+/master:v8/src/builtins/builtins-string-gen.cc;l=1455;drc=221e331b49dfefadbc6fa40b0c68e6f97606d0b3;bpv=0;bpt=1\n // We reimplement `codePointAt` because `codePointAt` is a V8 builtin which is not inlined by TurboFan (as of M91)\n // since `name` is mostly ASCII, an inlined `charCodeAt` wins here\n let cp = name.charCodeAt(i);\n if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {\n const trail = name.charCodeAt(++i);\n if ((trail & 0xfc00) === 0xdc00) {\n cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);\n }\n }\n if (isFirst) {\n isFirst = false;\n if (!isIdentifierStart(cp)) {\n return false;\n }\n } else if (!isIdentifierChar(cp)) {\n return false;\n }\n }\n return !isFirst;\n}\n"],"mappings":";;;;;;;;AAaA,IAAIA,4BAA4B,GAAG,8qIAA8qI;AAEjtI,IAAIC,uBAAuB,GAAG,2lFAA2lF;AAEznF,MAAMC,uBAAuB,GAAG,IAAIC,MAAM,CACxC,GAAG,GAAGH,4BAA4B,GAAG,GACvC,CAAC;AACD,MAAMI,kBAAkB,GAAG,IAAID,MAAM,CACnC,GAAG,GAAGH,4BAA4B,GAAGC,uBAAuB,GAAG,GACjE,CAAC;AAEDD,4BAA4B,GAAGC,uBAAuB,GAAG,IAAI;AAQ7D,MAAMI,0BAA0B,GAAG,CAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,GAAG,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,GAAG,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,GAAG,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,GAAG,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,GAAG,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,GAAG,EAAC,CAAC,EAAC,EAAE,EAAC,GAAG,EAAC,GAAG,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,IAAI,EAAC,EAAE,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,CAAC,EAAC,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,GAAG,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,IAAI,EAAC,EAAE,EAAC,CAAC,EAAC,IAAI,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,GAAG,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,GAAG,EAAC,IAAI,EAAC,GAAG,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,IAAI,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,IAAI,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,GAAG,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,GAAG,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,IAAI,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,IAAI,EAAC,KAAK,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,EAAC,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,IAAI,EAAC,CAAC,EAAC,IAAI,CAAC;AAEx+C,MAAMC,qBAAqB,GAAG,CAAC,GAAG,EAAC,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,IAAI,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,GAAG,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,GAAG,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,GAAG,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,GAAG,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,IAAI,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,KAAK,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,IAAI,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,KAAK,EAAC,CAAC,EAAC,IAAI,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,GAAG,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,IAAI,EAAC,CAAC,EAAC,MAAM,EAAC,GAAG,CAAC;AAKjwB,SAASC,aAAaA,CAACC,IAAY,EAAEC,GAAsB,EAAW;EACpE,IAAIC,GAAG,GAAG,OAAO;EACjB,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEC,MAAM,GAAGH,GAAG,CAACG,MAAM,EAAED,CAAC,GAAGC,MAAM,EAAED,CAAC,IAAI,CAAC,EAAE;IACvDD,GAAG,IAAID,GAAG,CAACE,CAAC,CAAC;IACb,IAAID,GAAG,GAAGF,IAAI,EAAE,OAAO,KAAK;IAE5BE,GAAG,IAAID,GAAG,CAACE,CAAC,GAAG,CAAC,CAAC;IACjB,IAAID,GAAG,IAAIF,IAAI,EAAE,OAAO,IAAI;EAC9B;EACA,OAAO,KAAK;AACd;AAIO,SAASK,iBAAiBA,CAACL,IAAY,EAAW;EACvD,IAAIA,IAAI,KAAuB,EAAE,OAAOA,IAAI,OAAyB;EACrE,IAAIA,IAAI,MAAwB,EAAE,OAAO,IAAI;EAC7C,IAAIA,IAAI,KAAuB,EAAE,OAAOA,IAAI,OAAyB;EACrE,IAAIA,IAAI,OAAwB,EAAE,OAAO,IAAI;EAC7C,IAAIA,IAAI,IAAI,MAAM,EAAE;IAClB,OACEA,IAAI,IAAI,IAAI,IAAIN,uBAAuB,CAACY,IAAI,CAACC,MAAM,CAACC,YAAY,CAACR,IAAI,CAAC,CAAC;EAE3E;EACA,OAAOD,aAAa,CAACC,IAAI,EAAEH,0BAA0B,CAAC;AACxD;AAIO,SAASY,gBAAgBA,CAACT,IAAY,EAAW;EACtD,IAAIA,IAAI,KAAmB,EAAE,OAAOA,IAAI,OAAyB;EACjE,IAAIA,IAAI,KAAkB,EAAE,OAAO,IAAI;EACvC,IAAIA,IAAI,KAAuB,EAAE,OAAO,KAAK;EAC7C,IAAIA,IAAI,MAAwB,EAAE,OAAO,IAAI;EAC7C,IAAIA,IAAI,KAAuB,EAAE,OAAOA,IAAI,OAAyB;EACrE,IAAIA,IAAI,OAAwB,EAAE,OAAO,IAAI;EAC7C,IAAIA,IAAI,IAAI,MAAM,EAAE;IAClB,OAAOA,IAAI,IAAI,IAAI,IAAIJ,kBAAkB,CAACU,IAAI,CAACC,MAAM,CAACC,YAAY,CAACR,IAAI,CAAC,CAAC;EAC3E;EACA,OACED,aAAa,CAACC,IAAI,EAAEH,0BAA0B,CAAC,IAC/CE,aAAa,CAACC,IAAI,EAAEF,qBAAqB,CAAC;AAE9C;AAIO,SAASY,gBAAgBA,CAACC,IAAY,EAAW;EACtD,IAAIC,OAAO,GAAG,IAAI;EAClB,KAAK,IAAIT,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGQ,IAAI,CAACP,MAAM,EAAED,CAAC,EAAE,EAAE;IAKpC,IAAIU,EAAE,GAAGF,IAAI,CAACG,UAAU,CAACX,CAAC,CAAC;IAC3B,IAAI,CAACU,EAAE,GAAG,MAAM,MAAM,MAAM,IAAIV,CAAC,GAAG,CAAC,GAAGQ,IAAI,CAACP,MAAM,EAAE;MACnD,MAAMW,KAAK,GAAGJ,IAAI,CAACG,UAAU,CAAC,EAAEX,CAAC,CAAC;MAClC,IAAI,CAACY,KAAK,GAAG,MAAM,MAAM,MAAM,EAAE;QAC/BF,EAAE,GAAG,OAAO,IAAI,CAACA,EAAE,GAAG,KAAK,KAAK,EAAE,CAAC,IAAIE,KAAK,GAAG,KAAK,CAAC;MACvD;IACF;IACA,IAAIH,OAAO,EAAE;MACXA,OAAO,GAAG,KAAK;MACf,IAAI,CAACP,iBAAiB,CAACQ,EAAE,CAAC,EAAE;QAC1B,OAAO,KAAK;MACd;IACF,CAAC,MAAM,IAAI,CAACJ,gBAAgB,CAACI,EAAE,CAAC,EAAE;MAChC,OAAO,KAAK;IACd;EACF;EACA,OAAO,CAACD,OAAO;AACjB","ignoreList":[]}
\ No newline at end of file
diff --git a/node_modules/@babel/helper-validator-identifier/lib/index.js b/node_modules/@babel/helper-validator-identifier/lib/index.js
new file mode 100644
index 0000000..76b2282
--- /dev/null
+++ b/node_modules/@babel/helper-validator-identifier/lib/index.js
@@ -0,0 +1,57 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+Object.defineProperty(exports, "isIdentifierChar", {
+ enumerable: true,
+ get: function () {
+ return _identifier.isIdentifierChar;
+ }
+});
+Object.defineProperty(exports, "isIdentifierName", {
+ enumerable: true,
+ get: function () {
+ return _identifier.isIdentifierName;
+ }
+});
+Object.defineProperty(exports, "isIdentifierStart", {
+ enumerable: true,
+ get: function () {
+ return _identifier.isIdentifierStart;
+ }
+});
+Object.defineProperty(exports, "isKeyword", {
+ enumerable: true,
+ get: function () {
+ return _keyword.isKeyword;
+ }
+});
+Object.defineProperty(exports, "isReservedWord", {
+ enumerable: true,
+ get: function () {
+ return _keyword.isReservedWord;
+ }
+});
+Object.defineProperty(exports, "isStrictBindOnlyReservedWord", {
+ enumerable: true,
+ get: function () {
+ return _keyword.isStrictBindOnlyReservedWord;
+ }
+});
+Object.defineProperty(exports, "isStrictBindReservedWord", {
+ enumerable: true,
+ get: function () {
+ return _keyword.isStrictBindReservedWord;
+ }
+});
+Object.defineProperty(exports, "isStrictReservedWord", {
+ enumerable: true,
+ get: function () {
+ return _keyword.isStrictReservedWord;
+ }
+});
+var _identifier = require("./identifier.js");
+var _keyword = require("./keyword.js");
+
+//# sourceMappingURL=index.js.map
diff --git a/node_modules/@babel/helper-validator-identifier/lib/index.js.map b/node_modules/@babel/helper-validator-identifier/lib/index.js.map
new file mode 100644
index 0000000..d985f3b
--- /dev/null
+++ b/node_modules/@babel/helper-validator-identifier/lib/index.js.map
@@ -0,0 +1 @@
+{"version":3,"names":["_identifier","require","_keyword"],"sources":["../src/index.ts"],"sourcesContent":["export {\n isIdentifierName,\n isIdentifierChar,\n isIdentifierStart,\n} from \"./identifier.ts\";\nexport {\n isReservedWord,\n isStrictBindOnlyReservedWord,\n isStrictBindReservedWord,\n isStrictReservedWord,\n isKeyword,\n} from \"./keyword.ts\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA","ignoreList":[]}
\ No newline at end of file
diff --git a/node_modules/@babel/helper-validator-identifier/lib/keyword.js b/node_modules/@babel/helper-validator-identifier/lib/keyword.js
new file mode 100644
index 0000000..054cf84
--- /dev/null
+++ b/node_modules/@babel/helper-validator-identifier/lib/keyword.js
@@ -0,0 +1,35 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.isKeyword = isKeyword;
+exports.isReservedWord = isReservedWord;
+exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;
+exports.isStrictBindReservedWord = isStrictBindReservedWord;
+exports.isStrictReservedWord = isStrictReservedWord;
+const reservedWords = {
+ keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
+ strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
+ strictBind: ["eval", "arguments"]
+};
+const keywords = new Set(reservedWords.keyword);
+const reservedWordsStrictSet = new Set(reservedWords.strict);
+const reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
+function isReservedWord(word, inModule) {
+ return inModule && word === "await" || word === "enum";
+}
+function isStrictReservedWord(word, inModule) {
+ return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
+}
+function isStrictBindOnlyReservedWord(word) {
+ return reservedWordsStrictBindSet.has(word);
+}
+function isStrictBindReservedWord(word, inModule) {
+ return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
+}
+function isKeyword(word) {
+ return keywords.has(word);
+}
+
+//# sourceMappingURL=keyword.js.map
diff --git a/node_modules/@babel/helper-validator-identifier/lib/keyword.js.map b/node_modules/@babel/helper-validator-identifier/lib/keyword.js.map
new file mode 100644
index 0000000..3471f78
--- /dev/null
+++ b/node_modules/@babel/helper-validator-identifier/lib/keyword.js.map
@@ -0,0 +1 @@
+{"version":3,"names":["reservedWords","keyword","strict","strictBind","keywords","Set","reservedWordsStrictSet","reservedWordsStrictBindSet","isReservedWord","word","inModule","isStrictReservedWord","has","isStrictBindOnlyReservedWord","isStrictBindReservedWord","isKeyword"],"sources":["../src/keyword.ts"],"sourcesContent":["const reservedWords = {\n keyword: [\n \"break\",\n \"case\",\n \"catch\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"var\",\n \"const\",\n \"while\",\n \"with\",\n \"new\",\n \"this\",\n \"super\",\n \"class\",\n \"extends\",\n \"export\",\n \"import\",\n \"null\",\n \"true\",\n \"false\",\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"void\",\n \"delete\",\n ],\n strict: [\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n ],\n strictBind: [\"eval\", \"arguments\"],\n};\nconst keywords = new Set(reservedWords.keyword);\nconst reservedWordsStrictSet = new Set(reservedWords.strict);\nconst reservedWordsStrictBindSet = new Set(reservedWords.strictBind);\n\n/**\n * Checks if word is a reserved word in non-strict mode\n */\nexport function isReservedWord(word: string, inModule: boolean): boolean {\n return (inModule && word === \"await\") || word === \"enum\";\n}\n\n/**\n * Checks if word is a reserved word in non-binding strict mode\n *\n * Includes non-strict reserved words\n */\nexport function isStrictReservedWord(word: string, inModule: boolean): boolean {\n return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode, but it is allowed as\n * a normal identifier.\n */\nexport function isStrictBindOnlyReservedWord(word: string): boolean {\n return reservedWordsStrictBindSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode\n *\n * Includes non-strict reserved words and non-binding strict reserved words\n */\nexport function isStrictBindReservedWord(\n word: string,\n inModule: boolean,\n): boolean {\n return (\n isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word)\n );\n}\n\nexport function isKeyword(word: string): boolean {\n return keywords.has(word);\n}\n"],"mappings":";;;;;;;;;;AAAA,MAAMA,aAAa,GAAG;EACpBC,OAAO,EAAE,CACP,OAAO,EACP,MAAM,EACN,OAAO,EACP,UAAU,EACV,UAAU,EACV,SAAS,EACT,IAAI,EACJ,MAAM,EACN,SAAS,EACT,KAAK,EACL,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,KAAK,EACL,KAAK,EACL,OAAO,EACP,OAAO,EACP,MAAM,EACN,KAAK,EACL,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,MAAM,EACN,OAAO,EACP,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,MAAM,EACN,QAAQ,CACT;EACDC,MAAM,EAAE,CACN,YAAY,EACZ,WAAW,EACX,KAAK,EACL,SAAS,EACT,SAAS,EACT,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,OAAO,CACR;EACDC,UAAU,EAAE,CAAC,MAAM,EAAE,WAAW;AAClC,CAAC;AACD,MAAMC,QAAQ,GAAG,IAAIC,GAAG,CAACL,aAAa,CAACC,OAAO,CAAC;AAC/C,MAAMK,sBAAsB,GAAG,IAAID,GAAG,CAACL,aAAa,CAACE,MAAM,CAAC;AAC5D,MAAMK,0BAA0B,GAAG,IAAIF,GAAG,CAACL,aAAa,CAACG,UAAU,CAAC;AAK7D,SAASK,cAAcA,CAACC,IAAY,EAAEC,QAAiB,EAAW;EACvE,OAAQA,QAAQ,IAAID,IAAI,KAAK,OAAO,IAAKA,IAAI,KAAK,MAAM;AAC1D;AAOO,SAASE,oBAAoBA,CAACF,IAAY,EAAEC,QAAiB,EAAW;EAC7E,OAAOF,cAAc,CAACC,IAAI,EAAEC,QAAQ,CAAC,IAAIJ,sBAAsB,CAACM,GAAG,CAACH,IAAI,CAAC;AAC3E;AAMO,SAASI,4BAA4BA,CAACJ,IAAY,EAAW;EAClE,OAAOF,0BAA0B,CAACK,GAAG,CAACH,IAAI,CAAC;AAC7C;AAOO,SAASK,wBAAwBA,CACtCL,IAAY,EACZC,QAAiB,EACR;EACT,OACEC,oBAAoB,CAACF,IAAI,EAAEC,QAAQ,CAAC,IAAIG,4BAA4B,CAACJ,IAAI,CAAC;AAE9E;AAEO,SAASM,SAASA,CAACN,IAAY,EAAW;EAC/C,OAAOL,QAAQ,CAACQ,GAAG,CAACH,IAAI,CAAC;AAC3B","ignoreList":[]}
\ No newline at end of file
diff --git a/node_modules/@babel/helper-validator-identifier/package.json b/node_modules/@babel/helper-validator-identifier/package.json
new file mode 100644
index 0000000..0e2e01b
--- /dev/null
+++ b/node_modules/@babel/helper-validator-identifier/package.json
@@ -0,0 +1,31 @@
+{
+ "name": "@babel/helper-validator-identifier",
+ "version": "7.24.7",
+ "description": "Validate identifier/keywords name",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/babel/babel.git",
+ "directory": "packages/babel-helper-validator-identifier"
+ },
+ "license": "MIT",
+ "publishConfig": {
+ "access": "public"
+ },
+ "main": "./lib/index.js",
+ "exports": {
+ ".": {
+ "types": "./lib/index.d.ts",
+ "default": "./lib/index.js"
+ },
+ "./package.json": "./package.json"
+ },
+ "devDependencies": {
+ "@unicode/unicode-15.1.0": "^1.5.2",
+ "charcodes": "^0.2.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "author": "The Babel Team (https://babel.dev/team)",
+ "type": "commonjs"
+}
\ No newline at end of file
diff --git a/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js b/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js
new file mode 100644
index 0000000..f3fd9e9
--- /dev/null
+++ b/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js
@@ -0,0 +1,73 @@
+"use strict";
+
+// Always use the latest available version of Unicode!
+// https://tc39.github.io/ecma262/#sec-conformance
+const version = "15.1.0";
+
+const start = require(
+ "@unicode/unicode-" + version + "/Binary_Property/ID_Start/code-points.js"
+).filter(function (ch) {
+ return ch > 0x7f;
+});
+let last = -1;
+const cont = require(
+ "@unicode/unicode-" + version + "/Binary_Property/ID_Continue/code-points.js"
+).filter(function (ch) {
+ return ch > 0x7f && search(start, ch, last + 1) === -1;
+});
+
+function search(arr, ch, starting) {
+ for (let i = starting; arr[i] <= ch && i < arr.length; last = i++) {
+ if (arr[i] === ch) return i;
+ }
+ return -1;
+}
+
+function pad(str, width) {
+ while (str.length < width) str = "0" + str;
+ return str;
+}
+
+function esc(code) {
+ const hex = code.toString(16);
+ if (hex.length <= 2) return "\\x" + pad(hex, 2);
+ else return "\\u" + pad(hex, 4);
+}
+
+function generate(chars) {
+ const astral = [];
+ let re = "";
+ for (let i = 0, at = 0x10000; i < chars.length; i++) {
+ const from = chars[i];
+ let to = from;
+ while (i < chars.length - 1 && chars[i + 1] === to + 1) {
+ i++;
+ to++;
+ }
+ if (to <= 0xffff) {
+ if (from === to) re += esc(from);
+ else if (from + 1 === to) re += esc(from) + esc(to);
+ else re += esc(from) + "-" + esc(to);
+ } else {
+ astral.push(from - at, to - from);
+ at = to;
+ }
+ }
+ return { nonASCII: re, astral: astral };
+}
+
+const startData = generate(start);
+const contData = generate(cont);
+
+console.log("/* prettier-ignore */");
+console.log('let nonASCIIidentifierStartChars = "' + startData.nonASCII + '";');
+console.log("/* prettier-ignore */");
+console.log('let nonASCIIidentifierChars = "' + contData.nonASCII + '";');
+console.log("/* prettier-ignore */");
+console.log(
+ "const astralIdentifierStartCodes = " + JSON.stringify(startData.astral) + ";"
+);
+console.log("/* prettier-ignore */");
+console.log(
+ "const astralIdentifierCodes = " + JSON.stringify(contData.astral) + ";"
+);
diff --git a/node_modules/@babel/parser/CHANGELOG.md b/node_modules/@babel/parser/CHANGELOG.md
new file mode 100644
index 0000000..b3840ac
--- /dev/null
+++ b/node_modules/@babel/parser/CHANGELOG.md
@@ -0,0 +1,1073 @@
+# Changelog
+
+> **Tags:**
+> - :boom: [Breaking Change]
+> - :eyeglasses: [Spec Compliance]
+> - :rocket: [New Feature]
+> - :bug: [Bug Fix]
+> - :memo: [Documentation]
+> - :house: [Internal]
+> - :nail_care: [Polish]
+
+> Semver Policy: https://github.com/babel/babel/tree/main/packages/babel-parser#semver
+
+_Note: Gaps between patch versions are faulty, broken or test releases._
+
+See the [Babel Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) for the pre-6.8.0 version Changelog.
+
+## 6.17.1 (2017-05-10)
+
+### :bug: Bug Fix
+ * Fix typo in flow spread operator error (Brian Ng)
+ * Fixed invalid number literal parsing ([#473](https://github.com/babel/babylon/pull/473)) (Alex Kuzmenko)
+ * Fix number parser ([#433](https://github.com/babel/babylon/pull/433)) (Alex Kuzmenko)
+ * Ensure non pattern shorthand props are checked for reserved words ([#479](https://github.com/babel/babylon/pull/479)) (Brian Ng)
+ * Remove jsx context when parsing arrow functions ([#475](https://github.com/babel/babylon/pull/475)) (Brian Ng)
+ * Allow super in class properties ([#499](https://github.com/babel/babylon/pull/499)) (Brian Ng)
+ * Allow flow class field to be named constructor ([#510](https://github.com/babel/babylon/pull/510)) (Brian Ng)
+
+## 6.17.0 (2017-04-20)
+
+### :bug: Bug Fix
+ * Cherry-pick #418 to 6.x ([#476](https://github.com/babel/babylon/pull/476)) (Sebastian McKenzie)
+ * Add support for invalid escapes in tagged templates ([#274](https://github.com/babel/babylon/pull/274)) (Kevin Gibbons)
+ * Throw error if new.target is used outside of a function ([#402](https://github.com/babel/babylon/pull/402)) (Brian Ng)
+ * Fix parsing of class properties ([#351](https://github.com/babel/babylon/pull/351)) (Kevin Gibbons)
+ * Fix parsing yield with dynamicImport ([#383](https://github.com/babel/babylon/pull/383)) (Brian Ng)
+ * Ensure consistent start args for parseParenItem ([#386](https://github.com/babel/babylon/pull/386)) (Brian Ng)
+
+## 7.0.0-beta.8 (2017-04-04)
+
+### New Feature
+* Add support for flow type spread (#418) (Conrad Buck)
+* Allow statics in flow interfaces (#427) (Brian Ng)
+
+### Bug Fix
+* Fix predicate attachment to match flow parser (#428) (Brian Ng)
+* Add extra.raw back to JSXText and JSXAttribute (#344) (Alex Rattray)
+* Fix rest parameters with array and objects (#424) (Brian Ng)
+* Fix number parser (#433) (Alex Kuzmenko)
+
+### Docs
+* Fix CONTRIBUTING.md [skip ci] (#432) (Alex Kuzmenko)
+
+### Internal
+* Use babel-register script when running babel smoke tests (#442) (Brian Ng)
+
+## 7.0.0-beta.7 (2017-03-22)
+
+### Spec Compliance
+* Remove babylon plugin for template revision since it's stage-4 (#426) (Henry Zhu)
+
+### Bug Fix
+
+* Fix push-pop logic in flow (#405) (Daniel Tschinder)
+
+## 7.0.0-beta.6 (2017-03-21)
+
+### New Feature
+* Add support for invalid escapes in tagged templates (#274) (Kevin Gibbons)
+
+### Polish
+* Improves error message when super is called outside of constructor (#408) (Arshabh Kumar Agarwal)
+
+### Docs
+
+* [7.0] Moved value field in spec from ObjectMember to ObjectProperty as ObjectMethod's don't have it (#415) [skip ci] (James Browning)
+
+## 7.0.0-beta.5 (2017-03-21)
+
+### Bug Fix
+* Throw error if new.target is used outside of a function (#402) (Brian Ng)
+* Fix parsing of class properties (#351) (Kevin Gibbons)
+
+### Other
+ * Test runner: Detect extra property in 'actual' but not in 'expected'. (#407) (Andy)
+ * Optimize travis builds (#419) (Daniel Tschinder)
+ * Update codecov to 2.0 (#412) (Daniel Tschinder)
+ * Fix spec for ClassMethod: It doesn't have a function, it *is* a function. (#406) [skip ci] (Andy)
+ * Changed Non-existent RestPattern to RestElement which is what is actually parsed (#409) [skip ci] (James Browning)
+ * Upgrade flow to 0.41 (Daniel Tschinder)
+ * Fix watch command (#403) (Brian Ng)
+ * Update yarn lock (Daniel Tschinder)
+ * Fix watch command (#403) (Brian Ng)
+ * chore(package): update flow-bin to version 0.41.0 (#395) (greenkeeper[bot])
+ * Add estree test for correct order of directives (Daniel Tschinder)
+ * Add DoExpression to spec (#364) (Alex Kuzmenko)
+ * Mention cloning of repository in CONTRIBUTING.md (#391) [skip ci] (Sumedh Nimkarde)
+ * Explain how to run only one test (#389) [skip ci] (Aaron Ang)
+
+ ## 7.0.0-beta.4 (2017-03-01)
+
+* Don't consume async when checking for async func decl (#377) (Brian Ng)
+* add `ranges` option [skip ci] (Henry Zhu)
+* Don't parse class properties without initializers when classProperties is disabled and Flow is enabled (#300) (Andrew Levine)
+
+## 7.0.0-beta.3 (2017-02-28)
+
+- [7.0] Change RestProperty/SpreadProperty to RestElement/SpreadElement (#384)
+- Merge changes from 6.x
+
+## 7.0.0-beta.2 (2017-02-20)
+
+- estree: correctly change literals in all cases (#368) (Daniel Tschinder)
+
+## 7.0.0-beta.1 (2017-02-20)
+
+- Fix negative number literal typeannotations (#366) (Daniel Tschinder)
+- Update contributing with more test info [skip ci] (#355) (Brian Ng)
+
+## 7.0.0-beta.0 (2017-02-15)
+
+- Reintroduce Variance node (#333) (Daniel Tschinder)
+- Rename NumericLiteralTypeAnnotation to NumberLiteralTypeAnnotation (#332) (Charles Pick)
+- [7.0] Remove ForAwaitStatement, add await flag to ForOfStatement (#349) (Brandon Dail)
+- chore(package): update ava to version 0.18.0 (#345) (greenkeeper[bot])
+- chore(package): update babel-plugin-istanbul to version 4.0.0 (#350) (greenkeeper[bot])
+- Change location of ObjectTypeIndexer to match flow (#228) (Daniel Tschinder)
+- Rename flow AST Type ExistentialTypeParam to ExistsTypeAnnotation (#322) (Toru Kobayashi)
+- Revert "Temporary rollback for erroring on trailing comma with spread (#154)" (#290) (Daniel Tschinder)
+- Remove classConstructorCall plugin (#291) (Brian Ng)
+- Update yarn.lock (Daniel Tschinder)
+- Update cross-env to 3.x (Daniel Tschinder)
+- [7.0] Remove node 0.10, 0.12 and 5 from Travis (#284) (Sergey Rubanov)
+- Remove `String.fromCodePoint` shim (#279) (Mathias Bynens)
+
+## 6.16.1 (2017-02-23)
+
+### :bug: Regression
+
+- Revert "Fix export default async function to be FunctionDeclaration" ([#375](https://github.com/babel/babylon/pull/375))
+
+Need to modify Babel for this AST node change, so moving to 7.0.
+
+- Revert "Don't parse class properties without initializers when classProperties plugin is disabled, and Flow is enabled" ([#376](https://github.com/babel/babylon/pull/376))
+
+[react-native](https://github.com/facebook/react-native/issues/12542) broke with this so we reverted.
+
+## 6.16.0 (2017-02-23)
+
+### :rocket: New Feature
+
+***ESTree*** compatibility as plugin ([#277](https://github.com/babel/babylon/pull/277)) (Daniel Tschinder)
+
+We finally introduce a new compatibility layer for ESTree. To put babylon into ESTree-compatible mode the new plugin `estree` can be enabled. In this mode the parser will output an AST that is compliant to the specs of [ESTree](https://github.com/estree/estree/)
+
+We highly recommend everyone who uses babylon outside of babel to use this plugin. This will make it much easier for users to switch between different ESTree-compatible parsers. We so far tested several projects with different parsers and exchanged their parser to babylon and in nearly all cases it worked out of the box. Some other estree-compatible parsers include `acorn`, `esprima`, `espree`, `flow-parser`, etc.
+
+To enable `estree` mode simply add the plugin in the config:
+```json
+{
+ "plugins": [ "estree" ]
+}
+```
+
+If you want to migrate your project from non-ESTree mode to ESTree, have a look at our [Readme](https://github.com/babel/babylon/#output), where all deviations are mentioned.
+
+Add a parseExpression public method ([#213](https://github.com/babel/babylon/pull/213)) (jeromew)
+
+Babylon exports a new function to parse a single expression
+
+```js
+import { parseExpression } from 'babylon';
+
+const ast = parseExpression('x || y && z', options);
+```
+
+The returned AST will only consist of the expression. The options are the same as for `parse()`
+
+Add startLine option ([#346](https://github.com/babel/babylon/pull/346)) (Raphael Mu)
+
+A new option was added to babylon allowing to change the initial linenumber for the first line which is usually `1`.
+Changing this for example to `100` will make line `1` of the input source to be marked as line `100`, line `2` as `101`, line `3` as `102`, ...
+
+Function predicate declaration ([#103](https://github.com/babel/babylon/pull/103)) (Panagiotis Vekris)
+
+Added support for function predicates which flow introduced in version 0.33.0
+
+```js
+declare function is_number(x: mixed): boolean %checks(typeof x === "number");
+```
+
+Allow imports in declare module ([#315](https://github.com/babel/babylon/pull/315)) (Daniel Tschinder)
+
+Added support for imports within module declarations which flow introduced in version 0.37.0
+
+```js
+declare module "C" {
+ import type { DT } from "D";
+ declare export type CT = { D: DT };
+}
+```
+
+### :eyeglasses: Spec Compliance
+
+Forbid semicolons after decorators in classes ([#352](https://github.com/babel/babylon/pull/352)) (Kevin Gibbons)
+
+This example now correctly throws an error when there is a semicolon after the decorator:
+
+```js
+class A {
+@a;
+foo(){}
+}
+```
+
+Keywords are not allowed as local specifier ([#307](https://github.com/babel/babylon/pull/307)) (Daniel Tschinder)
+
+Using keywords in imports is not allowed anymore:
+
+```js
+import { default } from "foo";
+import { a as debugger } from "foo";
+```
+
+Do not allow overwritting of primitive types ([#314](https://github.com/babel/babylon/pull/314)) (Daniel Tschinder)
+
+In flow it is now forbidden to overwrite the primitive types `"any"`, `"mixed"`, `"empty"`, `"bool"`, `"boolean"`, `"number"`, `"string"`, `"void"` and `"null"` with your own type declaration.
+
+Disallow import type { type a } from … ([#305](https://github.com/babel/babylon/pull/305)) (Daniel Tschinder)
+
+The following code now correctly throws an error
+
+```js
+import type { type a } from "foo";
+```
+
+Don't parse class properties without initializers when classProperties is disabled and Flow is enabled ([#300](https://github.com/babel/babylon/pull/300)) (Andrew Levine)
+
+Ensure that you enable the `classProperties` plugin in order to enable correct parsing of class properties. Prior to this version it was possible to parse them by enabling the `flow` plugin but this was not intended the behaviour.
+
+If you enable the flow plugin you can only define the type of the class properties, but not initialize them.
+
+Fix export default async function to be FunctionDeclaration ([#324](https://github.com/babel/babylon/pull/324)) (Daniel Tschinder)
+
+Parsing the following code now returns a `FunctionDeclaration` AST node instead of `FunctionExpression`.
+
+```js
+export default async function bar() {};
+```
+
+### :nail_care: Polish
+
+Improve error message on attempt to destructure named import ([#288](https://github.com/babel/babylon/pull/288)) (Brian Ng)
+
+### :bug: Bug Fix
+
+Fix negative number literal typeannotations ([#366](https://github.com/babel/babylon/pull/366)) (Daniel Tschinder)
+
+Ensure takeDecorators is called on exported class ([#358](https://github.com/babel/babylon/pull/358)) (Brian Ng)
+
+ESTree: correctly change literals in all cases ([#368](https://github.com/babel/babylon/pull/368)) (Daniel Tschinder)
+
+Correctly convert RestProperty to Assignable ([#339](https://github.com/babel/babylon/pull/339)) (Daniel Tschinder)
+
+Fix #321 by allowing question marks in type params ([#338](https://github.com/babel/babylon/pull/338)) (Daniel Tschinder)
+
+Fix #336 by correctly setting arrow-param ([#337](https://github.com/babel/babylon/pull/337)) (Daniel Tschinder)
+
+Fix parse error when destructuring `set` with default value ([#317](https://github.com/babel/babylon/pull/317)) (Brian Ng)
+
+Fix ObjectTypeCallProperty static ([#298](https://github.com/babel/babylon/pull/298)) (Dan Harper)
+
+
+### :house: Internal
+
+Fix generator-method-with-computed-name spec ([#360](https://github.com/babel/babylon/pull/360)) (Alex Rattray)
+
+Fix flow type-parameter-declaration test with unintended semantic ([#361](https://github.com/babel/babylon/pull/361)) (Alex Rattray)
+
+Cleanup and splitup parser functions ([#295](https://github.com/babel/babylon/pull/295)) (Daniel Tschinder)
+
+chore(package): update flow-bin to version 0.38.0 ([#313](https://github.com/babel/babylon/pull/313)) (greenkeeper[bot])
+
+Call inner function instead of 1:1 copy to plugin ([#294](https://github.com/babel/babylon/pull/294)) (Daniel Tschinder)
+
+Update eslint-config-babel to the latest version 🚀 ([#299](https://github.com/babel/babylon/pull/299)) (greenkeeper[bot])
+
+Update eslint-config-babel to the latest version 🚀 ([#293](https://github.com/babel/babylon/pull/293)) (greenkeeper[bot])
+
+devDeps: remove eslint-plugin-babel ([#292](https://github.com/babel/babylon/pull/292)) (Kai Cataldo)
+
+Correct indent eslint rule config ([#276](https://github.com/babel/babylon/pull/276)) (Daniel Tschinder)
+
+Fail tests that have expected.json and throws-option ([#285](https://github.com/babel/babylon/pull/285)) (Daniel Tschinder)
+
+### :memo: Documentation
+
+Update contributing with more test info [skip ci] ([#355](https://github.com/babel/babylon/pull/355)) (Brian Ng)
+
+Update API documentation ([#330](https://github.com/babel/babylon/pull/330)) (Timothy Gu)
+
+Added keywords to package.json ([#323](https://github.com/babel/babylon/pull/323)) (Dmytro)
+
+AST spec: fix casing of `RegExpLiteral` ([#318](https://github.com/babel/babylon/pull/318)) (Mathias Bynens)
+
+## 6.15.0 (2017-01-10)
+
+### :eyeglasses: Spec Compliance
+
+Add support for Flow shorthand import type ([#267](https://github.com/babel/babylon/pull/267)) (Jeff Morrison)
+
+This change implements flows new shorthand import syntax
+and where previously you had to write this code:
+
+```js
+import {someValue} from "blah";
+import type {someType} from "blah";
+import typeof {someOtherValue} from "blah";
+```
+
+you can now write it like this:
+
+```js
+import {
+ someValue,
+ type someType,
+ typeof someOtherValue,
+} from "blah";
+```
+
+For more information look at [this](https://github.com/facebook/flow/pull/2890) pull request.
+
+flow: allow leading pipes in all positions ([#256](https://github.com/babel/babylon/pull/256)) (Vladimir Kurchatkin)
+
+This change now allows a leading pipe everywhere types can be used:
+```js
+var f = (x): | 1 | 2 => 1;
+```
+
+Throw error when exporting non-declaration ([#241](https://github.com/babel/babylon/pull/241)) (Kai Cataldo)
+
+Previously babylon parsed the following exports, although they are not valid:
+```js
+export typeof foo;
+export new Foo();
+export function() {};
+export for (;;);
+export while(foo);
+```
+
+### :bug: Bug Fix
+
+Don't set inType flag when parsing property names ([#266](https://github.com/babel/babylon/pull/266)) (Vladimir Kurchatkin)
+
+This fixes parsing of this case:
+
+```js
+const map = {
+ [age <= 17] : 'Too young'
+};
+```
+
+Fix source location for JSXEmptyExpression nodes (fixes #248) ([#249](https://github.com/babel/babylon/pull/249)) (James Long)
+
+The following case produced an invalid AST
+```js
+
{/* foo */}
+```
+
+Use fromCodePoint to convert high value unicode entities ([#243](https://github.com/babel/babylon/pull/243)) (Ryan Duffy)
+
+When high value unicode entities (e.g. 💩) were used in the input source code they are now correctly encoded in the resulting AST.
+
+Rename folder to avoid Windows-illegal characters ([#281](https://github.com/babel/babylon/pull/281)) (Ryan Plant)
+
+Allow this.state.clone() when parsing decorators ([#262](https://github.com/babel/babylon/pull/262)) (Alex Rattray)
+
+### :house: Internal
+
+User external-helpers ([#254](https://github.com/babel/babylon/pull/254)) (Daniel Tschinder)
+
+Add watch script for dev ([#234](https://github.com/babel/babylon/pull/234)) (Kai Cataldo)
+
+Freeze current plugins list for "*" option, and remove from README.md ([#245](https://github.com/babel/babylon/pull/245)) (Andrew Levine)
+
+Prepare tests for multiple fixture runners. ([#240](https://github.com/babel/babylon/pull/240)) (Daniel Tschinder)
+
+Add some test coverage for decorators stage-0 plugin ([#250](https://github.com/babel/babylon/pull/250)) (Andrew Levine)
+
+Refactor tokenizer types file ([#263](https://github.com/babel/babylon/pull/263)) (Sven SAULEAU)
+
+Update eslint-config-babel to the latest version 🚀 ([#273](https://github.com/babel/babylon/pull/273)) (greenkeeper[bot])
+
+chore(package): update rollup to version 0.41.0 ([#272](https://github.com/babel/babylon/pull/272)) (greenkeeper[bot])
+
+chore(package): update flow-bin to version 0.37.0 ([#255](https://github.com/babel/babylon/pull/255)) (greenkeeper[bot])
+
+## 6.14.1 (2016-11-17)
+
+### :bug: Bug Fix
+
+Allow `"plugins": ["*"]` ([#229](https://github.com/babel/babylon/pull/229)) (Daniel Tschinder)
+
+```js
+{
+ "plugins": ["*"]
+}
+```
+
+Will include all parser plugins instead of specifying each one individually. Useful for tools like babel-eslint, jscodeshift, and ast-explorer.
+
+## 6.14.0 (2016-11-16)
+
+### :eyeglasses: Spec Compliance
+
+Throw error for reserved words `enum` and `await` ([#195](https://github.com/babel/babylon/pull/195)) (Kai Cataldo)
+
+[11.6.2.2 Future Reserved Words](http://www.ecma-international.org/ecma-262/6.0/#sec-future-reserved-words)
+
+Babylon will throw for more reserved words such as `enum` or `await` (in strict mode).
+
+```
+class enum {} // throws
+class await {} // throws in strict mode (module)
+```
+
+Optional names for function types and object type indexers ([#197](https://github.com/babel/babylon/pull/197)) (Gabe Levi)
+
+So where you used to have to write
+
+```js
+type A = (x: string, y: boolean) => number;
+type B = (z: string) => number;
+type C = { [key: string]: number };
+```
+
+you can now write (with flow 0.34.0)
+
+```js
+type A = (string, boolean) => number;
+type B = string => number;
+type C = { [string]: number };
+```
+
+Parse flow nested array type annotations like `number[][]` ([#219](https://github.com/babel/babylon/pull/219)) (Bernhard Häussner)
+
+Supports these form now of specifying array types:
+
+```js
+var a: number[][][][];
+var b: string[][];
+```
+
+### :bug: Bug Fix
+
+Correctly eat semicolon at the end of `DelcareModuleExports` ([#223](https://github.com/babel/babylon/pull/223)) (Daniel Tschinder)
+
+```
+declare module "foo" { declare module.exports: number }
+declare module "foo" { declare module.exports: number; } // also allowed now
+```
+
+### :house: Internal
+
+ * Count Babel tests towards Babylon code coverage ([#182](https://github.com/babel/babylon/pull/182)) (Moti Zilberman)
+ * Fix strange line endings ([#214](https://github.com/babel/babylon/pull/214)) (Thomas Grainger)
+ * Add node 7 (Daniel Tschinder)
+ * chore(package): update flow-bin to version 0.34.0 ([#204](https://github.com/babel/babylon/pull/204)) (Greenkeeper)
+
+## v6.13.1 (2016-10-26)
+
+### :nail_care: Polish
+
+- Use rollup for bundling to speed up startup time ([#190](https://github.com/babel/babylon/pull/190)) ([@drewml](https://github.com/DrewML))
+
+```js
+const babylon = require('babylon');
+const ast = babylon.parse('var foo = "lol";');
+```
+
+With that test case, there was a ~95ms savings by removing the need for node to build/traverse the dependency graph.
+
+**Without bundling**
+
+
+**With bundling**
+
+
+- add clean command [skip ci] ([#201](https://github.com/babel/babylon/pull/201)) (Henry Zhu)
+- add ForAwaitStatement (async generator already added) [skip ci] ([#196](https://github.com/babel/babylon/pull/196)) (Henry Zhu)
+
+## v6.13.0 (2016-10-21)
+
+### :eyeglasses: Spec Compliance
+
+Property variance type annotations for Flow plugin ([#161](https://github.com/babel/babylon/pull/161)) (Sam Goldman)
+
+> See https://flowtype.org/docs/variance.html for more information
+
+```js
+type T = { +p: T };
+interface T { -p: T };
+declare class T { +[k:K]: V };
+class T { -[k:K]: V };
+class C2 { +p: T = e };
+```
+
+Raise error on duplicate definition of __proto__ ([#183](https://github.com/babel/babylon/pull/183)) (Moti Zilberman)
+
+```js
+({ __proto__: 1, __proto__: 2 }) // Throws an error now
+```
+
+### :bug: Bug Fix
+
+Flow: Allow class properties to be named `static` ([#184](https://github.com/babel/babylon/pull/184)) (Moti Zilberman)
+
+```js
+declare class A {
+ static: T;
+}
+```
+
+Allow "async" as identifier for object literal property shorthand ([#187](https://github.com/babel/babylon/pull/187)) (Andrew Levine)
+
+```js
+var foo = { async, bar };
+```
+
+### :nail_care: Polish
+
+Fix flowtype and add inType to state ([#189](https://github.com/babel/babylon/pull/189)) (Daniel Tschinder)
+
+> This improves the performance slightly (because of hidden classes)
+
+### :house: Internal
+
+Fix .gitattributes line ending setting ([#191](https://github.com/babel/babylon/pull/191)) (Moti Zilberman)
+
+Increase test coverage ([#175](https://github.com/babel/babylon/pull/175) (Moti Zilberman)
+
+Readd missin .eslinignore for IDEs (Daniel Tschinder)
+
+Error on missing expected.json fixture in CI ([#188](https://github.com/babel/babylon/pull/188)) (Moti Zilberman)
+
+Add .gitattributes and .editorconfig for LF line endings ([#179](https://github.com/babel/babylon/pull/179)) (Moti Zilberman)
+
+Fixes two tests that are failing after the merge of #172 ([#177](https://github.com/babel/babylon/pull/177)) (Moti Zilberman)
+
+## v6.12.0 (2016-10-14)
+
+### :eyeglasses: Spec Compliance
+
+Implement import() syntax ([#163](https://github.com/babel/babylon/pull/163)) (Jordan Gensler)
+
+#### Dynamic Import
+
+- Proposal Repo: https://github.com/domenic/proposal-dynamic-import
+- Championed by [@domenic](https://github.com/domenic)
+- stage-2
+- [sept-28 tc39 notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-09/sept-28.md#113a-import)
+
+> This repository contains a proposal for adding a "function-like" import() module loading syntactic form to JavaScript
+
+```js
+import(`./section-modules/${link.dataset.entryModule}.js`)
+.then(module => {
+ module.loadPageInto(main);
+})
+```
+
+Add EmptyTypeAnnotation ([#171](https://github.com/babel/babylon/pull/171)) (Sam Goldman)
+
+#### EmptyTypeAnnotation
+
+Just wasn't covered before.
+
+```js
+type T = empty;
+```
+
+### :bug: Bug Fix
+
+Fix crash when exporting with destructuring and sparse array ([#170](https://github.com/babel/babylon/pull/170)) (Jeroen Engels)
+
+```js
+// was failing due to sparse array
+export const { foo: [ ,, qux7 ] } = bar;
+```
+
+Allow keyword in Flow object declaration property names with type parameters ([#146](https://github.com/babel/babylon/pull/146)) (Dan Harper)
+
+```js
+declare class X {
+ foobar(): void;
+ static foobar(): void;
+}
+```
+
+Allow keyword in object/class property names with Flow type parameters ([#145](https://github.com/babel/babylon/pull/145)) (Dan Harper)
+
+```js
+class Foo {
+ delete(item: T): T {
+ return item;
+ }
+}
+```
+
+Allow typeAnnotations for yield expressions ([#174](https://github.com/babel/babylon/pull/174))) (Daniel Tschinder)
+
+```js
+function *foo() {
+ const x = (yield 5: any);
+}
+```
+
+### :nail_care: Polish
+
+Annotate more errors with expected token ([#172](https://github.com/babel/babylon/pull/172))) (Moti Zilberman)
+
+```js
+// Unexpected token, expected ; (1:6)
+{ set 1 }
+```
+
+### :house: Internal
+
+Remove kcheck ([#173](https://github.com/babel/babylon/pull/173))) (Daniel Tschinder)
+
+Also run flow, linting, babel tests on separate instances (add back node 0.10)
+
+## v6.11.6 (2016-10-12)
+
+### :bug: Bug Fix/Regression
+
+Fix crash when exporting with destructuring and sparse array ([#170](https://github.com/babel/babylon/pull/170)) (Jeroen Engels)
+
+```js
+// was failing with `Cannot read property 'type' of null` because of null identifiers
+export const { foo: [ ,, qux7 ] } = bar;
+```
+
+## v6.11.5 (2016-10-12)
+
+### :eyeglasses: Spec Compliance
+
+Fix: Check for duplicate named exports in exported destructuring assignments ([#144](https://github.com/babel/babylon/pull/144)) (Kai Cataldo)
+
+```js
+// `foo` has already been exported. Exported identifiers must be unique. (2:20)
+export function foo() {};
+export const { a: [{foo}] } = bar;
+```
+
+Fix: Check for duplicate named exports in exported rest elements/properties ([#164](https://github.com/babel/babylon/pull/164)) (Kai Cataldo)
+
+```js
+// `foo` has already been exported. Exported identifiers must be unique. (2:22)
+export const foo = 1;
+export const [bar, ...foo] = baz;
+```
+
+### :bug: Bug Fix
+
+Fix: Allow identifier `async` for default param in arrow expression ([#165](https://github.com/babel/babylon/pull/165)) (Kai Cataldo)
+
+```js
+// this is ok now
+const test = ({async = true}) => {};
+```
+
+### :nail_care: Polish
+
+Babylon will now print out the token it's expecting if there's a `SyntaxError` ([#150](https://github.com/babel/babylon/pull/150)) (Daniel Tschinder)
+
+```bash
+# So in the case of a missing ending curly (`}`)
+Module build failed: SyntaxError: Unexpected token, expected } (30:0)
+ 28 | }
+ 29 |
+> 30 |
+ | ^
+```
+
+## v6.11.4 (2016-10-03)
+
+Temporary rollback for erroring on trailing comma with spread (#154) (Henry Zhu)
+
+## v6.11.3 (2016-10-01)
+
+### :eyeglasses: Spec Compliance
+
+Add static errors for object rest (#149) ([@danez](https://github.com/danez))
+
+> https://github.com/sebmarkbage/ecmascript-rest-spread
+
+Object rest copies the *rest* of properties from the right hand side `obj` starting from the left to right.
+
+```js
+let { x, y, ...z } = { x: 1, y: 2, z: 3 };
+// x = 1
+// y = 2
+// z = { z: 3 }
+```
+
+#### New Syntax Errors:
+
+**SyntaxError**: The rest element has to be the last element when destructuring (1:10)
+```bash
+> 1 | let { ...x, y, z } = { x: 1, y: 2, z: 3};
+ | ^
+# Previous behavior:
+# x = { x: 1, y: 2, z: 3 }
+# y = 2
+# z = 3
+```
+
+Before, this was just a more verbose way of shallow copying `obj` since it doesn't actually do what you think.
+
+**SyntaxError**: Cannot have multiple rest elements when destructuring (1:13)
+
+```bash
+> 1 | let { x, ...y, ...z } = { x: 1, y: 2, z: 3};
+ | ^
+# Previous behavior:
+# x = 1
+# y = { y: 2, z: 3 }
+# z = { y: 2, z: 3 }
+```
+
+Before y and z would just be the same value anyway so there is no reason to need to have both.
+
+**SyntaxError**: A trailing comma is not permitted after the rest element (1:16)
+
+```js
+let { x, y, ...z, } = obj;
+```
+
+The rationale for this is that the use case for trailing comma is that you can add something at the end without affecting the line above. Since a RestProperty always has to be the last property it doesn't make sense.
+
+---
+
+get / set are valid property names in default assignment (#142) ([@jezell](https://github.com/jezell))
+
+```js
+// valid
+function something({ set = null, get = null }) {}
+```
+
+## v6.11.2 (2016-09-23)
+
+### Bug Fix
+
+- [#139](https://github.com/babel/babylon/issues/139) Don't do the duplicate check if not an identifier (#140) @hzoo
+
+```js
+// regression with duplicate export check
+SyntaxError: ./typography.js: `undefined` has already been exported. Exported identifiers must be unique. (22:13)
+ 20 |
+ 21 | export const { rhythm } = typography;
+> 22 | export const { TypographyStyle } = typography
+```
+
+Bail out for now, and make a change to account for destructuring in the next release.
+
+## 6.11.1 (2016-09-22)
+
+### Bug Fix
+- [#137](https://github.com/babel/babylon/pull/137) - Fix a regression with duplicate exports - it was erroring on all keys in `Object.prototype`. @danez
+
+```javascript
+export toString from './toString';
+```
+
+```bash
+`toString` has already been exported. Exported identifiers must be unique. (1:7)
+> 1 | export toString from './toString';
+ | ^
+ 2 |
+```
+
+## 6.11.0 (2016-09-22)
+
+### Spec Compliance (will break CI)
+
+- Disallow duplicate named exports ([#107](https://github.com/babel/babylon/pull/107)) @kaicataldo
+
+```js
+// Only one default export allowed per module. (2:9)
+export default function() {};
+export { foo as default };
+
+// Only one default export allowed per module. (2:0)
+export default {};
+export default function() {};
+
+// `Foo` has already been exported. Exported identifiers must be unique. (2:0)
+export { Foo };
+export class Foo {};
+```
+
+### New Feature (Syntax)
+
+- Add support for computed class property names ([#121](https://github.com/babel/babylon/pull/121)) @motiz88
+
+```js
+// AST
+interface ClassProperty <: Node {
+ type: "ClassProperty";
+ key: Identifier;
+ value: Expression;
+ computed: boolean; // added
+}
+```
+
+```js
+// with "plugins": ["classProperties"]
+class Foo {
+ [x]
+ ['y']
+}
+
+class Bar {
+ [p]
+ [m] () {}
+}
+ ```
+
+### Bug Fix
+
+- Fix `static` property falling through in the declare class Flow AST ([#135](https://github.com/babel/babylon/pull/135)) @danharper
+
+```js
+declare class X {
+ a: number;
+ static b: number; // static
+ c: number; // this was being marked as static in the AST as well
+}
+```
+
+### Polish
+
+- Rephrase "assigning/binding to rvalue" errors to include context ([#119](https://github.com/babel/babylon/pull/119)) @motiz88
+
+```js
+// Used to error with:
+// SyntaxError: Assigning to rvalue (1:0)
+
+// Now:
+// Invalid left-hand side in assignment expression (1:0)
+3 = 4
+
+// Invalid left-hand side in for-in statement (1:5)
+for (+i in {});
+```
+
+### Internal
+
+- Fix call to `this.parseMaybeAssign` with correct arguments ([#133](https://github.com/babel/babylon/pull/133)) @danez
+- Add semver note to changelog ([#131](https://github.com/babel/babylon/pull/131)) @hzoo
+
+## 6.10.0 (2016-09-19)
+
+> We plan to include some spec compliance bugs in patch versions. An example was the multiple default exports issue.
+
+### Spec Compliance
+
+* Implement ES2016 check for simple parameter list in strict mode ([#106](https://github.com/babel/babylon/pull/106)) (Timothy Gu)
+
+> It is a Syntax Error if ContainsUseStrict of FunctionBody is true and IsSimpleParameterList of FormalParameters is false. https://tc39.github.io/ecma262/2016/#sec-function-definitions-static-semantics-early-errors
+
+More Context: [tc39-notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2015-07/july-29.md#611-the-scope-of-use-strict-with-respect-to-destructuring-in-parameter-lists)
+
+For example:
+
+```js
+// this errors because it uses destructuring and default parameters
+// in a function with a "use strict" directive
+function a([ option1, option2 ] = []) {
+ "use strict";
+}
+ ```
+
+The solution would be to use a top level "use strict" or to remove the destructuring or default parameters when using a function + "use strict" or to.
+
+### New Feature
+
+* Exact object type annotations for Flow plugin ([#104](https://github.com/babel/babylon/pull/104)) (Basil Hosmer)
+
+Added to flow in https://github.com/facebook/flow/commit/c710c40aa2a115435098d6c0dfeaadb023cd39b8
+
+Looks like:
+
+```js
+var a : {| x: number, y: string |} = { x: 0, y: 'foo' };
+```
+
+### Bug Fixes
+
+* Include `typeParameter` location in `ArrowFunctionExpression` ([#126](https://github.com/babel/babylon/pull/126)) (Daniel Tschinder)
+* Error on invalid flow type annotation with default assignment ([#122](https://github.com/babel/babylon/pull/122)) (Dan Harper)
+* Fix Flow return types on arrow functions ([#124](https://github.com/babel/babylon/pull/124)) (Dan Harper)
+
+### Misc
+
+* Add tests for export extensions ([#127](https://github.com/babel/babylon/pull/127)) (Daniel Tschinder)
+* Fix Contributing guidelines [skip ci] (Daniel Tschinder)
+
+## 6.9.2 (2016-09-09)
+
+The only change is to remove the `babel-runtime` dependency by compiling with Babel's ES2015 loose mode. So using babylon standalone should be smaller.
+
+## 6.9.1 (2016-08-23)
+
+This release contains mainly small bugfixes but also updates babylons default mode to es2017. The features for `exponentiationOperator`, `asyncFunctions` and `trailingFunctionCommas` which previously needed to be activated via plugin are now enabled by default and the plugins are now no-ops.
+
+### Bug Fixes
+
+- Fix issues with default object params in async functions ([#96](https://github.com/babel/babylon/pull/96)) @danez
+- Fix issues with flow-types and async function ([#95](https://github.com/babel/babylon/pull/95)) @danez
+- Fix arrow functions with destructuring, types & default value ([#94](https://github.com/babel/babylon/pull/94)) @danharper
+- Fix declare class with qualified type identifier ([#97](https://github.com/babel/babylon/pull/97)) @danez
+- Remove exponentiationOperator, asyncFunctions, trailingFunctionCommas plugins and enable them by default ([#98](https://github.com/babel/babylon/pull/98)) @danez
+
+## 6.9.0 (2016-08-16)
+
+### New syntax support
+
+- Add JSX spread children ([#42](https://github.com/babel/babylon/pull/42)) @calebmer
+
+(Be aware that React is not going to support this syntax)
+
+```js
+
+ {...todos.map(todo => )}
+
+```
+
+- Add support for declare module.exports ([#72](https://github.com/babel/babylon/pull/72)) @danez
+
+```js
+declare module "foo" {
+ declare module.exports: {}
+}
+```
+
+### New Features
+
+- If supplied, attach filename property to comment node loc. ([#80](https://github.com/babel/babylon/pull/80)) @divmain
+- Add identifier name to node loc field ([#90](https://github.com/babel/babylon/pull/90)) @kittens
+
+### Bug Fixes
+
+- Fix exponential operator to behave according to spec ([#75](https://github.com/babel/babylon/pull/75)) @danez
+- Fix lookahead to not add comments to arrays which are not cloned ([#76](https://github.com/babel/babylon/pull/76)) @danez
+- Fix accidental fall-through in Flow type parsing. ([#82](https://github.com/babel/babylon/pull/82)) @xiemaisi
+- Only allow declares inside declare module ([#73](https://github.com/babel/babylon/pull/73)) @danez
+- Small fix for parsing type parameter declarations ([#83](https://github.com/babel/babylon/pull/83)) @gabelevi
+- Fix arrow param locations with flow types ([#57](https://github.com/babel/babylon/pull/57)) @danez
+- Fixes SyntaxError position with flow optional type ([#65](https://github.com/babel/babylon/pull/65)) @danez
+
+### Internal
+
+- Add codecoverage to tests @danez
+- Fix tests to not save expected output if we expect the test to fail @danez
+- Make a shallow clone of babel for testing @danez
+- chore(package): update cross-env to version 2.0.0 ([#77](https://github.com/babel/babylon/pull/77)) @greenkeeperio-bot
+- chore(package): update ava to version 0.16.0 ([#86](https://github.com/babel/babylon/pull/86)) @greenkeeperio-bot
+- chore(package): update babel-plugin-istanbul to version 2.0.0 ([#89](https://github.com/babel/babylon/pull/89)) @greenkeeperio-bot
+- chore(package): update nyc to version 8.0.0 ([#88](https://github.com/babel/babylon/pull/88)) @greenkeeperio-bot
+
+## 6.8.4 (2016-07-06)
+
+### Bug Fixes
+
+- Fix the location of params, when flow and default value used ([#68](https://github.com/babel/babylon/pull/68)) @danez
+
+## 6.8.3 (2016-07-02)
+
+### Bug Fixes
+
+- Fix performance regression introduced in 6.8.2 with conditionals ([#63](https://github.com/babel/babylon/pull/63)) @danez
+
+## 6.8.2 (2016-06-24)
+
+### Bug Fixes
+
+- Fix parse error with yielding jsx elements in generators `function* it() { yield ; }` ([#31](https://github.com/babel/babylon/pull/31)) @eldereal
+- When cloning nodes do not clone its comments ([#24](https://github.com/babel/babylon/pull/24)) @danez
+- Fix parse errors when using arrow functions with an spread element and return type `(...props): void => {}` ([#10](https://github.com/babel/babylon/pull/10)) @danez
+- Fix leading comments added from previous node ([#23](https://github.com/babel/babylon/pull/23)) @danez
+- Fix parse errors with flow's optional arguments `(arg?) => {}` ([#19](https://github.com/babel/babylon/pull/19)) @danez
+- Support negative numeric type literals @kittens
+- Remove line terminator restriction after await keyword @kittens
+- Remove grouped type arrow restriction as it seems flow no longer has it @kittens
+- Fix parse error with generic methods that have the name `get` or `set` `class foo { get() {} }` ([#55](https://github.com/babel/babylon/pull/55)) @vkurchatkin
+- Fix parse error with arrow functions that have flow type parameter declarations `(x: T): T => x;` ([#54](https://github.com/babel/babylon/pull/54)) @gabelevi
+
+### Documentation
+
+- Document AST differences from ESTree ([#41](https://github.com/babel/babylon/pull/41)) @nene
+- Move ast spec from babel/babel ([#46](https://github.com/babel/babylon/pull/46)) @hzoo
+
+### Internal
+
+- Enable skipped tests ([#16](https://github.com/babel/babylon/pull/16)) @danez
+- Add script to test latest version of babylon with babel ([#21](https://github.com/babel/babylon/pull/21)) @danez
+- Upgrade test runner ava @kittens
+- Add missing generate-identifier-regex script @kittens
+- Rename parser context types @kittens
+- Add node v6 to travis testing @hzoo
+- Update to Unicode v9 ([#45](https://github.com/babel/babylon/pull/45)) @mathiasbynens
+
+## 6.8.1 (2016-06-06)
+
+### New Feature
+
+- Parse type parameter declarations with defaults like `type Foo = T`
+
+### Bug Fixes
+- Type parameter declarations need 1 or more type parameters.
+- The existential type `*` is not a valid type parameter.
+- The existential type `*` is a primary type
+
+### Spec Compliance
+- The param list for type parameter declarations now consists of `TypeParameter` nodes
+- New `TypeParameter` AST Node (replaces using the `Identifier` node before)
+
+```
+interface TypeParameter <: Node {
+ bound: TypeAnnotation;
+ default: TypeAnnotation;
+ name: string;
+ variance: "plus" | "minus";
+}
+```
+
+## 6.8.0 (2016-05-02)
+
+#### New Feature
+
+##### Parse Method Parameter Decorators ([#12](https://github.com/babel/babylon/pull/12))
+
+> [Method Parameter Decorators](https://goo.gl/8MmCMG) is now a TC39 [stage 0 proposal](https://github.com/tc39/ecma262/blob/master/stage0.md).
+
+Examples:
+
+```js
+class Foo {
+ constructor(@foo() x, @bar({ a: 123 }) @baz() y) {}
+}
+
+export default function func(@foo() x, @bar({ a: 123 }) @baz() y) {}
+
+var obj = {
+ method(@foo() x, @bar({ a: 123 }) @baz() y) {}
+};
+```
+
+##### Parse for-await statements (w/ `asyncGenerators` plugin) ([#17](https://github.com/babel/babylon/pull/17))
+
+There is also a new node type, `ForAwaitStatement`.
+
+> [Async generators and for-await](https://github.com/tc39/proposal-async-iteration) are now a [stage 2 proposal](https://github.com/tc39/ecma262#current-proposals).
+
+Example:
+
+```js
+async function f() {
+ for await (let x of y);
+}
+```
diff --git a/node_modules/@babel/parser/LICENSE b/node_modules/@babel/parser/LICENSE
new file mode 100644
index 0000000..d4c7fc5
--- /dev/null
+++ b/node_modules/@babel/parser/LICENSE
@@ -0,0 +1,19 @@
+Copyright (C) 2012-2014 by various contributors (see AUTHORS)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/@babel/parser/README.md b/node_modules/@babel/parser/README.md
new file mode 100644
index 0000000..a9463e8
--- /dev/null
+++ b/node_modules/@babel/parser/README.md
@@ -0,0 +1,19 @@
+# @babel/parser
+
+> A JavaScript parser
+
+See our website [@babel/parser](https://babeljs.io/docs/babel-parser) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20parser%22+is%3Aopen) associated with this package.
+
+## Install
+
+Using npm:
+
+```sh
+npm install --save-dev @babel/parser
+```
+
+or using yarn:
+
+```sh
+yarn add @babel/parser --dev
+```
diff --git a/node_modules/@babel/parser/bin/babel-parser.js b/node_modules/@babel/parser/bin/babel-parser.js
new file mode 100755
index 0000000..3aca314
--- /dev/null
+++ b/node_modules/@babel/parser/bin/babel-parser.js
@@ -0,0 +1,15 @@
+#!/usr/bin/env node
+/* eslint no-var: 0 */
+
+var parser = require("..");
+var fs = require("fs");
+
+var filename = process.argv[2];
+if (!filename) {
+ console.error("no filename specified");
+} else {
+ var file = fs.readFileSync(filename, "utf8");
+ var ast = parser.parse(file);
+
+ console.log(JSON.stringify(ast, null, " "));
+}
diff --git a/node_modules/@babel/parser/index.cjs b/node_modules/@babel/parser/index.cjs
new file mode 100644
index 0000000..89863a9
--- /dev/null
+++ b/node_modules/@babel/parser/index.cjs
@@ -0,0 +1,5 @@
+try {
+ module.exports = require("./lib/index.cjs");
+} catch {
+ module.exports = require("./lib/index.js");
+}
diff --git a/node_modules/@babel/parser/lib/index.js b/node_modules/@babel/parser/lib/index.js
new file mode 100644
index 0000000..3b5c6bc
--- /dev/null
+++ b/node_modules/@babel/parser/lib/index.js
@@ -0,0 +1,14009 @@
+'use strict';
+
+Object.defineProperty(exports, '__esModule', {
+ value: true
+});
+function _objectWithoutPropertiesLoose(r, e) {
+ if (null == r) return {};
+ var t = {};
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
+ if (e.includes(n)) continue;
+ t[n] = r[n];
+ }
+ return t;
+}
+class Position {
+ constructor(line, col, index) {
+ this.line = void 0;
+ this.column = void 0;
+ this.index = void 0;
+ this.line = line;
+ this.column = col;
+ this.index = index;
+ }
+}
+class SourceLocation {
+ constructor(start, end) {
+ this.start = void 0;
+ this.end = void 0;
+ this.filename = void 0;
+ this.identifierName = void 0;
+ this.start = start;
+ this.end = end;
+ }
+}
+function createPositionWithColumnOffset(position, columnOffset) {
+ const {
+ line,
+ column,
+ index
+ } = position;
+ return new Position(line, column + columnOffset, index + columnOffset);
+}
+const code = "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED";
+var ModuleErrors = {
+ ImportMetaOutsideModule: {
+ message: `import.meta may appear only with 'sourceType: "module"'`,
+ code
+ },
+ ImportOutsideModule: {
+ message: `'import' and 'export' may appear only with 'sourceType: "module"'`,
+ code
+ }
+};
+const NodeDescriptions = {
+ ArrayPattern: "array destructuring pattern",
+ AssignmentExpression: "assignment expression",
+ AssignmentPattern: "assignment expression",
+ ArrowFunctionExpression: "arrow function expression",
+ ConditionalExpression: "conditional expression",
+ CatchClause: "catch clause",
+ ForOfStatement: "for-of statement",
+ ForInStatement: "for-in statement",
+ ForStatement: "for-loop",
+ FormalParameters: "function parameter list",
+ Identifier: "identifier",
+ ImportSpecifier: "import specifier",
+ ImportDefaultSpecifier: "import default specifier",
+ ImportNamespaceSpecifier: "import namespace specifier",
+ ObjectPattern: "object destructuring pattern",
+ ParenthesizedExpression: "parenthesized expression",
+ RestElement: "rest element",
+ UpdateExpression: {
+ true: "prefix operation",
+ false: "postfix operation"
+ },
+ VariableDeclarator: "variable declaration",
+ YieldExpression: "yield expression"
+};
+const toNodeDescription = node => node.type === "UpdateExpression" ? NodeDescriptions.UpdateExpression[`${node.prefix}`] : NodeDescriptions[node.type];
+var StandardErrors = {
+ AccessorIsGenerator: ({
+ kind
+ }) => `A ${kind}ter cannot be a generator.`,
+ ArgumentsInClass: "'arguments' is only allowed in functions and class methods.",
+ AsyncFunctionInSingleStatementContext: "Async functions can only be declared at the top level or inside a block.",
+ AwaitBindingIdentifier: "Can not use 'await' as identifier inside an async function.",
+ AwaitBindingIdentifierInStaticBlock: "Can not use 'await' as identifier inside a static block.",
+ AwaitExpressionFormalParameter: "'await' is not allowed in async function parameters.",
+ AwaitUsingNotInAsyncContext: "'await using' is only allowed within async functions and at the top levels of modules.",
+ AwaitNotInAsyncContext: "'await' is only allowed within async functions and at the top levels of modules.",
+ AwaitNotInAsyncFunction: "'await' is only allowed within async functions.",
+ BadGetterArity: "A 'get' accessor must not have any formal parameters.",
+ BadSetterArity: "A 'set' accessor must have exactly one formal parameter.",
+ BadSetterRestParameter: "A 'set' accessor function argument must not be a rest parameter.",
+ ConstructorClassField: "Classes may not have a field named 'constructor'.",
+ ConstructorClassPrivateField: "Classes may not have a private field named '#constructor'.",
+ ConstructorIsAccessor: "Class constructor may not be an accessor.",
+ ConstructorIsAsync: "Constructor can't be an async function.",
+ ConstructorIsGenerator: "Constructor can't be a generator.",
+ DeclarationMissingInitializer: ({
+ kind
+ }) => `Missing initializer in ${kind} declaration.`,
+ DecoratorArgumentsOutsideParentheses: "Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",
+ DecoratorBeforeExport: "Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",
+ DecoratorsBeforeAfterExport: "Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",
+ DecoratorConstructor: "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",
+ DecoratorExportClass: "Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",
+ DecoratorSemicolon: "Decorators must not be followed by a semicolon.",
+ DecoratorStaticBlock: "Decorators can't be used with a static block.",
+ DeferImportRequiresNamespace: 'Only `import defer * as x from "./module"` is valid.',
+ DeletePrivateField: "Deleting a private field is not allowed.",
+ DestructureNamedImport: "ES2015 named imports do not destructure. Use another statement for destructuring after the import.",
+ DuplicateConstructor: "Duplicate constructor in the same class.",
+ DuplicateDefaultExport: "Only one default export allowed per module.",
+ DuplicateExport: ({
+ exportName
+ }) => `\`${exportName}\` has already been exported. Exported identifiers must be unique.`,
+ DuplicateProto: "Redefinition of __proto__ property.",
+ DuplicateRegExpFlags: "Duplicate regular expression flag.",
+ DynamicImportPhaseRequiresImportExpressions: ({
+ phase
+ }) => `'import.${phase}(...)' can only be parsed when using the 'createImportExpressions' option.`,
+ ElementAfterRest: "Rest element must be last element.",
+ EscapedCharNotAnIdentifier: "Invalid Unicode escape.",
+ ExportBindingIsString: ({
+ localName,
+ exportName
+ }) => `A string literal cannot be used as an exported binding without \`from\`.\n- Did you mean \`export { '${localName}' as '${exportName}' } from 'some-module'\`?`,
+ ExportDefaultFromAsIdentifier: "'from' is not allowed as an identifier after 'export default'.",
+ ForInOfLoopInitializer: ({
+ type
+ }) => `'${type === "ForInStatement" ? "for-in" : "for-of"}' loop variable declaration may not have an initializer.`,
+ ForInUsing: "For-in loop may not start with 'using' declaration.",
+ ForOfAsync: "The left-hand side of a for-of loop may not be 'async'.",
+ ForOfLet: "The left-hand side of a for-of loop may not start with 'let'.",
+ GeneratorInSingleStatementContext: "Generators can only be declared at the top level or inside a block.",
+ IllegalBreakContinue: ({
+ type
+ }) => `Unsyntactic ${type === "BreakStatement" ? "break" : "continue"}.`,
+ IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list.",
+ IllegalReturn: "'return' outside of function.",
+ ImportAttributesUseAssert: "The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedAssertSyntax: true` option in the import attributes plugin to suppress this error.",
+ ImportBindingIsString: ({
+ importName
+ }) => `A string literal cannot be used as an imported binding.\n- Did you mean \`import { "${importName}" as foo }\`?`,
+ ImportCallArgumentTrailingComma: "Trailing comma is disallowed inside import(...) arguments.",
+ ImportCallArity: ({
+ maxArgumentCount
+ }) => `\`import()\` requires exactly ${maxArgumentCount === 1 ? "one argument" : "one or two arguments"}.`,
+ ImportCallNotNewExpression: "Cannot use new with import(...).",
+ ImportCallSpreadArgument: "`...` is not allowed in `import()`.",
+ ImportJSONBindingNotDefault: "A JSON module can only be imported with `default`.",
+ ImportReflectionHasAssertion: "`import module x` cannot have assertions.",
+ ImportReflectionNotBinding: 'Only `import module x from "./module"` is valid.',
+ IncompatibleRegExpUVFlags: "The 'u' and 'v' regular expression flags cannot be enabled at the same time.",
+ InvalidBigIntLiteral: "Invalid BigIntLiteral.",
+ InvalidCodePoint: "Code point out of bounds.",
+ InvalidCoverInitializedName: "Invalid shorthand property initializer.",
+ InvalidDecimal: "Invalid decimal.",
+ InvalidDigit: ({
+ radix
+ }) => `Expected number in radix ${radix}.`,
+ InvalidEscapeSequence: "Bad character escape sequence.",
+ InvalidEscapeSequenceTemplate: "Invalid escape sequence in template.",
+ InvalidEscapedReservedWord: ({
+ reservedWord
+ }) => `Escape sequence in keyword ${reservedWord}.`,
+ InvalidIdentifier: ({
+ identifierName
+ }) => `Invalid identifier ${identifierName}.`,
+ InvalidLhs: ({
+ ancestor
+ }) => `Invalid left-hand side in ${toNodeDescription(ancestor)}.`,
+ InvalidLhsBinding: ({
+ ancestor
+ }) => `Binding invalid left-hand side in ${toNodeDescription(ancestor)}.`,
+ InvalidLhsOptionalChaining: ({
+ ancestor
+ }) => `Invalid optional chaining in the left-hand side of ${toNodeDescription(ancestor)}.`,
+ InvalidNumber: "Invalid number.",
+ InvalidOrMissingExponent: "Floating-point numbers require a valid exponent after the 'e'.",
+ InvalidOrUnexpectedToken: ({
+ unexpected
+ }) => `Unexpected character '${unexpected}'.`,
+ InvalidParenthesizedAssignment: "Invalid parenthesized assignment pattern.",
+ InvalidPrivateFieldResolution: ({
+ identifierName
+ }) => `Private name #${identifierName} is not defined.`,
+ InvalidPropertyBindingPattern: "Binding member expression.",
+ InvalidRecordProperty: "Only properties and spread elements are allowed in record definitions.",
+ InvalidRestAssignmentPattern: "Invalid rest operator's argument.",
+ LabelRedeclaration: ({
+ labelName
+ }) => `Label '${labelName}' is already declared.`,
+ LetInLexicalBinding: "'let' is disallowed as a lexically bound name.",
+ LineTerminatorBeforeArrow: "No line break is allowed before '=>'.",
+ MalformedRegExpFlags: "Invalid regular expression flag.",
+ MissingClassName: "A class name is required.",
+ MissingEqInAssignment: "Only '=' operator can be used for specifying default value.",
+ MissingSemicolon: "Missing semicolon.",
+ MissingPlugin: ({
+ missingPlugin
+ }) => `This experimental syntax requires enabling the parser plugin: ${missingPlugin.map(name => JSON.stringify(name)).join(", ")}.`,
+ MissingOneOfPlugins: ({
+ missingPlugin
+ }) => `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin.map(name => JSON.stringify(name)).join(", ")}.`,
+ MissingUnicodeEscape: "Expecting Unicode escape sequence \\uXXXX.",
+ MixingCoalesceWithLogical: "Nullish coalescing operator(??) requires parens when mixing with logical operators.",
+ ModuleAttributeDifferentFromType: "The only accepted module attribute is `type`.",
+ ModuleAttributeInvalidValue: "Only string literals are allowed as module attribute values.",
+ ModuleAttributesWithDuplicateKeys: ({
+ key
+ }) => `Duplicate key "${key}" is not allowed in module attributes.`,
+ ModuleExportNameHasLoneSurrogate: ({
+ surrogateCharCode
+ }) => `An export name cannot include a lone surrogate, found '\\u${surrogateCharCode.toString(16)}'.`,
+ ModuleExportUndefined: ({
+ localName
+ }) => `Export '${localName}' is not defined.`,
+ MultipleDefaultsInSwitch: "Multiple default clauses.",
+ NewlineAfterThrow: "Illegal newline after throw.",
+ NoCatchOrFinally: "Missing catch or finally clause.",
+ NumberIdentifier: "Identifier directly after number.",
+ NumericSeparatorInEscapeSequence: "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",
+ ObsoleteAwaitStar: "'await*' has been removed from the async functions proposal. Use Promise.all() instead.",
+ OptionalChainingNoNew: "Constructors in/after an Optional Chain are not allowed.",
+ OptionalChainingNoTemplate: "Tagged Template Literals are not allowed in optionalChain.",
+ OverrideOnConstructor: "'override' modifier cannot appear on a constructor declaration.",
+ ParamDupe: "Argument name clash.",
+ PatternHasAccessor: "Object pattern can't contain getter or setter.",
+ PatternHasMethod: "Object pattern can't contain methods.",
+ PrivateInExpectedIn: ({
+ identifierName
+ }) => `Private names are only allowed in property accesses (\`obj.#${identifierName}\`) or in \`in\` expressions (\`#${identifierName} in obj\`).`,
+ PrivateNameRedeclaration: ({
+ identifierName
+ }) => `Duplicate private name #${identifierName}.`,
+ RecordExpressionBarIncorrectEndSyntaxType: "Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
+ RecordExpressionBarIncorrectStartSyntaxType: "Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
+ RecordExpressionHashIncorrectStartSyntaxType: "Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",
+ RecordNoProto: "'__proto__' is not allowed in Record expressions.",
+ RestTrailingComma: "Unexpected trailing comma after rest element.",
+ SloppyFunction: "In non-strict mode code, functions can only be declared at top level or inside a block.",
+ SloppyFunctionAnnexB: "In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",
+ SourcePhaseImportRequiresDefault: 'Only `import source x from "./module"` is valid.',
+ StaticPrototype: "Classes may not have static property named prototype.",
+ SuperNotAllowed: "`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",
+ SuperPrivateField: "Private fields can't be accessed on super.",
+ TrailingDecorator: "Decorators must be attached to a class element.",
+ TupleExpressionBarIncorrectEndSyntaxType: "Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
+ TupleExpressionBarIncorrectStartSyntaxType: "Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
+ TupleExpressionHashIncorrectStartSyntaxType: "Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",
+ UnexpectedArgumentPlaceholder: "Unexpected argument placeholder.",
+ UnexpectedAwaitAfterPipelineBody: 'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',
+ UnexpectedDigitAfterHash: "Unexpected digit after hash token.",
+ UnexpectedImportExport: "'import' and 'export' may only appear at the top level.",
+ UnexpectedKeyword: ({
+ keyword
+ }) => `Unexpected keyword '${keyword}'.`,
+ UnexpectedLeadingDecorator: "Leading decorators must be attached to a class declaration.",
+ UnexpectedLexicalDeclaration: "Lexical declaration cannot appear in a single-statement context.",
+ UnexpectedNewTarget: "`new.target` can only be used in functions or class properties.",
+ UnexpectedNumericSeparator: "A numeric separator is only allowed between two digits.",
+ UnexpectedPrivateField: "Unexpected private name.",
+ UnexpectedReservedWord: ({
+ reservedWord
+ }) => `Unexpected reserved word '${reservedWord}'.`,
+ UnexpectedSuper: "'super' is only allowed in object methods and classes.",
+ UnexpectedToken: ({
+ expected,
+ unexpected
+ }) => `Unexpected token${unexpected ? ` '${unexpected}'.` : ""}${expected ? `, expected "${expected}"` : ""}`,
+ UnexpectedTokenUnaryExponentiation: "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",
+ UnexpectedUsingDeclaration: "Using declaration cannot appear in the top level when source type is `script`.",
+ UnsupportedBind: "Binding should be performed on object property.",
+ UnsupportedDecoratorExport: "A decorated export must export a class declaration.",
+ UnsupportedDefaultExport: "Only expressions, functions or classes are allowed as the `default` export.",
+ UnsupportedImport: "`import` can only be used in `import()` or `import.meta`.",
+ UnsupportedMetaProperty: ({
+ target,
+ onlyValidPropertyName
+ }) => `The only valid meta property for ${target} is ${target}.${onlyValidPropertyName}.`,
+ UnsupportedParameterDecorator: "Decorators cannot be used to decorate parameters.",
+ UnsupportedPropertyDecorator: "Decorators cannot be used to decorate object literal properties.",
+ UnsupportedSuper: "'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",
+ UnterminatedComment: "Unterminated comment.",
+ UnterminatedRegExp: "Unterminated regular expression.",
+ UnterminatedString: "Unterminated string constant.",
+ UnterminatedTemplate: "Unterminated template.",
+ UsingDeclarationExport: "Using declaration cannot be exported.",
+ UsingDeclarationHasBindingPattern: "Using declaration cannot have destructuring patterns.",
+ VarRedeclaration: ({
+ identifierName
+ }) => `Identifier '${identifierName}' has already been declared.`,
+ YieldBindingIdentifier: "Can not use 'yield' as identifier inside a generator.",
+ YieldInParameter: "Yield expression is not allowed in formal parameters.",
+ ZeroDigitNumericSeparator: "Numeric separator can not be used after leading 0."
+};
+var StrictModeErrors = {
+ StrictDelete: "Deleting local variable in strict mode.",
+ StrictEvalArguments: ({
+ referenceName
+ }) => `Assigning to '${referenceName}' in strict mode.`,
+ StrictEvalArgumentsBinding: ({
+ bindingName
+ }) => `Binding '${bindingName}' in strict mode.`,
+ StrictFunction: "In strict mode code, functions can only be declared at top level or inside a block.",
+ StrictNumericEscape: "The only valid numeric escape in strict mode is '\\0'.",
+ StrictOctalLiteral: "Legacy octal literals are not allowed in strict mode.",
+ StrictWith: "'with' in strict mode."
+};
+const UnparenthesizedPipeBodyDescriptions = new Set(["ArrowFunctionExpression", "AssignmentExpression", "ConditionalExpression", "YieldExpression"]);
+var PipelineOperatorErrors = {
+ PipeBodyIsTighter: "Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",
+ PipeTopicRequiresHackPipes: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',
+ PipeTopicUnbound: "Topic reference is unbound; it must be inside a pipe body.",
+ PipeTopicUnconfiguredToken: ({
+ token
+ }) => `Invalid topic token ${token}. In order to use ${token} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${token}" }.`,
+ PipeTopicUnused: "Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",
+ PipeUnparenthesizedBody: ({
+ type
+ }) => `Hack-style pipe body cannot be an unparenthesized ${toNodeDescription({
+ type
+ })}; please wrap it in parentheses.`,
+ PipelineBodyNoArrow: 'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',
+ PipelineBodySequenceExpression: "Pipeline body may not be a comma-separated sequence expression.",
+ PipelineHeadSequenceExpression: "Pipeline head should not be a comma-separated sequence expression.",
+ PipelineTopicUnused: "Pipeline is in topic style but does not use topic reference.",
+ PrimaryTopicNotAllowed: "Topic reference was used in a lexical context without topic binding.",
+ PrimaryTopicRequiresSmartPipeline: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'
+};
+const _excluded = ["message"];
+function defineHidden(obj, key, value) {
+ Object.defineProperty(obj, key, {
+ enumerable: false,
+ configurable: true,
+ value
+ });
+}
+function toParseErrorConstructor({
+ toMessage,
+ code,
+ reasonCode,
+ syntaxPlugin
+}) {
+ const hasMissingPlugin = reasonCode === "MissingPlugin" || reasonCode === "MissingOneOfPlugins";
+ {
+ const oldReasonCodes = {
+ AccessorCannotDeclareThisParameter: "AccesorCannotDeclareThisParameter",
+ AccessorCannotHaveTypeParameters: "AccesorCannotHaveTypeParameters",
+ ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference: "ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",
+ SetAccessorCannotHaveOptionalParameter: "SetAccesorCannotHaveOptionalParameter",
+ SetAccessorCannotHaveRestParameter: "SetAccesorCannotHaveRestParameter",
+ SetAccessorCannotHaveReturnType: "SetAccesorCannotHaveReturnType"
+ };
+ if (oldReasonCodes[reasonCode]) {
+ reasonCode = oldReasonCodes[reasonCode];
+ }
+ }
+ return function constructor(loc, details) {
+ const error = new SyntaxError();
+ error.code = code;
+ error.reasonCode = reasonCode;
+ error.loc = loc;
+ error.pos = loc.index;
+ error.syntaxPlugin = syntaxPlugin;
+ if (hasMissingPlugin) {
+ error.missingPlugin = details.missingPlugin;
+ }
+ defineHidden(error, "clone", function clone(overrides = {}) {
+ var _overrides$loc;
+ const {
+ line,
+ column,
+ index
+ } = (_overrides$loc = overrides.loc) != null ? _overrides$loc : loc;
+ return constructor(new Position(line, column, index), Object.assign({}, details, overrides.details));
+ });
+ defineHidden(error, "details", details);
+ Object.defineProperty(error, "message", {
+ configurable: true,
+ get() {
+ const message = `${toMessage(details)} (${loc.line}:${loc.column})`;
+ this.message = message;
+ return message;
+ },
+ set(value) {
+ Object.defineProperty(this, "message", {
+ value,
+ writable: true
+ });
+ }
+ });
+ return error;
+ };
+}
+function ParseErrorEnum(argument, syntaxPlugin) {
+ if (Array.isArray(argument)) {
+ return parseErrorTemplates => ParseErrorEnum(parseErrorTemplates, argument[0]);
+ }
+ const ParseErrorConstructors = {};
+ for (const reasonCode of Object.keys(argument)) {
+ const template = argument[reasonCode];
+ const _ref = typeof template === "string" ? {
+ message: () => template
+ } : typeof template === "function" ? {
+ message: template
+ } : template,
+ {
+ message
+ } = _ref,
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded);
+ const toMessage = typeof message === "string" ? () => message : message;
+ ParseErrorConstructors[reasonCode] = toParseErrorConstructor(Object.assign({
+ code: "BABEL_PARSER_SYNTAX_ERROR",
+ reasonCode,
+ toMessage
+ }, syntaxPlugin ? {
+ syntaxPlugin
+ } : {}, rest));
+ }
+ return ParseErrorConstructors;
+}
+const Errors = Object.assign({}, ParseErrorEnum(ModuleErrors), ParseErrorEnum(StandardErrors), ParseErrorEnum(StrictModeErrors), ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors));
+const {
+ defineProperty
+} = Object;
+const toUnenumerable = (object, key) => {
+ if (object) {
+ defineProperty(object, key, {
+ enumerable: false,
+ value: object[key]
+ });
+ }
+};
+function toESTreeLocation(node) {
+ toUnenumerable(node.loc.start, "index");
+ toUnenumerable(node.loc.end, "index");
+ return node;
+}
+var estree = superClass => class ESTreeParserMixin extends superClass {
+ parse() {
+ const file = toESTreeLocation(super.parse());
+ if (this.options.tokens) {
+ file.tokens = file.tokens.map(toESTreeLocation);
+ }
+ return file;
+ }
+ parseRegExpLiteral({
+ pattern,
+ flags
+ }) {
+ let regex = null;
+ try {
+ regex = new RegExp(pattern, flags);
+ } catch (_) {}
+ const node = this.estreeParseLiteral(regex);
+ node.regex = {
+ pattern,
+ flags
+ };
+ return node;
+ }
+ parseBigIntLiteral(value) {
+ let bigInt;
+ try {
+ bigInt = BigInt(value);
+ } catch (_unused) {
+ bigInt = null;
+ }
+ const node = this.estreeParseLiteral(bigInt);
+ node.bigint = String(node.value || value);
+ return node;
+ }
+ parseDecimalLiteral(value) {
+ const decimal = null;
+ const node = this.estreeParseLiteral(decimal);
+ node.decimal = String(node.value || value);
+ return node;
+ }
+ estreeParseLiteral(value) {
+ return this.parseLiteral(value, "Literal");
+ }
+ parseStringLiteral(value) {
+ return this.estreeParseLiteral(value);
+ }
+ parseNumericLiteral(value) {
+ return this.estreeParseLiteral(value);
+ }
+ parseNullLiteral() {
+ return this.estreeParseLiteral(null);
+ }
+ parseBooleanLiteral(value) {
+ return this.estreeParseLiteral(value);
+ }
+ directiveToStmt(directive) {
+ const expression = directive.value;
+ delete directive.value;
+ expression.type = "Literal";
+ expression.raw = expression.extra.raw;
+ expression.value = expression.extra.expressionValue;
+ const stmt = directive;
+ stmt.type = "ExpressionStatement";
+ stmt.expression = expression;
+ stmt.directive = expression.extra.rawValue;
+ delete expression.extra;
+ return stmt;
+ }
+ initFunction(node, isAsync) {
+ super.initFunction(node, isAsync);
+ node.expression = false;
+ }
+ checkDeclaration(node) {
+ if (node != null && this.isObjectProperty(node)) {
+ this.checkDeclaration(node.value);
+ } else {
+ super.checkDeclaration(node);
+ }
+ }
+ getObjectOrClassMethodParams(method) {
+ return method.value.params;
+ }
+ isValidDirective(stmt) {
+ var _stmt$expression$extr;
+ return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && !((_stmt$expression$extr = stmt.expression.extra) != null && _stmt$expression$extr.parenthesized);
+ }
+ parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) {
+ super.parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse);
+ const directiveStatements = node.directives.map(d => this.directiveToStmt(d));
+ node.body = directiveStatements.concat(node.body);
+ delete node.directives;
+ }
+ pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
+ this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true);
+ if (method.typeParameters) {
+ method.value.typeParameters = method.typeParameters;
+ delete method.typeParameters;
+ }
+ classBody.body.push(method);
+ }
+ parsePrivateName() {
+ const node = super.parsePrivateName();
+ {
+ if (!this.getPluginOption("estree", "classFeatures")) {
+ return node;
+ }
+ }
+ return this.convertPrivateNameToPrivateIdentifier(node);
+ }
+ convertPrivateNameToPrivateIdentifier(node) {
+ const name = super.getPrivateNameSV(node);
+ node = node;
+ delete node.id;
+ node.name = name;
+ node.type = "PrivateIdentifier";
+ return node;
+ }
+ isPrivateName(node) {
+ {
+ if (!this.getPluginOption("estree", "classFeatures")) {
+ return super.isPrivateName(node);
+ }
+ }
+ return node.type === "PrivateIdentifier";
+ }
+ getPrivateNameSV(node) {
+ {
+ if (!this.getPluginOption("estree", "classFeatures")) {
+ return super.getPrivateNameSV(node);
+ }
+ }
+ return node.name;
+ }
+ parseLiteral(value, type) {
+ const node = super.parseLiteral(value, type);
+ node.raw = node.extra.raw;
+ delete node.extra;
+ return node;
+ }
+ parseFunctionBody(node, allowExpression, isMethod = false) {
+ super.parseFunctionBody(node, allowExpression, isMethod);
+ node.expression = node.body.type !== "BlockStatement";
+ }
+ parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) {
+ let funcNode = this.startNode();
+ funcNode.kind = node.kind;
+ funcNode = super.parseMethod(funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope);
+ funcNode.type = "FunctionExpression";
+ delete funcNode.kind;
+ node.value = funcNode;
+ if (type === "ClassPrivateMethod") {
+ node.computed = false;
+ }
+ return this.finishNode(node, "MethodDefinition");
+ }
+ nameIsConstructor(key) {
+ if (key.type === "Literal") return key.value === "constructor";
+ return super.nameIsConstructor(key);
+ }
+ parseClassProperty(...args) {
+ const propertyNode = super.parseClassProperty(...args);
+ {
+ if (!this.getPluginOption("estree", "classFeatures")) {
+ return propertyNode;
+ }
+ }
+ propertyNode.type = "PropertyDefinition";
+ return propertyNode;
+ }
+ parseClassPrivateProperty(...args) {
+ const propertyNode = super.parseClassPrivateProperty(...args);
+ {
+ if (!this.getPluginOption("estree", "classFeatures")) {
+ return propertyNode;
+ }
+ }
+ propertyNode.type = "PropertyDefinition";
+ propertyNode.computed = false;
+ return propertyNode;
+ }
+ parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) {
+ const node = super.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor);
+ if (node) {
+ node.type = "Property";
+ if (node.kind === "method") {
+ node.kind = "init";
+ }
+ node.shorthand = false;
+ }
+ return node;
+ }
+ parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) {
+ const node = super.parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors);
+ if (node) {
+ node.kind = "init";
+ node.type = "Property";
+ }
+ return node;
+ }
+ isValidLVal(type, isUnparenthesizedInAssign, binding) {
+ return type === "Property" ? "value" : super.isValidLVal(type, isUnparenthesizedInAssign, binding);
+ }
+ isAssignable(node, isBinding) {
+ if (node != null && this.isObjectProperty(node)) {
+ return this.isAssignable(node.value, isBinding);
+ }
+ return super.isAssignable(node, isBinding);
+ }
+ toAssignable(node, isLHS = false) {
+ if (node != null && this.isObjectProperty(node)) {
+ const {
+ key,
+ value
+ } = node;
+ if (this.isPrivateName(key)) {
+ this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start);
+ }
+ this.toAssignable(value, isLHS);
+ } else {
+ super.toAssignable(node, isLHS);
+ }
+ }
+ toAssignableObjectExpressionProp(prop, isLast, isLHS) {
+ if (prop.type === "Property" && (prop.kind === "get" || prop.kind === "set")) {
+ this.raise(Errors.PatternHasAccessor, prop.key);
+ } else if (prop.type === "Property" && prop.method) {
+ this.raise(Errors.PatternHasMethod, prop.key);
+ } else {
+ super.toAssignableObjectExpressionProp(prop, isLast, isLHS);
+ }
+ }
+ finishCallExpression(unfinished, optional) {
+ const node = super.finishCallExpression(unfinished, optional);
+ if (node.callee.type === "Import") {
+ node.type = "ImportExpression";
+ node.source = node.arguments[0];
+ if (this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions")) {
+ var _ref, _ref2;
+ node.options = (_ref = node.arguments[1]) != null ? _ref : null;
+ node.attributes = (_ref2 = node.arguments[1]) != null ? _ref2 : null;
+ }
+ delete node.arguments;
+ delete node.callee;
+ }
+ return node;
+ }
+ toReferencedArguments(node) {
+ if (node.type === "ImportExpression") {
+ return;
+ }
+ super.toReferencedArguments(node);
+ }
+ parseExport(unfinished, decorators) {
+ const exportStartLoc = this.state.lastTokStartLoc;
+ const node = super.parseExport(unfinished, decorators);
+ switch (node.type) {
+ case "ExportAllDeclaration":
+ node.exported = null;
+ break;
+ case "ExportNamedDeclaration":
+ if (node.specifiers.length === 1 && node.specifiers[0].type === "ExportNamespaceSpecifier") {
+ node.type = "ExportAllDeclaration";
+ node.exported = node.specifiers[0].exported;
+ delete node.specifiers;
+ }
+ case "ExportDefaultDeclaration":
+ {
+ var _declaration$decorato;
+ const {
+ declaration
+ } = node;
+ if ((declaration == null ? void 0 : declaration.type) === "ClassDeclaration" && ((_declaration$decorato = declaration.decorators) == null ? void 0 : _declaration$decorato.length) > 0 && declaration.start === node.start) {
+ this.resetStartLocation(node, exportStartLoc);
+ }
+ }
+ break;
+ }
+ return node;
+ }
+ parseSubscript(base, startLoc, noCalls, state) {
+ const node = super.parseSubscript(base, startLoc, noCalls, state);
+ if (state.optionalChainMember) {
+ if (node.type === "OptionalMemberExpression" || node.type === "OptionalCallExpression") {
+ node.type = node.type.substring(8);
+ }
+ if (state.stop) {
+ const chain = this.startNodeAtNode(node);
+ chain.expression = node;
+ return this.finishNode(chain, "ChainExpression");
+ }
+ } else if (node.type === "MemberExpression" || node.type === "CallExpression") {
+ node.optional = false;
+ }
+ return node;
+ }
+ isOptionalMemberExpression(node) {
+ if (node.type === "ChainExpression") {
+ return node.expression.type === "MemberExpression";
+ }
+ return super.isOptionalMemberExpression(node);
+ }
+ hasPropertyAsPrivateName(node) {
+ if (node.type === "ChainExpression") {
+ node = node.expression;
+ }
+ return super.hasPropertyAsPrivateName(node);
+ }
+ isObjectProperty(node) {
+ return node.type === "Property" && node.kind === "init" && !node.method;
+ }
+ isObjectMethod(node) {
+ return node.type === "Property" && (node.method || node.kind === "get" || node.kind === "set");
+ }
+ finishNodeAt(node, type, endLoc) {
+ return toESTreeLocation(super.finishNodeAt(node, type, endLoc));
+ }
+ resetStartLocation(node, startLoc) {
+ super.resetStartLocation(node, startLoc);
+ toESTreeLocation(node);
+ }
+ resetEndLocation(node, endLoc = this.state.lastTokEndLoc) {
+ super.resetEndLocation(node, endLoc);
+ toESTreeLocation(node);
+ }
+};
+class TokContext {
+ constructor(token, preserveSpace) {
+ this.token = void 0;
+ this.preserveSpace = void 0;
+ this.token = token;
+ this.preserveSpace = !!preserveSpace;
+ }
+}
+const types = {
+ brace: new TokContext("{"),
+ j_oTag: new TokContext("...", true)
+};
+{
+ types.template = new TokContext("`", true);
+}
+const beforeExpr = true;
+const startsExpr = true;
+const isLoop = true;
+const isAssign = true;
+const prefix = true;
+const postfix = true;
+class ExportedTokenType {
+ constructor(label, conf = {}) {
+ this.label = void 0;
+ this.keyword = void 0;
+ this.beforeExpr = void 0;
+ this.startsExpr = void 0;
+ this.rightAssociative = void 0;
+ this.isLoop = void 0;
+ this.isAssign = void 0;
+ this.prefix = void 0;
+ this.postfix = void 0;
+ this.binop = void 0;
+ this.label = label;
+ this.keyword = conf.keyword;
+ this.beforeExpr = !!conf.beforeExpr;
+ this.startsExpr = !!conf.startsExpr;
+ this.rightAssociative = !!conf.rightAssociative;
+ this.isLoop = !!conf.isLoop;
+ this.isAssign = !!conf.isAssign;
+ this.prefix = !!conf.prefix;
+ this.postfix = !!conf.postfix;
+ this.binop = conf.binop != null ? conf.binop : null;
+ {
+ this.updateContext = null;
+ }
+ }
+}
+const keywords$1 = new Map();
+function createKeyword(name, options = {}) {
+ options.keyword = name;
+ const token = createToken(name, options);
+ keywords$1.set(name, token);
+ return token;
+}
+function createBinop(name, binop) {
+ return createToken(name, {
+ beforeExpr,
+ binop
+ });
+}
+let tokenTypeCounter = -1;
+const tokenTypes = [];
+const tokenLabels = [];
+const tokenBinops = [];
+const tokenBeforeExprs = [];
+const tokenStartsExprs = [];
+const tokenPrefixes = [];
+function createToken(name, options = {}) {
+ var _options$binop, _options$beforeExpr, _options$startsExpr, _options$prefix;
+ ++tokenTypeCounter;
+ tokenLabels.push(name);
+ tokenBinops.push((_options$binop = options.binop) != null ? _options$binop : -1);
+ tokenBeforeExprs.push((_options$beforeExpr = options.beforeExpr) != null ? _options$beforeExpr : false);
+ tokenStartsExprs.push((_options$startsExpr = options.startsExpr) != null ? _options$startsExpr : false);
+ tokenPrefixes.push((_options$prefix = options.prefix) != null ? _options$prefix : false);
+ tokenTypes.push(new ExportedTokenType(name, options));
+ return tokenTypeCounter;
+}
+function createKeywordLike(name, options = {}) {
+ var _options$binop2, _options$beforeExpr2, _options$startsExpr2, _options$prefix2;
+ ++tokenTypeCounter;
+ keywords$1.set(name, tokenTypeCounter);
+ tokenLabels.push(name);
+ tokenBinops.push((_options$binop2 = options.binop) != null ? _options$binop2 : -1);
+ tokenBeforeExprs.push((_options$beforeExpr2 = options.beforeExpr) != null ? _options$beforeExpr2 : false);
+ tokenStartsExprs.push((_options$startsExpr2 = options.startsExpr) != null ? _options$startsExpr2 : false);
+ tokenPrefixes.push((_options$prefix2 = options.prefix) != null ? _options$prefix2 : false);
+ tokenTypes.push(new ExportedTokenType("name", options));
+ return tokenTypeCounter;
+}
+const tt = {
+ bracketL: createToken("[", {
+ beforeExpr,
+ startsExpr
+ }),
+ bracketHashL: createToken("#[", {
+ beforeExpr,
+ startsExpr
+ }),
+ bracketBarL: createToken("[|", {
+ beforeExpr,
+ startsExpr
+ }),
+ bracketR: createToken("]"),
+ bracketBarR: createToken("|]"),
+ braceL: createToken("{", {
+ beforeExpr,
+ startsExpr
+ }),
+ braceBarL: createToken("{|", {
+ beforeExpr,
+ startsExpr
+ }),
+ braceHashL: createToken("#{", {
+ beforeExpr,
+ startsExpr
+ }),
+ braceR: createToken("}"),
+ braceBarR: createToken("|}"),
+ parenL: createToken("(", {
+ beforeExpr,
+ startsExpr
+ }),
+ parenR: createToken(")"),
+ comma: createToken(",", {
+ beforeExpr
+ }),
+ semi: createToken(";", {
+ beforeExpr
+ }),
+ colon: createToken(":", {
+ beforeExpr
+ }),
+ doubleColon: createToken("::", {
+ beforeExpr
+ }),
+ dot: createToken("."),
+ question: createToken("?", {
+ beforeExpr
+ }),
+ questionDot: createToken("?."),
+ arrow: createToken("=>", {
+ beforeExpr
+ }),
+ template: createToken("template"),
+ ellipsis: createToken("...", {
+ beforeExpr
+ }),
+ backQuote: createToken("`", {
+ startsExpr
+ }),
+ dollarBraceL: createToken("${", {
+ beforeExpr,
+ startsExpr
+ }),
+ templateTail: createToken("...`", {
+ startsExpr
+ }),
+ templateNonTail: createToken("...${", {
+ beforeExpr,
+ startsExpr
+ }),
+ at: createToken("@"),
+ hash: createToken("#", {
+ startsExpr
+ }),
+ interpreterDirective: createToken("#!..."),
+ eq: createToken("=", {
+ beforeExpr,
+ isAssign
+ }),
+ assign: createToken("_=", {
+ beforeExpr,
+ isAssign
+ }),
+ slashAssign: createToken("_=", {
+ beforeExpr,
+ isAssign
+ }),
+ xorAssign: createToken("_=", {
+ beforeExpr,
+ isAssign
+ }),
+ moduloAssign: createToken("_=", {
+ beforeExpr,
+ isAssign
+ }),
+ incDec: createToken("++/--", {
+ prefix,
+ postfix,
+ startsExpr
+ }),
+ bang: createToken("!", {
+ beforeExpr,
+ prefix,
+ startsExpr
+ }),
+ tilde: createToken("~", {
+ beforeExpr,
+ prefix,
+ startsExpr
+ }),
+ doubleCaret: createToken("^^", {
+ startsExpr
+ }),
+ doubleAt: createToken("@@", {
+ startsExpr
+ }),
+ pipeline: createBinop("|>", 0),
+ nullishCoalescing: createBinop("??", 1),
+ logicalOR: createBinop("||", 1),
+ logicalAND: createBinop("&&", 2),
+ bitwiseOR: createBinop("|", 3),
+ bitwiseXOR: createBinop("^", 4),
+ bitwiseAND: createBinop("&", 5),
+ equality: createBinop("==/!=/===/!==", 6),
+ lt: createBinop(">/<=/>=", 7),
+ gt: createBinop(">/<=/>=", 7),
+ relational: createBinop(">/<=/>=", 7),
+ bitShift: createBinop("<>>/>>>", 8),
+ bitShiftL: createBinop("<>>/>>>", 8),
+ bitShiftR: createBinop("<>>/>>>", 8),
+ plusMin: createToken("+/-", {
+ beforeExpr,
+ binop: 9,
+ prefix,
+ startsExpr
+ }),
+ modulo: createToken("%", {
+ binop: 10,
+ startsExpr
+ }),
+ star: createToken("*", {
+ binop: 10
+ }),
+ slash: createBinop("/", 10),
+ exponent: createToken("**", {
+ beforeExpr,
+ binop: 11,
+ rightAssociative: true
+ }),
+ _in: createKeyword("in", {
+ beforeExpr,
+ binop: 7
+ }),
+ _instanceof: createKeyword("instanceof", {
+ beforeExpr,
+ binop: 7
+ }),
+ _break: createKeyword("break"),
+ _case: createKeyword("case", {
+ beforeExpr
+ }),
+ _catch: createKeyword("catch"),
+ _continue: createKeyword("continue"),
+ _debugger: createKeyword("debugger"),
+ _default: createKeyword("default", {
+ beforeExpr
+ }),
+ _else: createKeyword("else", {
+ beforeExpr
+ }),
+ _finally: createKeyword("finally"),
+ _function: createKeyword("function", {
+ startsExpr
+ }),
+ _if: createKeyword("if"),
+ _return: createKeyword("return", {
+ beforeExpr
+ }),
+ _switch: createKeyword("switch"),
+ _throw: createKeyword("throw", {
+ beforeExpr,
+ prefix,
+ startsExpr
+ }),
+ _try: createKeyword("try"),
+ _var: createKeyword("var"),
+ _const: createKeyword("const"),
+ _with: createKeyword("with"),
+ _new: createKeyword("new", {
+ beforeExpr,
+ startsExpr
+ }),
+ _this: createKeyword("this", {
+ startsExpr
+ }),
+ _super: createKeyword("super", {
+ startsExpr
+ }),
+ _class: createKeyword("class", {
+ startsExpr
+ }),
+ _extends: createKeyword("extends", {
+ beforeExpr
+ }),
+ _export: createKeyword("export"),
+ _import: createKeyword("import", {
+ startsExpr
+ }),
+ _null: createKeyword("null", {
+ startsExpr
+ }),
+ _true: createKeyword("true", {
+ startsExpr
+ }),
+ _false: createKeyword("false", {
+ startsExpr
+ }),
+ _typeof: createKeyword("typeof", {
+ beforeExpr,
+ prefix,
+ startsExpr
+ }),
+ _void: createKeyword("void", {
+ beforeExpr,
+ prefix,
+ startsExpr
+ }),
+ _delete: createKeyword("delete", {
+ beforeExpr,
+ prefix,
+ startsExpr
+ }),
+ _do: createKeyword("do", {
+ isLoop,
+ beforeExpr
+ }),
+ _for: createKeyword("for", {
+ isLoop
+ }),
+ _while: createKeyword("while", {
+ isLoop
+ }),
+ _as: createKeywordLike("as", {
+ startsExpr
+ }),
+ _assert: createKeywordLike("assert", {
+ startsExpr
+ }),
+ _async: createKeywordLike("async", {
+ startsExpr
+ }),
+ _await: createKeywordLike("await", {
+ startsExpr
+ }),
+ _defer: createKeywordLike("defer", {
+ startsExpr
+ }),
+ _from: createKeywordLike("from", {
+ startsExpr
+ }),
+ _get: createKeywordLike("get", {
+ startsExpr
+ }),
+ _let: createKeywordLike("let", {
+ startsExpr
+ }),
+ _meta: createKeywordLike("meta", {
+ startsExpr
+ }),
+ _of: createKeywordLike("of", {
+ startsExpr
+ }),
+ _sent: createKeywordLike("sent", {
+ startsExpr
+ }),
+ _set: createKeywordLike("set", {
+ startsExpr
+ }),
+ _source: createKeywordLike("source", {
+ startsExpr
+ }),
+ _static: createKeywordLike("static", {
+ startsExpr
+ }),
+ _using: createKeywordLike("using", {
+ startsExpr
+ }),
+ _yield: createKeywordLike("yield", {
+ startsExpr
+ }),
+ _asserts: createKeywordLike("asserts", {
+ startsExpr
+ }),
+ _checks: createKeywordLike("checks", {
+ startsExpr
+ }),
+ _exports: createKeywordLike("exports", {
+ startsExpr
+ }),
+ _global: createKeywordLike("global", {
+ startsExpr
+ }),
+ _implements: createKeywordLike("implements", {
+ startsExpr
+ }),
+ _intrinsic: createKeywordLike("intrinsic", {
+ startsExpr
+ }),
+ _infer: createKeywordLike("infer", {
+ startsExpr
+ }),
+ _is: createKeywordLike("is", {
+ startsExpr
+ }),
+ _mixins: createKeywordLike("mixins", {
+ startsExpr
+ }),
+ _proto: createKeywordLike("proto", {
+ startsExpr
+ }),
+ _require: createKeywordLike("require", {
+ startsExpr
+ }),
+ _satisfies: createKeywordLike("satisfies", {
+ startsExpr
+ }),
+ _keyof: createKeywordLike("keyof", {
+ startsExpr
+ }),
+ _readonly: createKeywordLike("readonly", {
+ startsExpr
+ }),
+ _unique: createKeywordLike("unique", {
+ startsExpr
+ }),
+ _abstract: createKeywordLike("abstract", {
+ startsExpr
+ }),
+ _declare: createKeywordLike("declare", {
+ startsExpr
+ }),
+ _enum: createKeywordLike("enum", {
+ startsExpr
+ }),
+ _module: createKeywordLike("module", {
+ startsExpr
+ }),
+ _namespace: createKeywordLike("namespace", {
+ startsExpr
+ }),
+ _interface: createKeywordLike("interface", {
+ startsExpr
+ }),
+ _type: createKeywordLike("type", {
+ startsExpr
+ }),
+ _opaque: createKeywordLike("opaque", {
+ startsExpr
+ }),
+ name: createToken("name", {
+ startsExpr
+ }),
+ string: createToken("string", {
+ startsExpr
+ }),
+ num: createToken("num", {
+ startsExpr
+ }),
+ bigint: createToken("bigint", {
+ startsExpr
+ }),
+ decimal: createToken("decimal", {
+ startsExpr
+ }),
+ regexp: createToken("regexp", {
+ startsExpr
+ }),
+ privateName: createToken("#name", {
+ startsExpr
+ }),
+ eof: createToken("eof"),
+ jsxName: createToken("jsxName"),
+ jsxText: createToken("jsxText", {
+ beforeExpr: true
+ }),
+ jsxTagStart: createToken("jsxTagStart", {
+ startsExpr: true
+ }),
+ jsxTagEnd: createToken("jsxTagEnd"),
+ placeholder: createToken("%%", {
+ startsExpr: true
+ })
+};
+function tokenIsIdentifier(token) {
+ return token >= 93 && token <= 132;
+}
+function tokenKeywordOrIdentifierIsKeyword(token) {
+ return token <= 92;
+}
+function tokenIsKeywordOrIdentifier(token) {
+ return token >= 58 && token <= 132;
+}
+function tokenIsLiteralPropertyName(token) {
+ return token >= 58 && token <= 136;
+}
+function tokenComesBeforeExpression(token) {
+ return tokenBeforeExprs[token];
+}
+function tokenCanStartExpression(token) {
+ return tokenStartsExprs[token];
+}
+function tokenIsAssignment(token) {
+ return token >= 29 && token <= 33;
+}
+function tokenIsFlowInterfaceOrTypeOrOpaque(token) {
+ return token >= 129 && token <= 131;
+}
+function tokenIsLoop(token) {
+ return token >= 90 && token <= 92;
+}
+function tokenIsKeyword(token) {
+ return token >= 58 && token <= 92;
+}
+function tokenIsOperator(token) {
+ return token >= 39 && token <= 59;
+}
+function tokenIsPostfix(token) {
+ return token === 34;
+}
+function tokenIsPrefix(token) {
+ return tokenPrefixes[token];
+}
+function tokenIsTSTypeOperator(token) {
+ return token >= 121 && token <= 123;
+}
+function tokenIsTSDeclarationStart(token) {
+ return token >= 124 && token <= 130;
+}
+function tokenLabelName(token) {
+ return tokenLabels[token];
+}
+function tokenOperatorPrecedence(token) {
+ return tokenBinops[token];
+}
+function tokenIsRightAssociative(token) {
+ return token === 57;
+}
+function tokenIsTemplate(token) {
+ return token >= 24 && token <= 25;
+}
+function getExportedToken(token) {
+ return tokenTypes[token];
+}
+{
+ tokenTypes[8].updateContext = context => {
+ context.pop();
+ };
+ tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = context => {
+ context.push(types.brace);
+ };
+ tokenTypes[22].updateContext = context => {
+ if (context[context.length - 1] === types.template) {
+ context.pop();
+ } else {
+ context.push(types.template);
+ }
+ };
+ tokenTypes[142].updateContext = context => {
+ context.push(types.j_expr, types.j_oTag);
+ };
+}
+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-\u1c88\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-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\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";
+let nonASCIIidentifierChars = "\u200c\u200d\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\u0898-\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";
+const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
+const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
+nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
+const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 4026, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 757, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191];
+const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 81, 2, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 9, 5351, 0, 7, 14, 13835, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 983, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
+function isInAstralSet(code, set) {
+ let pos = 0x10000;
+ for (let i = 0, length = set.length; i < length; i += 2) {
+ pos += set[i];
+ if (pos > code) return false;
+ pos += set[i + 1];
+ if (pos >= code) return true;
+ }
+ return false;
+}
+function isIdentifierStart(code) {
+ if (code < 65) return code === 36;
+ if (code <= 90) return true;
+ if (code < 97) return code === 95;
+ if (code <= 122) return true;
+ if (code <= 0xffff) {
+ return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));
+ }
+ return isInAstralSet(code, astralIdentifierStartCodes);
+}
+function isIdentifierChar(code) {
+ if (code < 48) return code === 36;
+ if (code < 58) return true;
+ if (code < 65) return false;
+ if (code <= 90) return true;
+ if (code < 97) return code === 95;
+ if (code <= 122) return true;
+ if (code <= 0xffff) {
+ return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));
+ }
+ return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
+}
+const reservedWords = {
+ keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
+ strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
+ strictBind: ["eval", "arguments"]
+};
+const keywords = new Set(reservedWords.keyword);
+const reservedWordsStrictSet = new Set(reservedWords.strict);
+const reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
+function isReservedWord(word, inModule) {
+ return inModule && word === "await" || word === "enum";
+}
+function isStrictReservedWord(word, inModule) {
+ return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
+}
+function isStrictBindOnlyReservedWord(word) {
+ return reservedWordsStrictBindSet.has(word);
+}
+function isStrictBindReservedWord(word, inModule) {
+ return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
+}
+function isKeyword(word) {
+ return keywords.has(word);
+}
+function isIteratorStart(current, next, next2) {
+ return current === 64 && next === 64 && isIdentifierStart(next2);
+}
+const reservedWordLikeSet = new Set(["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete", "implements", "interface", "let", "package", "private", "protected", "public", "static", "yield", "eval", "arguments", "enum", "await"]);
+function canBeReservedWord(word) {
+ return reservedWordLikeSet.has(word);
+}
+class Scope {
+ constructor(flags) {
+ this.flags = 0;
+ this.names = new Map();
+ this.firstLexicalName = "";
+ this.flags = flags;
+ }
+}
+class ScopeHandler {
+ constructor(parser, inModule) {
+ this.parser = void 0;
+ this.scopeStack = [];
+ this.inModule = void 0;
+ this.undefinedExports = new Map();
+ this.parser = parser;
+ this.inModule = inModule;
+ }
+ get inTopLevel() {
+ return (this.currentScope().flags & 1) > 0;
+ }
+ get inFunction() {
+ return (this.currentVarScopeFlags() & 2) > 0;
+ }
+ get allowSuper() {
+ return (this.currentThisScopeFlags() & 16) > 0;
+ }
+ get allowDirectSuper() {
+ return (this.currentThisScopeFlags() & 32) > 0;
+ }
+ get inClass() {
+ return (this.currentThisScopeFlags() & 64) > 0;
+ }
+ get inClassAndNotInNonArrowFunction() {
+ const flags = this.currentThisScopeFlags();
+ return (flags & 64) > 0 && (flags & 2) === 0;
+ }
+ get inStaticBlock() {
+ for (let i = this.scopeStack.length - 1;; i--) {
+ const {
+ flags
+ } = this.scopeStack[i];
+ if (flags & 128) {
+ return true;
+ }
+ if (flags & (387 | 64)) {
+ return false;
+ }
+ }
+ }
+ get inNonArrowFunction() {
+ return (this.currentThisScopeFlags() & 2) > 0;
+ }
+ get treatFunctionsAsVar() {
+ return this.treatFunctionsAsVarInScope(this.currentScope());
+ }
+ createScope(flags) {
+ return new Scope(flags);
+ }
+ enter(flags) {
+ this.scopeStack.push(this.createScope(flags));
+ }
+ exit() {
+ const scope = this.scopeStack.pop();
+ return scope.flags;
+ }
+ treatFunctionsAsVarInScope(scope) {
+ return !!(scope.flags & (2 | 128) || !this.parser.inModule && scope.flags & 1);
+ }
+ declareName(name, bindingType, loc) {
+ let scope = this.currentScope();
+ if (bindingType & 8 || bindingType & 16) {
+ this.checkRedeclarationInScope(scope, name, bindingType, loc);
+ let type = scope.names.get(name) || 0;
+ if (bindingType & 16) {
+ type = type | 4;
+ } else {
+ if (!scope.firstLexicalName) {
+ scope.firstLexicalName = name;
+ }
+ type = type | 2;
+ }
+ scope.names.set(name, type);
+ if (bindingType & 8) {
+ this.maybeExportDefined(scope, name);
+ }
+ } else if (bindingType & 4) {
+ for (let i = this.scopeStack.length - 1; i >= 0; --i) {
+ scope = this.scopeStack[i];
+ this.checkRedeclarationInScope(scope, name, bindingType, loc);
+ scope.names.set(name, (scope.names.get(name) || 0) | 1);
+ this.maybeExportDefined(scope, name);
+ if (scope.flags & 387) break;
+ }
+ }
+ if (this.parser.inModule && scope.flags & 1) {
+ this.undefinedExports.delete(name);
+ }
+ }
+ maybeExportDefined(scope, name) {
+ if (this.parser.inModule && scope.flags & 1) {
+ this.undefinedExports.delete(name);
+ }
+ }
+ checkRedeclarationInScope(scope, name, bindingType, loc) {
+ if (this.isRedeclaredInScope(scope, name, bindingType)) {
+ this.parser.raise(Errors.VarRedeclaration, loc, {
+ identifierName: name
+ });
+ }
+ }
+ isRedeclaredInScope(scope, name, bindingType) {
+ if (!(bindingType & 1)) return false;
+ if (bindingType & 8) {
+ return scope.names.has(name);
+ }
+ const type = scope.names.get(name);
+ if (bindingType & 16) {
+ return (type & 2) > 0 || !this.treatFunctionsAsVarInScope(scope) && (type & 1) > 0;
+ }
+ return (type & 2) > 0 && !(scope.flags & 8 && scope.firstLexicalName === name) || !this.treatFunctionsAsVarInScope(scope) && (type & 4) > 0;
+ }
+ checkLocalExport(id) {
+ const {
+ name
+ } = id;
+ const topLevelScope = this.scopeStack[0];
+ if (!topLevelScope.names.has(name)) {
+ this.undefinedExports.set(name, id.loc.start);
+ }
+ }
+ currentScope() {
+ return this.scopeStack[this.scopeStack.length - 1];
+ }
+ currentVarScopeFlags() {
+ for (let i = this.scopeStack.length - 1;; i--) {
+ const {
+ flags
+ } = this.scopeStack[i];
+ if (flags & 387) {
+ return flags;
+ }
+ }
+ }
+ currentThisScopeFlags() {
+ for (let i = this.scopeStack.length - 1;; i--) {
+ const {
+ flags
+ } = this.scopeStack[i];
+ if (flags & (387 | 64) && !(flags & 4)) {
+ return flags;
+ }
+ }
+ }
+}
+class FlowScope extends Scope {
+ constructor(...args) {
+ super(...args);
+ this.declareFunctions = new Set();
+ }
+}
+class FlowScopeHandler extends ScopeHandler {
+ createScope(flags) {
+ return new FlowScope(flags);
+ }
+ declareName(name, bindingType, loc) {
+ const scope = this.currentScope();
+ if (bindingType & 2048) {
+ this.checkRedeclarationInScope(scope, name, bindingType, loc);
+ this.maybeExportDefined(scope, name);
+ scope.declareFunctions.add(name);
+ return;
+ }
+ super.declareName(name, bindingType, loc);
+ }
+ isRedeclaredInScope(scope, name, bindingType) {
+ if (super.isRedeclaredInScope(scope, name, bindingType)) return true;
+ if (bindingType & 2048 && !scope.declareFunctions.has(name)) {
+ const type = scope.names.get(name);
+ return (type & 4) > 0 || (type & 2) > 0;
+ }
+ return false;
+ }
+ checkLocalExport(id) {
+ if (!this.scopeStack[0].declareFunctions.has(id.name)) {
+ super.checkLocalExport(id);
+ }
+ }
+}
+class BaseParser {
+ constructor() {
+ this.sawUnambiguousESM = false;
+ this.ambiguousScriptDifferentAst = false;
+ }
+ hasPlugin(pluginConfig) {
+ if (typeof pluginConfig === "string") {
+ return this.plugins.has(pluginConfig);
+ } else {
+ const [pluginName, pluginOptions] = pluginConfig;
+ if (!this.hasPlugin(pluginName)) {
+ return false;
+ }
+ const actualOptions = this.plugins.get(pluginName);
+ for (const key of Object.keys(pluginOptions)) {
+ if ((actualOptions == null ? void 0 : actualOptions[key]) !== pluginOptions[key]) {
+ return false;
+ }
+ }
+ return true;
+ }
+ }
+ getPluginOption(plugin, name) {
+ var _this$plugins$get;
+ return (_this$plugins$get = this.plugins.get(plugin)) == null ? void 0 : _this$plugins$get[name];
+ }
+}
+function setTrailingComments(node, comments) {
+ if (node.trailingComments === undefined) {
+ node.trailingComments = comments;
+ } else {
+ node.trailingComments.unshift(...comments);
+ }
+}
+function setLeadingComments(node, comments) {
+ if (node.leadingComments === undefined) {
+ node.leadingComments = comments;
+ } else {
+ node.leadingComments.unshift(...comments);
+ }
+}
+function setInnerComments(node, comments) {
+ if (node.innerComments === undefined) {
+ node.innerComments = comments;
+ } else {
+ node.innerComments.unshift(...comments);
+ }
+}
+function adjustInnerComments(node, elements, commentWS) {
+ let lastElement = null;
+ let i = elements.length;
+ while (lastElement === null && i > 0) {
+ lastElement = elements[--i];
+ }
+ if (lastElement === null || lastElement.start > commentWS.start) {
+ setInnerComments(node, commentWS.comments);
+ } else {
+ setTrailingComments(lastElement, commentWS.comments);
+ }
+}
+class CommentsParser extends BaseParser {
+ addComment(comment) {
+ if (this.filename) comment.loc.filename = this.filename;
+ const {
+ commentsLen
+ } = this.state;
+ if (this.comments.length !== commentsLen) {
+ this.comments.length = commentsLen;
+ }
+ this.comments.push(comment);
+ this.state.commentsLen++;
+ }
+ processComment(node) {
+ const {
+ commentStack
+ } = this.state;
+ const commentStackLength = commentStack.length;
+ if (commentStackLength === 0) return;
+ let i = commentStackLength - 1;
+ const lastCommentWS = commentStack[i];
+ if (lastCommentWS.start === node.end) {
+ lastCommentWS.leadingNode = node;
+ i--;
+ }
+ const {
+ start: nodeStart
+ } = node;
+ for (; i >= 0; i--) {
+ const commentWS = commentStack[i];
+ const commentEnd = commentWS.end;
+ if (commentEnd > nodeStart) {
+ commentWS.containingNode = node;
+ this.finalizeComment(commentWS);
+ commentStack.splice(i, 1);
+ } else {
+ if (commentEnd === nodeStart) {
+ commentWS.trailingNode = node;
+ }
+ break;
+ }
+ }
+ }
+ finalizeComment(commentWS) {
+ const {
+ comments
+ } = commentWS;
+ if (commentWS.leadingNode !== null || commentWS.trailingNode !== null) {
+ if (commentWS.leadingNode !== null) {
+ setTrailingComments(commentWS.leadingNode, comments);
+ }
+ if (commentWS.trailingNode !== null) {
+ setLeadingComments(commentWS.trailingNode, comments);
+ }
+ } else {
+ const {
+ containingNode: node,
+ start: commentStart
+ } = commentWS;
+ if (this.input.charCodeAt(commentStart - 1) === 44) {
+ switch (node.type) {
+ case "ObjectExpression":
+ case "ObjectPattern":
+ case "RecordExpression":
+ adjustInnerComments(node, node.properties, commentWS);
+ break;
+ case "CallExpression":
+ case "OptionalCallExpression":
+ adjustInnerComments(node, node.arguments, commentWS);
+ break;
+ case "FunctionDeclaration":
+ case "FunctionExpression":
+ case "ArrowFunctionExpression":
+ case "ObjectMethod":
+ case "ClassMethod":
+ case "ClassPrivateMethod":
+ adjustInnerComments(node, node.params, commentWS);
+ break;
+ case "ArrayExpression":
+ case "ArrayPattern":
+ case "TupleExpression":
+ adjustInnerComments(node, node.elements, commentWS);
+ break;
+ case "ExportNamedDeclaration":
+ case "ImportDeclaration":
+ adjustInnerComments(node, node.specifiers, commentWS);
+ break;
+ default:
+ {
+ setInnerComments(node, comments);
+ }
+ }
+ } else {
+ setInnerComments(node, comments);
+ }
+ }
+ }
+ finalizeRemainingComments() {
+ const {
+ commentStack
+ } = this.state;
+ for (let i = commentStack.length - 1; i >= 0; i--) {
+ this.finalizeComment(commentStack[i]);
+ }
+ this.state.commentStack = [];
+ }
+ resetPreviousNodeTrailingComments(node) {
+ const {
+ commentStack
+ } = this.state;
+ const {
+ length
+ } = commentStack;
+ if (length === 0) return;
+ const commentWS = commentStack[length - 1];
+ if (commentWS.leadingNode === node) {
+ commentWS.leadingNode = null;
+ }
+ }
+ resetPreviousIdentifierLeadingComments(node) {
+ const {
+ commentStack
+ } = this.state;
+ const {
+ length
+ } = commentStack;
+ if (length === 0) return;
+ if (commentStack[length - 1].trailingNode === node) {
+ commentStack[length - 1].trailingNode = null;
+ } else if (length >= 2 && commentStack[length - 2].trailingNode === node) {
+ commentStack[length - 2].trailingNode = null;
+ }
+ }
+ takeSurroundingComments(node, start, end) {
+ const {
+ commentStack
+ } = this.state;
+ const commentStackLength = commentStack.length;
+ if (commentStackLength === 0) return;
+ let i = commentStackLength - 1;
+ for (; i >= 0; i--) {
+ const commentWS = commentStack[i];
+ const commentEnd = commentWS.end;
+ const commentStart = commentWS.start;
+ if (commentStart === end) {
+ commentWS.leadingNode = node;
+ } else if (commentEnd === start) {
+ commentWS.trailingNode = node;
+ } else if (commentEnd < start) {
+ break;
+ }
+ }
+ }
+}
+const lineBreak = /\r\n|[\r\n\u2028\u2029]/;
+const lineBreakG = new RegExp(lineBreak.source, "g");
+function isNewLine(code) {
+ switch (code) {
+ case 10:
+ case 13:
+ case 8232:
+ case 8233:
+ return true;
+ default:
+ return false;
+ }
+}
+function hasNewLine(input, start, end) {
+ for (let i = start; i < end; i++) {
+ if (isNewLine(input.charCodeAt(i))) {
+ return true;
+ }
+ }
+ return false;
+}
+const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
+const skipWhiteSpaceInLine = /(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;
+function isWhitespace(code) {
+ switch (code) {
+ case 0x0009:
+ case 0x000b:
+ case 0x000c:
+ case 32:
+ case 160:
+ case 5760:
+ case 0x2000:
+ case 0x2001:
+ case 0x2002:
+ case 0x2003:
+ case 0x2004:
+ case 0x2005:
+ case 0x2006:
+ case 0x2007:
+ case 0x2008:
+ case 0x2009:
+ case 0x200a:
+ case 0x202f:
+ case 0x205f:
+ case 0x3000:
+ case 0xfeff:
+ return true;
+ default:
+ return false;
+ }
+}
+class State {
+ constructor() {
+ 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 = {
+ maxNumOfResolvableTopics: 0,
+ maxTopicIndex: null
+ };
+ this.labels = [];
+ this.commentsLen = 0;
+ this.commentStack = [];
+ this.pos = 0;
+ this.type = 139;
+ this.value = null;
+ this.start = 0;
+ this.end = 0;
+ this.lastTokEndLoc = null;
+ this.lastTokStartLoc = null;
+ this.context = [types.brace];
+ this.firstInvalidTemplateEscapePos = null;
+ this.strictErrors = new Map();
+ this.tokensLength = 0;
+ }
+ get strict() {
+ return (this.flags & 1) > 0;
+ }
+ set strict(v) {
+ if (v) this.flags |= 1;else this.flags &= -2;
+ }
+ init({
+ strictMode,
+ sourceType,
+ startLine,
+ startColumn
+ }) {
+ this.strict = strictMode === false ? false : strictMode === true ? true : sourceType === "module";
+ this.curLine = startLine;
+ this.lineStart = -startColumn;
+ this.startLoc = this.endLoc = new Position(startLine, startColumn, 0);
+ }
+ get maybeInArrowParameters() {
+ return (this.flags & 2) > 0;
+ }
+ set maybeInArrowParameters(v) {
+ if (v) this.flags |= 2;else this.flags &= -3;
+ }
+ get inType() {
+ return (this.flags & 4) > 0;
+ }
+ set inType(v) {
+ if (v) this.flags |= 4;else this.flags &= -5;
+ }
+ get noAnonFunctionType() {
+ return (this.flags & 8) > 0;
+ }
+ set noAnonFunctionType(v) {
+ if (v) this.flags |= 8;else this.flags &= -9;
+ }
+ get hasFlowComment() {
+ return (this.flags & 16) > 0;
+ }
+ set hasFlowComment(v) {
+ if (v) this.flags |= 16;else this.flags &= -17;
+ }
+ get isAmbientContext() {
+ return (this.flags & 32) > 0;
+ }
+ set isAmbientContext(v) {
+ if (v) this.flags |= 32;else this.flags &= -33;
+ }
+ get inAbstractClass() {
+ return (this.flags & 64) > 0;
+ }
+ set inAbstractClass(v) {
+ if (v) this.flags |= 64;else this.flags &= -65;
+ }
+ get inDisallowConditionalTypesContext() {
+ return (this.flags & 128) > 0;
+ }
+ set inDisallowConditionalTypesContext(v) {
+ if (v) this.flags |= 128;else this.flags &= -129;
+ }
+ get soloAwait() {
+ return (this.flags & 256) > 0;
+ }
+ set soloAwait(v) {
+ if (v) this.flags |= 256;else this.flags &= -257;
+ }
+ get inFSharpPipelineDirectBody() {
+ return (this.flags & 512) > 0;
+ }
+ set inFSharpPipelineDirectBody(v) {
+ if (v) this.flags |= 512;else this.flags &= -513;
+ }
+ get canStartJSXElement() {
+ return (this.flags & 1024) > 0;
+ }
+ set canStartJSXElement(v) {
+ if (v) this.flags |= 1024;else this.flags &= -1025;
+ }
+ get containsEsc() {
+ return (this.flags & 2048) > 0;
+ }
+ set containsEsc(v) {
+ if (v) this.flags |= 2048;else this.flags &= -2049;
+ }
+ get hasTopLevelAwait() {
+ return (this.flags & 4096) > 0;
+ }
+ set hasTopLevelAwait(v) {
+ if (v) this.flags |= 4096;else this.flags &= -4097;
+ }
+ curPosition() {
+ return new Position(this.curLine, this.pos - this.lineStart, this.pos);
+ }
+ clone() {
+ const state = new State();
+ 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;
+ return state;
+ }
+}
+var _isDigit = function isDigit(code) {
+ return code >= 48 && code <= 57;
+};
+const forbiddenNumericSeparatorSiblings = {
+ decBinOct: new Set([46, 66, 69, 79, 95, 98, 101, 111]),
+ hex: new Set([46, 88, 95, 120])
+};
+const isAllowedNumericSeparatorSibling = {
+ bin: ch => ch === 48 || ch === 49,
+ oct: ch => ch >= 48 && ch <= 55,
+ dec: ch => ch >= 48 && ch <= 57,
+ hex: ch => ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102
+};
+function readStringContents(type, input, pos, lineStart, curLine, errors) {
+ const initialPos = pos;
+ const initialLineStart = lineStart;
+ const initialCurLine = curLine;
+ let out = "";
+ let firstInvalidLoc = null;
+ let chunkStart = pos;
+ const {
+ length
+ } = input;
+ for (;;) {
+ if (pos >= length) {
+ errors.unterminated(initialPos, initialLineStart, initialCurLine);
+ out += input.slice(chunkStart, pos);
+ break;
+ }
+ const ch = input.charCodeAt(pos);
+ if (isStringEnd(type, ch, input, pos)) {
+ out += input.slice(chunkStart, pos);
+ break;
+ }
+ if (ch === 92) {
+ out += input.slice(chunkStart, pos);
+ const res = readEscapedChar(input, pos, lineStart, curLine, type === "template", errors);
+ if (res.ch === null && !firstInvalidLoc) {
+ firstInvalidLoc = {
+ pos,
+ lineStart,
+ curLine
+ };
+ } else {
+ out += res.ch;
+ }
+ ({
+ pos,
+ lineStart,
+ curLine
+ } = res);
+ chunkStart = pos;
+ } else if (ch === 8232 || ch === 8233) {
+ ++pos;
+ ++curLine;
+ lineStart = pos;
+ } else if (ch === 10 || ch === 13) {
+ if (type === "template") {
+ out += input.slice(chunkStart, pos) + "\n";
+ ++pos;
+ if (ch === 13 && input.charCodeAt(pos) === 10) {
+ ++pos;
+ }
+ ++curLine;
+ chunkStart = lineStart = pos;
+ } else {
+ errors.unterminated(initialPos, initialLineStart, initialCurLine);
+ }
+ } else {
+ ++pos;
+ }
+ }
+ return {
+ pos,
+ str: out,
+ firstInvalidLoc,
+ lineStart,
+ curLine,
+ containsInvalid: !!firstInvalidLoc
+ };
+}
+function isStringEnd(type, ch, input, pos) {
+ if (type === "template") {
+ return ch === 96 || ch === 36 && input.charCodeAt(pos + 1) === 123;
+ }
+ return ch === (type === "double" ? 34 : 39);
+}
+function readEscapedChar(input, pos, lineStart, curLine, inTemplate, errors) {
+ const throwOnInvalid = !inTemplate;
+ pos++;
+ const res = ch => ({
+ pos,
+ ch,
+ lineStart,
+ curLine
+ });
+ const ch = input.charCodeAt(pos++);
+ switch (ch) {
+ case 110:
+ return res("\n");
+ case 114:
+ return res("\r");
+ case 120:
+ {
+ let code;
+ ({
+ code,
+ pos
+ } = readHexChar(input, pos, lineStart, curLine, 2, false, throwOnInvalid, errors));
+ return res(code === null ? null : String.fromCharCode(code));
+ }
+ case 117:
+ {
+ let code;
+ ({
+ code,
+ pos
+ } = readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors));
+ return res(code === null ? null : String.fromCodePoint(code));
+ }
+ case 116:
+ return res("\t");
+ case 98:
+ return res("\b");
+ case 118:
+ return res("\u000b");
+ case 102:
+ return res("\f");
+ case 13:
+ if (input.charCodeAt(pos) === 10) {
+ ++pos;
+ }
+ case 10:
+ lineStart = pos;
+ ++curLine;
+ case 8232:
+ case 8233:
+ return res("");
+ case 56:
+ case 57:
+ if (inTemplate) {
+ return res(null);
+ } else {
+ errors.strictNumericEscape(pos - 1, lineStart, curLine);
+ }
+ default:
+ if (ch >= 48 && ch <= 55) {
+ const startPos = pos - 1;
+ const match = /^[0-7]+/.exec(input.slice(startPos, pos + 2));
+ let octalStr = match[0];
+ let octal = parseInt(octalStr, 8);
+ if (octal > 255) {
+ octalStr = octalStr.slice(0, -1);
+ octal = parseInt(octalStr, 8);
+ }
+ pos += octalStr.length - 1;
+ const next = input.charCodeAt(pos);
+ if (octalStr !== "0" || next === 56 || next === 57) {
+ if (inTemplate) {
+ return res(null);
+ } else {
+ errors.strictNumericEscape(startPos, lineStart, curLine);
+ }
+ }
+ return res(String.fromCharCode(octal));
+ }
+ return res(String.fromCharCode(ch));
+ }
+}
+function readHexChar(input, pos, lineStart, curLine, len, forceLen, throwOnInvalid, errors) {
+ const initialPos = pos;
+ let n;
+ ({
+ n,
+ pos
+ } = readInt(input, pos, lineStart, curLine, 16, len, forceLen, false, errors, !throwOnInvalid));
+ if (n === null) {
+ if (throwOnInvalid) {
+ errors.invalidEscapeSequence(initialPos, lineStart, curLine);
+ } else {
+ pos = initialPos - 1;
+ }
+ }
+ return {
+ code: n,
+ pos
+ };
+}
+function readInt(input, pos, lineStart, curLine, radix, len, forceLen, allowNumSeparator, errors, bailOnError) {
+ const start = pos;
+ const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct;
+ const isAllowedSibling = radix === 16 ? isAllowedNumericSeparatorSibling.hex : radix === 10 ? isAllowedNumericSeparatorSibling.dec : radix === 8 ? isAllowedNumericSeparatorSibling.oct : isAllowedNumericSeparatorSibling.bin;
+ let invalid = false;
+ let total = 0;
+ for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {
+ const code = input.charCodeAt(pos);
+ let val;
+ if (code === 95 && allowNumSeparator !== "bail") {
+ const prev = input.charCodeAt(pos - 1);
+ const next = input.charCodeAt(pos + 1);
+ if (!allowNumSeparator) {
+ if (bailOnError) return {
+ n: null,
+ pos
+ };
+ errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine);
+ } else if (Number.isNaN(next) || !isAllowedSibling(next) || forbiddenSiblings.has(prev) || forbiddenSiblings.has(next)) {
+ if (bailOnError) return {
+ n: null,
+ pos
+ };
+ errors.unexpectedNumericSeparator(pos, lineStart, curLine);
+ }
+ ++pos;
+ continue;
+ }
+ if (code >= 97) {
+ val = code - 97 + 10;
+ } else if (code >= 65) {
+ val = code - 65 + 10;
+ } else if (_isDigit(code)) {
+ val = code - 48;
+ } else {
+ val = Infinity;
+ }
+ if (val >= radix) {
+ if (val <= 9 && bailOnError) {
+ return {
+ n: null,
+ pos
+ };
+ } else if (val <= 9 && errors.invalidDigit(pos, lineStart, curLine, radix)) {
+ val = 0;
+ } else if (forceLen) {
+ val = 0;
+ invalid = true;
+ } else {
+ break;
+ }
+ }
+ ++pos;
+ total = total * radix + val;
+ }
+ if (pos === start || len != null && pos - start !== len || invalid) {
+ return {
+ n: null,
+ pos
+ };
+ }
+ return {
+ n: total,
+ pos
+ };
+}
+function readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors) {
+ const ch = input.charCodeAt(pos);
+ let code;
+ if (ch === 123) {
+ ++pos;
+ ({
+ code,
+ pos
+ } = readHexChar(input, pos, lineStart, curLine, input.indexOf("}", pos) - pos, true, throwOnInvalid, errors));
+ ++pos;
+ if (code !== null && code > 0x10ffff) {
+ if (throwOnInvalid) {
+ errors.invalidCodePoint(pos, lineStart, curLine);
+ } else {
+ return {
+ code: null,
+ pos
+ };
+ }
+ }
+ } else {
+ ({
+ code,
+ pos
+ } = readHexChar(input, pos, lineStart, curLine, 4, false, throwOnInvalid, errors));
+ }
+ return {
+ code,
+ pos
+ };
+}
+function buildPosition(pos, lineStart, curLine) {
+ return new Position(curLine, pos - lineStart, pos);
+}
+const VALID_REGEX_FLAGS = new Set([103, 109, 115, 105, 121, 117, 100, 118]);
+class Token {
+ constructor(state) {
+ this.type = state.type;
+ this.value = state.value;
+ this.start = state.start;
+ this.end = state.end;
+ this.loc = new SourceLocation(state.startLoc, state.endLoc);
+ }
+}
+class Tokenizer extends CommentsParser {
+ constructor(options, input) {
+ super();
+ this.isLookahead = void 0;
+ this.tokens = [];
+ this.errorHandlers_readInt = {
+ invalidDigit: (pos, lineStart, curLine, radix) => {
+ if (!this.options.errorRecovery) return false;
+ this.raise(Errors.InvalidDigit, buildPosition(pos, lineStart, curLine), {
+ radix
+ });
+ return true;
+ },
+ numericSeparatorInEscapeSequence: this.errorBuilder(Errors.NumericSeparatorInEscapeSequence),
+ unexpectedNumericSeparator: this.errorBuilder(Errors.UnexpectedNumericSeparator)
+ };
+ this.errorHandlers_readCodePoint = Object.assign({}, this.errorHandlers_readInt, {
+ invalidEscapeSequence: this.errorBuilder(Errors.InvalidEscapeSequence),
+ invalidCodePoint: this.errorBuilder(Errors.InvalidCodePoint)
+ });
+ this.errorHandlers_readStringContents_string = Object.assign({}, this.errorHandlers_readCodePoint, {
+ strictNumericEscape: (pos, lineStart, curLine) => {
+ this.recordStrictModeErrors(Errors.StrictNumericEscape, buildPosition(pos, lineStart, curLine));
+ },
+ unterminated: (pos, lineStart, curLine) => {
+ throw this.raise(Errors.UnterminatedString, buildPosition(pos - 1, lineStart, curLine));
+ }
+ });
+ this.errorHandlers_readStringContents_template = Object.assign({}, this.errorHandlers_readCodePoint, {
+ strictNumericEscape: this.errorBuilder(Errors.StrictNumericEscape),
+ unterminated: (pos, lineStart, curLine) => {
+ throw this.raise(Errors.UnterminatedTemplate, buildPosition(pos, lineStart, curLine));
+ }
+ });
+ this.state = new State();
+ this.state.init(options);
+ this.input = input;
+ this.length = input.length;
+ this.comments = [];
+ this.isLookahead = false;
+ }
+ pushToken(token) {
+ this.tokens.length = this.state.tokensLength;
+ this.tokens.push(token);
+ ++this.state.tokensLength;
+ }
+ next() {
+ this.checkKeywordEscapes();
+ if (this.options.tokens) {
+ this.pushToken(new Token(this.state));
+ }
+ this.state.lastTokEndLoc = this.state.endLoc;
+ this.state.lastTokStartLoc = this.state.startLoc;
+ this.nextToken();
+ }
+ eat(type) {
+ if (this.match(type)) {
+ this.next();
+ return true;
+ } else {
+ return false;
+ }
+ }
+ match(type) {
+ return this.state.type === type;
+ }
+ createLookaheadState(state) {
+ return {
+ pos: state.pos,
+ value: null,
+ type: state.type,
+ start: state.start,
+ end: state.end,
+ context: [this.curContext()],
+ inType: state.inType,
+ startLoc: state.startLoc,
+ lastTokEndLoc: state.lastTokEndLoc,
+ curLine: state.curLine,
+ lineStart: state.lineStart,
+ curPosition: state.curPosition
+ };
+ }
+ lookahead() {
+ const old = this.state;
+ this.state = this.createLookaheadState(old);
+ this.isLookahead = true;
+ this.nextToken();
+ this.isLookahead = false;
+ const curr = this.state;
+ this.state = old;
+ return curr;
+ }
+ nextTokenStart() {
+ return this.nextTokenStartSince(this.state.pos);
+ }
+ nextTokenStartSince(pos) {
+ skipWhiteSpace.lastIndex = pos;
+ return skipWhiteSpace.test(this.input) ? skipWhiteSpace.lastIndex : pos;
+ }
+ lookaheadCharCode() {
+ return this.input.charCodeAt(this.nextTokenStart());
+ }
+ nextTokenInLineStart() {
+ return this.nextTokenInLineStartSince(this.state.pos);
+ }
+ nextTokenInLineStartSince(pos) {
+ skipWhiteSpaceInLine.lastIndex = pos;
+ return skipWhiteSpaceInLine.test(this.input) ? skipWhiteSpaceInLine.lastIndex : pos;
+ }
+ lookaheadInLineCharCode() {
+ return this.input.charCodeAt(this.nextTokenInLineStart());
+ }
+ codePointAtPos(pos) {
+ let cp = this.input.charCodeAt(pos);
+ if ((cp & 0xfc00) === 0xd800 && ++pos < this.input.length) {
+ const trail = this.input.charCodeAt(pos);
+ if ((trail & 0xfc00) === 0xdc00) {
+ cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);
+ }
+ }
+ return cp;
+ }
+ setStrict(strict) {
+ this.state.strict = strict;
+ if (strict) {
+ this.state.strictErrors.forEach(([toParseError, at]) => this.raise(toParseError, at));
+ this.state.strictErrors.clear();
+ }
+ }
+ curContext() {
+ return this.state.context[this.state.context.length - 1];
+ }
+ nextToken() {
+ this.skipSpace();
+ this.state.start = this.state.pos;
+ if (!this.isLookahead) this.state.startLoc = this.state.curPosition();
+ if (this.state.pos >= this.length) {
+ this.finishToken(139);
+ return;
+ }
+ this.getTokenFromCode(this.codePointAtPos(this.state.pos));
+ }
+ skipBlockComment(commentEnd) {
+ let startLoc;
+ if (!this.isLookahead) startLoc = this.state.curPosition();
+ const start = this.state.pos;
+ const end = this.input.indexOf(commentEnd, start + 2);
+ if (end === -1) {
+ throw this.raise(Errors.UnterminatedComment, this.state.curPosition());
+ }
+ this.state.pos = end + commentEnd.length;
+ lineBreakG.lastIndex = start + 2;
+ while (lineBreakG.test(this.input) && lineBreakG.lastIndex <= end) {
+ ++this.state.curLine;
+ this.state.lineStart = lineBreakG.lastIndex;
+ }
+ if (this.isLookahead) return;
+ const comment = {
+ type: "CommentBlock",
+ value: this.input.slice(start + 2, end),
+ start,
+ end: end + commentEnd.length,
+ loc: new SourceLocation(startLoc, this.state.curPosition())
+ };
+ if (this.options.tokens) this.pushToken(comment);
+ return comment;
+ }
+ skipLineComment(startSkip) {
+ const start = this.state.pos;
+ let startLoc;
+ if (!this.isLookahead) startLoc = this.state.curPosition();
+ let ch = this.input.charCodeAt(this.state.pos += startSkip);
+ if (this.state.pos < this.length) {
+ while (!isNewLine(ch) && ++this.state.pos < this.length) {
+ ch = this.input.charCodeAt(this.state.pos);
+ }
+ }
+ if (this.isLookahead) return;
+ const end = this.state.pos;
+ const value = this.input.slice(start + startSkip, end);
+ const comment = {
+ type: "CommentLine",
+ value,
+ start,
+ end,
+ loc: new SourceLocation(startLoc, this.state.curPosition())
+ };
+ if (this.options.tokens) this.pushToken(comment);
+ return comment;
+ }
+ skipSpace() {
+ const spaceStart = this.state.pos;
+ const comments = [];
+ loop: while (this.state.pos < this.length) {
+ const ch = this.input.charCodeAt(this.state.pos);
+ switch (ch) {
+ case 32:
+ case 160:
+ case 9:
+ ++this.state.pos;
+ break;
+ case 13:
+ if (this.input.charCodeAt(this.state.pos + 1) === 10) {
+ ++this.state.pos;
+ }
+ case 10:
+ case 8232:
+ case 8233:
+ ++this.state.pos;
+ ++this.state.curLine;
+ this.state.lineStart = this.state.pos;
+ break;
+ case 47:
+ switch (this.input.charCodeAt(this.state.pos + 1)) {
+ case 42:
+ {
+ const comment = this.skipBlockComment("*/");
+ if (comment !== undefined) {
+ this.addComment(comment);
+ if (this.options.attachComment) comments.push(comment);
+ }
+ break;
+ }
+ case 47:
+ {
+ const comment = this.skipLineComment(2);
+ if (comment !== undefined) {
+ this.addComment(comment);
+ if (this.options.attachComment) comments.push(comment);
+ }
+ break;
+ }
+ default:
+ break loop;
+ }
+ break;
+ default:
+ if (isWhitespace(ch)) {
+ ++this.state.pos;
+ } else if (ch === 45 && !this.inModule && this.options.annexB) {
+ const pos = this.state.pos;
+ if (this.input.charCodeAt(pos + 1) === 45 && this.input.charCodeAt(pos + 2) === 62 && (spaceStart === 0 || this.state.lineStart > spaceStart)) {
+ const comment = this.skipLineComment(3);
+ if (comment !== undefined) {
+ this.addComment(comment);
+ if (this.options.attachComment) comments.push(comment);
+ }
+ } else {
+ break loop;
+ }
+ } else if (ch === 60 && !this.inModule && this.options.annexB) {
+ const pos = this.state.pos;
+ if (this.input.charCodeAt(pos + 1) === 33 && this.input.charCodeAt(pos + 2) === 45 && this.input.charCodeAt(pos + 3) === 45) {
+ const comment = this.skipLineComment(4);
+ if (comment !== undefined) {
+ this.addComment(comment);
+ if (this.options.attachComment) comments.push(comment);
+ }
+ } else {
+ break loop;
+ }
+ } else {
+ break loop;
+ }
+ }
+ }
+ if (comments.length > 0) {
+ const end = this.state.pos;
+ const commentWhitespace = {
+ start: spaceStart,
+ end,
+ comments,
+ leadingNode: null,
+ trailingNode: null,
+ containingNode: null
+ };
+ this.state.commentStack.push(commentWhitespace);
+ }
+ }
+ finishToken(type, val) {
+ this.state.end = this.state.pos;
+ this.state.endLoc = this.state.curPosition();
+ const prevType = this.state.type;
+ this.state.type = type;
+ this.state.value = val;
+ if (!this.isLookahead) {
+ this.updateContext(prevType);
+ }
+ }
+ replaceToken(type) {
+ this.state.type = type;
+ this.updateContext();
+ }
+ readToken_numberSign() {
+ if (this.state.pos === 0 && this.readToken_interpreter()) {
+ return;
+ }
+ const nextPos = this.state.pos + 1;
+ const next = this.codePointAtPos(nextPos);
+ if (next >= 48 && next <= 57) {
+ throw this.raise(Errors.UnexpectedDigitAfterHash, this.state.curPosition());
+ }
+ if (next === 123 || next === 91 && this.hasPlugin("recordAndTuple")) {
+ this.expectPlugin("recordAndTuple");
+ if (this.getPluginOption("recordAndTuple", "syntaxType") === "bar") {
+ throw this.raise(next === 123 ? Errors.RecordExpressionHashIncorrectStartSyntaxType : Errors.TupleExpressionHashIncorrectStartSyntaxType, this.state.curPosition());
+ }
+ this.state.pos += 2;
+ if (next === 123) {
+ this.finishToken(7);
+ } else {
+ this.finishToken(1);
+ }
+ } else if (isIdentifierStart(next)) {
+ ++this.state.pos;
+ this.finishToken(138, this.readWord1(next));
+ } else if (next === 92) {
+ ++this.state.pos;
+ this.finishToken(138, this.readWord1());
+ } else {
+ this.finishOp(27, 1);
+ }
+ }
+ readToken_dot() {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+ if (next >= 48 && next <= 57) {
+ this.readNumber(true);
+ return;
+ }
+ if (next === 46 && this.input.charCodeAt(this.state.pos + 2) === 46) {
+ this.state.pos += 3;
+ this.finishToken(21);
+ } else {
+ ++this.state.pos;
+ this.finishToken(16);
+ }
+ }
+ readToken_slash() {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+ if (next === 61) {
+ this.finishOp(31, 2);
+ } else {
+ this.finishOp(56, 1);
+ }
+ }
+ readToken_interpreter() {
+ if (this.state.pos !== 0 || this.length < 2) return false;
+ let ch = this.input.charCodeAt(this.state.pos + 1);
+ if (ch !== 33) return false;
+ const start = this.state.pos;
+ this.state.pos += 1;
+ while (!isNewLine(ch) && ++this.state.pos < this.length) {
+ ch = this.input.charCodeAt(this.state.pos);
+ }
+ const value = this.input.slice(start + 2, this.state.pos);
+ this.finishToken(28, value);
+ return true;
+ }
+ readToken_mult_modulo(code) {
+ let type = code === 42 ? 55 : 54;
+ let width = 1;
+ let next = this.input.charCodeAt(this.state.pos + 1);
+ if (code === 42 && next === 42) {
+ width++;
+ next = this.input.charCodeAt(this.state.pos + 2);
+ type = 57;
+ }
+ if (next === 61 && !this.state.inType) {
+ width++;
+ type = code === 37 ? 33 : 30;
+ }
+ this.finishOp(type, width);
+ }
+ readToken_pipe_amp(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+ if (next === code) {
+ if (this.input.charCodeAt(this.state.pos + 2) === 61) {
+ this.finishOp(30, 3);
+ } else {
+ this.finishOp(code === 124 ? 41 : 42, 2);
+ }
+ return;
+ }
+ if (code === 124) {
+ if (next === 62) {
+ this.finishOp(39, 2);
+ return;
+ }
+ if (this.hasPlugin("recordAndTuple") && next === 125) {
+ if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
+ throw this.raise(Errors.RecordExpressionBarIncorrectEndSyntaxType, this.state.curPosition());
+ }
+ this.state.pos += 2;
+ this.finishToken(9);
+ return;
+ }
+ if (this.hasPlugin("recordAndTuple") && next === 93) {
+ if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
+ throw this.raise(Errors.TupleExpressionBarIncorrectEndSyntaxType, this.state.curPosition());
+ }
+ this.state.pos += 2;
+ this.finishToken(4);
+ return;
+ }
+ }
+ if (next === 61) {
+ this.finishOp(30, 2);
+ return;
+ }
+ this.finishOp(code === 124 ? 43 : 45, 1);
+ }
+ readToken_caret() {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+ if (next === 61 && !this.state.inType) {
+ this.finishOp(32, 2);
+ } else if (next === 94 && this.hasPlugin(["pipelineOperator", {
+ proposal: "hack",
+ topicToken: "^^"
+ }])) {
+ this.finishOp(37, 2);
+ const lookaheadCh = this.input.codePointAt(this.state.pos);
+ if (lookaheadCh === 94) {
+ this.unexpected();
+ }
+ } else {
+ this.finishOp(44, 1);
+ }
+ }
+ readToken_atSign() {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+ if (next === 64 && this.hasPlugin(["pipelineOperator", {
+ proposal: "hack",
+ topicToken: "@@"
+ }])) {
+ this.finishOp(38, 2);
+ } else {
+ this.finishOp(26, 1);
+ }
+ }
+ readToken_plus_min(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+ if (next === code) {
+ this.finishOp(34, 2);
+ return;
+ }
+ if (next === 61) {
+ this.finishOp(30, 2);
+ } else {
+ this.finishOp(53, 1);
+ }
+ }
+ readToken_lt() {
+ const {
+ pos
+ } = this.state;
+ const next = this.input.charCodeAt(pos + 1);
+ if (next === 60) {
+ if (this.input.charCodeAt(pos + 2) === 61) {
+ this.finishOp(30, 3);
+ return;
+ }
+ this.finishOp(51, 2);
+ return;
+ }
+ if (next === 61) {
+ this.finishOp(49, 2);
+ return;
+ }
+ this.finishOp(47, 1);
+ }
+ readToken_gt() {
+ const {
+ pos
+ } = this.state;
+ const next = this.input.charCodeAt(pos + 1);
+ if (next === 62) {
+ const size = this.input.charCodeAt(pos + 2) === 62 ? 3 : 2;
+ if (this.input.charCodeAt(pos + size) === 61) {
+ this.finishOp(30, size + 1);
+ return;
+ }
+ this.finishOp(52, size);
+ return;
+ }
+ if (next === 61) {
+ this.finishOp(49, 2);
+ return;
+ }
+ this.finishOp(48, 1);
+ }
+ readToken_eq_excl(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+ if (next === 61) {
+ this.finishOp(46, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2);
+ return;
+ }
+ if (code === 61 && next === 62) {
+ this.state.pos += 2;
+ this.finishToken(19);
+ return;
+ }
+ this.finishOp(code === 61 ? 29 : 35, 1);
+ }
+ readToken_question() {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+ const next2 = this.input.charCodeAt(this.state.pos + 2);
+ if (next === 63) {
+ if (next2 === 61) {
+ this.finishOp(30, 3);
+ } else {
+ this.finishOp(40, 2);
+ }
+ } else if (next === 46 && !(next2 >= 48 && next2 <= 57)) {
+ this.state.pos += 2;
+ this.finishToken(18);
+ } else {
+ ++this.state.pos;
+ this.finishToken(17);
+ }
+ }
+ getTokenFromCode(code) {
+ switch (code) {
+ case 46:
+ this.readToken_dot();
+ return;
+ case 40:
+ ++this.state.pos;
+ this.finishToken(10);
+ return;
+ case 41:
+ ++this.state.pos;
+ this.finishToken(11);
+ return;
+ case 59:
+ ++this.state.pos;
+ this.finishToken(13);
+ return;
+ case 44:
+ ++this.state.pos;
+ this.finishToken(12);
+ return;
+ case 91:
+ if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) {
+ if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
+ throw this.raise(Errors.TupleExpressionBarIncorrectStartSyntaxType, this.state.curPosition());
+ }
+ this.state.pos += 2;
+ this.finishToken(2);
+ } else {
+ ++this.state.pos;
+ this.finishToken(0);
+ }
+ return;
+ case 93:
+ ++this.state.pos;
+ this.finishToken(3);
+ return;
+ case 123:
+ if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) {
+ if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
+ throw this.raise(Errors.RecordExpressionBarIncorrectStartSyntaxType, this.state.curPosition());
+ }
+ this.state.pos += 2;
+ this.finishToken(6);
+ } else {
+ ++this.state.pos;
+ this.finishToken(5);
+ }
+ return;
+ case 125:
+ ++this.state.pos;
+ this.finishToken(8);
+ return;
+ case 58:
+ if (this.hasPlugin("functionBind") && this.input.charCodeAt(this.state.pos + 1) === 58) {
+ this.finishOp(15, 2);
+ } else {
+ ++this.state.pos;
+ this.finishToken(14);
+ }
+ return;
+ case 63:
+ this.readToken_question();
+ return;
+ case 96:
+ this.readTemplateToken();
+ return;
+ case 48:
+ {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+ if (next === 120 || next === 88) {
+ this.readRadixNumber(16);
+ return;
+ }
+ if (next === 111 || next === 79) {
+ this.readRadixNumber(8);
+ return;
+ }
+ if (next === 98 || next === 66) {
+ this.readRadixNumber(2);
+ return;
+ }
+ }
+ case 49:
+ case 50:
+ case 51:
+ case 52:
+ case 53:
+ case 54:
+ case 55:
+ case 56:
+ case 57:
+ this.readNumber(false);
+ return;
+ case 34:
+ case 39:
+ this.readString(code);
+ return;
+ case 47:
+ this.readToken_slash();
+ return;
+ case 37:
+ case 42:
+ this.readToken_mult_modulo(code);
+ return;
+ case 124:
+ case 38:
+ this.readToken_pipe_amp(code);
+ return;
+ case 94:
+ this.readToken_caret();
+ return;
+ case 43:
+ case 45:
+ this.readToken_plus_min(code);
+ return;
+ case 60:
+ this.readToken_lt();
+ return;
+ case 62:
+ this.readToken_gt();
+ return;
+ case 61:
+ case 33:
+ this.readToken_eq_excl(code);
+ return;
+ case 126:
+ this.finishOp(36, 1);
+ return;
+ case 64:
+ this.readToken_atSign();
+ return;
+ case 35:
+ this.readToken_numberSign();
+ return;
+ case 92:
+ this.readWord();
+ return;
+ default:
+ if (isIdentifierStart(code)) {
+ this.readWord(code);
+ return;
+ }
+ }
+ throw this.raise(Errors.InvalidOrUnexpectedToken, this.state.curPosition(), {
+ unexpected: String.fromCodePoint(code)
+ });
+ }
+ finishOp(type, size) {
+ const str = this.input.slice(this.state.pos, this.state.pos + size);
+ this.state.pos += size;
+ this.finishToken(type, str);
+ }
+ readRegexp() {
+ const startLoc = this.state.startLoc;
+ const start = this.state.start + 1;
+ let escaped, inClass;
+ let {
+ pos
+ } = this.state;
+ for (;; ++pos) {
+ if (pos >= this.length) {
+ throw this.raise(Errors.UnterminatedRegExp, createPositionWithColumnOffset(startLoc, 1));
+ }
+ const ch = this.input.charCodeAt(pos);
+ if (isNewLine(ch)) {
+ throw this.raise(Errors.UnterminatedRegExp, createPositionWithColumnOffset(startLoc, 1));
+ }
+ if (escaped) {
+ escaped = false;
+ } else {
+ if (ch === 91) {
+ inClass = true;
+ } else if (ch === 93 && inClass) {
+ inClass = false;
+ } else if (ch === 47 && !inClass) {
+ break;
+ }
+ escaped = ch === 92;
+ }
+ }
+ const content = this.input.slice(start, pos);
+ ++pos;
+ let mods = "";
+ const nextPos = () => createPositionWithColumnOffset(startLoc, pos + 2 - start);
+ while (pos < this.length) {
+ const cp = this.codePointAtPos(pos);
+ const char = String.fromCharCode(cp);
+ if (VALID_REGEX_FLAGS.has(cp)) {
+ if (cp === 118) {
+ if (mods.includes("u")) {
+ this.raise(Errors.IncompatibleRegExpUVFlags, nextPos());
+ }
+ } else if (cp === 117) {
+ if (mods.includes("v")) {
+ this.raise(Errors.IncompatibleRegExpUVFlags, nextPos());
+ }
+ }
+ if (mods.includes(char)) {
+ this.raise(Errors.DuplicateRegExpFlags, nextPos());
+ }
+ } else if (isIdentifierChar(cp) || cp === 92) {
+ this.raise(Errors.MalformedRegExpFlags, nextPos());
+ } else {
+ break;
+ }
+ ++pos;
+ mods += char;
+ }
+ this.state.pos = pos;
+ this.finishToken(137, {
+ pattern: content,
+ flags: mods
+ });
+ }
+ readInt(radix, len, forceLen = false, allowNumSeparator = true) {
+ const {
+ n,
+ pos
+ } = readInt(this.input, this.state.pos, this.state.lineStart, this.state.curLine, radix, len, forceLen, allowNumSeparator, this.errorHandlers_readInt, false);
+ this.state.pos = pos;
+ return n;
+ }
+ readRadixNumber(radix) {
+ const startLoc = this.state.curPosition();
+ let isBigInt = false;
+ this.state.pos += 2;
+ const val = this.readInt(radix);
+ if (val == null) {
+ this.raise(Errors.InvalidDigit, createPositionWithColumnOffset(startLoc, 2), {
+ radix
+ });
+ }
+ const next = this.input.charCodeAt(this.state.pos);
+ if (next === 110) {
+ ++this.state.pos;
+ isBigInt = true;
+ } else if (next === 109) {
+ throw this.raise(Errors.InvalidDecimal, startLoc);
+ }
+ if (isIdentifierStart(this.codePointAtPos(this.state.pos))) {
+ throw this.raise(Errors.NumberIdentifier, this.state.curPosition());
+ }
+ if (isBigInt) {
+ const str = this.input.slice(startLoc.index, this.state.pos).replace(/[_n]/g, "");
+ this.finishToken(135, str);
+ return;
+ }
+ this.finishToken(134, val);
+ }
+ readNumber(startsWithDot) {
+ const start = this.state.pos;
+ const startLoc = this.state.curPosition();
+ let isFloat = false;
+ let isBigInt = false;
+ let isDecimal = false;
+ let hasExponent = false;
+ let isOctal = false;
+ if (!startsWithDot && this.readInt(10) === null) {
+ this.raise(Errors.InvalidNumber, this.state.curPosition());
+ }
+ const hasLeadingZero = this.state.pos - start >= 2 && this.input.charCodeAt(start) === 48;
+ if (hasLeadingZero) {
+ const integer = this.input.slice(start, this.state.pos);
+ this.recordStrictModeErrors(Errors.StrictOctalLiteral, startLoc);
+ if (!this.state.strict) {
+ const underscorePos = integer.indexOf("_");
+ if (underscorePos > 0) {
+ this.raise(Errors.ZeroDigitNumericSeparator, createPositionWithColumnOffset(startLoc, underscorePos));
+ }
+ }
+ isOctal = hasLeadingZero && !/[89]/.test(integer);
+ }
+ let next = this.input.charCodeAt(this.state.pos);
+ if (next === 46 && !isOctal) {
+ ++this.state.pos;
+ this.readInt(10);
+ isFloat = true;
+ next = this.input.charCodeAt(this.state.pos);
+ }
+ if ((next === 69 || next === 101) && !isOctal) {
+ next = this.input.charCodeAt(++this.state.pos);
+ if (next === 43 || next === 45) {
+ ++this.state.pos;
+ }
+ if (this.readInt(10) === null) {
+ this.raise(Errors.InvalidOrMissingExponent, startLoc);
+ }
+ isFloat = true;
+ hasExponent = true;
+ next = this.input.charCodeAt(this.state.pos);
+ }
+ if (next === 110) {
+ if (isFloat || hasLeadingZero) {
+ this.raise(Errors.InvalidBigIntLiteral, startLoc);
+ }
+ ++this.state.pos;
+ isBigInt = true;
+ }
+ if (next === 109) {
+ this.expectPlugin("decimal", this.state.curPosition());
+ if (hasExponent || hasLeadingZero) {
+ this.raise(Errors.InvalidDecimal, startLoc);
+ }
+ ++this.state.pos;
+ isDecimal = true;
+ }
+ if (isIdentifierStart(this.codePointAtPos(this.state.pos))) {
+ throw this.raise(Errors.NumberIdentifier, this.state.curPosition());
+ }
+ const str = this.input.slice(start, this.state.pos).replace(/[_mn]/g, "");
+ if (isBigInt) {
+ this.finishToken(135, str);
+ return;
+ }
+ if (isDecimal) {
+ this.finishToken(136, str);
+ return;
+ }
+ const val = isOctal ? parseInt(str, 8) : parseFloat(str);
+ this.finishToken(134, val);
+ }
+ readCodePoint(throwOnInvalid) {
+ const {
+ code,
+ pos
+ } = readCodePoint(this.input, this.state.pos, this.state.lineStart, this.state.curLine, throwOnInvalid, this.errorHandlers_readCodePoint);
+ this.state.pos = pos;
+ return code;
+ }
+ readString(quote) {
+ const {
+ str,
+ pos,
+ curLine,
+ lineStart
+ } = readStringContents(quote === 34 ? "double" : "single", this.input, this.state.pos + 1, this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_string);
+ this.state.pos = pos + 1;
+ this.state.lineStart = lineStart;
+ this.state.curLine = curLine;
+ this.finishToken(133, str);
+ }
+ readTemplateContinuation() {
+ if (!this.match(8)) {
+ this.unexpected(null, 8);
+ }
+ this.state.pos--;
+ this.readTemplateToken();
+ }
+ readTemplateToken() {
+ const opening = this.input[this.state.pos];
+ const {
+ str,
+ firstInvalidLoc,
+ pos,
+ curLine,
+ lineStart
+ } = readStringContents("template", this.input, this.state.pos + 1, this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_template);
+ this.state.pos = pos + 1;
+ this.state.lineStart = lineStart;
+ this.state.curLine = curLine;
+ if (firstInvalidLoc) {
+ this.state.firstInvalidTemplateEscapePos = new Position(firstInvalidLoc.curLine, firstInvalidLoc.pos - firstInvalidLoc.lineStart, firstInvalidLoc.pos);
+ }
+ if (this.input.codePointAt(pos) === 96) {
+ this.finishToken(24, firstInvalidLoc ? null : opening + str + "`");
+ } else {
+ this.state.pos++;
+ this.finishToken(25, firstInvalidLoc ? null : opening + str + "${");
+ }
+ }
+ recordStrictModeErrors(toParseError, at) {
+ const index = at.index;
+ if (this.state.strict && !this.state.strictErrors.has(index)) {
+ this.raise(toParseError, at);
+ } else {
+ this.state.strictErrors.set(index, [toParseError, at]);
+ }
+ }
+ readWord1(firstCode) {
+ this.state.containsEsc = false;
+ let word = "";
+ const start = this.state.pos;
+ let chunkStart = this.state.pos;
+ if (firstCode !== undefined) {
+ this.state.pos += firstCode <= 0xffff ? 1 : 2;
+ }
+ while (this.state.pos < this.length) {
+ const ch = this.codePointAtPos(this.state.pos);
+ if (isIdentifierChar(ch)) {
+ this.state.pos += ch <= 0xffff ? 1 : 2;
+ } else if (ch === 92) {
+ this.state.containsEsc = true;
+ word += this.input.slice(chunkStart, this.state.pos);
+ const escStart = this.state.curPosition();
+ const identifierCheck = this.state.pos === start ? isIdentifierStart : isIdentifierChar;
+ if (this.input.charCodeAt(++this.state.pos) !== 117) {
+ this.raise(Errors.MissingUnicodeEscape, this.state.curPosition());
+ chunkStart = this.state.pos - 1;
+ continue;
+ }
+ ++this.state.pos;
+ const esc = this.readCodePoint(true);
+ if (esc !== null) {
+ if (!identifierCheck(esc)) {
+ this.raise(Errors.EscapedCharNotAnIdentifier, escStart);
+ }
+ word += String.fromCodePoint(esc);
+ }
+ chunkStart = this.state.pos;
+ } else {
+ break;
+ }
+ }
+ return word + this.input.slice(chunkStart, this.state.pos);
+ }
+ readWord(firstCode) {
+ const word = this.readWord1(firstCode);
+ const type = keywords$1.get(word);
+ if (type !== undefined) {
+ this.finishToken(type, tokenLabelName(type));
+ } else {
+ this.finishToken(132, word);
+ }
+ }
+ checkKeywordEscapes() {
+ const {
+ type
+ } = this.state;
+ if (tokenIsKeyword(type) && this.state.containsEsc) {
+ this.raise(Errors.InvalidEscapedReservedWord, this.state.startLoc, {
+ reservedWord: tokenLabelName(type)
+ });
+ }
+ }
+ raise(toParseError, at, details = {}) {
+ const loc = at instanceof Position ? at : at.loc.start;
+ const error = toParseError(loc, details);
+ if (!this.options.errorRecovery) throw error;
+ if (!this.isLookahead) this.state.errors.push(error);
+ return error;
+ }
+ raiseOverwrite(toParseError, at, details = {}) {
+ const loc = at instanceof Position ? at : at.loc.start;
+ const pos = loc.index;
+ const errors = this.state.errors;
+ for (let i = errors.length - 1; i >= 0; i--) {
+ const error = errors[i];
+ if (error.loc.index === pos) {
+ return errors[i] = toParseError(loc, details);
+ }
+ if (error.loc.index < pos) break;
+ }
+ return this.raise(toParseError, at, details);
+ }
+ updateContext(prevType) {}
+ unexpected(loc, type) {
+ throw this.raise(Errors.UnexpectedToken, loc != null ? loc : this.state.startLoc, {
+ expected: type ? tokenLabelName(type) : null
+ });
+ }
+ expectPlugin(pluginName, loc) {
+ if (this.hasPlugin(pluginName)) {
+ return true;
+ }
+ throw this.raise(Errors.MissingPlugin, loc != null ? loc : this.state.startLoc, {
+ missingPlugin: [pluginName]
+ });
+ }
+ expectOnePlugin(pluginNames) {
+ if (!pluginNames.some(name => this.hasPlugin(name))) {
+ throw this.raise(Errors.MissingOneOfPlugins, this.state.startLoc, {
+ missingPlugin: pluginNames
+ });
+ }
+ }
+ errorBuilder(error) {
+ return (pos, lineStart, curLine) => {
+ this.raise(error, buildPosition(pos, lineStart, curLine));
+ };
+ }
+}
+class ClassScope {
+ constructor() {
+ this.privateNames = new Set();
+ this.loneAccessors = new Map();
+ this.undefinedPrivateNames = new Map();
+ }
+}
+class ClassScopeHandler {
+ constructor(parser) {
+ this.parser = void 0;
+ this.stack = [];
+ this.undefinedPrivateNames = new Map();
+ this.parser = parser;
+ }
+ current() {
+ return this.stack[this.stack.length - 1];
+ }
+ enter() {
+ this.stack.push(new ClassScope());
+ }
+ exit() {
+ const oldClassScope = this.stack.pop();
+ const current = this.current();
+ for (const [name, loc] of Array.from(oldClassScope.undefinedPrivateNames)) {
+ if (current) {
+ if (!current.undefinedPrivateNames.has(name)) {
+ current.undefinedPrivateNames.set(name, loc);
+ }
+ } else {
+ this.parser.raise(Errors.InvalidPrivateFieldResolution, loc, {
+ identifierName: name
+ });
+ }
+ }
+ }
+ declarePrivateName(name, elementType, loc) {
+ const {
+ privateNames,
+ loneAccessors,
+ undefinedPrivateNames
+ } = this.current();
+ let redefined = privateNames.has(name);
+ if (elementType & 3) {
+ const accessor = redefined && loneAccessors.get(name);
+ if (accessor) {
+ const oldStatic = accessor & 4;
+ const newStatic = elementType & 4;
+ const oldKind = accessor & 3;
+ const newKind = elementType & 3;
+ redefined = oldKind === newKind || oldStatic !== newStatic;
+ if (!redefined) loneAccessors.delete(name);
+ } else if (!redefined) {
+ loneAccessors.set(name, elementType);
+ }
+ }
+ if (redefined) {
+ this.parser.raise(Errors.PrivateNameRedeclaration, loc, {
+ identifierName: name
+ });
+ }
+ privateNames.add(name);
+ undefinedPrivateNames.delete(name);
+ }
+ usePrivateName(name, loc) {
+ let classScope;
+ for (classScope of this.stack) {
+ if (classScope.privateNames.has(name)) return;
+ }
+ if (classScope) {
+ classScope.undefinedPrivateNames.set(name, loc);
+ } else {
+ this.parser.raise(Errors.InvalidPrivateFieldResolution, loc, {
+ identifierName: name
+ });
+ }
+ }
+}
+class ExpressionScope {
+ constructor(type = 0) {
+ this.type = type;
+ }
+ canBeArrowParameterDeclaration() {
+ return this.type === 2 || this.type === 1;
+ }
+ isCertainlyParameterDeclaration() {
+ return this.type === 3;
+ }
+}
+class ArrowHeadParsingScope extends ExpressionScope {
+ constructor(type) {
+ super(type);
+ this.declarationErrors = new Map();
+ }
+ recordDeclarationError(ParsingErrorClass, at) {
+ const index = at.index;
+ this.declarationErrors.set(index, [ParsingErrorClass, at]);
+ }
+ clearDeclarationError(index) {
+ this.declarationErrors.delete(index);
+ }
+ iterateErrors(iterator) {
+ this.declarationErrors.forEach(iterator);
+ }
+}
+class ExpressionScopeHandler {
+ constructor(parser) {
+ this.parser = void 0;
+ this.stack = [new ExpressionScope()];
+ this.parser = parser;
+ }
+ enter(scope) {
+ this.stack.push(scope);
+ }
+ exit() {
+ this.stack.pop();
+ }
+ recordParameterInitializerError(toParseError, node) {
+ const origin = node.loc.start;
+ const {
+ stack
+ } = this;
+ let i = stack.length - 1;
+ let scope = stack[i];
+ while (!scope.isCertainlyParameterDeclaration()) {
+ if (scope.canBeArrowParameterDeclaration()) {
+ scope.recordDeclarationError(toParseError, origin);
+ } else {
+ return;
+ }
+ scope = stack[--i];
+ }
+ this.parser.raise(toParseError, origin);
+ }
+ recordArrowParameterBindingError(error, node) {
+ const {
+ stack
+ } = this;
+ const scope = stack[stack.length - 1];
+ const origin = node.loc.start;
+ if (scope.isCertainlyParameterDeclaration()) {
+ this.parser.raise(error, origin);
+ } else if (scope.canBeArrowParameterDeclaration()) {
+ scope.recordDeclarationError(error, origin);
+ } else {
+ return;
+ }
+ }
+ recordAsyncArrowParametersError(at) {
+ const {
+ stack
+ } = this;
+ let i = stack.length - 1;
+ let scope = stack[i];
+ while (scope.canBeArrowParameterDeclaration()) {
+ if (scope.type === 2) {
+ scope.recordDeclarationError(Errors.AwaitBindingIdentifier, at);
+ }
+ scope = stack[--i];
+ }
+ }
+ validateAsPattern() {
+ const {
+ stack
+ } = this;
+ const currentScope = stack[stack.length - 1];
+ if (!currentScope.canBeArrowParameterDeclaration()) return;
+ currentScope.iterateErrors(([toParseError, loc]) => {
+ this.parser.raise(toParseError, loc);
+ let i = stack.length - 2;
+ let scope = stack[i];
+ while (scope.canBeArrowParameterDeclaration()) {
+ scope.clearDeclarationError(loc.index);
+ scope = stack[--i];
+ }
+ });
+ }
+}
+function newParameterDeclarationScope() {
+ return new ExpressionScope(3);
+}
+function newArrowHeadScope() {
+ return new ArrowHeadParsingScope(1);
+}
+function newAsyncArrowScope() {
+ return new ArrowHeadParsingScope(2);
+}
+function newExpressionScope() {
+ return new ExpressionScope();
+}
+class ProductionParameterHandler {
+ constructor() {
+ this.stacks = [];
+ }
+ enter(flags) {
+ this.stacks.push(flags);
+ }
+ exit() {
+ this.stacks.pop();
+ }
+ currentFlags() {
+ return this.stacks[this.stacks.length - 1];
+ }
+ get hasAwait() {
+ return (this.currentFlags() & 2) > 0;
+ }
+ get hasYield() {
+ return (this.currentFlags() & 1) > 0;
+ }
+ get hasReturn() {
+ return (this.currentFlags() & 4) > 0;
+ }
+ get hasIn() {
+ return (this.currentFlags() & 8) > 0;
+ }
+}
+function functionFlags(isAsync, isGenerator) {
+ return (isAsync ? 2 : 0) | (isGenerator ? 1 : 0);
+}
+class UtilParser extends Tokenizer {
+ addExtra(node, key, value, enumerable = true) {
+ if (!node) return;
+ let {
+ extra
+ } = node;
+ if (extra == null) {
+ extra = {};
+ node.extra = extra;
+ }
+ if (enumerable) {
+ extra[key] = value;
+ } else {
+ Object.defineProperty(extra, key, {
+ enumerable,
+ value
+ });
+ }
+ }
+ isContextual(token) {
+ return this.state.type === token && !this.state.containsEsc;
+ }
+ isUnparsedContextual(nameStart, name) {
+ const nameEnd = nameStart + name.length;
+ if (this.input.slice(nameStart, nameEnd) === name) {
+ const nextCh = this.input.charCodeAt(nameEnd);
+ return !(isIdentifierChar(nextCh) || (nextCh & 0xfc00) === 0xd800);
+ }
+ return false;
+ }
+ isLookaheadContextual(name) {
+ const next = this.nextTokenStart();
+ return this.isUnparsedContextual(next, name);
+ }
+ eatContextual(token) {
+ if (this.isContextual(token)) {
+ this.next();
+ return true;
+ }
+ return false;
+ }
+ expectContextual(token, toParseError) {
+ if (!this.eatContextual(token)) {
+ if (toParseError != null) {
+ throw this.raise(toParseError, this.state.startLoc);
+ }
+ this.unexpected(null, token);
+ }
+ }
+ canInsertSemicolon() {
+ return this.match(139) || this.match(8) || this.hasPrecedingLineBreak();
+ }
+ hasPrecedingLineBreak() {
+ return hasNewLine(this.input, this.state.lastTokEndLoc.index, this.state.start);
+ }
+ hasFollowingLineBreak() {
+ return hasNewLine(this.input, this.state.end, this.nextTokenStart());
+ }
+ isLineTerminator() {
+ return this.eat(13) || this.canInsertSemicolon();
+ }
+ semicolon(allowAsi = true) {
+ if (allowAsi ? this.isLineTerminator() : this.eat(13)) return;
+ this.raise(Errors.MissingSemicolon, this.state.lastTokEndLoc);
+ }
+ expect(type, loc) {
+ if (!this.eat(type)) {
+ this.unexpected(loc, type);
+ }
+ }
+ tryParse(fn, oldState = this.state.clone()) {
+ const abortSignal = {
+ node: null
+ };
+ try {
+ const node = fn((node = null) => {
+ abortSignal.node = node;
+ throw abortSignal;
+ });
+ if (this.state.errors.length > oldState.errors.length) {
+ const failState = this.state;
+ this.state = oldState;
+ this.state.tokensLength = failState.tokensLength;
+ return {
+ node,
+ error: failState.errors[oldState.errors.length],
+ thrown: false,
+ aborted: false,
+ failState
+ };
+ }
+ return {
+ node,
+ error: null,
+ thrown: false,
+ aborted: false,
+ failState: null
+ };
+ } catch (error) {
+ const failState = this.state;
+ this.state = oldState;
+ if (error instanceof SyntaxError) {
+ return {
+ node: null,
+ error,
+ thrown: true,
+ aborted: false,
+ failState
+ };
+ }
+ if (error === abortSignal) {
+ return {
+ node: abortSignal.node,
+ error: null,
+ thrown: false,
+ aborted: true,
+ failState
+ };
+ }
+ throw error;
+ }
+ }
+ checkExpressionErrors(refExpressionErrors, andThrow) {
+ if (!refExpressionErrors) return false;
+ const {
+ shorthandAssignLoc,
+ doubleProtoLoc,
+ privateKeyLoc,
+ optionalParametersLoc
+ } = refExpressionErrors;
+ const hasErrors = !!shorthandAssignLoc || !!doubleProtoLoc || !!optionalParametersLoc || !!privateKeyLoc;
+ if (!andThrow) {
+ return hasErrors;
+ }
+ if (shorthandAssignLoc != null) {
+ this.raise(Errors.InvalidCoverInitializedName, shorthandAssignLoc);
+ }
+ if (doubleProtoLoc != null) {
+ this.raise(Errors.DuplicateProto, doubleProtoLoc);
+ }
+ if (privateKeyLoc != null) {
+ this.raise(Errors.UnexpectedPrivateField, privateKeyLoc);
+ }
+ if (optionalParametersLoc != null) {
+ this.unexpected(optionalParametersLoc);
+ }
+ }
+ isLiteralPropertyName() {
+ return tokenIsLiteralPropertyName(this.state.type);
+ }
+ isPrivateName(node) {
+ return node.type === "PrivateName";
+ }
+ getPrivateNameSV(node) {
+ return node.id.name;
+ }
+ hasPropertyAsPrivateName(node) {
+ return (node.type === "MemberExpression" || node.type === "OptionalMemberExpression") && this.isPrivateName(node.property);
+ }
+ isObjectProperty(node) {
+ return node.type === "ObjectProperty";
+ }
+ isObjectMethod(node) {
+ return node.type === "ObjectMethod";
+ }
+ initializeScopes(inModule = this.options.sourceType === "module") {
+ const oldLabels = this.state.labels;
+ this.state.labels = [];
+ const oldExportedIdentifiers = this.exportedIdentifiers;
+ this.exportedIdentifiers = new Set();
+ const oldInModule = this.inModule;
+ this.inModule = inModule;
+ const oldScope = this.scope;
+ const ScopeHandler = this.getScopeHandler();
+ this.scope = new ScopeHandler(this, inModule);
+ const oldProdParam = this.prodParam;
+ this.prodParam = new ProductionParameterHandler();
+ const oldClassScope = this.classScope;
+ this.classScope = new ClassScopeHandler(this);
+ const oldExpressionScope = this.expressionScope;
+ this.expressionScope = new ExpressionScopeHandler(this);
+ return () => {
+ this.state.labels = oldLabels;
+ this.exportedIdentifiers = oldExportedIdentifiers;
+ this.inModule = oldInModule;
+ this.scope = oldScope;
+ this.prodParam = oldProdParam;
+ this.classScope = oldClassScope;
+ this.expressionScope = oldExpressionScope;
+ };
+ }
+ enterInitialScopes() {
+ let paramFlags = 0;
+ if (this.inModule) {
+ paramFlags |= 2;
+ }
+ this.scope.enter(1);
+ this.prodParam.enter(paramFlags);
+ }
+ checkDestructuringPrivate(refExpressionErrors) {
+ const {
+ privateKeyLoc
+ } = refExpressionErrors;
+ if (privateKeyLoc !== null) {
+ this.expectPlugin("destructuringPrivate", privateKeyLoc);
+ }
+ }
+}
+class ExpressionErrors {
+ constructor() {
+ this.shorthandAssignLoc = null;
+ this.doubleProtoLoc = null;
+ this.privateKeyLoc = null;
+ this.optionalParametersLoc = null;
+ }
+}
+class Node {
+ constructor(parser, pos, loc) {
+ this.type = "";
+ this.start = pos;
+ this.end = 0;
+ this.loc = new SourceLocation(loc);
+ if (parser != null && parser.options.ranges) this.range = [pos, 0];
+ if (parser != null && parser.filename) this.loc.filename = parser.filename;
+ }
+}
+const NodePrototype = Node.prototype;
+{
+ NodePrototype.__clone = function () {
+ const newNode = new Node(undefined, this.start, this.loc.start);
+ const keys = Object.keys(this);
+ for (let i = 0, length = keys.length; i < length; i++) {
+ const key = keys[i];
+ if (key !== "leadingComments" && key !== "trailingComments" && key !== "innerComments") {
+ newNode[key] = this[key];
+ }
+ }
+ return newNode;
+ };
+}
+function clonePlaceholder(node) {
+ return cloneIdentifier(node);
+}
+function cloneIdentifier(node) {
+ const {
+ type,
+ start,
+ end,
+ loc,
+ range,
+ extra,
+ name
+ } = node;
+ const cloned = Object.create(NodePrototype);
+ cloned.type = type;
+ cloned.start = start;
+ cloned.end = end;
+ cloned.loc = loc;
+ cloned.range = range;
+ cloned.extra = extra;
+ cloned.name = name;
+ if (type === "Placeholder") {
+ cloned.expectedNode = node.expectedNode;
+ }
+ return cloned;
+}
+function cloneStringLiteral(node) {
+ const {
+ type,
+ start,
+ end,
+ loc,
+ range,
+ extra
+ } = node;
+ if (type === "Placeholder") {
+ return clonePlaceholder(node);
+ }
+ const cloned = Object.create(NodePrototype);
+ cloned.type = type;
+ cloned.start = start;
+ cloned.end = end;
+ cloned.loc = loc;
+ cloned.range = range;
+ if (node.raw !== undefined) {
+ cloned.raw = node.raw;
+ } else {
+ cloned.extra = extra;
+ }
+ cloned.value = node.value;
+ return cloned;
+}
+class NodeUtils extends UtilParser {
+ startNode() {
+ const loc = this.state.startLoc;
+ return new Node(this, loc.index, loc);
+ }
+ startNodeAt(loc) {
+ return new Node(this, loc.index, loc);
+ }
+ startNodeAtNode(type) {
+ return this.startNodeAt(type.loc.start);
+ }
+ finishNode(node, type) {
+ return this.finishNodeAt(node, type, this.state.lastTokEndLoc);
+ }
+ finishNodeAt(node, type, endLoc) {
+ node.type = type;
+ node.end = endLoc.index;
+ node.loc.end = endLoc;
+ if (this.options.ranges) node.range[1] = endLoc.index;
+ if (this.options.attachComment) this.processComment(node);
+ return node;
+ }
+ resetStartLocation(node, startLoc) {
+ node.start = startLoc.index;
+ node.loc.start = startLoc;
+ if (this.options.ranges) node.range[0] = startLoc.index;
+ }
+ resetEndLocation(node, endLoc = this.state.lastTokEndLoc) {
+ node.end = endLoc.index;
+ node.loc.end = endLoc;
+ if (this.options.ranges) node.range[1] = endLoc.index;
+ }
+ resetStartLocationFromNode(node, locationNode) {
+ this.resetStartLocation(node, locationNode.loc.start);
+ }
+}
+const reservedTypes = new Set(["_", "any", "bool", "boolean", "empty", "extends", "false", "interface", "mixed", "null", "number", "static", "string", "true", "typeof", "void"]);
+const FlowErrors = ParseErrorEnum`flow`({
+ AmbiguousConditionalArrow: "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",
+ AmbiguousDeclareModuleKind: "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",
+ AssignReservedType: ({
+ reservedType
+ }) => `Cannot overwrite reserved type ${reservedType}.`,
+ DeclareClassElement: "The `declare` modifier can only appear on class fields.",
+ DeclareClassFieldInitializer: "Initializers are not allowed in fields with the `declare` modifier.",
+ DuplicateDeclareModuleExports: "Duplicate `declare module.exports` statement.",
+ EnumBooleanMemberNotInitialized: ({
+ memberName,
+ enumName
+ }) => `Boolean enum members need to be initialized. Use either \`${memberName} = true,\` or \`${memberName} = false,\` in enum \`${enumName}\`.`,
+ EnumDuplicateMemberName: ({
+ memberName,
+ enumName
+ }) => `Enum member names need to be unique, but the name \`${memberName}\` has already been used before in enum \`${enumName}\`.`,
+ EnumInconsistentMemberValues: ({
+ enumName
+ }) => `Enum \`${enumName}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,
+ EnumInvalidExplicitType: ({
+ invalidEnumType,
+ enumName
+ }) => `Enum type \`${invalidEnumType}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${enumName}\`.`,
+ EnumInvalidExplicitTypeUnknownSupplied: ({
+ enumName
+ }) => `Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${enumName}\`.`,
+ EnumInvalidMemberInitializerPrimaryType: ({
+ enumName,
+ memberName,
+ explicitType
+ }) => `Enum \`${enumName}\` has type \`${explicitType}\`, so the initializer of \`${memberName}\` needs to be a ${explicitType} literal.`,
+ EnumInvalidMemberInitializerSymbolType: ({
+ enumName,
+ memberName
+ }) => `Symbol enum members cannot be initialized. Use \`${memberName},\` in enum \`${enumName}\`.`,
+ EnumInvalidMemberInitializerUnknownType: ({
+ enumName,
+ memberName
+ }) => `The enum member initializer for \`${memberName}\` needs to be a literal (either a boolean, number, or string) in enum \`${enumName}\`.`,
+ EnumInvalidMemberName: ({
+ enumName,
+ memberName,
+ suggestion
+ }) => `Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${memberName}\`, consider using \`${suggestion}\`, in enum \`${enumName}\`.`,
+ EnumNumberMemberNotInitialized: ({
+ enumName,
+ memberName
+ }) => `Number enum members need to be initialized, e.g. \`${memberName} = 1\` in enum \`${enumName}\`.`,
+ EnumStringMemberInconsistentlyInitialized: ({
+ enumName
+ }) => `String enum members need to consistently either all use initializers, or use no initializers, in enum \`${enumName}\`.`,
+ GetterMayNotHaveThisParam: "A getter cannot have a `this` parameter.",
+ ImportReflectionHasImportType: "An `import module` declaration can not use `type` or `typeof` keyword.",
+ ImportTypeShorthandOnlyInPureImport: "The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",
+ InexactInsideExact: "Explicit inexact syntax cannot appear inside an explicit exact object type.",
+ InexactInsideNonObject: "Explicit inexact syntax cannot appear in class or interface definitions.",
+ InexactVariance: "Explicit inexact syntax cannot have variance.",
+ InvalidNonTypeImportInDeclareModule: "Imports within a `declare module` body must always be `import type` or `import typeof`.",
+ MissingTypeParamDefault: "Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",
+ NestedDeclareModule: "`declare module` cannot be used inside another `declare module`.",
+ NestedFlowComment: "Cannot have a flow comment inside another flow comment.",
+ PatternIsOptional: Object.assign({
+ message: "A binding pattern parameter cannot be optional in an implementation signature."
+ }, {
+ reasonCode: "OptionalBindingPattern"
+ }),
+ SetterMayNotHaveThisParam: "A setter cannot have a `this` parameter.",
+ SpreadVariance: "Spread properties cannot have variance.",
+ ThisParamAnnotationRequired: "A type annotation is required for the `this` parameter.",
+ ThisParamBannedInConstructor: "Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",
+ ThisParamMayNotBeOptional: "The `this` parameter cannot be optional.",
+ ThisParamMustBeFirst: "The `this` parameter must be the first function parameter.",
+ ThisParamNoDefault: "The `this` parameter may not have a default value.",
+ TypeBeforeInitializer: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",
+ TypeCastInPattern: "The type cast expression is expected to be wrapped with parenthesis.",
+ UnexpectedExplicitInexactInObject: "Explicit inexact syntax must appear at the end of an inexact object.",
+ UnexpectedReservedType: ({
+ reservedType
+ }) => `Unexpected reserved type ${reservedType}.`,
+ UnexpectedReservedUnderscore: "`_` is only allowed as a type argument to call or new.",
+ UnexpectedSpaceBetweenModuloChecks: "Spaces between `%` and `checks` are not allowed here.",
+ UnexpectedSpreadType: "Spread operator cannot appear in class or interface definitions.",
+ UnexpectedSubtractionOperand: 'Unexpected token, expected "number" or "bigint".',
+ UnexpectedTokenAfterTypeParameter: "Expected an arrow function after this type parameter declaration.",
+ UnexpectedTypeParameterBeforeAsyncArrowFunction: "Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}`.",
+ UnsupportedDeclareExportKind: ({
+ unsupportedExportKind,
+ suggestion
+ }) => `\`declare export ${unsupportedExportKind}\` is not supported. Use \`${suggestion}\` instead.`,
+ UnsupportedStatementInDeclareModule: "Only declares and type imports are allowed inside declare module.",
+ UnterminatedFlowComment: "Unterminated flow-comment."
+});
+function isEsModuleType(bodyElement) {
+ return bodyElement.type === "DeclareExportAllDeclaration" || bodyElement.type === "DeclareExportDeclaration" && (!bodyElement.declaration || bodyElement.declaration.type !== "TypeAlias" && bodyElement.declaration.type !== "InterfaceDeclaration");
+}
+function hasTypeImportKind(node) {
+ return node.importKind === "type" || node.importKind === "typeof";
+}
+const exportSuggestions = {
+ const: "declare export var",
+ let: "declare export var",
+ type: "export type",
+ interface: "export interface"
+};
+function partition(list, test) {
+ const list1 = [];
+ const list2 = [];
+ for (let i = 0; i < list.length; i++) {
+ (test(list[i], i, list) ? list1 : list2).push(list[i]);
+ }
+ return [list1, list2];
+}
+const FLOW_PRAGMA_REGEX = /\*?\s*@((?:no)?flow)\b/;
+var flow = superClass => class FlowParserMixin extends superClass {
+ constructor(...args) {
+ super(...args);
+ this.flowPragma = undefined;
+ }
+ getScopeHandler() {
+ return FlowScopeHandler;
+ }
+ shouldParseTypes() {
+ return this.getPluginOption("flow", "all") || this.flowPragma === "flow";
+ }
+ shouldParseEnums() {
+ return !!this.getPluginOption("flow", "enums");
+ }
+ finishToken(type, val) {
+ if (type !== 133 && type !== 13 && type !== 28) {
+ if (this.flowPragma === undefined) {
+ this.flowPragma = null;
+ }
+ }
+ super.finishToken(type, val);
+ }
+ addComment(comment) {
+ if (this.flowPragma === undefined) {
+ const matches = FLOW_PRAGMA_REGEX.exec(comment.value);
+ if (!matches) ;else if (matches[1] === "flow") {
+ this.flowPragma = "flow";
+ } else if (matches[1] === "noflow") {
+ this.flowPragma = "noflow";
+ } else {
+ throw new Error("Unexpected flow pragma");
+ }
+ }
+ super.addComment(comment);
+ }
+ flowParseTypeInitialiser(tok) {
+ const oldInType = this.state.inType;
+ this.state.inType = true;
+ this.expect(tok || 14);
+ const type = this.flowParseType();
+ this.state.inType = oldInType;
+ return type;
+ }
+ flowParsePredicate() {
+ const node = this.startNode();
+ const moduloLoc = this.state.startLoc;
+ this.next();
+ this.expectContextual(110);
+ if (this.state.lastTokStartLoc.index > moduloLoc.index + 1) {
+ this.raise(FlowErrors.UnexpectedSpaceBetweenModuloChecks, moduloLoc);
+ }
+ if (this.eat(10)) {
+ node.value = super.parseExpression();
+ this.expect(11);
+ return this.finishNode(node, "DeclaredPredicate");
+ } else {
+ return this.finishNode(node, "InferredPredicate");
+ }
+ }
+ flowParseTypeAndPredicateInitialiser() {
+ const oldInType = this.state.inType;
+ this.state.inType = true;
+ this.expect(14);
+ let type = null;
+ let predicate = null;
+ if (this.match(54)) {
+ this.state.inType = oldInType;
+ predicate = this.flowParsePredicate();
+ } else {
+ type = this.flowParseType();
+ this.state.inType = oldInType;
+ if (this.match(54)) {
+ predicate = this.flowParsePredicate();
+ }
+ }
+ return [type, predicate];
+ }
+ flowParseDeclareClass(node) {
+ this.next();
+ this.flowParseInterfaceish(node, true);
+ return this.finishNode(node, "DeclareClass");
+ }
+ flowParseDeclareFunction(node) {
+ this.next();
+ const id = node.id = this.parseIdentifier();
+ const typeNode = this.startNode();
+ const typeContainer = this.startNode();
+ if (this.match(47)) {
+ typeNode.typeParameters = this.flowParseTypeParameterDeclaration();
+ } else {
+ typeNode.typeParameters = null;
+ }
+ this.expect(10);
+ const tmp = this.flowParseFunctionTypeParams();
+ typeNode.params = tmp.params;
+ typeNode.rest = tmp.rest;
+ typeNode.this = tmp._this;
+ this.expect(11);
+ [typeNode.returnType, node.predicate] = this.flowParseTypeAndPredicateInitialiser();
+ typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation");
+ id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation");
+ this.resetEndLocation(id);
+ this.semicolon();
+ this.scope.declareName(node.id.name, 2048, node.id.loc.start);
+ return this.finishNode(node, "DeclareFunction");
+ }
+ flowParseDeclare(node, insideModule) {
+ if (this.match(80)) {
+ return this.flowParseDeclareClass(node);
+ } else if (this.match(68)) {
+ return this.flowParseDeclareFunction(node);
+ } else if (this.match(74)) {
+ return this.flowParseDeclareVariable(node);
+ } else if (this.eatContextual(127)) {
+ if (this.match(16)) {
+ return this.flowParseDeclareModuleExports(node);
+ } else {
+ if (insideModule) {
+ this.raise(FlowErrors.NestedDeclareModule, this.state.lastTokStartLoc);
+ }
+ return this.flowParseDeclareModule(node);
+ }
+ } else if (this.isContextual(130)) {
+ return this.flowParseDeclareTypeAlias(node);
+ } else if (this.isContextual(131)) {
+ return this.flowParseDeclareOpaqueType(node);
+ } else if (this.isContextual(129)) {
+ return this.flowParseDeclareInterface(node);
+ } else if (this.match(82)) {
+ return this.flowParseDeclareExportDeclaration(node, insideModule);
+ } else {
+ this.unexpected();
+ }
+ }
+ flowParseDeclareVariable(node) {
+ this.next();
+ node.id = this.flowParseTypeAnnotatableIdentifier(true);
+ this.scope.declareName(node.id.name, 5, node.id.loc.start);
+ this.semicolon();
+ return this.finishNode(node, "DeclareVariable");
+ }
+ flowParseDeclareModule(node) {
+ this.scope.enter(0);
+ if (this.match(133)) {
+ node.id = super.parseExprAtom();
+ } else {
+ node.id = this.parseIdentifier();
+ }
+ const bodyNode = node.body = this.startNode();
+ const body = bodyNode.body = [];
+ this.expect(5);
+ while (!this.match(8)) {
+ let bodyNode = this.startNode();
+ if (this.match(83)) {
+ this.next();
+ if (!this.isContextual(130) && !this.match(87)) {
+ this.raise(FlowErrors.InvalidNonTypeImportInDeclareModule, this.state.lastTokStartLoc);
+ }
+ super.parseImport(bodyNode);
+ } else {
+ this.expectContextual(125, FlowErrors.UnsupportedStatementInDeclareModule);
+ bodyNode = this.flowParseDeclare(bodyNode, true);
+ }
+ body.push(bodyNode);
+ }
+ this.scope.exit();
+ this.expect(8);
+ this.finishNode(bodyNode, "BlockStatement");
+ let kind = null;
+ let hasModuleExport = false;
+ body.forEach(bodyElement => {
+ if (isEsModuleType(bodyElement)) {
+ if (kind === "CommonJS") {
+ this.raise(FlowErrors.AmbiguousDeclareModuleKind, bodyElement);
+ }
+ kind = "ES";
+ } else if (bodyElement.type === "DeclareModuleExports") {
+ if (hasModuleExport) {
+ this.raise(FlowErrors.DuplicateDeclareModuleExports, bodyElement);
+ }
+ if (kind === "ES") {
+ this.raise(FlowErrors.AmbiguousDeclareModuleKind, bodyElement);
+ }
+ kind = "CommonJS";
+ hasModuleExport = true;
+ }
+ });
+ node.kind = kind || "CommonJS";
+ return this.finishNode(node, "DeclareModule");
+ }
+ flowParseDeclareExportDeclaration(node, insideModule) {
+ this.expect(82);
+ if (this.eat(65)) {
+ if (this.match(68) || this.match(80)) {
+ node.declaration = this.flowParseDeclare(this.startNode());
+ } else {
+ node.declaration = this.flowParseType();
+ this.semicolon();
+ }
+ node.default = true;
+ return this.finishNode(node, "DeclareExportDeclaration");
+ } else {
+ if (this.match(75) || this.isLet() || (this.isContextual(130) || this.isContextual(129)) && !insideModule) {
+ const label = this.state.value;
+ throw this.raise(FlowErrors.UnsupportedDeclareExportKind, this.state.startLoc, {
+ unsupportedExportKind: label,
+ suggestion: exportSuggestions[label]
+ });
+ }
+ if (this.match(74) || this.match(68) || this.match(80) || this.isContextual(131)) {
+ node.declaration = this.flowParseDeclare(this.startNode());
+ node.default = false;
+ return this.finishNode(node, "DeclareExportDeclaration");
+ } else if (this.match(55) || this.match(5) || this.isContextual(129) || this.isContextual(130) || this.isContextual(131)) {
+ node = this.parseExport(node, null);
+ if (node.type === "ExportNamedDeclaration") {
+ node.type = "ExportDeclaration";
+ node.default = false;
+ delete node.exportKind;
+ }
+ node.type = "Declare" + node.type;
+ return node;
+ }
+ }
+ this.unexpected();
+ }
+ flowParseDeclareModuleExports(node) {
+ this.next();
+ this.expectContextual(111);
+ node.typeAnnotation = this.flowParseTypeAnnotation();
+ this.semicolon();
+ return this.finishNode(node, "DeclareModuleExports");
+ }
+ flowParseDeclareTypeAlias(node) {
+ this.next();
+ const finished = this.flowParseTypeAlias(node);
+ finished.type = "DeclareTypeAlias";
+ return finished;
+ }
+ flowParseDeclareOpaqueType(node) {
+ this.next();
+ const finished = this.flowParseOpaqueType(node, true);
+ finished.type = "DeclareOpaqueType";
+ return finished;
+ }
+ flowParseDeclareInterface(node) {
+ this.next();
+ this.flowParseInterfaceish(node, false);
+ return this.finishNode(node, "DeclareInterface");
+ }
+ flowParseInterfaceish(node, isClass) {
+ node.id = this.flowParseRestrictedIdentifier(!isClass, true);
+ this.scope.declareName(node.id.name, isClass ? 17 : 8201, node.id.loc.start);
+ if (this.match(47)) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ } else {
+ node.typeParameters = null;
+ }
+ node.extends = [];
+ if (this.eat(81)) {
+ do {
+ node.extends.push(this.flowParseInterfaceExtends());
+ } while (!isClass && this.eat(12));
+ }
+ if (isClass) {
+ node.implements = [];
+ node.mixins = [];
+ if (this.eatContextual(117)) {
+ do {
+ node.mixins.push(this.flowParseInterfaceExtends());
+ } while (this.eat(12));
+ }
+ if (this.eatContextual(113)) {
+ do {
+ node.implements.push(this.flowParseInterfaceExtends());
+ } while (this.eat(12));
+ }
+ }
+ node.body = this.flowParseObjectType({
+ allowStatic: isClass,
+ allowExact: false,
+ allowSpread: false,
+ allowProto: isClass,
+ allowInexact: false
+ });
+ }
+ flowParseInterfaceExtends() {
+ const node = this.startNode();
+ node.id = this.flowParseQualifiedTypeIdentifier();
+ if (this.match(47)) {
+ node.typeParameters = this.flowParseTypeParameterInstantiation();
+ } else {
+ node.typeParameters = null;
+ }
+ return this.finishNode(node, "InterfaceExtends");
+ }
+ flowParseInterface(node) {
+ this.flowParseInterfaceish(node, false);
+ return this.finishNode(node, "InterfaceDeclaration");
+ }
+ checkNotUnderscore(word) {
+ if (word === "_") {
+ this.raise(FlowErrors.UnexpectedReservedUnderscore, this.state.startLoc);
+ }
+ }
+ checkReservedType(word, startLoc, declaration) {
+ if (!reservedTypes.has(word)) return;
+ this.raise(declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, startLoc, {
+ reservedType: word
+ });
+ }
+ flowParseRestrictedIdentifier(liberal, declaration) {
+ this.checkReservedType(this.state.value, this.state.startLoc, declaration);
+ return this.parseIdentifier(liberal);
+ }
+ flowParseTypeAlias(node) {
+ node.id = this.flowParseRestrictedIdentifier(false, true);
+ this.scope.declareName(node.id.name, 8201, node.id.loc.start);
+ if (this.match(47)) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ } else {
+ node.typeParameters = null;
+ }
+ node.right = this.flowParseTypeInitialiser(29);
+ this.semicolon();
+ return this.finishNode(node, "TypeAlias");
+ }
+ flowParseOpaqueType(node, declare) {
+ this.expectContextual(130);
+ node.id = this.flowParseRestrictedIdentifier(true, true);
+ this.scope.declareName(node.id.name, 8201, node.id.loc.start);
+ if (this.match(47)) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ } else {
+ node.typeParameters = null;
+ }
+ node.supertype = null;
+ if (this.match(14)) {
+ node.supertype = this.flowParseTypeInitialiser(14);
+ }
+ node.impltype = null;
+ if (!declare) {
+ node.impltype = this.flowParseTypeInitialiser(29);
+ }
+ this.semicolon();
+ return this.finishNode(node, "OpaqueType");
+ }
+ flowParseTypeParameter(requireDefault = false) {
+ const nodeStartLoc = this.state.startLoc;
+ const node = this.startNode();
+ const variance = this.flowParseVariance();
+ const ident = this.flowParseTypeAnnotatableIdentifier();
+ node.name = ident.name;
+ node.variance = variance;
+ node.bound = ident.typeAnnotation;
+ if (this.match(29)) {
+ this.eat(29);
+ node.default = this.flowParseType();
+ } else {
+ if (requireDefault) {
+ this.raise(FlowErrors.MissingTypeParamDefault, nodeStartLoc);
+ }
+ }
+ return this.finishNode(node, "TypeParameter");
+ }
+ flowParseTypeParameterDeclaration() {
+ const oldInType = this.state.inType;
+ const node = this.startNode();
+ node.params = [];
+ this.state.inType = true;
+ if (this.match(47) || this.match(142)) {
+ this.next();
+ } else {
+ this.unexpected();
+ }
+ let defaultRequired = false;
+ do {
+ const typeParameter = this.flowParseTypeParameter(defaultRequired);
+ node.params.push(typeParameter);
+ if (typeParameter.default) {
+ defaultRequired = true;
+ }
+ if (!this.match(48)) {
+ this.expect(12);
+ }
+ } while (!this.match(48));
+ this.expect(48);
+ this.state.inType = oldInType;
+ return this.finishNode(node, "TypeParameterDeclaration");
+ }
+ flowParseTypeParameterInstantiation() {
+ const node = this.startNode();
+ const oldInType = this.state.inType;
+ node.params = [];
+ this.state.inType = true;
+ this.expect(47);
+ const oldNoAnonFunctionType = this.state.noAnonFunctionType;
+ this.state.noAnonFunctionType = false;
+ while (!this.match(48)) {
+ node.params.push(this.flowParseType());
+ if (!this.match(48)) {
+ this.expect(12);
+ }
+ }
+ this.state.noAnonFunctionType = oldNoAnonFunctionType;
+ this.expect(48);
+ this.state.inType = oldInType;
+ return this.finishNode(node, "TypeParameterInstantiation");
+ }
+ flowParseTypeParameterInstantiationCallOrNew() {
+ const node = this.startNode();
+ const oldInType = this.state.inType;
+ node.params = [];
+ this.state.inType = true;
+ this.expect(47);
+ while (!this.match(48)) {
+ node.params.push(this.flowParseTypeOrImplicitInstantiation());
+ if (!this.match(48)) {
+ this.expect(12);
+ }
+ }
+ this.expect(48);
+ this.state.inType = oldInType;
+ return this.finishNode(node, "TypeParameterInstantiation");
+ }
+ flowParseInterfaceType() {
+ const node = this.startNode();
+ this.expectContextual(129);
+ node.extends = [];
+ if (this.eat(81)) {
+ do {
+ node.extends.push(this.flowParseInterfaceExtends());
+ } while (this.eat(12));
+ }
+ node.body = this.flowParseObjectType({
+ allowStatic: false,
+ allowExact: false,
+ allowSpread: false,
+ allowProto: false,
+ allowInexact: false
+ });
+ return this.finishNode(node, "InterfaceTypeAnnotation");
+ }
+ flowParseObjectPropertyKey() {
+ return this.match(134) || this.match(133) ? super.parseExprAtom() : this.parseIdentifier(true);
+ }
+ flowParseObjectTypeIndexer(node, isStatic, variance) {
+ node.static = isStatic;
+ if (this.lookahead().type === 14) {
+ node.id = this.flowParseObjectPropertyKey();
+ node.key = this.flowParseTypeInitialiser();
+ } else {
+ node.id = null;
+ node.key = this.flowParseType();
+ }
+ this.expect(3);
+ node.value = this.flowParseTypeInitialiser();
+ node.variance = variance;
+ return this.finishNode(node, "ObjectTypeIndexer");
+ }
+ flowParseObjectTypeInternalSlot(node, isStatic) {
+ node.static = isStatic;
+ node.id = this.flowParseObjectPropertyKey();
+ this.expect(3);
+ this.expect(3);
+ if (this.match(47) || this.match(10)) {
+ node.method = true;
+ node.optional = false;
+ node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.loc.start));
+ } else {
+ node.method = false;
+ if (this.eat(17)) {
+ node.optional = true;
+ }
+ node.value = this.flowParseTypeInitialiser();
+ }
+ return this.finishNode(node, "ObjectTypeInternalSlot");
+ }
+ flowParseObjectTypeMethodish(node) {
+ node.params = [];
+ node.rest = null;
+ node.typeParameters = null;
+ node.this = null;
+ if (this.match(47)) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+ this.expect(10);
+ if (this.match(78)) {
+ node.this = this.flowParseFunctionTypeParam(true);
+ node.this.name = null;
+ if (!this.match(11)) {
+ this.expect(12);
+ }
+ }
+ while (!this.match(11) && !this.match(21)) {
+ node.params.push(this.flowParseFunctionTypeParam(false));
+ if (!this.match(11)) {
+ this.expect(12);
+ }
+ }
+ if (this.eat(21)) {
+ node.rest = this.flowParseFunctionTypeParam(false);
+ }
+ this.expect(11);
+ node.returnType = this.flowParseTypeInitialiser();
+ return this.finishNode(node, "FunctionTypeAnnotation");
+ }
+ flowParseObjectTypeCallProperty(node, isStatic) {
+ const valueNode = this.startNode();
+ node.static = isStatic;
+ node.value = this.flowParseObjectTypeMethodish(valueNode);
+ return this.finishNode(node, "ObjectTypeCallProperty");
+ }
+ flowParseObjectType({
+ allowStatic,
+ allowExact,
+ allowSpread,
+ allowProto,
+ allowInexact
+ }) {
+ const oldInType = this.state.inType;
+ this.state.inType = true;
+ const nodeStart = this.startNode();
+ nodeStart.callProperties = [];
+ nodeStart.properties = [];
+ nodeStart.indexers = [];
+ nodeStart.internalSlots = [];
+ let endDelim;
+ let exact;
+ let inexact = false;
+ if (allowExact && this.match(6)) {
+ this.expect(6);
+ endDelim = 9;
+ exact = true;
+ } else {
+ this.expect(5);
+ endDelim = 8;
+ exact = false;
+ }
+ nodeStart.exact = exact;
+ while (!this.match(endDelim)) {
+ let isStatic = false;
+ let protoStartLoc = null;
+ let inexactStartLoc = null;
+ const node = this.startNode();
+ if (allowProto && this.isContextual(118)) {
+ const lookahead = this.lookahead();
+ if (lookahead.type !== 14 && lookahead.type !== 17) {
+ this.next();
+ protoStartLoc = this.state.startLoc;
+ allowStatic = false;
+ }
+ }
+ if (allowStatic && this.isContextual(106)) {
+ const lookahead = this.lookahead();
+ if (lookahead.type !== 14 && lookahead.type !== 17) {
+ this.next();
+ isStatic = true;
+ }
+ }
+ const variance = this.flowParseVariance();
+ if (this.eat(0)) {
+ if (protoStartLoc != null) {
+ this.unexpected(protoStartLoc);
+ }
+ if (this.eat(0)) {
+ if (variance) {
+ this.unexpected(variance.loc.start);
+ }
+ nodeStart.internalSlots.push(this.flowParseObjectTypeInternalSlot(node, isStatic));
+ } else {
+ nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance));
+ }
+ } else if (this.match(10) || this.match(47)) {
+ if (protoStartLoc != null) {
+ this.unexpected(protoStartLoc);
+ }
+ if (variance) {
+ this.unexpected(variance.loc.start);
+ }
+ nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic));
+ } else {
+ let kind = "init";
+ if (this.isContextual(99) || this.isContextual(104)) {
+ const lookahead = this.lookahead();
+ if (tokenIsLiteralPropertyName(lookahead.type)) {
+ kind = this.state.value;
+ this.next();
+ }
+ }
+ const propOrInexact = this.flowParseObjectTypeProperty(node, isStatic, protoStartLoc, variance, kind, allowSpread, allowInexact != null ? allowInexact : !exact);
+ if (propOrInexact === null) {
+ inexact = true;
+ inexactStartLoc = this.state.lastTokStartLoc;
+ } else {
+ nodeStart.properties.push(propOrInexact);
+ }
+ }
+ this.flowObjectTypeSemicolon();
+ if (inexactStartLoc && !this.match(8) && !this.match(9)) {
+ this.raise(FlowErrors.UnexpectedExplicitInexactInObject, inexactStartLoc);
+ }
+ }
+ this.expect(endDelim);
+ if (allowSpread) {
+ nodeStart.inexact = inexact;
+ }
+ const out = this.finishNode(nodeStart, "ObjectTypeAnnotation");
+ this.state.inType = oldInType;
+ return out;
+ }
+ flowParseObjectTypeProperty(node, isStatic, protoStartLoc, variance, kind, allowSpread, allowInexact) {
+ if (this.eat(21)) {
+ const isInexactToken = this.match(12) || this.match(13) || this.match(8) || this.match(9);
+ if (isInexactToken) {
+ if (!allowSpread) {
+ this.raise(FlowErrors.InexactInsideNonObject, this.state.lastTokStartLoc);
+ } else if (!allowInexact) {
+ this.raise(FlowErrors.InexactInsideExact, this.state.lastTokStartLoc);
+ }
+ if (variance) {
+ this.raise(FlowErrors.InexactVariance, variance);
+ }
+ return null;
+ }
+ if (!allowSpread) {
+ this.raise(FlowErrors.UnexpectedSpreadType, this.state.lastTokStartLoc);
+ }
+ if (protoStartLoc != null) {
+ this.unexpected(protoStartLoc);
+ }
+ if (variance) {
+ this.raise(FlowErrors.SpreadVariance, variance);
+ }
+ node.argument = this.flowParseType();
+ return this.finishNode(node, "ObjectTypeSpreadProperty");
+ } else {
+ node.key = this.flowParseObjectPropertyKey();
+ node.static = isStatic;
+ node.proto = protoStartLoc != null;
+ node.kind = kind;
+ let optional = false;
+ if (this.match(47) || this.match(10)) {
+ node.method = true;
+ if (protoStartLoc != null) {
+ this.unexpected(protoStartLoc);
+ }
+ if (variance) {
+ this.unexpected(variance.loc.start);
+ }
+ node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.loc.start));
+ if (kind === "get" || kind === "set") {
+ this.flowCheckGetterSetterParams(node);
+ }
+ if (!allowSpread && node.key.name === "constructor" && node.value.this) {
+ this.raise(FlowErrors.ThisParamBannedInConstructor, node.value.this);
+ }
+ } else {
+ if (kind !== "init") this.unexpected();
+ node.method = false;
+ if (this.eat(17)) {
+ optional = true;
+ }
+ node.value = this.flowParseTypeInitialiser();
+ node.variance = variance;
+ }
+ node.optional = optional;
+ return this.finishNode(node, "ObjectTypeProperty");
+ }
+ }
+ flowCheckGetterSetterParams(property) {
+ const paramCount = property.kind === "get" ? 0 : 1;
+ const length = property.value.params.length + (property.value.rest ? 1 : 0);
+ if (property.value.this) {
+ this.raise(property.kind === "get" ? FlowErrors.GetterMayNotHaveThisParam : FlowErrors.SetterMayNotHaveThisParam, property.value.this);
+ }
+ if (length !== paramCount) {
+ this.raise(property.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, property);
+ }
+ if (property.kind === "set" && property.value.rest) {
+ this.raise(Errors.BadSetterRestParameter, property);
+ }
+ }
+ flowObjectTypeSemicolon() {
+ if (!this.eat(13) && !this.eat(12) && !this.match(8) && !this.match(9)) {
+ this.unexpected();
+ }
+ }
+ flowParseQualifiedTypeIdentifier(startLoc, id) {
+ var _startLoc;
+ (_startLoc = startLoc) != null ? _startLoc : startLoc = this.state.startLoc;
+ let node = id || this.flowParseRestrictedIdentifier(true);
+ while (this.eat(16)) {
+ const node2 = this.startNodeAt(startLoc);
+ node2.qualification = node;
+ node2.id = this.flowParseRestrictedIdentifier(true);
+ node = this.finishNode(node2, "QualifiedTypeIdentifier");
+ }
+ return node;
+ }
+ flowParseGenericType(startLoc, id) {
+ const node = this.startNodeAt(startLoc);
+ node.typeParameters = null;
+ node.id = this.flowParseQualifiedTypeIdentifier(startLoc, id);
+ if (this.match(47)) {
+ node.typeParameters = this.flowParseTypeParameterInstantiation();
+ }
+ return this.finishNode(node, "GenericTypeAnnotation");
+ }
+ flowParseTypeofType() {
+ const node = this.startNode();
+ this.expect(87);
+ node.argument = this.flowParsePrimaryType();
+ return this.finishNode(node, "TypeofTypeAnnotation");
+ }
+ flowParseTupleType() {
+ const node = this.startNode();
+ node.types = [];
+ this.expect(0);
+ while (this.state.pos < this.length && !this.match(3)) {
+ node.types.push(this.flowParseType());
+ if (this.match(3)) break;
+ this.expect(12);
+ }
+ this.expect(3);
+ return this.finishNode(node, "TupleTypeAnnotation");
+ }
+ flowParseFunctionTypeParam(first) {
+ let name = null;
+ let optional = false;
+ let typeAnnotation = null;
+ const node = this.startNode();
+ const lh = this.lookahead();
+ const isThis = this.state.type === 78;
+ if (lh.type === 14 || lh.type === 17) {
+ if (isThis && !first) {
+ this.raise(FlowErrors.ThisParamMustBeFirst, node);
+ }
+ name = this.parseIdentifier(isThis);
+ if (this.eat(17)) {
+ optional = true;
+ if (isThis) {
+ this.raise(FlowErrors.ThisParamMayNotBeOptional, node);
+ }
+ }
+ typeAnnotation = this.flowParseTypeInitialiser();
+ } else {
+ typeAnnotation = this.flowParseType();
+ }
+ node.name = name;
+ node.optional = optional;
+ node.typeAnnotation = typeAnnotation;
+ return this.finishNode(node, "FunctionTypeParam");
+ }
+ reinterpretTypeAsFunctionTypeParam(type) {
+ const node = this.startNodeAt(type.loc.start);
+ node.name = null;
+ node.optional = false;
+ node.typeAnnotation = type;
+ return this.finishNode(node, "FunctionTypeParam");
+ }
+ flowParseFunctionTypeParams(params = []) {
+ let rest = null;
+ let _this = null;
+ if (this.match(78)) {
+ _this = this.flowParseFunctionTypeParam(true);
+ _this.name = null;
+ if (!this.match(11)) {
+ this.expect(12);
+ }
+ }
+ while (!this.match(11) && !this.match(21)) {
+ params.push(this.flowParseFunctionTypeParam(false));
+ if (!this.match(11)) {
+ this.expect(12);
+ }
+ }
+ if (this.eat(21)) {
+ rest = this.flowParseFunctionTypeParam(false);
+ }
+ return {
+ params,
+ rest,
+ _this
+ };
+ }
+ flowIdentToTypeAnnotation(startLoc, node, id) {
+ switch (id.name) {
+ case "any":
+ return this.finishNode(node, "AnyTypeAnnotation");
+ case "bool":
+ case "boolean":
+ return this.finishNode(node, "BooleanTypeAnnotation");
+ case "mixed":
+ return this.finishNode(node, "MixedTypeAnnotation");
+ case "empty":
+ return this.finishNode(node, "EmptyTypeAnnotation");
+ case "number":
+ return this.finishNode(node, "NumberTypeAnnotation");
+ case "string":
+ return this.finishNode(node, "StringTypeAnnotation");
+ case "symbol":
+ return this.finishNode(node, "SymbolTypeAnnotation");
+ default:
+ this.checkNotUnderscore(id.name);
+ return this.flowParseGenericType(startLoc, id);
+ }
+ }
+ flowParsePrimaryType() {
+ const startLoc = this.state.startLoc;
+ const node = this.startNode();
+ let tmp;
+ let type;
+ let isGroupedType = false;
+ const oldNoAnonFunctionType = this.state.noAnonFunctionType;
+ switch (this.state.type) {
+ case 5:
+ return this.flowParseObjectType({
+ allowStatic: false,
+ allowExact: false,
+ allowSpread: true,
+ allowProto: false,
+ allowInexact: true
+ });
+ case 6:
+ return this.flowParseObjectType({
+ allowStatic: false,
+ allowExact: true,
+ allowSpread: true,
+ allowProto: false,
+ allowInexact: false
+ });
+ case 0:
+ this.state.noAnonFunctionType = false;
+ type = this.flowParseTupleType();
+ this.state.noAnonFunctionType = oldNoAnonFunctionType;
+ return type;
+ case 47:
+ {
+ const node = this.startNode();
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ this.expect(10);
+ tmp = this.flowParseFunctionTypeParams();
+ node.params = tmp.params;
+ node.rest = tmp.rest;
+ node.this = tmp._this;
+ this.expect(11);
+ this.expect(19);
+ node.returnType = this.flowParseType();
+ return this.finishNode(node, "FunctionTypeAnnotation");
+ }
+ case 10:
+ {
+ const node = this.startNode();
+ this.next();
+ if (!this.match(11) && !this.match(21)) {
+ if (tokenIsIdentifier(this.state.type) || this.match(78)) {
+ const token = this.lookahead().type;
+ isGroupedType = token !== 17 && token !== 14;
+ } else {
+ isGroupedType = true;
+ }
+ }
+ if (isGroupedType) {
+ this.state.noAnonFunctionType = false;
+ type = this.flowParseType();
+ this.state.noAnonFunctionType = oldNoAnonFunctionType;
+ if (this.state.noAnonFunctionType || !(this.match(12) || this.match(11) && this.lookahead().type === 19)) {
+ this.expect(11);
+ return type;
+ } else {
+ this.eat(12);
+ }
+ }
+ if (type) {
+ tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]);
+ } else {
+ tmp = this.flowParseFunctionTypeParams();
+ }
+ node.params = tmp.params;
+ node.rest = tmp.rest;
+ node.this = tmp._this;
+ this.expect(11);
+ this.expect(19);
+ node.returnType = this.flowParseType();
+ node.typeParameters = null;
+ return this.finishNode(node, "FunctionTypeAnnotation");
+ }
+ case 133:
+ return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation");
+ case 85:
+ case 86:
+ node.value = this.match(85);
+ this.next();
+ return this.finishNode(node, "BooleanLiteralTypeAnnotation");
+ case 53:
+ if (this.state.value === "-") {
+ this.next();
+ if (this.match(134)) {
+ return this.parseLiteralAtNode(-this.state.value, "NumberLiteralTypeAnnotation", node);
+ }
+ if (this.match(135)) {
+ return this.parseLiteralAtNode(-this.state.value, "BigIntLiteralTypeAnnotation", node);
+ }
+ throw this.raise(FlowErrors.UnexpectedSubtractionOperand, this.state.startLoc);
+ }
+ this.unexpected();
+ return;
+ case 134:
+ return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation");
+ case 135:
+ return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation");
+ case 88:
+ this.next();
+ return this.finishNode(node, "VoidTypeAnnotation");
+ case 84:
+ this.next();
+ return this.finishNode(node, "NullLiteralTypeAnnotation");
+ case 78:
+ this.next();
+ return this.finishNode(node, "ThisTypeAnnotation");
+ case 55:
+ this.next();
+ return this.finishNode(node, "ExistsTypeAnnotation");
+ case 87:
+ return this.flowParseTypeofType();
+ default:
+ if (tokenIsKeyword(this.state.type)) {
+ const label = tokenLabelName(this.state.type);
+ this.next();
+ return super.createIdentifier(node, label);
+ } else if (tokenIsIdentifier(this.state.type)) {
+ if (this.isContextual(129)) {
+ return this.flowParseInterfaceType();
+ }
+ return this.flowIdentToTypeAnnotation(startLoc, node, this.parseIdentifier());
+ }
+ }
+ this.unexpected();
+ }
+ flowParsePostfixType() {
+ const startLoc = this.state.startLoc;
+ let type = this.flowParsePrimaryType();
+ let seenOptionalIndexedAccess = false;
+ while ((this.match(0) || this.match(18)) && !this.canInsertSemicolon()) {
+ const node = this.startNodeAt(startLoc);
+ const optional = this.eat(18);
+ seenOptionalIndexedAccess = seenOptionalIndexedAccess || optional;
+ this.expect(0);
+ if (!optional && this.match(3)) {
+ node.elementType = type;
+ this.next();
+ type = this.finishNode(node, "ArrayTypeAnnotation");
+ } else {
+ node.objectType = type;
+ node.indexType = this.flowParseType();
+ this.expect(3);
+ if (seenOptionalIndexedAccess) {
+ node.optional = optional;
+ type = this.finishNode(node, "OptionalIndexedAccessType");
+ } else {
+ type = this.finishNode(node, "IndexedAccessType");
+ }
+ }
+ }
+ return type;
+ }
+ flowParsePrefixType() {
+ const node = this.startNode();
+ if (this.eat(17)) {
+ node.typeAnnotation = this.flowParsePrefixType();
+ return this.finishNode(node, "NullableTypeAnnotation");
+ } else {
+ return this.flowParsePostfixType();
+ }
+ }
+ flowParseAnonFunctionWithoutParens() {
+ const param = this.flowParsePrefixType();
+ if (!this.state.noAnonFunctionType && this.eat(19)) {
+ const node = this.startNodeAt(param.loc.start);
+ node.params = [this.reinterpretTypeAsFunctionTypeParam(param)];
+ node.rest = null;
+ node.this = null;
+ node.returnType = this.flowParseType();
+ node.typeParameters = null;
+ return this.finishNode(node, "FunctionTypeAnnotation");
+ }
+ return param;
+ }
+ flowParseIntersectionType() {
+ const node = this.startNode();
+ this.eat(45);
+ const type = this.flowParseAnonFunctionWithoutParens();
+ node.types = [type];
+ while (this.eat(45)) {
+ node.types.push(this.flowParseAnonFunctionWithoutParens());
+ }
+ return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation");
+ }
+ flowParseUnionType() {
+ const node = this.startNode();
+ this.eat(43);
+ const type = this.flowParseIntersectionType();
+ node.types = [type];
+ while (this.eat(43)) {
+ node.types.push(this.flowParseIntersectionType());
+ }
+ return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation");
+ }
+ flowParseType() {
+ const oldInType = this.state.inType;
+ this.state.inType = true;
+ const type = this.flowParseUnionType();
+ this.state.inType = oldInType;
+ return type;
+ }
+ flowParseTypeOrImplicitInstantiation() {
+ if (this.state.type === 132 && this.state.value === "_") {
+ const startLoc = this.state.startLoc;
+ const node = this.parseIdentifier();
+ return this.flowParseGenericType(startLoc, node);
+ } else {
+ return this.flowParseType();
+ }
+ }
+ flowParseTypeAnnotation() {
+ const node = this.startNode();
+ node.typeAnnotation = this.flowParseTypeInitialiser();
+ return this.finishNode(node, "TypeAnnotation");
+ }
+ flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) {
+ const ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier();
+ if (this.match(14)) {
+ ident.typeAnnotation = this.flowParseTypeAnnotation();
+ this.resetEndLocation(ident);
+ }
+ return ident;
+ }
+ typeCastToParameter(node) {
+ node.expression.typeAnnotation = node.typeAnnotation;
+ this.resetEndLocation(node.expression, node.typeAnnotation.loc.end);
+ return node.expression;
+ }
+ flowParseVariance() {
+ let variance = null;
+ if (this.match(53)) {
+ variance = this.startNode();
+ if (this.state.value === "+") {
+ variance.kind = "plus";
+ } else {
+ variance.kind = "minus";
+ }
+ this.next();
+ return this.finishNode(variance, "Variance");
+ }
+ return variance;
+ }
+ parseFunctionBody(node, allowExpressionBody, isMethod = false) {
+ if (allowExpressionBody) {
+ this.forwardNoArrowParamsConversionAt(node, () => super.parseFunctionBody(node, true, isMethod));
+ return;
+ }
+ super.parseFunctionBody(node, false, isMethod);
+ }
+ parseFunctionBodyAndFinish(node, type, isMethod = false) {
+ if (this.match(14)) {
+ const typeNode = this.startNode();
+ [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser();
+ node.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, "TypeAnnotation") : null;
+ }
+ return super.parseFunctionBodyAndFinish(node, type, isMethod);
+ }
+ parseStatementLike(flags) {
+ if (this.state.strict && this.isContextual(129)) {
+ const lookahead = this.lookahead();
+ if (tokenIsKeywordOrIdentifier(lookahead.type)) {
+ const node = this.startNode();
+ this.next();
+ return this.flowParseInterface(node);
+ }
+ } else if (this.shouldParseEnums() && this.isContextual(126)) {
+ const node = this.startNode();
+ this.next();
+ return this.flowParseEnumDeclaration(node);
+ }
+ const stmt = super.parseStatementLike(flags);
+ if (this.flowPragma === undefined && !this.isValidDirective(stmt)) {
+ this.flowPragma = null;
+ }
+ return stmt;
+ }
+ parseExpressionStatement(node, expr, decorators) {
+ if (expr.type === "Identifier") {
+ if (expr.name === "declare") {
+ if (this.match(80) || tokenIsIdentifier(this.state.type) || this.match(68) || this.match(74) || this.match(82)) {
+ return this.flowParseDeclare(node);
+ }
+ } else if (tokenIsIdentifier(this.state.type)) {
+ if (expr.name === "interface") {
+ return this.flowParseInterface(node);
+ } else if (expr.name === "type") {
+ return this.flowParseTypeAlias(node);
+ } else if (expr.name === "opaque") {
+ return this.flowParseOpaqueType(node, false);
+ }
+ }
+ }
+ return super.parseExpressionStatement(node, expr, decorators);
+ }
+ shouldParseExportDeclaration() {
+ const {
+ type
+ } = this.state;
+ if (tokenIsFlowInterfaceOrTypeOrOpaque(type) || this.shouldParseEnums() && type === 126) {
+ return !this.state.containsEsc;
+ }
+ return super.shouldParseExportDeclaration();
+ }
+ isExportDefaultSpecifier() {
+ const {
+ type
+ } = this.state;
+ if (tokenIsFlowInterfaceOrTypeOrOpaque(type) || this.shouldParseEnums() && type === 126) {
+ return this.state.containsEsc;
+ }
+ return super.isExportDefaultSpecifier();
+ }
+ parseExportDefaultExpression() {
+ if (this.shouldParseEnums() && this.isContextual(126)) {
+ const node = this.startNode();
+ this.next();
+ return this.flowParseEnumDeclaration(node);
+ }
+ return super.parseExportDefaultExpression();
+ }
+ parseConditional(expr, startLoc, refExpressionErrors) {
+ if (!this.match(17)) return expr;
+ if (this.state.maybeInArrowParameters) {
+ const nextCh = this.lookaheadCharCode();
+ if (nextCh === 44 || nextCh === 61 || nextCh === 58 || nextCh === 41) {
+ this.setOptionalParametersError(refExpressionErrors);
+ return expr;
+ }
+ }
+ this.expect(17);
+ const state = this.state.clone();
+ const originalNoArrowAt = this.state.noArrowAt;
+ const node = this.startNodeAt(startLoc);
+ let {
+ consequent,
+ failed
+ } = this.tryParseConditionalConsequent();
+ let [valid, invalid] = this.getArrowLikeExpressions(consequent);
+ if (failed || invalid.length > 0) {
+ const noArrowAt = [...originalNoArrowAt];
+ if (invalid.length > 0) {
+ this.state = state;
+ this.state.noArrowAt = noArrowAt;
+ for (let i = 0; i < invalid.length; i++) {
+ noArrowAt.push(invalid[i].start);
+ }
+ ({
+ consequent,
+ failed
+ } = this.tryParseConditionalConsequent());
+ [valid, invalid] = this.getArrowLikeExpressions(consequent);
+ }
+ if (failed && valid.length > 1) {
+ this.raise(FlowErrors.AmbiguousConditionalArrow, state.startLoc);
+ }
+ if (failed && valid.length === 1) {
+ this.state = state;
+ noArrowAt.push(valid[0].start);
+ this.state.noArrowAt = noArrowAt;
+ ({
+ consequent,
+ failed
+ } = this.tryParseConditionalConsequent());
+ }
+ }
+ this.getArrowLikeExpressions(consequent, true);
+ this.state.noArrowAt = originalNoArrowAt;
+ this.expect(14);
+ node.test = expr;
+ node.consequent = consequent;
+ node.alternate = this.forwardNoArrowParamsConversionAt(node, () => this.parseMaybeAssign(undefined, undefined));
+ return this.finishNode(node, "ConditionalExpression");
+ }
+ tryParseConditionalConsequent() {
+ this.state.noArrowParamsConversionAt.push(this.state.start);
+ const consequent = this.parseMaybeAssignAllowIn();
+ const failed = !this.match(14);
+ this.state.noArrowParamsConversionAt.pop();
+ return {
+ consequent,
+ failed
+ };
+ }
+ getArrowLikeExpressions(node, disallowInvalid) {
+ const stack = [node];
+ const arrows = [];
+ while (stack.length !== 0) {
+ const node = stack.pop();
+ if (node.type === "ArrowFunctionExpression" && node.body.type !== "BlockStatement") {
+ if (node.typeParameters || !node.returnType) {
+ this.finishArrowValidation(node);
+ } else {
+ arrows.push(node);
+ }
+ stack.push(node.body);
+ } else if (node.type === "ConditionalExpression") {
+ stack.push(node.consequent);
+ stack.push(node.alternate);
+ }
+ }
+ if (disallowInvalid) {
+ arrows.forEach(node => this.finishArrowValidation(node));
+ return [arrows, []];
+ }
+ return partition(arrows, node => node.params.every(param => this.isAssignable(param, true)));
+ }
+ finishArrowValidation(node) {
+ var _node$extra;
+ this.toAssignableList(node.params, (_node$extra = node.extra) == null ? void 0 : _node$extra.trailingCommaLoc, false);
+ this.scope.enter(2 | 4);
+ super.checkParams(node, false, true);
+ this.scope.exit();
+ }
+ forwardNoArrowParamsConversionAt(node, parse) {
+ let result;
+ if (this.state.noArrowParamsConversionAt.includes(node.start)) {
+ this.state.noArrowParamsConversionAt.push(this.state.start);
+ result = parse();
+ this.state.noArrowParamsConversionAt.pop();
+ } else {
+ result = parse();
+ }
+ return result;
+ }
+ parseParenItem(node, startLoc) {
+ const newNode = super.parseParenItem(node, startLoc);
+ if (this.eat(17)) {
+ newNode.optional = true;
+ this.resetEndLocation(node);
+ }
+ if (this.match(14)) {
+ const typeCastNode = this.startNodeAt(startLoc);
+ typeCastNode.expression = newNode;
+ typeCastNode.typeAnnotation = this.flowParseTypeAnnotation();
+ return this.finishNode(typeCastNode, "TypeCastExpression");
+ }
+ return newNode;
+ }
+ assertModuleNodeAllowed(node) {
+ if (node.type === "ImportDeclaration" && (node.importKind === "type" || node.importKind === "typeof") || node.type === "ExportNamedDeclaration" && node.exportKind === "type" || node.type === "ExportAllDeclaration" && node.exportKind === "type") {
+ return;
+ }
+ super.assertModuleNodeAllowed(node);
+ }
+ parseExportDeclaration(node) {
+ if (this.isContextual(130)) {
+ node.exportKind = "type";
+ const declarationNode = this.startNode();
+ this.next();
+ if (this.match(5)) {
+ node.specifiers = this.parseExportSpecifiers(true);
+ super.parseExportFrom(node);
+ return null;
+ } else {
+ return this.flowParseTypeAlias(declarationNode);
+ }
+ } else if (this.isContextual(131)) {
+ node.exportKind = "type";
+ const declarationNode = this.startNode();
+ this.next();
+ return this.flowParseOpaqueType(declarationNode, false);
+ } else if (this.isContextual(129)) {
+ node.exportKind = "type";
+ const declarationNode = this.startNode();
+ this.next();
+ return this.flowParseInterface(declarationNode);
+ } else if (this.shouldParseEnums() && this.isContextual(126)) {
+ node.exportKind = "value";
+ const declarationNode = this.startNode();
+ this.next();
+ return this.flowParseEnumDeclaration(declarationNode);
+ } else {
+ return super.parseExportDeclaration(node);
+ }
+ }
+ eatExportStar(node) {
+ if (super.eatExportStar(node)) return true;
+ if (this.isContextual(130) && this.lookahead().type === 55) {
+ node.exportKind = "type";
+ this.next();
+ this.next();
+ return true;
+ }
+ return false;
+ }
+ maybeParseExportNamespaceSpecifier(node) {
+ const {
+ startLoc
+ } = this.state;
+ const hasNamespace = super.maybeParseExportNamespaceSpecifier(node);
+ if (hasNamespace && node.exportKind === "type") {
+ this.unexpected(startLoc);
+ }
+ return hasNamespace;
+ }
+ parseClassId(node, isStatement, optionalId) {
+ super.parseClassId(node, isStatement, optionalId);
+ if (this.match(47)) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+ }
+ parseClassMember(classBody, member, state) {
+ const {
+ startLoc
+ } = this.state;
+ if (this.isContextual(125)) {
+ if (super.parseClassMemberFromModifier(classBody, member)) {
+ return;
+ }
+ member.declare = true;
+ }
+ super.parseClassMember(classBody, member, state);
+ if (member.declare) {
+ if (member.type !== "ClassProperty" && member.type !== "ClassPrivateProperty" && member.type !== "PropertyDefinition") {
+ this.raise(FlowErrors.DeclareClassElement, startLoc);
+ } else if (member.value) {
+ this.raise(FlowErrors.DeclareClassFieldInitializer, member.value);
+ }
+ }
+ }
+ isIterator(word) {
+ return word === "iterator" || word === "asyncIterator";
+ }
+ readIterator() {
+ const word = super.readWord1();
+ const fullWord = "@@" + word;
+ if (!this.isIterator(word) || !this.state.inType) {
+ this.raise(Errors.InvalidIdentifier, this.state.curPosition(), {
+ identifierName: fullWord
+ });
+ }
+ this.finishToken(132, fullWord);
+ }
+ getTokenFromCode(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+ if (code === 123 && next === 124) {
+ this.finishOp(6, 2);
+ } else if (this.state.inType && (code === 62 || code === 60)) {
+ this.finishOp(code === 62 ? 48 : 47, 1);
+ } else if (this.state.inType && code === 63) {
+ if (next === 46) {
+ this.finishOp(18, 2);
+ } else {
+ this.finishOp(17, 1);
+ }
+ } else if (isIteratorStart(code, next, this.input.charCodeAt(this.state.pos + 2))) {
+ this.state.pos += 2;
+ this.readIterator();
+ } else {
+ super.getTokenFromCode(code);
+ }
+ }
+ isAssignable(node, isBinding) {
+ if (node.type === "TypeCastExpression") {
+ return this.isAssignable(node.expression, isBinding);
+ } else {
+ return super.isAssignable(node, isBinding);
+ }
+ }
+ toAssignable(node, isLHS = false) {
+ if (!isLHS && node.type === "AssignmentExpression" && node.left.type === "TypeCastExpression") {
+ node.left = this.typeCastToParameter(node.left);
+ }
+ super.toAssignable(node, isLHS);
+ }
+ toAssignableList(exprList, trailingCommaLoc, isLHS) {
+ for (let i = 0; i < exprList.length; i++) {
+ const expr = exprList[i];
+ if ((expr == null ? void 0 : expr.type) === "TypeCastExpression") {
+ exprList[i] = this.typeCastToParameter(expr);
+ }
+ }
+ super.toAssignableList(exprList, trailingCommaLoc, isLHS);
+ }
+ toReferencedList(exprList, isParenthesizedExpr) {
+ for (let i = 0; i < exprList.length; i++) {
+ var _expr$extra;
+ const expr = exprList[i];
+ if (expr && expr.type === "TypeCastExpression" && !((_expr$extra = expr.extra) != null && _expr$extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) {
+ this.raise(FlowErrors.TypeCastInPattern, expr.typeAnnotation);
+ }
+ }
+ return exprList;
+ }
+ parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) {
+ const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors);
+ if (canBePattern && !this.state.maybeInArrowParameters) {
+ this.toReferencedList(node.elements);
+ }
+ return node;
+ }
+ isValidLVal(type, isParenthesized, binding) {
+ return type === "TypeCastExpression" || super.isValidLVal(type, isParenthesized, binding);
+ }
+ parseClassProperty(node) {
+ if (this.match(14)) {
+ node.typeAnnotation = this.flowParseTypeAnnotation();
+ }
+ return super.parseClassProperty(node);
+ }
+ parseClassPrivateProperty(node) {
+ if (this.match(14)) {
+ node.typeAnnotation = this.flowParseTypeAnnotation();
+ }
+ return super.parseClassPrivateProperty(node);
+ }
+ isClassMethod() {
+ return this.match(47) || super.isClassMethod();
+ }
+ isClassProperty() {
+ return this.match(14) || super.isClassProperty();
+ }
+ isNonstaticConstructor(method) {
+ return !this.match(14) && super.isNonstaticConstructor(method);
+ }
+ pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
+ if (method.variance) {
+ this.unexpected(method.variance.loc.start);
+ }
+ delete method.variance;
+ if (this.match(47)) {
+ method.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+ super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper);
+ if (method.params && isConstructor) {
+ const params = method.params;
+ if (params.length > 0 && this.isThisParam(params[0])) {
+ this.raise(FlowErrors.ThisParamBannedInConstructor, method);
+ }
+ } else if (method.type === "MethodDefinition" && isConstructor && method.value.params) {
+ const params = method.value.params;
+ if (params.length > 0 && this.isThisParam(params[0])) {
+ this.raise(FlowErrors.ThisParamBannedInConstructor, method);
+ }
+ }
+ }
+ pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {
+ if (method.variance) {
+ this.unexpected(method.variance.loc.start);
+ }
+ delete method.variance;
+ if (this.match(47)) {
+ method.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+ super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);
+ }
+ parseClassSuper(node) {
+ super.parseClassSuper(node);
+ if (node.superClass && this.match(47)) {
+ node.superTypeParameters = this.flowParseTypeParameterInstantiation();
+ }
+ if (this.isContextual(113)) {
+ this.next();
+ const implemented = node.implements = [];
+ do {
+ const node = this.startNode();
+ node.id = this.flowParseRestrictedIdentifier(true);
+ if (this.match(47)) {
+ node.typeParameters = this.flowParseTypeParameterInstantiation();
+ } else {
+ node.typeParameters = null;
+ }
+ implemented.push(this.finishNode(node, "ClassImplements"));
+ } while (this.eat(12));
+ }
+ }
+ checkGetterSetterParams(method) {
+ super.checkGetterSetterParams(method);
+ const params = this.getObjectOrClassMethodParams(method);
+ if (params.length > 0) {
+ const param = params[0];
+ if (this.isThisParam(param) && method.kind === "get") {
+ this.raise(FlowErrors.GetterMayNotHaveThisParam, param);
+ } else if (this.isThisParam(param)) {
+ this.raise(FlowErrors.SetterMayNotHaveThisParam, param);
+ }
+ }
+ }
+ parsePropertyNamePrefixOperator(node) {
+ node.variance = this.flowParseVariance();
+ }
+ parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) {
+ if (prop.variance) {
+ this.unexpected(prop.variance.loc.start);
+ }
+ delete prop.variance;
+ let typeParameters;
+ if (this.match(47) && !isAccessor) {
+ typeParameters = this.flowParseTypeParameterDeclaration();
+ if (!this.match(10)) this.unexpected();
+ }
+ const result = super.parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors);
+ if (typeParameters) {
+ (result.value || result).typeParameters = typeParameters;
+ }
+ return result;
+ }
+ parseAssignableListItemTypes(param) {
+ if (this.eat(17)) {
+ if (param.type !== "Identifier") {
+ this.raise(FlowErrors.PatternIsOptional, param);
+ }
+ if (this.isThisParam(param)) {
+ this.raise(FlowErrors.ThisParamMayNotBeOptional, param);
+ }
+ param.optional = true;
+ }
+ if (this.match(14)) {
+ param.typeAnnotation = this.flowParseTypeAnnotation();
+ } else if (this.isThisParam(param)) {
+ this.raise(FlowErrors.ThisParamAnnotationRequired, param);
+ }
+ if (this.match(29) && this.isThisParam(param)) {
+ this.raise(FlowErrors.ThisParamNoDefault, param);
+ }
+ this.resetEndLocation(param);
+ return param;
+ }
+ parseMaybeDefault(startLoc, left) {
+ const node = super.parseMaybeDefault(startLoc, left);
+ if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) {
+ this.raise(FlowErrors.TypeBeforeInitializer, node.typeAnnotation);
+ }
+ return node;
+ }
+ checkImportReflection(node) {
+ super.checkImportReflection(node);
+ if (node.module && node.importKind !== "value") {
+ this.raise(FlowErrors.ImportReflectionHasImportType, node.specifiers[0].loc.start);
+ }
+ }
+ parseImportSpecifierLocal(node, specifier, type) {
+ specifier.local = hasTypeImportKind(node) ? this.flowParseRestrictedIdentifier(true, true) : this.parseIdentifier();
+ node.specifiers.push(this.finishImportSpecifier(specifier, type));
+ }
+ isPotentialImportPhase(isExport) {
+ if (super.isPotentialImportPhase(isExport)) return true;
+ if (this.isContextual(130)) {
+ if (!isExport) return true;
+ const ch = this.lookaheadCharCode();
+ return ch === 123 || ch === 42;
+ }
+ return !isExport && this.isContextual(87);
+ }
+ applyImportPhase(node, isExport, phase, loc) {
+ super.applyImportPhase(node, isExport, phase, loc);
+ if (isExport) {
+ if (!phase && this.match(65)) {
+ return;
+ }
+ node.exportKind = phase === "type" ? phase : "value";
+ } else {
+ if (phase === "type" && this.match(55)) this.unexpected();
+ node.importKind = phase === "type" || phase === "typeof" ? phase : "value";
+ }
+ }
+ parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) {
+ const firstIdent = specifier.imported;
+ let specifierTypeKind = null;
+ if (firstIdent.type === "Identifier") {
+ if (firstIdent.name === "type") {
+ specifierTypeKind = "type";
+ } else if (firstIdent.name === "typeof") {
+ specifierTypeKind = "typeof";
+ }
+ }
+ let isBinding = false;
+ if (this.isContextual(93) && !this.isLookaheadContextual("as")) {
+ const as_ident = this.parseIdentifier(true);
+ if (specifierTypeKind !== null && !tokenIsKeywordOrIdentifier(this.state.type)) {
+ specifier.imported = as_ident;
+ specifier.importKind = specifierTypeKind;
+ specifier.local = cloneIdentifier(as_ident);
+ } else {
+ specifier.imported = firstIdent;
+ specifier.importKind = null;
+ specifier.local = this.parseIdentifier();
+ }
+ } else {
+ if (specifierTypeKind !== null && tokenIsKeywordOrIdentifier(this.state.type)) {
+ specifier.imported = this.parseIdentifier(true);
+ specifier.importKind = specifierTypeKind;
+ } else {
+ if (importedIsString) {
+ throw this.raise(Errors.ImportBindingIsString, specifier, {
+ importName: firstIdent.value
+ });
+ }
+ specifier.imported = firstIdent;
+ specifier.importKind = null;
+ }
+ if (this.eatContextual(93)) {
+ specifier.local = this.parseIdentifier();
+ } else {
+ isBinding = true;
+ specifier.local = cloneIdentifier(specifier.imported);
+ }
+ }
+ const specifierIsTypeImport = hasTypeImportKind(specifier);
+ if (isInTypeOnlyImport && specifierIsTypeImport) {
+ this.raise(FlowErrors.ImportTypeShorthandOnlyInPureImport, specifier);
+ }
+ if (isInTypeOnlyImport || specifierIsTypeImport) {
+ this.checkReservedType(specifier.local.name, specifier.local.loc.start, true);
+ }
+ if (isBinding && !isInTypeOnlyImport && !specifierIsTypeImport) {
+ this.checkReservedWord(specifier.local.name, specifier.loc.start, true, true);
+ }
+ return this.finishImportSpecifier(specifier, "ImportSpecifier");
+ }
+ parseBindingAtom() {
+ switch (this.state.type) {
+ case 78:
+ return this.parseIdentifier(true);
+ default:
+ return super.parseBindingAtom();
+ }
+ }
+ parseFunctionParams(node, isConstructor) {
+ const kind = node.kind;
+ if (kind !== "get" && kind !== "set" && this.match(47)) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+ super.parseFunctionParams(node, isConstructor);
+ }
+ parseVarId(decl, kind) {
+ super.parseVarId(decl, kind);
+ if (this.match(14)) {
+ decl.id.typeAnnotation = this.flowParseTypeAnnotation();
+ this.resetEndLocation(decl.id);
+ }
+ }
+ parseAsyncArrowFromCallExpression(node, call) {
+ if (this.match(14)) {
+ const oldNoAnonFunctionType = this.state.noAnonFunctionType;
+ this.state.noAnonFunctionType = true;
+ node.returnType = this.flowParseTypeAnnotation();
+ this.state.noAnonFunctionType = oldNoAnonFunctionType;
+ }
+ return super.parseAsyncArrowFromCallExpression(node, call);
+ }
+ shouldParseAsyncArrow() {
+ return this.match(14) || super.shouldParseAsyncArrow();
+ }
+ parseMaybeAssign(refExpressionErrors, afterLeftParse) {
+ var _jsx;
+ let state = null;
+ let jsx;
+ if (this.hasPlugin("jsx") && (this.match(142) || this.match(47))) {
+ state = this.state.clone();
+ jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state);
+ if (!jsx.error) return jsx.node;
+ const {
+ context
+ } = this.state;
+ const currentContext = context[context.length - 1];
+ if (currentContext === types.j_oTag || currentContext === types.j_expr) {
+ context.pop();
+ }
+ }
+ if ((_jsx = jsx) != null && _jsx.error || this.match(47)) {
+ var _jsx2, _jsx3;
+ state = state || this.state.clone();
+ let typeParameters;
+ const arrow = this.tryParse(abort => {
+ var _arrowExpression$extr;
+ typeParameters = this.flowParseTypeParameterDeclaration();
+ const arrowExpression = this.forwardNoArrowParamsConversionAt(typeParameters, () => {
+ const result = super.parseMaybeAssign(refExpressionErrors, afterLeftParse);
+ this.resetStartLocationFromNode(result, typeParameters);
+ return result;
+ });
+ if ((_arrowExpression$extr = arrowExpression.extra) != null && _arrowExpression$extr.parenthesized) abort();
+ const expr = this.maybeUnwrapTypeCastExpression(arrowExpression);
+ if (expr.type !== "ArrowFunctionExpression") abort();
+ expr.typeParameters = typeParameters;
+ this.resetStartLocationFromNode(expr, typeParameters);
+ return arrowExpression;
+ }, state);
+ let arrowExpression = null;
+ if (arrow.node && this.maybeUnwrapTypeCastExpression(arrow.node).type === "ArrowFunctionExpression") {
+ if (!arrow.error && !arrow.aborted) {
+ if (arrow.node.async) {
+ this.raise(FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction, typeParameters);
+ }
+ return arrow.node;
+ }
+ arrowExpression = arrow.node;
+ }
+ if ((_jsx2 = jsx) != null && _jsx2.node) {
+ this.state = jsx.failState;
+ return jsx.node;
+ }
+ if (arrowExpression) {
+ this.state = arrow.failState;
+ return arrowExpression;
+ }
+ if ((_jsx3 = jsx) != null && _jsx3.thrown) throw jsx.error;
+ if (arrow.thrown) throw arrow.error;
+ throw this.raise(FlowErrors.UnexpectedTokenAfterTypeParameter, typeParameters);
+ }
+ return super.parseMaybeAssign(refExpressionErrors, afterLeftParse);
+ }
+ parseArrow(node) {
+ if (this.match(14)) {
+ const result = this.tryParse(() => {
+ const oldNoAnonFunctionType = this.state.noAnonFunctionType;
+ this.state.noAnonFunctionType = true;
+ const typeNode = this.startNode();
+ [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser();
+ this.state.noAnonFunctionType = oldNoAnonFunctionType;
+ if (this.canInsertSemicolon()) this.unexpected();
+ if (!this.match(19)) this.unexpected();
+ return typeNode;
+ });
+ if (result.thrown) return null;
+ if (result.error) this.state = result.failState;
+ node.returnType = result.node.typeAnnotation ? this.finishNode(result.node, "TypeAnnotation") : null;
+ }
+ return super.parseArrow(node);
+ }
+ shouldParseArrow(params) {
+ return this.match(14) || super.shouldParseArrow(params);
+ }
+ setArrowFunctionParameters(node, params) {
+ if (this.state.noArrowParamsConversionAt.includes(node.start)) {
+ node.params = params;
+ } else {
+ super.setArrowFunctionParameters(node, params);
+ }
+ }
+ checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) {
+ if (isArrowFunction && this.state.noArrowParamsConversionAt.includes(node.start)) {
+ return;
+ }
+ for (let i = 0; i < node.params.length; i++) {
+ if (this.isThisParam(node.params[i]) && i > 0) {
+ this.raise(FlowErrors.ThisParamMustBeFirst, node.params[i]);
+ }
+ }
+ super.checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged);
+ }
+ parseParenAndDistinguishExpression(canBeArrow) {
+ return super.parseParenAndDistinguishExpression(canBeArrow && !this.state.noArrowAt.includes(this.state.start));
+ }
+ parseSubscripts(base, startLoc, noCalls) {
+ if (base.type === "Identifier" && base.name === "async" && this.state.noArrowAt.includes(startLoc.index)) {
+ this.next();
+ const node = this.startNodeAt(startLoc);
+ node.callee = base;
+ node.arguments = super.parseCallExpressionArguments(11, false);
+ base = this.finishNode(node, "CallExpression");
+ } else if (base.type === "Identifier" && base.name === "async" && this.match(47)) {
+ const state = this.state.clone();
+ const arrow = this.tryParse(abort => this.parseAsyncArrowWithTypeParameters(startLoc) || abort(), state);
+ if (!arrow.error && !arrow.aborted) return arrow.node;
+ const result = this.tryParse(() => super.parseSubscripts(base, startLoc, noCalls), state);
+ if (result.node && !result.error) return result.node;
+ if (arrow.node) {
+ this.state = arrow.failState;
+ return arrow.node;
+ }
+ if (result.node) {
+ this.state = result.failState;
+ return result.node;
+ }
+ throw arrow.error || result.error;
+ }
+ return super.parseSubscripts(base, startLoc, noCalls);
+ }
+ parseSubscript(base, startLoc, noCalls, subscriptState) {
+ if (this.match(18) && this.isLookaheadToken_lt()) {
+ subscriptState.optionalChainMember = true;
+ if (noCalls) {
+ subscriptState.stop = true;
+ return base;
+ }
+ this.next();
+ const node = this.startNodeAt(startLoc);
+ node.callee = base;
+ node.typeArguments = this.flowParseTypeParameterInstantiation();
+ this.expect(10);
+ node.arguments = this.parseCallExpressionArguments(11, false);
+ node.optional = true;
+ return this.finishCallExpression(node, true);
+ } else if (!noCalls && this.shouldParseTypes() && this.match(47)) {
+ const node = this.startNodeAt(startLoc);
+ node.callee = base;
+ const result = this.tryParse(() => {
+ node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew();
+ this.expect(10);
+ node.arguments = super.parseCallExpressionArguments(11, false);
+ if (subscriptState.optionalChainMember) {
+ node.optional = false;
+ }
+ return this.finishCallExpression(node, subscriptState.optionalChainMember);
+ });
+ if (result.node) {
+ if (result.error) this.state = result.failState;
+ return result.node;
+ }
+ }
+ return super.parseSubscript(base, startLoc, noCalls, subscriptState);
+ }
+ parseNewCallee(node) {
+ super.parseNewCallee(node);
+ let targs = null;
+ if (this.shouldParseTypes() && this.match(47)) {
+ targs = this.tryParse(() => this.flowParseTypeParameterInstantiationCallOrNew()).node;
+ }
+ node.typeArguments = targs;
+ }
+ parseAsyncArrowWithTypeParameters(startLoc) {
+ const node = this.startNodeAt(startLoc);
+ this.parseFunctionParams(node, false);
+ if (!this.parseArrow(node)) return;
+ return super.parseArrowExpression(node, undefined, true);
+ }
+ readToken_mult_modulo(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+ if (code === 42 && next === 47 && this.state.hasFlowComment) {
+ this.state.hasFlowComment = false;
+ this.state.pos += 2;
+ this.nextToken();
+ return;
+ }
+ super.readToken_mult_modulo(code);
+ }
+ readToken_pipe_amp(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+ if (code === 124 && next === 125) {
+ this.finishOp(9, 2);
+ return;
+ }
+ super.readToken_pipe_amp(code);
+ }
+ parseTopLevel(file, program) {
+ const fileNode = super.parseTopLevel(file, program);
+ if (this.state.hasFlowComment) {
+ this.raise(FlowErrors.UnterminatedFlowComment, this.state.curPosition());
+ }
+ return fileNode;
+ }
+ skipBlockComment() {
+ if (this.hasPlugin("flowComments") && this.skipFlowComment()) {
+ if (this.state.hasFlowComment) {
+ throw this.raise(FlowErrors.NestedFlowComment, this.state.startLoc);
+ }
+ this.hasFlowCommentCompletion();
+ const commentSkip = this.skipFlowComment();
+ if (commentSkip) {
+ this.state.pos += commentSkip;
+ this.state.hasFlowComment = true;
+ }
+ return;
+ }
+ return super.skipBlockComment(this.state.hasFlowComment ? "*-/" : "*/");
+ }
+ skipFlowComment() {
+ const {
+ pos
+ } = this.state;
+ let shiftToFirstNonWhiteSpace = 2;
+ while ([32, 9].includes(this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace))) {
+ shiftToFirstNonWhiteSpace++;
+ }
+ const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos);
+ const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1);
+ if (ch2 === 58 && ch3 === 58) {
+ return shiftToFirstNonWhiteSpace + 2;
+ }
+ if (this.input.slice(shiftToFirstNonWhiteSpace + pos, shiftToFirstNonWhiteSpace + pos + 12) === "flow-include") {
+ return shiftToFirstNonWhiteSpace + 12;
+ }
+ if (ch2 === 58 && ch3 !== 58) {
+ return shiftToFirstNonWhiteSpace;
+ }
+ return false;
+ }
+ hasFlowCommentCompletion() {
+ const end = this.input.indexOf("*/", this.state.pos);
+ if (end === -1) {
+ throw this.raise(Errors.UnterminatedComment, this.state.curPosition());
+ }
+ }
+ flowEnumErrorBooleanMemberNotInitialized(loc, {
+ enumName,
+ memberName
+ }) {
+ this.raise(FlowErrors.EnumBooleanMemberNotInitialized, loc, {
+ memberName,
+ enumName
+ });
+ }
+ flowEnumErrorInvalidMemberInitializer(loc, enumContext) {
+ return this.raise(!enumContext.explicitType ? FlowErrors.EnumInvalidMemberInitializerUnknownType : enumContext.explicitType === "symbol" ? FlowErrors.EnumInvalidMemberInitializerSymbolType : FlowErrors.EnumInvalidMemberInitializerPrimaryType, loc, enumContext);
+ }
+ flowEnumErrorNumberMemberNotInitialized(loc, details) {
+ this.raise(FlowErrors.EnumNumberMemberNotInitialized, loc, details);
+ }
+ flowEnumErrorStringMemberInconsistentlyInitialized(node, details) {
+ this.raise(FlowErrors.EnumStringMemberInconsistentlyInitialized, node, details);
+ }
+ flowEnumMemberInit() {
+ const startLoc = this.state.startLoc;
+ const endOfInit = () => this.match(12) || this.match(8);
+ switch (this.state.type) {
+ case 134:
+ {
+ const literal = this.parseNumericLiteral(this.state.value);
+ if (endOfInit()) {
+ return {
+ type: "number",
+ loc: literal.loc.start,
+ value: literal
+ };
+ }
+ return {
+ type: "invalid",
+ loc: startLoc
+ };
+ }
+ case 133:
+ {
+ const literal = this.parseStringLiteral(this.state.value);
+ if (endOfInit()) {
+ return {
+ type: "string",
+ loc: literal.loc.start,
+ value: literal
+ };
+ }
+ return {
+ type: "invalid",
+ loc: startLoc
+ };
+ }
+ case 85:
+ case 86:
+ {
+ const literal = this.parseBooleanLiteral(this.match(85));
+ if (endOfInit()) {
+ return {
+ type: "boolean",
+ loc: literal.loc.start,
+ value: literal
+ };
+ }
+ return {
+ type: "invalid",
+ loc: startLoc
+ };
+ }
+ default:
+ return {
+ type: "invalid",
+ loc: startLoc
+ };
+ }
+ }
+ flowEnumMemberRaw() {
+ const loc = this.state.startLoc;
+ const id = this.parseIdentifier(true);
+ const init = this.eat(29) ? this.flowEnumMemberInit() : {
+ type: "none",
+ loc
+ };
+ return {
+ id,
+ init
+ };
+ }
+ flowEnumCheckExplicitTypeMismatch(loc, context, expectedType) {
+ const {
+ explicitType
+ } = context;
+ if (explicitType === null) {
+ return;
+ }
+ if (explicitType !== expectedType) {
+ this.flowEnumErrorInvalidMemberInitializer(loc, context);
+ }
+ }
+ flowEnumMembers({
+ enumName,
+ explicitType
+ }) {
+ const seenNames = new Set();
+ const members = {
+ booleanMembers: [],
+ numberMembers: [],
+ stringMembers: [],
+ defaultedMembers: []
+ };
+ let hasUnknownMembers = false;
+ while (!this.match(8)) {
+ if (this.eat(21)) {
+ hasUnknownMembers = true;
+ break;
+ }
+ const memberNode = this.startNode();
+ const {
+ id,
+ init
+ } = this.flowEnumMemberRaw();
+ const memberName = id.name;
+ if (memberName === "") {
+ continue;
+ }
+ if (/^[a-z]/.test(memberName)) {
+ this.raise(FlowErrors.EnumInvalidMemberName, id, {
+ memberName,
+ suggestion: memberName[0].toUpperCase() + memberName.slice(1),
+ enumName
+ });
+ }
+ if (seenNames.has(memberName)) {
+ this.raise(FlowErrors.EnumDuplicateMemberName, id, {
+ memberName,
+ enumName
+ });
+ }
+ seenNames.add(memberName);
+ const context = {
+ enumName,
+ explicitType,
+ memberName
+ };
+ memberNode.id = id;
+ switch (init.type) {
+ case "boolean":
+ {
+ this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "boolean");
+ memberNode.init = init.value;
+ members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember"));
+ break;
+ }
+ case "number":
+ {
+ this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "number");
+ memberNode.init = init.value;
+ members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember"));
+ break;
+ }
+ case "string":
+ {
+ this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "string");
+ memberNode.init = init.value;
+ members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember"));
+ break;
+ }
+ case "invalid":
+ {
+ throw this.flowEnumErrorInvalidMemberInitializer(init.loc, context);
+ }
+ case "none":
+ {
+ switch (explicitType) {
+ case "boolean":
+ this.flowEnumErrorBooleanMemberNotInitialized(init.loc, context);
+ break;
+ case "number":
+ this.flowEnumErrorNumberMemberNotInitialized(init.loc, context);
+ break;
+ default:
+ members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember"));
+ }
+ }
+ }
+ if (!this.match(8)) {
+ this.expect(12);
+ }
+ }
+ return {
+ members,
+ hasUnknownMembers
+ };
+ }
+ flowEnumStringMembers(initializedMembers, defaultedMembers, {
+ enumName
+ }) {
+ if (initializedMembers.length === 0) {
+ return defaultedMembers;
+ } else if (defaultedMembers.length === 0) {
+ return initializedMembers;
+ } else if (defaultedMembers.length > initializedMembers.length) {
+ for (const member of initializedMembers) {
+ this.flowEnumErrorStringMemberInconsistentlyInitialized(member, {
+ enumName
+ });
+ }
+ return defaultedMembers;
+ } else {
+ for (const member of defaultedMembers) {
+ this.flowEnumErrorStringMemberInconsistentlyInitialized(member, {
+ enumName
+ });
+ }
+ return initializedMembers;
+ }
+ }
+ flowEnumParseExplicitType({
+ enumName
+ }) {
+ if (!this.eatContextual(102)) return null;
+ if (!tokenIsIdentifier(this.state.type)) {
+ throw this.raise(FlowErrors.EnumInvalidExplicitTypeUnknownSupplied, this.state.startLoc, {
+ enumName
+ });
+ }
+ const {
+ value
+ } = this.state;
+ this.next();
+ if (value !== "boolean" && value !== "number" && value !== "string" && value !== "symbol") {
+ this.raise(FlowErrors.EnumInvalidExplicitType, this.state.startLoc, {
+ enumName,
+ invalidEnumType: value
+ });
+ }
+ return value;
+ }
+ flowEnumBody(node, id) {
+ const enumName = id.name;
+ const nameLoc = id.loc.start;
+ const explicitType = this.flowEnumParseExplicitType({
+ enumName
+ });
+ this.expect(5);
+ const {
+ members,
+ hasUnknownMembers
+ } = this.flowEnumMembers({
+ enumName,
+ explicitType
+ });
+ node.hasUnknownMembers = hasUnknownMembers;
+ switch (explicitType) {
+ case "boolean":
+ node.explicitType = true;
+ node.members = members.booleanMembers;
+ this.expect(8);
+ return this.finishNode(node, "EnumBooleanBody");
+ case "number":
+ node.explicitType = true;
+ node.members = members.numberMembers;
+ this.expect(8);
+ return this.finishNode(node, "EnumNumberBody");
+ case "string":
+ node.explicitType = true;
+ node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, {
+ enumName
+ });
+ this.expect(8);
+ return this.finishNode(node, "EnumStringBody");
+ case "symbol":
+ node.members = members.defaultedMembers;
+ this.expect(8);
+ return this.finishNode(node, "EnumSymbolBody");
+ default:
+ {
+ const empty = () => {
+ node.members = [];
+ this.expect(8);
+ return this.finishNode(node, "EnumStringBody");
+ };
+ node.explicitType = false;
+ const boolsLen = members.booleanMembers.length;
+ const numsLen = members.numberMembers.length;
+ const strsLen = members.stringMembers.length;
+ const defaultedLen = members.defaultedMembers.length;
+ if (!boolsLen && !numsLen && !strsLen && !defaultedLen) {
+ return empty();
+ } else if (!boolsLen && !numsLen) {
+ node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, {
+ enumName
+ });
+ this.expect(8);
+ return this.finishNode(node, "EnumStringBody");
+ } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) {
+ for (const member of members.defaultedMembers) {
+ this.flowEnumErrorBooleanMemberNotInitialized(member.loc.start, {
+ enumName,
+ memberName: member.id.name
+ });
+ }
+ node.members = members.booleanMembers;
+ this.expect(8);
+ return this.finishNode(node, "EnumBooleanBody");
+ } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) {
+ for (const member of members.defaultedMembers) {
+ this.flowEnumErrorNumberMemberNotInitialized(member.loc.start, {
+ enumName,
+ memberName: member.id.name
+ });
+ }
+ node.members = members.numberMembers;
+ this.expect(8);
+ return this.finishNode(node, "EnumNumberBody");
+ } else {
+ this.raise(FlowErrors.EnumInconsistentMemberValues, nameLoc, {
+ enumName
+ });
+ return empty();
+ }
+ }
+ }
+ }
+ flowParseEnumDeclaration(node) {
+ const id = this.parseIdentifier();
+ node.id = id;
+ node.body = this.flowEnumBody(this.startNode(), id);
+ return this.finishNode(node, "EnumDeclaration");
+ }
+ isLookaheadToken_lt() {
+ const next = this.nextTokenStart();
+ if (this.input.charCodeAt(next) === 60) {
+ const afterNext = this.input.charCodeAt(next + 1);
+ return afterNext !== 60 && afterNext !== 61;
+ }
+ return false;
+ }
+ maybeUnwrapTypeCastExpression(node) {
+ return node.type === "TypeCastExpression" ? node.expression : node;
+ }
+};
+const entities = {
+ __proto__: null,
+ quot: "\u0022",
+ amp: "&",
+ apos: "\u0027",
+ lt: "<",
+ gt: ">",
+ nbsp: "\u00A0",
+ iexcl: "\u00A1",
+ cent: "\u00A2",
+ pound: "\u00A3",
+ curren: "\u00A4",
+ yen: "\u00A5",
+ brvbar: "\u00A6",
+ sect: "\u00A7",
+ uml: "\u00A8",
+ copy: "\u00A9",
+ ordf: "\u00AA",
+ laquo: "\u00AB",
+ not: "\u00AC",
+ shy: "\u00AD",
+ reg: "\u00AE",
+ macr: "\u00AF",
+ deg: "\u00B0",
+ plusmn: "\u00B1",
+ sup2: "\u00B2",
+ sup3: "\u00B3",
+ acute: "\u00B4",
+ micro: "\u00B5",
+ para: "\u00B6",
+ middot: "\u00B7",
+ cedil: "\u00B8",
+ sup1: "\u00B9",
+ ordm: "\u00BA",
+ raquo: "\u00BB",
+ frac14: "\u00BC",
+ frac12: "\u00BD",
+ frac34: "\u00BE",
+ iquest: "\u00BF",
+ Agrave: "\u00C0",
+ Aacute: "\u00C1",
+ Acirc: "\u00C2",
+ Atilde: "\u00C3",
+ Auml: "\u00C4",
+ Aring: "\u00C5",
+ AElig: "\u00C6",
+ Ccedil: "\u00C7",
+ Egrave: "\u00C8",
+ Eacute: "\u00C9",
+ Ecirc: "\u00CA",
+ Euml: "\u00CB",
+ Igrave: "\u00CC",
+ Iacute: "\u00CD",
+ Icirc: "\u00CE",
+ Iuml: "\u00CF",
+ ETH: "\u00D0",
+ Ntilde: "\u00D1",
+ Ograve: "\u00D2",
+ Oacute: "\u00D3",
+ Ocirc: "\u00D4",
+ Otilde: "\u00D5",
+ Ouml: "\u00D6",
+ times: "\u00D7",
+ Oslash: "\u00D8",
+ Ugrave: "\u00D9",
+ Uacute: "\u00DA",
+ Ucirc: "\u00DB",
+ Uuml: "\u00DC",
+ Yacute: "\u00DD",
+ THORN: "\u00DE",
+ szlig: "\u00DF",
+ agrave: "\u00E0",
+ aacute: "\u00E1",
+ acirc: "\u00E2",
+ atilde: "\u00E3",
+ auml: "\u00E4",
+ aring: "\u00E5",
+ aelig: "\u00E6",
+ ccedil: "\u00E7",
+ egrave: "\u00E8",
+ eacute: "\u00E9",
+ ecirc: "\u00EA",
+ euml: "\u00EB",
+ igrave: "\u00EC",
+ iacute: "\u00ED",
+ icirc: "\u00EE",
+ iuml: "\u00EF",
+ eth: "\u00F0",
+ ntilde: "\u00F1",
+ ograve: "\u00F2",
+ oacute: "\u00F3",
+ ocirc: "\u00F4",
+ otilde: "\u00F5",
+ ouml: "\u00F6",
+ divide: "\u00F7",
+ oslash: "\u00F8",
+ ugrave: "\u00F9",
+ uacute: "\u00FA",
+ ucirc: "\u00FB",
+ uuml: "\u00FC",
+ yacute: "\u00FD",
+ thorn: "\u00FE",
+ yuml: "\u00FF",
+ OElig: "\u0152",
+ oelig: "\u0153",
+ Scaron: "\u0160",
+ scaron: "\u0161",
+ Yuml: "\u0178",
+ fnof: "\u0192",
+ circ: "\u02C6",
+ tilde: "\u02DC",
+ Alpha: "\u0391",
+ Beta: "\u0392",
+ Gamma: "\u0393",
+ Delta: "\u0394",
+ Epsilon: "\u0395",
+ Zeta: "\u0396",
+ Eta: "\u0397",
+ Theta: "\u0398",
+ Iota: "\u0399",
+ Kappa: "\u039A",
+ Lambda: "\u039B",
+ Mu: "\u039C",
+ Nu: "\u039D",
+ Xi: "\u039E",
+ Omicron: "\u039F",
+ Pi: "\u03A0",
+ Rho: "\u03A1",
+ Sigma: "\u03A3",
+ Tau: "\u03A4",
+ Upsilon: "\u03A5",
+ Phi: "\u03A6",
+ Chi: "\u03A7",
+ Psi: "\u03A8",
+ Omega: "\u03A9",
+ alpha: "\u03B1",
+ beta: "\u03B2",
+ gamma: "\u03B3",
+ delta: "\u03B4",
+ epsilon: "\u03B5",
+ zeta: "\u03B6",
+ eta: "\u03B7",
+ theta: "\u03B8",
+ iota: "\u03B9",
+ kappa: "\u03BA",
+ lambda: "\u03BB",
+ mu: "\u03BC",
+ nu: "\u03BD",
+ xi: "\u03BE",
+ omicron: "\u03BF",
+ pi: "\u03C0",
+ rho: "\u03C1",
+ sigmaf: "\u03C2",
+ sigma: "\u03C3",
+ tau: "\u03C4",
+ upsilon: "\u03C5",
+ phi: "\u03C6",
+ chi: "\u03C7",
+ psi: "\u03C8",
+ omega: "\u03C9",
+ thetasym: "\u03D1",
+ upsih: "\u03D2",
+ piv: "\u03D6",
+ ensp: "\u2002",
+ emsp: "\u2003",
+ thinsp: "\u2009",
+ zwnj: "\u200C",
+ zwj: "\u200D",
+ lrm: "\u200E",
+ rlm: "\u200F",
+ ndash: "\u2013",
+ mdash: "\u2014",
+ lsquo: "\u2018",
+ rsquo: "\u2019",
+ sbquo: "\u201A",
+ ldquo: "\u201C",
+ rdquo: "\u201D",
+ bdquo: "\u201E",
+ dagger: "\u2020",
+ Dagger: "\u2021",
+ bull: "\u2022",
+ hellip: "\u2026",
+ permil: "\u2030",
+ prime: "\u2032",
+ Prime: "\u2033",
+ lsaquo: "\u2039",
+ rsaquo: "\u203A",
+ oline: "\u203E",
+ frasl: "\u2044",
+ euro: "\u20AC",
+ image: "\u2111",
+ weierp: "\u2118",
+ real: "\u211C",
+ trade: "\u2122",
+ alefsym: "\u2135",
+ larr: "\u2190",
+ uarr: "\u2191",
+ rarr: "\u2192",
+ darr: "\u2193",
+ harr: "\u2194",
+ crarr: "\u21B5",
+ lArr: "\u21D0",
+ uArr: "\u21D1",
+ rArr: "\u21D2",
+ dArr: "\u21D3",
+ hArr: "\u21D4",
+ forall: "\u2200",
+ part: "\u2202",
+ exist: "\u2203",
+ empty: "\u2205",
+ nabla: "\u2207",
+ isin: "\u2208",
+ notin: "\u2209",
+ ni: "\u220B",
+ prod: "\u220F",
+ sum: "\u2211",
+ minus: "\u2212",
+ lowast: "\u2217",
+ radic: "\u221A",
+ prop: "\u221D",
+ infin: "\u221E",
+ ang: "\u2220",
+ and: "\u2227",
+ or: "\u2228",
+ cap: "\u2229",
+ cup: "\u222A",
+ int: "\u222B",
+ there4: "\u2234",
+ sim: "\u223C",
+ cong: "\u2245",
+ asymp: "\u2248",
+ ne: "\u2260",
+ equiv: "\u2261",
+ le: "\u2264",
+ ge: "\u2265",
+ sub: "\u2282",
+ sup: "\u2283",
+ nsub: "\u2284",
+ sube: "\u2286",
+ supe: "\u2287",
+ oplus: "\u2295",
+ otimes: "\u2297",
+ perp: "\u22A5",
+ sdot: "\u22C5",
+ lceil: "\u2308",
+ rceil: "\u2309",
+ lfloor: "\u230A",
+ rfloor: "\u230B",
+ lang: "\u2329",
+ rang: "\u232A",
+ loz: "\u25CA",
+ spades: "\u2660",
+ clubs: "\u2663",
+ hearts: "\u2665",
+ diams: "\u2666"
+};
+const JsxErrors = ParseErrorEnum`jsx`({
+ AttributeIsEmpty: "JSX attributes must only be assigned a non-empty expression.",
+ MissingClosingTagElement: ({
+ openingTagName
+ }) => `Expected corresponding JSX closing tag for <${openingTagName}>.`,
+ MissingClosingTagFragment: "Expected corresponding JSX closing tag for <>.",
+ UnexpectedSequenceExpression: "Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",
+ UnexpectedToken: ({
+ unexpected,
+ HTMLEntity
+ }) => `Unexpected token \`${unexpected}\`. Did you mean \`${HTMLEntity}\` or \`{'${unexpected}'}\`?`,
+ UnsupportedJsxValue: "JSX value should be either an expression or a quoted JSX text.",
+ UnterminatedJsxContent: "Unterminated JSX contents.",
+ UnwrappedAdjacentJSXElements: "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...>?"
+});
+function isFragment(object) {
+ return object ? object.type === "JSXOpeningFragment" || object.type === "JSXClosingFragment" : false;
+}
+function getQualifiedJSXName(object) {
+ if (object.type === "JSXIdentifier") {
+ return object.name;
+ }
+ if (object.type === "JSXNamespacedName") {
+ return object.namespace.name + ":" + object.name.name;
+ }
+ if (object.type === "JSXMemberExpression") {
+ return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property);
+ }
+ throw new Error("Node had unexpected type: " + object.type);
+}
+var jsx = superClass => class JSXParserMixin extends superClass {
+ jsxReadToken() {
+ let out = "";
+ let chunkStart = this.state.pos;
+ for (;;) {
+ if (this.state.pos >= this.length) {
+ throw this.raise(JsxErrors.UnterminatedJsxContent, this.state.startLoc);
+ }
+ const ch = this.input.charCodeAt(this.state.pos);
+ switch (ch) {
+ case 60:
+ case 123:
+ if (this.state.pos === this.state.start) {
+ if (ch === 60 && this.state.canStartJSXElement) {
+ ++this.state.pos;
+ this.finishToken(142);
+ } else {
+ super.getTokenFromCode(ch);
+ }
+ return;
+ }
+ out += this.input.slice(chunkStart, this.state.pos);
+ this.finishToken(141, out);
+ return;
+ case 38:
+ out += this.input.slice(chunkStart, this.state.pos);
+ out += this.jsxReadEntity();
+ chunkStart = this.state.pos;
+ break;
+ case 62:
+ case 125:
+ default:
+ if (isNewLine(ch)) {
+ out += this.input.slice(chunkStart, this.state.pos);
+ out += this.jsxReadNewLine(true);
+ chunkStart = this.state.pos;
+ } else {
+ ++this.state.pos;
+ }
+ }
+ }
+ }
+ jsxReadNewLine(normalizeCRLF) {
+ const ch = this.input.charCodeAt(this.state.pos);
+ let out;
+ ++this.state.pos;
+ if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) {
+ ++this.state.pos;
+ out = normalizeCRLF ? "\n" : "\r\n";
+ } else {
+ out = String.fromCharCode(ch);
+ }
+ ++this.state.curLine;
+ this.state.lineStart = this.state.pos;
+ return out;
+ }
+ jsxReadString(quote) {
+ let out = "";
+ let chunkStart = ++this.state.pos;
+ for (;;) {
+ if (this.state.pos >= this.length) {
+ throw this.raise(Errors.UnterminatedString, this.state.startLoc);
+ }
+ const ch = this.input.charCodeAt(this.state.pos);
+ if (ch === quote) break;
+ if (ch === 38) {
+ out += this.input.slice(chunkStart, this.state.pos);
+ out += this.jsxReadEntity();
+ chunkStart = this.state.pos;
+ } else if (isNewLine(ch)) {
+ out += this.input.slice(chunkStart, this.state.pos);
+ out += this.jsxReadNewLine(false);
+ chunkStart = this.state.pos;
+ } else {
+ ++this.state.pos;
+ }
+ }
+ out += this.input.slice(chunkStart, this.state.pos++);
+ this.finishToken(133, out);
+ }
+ jsxReadEntity() {
+ const startPos = ++this.state.pos;
+ if (this.codePointAtPos(this.state.pos) === 35) {
+ ++this.state.pos;
+ let radix = 10;
+ if (this.codePointAtPos(this.state.pos) === 120) {
+ radix = 16;
+ ++this.state.pos;
+ }
+ const codePoint = this.readInt(radix, undefined, false, "bail");
+ if (codePoint !== null && this.codePointAtPos(this.state.pos) === 59) {
+ ++this.state.pos;
+ return String.fromCodePoint(codePoint);
+ }
+ } else {
+ let count = 0;
+ let semi = false;
+ while (count++ < 10 && this.state.pos < this.length && !(semi = this.codePointAtPos(this.state.pos) === 59)) {
+ ++this.state.pos;
+ }
+ if (semi) {
+ const desc = this.input.slice(startPos, this.state.pos);
+ const entity = entities[desc];
+ ++this.state.pos;
+ if (entity) {
+ return entity;
+ }
+ }
+ }
+ this.state.pos = startPos;
+ return "&";
+ }
+ jsxReadWord() {
+ let ch;
+ const start = this.state.pos;
+ do {
+ ch = this.input.charCodeAt(++this.state.pos);
+ } while (isIdentifierChar(ch) || ch === 45);
+ this.finishToken(140, this.input.slice(start, this.state.pos));
+ }
+ jsxParseIdentifier() {
+ const node = this.startNode();
+ if (this.match(140)) {
+ node.name = this.state.value;
+ } else if (tokenIsKeyword(this.state.type)) {
+ node.name = tokenLabelName(this.state.type);
+ } else {
+ this.unexpected();
+ }
+ this.next();
+ return this.finishNode(node, "JSXIdentifier");
+ }
+ jsxParseNamespacedName() {
+ const startLoc = this.state.startLoc;
+ const name = this.jsxParseIdentifier();
+ if (!this.eat(14)) return name;
+ const node = this.startNodeAt(startLoc);
+ node.namespace = name;
+ node.name = this.jsxParseIdentifier();
+ return this.finishNode(node, "JSXNamespacedName");
+ }
+ jsxParseElementName() {
+ const startLoc = this.state.startLoc;
+ let node = this.jsxParseNamespacedName();
+ if (node.type === "JSXNamespacedName") {
+ return node;
+ }
+ while (this.eat(16)) {
+ const newNode = this.startNodeAt(startLoc);
+ newNode.object = node;
+ newNode.property = this.jsxParseIdentifier();
+ node = this.finishNode(newNode, "JSXMemberExpression");
+ }
+ return node;
+ }
+ jsxParseAttributeValue() {
+ let node;
+ switch (this.state.type) {
+ case 5:
+ node = this.startNode();
+ this.setContext(types.brace);
+ this.next();
+ node = this.jsxParseExpressionContainer(node, types.j_oTag);
+ if (node.expression.type === "JSXEmptyExpression") {
+ this.raise(JsxErrors.AttributeIsEmpty, node);
+ }
+ return node;
+ case 142:
+ case 133:
+ return this.parseExprAtom();
+ default:
+ throw this.raise(JsxErrors.UnsupportedJsxValue, this.state.startLoc);
+ }
+ }
+ jsxParseEmptyExpression() {
+ const node = this.startNodeAt(this.state.lastTokEndLoc);
+ return this.finishNodeAt(node, "JSXEmptyExpression", this.state.startLoc);
+ }
+ jsxParseSpreadChild(node) {
+ this.next();
+ node.expression = this.parseExpression();
+ this.setContext(types.j_expr);
+ this.state.canStartJSXElement = true;
+ this.expect(8);
+ return this.finishNode(node, "JSXSpreadChild");
+ }
+ jsxParseExpressionContainer(node, previousContext) {
+ if (this.match(8)) {
+ node.expression = this.jsxParseEmptyExpression();
+ } else {
+ const expression = this.parseExpression();
+ node.expression = expression;
+ }
+ this.setContext(previousContext);
+ this.state.canStartJSXElement = true;
+ this.expect(8);
+ return this.finishNode(node, "JSXExpressionContainer");
+ }
+ jsxParseAttribute() {
+ const node = this.startNode();
+ if (this.match(5)) {
+ this.setContext(types.brace);
+ this.next();
+ this.expect(21);
+ node.argument = this.parseMaybeAssignAllowIn();
+ this.setContext(types.j_oTag);
+ this.state.canStartJSXElement = true;
+ this.expect(8);
+ return this.finishNode(node, "JSXSpreadAttribute");
+ }
+ node.name = this.jsxParseNamespacedName();
+ node.value = this.eat(29) ? this.jsxParseAttributeValue() : null;
+ return this.finishNode(node, "JSXAttribute");
+ }
+ jsxParseOpeningElementAt(startLoc) {
+ const node = this.startNodeAt(startLoc);
+ if (this.eat(143)) {
+ return this.finishNode(node, "JSXOpeningFragment");
+ }
+ node.name = this.jsxParseElementName();
+ return this.jsxParseOpeningElementAfterName(node);
+ }
+ jsxParseOpeningElementAfterName(node) {
+ const attributes = [];
+ while (!this.match(56) && !this.match(143)) {
+ attributes.push(this.jsxParseAttribute());
+ }
+ node.attributes = attributes;
+ node.selfClosing = this.eat(56);
+ this.expect(143);
+ return this.finishNode(node, "JSXOpeningElement");
+ }
+ jsxParseClosingElementAt(startLoc) {
+ const node = this.startNodeAt(startLoc);
+ if (this.eat(143)) {
+ return this.finishNode(node, "JSXClosingFragment");
+ }
+ node.name = this.jsxParseElementName();
+ this.expect(143);
+ return this.finishNode(node, "JSXClosingElement");
+ }
+ jsxParseElementAt(startLoc) {
+ const node = this.startNodeAt(startLoc);
+ const children = [];
+ const openingElement = this.jsxParseOpeningElementAt(startLoc);
+ let closingElement = null;
+ if (!openingElement.selfClosing) {
+ contents: for (;;) {
+ switch (this.state.type) {
+ case 142:
+ startLoc = this.state.startLoc;
+ this.next();
+ if (this.eat(56)) {
+ closingElement = this.jsxParseClosingElementAt(startLoc);
+ break contents;
+ }
+ children.push(this.jsxParseElementAt(startLoc));
+ break;
+ case 141:
+ children.push(this.parseLiteral(this.state.value, "JSXText"));
+ break;
+ case 5:
+ {
+ const node = this.startNode();
+ this.setContext(types.brace);
+ this.next();
+ if (this.match(21)) {
+ children.push(this.jsxParseSpreadChild(node));
+ } else {
+ children.push(this.jsxParseExpressionContainer(node, types.j_expr));
+ }
+ break;
+ }
+ default:
+ this.unexpected();
+ }
+ }
+ if (isFragment(openingElement) && !isFragment(closingElement) && closingElement !== null) {
+ this.raise(JsxErrors.MissingClosingTagFragment, closingElement);
+ } else if (!isFragment(openingElement) && isFragment(closingElement)) {
+ this.raise(JsxErrors.MissingClosingTagElement, closingElement, {
+ openingTagName: getQualifiedJSXName(openingElement.name)
+ });
+ } else if (!isFragment(openingElement) && !isFragment(closingElement)) {
+ if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) {
+ this.raise(JsxErrors.MissingClosingTagElement, closingElement, {
+ openingTagName: getQualifiedJSXName(openingElement.name)
+ });
+ }
+ }
+ }
+ if (isFragment(openingElement)) {
+ node.openingFragment = openingElement;
+ node.closingFragment = closingElement;
+ } else {
+ node.openingElement = openingElement;
+ node.closingElement = closingElement;
+ }
+ node.children = children;
+ if (this.match(47)) {
+ throw this.raise(JsxErrors.UnwrappedAdjacentJSXElements, this.state.startLoc);
+ }
+ return isFragment(openingElement) ? this.finishNode(node, "JSXFragment") : this.finishNode(node, "JSXElement");
+ }
+ jsxParseElement() {
+ const startLoc = this.state.startLoc;
+ this.next();
+ return this.jsxParseElementAt(startLoc);
+ }
+ setContext(newContext) {
+ const {
+ context
+ } = this.state;
+ context[context.length - 1] = newContext;
+ }
+ parseExprAtom(refExpressionErrors) {
+ if (this.match(142)) {
+ return this.jsxParseElement();
+ } else if (this.match(47) && this.input.charCodeAt(this.state.pos) !== 33) {
+ this.replaceToken(142);
+ return this.jsxParseElement();
+ } else {
+ return super.parseExprAtom(refExpressionErrors);
+ }
+ }
+ skipSpace() {
+ const curContext = this.curContext();
+ if (!curContext.preserveSpace) super.skipSpace();
+ }
+ getTokenFromCode(code) {
+ const context = this.curContext();
+ if (context === types.j_expr) {
+ this.jsxReadToken();
+ return;
+ }
+ if (context === types.j_oTag || context === types.j_cTag) {
+ if (isIdentifierStart(code)) {
+ this.jsxReadWord();
+ return;
+ }
+ if (code === 62) {
+ ++this.state.pos;
+ this.finishToken(143);
+ return;
+ }
+ if ((code === 34 || code === 39) && context === types.j_oTag) {
+ this.jsxReadString(code);
+ return;
+ }
+ }
+ if (code === 60 && this.state.canStartJSXElement && this.input.charCodeAt(this.state.pos + 1) !== 33) {
+ ++this.state.pos;
+ this.finishToken(142);
+ return;
+ }
+ super.getTokenFromCode(code);
+ }
+ updateContext(prevType) {
+ const {
+ context,
+ type
+ } = this.state;
+ if (type === 56 && prevType === 142) {
+ context.splice(-2, 2, types.j_cTag);
+ this.state.canStartJSXElement = false;
+ } else if (type === 142) {
+ context.push(types.j_oTag);
+ } else if (type === 143) {
+ const out = context[context.length - 1];
+ if (out === types.j_oTag && prevType === 56 || out === types.j_cTag) {
+ context.pop();
+ this.state.canStartJSXElement = context[context.length - 1] === types.j_expr;
+ } else {
+ this.setContext(types.j_expr);
+ this.state.canStartJSXElement = true;
+ }
+ } else {
+ this.state.canStartJSXElement = tokenComesBeforeExpression(type);
+ }
+ }
+};
+class TypeScriptScope extends Scope {
+ constructor(...args) {
+ super(...args);
+ this.tsNames = new Map();
+ }
+}
+class TypeScriptScopeHandler extends ScopeHandler {
+ constructor(...args) {
+ super(...args);
+ this.importsStack = [];
+ }
+ createScope(flags) {
+ this.importsStack.push(new Set());
+ return new TypeScriptScope(flags);
+ }
+ enter(flags) {
+ if (flags === 256) {
+ this.importsStack.push(new Set());
+ }
+ super.enter(flags);
+ }
+ exit() {
+ const flags = super.exit();
+ if (flags === 256) {
+ this.importsStack.pop();
+ }
+ return flags;
+ }
+ hasImport(name, allowShadow) {
+ const len = this.importsStack.length;
+ if (this.importsStack[len - 1].has(name)) {
+ return true;
+ }
+ if (!allowShadow && len > 1) {
+ for (let i = 0; i < len - 1; i++) {
+ if (this.importsStack[i].has(name)) return true;
+ }
+ }
+ return false;
+ }
+ declareName(name, bindingType, loc) {
+ if (bindingType & 4096) {
+ if (this.hasImport(name, true)) {
+ this.parser.raise(Errors.VarRedeclaration, loc, {
+ identifierName: name
+ });
+ }
+ this.importsStack[this.importsStack.length - 1].add(name);
+ return;
+ }
+ const scope = this.currentScope();
+ let type = scope.tsNames.get(name) || 0;
+ if (bindingType & 1024) {
+ this.maybeExportDefined(scope, name);
+ scope.tsNames.set(name, type | 16);
+ return;
+ }
+ super.declareName(name, bindingType, loc);
+ if (bindingType & 2) {
+ if (!(bindingType & 1)) {
+ this.checkRedeclarationInScope(scope, name, bindingType, loc);
+ this.maybeExportDefined(scope, name);
+ }
+ type = type | 1;
+ }
+ if (bindingType & 256) {
+ type = type | 2;
+ }
+ if (bindingType & 512) {
+ type = type | 4;
+ }
+ if (bindingType & 128) {
+ type = type | 8;
+ }
+ if (type) scope.tsNames.set(name, type);
+ }
+ isRedeclaredInScope(scope, name, bindingType) {
+ const type = scope.tsNames.get(name);
+ if ((type & 2) > 0) {
+ if (bindingType & 256) {
+ const isConst = !!(bindingType & 512);
+ const wasConst = (type & 4) > 0;
+ return isConst !== wasConst;
+ }
+ return true;
+ }
+ if (bindingType & 128 && (type & 8) > 0) {
+ if (scope.names.get(name) & 2) {
+ return !!(bindingType & 1);
+ } else {
+ return false;
+ }
+ }
+ if (bindingType & 2 && (type & 1) > 0) {
+ return true;
+ }
+ return super.isRedeclaredInScope(scope, name, bindingType);
+ }
+ checkLocalExport(id) {
+ const {
+ name
+ } = id;
+ if (this.hasImport(name)) return;
+ const len = this.scopeStack.length;
+ for (let i = len - 1; i >= 0; i--) {
+ const scope = this.scopeStack[i];
+ const type = scope.tsNames.get(name);
+ if ((type & 1) > 0 || (type & 16) > 0) {
+ return;
+ }
+ }
+ super.checkLocalExport(id);
+ }
+}
+const unwrapParenthesizedExpression = node => {
+ return node.type === "ParenthesizedExpression" ? unwrapParenthesizedExpression(node.expression) : node;
+};
+class LValParser extends NodeUtils {
+ toAssignable(node, isLHS = false) {
+ var _node$extra, _node$extra3;
+ let parenthesized = undefined;
+ if (node.type === "ParenthesizedExpression" || (_node$extra = node.extra) != null && _node$extra.parenthesized) {
+ parenthesized = unwrapParenthesizedExpression(node);
+ if (isLHS) {
+ if (parenthesized.type === "Identifier") {
+ this.expressionScope.recordArrowParameterBindingError(Errors.InvalidParenthesizedAssignment, node);
+ } else if (parenthesized.type !== "MemberExpression" && !this.isOptionalMemberExpression(parenthesized)) {
+ this.raise(Errors.InvalidParenthesizedAssignment, node);
+ }
+ } else {
+ this.raise(Errors.InvalidParenthesizedAssignment, node);
+ }
+ }
+ switch (node.type) {
+ case "Identifier":
+ case "ObjectPattern":
+ case "ArrayPattern":
+ case "AssignmentPattern":
+ case "RestElement":
+ break;
+ case "ObjectExpression":
+ node.type = "ObjectPattern";
+ for (let i = 0, length = node.properties.length, last = length - 1; i < length; i++) {
+ var _node$extra2;
+ const prop = node.properties[i];
+ const isLast = i === last;
+ this.toAssignableObjectExpressionProp(prop, isLast, isLHS);
+ if (isLast && prop.type === "RestElement" && (_node$extra2 = node.extra) != null && _node$extra2.trailingCommaLoc) {
+ this.raise(Errors.RestTrailingComma, node.extra.trailingCommaLoc);
+ }
+ }
+ break;
+ case "ObjectProperty":
+ {
+ const {
+ key,
+ value
+ } = node;
+ if (this.isPrivateName(key)) {
+ this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start);
+ }
+ this.toAssignable(value, isLHS);
+ break;
+ }
+ case "SpreadElement":
+ {
+ throw new Error("Internal @babel/parser error (this is a bug, please report it)." + " SpreadElement should be converted by .toAssignable's caller.");
+ }
+ case "ArrayExpression":
+ node.type = "ArrayPattern";
+ this.toAssignableList(node.elements, (_node$extra3 = node.extra) == null ? void 0 : _node$extra3.trailingCommaLoc, isLHS);
+ break;
+ case "AssignmentExpression":
+ if (node.operator !== "=") {
+ this.raise(Errors.MissingEqInAssignment, node.left.loc.end);
+ }
+ node.type = "AssignmentPattern";
+ delete node.operator;
+ this.toAssignable(node.left, isLHS);
+ break;
+ case "ParenthesizedExpression":
+ this.toAssignable(parenthesized, isLHS);
+ break;
+ }
+ }
+ toAssignableObjectExpressionProp(prop, isLast, isLHS) {
+ if (prop.type === "ObjectMethod") {
+ this.raise(prop.kind === "get" || prop.kind === "set" ? Errors.PatternHasAccessor : Errors.PatternHasMethod, prop.key);
+ } else if (prop.type === "SpreadElement") {
+ prop.type = "RestElement";
+ const arg = prop.argument;
+ this.checkToRestConversion(arg, false);
+ this.toAssignable(arg, isLHS);
+ if (!isLast) {
+ this.raise(Errors.RestTrailingComma, prop);
+ }
+ } else {
+ this.toAssignable(prop, isLHS);
+ }
+ }
+ toAssignableList(exprList, trailingCommaLoc, isLHS) {
+ const end = exprList.length - 1;
+ for (let i = 0; i <= end; i++) {
+ const elt = exprList[i];
+ if (!elt) continue;
+ if (elt.type === "SpreadElement") {
+ elt.type = "RestElement";
+ const arg = elt.argument;
+ this.checkToRestConversion(arg, true);
+ this.toAssignable(arg, isLHS);
+ } else {
+ this.toAssignable(elt, isLHS);
+ }
+ if (elt.type === "RestElement") {
+ if (i < end) {
+ this.raise(Errors.RestTrailingComma, elt);
+ } else if (trailingCommaLoc) {
+ this.raise(Errors.RestTrailingComma, trailingCommaLoc);
+ }
+ }
+ }
+ }
+ isAssignable(node, isBinding) {
+ switch (node.type) {
+ case "Identifier":
+ case "ObjectPattern":
+ case "ArrayPattern":
+ case "AssignmentPattern":
+ case "RestElement":
+ return true;
+ case "ObjectExpression":
+ {
+ const last = node.properties.length - 1;
+ return node.properties.every((prop, i) => {
+ return prop.type !== "ObjectMethod" && (i === last || prop.type !== "SpreadElement") && this.isAssignable(prop);
+ });
+ }
+ case "ObjectProperty":
+ return this.isAssignable(node.value);
+ case "SpreadElement":
+ return this.isAssignable(node.argument);
+ case "ArrayExpression":
+ return node.elements.every(element => element === null || this.isAssignable(element));
+ case "AssignmentExpression":
+ return node.operator === "=";
+ case "ParenthesizedExpression":
+ return this.isAssignable(node.expression);
+ case "MemberExpression":
+ case "OptionalMemberExpression":
+ return !isBinding;
+ default:
+ return false;
+ }
+ }
+ toReferencedList(exprList, isParenthesizedExpr) {
+ return exprList;
+ }
+ toReferencedListDeep(exprList, isParenthesizedExpr) {
+ this.toReferencedList(exprList, isParenthesizedExpr);
+ for (const expr of exprList) {
+ if ((expr == null ? void 0 : expr.type) === "ArrayExpression") {
+ this.toReferencedListDeep(expr.elements);
+ }
+ }
+ }
+ parseSpread(refExpressionErrors) {
+ const node = this.startNode();
+ this.next();
+ node.argument = this.parseMaybeAssignAllowIn(refExpressionErrors, undefined);
+ return this.finishNode(node, "SpreadElement");
+ }
+ parseRestBinding() {
+ const node = this.startNode();
+ this.next();
+ node.argument = this.parseBindingAtom();
+ return this.finishNode(node, "RestElement");
+ }
+ parseBindingAtom() {
+ switch (this.state.type) {
+ case 0:
+ {
+ const node = this.startNode();
+ this.next();
+ node.elements = this.parseBindingList(3, 93, 1);
+ return this.finishNode(node, "ArrayPattern");
+ }
+ case 5:
+ return this.parseObjectLike(8, true);
+ }
+ return this.parseIdentifier();
+ }
+ parseBindingList(close, closeCharCode, flags) {
+ const allowEmpty = flags & 1;
+ const elts = [];
+ let first = true;
+ while (!this.eat(close)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(12);
+ }
+ if (allowEmpty && this.match(12)) {
+ elts.push(null);
+ } else if (this.eat(close)) {
+ break;
+ } else if (this.match(21)) {
+ elts.push(this.parseAssignableListItemTypes(this.parseRestBinding(), flags));
+ if (!this.checkCommaAfterRest(closeCharCode)) {
+ this.expect(close);
+ break;
+ }
+ } else {
+ const decorators = [];
+ if (this.match(26) && this.hasPlugin("decorators")) {
+ this.raise(Errors.UnsupportedParameterDecorator, this.state.startLoc);
+ }
+ while (this.match(26)) {
+ decorators.push(this.parseDecorator());
+ }
+ elts.push(this.parseAssignableListItem(flags, decorators));
+ }
+ }
+ return elts;
+ }
+ parseBindingRestProperty(prop) {
+ this.next();
+ prop.argument = this.parseIdentifier();
+ this.checkCommaAfterRest(125);
+ return this.finishNode(prop, "RestElement");
+ }
+ parseBindingProperty() {
+ const {
+ type,
+ startLoc
+ } = this.state;
+ if (type === 21) {
+ return this.parseBindingRestProperty(this.startNode());
+ }
+ const prop = this.startNode();
+ if (type === 138) {
+ this.expectPlugin("destructuringPrivate", startLoc);
+ this.classScope.usePrivateName(this.state.value, startLoc);
+ prop.key = this.parsePrivateName();
+ } else {
+ this.parsePropertyName(prop);
+ }
+ prop.method = false;
+ return this.parseObjPropValue(prop, startLoc, false, false, true, false);
+ }
+ parseAssignableListItem(flags, decorators) {
+ const left = this.parseMaybeDefault();
+ this.parseAssignableListItemTypes(left, flags);
+ const elt = this.parseMaybeDefault(left.loc.start, left);
+ if (decorators.length) {
+ left.decorators = decorators;
+ }
+ return elt;
+ }
+ parseAssignableListItemTypes(param, flags) {
+ return param;
+ }
+ parseMaybeDefault(startLoc, left) {
+ var _startLoc, _left;
+ (_startLoc = startLoc) != null ? _startLoc : startLoc = this.state.startLoc;
+ left = (_left = left) != null ? _left : this.parseBindingAtom();
+ if (!this.eat(29)) return left;
+ const node = this.startNodeAt(startLoc);
+ node.left = left;
+ node.right = this.parseMaybeAssignAllowIn();
+ return this.finishNode(node, "AssignmentPattern");
+ }
+ isValidLVal(type, isUnparenthesizedInAssign, binding) {
+ switch (type) {
+ case "AssignmentPattern":
+ return "left";
+ case "RestElement":
+ return "argument";
+ case "ObjectProperty":
+ return "value";
+ case "ParenthesizedExpression":
+ return "expression";
+ case "ArrayPattern":
+ return "elements";
+ case "ObjectPattern":
+ return "properties";
+ }
+ return false;
+ }
+ isOptionalMemberExpression(expression) {
+ return expression.type === "OptionalMemberExpression";
+ }
+ checkLVal(expression, ancestor, binding = 64, checkClashes = false, strictModeChanged = false, hasParenthesizedAncestor = false) {
+ var _expression$extra;
+ const type = expression.type;
+ if (this.isObjectMethod(expression)) return;
+ const isOptionalMemberExpression = this.isOptionalMemberExpression(expression);
+ if (isOptionalMemberExpression || type === "MemberExpression") {
+ if (isOptionalMemberExpression) {
+ this.expectPlugin("optionalChainingAssign", expression.loc.start);
+ if (ancestor.type !== "AssignmentExpression") {
+ this.raise(Errors.InvalidLhsOptionalChaining, expression, {
+ ancestor
+ });
+ }
+ }
+ if (binding !== 64) {
+ this.raise(Errors.InvalidPropertyBindingPattern, expression);
+ }
+ return;
+ }
+ if (type === "Identifier") {
+ this.checkIdentifier(expression, binding, strictModeChanged);
+ const {
+ name
+ } = expression;
+ if (checkClashes) {
+ if (checkClashes.has(name)) {
+ this.raise(Errors.ParamDupe, expression);
+ } else {
+ checkClashes.add(name);
+ }
+ }
+ return;
+ }
+ const validity = this.isValidLVal(type, !(hasParenthesizedAncestor || (_expression$extra = expression.extra) != null && _expression$extra.parenthesized) && ancestor.type === "AssignmentExpression", binding);
+ if (validity === true) return;
+ if (validity === false) {
+ const ParseErrorClass = binding === 64 ? Errors.InvalidLhs : Errors.InvalidLhsBinding;
+ this.raise(ParseErrorClass, expression, {
+ ancestor
+ });
+ return;
+ }
+ let key, isParenthesizedExpression;
+ if (typeof validity === "string") {
+ key = validity;
+ isParenthesizedExpression = type === "ParenthesizedExpression";
+ } else {
+ [key, isParenthesizedExpression] = validity;
+ }
+ const nextAncestor = type === "ArrayPattern" || type === "ObjectPattern" ? {
+ type
+ } : ancestor;
+ const val = expression[key];
+ if (Array.isArray(val)) {
+ for (const child of val) {
+ if (child) {
+ this.checkLVal(child, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression);
+ }
+ }
+ } else if (val) {
+ this.checkLVal(val, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression);
+ }
+ }
+ checkIdentifier(at, bindingType, strictModeChanged = false) {
+ if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord(at.name, this.inModule) : isStrictBindOnlyReservedWord(at.name))) {
+ if (bindingType === 64) {
+ this.raise(Errors.StrictEvalArguments, at, {
+ referenceName: at.name
+ });
+ } else {
+ this.raise(Errors.StrictEvalArgumentsBinding, at, {
+ bindingName: at.name
+ });
+ }
+ }
+ if (bindingType & 8192 && at.name === "let") {
+ this.raise(Errors.LetInLexicalBinding, at);
+ }
+ if (!(bindingType & 64)) {
+ this.declareNameFromIdentifier(at, bindingType);
+ }
+ }
+ declareNameFromIdentifier(identifier, binding) {
+ this.scope.declareName(identifier.name, binding, identifier.loc.start);
+ }
+ checkToRestConversion(node, allowPattern) {
+ switch (node.type) {
+ case "ParenthesizedExpression":
+ this.checkToRestConversion(node.expression, allowPattern);
+ break;
+ case "Identifier":
+ case "MemberExpression":
+ break;
+ case "ArrayExpression":
+ case "ObjectExpression":
+ if (allowPattern) break;
+ default:
+ this.raise(Errors.InvalidRestAssignmentPattern, node);
+ }
+ }
+ checkCommaAfterRest(close) {
+ if (!this.match(12)) {
+ return false;
+ }
+ this.raise(this.lookaheadCharCode() === close ? Errors.RestTrailingComma : Errors.ElementAfterRest, this.state.startLoc);
+ return true;
+ }
+}
+function nonNull(x) {
+ if (x == null) {
+ throw new Error(`Unexpected ${x} value.`);
+ }
+ return x;
+}
+function assert(x) {
+ if (!x) {
+ throw new Error("Assert fail");
+ }
+}
+const TSErrors = ParseErrorEnum`typescript`({
+ AbstractMethodHasImplementation: ({
+ methodName
+ }) => `Method '${methodName}' cannot have an implementation because it is marked abstract.`,
+ AbstractPropertyHasInitializer: ({
+ propertyName
+ }) => `Property '${propertyName}' cannot have an initializer because it is marked abstract.`,
+ AccessorCannotBeOptional: "An 'accessor' property cannot be declared optional.",
+ AccessorCannotDeclareThisParameter: "'get' and 'set' accessors cannot declare 'this' parameters.",
+ AccessorCannotHaveTypeParameters: "An accessor cannot have type parameters.",
+ ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier.",
+ ClassMethodHasReadonly: "Class methods cannot have the 'readonly' modifier.",
+ ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference: "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",
+ ConstructorHasTypeParameters: "Type parameters cannot appear on a constructor declaration.",
+ DeclareAccessor: ({
+ kind
+ }) => `'declare' is not allowed in ${kind}ters.`,
+ DeclareClassFieldHasInitializer: "Initializers are not allowed in ambient contexts.",
+ DeclareFunctionHasImplementation: "An implementation cannot be declared in ambient contexts.",
+ DuplicateAccessibilityModifier: ({
+ modifier
+ }) => `Accessibility modifier already seen.`,
+ DuplicateModifier: ({
+ modifier
+ }) => `Duplicate modifier: '${modifier}'.`,
+ EmptyHeritageClauseType: ({
+ token
+ }) => `'${token}' list cannot be empty.`,
+ EmptyTypeArguments: "Type argument list cannot be empty.",
+ EmptyTypeParameters: "Type parameter list cannot be empty.",
+ ExpectedAmbientAfterExportDeclare: "'export declare' must be followed by an ambient declaration.",
+ ImportAliasHasImportType: "An import alias can not use 'import type'.",
+ ImportReflectionHasImportType: "An `import module` declaration can not use `type` modifier",
+ IncompatibleModifiers: ({
+ modifiers
+ }) => `'${modifiers[0]}' modifier cannot be used with '${modifiers[1]}' modifier.`,
+ IndexSignatureHasAbstract: "Index signatures cannot have the 'abstract' modifier.",
+ IndexSignatureHasAccessibility: ({
+ modifier
+ }) => `Index signatures cannot have an accessibility modifier ('${modifier}').`,
+ IndexSignatureHasDeclare: "Index signatures cannot have the 'declare' modifier.",
+ IndexSignatureHasOverride: "'override' modifier cannot appear on an index signature.",
+ IndexSignatureHasStatic: "Index signatures cannot have the 'static' modifier.",
+ InitializerNotAllowedInAmbientContext: "Initializers are not allowed in ambient contexts.",
+ InvalidModifierOnTypeMember: ({
+ modifier
+ }) => `'${modifier}' modifier cannot appear on a type member.`,
+ InvalidModifierOnTypeParameter: ({
+ modifier
+ }) => `'${modifier}' modifier cannot appear on a type parameter.`,
+ InvalidModifierOnTypeParameterPositions: ({
+ modifier
+ }) => `'${modifier}' modifier can only appear on a type parameter of a class, interface or type alias.`,
+ InvalidModifiersOrder: ({
+ orderedModifiers
+ }) => `'${orderedModifiers[0]}' modifier must precede '${orderedModifiers[1]}' modifier.`,
+ InvalidPropertyAccessAfterInstantiationExpression: "Invalid property access after an instantiation expression. " + "You can either wrap the instantiation expression in parentheses, or delete the type arguments.",
+ InvalidTupleMemberLabel: "Tuple members must be labeled with a simple identifier.",
+ MissingInterfaceName: "'interface' declarations must be followed by an identifier.",
+ NonAbstractClassHasAbstractMethod: "Abstract methods can only appear within an abstract class.",
+ NonClassMethodPropertyHasAbstractModifer: "'abstract' modifier can only appear on a class, method, or property declaration.",
+ OptionalTypeBeforeRequired: "A required element cannot follow an optional element.",
+ OverrideNotInSubClass: "This member cannot have an 'override' modifier because its containing class does not extend another class.",
+ PatternIsOptional: "A binding pattern parameter cannot be optional in an implementation signature.",
+ PrivateElementHasAbstract: "Private elements cannot have the 'abstract' modifier.",
+ PrivateElementHasAccessibility: ({
+ modifier
+ }) => `Private elements cannot have an accessibility modifier ('${modifier}').`,
+ ReadonlyForMethodSignature: "'readonly' modifier can only appear on a property declaration or index signature.",
+ ReservedArrowTypeParam: "This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `() => ...`.",
+ ReservedTypeAssertion: "This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",
+ SetAccessorCannotHaveOptionalParameter: "A 'set' accessor cannot have an optional parameter.",
+ SetAccessorCannotHaveRestParameter: "A 'set' accessor cannot have rest parameter.",
+ SetAccessorCannotHaveReturnType: "A 'set' accessor cannot have a return type annotation.",
+ SingleTypeParameterWithoutTrailingComma: ({
+ typeParameterName
+ }) => `Single type parameter ${typeParameterName} should have a trailing comma. Example usage: <${typeParameterName},>.`,
+ StaticBlockCannotHaveModifier: "Static class blocks cannot have any modifier.",
+ TupleOptionalAfterType: "A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).",
+ TypeAnnotationAfterAssign: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",
+ TypeImportCannotSpecifyDefaultAndNamed: "A type-only import can specify a default import or named bindings, but not both.",
+ TypeModifierIsUsedInTypeExports: "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",
+ TypeModifierIsUsedInTypeImports: "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",
+ UnexpectedParameterModifier: "A parameter property is only allowed in a constructor implementation.",
+ UnexpectedReadonly: "'readonly' type modifier is only permitted on array and tuple literal types.",
+ UnexpectedTypeAnnotation: "Did not expect a type annotation here.",
+ UnexpectedTypeCastInParameter: "Unexpected type cast in parameter position.",
+ UnsupportedImportTypeArgument: "Argument in a type import must be a string literal.",
+ UnsupportedParameterPropertyKind: "A parameter property may not be declared using a binding pattern.",
+ UnsupportedSignatureParameterKind: ({
+ type
+ }) => `Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${type}.`
+});
+function keywordTypeFromName(value) {
+ switch (value) {
+ case "any":
+ return "TSAnyKeyword";
+ case "boolean":
+ return "TSBooleanKeyword";
+ case "bigint":
+ return "TSBigIntKeyword";
+ case "never":
+ return "TSNeverKeyword";
+ case "number":
+ return "TSNumberKeyword";
+ case "object":
+ return "TSObjectKeyword";
+ case "string":
+ return "TSStringKeyword";
+ case "symbol":
+ return "TSSymbolKeyword";
+ case "undefined":
+ return "TSUndefinedKeyword";
+ case "unknown":
+ return "TSUnknownKeyword";
+ default:
+ return undefined;
+ }
+}
+function tsIsAccessModifier(modifier) {
+ return modifier === "private" || modifier === "public" || modifier === "protected";
+}
+function tsIsVarianceAnnotations(modifier) {
+ return modifier === "in" || modifier === "out";
+}
+var typescript = superClass => class TypeScriptParserMixin extends superClass {
+ constructor(...args) {
+ super(...args);
+ this.tsParseInOutModifiers = this.tsParseModifiers.bind(this, {
+ allowedModifiers: ["in", "out"],
+ disallowedModifiers: ["const", "public", "private", "protected", "readonly", "declare", "abstract", "override"],
+ errorTemplate: TSErrors.InvalidModifierOnTypeParameter
+ });
+ this.tsParseConstModifier = this.tsParseModifiers.bind(this, {
+ allowedModifiers: ["const"],
+ disallowedModifiers: ["in", "out"],
+ errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions
+ });
+ this.tsParseInOutConstModifiers = this.tsParseModifiers.bind(this, {
+ allowedModifiers: ["in", "out", "const"],
+ disallowedModifiers: ["public", "private", "protected", "readonly", "declare", "abstract", "override"],
+ errorTemplate: TSErrors.InvalidModifierOnTypeParameter
+ });
+ }
+ getScopeHandler() {
+ return TypeScriptScopeHandler;
+ }
+ tsIsIdentifier() {
+ return tokenIsIdentifier(this.state.type);
+ }
+ tsTokenCanFollowModifier() {
+ return this.match(0) || this.match(5) || this.match(55) || this.match(21) || this.match(138) || this.isLiteralPropertyName();
+ }
+ tsNextTokenOnSameLineAndCanFollowModifier() {
+ this.next();
+ if (this.hasPrecedingLineBreak()) {
+ return false;
+ }
+ return this.tsTokenCanFollowModifier();
+ }
+ tsNextTokenCanFollowModifier() {
+ if (this.match(106)) {
+ this.next();
+ return this.tsTokenCanFollowModifier();
+ }
+ return this.tsNextTokenOnSameLineAndCanFollowModifier();
+ }
+ tsParseModifier(allowedModifiers, stopOnStartOfClassStaticBlock) {
+ if (!tokenIsIdentifier(this.state.type) && this.state.type !== 58 && this.state.type !== 75) {
+ return undefined;
+ }
+ const modifier = this.state.value;
+ if (allowedModifiers.includes(modifier)) {
+ if (stopOnStartOfClassStaticBlock && this.tsIsStartOfStaticBlocks()) {
+ return undefined;
+ }
+ if (this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) {
+ return modifier;
+ }
+ }
+ return undefined;
+ }
+ tsParseModifiers({
+ allowedModifiers,
+ disallowedModifiers,
+ stopOnStartOfClassStaticBlock,
+ errorTemplate = TSErrors.InvalidModifierOnTypeMember
+ }, modified) {
+ const enforceOrder = (loc, modifier, before, after) => {
+ if (modifier === before && modified[after]) {
+ this.raise(TSErrors.InvalidModifiersOrder, loc, {
+ orderedModifiers: [before, after]
+ });
+ }
+ };
+ const incompatible = (loc, modifier, mod1, mod2) => {
+ if (modified[mod1] && modifier === mod2 || modified[mod2] && modifier === mod1) {
+ this.raise(TSErrors.IncompatibleModifiers, loc, {
+ modifiers: [mod1, mod2]
+ });
+ }
+ };
+ for (;;) {
+ const {
+ startLoc
+ } = this.state;
+ const modifier = this.tsParseModifier(allowedModifiers.concat(disallowedModifiers != null ? disallowedModifiers : []), stopOnStartOfClassStaticBlock);
+ if (!modifier) break;
+ if (tsIsAccessModifier(modifier)) {
+ if (modified.accessibility) {
+ this.raise(TSErrors.DuplicateAccessibilityModifier, startLoc, {
+ modifier
+ });
+ } else {
+ enforceOrder(startLoc, modifier, modifier, "override");
+ enforceOrder(startLoc, modifier, modifier, "static");
+ enforceOrder(startLoc, modifier, modifier, "readonly");
+ modified.accessibility = modifier;
+ }
+ } else if (tsIsVarianceAnnotations(modifier)) {
+ if (modified[modifier]) {
+ this.raise(TSErrors.DuplicateModifier, startLoc, {
+ modifier
+ });
+ }
+ modified[modifier] = true;
+ enforceOrder(startLoc, modifier, "in", "out");
+ } else {
+ if (hasOwnProperty.call(modified, modifier)) {
+ this.raise(TSErrors.DuplicateModifier, startLoc, {
+ modifier
+ });
+ } else {
+ enforceOrder(startLoc, modifier, "static", "readonly");
+ enforceOrder(startLoc, modifier, "static", "override");
+ enforceOrder(startLoc, modifier, "override", "readonly");
+ enforceOrder(startLoc, modifier, "abstract", "override");
+ incompatible(startLoc, modifier, "declare", "override");
+ incompatible(startLoc, modifier, "static", "abstract");
+ }
+ modified[modifier] = true;
+ }
+ if (disallowedModifiers != null && disallowedModifiers.includes(modifier)) {
+ this.raise(errorTemplate, startLoc, {
+ modifier
+ });
+ }
+ }
+ }
+ tsIsListTerminator(kind) {
+ switch (kind) {
+ case "EnumMembers":
+ case "TypeMembers":
+ return this.match(8);
+ case "HeritageClauseElement":
+ return this.match(5);
+ case "TupleElementTypes":
+ return this.match(3);
+ case "TypeParametersOrArguments":
+ return this.match(48);
+ }
+ }
+ tsParseList(kind, parseElement) {
+ const result = [];
+ while (!this.tsIsListTerminator(kind)) {
+ result.push(parseElement());
+ }
+ return result;
+ }
+ tsParseDelimitedList(kind, parseElement, refTrailingCommaPos) {
+ return nonNull(this.tsParseDelimitedListWorker(kind, parseElement, true, refTrailingCommaPos));
+ }
+ tsParseDelimitedListWorker(kind, parseElement, expectSuccess, refTrailingCommaPos) {
+ const result = [];
+ let trailingCommaPos = -1;
+ for (;;) {
+ if (this.tsIsListTerminator(kind)) {
+ break;
+ }
+ trailingCommaPos = -1;
+ const element = parseElement();
+ if (element == null) {
+ return undefined;
+ }
+ result.push(element);
+ if (this.eat(12)) {
+ trailingCommaPos = this.state.lastTokStartLoc.index;
+ continue;
+ }
+ if (this.tsIsListTerminator(kind)) {
+ break;
+ }
+ if (expectSuccess) {
+ this.expect(12);
+ }
+ return undefined;
+ }
+ if (refTrailingCommaPos) {
+ refTrailingCommaPos.value = trailingCommaPos;
+ }
+ return result;
+ }
+ tsParseBracketedList(kind, parseElement, bracket, skipFirstToken, refTrailingCommaPos) {
+ if (!skipFirstToken) {
+ if (bracket) {
+ this.expect(0);
+ } else {
+ this.expect(47);
+ }
+ }
+ const result = this.tsParseDelimitedList(kind, parseElement, refTrailingCommaPos);
+ if (bracket) {
+ this.expect(3);
+ } else {
+ this.expect(48);
+ }
+ return result;
+ }
+ tsParseImportType() {
+ const node = this.startNode();
+ this.expect(83);
+ this.expect(10);
+ if (!this.match(133)) {
+ this.raise(TSErrors.UnsupportedImportTypeArgument, this.state.startLoc);
+ }
+ node.argument = super.parseExprAtom();
+ if (this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions")) {
+ node.options = null;
+ }
+ if (this.eat(12)) {
+ this.expectImportAttributesPlugin();
+ if (!this.match(11)) {
+ node.options = super.parseMaybeAssignAllowIn();
+ this.eat(12);
+ }
+ }
+ this.expect(11);
+ if (this.eat(16)) {
+ node.qualifier = this.tsParseEntityName();
+ }
+ if (this.match(47)) {
+ node.typeParameters = this.tsParseTypeArguments();
+ }
+ return this.finishNode(node, "TSImportType");
+ }
+ tsParseEntityName(allowReservedWords = true) {
+ let entity = this.parseIdentifier(allowReservedWords);
+ while (this.eat(16)) {
+ const node = this.startNodeAtNode(entity);
+ node.left = entity;
+ node.right = this.parseIdentifier(allowReservedWords);
+ entity = this.finishNode(node, "TSQualifiedName");
+ }
+ return entity;
+ }
+ tsParseTypeReference() {
+ const node = this.startNode();
+ node.typeName = this.tsParseEntityName();
+ if (!this.hasPrecedingLineBreak() && this.match(47)) {
+ node.typeParameters = this.tsParseTypeArguments();
+ }
+ return this.finishNode(node, "TSTypeReference");
+ }
+ tsParseThisTypePredicate(lhs) {
+ this.next();
+ const node = this.startNodeAtNode(lhs);
+ node.parameterName = lhs;
+ node.typeAnnotation = this.tsParseTypeAnnotation(false);
+ node.asserts = false;
+ return this.finishNode(node, "TSTypePredicate");
+ }
+ tsParseThisTypeNode() {
+ const node = this.startNode();
+ this.next();
+ return this.finishNode(node, "TSThisType");
+ }
+ tsParseTypeQuery() {
+ const node = this.startNode();
+ this.expect(87);
+ if (this.match(83)) {
+ node.exprName = this.tsParseImportType();
+ } else {
+ node.exprName = this.tsParseEntityName();
+ }
+ if (!this.hasPrecedingLineBreak() && this.match(47)) {
+ node.typeParameters = this.tsParseTypeArguments();
+ }
+ return this.finishNode(node, "TSTypeQuery");
+ }
+ tsParseTypeParameter(parseModifiers) {
+ const node = this.startNode();
+ parseModifiers(node);
+ node.name = this.tsParseTypeParameterName();
+ node.constraint = this.tsEatThenParseType(81);
+ node.default = this.tsEatThenParseType(29);
+ return this.finishNode(node, "TSTypeParameter");
+ }
+ tsTryParseTypeParameters(parseModifiers) {
+ if (this.match(47)) {
+ return this.tsParseTypeParameters(parseModifiers);
+ }
+ }
+ tsParseTypeParameters(parseModifiers) {
+ const node = this.startNode();
+ if (this.match(47) || this.match(142)) {
+ this.next();
+ } else {
+ this.unexpected();
+ }
+ const refTrailingCommaPos = {
+ value: -1
+ };
+ node.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this, parseModifiers), false, true, refTrailingCommaPos);
+ if (node.params.length === 0) {
+ this.raise(TSErrors.EmptyTypeParameters, node);
+ }
+ if (refTrailingCommaPos.value !== -1) {
+ this.addExtra(node, "trailingComma", refTrailingCommaPos.value);
+ }
+ return this.finishNode(node, "TSTypeParameterDeclaration");
+ }
+ tsFillSignature(returnToken, signature) {
+ const returnTokenRequired = returnToken === 19;
+ const paramsKey = "parameters";
+ const returnTypeKey = "typeAnnotation";
+ signature.typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier);
+ this.expect(10);
+ signature[paramsKey] = this.tsParseBindingListForSignature();
+ if (returnTokenRequired) {
+ signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken);
+ } else if (this.match(returnToken)) {
+ signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken);
+ }
+ }
+ tsParseBindingListForSignature() {
+ const list = super.parseBindingList(11, 41, 2);
+ for (const pattern of list) {
+ const {
+ type
+ } = pattern;
+ if (type === "AssignmentPattern" || type === "TSParameterProperty") {
+ this.raise(TSErrors.UnsupportedSignatureParameterKind, pattern, {
+ type
+ });
+ }
+ }
+ return list;
+ }
+ tsParseTypeMemberSemicolon() {
+ if (!this.eat(12) && !this.isLineTerminator()) {
+ this.expect(13);
+ }
+ }
+ tsParseSignatureMember(kind, node) {
+ this.tsFillSignature(14, node);
+ this.tsParseTypeMemberSemicolon();
+ return this.finishNode(node, kind);
+ }
+ tsIsUnambiguouslyIndexSignature() {
+ this.next();
+ if (tokenIsIdentifier(this.state.type)) {
+ this.next();
+ return this.match(14);
+ }
+ return false;
+ }
+ tsTryParseIndexSignature(node) {
+ if (!(this.match(0) && this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))) {
+ return;
+ }
+ this.expect(0);
+ const id = this.parseIdentifier();
+ id.typeAnnotation = this.tsParseTypeAnnotation();
+ this.resetEndLocation(id);
+ this.expect(3);
+ node.parameters = [id];
+ const type = this.tsTryParseTypeAnnotation();
+ if (type) node.typeAnnotation = type;
+ this.tsParseTypeMemberSemicolon();
+ return this.finishNode(node, "TSIndexSignature");
+ }
+ tsParsePropertyOrMethodSignature(node, readonly) {
+ if (this.eat(17)) node.optional = true;
+ const nodeAny = node;
+ if (this.match(10) || this.match(47)) {
+ if (readonly) {
+ this.raise(TSErrors.ReadonlyForMethodSignature, node);
+ }
+ const method = nodeAny;
+ if (method.kind && this.match(47)) {
+ this.raise(TSErrors.AccessorCannotHaveTypeParameters, this.state.curPosition());
+ }
+ this.tsFillSignature(14, method);
+ this.tsParseTypeMemberSemicolon();
+ const paramsKey = "parameters";
+ const returnTypeKey = "typeAnnotation";
+ if (method.kind === "get") {
+ if (method[paramsKey].length > 0) {
+ this.raise(Errors.BadGetterArity, this.state.curPosition());
+ if (this.isThisParam(method[paramsKey][0])) {
+ this.raise(TSErrors.AccessorCannotDeclareThisParameter, this.state.curPosition());
+ }
+ }
+ } else if (method.kind === "set") {
+ if (method[paramsKey].length !== 1) {
+ this.raise(Errors.BadSetterArity, this.state.curPosition());
+ } else {
+ const firstParameter = method[paramsKey][0];
+ if (this.isThisParam(firstParameter)) {
+ this.raise(TSErrors.AccessorCannotDeclareThisParameter, this.state.curPosition());
+ }
+ if (firstParameter.type === "Identifier" && firstParameter.optional) {
+ this.raise(TSErrors.SetAccessorCannotHaveOptionalParameter, this.state.curPosition());
+ }
+ if (firstParameter.type === "RestElement") {
+ this.raise(TSErrors.SetAccessorCannotHaveRestParameter, this.state.curPosition());
+ }
+ }
+ if (method[returnTypeKey]) {
+ this.raise(TSErrors.SetAccessorCannotHaveReturnType, method[returnTypeKey]);
+ }
+ } else {
+ method.kind = "method";
+ }
+ return this.finishNode(method, "TSMethodSignature");
+ } else {
+ const property = nodeAny;
+ if (readonly) property.readonly = true;
+ const type = this.tsTryParseTypeAnnotation();
+ if (type) property.typeAnnotation = type;
+ this.tsParseTypeMemberSemicolon();
+ return this.finishNode(property, "TSPropertySignature");
+ }
+ }
+ tsParseTypeMember() {
+ const node = this.startNode();
+ if (this.match(10) || this.match(47)) {
+ return this.tsParseSignatureMember("TSCallSignatureDeclaration", node);
+ }
+ if (this.match(77)) {
+ const id = this.startNode();
+ this.next();
+ if (this.match(10) || this.match(47)) {
+ return this.tsParseSignatureMember("TSConstructSignatureDeclaration", node);
+ } else {
+ node.key = this.createIdentifier(id, "new");
+ return this.tsParsePropertyOrMethodSignature(node, false);
+ }
+ }
+ this.tsParseModifiers({
+ allowedModifiers: ["readonly"],
+ disallowedModifiers: ["declare", "abstract", "private", "protected", "public", "static", "override"]
+ }, node);
+ const idx = this.tsTryParseIndexSignature(node);
+ if (idx) {
+ return idx;
+ }
+ super.parsePropertyName(node);
+ if (!node.computed && node.key.type === "Identifier" && (node.key.name === "get" || node.key.name === "set") && this.tsTokenCanFollowModifier()) {
+ node.kind = node.key.name;
+ super.parsePropertyName(node);
+ }
+ return this.tsParsePropertyOrMethodSignature(node, !!node.readonly);
+ }
+ tsParseTypeLiteral() {
+ const node = this.startNode();
+ node.members = this.tsParseObjectTypeMembers();
+ return this.finishNode(node, "TSTypeLiteral");
+ }
+ tsParseObjectTypeMembers() {
+ this.expect(5);
+ const members = this.tsParseList("TypeMembers", this.tsParseTypeMember.bind(this));
+ this.expect(8);
+ return members;
+ }
+ tsIsStartOfMappedType() {
+ this.next();
+ if (this.eat(53)) {
+ return this.isContextual(122);
+ }
+ if (this.isContextual(122)) {
+ this.next();
+ }
+ if (!this.match(0)) {
+ return false;
+ }
+ this.next();
+ if (!this.tsIsIdentifier()) {
+ return false;
+ }
+ this.next();
+ return this.match(58);
+ }
+ tsParseMappedType() {
+ const node = this.startNode();
+ this.expect(5);
+ if (this.match(53)) {
+ node.readonly = this.state.value;
+ this.next();
+ this.expectContextual(122);
+ } else if (this.eatContextual(122)) {
+ node.readonly = true;
+ }
+ this.expect(0);
+ {
+ const typeParameter = this.startNode();
+ typeParameter.name = this.tsParseTypeParameterName();
+ typeParameter.constraint = this.tsExpectThenParseType(58);
+ node.typeParameter = this.finishNode(typeParameter, "TSTypeParameter");
+ }
+ node.nameType = this.eatContextual(93) ? this.tsParseType() : null;
+ this.expect(3);
+ if (this.match(53)) {
+ node.optional = this.state.value;
+ this.next();
+ this.expect(17);
+ } else if (this.eat(17)) {
+ node.optional = true;
+ }
+ node.typeAnnotation = this.tsTryParseType();
+ this.semicolon();
+ this.expect(8);
+ return this.finishNode(node, "TSMappedType");
+ }
+ tsParseTupleType() {
+ const node = this.startNode();
+ node.elementTypes = this.tsParseBracketedList("TupleElementTypes", this.tsParseTupleElementType.bind(this), true, false);
+ let seenOptionalElement = false;
+ node.elementTypes.forEach(elementNode => {
+ const {
+ type
+ } = elementNode;
+ if (seenOptionalElement && type !== "TSRestType" && type !== "TSOptionalType" && !(type === "TSNamedTupleMember" && elementNode.optional)) {
+ this.raise(TSErrors.OptionalTypeBeforeRequired, elementNode);
+ }
+ seenOptionalElement || (seenOptionalElement = type === "TSNamedTupleMember" && elementNode.optional || type === "TSOptionalType");
+ });
+ return this.finishNode(node, "TSTupleType");
+ }
+ tsParseTupleElementType() {
+ const {
+ startLoc
+ } = this.state;
+ const rest = this.eat(21);
+ let labeled;
+ let label;
+ let optional;
+ let type;
+ const isWord = tokenIsKeywordOrIdentifier(this.state.type);
+ const chAfterWord = isWord ? this.lookaheadCharCode() : null;
+ if (chAfterWord === 58) {
+ labeled = true;
+ optional = false;
+ label = this.parseIdentifier(true);
+ this.expect(14);
+ type = this.tsParseType();
+ } else if (chAfterWord === 63) {
+ optional = true;
+ const startLoc = this.state.startLoc;
+ const wordName = this.state.value;
+ const typeOrLabel = this.tsParseNonArrayType();
+ if (this.lookaheadCharCode() === 58) {
+ labeled = true;
+ label = this.createIdentifier(this.startNodeAt(startLoc), wordName);
+ this.expect(17);
+ this.expect(14);
+ type = this.tsParseType();
+ } else {
+ labeled = false;
+ type = typeOrLabel;
+ this.expect(17);
+ }
+ } else {
+ type = this.tsParseType();
+ optional = this.eat(17);
+ labeled = this.eat(14);
+ }
+ if (labeled) {
+ let labeledNode;
+ if (label) {
+ labeledNode = this.startNodeAtNode(label);
+ labeledNode.optional = optional;
+ labeledNode.label = label;
+ labeledNode.elementType = type;
+ if (this.eat(17)) {
+ labeledNode.optional = true;
+ this.raise(TSErrors.TupleOptionalAfterType, this.state.lastTokStartLoc);
+ }
+ } else {
+ labeledNode = this.startNodeAtNode(type);
+ labeledNode.optional = optional;
+ this.raise(TSErrors.InvalidTupleMemberLabel, type);
+ labeledNode.label = type;
+ labeledNode.elementType = this.tsParseType();
+ }
+ type = this.finishNode(labeledNode, "TSNamedTupleMember");
+ } else if (optional) {
+ const optionalTypeNode = this.startNodeAtNode(type);
+ optionalTypeNode.typeAnnotation = type;
+ type = this.finishNode(optionalTypeNode, "TSOptionalType");
+ }
+ if (rest) {
+ const restNode = this.startNodeAt(startLoc);
+ restNode.typeAnnotation = type;
+ type = this.finishNode(restNode, "TSRestType");
+ }
+ return type;
+ }
+ tsParseParenthesizedType() {
+ const node = this.startNode();
+ this.expect(10);
+ node.typeAnnotation = this.tsParseType();
+ this.expect(11);
+ return this.finishNode(node, "TSParenthesizedType");
+ }
+ tsParseFunctionOrConstructorType(type, abstract) {
+ const node = this.startNode();
+ if (type === "TSConstructorType") {
+ node.abstract = !!abstract;
+ if (abstract) this.next();
+ this.next();
+ }
+ this.tsInAllowConditionalTypesContext(() => this.tsFillSignature(19, node));
+ return this.finishNode(node, type);
+ }
+ tsParseLiteralTypeNode() {
+ const node = this.startNode();
+ switch (this.state.type) {
+ case 134:
+ case 135:
+ case 133:
+ case 85:
+ case 86:
+ node.literal = super.parseExprAtom();
+ break;
+ default:
+ this.unexpected();
+ }
+ return this.finishNode(node, "TSLiteralType");
+ }
+ tsParseTemplateLiteralType() {
+ const node = this.startNode();
+ node.literal = super.parseTemplate(false);
+ return this.finishNode(node, "TSLiteralType");
+ }
+ parseTemplateSubstitution() {
+ if (this.state.inType) return this.tsParseType();
+ return super.parseTemplateSubstitution();
+ }
+ tsParseThisTypeOrThisTypePredicate() {
+ const thisKeyword = this.tsParseThisTypeNode();
+ if (this.isContextual(116) && !this.hasPrecedingLineBreak()) {
+ return this.tsParseThisTypePredicate(thisKeyword);
+ } else {
+ return thisKeyword;
+ }
+ }
+ tsParseNonArrayType() {
+ switch (this.state.type) {
+ case 133:
+ case 134:
+ case 135:
+ case 85:
+ case 86:
+ return this.tsParseLiteralTypeNode();
+ case 53:
+ if (this.state.value === "-") {
+ const node = this.startNode();
+ const nextToken = this.lookahead();
+ if (nextToken.type !== 134 && nextToken.type !== 135) {
+ this.unexpected();
+ }
+ node.literal = this.parseMaybeUnary();
+ return this.finishNode(node, "TSLiteralType");
+ }
+ break;
+ case 78:
+ return this.tsParseThisTypeOrThisTypePredicate();
+ case 87:
+ return this.tsParseTypeQuery();
+ case 83:
+ return this.tsParseImportType();
+ case 5:
+ return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this)) ? this.tsParseMappedType() : this.tsParseTypeLiteral();
+ case 0:
+ return this.tsParseTupleType();
+ case 10:
+ return this.tsParseParenthesizedType();
+ case 25:
+ case 24:
+ return this.tsParseTemplateLiteralType();
+ default:
+ {
+ const {
+ type
+ } = this.state;
+ if (tokenIsIdentifier(type) || type === 88 || type === 84) {
+ const nodeType = type === 88 ? "TSVoidKeyword" : type === 84 ? "TSNullKeyword" : keywordTypeFromName(this.state.value);
+ if (nodeType !== undefined && this.lookaheadCharCode() !== 46) {
+ const node = this.startNode();
+ this.next();
+ return this.finishNode(node, nodeType);
+ }
+ return this.tsParseTypeReference();
+ }
+ }
+ }
+ this.unexpected();
+ }
+ tsParseArrayTypeOrHigher() {
+ let type = this.tsParseNonArrayType();
+ while (!this.hasPrecedingLineBreak() && this.eat(0)) {
+ if (this.match(3)) {
+ const node = this.startNodeAtNode(type);
+ node.elementType = type;
+ this.expect(3);
+ type = this.finishNode(node, "TSArrayType");
+ } else {
+ const node = this.startNodeAtNode(type);
+ node.objectType = type;
+ node.indexType = this.tsParseType();
+ this.expect(3);
+ type = this.finishNode(node, "TSIndexedAccessType");
+ }
+ }
+ return type;
+ }
+ tsParseTypeOperator() {
+ const node = this.startNode();
+ const operator = this.state.value;
+ this.next();
+ node.operator = operator;
+ node.typeAnnotation = this.tsParseTypeOperatorOrHigher();
+ if (operator === "readonly") {
+ this.tsCheckTypeAnnotationForReadOnly(node);
+ }
+ return this.finishNode(node, "TSTypeOperator");
+ }
+ tsCheckTypeAnnotationForReadOnly(node) {
+ switch (node.typeAnnotation.type) {
+ case "TSTupleType":
+ case "TSArrayType":
+ return;
+ default:
+ this.raise(TSErrors.UnexpectedReadonly, node);
+ }
+ }
+ tsParseInferType() {
+ const node = this.startNode();
+ this.expectContextual(115);
+ const typeParameter = this.startNode();
+ typeParameter.name = this.tsParseTypeParameterName();
+ typeParameter.constraint = this.tsTryParse(() => this.tsParseConstraintForInferType());
+ node.typeParameter = this.finishNode(typeParameter, "TSTypeParameter");
+ return this.finishNode(node, "TSInferType");
+ }
+ tsParseConstraintForInferType() {
+ if (this.eat(81)) {
+ const constraint = this.tsInDisallowConditionalTypesContext(() => this.tsParseType());
+ if (this.state.inDisallowConditionalTypesContext || !this.match(17)) {
+ return constraint;
+ }
+ }
+ }
+ tsParseTypeOperatorOrHigher() {
+ const isTypeOperator = tokenIsTSTypeOperator(this.state.type) && !this.state.containsEsc;
+ return isTypeOperator ? this.tsParseTypeOperator() : this.isContextual(115) ? this.tsParseInferType() : this.tsInAllowConditionalTypesContext(() => this.tsParseArrayTypeOrHigher());
+ }
+ tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
+ const node = this.startNode();
+ const hasLeadingOperator = this.eat(operator);
+ const types = [];
+ do {
+ types.push(parseConstituentType());
+ } while (this.eat(operator));
+ if (types.length === 1 && !hasLeadingOperator) {
+ return types[0];
+ }
+ node.types = types;
+ return this.finishNode(node, kind);
+ }
+ tsParseIntersectionTypeOrHigher() {
+ return this.tsParseUnionOrIntersectionType("TSIntersectionType", this.tsParseTypeOperatorOrHigher.bind(this), 45);
+ }
+ tsParseUnionTypeOrHigher() {
+ return this.tsParseUnionOrIntersectionType("TSUnionType", this.tsParseIntersectionTypeOrHigher.bind(this), 43);
+ }
+ tsIsStartOfFunctionType() {
+ if (this.match(47)) {
+ return true;
+ }
+ return this.match(10) && this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this));
+ }
+ tsSkipParameterStart() {
+ if (tokenIsIdentifier(this.state.type) || this.match(78)) {
+ this.next();
+ return true;
+ }
+ if (this.match(5)) {
+ const {
+ errors
+ } = this.state;
+ const previousErrorCount = errors.length;
+ try {
+ this.parseObjectLike(8, true);
+ return errors.length === previousErrorCount;
+ } catch (_unused) {
+ return false;
+ }
+ }
+ if (this.match(0)) {
+ this.next();
+ const {
+ errors
+ } = this.state;
+ const previousErrorCount = errors.length;
+ try {
+ super.parseBindingList(3, 93, 1);
+ return errors.length === previousErrorCount;
+ } catch (_unused2) {
+ return false;
+ }
+ }
+ return false;
+ }
+ tsIsUnambiguouslyStartOfFunctionType() {
+ this.next();
+ if (this.match(11) || this.match(21)) {
+ return true;
+ }
+ if (this.tsSkipParameterStart()) {
+ if (this.match(14) || this.match(12) || this.match(17) || this.match(29)) {
+ return true;
+ }
+ if (this.match(11)) {
+ this.next();
+ if (this.match(19)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+ tsParseTypeOrTypePredicateAnnotation(returnToken) {
+ return this.tsInType(() => {
+ const t = this.startNode();
+ this.expect(returnToken);
+ const node = this.startNode();
+ const asserts = !!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));
+ if (asserts && this.match(78)) {
+ let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate();
+ if (thisTypePredicate.type === "TSThisType") {
+ node.parameterName = thisTypePredicate;
+ node.asserts = true;
+ node.typeAnnotation = null;
+ thisTypePredicate = this.finishNode(node, "TSTypePredicate");
+ } else {
+ this.resetStartLocationFromNode(thisTypePredicate, node);
+ thisTypePredicate.asserts = true;
+ }
+ t.typeAnnotation = thisTypePredicate;
+ return this.finishNode(t, "TSTypeAnnotation");
+ }
+ const typePredicateVariable = this.tsIsIdentifier() && this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));
+ if (!typePredicateVariable) {
+ if (!asserts) {
+ return this.tsParseTypeAnnotation(false, t);
+ }
+ node.parameterName = this.parseIdentifier();
+ node.asserts = asserts;
+ node.typeAnnotation = null;
+ t.typeAnnotation = this.finishNode(node, "TSTypePredicate");
+ return this.finishNode(t, "TSTypeAnnotation");
+ }
+ const type = this.tsParseTypeAnnotation(false);
+ node.parameterName = typePredicateVariable;
+ node.typeAnnotation = type;
+ node.asserts = asserts;
+ t.typeAnnotation = this.finishNode(node, "TSTypePredicate");
+ return this.finishNode(t, "TSTypeAnnotation");
+ });
+ }
+ tsTryParseTypeOrTypePredicateAnnotation() {
+ if (this.match(14)) {
+ return this.tsParseTypeOrTypePredicateAnnotation(14);
+ }
+ }
+ tsTryParseTypeAnnotation() {
+ if (this.match(14)) {
+ return this.tsParseTypeAnnotation();
+ }
+ }
+ tsTryParseType() {
+ return this.tsEatThenParseType(14);
+ }
+ tsParseTypePredicatePrefix() {
+ const id = this.parseIdentifier();
+ if (this.isContextual(116) && !this.hasPrecedingLineBreak()) {
+ this.next();
+ return id;
+ }
+ }
+ tsParseTypePredicateAsserts() {
+ if (this.state.type !== 109) {
+ return false;
+ }
+ const containsEsc = this.state.containsEsc;
+ this.next();
+ if (!tokenIsIdentifier(this.state.type) && !this.match(78)) {
+ return false;
+ }
+ if (containsEsc) {
+ this.raise(Errors.InvalidEscapedReservedWord, this.state.lastTokStartLoc, {
+ reservedWord: "asserts"
+ });
+ }
+ return true;
+ }
+ tsParseTypeAnnotation(eatColon = true, t = this.startNode()) {
+ this.tsInType(() => {
+ if (eatColon) this.expect(14);
+ t.typeAnnotation = this.tsParseType();
+ });
+ return this.finishNode(t, "TSTypeAnnotation");
+ }
+ tsParseType() {
+ assert(this.state.inType);
+ const type = this.tsParseNonConditionalType();
+ if (this.state.inDisallowConditionalTypesContext || this.hasPrecedingLineBreak() || !this.eat(81)) {
+ return type;
+ }
+ const node = this.startNodeAtNode(type);
+ node.checkType = type;
+ node.extendsType = this.tsInDisallowConditionalTypesContext(() => this.tsParseNonConditionalType());
+ this.expect(17);
+ node.trueType = this.tsInAllowConditionalTypesContext(() => this.tsParseType());
+ this.expect(14);
+ node.falseType = this.tsInAllowConditionalTypesContext(() => this.tsParseType());
+ return this.finishNode(node, "TSConditionalType");
+ }
+ isAbstractConstructorSignature() {
+ return this.isContextual(124) && this.lookahead().type === 77;
+ }
+ tsParseNonConditionalType() {
+ if (this.tsIsStartOfFunctionType()) {
+ return this.tsParseFunctionOrConstructorType("TSFunctionType");
+ }
+ if (this.match(77)) {
+ return this.tsParseFunctionOrConstructorType("TSConstructorType");
+ } else if (this.isAbstractConstructorSignature()) {
+ return this.tsParseFunctionOrConstructorType("TSConstructorType", true);
+ }
+ return this.tsParseUnionTypeOrHigher();
+ }
+ tsParseTypeAssertion() {
+ if (this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) {
+ this.raise(TSErrors.ReservedTypeAssertion, this.state.startLoc);
+ }
+ const node = this.startNode();
+ node.typeAnnotation = this.tsInType(() => {
+ this.next();
+ return this.match(75) ? this.tsParseTypeReference() : this.tsParseType();
+ });
+ this.expect(48);
+ node.expression = this.parseMaybeUnary();
+ return this.finishNode(node, "TSTypeAssertion");
+ }
+ tsParseHeritageClause(token) {
+ const originalStartLoc = this.state.startLoc;
+ const delimitedList = this.tsParseDelimitedList("HeritageClauseElement", () => {
+ const node = this.startNode();
+ node.expression = this.tsParseEntityName();
+ if (this.match(47)) {
+ node.typeParameters = this.tsParseTypeArguments();
+ }
+ return this.finishNode(node, "TSExpressionWithTypeArguments");
+ });
+ if (!delimitedList.length) {
+ this.raise(TSErrors.EmptyHeritageClauseType, originalStartLoc, {
+ token
+ });
+ }
+ return delimitedList;
+ }
+ tsParseInterfaceDeclaration(node, properties = {}) {
+ if (this.hasFollowingLineBreak()) return null;
+ this.expectContextual(129);
+ if (properties.declare) node.declare = true;
+ if (tokenIsIdentifier(this.state.type)) {
+ node.id = this.parseIdentifier();
+ this.checkIdentifier(node.id, 130);
+ } else {
+ node.id = null;
+ this.raise(TSErrors.MissingInterfaceName, this.state.startLoc);
+ }
+ node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);
+ if (this.eat(81)) {
+ node.extends = this.tsParseHeritageClause("extends");
+ }
+ const body = this.startNode();
+ body.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this));
+ node.body = this.finishNode(body, "TSInterfaceBody");
+ return this.finishNode(node, "TSInterfaceDeclaration");
+ }
+ tsParseTypeAliasDeclaration(node) {
+ node.id = this.parseIdentifier();
+ this.checkIdentifier(node.id, 2);
+ node.typeAnnotation = this.tsInType(() => {
+ node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers);
+ this.expect(29);
+ if (this.isContextual(114) && this.lookahead().type !== 16) {
+ const node = this.startNode();
+ this.next();
+ return this.finishNode(node, "TSIntrinsicKeyword");
+ }
+ return this.tsParseType();
+ });
+ this.semicolon();
+ return this.finishNode(node, "TSTypeAliasDeclaration");
+ }
+ tsInNoContext(cb) {
+ const oldContext = this.state.context;
+ this.state.context = [oldContext[0]];
+ try {
+ return cb();
+ } finally {
+ this.state.context = oldContext;
+ }
+ }
+ tsInType(cb) {
+ const oldInType = this.state.inType;
+ this.state.inType = true;
+ try {
+ return cb();
+ } finally {
+ this.state.inType = oldInType;
+ }
+ }
+ tsInDisallowConditionalTypesContext(cb) {
+ const oldInDisallowConditionalTypesContext = this.state.inDisallowConditionalTypesContext;
+ this.state.inDisallowConditionalTypesContext = true;
+ try {
+ return cb();
+ } finally {
+ this.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext;
+ }
+ }
+ tsInAllowConditionalTypesContext(cb) {
+ const oldInDisallowConditionalTypesContext = this.state.inDisallowConditionalTypesContext;
+ this.state.inDisallowConditionalTypesContext = false;
+ try {
+ return cb();
+ } finally {
+ this.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext;
+ }
+ }
+ tsEatThenParseType(token) {
+ if (this.match(token)) {
+ return this.tsNextThenParseType();
+ }
+ }
+ tsExpectThenParseType(token) {
+ return this.tsInType(() => {
+ this.expect(token);
+ return this.tsParseType();
+ });
+ }
+ tsNextThenParseType() {
+ return this.tsInType(() => {
+ this.next();
+ return this.tsParseType();
+ });
+ }
+ tsParseEnumMember() {
+ const node = this.startNode();
+ node.id = this.match(133) ? super.parseStringLiteral(this.state.value) : this.parseIdentifier(true);
+ if (this.eat(29)) {
+ node.initializer = super.parseMaybeAssignAllowIn();
+ }
+ return this.finishNode(node, "TSEnumMember");
+ }
+ tsParseEnumDeclaration(node, properties = {}) {
+ if (properties.const) node.const = true;
+ if (properties.declare) node.declare = true;
+ 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);
+ return this.finishNode(node, "TSEnumDeclaration");
+ }
+ tsParseModuleBlock() {
+ const node = this.startNode();
+ this.scope.enter(0);
+ this.expect(5);
+ super.parseBlockOrModuleBlockBody(node.body = [], undefined, true, 8);
+ this.scope.exit();
+ return this.finishNode(node, "TSModuleBlock");
+ }
+ tsParseModuleOrNamespaceDeclaration(node, nested = false) {
+ node.id = this.parseIdentifier();
+ if (!nested) {
+ this.checkIdentifier(node.id, 1024);
+ }
+ if (this.eat(16)) {
+ const inner = this.startNode();
+ this.tsParseModuleOrNamespaceDeclaration(inner, true);
+ node.body = inner;
+ } else {
+ this.scope.enter(256);
+ this.prodParam.enter(0);
+ node.body = this.tsParseModuleBlock();
+ this.prodParam.exit();
+ this.scope.exit();
+ }
+ return this.finishNode(node, "TSModuleDeclaration");
+ }
+ tsParseAmbientExternalModuleDeclaration(node) {
+ if (this.isContextual(112)) {
+ node.global = true;
+ node.id = this.parseIdentifier();
+ } else if (this.match(133)) {
+ node.id = super.parseStringLiteral(this.state.value);
+ } else {
+ this.unexpected();
+ }
+ if (this.match(5)) {
+ this.scope.enter(256);
+ this.prodParam.enter(0);
+ node.body = this.tsParseModuleBlock();
+ this.prodParam.exit();
+ this.scope.exit();
+ } else {
+ this.semicolon();
+ }
+ return this.finishNode(node, "TSModuleDeclaration");
+ }
+ tsParseImportEqualsDeclaration(node, maybeDefaultIdentifier, isExport) {
+ node.isExport = isExport || false;
+ node.id = maybeDefaultIdentifier || this.parseIdentifier();
+ this.checkIdentifier(node.id, 4096);
+ this.expect(29);
+ const moduleReference = this.tsParseModuleReference();
+ if (node.importKind === "type" && moduleReference.type !== "TSExternalModuleReference") {
+ this.raise(TSErrors.ImportAliasHasImportType, moduleReference);
+ }
+ node.moduleReference = moduleReference;
+ this.semicolon();
+ return this.finishNode(node, "TSImportEqualsDeclaration");
+ }
+ tsIsExternalModuleReference() {
+ return this.isContextual(119) && this.lookaheadCharCode() === 40;
+ }
+ tsParseModuleReference() {
+ return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(false);
+ }
+ tsParseExternalModuleReference() {
+ const node = this.startNode();
+ this.expectContextual(119);
+ this.expect(10);
+ if (!this.match(133)) {
+ this.unexpected();
+ }
+ node.expression = super.parseExprAtom();
+ this.expect(11);
+ this.sawUnambiguousESM = true;
+ return this.finishNode(node, "TSExternalModuleReference");
+ }
+ tsLookAhead(f) {
+ const state = this.state.clone();
+ const res = f();
+ this.state = state;
+ return res;
+ }
+ tsTryParseAndCatch(f) {
+ const result = this.tryParse(abort => f() || abort());
+ if (result.aborted || !result.node) return;
+ if (result.error) this.state = result.failState;
+ return result.node;
+ }
+ tsTryParse(f) {
+ const state = this.state.clone();
+ const result = f();
+ if (result !== undefined && result !== false) {
+ return result;
+ }
+ this.state = state;
+ }
+ tsTryParseDeclare(nany) {
+ if (this.isLineTerminator()) {
+ return;
+ }
+ let startType = this.state.type;
+ let kind;
+ if (this.isContextual(100)) {
+ startType = 74;
+ kind = "let";
+ }
+ return this.tsInAmbientContext(() => {
+ switch (startType) {
+ case 68:
+ nany.declare = true;
+ return super.parseFunctionStatement(nany, false, false);
+ case 80:
+ nany.declare = true;
+ return this.parseClass(nany, true, false);
+ case 126:
+ return this.tsParseEnumDeclaration(nany, {
+ declare: true
+ });
+ case 112:
+ return this.tsParseAmbientExternalModuleDeclaration(nany);
+ case 75:
+ case 74:
+ if (!this.match(75) || !this.isLookaheadContextual("enum")) {
+ nany.declare = true;
+ return this.parseVarStatement(nany, kind || this.state.value, true);
+ }
+ this.expect(75);
+ return this.tsParseEnumDeclaration(nany, {
+ const: true,
+ declare: true
+ });
+ case 129:
+ {
+ const result = this.tsParseInterfaceDeclaration(nany, {
+ declare: true
+ });
+ if (result) return result;
+ }
+ default:
+ if (tokenIsIdentifier(startType)) {
+ return this.tsParseDeclaration(nany, this.state.value, true, null);
+ }
+ }
+ });
+ }
+ tsTryParseExportDeclaration() {
+ return this.tsParseDeclaration(this.startNode(), this.state.value, true, null);
+ }
+ tsParseExpressionStatement(node, expr, decorators) {
+ switch (expr.name) {
+ case "declare":
+ {
+ const declaration = this.tsTryParseDeclare(node);
+ if (declaration) {
+ declaration.declare = true;
+ }
+ return declaration;
+ }
+ case "global":
+ if (this.match(5)) {
+ this.scope.enter(256);
+ this.prodParam.enter(0);
+ const mod = node;
+ mod.global = true;
+ mod.id = expr;
+ mod.body = this.tsParseModuleBlock();
+ this.scope.exit();
+ this.prodParam.exit();
+ return this.finishNode(mod, "TSModuleDeclaration");
+ }
+ break;
+ default:
+ return this.tsParseDeclaration(node, expr.name, false, decorators);
+ }
+ }
+ tsParseDeclaration(node, value, next, decorators) {
+ switch (value) {
+ case "abstract":
+ if (this.tsCheckLineTerminator(next) && (this.match(80) || tokenIsIdentifier(this.state.type))) {
+ return this.tsParseAbstractDeclaration(node, decorators);
+ }
+ break;
+ case "module":
+ if (this.tsCheckLineTerminator(next)) {
+ if (this.match(133)) {
+ return this.tsParseAmbientExternalModuleDeclaration(node);
+ } else if (tokenIsIdentifier(this.state.type)) {
+ return this.tsParseModuleOrNamespaceDeclaration(node);
+ }
+ }
+ break;
+ case "namespace":
+ if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) {
+ return this.tsParseModuleOrNamespaceDeclaration(node);
+ }
+ break;
+ case "type":
+ if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) {
+ return this.tsParseTypeAliasDeclaration(node);
+ }
+ break;
+ }
+ }
+ tsCheckLineTerminator(next) {
+ if (next) {
+ if (this.hasFollowingLineBreak()) return false;
+ this.next();
+ return true;
+ }
+ return !this.isLineTerminator();
+ }
+ tsTryParseGenericAsyncArrowFunction(startLoc) {
+ if (!this.match(47)) return;
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ this.state.maybeInArrowParameters = true;
+ const res = this.tsTryParseAndCatch(() => {
+ const node = this.startNodeAt(startLoc);
+ node.typeParameters = this.tsParseTypeParameters(this.tsParseConstModifier);
+ super.parseFunctionParams(node);
+ node.returnType = this.tsTryParseTypeOrTypePredicateAnnotation();
+ this.expect(19);
+ return node;
+ });
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ if (!res) return;
+ return super.parseArrowExpression(res, null, true);
+ }
+ tsParseTypeArgumentsInExpression() {
+ if (this.reScan_lt() !== 47) return;
+ return this.tsParseTypeArguments();
+ }
+ tsParseTypeArguments() {
+ const node = this.startNode();
+ node.params = this.tsInType(() => this.tsInNoContext(() => {
+ this.expect(47);
+ return this.tsParseDelimitedList("TypeParametersOrArguments", this.tsParseType.bind(this));
+ }));
+ if (node.params.length === 0) {
+ this.raise(TSErrors.EmptyTypeArguments, node);
+ } else if (!this.state.inType && this.curContext() === types.brace) {
+ this.reScan_lt_gt();
+ }
+ this.expect(48);
+ return this.finishNode(node, "TSTypeParameterInstantiation");
+ }
+ tsIsDeclarationStart() {
+ return tokenIsTSDeclarationStart(this.state.type);
+ }
+ isExportDefaultSpecifier() {
+ if (this.tsIsDeclarationStart()) return false;
+ return super.isExportDefaultSpecifier();
+ }
+ parseAssignableListItem(flags, decorators) {
+ const startLoc = this.state.startLoc;
+ const modified = {};
+ this.tsParseModifiers({
+ allowedModifiers: ["public", "private", "protected", "override", "readonly"]
+ }, modified);
+ const accessibility = modified.accessibility;
+ const override = modified.override;
+ const readonly = modified.readonly;
+ if (!(flags & 4) && (accessibility || readonly || override)) {
+ this.raise(TSErrors.UnexpectedParameterModifier, startLoc);
+ }
+ const left = this.parseMaybeDefault();
+ this.parseAssignableListItemTypes(left, flags);
+ const elt = this.parseMaybeDefault(left.loc.start, left);
+ if (accessibility || readonly || override) {
+ const pp = this.startNodeAt(startLoc);
+ if (decorators.length) {
+ pp.decorators = decorators;
+ }
+ if (accessibility) pp.accessibility = accessibility;
+ if (readonly) pp.readonly = readonly;
+ if (override) pp.override = override;
+ if (elt.type !== "Identifier" && elt.type !== "AssignmentPattern") {
+ this.raise(TSErrors.UnsupportedParameterPropertyKind, pp);
+ }
+ pp.parameter = elt;
+ return this.finishNode(pp, "TSParameterProperty");
+ }
+ if (decorators.length) {
+ left.decorators = decorators;
+ }
+ return elt;
+ }
+ isSimpleParameter(node) {
+ return node.type === "TSParameterProperty" && super.isSimpleParameter(node.parameter) || super.isSimpleParameter(node);
+ }
+ tsDisallowOptionalPattern(node) {
+ for (const param of node.params) {
+ if (param.type !== "Identifier" && param.optional && !this.state.isAmbientContext) {
+ this.raise(TSErrors.PatternIsOptional, param);
+ }
+ }
+ }
+ setArrowFunctionParameters(node, params, trailingCommaLoc) {
+ super.setArrowFunctionParameters(node, params, trailingCommaLoc);
+ this.tsDisallowOptionalPattern(node);
+ }
+ parseFunctionBodyAndFinish(node, type, isMethod = false) {
+ if (this.match(14)) {
+ node.returnType = this.tsParseTypeOrTypePredicateAnnotation(14);
+ }
+ const bodilessType = type === "FunctionDeclaration" ? "TSDeclareFunction" : type === "ClassMethod" || type === "ClassPrivateMethod" ? "TSDeclareMethod" : undefined;
+ if (bodilessType && !this.match(5) && this.isLineTerminator()) {
+ return this.finishNode(node, bodilessType);
+ }
+ if (bodilessType === "TSDeclareFunction" && this.state.isAmbientContext) {
+ this.raise(TSErrors.DeclareFunctionHasImplementation, node);
+ if (node.declare) {
+ return super.parseFunctionBodyAndFinish(node, bodilessType, isMethod);
+ }
+ }
+ this.tsDisallowOptionalPattern(node);
+ return super.parseFunctionBodyAndFinish(node, type, isMethod);
+ }
+ registerFunctionStatementId(node) {
+ if (!node.body && node.id) {
+ this.checkIdentifier(node.id, 1024);
+ } else {
+ super.registerFunctionStatementId(node);
+ }
+ }
+ tsCheckForInvalidTypeCasts(items) {
+ items.forEach(node => {
+ if ((node == null ? void 0 : node.type) === "TSTypeCastExpression") {
+ this.raise(TSErrors.UnexpectedTypeAnnotation, node.typeAnnotation);
+ }
+ });
+ }
+ toReferencedList(exprList, isInParens) {
+ this.tsCheckForInvalidTypeCasts(exprList);
+ return exprList;
+ }
+ parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) {
+ const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors);
+ if (node.type === "ArrayExpression") {
+ this.tsCheckForInvalidTypeCasts(node.elements);
+ }
+ return node;
+ }
+ parseSubscript(base, startLoc, noCalls, state) {
+ if (!this.hasPrecedingLineBreak() && this.match(35)) {
+ this.state.canStartJSXElement = false;
+ this.next();
+ const nonNullExpression = this.startNodeAt(startLoc);
+ nonNullExpression.expression = base;
+ return this.finishNode(nonNullExpression, "TSNonNullExpression");
+ }
+ let isOptionalCall = false;
+ if (this.match(18) && this.lookaheadCharCode() === 60) {
+ if (noCalls) {
+ state.stop = true;
+ return base;
+ }
+ state.optionalChainMember = isOptionalCall = true;
+ this.next();
+ }
+ if (this.match(47) || this.match(51)) {
+ let missingParenErrorLoc;
+ const result = this.tsTryParseAndCatch(() => {
+ if (!noCalls && this.atPossibleAsyncArrow(base)) {
+ const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(startLoc);
+ if (asyncArrowFn) {
+ return asyncArrowFn;
+ }
+ }
+ const typeArguments = this.tsParseTypeArgumentsInExpression();
+ if (!typeArguments) return;
+ if (isOptionalCall && !this.match(10)) {
+ missingParenErrorLoc = this.state.curPosition();
+ return;
+ }
+ if (tokenIsTemplate(this.state.type)) {
+ const result = super.parseTaggedTemplateExpression(base, startLoc, state);
+ result.typeParameters = typeArguments;
+ return result;
+ }
+ if (!noCalls && this.eat(10)) {
+ const node = this.startNodeAt(startLoc);
+ node.callee = base;
+ node.arguments = this.parseCallExpressionArguments(11, false);
+ this.tsCheckForInvalidTypeCasts(node.arguments);
+ node.typeParameters = typeArguments;
+ if (state.optionalChainMember) {
+ node.optional = isOptionalCall;
+ }
+ return this.finishCallExpression(node, state.optionalChainMember);
+ }
+ const tokenType = this.state.type;
+ if (tokenType === 48 || tokenType === 52 || tokenType !== 10 && tokenCanStartExpression(tokenType) && !this.hasPrecedingLineBreak()) {
+ return;
+ }
+ const node = this.startNodeAt(startLoc);
+ node.expression = base;
+ node.typeParameters = typeArguments;
+ return this.finishNode(node, "TSInstantiationExpression");
+ });
+ if (missingParenErrorLoc) {
+ this.unexpected(missingParenErrorLoc, 10);
+ }
+ if (result) {
+ if (result.type === "TSInstantiationExpression" && (this.match(16) || this.match(18) && this.lookaheadCharCode() !== 40)) {
+ this.raise(TSErrors.InvalidPropertyAccessAfterInstantiationExpression, this.state.startLoc);
+ }
+ return result;
+ }
+ }
+ return super.parseSubscript(base, startLoc, noCalls, state);
+ }
+ parseNewCallee(node) {
+ var _callee$extra;
+ super.parseNewCallee(node);
+ const {
+ callee
+ } = node;
+ if (callee.type === "TSInstantiationExpression" && !((_callee$extra = callee.extra) != null && _callee$extra.parenthesized)) {
+ node.typeParameters = callee.typeParameters;
+ node.callee = callee.expression;
+ }
+ }
+ parseExprOp(left, leftStartLoc, minPrec) {
+ let isSatisfies;
+ if (tokenOperatorPrecedence(58) > minPrec && !this.hasPrecedingLineBreak() && (this.isContextual(93) || (isSatisfies = this.isContextual(120)))) {
+ const node = this.startNodeAt(leftStartLoc);
+ node.expression = left;
+ node.typeAnnotation = this.tsInType(() => {
+ this.next();
+ if (this.match(75)) {
+ if (isSatisfies) {
+ this.raise(Errors.UnexpectedKeyword, this.state.startLoc, {
+ keyword: "const"
+ });
+ }
+ return this.tsParseTypeReference();
+ }
+ return this.tsParseType();
+ });
+ this.finishNode(node, isSatisfies ? "TSSatisfiesExpression" : "TSAsExpression");
+ this.reScan_lt_gt();
+ return this.parseExprOp(node, leftStartLoc, minPrec);
+ }
+ return super.parseExprOp(left, leftStartLoc, minPrec);
+ }
+ checkReservedWord(word, startLoc, checkKeywords, isBinding) {
+ if (!this.state.isAmbientContext) {
+ super.checkReservedWord(word, startLoc, checkKeywords, isBinding);
+ }
+ }
+ checkImportReflection(node) {
+ super.checkImportReflection(node);
+ if (node.module && node.importKind !== "value") {
+ this.raise(TSErrors.ImportReflectionHasImportType, node.specifiers[0].loc.start);
+ }
+ }
+ checkDuplicateExports() {}
+ isPotentialImportPhase(isExport) {
+ if (super.isPotentialImportPhase(isExport)) return true;
+ if (this.isContextual(130)) {
+ const ch = this.lookaheadCharCode();
+ return isExport ? ch === 123 || ch === 42 : ch !== 61;
+ }
+ return !isExport && this.isContextual(87);
+ }
+ applyImportPhase(node, isExport, phase, loc) {
+ super.applyImportPhase(node, isExport, phase, loc);
+ if (isExport) {
+ node.exportKind = phase === "type" ? "type" : "value";
+ } else {
+ node.importKind = phase === "type" || phase === "typeof" ? phase : "value";
+ }
+ }
+ parseImport(node) {
+ if (this.match(133)) {
+ node.importKind = "value";
+ return super.parseImport(node);
+ }
+ let importNode;
+ if (tokenIsIdentifier(this.state.type) && this.lookaheadCharCode() === 61) {
+ node.importKind = "value";
+ return this.tsParseImportEqualsDeclaration(node);
+ } else if (this.isContextual(130)) {
+ const maybeDefaultIdentifier = this.parseMaybeImportPhase(node, false);
+ if (this.lookaheadCharCode() === 61) {
+ return this.tsParseImportEqualsDeclaration(node, maybeDefaultIdentifier);
+ } else {
+ importNode = super.parseImportSpecifiersAndAfter(node, maybeDefaultIdentifier);
+ }
+ } else {
+ importNode = super.parseImport(node);
+ }
+ if (importNode.importKind === "type" && importNode.specifiers.length > 1 && importNode.specifiers[0].type === "ImportDefaultSpecifier") {
+ this.raise(TSErrors.TypeImportCannotSpecifyDefaultAndNamed, importNode);
+ }
+ return importNode;
+ }
+ parseExport(node, decorators) {
+ if (this.match(83)) {
+ this.next();
+ const nodeImportEquals = node;
+ let maybeDefaultIdentifier = null;
+ if (this.isContextual(130) && this.isPotentialImportPhase(false)) {
+ maybeDefaultIdentifier = this.parseMaybeImportPhase(nodeImportEquals, false);
+ } else {
+ nodeImportEquals.importKind = "value";
+ }
+ return this.tsParseImportEqualsDeclaration(nodeImportEquals, maybeDefaultIdentifier, true);
+ } else if (this.eat(29)) {
+ const assign = node;
+ assign.expression = super.parseExpression();
+ this.semicolon();
+ this.sawUnambiguousESM = true;
+ return this.finishNode(assign, "TSExportAssignment");
+ } else if (this.eatContextual(93)) {
+ const decl = node;
+ this.expectContextual(128);
+ decl.id = this.parseIdentifier();
+ this.semicolon();
+ return this.finishNode(decl, "TSNamespaceExportDeclaration");
+ } else {
+ return super.parseExport(node, decorators);
+ }
+ }
+ isAbstractClass() {
+ return this.isContextual(124) && this.lookahead().type === 80;
+ }
+ parseExportDefaultExpression() {
+ if (this.isAbstractClass()) {
+ const cls = this.startNode();
+ this.next();
+ cls.abstract = true;
+ return this.parseClass(cls, true, true);
+ }
+ if (this.match(129)) {
+ const result = this.tsParseInterfaceDeclaration(this.startNode());
+ if (result) return result;
+ }
+ return super.parseExportDefaultExpression();
+ }
+ parseVarStatement(node, kind, allowMissingInitializer = false) {
+ const {
+ isAmbientContext
+ } = this.state;
+ const declaration = super.parseVarStatement(node, kind, allowMissingInitializer || isAmbientContext);
+ if (!isAmbientContext) return declaration;
+ for (const {
+ id,
+ init
+ } of declaration.declarations) {
+ if (!init) continue;
+ if (kind !== "const" || !!id.typeAnnotation) {
+ this.raise(TSErrors.InitializerNotAllowedInAmbientContext, init);
+ } else if (!isValidAmbientConstInitializer(init, this.hasPlugin("estree"))) {
+ this.raise(TSErrors.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference, init);
+ }
+ }
+ return declaration;
+ }
+ parseStatementContent(flags, decorators) {
+ if (this.match(75) && this.isLookaheadContextual("enum")) {
+ const node = this.startNode();
+ this.expect(75);
+ return this.tsParseEnumDeclaration(node, {
+ const: true
+ });
+ }
+ if (this.isContextual(126)) {
+ return this.tsParseEnumDeclaration(this.startNode());
+ }
+ if (this.isContextual(129)) {
+ const result = this.tsParseInterfaceDeclaration(this.startNode());
+ if (result) return result;
+ }
+ return super.parseStatementContent(flags, decorators);
+ }
+ parseAccessModifier() {
+ return this.tsParseModifier(["public", "protected", "private"]);
+ }
+ tsHasSomeModifiers(member, modifiers) {
+ return modifiers.some(modifier => {
+ if (tsIsAccessModifier(modifier)) {
+ return member.accessibility === modifier;
+ }
+ return !!member[modifier];
+ });
+ }
+ tsIsStartOfStaticBlocks() {
+ return this.isContextual(106) && this.lookaheadCharCode() === 123;
+ }
+ parseClassMember(classBody, member, state) {
+ const modifiers = ["declare", "private", "public", "protected", "override", "abstract", "readonly", "static"];
+ this.tsParseModifiers({
+ allowedModifiers: modifiers,
+ disallowedModifiers: ["in", "out"],
+ stopOnStartOfClassStaticBlock: true,
+ errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions
+ }, member);
+ const callParseClassMemberWithIsStatic = () => {
+ if (this.tsIsStartOfStaticBlocks()) {
+ this.next();
+ this.next();
+ if (this.tsHasSomeModifiers(member, modifiers)) {
+ this.raise(TSErrors.StaticBlockCannotHaveModifier, this.state.curPosition());
+ }
+ super.parseClassStaticBlock(classBody, member);
+ } else {
+ this.parseClassMemberWithIsStatic(classBody, member, state, !!member.static);
+ }
+ };
+ if (member.declare) {
+ this.tsInAmbientContext(callParseClassMemberWithIsStatic);
+ } else {
+ callParseClassMemberWithIsStatic();
+ }
+ }
+ parseClassMemberWithIsStatic(classBody, member, state, isStatic) {
+ const idx = this.tsTryParseIndexSignature(member);
+ if (idx) {
+ classBody.body.push(idx);
+ if (member.abstract) {
+ this.raise(TSErrors.IndexSignatureHasAbstract, member);
+ }
+ if (member.accessibility) {
+ this.raise(TSErrors.IndexSignatureHasAccessibility, member, {
+ modifier: member.accessibility
+ });
+ }
+ if (member.declare) {
+ this.raise(TSErrors.IndexSignatureHasDeclare, member);
+ }
+ if (member.override) {
+ this.raise(TSErrors.IndexSignatureHasOverride, member);
+ }
+ return;
+ }
+ if (!this.state.inAbstractClass && member.abstract) {
+ this.raise(TSErrors.NonAbstractClassHasAbstractMethod, member);
+ }
+ if (member.override) {
+ if (!state.hadSuperClass) {
+ this.raise(TSErrors.OverrideNotInSubClass, member);
+ }
+ }
+ super.parseClassMemberWithIsStatic(classBody, member, state, isStatic);
+ }
+ parsePostMemberNameModifiers(methodOrProp) {
+ const optional = this.eat(17);
+ if (optional) methodOrProp.optional = true;
+ if (methodOrProp.readonly && this.match(10)) {
+ this.raise(TSErrors.ClassMethodHasReadonly, methodOrProp);
+ }
+ if (methodOrProp.declare && this.match(10)) {
+ this.raise(TSErrors.ClassMethodHasDeclare, methodOrProp);
+ }
+ }
+ parseExpressionStatement(node, expr, decorators) {
+ const decl = expr.type === "Identifier" ? this.tsParseExpressionStatement(node, expr, decorators) : undefined;
+ return decl || super.parseExpressionStatement(node, expr, decorators);
+ }
+ shouldParseExportDeclaration() {
+ if (this.tsIsDeclarationStart()) return true;
+ return super.shouldParseExportDeclaration();
+ }
+ parseConditional(expr, startLoc, refExpressionErrors) {
+ if (!this.state.maybeInArrowParameters || !this.match(17)) {
+ return super.parseConditional(expr, startLoc, refExpressionErrors);
+ }
+ const result = this.tryParse(() => super.parseConditional(expr, startLoc));
+ if (!result.node) {
+ if (result.error) {
+ super.setOptionalParametersError(refExpressionErrors, result.error);
+ }
+ return expr;
+ }
+ if (result.error) this.state = result.failState;
+ return result.node;
+ }
+ parseParenItem(node, startLoc) {
+ const newNode = super.parseParenItem(node, startLoc);
+ if (this.eat(17)) {
+ newNode.optional = true;
+ this.resetEndLocation(node);
+ }
+ if (this.match(14)) {
+ const typeCastNode = this.startNodeAt(startLoc);
+ typeCastNode.expression = node;
+ typeCastNode.typeAnnotation = this.tsParseTypeAnnotation();
+ return this.finishNode(typeCastNode, "TSTypeCastExpression");
+ }
+ return node;
+ }
+ parseExportDeclaration(node) {
+ if (!this.state.isAmbientContext && this.isContextual(125)) {
+ return this.tsInAmbientContext(() => this.parseExportDeclaration(node));
+ }
+ const startLoc = this.state.startLoc;
+ const isDeclare = this.eatContextual(125);
+ if (isDeclare && (this.isContextual(125) || !this.shouldParseExportDeclaration())) {
+ throw this.raise(TSErrors.ExpectedAmbientAfterExportDeclare, this.state.startLoc);
+ }
+ const isIdentifier = tokenIsIdentifier(this.state.type);
+ const declaration = isIdentifier && this.tsTryParseExportDeclaration() || super.parseExportDeclaration(node);
+ if (!declaration) return null;
+ if (declaration.type === "TSInterfaceDeclaration" || declaration.type === "TSTypeAliasDeclaration" || isDeclare) {
+ node.exportKind = "type";
+ }
+ if (isDeclare) {
+ this.resetStartLocation(declaration, startLoc);
+ declaration.declare = true;
+ }
+ return declaration;
+ }
+ parseClassId(node, isStatement, optionalId, bindingType) {
+ if ((!isStatement || optionalId) && this.isContextual(113)) {
+ return;
+ }
+ super.parseClassId(node, isStatement, optionalId, node.declare ? 1024 : 8331);
+ const typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);
+ if (typeParameters) node.typeParameters = typeParameters;
+ }
+ parseClassPropertyAnnotation(node) {
+ if (!node.optional) {
+ if (this.eat(35)) {
+ node.definite = true;
+ } else if (this.eat(17)) {
+ node.optional = true;
+ }
+ }
+ const type = this.tsTryParseTypeAnnotation();
+ if (type) node.typeAnnotation = type;
+ }
+ parseClassProperty(node) {
+ this.parseClassPropertyAnnotation(node);
+ if (this.state.isAmbientContext && !(node.readonly && !node.typeAnnotation) && this.match(29)) {
+ this.raise(TSErrors.DeclareClassFieldHasInitializer, this.state.startLoc);
+ }
+ if (node.abstract && this.match(29)) {
+ const {
+ key
+ } = node;
+ this.raise(TSErrors.AbstractPropertyHasInitializer, this.state.startLoc, {
+ propertyName: key.type === "Identifier" && !node.computed ? key.name : `[${this.input.slice(key.start, key.end)}]`
+ });
+ }
+ return super.parseClassProperty(node);
+ }
+ parseClassPrivateProperty(node) {
+ if (node.abstract) {
+ this.raise(TSErrors.PrivateElementHasAbstract, node);
+ }
+ if (node.accessibility) {
+ this.raise(TSErrors.PrivateElementHasAccessibility, node, {
+ modifier: node.accessibility
+ });
+ }
+ this.parseClassPropertyAnnotation(node);
+ return super.parseClassPrivateProperty(node);
+ }
+ parseClassAccessorProperty(node) {
+ this.parseClassPropertyAnnotation(node);
+ if (node.optional) {
+ this.raise(TSErrors.AccessorCannotBeOptional, node);
+ }
+ return super.parseClassAccessorProperty(node);
+ }
+ pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
+ const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier);
+ if (typeParameters && isConstructor) {
+ this.raise(TSErrors.ConstructorHasTypeParameters, typeParameters);
+ }
+ const {
+ declare = false,
+ kind
+ } = method;
+ if (declare && (kind === "get" || kind === "set")) {
+ this.raise(TSErrors.DeclareAccessor, method, {
+ kind
+ });
+ }
+ if (typeParameters) method.typeParameters = typeParameters;
+ super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper);
+ }
+ pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {
+ const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier);
+ if (typeParameters) method.typeParameters = typeParameters;
+ super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);
+ }
+ declareClassPrivateMethodInScope(node, kind) {
+ if (node.type === "TSDeclareMethod") return;
+ if (node.type === "MethodDefinition" && !hasOwnProperty.call(node.value, "body")) {
+ return;
+ }
+ super.declareClassPrivateMethodInScope(node, kind);
+ }
+ parseClassSuper(node) {
+ super.parseClassSuper(node);
+ if (node.superClass && (this.match(47) || this.match(51))) {
+ node.superTypeParameters = this.tsParseTypeArgumentsInExpression();
+ }
+ if (this.eatContextual(113)) {
+ node.implements = this.tsParseHeritageClause("implements");
+ }
+ }
+ parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) {
+ const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier);
+ if (typeParameters) prop.typeParameters = typeParameters;
+ return super.parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors);
+ }
+ parseFunctionParams(node, isConstructor) {
+ const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier);
+ if (typeParameters) node.typeParameters = typeParameters;
+ super.parseFunctionParams(node, isConstructor);
+ }
+ parseVarId(decl, kind) {
+ super.parseVarId(decl, kind);
+ if (decl.id.type === "Identifier" && !this.hasPrecedingLineBreak() && this.eat(35)) {
+ decl.definite = true;
+ }
+ const type = this.tsTryParseTypeAnnotation();
+ if (type) {
+ decl.id.typeAnnotation = type;
+ this.resetEndLocation(decl.id);
+ }
+ }
+ parseAsyncArrowFromCallExpression(node, call) {
+ if (this.match(14)) {
+ node.returnType = this.tsParseTypeAnnotation();
+ }
+ return super.parseAsyncArrowFromCallExpression(node, call);
+ }
+ parseMaybeAssign(refExpressionErrors, afterLeftParse) {
+ var _jsx, _jsx2, _typeCast, _jsx3, _typeCast2;
+ let state;
+ let jsx;
+ let typeCast;
+ if (this.hasPlugin("jsx") && (this.match(142) || this.match(47))) {
+ state = this.state.clone();
+ jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state);
+ if (!jsx.error) return jsx.node;
+ const {
+ context
+ } = this.state;
+ const currentContext = context[context.length - 1];
+ if (currentContext === types.j_oTag || currentContext === types.j_expr) {
+ context.pop();
+ }
+ }
+ if (!((_jsx = jsx) != null && _jsx.error) && !this.match(47)) {
+ return super.parseMaybeAssign(refExpressionErrors, afterLeftParse);
+ }
+ if (!state || state === this.state) state = this.state.clone();
+ let typeParameters;
+ const arrow = this.tryParse(abort => {
+ var _expr$extra, _typeParameters;
+ typeParameters = this.tsParseTypeParameters(this.tsParseConstModifier);
+ const expr = super.parseMaybeAssign(refExpressionErrors, afterLeftParse);
+ if (expr.type !== "ArrowFunctionExpression" || (_expr$extra = expr.extra) != null && _expr$extra.parenthesized) {
+ abort();
+ }
+ if (((_typeParameters = typeParameters) == null ? void 0 : _typeParameters.params.length) !== 0) {
+ this.resetStartLocationFromNode(expr, typeParameters);
+ }
+ expr.typeParameters = typeParameters;
+ return expr;
+ }, state);
+ if (!arrow.error && !arrow.aborted) {
+ if (typeParameters) this.reportReservedArrowTypeParam(typeParameters);
+ return arrow.node;
+ }
+ if (!jsx) {
+ assert(!this.hasPlugin("jsx"));
+ typeCast = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state);
+ if (!typeCast.error) return typeCast.node;
+ }
+ if ((_jsx2 = jsx) != null && _jsx2.node) {
+ this.state = jsx.failState;
+ return jsx.node;
+ }
+ if (arrow.node) {
+ this.state = arrow.failState;
+ if (typeParameters) this.reportReservedArrowTypeParam(typeParameters);
+ return arrow.node;
+ }
+ if ((_typeCast = typeCast) != null && _typeCast.node) {
+ this.state = typeCast.failState;
+ return typeCast.node;
+ }
+ throw ((_jsx3 = jsx) == null ? void 0 : _jsx3.error) || arrow.error || ((_typeCast2 = typeCast) == null ? void 0 : _typeCast2.error);
+ }
+ reportReservedArrowTypeParam(node) {
+ var _node$extra;
+ if (node.params.length === 1 && !node.params[0].constraint && !((_node$extra = node.extra) != null && _node$extra.trailingComma) && this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) {
+ this.raise(TSErrors.ReservedArrowTypeParam, node);
+ }
+ }
+ parseMaybeUnary(refExpressionErrors, sawUnary) {
+ if (!this.hasPlugin("jsx") && this.match(47)) {
+ return this.tsParseTypeAssertion();
+ }
+ return super.parseMaybeUnary(refExpressionErrors, sawUnary);
+ }
+ parseArrow(node) {
+ if (this.match(14)) {
+ const result = this.tryParse(abort => {
+ const returnType = this.tsParseTypeOrTypePredicateAnnotation(14);
+ if (this.canInsertSemicolon() || !this.match(19)) abort();
+ return returnType;
+ });
+ if (result.aborted) return;
+ if (!result.thrown) {
+ if (result.error) this.state = result.failState;
+ node.returnType = result.node;
+ }
+ }
+ return super.parseArrow(node);
+ }
+ parseAssignableListItemTypes(param, flags) {
+ if (!(flags & 2)) return param;
+ if (this.eat(17)) {
+ param.optional = true;
+ }
+ const type = this.tsTryParseTypeAnnotation();
+ if (type) param.typeAnnotation = type;
+ this.resetEndLocation(param);
+ return param;
+ }
+ isAssignable(node, isBinding) {
+ switch (node.type) {
+ case "TSTypeCastExpression":
+ return this.isAssignable(node.expression, isBinding);
+ case "TSParameterProperty":
+ return true;
+ default:
+ return super.isAssignable(node, isBinding);
+ }
+ }
+ toAssignable(node, isLHS = false) {
+ switch (node.type) {
+ case "ParenthesizedExpression":
+ this.toAssignableParenthesizedExpression(node, isLHS);
+ break;
+ case "TSAsExpression":
+ case "TSSatisfiesExpression":
+ case "TSNonNullExpression":
+ case "TSTypeAssertion":
+ if (isLHS) {
+ this.expressionScope.recordArrowParameterBindingError(TSErrors.UnexpectedTypeCastInParameter, node);
+ } else {
+ this.raise(TSErrors.UnexpectedTypeCastInParameter, node);
+ }
+ this.toAssignable(node.expression, isLHS);
+ break;
+ case "AssignmentExpression":
+ if (!isLHS && node.left.type === "TSTypeCastExpression") {
+ node.left = this.typeCastToParameter(node.left);
+ }
+ default:
+ super.toAssignable(node, isLHS);
+ }
+ }
+ toAssignableParenthesizedExpression(node, isLHS) {
+ switch (node.expression.type) {
+ case "TSAsExpression":
+ case "TSSatisfiesExpression":
+ case "TSNonNullExpression":
+ case "TSTypeAssertion":
+ case "ParenthesizedExpression":
+ this.toAssignable(node.expression, isLHS);
+ break;
+ default:
+ super.toAssignable(node, isLHS);
+ }
+ }
+ checkToRestConversion(node, allowPattern) {
+ switch (node.type) {
+ case "TSAsExpression":
+ case "TSSatisfiesExpression":
+ case "TSTypeAssertion":
+ case "TSNonNullExpression":
+ this.checkToRestConversion(node.expression, false);
+ break;
+ default:
+ super.checkToRestConversion(node, allowPattern);
+ }
+ }
+ isValidLVal(type, isUnparenthesizedInAssign, binding) {
+ switch (type) {
+ case "TSTypeCastExpression":
+ return true;
+ case "TSParameterProperty":
+ return "parameter";
+ case "TSNonNullExpression":
+ case "TSInstantiationExpression":
+ return "expression";
+ case "TSAsExpression":
+ case "TSSatisfiesExpression":
+ case "TSTypeAssertion":
+ return (binding !== 64 || !isUnparenthesizedInAssign) && ["expression", true];
+ default:
+ return super.isValidLVal(type, isUnparenthesizedInAssign, binding);
+ }
+ }
+ parseBindingAtom() {
+ if (this.state.type === 78) {
+ return this.parseIdentifier(true);
+ }
+ return super.parseBindingAtom();
+ }
+ parseMaybeDecoratorArguments(expr) {
+ if (this.match(47) || this.match(51)) {
+ const typeArguments = this.tsParseTypeArgumentsInExpression();
+ if (this.match(10)) {
+ const call = super.parseMaybeDecoratorArguments(expr);
+ call.typeParameters = typeArguments;
+ return call;
+ }
+ this.unexpected(null, 10);
+ }
+ return super.parseMaybeDecoratorArguments(expr);
+ }
+ checkCommaAfterRest(close) {
+ if (this.state.isAmbientContext && this.match(12) && this.lookaheadCharCode() === close) {
+ this.next();
+ return false;
+ }
+ return super.checkCommaAfterRest(close);
+ }
+ isClassMethod() {
+ return this.match(47) || super.isClassMethod();
+ }
+ isClassProperty() {
+ return this.match(35) || this.match(14) || super.isClassProperty();
+ }
+ parseMaybeDefault(startLoc, left) {
+ const node = super.parseMaybeDefault(startLoc, left);
+ if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) {
+ this.raise(TSErrors.TypeAnnotationAfterAssign, node.typeAnnotation);
+ }
+ return node;
+ }
+ getTokenFromCode(code) {
+ if (this.state.inType) {
+ if (code === 62) {
+ this.finishOp(48, 1);
+ return;
+ }
+ if (code === 60) {
+ this.finishOp(47, 1);
+ return;
+ }
+ }
+ super.getTokenFromCode(code);
+ }
+ reScan_lt_gt() {
+ const {
+ type
+ } = this.state;
+ if (type === 47) {
+ this.state.pos -= 1;
+ this.readToken_lt();
+ } else if (type === 48) {
+ this.state.pos -= 1;
+ this.readToken_gt();
+ }
+ }
+ reScan_lt() {
+ const {
+ type
+ } = this.state;
+ if (type === 51) {
+ this.state.pos -= 2;
+ this.finishOp(47, 1);
+ return 47;
+ }
+ return type;
+ }
+ toAssignableList(exprList, trailingCommaLoc, isLHS) {
+ for (let i = 0; i < exprList.length; i++) {
+ const expr = exprList[i];
+ if ((expr == null ? void 0 : expr.type) === "TSTypeCastExpression") {
+ exprList[i] = this.typeCastToParameter(expr);
+ }
+ }
+ super.toAssignableList(exprList, trailingCommaLoc, isLHS);
+ }
+ typeCastToParameter(node) {
+ node.expression.typeAnnotation = node.typeAnnotation;
+ this.resetEndLocation(node.expression, node.typeAnnotation.loc.end);
+ return node.expression;
+ }
+ shouldParseArrow(params) {
+ if (this.match(14)) {
+ return params.every(expr => this.isAssignable(expr, true));
+ }
+ return super.shouldParseArrow(params);
+ }
+ shouldParseAsyncArrow() {
+ return this.match(14) || super.shouldParseAsyncArrow();
+ }
+ canHaveLeadingDecorator() {
+ return super.canHaveLeadingDecorator() || this.isAbstractClass();
+ }
+ jsxParseOpeningElementAfterName(node) {
+ if (this.match(47) || this.match(51)) {
+ const typeArguments = this.tsTryParseAndCatch(() => this.tsParseTypeArgumentsInExpression());
+ if (typeArguments) node.typeParameters = typeArguments;
+ }
+ return super.jsxParseOpeningElementAfterName(node);
+ }
+ getGetterSetterExpectedParamCount(method) {
+ const baseCount = super.getGetterSetterExpectedParamCount(method);
+ const params = this.getObjectOrClassMethodParams(method);
+ const firstParam = params[0];
+ const hasContextParam = firstParam && this.isThisParam(firstParam);
+ return hasContextParam ? baseCount + 1 : baseCount;
+ }
+ parseCatchClauseParam() {
+ const param = super.parseCatchClauseParam();
+ const type = this.tsTryParseTypeAnnotation();
+ if (type) {
+ param.typeAnnotation = type;
+ this.resetEndLocation(param);
+ }
+ return param;
+ }
+ tsInAmbientContext(cb) {
+ const {
+ isAmbientContext: oldIsAmbientContext,
+ strict: oldStrict
+ } = this.state;
+ this.state.isAmbientContext = true;
+ this.state.strict = false;
+ try {
+ return cb();
+ } finally {
+ this.state.isAmbientContext = oldIsAmbientContext;
+ this.state.strict = oldStrict;
+ }
+ }
+ parseClass(node, isStatement, optionalId) {
+ const oldInAbstractClass = this.state.inAbstractClass;
+ this.state.inAbstractClass = !!node.abstract;
+ try {
+ return super.parseClass(node, isStatement, optionalId);
+ } finally {
+ this.state.inAbstractClass = oldInAbstractClass;
+ }
+ }
+ tsParseAbstractDeclaration(node, decorators) {
+ if (this.match(80)) {
+ node.abstract = true;
+ return this.maybeTakeDecorators(decorators, this.parseClass(node, true, false));
+ } else if (this.isContextual(129)) {
+ if (!this.hasFollowingLineBreak()) {
+ node.abstract = true;
+ this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifer, node);
+ return this.tsParseInterfaceDeclaration(node);
+ }
+ } else {
+ this.unexpected(null, 80);
+ }
+ }
+ parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope) {
+ const method = super.parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope);
+ if (method.abstract) {
+ const hasBody = this.hasPlugin("estree") ? !!method.value.body : !!method.body;
+ if (hasBody) {
+ const {
+ key
+ } = method;
+ this.raise(TSErrors.AbstractMethodHasImplementation, method, {
+ methodName: key.type === "Identifier" && !method.computed ? key.name : `[${this.input.slice(key.start, key.end)}]`
+ });
+ }
+ }
+ return method;
+ }
+ tsParseTypeParameterName() {
+ const typeName = this.parseIdentifier();
+ return typeName.name;
+ }
+ shouldParseAsAmbientContext() {
+ return !!this.getPluginOption("typescript", "dts");
+ }
+ parse() {
+ if (this.shouldParseAsAmbientContext()) {
+ this.state.isAmbientContext = true;
+ }
+ return super.parse();
+ }
+ getExpression() {
+ if (this.shouldParseAsAmbientContext()) {
+ this.state.isAmbientContext = true;
+ }
+ return super.getExpression();
+ }
+ parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly) {
+ if (!isString && isMaybeTypeOnly) {
+ this.parseTypeOnlyImportExportSpecifier(node, false, isInTypeExport);
+ return this.finishNode(node, "ExportSpecifier");
+ }
+ node.exportKind = "value";
+ return super.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly);
+ }
+ parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) {
+ if (!importedIsString && isMaybeTypeOnly) {
+ this.parseTypeOnlyImportExportSpecifier(specifier, true, isInTypeOnlyImport);
+ return this.finishNode(specifier, "ImportSpecifier");
+ }
+ specifier.importKind = "value";
+ return super.parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, isInTypeOnlyImport ? 4098 : 4096);
+ }
+ parseTypeOnlyImportExportSpecifier(node, isImport, isInTypeOnlyImportExport) {
+ const leftOfAsKey = isImport ? "imported" : "local";
+ const rightOfAsKey = isImport ? "local" : "exported";
+ let leftOfAs = node[leftOfAsKey];
+ let rightOfAs;
+ let hasTypeSpecifier = false;
+ let canParseAsKeyword = true;
+ const loc = leftOfAs.loc.start;
+ if (this.isContextual(93)) {
+ const firstAs = this.parseIdentifier();
+ if (this.isContextual(93)) {
+ const secondAs = this.parseIdentifier();
+ if (tokenIsKeywordOrIdentifier(this.state.type)) {
+ hasTypeSpecifier = true;
+ leftOfAs = firstAs;
+ rightOfAs = isImport ? this.parseIdentifier() : this.parseModuleExportName();
+ canParseAsKeyword = false;
+ } else {
+ rightOfAs = secondAs;
+ canParseAsKeyword = false;
+ }
+ } else if (tokenIsKeywordOrIdentifier(this.state.type)) {
+ canParseAsKeyword = false;
+ rightOfAs = isImport ? this.parseIdentifier() : this.parseModuleExportName();
+ } else {
+ hasTypeSpecifier = true;
+ leftOfAs = firstAs;
+ }
+ } else if (tokenIsKeywordOrIdentifier(this.state.type)) {
+ hasTypeSpecifier = true;
+ if (isImport) {
+ leftOfAs = this.parseIdentifier(true);
+ if (!this.isContextual(93)) {
+ this.checkReservedWord(leftOfAs.name, leftOfAs.loc.start, true, true);
+ }
+ } else {
+ leftOfAs = this.parseModuleExportName();
+ }
+ }
+ if (hasTypeSpecifier && isInTypeOnlyImportExport) {
+ this.raise(isImport ? TSErrors.TypeModifierIsUsedInTypeImports : TSErrors.TypeModifierIsUsedInTypeExports, loc);
+ }
+ node[leftOfAsKey] = leftOfAs;
+ node[rightOfAsKey] = rightOfAs;
+ const kindKey = isImport ? "importKind" : "exportKind";
+ node[kindKey] = hasTypeSpecifier ? "type" : "value";
+ if (canParseAsKeyword && this.eatContextual(93)) {
+ node[rightOfAsKey] = isImport ? this.parseIdentifier() : this.parseModuleExportName();
+ }
+ if (!node[rightOfAsKey]) {
+ node[rightOfAsKey] = cloneIdentifier(node[leftOfAsKey]);
+ }
+ if (isImport) {
+ this.checkIdentifier(node[rightOfAsKey], hasTypeSpecifier ? 4098 : 4096);
+ }
+ }
+};
+function isPossiblyLiteralEnum(expression) {
+ if (expression.type !== "MemberExpression") return false;
+ const {
+ computed,
+ property
+ } = expression;
+ if (computed && property.type !== "StringLiteral" && (property.type !== "TemplateLiteral" || property.expressions.length > 0)) {
+ return false;
+ }
+ return isUncomputedMemberExpressionChain(expression.object);
+}
+function isValidAmbientConstInitializer(expression, estree) {
+ var _expression$extra;
+ const {
+ type
+ } = expression;
+ if ((_expression$extra = expression.extra) != null && _expression$extra.parenthesized) {
+ return false;
+ }
+ if (estree) {
+ if (type === "Literal") {
+ const {
+ value
+ } = expression;
+ if (typeof value === "string" || typeof value === "boolean") {
+ return true;
+ }
+ }
+ } else {
+ if (type === "StringLiteral" || type === "BooleanLiteral") {
+ return true;
+ }
+ }
+ if (isNumber(expression, estree) || isNegativeNumber(expression, estree)) {
+ return true;
+ }
+ if (type === "TemplateLiteral" && expression.expressions.length === 0) {
+ return true;
+ }
+ if (isPossiblyLiteralEnum(expression)) {
+ return true;
+ }
+ return false;
+}
+function isNumber(expression, estree) {
+ if (estree) {
+ return expression.type === "Literal" && (typeof expression.value === "number" || "bigint" in expression);
+ }
+ return expression.type === "NumericLiteral" || expression.type === "BigIntLiteral";
+}
+function isNegativeNumber(expression, estree) {
+ if (expression.type === "UnaryExpression") {
+ const {
+ operator,
+ argument
+ } = expression;
+ if (operator === "-" && isNumber(argument, estree)) {
+ return true;
+ }
+ }
+ return false;
+}
+function isUncomputedMemberExpressionChain(expression) {
+ if (expression.type === "Identifier") return true;
+ if (expression.type !== "MemberExpression" || expression.computed) {
+ return false;
+ }
+ return isUncomputedMemberExpressionChain(expression.object);
+}
+const PlaceholderErrors = ParseErrorEnum`placeholders`({
+ ClassNameIsRequired: "A class name is required.",
+ UnexpectedSpace: "Unexpected space in placeholder."
+});
+var placeholders = superClass => class PlaceholdersParserMixin extends superClass {
+ parsePlaceholder(expectedNode) {
+ if (this.match(144)) {
+ const node = this.startNode();
+ this.next();
+ this.assertNoSpace();
+ node.name = super.parseIdentifier(true);
+ this.assertNoSpace();
+ this.expect(144);
+ return this.finishPlaceholder(node, expectedNode);
+ }
+ }
+ finishPlaceholder(node, expectedNode) {
+ let placeholder = node;
+ if (!placeholder.expectedNode || !placeholder.type) {
+ placeholder = this.finishNode(placeholder, "Placeholder");
+ }
+ placeholder.expectedNode = expectedNode;
+ return placeholder;
+ }
+ getTokenFromCode(code) {
+ if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) {
+ this.finishOp(144, 2);
+ } else {
+ super.getTokenFromCode(code);
+ }
+ }
+ parseExprAtom(refExpressionErrors) {
+ return this.parsePlaceholder("Expression") || super.parseExprAtom(refExpressionErrors);
+ }
+ parseIdentifier(liberal) {
+ return this.parsePlaceholder("Identifier") || super.parseIdentifier(liberal);
+ }
+ checkReservedWord(word, startLoc, checkKeywords, isBinding) {
+ if (word !== undefined) {
+ super.checkReservedWord(word, startLoc, checkKeywords, isBinding);
+ }
+ }
+ parseBindingAtom() {
+ return this.parsePlaceholder("Pattern") || super.parseBindingAtom();
+ }
+ isValidLVal(type, isParenthesized, binding) {
+ return type === "Placeholder" || super.isValidLVal(type, isParenthesized, binding);
+ }
+ toAssignable(node, isLHS) {
+ if (node && node.type === "Placeholder" && node.expectedNode === "Expression") {
+ node.expectedNode = "Pattern";
+ } else {
+ super.toAssignable(node, isLHS);
+ }
+ }
+ chStartsBindingIdentifier(ch, pos) {
+ if (super.chStartsBindingIdentifier(ch, pos)) {
+ return true;
+ }
+ const nextToken = this.lookahead();
+ if (nextToken.type === 144) {
+ return true;
+ }
+ return false;
+ }
+ verifyBreakContinue(node, isBreak) {
+ if (node.label && node.label.type === "Placeholder") return;
+ super.verifyBreakContinue(node, isBreak);
+ }
+ parseExpressionStatement(node, expr) {
+ var _expr$extra;
+ if (expr.type !== "Placeholder" || (_expr$extra = expr.extra) != null && _expr$extra.parenthesized) {
+ return super.parseExpressionStatement(node, expr);
+ }
+ if (this.match(14)) {
+ const stmt = node;
+ stmt.label = this.finishPlaceholder(expr, "Identifier");
+ this.next();
+ stmt.body = super.parseStatementOrSloppyAnnexBFunctionDeclaration();
+ return this.finishNode(stmt, "LabeledStatement");
+ }
+ this.semicolon();
+ const stmtPlaceholder = node;
+ stmtPlaceholder.name = expr.name;
+ return this.finishPlaceholder(stmtPlaceholder, "Statement");
+ }
+ parseBlock(allowDirectives, createNewLexicalScope, afterBlockParse) {
+ return this.parsePlaceholder("BlockStatement") || super.parseBlock(allowDirectives, createNewLexicalScope, afterBlockParse);
+ }
+ parseFunctionId(requireId) {
+ return this.parsePlaceholder("Identifier") || super.parseFunctionId(requireId);
+ }
+ parseClass(node, isStatement, optionalId) {
+ const type = isStatement ? "ClassDeclaration" : "ClassExpression";
+ this.next();
+ const oldStrict = this.state.strict;
+ const placeholder = this.parsePlaceholder("Identifier");
+ if (placeholder) {
+ if (this.match(81) || this.match(144) || this.match(5)) {
+ node.id = placeholder;
+ } else if (optionalId || !isStatement) {
+ node.id = null;
+ node.body = this.finishPlaceholder(placeholder, "ClassBody");
+ return this.finishNode(node, type);
+ } else {
+ throw this.raise(PlaceholderErrors.ClassNameIsRequired, this.state.startLoc);
+ }
+ } else {
+ this.parseClassId(node, isStatement, optionalId);
+ }
+ super.parseClassSuper(node);
+ node.body = this.parsePlaceholder("ClassBody") || super.parseClassBody(!!node.superClass, oldStrict);
+ return this.finishNode(node, type);
+ }
+ parseExport(node, decorators) {
+ const placeholder = this.parsePlaceholder("Identifier");
+ if (!placeholder) return super.parseExport(node, decorators);
+ const node2 = node;
+ if (!this.isContextual(98) && !this.match(12)) {
+ node2.specifiers = [];
+ node2.source = null;
+ node2.declaration = this.finishPlaceholder(placeholder, "Declaration");
+ return this.finishNode(node2, "ExportNamedDeclaration");
+ }
+ this.expectPlugin("exportDefaultFrom");
+ const specifier = this.startNode();
+ specifier.exported = placeholder;
+ node2.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")];
+ return super.parseExport(node2, decorators);
+ }
+ isExportDefaultSpecifier() {
+ if (this.match(65)) {
+ const next = this.nextTokenStart();
+ if (this.isUnparsedContextual(next, "from")) {
+ if (this.input.startsWith(tokenLabelName(144), this.nextTokenStartSince(next + 4))) {
+ return true;
+ }
+ }
+ }
+ return super.isExportDefaultSpecifier();
+ }
+ maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier) {
+ var _specifiers;
+ if ((_specifiers = node.specifiers) != null && _specifiers.length) {
+ return true;
+ }
+ return super.maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier);
+ }
+ checkExport(node) {
+ const {
+ specifiers
+ } = node;
+ if (specifiers != null && specifiers.length) {
+ node.specifiers = specifiers.filter(node => node.exported.type === "Placeholder");
+ }
+ super.checkExport(node);
+ node.specifiers = specifiers;
+ }
+ parseImport(node) {
+ const placeholder = this.parsePlaceholder("Identifier");
+ if (!placeholder) return super.parseImport(node);
+ node.specifiers = [];
+ if (!this.isContextual(98) && !this.match(12)) {
+ node.source = this.finishPlaceholder(placeholder, "StringLiteral");
+ this.semicolon();
+ return this.finishNode(node, "ImportDeclaration");
+ }
+ const specifier = this.startNodeAtNode(placeholder);
+ specifier.local = placeholder;
+ node.specifiers.push(this.finishNode(specifier, "ImportDefaultSpecifier"));
+ if (this.eat(12)) {
+ const hasStarImport = this.maybeParseStarImportSpecifier(node);
+ if (!hasStarImport) this.parseNamedImportSpecifiers(node);
+ }
+ this.expectContextual(98);
+ node.source = this.parseImportSource();
+ this.semicolon();
+ return this.finishNode(node, "ImportDeclaration");
+ }
+ parseImportSource() {
+ return this.parsePlaceholder("StringLiteral") || super.parseImportSource();
+ }
+ assertNoSpace() {
+ if (this.state.start > this.state.lastTokEndLoc.index) {
+ this.raise(PlaceholderErrors.UnexpectedSpace, this.state.lastTokEndLoc);
+ }
+ }
+};
+var v8intrinsic = superClass => class V8IntrinsicMixin extends superClass {
+ parseV8Intrinsic() {
+ if (this.match(54)) {
+ const v8IntrinsicStartLoc = this.state.startLoc;
+ const node = this.startNode();
+ this.next();
+ if (tokenIsIdentifier(this.state.type)) {
+ const name = this.parseIdentifierName();
+ const identifier = this.createIdentifier(node, name);
+ identifier.type = "V8IntrinsicIdentifier";
+ if (this.match(10)) {
+ return identifier;
+ }
+ }
+ this.unexpected(v8IntrinsicStartLoc);
+ }
+ }
+ parseExprAtom(refExpressionErrors) {
+ return this.parseV8Intrinsic() || super.parseExprAtom(refExpressionErrors);
+ }
+};
+const PIPELINE_PROPOSALS = ["minimal", "fsharp", "hack", "smart"];
+const TOPIC_TOKENS = ["^^", "@@", "^", "%", "#"];
+function validatePlugins(pluginsMap) {
+ if (pluginsMap.has("decorators")) {
+ if (pluginsMap.has("decorators-legacy")) {
+ throw new Error("Cannot use the decorators and decorators-legacy plugin together");
+ }
+ const decoratorsBeforeExport = pluginsMap.get("decorators").decoratorsBeforeExport;
+ if (decoratorsBeforeExport != null && typeof decoratorsBeforeExport !== "boolean") {
+ throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");
+ }
+ const allowCallParenthesized = pluginsMap.get("decorators").allowCallParenthesized;
+ if (allowCallParenthesized != null && typeof allowCallParenthesized !== "boolean") {
+ throw new Error("'allowCallParenthesized' must be a boolean.");
+ }
+ }
+ if (pluginsMap.has("flow") && pluginsMap.has("typescript")) {
+ throw new Error("Cannot combine flow and typescript plugins.");
+ }
+ if (pluginsMap.has("placeholders") && pluginsMap.has("v8intrinsic")) {
+ throw new Error("Cannot combine placeholders and v8intrinsic plugins.");
+ }
+ if (pluginsMap.has("pipelineOperator")) {
+ var _pluginsMap$get;
+ const proposal = pluginsMap.get("pipelineOperator").proposal;
+ if (!PIPELINE_PROPOSALS.includes(proposal)) {
+ const proposalList = PIPELINE_PROPOSALS.map(p => `"${p}"`).join(", ");
+ throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${proposalList}.`);
+ }
+ const tupleSyntaxIsHash = ((_pluginsMap$get = pluginsMap.get("recordAndTuple")) == null ? void 0 : _pluginsMap$get.syntaxType) === "hash";
+ if (proposal === "hack") {
+ if (pluginsMap.has("placeholders")) {
+ throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");
+ }
+ if (pluginsMap.has("v8intrinsic")) {
+ throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");
+ }
+ const topicToken = pluginsMap.get("pipelineOperator").topicToken;
+ if (!TOPIC_TOKENS.includes(topicToken)) {
+ const tokenList = TOPIC_TOKENS.map(t => `"${t}"`).join(", ");
+ throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${tokenList}.`);
+ }
+ if (topicToken === "#" && tupleSyntaxIsHash) {
+ throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple", pluginsMap.get("recordAndTuple")])}\`.`);
+ }
+ } else if (proposal === "smart" && tupleSyntaxIsHash) {
+ throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple", pluginsMap.get("recordAndTuple")])}\`.`);
+ }
+ }
+ if (pluginsMap.has("moduleAttributes")) {
+ {
+ if (pluginsMap.has("importAttributes") || pluginsMap.has("importAssertions")) {
+ throw new Error("Cannot combine importAssertions, importAttributes and moduleAttributes plugins.");
+ }
+ const moduleAttributesVersionPluginOption = pluginsMap.get("moduleAttributes").version;
+ if (moduleAttributesVersionPluginOption !== "may-2020") {
+ throw new Error("The 'moduleAttributes' plugin requires a 'version' option," + " representing the last proposal update. Currently, the" + " only supported value is 'may-2020'.");
+ }
+ }
+ }
+ if (pluginsMap.has("importAttributes") && pluginsMap.has("importAssertions")) {
+ throw new Error("Cannot combine importAssertions and importAttributes plugins.");
+ }
+ if (pluginsMap.has("recordAndTuple")) {
+ const syntaxType = pluginsMap.get("recordAndTuple").syntaxType;
+ if (syntaxType != null) {
+ {
+ const RECORD_AND_TUPLE_SYNTAX_TYPES = ["hash", "bar"];
+ if (!RECORD_AND_TUPLE_SYNTAX_TYPES.includes(syntaxType)) {
+ throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: " + RECORD_AND_TUPLE_SYNTAX_TYPES.map(p => `'${p}'`).join(", "));
+ }
+ }
+ }
+ }
+ if (pluginsMap.has("asyncDoExpressions") && !pluginsMap.has("doExpressions")) {
+ const error = new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");
+ error.missingPlugins = "doExpressions";
+ throw error;
+ }
+ if (pluginsMap.has("optionalChainingAssign") && pluginsMap.get("optionalChainingAssign").version !== "2023-07") {
+ throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option," + " representing the last proposal update. Currently, the" + " only supported value is '2023-07'.");
+ }
+}
+const mixinPlugins = {
+ estree,
+ jsx,
+ flow,
+ typescript,
+ v8intrinsic,
+ placeholders
+};
+const mixinPluginNames = Object.keys(mixinPlugins);
+const defaultOptions = {
+ sourceType: "script",
+ sourceFilename: undefined,
+ startColumn: 0,
+ startLine: 1,
+ allowAwaitOutsideFunction: false,
+ allowReturnOutsideFunction: false,
+ allowNewTargetOutsideFunction: false,
+ allowImportExportEverywhere: false,
+ allowSuperOutsideMethod: false,
+ allowUndeclaredExports: false,
+ plugins: [],
+ strictMode: null,
+ ranges: false,
+ tokens: false,
+ createImportExpressions: false,
+ createParenthesizedExpressions: false,
+ errorRecovery: false,
+ attachComment: true,
+ annexB: true
+};
+function getOptions(opts) {
+ if (opts == null) {
+ return Object.assign({}, defaultOptions);
+ }
+ if (opts.annexB != null && opts.annexB !== false) {
+ throw new Error("The `annexB` option can only be set to `false`.");
+ }
+ const options = {};
+ for (const key of Object.keys(defaultOptions)) {
+ var _opts$key;
+ options[key] = (_opts$key = opts[key]) != null ? _opts$key : defaultOptions[key];
+ }
+ return options;
+}
+class ExpressionParser extends LValParser {
+ checkProto(prop, isRecord, protoRef, refExpressionErrors) {
+ if (prop.type === "SpreadElement" || this.isObjectMethod(prop) || prop.computed || prop.shorthand) {
+ return;
+ }
+ const key = prop.key;
+ const name = key.type === "Identifier" ? key.name : key.value;
+ if (name === "__proto__") {
+ if (isRecord) {
+ this.raise(Errors.RecordNoProto, key);
+ return;
+ }
+ if (protoRef.used) {
+ if (refExpressionErrors) {
+ if (refExpressionErrors.doubleProtoLoc === null) {
+ refExpressionErrors.doubleProtoLoc = key.loc.start;
+ }
+ } else {
+ this.raise(Errors.DuplicateProto, key);
+ }
+ }
+ protoRef.used = true;
+ }
+ }
+ shouldExitDescending(expr, potentialArrowAt) {
+ return expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt;
+ }
+ getExpression() {
+ this.enterInitialScopes();
+ this.nextToken();
+ const expr = this.parseExpression();
+ if (!this.match(139)) {
+ this.unexpected();
+ }
+ this.finalizeRemainingComments();
+ expr.comments = this.comments;
+ expr.errors = this.state.errors;
+ if (this.options.tokens) {
+ expr.tokens = this.tokens;
+ }
+ return expr;
+ }
+ parseExpression(disallowIn, refExpressionErrors) {
+ if (disallowIn) {
+ return this.disallowInAnd(() => this.parseExpressionBase(refExpressionErrors));
+ }
+ return this.allowInAnd(() => this.parseExpressionBase(refExpressionErrors));
+ }
+ parseExpressionBase(refExpressionErrors) {
+ const startLoc = this.state.startLoc;
+ const expr = this.parseMaybeAssign(refExpressionErrors);
+ if (this.match(12)) {
+ const node = this.startNodeAt(startLoc);
+ node.expressions = [expr];
+ while (this.eat(12)) {
+ node.expressions.push(this.parseMaybeAssign(refExpressionErrors));
+ }
+ this.toReferencedList(node.expressions);
+ return this.finishNode(node, "SequenceExpression");
+ }
+ return expr;
+ }
+ parseMaybeAssignDisallowIn(refExpressionErrors, afterLeftParse) {
+ return this.disallowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse));
+ }
+ parseMaybeAssignAllowIn(refExpressionErrors, afterLeftParse) {
+ return this.allowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse));
+ }
+ setOptionalParametersError(refExpressionErrors, resultError) {
+ var _resultError$loc;
+ refExpressionErrors.optionalParametersLoc = (_resultError$loc = resultError == null ? void 0 : resultError.loc) != null ? _resultError$loc : this.state.startLoc;
+ }
+ parseMaybeAssign(refExpressionErrors, afterLeftParse) {
+ const startLoc = this.state.startLoc;
+ if (this.isContextual(108)) {
+ if (this.prodParam.hasYield) {
+ let left = this.parseYield();
+ if (afterLeftParse) {
+ left = afterLeftParse.call(this, left, startLoc);
+ }
+ return left;
+ }
+ }
+ let ownExpressionErrors;
+ if (refExpressionErrors) {
+ ownExpressionErrors = false;
+ } else {
+ refExpressionErrors = new ExpressionErrors();
+ ownExpressionErrors = true;
+ }
+ const {
+ type
+ } = this.state;
+ if (type === 10 || tokenIsIdentifier(type)) {
+ this.state.potentialArrowAt = this.state.start;
+ }
+ let left = this.parseMaybeConditional(refExpressionErrors);
+ if (afterLeftParse) {
+ left = afterLeftParse.call(this, left, startLoc);
+ }
+ if (tokenIsAssignment(this.state.type)) {
+ const node = this.startNodeAt(startLoc);
+ const operator = this.state.value;
+ node.operator = operator;
+ if (this.match(29)) {
+ this.toAssignable(left, true);
+ node.left = left;
+ const startIndex = startLoc.index;
+ if (refExpressionErrors.doubleProtoLoc != null && refExpressionErrors.doubleProtoLoc.index >= startIndex) {
+ refExpressionErrors.doubleProtoLoc = null;
+ }
+ if (refExpressionErrors.shorthandAssignLoc != null && refExpressionErrors.shorthandAssignLoc.index >= startIndex) {
+ refExpressionErrors.shorthandAssignLoc = null;
+ }
+ if (refExpressionErrors.privateKeyLoc != null && refExpressionErrors.privateKeyLoc.index >= startIndex) {
+ this.checkDestructuringPrivate(refExpressionErrors);
+ refExpressionErrors.privateKeyLoc = null;
+ }
+ } else {
+ node.left = left;
+ }
+ this.next();
+ node.right = this.parseMaybeAssign();
+ this.checkLVal(left, this.finishNode(node, "AssignmentExpression"));
+ return node;
+ } else if (ownExpressionErrors) {
+ this.checkExpressionErrors(refExpressionErrors, true);
+ }
+ return left;
+ }
+ parseMaybeConditional(refExpressionErrors) {
+ const startLoc = this.state.startLoc;
+ const potentialArrowAt = this.state.potentialArrowAt;
+ const expr = this.parseExprOps(refExpressionErrors);
+ if (this.shouldExitDescending(expr, potentialArrowAt)) {
+ return expr;
+ }
+ return this.parseConditional(expr, startLoc, refExpressionErrors);
+ }
+ parseConditional(expr, startLoc, refExpressionErrors) {
+ if (this.eat(17)) {
+ const node = this.startNodeAt(startLoc);
+ node.test = expr;
+ node.consequent = this.parseMaybeAssignAllowIn();
+ this.expect(14);
+ node.alternate = this.parseMaybeAssign();
+ return this.finishNode(node, "ConditionalExpression");
+ }
+ return expr;
+ }
+ parseMaybeUnaryOrPrivate(refExpressionErrors) {
+ return this.match(138) ? this.parsePrivateName() : this.parseMaybeUnary(refExpressionErrors);
+ }
+ parseExprOps(refExpressionErrors) {
+ const startLoc = this.state.startLoc;
+ const potentialArrowAt = this.state.potentialArrowAt;
+ const expr = this.parseMaybeUnaryOrPrivate(refExpressionErrors);
+ if (this.shouldExitDescending(expr, potentialArrowAt)) {
+ return expr;
+ }
+ return this.parseExprOp(expr, startLoc, -1);
+ }
+ parseExprOp(left, leftStartLoc, minPrec) {
+ if (this.isPrivateName(left)) {
+ const value = this.getPrivateNameSV(left);
+ if (minPrec >= tokenOperatorPrecedence(58) || !this.prodParam.hasIn || !this.match(58)) {
+ this.raise(Errors.PrivateInExpectedIn, left, {
+ identifierName: value
+ });
+ }
+ this.classScope.usePrivateName(value, left.loc.start);
+ }
+ const op = this.state.type;
+ if (tokenIsOperator(op) && (this.prodParam.hasIn || !this.match(58))) {
+ let prec = tokenOperatorPrecedence(op);
+ if (prec > minPrec) {
+ if (op === 39) {
+ this.expectPlugin("pipelineOperator");
+ if (this.state.inFSharpPipelineDirectBody) {
+ return left;
+ }
+ this.checkPipelineAtInfixOperator(left, leftStartLoc);
+ }
+ const node = this.startNodeAt(leftStartLoc);
+ node.left = left;
+ node.operator = this.state.value;
+ const logical = op === 41 || op === 42;
+ const coalesce = op === 40;
+ if (coalesce) {
+ prec = tokenOperatorPrecedence(42);
+ }
+ this.next();
+ if (op === 39 && this.hasPlugin(["pipelineOperator", {
+ proposal: "minimal"
+ }])) {
+ if (this.state.type === 96 && this.prodParam.hasAwait) {
+ throw this.raise(Errors.UnexpectedAwaitAfterPipelineBody, this.state.startLoc);
+ }
+ }
+ node.right = this.parseExprOpRightExpr(op, prec);
+ const finishedNode = this.finishNode(node, logical || coalesce ? "LogicalExpression" : "BinaryExpression");
+ const nextOp = this.state.type;
+ if (coalesce && (nextOp === 41 || nextOp === 42) || logical && nextOp === 40) {
+ throw this.raise(Errors.MixingCoalesceWithLogical, this.state.startLoc);
+ }
+ return this.parseExprOp(finishedNode, leftStartLoc, minPrec);
+ }
+ }
+ return left;
+ }
+ parseExprOpRightExpr(op, prec) {
+ const startLoc = this.state.startLoc;
+ switch (op) {
+ case 39:
+ switch (this.getPluginOption("pipelineOperator", "proposal")) {
+ case "hack":
+ return this.withTopicBindingContext(() => {
+ return this.parseHackPipeBody();
+ });
+ case "smart":
+ return this.withTopicBindingContext(() => {
+ if (this.prodParam.hasYield && this.isContextual(108)) {
+ throw this.raise(Errors.PipeBodyIsTighter, this.state.startLoc);
+ }
+ return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(op, prec), startLoc);
+ });
+ case "fsharp":
+ return this.withSoloAwaitPermittingContext(() => {
+ return this.parseFSharpPipelineBody(prec);
+ });
+ }
+ default:
+ return this.parseExprOpBaseRightExpr(op, prec);
+ }
+ }
+ parseExprOpBaseRightExpr(op, prec) {
+ const startLoc = this.state.startLoc;
+ return this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startLoc, tokenIsRightAssociative(op) ? prec - 1 : prec);
+ }
+ parseHackPipeBody() {
+ var _body$extra;
+ const {
+ startLoc
+ } = this.state;
+ const body = this.parseMaybeAssign();
+ const requiredParentheses = UnparenthesizedPipeBodyDescriptions.has(body.type);
+ if (requiredParentheses && !((_body$extra = body.extra) != null && _body$extra.parenthesized)) {
+ this.raise(Errors.PipeUnparenthesizedBody, startLoc, {
+ type: body.type
+ });
+ }
+ if (!this.topicReferenceWasUsedInCurrentContext()) {
+ this.raise(Errors.PipeTopicUnused, startLoc);
+ }
+ return body;
+ }
+ checkExponentialAfterUnary(node) {
+ if (this.match(57)) {
+ this.raise(Errors.UnexpectedTokenUnaryExponentiation, node.argument);
+ }
+ }
+ parseMaybeUnary(refExpressionErrors, sawUnary) {
+ const startLoc = this.state.startLoc;
+ const isAwait = this.isContextual(96);
+ if (isAwait && this.recordAwaitIfAllowed()) {
+ this.next();
+ const expr = this.parseAwait(startLoc);
+ if (!sawUnary) this.checkExponentialAfterUnary(expr);
+ return expr;
+ }
+ const update = this.match(34);
+ const node = this.startNode();
+ if (tokenIsPrefix(this.state.type)) {
+ node.operator = this.state.value;
+ node.prefix = true;
+ if (this.match(72)) {
+ this.expectPlugin("throwExpressions");
+ }
+ const isDelete = this.match(89);
+ this.next();
+ node.argument = this.parseMaybeUnary(null, true);
+ this.checkExpressionErrors(refExpressionErrors, true);
+ if (this.state.strict && isDelete) {
+ const arg = node.argument;
+ if (arg.type === "Identifier") {
+ this.raise(Errors.StrictDelete, node);
+ } else if (this.hasPropertyAsPrivateName(arg)) {
+ this.raise(Errors.DeletePrivateField, node);
+ }
+ }
+ if (!update) {
+ if (!sawUnary) {
+ this.checkExponentialAfterUnary(node);
+ }
+ return this.finishNode(node, "UnaryExpression");
+ }
+ }
+ const expr = this.parseUpdate(node, update, refExpressionErrors);
+ if (isAwait) {
+ const {
+ type
+ } = this.state;
+ const startsExpr = this.hasPlugin("v8intrinsic") ? tokenCanStartExpression(type) : tokenCanStartExpression(type) && !this.match(54);
+ if (startsExpr && !this.isAmbiguousAwait()) {
+ this.raiseOverwrite(Errors.AwaitNotInAsyncContext, startLoc);
+ return this.parseAwait(startLoc);
+ }
+ }
+ return expr;
+ }
+ parseUpdate(node, update, refExpressionErrors) {
+ if (update) {
+ const updateExpressionNode = node;
+ this.checkLVal(updateExpressionNode.argument, this.finishNode(updateExpressionNode, "UpdateExpression"));
+ return node;
+ }
+ const startLoc = this.state.startLoc;
+ let expr = this.parseExprSubscripts(refExpressionErrors);
+ if (this.checkExpressionErrors(refExpressionErrors, false)) return expr;
+ while (tokenIsPostfix(this.state.type) && !this.canInsertSemicolon()) {
+ const node = this.startNodeAt(startLoc);
+ node.operator = this.state.value;
+ node.prefix = false;
+ node.argument = expr;
+ this.next();
+ this.checkLVal(expr, expr = this.finishNode(node, "UpdateExpression"));
+ }
+ return expr;
+ }
+ parseExprSubscripts(refExpressionErrors) {
+ const startLoc = this.state.startLoc;
+ const potentialArrowAt = this.state.potentialArrowAt;
+ const expr = this.parseExprAtom(refExpressionErrors);
+ if (this.shouldExitDescending(expr, potentialArrowAt)) {
+ return expr;
+ }
+ return this.parseSubscripts(expr, startLoc);
+ }
+ parseSubscripts(base, startLoc, noCalls) {
+ const state = {
+ optionalChainMember: false,
+ maybeAsyncArrow: this.atPossibleAsyncArrow(base),
+ stop: false
+ };
+ do {
+ base = this.parseSubscript(base, startLoc, noCalls, state);
+ state.maybeAsyncArrow = false;
+ } while (!state.stop);
+ return base;
+ }
+ parseSubscript(base, startLoc, noCalls, state) {
+ const {
+ type
+ } = this.state;
+ if (!noCalls && type === 15) {
+ return this.parseBind(base, startLoc, noCalls, state);
+ } else if (tokenIsTemplate(type)) {
+ return this.parseTaggedTemplateExpression(base, startLoc, state);
+ }
+ let optional = false;
+ if (type === 18) {
+ if (noCalls) {
+ this.raise(Errors.OptionalChainingNoNew, this.state.startLoc);
+ if (this.lookaheadCharCode() === 40) {
+ state.stop = true;
+ return base;
+ }
+ }
+ state.optionalChainMember = optional = true;
+ this.next();
+ }
+ if (!noCalls && this.match(10)) {
+ return this.parseCoverCallAndAsyncArrowHead(base, startLoc, state, optional);
+ } else {
+ const computed = this.eat(0);
+ if (computed || optional || this.eat(16)) {
+ return this.parseMember(base, startLoc, state, computed, optional);
+ } else {
+ state.stop = true;
+ return base;
+ }
+ }
+ }
+ parseMember(base, startLoc, state, computed, optional) {
+ const node = this.startNodeAt(startLoc);
+ node.object = base;
+ node.computed = computed;
+ if (computed) {
+ node.property = this.parseExpression();
+ this.expect(3);
+ } else if (this.match(138)) {
+ if (base.type === "Super") {
+ this.raise(Errors.SuperPrivateField, startLoc);
+ }
+ this.classScope.usePrivateName(this.state.value, this.state.startLoc);
+ node.property = this.parsePrivateName();
+ } else {
+ node.property = this.parseIdentifier(true);
+ }
+ if (state.optionalChainMember) {
+ node.optional = optional;
+ return this.finishNode(node, "OptionalMemberExpression");
+ } else {
+ return this.finishNode(node, "MemberExpression");
+ }
+ }
+ parseBind(base, startLoc, noCalls, state) {
+ const node = this.startNodeAt(startLoc);
+ node.object = base;
+ this.next();
+ node.callee = this.parseNoCallExpr();
+ state.stop = true;
+ return this.parseSubscripts(this.finishNode(node, "BindExpression"), startLoc, noCalls);
+ }
+ parseCoverCallAndAsyncArrowHead(base, startLoc, state, optional) {
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ let refExpressionErrors = null;
+ this.state.maybeInArrowParameters = true;
+ this.next();
+ const node = this.startNodeAt(startLoc);
+ node.callee = base;
+ const {
+ maybeAsyncArrow,
+ optionalChainMember
+ } = state;
+ if (maybeAsyncArrow) {
+ this.expressionScope.enter(newAsyncArrowScope());
+ refExpressionErrors = new ExpressionErrors();
+ }
+ if (optionalChainMember) {
+ node.optional = optional;
+ }
+ if (optional) {
+ node.arguments = this.parseCallExpressionArguments(11);
+ } else {
+ node.arguments = this.parseCallExpressionArguments(11, base.type === "Import", base.type !== "Super", node, refExpressionErrors);
+ }
+ let finishedNode = this.finishCallExpression(node, optionalChainMember);
+ if (maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional) {
+ state.stop = true;
+ this.checkDestructuringPrivate(refExpressionErrors);
+ this.expressionScope.validateAsPattern();
+ this.expressionScope.exit();
+ finishedNode = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startLoc), finishedNode);
+ } else {
+ if (maybeAsyncArrow) {
+ this.checkExpressionErrors(refExpressionErrors, true);
+ this.expressionScope.exit();
+ }
+ this.toReferencedArguments(finishedNode);
+ }
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ return finishedNode;
+ }
+ toReferencedArguments(node, isParenthesizedExpr) {
+ this.toReferencedListDeep(node.arguments, isParenthesizedExpr);
+ }
+ parseTaggedTemplateExpression(base, startLoc, state) {
+ const node = this.startNodeAt(startLoc);
+ node.tag = base;
+ node.quasi = this.parseTemplate(true);
+ if (state.optionalChainMember) {
+ this.raise(Errors.OptionalChainingNoTemplate, startLoc);
+ }
+ return this.finishNode(node, "TaggedTemplateExpression");
+ }
+ atPossibleAsyncArrow(base) {
+ return base.type === "Identifier" && base.name === "async" && this.state.lastTokEndLoc.index === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && base.start === this.state.potentialArrowAt;
+ }
+ expectImportAttributesPlugin() {
+ if (!this.hasPlugin("importAssertions")) {
+ this.expectPlugin("importAttributes");
+ }
+ }
+ finishCallExpression(node, optional) {
+ if (node.callee.type === "Import") {
+ if (node.arguments.length === 2) {
+ {
+ if (!this.hasPlugin("moduleAttributes")) {
+ this.expectImportAttributesPlugin();
+ }
+ }
+ }
+ if (node.arguments.length === 0 || node.arguments.length > 2) {
+ this.raise(Errors.ImportCallArity, node, {
+ maxArgumentCount: this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions") || this.hasPlugin("moduleAttributes") ? 2 : 1
+ });
+ } else {
+ for (const arg of node.arguments) {
+ if (arg.type === "SpreadElement") {
+ this.raise(Errors.ImportCallSpreadArgument, arg);
+ }
+ }
+ }
+ }
+ return this.finishNode(node, optional ? "OptionalCallExpression" : "CallExpression");
+ }
+ parseCallExpressionArguments(close, dynamicImport, allowPlaceholder, nodeForExtra, refExpressionErrors) {
+ const elts = [];
+ let first = true;
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ this.state.inFSharpPipelineDirectBody = false;
+ while (!this.eat(close)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(12);
+ if (this.match(close)) {
+ if (dynamicImport && !this.hasPlugin("importAttributes") && !this.hasPlugin("importAssertions") && !this.hasPlugin("moduleAttributes")) {
+ this.raise(Errors.ImportCallArgumentTrailingComma, this.state.lastTokStartLoc);
+ }
+ if (nodeForExtra) {
+ this.addTrailingCommaExtraToNode(nodeForExtra);
+ }
+ this.next();
+ break;
+ }
+ }
+ elts.push(this.parseExprListItem(false, refExpressionErrors, allowPlaceholder));
+ }
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ return elts;
+ }
+ shouldParseAsyncArrow() {
+ return this.match(19) && !this.canInsertSemicolon();
+ }
+ parseAsyncArrowFromCallExpression(node, call) {
+ var _call$extra;
+ this.resetPreviousNodeTrailingComments(call);
+ this.expect(19);
+ this.parseArrowExpression(node, call.arguments, true, (_call$extra = call.extra) == null ? void 0 : _call$extra.trailingCommaLoc);
+ if (call.innerComments) {
+ setInnerComments(node, call.innerComments);
+ }
+ if (call.callee.trailingComments) {
+ setInnerComments(node, call.callee.trailingComments);
+ }
+ return node;
+ }
+ parseNoCallExpr() {
+ const startLoc = this.state.startLoc;
+ return this.parseSubscripts(this.parseExprAtom(), startLoc, true);
+ }
+ parseExprAtom(refExpressionErrors) {
+ let node;
+ let decorators = null;
+ const {
+ type
+ } = this.state;
+ switch (type) {
+ case 79:
+ return this.parseSuper();
+ case 83:
+ node = this.startNode();
+ this.next();
+ if (this.match(16)) {
+ return this.parseImportMetaProperty(node);
+ }
+ if (this.match(10)) {
+ if (this.options.createImportExpressions) {
+ return this.parseImportCall(node);
+ } else {
+ return this.finishNode(node, "Import");
+ }
+ } else {
+ this.raise(Errors.UnsupportedImport, this.state.lastTokStartLoc);
+ return this.finishNode(node, "Import");
+ }
+ case 78:
+ node = this.startNode();
+ this.next();
+ return this.finishNode(node, "ThisExpression");
+ case 90:
+ {
+ return this.parseDo(this.startNode(), false);
+ }
+ case 56:
+ case 31:
+ {
+ this.readRegexp();
+ return this.parseRegExpLiteral(this.state.value);
+ }
+ case 134:
+ return this.parseNumericLiteral(this.state.value);
+ case 135:
+ return this.parseBigIntLiteral(this.state.value);
+ case 136:
+ return this.parseDecimalLiteral(this.state.value);
+ case 133:
+ return this.parseStringLiteral(this.state.value);
+ case 84:
+ return this.parseNullLiteral();
+ case 85:
+ return this.parseBooleanLiteral(true);
+ case 86:
+ return this.parseBooleanLiteral(false);
+ case 10:
+ {
+ const canBeArrow = this.state.potentialArrowAt === this.state.start;
+ return this.parseParenAndDistinguishExpression(canBeArrow);
+ }
+ case 2:
+ case 1:
+ {
+ return this.parseArrayLike(this.state.type === 2 ? 4 : 3, false, true);
+ }
+ case 0:
+ {
+ return this.parseArrayLike(3, true, false, refExpressionErrors);
+ }
+ case 6:
+ case 7:
+ {
+ return this.parseObjectLike(this.state.type === 6 ? 9 : 8, false, true);
+ }
+ case 5:
+ {
+ return this.parseObjectLike(8, false, false, refExpressionErrors);
+ }
+ case 68:
+ return this.parseFunctionOrFunctionSent();
+ case 26:
+ decorators = this.parseDecorators();
+ case 80:
+ return this.parseClass(this.maybeTakeDecorators(decorators, this.startNode()), false);
+ case 77:
+ return this.parseNewOrNewTarget();
+ case 25:
+ case 24:
+ return this.parseTemplate(false);
+ case 15:
+ {
+ node = this.startNode();
+ this.next();
+ node.object = null;
+ const callee = node.callee = this.parseNoCallExpr();
+ if (callee.type === "MemberExpression") {
+ return this.finishNode(node, "BindExpression");
+ } else {
+ throw this.raise(Errors.UnsupportedBind, callee);
+ }
+ }
+ case 138:
+ {
+ this.raise(Errors.PrivateInExpectedIn, this.state.startLoc, {
+ identifierName: this.state.value
+ });
+ return this.parsePrivateName();
+ }
+ case 33:
+ {
+ return this.parseTopicReferenceThenEqualsSign(54, "%");
+ }
+ case 32:
+ {
+ return this.parseTopicReferenceThenEqualsSign(44, "^");
+ }
+ case 37:
+ case 38:
+ {
+ return this.parseTopicReference("hack");
+ }
+ case 44:
+ case 54:
+ case 27:
+ {
+ const pipeProposal = this.getPluginOption("pipelineOperator", "proposal");
+ if (pipeProposal) {
+ return this.parseTopicReference(pipeProposal);
+ }
+ this.unexpected();
+ break;
+ }
+ case 47:
+ {
+ const lookaheadCh = this.input.codePointAt(this.nextTokenStart());
+ if (isIdentifierStart(lookaheadCh) || lookaheadCh === 62) {
+ this.expectOnePlugin(["jsx", "flow", "typescript"]);
+ } else {
+ this.unexpected();
+ }
+ break;
+ }
+ default:
+ if (tokenIsIdentifier(type)) {
+ if (this.isContextual(127) && this.lookaheadInLineCharCode() === 123) {
+ return this.parseModuleExpression();
+ }
+ const canBeArrow = this.state.potentialArrowAt === this.state.start;
+ const containsEsc = this.state.containsEsc;
+ const id = this.parseIdentifier();
+ if (!containsEsc && id.name === "async" && !this.canInsertSemicolon()) {
+ const {
+ type
+ } = this.state;
+ if (type === 68) {
+ this.resetPreviousNodeTrailingComments(id);
+ this.next();
+ return this.parseAsyncFunctionExpression(this.startNodeAtNode(id));
+ } else if (tokenIsIdentifier(type)) {
+ if (this.lookaheadCharCode() === 61) {
+ return this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(id));
+ } else {
+ return id;
+ }
+ } else if (type === 90) {
+ this.resetPreviousNodeTrailingComments(id);
+ return this.parseDo(this.startNodeAtNode(id), true);
+ }
+ }
+ if (canBeArrow && this.match(19) && !this.canInsertSemicolon()) {
+ this.next();
+ return this.parseArrowExpression(this.startNodeAtNode(id), [id], false);
+ }
+ return id;
+ } else {
+ this.unexpected();
+ }
+ }
+ }
+ parseTopicReferenceThenEqualsSign(topicTokenType, topicTokenValue) {
+ const pipeProposal = this.getPluginOption("pipelineOperator", "proposal");
+ if (pipeProposal) {
+ this.state.type = topicTokenType;
+ this.state.value = topicTokenValue;
+ this.state.pos--;
+ this.state.end--;
+ this.state.endLoc = createPositionWithColumnOffset(this.state.endLoc, -1);
+ return this.parseTopicReference(pipeProposal);
+ } else {
+ this.unexpected();
+ }
+ }
+ parseTopicReference(pipeProposal) {
+ const node = this.startNode();
+ const startLoc = this.state.startLoc;
+ const tokenType = this.state.type;
+ this.next();
+ return this.finishTopicReference(node, startLoc, pipeProposal, tokenType);
+ }
+ finishTopicReference(node, startLoc, pipeProposal, tokenType) {
+ if (this.testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType)) {
+ const nodeType = pipeProposal === "smart" ? "PipelinePrimaryTopicReference" : "TopicReference";
+ if (!this.topicReferenceIsAllowedInCurrentContext()) {
+ this.raise(pipeProposal === "smart" ? Errors.PrimaryTopicNotAllowed : Errors.PipeTopicUnbound, startLoc);
+ }
+ this.registerTopicReference();
+ return this.finishNode(node, nodeType);
+ } else {
+ throw this.raise(Errors.PipeTopicUnconfiguredToken, startLoc, {
+ token: tokenLabelName(tokenType)
+ });
+ }
+ }
+ testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType) {
+ switch (pipeProposal) {
+ case "hack":
+ {
+ return this.hasPlugin(["pipelineOperator", {
+ topicToken: tokenLabelName(tokenType)
+ }]);
+ }
+ case "smart":
+ return tokenType === 27;
+ default:
+ throw this.raise(Errors.PipeTopicRequiresHackPipes, startLoc);
+ }
+ }
+ parseAsyncArrowUnaryFunction(node) {
+ this.prodParam.enter(functionFlags(true, this.prodParam.hasYield));
+ const params = [this.parseIdentifier()];
+ this.prodParam.exit();
+ if (this.hasPrecedingLineBreak()) {
+ this.raise(Errors.LineTerminatorBeforeArrow, this.state.curPosition());
+ }
+ this.expect(19);
+ return this.parseArrowExpression(node, params, true);
+ }
+ parseDo(node, isAsync) {
+ this.expectPlugin("doExpressions");
+ if (isAsync) {
+ this.expectPlugin("asyncDoExpressions");
+ }
+ node.async = isAsync;
+ this.next();
+ const oldLabels = this.state.labels;
+ this.state.labels = [];
+ if (isAsync) {
+ this.prodParam.enter(2);
+ node.body = this.parseBlock();
+ this.prodParam.exit();
+ } else {
+ node.body = this.parseBlock();
+ }
+ this.state.labels = oldLabels;
+ return this.finishNode(node, "DoExpression");
+ }
+ parseSuper() {
+ const node = this.startNode();
+ this.next();
+ if (this.match(10) && !this.scope.allowDirectSuper && !this.options.allowSuperOutsideMethod) {
+ this.raise(Errors.SuperNotAllowed, node);
+ } else if (!this.scope.allowSuper && !this.options.allowSuperOutsideMethod) {
+ this.raise(Errors.UnexpectedSuper, node);
+ }
+ if (!this.match(10) && !this.match(0) && !this.match(16)) {
+ this.raise(Errors.UnsupportedSuper, node);
+ }
+ return this.finishNode(node, "Super");
+ }
+ parsePrivateName() {
+ const node = this.startNode();
+ const id = this.startNodeAt(createPositionWithColumnOffset(this.state.startLoc, 1));
+ const name = this.state.value;
+ this.next();
+ node.id = this.createIdentifier(id, name);
+ return this.finishNode(node, "PrivateName");
+ }
+ parseFunctionOrFunctionSent() {
+ const node = this.startNode();
+ this.next();
+ if (this.prodParam.hasYield && this.match(16)) {
+ const meta = this.createIdentifier(this.startNodeAtNode(node), "function");
+ this.next();
+ if (this.match(103)) {
+ this.expectPlugin("functionSent");
+ } else if (!this.hasPlugin("functionSent")) {
+ this.unexpected();
+ }
+ return this.parseMetaProperty(node, meta, "sent");
+ }
+ return this.parseFunction(node);
+ }
+ parseMetaProperty(node, meta, propertyName) {
+ node.meta = meta;
+ const containsEsc = this.state.containsEsc;
+ node.property = this.parseIdentifier(true);
+ if (node.property.name !== propertyName || containsEsc) {
+ this.raise(Errors.UnsupportedMetaProperty, node.property, {
+ target: meta.name,
+ onlyValidPropertyName: propertyName
+ });
+ }
+ return this.finishNode(node, "MetaProperty");
+ }
+ parseImportMetaProperty(node) {
+ const id = this.createIdentifier(this.startNodeAtNode(node), "import");
+ this.next();
+ if (this.isContextual(101)) {
+ if (!this.inModule) {
+ this.raise(Errors.ImportMetaOutsideModule, id);
+ }
+ this.sawUnambiguousESM = true;
+ } else if (this.isContextual(105) || this.isContextual(97)) {
+ const isSource = this.isContextual(105);
+ if (!isSource) this.unexpected();
+ this.expectPlugin(isSource ? "sourcePhaseImports" : "deferredImportEvaluation");
+ if (!this.options.createImportExpressions) {
+ throw this.raise(Errors.DynamicImportPhaseRequiresImportExpressions, this.state.startLoc, {
+ phase: this.state.value
+ });
+ }
+ this.next();
+ node.phase = isSource ? "source" : "defer";
+ return this.parseImportCall(node);
+ }
+ return this.parseMetaProperty(node, id, "meta");
+ }
+ parseLiteralAtNode(value, type, node) {
+ this.addExtra(node, "rawValue", value);
+ this.addExtra(node, "raw", this.input.slice(node.start, this.state.end));
+ node.value = value;
+ this.next();
+ return this.finishNode(node, type);
+ }
+ parseLiteral(value, type) {
+ const node = this.startNode();
+ return this.parseLiteralAtNode(value, type, node);
+ }
+ parseStringLiteral(value) {
+ return this.parseLiteral(value, "StringLiteral");
+ }
+ parseNumericLiteral(value) {
+ return this.parseLiteral(value, "NumericLiteral");
+ }
+ parseBigIntLiteral(value) {
+ return this.parseLiteral(value, "BigIntLiteral");
+ }
+ parseDecimalLiteral(value) {
+ return this.parseLiteral(value, "DecimalLiteral");
+ }
+ parseRegExpLiteral(value) {
+ const node = this.startNode();
+ this.addExtra(node, "raw", this.input.slice(node.start, this.state.end));
+ node.pattern = value.pattern;
+ node.flags = value.flags;
+ this.next();
+ return this.finishNode(node, "RegExpLiteral");
+ }
+ parseBooleanLiteral(value) {
+ const node = this.startNode();
+ node.value = value;
+ this.next();
+ return this.finishNode(node, "BooleanLiteral");
+ }
+ parseNullLiteral() {
+ const node = this.startNode();
+ this.next();
+ return this.finishNode(node, "NullLiteral");
+ }
+ parseParenAndDistinguishExpression(canBeArrow) {
+ const startLoc = this.state.startLoc;
+ let val;
+ this.next();
+ this.expressionScope.enter(newArrowHeadScope());
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ this.state.maybeInArrowParameters = true;
+ this.state.inFSharpPipelineDirectBody = false;
+ const innerStartLoc = this.state.startLoc;
+ const exprList = [];
+ const refExpressionErrors = new ExpressionErrors();
+ let first = true;
+ let spreadStartLoc;
+ let optionalCommaStartLoc;
+ while (!this.match(11)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(12, refExpressionErrors.optionalParametersLoc === null ? null : refExpressionErrors.optionalParametersLoc);
+ if (this.match(11)) {
+ optionalCommaStartLoc = this.state.startLoc;
+ break;
+ }
+ }
+ if (this.match(21)) {
+ const spreadNodeStartLoc = this.state.startLoc;
+ spreadStartLoc = this.state.startLoc;
+ exprList.push(this.parseParenItem(this.parseRestBinding(), spreadNodeStartLoc));
+ if (!this.checkCommaAfterRest(41)) {
+ break;
+ }
+ } else {
+ exprList.push(this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem));
+ }
+ }
+ const innerEndLoc = this.state.lastTokEndLoc;
+ this.expect(11);
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ let arrowNode = this.startNodeAt(startLoc);
+ if (canBeArrow && this.shouldParseArrow(exprList) && (arrowNode = this.parseArrow(arrowNode))) {
+ this.checkDestructuringPrivate(refExpressionErrors);
+ this.expressionScope.validateAsPattern();
+ this.expressionScope.exit();
+ this.parseArrowExpression(arrowNode, exprList, false);
+ return arrowNode;
+ }
+ this.expressionScope.exit();
+ if (!exprList.length) {
+ this.unexpected(this.state.lastTokStartLoc);
+ }
+ if (optionalCommaStartLoc) this.unexpected(optionalCommaStartLoc);
+ if (spreadStartLoc) this.unexpected(spreadStartLoc);
+ this.checkExpressionErrors(refExpressionErrors, true);
+ this.toReferencedListDeep(exprList, true);
+ if (exprList.length > 1) {
+ val = this.startNodeAt(innerStartLoc);
+ val.expressions = exprList;
+ this.finishNode(val, "SequenceExpression");
+ this.resetEndLocation(val, innerEndLoc);
+ } else {
+ val = exprList[0];
+ }
+ return this.wrapParenthesis(startLoc, val);
+ }
+ wrapParenthesis(startLoc, expression) {
+ if (!this.options.createParenthesizedExpressions) {
+ this.addExtra(expression, "parenthesized", true);
+ this.addExtra(expression, "parenStart", startLoc.index);
+ this.takeSurroundingComments(expression, startLoc.index, this.state.lastTokEndLoc.index);
+ return expression;
+ }
+ const parenExpression = this.startNodeAt(startLoc);
+ parenExpression.expression = expression;
+ return this.finishNode(parenExpression, "ParenthesizedExpression");
+ }
+ shouldParseArrow(params) {
+ return !this.canInsertSemicolon();
+ }
+ parseArrow(node) {
+ if (this.eat(19)) {
+ return node;
+ }
+ }
+ parseParenItem(node, startLoc) {
+ return node;
+ }
+ parseNewOrNewTarget() {
+ const node = this.startNode();
+ this.next();
+ if (this.match(16)) {
+ const meta = this.createIdentifier(this.startNodeAtNode(node), "new");
+ this.next();
+ const metaProp = this.parseMetaProperty(node, meta, "target");
+ if (!this.scope.inNonArrowFunction && !this.scope.inClass && !this.options.allowNewTargetOutsideFunction) {
+ this.raise(Errors.UnexpectedNewTarget, metaProp);
+ }
+ return metaProp;
+ }
+ return this.parseNew(node);
+ }
+ parseNew(node) {
+ this.parseNewCallee(node);
+ if (this.eat(10)) {
+ const args = this.parseExprList(11);
+ this.toReferencedList(args);
+ node.arguments = args;
+ } else {
+ node.arguments = [];
+ }
+ return this.finishNode(node, "NewExpression");
+ }
+ parseNewCallee(node) {
+ const isImport = this.match(83);
+ const callee = this.parseNoCallExpr();
+ node.callee = callee;
+ if (isImport && (callee.type === "Import" || callee.type === "ImportExpression")) {
+ this.raise(Errors.ImportCallNotNewExpression, callee);
+ }
+ }
+ parseTemplateElement(isTagged) {
+ const {
+ start,
+ startLoc,
+ end,
+ value
+ } = this.state;
+ const elemStart = start + 1;
+ const elem = this.startNodeAt(createPositionWithColumnOffset(startLoc, 1));
+ if (value === null) {
+ if (!isTagged) {
+ this.raise(Errors.InvalidEscapeSequenceTemplate, createPositionWithColumnOffset(this.state.firstInvalidTemplateEscapePos, 1));
+ }
+ }
+ const isTail = this.match(24);
+ const endOffset = isTail ? -1 : -2;
+ const elemEnd = end + endOffset;
+ elem.value = {
+ raw: this.input.slice(elemStart, elemEnd).replace(/\r\n?/g, "\n"),
+ cooked: value === null ? null : value.slice(1, endOffset)
+ };
+ elem.tail = isTail;
+ this.next();
+ const finishedNode = this.finishNode(elem, "TemplateElement");
+ this.resetEndLocation(finishedNode, createPositionWithColumnOffset(this.state.lastTokEndLoc, endOffset));
+ return finishedNode;
+ }
+ parseTemplate(isTagged) {
+ const node = this.startNode();
+ let curElt = this.parseTemplateElement(isTagged);
+ const quasis = [curElt];
+ const substitutions = [];
+ while (!curElt.tail) {
+ substitutions.push(this.parseTemplateSubstitution());
+ this.readTemplateContinuation();
+ quasis.push(curElt = this.parseTemplateElement(isTagged));
+ }
+ node.expressions = substitutions;
+ node.quasis = quasis;
+ return this.finishNode(node, "TemplateLiteral");
+ }
+ parseTemplateSubstitution() {
+ return this.parseExpression();
+ }
+ parseObjectLike(close, isPattern, isRecord, refExpressionErrors) {
+ if (isRecord) {
+ this.expectPlugin("recordAndTuple");
+ }
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ this.state.inFSharpPipelineDirectBody = false;
+ const propHash = Object.create(null);
+ let first = true;
+ const node = this.startNode();
+ node.properties = [];
+ this.next();
+ while (!this.match(close)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(12);
+ if (this.match(close)) {
+ this.addTrailingCommaExtraToNode(node);
+ break;
+ }
+ }
+ let prop;
+ if (isPattern) {
+ prop = this.parseBindingProperty();
+ } else {
+ prop = this.parsePropertyDefinition(refExpressionErrors);
+ this.checkProto(prop, isRecord, propHash, refExpressionErrors);
+ }
+ if (isRecord && !this.isObjectProperty(prop) && prop.type !== "SpreadElement") {
+ this.raise(Errors.InvalidRecordProperty, prop);
+ }
+ {
+ if (prop.shorthand) {
+ this.addExtra(prop, "shorthand", true);
+ }
+ }
+ node.properties.push(prop);
+ }
+ this.next();
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ let type = "ObjectExpression";
+ if (isPattern) {
+ type = "ObjectPattern";
+ } else if (isRecord) {
+ type = "RecordExpression";
+ }
+ return this.finishNode(node, type);
+ }
+ addTrailingCommaExtraToNode(node) {
+ this.addExtra(node, "trailingComma", this.state.lastTokStartLoc.index);
+ this.addExtra(node, "trailingCommaLoc", this.state.lastTokStartLoc, false);
+ }
+ maybeAsyncOrAccessorProp(prop) {
+ return !prop.computed && prop.key.type === "Identifier" && (this.isLiteralPropertyName() || this.match(0) || this.match(55));
+ }
+ parsePropertyDefinition(refExpressionErrors) {
+ let decorators = [];
+ if (this.match(26)) {
+ if (this.hasPlugin("decorators")) {
+ this.raise(Errors.UnsupportedPropertyDecorator, this.state.startLoc);
+ }
+ while (this.match(26)) {
+ decorators.push(this.parseDecorator());
+ }
+ }
+ const prop = this.startNode();
+ let isAsync = false;
+ let isAccessor = false;
+ let startLoc;
+ if (this.match(21)) {
+ if (decorators.length) this.unexpected();
+ return this.parseSpread();
+ }
+ if (decorators.length) {
+ prop.decorators = decorators;
+ decorators = [];
+ }
+ prop.method = false;
+ if (refExpressionErrors) {
+ startLoc = this.state.startLoc;
+ }
+ let isGenerator = this.eat(55);
+ this.parsePropertyNamePrefixOperator(prop);
+ const containsEsc = this.state.containsEsc;
+ this.parsePropertyName(prop, refExpressionErrors);
+ if (!isGenerator && !containsEsc && this.maybeAsyncOrAccessorProp(prop)) {
+ const {
+ key
+ } = prop;
+ const keyName = key.name;
+ if (keyName === "async" && !this.hasPrecedingLineBreak()) {
+ isAsync = true;
+ this.resetPreviousNodeTrailingComments(key);
+ isGenerator = this.eat(55);
+ this.parsePropertyName(prop);
+ }
+ if (keyName === "get" || keyName === "set") {
+ isAccessor = true;
+ this.resetPreviousNodeTrailingComments(key);
+ prop.kind = keyName;
+ if (this.match(55)) {
+ isGenerator = true;
+ this.raise(Errors.AccessorIsGenerator, this.state.curPosition(), {
+ kind: keyName
+ });
+ this.next();
+ }
+ this.parsePropertyName(prop);
+ }
+ }
+ return this.parseObjPropValue(prop, startLoc, isGenerator, isAsync, false, isAccessor, refExpressionErrors);
+ }
+ getGetterSetterExpectedParamCount(method) {
+ return method.kind === "get" ? 0 : 1;
+ }
+ getObjectOrClassMethodParams(method) {
+ return method.params;
+ }
+ checkGetterSetterParams(method) {
+ var _params;
+ const paramCount = this.getGetterSetterExpectedParamCount(method);
+ const params = this.getObjectOrClassMethodParams(method);
+ if (params.length !== paramCount) {
+ this.raise(method.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, method);
+ }
+ if (method.kind === "set" && ((_params = params[params.length - 1]) == null ? void 0 : _params.type) === "RestElement") {
+ this.raise(Errors.BadSetterRestParameter, method);
+ }
+ }
+ parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) {
+ if (isAccessor) {
+ const finishedProp = this.parseMethod(prop, isGenerator, false, false, false, "ObjectMethod");
+ this.checkGetterSetterParams(finishedProp);
+ return finishedProp;
+ }
+ if (isAsync || isGenerator || this.match(10)) {
+ if (isPattern) this.unexpected();
+ prop.kind = "method";
+ prop.method = true;
+ return this.parseMethod(prop, isGenerator, isAsync, false, false, "ObjectMethod");
+ }
+ }
+ parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) {
+ prop.shorthand = false;
+ if (this.eat(14)) {
+ prop.value = isPattern ? this.parseMaybeDefault(this.state.startLoc) : this.parseMaybeAssignAllowIn(refExpressionErrors);
+ return this.finishNode(prop, "ObjectProperty");
+ }
+ if (!prop.computed && prop.key.type === "Identifier") {
+ this.checkReservedWord(prop.key.name, prop.key.loc.start, true, false);
+ if (isPattern) {
+ prop.value = this.parseMaybeDefault(startLoc, cloneIdentifier(prop.key));
+ } else if (this.match(29)) {
+ const shorthandAssignLoc = this.state.startLoc;
+ if (refExpressionErrors != null) {
+ if (refExpressionErrors.shorthandAssignLoc === null) {
+ refExpressionErrors.shorthandAssignLoc = shorthandAssignLoc;
+ }
+ } else {
+ this.raise(Errors.InvalidCoverInitializedName, shorthandAssignLoc);
+ }
+ prop.value = this.parseMaybeDefault(startLoc, cloneIdentifier(prop.key));
+ } else {
+ prop.value = cloneIdentifier(prop.key);
+ }
+ prop.shorthand = true;
+ return this.finishNode(prop, "ObjectProperty");
+ }
+ }
+ parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) {
+ const node = this.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) || this.parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors);
+ if (!node) this.unexpected();
+ return node;
+ }
+ parsePropertyName(prop, refExpressionErrors) {
+ if (this.eat(0)) {
+ prop.computed = true;
+ prop.key = this.parseMaybeAssignAllowIn();
+ this.expect(3);
+ } else {
+ const {
+ type,
+ value
+ } = this.state;
+ let key;
+ if (tokenIsKeywordOrIdentifier(type)) {
+ key = this.parseIdentifier(true);
+ } else {
+ switch (type) {
+ case 134:
+ key = this.parseNumericLiteral(value);
+ break;
+ case 133:
+ key = this.parseStringLiteral(value);
+ break;
+ case 135:
+ key = this.parseBigIntLiteral(value);
+ break;
+ case 136:
+ key = this.parseDecimalLiteral(value);
+ break;
+ case 138:
+ {
+ const privateKeyLoc = this.state.startLoc;
+ if (refExpressionErrors != null) {
+ if (refExpressionErrors.privateKeyLoc === null) {
+ refExpressionErrors.privateKeyLoc = privateKeyLoc;
+ }
+ } else {
+ this.raise(Errors.UnexpectedPrivateField, privateKeyLoc);
+ }
+ key = this.parsePrivateName();
+ break;
+ }
+ default:
+ this.unexpected();
+ }
+ }
+ prop.key = key;
+ if (type !== 138) {
+ prop.computed = false;
+ }
+ }
+ }
+ initFunction(node, isAsync) {
+ node.id = null;
+ node.generator = false;
+ node.async = isAsync;
+ }
+ parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) {
+ this.initFunction(node, isAsync);
+ node.generator = isGenerator;
+ this.scope.enter(2 | 16 | (inClassScope ? 64 : 0) | (allowDirectSuper ? 32 : 0));
+ this.prodParam.enter(functionFlags(isAsync, node.generator));
+ this.parseFunctionParams(node, isConstructor);
+ const finishedNode = this.parseFunctionBodyAndFinish(node, type, true);
+ this.prodParam.exit();
+ this.scope.exit();
+ return finishedNode;
+ }
+ parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) {
+ if (isTuple) {
+ this.expectPlugin("recordAndTuple");
+ }
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ this.state.inFSharpPipelineDirectBody = false;
+ const node = this.startNode();
+ this.next();
+ node.elements = this.parseExprList(close, !isTuple, refExpressionErrors, node);
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ return this.finishNode(node, isTuple ? "TupleExpression" : "ArrayExpression");
+ }
+ parseArrowExpression(node, params, isAsync, trailingCommaLoc) {
+ this.scope.enter(2 | 4);
+ let flags = functionFlags(isAsync, false);
+ if (!this.match(5) && this.prodParam.hasIn) {
+ flags |= 8;
+ }
+ this.prodParam.enter(flags);
+ this.initFunction(node, isAsync);
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ if (params) {
+ this.state.maybeInArrowParameters = true;
+ this.setArrowFunctionParameters(node, params, trailingCommaLoc);
+ }
+ this.state.maybeInArrowParameters = false;
+ this.parseFunctionBody(node, true);
+ this.prodParam.exit();
+ this.scope.exit();
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ return this.finishNode(node, "ArrowFunctionExpression");
+ }
+ setArrowFunctionParameters(node, params, trailingCommaLoc) {
+ this.toAssignableList(params, trailingCommaLoc, false);
+ node.params = params;
+ }
+ parseFunctionBodyAndFinish(node, type, isMethod = false) {
+ this.parseFunctionBody(node, false, isMethod);
+ return this.finishNode(node, type);
+ }
+ parseFunctionBody(node, allowExpression, isMethod = false) {
+ const isExpression = allowExpression && !this.match(5);
+ this.expressionScope.enter(newExpressionScope());
+ if (isExpression) {
+ node.body = this.parseMaybeAssign();
+ this.checkParams(node, false, allowExpression, false);
+ } else {
+ const oldStrict = this.state.strict;
+ const oldLabels = this.state.labels;
+ this.state.labels = [];
+ this.prodParam.enter(this.prodParam.currentFlags() | 4);
+ node.body = this.parseBlock(true, false, hasStrictModeDirective => {
+ const nonSimple = !this.isSimpleParamList(node.params);
+ if (hasStrictModeDirective && nonSimple) {
+ this.raise(Errors.IllegalLanguageModeDirective, (node.kind === "method" || node.kind === "constructor") && !!node.key ? node.key.loc.end : node);
+ }
+ const strictModeChanged = !oldStrict && this.state.strict;
+ this.checkParams(node, !this.state.strict && !allowExpression && !isMethod && !nonSimple, allowExpression, strictModeChanged);
+ if (this.state.strict && node.id) {
+ this.checkIdentifier(node.id, 65, strictModeChanged);
+ }
+ });
+ this.prodParam.exit();
+ this.state.labels = oldLabels;
+ }
+ this.expressionScope.exit();
+ }
+ isSimpleParameter(node) {
+ return node.type === "Identifier";
+ }
+ isSimpleParamList(params) {
+ for (let i = 0, len = params.length; i < len; i++) {
+ if (!this.isSimpleParameter(params[i])) return false;
+ }
+ return true;
+ }
+ checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) {
+ const checkClashes = !allowDuplicates && new Set();
+ const formalParameters = {
+ type: "FormalParameters"
+ };
+ for (const param of node.params) {
+ this.checkLVal(param, formalParameters, 5, checkClashes, strictModeChanged);
+ }
+ }
+ parseExprList(close, allowEmpty, refExpressionErrors, nodeForExtra) {
+ const elts = [];
+ let first = true;
+ while (!this.eat(close)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(12);
+ if (this.match(close)) {
+ if (nodeForExtra) {
+ this.addTrailingCommaExtraToNode(nodeForExtra);
+ }
+ this.next();
+ break;
+ }
+ }
+ elts.push(this.parseExprListItem(allowEmpty, refExpressionErrors));
+ }
+ return elts;
+ }
+ parseExprListItem(allowEmpty, refExpressionErrors, allowPlaceholder) {
+ let elt;
+ if (this.match(12)) {
+ if (!allowEmpty) {
+ this.raise(Errors.UnexpectedToken, this.state.curPosition(), {
+ unexpected: ","
+ });
+ }
+ elt = null;
+ } else if (this.match(21)) {
+ const spreadNodeStartLoc = this.state.startLoc;
+ elt = this.parseParenItem(this.parseSpread(refExpressionErrors), spreadNodeStartLoc);
+ } else if (this.match(17)) {
+ this.expectPlugin("partialApplication");
+ if (!allowPlaceholder) {
+ this.raise(Errors.UnexpectedArgumentPlaceholder, this.state.startLoc);
+ }
+ const node = this.startNode();
+ this.next();
+ elt = this.finishNode(node, "ArgumentPlaceholder");
+ } else {
+ elt = this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem);
+ }
+ return elt;
+ }
+ parseIdentifier(liberal) {
+ const node = this.startNode();
+ const name = this.parseIdentifierName(liberal);
+ return this.createIdentifier(node, name);
+ }
+ createIdentifier(node, name) {
+ node.name = name;
+ node.loc.identifierName = name;
+ return this.finishNode(node, "Identifier");
+ }
+ parseIdentifierName(liberal) {
+ let name;
+ const {
+ startLoc,
+ type
+ } = this.state;
+ if (tokenIsKeywordOrIdentifier(type)) {
+ name = this.state.value;
+ } else {
+ this.unexpected();
+ }
+ const tokenIsKeyword = tokenKeywordOrIdentifierIsKeyword(type);
+ if (liberal) {
+ if (tokenIsKeyword) {
+ this.replaceToken(132);
+ }
+ } else {
+ this.checkReservedWord(name, startLoc, tokenIsKeyword, false);
+ }
+ this.next();
+ return name;
+ }
+ checkReservedWord(word, startLoc, checkKeywords, isBinding) {
+ if (word.length > 10) {
+ return;
+ }
+ if (!canBeReservedWord(word)) {
+ return;
+ }
+ if (checkKeywords && isKeyword(word)) {
+ this.raise(Errors.UnexpectedKeyword, startLoc, {
+ keyword: word
+ });
+ return;
+ }
+ const reservedTest = !this.state.strict ? isReservedWord : isBinding ? isStrictBindReservedWord : isStrictReservedWord;
+ if (reservedTest(word, this.inModule)) {
+ this.raise(Errors.UnexpectedReservedWord, startLoc, {
+ reservedWord: word
+ });
+ return;
+ } else if (word === "yield") {
+ if (this.prodParam.hasYield) {
+ this.raise(Errors.YieldBindingIdentifier, startLoc);
+ return;
+ }
+ } else if (word === "await") {
+ if (this.prodParam.hasAwait) {
+ this.raise(Errors.AwaitBindingIdentifier, startLoc);
+ return;
+ }
+ if (this.scope.inStaticBlock) {
+ this.raise(Errors.AwaitBindingIdentifierInStaticBlock, startLoc);
+ return;
+ }
+ this.expressionScope.recordAsyncArrowParametersError(startLoc);
+ } else if (word === "arguments") {
+ if (this.scope.inClassAndNotInNonArrowFunction) {
+ this.raise(Errors.ArgumentsInClass, startLoc);
+ return;
+ }
+ }
+ }
+ recordAwaitIfAllowed() {
+ const isAwaitAllowed = this.prodParam.hasAwait || this.options.allowAwaitOutsideFunction && !this.scope.inFunction;
+ if (isAwaitAllowed && !this.scope.inFunction) {
+ this.state.hasTopLevelAwait = true;
+ }
+ return isAwaitAllowed;
+ }
+ parseAwait(startLoc) {
+ const node = this.startNodeAt(startLoc);
+ this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter, node);
+ if (this.eat(55)) {
+ this.raise(Errors.ObsoleteAwaitStar, node);
+ }
+ if (!this.scope.inFunction && !this.options.allowAwaitOutsideFunction) {
+ if (this.isAmbiguousAwait()) {
+ this.ambiguousScriptDifferentAst = true;
+ } else {
+ this.sawUnambiguousESM = true;
+ }
+ }
+ if (!this.state.soloAwait) {
+ node.argument = this.parseMaybeUnary(null, true);
+ }
+ return this.finishNode(node, "AwaitExpression");
+ }
+ isAmbiguousAwait() {
+ if (this.hasPrecedingLineBreak()) return true;
+ const {
+ type
+ } = this.state;
+ return type === 53 || type === 10 || type === 0 || tokenIsTemplate(type) || type === 102 && !this.state.containsEsc || type === 137 || type === 56 || this.hasPlugin("v8intrinsic") && type === 54;
+ }
+ parseYield() {
+ const node = this.startNode();
+ this.expressionScope.recordParameterInitializerError(Errors.YieldInParameter, node);
+ this.next();
+ let delegating = false;
+ let argument = null;
+ if (!this.hasPrecedingLineBreak()) {
+ delegating = this.eat(55);
+ switch (this.state.type) {
+ case 13:
+ case 139:
+ case 8:
+ case 11:
+ case 3:
+ case 9:
+ case 14:
+ case 12:
+ if (!delegating) break;
+ default:
+ argument = this.parseMaybeAssign();
+ }
+ }
+ node.delegate = delegating;
+ node.argument = argument;
+ return this.finishNode(node, "YieldExpression");
+ }
+ parseImportCall(node) {
+ this.next();
+ node.source = this.parseMaybeAssignAllowIn();
+ if (this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions")) {
+ node.options = null;
+ }
+ if (this.eat(12)) {
+ this.expectImportAttributesPlugin();
+ if (!this.match(11)) {
+ node.options = this.parseMaybeAssignAllowIn();
+ this.eat(12);
+ }
+ }
+ this.expect(11);
+ return this.finishNode(node, "ImportExpression");
+ }
+ checkPipelineAtInfixOperator(left, leftStartLoc) {
+ if (this.hasPlugin(["pipelineOperator", {
+ proposal: "smart"
+ }])) {
+ if (left.type === "SequenceExpression") {
+ this.raise(Errors.PipelineHeadSequenceExpression, leftStartLoc);
+ }
+ }
+ }
+ parseSmartPipelineBodyInStyle(childExpr, startLoc) {
+ if (this.isSimpleReference(childExpr)) {
+ const bodyNode = this.startNodeAt(startLoc);
+ bodyNode.callee = childExpr;
+ return this.finishNode(bodyNode, "PipelineBareFunction");
+ } else {
+ const bodyNode = this.startNodeAt(startLoc);
+ this.checkSmartPipeTopicBodyEarlyErrors(startLoc);
+ bodyNode.expression = childExpr;
+ return this.finishNode(bodyNode, "PipelineTopicExpression");
+ }
+ }
+ isSimpleReference(expression) {
+ switch (expression.type) {
+ case "MemberExpression":
+ return !expression.computed && this.isSimpleReference(expression.object);
+ case "Identifier":
+ return true;
+ default:
+ return false;
+ }
+ }
+ checkSmartPipeTopicBodyEarlyErrors(startLoc) {
+ if (this.match(19)) {
+ throw this.raise(Errors.PipelineBodyNoArrow, this.state.startLoc);
+ }
+ if (!this.topicReferenceWasUsedInCurrentContext()) {
+ this.raise(Errors.PipelineTopicUnused, startLoc);
+ }
+ }
+ withTopicBindingContext(callback) {
+ const outerContextTopicState = this.state.topicContext;
+ this.state.topicContext = {
+ maxNumOfResolvableTopics: 1,
+ maxTopicIndex: null
+ };
+ try {
+ return callback();
+ } finally {
+ this.state.topicContext = outerContextTopicState;
+ }
+ }
+ withSmartMixTopicForbiddingContext(callback) {
+ if (this.hasPlugin(["pipelineOperator", {
+ proposal: "smart"
+ }])) {
+ const outerContextTopicState = this.state.topicContext;
+ this.state.topicContext = {
+ maxNumOfResolvableTopics: 0,
+ maxTopicIndex: null
+ };
+ try {
+ return callback();
+ } finally {
+ this.state.topicContext = outerContextTopicState;
+ }
+ } else {
+ return callback();
+ }
+ }
+ withSoloAwaitPermittingContext(callback) {
+ const outerContextSoloAwaitState = this.state.soloAwait;
+ this.state.soloAwait = true;
+ try {
+ return callback();
+ } finally {
+ this.state.soloAwait = outerContextSoloAwaitState;
+ }
+ }
+ allowInAnd(callback) {
+ const flags = this.prodParam.currentFlags();
+ const prodParamToSet = 8 & ~flags;
+ if (prodParamToSet) {
+ this.prodParam.enter(flags | 8);
+ try {
+ return callback();
+ } finally {
+ this.prodParam.exit();
+ }
+ }
+ return callback();
+ }
+ disallowInAnd(callback) {
+ const flags = this.prodParam.currentFlags();
+ const prodParamToClear = 8 & flags;
+ if (prodParamToClear) {
+ this.prodParam.enter(flags & ~8);
+ try {
+ return callback();
+ } finally {
+ this.prodParam.exit();
+ }
+ }
+ return callback();
+ }
+ registerTopicReference() {
+ this.state.topicContext.maxTopicIndex = 0;
+ }
+ topicReferenceIsAllowedInCurrentContext() {
+ return this.state.topicContext.maxNumOfResolvableTopics >= 1;
+ }
+ topicReferenceWasUsedInCurrentContext() {
+ return this.state.topicContext.maxTopicIndex != null && this.state.topicContext.maxTopicIndex >= 0;
+ }
+ parseFSharpPipelineBody(prec) {
+ const startLoc = this.state.startLoc;
+ this.state.potentialArrowAt = this.state.start;
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ this.state.inFSharpPipelineDirectBody = true;
+ const ret = this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startLoc, prec);
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ return ret;
+ }
+ parseModuleExpression() {
+ this.expectPlugin("moduleBlocks");
+ const node = this.startNode();
+ this.next();
+ if (!this.match(5)) {
+ this.unexpected(null, 5);
+ }
+ const program = this.startNodeAt(this.state.endLoc);
+ this.next();
+ const revertScopes = this.initializeScopes(true);
+ this.enterInitialScopes();
+ try {
+ node.body = this.parseProgram(program, 8, "module");
+ } finally {
+ revertScopes();
+ }
+ return this.finishNode(node, "ModuleExpression");
+ }
+ parsePropertyNamePrefixOperator(prop) {}
+}
+const loopLabel = {
+ kind: 1
+ },
+ switchLabel = {
+ kind: 2
+ };
+const loneSurrogate = /[\uD800-\uDFFF]/u;
+const keywordRelationalOperator = /in(?:stanceof)?/y;
+function babel7CompatTokens(tokens, input) {
+ for (let i = 0; i < tokens.length; i++) {
+ const token = tokens[i];
+ const {
+ type
+ } = token;
+ if (typeof type === "number") {
+ {
+ if (type === 138) {
+ const {
+ loc,
+ start,
+ value,
+ end
+ } = token;
+ const hashEndPos = start + 1;
+ const hashEndLoc = createPositionWithColumnOffset(loc.start, 1);
+ tokens.splice(i, 1, new Token({
+ type: getExportedToken(27),
+ value: "#",
+ start: start,
+ end: hashEndPos,
+ startLoc: loc.start,
+ endLoc: hashEndLoc
+ }), new Token({
+ type: getExportedToken(132),
+ value: value,
+ start: hashEndPos,
+ end: end,
+ startLoc: hashEndLoc,
+ endLoc: loc.end
+ }));
+ i++;
+ continue;
+ }
+ if (tokenIsTemplate(type)) {
+ const {
+ loc,
+ start,
+ value,
+ end
+ } = token;
+ const backquoteEnd = start + 1;
+ const backquoteEndLoc = createPositionWithColumnOffset(loc.start, 1);
+ let startToken;
+ if (input.charCodeAt(start) === 96) {
+ startToken = new Token({
+ type: getExportedToken(22),
+ value: "`",
+ start: start,
+ end: backquoteEnd,
+ startLoc: loc.start,
+ endLoc: backquoteEndLoc
+ });
+ } else {
+ startToken = new Token({
+ type: getExportedToken(8),
+ value: "}",
+ start: start,
+ end: backquoteEnd,
+ startLoc: loc.start,
+ endLoc: backquoteEndLoc
+ });
+ }
+ let templateValue, templateElementEnd, templateElementEndLoc, endToken;
+ if (type === 24) {
+ templateElementEnd = end - 1;
+ templateElementEndLoc = createPositionWithColumnOffset(loc.end, -1);
+ templateValue = value === null ? null : value.slice(1, -1);
+ endToken = new Token({
+ type: getExportedToken(22),
+ value: "`",
+ start: templateElementEnd,
+ end: end,
+ startLoc: templateElementEndLoc,
+ endLoc: loc.end
+ });
+ } else {
+ templateElementEnd = end - 2;
+ templateElementEndLoc = createPositionWithColumnOffset(loc.end, -2);
+ templateValue = value === null ? null : value.slice(1, -2);
+ endToken = new Token({
+ type: getExportedToken(23),
+ value: "${",
+ start: templateElementEnd,
+ end: end,
+ startLoc: templateElementEndLoc,
+ endLoc: loc.end
+ });
+ }
+ tokens.splice(i, 1, startToken, new Token({
+ type: getExportedToken(20),
+ value: templateValue,
+ start: backquoteEnd,
+ end: templateElementEnd,
+ startLoc: backquoteEndLoc,
+ endLoc: templateElementEndLoc
+ }), endToken);
+ i += 2;
+ continue;
+ }
+ }
+ token.type = getExportedToken(type);
+ }
+ }
+ return tokens;
+}
+class StatementParser extends ExpressionParser {
+ parseTopLevel(file, program) {
+ file.program = this.parseProgram(program);
+ file.comments = this.comments;
+ if (this.options.tokens) {
+ file.tokens = babel7CompatTokens(this.tokens, this.input);
+ }
+ return this.finishNode(file, "File");
+ }
+ parseProgram(program, end = 139, sourceType = this.options.sourceType) {
+ program.sourceType = sourceType;
+ program.interpreter = this.parseInterpreterDirective();
+ this.parseBlockBody(program, true, true, end);
+ if (this.inModule) {
+ if (!this.options.allowUndeclaredExports && this.scope.undefinedExports.size > 0) {
+ for (const [localName, at] of Array.from(this.scope.undefinedExports)) {
+ this.raise(Errors.ModuleExportUndefined, at, {
+ localName
+ });
+ }
+ }
+ this.addExtra(program, "topLevelAwait", this.state.hasTopLevelAwait);
+ }
+ let finishedProgram;
+ if (end === 139) {
+ finishedProgram = this.finishNode(program, "Program");
+ } else {
+ finishedProgram = this.finishNodeAt(program, "Program", createPositionWithColumnOffset(this.state.startLoc, -1));
+ }
+ return finishedProgram;
+ }
+ stmtToDirective(stmt) {
+ const directive = stmt;
+ directive.type = "Directive";
+ directive.value = directive.expression;
+ delete directive.expression;
+ const directiveLiteral = directive.value;
+ const expressionValue = directiveLiteral.value;
+ const raw = this.input.slice(directiveLiteral.start, directiveLiteral.end);
+ const val = directiveLiteral.value = raw.slice(1, -1);
+ this.addExtra(directiveLiteral, "raw", raw);
+ this.addExtra(directiveLiteral, "rawValue", val);
+ this.addExtra(directiveLiteral, "expressionValue", expressionValue);
+ directiveLiteral.type = "DirectiveLiteral";
+ return directive;
+ }
+ parseInterpreterDirective() {
+ if (!this.match(28)) {
+ return null;
+ }
+ const node = this.startNode();
+ node.value = this.state.value;
+ this.next();
+ return this.finishNode(node, "InterpreterDirective");
+ }
+ isLet() {
+ if (!this.isContextual(100)) {
+ return false;
+ }
+ return this.hasFollowingBindingAtom();
+ }
+ chStartsBindingIdentifier(ch, pos) {
+ if (isIdentifierStart(ch)) {
+ keywordRelationalOperator.lastIndex = pos;
+ if (keywordRelationalOperator.test(this.input)) {
+ const endCh = this.codePointAtPos(keywordRelationalOperator.lastIndex);
+ if (!isIdentifierChar(endCh) && endCh !== 92) {
+ return false;
+ }
+ }
+ return true;
+ } else if (ch === 92) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ chStartsBindingPattern(ch) {
+ return ch === 91 || ch === 123;
+ }
+ hasFollowingBindingAtom() {
+ const next = this.nextTokenStart();
+ const nextCh = this.codePointAtPos(next);
+ return this.chStartsBindingPattern(nextCh) || this.chStartsBindingIdentifier(nextCh, next);
+ }
+ hasInLineFollowingBindingIdentifierOrBrace() {
+ const next = this.nextTokenInLineStart();
+ const nextCh = this.codePointAtPos(next);
+ return nextCh === 123 || this.chStartsBindingIdentifier(nextCh, next);
+ }
+ startsUsingForOf() {
+ const {
+ type,
+ containsEsc
+ } = this.lookahead();
+ if (type === 102 && !containsEsc) {
+ return false;
+ } else if (tokenIsIdentifier(type) && !this.hasFollowingLineBreak()) {
+ this.expectPlugin("explicitResourceManagement");
+ return true;
+ }
+ }
+ startsAwaitUsing() {
+ let next = this.nextTokenInLineStart();
+ if (this.isUnparsedContextual(next, "using")) {
+ next = this.nextTokenInLineStartSince(next + 5);
+ const nextCh = this.codePointAtPos(next);
+ if (this.chStartsBindingIdentifier(nextCh, next)) {
+ this.expectPlugin("explicitResourceManagement");
+ return true;
+ }
+ }
+ return false;
+ }
+ parseModuleItem() {
+ return this.parseStatementLike(1 | 2 | 4 | 8);
+ }
+ parseStatementListItem() {
+ return this.parseStatementLike(2 | 4 | (!this.options.annexB || this.state.strict ? 0 : 8));
+ }
+ parseStatementOrSloppyAnnexBFunctionDeclaration(allowLabeledFunction = false) {
+ let flags = 0;
+ if (this.options.annexB && !this.state.strict) {
+ flags |= 4;
+ if (allowLabeledFunction) {
+ flags |= 8;
+ }
+ }
+ return this.parseStatementLike(flags);
+ }
+ parseStatement() {
+ return this.parseStatementLike(0);
+ }
+ parseStatementLike(flags) {
+ let decorators = null;
+ if (this.match(26)) {
+ decorators = this.parseDecorators(true);
+ }
+ return this.parseStatementContent(flags, decorators);
+ }
+ parseStatementContent(flags, decorators) {
+ const startType = this.state.type;
+ const node = this.startNode();
+ const allowDeclaration = !!(flags & 2);
+ const allowFunctionDeclaration = !!(flags & 4);
+ const topLevel = flags & 1;
+ switch (startType) {
+ case 60:
+ return this.parseBreakContinueStatement(node, true);
+ case 63:
+ return this.parseBreakContinueStatement(node, false);
+ case 64:
+ return this.parseDebuggerStatement(node);
+ case 90:
+ return this.parseDoWhileStatement(node);
+ case 91:
+ return this.parseForStatement(node);
+ case 68:
+ if (this.lookaheadCharCode() === 46) break;
+ if (!allowFunctionDeclaration) {
+ this.raise(this.state.strict ? Errors.StrictFunction : this.options.annexB ? Errors.SloppyFunctionAnnexB : Errors.SloppyFunction, this.state.startLoc);
+ }
+ return this.parseFunctionStatement(node, false, !allowDeclaration && allowFunctionDeclaration);
+ case 80:
+ if (!allowDeclaration) this.unexpected();
+ return this.parseClass(this.maybeTakeDecorators(decorators, node), true);
+ case 69:
+ return this.parseIfStatement(node);
+ case 70:
+ return this.parseReturnStatement(node);
+ case 71:
+ return this.parseSwitchStatement(node);
+ case 72:
+ return this.parseThrowStatement(node);
+ case 73:
+ return this.parseTryStatement(node);
+ case 96:
+ if (!this.state.containsEsc && this.startsAwaitUsing()) {
+ if (!this.recordAwaitIfAllowed()) {
+ this.raise(Errors.AwaitUsingNotInAsyncContext, node);
+ } else if (!allowDeclaration) {
+ this.raise(Errors.UnexpectedLexicalDeclaration, node);
+ }
+ this.next();
+ return this.parseVarStatement(node, "await using");
+ }
+ break;
+ case 107:
+ if (this.state.containsEsc || !this.hasInLineFollowingBindingIdentifierOrBrace()) {
+ break;
+ }
+ this.expectPlugin("explicitResourceManagement");
+ if (!this.scope.inModule && this.scope.inTopLevel) {
+ this.raise(Errors.UnexpectedUsingDeclaration, this.state.startLoc);
+ } else if (!allowDeclaration) {
+ this.raise(Errors.UnexpectedLexicalDeclaration, this.state.startLoc);
+ }
+ return this.parseVarStatement(node, "using");
+ case 100:
+ {
+ if (this.state.containsEsc) {
+ break;
+ }
+ const next = this.nextTokenStart();
+ const nextCh = this.codePointAtPos(next);
+ if (nextCh !== 91) {
+ if (!allowDeclaration && this.hasFollowingLineBreak()) break;
+ if (!this.chStartsBindingIdentifier(nextCh, next) && nextCh !== 123) {
+ break;
+ }
+ }
+ }
+ case 75:
+ {
+ if (!allowDeclaration) {
+ this.raise(Errors.UnexpectedLexicalDeclaration, this.state.startLoc);
+ }
+ }
+ case 74:
+ {
+ const kind = this.state.value;
+ return this.parseVarStatement(node, kind);
+ }
+ case 92:
+ return this.parseWhileStatement(node);
+ case 76:
+ return this.parseWithStatement(node);
+ case 5:
+ return this.parseBlock();
+ case 13:
+ return this.parseEmptyStatement(node);
+ case 83:
+ {
+ const nextTokenCharCode = this.lookaheadCharCode();
+ if (nextTokenCharCode === 40 || nextTokenCharCode === 46) {
+ break;
+ }
+ }
+ case 82:
+ {
+ if (!this.options.allowImportExportEverywhere && !topLevel) {
+ this.raise(Errors.UnexpectedImportExport, this.state.startLoc);
+ }
+ this.next();
+ let result;
+ if (startType === 83) {
+ result = this.parseImport(node);
+ if (result.type === "ImportDeclaration" && (!result.importKind || result.importKind === "value")) {
+ this.sawUnambiguousESM = true;
+ }
+ } else {
+ result = this.parseExport(node, decorators);
+ if (result.type === "ExportNamedDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportAllDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportDefaultDeclaration") {
+ this.sawUnambiguousESM = true;
+ }
+ }
+ this.assertModuleNodeAllowed(result);
+ return result;
+ }
+ default:
+ {
+ if (this.isAsyncFunction()) {
+ if (!allowDeclaration) {
+ this.raise(Errors.AsyncFunctionInSingleStatementContext, this.state.startLoc);
+ }
+ this.next();
+ return this.parseFunctionStatement(node, true, !allowDeclaration && allowFunctionDeclaration);
+ }
+ }
+ }
+ const maybeName = this.state.value;
+ const expr = this.parseExpression();
+ if (tokenIsIdentifier(startType) && expr.type === "Identifier" && this.eat(14)) {
+ return this.parseLabeledStatement(node, maybeName, expr, flags);
+ } else {
+ return this.parseExpressionStatement(node, expr, decorators);
+ }
+ }
+ assertModuleNodeAllowed(node) {
+ if (!this.options.allowImportExportEverywhere && !this.inModule) {
+ this.raise(Errors.ImportOutsideModule, node);
+ }
+ }
+ decoratorsEnabledBeforeExport() {
+ if (this.hasPlugin("decorators-legacy")) return true;
+ return this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport") !== false;
+ }
+ maybeTakeDecorators(maybeDecorators, classNode, exportNode) {
+ if (maybeDecorators) {
+ if (classNode.decorators && classNode.decorators.length > 0) {
+ if (typeof this.getPluginOption("decorators", "decoratorsBeforeExport") !== "boolean") {
+ this.raise(Errors.DecoratorsBeforeAfterExport, classNode.decorators[0]);
+ }
+ classNode.decorators.unshift(...maybeDecorators);
+ } else {
+ classNode.decorators = maybeDecorators;
+ }
+ this.resetStartLocationFromNode(classNode, maybeDecorators[0]);
+ if (exportNode) this.resetStartLocationFromNode(exportNode, classNode);
+ }
+ return classNode;
+ }
+ canHaveLeadingDecorator() {
+ return this.match(80);
+ }
+ parseDecorators(allowExport) {
+ const decorators = [];
+ do {
+ decorators.push(this.parseDecorator());
+ } while (this.match(26));
+ if (this.match(82)) {
+ if (!allowExport) {
+ this.unexpected();
+ }
+ if (!this.decoratorsEnabledBeforeExport()) {
+ this.raise(Errors.DecoratorExportClass, this.state.startLoc);
+ }
+ } else if (!this.canHaveLeadingDecorator()) {
+ throw this.raise(Errors.UnexpectedLeadingDecorator, this.state.startLoc);
+ }
+ return decorators;
+ }
+ parseDecorator() {
+ this.expectOnePlugin(["decorators", "decorators-legacy"]);
+ const node = this.startNode();
+ this.next();
+ if (this.hasPlugin("decorators")) {
+ const startLoc = this.state.startLoc;
+ let expr;
+ if (this.match(10)) {
+ const startLoc = this.state.startLoc;
+ this.next();
+ expr = this.parseExpression();
+ this.expect(11);
+ expr = this.wrapParenthesis(startLoc, expr);
+ const paramsStartLoc = this.state.startLoc;
+ node.expression = this.parseMaybeDecoratorArguments(expr);
+ if (this.getPluginOption("decorators", "allowCallParenthesized") === false && node.expression !== expr) {
+ this.raise(Errors.DecoratorArgumentsOutsideParentheses, paramsStartLoc);
+ }
+ } else {
+ expr = this.parseIdentifier(false);
+ while (this.eat(16)) {
+ const node = this.startNodeAt(startLoc);
+ node.object = expr;
+ if (this.match(138)) {
+ this.classScope.usePrivateName(this.state.value, this.state.startLoc);
+ node.property = this.parsePrivateName();
+ } else {
+ node.property = this.parseIdentifier(true);
+ }
+ node.computed = false;
+ expr = this.finishNode(node, "MemberExpression");
+ }
+ node.expression = this.parseMaybeDecoratorArguments(expr);
+ }
+ } else {
+ node.expression = this.parseExprSubscripts();
+ }
+ return this.finishNode(node, "Decorator");
+ }
+ parseMaybeDecoratorArguments(expr) {
+ if (this.eat(10)) {
+ const node = this.startNodeAtNode(expr);
+ node.callee = expr;
+ node.arguments = this.parseCallExpressionArguments(11, false);
+ this.toReferencedList(node.arguments);
+ return this.finishNode(node, "CallExpression");
+ }
+ return expr;
+ }
+ parseBreakContinueStatement(node, isBreak) {
+ this.next();
+ if (this.isLineTerminator()) {
+ node.label = null;
+ } else {
+ node.label = this.parseIdentifier();
+ this.semicolon();
+ }
+ this.verifyBreakContinue(node, isBreak);
+ return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement");
+ }
+ verifyBreakContinue(node, isBreak) {
+ let i;
+ for (i = 0; i < this.state.labels.length; ++i) {
+ const lab = this.state.labels[i];
+ if (node.label == null || lab.name === node.label.name) {
+ if (lab.kind != null && (isBreak || lab.kind === 1)) {
+ break;
+ }
+ if (node.label && isBreak) break;
+ }
+ }
+ if (i === this.state.labels.length) {
+ const type = isBreak ? "BreakStatement" : "ContinueStatement";
+ this.raise(Errors.IllegalBreakContinue, node, {
+ type
+ });
+ }
+ }
+ parseDebuggerStatement(node) {
+ this.next();
+ this.semicolon();
+ return this.finishNode(node, "DebuggerStatement");
+ }
+ parseHeaderExpression() {
+ this.expect(10);
+ const val = this.parseExpression();
+ this.expect(11);
+ return val;
+ }
+ parseDoWhileStatement(node) {
+ this.next();
+ this.state.labels.push(loopLabel);
+ node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement());
+ this.state.labels.pop();
+ this.expect(92);
+ node.test = this.parseHeaderExpression();
+ this.eat(13);
+ return this.finishNode(node, "DoWhileStatement");
+ }
+ parseForStatement(node) {
+ this.next();
+ this.state.labels.push(loopLabel);
+ let awaitAt = null;
+ if (this.isContextual(96) && this.recordAwaitIfAllowed()) {
+ awaitAt = this.state.startLoc;
+ this.next();
+ }
+ this.scope.enter(0);
+ this.expect(10);
+ if (this.match(13)) {
+ if (awaitAt !== null) {
+ this.unexpected(awaitAt);
+ }
+ return this.parseFor(node, null);
+ }
+ const startsWithLet = this.isContextual(100);
+ {
+ const startsWithAwaitUsing = this.isContextual(96) && this.startsAwaitUsing();
+ const starsWithUsingDeclaration = startsWithAwaitUsing || this.isContextual(107) && this.startsUsingForOf();
+ const isLetOrUsing = startsWithLet && this.hasFollowingBindingAtom() || starsWithUsingDeclaration;
+ if (this.match(74) || this.match(75) || isLetOrUsing) {
+ const initNode = this.startNode();
+ let kind;
+ if (startsWithAwaitUsing) {
+ kind = "await using";
+ if (!this.recordAwaitIfAllowed()) {
+ this.raise(Errors.AwaitUsingNotInAsyncContext, this.state.startLoc);
+ }
+ this.next();
+ } else {
+ kind = this.state.value;
+ }
+ this.next();
+ this.parseVar(initNode, true, kind);
+ const init = this.finishNode(initNode, "VariableDeclaration");
+ const isForIn = this.match(58);
+ if (isForIn && starsWithUsingDeclaration) {
+ this.raise(Errors.ForInUsing, init);
+ }
+ if ((isForIn || this.isContextual(102)) && init.declarations.length === 1) {
+ return this.parseForIn(node, init, awaitAt);
+ }
+ if (awaitAt !== null) {
+ this.unexpected(awaitAt);
+ }
+ return this.parseFor(node, init);
+ }
+ }
+ const startsWithAsync = this.isContextual(95);
+ const refExpressionErrors = new ExpressionErrors();
+ const init = this.parseExpression(true, refExpressionErrors);
+ const isForOf = this.isContextual(102);
+ if (isForOf) {
+ if (startsWithLet) {
+ this.raise(Errors.ForOfLet, init);
+ }
+ if (awaitAt === null && startsWithAsync && init.type === "Identifier") {
+ this.raise(Errors.ForOfAsync, init);
+ }
+ }
+ if (isForOf || this.match(58)) {
+ this.checkDestructuringPrivate(refExpressionErrors);
+ this.toAssignable(init, true);
+ const type = isForOf ? "ForOfStatement" : "ForInStatement";
+ this.checkLVal(init, {
+ type
+ });
+ return this.parseForIn(node, init, awaitAt);
+ } else {
+ this.checkExpressionErrors(refExpressionErrors, true);
+ }
+ if (awaitAt !== null) {
+ this.unexpected(awaitAt);
+ }
+ return this.parseFor(node, init);
+ }
+ parseFunctionStatement(node, isAsync, isHangingDeclaration) {
+ this.next();
+ return this.parseFunction(node, 1 | (isHangingDeclaration ? 2 : 0) | (isAsync ? 8 : 0));
+ }
+ parseIfStatement(node) {
+ this.next();
+ node.test = this.parseHeaderExpression();
+ node.consequent = this.parseStatementOrSloppyAnnexBFunctionDeclaration();
+ node.alternate = this.eat(66) ? this.parseStatementOrSloppyAnnexBFunctionDeclaration() : null;
+ return this.finishNode(node, "IfStatement");
+ }
+ parseReturnStatement(node) {
+ if (!this.prodParam.hasReturn && !this.options.allowReturnOutsideFunction) {
+ this.raise(Errors.IllegalReturn, this.state.startLoc);
+ }
+ this.next();
+ if (this.isLineTerminator()) {
+ node.argument = null;
+ } else {
+ node.argument = this.parseExpression();
+ this.semicolon();
+ }
+ return this.finishNode(node, "ReturnStatement");
+ }
+ parseSwitchStatement(node) {
+ this.next();
+ node.discriminant = this.parseHeaderExpression();
+ const cases = node.cases = [];
+ this.expect(5);
+ this.state.labels.push(switchLabel);
+ this.scope.enter(0);
+ let cur;
+ for (let sawDefault; !this.match(8);) {
+ if (this.match(61) || this.match(65)) {
+ const isCase = this.match(61);
+ if (cur) this.finishNode(cur, "SwitchCase");
+ cases.push(cur = this.startNode());
+ cur.consequent = [];
+ this.next();
+ if (isCase) {
+ cur.test = this.parseExpression();
+ } else {
+ if (sawDefault) {
+ this.raise(Errors.MultipleDefaultsInSwitch, this.state.lastTokStartLoc);
+ }
+ sawDefault = true;
+ cur.test = null;
+ }
+ this.expect(14);
+ } else {
+ if (cur) {
+ cur.consequent.push(this.parseStatementListItem());
+ } else {
+ this.unexpected();
+ }
+ }
+ }
+ this.scope.exit();
+ if (cur) this.finishNode(cur, "SwitchCase");
+ this.next();
+ this.state.labels.pop();
+ return this.finishNode(node, "SwitchStatement");
+ }
+ parseThrowStatement(node) {
+ this.next();
+ if (this.hasPrecedingLineBreak()) {
+ this.raise(Errors.NewlineAfterThrow, this.state.lastTokEndLoc);
+ }
+ node.argument = this.parseExpression();
+ this.semicolon();
+ return this.finishNode(node, "ThrowStatement");
+ }
+ parseCatchClauseParam() {
+ const param = this.parseBindingAtom();
+ this.scope.enter(this.options.annexB && param.type === "Identifier" ? 8 : 0);
+ this.checkLVal(param, {
+ type: "CatchClause"
+ }, 9);
+ return param;
+ }
+ parseTryStatement(node) {
+ this.next();
+ node.block = this.parseBlock();
+ node.handler = null;
+ if (this.match(62)) {
+ const clause = this.startNode();
+ this.next();
+ if (this.match(10)) {
+ this.expect(10);
+ clause.param = this.parseCatchClauseParam();
+ this.expect(11);
+ } else {
+ clause.param = null;
+ this.scope.enter(0);
+ }
+ clause.body = this.withSmartMixTopicForbiddingContext(() => this.parseBlock(false, false));
+ this.scope.exit();
+ node.handler = this.finishNode(clause, "CatchClause");
+ }
+ node.finalizer = this.eat(67) ? this.parseBlock() : null;
+ if (!node.handler && !node.finalizer) {
+ this.raise(Errors.NoCatchOrFinally, node);
+ }
+ return this.finishNode(node, "TryStatement");
+ }
+ parseVarStatement(node, kind, allowMissingInitializer = false) {
+ this.next();
+ this.parseVar(node, false, kind, allowMissingInitializer);
+ this.semicolon();
+ return this.finishNode(node, "VariableDeclaration");
+ }
+ parseWhileStatement(node) {
+ this.next();
+ node.test = this.parseHeaderExpression();
+ this.state.labels.push(loopLabel);
+ node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement());
+ this.state.labels.pop();
+ return this.finishNode(node, "WhileStatement");
+ }
+ parseWithStatement(node) {
+ if (this.state.strict) {
+ this.raise(Errors.StrictWith, this.state.startLoc);
+ }
+ this.next();
+ node.object = this.parseHeaderExpression();
+ node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement());
+ return this.finishNode(node, "WithStatement");
+ }
+ parseEmptyStatement(node) {
+ this.next();
+ return this.finishNode(node, "EmptyStatement");
+ }
+ parseLabeledStatement(node, maybeName, expr, flags) {
+ for (const label of this.state.labels) {
+ if (label.name === maybeName) {
+ this.raise(Errors.LabelRedeclaration, expr, {
+ labelName: maybeName
+ });
+ }
+ }
+ const kind = tokenIsLoop(this.state.type) ? 1 : this.match(71) ? 2 : null;
+ for (let i = this.state.labels.length - 1; i >= 0; i--) {
+ const label = this.state.labels[i];
+ if (label.statementStart === node.start) {
+ label.statementStart = this.state.start;
+ label.kind = kind;
+ } else {
+ break;
+ }
+ }
+ this.state.labels.push({
+ name: maybeName,
+ kind: kind,
+ statementStart: this.state.start
+ });
+ node.body = flags & 8 ? this.parseStatementOrSloppyAnnexBFunctionDeclaration(true) : this.parseStatement();
+ this.state.labels.pop();
+ node.label = expr;
+ return this.finishNode(node, "LabeledStatement");
+ }
+ parseExpressionStatement(node, expr, decorators) {
+ node.expression = expr;
+ this.semicolon();
+ return this.finishNode(node, "ExpressionStatement");
+ }
+ parseBlock(allowDirectives = false, createNewLexicalScope = true, afterBlockParse) {
+ const node = this.startNode();
+ if (allowDirectives) {
+ this.state.strictErrors.clear();
+ }
+ this.expect(5);
+ if (createNewLexicalScope) {
+ this.scope.enter(0);
+ }
+ this.parseBlockBody(node, allowDirectives, false, 8, afterBlockParse);
+ if (createNewLexicalScope) {
+ this.scope.exit();
+ }
+ return this.finishNode(node, "BlockStatement");
+ }
+ isValidDirective(stmt) {
+ return stmt.type === "ExpressionStatement" && stmt.expression.type === "StringLiteral" && !stmt.expression.extra.parenthesized;
+ }
+ parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) {
+ const body = node.body = [];
+ const directives = node.directives = [];
+ this.parseBlockOrModuleBlockBody(body, allowDirectives ? directives : undefined, topLevel, end, afterBlockParse);
+ }
+ parseBlockOrModuleBlockBody(body, directives, topLevel, end, afterBlockParse) {
+ const oldStrict = this.state.strict;
+ let hasStrictModeDirective = false;
+ let parsedNonDirective = false;
+ while (!this.match(end)) {
+ const stmt = topLevel ? this.parseModuleItem() : this.parseStatementListItem();
+ if (directives && !parsedNonDirective) {
+ if (this.isValidDirective(stmt)) {
+ const directive = this.stmtToDirective(stmt);
+ directives.push(directive);
+ if (!hasStrictModeDirective && directive.value.value === "use strict") {
+ hasStrictModeDirective = true;
+ this.setStrict(true);
+ }
+ continue;
+ }
+ parsedNonDirective = true;
+ this.state.strictErrors.clear();
+ }
+ body.push(stmt);
+ }
+ afterBlockParse == null || afterBlockParse.call(this, hasStrictModeDirective);
+ if (!oldStrict) {
+ this.setStrict(false);
+ }
+ this.next();
+ }
+ parseFor(node, init) {
+ node.init = init;
+ this.semicolon(false);
+ node.test = this.match(13) ? null : this.parseExpression();
+ this.semicolon(false);
+ node.update = this.match(11) ? null : this.parseExpression();
+ this.expect(11);
+ node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement());
+ this.scope.exit();
+ this.state.labels.pop();
+ return this.finishNode(node, "ForStatement");
+ }
+ parseForIn(node, init, awaitAt) {
+ const isForIn = this.match(58);
+ this.next();
+ if (isForIn) {
+ if (awaitAt !== null) this.unexpected(awaitAt);
+ } else {
+ node.await = awaitAt !== null;
+ }
+ if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || !this.options.annexB || this.state.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) {
+ this.raise(Errors.ForInOfLoopInitializer, init, {
+ type: isForIn ? "ForInStatement" : "ForOfStatement"
+ });
+ }
+ if (init.type === "AssignmentPattern") {
+ this.raise(Errors.InvalidLhs, init, {
+ ancestor: {
+ type: "ForStatement"
+ }
+ });
+ }
+ node.left = init;
+ node.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn();
+ this.expect(11);
+ node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement());
+ this.scope.exit();
+ this.state.labels.pop();
+ return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement");
+ }
+ parseVar(node, isFor, kind, allowMissingInitializer = false) {
+ const declarations = node.declarations = [];
+ node.kind = kind;
+ for (;;) {
+ const decl = this.startNode();
+ this.parseVarId(decl, kind);
+ decl.init = !this.eat(29) ? null : isFor ? this.parseMaybeAssignDisallowIn() : this.parseMaybeAssignAllowIn();
+ if (decl.init === null && !allowMissingInitializer) {
+ if (decl.id.type !== "Identifier" && !(isFor && (this.match(58) || this.isContextual(102)))) {
+ this.raise(Errors.DeclarationMissingInitializer, this.state.lastTokEndLoc, {
+ kind: "destructuring"
+ });
+ } else if ((kind === "const" || kind === "using" || kind === "await using") && !(this.match(58) || this.isContextual(102))) {
+ this.raise(Errors.DeclarationMissingInitializer, this.state.lastTokEndLoc, {
+ kind
+ });
+ }
+ }
+ declarations.push(this.finishNode(decl, "VariableDeclarator"));
+ if (!this.eat(12)) break;
+ }
+ return node;
+ }
+ parseVarId(decl, kind) {
+ const id = this.parseBindingAtom();
+ if (kind === "using" || kind === "await using") {
+ if (id.type === "ArrayPattern" || id.type === "ObjectPattern") {
+ this.raise(Errors.UsingDeclarationHasBindingPattern, id.loc.start);
+ }
+ }
+ this.checkLVal(id, {
+ type: "VariableDeclarator"
+ }, kind === "var" ? 5 : 8201);
+ decl.id = id;
+ }
+ parseAsyncFunctionExpression(node) {
+ return this.parseFunction(node, 8);
+ }
+ parseFunction(node, flags = 0) {
+ const hangingDeclaration = flags & 2;
+ const isDeclaration = !!(flags & 1);
+ const requireId = isDeclaration && !(flags & 4);
+ const isAsync = !!(flags & 8);
+ this.initFunction(node, isAsync);
+ if (this.match(55)) {
+ if (hangingDeclaration) {
+ this.raise(Errors.GeneratorInSingleStatementContext, this.state.startLoc);
+ }
+ this.next();
+ node.generator = true;
+ }
+ if (isDeclaration) {
+ node.id = this.parseFunctionId(requireId);
+ }
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ this.state.maybeInArrowParameters = false;
+ this.scope.enter(2);
+ this.prodParam.enter(functionFlags(isAsync, node.generator));
+ if (!isDeclaration) {
+ node.id = this.parseFunctionId();
+ }
+ this.parseFunctionParams(node, false);
+ this.withSmartMixTopicForbiddingContext(() => {
+ this.parseFunctionBodyAndFinish(node, isDeclaration ? "FunctionDeclaration" : "FunctionExpression");
+ });
+ this.prodParam.exit();
+ this.scope.exit();
+ if (isDeclaration && !hangingDeclaration) {
+ this.registerFunctionStatementId(node);
+ }
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ return node;
+ }
+ parseFunctionId(requireId) {
+ return requireId || tokenIsIdentifier(this.state.type) ? this.parseIdentifier() : null;
+ }
+ parseFunctionParams(node, isConstructor) {
+ this.expect(10);
+ this.expressionScope.enter(newParameterDeclarationScope());
+ node.params = this.parseBindingList(11, 41, 2 | (isConstructor ? 4 : 0));
+ this.expressionScope.exit();
+ }
+ registerFunctionStatementId(node) {
+ if (!node.id) return;
+ this.scope.declareName(node.id.name, !this.options.annexB || this.state.strict || node.generator || node.async ? this.scope.treatFunctionsAsVar ? 5 : 8201 : 17, node.id.loc.start);
+ }
+ parseClass(node, isStatement, optionalId) {
+ this.next();
+ const oldStrict = this.state.strict;
+ this.state.strict = true;
+ this.parseClassId(node, isStatement, optionalId);
+ this.parseClassSuper(node);
+ node.body = this.parseClassBody(!!node.superClass, oldStrict);
+ return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression");
+ }
+ isClassProperty() {
+ return this.match(29) || this.match(13) || this.match(8);
+ }
+ isClassMethod() {
+ return this.match(10);
+ }
+ nameIsConstructor(key) {
+ return key.type === "Identifier" && key.name === "constructor" || key.type === "StringLiteral" && key.value === "constructor";
+ }
+ isNonstaticConstructor(method) {
+ return !method.computed && !method.static && this.nameIsConstructor(method.key);
+ }
+ parseClassBody(hadSuperClass, oldStrict) {
+ this.classScope.enter();
+ const state = {
+ hadConstructor: false,
+ hadSuperClass
+ };
+ let decorators = [];
+ const classBody = this.startNode();
+ classBody.body = [];
+ this.expect(5);
+ this.withSmartMixTopicForbiddingContext(() => {
+ while (!this.match(8)) {
+ if (this.eat(13)) {
+ if (decorators.length > 0) {
+ throw this.raise(Errors.DecoratorSemicolon, this.state.lastTokEndLoc);
+ }
+ continue;
+ }
+ if (this.match(26)) {
+ decorators.push(this.parseDecorator());
+ continue;
+ }
+ const member = this.startNode();
+ if (decorators.length) {
+ member.decorators = decorators;
+ this.resetStartLocationFromNode(member, decorators[0]);
+ decorators = [];
+ }
+ this.parseClassMember(classBody, member, state);
+ if (member.kind === "constructor" && member.decorators && member.decorators.length > 0) {
+ this.raise(Errors.DecoratorConstructor, member);
+ }
+ }
+ });
+ this.state.strict = oldStrict;
+ this.next();
+ if (decorators.length) {
+ throw this.raise(Errors.TrailingDecorator, this.state.startLoc);
+ }
+ this.classScope.exit();
+ return this.finishNode(classBody, "ClassBody");
+ }
+ parseClassMemberFromModifier(classBody, member) {
+ const key = this.parseIdentifier(true);
+ if (this.isClassMethod()) {
+ const method = member;
+ method.kind = "method";
+ method.computed = false;
+ method.key = key;
+ method.static = false;
+ this.pushClassMethod(classBody, method, false, false, false, false);
+ return true;
+ } else if (this.isClassProperty()) {
+ const prop = member;
+ prop.computed = false;
+ prop.key = key;
+ prop.static = false;
+ classBody.body.push(this.parseClassProperty(prop));
+ return true;
+ }
+ this.resetPreviousNodeTrailingComments(key);
+ return false;
+ }
+ parseClassMember(classBody, member, state) {
+ const isStatic = this.isContextual(106);
+ if (isStatic) {
+ if (this.parseClassMemberFromModifier(classBody, member)) {
+ return;
+ }
+ if (this.eat(5)) {
+ this.parseClassStaticBlock(classBody, member);
+ return;
+ }
+ }
+ this.parseClassMemberWithIsStatic(classBody, member, state, isStatic);
+ }
+ parseClassMemberWithIsStatic(classBody, member, state, isStatic) {
+ const publicMethod = member;
+ const privateMethod = member;
+ const publicProp = member;
+ const privateProp = member;
+ const accessorProp = member;
+ const method = publicMethod;
+ const publicMember = publicMethod;
+ member.static = isStatic;
+ this.parsePropertyNamePrefixOperator(member);
+ if (this.eat(55)) {
+ method.kind = "method";
+ const isPrivateName = this.match(138);
+ this.parseClassElementName(method);
+ if (isPrivateName) {
+ this.pushClassPrivateMethod(classBody, privateMethod, true, false);
+ return;
+ }
+ if (this.isNonstaticConstructor(publicMethod)) {
+ this.raise(Errors.ConstructorIsGenerator, publicMethod.key);
+ }
+ this.pushClassMethod(classBody, publicMethod, true, false, false, false);
+ return;
+ }
+ const isContextual = !this.state.containsEsc && tokenIsIdentifier(this.state.type);
+ const key = this.parseClassElementName(member);
+ const maybeContextualKw = isContextual ? key.name : null;
+ const isPrivate = this.isPrivateName(key);
+ const maybeQuestionTokenStartLoc = this.state.startLoc;
+ this.parsePostMemberNameModifiers(publicMember);
+ if (this.isClassMethod()) {
+ method.kind = "method";
+ if (isPrivate) {
+ this.pushClassPrivateMethod(classBody, privateMethod, false, false);
+ return;
+ }
+ const isConstructor = this.isNonstaticConstructor(publicMethod);
+ let allowsDirectSuper = false;
+ if (isConstructor) {
+ publicMethod.kind = "constructor";
+ if (state.hadConstructor && !this.hasPlugin("typescript")) {
+ this.raise(Errors.DuplicateConstructor, key);
+ }
+ if (isConstructor && this.hasPlugin("typescript") && member.override) {
+ this.raise(Errors.OverrideOnConstructor, key);
+ }
+ state.hadConstructor = true;
+ allowsDirectSuper = state.hadSuperClass;
+ }
+ this.pushClassMethod(classBody, publicMethod, false, false, isConstructor, allowsDirectSuper);
+ } else if (this.isClassProperty()) {
+ if (isPrivate) {
+ this.pushClassPrivateProperty(classBody, privateProp);
+ } else {
+ this.pushClassProperty(classBody, publicProp);
+ }
+ } else if (maybeContextualKw === "async" && !this.isLineTerminator()) {
+ this.resetPreviousNodeTrailingComments(key);
+ const isGenerator = this.eat(55);
+ if (publicMember.optional) {
+ this.unexpected(maybeQuestionTokenStartLoc);
+ }
+ method.kind = "method";
+ const isPrivate = this.match(138);
+ this.parseClassElementName(method);
+ this.parsePostMemberNameModifiers(publicMember);
+ if (isPrivate) {
+ this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, true);
+ } else {
+ if (this.isNonstaticConstructor(publicMethod)) {
+ this.raise(Errors.ConstructorIsAsync, publicMethod.key);
+ }
+ this.pushClassMethod(classBody, publicMethod, isGenerator, true, false, false);
+ }
+ } else if ((maybeContextualKw === "get" || maybeContextualKw === "set") && !(this.match(55) && this.isLineTerminator())) {
+ this.resetPreviousNodeTrailingComments(key);
+ method.kind = maybeContextualKw;
+ const isPrivate = this.match(138);
+ this.parseClassElementName(publicMethod);
+ if (isPrivate) {
+ this.pushClassPrivateMethod(classBody, privateMethod, false, false);
+ } else {
+ if (this.isNonstaticConstructor(publicMethod)) {
+ this.raise(Errors.ConstructorIsAccessor, publicMethod.key);
+ }
+ this.pushClassMethod(classBody, publicMethod, false, false, false, false);
+ }
+ this.checkGetterSetterParams(publicMethod);
+ } else if (maybeContextualKw === "accessor" && !this.isLineTerminator()) {
+ this.expectPlugin("decoratorAutoAccessors");
+ this.resetPreviousNodeTrailingComments(key);
+ const isPrivate = this.match(138);
+ this.parseClassElementName(publicProp);
+ this.pushClassAccessorProperty(classBody, accessorProp, isPrivate);
+ } else if (this.isLineTerminator()) {
+ if (isPrivate) {
+ this.pushClassPrivateProperty(classBody, privateProp);
+ } else {
+ this.pushClassProperty(classBody, publicProp);
+ }
+ } else {
+ this.unexpected();
+ }
+ }
+ parseClassElementName(member) {
+ const {
+ type,
+ value
+ } = this.state;
+ if ((type === 132 || type === 133) && member.static && value === "prototype") {
+ this.raise(Errors.StaticPrototype, this.state.startLoc);
+ }
+ if (type === 138) {
+ if (value === "constructor") {
+ this.raise(Errors.ConstructorClassPrivateField, this.state.startLoc);
+ }
+ const key = this.parsePrivateName();
+ member.key = key;
+ return key;
+ }
+ this.parsePropertyName(member);
+ return member.key;
+ }
+ parseClassStaticBlock(classBody, member) {
+ var _member$decorators;
+ this.scope.enter(64 | 128 | 16);
+ const oldLabels = this.state.labels;
+ this.state.labels = [];
+ this.prodParam.enter(0);
+ const body = member.body = [];
+ this.parseBlockOrModuleBlockBody(body, undefined, false, 8);
+ this.prodParam.exit();
+ this.scope.exit();
+ this.state.labels = oldLabels;
+ classBody.body.push(this.finishNode(member, "StaticBlock"));
+ if ((_member$decorators = member.decorators) != null && _member$decorators.length) {
+ this.raise(Errors.DecoratorStaticBlock, member);
+ }
+ }
+ pushClassProperty(classBody, prop) {
+ if (!prop.computed && this.nameIsConstructor(prop.key)) {
+ this.raise(Errors.ConstructorClassField, prop.key);
+ }
+ classBody.body.push(this.parseClassProperty(prop));
+ }
+ pushClassPrivateProperty(classBody, prop) {
+ const node = this.parseClassPrivateProperty(prop);
+ classBody.body.push(node);
+ this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), 0, node.key.loc.start);
+ }
+ pushClassAccessorProperty(classBody, prop, isPrivate) {
+ if (!isPrivate && !prop.computed && this.nameIsConstructor(prop.key)) {
+ this.raise(Errors.ConstructorClassField, prop.key);
+ }
+ const node = this.parseClassAccessorProperty(prop);
+ classBody.body.push(node);
+ if (isPrivate) {
+ this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), 0, node.key.loc.start);
+ }
+ }
+ pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
+ classBody.body.push(this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true));
+ }
+ pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {
+ const node = this.parseMethod(method, isGenerator, isAsync, false, false, "ClassPrivateMethod", true);
+ classBody.body.push(node);
+ const kind = node.kind === "get" ? node.static ? 6 : 2 : node.kind === "set" ? node.static ? 5 : 1 : 0;
+ this.declareClassPrivateMethodInScope(node, kind);
+ }
+ declareClassPrivateMethodInScope(node, kind) {
+ this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), kind, node.key.loc.start);
+ }
+ parsePostMemberNameModifiers(methodOrProp) {}
+ parseClassPrivateProperty(node) {
+ this.parseInitializer(node);
+ this.semicolon();
+ return this.finishNode(node, "ClassPrivateProperty");
+ }
+ parseClassProperty(node) {
+ this.parseInitializer(node);
+ this.semicolon();
+ return this.finishNode(node, "ClassProperty");
+ }
+ parseClassAccessorProperty(node) {
+ this.parseInitializer(node);
+ this.semicolon();
+ return this.finishNode(node, "ClassAccessorProperty");
+ }
+ parseInitializer(node) {
+ this.scope.enter(64 | 16);
+ this.expressionScope.enter(newExpressionScope());
+ this.prodParam.enter(0);
+ node.value = this.eat(29) ? this.parseMaybeAssignAllowIn() : null;
+ this.expressionScope.exit();
+ this.prodParam.exit();
+ this.scope.exit();
+ }
+ parseClassId(node, isStatement, optionalId, bindingType = 8331) {
+ if (tokenIsIdentifier(this.state.type)) {
+ node.id = this.parseIdentifier();
+ if (isStatement) {
+ this.declareNameFromIdentifier(node.id, bindingType);
+ }
+ } else {
+ if (optionalId || !isStatement) {
+ node.id = null;
+ } else {
+ throw this.raise(Errors.MissingClassName, this.state.startLoc);
+ }
+ }
+ }
+ parseClassSuper(node) {
+ node.superClass = this.eat(81) ? this.parseExprSubscripts() : null;
+ }
+ parseExport(node, decorators) {
+ const maybeDefaultIdentifier = this.parseMaybeImportPhase(node, true);
+ const hasDefault = this.maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier);
+ const parseAfterDefault = !hasDefault || this.eat(12);
+ const hasStar = parseAfterDefault && this.eatExportStar(node);
+ const hasNamespace = hasStar && this.maybeParseExportNamespaceSpecifier(node);
+ const parseAfterNamespace = parseAfterDefault && (!hasNamespace || this.eat(12));
+ const isFromRequired = hasDefault || hasStar;
+ if (hasStar && !hasNamespace) {
+ if (hasDefault) this.unexpected();
+ if (decorators) {
+ throw this.raise(Errors.UnsupportedDecoratorExport, node);
+ }
+ this.parseExportFrom(node, true);
+ return this.finishNode(node, "ExportAllDeclaration");
+ }
+ const hasSpecifiers = this.maybeParseExportNamedSpecifiers(node);
+ if (hasDefault && parseAfterDefault && !hasStar && !hasSpecifiers) {
+ this.unexpected(null, 5);
+ }
+ if (hasNamespace && parseAfterNamespace) {
+ this.unexpected(null, 98);
+ }
+ let hasDeclaration;
+ if (isFromRequired || hasSpecifiers) {
+ hasDeclaration = false;
+ if (decorators) {
+ throw this.raise(Errors.UnsupportedDecoratorExport, node);
+ }
+ this.parseExportFrom(node, isFromRequired);
+ } else {
+ hasDeclaration = this.maybeParseExportDeclaration(node);
+ }
+ if (isFromRequired || hasSpecifiers || hasDeclaration) {
+ var _node2$declaration;
+ const node2 = node;
+ this.checkExport(node2, true, false, !!node2.source);
+ if (((_node2$declaration = node2.declaration) == null ? void 0 : _node2$declaration.type) === "ClassDeclaration") {
+ this.maybeTakeDecorators(decorators, node2.declaration, node2);
+ } else if (decorators) {
+ throw this.raise(Errors.UnsupportedDecoratorExport, node);
+ }
+ return this.finishNode(node2, "ExportNamedDeclaration");
+ }
+ if (this.eat(65)) {
+ const node2 = node;
+ const decl = this.parseExportDefaultExpression();
+ node2.declaration = decl;
+ if (decl.type === "ClassDeclaration") {
+ this.maybeTakeDecorators(decorators, decl, node2);
+ } else if (decorators) {
+ throw this.raise(Errors.UnsupportedDecoratorExport, node);
+ }
+ this.checkExport(node2, true, true);
+ return this.finishNode(node2, "ExportDefaultDeclaration");
+ }
+ this.unexpected(null, 5);
+ }
+ eatExportStar(node) {
+ return this.eat(55);
+ }
+ maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier) {
+ if (maybeDefaultIdentifier || this.isExportDefaultSpecifier()) {
+ this.expectPlugin("exportDefaultFrom", maybeDefaultIdentifier == null ? void 0 : maybeDefaultIdentifier.loc.start);
+ const id = maybeDefaultIdentifier || this.parseIdentifier(true);
+ const specifier = this.startNodeAtNode(id);
+ specifier.exported = id;
+ node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")];
+ return true;
+ }
+ return false;
+ }
+ maybeParseExportNamespaceSpecifier(node) {
+ if (this.isContextual(93)) {
+ var _ref, _ref$specifiers;
+ (_ref$specifiers = (_ref = node).specifiers) != null ? _ref$specifiers : _ref.specifiers = [];
+ const specifier = this.startNodeAt(this.state.lastTokStartLoc);
+ this.next();
+ specifier.exported = this.parseModuleExportName();
+ node.specifiers.push(this.finishNode(specifier, "ExportNamespaceSpecifier"));
+ return true;
+ }
+ return false;
+ }
+ maybeParseExportNamedSpecifiers(node) {
+ if (this.match(5)) {
+ const node2 = node;
+ if (!node2.specifiers) node2.specifiers = [];
+ const isTypeExport = node2.exportKind === "type";
+ node2.specifiers.push(...this.parseExportSpecifiers(isTypeExport));
+ node2.source = null;
+ node2.declaration = null;
+ if (this.hasPlugin("importAssertions")) {
+ node2.assertions = [];
+ }
+ return true;
+ }
+ return false;
+ }
+ maybeParseExportDeclaration(node) {
+ if (this.shouldParseExportDeclaration()) {
+ node.specifiers = [];
+ node.source = null;
+ if (this.hasPlugin("importAssertions")) {
+ node.assertions = [];
+ }
+ node.declaration = this.parseExportDeclaration(node);
+ return true;
+ }
+ return false;
+ }
+ isAsyncFunction() {
+ if (!this.isContextual(95)) return false;
+ const next = this.nextTokenInLineStart();
+ return this.isUnparsedContextual(next, "function");
+ }
+ parseExportDefaultExpression() {
+ const expr = this.startNode();
+ if (this.match(68)) {
+ this.next();
+ return this.parseFunction(expr, 1 | 4);
+ } else if (this.isAsyncFunction()) {
+ this.next();
+ this.next();
+ return this.parseFunction(expr, 1 | 4 | 8);
+ }
+ if (this.match(80)) {
+ return this.parseClass(expr, true, true);
+ }
+ if (this.match(26)) {
+ if (this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport") === true) {
+ this.raise(Errors.DecoratorBeforeExport, this.state.startLoc);
+ }
+ return this.parseClass(this.maybeTakeDecorators(this.parseDecorators(false), this.startNode()), true, true);
+ }
+ if (this.match(75) || this.match(74) || this.isLet()) {
+ throw this.raise(Errors.UnsupportedDefaultExport, this.state.startLoc);
+ }
+ const res = this.parseMaybeAssignAllowIn();
+ this.semicolon();
+ return res;
+ }
+ parseExportDeclaration(node) {
+ if (this.match(80)) {
+ const node = this.parseClass(this.startNode(), true, false);
+ return node;
+ }
+ return this.parseStatementListItem();
+ }
+ isExportDefaultSpecifier() {
+ const {
+ type
+ } = this.state;
+ if (tokenIsIdentifier(type)) {
+ if (type === 95 && !this.state.containsEsc || type === 100) {
+ return false;
+ }
+ if ((type === 130 || type === 129) && !this.state.containsEsc) {
+ const {
+ type: nextType
+ } = this.lookahead();
+ if (tokenIsIdentifier(nextType) && nextType !== 98 || nextType === 5) {
+ this.expectOnePlugin(["flow", "typescript"]);
+ return false;
+ }
+ }
+ } else if (!this.match(65)) {
+ return false;
+ }
+ const next = this.nextTokenStart();
+ const hasFrom = this.isUnparsedContextual(next, "from");
+ if (this.input.charCodeAt(next) === 44 || tokenIsIdentifier(this.state.type) && hasFrom) {
+ return true;
+ }
+ if (this.match(65) && hasFrom) {
+ const nextAfterFrom = this.input.charCodeAt(this.nextTokenStartSince(next + 4));
+ return nextAfterFrom === 34 || nextAfterFrom === 39;
+ }
+ return false;
+ }
+ parseExportFrom(node, expect) {
+ if (this.eatContextual(98)) {
+ node.source = this.parseImportSource();
+ this.checkExport(node);
+ this.maybeParseImportAttributes(node);
+ this.checkJSONModuleImport(node);
+ } else if (expect) {
+ this.unexpected();
+ }
+ this.semicolon();
+ }
+ shouldParseExportDeclaration() {
+ const {
+ type
+ } = this.state;
+ if (type === 26) {
+ this.expectOnePlugin(["decorators", "decorators-legacy"]);
+ if (this.hasPlugin("decorators")) {
+ if (this.getPluginOption("decorators", "decoratorsBeforeExport") === true) {
+ this.raise(Errors.DecoratorBeforeExport, this.state.startLoc);
+ }
+ return true;
+ }
+ }
+ if (this.isContextual(107)) {
+ this.raise(Errors.UsingDeclarationExport, this.state.startLoc);
+ return true;
+ }
+ if (this.isContextual(96) && this.startsAwaitUsing()) {
+ this.raise(Errors.UsingDeclarationExport, this.state.startLoc);
+ return true;
+ }
+ return type === 74 || type === 75 || type === 68 || type === 80 || this.isLet() || this.isAsyncFunction();
+ }
+ checkExport(node, checkNames, isDefault, isFrom) {
+ if (checkNames) {
+ var _node$specifiers;
+ if (isDefault) {
+ this.checkDuplicateExports(node, "default");
+ if (this.hasPlugin("exportDefaultFrom")) {
+ var _declaration$extra;
+ const declaration = node.declaration;
+ if (declaration.type === "Identifier" && declaration.name === "from" && declaration.end - declaration.start === 4 && !((_declaration$extra = declaration.extra) != null && _declaration$extra.parenthesized)) {
+ this.raise(Errors.ExportDefaultFromAsIdentifier, declaration);
+ }
+ }
+ } else if ((_node$specifiers = node.specifiers) != null && _node$specifiers.length) {
+ for (const specifier of node.specifiers) {
+ const {
+ exported
+ } = specifier;
+ const exportName = exported.type === "Identifier" ? exported.name : exported.value;
+ this.checkDuplicateExports(specifier, exportName);
+ if (!isFrom && specifier.local) {
+ const {
+ local
+ } = specifier;
+ if (local.type !== "Identifier") {
+ this.raise(Errors.ExportBindingIsString, specifier, {
+ localName: local.value,
+ exportName
+ });
+ } else {
+ this.checkReservedWord(local.name, local.loc.start, true, false);
+ this.scope.checkLocalExport(local);
+ }
+ }
+ }
+ } else if (node.declaration) {
+ const decl = node.declaration;
+ if (decl.type === "FunctionDeclaration" || decl.type === "ClassDeclaration") {
+ const {
+ id
+ } = decl;
+ if (!id) throw new Error("Assertion failure");
+ this.checkDuplicateExports(node, id.name);
+ } else if (decl.type === "VariableDeclaration") {
+ for (const declaration of decl.declarations) {
+ this.checkDeclaration(declaration.id);
+ }
+ }
+ }
+ }
+ }
+ checkDeclaration(node) {
+ if (node.type === "Identifier") {
+ this.checkDuplicateExports(node, node.name);
+ } else if (node.type === "ObjectPattern") {
+ for (const prop of node.properties) {
+ this.checkDeclaration(prop);
+ }
+ } else if (node.type === "ArrayPattern") {
+ for (const elem of node.elements) {
+ if (elem) {
+ this.checkDeclaration(elem);
+ }
+ }
+ } else if (node.type === "ObjectProperty") {
+ this.checkDeclaration(node.value);
+ } else if (node.type === "RestElement") {
+ this.checkDeclaration(node.argument);
+ } else if (node.type === "AssignmentPattern") {
+ this.checkDeclaration(node.left);
+ }
+ }
+ checkDuplicateExports(node, exportName) {
+ if (this.exportedIdentifiers.has(exportName)) {
+ if (exportName === "default") {
+ this.raise(Errors.DuplicateDefaultExport, node);
+ } else {
+ this.raise(Errors.DuplicateExport, node, {
+ exportName
+ });
+ }
+ }
+ this.exportedIdentifiers.add(exportName);
+ }
+ parseExportSpecifiers(isInTypeExport) {
+ const nodes = [];
+ let first = true;
+ this.expect(5);
+ while (!this.eat(8)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(12);
+ if (this.eat(8)) break;
+ }
+ const isMaybeTypeOnly = this.isContextual(130);
+ const isString = this.match(133);
+ const node = this.startNode();
+ node.local = this.parseModuleExportName();
+ nodes.push(this.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly));
+ }
+ return nodes;
+ }
+ parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly) {
+ if (this.eatContextual(93)) {
+ node.exported = this.parseModuleExportName();
+ } else if (isString) {
+ node.exported = cloneStringLiteral(node.local);
+ } else if (!node.exported) {
+ node.exported = cloneIdentifier(node.local);
+ }
+ return this.finishNode(node, "ExportSpecifier");
+ }
+ parseModuleExportName() {
+ if (this.match(133)) {
+ const result = this.parseStringLiteral(this.state.value);
+ const surrogate = loneSurrogate.exec(result.value);
+ if (surrogate) {
+ this.raise(Errors.ModuleExportNameHasLoneSurrogate, result, {
+ surrogateCharCode: surrogate[0].charCodeAt(0)
+ });
+ }
+ return result;
+ }
+ return this.parseIdentifier(true);
+ }
+ isJSONModuleImport(node) {
+ if (node.assertions != null) {
+ return node.assertions.some(({
+ key,
+ value
+ }) => {
+ return value.value === "json" && (key.type === "Identifier" ? key.name === "type" : key.value === "type");
+ });
+ }
+ return false;
+ }
+ checkImportReflection(node) {
+ const {
+ specifiers
+ } = node;
+ const singleBindingType = specifiers.length === 1 ? specifiers[0].type : null;
+ if (node.phase === "source") {
+ if (singleBindingType !== "ImportDefaultSpecifier") {
+ this.raise(Errors.SourcePhaseImportRequiresDefault, specifiers[0].loc.start);
+ }
+ } else if (node.phase === "defer") {
+ if (singleBindingType !== "ImportNamespaceSpecifier") {
+ this.raise(Errors.DeferImportRequiresNamespace, specifiers[0].loc.start);
+ }
+ } else if (node.module) {
+ var _node$assertions;
+ if (singleBindingType !== "ImportDefaultSpecifier") {
+ this.raise(Errors.ImportReflectionNotBinding, specifiers[0].loc.start);
+ }
+ if (((_node$assertions = node.assertions) == null ? void 0 : _node$assertions.length) > 0) {
+ this.raise(Errors.ImportReflectionHasAssertion, specifiers[0].loc.start);
+ }
+ }
+ }
+ checkJSONModuleImport(node) {
+ if (this.isJSONModuleImport(node) && node.type !== "ExportAllDeclaration") {
+ const {
+ specifiers
+ } = node;
+ if (specifiers != null) {
+ const nonDefaultNamedSpecifier = specifiers.find(specifier => {
+ let imported;
+ if (specifier.type === "ExportSpecifier") {
+ imported = specifier.local;
+ } else if (specifier.type === "ImportSpecifier") {
+ imported = specifier.imported;
+ }
+ if (imported !== undefined) {
+ return imported.type === "Identifier" ? imported.name !== "default" : imported.value !== "default";
+ }
+ });
+ if (nonDefaultNamedSpecifier !== undefined) {
+ this.raise(Errors.ImportJSONBindingNotDefault, nonDefaultNamedSpecifier.loc.start);
+ }
+ }
+ }
+ }
+ isPotentialImportPhase(isExport) {
+ if (isExport) return false;
+ return this.isContextual(105) || this.isContextual(97) || this.isContextual(127);
+ }
+ applyImportPhase(node, isExport, phase, loc) {
+ if (isExport) {
+ return;
+ }
+ if (phase === "module") {
+ this.expectPlugin("importReflection", loc);
+ node.module = true;
+ } else if (this.hasPlugin("importReflection")) {
+ node.module = false;
+ }
+ if (phase === "source") {
+ this.expectPlugin("sourcePhaseImports", loc);
+ node.phase = "source";
+ } else if (phase === "defer") {
+ this.expectPlugin("deferredImportEvaluation", loc);
+ node.phase = "defer";
+ } else if (this.hasPlugin("sourcePhaseImports")) {
+ node.phase = null;
+ }
+ }
+ parseMaybeImportPhase(node, isExport) {
+ if (!this.isPotentialImportPhase(isExport)) {
+ this.applyImportPhase(node, isExport, null);
+ return null;
+ }
+ const phaseIdentifier = this.parseIdentifier(true);
+ const {
+ type
+ } = this.state;
+ const isImportPhase = tokenIsKeywordOrIdentifier(type) ? type !== 98 || this.lookaheadCharCode() === 102 : type !== 12;
+ if (isImportPhase) {
+ this.resetPreviousIdentifierLeadingComments(phaseIdentifier);
+ this.applyImportPhase(node, isExport, phaseIdentifier.name, phaseIdentifier.loc.start);
+ return null;
+ } else {
+ this.applyImportPhase(node, isExport, null);
+ return phaseIdentifier;
+ }
+ }
+ isPrecedingIdImportPhase(phase) {
+ const {
+ type
+ } = this.state;
+ return tokenIsIdentifier(type) ? type !== 98 || this.lookaheadCharCode() === 102 : type !== 12;
+ }
+ parseImport(node) {
+ if (this.match(133)) {
+ return this.parseImportSourceAndAttributes(node);
+ }
+ return this.parseImportSpecifiersAndAfter(node, this.parseMaybeImportPhase(node, false));
+ }
+ parseImportSpecifiersAndAfter(node, maybeDefaultIdentifier) {
+ node.specifiers = [];
+ const hasDefault = this.maybeParseDefaultImportSpecifier(node, maybeDefaultIdentifier);
+ const parseNext = !hasDefault || this.eat(12);
+ const hasStar = parseNext && this.maybeParseStarImportSpecifier(node);
+ if (parseNext && !hasStar) this.parseNamedImportSpecifiers(node);
+ this.expectContextual(98);
+ return this.parseImportSourceAndAttributes(node);
+ }
+ parseImportSourceAndAttributes(node) {
+ var _node$specifiers2;
+ (_node$specifiers2 = node.specifiers) != null ? _node$specifiers2 : node.specifiers = [];
+ node.source = this.parseImportSource();
+ this.maybeParseImportAttributes(node);
+ this.checkImportReflection(node);
+ this.checkJSONModuleImport(node);
+ this.semicolon();
+ return this.finishNode(node, "ImportDeclaration");
+ }
+ parseImportSource() {
+ if (!this.match(133)) this.unexpected();
+ return this.parseExprAtom();
+ }
+ parseImportSpecifierLocal(node, specifier, type) {
+ specifier.local = this.parseIdentifier();
+ node.specifiers.push(this.finishImportSpecifier(specifier, type));
+ }
+ finishImportSpecifier(specifier, type, bindingType = 8201) {
+ this.checkLVal(specifier.local, {
+ type
+ }, bindingType);
+ return this.finishNode(specifier, type);
+ }
+ parseImportAttributes() {
+ this.expect(5);
+ const attrs = [];
+ const attrNames = new Set();
+ do {
+ if (this.match(8)) {
+ break;
+ }
+ const node = this.startNode();
+ const keyName = this.state.value;
+ if (attrNames.has(keyName)) {
+ this.raise(Errors.ModuleAttributesWithDuplicateKeys, this.state.startLoc, {
+ key: keyName
+ });
+ }
+ attrNames.add(keyName);
+ if (this.match(133)) {
+ node.key = this.parseStringLiteral(keyName);
+ } else {
+ node.key = this.parseIdentifier(true);
+ }
+ this.expect(14);
+ if (!this.match(133)) {
+ throw this.raise(Errors.ModuleAttributeInvalidValue, this.state.startLoc);
+ }
+ node.value = this.parseStringLiteral(this.state.value);
+ attrs.push(this.finishNode(node, "ImportAttribute"));
+ } while (this.eat(12));
+ this.expect(8);
+ return attrs;
+ }
+ parseModuleAttributes() {
+ const attrs = [];
+ const attributes = new Set();
+ do {
+ const node = this.startNode();
+ node.key = this.parseIdentifier(true);
+ if (node.key.name !== "type") {
+ this.raise(Errors.ModuleAttributeDifferentFromType, node.key);
+ }
+ if (attributes.has(node.key.name)) {
+ this.raise(Errors.ModuleAttributesWithDuplicateKeys, node.key, {
+ key: node.key.name
+ });
+ }
+ attributes.add(node.key.name);
+ this.expect(14);
+ if (!this.match(133)) {
+ throw this.raise(Errors.ModuleAttributeInvalidValue, this.state.startLoc);
+ }
+ node.value = this.parseStringLiteral(this.state.value);
+ attrs.push(this.finishNode(node, "ImportAttribute"));
+ } while (this.eat(12));
+ return attrs;
+ }
+ maybeParseImportAttributes(node) {
+ let attributes;
+ let useWith = false;
+ if (this.match(76)) {
+ if (this.hasPrecedingLineBreak() && this.lookaheadCharCode() === 40) {
+ return;
+ }
+ this.next();
+ {
+ if (this.hasPlugin("moduleAttributes")) {
+ attributes = this.parseModuleAttributes();
+ } else {
+ this.expectImportAttributesPlugin();
+ attributes = this.parseImportAttributes();
+ }
+ }
+ useWith = true;
+ } else if (this.isContextual(94) && !this.hasPrecedingLineBreak()) {
+ if (this.hasPlugin("importAttributes")) {
+ if (this.getPluginOption("importAttributes", "deprecatedAssertSyntax") !== true) {
+ this.raise(Errors.ImportAttributesUseAssert, this.state.startLoc);
+ }
+ this.addExtra(node, "deprecatedAssertSyntax", true);
+ } else {
+ this.expectOnePlugin(["importAttributes", "importAssertions"]);
+ }
+ this.next();
+ attributes = this.parseImportAttributes();
+ } else if (this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions")) {
+ attributes = [];
+ } else {
+ if (this.hasPlugin("moduleAttributes")) {
+ attributes = [];
+ } else return;
+ }
+ if (!useWith && this.hasPlugin("importAssertions")) {
+ node.assertions = attributes;
+ } else {
+ node.attributes = attributes;
+ }
+ }
+ maybeParseDefaultImportSpecifier(node, maybeDefaultIdentifier) {
+ if (maybeDefaultIdentifier) {
+ const specifier = this.startNodeAtNode(maybeDefaultIdentifier);
+ specifier.local = maybeDefaultIdentifier;
+ node.specifiers.push(this.finishImportSpecifier(specifier, "ImportDefaultSpecifier"));
+ return true;
+ } else if (tokenIsKeywordOrIdentifier(this.state.type)) {
+ this.parseImportSpecifierLocal(node, this.startNode(), "ImportDefaultSpecifier");
+ return true;
+ }
+ return false;
+ }
+ maybeParseStarImportSpecifier(node) {
+ if (this.match(55)) {
+ const specifier = this.startNode();
+ this.next();
+ this.expectContextual(93);
+ this.parseImportSpecifierLocal(node, specifier, "ImportNamespaceSpecifier");
+ return true;
+ }
+ return false;
+ }
+ parseNamedImportSpecifiers(node) {
+ let first = true;
+ this.expect(5);
+ while (!this.eat(8)) {
+ if (first) {
+ first = false;
+ } else {
+ if (this.eat(14)) {
+ throw this.raise(Errors.DestructureNamedImport, this.state.startLoc);
+ }
+ this.expect(12);
+ if (this.eat(8)) break;
+ }
+ const specifier = this.startNode();
+ const importedIsString = this.match(133);
+ const isMaybeTypeOnly = this.isContextual(130);
+ specifier.imported = this.parseModuleExportName();
+ const importSpecifier = this.parseImportSpecifier(specifier, importedIsString, node.importKind === "type" || node.importKind === "typeof", isMaybeTypeOnly, undefined);
+ node.specifiers.push(importSpecifier);
+ }
+ }
+ parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) {
+ if (this.eatContextual(93)) {
+ specifier.local = this.parseIdentifier();
+ } else {
+ const {
+ imported
+ } = specifier;
+ if (importedIsString) {
+ throw this.raise(Errors.ImportBindingIsString, specifier, {
+ importName: imported.value
+ });
+ }
+ this.checkReservedWord(imported.name, specifier.loc.start, true, true);
+ if (!specifier.local) {
+ specifier.local = cloneIdentifier(imported);
+ }
+ }
+ return this.finishImportSpecifier(specifier, "ImportSpecifier", bindingType);
+ }
+ isThisParam(param) {
+ return param.type === "Identifier" && param.name === "this";
+ }
+}
+class Parser extends StatementParser {
+ constructor(options, input, pluginsMap) {
+ options = getOptions(options);
+ super(options, input);
+ this.options = options;
+ this.initializeScopes();
+ this.plugins = pluginsMap;
+ this.filename = options.sourceFilename;
+ }
+ getScopeHandler() {
+ return ScopeHandler;
+ }
+ parse() {
+ this.enterInitialScopes();
+ const file = this.startNode();
+ const program = this.startNode();
+ this.nextToken();
+ file.errors = null;
+ this.parseTopLevel(file, program);
+ file.errors = this.state.errors;
+ file.comments.length = this.state.commentsLen;
+ return file;
+ }
+}
+function parse(input, options) {
+ var _options;
+ if (((_options = options) == null ? void 0 : _options.sourceType) === "unambiguous") {
+ options = Object.assign({}, options);
+ try {
+ options.sourceType = "module";
+ const parser = getParser(options, input);
+ const ast = parser.parse();
+ if (parser.sawUnambiguousESM) {
+ return ast;
+ }
+ if (parser.ambiguousScriptDifferentAst) {
+ try {
+ options.sourceType = "script";
+ return getParser(options, input).parse();
+ } catch (_unused) {}
+ } else {
+ ast.program.sourceType = "script";
+ }
+ return ast;
+ } catch (moduleError) {
+ try {
+ options.sourceType = "script";
+ return getParser(options, input).parse();
+ } catch (_unused2) {}
+ throw moduleError;
+ }
+ } else {
+ return getParser(options, input).parse();
+ }
+}
+function parseExpression(input, options) {
+ const parser = getParser(options, input);
+ if (parser.options.strictMode) {
+ parser.state.strict = true;
+ }
+ return parser.getExpression();
+}
+function generateExportedTokenTypes(internalTokenTypes) {
+ const tokenTypes = {};
+ for (const typeName of Object.keys(internalTokenTypes)) {
+ tokenTypes[typeName] = getExportedToken(internalTokenTypes[typeName]);
+ }
+ return tokenTypes;
+}
+const tokTypes = generateExportedTokenTypes(tt);
+function getParser(options, input) {
+ let cls = Parser;
+ const pluginsMap = new Map();
+ if (options != null && options.plugins) {
+ for (const plugin of options.plugins) {
+ let name, opts;
+ if (typeof plugin === "string") {
+ name = plugin;
+ } else {
+ [name, opts] = plugin;
+ }
+ if (!pluginsMap.has(name)) {
+ pluginsMap.set(name, opts || {});
+ }
+ }
+ validatePlugins(pluginsMap);
+ cls = getParserClass(pluginsMap);
+ }
+ return new cls(options, input, pluginsMap);
+}
+const parserClassCache = new Map();
+function getParserClass(pluginsMap) {
+ const pluginList = [];
+ for (const name of mixinPluginNames) {
+ if (pluginsMap.has(name)) {
+ pluginList.push(name);
+ }
+ }
+ const key = pluginList.join("|");
+ let cls = parserClassCache.get(key);
+ if (!cls) {
+ cls = Parser;
+ for (const plugin of pluginList) {
+ cls = mixinPlugins[plugin](cls);
+ }
+ parserClassCache.set(key, cls);
+ }
+ return cls;
+}
+exports.parse = parse;
+exports.parseExpression = parseExpression;
+exports.tokTypes = tokTypes;
+//# sourceMappingURL=index.js.map
diff --git a/node_modules/@babel/parser/lib/index.js.map b/node_modules/@babel/parser/lib/index.js.map
new file mode 100644
index 0000000..3cdfa3d
--- /dev/null
+++ b/node_modules/@babel/parser/lib/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sources":["../src/util/location.ts","../src/parse-error/module-errors.ts","../src/parse-error/to-node-description.ts","../src/parse-error/standard-errors.ts","../src/parse-error/strict-mode-errors.ts","../src/parse-error/pipeline-operator-errors.ts","../src/parse-error.ts","../src/plugins/estree.ts","../src/tokenizer/context.ts","../src/tokenizer/types.ts","../../babel-helper-validator-identifier/src/identifier.ts","../../babel-helper-validator-identifier/src/keyword.ts","../src/util/identifier.ts","../src/util/scope.ts","../src/plugins/flow/scope.ts","../src/parser/base.ts","../src/parser/comments.ts","../src/util/whitespace.ts","../src/tokenizer/state.ts","../../babel-helper-string-parser/src/index.ts","../src/tokenizer/index.ts","../src/util/class-scope.ts","../src/util/expression-scope.ts","../src/util/production-parameter.ts","../src/parser/util.ts","../src/parser/node.ts","../src/plugins/flow/index.ts","../src/plugins/jsx/xhtml.ts","../src/plugins/jsx/index.ts","../src/plugins/typescript/scope.ts","../src/parser/lval.ts","../src/plugins/typescript/index.ts","../src/plugins/placeholders.ts","../src/plugins/v8intrinsic.ts","../src/plugin-utils.ts","../src/options.ts","../src/parser/expression.ts","../src/parser/statement.ts","../src/parser/index.ts","../src/index.ts"],"sourcesContent":["export type Pos = {\n start: number;\n};\n\n// These are used when `options.locations` is on, for the\n// `startLoc` and `endLoc` properties.\n\nexport class Position {\n line: number;\n column: number;\n index: number;\n\n constructor(line: number, col: number, index: number) {\n this.line = line;\n this.column = col;\n this.index = index;\n }\n}\n\nexport class SourceLocation {\n start: Position;\n end: Position;\n filename: string;\n identifierName: string | undefined | null;\n\n constructor(start: Position, end?: Position) {\n this.start = start;\n // (may start as null, but initialized later)\n this.end = end;\n }\n}\n\n/**\n * creates a new position with a non-zero column offset from the given position.\n * This function should be only be used when we create AST node out of the token\n * boundaries, such as TemplateElement ends before tt.templateNonTail. This\n * function does not skip whitespaces.\n */\nexport function createPositionWithColumnOffset(\n position: Position,\n columnOffset: number,\n) {\n const { line, column, index } = position;\n return new Position(line, column + columnOffset, index + columnOffset);\n}\n","import type { ParseErrorTemplates } from \"../parse-error.ts\";\n\nconst code = \"BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED\";\n\nexport default {\n ImportMetaOutsideModule: {\n message: `import.meta may appear only with 'sourceType: \"module\"'`,\n code,\n },\n ImportOutsideModule: {\n message: `'import' and 'export' may appear only with 'sourceType: \"module\"'`,\n code,\n },\n} satisfies ParseErrorTemplates;\n","const NodeDescriptions = {\n ArrayPattern: \"array destructuring pattern\",\n AssignmentExpression: \"assignment expression\",\n AssignmentPattern: \"assignment expression\",\n ArrowFunctionExpression: \"arrow function expression\",\n ConditionalExpression: \"conditional expression\",\n CatchClause: \"catch clause\",\n ForOfStatement: \"for-of statement\",\n ForInStatement: \"for-in statement\",\n ForStatement: \"for-loop\",\n FormalParameters: \"function parameter list\",\n Identifier: \"identifier\",\n ImportSpecifier: \"import specifier\",\n ImportDefaultSpecifier: \"import default specifier\",\n ImportNamespaceSpecifier: \"import namespace specifier\",\n ObjectPattern: \"object destructuring pattern\",\n ParenthesizedExpression: \"parenthesized expression\",\n RestElement: \"rest element\",\n UpdateExpression: {\n true: \"prefix operation\",\n false: \"postfix operation\",\n },\n VariableDeclarator: \"variable declaration\",\n YieldExpression: \"yield expression\",\n};\n\ntype NodeTypesWithDescriptions = keyof Omit<\n typeof NodeDescriptions,\n \"UpdateExpression\"\n>;\n\ntype NodeWithDescription =\n | {\n type: \"UpdateExpression\";\n prefix: boolean;\n }\n | {\n type: NodeTypesWithDescriptions;\n };\n\n// eslint-disable-next-line no-confusing-arrow\nconst toNodeDescription = (node: NodeWithDescription) =>\n node.type === \"UpdateExpression\"\n ? NodeDescriptions.UpdateExpression[`${node.prefix}`]\n : NodeDescriptions[node.type];\n\nexport default toNodeDescription;\n","import type { ParseErrorTemplates } from \"../parse-error.ts\";\nimport toNodeDescription from \"./to-node-description.ts\";\n\nexport type LValAncestor =\n | { type: \"UpdateExpression\"; prefix: boolean }\n | {\n type:\n | \"ArrayPattern\"\n | \"AssignmentExpression\"\n | \"CatchClause\"\n | \"ForOfStatement\"\n | \"FormalParameters\"\n | \"ForInStatement\"\n | \"ForStatement\"\n | \"ImportSpecifier\"\n | \"ImportNamespaceSpecifier\"\n | \"ImportDefaultSpecifier\"\n | \"ParenthesizedExpression\"\n | \"ObjectPattern\"\n | \"RestElement\"\n | \"VariableDeclarator\";\n };\n\nexport default {\n AccessorIsGenerator: ({ kind }: { kind: \"get\" | \"set\" }) =>\n `A ${kind}ter cannot be a generator.`,\n ArgumentsInClass:\n \"'arguments' is only allowed in functions and class methods.\",\n AsyncFunctionInSingleStatementContext:\n \"Async functions can only be declared at the top level or inside a block.\",\n AwaitBindingIdentifier:\n \"Can not use 'await' as identifier inside an async function.\",\n AwaitBindingIdentifierInStaticBlock:\n \"Can not use 'await' as identifier inside a static block.\",\n AwaitExpressionFormalParameter:\n \"'await' is not allowed in async function parameters.\",\n AwaitUsingNotInAsyncContext:\n \"'await using' is only allowed within async functions and at the top levels of modules.\",\n AwaitNotInAsyncContext:\n \"'await' is only allowed within async functions and at the top levels of modules.\",\n AwaitNotInAsyncFunction: \"'await' is only allowed within async functions.\",\n BadGetterArity: \"A 'get' accessor must not have any formal parameters.\",\n BadSetterArity: \"A 'set' accessor must have exactly one formal parameter.\",\n BadSetterRestParameter:\n \"A 'set' accessor function argument must not be a rest parameter.\",\n ConstructorClassField: \"Classes may not have a field named 'constructor'.\",\n ConstructorClassPrivateField:\n \"Classes may not have a private field named '#constructor'.\",\n ConstructorIsAccessor: \"Class constructor may not be an accessor.\",\n ConstructorIsAsync: \"Constructor can't be an async function.\",\n ConstructorIsGenerator: \"Constructor can't be a generator.\",\n DeclarationMissingInitializer: ({\n kind,\n }: {\n kind: \"await using\" | \"const\" | \"destructuring\" | \"using\";\n }) => `Missing initializer in ${kind} declaration.`,\n DecoratorArgumentsOutsideParentheses:\n \"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.\",\n DecoratorBeforeExport:\n \"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.\",\n DecoratorsBeforeAfterExport:\n \"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.\",\n DecoratorConstructor:\n \"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?\",\n DecoratorExportClass:\n \"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.\",\n DecoratorSemicolon: \"Decorators must not be followed by a semicolon.\",\n DecoratorStaticBlock: \"Decorators can't be used with a static block.\",\n DeferImportRequiresNamespace:\n 'Only `import defer * as x from \"./module\"` is valid.',\n DeletePrivateField: \"Deleting a private field is not allowed.\",\n DestructureNamedImport:\n \"ES2015 named imports do not destructure. Use another statement for destructuring after the import.\",\n DuplicateConstructor: \"Duplicate constructor in the same class.\",\n DuplicateDefaultExport: \"Only one default export allowed per module.\",\n DuplicateExport: ({ exportName }: { exportName: string }) =>\n `\\`${exportName}\\` has already been exported. Exported identifiers must be unique.`,\n DuplicateProto: \"Redefinition of __proto__ property.\",\n DuplicateRegExpFlags: \"Duplicate regular expression flag.\",\n DynamicImportPhaseRequiresImportExpressions: ({ phase }: { phase: string }) =>\n `'import.${phase}(...)' can only be parsed when using the 'createImportExpressions' option.`,\n ElementAfterRest: \"Rest element must be last element.\",\n EscapedCharNotAnIdentifier: \"Invalid Unicode escape.\",\n ExportBindingIsString: ({\n localName,\n exportName,\n }: {\n localName: string;\n exportName: string;\n }) =>\n `A string literal cannot be used as an exported binding without \\`from\\`.\\n- Did you mean \\`export { '${localName}' as '${exportName}' } from 'some-module'\\`?`,\n ExportDefaultFromAsIdentifier:\n \"'from' is not allowed as an identifier after 'export default'.\",\n\n ForInOfLoopInitializer: ({\n type,\n }: {\n type: \"ForInStatement\" | \"ForOfStatement\";\n }) =>\n `'${\n type === \"ForInStatement\" ? \"for-in\" : \"for-of\"\n }' loop variable declaration may not have an initializer.`,\n ForInUsing: \"For-in loop may not start with 'using' declaration.\",\n\n ForOfAsync: \"The left-hand side of a for-of loop may not be 'async'.\",\n ForOfLet: \"The left-hand side of a for-of loop may not start with 'let'.\",\n GeneratorInSingleStatementContext:\n \"Generators can only be declared at the top level or inside a block.\",\n\n IllegalBreakContinue: ({\n type,\n }: {\n type: \"BreakStatement\" | \"ContinueStatement\";\n }) => `Unsyntactic ${type === \"BreakStatement\" ? \"break\" : \"continue\"}.`,\n\n IllegalLanguageModeDirective:\n \"Illegal 'use strict' directive in function with non-simple parameter list.\",\n IllegalReturn: \"'return' outside of function.\",\n ImportAttributesUseAssert:\n \"The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedAssertSyntax: true` option in the import attributes plugin to suppress this error.\",\n ImportBindingIsString: ({ importName }: { importName: string }) =>\n `A string literal cannot be used as an imported binding.\\n- Did you mean \\`import { \"${importName}\" as foo }\\`?`,\n ImportCallArgumentTrailingComma:\n \"Trailing comma is disallowed inside import(...) arguments.\",\n ImportCallArity: ({ maxArgumentCount }: { maxArgumentCount: 1 | 2 }) =>\n `\\`import()\\` requires exactly ${\n maxArgumentCount === 1 ? \"one argument\" : \"one or two arguments\"\n }.`,\n ImportCallNotNewExpression: \"Cannot use new with import(...).\",\n ImportCallSpreadArgument: \"`...` is not allowed in `import()`.\",\n ImportJSONBindingNotDefault:\n \"A JSON module can only be imported with `default`.\",\n ImportReflectionHasAssertion: \"`import module x` cannot have assertions.\",\n ImportReflectionNotBinding:\n 'Only `import module x from \"./module\"` is valid.',\n IncompatibleRegExpUVFlags:\n \"The 'u' and 'v' regular expression flags cannot be enabled at the same time.\",\n InvalidBigIntLiteral: \"Invalid BigIntLiteral.\",\n InvalidCodePoint: \"Code point out of bounds.\",\n InvalidCoverInitializedName: \"Invalid shorthand property initializer.\",\n InvalidDecimal: \"Invalid decimal.\",\n InvalidDigit: ({ radix }: { radix: number }) =>\n `Expected number in radix ${radix}.`,\n InvalidEscapeSequence: \"Bad character escape sequence.\",\n InvalidEscapeSequenceTemplate: \"Invalid escape sequence in template.\",\n InvalidEscapedReservedWord: ({ reservedWord }: { reservedWord: string }) =>\n `Escape sequence in keyword ${reservedWord}.`,\n InvalidIdentifier: ({ identifierName }: { identifierName: string }) =>\n `Invalid identifier ${identifierName}.`,\n InvalidLhs: ({ ancestor }: { ancestor: LValAncestor }) =>\n `Invalid left-hand side in ${toNodeDescription(ancestor)}.`,\n InvalidLhsBinding: ({ ancestor }: { ancestor: LValAncestor }) =>\n `Binding invalid left-hand side in ${toNodeDescription(ancestor)}.`,\n InvalidLhsOptionalChaining: ({ ancestor }: { ancestor: LValAncestor }) =>\n `Invalid optional chaining in the left-hand side of ${toNodeDescription(\n ancestor,\n )}.`,\n InvalidNumber: \"Invalid number.\",\n InvalidOrMissingExponent:\n \"Floating-point numbers require a valid exponent after the 'e'.\",\n InvalidOrUnexpectedToken: ({ unexpected }: { unexpected: string }) =>\n `Unexpected character '${unexpected}'.`,\n InvalidParenthesizedAssignment: \"Invalid parenthesized assignment pattern.\",\n InvalidPrivateFieldResolution: ({\n identifierName,\n }: {\n identifierName: string;\n }) => `Private name #${identifierName} is not defined.`,\n InvalidPropertyBindingPattern: \"Binding member expression.\",\n InvalidRecordProperty:\n \"Only properties and spread elements are allowed in record definitions.\",\n InvalidRestAssignmentPattern: \"Invalid rest operator's argument.\",\n LabelRedeclaration: ({ labelName }: { labelName: string }) =>\n `Label '${labelName}' is already declared.`,\n LetInLexicalBinding: \"'let' is disallowed as a lexically bound name.\",\n LineTerminatorBeforeArrow: \"No line break is allowed before '=>'.\",\n MalformedRegExpFlags: \"Invalid regular expression flag.\",\n MissingClassName: \"A class name is required.\",\n MissingEqInAssignment:\n \"Only '=' operator can be used for specifying default value.\",\n MissingSemicolon: \"Missing semicolon.\",\n MissingPlugin: ({ missingPlugin }: { missingPlugin: [string] }) =>\n `This experimental syntax requires enabling the parser plugin: ${missingPlugin\n .map(name => JSON.stringify(name))\n .join(\", \")}.`,\n // FIXME: Would be nice to make this \"missingPlugins\" instead.\n // Also, seems like we can drop the \"(s)\" from the message and just make it \"s\".\n MissingOneOfPlugins: ({ missingPlugin }: { missingPlugin: string[] }) =>\n `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin\n .map(name => JSON.stringify(name))\n .join(\", \")}.`,\n MissingUnicodeEscape: \"Expecting Unicode escape sequence \\\\uXXXX.\",\n MixingCoalesceWithLogical:\n \"Nullish coalescing operator(??) requires parens when mixing with logical operators.\",\n ModuleAttributeDifferentFromType:\n \"The only accepted module attribute is `type`.\",\n ModuleAttributeInvalidValue:\n \"Only string literals are allowed as module attribute values.\",\n ModuleAttributesWithDuplicateKeys: ({ key }: { key: string }) =>\n `Duplicate key \"${key}\" is not allowed in module attributes.`,\n ModuleExportNameHasLoneSurrogate: ({\n surrogateCharCode,\n }: {\n surrogateCharCode: number;\n }) =>\n `An export name cannot include a lone surrogate, found '\\\\u${surrogateCharCode.toString(\n 16,\n )}'.`,\n ModuleExportUndefined: ({ localName }: { localName: string }) =>\n `Export '${localName}' is not defined.`,\n MultipleDefaultsInSwitch: \"Multiple default clauses.\",\n NewlineAfterThrow: \"Illegal newline after throw.\",\n NoCatchOrFinally: \"Missing catch or finally clause.\",\n NumberIdentifier: \"Identifier directly after number.\",\n NumericSeparatorInEscapeSequence:\n \"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.\",\n ObsoleteAwaitStar:\n \"'await*' has been removed from the async functions proposal. Use Promise.all() instead.\",\n OptionalChainingNoNew:\n \"Constructors in/after an Optional Chain are not allowed.\",\n OptionalChainingNoTemplate:\n \"Tagged Template Literals are not allowed in optionalChain.\",\n OverrideOnConstructor:\n \"'override' modifier cannot appear on a constructor declaration.\",\n ParamDupe: \"Argument name clash.\",\n PatternHasAccessor: \"Object pattern can't contain getter or setter.\",\n PatternHasMethod: \"Object pattern can't contain methods.\",\n PrivateInExpectedIn: ({ identifierName }: { identifierName: string }) =>\n `Private names are only allowed in property accesses (\\`obj.#${identifierName}\\`) or in \\`in\\` expressions (\\`#${identifierName} in obj\\`).`,\n PrivateNameRedeclaration: ({ identifierName }: { identifierName: string }) =>\n `Duplicate private name #${identifierName}.`,\n RecordExpressionBarIncorrectEndSyntaxType:\n \"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n RecordExpressionBarIncorrectStartSyntaxType:\n \"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n RecordExpressionHashIncorrectStartSyntaxType:\n \"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.\",\n RecordNoProto: \"'__proto__' is not allowed in Record expressions.\",\n RestTrailingComma: \"Unexpected trailing comma after rest element.\",\n SloppyFunction:\n \"In non-strict mode code, functions can only be declared at top level or inside a block.\",\n SloppyFunctionAnnexB:\n \"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.\",\n SourcePhaseImportRequiresDefault:\n 'Only `import source x from \"./module\"` is valid.',\n StaticPrototype: \"Classes may not have static property named prototype.\",\n SuperNotAllowed:\n \"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?\",\n SuperPrivateField: \"Private fields can't be accessed on super.\",\n TrailingDecorator: \"Decorators must be attached to a class element.\",\n TupleExpressionBarIncorrectEndSyntaxType:\n \"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n TupleExpressionBarIncorrectStartSyntaxType:\n \"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n TupleExpressionHashIncorrectStartSyntaxType:\n \"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.\",\n UnexpectedArgumentPlaceholder: \"Unexpected argument placeholder.\",\n UnexpectedAwaitAfterPipelineBody:\n 'Unexpected \"await\" after pipeline body; await must have parentheses in minimal proposal.',\n UnexpectedDigitAfterHash: \"Unexpected digit after hash token.\",\n UnexpectedImportExport:\n \"'import' and 'export' may only appear at the top level.\",\n UnexpectedKeyword: ({ keyword }: { keyword: string }) =>\n `Unexpected keyword '${keyword}'.`,\n UnexpectedLeadingDecorator:\n \"Leading decorators must be attached to a class declaration.\",\n UnexpectedLexicalDeclaration:\n \"Lexical declaration cannot appear in a single-statement context.\",\n UnexpectedNewTarget:\n \"`new.target` can only be used in functions or class properties.\",\n UnexpectedNumericSeparator:\n \"A numeric separator is only allowed between two digits.\",\n UnexpectedPrivateField: \"Unexpected private name.\",\n UnexpectedReservedWord: ({ reservedWord }: { reservedWord: string }) =>\n `Unexpected reserved word '${reservedWord}'.`,\n UnexpectedSuper: \"'super' is only allowed in object methods and classes.\",\n UnexpectedToken: ({\n expected,\n unexpected,\n }: {\n expected?: string | null;\n unexpected?: string | null;\n }) =>\n `Unexpected token${unexpected ? ` '${unexpected}'.` : \"\"}${\n expected ? `, expected \"${expected}\"` : \"\"\n }`,\n UnexpectedTokenUnaryExponentiation:\n \"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.\",\n UnexpectedUsingDeclaration:\n \"Using declaration cannot appear in the top level when source type is `script`.\",\n UnsupportedBind: \"Binding should be performed on object property.\",\n UnsupportedDecoratorExport:\n \"A decorated export must export a class declaration.\",\n UnsupportedDefaultExport:\n \"Only expressions, functions or classes are allowed as the `default` export.\",\n UnsupportedImport:\n \"`import` can only be used in `import()` or `import.meta`.\",\n UnsupportedMetaProperty: ({\n target,\n onlyValidPropertyName,\n }: {\n target: string;\n onlyValidPropertyName: string;\n }) =>\n `The only valid meta property for ${target} is ${target}.${onlyValidPropertyName}.`,\n UnsupportedParameterDecorator:\n \"Decorators cannot be used to decorate parameters.\",\n UnsupportedPropertyDecorator:\n \"Decorators cannot be used to decorate object literal properties.\",\n UnsupportedSuper:\n \"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).\",\n UnterminatedComment: \"Unterminated comment.\",\n UnterminatedRegExp: \"Unterminated regular expression.\",\n UnterminatedString: \"Unterminated string constant.\",\n UnterminatedTemplate: \"Unterminated template.\",\n UsingDeclarationExport: \"Using declaration cannot be exported.\",\n UsingDeclarationHasBindingPattern:\n \"Using declaration cannot have destructuring patterns.\",\n VarRedeclaration: ({ identifierName }: { identifierName: string }) =>\n `Identifier '${identifierName}' has already been declared.`,\n YieldBindingIdentifier:\n \"Can not use 'yield' as identifier inside a generator.\",\n YieldInParameter: \"Yield expression is not allowed in formal parameters.\",\n ZeroDigitNumericSeparator:\n \"Numeric separator can not be used after leading 0.\",\n} satisfies ParseErrorTemplates;\n","import type { ParseErrorTemplates } from \"../parse-error\";\n\nexport default {\n StrictDelete: \"Deleting local variable in strict mode.\",\n\n // `referenceName` is the StringValue[1] of an IdentifierReference[2], which\n // is represented as just an `Identifier`[3] in the Babel AST.\n // 1. https://tc39.es/ecma262/#sec-static-semantics-stringvalue\n // 2. https://tc39.es/ecma262/#prod-IdentifierReference\n // 3. https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md#identifier\n StrictEvalArguments: ({ referenceName }: { referenceName: string }) =>\n `Assigning to '${referenceName}' in strict mode.`,\n\n // `bindingName` is the StringValue[1] of a BindingIdentifier[2], which is\n // represented as just an `Identifier`[3] in the Babel AST.\n // 1. https://tc39.es/ecma262/#sec-static-semantics-stringvalue\n // 2. https://tc39.es/ecma262/#prod-BindingIdentifier\n // 3. https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md#identifier\n StrictEvalArgumentsBinding: ({ bindingName }: { bindingName: string }) =>\n `Binding '${bindingName}' in strict mode.`,\n\n StrictFunction:\n \"In strict mode code, functions can only be declared at top level or inside a block.\",\n\n StrictNumericEscape: \"The only valid numeric escape in strict mode is '\\\\0'.\",\n\n StrictOctalLiteral: \"Legacy octal literals are not allowed in strict mode.\",\n\n StrictWith: \"'with' in strict mode.\",\n} satisfies ParseErrorTemplates;\n","import type { ParseErrorTemplates } from \"../parse-error.ts\";\nimport toNodeDescription from \"./to-node-description.ts\";\n\nexport const UnparenthesizedPipeBodyDescriptions = new Set([\n \"ArrowFunctionExpression\",\n \"AssignmentExpression\",\n \"ConditionalExpression\",\n \"YieldExpression\",\n] as const);\n\ntype GetSetMemberType> =\n T extends Set ? M : unknown;\n\nexport type UnparenthesizedPipeBodyTypes = GetSetMemberType<\n typeof UnparenthesizedPipeBodyDescriptions\n>;\n\nexport default {\n // This error is only used by the smart-mix proposal\n PipeBodyIsTighter:\n \"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.\",\n PipeTopicRequiresHackPipes:\n 'Topic reference is used, but the pipelineOperator plugin was not passed a \"proposal\": \"hack\" or \"smart\" option.',\n PipeTopicUnbound:\n \"Topic reference is unbound; it must be inside a pipe body.\",\n PipeTopicUnconfiguredToken: ({ token }: { token: string }) =>\n `Invalid topic token ${token}. In order to use ${token} as a topic reference, the pipelineOperator plugin must be configured with { \"proposal\": \"hack\", \"topicToken\": \"${token}\" }.`,\n PipeTopicUnused:\n \"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.\",\n PipeUnparenthesizedBody: ({ type }: { type: UnparenthesizedPipeBodyTypes }) =>\n `Hack-style pipe body cannot be an unparenthesized ${toNodeDescription({\n type,\n })}; please wrap it in parentheses.`,\n\n // Messages whose codes start with “Pipeline” or “PrimaryTopic”\n // are retained for backwards compatibility\n // with the deprecated smart-mix pipe operator proposal plugin.\n // They are subject to removal in a future major version.\n PipelineBodyNoArrow:\n 'Unexpected arrow \"=>\" after pipeline body; arrow function in pipeline body must be parenthesized.',\n PipelineBodySequenceExpression:\n \"Pipeline body may not be a comma-separated sequence expression.\",\n PipelineHeadSequenceExpression:\n \"Pipeline head should not be a comma-separated sequence expression.\",\n PipelineTopicUnused:\n \"Pipeline is in topic style but does not use topic reference.\",\n PrimaryTopicNotAllowed:\n \"Topic reference was used in a lexical context without topic binding.\",\n PrimaryTopicRequiresSmartPipeline:\n 'Topic reference is used, but the pipelineOperator plugin was not passed a \"proposal\": \"hack\" or \"smart\" option.',\n} satisfies ParseErrorTemplates;\n","import { Position } from \"./util/location.ts\";\n\ntype SyntaxPlugin =\n | \"flow\"\n | \"typescript\"\n | \"jsx\"\n | \"pipelineOperator\"\n | \"placeholders\";\n\ntype ParseErrorCode =\n | \"BABEL_PARSER_SYNTAX_ERROR\"\n | \"BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED\";\n\n// Babel uses \"normal\" SyntaxErrors for it's errors, but adds some extra\n// functionality. This functionality is defined in the\n// `ParseErrorSpecification` interface below. We may choose to change to someday\n// give our errors their own full-blown class, but until then this allow us to\n// keep all the desirable properties of SyntaxErrors (like their name in stack\n// traces, etc.), and also allows us to punt on any publicly facing\n// class-hierarchy decisions until Babel 8.\ninterface ParseErrorSpecification {\n // Look, these *could* be readonly, but then Flow complains when we initially\n // set them. We could do a whole dance and make a special interface that's not\n // readonly for when we create the error, then cast it to the readonly\n // interface for public use, but the previous implementation didn't have them\n // as readonly, so let's just not worry about it for now.\n code: ParseErrorCode;\n reasonCode: string;\n syntaxPlugin?: SyntaxPlugin;\n missingPlugin?: string | string[];\n loc: Position;\n details: ErrorDetails;\n\n // We should consider removing this as it now just contains the same\n // information as `loc.index`.\n pos: number;\n}\n\nexport type ParseError = SyntaxError &\n ParseErrorSpecification;\n\n// By `ParseErrorConstructor`, we mean something like the new-less style\n// `ErrorConstructor`[1], since `ParseError`'s are not themselves actually\n// separate classes from `SyntaxError`'s.\n//\n// 1. https://github.com/microsoft/TypeScript/blob/v4.5.5/lib/lib.es5.d.ts#L1027\nexport type ParseErrorConstructor = (\n loc: Position,\n details: ErrorDetails,\n) => ParseError;\n\ntype ToMessage = (self: ErrorDetails) => string;\n\ntype ParseErrorCredentials = {\n code: string;\n reasonCode: string;\n syntaxPlugin?: SyntaxPlugin;\n toMessage: ToMessage;\n};\n\nfunction defineHidden(obj: object, key: string, value: unknown) {\n Object.defineProperty(obj, key, {\n enumerable: false,\n configurable: true,\n value,\n });\n}\n\nfunction toParseErrorConstructor({\n toMessage,\n code,\n reasonCode,\n syntaxPlugin,\n}: ParseErrorCredentials): ParseErrorConstructor {\n const hasMissingPlugin =\n reasonCode === \"MissingPlugin\" || reasonCode === \"MissingOneOfPlugins\";\n\n if (!process.env.BABEL_8_BREAKING) {\n const oldReasonCodes: Record = {\n AccessorCannotDeclareThisParameter: \"AccesorCannotDeclareThisParameter\",\n AccessorCannotHaveTypeParameters: \"AccesorCannotHaveTypeParameters\",\n ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:\n \"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference\",\n SetAccessorCannotHaveOptionalParameter:\n \"SetAccesorCannotHaveOptionalParameter\",\n SetAccessorCannotHaveRestParameter: \"SetAccesorCannotHaveRestParameter\",\n SetAccessorCannotHaveReturnType: \"SetAccesorCannotHaveReturnType\",\n };\n if (oldReasonCodes[reasonCode]) {\n reasonCode = oldReasonCodes[reasonCode];\n }\n }\n\n return function constructor(loc: Position, details: ErrorDetails) {\n const error: ParseError = new SyntaxError() as any;\n\n error.code = code as ParseErrorCode;\n error.reasonCode = reasonCode;\n error.loc = loc;\n error.pos = loc.index;\n\n error.syntaxPlugin = syntaxPlugin;\n if (hasMissingPlugin) {\n error.missingPlugin = (details as any).missingPlugin;\n }\n\n type Overrides = {\n loc?: Position;\n details?: ErrorDetails;\n };\n defineHidden(error, \"clone\", function clone(overrides: Overrides = {}) {\n const { line, column, index } = overrides.loc ?? loc;\n return constructor(new Position(line, column, index), {\n ...details,\n ...overrides.details,\n });\n });\n\n defineHidden(error, \"details\", details);\n\n Object.defineProperty(error, \"message\", {\n configurable: true,\n get(this: ParseError): string {\n const message = `${toMessage(details)} (${loc.line}:${loc.column})`;\n this.message = message;\n return message;\n },\n set(value: string) {\n Object.defineProperty(this, \"message\", { value, writable: true });\n },\n });\n\n return error;\n };\n}\n\ntype ParseErrorTemplate =\n | string\n | ToMessage\n | { message: string | ToMessage; code?: ParseErrorCode };\n\nexport type ParseErrorTemplates = { [reasonCode: string]: ParseErrorTemplate };\n\n// This is the templated form of `ParseErrorEnum`.\n//\n// Note: We could factor out the return type calculation into something like\n// `ParseErrorConstructor`, and then we could\n// reuse it in the non-templated form of `ParseErrorEnum`, but TypeScript\n// doesn't seem to drill down that far when showing you the computed type of\n// an object in an editor, so we'll leave it inlined for now.\nexport function ParseErrorEnum(a: TemplateStringsArray): <\n T extends ParseErrorTemplates,\n>(\n parseErrorTemplates: T,\n) => {\n [K in keyof T]: ParseErrorConstructor<\n T[K] extends { message: string | ToMessage }\n ? T[K][\"message\"] extends ToMessage\n ? Parameters[0]\n : object\n : T[K] extends ToMessage\n ? Parameters[0]\n : object\n >;\n};\n\nexport function ParseErrorEnum(\n parseErrorTemplates: T,\n syntaxPlugin?: SyntaxPlugin,\n): {\n [K in keyof T]: ParseErrorConstructor<\n T[K] extends { message: string | ToMessage }\n ? T[K][\"message\"] extends ToMessage\n ? Parameters[0]\n : object\n : T[K] extends ToMessage\n ? Parameters[0]\n : object\n >;\n};\n\n// You call `ParseErrorEnum` with a mapping from `ReasonCode`'s to either:\n//\n// 1. a static error message,\n// 2. `toMessage` functions that define additional necessary `details` needed by\n// the `ParseError`, or\n// 3. Objects that contain a `message` of one of the above and overridden `code`\n// and/or `reasonCode`:\n//\n// ParseErrorEnum `optionalSyntaxPlugin` ({\n// ErrorWithStaticMessage: \"message\",\n// ErrorWithDynamicMessage: ({ type } : { type: string }) => `${type}`),\n// ErrorWithOverriddenCodeAndOrReasonCode: {\n// message: ({ type }: { type: string }) => `${type}`),\n// code: \"AN_ERROR_CODE\",\n// ...(BABEL_8_BREAKING ? { } : { reasonCode: \"CustomErrorReasonCode\" })\n// }\n// });\n//\nexport function ParseErrorEnum(\n argument: TemplateStringsArray | ParseErrorTemplates,\n syntaxPlugin?: SyntaxPlugin,\n) {\n // If the first parameter is an array, that means we were called with a tagged\n // template literal. Extract the syntaxPlugin from this, and call again in\n // the \"normalized\" form.\n if (Array.isArray(argument)) {\n return (parseErrorTemplates: ParseErrorTemplates) =>\n ParseErrorEnum(parseErrorTemplates, argument[0]);\n }\n\n const ParseErrorConstructors = {} as Record<\n string,\n ParseErrorConstructor\n >;\n\n for (const reasonCode of Object.keys(argument)) {\n const template = (argument as ParseErrorTemplates)[reasonCode];\n const { message, ...rest } =\n typeof template === \"string\"\n ? { message: () => template }\n : typeof template === \"function\"\n ? { message: template }\n : template;\n const toMessage = typeof message === \"string\" ? () => message : message;\n\n ParseErrorConstructors[reasonCode] = toParseErrorConstructor({\n code: \"BABEL_PARSER_SYNTAX_ERROR\",\n reasonCode,\n toMessage,\n ...(syntaxPlugin ? { syntaxPlugin } : {}),\n ...rest,\n });\n }\n\n return ParseErrorConstructors;\n}\n\nimport ModuleErrors from \"./parse-error/module-errors.ts\";\nimport StandardErrors from \"./parse-error/standard-errors.ts\";\nimport StrictModeErrors from \"./parse-error/strict-mode-errors.ts\";\nimport PipelineOperatorErrors from \"./parse-error/pipeline-operator-errors.ts\";\n\nexport const Errors = {\n ...ParseErrorEnum(ModuleErrors),\n ...ParseErrorEnum(StandardErrors),\n ...ParseErrorEnum(StrictModeErrors),\n ...ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors),\n};\n\nexport type { LValAncestor } from \"./parse-error/standard-errors.ts\";\n","import type { TokenType } from \"../tokenizer/types.ts\";\nimport type Parser from \"../parser/index.ts\";\nimport type { ExpressionErrors } from \"../parser/util.ts\";\nimport type * as N from \"../types.ts\";\nimport type { Node as NodeType, NodeBase, File } from \"../types.ts\";\nimport type { Position } from \"../util/location.ts\";\nimport { Errors } from \"../parse-error.ts\";\nimport type { Undone } from \"../parser/node.ts\";\nimport type { BindingFlag } from \"../util/scopeflags.ts\";\n\nconst { defineProperty } = Object;\nconst toUnenumerable = (object: any, key: string) => {\n if (object) {\n defineProperty(object, key, { enumerable: false, value: object[key] });\n }\n};\n\nfunction toESTreeLocation(node: any) {\n toUnenumerable(node.loc.start, \"index\");\n toUnenumerable(node.loc.end, \"index\");\n\n return node;\n}\n\nexport default (superClass: typeof Parser) =>\n class ESTreeParserMixin extends superClass implements Parser {\n parse(): File {\n const file = toESTreeLocation(super.parse());\n\n if (this.options.tokens) {\n file.tokens = file.tokens.map(toESTreeLocation);\n }\n\n return file;\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseRegExpLiteral({ pattern, flags }): N.EstreeRegExpLiteral {\n let regex: RegExp | null = null;\n try {\n regex = new RegExp(pattern, flags);\n } catch (_) {\n // In environments that don't support these flags value will\n // be null as the regex can't be represented natively.\n }\n const node = this.estreeParseLiteral(regex);\n node.regex = { pattern, flags };\n\n return node;\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseBigIntLiteral(value: any): N.Node {\n // https://github.com/estree/estree/blob/master/es2020.md#bigintliteral\n let bigInt: bigint | null;\n try {\n bigInt = BigInt(value);\n } catch {\n bigInt = null;\n }\n const node = this.estreeParseLiteral(bigInt);\n node.bigint = String(node.value || value);\n\n return node;\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseDecimalLiteral(value: any): N.Node {\n // https://github.com/estree/estree/blob/master/experimental/decimal.md\n // todo: use BigDecimal when node supports it.\n const decimal: null = null;\n const node = this.estreeParseLiteral(decimal);\n node.decimal = String(node.value || value);\n\n return node;\n }\n\n estreeParseLiteral(value: any) {\n // @ts-expect-error ESTree plugin changes node types\n return this.parseLiteral(value, \"Literal\");\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseStringLiteral(value: any): N.Node {\n return this.estreeParseLiteral(value);\n }\n\n parseNumericLiteral(value: any): any {\n return this.estreeParseLiteral(value);\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseNullLiteral(): N.Node {\n return this.estreeParseLiteral(null);\n }\n\n parseBooleanLiteral(value: boolean): N.BooleanLiteral {\n // @ts-expect-error ESTree plugin changes node types\n return this.estreeParseLiteral(value);\n }\n\n // Cast a Directive to an ExpressionStatement. Mutates the input Directive.\n directiveToStmt(directive: N.Directive): N.ExpressionStatement {\n const expression = directive.value as any as N.EstreeLiteral;\n delete directive.value;\n\n expression.type = \"Literal\";\n // @ts-expect-error N.EstreeLiteral.raw is not defined.\n expression.raw = expression.extra.raw;\n expression.value = expression.extra.expressionValue;\n\n const stmt = directive as any as N.ExpressionStatement;\n stmt.type = \"ExpressionStatement\";\n stmt.expression = expression;\n // @ts-expect-error N.ExpressionStatement.directive is not defined\n stmt.directive = expression.extra.rawValue;\n\n delete expression.extra;\n\n return stmt;\n }\n\n // ==================================\n // Overrides\n // ==================================\n\n initFunction(node: N.BodilessFunctionOrMethodBase, isAsync: boolean): void {\n super.initFunction(node, isAsync);\n node.expression = false;\n }\n\n checkDeclaration(node: N.Pattern | N.ObjectProperty): void {\n if (node != null && this.isObjectProperty(node)) {\n // @ts-expect-error plugin typings\n this.checkDeclaration((node as unknown as N.EstreeProperty).value);\n } else {\n super.checkDeclaration(node);\n }\n }\n\n getObjectOrClassMethodParams(method: N.ObjectMethod | N.ClassMethod) {\n return (method as unknown as N.EstreeMethodDefinition).value.params;\n }\n\n isValidDirective(stmt: N.Statement): boolean {\n return (\n stmt.type === \"ExpressionStatement\" &&\n stmt.expression.type === \"Literal\" &&\n typeof stmt.expression.value === \"string\" &&\n !stmt.expression.extra?.parenthesized\n );\n }\n\n parseBlockBody(\n node: N.BlockStatementLike,\n allowDirectives: boolean | undefined | null,\n topLevel: boolean,\n end: TokenType,\n afterBlockParse?: (hasStrictModeDirective: boolean) => void,\n ): void {\n super.parseBlockBody(\n node,\n allowDirectives,\n topLevel,\n end,\n afterBlockParse,\n );\n\n const directiveStatements = node.directives.map(d =>\n this.directiveToStmt(d),\n );\n // @ts-expect-error estree plugin typings\n node.body = directiveStatements.concat(node.body);\n delete node.directives;\n }\n\n pushClassMethod(\n classBody: N.ClassBody,\n method: N.ClassMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowsDirectSuper: boolean,\n ): void {\n this.parseMethod(\n method,\n isGenerator,\n isAsync,\n isConstructor,\n allowsDirectSuper,\n \"ClassMethod\",\n true,\n );\n if (method.typeParameters) {\n // @ts-expect-error mutate AST types\n method.value.typeParameters = method.typeParameters;\n delete method.typeParameters;\n }\n classBody.body.push(method);\n }\n\n parsePrivateName(): any {\n const node = super.parsePrivateName();\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return node;\n }\n }\n return this.convertPrivateNameToPrivateIdentifier(node);\n }\n\n convertPrivateNameToPrivateIdentifier(\n node: N.PrivateName,\n ): N.EstreePrivateIdentifier {\n const name = super.getPrivateNameSV(node);\n node = node as any;\n delete node.id;\n // @ts-expect-error mutate AST types\n node.name = name;\n // @ts-expect-error mutate AST types\n node.type = \"PrivateIdentifier\";\n return node as unknown as N.EstreePrivateIdentifier;\n }\n\n // @ts-expect-error ESTree plugin changes node types\n isPrivateName(node: N.Node): node is N.EstreePrivateIdentifier {\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return super.isPrivateName(node);\n }\n }\n return node.type === \"PrivateIdentifier\";\n }\n\n // @ts-expect-error ESTree plugin changes node types\n getPrivateNameSV(node: N.EstreePrivateIdentifier): string {\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return super.getPrivateNameSV(node as unknown as N.PrivateName);\n }\n }\n return node.name;\n }\n\n // @ts-expect-error plugin may override interfaces\n parseLiteral(value: any, type: T[\"type\"]): T {\n const node = super.parseLiteral(value, type);\n // @ts-expect-error mutating AST types\n node.raw = node.extra.raw;\n delete node.extra;\n\n return node;\n }\n\n parseFunctionBody(\n node: N.Function,\n allowExpression?: boolean | null,\n isMethod: boolean = false,\n ): void {\n super.parseFunctionBody(node, allowExpression, isMethod);\n node.expression = node.body.type !== \"BlockStatement\";\n }\n\n // @ts-expect-error plugin may override interfaces\n parseMethod<\n T extends N.ClassPrivateMethod | N.ObjectMethod | N.ClassMethod,\n >(\n node: Undone,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowDirectSuper: boolean,\n type: T[\"type\"],\n inClassScope: boolean = false,\n ): N.EstreeMethodDefinition {\n let funcNode = this.startNode();\n funcNode.kind = node.kind; // provide kind, so super method correctly sets state\n funcNode = super.parseMethod(\n // @ts-expect-error todo(flow->ts)\n funcNode,\n isGenerator,\n isAsync,\n isConstructor,\n allowDirectSuper,\n type,\n inClassScope,\n );\n // @ts-expect-error mutate AST types\n funcNode.type = \"FunctionExpression\";\n delete funcNode.kind;\n // @ts-expect-error mutate AST types\n node.value = funcNode;\n if (type === \"ClassPrivateMethod\") {\n node.computed = false;\n }\n return this.finishNode(\n // @ts-expect-error cast methods to estree types\n node as Undone,\n \"MethodDefinition\",\n );\n }\n\n nameIsConstructor(key: N.Expression | N.PrivateName): boolean {\n if (key.type === \"Literal\") return key.value === \"constructor\";\n return super.nameIsConstructor(key);\n }\n\n parseClassProperty(...args: [N.ClassProperty]): any {\n const propertyNode = super.parseClassProperty(...args) as any;\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return propertyNode as N.EstreePropertyDefinition;\n }\n }\n propertyNode.type = \"PropertyDefinition\";\n return propertyNode as N.EstreePropertyDefinition;\n }\n\n parseClassPrivateProperty(...args: [N.ClassPrivateProperty]): any {\n const propertyNode = super.parseClassPrivateProperty(...args) as any;\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return propertyNode as N.EstreePropertyDefinition;\n }\n }\n propertyNode.type = \"PropertyDefinition\";\n propertyNode.computed = false;\n return propertyNode as N.EstreePropertyDefinition;\n }\n\n parseObjectMethod(\n prop: N.ObjectMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isPattern: boolean,\n isAccessor: boolean,\n ): N.ObjectMethod | undefined | null {\n const node: N.EstreeProperty = super.parseObjectMethod(\n prop,\n isGenerator,\n isAsync,\n isPattern,\n isAccessor,\n ) as any;\n\n if (node) {\n node.type = \"Property\";\n if ((node as any as N.ClassMethod).kind === \"method\") {\n node.kind = \"init\";\n }\n node.shorthand = false;\n }\n\n return node as any;\n }\n\n parseObjectProperty(\n prop: N.ObjectProperty,\n startLoc: Position | undefined | null,\n isPattern: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.ObjectProperty | undefined | null {\n const node: N.EstreeProperty = super.parseObjectProperty(\n prop,\n startLoc,\n isPattern,\n refExpressionErrors,\n ) as any;\n\n if (node) {\n node.kind = \"init\";\n node.type = \"Property\";\n }\n\n return node as any;\n }\n\n isValidLVal(\n type: string,\n isUnparenthesizedInAssign: boolean,\n binding: BindingFlag,\n ) {\n return type === \"Property\"\n ? \"value\"\n : super.isValidLVal(type, isUnparenthesizedInAssign, binding);\n }\n\n isAssignable(node: N.Node, isBinding?: boolean): boolean {\n if (node != null && this.isObjectProperty(node)) {\n return this.isAssignable(node.value, isBinding);\n }\n return super.isAssignable(node, isBinding);\n }\n\n toAssignable(node: N.Node, isLHS: boolean = false): void {\n if (node != null && this.isObjectProperty(node)) {\n const { key, value } = node;\n if (this.isPrivateName(key)) {\n this.classScope.usePrivateName(\n this.getPrivateNameSV(key),\n key.loc.start,\n );\n }\n this.toAssignable(value, isLHS);\n } else {\n super.toAssignable(node, isLHS);\n }\n }\n\n toAssignableObjectExpressionProp(\n prop: N.Node,\n isLast: boolean,\n isLHS: boolean,\n ) {\n if (\n prop.type === \"Property\" &&\n (prop.kind === \"get\" || prop.kind === \"set\")\n ) {\n this.raise(Errors.PatternHasAccessor, prop.key);\n } else if (prop.type === \"Property\" && prop.method) {\n this.raise(Errors.PatternHasMethod, prop.key);\n } else {\n super.toAssignableObjectExpressionProp(prop, isLast, isLHS);\n }\n }\n\n finishCallExpression(\n unfinished: Undone,\n optional: boolean,\n ): T {\n const node = super.finishCallExpression(unfinished, optional);\n\n if (node.callee.type === \"Import\") {\n (node as N.Node as N.EstreeImportExpression).type = \"ImportExpression\";\n (node as N.Node as N.EstreeImportExpression).source = node\n .arguments[0] as N.Expression;\n if (\n this.hasPlugin(\"importAttributes\") ||\n this.hasPlugin(\"importAssertions\")\n ) {\n (node as N.Node as N.EstreeImportExpression).options =\n (node.arguments[1] as N.Expression) ?? null;\n // compatibility with previous ESTree AST\n (node as N.Node as N.EstreeImportExpression).attributes =\n (node.arguments[1] as N.Expression) ?? null;\n }\n // arguments isn't optional in the type definition\n delete node.arguments;\n // callee isn't optional in the type definition\n delete node.callee;\n }\n\n return node;\n }\n\n toReferencedArguments(\n node:\n | N.CallExpression\n | N.OptionalCallExpression\n | N.EstreeImportExpression,\n /* isParenthesizedExpr?: boolean, */\n ) {\n // ImportExpressions do not have an arguments array.\n if (node.type === \"ImportExpression\") {\n return;\n }\n\n super.toReferencedArguments(node);\n }\n\n parseExport(\n unfinished: Undone,\n decorators: N.Decorator[] | null,\n ) {\n const exportStartLoc = this.state.lastTokStartLoc;\n const node = super.parseExport(unfinished, decorators);\n\n switch (node.type) {\n case \"ExportAllDeclaration\":\n // @ts-expect-error mutating AST types\n node.exported = null;\n break;\n\n case \"ExportNamedDeclaration\":\n if (\n node.specifiers.length === 1 &&\n node.specifiers[0].type === \"ExportNamespaceSpecifier\"\n ) {\n // @ts-expect-error mutating AST types\n node.type = \"ExportAllDeclaration\";\n // @ts-expect-error mutating AST types\n node.exported = node.specifiers[0].exported;\n delete node.specifiers;\n }\n\n // fallthrough\n case \"ExportDefaultDeclaration\":\n {\n const { declaration } = node;\n if (\n declaration?.type === \"ClassDeclaration\" &&\n declaration.decorators?.length > 0 &&\n // decorator comes before export\n declaration.start === node.start\n ) {\n this.resetStartLocation(\n node,\n // For compatibility with ESLint's keyword-spacing rule, which assumes that an\n // export declaration must start with export.\n // https://github.com/babel/babel/issues/15085\n // Here we reset export declaration's start to be the start of the export token\n exportStartLoc,\n );\n }\n }\n\n break;\n }\n\n return node;\n }\n\n parseSubscript(\n base: N.Expression,\n startLoc: Position,\n noCalls: boolean | undefined | null,\n state: N.ParseSubscriptState,\n ): N.Expression {\n const node = super.parseSubscript(base, startLoc, noCalls, state);\n\n if (state.optionalChainMember) {\n // https://github.com/estree/estree/blob/master/es2020.md#chainexpression\n if (\n node.type === \"OptionalMemberExpression\" ||\n node.type === \"OptionalCallExpression\"\n ) {\n // strip Optional prefix\n (node as unknown as N.CallExpression | N.MemberExpression).type =\n node.type.substring(8) as \"CallExpression\" | \"MemberExpression\";\n }\n if (state.stop) {\n const chain = this.startNodeAtNode(node);\n chain.expression = node;\n return this.finishNode(chain, \"ChainExpression\");\n }\n } else if (\n node.type === \"MemberExpression\" ||\n node.type === \"CallExpression\"\n ) {\n // @ts-expect-error not in the type definitions\n node.optional = false;\n }\n\n return node;\n }\n\n isOptionalMemberExpression(node: N.Node) {\n if (node.type === \"ChainExpression\") {\n return node.expression.type === \"MemberExpression\";\n }\n return super.isOptionalMemberExpression(node);\n }\n\n hasPropertyAsPrivateName(node: N.Node): boolean {\n if (node.type === \"ChainExpression\") {\n node = node.expression;\n }\n return super.hasPropertyAsPrivateName(node);\n }\n\n // @ts-expect-error ESTree plugin changes node types\n isObjectProperty(node: N.Node): node is N.EstreeProperty {\n return node.type === \"Property\" && node.kind === \"init\" && !node.method;\n }\n\n // @ts-expect-error ESTree plugin changes node types\n isObjectMethod(node: N.Node): node is N.EstreeProperty {\n return (\n node.type === \"Property\" &&\n (node.method || node.kind === \"get\" || node.kind === \"set\")\n );\n }\n\n finishNodeAt(\n node: Undone,\n type: T[\"type\"],\n endLoc: Position,\n ): T {\n return toESTreeLocation(super.finishNodeAt(node, type, endLoc));\n }\n\n resetStartLocation(node: N.Node, startLoc: Position) {\n super.resetStartLocation(node, startLoc);\n toESTreeLocation(node);\n }\n\n resetEndLocation(\n node: NodeBase,\n endLoc: Position = this.state.lastTokEndLoc,\n ): void {\n super.resetEndLocation(node, endLoc);\n toESTreeLocation(node);\n }\n };\n","// The token context is used in JSX plugin to track\n// jsx tag / jsx text / normal JavaScript expression\n\nexport class TokContext {\n constructor(token: string, preserveSpace?: boolean) {\n this.token = token;\n this.preserveSpace = !!preserveSpace;\n }\n\n token: string;\n preserveSpace: boolean;\n}\n\nconst types: {\n [key: string]: TokContext;\n} = {\n brace: new TokContext(\"{\"), // normal JavaScript expression\n j_oTag: new TokContext(\"...\", true), // JSX expressions\n};\n\nif (!process.env.BABEL_8_BREAKING) {\n types.template = new TokContext(\"`\", true);\n}\n\nexport { types };\n","import { types as tc, type TokContext } from \"./context.ts\";\n// ## Token types\n\n// The assignment of fine-grained, information-carrying type objects\n// allows the tokenizer to store the information it has about a\n// token in a way that is very cheap for the parser to look up.\n\n// All token type variables start with an underscore, to make them\n// easy to recognize.\n\n// The `beforeExpr` property is used to disambiguate between 1) binary\n// expression (<) and JSX Tag start (); 2) object literal and JSX\n// texts. It is set on the `updateContext` function in the JSX plugin.\n\n// The `startsExpr` property is used to determine whether an expression\n// may be the “argument” subexpression of a `yield` expression or\n// `yield` statement. It is set on all token types that may be at the\n// start of a subexpression.\n\n// `isLoop` marks a keyword as starting a loop, which is important\n// to know when parsing a label, in order to allow or disallow\n// continue jumps to that label.\n\nconst beforeExpr = true;\nconst startsExpr = true;\nconst isLoop = true;\nconst isAssign = true;\nconst prefix = true;\nconst postfix = true;\n\ntype TokenOptions = {\n keyword?: string;\n beforeExpr?: boolean;\n startsExpr?: boolean;\n rightAssociative?: boolean;\n isLoop?: boolean;\n isAssign?: boolean;\n prefix?: boolean;\n postfix?: boolean;\n binop?: number | null;\n};\n\n// Internally the tokenizer stores token as a number\nexport type TokenType = number;\n\n// The `ExportedTokenType` is exported via `tokTypes` and accessible\n// when `tokens: true` is enabled. Unlike internal token type, it provides\n// metadata of the tokens.\nexport class ExportedTokenType {\n label: string;\n keyword: string | undefined | null;\n beforeExpr: boolean;\n startsExpr: boolean;\n rightAssociative: boolean;\n isLoop: boolean;\n isAssign: boolean;\n prefix: boolean;\n postfix: boolean;\n binop: number | undefined | null;\n // todo(Babel 8): remove updateContext from exposed token layout\n declare updateContext:\n | ((context: Array) => void)\n | undefined\n | null;\n\n constructor(label: string, conf: TokenOptions = {}) {\n this.label = label;\n this.keyword = conf.keyword;\n this.beforeExpr = !!conf.beforeExpr;\n this.startsExpr = !!conf.startsExpr;\n this.rightAssociative = !!conf.rightAssociative;\n this.isLoop = !!conf.isLoop;\n this.isAssign = !!conf.isAssign;\n this.prefix = !!conf.prefix;\n this.postfix = !!conf.postfix;\n this.binop = conf.binop != null ? conf.binop : null;\n if (!process.env.BABEL_8_BREAKING) {\n this.updateContext = null;\n }\n }\n}\n\n// A map from keyword/keyword-like string value to the token type\nexport const keywords = new Map();\n\nfunction createKeyword(name: string, options: TokenOptions = {}): TokenType {\n options.keyword = name;\n const token = createToken(name, options);\n keywords.set(name, token);\n return token;\n}\n\nfunction createBinop(name: string, binop: number) {\n return createToken(name, { beforeExpr, binop });\n}\n\nlet tokenTypeCounter = -1;\nexport const tokenTypes: ExportedTokenType[] = [];\nconst tokenLabels: string[] = [];\nconst tokenBinops: number[] = [];\nconst tokenBeforeExprs: boolean[] = [];\nconst tokenStartsExprs: boolean[] = [];\nconst tokenPrefixes: boolean[] = [];\n\nfunction createToken(name: string, options: TokenOptions = {}): TokenType {\n ++tokenTypeCounter;\n tokenLabels.push(name);\n tokenBinops.push(options.binop ?? -1);\n tokenBeforeExprs.push(options.beforeExpr ?? false);\n tokenStartsExprs.push(options.startsExpr ?? false);\n tokenPrefixes.push(options.prefix ?? false);\n tokenTypes.push(new ExportedTokenType(name, options));\n\n return tokenTypeCounter;\n}\n\nfunction createKeywordLike(\n name: string,\n options: TokenOptions = {},\n): TokenType {\n ++tokenTypeCounter;\n keywords.set(name, tokenTypeCounter);\n tokenLabels.push(name);\n tokenBinops.push(options.binop ?? -1);\n tokenBeforeExprs.push(options.beforeExpr ?? false);\n tokenStartsExprs.push(options.startsExpr ?? false);\n tokenPrefixes.push(options.prefix ?? false);\n // In the exported token type, we set the label as \"name\" for backward compatibility with Babel 7\n tokenTypes.push(new ExportedTokenType(\"name\", options));\n\n return tokenTypeCounter;\n}\n\n// For performance the token type helpers depend on the following declarations order.\n// When adding new token types, please also check if the token helpers need update.\n\nexport type InternalTokenTypes = typeof tt;\n\nexport const tt = {\n // Punctuation token types.\n bracketL: createToken(\"[\", { beforeExpr, startsExpr }),\n bracketHashL: createToken(\"#[\", { beforeExpr, startsExpr }),\n bracketBarL: createToken(\"[|\", { beforeExpr, startsExpr }),\n bracketR: createToken(\"]\"),\n bracketBarR: createToken(\"|]\"),\n braceL: createToken(\"{\", { beforeExpr, startsExpr }),\n braceBarL: createToken(\"{|\", { beforeExpr, startsExpr }),\n braceHashL: createToken(\"#{\", { beforeExpr, startsExpr }),\n braceR: createToken(\"}\"),\n braceBarR: createToken(\"|}\"),\n parenL: createToken(\"(\", { beforeExpr, startsExpr }),\n parenR: createToken(\")\"),\n comma: createToken(\",\", { beforeExpr }),\n semi: createToken(\";\", { beforeExpr }),\n colon: createToken(\":\", { beforeExpr }),\n doubleColon: createToken(\"::\", { beforeExpr }),\n dot: createToken(\".\"),\n question: createToken(\"?\", { beforeExpr }),\n questionDot: createToken(\"?.\"),\n arrow: createToken(\"=>\", { beforeExpr }),\n template: createToken(\"template\"),\n ellipsis: createToken(\"...\", { beforeExpr }),\n backQuote: createToken(\"`\", { startsExpr }),\n dollarBraceL: createToken(\"${\", { beforeExpr, startsExpr }),\n // start: isTemplate\n templateTail: createToken(\"...`\", { startsExpr }),\n templateNonTail: createToken(\"...${\", { beforeExpr, startsExpr }),\n // end: isTemplate\n at: createToken(\"@\"),\n hash: createToken(\"#\", { startsExpr }),\n\n // Special hashbang token.\n interpreterDirective: createToken(\"#!...\"),\n\n // Operators. These carry several kinds of properties to help the\n // parser use them properly (the presence of these properties is\n // what categorizes them as operators).\n //\n // `binop`, when present, specifies that this operator is a binary\n // operator, and will refer to its precedence.\n //\n // `prefix` and `postfix` mark the operator as a prefix or postfix\n // unary operator.\n //\n // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as\n // binary operators with a very low precedence, that should result\n // in AssignmentExpression nodes.\n\n // start: isAssign\n eq: createToken(\"=\", { beforeExpr, isAssign }),\n assign: createToken(\"_=\", { beforeExpr, isAssign }),\n slashAssign: createToken(\"_=\", { beforeExpr, isAssign }),\n // These are only needed to support % and ^ as a Hack-pipe topic token.\n // When the proposal settles on a token, the others can be merged with\n // tt.assign.\n xorAssign: createToken(\"_=\", { beforeExpr, isAssign }),\n moduloAssign: createToken(\"_=\", { beforeExpr, isAssign }),\n // end: isAssign\n\n incDec: createToken(\"++/--\", { prefix, postfix, startsExpr }),\n bang: createToken(\"!\", { beforeExpr, prefix, startsExpr }),\n tilde: createToken(\"~\", { beforeExpr, prefix, startsExpr }),\n\n // More possible topic tokens.\n // When the proposal settles on a token, at least one of these may be removed.\n doubleCaret: createToken(\"^^\", { startsExpr }),\n doubleAt: createToken(\"@@\", { startsExpr }),\n\n // start: isBinop\n pipeline: createBinop(\"|>\", 0),\n nullishCoalescing: createBinop(\"??\", 1),\n logicalOR: createBinop(\"||\", 1),\n logicalAND: createBinop(\"&&\", 2),\n bitwiseOR: createBinop(\"|\", 3),\n bitwiseXOR: createBinop(\"^\", 4),\n bitwiseAND: createBinop(\"&\", 5),\n equality: createBinop(\"==/!=/===/!==\", 6),\n lt: createBinop(\">/<=/>=\", 7),\n gt: createBinop(\">/<=/>=\", 7),\n relational: createBinop(\">/<=/>=\", 7),\n bitShift: createBinop(\"<>>/>>>\", 8),\n bitShiftL: createBinop(\"<>>/>>>\", 8),\n bitShiftR: createBinop(\"<>>/>>>\", 8),\n plusMin: createToken(\"+/-\", { beforeExpr, binop: 9, prefix, startsExpr }),\n // startsExpr: required by v8intrinsic plugin\n modulo: createToken(\"%\", { binop: 10, startsExpr }),\n // unset `beforeExpr` as it can be `function *`\n star: createToken(\"*\", { binop: 10 }),\n slash: createBinop(\"/\", 10),\n exponent: createToken(\"**\", {\n beforeExpr,\n binop: 11,\n rightAssociative: true,\n }),\n\n // Keywords\n // Don't forget to update packages/babel-helper-validator-identifier/src/keyword.js\n // when new keywords are added\n // start: isLiteralPropertyName\n // start: isKeyword\n _in: createKeyword(\"in\", { beforeExpr, binop: 7 }),\n _instanceof: createKeyword(\"instanceof\", { beforeExpr, binop: 7 }),\n // end: isBinop\n _break: createKeyword(\"break\"),\n _case: createKeyword(\"case\", { beforeExpr }),\n _catch: createKeyword(\"catch\"),\n _continue: createKeyword(\"continue\"),\n _debugger: createKeyword(\"debugger\"),\n _default: createKeyword(\"default\", { beforeExpr }),\n _else: createKeyword(\"else\", { beforeExpr }),\n _finally: createKeyword(\"finally\"),\n _function: createKeyword(\"function\", { startsExpr }),\n _if: createKeyword(\"if\"),\n _return: createKeyword(\"return\", { beforeExpr }),\n _switch: createKeyword(\"switch\"),\n _throw: createKeyword(\"throw\", { beforeExpr, prefix, startsExpr }),\n _try: createKeyword(\"try\"),\n _var: createKeyword(\"var\"),\n _const: createKeyword(\"const\"),\n _with: createKeyword(\"with\"),\n _new: createKeyword(\"new\", { beforeExpr, startsExpr }),\n _this: createKeyword(\"this\", { startsExpr }),\n _super: createKeyword(\"super\", { startsExpr }),\n _class: createKeyword(\"class\", { startsExpr }),\n _extends: createKeyword(\"extends\", { beforeExpr }),\n _export: createKeyword(\"export\"),\n _import: createKeyword(\"import\", { startsExpr }),\n _null: createKeyword(\"null\", { startsExpr }),\n _true: createKeyword(\"true\", { startsExpr }),\n _false: createKeyword(\"false\", { startsExpr }),\n _typeof: createKeyword(\"typeof\", { beforeExpr, prefix, startsExpr }),\n _void: createKeyword(\"void\", { beforeExpr, prefix, startsExpr }),\n _delete: createKeyword(\"delete\", { beforeExpr, prefix, startsExpr }),\n // start: isLoop\n _do: createKeyword(\"do\", { isLoop, beforeExpr }),\n _for: createKeyword(\"for\", { isLoop }),\n _while: createKeyword(\"while\", { isLoop }),\n // end: isLoop\n // end: isKeyword\n\n // Primary literals\n // start: isIdentifier\n _as: createKeywordLike(\"as\", { startsExpr }),\n _assert: createKeywordLike(\"assert\", { startsExpr }),\n _async: createKeywordLike(\"async\", { startsExpr }),\n _await: createKeywordLike(\"await\", { startsExpr }),\n _defer: createKeywordLike(\"defer\", { startsExpr }),\n _from: createKeywordLike(\"from\", { startsExpr }),\n _get: createKeywordLike(\"get\", { startsExpr }),\n _let: createKeywordLike(\"let\", { startsExpr }),\n _meta: createKeywordLike(\"meta\", { startsExpr }),\n _of: createKeywordLike(\"of\", { startsExpr }),\n _sent: createKeywordLike(\"sent\", { startsExpr }),\n _set: createKeywordLike(\"set\", { startsExpr }),\n _source: createKeywordLike(\"source\", { startsExpr }),\n _static: createKeywordLike(\"static\", { startsExpr }),\n _using: createKeywordLike(\"using\", { startsExpr }),\n _yield: createKeywordLike(\"yield\", { startsExpr }),\n\n // Flow and TypeScript Keywordlike\n _asserts: createKeywordLike(\"asserts\", { startsExpr }),\n _checks: createKeywordLike(\"checks\", { startsExpr }),\n _exports: createKeywordLike(\"exports\", { startsExpr }),\n _global: createKeywordLike(\"global\", { startsExpr }),\n _implements: createKeywordLike(\"implements\", { startsExpr }),\n _intrinsic: createKeywordLike(\"intrinsic\", { startsExpr }),\n _infer: createKeywordLike(\"infer\", { startsExpr }),\n _is: createKeywordLike(\"is\", { startsExpr }),\n _mixins: createKeywordLike(\"mixins\", { startsExpr }),\n _proto: createKeywordLike(\"proto\", { startsExpr }),\n _require: createKeywordLike(\"require\", { startsExpr }),\n _satisfies: createKeywordLike(\"satisfies\", { startsExpr }),\n // start: isTSTypeOperator\n _keyof: createKeywordLike(\"keyof\", { startsExpr }),\n _readonly: createKeywordLike(\"readonly\", { startsExpr }),\n _unique: createKeywordLike(\"unique\", { startsExpr }),\n // end: isTSTypeOperator\n // start: isTSDeclarationStart\n _abstract: createKeywordLike(\"abstract\", { startsExpr }),\n _declare: createKeywordLike(\"declare\", { startsExpr }),\n _enum: createKeywordLike(\"enum\", { startsExpr }),\n _module: createKeywordLike(\"module\", { startsExpr }),\n _namespace: createKeywordLike(\"namespace\", { startsExpr }),\n // start: isFlowInterfaceOrTypeOrOpaque\n _interface: createKeywordLike(\"interface\", { startsExpr }),\n _type: createKeywordLike(\"type\", { startsExpr }),\n // end: isTSDeclarationStart\n _opaque: createKeywordLike(\"opaque\", { startsExpr }),\n // end: isFlowInterfaceOrTypeOrOpaque\n name: createToken(\"name\", { startsExpr }),\n // end: isIdentifier\n\n string: createToken(\"string\", { startsExpr }),\n num: createToken(\"num\", { startsExpr }),\n bigint: createToken(\"bigint\", { startsExpr }),\n decimal: createToken(\"decimal\", { startsExpr }),\n // end: isLiteralPropertyName\n regexp: createToken(\"regexp\", { startsExpr }),\n privateName: createToken(\"#name\", { startsExpr }),\n eof: createToken(\"eof\"),\n\n // jsx plugin\n jsxName: createToken(\"jsxName\"),\n jsxText: createToken(\"jsxText\", { beforeExpr: true }),\n jsxTagStart: createToken(\"jsxTagStart\", { startsExpr: true }),\n jsxTagEnd: createToken(\"jsxTagEnd\"),\n\n // placeholder plugin\n placeholder: createToken(\"%%\", { startsExpr: true }),\n} as const;\n\nexport function tokenIsIdentifier(token: TokenType): boolean {\n return token >= tt._as && token <= tt.name;\n}\n\nexport function tokenKeywordOrIdentifierIsKeyword(token: TokenType): boolean {\n // we can remove the token >= tt._in check when we\n // know a token is either keyword or identifier\n return token <= tt._while;\n}\n\nexport function tokenIsKeywordOrIdentifier(token: TokenType): boolean {\n return token >= tt._in && token <= tt.name;\n}\n\nexport function tokenIsLiteralPropertyName(token: TokenType): boolean {\n return token >= tt._in && token <= tt.decimal;\n}\n\nexport function tokenComesBeforeExpression(token: TokenType): boolean {\n return tokenBeforeExprs[token];\n}\n\nexport function tokenCanStartExpression(token: TokenType): boolean {\n return tokenStartsExprs[token];\n}\n\nexport function tokenIsAssignment(token: TokenType): boolean {\n return token >= tt.eq && token <= tt.moduloAssign;\n}\n\nexport function tokenIsFlowInterfaceOrTypeOrOpaque(token: TokenType): boolean {\n return token >= tt._interface && token <= tt._opaque;\n}\n\nexport function tokenIsLoop(token: TokenType): boolean {\n return token >= tt._do && token <= tt._while;\n}\n\nexport function tokenIsKeyword(token: TokenType): boolean {\n return token >= tt._in && token <= tt._while;\n}\n\nexport function tokenIsOperator(token: TokenType): boolean {\n return token >= tt.pipeline && token <= tt._instanceof;\n}\n\nexport function tokenIsPostfix(token: TokenType): boolean {\n return token === tt.incDec;\n}\n\nexport function tokenIsPrefix(token: TokenType): boolean {\n return tokenPrefixes[token];\n}\n\nexport function tokenIsTSTypeOperator(token: TokenType): boolean {\n return token >= tt._keyof && token <= tt._unique;\n}\n\nexport function tokenIsTSDeclarationStart(token: TokenType): boolean {\n return token >= tt._abstract && token <= tt._type;\n}\n\nexport function tokenLabelName(token: TokenType): string {\n return tokenLabels[token];\n}\n\nexport function tokenOperatorPrecedence(token: TokenType): number {\n return tokenBinops[token];\n}\n\nexport function tokenIsBinaryOperator(token: TokenType): boolean {\n return tokenBinops[token] !== -1;\n}\n\nexport function tokenIsRightAssociative(token: TokenType): boolean {\n return token === tt.exponent;\n}\n\nexport function tokenIsTemplate(token: TokenType): boolean {\n return token >= tt.templateTail && token <= tt.templateNonTail;\n}\n\nexport function getExportedToken(token: TokenType): ExportedTokenType {\n return tokenTypes[token];\n}\n\nexport function isTokenType(obj: any): boolean {\n return typeof obj === \"number\";\n}\n\nif (!process.env.BABEL_8_BREAKING) {\n tokenTypes[tt.braceR].updateContext = context => {\n context.pop();\n };\n\n tokenTypes[tt.braceL].updateContext =\n tokenTypes[tt.braceHashL].updateContext =\n tokenTypes[tt.dollarBraceL].updateContext =\n context => {\n context.push(tc.brace);\n };\n\n tokenTypes[tt.backQuote].updateContext = context => {\n if (context[context.length - 1] === tc.template) {\n context.pop();\n } else {\n context.push(tc.template);\n }\n };\n\n tokenTypes[tt.jsxTagStart].updateContext = context => {\n context.push(tc.j_expr, tc.j_oTag);\n };\n}\n","// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charCodes from \"charcodes\";\n\n// ## Character categories\n\n// Big ugly regular expressions that match characters in the\n// whitespace, identifier, and identifier-start categories. These\n// are only applied when a character is found to actually have a\n// code point between 0x80 and 0xffff.\n// Generated by `scripts/generate-identifier-regex.js`.\n\n/* prettier-ignore */\nlet 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-\\u1c88\\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-\\ua7ca\\ua7d0\\ua7d1\\ua7d3\\ua7d5-\\ua7d9\\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\";\n/* prettier-ignore */\nlet nonASCIIidentifierChars = \"\\u200c\\u200d\\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\\u0898-\\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\";\n\nconst nonASCIIidentifierStart = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + \"]\",\n);\nconst nonASCIIidentifier = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\",\n);\n\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null;\n\n// These are a run-length and offset-encoded representation of the\n// >0xffff code points that are a valid part of identifiers. The\n// offset starts at 0x10000, and each pair of numbers represents an\n// offset to the next range, and then a size of the range. They were\n// generated by `scripts/generate-identifier-regex.js`.\n/* prettier-ignore */\nconst astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191];\n/* prettier-ignore */\nconst astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239];\n\n// This has a complexity linear to the value of the code. The\n// assumption is that looking up astral identifier characters is\n// rare.\nfunction isInAstralSet(code: number, set: readonly number[]): boolean {\n let pos = 0x10000;\n for (let i = 0, length = set.length; i < length; i += 2) {\n pos += set[i];\n if (pos > code) return false;\n\n pos += set[i + 1];\n if (pos >= code) return true;\n }\n return false;\n}\n\n// Test whether a given character code starts an identifier.\n\nexport function isIdentifierStart(code: number): boolean {\n if (code < charCodes.uppercaseA) return code === charCodes.dollarSign;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return (\n code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code))\n );\n }\n return isInAstralSet(code, astralIdentifierStartCodes);\n}\n\n// Test whether a given character is part of an identifier.\n\nexport function isIdentifierChar(code: number): boolean {\n if (code < charCodes.digit0) return code === charCodes.dollarSign;\n if (code < charCodes.colon) return true;\n if (code < charCodes.uppercaseA) return false;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n }\n return (\n isInAstralSet(code, astralIdentifierStartCodes) ||\n isInAstralSet(code, astralIdentifierCodes)\n );\n}\n\n// Test whether a given string is a valid identifier name\n\nexport function isIdentifierName(name: string): boolean {\n let isFirst = true;\n for (let i = 0; i < name.length; i++) {\n // The implementation is based on\n // https://source.chromium.org/chromium/chromium/src/+/master:v8/src/builtins/builtins-string-gen.cc;l=1455;drc=221e331b49dfefadbc6fa40b0c68e6f97606d0b3;bpv=0;bpt=1\n // We reimplement `codePointAt` because `codePointAt` is a V8 builtin which is not inlined by TurboFan (as of M91)\n // since `name` is mostly ASCII, an inlined `charCodeAt` wins here\n let cp = name.charCodeAt(i);\n if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {\n const trail = name.charCodeAt(++i);\n if ((trail & 0xfc00) === 0xdc00) {\n cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);\n }\n }\n if (isFirst) {\n isFirst = false;\n if (!isIdentifierStart(cp)) {\n return false;\n }\n } else if (!isIdentifierChar(cp)) {\n return false;\n }\n }\n return !isFirst;\n}\n","const reservedWords = {\n keyword: [\n \"break\",\n \"case\",\n \"catch\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"var\",\n \"const\",\n \"while\",\n \"with\",\n \"new\",\n \"this\",\n \"super\",\n \"class\",\n \"extends\",\n \"export\",\n \"import\",\n \"null\",\n \"true\",\n \"false\",\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"void\",\n \"delete\",\n ],\n strict: [\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n ],\n strictBind: [\"eval\", \"arguments\"],\n};\nconst keywords = new Set(reservedWords.keyword);\nconst reservedWordsStrictSet = new Set(reservedWords.strict);\nconst reservedWordsStrictBindSet = new Set(reservedWords.strictBind);\n\n/**\n * Checks if word is a reserved word in non-strict mode\n */\nexport function isReservedWord(word: string, inModule: boolean): boolean {\n return (inModule && word === \"await\") || word === \"enum\";\n}\n\n/**\n * Checks if word is a reserved word in non-binding strict mode\n *\n * Includes non-strict reserved words\n */\nexport function isStrictReservedWord(word: string, inModule: boolean): boolean {\n return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode, but it is allowed as\n * a normal identifier.\n */\nexport function isStrictBindOnlyReservedWord(word: string): boolean {\n return reservedWordsStrictBindSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode\n *\n * Includes non-strict reserved words and non-binding strict reserved words\n */\nexport function isStrictBindReservedWord(\n word: string,\n inModule: boolean,\n): boolean {\n return (\n isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word)\n );\n}\n\nexport function isKeyword(word: string): boolean {\n return keywords.has(word);\n}\n","import * as charCodes from \"charcodes\";\nimport { isIdentifierStart } from \"@babel/helper-validator-identifier\";\n\nexport {\n isIdentifierStart,\n isIdentifierChar,\n isReservedWord,\n isStrictBindOnlyReservedWord,\n isStrictBindReservedWord,\n isStrictReservedWord,\n isKeyword,\n} from \"@babel/helper-validator-identifier\";\n\nexport const keywordRelationalOperator = /^in(stanceof)?$/;\n\n// Test whether a current state character code and next character code is @\n\nexport function isIteratorStart(\n current: number,\n next: number,\n next2: number,\n): boolean {\n return (\n current === charCodes.atSign &&\n next === charCodes.atSign &&\n isIdentifierStart(next2)\n );\n}\n\n// This is the comprehensive set of JavaScript reserved words\n// If a word is in this set, it could be a reserved word,\n// depending on sourceType/strictMode/binding info. In other words\n// if a word is not in this set, it is not a reserved word under\n// any circumstance.\nconst reservedWordLikeSet = new Set([\n \"break\",\n \"case\",\n \"catch\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"var\",\n \"const\",\n \"while\",\n \"with\",\n \"new\",\n \"this\",\n \"super\",\n \"class\",\n \"extends\",\n \"export\",\n \"import\",\n \"null\",\n \"true\",\n \"false\",\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"void\",\n \"delete\",\n // strict\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n // strictBind\n \"eval\",\n \"arguments\",\n // reservedWorkLike\n \"enum\",\n \"await\",\n]);\n\nexport function canBeReservedWord(word: string): boolean {\n return reservedWordLikeSet.has(word);\n}\n","import { ScopeFlag, BindingFlag } from \"./scopeflags.ts\";\nimport type { Position } from \"./location.ts\";\nimport type * as N from \"../types.ts\";\nimport { Errors } from \"../parse-error.ts\";\nimport type Tokenizer from \"../tokenizer/index.ts\";\n\nexport const enum NameType {\n // var-declared names in the current lexical scope\n Var = 1 << 0,\n // lexically-declared names in the current lexical scope\n Lexical = 1 << 1,\n // lexically-declared FunctionDeclaration names in the current lexical scope\n Function = 1 << 2,\n}\n\n// Start an AST node, attaching a start offset.\nexport class Scope {\n flags: ScopeFlag = 0;\n names: Map = new Map();\n firstLexicalName = \"\";\n\n constructor(flags: ScopeFlag) {\n this.flags = flags;\n }\n}\n\n// The functions in this module keep track of declared variables in the\n// current scope in order to detect duplicate variable names.\nexport default class ScopeHandler {\n parser: Tokenizer;\n scopeStack: Array = [];\n inModule: boolean;\n undefinedExports: Map = new Map();\n\n constructor(parser: Tokenizer, inModule: boolean) {\n this.parser = parser;\n this.inModule = inModule;\n }\n\n get inTopLevel() {\n return (this.currentScope().flags & ScopeFlag.PROGRAM) > 0;\n }\n get inFunction() {\n return (this.currentVarScopeFlags() & ScopeFlag.FUNCTION) > 0;\n }\n get allowSuper() {\n return (this.currentThisScopeFlags() & ScopeFlag.SUPER) > 0;\n }\n get allowDirectSuper() {\n return (this.currentThisScopeFlags() & ScopeFlag.DIRECT_SUPER) > 0;\n }\n get inClass() {\n return (this.currentThisScopeFlags() & ScopeFlag.CLASS) > 0;\n }\n get inClassAndNotInNonArrowFunction() {\n const flags = this.currentThisScopeFlags();\n return (flags & ScopeFlag.CLASS) > 0 && (flags & ScopeFlag.FUNCTION) === 0;\n }\n get inStaticBlock() {\n for (let i = this.scopeStack.length - 1; ; i--) {\n const { flags } = this.scopeStack[i];\n if (flags & ScopeFlag.STATIC_BLOCK) {\n return true;\n }\n if (flags & (ScopeFlag.VAR | ScopeFlag.CLASS)) {\n // function body, module body, class property initializers\n return false;\n }\n }\n }\n get inNonArrowFunction() {\n return (this.currentThisScopeFlags() & ScopeFlag.FUNCTION) > 0;\n }\n get treatFunctionsAsVar() {\n return this.treatFunctionsAsVarInScope(this.currentScope());\n }\n\n createScope(flags: ScopeFlag): Scope {\n return new Scope(flags);\n }\n\n enter(flags: ScopeFlag) {\n /*:: +createScope: (flags:ScopeFlag) => IScope; */\n // @ts-expect-error This method will be overwritten by subclasses\n this.scopeStack.push(this.createScope(flags));\n }\n\n exit(): ScopeFlag {\n const scope = this.scopeStack.pop();\n return scope.flags;\n }\n\n // The spec says:\n // > At the top level of a function, or script, function declarations are\n // > treated like var declarations rather than like lexical declarations.\n treatFunctionsAsVarInScope(scope: IScope): boolean {\n return !!(\n scope.flags & (ScopeFlag.FUNCTION | ScopeFlag.STATIC_BLOCK) ||\n (!this.parser.inModule && scope.flags & ScopeFlag.PROGRAM)\n );\n }\n\n declareName(name: string, bindingType: BindingFlag, loc: Position) {\n let scope = this.currentScope();\n if (\n bindingType & BindingFlag.SCOPE_LEXICAL ||\n bindingType & BindingFlag.SCOPE_FUNCTION\n ) {\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n\n let type = scope.names.get(name) || 0;\n\n if (bindingType & BindingFlag.SCOPE_FUNCTION) {\n type = type | NameType.Function;\n } else {\n if (!scope.firstLexicalName) {\n scope.firstLexicalName = name;\n }\n type = type | NameType.Lexical;\n }\n\n scope.names.set(name, type);\n\n if (bindingType & BindingFlag.SCOPE_LEXICAL) {\n this.maybeExportDefined(scope, name);\n }\n } else if (bindingType & BindingFlag.SCOPE_VAR) {\n for (let i = this.scopeStack.length - 1; i >= 0; --i) {\n scope = this.scopeStack[i];\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n scope.names.set(name, (scope.names.get(name) || 0) | NameType.Var);\n this.maybeExportDefined(scope, name);\n\n if (scope.flags & ScopeFlag.VAR) break;\n }\n }\n if (this.parser.inModule && scope.flags & ScopeFlag.PROGRAM) {\n this.undefinedExports.delete(name);\n }\n }\n\n maybeExportDefined(scope: IScope, name: string) {\n if (this.parser.inModule && scope.flags & ScopeFlag.PROGRAM) {\n this.undefinedExports.delete(name);\n }\n }\n\n checkRedeclarationInScope(\n scope: IScope,\n name: string,\n bindingType: BindingFlag,\n loc: Position,\n ) {\n if (this.isRedeclaredInScope(scope, name, bindingType)) {\n this.parser.raise(Errors.VarRedeclaration, loc, {\n identifierName: name,\n });\n }\n }\n\n isRedeclaredInScope(\n scope: IScope,\n name: string,\n bindingType: BindingFlag,\n ): boolean {\n if (!(bindingType & BindingFlag.KIND_VALUE)) return false;\n\n if (bindingType & BindingFlag.SCOPE_LEXICAL) {\n return scope.names.has(name);\n }\n\n const type = scope.names.get(name);\n\n if (bindingType & BindingFlag.SCOPE_FUNCTION) {\n return (\n (type & NameType.Lexical) > 0 ||\n (!this.treatFunctionsAsVarInScope(scope) && (type & NameType.Var) > 0)\n );\n }\n\n return (\n ((type & NameType.Lexical) > 0 &&\n // Annex B.3.4\n // https://tc39.es/ecma262/#sec-variablestatements-in-catch-blocks\n !(\n scope.flags & ScopeFlag.SIMPLE_CATCH &&\n scope.firstLexicalName === name\n )) ||\n (!this.treatFunctionsAsVarInScope(scope) &&\n (type & NameType.Function) > 0)\n );\n }\n\n checkLocalExport(id: N.Identifier) {\n const { name } = id;\n const topLevelScope = this.scopeStack[0];\n if (!topLevelScope.names.has(name)) {\n this.undefinedExports.set(name, id.loc.start);\n }\n }\n\n currentScope(): IScope {\n return this.scopeStack[this.scopeStack.length - 1];\n }\n\n currentVarScopeFlags(): ScopeFlag {\n for (let i = this.scopeStack.length - 1; ; i--) {\n const { flags } = this.scopeStack[i];\n if (flags & ScopeFlag.VAR) {\n return flags;\n }\n }\n }\n\n // Could be useful for `arguments`, `this`, `new.target`, `super()`, `super.property`, and `super[property]`.\n currentThisScopeFlags(): ScopeFlag {\n for (let i = this.scopeStack.length - 1; ; i--) {\n const { flags } = this.scopeStack[i];\n if (\n flags & (ScopeFlag.VAR | ScopeFlag.CLASS) &&\n !(flags & ScopeFlag.ARROW)\n ) {\n return flags;\n }\n }\n }\n}\n","import type { Position } from \"../../util/location.ts\";\nimport ScopeHandler, { NameType, Scope } from \"../../util/scope.ts\";\nimport { BindingFlag, type ScopeFlag } from \"../../util/scopeflags.ts\";\nimport type * as N from \"../../types.ts\";\n\n// Reference implementation: https://github.com/facebook/flow/blob/23aeb2a2ef6eb4241ce178fde5d8f17c5f747fb5/src/typing/env.ml#L536-L584\nclass FlowScope extends Scope {\n // declare function foo(): type;\n declareFunctions: Set = new Set();\n}\n\nexport default class FlowScopeHandler extends ScopeHandler {\n createScope(flags: ScopeFlag): FlowScope {\n return new FlowScope(flags);\n }\n\n declareName(name: string, bindingType: BindingFlag, loc: Position) {\n const scope = this.currentScope();\n if (bindingType & BindingFlag.FLAG_FLOW_DECLARE_FN) {\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n this.maybeExportDefined(scope, name);\n scope.declareFunctions.add(name);\n return;\n }\n\n super.declareName(name, bindingType, loc);\n }\n\n isRedeclaredInScope(\n scope: FlowScope,\n name: string,\n bindingType: BindingFlag,\n ): boolean {\n if (super.isRedeclaredInScope(scope, name, bindingType)) return true;\n\n if (\n bindingType & BindingFlag.FLAG_FLOW_DECLARE_FN &&\n !scope.declareFunctions.has(name)\n ) {\n const type = scope.names.get(name);\n return (type & NameType.Function) > 0 || (type & NameType.Lexical) > 0;\n }\n\n return false;\n }\n\n checkLocalExport(id: N.Identifier) {\n if (!this.scopeStack[0].declareFunctions.has(id.name)) {\n super.checkLocalExport(id);\n }\n }\n}\n","import type { Options } from \"../options.ts\";\nimport type State from \"../tokenizer/state.ts\";\nimport type { PluginsMap } from \"./index.ts\";\nimport type ScopeHandler from \"../util/scope.ts\";\nimport type ExpressionScopeHandler from \"../util/expression-scope.ts\";\nimport type ClassScopeHandler from \"../util/class-scope.ts\";\nimport type ProductionParameterHandler from \"../util/production-parameter.ts\";\nimport type {\n ParserPluginWithOptions,\n PluginConfig,\n PluginOptions,\n} from \"../typings.ts\";\nimport type * as N from \"../types.ts\";\n\nexport default class BaseParser {\n // Properties set by constructor in index.js\n declare options: Options;\n declare inModule: boolean;\n declare scope: ScopeHandler;\n declare classScope: ClassScopeHandler;\n declare prodParam: ProductionParameterHandler;\n declare expressionScope: ExpressionScopeHandler;\n declare plugins: PluginsMap;\n declare filename: string | undefined | null;\n // Names of exports store. `default` is stored as a name for both\n // `export default foo;` and `export { foo as default };`.\n declare exportedIdentifiers: Set;\n sawUnambiguousESM: boolean = false;\n ambiguousScriptDifferentAst: boolean = false;\n\n // Initialized by Tokenizer\n declare state: State;\n // input and length are not in state as they are constant and we do\n // not want to ever copy them, which happens if state gets cloned\n declare input: string;\n declare length: number;\n // Comment store for Program.comments\n declare comments: Array;\n\n // This method accepts either a string (plugin name) or an array pair\n // (plugin name and options object). If an options object is given,\n // then each value is non-recursively checked for identity with that\n // plugin’s actual option value.\n hasPlugin(pluginConfig: PluginConfig): boolean {\n if (typeof pluginConfig === \"string\") {\n return this.plugins.has(pluginConfig);\n } else {\n const [pluginName, pluginOptions] = pluginConfig;\n if (!this.hasPlugin(pluginName)) {\n return false;\n }\n const actualOptions = this.plugins.get(pluginName);\n for (const key of Object.keys(\n pluginOptions,\n ) as (keyof typeof pluginOptions)[]) {\n if (actualOptions?.[key] !== pluginOptions[key]) {\n return false;\n }\n }\n return true;\n }\n }\n\n getPluginOption<\n PluginName extends ParserPluginWithOptions[0],\n OptionName extends keyof PluginOptions,\n >(plugin: PluginName, name: OptionName) {\n return (this.plugins.get(plugin) as null | PluginOptions)?.[\n name\n ];\n }\n}\n","/*:: declare var invariant; */\n\nimport BaseParser from \"./base.ts\";\nimport type { Comment, Node, Identifier } from \"../types.ts\";\nimport * as charCodes from \"charcodes\";\nimport type { Undone } from \"./node.ts\";\n\n/**\n * A whitespace token containing comments\n */\nexport type CommentWhitespace = {\n /**\n * the start of the whitespace token.\n */\n start: number;\n /**\n * the end of the whitespace token.\n */\n end: number;\n /**\n * the containing comments\n */\n comments: Array;\n /**\n * the immediately preceding AST node of the whitespace token\n */\n leadingNode: Node | null;\n /**\n * the immediately following AST node of the whitespace token\n */\n trailingNode: Node | null;\n /**\n * the innermost AST node containing the whitespace with minimal size (|end - start|)\n */\n containingNode: Node | null;\n};\n\n/**\n * Merge comments with node's trailingComments or assign comments to be\n * trailingComments. New comments will be placed before old comments\n * because the commentStack is enumerated reversely.\n */\nfunction setTrailingComments(node: Undone, comments: Array) {\n if (node.trailingComments === undefined) {\n node.trailingComments = comments;\n } else {\n node.trailingComments.unshift(...comments);\n }\n}\n\n/**\n * Merge comments with node's leadingComments or assign comments to be\n * leadingComments. New comments will be placed before old comments\n * because the commentStack is enumerated reversely.\n */\nfunction setLeadingComments(node: Undone, comments: Array) {\n if (node.leadingComments === undefined) {\n node.leadingComments = comments;\n } else {\n node.leadingComments.unshift(...comments);\n }\n}\n\n/**\n * Merge comments with node's innerComments or assign comments to be\n * innerComments. New comments will be placed before old comments\n * because the commentStack is enumerated reversely.\n */\nexport function setInnerComments(\n node: Undone,\n comments?: Array,\n) {\n if (node.innerComments === undefined) {\n node.innerComments = comments;\n } else {\n node.innerComments.unshift(...comments);\n }\n}\n\n/**\n * Given node and elements array, if elements has non-null element,\n * merge comments to its trailingComments, otherwise merge comments\n * to node's innerComments\n */\nfunction adjustInnerComments(\n node: Undone,\n elements: Array,\n commentWS: CommentWhitespace,\n) {\n let lastElement = null;\n let i = elements.length;\n while (lastElement === null && i > 0) {\n lastElement = elements[--i];\n }\n if (lastElement === null || lastElement.start > commentWS.start) {\n setInnerComments(node, commentWS.comments);\n } else {\n setTrailingComments(lastElement, commentWS.comments);\n }\n}\n\nexport default class CommentsParser extends BaseParser {\n addComment(comment: Comment): void {\n if (this.filename) comment.loc.filename = this.filename;\n const { commentsLen } = this.state;\n if (this.comments.length !== commentsLen) {\n this.comments.length = commentsLen;\n }\n this.comments.push(comment);\n this.state.commentsLen++;\n }\n\n /**\n * Given a newly created AST node _n_, attach _n_ to a comment whitespace _w_ if applicable\n * {@see {@link CommentWhitespace}}\n */\n processComment(node: Node): void {\n const { commentStack } = this.state;\n const commentStackLength = commentStack.length;\n if (commentStackLength === 0) return;\n let i = commentStackLength - 1;\n const lastCommentWS = commentStack[i];\n\n if (lastCommentWS.start === node.end) {\n lastCommentWS.leadingNode = node;\n i--;\n }\n\n const { start: nodeStart } = node;\n // invariant: for all 0 <= j <= i, let c = commentStack[j], c must satisfy c.end < node.end\n for (; i >= 0; i--) {\n const commentWS = commentStack[i];\n const commentEnd = commentWS.end;\n if (commentEnd > nodeStart) {\n // by definition of commentWhiteSpace, this implies commentWS.start > nodeStart\n // so node can be a containingNode candidate. At this time we can finalize the comment\n // whitespace, because\n // 1) its leadingNode or trailingNode, if exists, will not change\n // 2) its containingNode have been assigned and will not change because it is the\n // innermost minimal-sized AST node\n commentWS.containingNode = node;\n this.finalizeComment(commentWS);\n commentStack.splice(i, 1);\n } else {\n if (commentEnd === nodeStart) {\n commentWS.trailingNode = node;\n }\n // stop the loop when commentEnd <= nodeStart\n break;\n }\n }\n }\n\n /**\n * Assign the comments of comment whitespaces to related AST nodes.\n * Also adjust innerComments following trailing comma.\n */\n finalizeComment(commentWS: CommentWhitespace) {\n const { comments } = commentWS;\n if (commentWS.leadingNode !== null || commentWS.trailingNode !== null) {\n if (commentWS.leadingNode !== null) {\n setTrailingComments(commentWS.leadingNode, comments);\n }\n if (commentWS.trailingNode !== null) {\n setLeadingComments(commentWS.trailingNode, comments);\n }\n } else {\n /*:: invariant(commentWS.containingNode !== null) */\n const { containingNode: node, start: commentStart } = commentWS;\n if (this.input.charCodeAt(commentStart - 1) === charCodes.comma) {\n // If a commentWhitespace follows a comma and the containingNode allows\n // list structures with trailing comma, merge it to the trailingComment\n // of the last non-null list element\n switch (node.type) {\n case \"ObjectExpression\":\n case \"ObjectPattern\":\n case \"RecordExpression\":\n adjustInnerComments(node, node.properties, commentWS);\n break;\n case \"CallExpression\":\n case \"OptionalCallExpression\":\n adjustInnerComments(node, node.arguments, commentWS);\n break;\n case \"FunctionDeclaration\":\n case \"FunctionExpression\":\n case \"ArrowFunctionExpression\":\n case \"ObjectMethod\":\n case \"ClassMethod\":\n case \"ClassPrivateMethod\":\n adjustInnerComments(node, node.params, commentWS);\n break;\n case \"ArrayExpression\":\n case \"ArrayPattern\":\n case \"TupleExpression\":\n adjustInnerComments(node, node.elements, commentWS);\n break;\n case \"ExportNamedDeclaration\":\n case \"ImportDeclaration\":\n adjustInnerComments(node, node.specifiers, commentWS);\n break;\n default: {\n setInnerComments(node, comments);\n }\n }\n } else {\n setInnerComments(node, comments);\n }\n }\n }\n\n /**\n * Drains remaining commentStack and applies finalizeComment\n * to each comment whitespace. Used only in parseExpression\n * where the top level AST node is _not_ Program\n * {@see {@link CommentsParser#finalizeComment}}\n */\n finalizeRemainingComments() {\n const { commentStack } = this.state;\n for (let i = commentStack.length - 1; i >= 0; i--) {\n this.finalizeComment(commentStack[i]);\n }\n this.state.commentStack = [];\n }\n\n /* eslint-disable no-irregular-whitespace */\n /**\n * Reset previous node trailing comments. Used in object / class\n * property parsing. We parse `async`, `static`, `set` and `get`\n * as an identifier but may reinterpret it into an async/static/accessor\n * method later. In this case the identifier is not part of the AST and we\n * should sync the knowledge to commentStacks\n *\n * For example, when parsing\n * ```\n * async /* 1 */ function f() {}\n * ```\n * the comment whitespace `/* 1 */` has leading node Identifier(async). When\n * we see the function token, we create a Function node and mark `/* 1 */` as\n * inner comments. So `/* 1 */` should be detached from the Identifier node.\n *\n * @param node the last finished AST node _before_ current token\n */\n /* eslint-enable no-irregular-whitespace */\n resetPreviousNodeTrailingComments(node: Node) {\n const { commentStack } = this.state;\n const { length } = commentStack;\n if (length === 0) return;\n const commentWS = commentStack[length - 1];\n if (commentWS.leadingNode === node) {\n commentWS.leadingNode = null;\n }\n }\n\n /* eslint-disable no-irregular-whitespace */\n /**\n * Reset previous node leading comments, assuming that `node` is a\n * single-token node. Used in import phase modifiers parsing. We parse\n * `module` in `import module foo from ...` as an identifier but may\n * reinterpret it into a phase modifier later. In this case the identifier is\n * not part of the AST and we should sync the knowledge to commentStacks\n *\n * For example, when parsing\n * ```\n * import /* 1 */ module a from \"a\";\n * ```\n * the comment whitespace `/* 1 */` has trailing node Identifier(module). When\n * we see that `module` is not a default import binding, we mark `/* 1 */` as\n * inner comments of the ImportDeclaration. So `/* 1 */` should be detached from\n * the Identifier node.\n *\n * @param node the last finished AST node _before_ current token\n */\n /* eslint-enable no-irregular-whitespace */\n resetPreviousIdentifierLeadingComments(node: Identifier) {\n const { commentStack } = this.state;\n const { length } = commentStack;\n if (length === 0) return;\n\n if (commentStack[length - 1].trailingNode === node) {\n commentStack[length - 1].trailingNode = null;\n } else if (length >= 2 && commentStack[length - 2].trailingNode === node) {\n commentStack[length - 2].trailingNode = null;\n }\n }\n\n /**\n * Attach a node to the comment whitespaces right before/after\n * the given range.\n *\n * This is used to properly attach comments around parenthesized\n * expressions as leading/trailing comments of the inner expression.\n */\n takeSurroundingComments(node: Node, start: number, end: number) {\n const { commentStack } = this.state;\n const commentStackLength = commentStack.length;\n if (commentStackLength === 0) return;\n let i = commentStackLength - 1;\n\n for (; i >= 0; i--) {\n const commentWS = commentStack[i];\n const commentEnd = commentWS.end;\n const commentStart = commentWS.start;\n\n if (commentStart === end) {\n commentWS.leadingNode = node;\n } else if (commentEnd === start) {\n commentWS.trailingNode = node;\n } else if (commentEnd < start) {\n break;\n }\n }\n }\n}\n","import * as charCodes from \"charcodes\";\n\n// Matches a whole line break (where CRLF is considered a single\n// line break). Used to count lines.\nexport const lineBreak = /\\r\\n|[\\r\\n\\u2028\\u2029]/;\nexport const lineBreakG = new RegExp(lineBreak.source, \"g\");\n\n// https://tc39.github.io/ecma262/#sec-line-terminators\nexport function isNewLine(code: number): boolean {\n switch (code) {\n case charCodes.lineFeed:\n case charCodes.carriageReturn:\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n return true;\n\n default:\n return false;\n }\n}\n\nexport function hasNewLine(input: string, start: number, end: number): boolean {\n for (let i = start; i < end; i++) {\n if (isNewLine(input.charCodeAt(i))) {\n return true;\n }\n }\n return false;\n}\n\nexport const skipWhiteSpace = /(?:\\s|\\/\\/.*|\\/\\*[^]*?\\*\\/)*/g;\n\nexport const skipWhiteSpaceInLine =\n /(?:[^\\S\\n\\r\\u2028\\u2029]|\\/\\/.*|\\/\\*.*?\\*\\/)*/g;\n\n// https://tc39.github.io/ecma262/#sec-white-space\nexport function isWhitespace(code: number): boolean {\n switch (code) {\n case 0x0009: // CHARACTER TABULATION\n case 0x000b: // LINE TABULATION\n case 0x000c: // FORM FEED\n case charCodes.space:\n case charCodes.nonBreakingSpace:\n case charCodes.oghamSpaceMark:\n case 0x2000: // EN QUAD\n case 0x2001: // EM QUAD\n case 0x2002: // EN SPACE\n case 0x2003: // EM SPACE\n case 0x2004: // THREE-PER-EM SPACE\n case 0x2005: // FOUR-PER-EM SPACE\n case 0x2006: // SIX-PER-EM SPACE\n case 0x2007: // FIGURE SPACE\n case 0x2008: // PUNCTUATION SPACE\n case 0x2009: // THIN SPACE\n case 0x200a: // HAIR SPACE\n case 0x202f: // NARROW NO-BREAK SPACE\n case 0x205f: // MEDIUM MATHEMATICAL SPACE\n case 0x3000: // IDEOGRAPHIC SPACE\n case 0xfeff: // ZERO WIDTH NO-BREAK SPACE\n return true;\n\n default:\n return false;\n }\n}\n","import type { Options } from \"../options.ts\";\nimport type { CommentWhitespace } from \"../parser/comments\";\nimport { Position } from \"../util/location.ts\";\n\nimport { types as ct, type TokContext } from \"./context.ts\";\nimport { tt, type TokenType } from \"./types.ts\";\nimport type { Errors } from \"../parse-error.ts\";\nimport type { ParseError } from \"../parse-error.ts\";\n\nexport type DeferredStrictError =\n | typeof Errors.StrictNumericEscape\n | typeof Errors.StrictOctalLiteral;\n\ntype TopicContextState = {\n // When a topic binding has been currently established,\n // then this is 1. Otherwise, it is 0. This is forwards compatible\n // with a future plugin for multiple lexical topics.\n maxNumOfResolvableTopics: number;\n // When a topic binding has been currently established, and if that binding\n // has been used as a topic reference `#`, then this is 0. Otherwise, it is\n // `null`. This is forwards compatible with a future plugin for multiple\n // lexical topics.\n maxTopicIndex: null | 0;\n};\n\nexport const enum LoopLabelKind {\n Loop = 1,\n Switch = 2,\n}\n\ndeclare const bit: import(\"../../../../scripts/babel-plugin-bit-decorator/types.d.ts\").BitDecorator;\n\nexport default class State {\n @bit.storage flags: number;\n\n @bit accessor strict = false;\n\n curLine: number;\n lineStart: number;\n\n // And, if locations are used, the {line, column} object\n // corresponding to those offsets\n startLoc: Position;\n endLoc: Position;\n\n init({ strictMode, sourceType, startLine, startColumn }: Options): void {\n this.strict =\n strictMode === false\n ? false\n : strictMode === true\n ? true\n : sourceType === \"module\";\n\n this.curLine = startLine;\n this.lineStart = -startColumn;\n this.startLoc = this.endLoc = new Position(startLine, startColumn, 0);\n }\n\n errors: ParseError[] = [];\n\n // Used to signify the start of a potential arrow function\n potentialArrowAt: number = -1;\n\n // Used to signify the start of an expression which looks like a\n // typed arrow function, but it isn't\n // e.g. a ? (b) : c => d\n // ^\n noArrowAt: number[] = [];\n\n // Used to signify the start of an expression whose params, if it looks like\n // an arrow function, shouldn't be converted to assignable nodes.\n // This is used to defer the validation of typed arrow functions inside\n // conditional expressions.\n // e.g. a ? (b) : c => d\n // ^\n noArrowParamsConversionAt: number[] = [];\n\n // Flags to track\n @bit accessor maybeInArrowParameters = false;\n @bit accessor inType = false;\n @bit accessor noAnonFunctionType = false;\n @bit accessor hasFlowComment = false;\n @bit accessor isAmbientContext = false;\n @bit accessor inAbstractClass = false;\n @bit accessor inDisallowConditionalTypesContext = false;\n\n // For the Hack-style pipelines plugin\n topicContext: TopicContextState = {\n maxNumOfResolvableTopics: 0,\n maxTopicIndex: null,\n };\n\n // For the F#-style pipelines plugin\n @bit accessor soloAwait = false;\n @bit accessor inFSharpPipelineDirectBody = false;\n\n // Labels in scope.\n labels: Array<{\n kind: LoopLabelKind;\n name?: string | null;\n statementStart?: number;\n }> = [];\n\n commentsLen = 0;\n // Comment attachment store\n commentStack: Array = [];\n\n // The current position of the tokenizer in the input.\n pos: number = 0;\n\n // Properties of the current token:\n // Its type\n type: TokenType = tt.eof;\n\n // For tokens that include more information than their type, the value\n value: any = null;\n\n // Its start and end offset\n start: number = 0;\n end: number = 0;\n\n // Position information for the previous token\n // this is initialized when generating the second token.\n lastTokEndLoc: Position = null;\n // this is initialized when generating the second token.\n lastTokStartLoc: Position = null;\n\n // The context stack is used to track whether the apostrophe \"`\" starts\n // or ends a string template\n context: Array = [ct.brace];\n\n // Used to track whether a JSX element is allowed to form\n @bit accessor canStartJSXElement = true;\n\n // Used to signal to callers of `readWord1` whether the word\n // contained any escape sequences. This is needed because words with\n // escape sequences must not be interpreted as keywords.\n @bit accessor containsEsc = false;\n\n // Used to track invalid escape sequences in template literals,\n // that must be reported if the template is not tagged.\n firstInvalidTemplateEscapePos: null | Position = null;\n\n @bit accessor hasTopLevelAwait = false;\n\n // This property is used to track the following errors\n // - StrictNumericEscape\n // - StrictOctalLiteral\n //\n // in a literal that occurs prior to/immediately after a \"use strict\" directive.\n\n // todo(JLHwung): set strictErrors to null and avoid recording string errors\n // after a non-directive is parsed\n strictErrors: Map = new Map();\n\n // Tokens length in token store\n tokensLength: number = 0;\n\n /**\n * When we add a new property, we must manually update the `clone` method\n * @see State#clone\n */\n\n curPosition(): Position {\n return new Position(this.curLine, this.pos - this.lineStart, this.pos);\n }\n\n clone(): State {\n const state = new State();\n state.flags = this.flags;\n state.curLine = this.curLine;\n state.lineStart = this.lineStart;\n state.startLoc = this.startLoc;\n state.endLoc = this.endLoc;\n state.errors = this.errors.slice();\n state.potentialArrowAt = this.potentialArrowAt;\n state.noArrowAt = this.noArrowAt.slice();\n state.noArrowParamsConversionAt = this.noArrowParamsConversionAt.slice();\n state.topicContext = this.topicContext;\n state.labels = this.labels.slice();\n state.commentsLen = this.commentsLen;\n state.commentStack = this.commentStack.slice();\n state.pos = this.pos;\n state.type = this.type;\n state.value = this.value;\n state.start = this.start;\n state.end = this.end;\n state.lastTokEndLoc = this.lastTokEndLoc;\n state.lastTokStartLoc = this.lastTokStartLoc;\n state.context = this.context.slice();\n state.firstInvalidTemplateEscapePos = this.firstInvalidTemplateEscapePos;\n state.strictErrors = this.strictErrors;\n state.tokensLength = this.tokensLength;\n\n return state;\n }\n}\n\nexport type LookaheadState = {\n pos: number;\n value: any;\n type: TokenType;\n start: number;\n end: number;\n context: TokContext[];\n startLoc: Position;\n lastTokEndLoc: Position;\n curLine: number;\n lineStart: number;\n curPosition: () => Position;\n /* Used only in readToken_mult_modulo */\n inType: boolean;\n // These boolean properties are not initialized in createLookaheadState()\n // instead they will only be set by the tokenizer\n containsEsc?: boolean;\n};\n","// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charCodes from \"charcodes\";\n\n// The following character codes are forbidden from being\n// an immediate sibling of NumericLiteralSeparator _\nconst forbiddenNumericSeparatorSiblings = {\n decBinOct: new Set([\n charCodes.dot,\n charCodes.uppercaseB,\n charCodes.uppercaseE,\n charCodes.uppercaseO,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseB,\n charCodes.lowercaseE,\n charCodes.lowercaseO,\n ]),\n hex: new Set([\n charCodes.dot,\n charCodes.uppercaseX,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseX,\n ]),\n};\n\nconst isAllowedNumericSeparatorSibling = {\n // 0 - 1\n bin: (ch: number) => ch === charCodes.digit0 || ch === charCodes.digit1,\n\n // 0 - 7\n oct: (ch: number) => ch >= charCodes.digit0 && ch <= charCodes.digit7,\n\n // 0 - 9\n dec: (ch: number) => ch >= charCodes.digit0 && ch <= charCodes.digit9,\n\n // 0 - 9, A - F, a - f,\n hex: (ch: number) =>\n (ch >= charCodes.digit0 && ch <= charCodes.digit9) ||\n (ch >= charCodes.uppercaseA && ch <= charCodes.uppercaseF) ||\n (ch >= charCodes.lowercaseA && ch <= charCodes.lowercaseF),\n};\n\nexport type StringContentsErrorHandlers = EscapedCharErrorHandlers & {\n unterminated(\n initialPos: number,\n initialLineStart: number,\n initialCurLine: number,\n ): void;\n};\n\nexport function readStringContents(\n type: \"single\" | \"double\" | \"template\",\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n errors: StringContentsErrorHandlers,\n) {\n const initialPos = pos;\n const initialLineStart = lineStart;\n const initialCurLine = curLine;\n\n let out = \"\";\n let firstInvalidLoc = null;\n let chunkStart = pos;\n const { length } = input;\n for (;;) {\n if (pos >= length) {\n errors.unterminated(initialPos, initialLineStart, initialCurLine);\n out += input.slice(chunkStart, pos);\n break;\n }\n const ch = input.charCodeAt(pos);\n if (isStringEnd(type, ch, input, pos)) {\n out += input.slice(chunkStart, pos);\n break;\n }\n if (ch === charCodes.backslash) {\n out += input.slice(chunkStart, pos);\n const res = readEscapedChar(\n input,\n pos,\n lineStart,\n curLine,\n type === \"template\",\n errors,\n );\n if (res.ch === null && !firstInvalidLoc) {\n firstInvalidLoc = { pos, lineStart, curLine };\n } else {\n out += res.ch;\n }\n ({ pos, lineStart, curLine } = res);\n chunkStart = pos;\n } else if (\n ch === charCodes.lineSeparator ||\n ch === charCodes.paragraphSeparator\n ) {\n ++pos;\n ++curLine;\n lineStart = pos;\n } else if (ch === charCodes.lineFeed || ch === charCodes.carriageReturn) {\n if (type === \"template\") {\n out += input.slice(chunkStart, pos) + \"\\n\";\n ++pos;\n if (\n ch === charCodes.carriageReturn &&\n input.charCodeAt(pos) === charCodes.lineFeed\n ) {\n ++pos;\n }\n ++curLine;\n chunkStart = lineStart = pos;\n } else {\n errors.unterminated(initialPos, initialLineStart, initialCurLine);\n }\n } else {\n ++pos;\n }\n }\n return process.env.BABEL_8_BREAKING\n ? { pos, str: out, firstInvalidLoc, lineStart, curLine }\n : {\n pos,\n str: out,\n firstInvalidLoc,\n lineStart,\n curLine,\n containsInvalid: !!firstInvalidLoc,\n };\n}\n\nfunction isStringEnd(\n type: \"single\" | \"double\" | \"template\",\n ch: number,\n input: string,\n pos: number,\n) {\n if (type === \"template\") {\n return (\n ch === charCodes.graveAccent ||\n (ch === charCodes.dollarSign &&\n input.charCodeAt(pos + 1) === charCodes.leftCurlyBrace)\n );\n }\n return (\n ch === (type === \"double\" ? charCodes.quotationMark : charCodes.apostrophe)\n );\n}\n\ntype EscapedCharErrorHandlers = HexCharErrorHandlers &\n CodePointErrorHandlers & {\n strictNumericEscape(pos: number, lineStart: number, curLine: number): void;\n };\n\nfunction readEscapedChar(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n inTemplate: boolean,\n errors: EscapedCharErrorHandlers,\n) {\n const throwOnInvalid = !inTemplate;\n pos++; // skip '\\'\n\n const res = (ch: string | null) => ({ pos, ch, lineStart, curLine });\n\n const ch = input.charCodeAt(pos++);\n switch (ch) {\n case charCodes.lowercaseN:\n return res(\"\\n\");\n case charCodes.lowercaseR:\n return res(\"\\r\");\n case charCodes.lowercaseX: {\n let code;\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n 2,\n false,\n throwOnInvalid,\n errors,\n ));\n return res(code === null ? null : String.fromCharCode(code));\n }\n case charCodes.lowercaseU: {\n let code;\n ({ code, pos } = readCodePoint(\n input,\n pos,\n lineStart,\n curLine,\n throwOnInvalid,\n errors,\n ));\n return res(code === null ? null : String.fromCodePoint(code));\n }\n case charCodes.lowercaseT:\n return res(\"\\t\");\n case charCodes.lowercaseB:\n return res(\"\\b\");\n case charCodes.lowercaseV:\n return res(\"\\u000b\");\n case charCodes.lowercaseF:\n return res(\"\\f\");\n case charCodes.carriageReturn:\n if (input.charCodeAt(pos) === charCodes.lineFeed) {\n ++pos;\n }\n // fall through\n case charCodes.lineFeed:\n lineStart = pos;\n ++curLine;\n // fall through\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n return res(\"\");\n case charCodes.digit8:\n case charCodes.digit9:\n if (inTemplate) {\n return res(null);\n } else {\n errors.strictNumericEscape(pos - 1, lineStart, curLine);\n }\n // fall through\n default:\n if (ch >= charCodes.digit0 && ch <= charCodes.digit7) {\n const startPos = pos - 1;\n const match = /^[0-7]+/.exec(input.slice(startPos, pos + 2));\n\n let octalStr = match[0];\n\n let octal = parseInt(octalStr, 8);\n if (octal > 255) {\n octalStr = octalStr.slice(0, -1);\n octal = parseInt(octalStr, 8);\n }\n pos += octalStr.length - 1;\n const next = input.charCodeAt(pos);\n if (\n octalStr !== \"0\" ||\n next === charCodes.digit8 ||\n next === charCodes.digit9\n ) {\n if (inTemplate) {\n return res(null);\n } else {\n errors.strictNumericEscape(startPos, lineStart, curLine);\n }\n }\n\n return res(String.fromCharCode(octal));\n }\n\n return res(String.fromCharCode(ch));\n }\n}\n\ntype HexCharErrorHandlers = IntErrorHandlers & {\n invalidEscapeSequence(pos: number, lineStart: number, curLine: number): void;\n};\n\n// Used to read character escape sequences ('\\x', '\\u').\nfunction readHexChar(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n len: number,\n forceLen: boolean,\n throwOnInvalid: boolean,\n errors: HexCharErrorHandlers,\n) {\n const initialPos = pos;\n let n;\n ({ n, pos } = readInt(\n input,\n pos,\n lineStart,\n curLine,\n 16,\n len,\n forceLen,\n false,\n errors,\n /* bailOnError */ !throwOnInvalid,\n ));\n if (n === null) {\n if (throwOnInvalid) {\n errors.invalidEscapeSequence(initialPos, lineStart, curLine);\n } else {\n pos = initialPos - 1;\n }\n }\n return { code: n, pos };\n}\n\nexport type IntErrorHandlers = {\n numericSeparatorInEscapeSequence(\n pos: number,\n lineStart: number,\n curLine: number,\n ): void;\n unexpectedNumericSeparator(\n pos: number,\n lineStart: number,\n curLine: number,\n ): void;\n // It can return \"true\" to indicate that the error was handled\n // and the int parsing should continue.\n invalidDigit(\n pos: number,\n lineStart: number,\n curLine: number,\n radix: number,\n ): boolean;\n};\n\nexport function readInt(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n radix: number,\n len: number | undefined,\n forceLen: boolean,\n allowNumSeparator: boolean | \"bail\",\n errors: IntErrorHandlers,\n bailOnError: boolean,\n) {\n const start = pos;\n const forbiddenSiblings =\n radix === 16\n ? forbiddenNumericSeparatorSiblings.hex\n : forbiddenNumericSeparatorSiblings.decBinOct;\n const isAllowedSibling =\n radix === 16\n ? isAllowedNumericSeparatorSibling.hex\n : radix === 10\n ? isAllowedNumericSeparatorSibling.dec\n : radix === 8\n ? isAllowedNumericSeparatorSibling.oct\n : isAllowedNumericSeparatorSibling.bin;\n\n let invalid = false;\n let total = 0;\n\n for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {\n const code = input.charCodeAt(pos);\n let val;\n\n if (code === charCodes.underscore && allowNumSeparator !== \"bail\") {\n const prev = input.charCodeAt(pos - 1);\n const next = input.charCodeAt(pos + 1);\n\n if (!allowNumSeparator) {\n if (bailOnError) return { n: null, pos };\n errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine);\n } else if (\n Number.isNaN(next) ||\n !isAllowedSibling(next) ||\n forbiddenSiblings.has(prev) ||\n forbiddenSiblings.has(next)\n ) {\n if (bailOnError) return { n: null, pos };\n errors.unexpectedNumericSeparator(pos, lineStart, curLine);\n }\n\n // Ignore this _ character\n ++pos;\n continue;\n }\n\n if (code >= charCodes.lowercaseA) {\n val = code - charCodes.lowercaseA + charCodes.lineFeed;\n } else if (code >= charCodes.uppercaseA) {\n val = code - charCodes.uppercaseA + charCodes.lineFeed;\n } else if (charCodes.isDigit(code)) {\n val = code - charCodes.digit0; // 0-9\n } else {\n val = Infinity;\n }\n if (val >= radix) {\n // If we found a digit which is too big, errors.invalidDigit can return true to avoid\n // breaking the loop (this is used for error recovery).\n if (val <= 9 && bailOnError) {\n return { n: null, pos };\n } else if (\n val <= 9 &&\n errors.invalidDigit(pos, lineStart, curLine, radix)\n ) {\n val = 0;\n } else if (forceLen) {\n val = 0;\n invalid = true;\n } else {\n break;\n }\n }\n ++pos;\n total = total * radix + val;\n }\n if (pos === start || (len != null && pos - start !== len) || invalid) {\n return { n: null, pos };\n }\n\n return { n: total, pos };\n}\n\nexport type CodePointErrorHandlers = HexCharErrorHandlers & {\n invalidCodePoint(pos: number, lineStart: number, curLine: number): void;\n};\n\nexport function readCodePoint(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n throwOnInvalid: boolean,\n errors: CodePointErrorHandlers,\n) {\n const ch = input.charCodeAt(pos);\n let code;\n\n if (ch === charCodes.leftCurlyBrace) {\n ++pos;\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n input.indexOf(\"}\", pos) - pos,\n true,\n throwOnInvalid,\n errors,\n ));\n ++pos;\n if (code !== null && code > 0x10ffff) {\n if (throwOnInvalid) {\n errors.invalidCodePoint(pos, lineStart, curLine);\n } else {\n return { code: null, pos };\n }\n }\n } else {\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n 4,\n false,\n throwOnInvalid,\n errors,\n ));\n }\n return { code, pos };\n}\n","/*:: declare var invariant; */\n\nimport type { Options } from \"../options.ts\";\nimport {\n Position,\n SourceLocation,\n createPositionWithColumnOffset,\n} from \"../util/location.ts\";\nimport CommentsParser, { type CommentWhitespace } from \"../parser/comments.ts\";\nimport type * as N from \"../types.ts\";\nimport * as charCodes from \"charcodes\";\nimport { isIdentifierStart, isIdentifierChar } from \"../util/identifier.ts\";\nimport {\n tokenIsKeyword,\n tokenLabelName,\n tt,\n keywords as keywordTypes,\n type TokenType,\n} from \"./types.ts\";\nimport type { TokContext } from \"./context.ts\";\nimport {\n Errors,\n type ParseError,\n type ParseErrorConstructor,\n} from \"../parse-error.ts\";\nimport {\n lineBreakG,\n isNewLine,\n isWhitespace,\n skipWhiteSpace,\n skipWhiteSpaceInLine,\n} from \"../util/whitespace.ts\";\nimport State from \"./state.ts\";\nimport type { LookaheadState, DeferredStrictError } from \"./state.ts\";\nimport type { Undone } from \"../parser/node.ts\";\nimport type { Node } from \"../types.ts\";\n\nimport {\n readInt,\n readCodePoint,\n readStringContents,\n type IntErrorHandlers,\n type CodePointErrorHandlers,\n type StringContentsErrorHandlers,\n} from \"@babel/helper-string-parser\";\n\nimport type { Plugin } from \"../typings.ts\";\n\nfunction buildPosition(pos: number, lineStart: number, curLine: number) {\n return new Position(curLine, pos - lineStart, pos);\n}\n\nconst VALID_REGEX_FLAGS = new Set([\n charCodes.lowercaseG,\n charCodes.lowercaseM,\n charCodes.lowercaseS,\n charCodes.lowercaseI,\n charCodes.lowercaseY,\n charCodes.lowercaseU,\n charCodes.lowercaseD,\n charCodes.lowercaseV,\n]);\n\n// Object type used to represent tokens. Note that normally, tokens\n// simply exist as properties on the parser object. This is only\n// used for the onToken callback and the external tokenizer.\n\nexport class Token {\n constructor(state: State) {\n this.type = state.type;\n this.value = state.value;\n this.start = state.start;\n this.end = state.end;\n this.loc = new SourceLocation(state.startLoc, state.endLoc);\n }\n\n declare type: TokenType;\n declare value: any;\n declare start: number;\n declare end: number;\n declare loc: SourceLocation;\n}\n\n// ## Tokenizer\n\nexport default abstract class Tokenizer extends CommentsParser {\n isLookahead: boolean;\n\n // Token store.\n tokens: Array = [];\n\n constructor(options: Options, input: string) {\n super();\n this.state = new State();\n this.state.init(options);\n this.input = input;\n this.length = input.length;\n this.comments = [];\n this.isLookahead = false;\n }\n\n pushToken(token: Token | N.Comment) {\n // Pop out invalid tokens trapped by try-catch parsing.\n // Those parsing branches are mainly created by typescript and flow plugins.\n this.tokens.length = this.state.tokensLength;\n this.tokens.push(token);\n ++this.state.tokensLength;\n }\n\n // Move to the next token\n\n next(): void {\n this.checkKeywordEscapes();\n if (this.options.tokens) {\n this.pushToken(new Token(this.state));\n }\n\n this.state.lastTokEndLoc = this.state.endLoc;\n this.state.lastTokStartLoc = this.state.startLoc;\n this.nextToken();\n }\n\n eat(type: TokenType): boolean {\n if (this.match(type)) {\n this.next();\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * Whether current token matches given type\n */\n match(type: TokenType): boolean {\n return this.state.type === type;\n }\n\n /**\n * Create a LookaheadState from current parser state\n */\n createLookaheadState(state: State): LookaheadState {\n return {\n pos: state.pos,\n value: null,\n type: state.type,\n start: state.start,\n end: state.end,\n context: [this.curContext()],\n inType: state.inType,\n startLoc: state.startLoc,\n lastTokEndLoc: state.lastTokEndLoc,\n curLine: state.curLine,\n lineStart: state.lineStart,\n curPosition: state.curPosition,\n };\n }\n\n /**\n * lookahead peeks the next token, skipping changes to token context and\n * comment stack. For performance it returns a limited LookaheadState\n * instead of full parser state.\n *\n * The { column, line } Loc info is not included in lookahead since such usage\n * is rare. Although it may return other location properties e.g. `curLine` and\n * `lineStart`, these properties are not listed in the LookaheadState interface\n * and thus the returned value is _NOT_ reliable.\n *\n * The tokenizer should make best efforts to avoid using any parser state\n * other than those defined in LookaheadState\n */\n lookahead(): LookaheadState {\n const old = this.state;\n // @ts-expect-error For performance we use a simplified tokenizer state structure\n this.state = this.createLookaheadState(old);\n\n this.isLookahead = true;\n this.nextToken();\n this.isLookahead = false;\n\n const curr = this.state;\n this.state = old;\n return curr;\n }\n\n nextTokenStart(): number {\n return this.nextTokenStartSince(this.state.pos);\n }\n\n nextTokenStartSince(pos: number): number {\n skipWhiteSpace.lastIndex = pos;\n return skipWhiteSpace.test(this.input) ? skipWhiteSpace.lastIndex : pos;\n }\n\n lookaheadCharCode(): number {\n return this.input.charCodeAt(this.nextTokenStart());\n }\n\n /**\n * Similar to nextToken, but it will stop at line break when it is seen before the next token\n *\n * @returns {number} position of the next token start or line break, whichever is seen first.\n * @memberof Tokenizer\n */\n nextTokenInLineStart(): number {\n return this.nextTokenInLineStartSince(this.state.pos);\n }\n\n nextTokenInLineStartSince(pos: number): number {\n skipWhiteSpaceInLine.lastIndex = pos;\n return skipWhiteSpaceInLine.test(this.input)\n ? skipWhiteSpaceInLine.lastIndex\n : pos;\n }\n\n /**\n * Similar to lookaheadCharCode, but it will return the char code of line break if it is\n * seen before the next token\n *\n * @returns {number} char code of the next token start or line break, whichever is seen first.\n * @memberof Tokenizer\n */\n lookaheadInLineCharCode(): number {\n return this.input.charCodeAt(this.nextTokenInLineStart());\n }\n\n codePointAtPos(pos: number): number {\n // The implementation is based on\n // https://source.chromium.org/chromium/chromium/src/+/master:v8/src/builtins/builtins-string-gen.cc;l=1455;drc=221e331b49dfefadbc6fa40b0c68e6f97606d0b3;bpv=0;bpt=1\n // We reimplement `codePointAt` because `codePointAt` is a V8 builtin which is not inlined by TurboFan (as of M91)\n // since `input` is mostly ASCII, an inlined `charCodeAt` wins here\n let cp = this.input.charCodeAt(pos);\n if ((cp & 0xfc00) === 0xd800 && ++pos < this.input.length) {\n const trail = this.input.charCodeAt(pos);\n if ((trail & 0xfc00) === 0xdc00) {\n cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);\n }\n }\n return cp;\n }\n\n // Toggle strict mode. Re-reads the next number or string to please\n // pedantic tests (`\"use strict\"; 010;` should fail).\n\n setStrict(strict: boolean): void {\n this.state.strict = strict;\n if (strict) {\n // Throw an error for any string decimal escape found before/immediately\n // after a \"use strict\" directive. Strict mode will be set at parse\n // time for any literals that occur after the next node of the strict\n // directive.\n this.state.strictErrors.forEach(([toParseError, at]) =>\n this.raise(toParseError, at),\n );\n this.state.strictErrors.clear();\n }\n }\n\n curContext(): TokContext {\n return this.state.context[this.state.context.length - 1];\n }\n\n // Read a single token, updating the parser object's token-related properties.\n nextToken(): void {\n this.skipSpace();\n this.state.start = this.state.pos;\n if (!this.isLookahead) this.state.startLoc = this.state.curPosition();\n if (this.state.pos >= this.length) {\n this.finishToken(tt.eof);\n return;\n }\n\n this.getTokenFromCode(this.codePointAtPos(this.state.pos));\n }\n\n // Skips a block comment, whose end is marked by commentEnd.\n // *-/ is used by the Flow plugin, when parsing block comments nested\n // inside Flow comments.\n skipBlockComment(commentEnd: \"*/\" | \"*-/\"): N.CommentBlock | undefined {\n let startLoc;\n if (!this.isLookahead) startLoc = this.state.curPosition();\n const start = this.state.pos;\n const end = this.input.indexOf(commentEnd, start + 2);\n if (end === -1) {\n // We have to call this again here because startLoc may not be set...\n // This seems to be for performance reasons:\n // https://github.com/babel/babel/commit/acf2a10899f696a8aaf34df78bf9725b5ea7f2da\n throw this.raise(Errors.UnterminatedComment, this.state.curPosition());\n }\n\n this.state.pos = end + commentEnd.length;\n lineBreakG.lastIndex = start + 2;\n while (lineBreakG.test(this.input) && lineBreakG.lastIndex <= end) {\n ++this.state.curLine;\n this.state.lineStart = lineBreakG.lastIndex;\n }\n\n // If we are doing a lookahead right now we need to advance the position (above code)\n // but we do not want to push the comment to the state.\n if (this.isLookahead) return;\n /*:: invariant(startLoc) */\n\n const comment: N.CommentBlock = {\n type: \"CommentBlock\",\n value: this.input.slice(start + 2, end),\n start,\n end: end + commentEnd.length,\n loc: new SourceLocation(startLoc, this.state.curPosition()),\n };\n if (this.options.tokens) this.pushToken(comment);\n return comment;\n }\n\n skipLineComment(startSkip: number): N.CommentLine | undefined {\n const start = this.state.pos;\n let startLoc;\n if (!this.isLookahead) startLoc = this.state.curPosition();\n let ch = this.input.charCodeAt((this.state.pos += startSkip));\n if (this.state.pos < this.length) {\n while (!isNewLine(ch) && ++this.state.pos < this.length) {\n ch = this.input.charCodeAt(this.state.pos);\n }\n }\n\n // If we are doing a lookahead right now we need to advance the position (above code)\n // but we do not want to push the comment to the state.\n if (this.isLookahead) return;\n\n const end = this.state.pos;\n const value = this.input.slice(start + startSkip, end);\n\n const comment: N.CommentLine = {\n type: \"CommentLine\",\n value,\n start,\n end,\n loc: new SourceLocation(startLoc, this.state.curPosition()),\n };\n if (this.options.tokens) this.pushToken(comment);\n return comment;\n }\n\n // Called at the start of the parse and after every token. Skips\n // whitespace and comments, and.\n\n skipSpace(): void {\n const spaceStart = this.state.pos;\n const comments = [];\n loop: while (this.state.pos < this.length) {\n const ch = this.input.charCodeAt(this.state.pos);\n switch (ch) {\n case charCodes.space:\n case charCodes.nonBreakingSpace:\n case charCodes.tab:\n ++this.state.pos;\n break;\n case charCodes.carriageReturn:\n if (\n this.input.charCodeAt(this.state.pos + 1) === charCodes.lineFeed\n ) {\n ++this.state.pos;\n }\n // fall through\n case charCodes.lineFeed:\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n ++this.state.pos;\n ++this.state.curLine;\n this.state.lineStart = this.state.pos;\n break;\n\n case charCodes.slash:\n switch (this.input.charCodeAt(this.state.pos + 1)) {\n case charCodes.asterisk: {\n const comment = this.skipBlockComment(\"*/\");\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n break;\n }\n\n case charCodes.slash: {\n const comment = this.skipLineComment(2);\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n break;\n }\n\n default:\n break loop;\n }\n break;\n\n default:\n if (isWhitespace(ch)) {\n ++this.state.pos;\n } else if (\n ch === charCodes.dash &&\n !this.inModule &&\n this.options.annexB\n ) {\n const pos = this.state.pos;\n if (\n this.input.charCodeAt(pos + 1) === charCodes.dash &&\n this.input.charCodeAt(pos + 2) === charCodes.greaterThan &&\n (spaceStart === 0 || this.state.lineStart > spaceStart)\n ) {\n // A `-->` line comment\n const comment = this.skipLineComment(3);\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n } else {\n break loop;\n }\n } else if (\n ch === charCodes.lessThan &&\n !this.inModule &&\n this.options.annexB\n ) {\n const pos = this.state.pos;\n if (\n this.input.charCodeAt(pos + 1) === charCodes.exclamationMark &&\n this.input.charCodeAt(pos + 2) === charCodes.dash &&\n this.input.charCodeAt(pos + 3) === charCodes.dash\n ) {\n // `` line comment
+ this.skipLineComment(3);
+ this.skipSpace();
+ return this.nextToken()
+ }
+ return this.finishOp(types.incDec, 2)
+ }
+ if (next === 61) { return this.finishOp(types.assign, 2) }
+ return this.finishOp(types.plusMin, 1)
+ };
+
+ pp$9.readToken_lt_gt = function(code) { // '<>'
+ var next = this.input.charCodeAt(this.pos + 1);
+ var size = 1;
+ if (next === code) {
+ size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2;
+ if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) }
+ return this.finishOp(types.bitShift, size)
+ }
+ if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&
+ this.input.charCodeAt(this.pos + 3) === 45) {
+ // `` line comment\n this.skipLineComment(3)\n this.skipSpace()\n return this.nextToken()\n }\n return this.finishOp(tt.incDec, 2)\n }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.plusMin, 1)\n}\n\npp.readToken_lt_gt = function(code) { // '<>'\n let next = this.input.charCodeAt(this.pos + 1)\n let size = 1\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2\n if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1)\n return this.finishOp(tt.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // `` line comment
+ this.skipLineComment(3);
+ this.skipSpace();
+ return this.nextToken()
+ }
+ return this.finishOp(types.incDec, 2)
+ }
+ if (next === 61) { return this.finishOp(types.assign, 2) }
+ return this.finishOp(types.plusMin, 1)
+};
+
+pp$9.readToken_lt_gt = function(code) { // '<>'
+ var next = this.input.charCodeAt(this.pos + 1);
+ var size = 1;
+ if (next === code) {
+ size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2;
+ if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) }
+ return this.finishOp(types.bitShift, size)
+ }
+ if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&
+ this.input.charCodeAt(this.pos + 3) === 45) {
+ // `` line comment\n this.skipLineComment(3)\n this.skipSpace()\n return this.nextToken()\n }\n return this.finishOp(tt.incDec, 2)\n }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.plusMin, 1)\n}\n\npp.readToken_lt_gt = function(code) { // '<>'\n let next = this.input.charCodeAt(this.pos + 1)\n let size = 1\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2\n if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1)\n return this.finishOp(tt.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // `
+[![github actions][actions-image]][actions-url]
+
+[![dependency status][deps-svg]][deps-url]
+[![dev dependency status][dev-deps-svg]][dev-deps-url]
+[![License][license-image]][license-url]
+[![Downloads][downloads-image]][downloads-url]
-
+[![npm badge][npm-badge-png]][package-url]
Implementation of function.prototype.bind
-## Example
+Old versions of phantomjs, Internet Explorer < 9, and node < 0.6 don't support `Function.prototype.bind`.
-I mainly do this for unit tests I run on phantomjs.
-PhantomJS does not have Function.prototype.bind :(
+## Example
```js
Function.prototype.bind = require("function-bind")
@@ -32,17 +29,18 @@ Function.prototype.bind = require("function-bind")
## MIT Licenced
- [travis-svg]: https://travis-ci.org/Raynos/function-bind.svg
- [travis-url]: https://travis-ci.org/Raynos/function-bind
- [npm-badge-svg]: https://badge.fury.io/js/function-bind.svg
- [npm-url]: https://npmjs.org/package/function-bind
- [5]: https://coveralls.io/repos/Raynos/function-bind/badge.png
- [6]: https://coveralls.io/r/Raynos/function-bind
- [7]: https://gemnasium.com/Raynos/function-bind.png
- [8]: https://gemnasium.com/Raynos/function-bind
- [deps-svg]: https://david-dm.org/Raynos/function-bind.svg
- [deps-url]: https://david-dm.org/Raynos/function-bind
- [dev-deps-svg]: https://david-dm.org/Raynos/function-bind/dev-status.svg
- [dev-deps-url]: https://david-dm.org/Raynos/function-bind#info=devDependencies
- [11]: https://ci.testling.com/Raynos/function-bind.png
- [12]: https://ci.testling.com/Raynos/function-bind
+[package-url]: https://npmjs.org/package/function-bind
+[npm-version-svg]: https://versionbadg.es/Raynos/function-bind.svg
+[deps-svg]: https://david-dm.org/Raynos/function-bind.svg
+[deps-url]: https://david-dm.org/Raynos/function-bind
+[dev-deps-svg]: https://david-dm.org/Raynos/function-bind/dev-status.svg
+[dev-deps-url]: https://david-dm.org/Raynos/function-bind#info=devDependencies
+[npm-badge-png]: https://nodei.co/npm/function-bind.png?downloads=true&stars=true
+[license-image]: https://img.shields.io/npm/l/function-bind.svg
+[license-url]: LICENSE
+[downloads-image]: https://img.shields.io/npm/dm/function-bind.svg
+[downloads-url]: https://npm-stat.com/charts.html?package=function-bind
+[codecov-image]: https://codecov.io/gh/Raynos/function-bind/branch/main/graphs/badge.svg
+[codecov-url]: https://app.codecov.io/gh/Raynos/function-bind/
+[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/Raynos/function-bind
+[actions-url]: https://github.com/Raynos/function-bind/actions
diff --git a/node_modules/function-bind/implementation.js b/node_modules/function-bind/implementation.js
index cc4daec..fd4384c 100644
--- a/node_modules/function-bind/implementation.js
+++ b/node_modules/function-bind/implementation.js
@@ -3,43 +3,75 @@
/* eslint no-invalid-this: 1 */
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
-var slice = Array.prototype.slice;
var toStr = Object.prototype.toString;
+var max = Math.max;
var funcType = '[object Function]';
+var concatty = function concatty(a, b) {
+ var arr = [];
+
+ for (var i = 0; i < a.length; i += 1) {
+ arr[i] = a[i];
+ }
+ for (var j = 0; j < b.length; j += 1) {
+ arr[j + a.length] = b[j];
+ }
+
+ return arr;
+};
+
+var slicy = function slicy(arrLike, offset) {
+ var arr = [];
+ for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
+ arr[j] = arrLike[i];
+ }
+ return arr;
+};
+
+var joiny = function (arr, joiner) {
+ var str = '';
+ for (var i = 0; i < arr.length; i += 1) {
+ str += arr[i];
+ if (i + 1 < arr.length) {
+ str += joiner;
+ }
+ }
+ return str;
+};
+
module.exports = function bind(that) {
var target = this;
- if (typeof target !== 'function' || toStr.call(target) !== funcType) {
+ if (typeof target !== 'function' || toStr.apply(target) !== funcType) {
throw new TypeError(ERROR_MESSAGE + target);
}
- var args = slice.call(arguments, 1);
+ var args = slicy(arguments, 1);
var bound;
var binder = function () {
if (this instanceof bound) {
var result = target.apply(
this,
- args.concat(slice.call(arguments))
+ concatty(args, arguments)
);
if (Object(result) === result) {
return result;
}
return this;
- } else {
- return target.apply(
- that,
- args.concat(slice.call(arguments))
- );
}
+ return target.apply(
+ that,
+ concatty(args, arguments)
+ );
+
};
- var boundLength = Math.max(0, target.length - args.length);
+ var boundLength = max(0, target.length - args.length);
var boundArgs = [];
for (var i = 0; i < boundLength; i++) {
- boundArgs.push('$' + i);
+ boundArgs[i] = '$' + i;
}
- bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
+ bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
if (target.prototype) {
var Empty = function Empty() {};
diff --git a/node_modules/function-bind/package.json b/node_modules/function-bind/package.json
index 20a1727..6185963 100644
--- a/node_modules/function-bind/package.json
+++ b/node_modules/function-bind/package.json
@@ -1,6 +1,6 @@
{
"name": "function-bind",
- "version": "1.1.1",
+ "version": "1.1.2",
"description": "Implementation of Function.prototype.bind",
"keywords": [
"function",
@@ -9,7 +9,13 @@
"es5"
],
"author": "Raynos ",
- "repository": "git://github.com/Raynos/function-bind.git",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/Raynos/function-bind.git"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ },
"main": "index",
"homepage": "https://github.com/Raynos/function-bind",
"contributors": [
@@ -25,24 +31,29 @@
"url": "https://github.com/Raynos/function-bind/issues",
"email": "raynos2@gmail.com"
},
- "dependencies": {},
"devDependencies": {
- "@ljharb/eslint-config": "^12.2.1",
- "covert": "^1.1.0",
- "eslint": "^4.5.0",
- "jscs": "^3.0.7",
- "tape": "^4.8.0"
+ "@ljharb/eslint-config": "^21.1.0",
+ "aud": "^2.0.3",
+ "auto-changelog": "^2.4.0",
+ "eslint": "=8.8.0",
+ "in-publish": "^2.0.1",
+ "npmignore": "^0.3.0",
+ "nyc": "^10.3.2",
+ "safe-publish-latest": "^2.0.0",
+ "tape": "^5.7.1"
},
"license": "MIT",
"scripts": {
+ "prepublishOnly": "safe-publish-latest",
+ "prepublish": "not-in-publish || npm run prepublishOnly",
+ "prepack": "npmignore --auto --commentLines=autogenerated",
"pretest": "npm run lint",
"test": "npm run tests-only",
- "posttest": "npm run coverage -- --quiet",
- "tests-only": "node test",
- "coverage": "covert test/*.js",
- "lint": "npm run jscs && npm run eslint",
- "jscs": "jscs *.js */*.js",
- "eslint": "eslint *.js */*.js"
+ "posttest": "aud --production",
+ "tests-only": "nyc tape 'test/**/*.js'",
+ "lint": "eslint --ext=js,mjs .",
+ "version": "auto-changelog && git add CHANGELOG.md",
+ "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
},
"testling": {
"files": "test/index.js",
@@ -59,5 +70,18 @@
"iphone/6.0..latest",
"android-browser/4.2..latest"
]
+ },
+ "auto-changelog": {
+ "output": "CHANGELOG.md",
+ "template": "keepachangelog",
+ "unreleased": false,
+ "commitLimit": false,
+ "backfillLimit": false,
+ "hideCredit": true
+ },
+ "publishConfig": {
+ "ignore": [
+ ".github/workflows"
+ ]
}
}
diff --git a/node_modules/get-intrinsic/CHANGELOG.md b/node_modules/get-intrinsic/CHANGELOG.md
index 15e7a37..96d5397 100644
--- a/node_modules/get-intrinsic/CHANGELOG.md
+++ b/node_modules/get-intrinsic/CHANGELOG.md
@@ -5,6 +5,39 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [v1.2.4](https://github.com/ljharb/get-intrinsic/compare/v1.2.3...v1.2.4) - 2024-02-05
+
+### Commits
+
+- [Refactor] use all 7 <+ ES6 Errors from `es-errors` [`bcac811`](https://github.com/ljharb/get-intrinsic/commit/bcac811abdc1c982e12abf848a410d6aae148d14)
+
+## [v1.2.3](https://github.com/ljharb/get-intrinsic/compare/v1.2.2...v1.2.3) - 2024-02-03
+
+### Commits
+
+- [Refactor] use `es-errors`, so things that only need those do not need `get-intrinsic` [`f11db9c`](https://github.com/ljharb/get-intrinsic/commit/f11db9c4fb97d87bbd53d3c73ac6b3db3613ad3b)
+- [Dev Deps] update `aud`, `es-abstract`, `mock-property`, `npmignore` [`b7ac7d1`](https://github.com/ljharb/get-intrinsic/commit/b7ac7d1616fefb03877b1aed0c8f8d61aad32b6c)
+- [meta] simplify `exports` [`faa0cc6`](https://github.com/ljharb/get-intrinsic/commit/faa0cc618e2830ffb51a8202490b0c215d965cbc)
+- [meta] add missing `engines.node` [`774dd0b`](https://github.com/ljharb/get-intrinsic/commit/774dd0b3e8f741c3f05a6322d124d6087f146af1)
+- [Dev Deps] update `tape` [`5828e8e`](https://github.com/ljharb/get-intrinsic/commit/5828e8e4a04e69312e87a36c0ea39428a7a4c3d8)
+- [Robustness] use null objects for lookups [`eb9a11f`](https://github.com/ljharb/get-intrinsic/commit/eb9a11fa9eb3e13b193fcc05a7fb814341b1a7b7)
+- [meta] add `sideEffects` flag [`89bcc7a`](https://github.com/ljharb/get-intrinsic/commit/89bcc7a42e19bf07b7c21e3094d5ab177109e6d2)
+
+## [v1.2.2](https://github.com/ljharb/get-intrinsic/compare/v1.2.1...v1.2.2) - 2023-10-20
+
+### Commits
+
+- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `call-bind`, `es-abstract`, `mock-property`, `object-inspect`, `tape` [`f51bcf2`](https://github.com/ljharb/get-intrinsic/commit/f51bcf26412d58d17ce17c91c9afd0ad271f0762)
+- [Refactor] use `hasown` instead of `has` [`18d14b7`](https://github.com/ljharb/get-intrinsic/commit/18d14b799bea6b5765e1cec91890830cbcdb0587)
+- [Deps] update `function-bind` [`6e109c8`](https://github.com/ljharb/get-intrinsic/commit/6e109c81e03804cc5e7824fb64353cdc3d8ee2c7)
+
+## [v1.2.1](https://github.com/ljharb/get-intrinsic/compare/v1.2.0...v1.2.1) - 2023-05-13
+
+### Commits
+
+- [Fix] avoid a crash in envs without `__proto__` [`7bad8d0`](https://github.com/ljharb/get-intrinsic/commit/7bad8d061bf8721733b58b73a2565af2b6756b64)
+- [Dev Deps] update `es-abstract` [`c60e6b7`](https://github.com/ljharb/get-intrinsic/commit/c60e6b7b4cf9660c7f27ed970970fd55fac48dc5)
+
## [v1.2.0](https://github.com/ljharb/get-intrinsic/compare/v1.1.3...v1.2.0) - 2023-01-19
### Commits
diff --git a/node_modules/get-intrinsic/index.js b/node_modules/get-intrinsic/index.js
index 8fd7de0..c25e2c4 100644
--- a/node_modules/get-intrinsic/index.js
+++ b/node_modules/get-intrinsic/index.js
@@ -2,9 +2,15 @@
var undefined;
-var $SyntaxError = SyntaxError;
+var $Error = require('es-errors');
+var $EvalError = require('es-errors/eval');
+var $RangeError = require('es-errors/range');
+var $ReferenceError = require('es-errors/ref');
+var $SyntaxError = require('es-errors/syntax');
+var $TypeError = require('es-errors/type');
+var $URIError = require('es-errors/uri');
+
var $Function = Function;
-var $TypeError = TypeError;
// eslint-disable-next-line consistent-return
var getEvalledConstructor = function (expressionSyntax) {
@@ -43,18 +49,24 @@ var ThrowTypeError = $gOPD
: throwTypeError;
var hasSymbols = require('has-symbols')();
+var hasProto = require('has-proto')();
-var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
+var getProto = Object.getPrototypeOf || (
+ hasProto
+ ? function (x) { return x.__proto__; } // eslint-disable-line no-proto
+ : null
+);
var needsEval = {};
-var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);
+var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);
var INTRINSICS = {
+ __proto__: null,
'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
'%Array%': Array,
'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
- '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,
+ '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,
'%AsyncFromSyncIteratorPrototype%': undefined,
'%AsyncFunction%': needsEval,
'%AsyncGenerator%': needsEval,
@@ -71,9 +83,9 @@ var INTRINSICS = {
'%decodeURIComponent%': decodeURIComponent,
'%encodeURI%': encodeURI,
'%encodeURIComponent%': encodeURIComponent,
- '%Error%': Error,
+ '%Error%': $Error,
'%eval%': eval, // eslint-disable-line no-eval
- '%EvalError%': EvalError,
+ '%EvalError%': $EvalError,
'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
@@ -84,10 +96,10 @@ var INTRINSICS = {
'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
'%isFinite%': isFinite,
'%isNaN%': isNaN,
- '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,
+ '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,
'%JSON%': typeof JSON === 'object' ? JSON : undefined,
'%Map%': typeof Map === 'undefined' ? undefined : Map,
- '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),
'%Math%': Math,
'%Number%': Number,
'%Object%': Object,
@@ -95,15 +107,15 @@ var INTRINSICS = {
'%parseInt%': parseInt,
'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
- '%RangeError%': RangeError,
- '%ReferenceError%': ReferenceError,
+ '%RangeError%': $RangeError,
+ '%ReferenceError%': $ReferenceError,
'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
'%RegExp%': RegExp,
'%Set%': typeof Set === 'undefined' ? undefined : Set,
- '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),
'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
'%String%': String,
- '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,
+ '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,
'%Symbol%': hasSymbols ? Symbol : undefined,
'%SyntaxError%': $SyntaxError,
'%ThrowTypeError%': ThrowTypeError,
@@ -113,18 +125,20 @@ var INTRINSICS = {
'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
- '%URIError%': URIError,
+ '%URIError%': $URIError,
'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet
};
-try {
- null.error; // eslint-disable-line no-unused-expressions
-} catch (e) {
- // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
- var errorProto = getProto(getProto(e));
- INTRINSICS['%Error.prototype%'] = errorProto;
+if (getProto) {
+ try {
+ null.error; // eslint-disable-line no-unused-expressions
+ } catch (e) {
+ // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
+ var errorProto = getProto(getProto(e));
+ INTRINSICS['%Error.prototype%'] = errorProto;
+ }
}
var doEval = function doEval(name) {
@@ -142,7 +156,7 @@ var doEval = function doEval(name) {
}
} else if (name === '%AsyncIteratorPrototype%') {
var gen = doEval('%AsyncGenerator%');
- if (gen) {
+ if (gen && getProto) {
value = getProto(gen.prototype);
}
}
@@ -153,6 +167,7 @@ var doEval = function doEval(name) {
};
var LEGACY_ALIASES = {
+ __proto__: null,
'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
'%ArrayPrototype%': ['Array', 'prototype'],
'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
@@ -207,7 +222,7 @@ var LEGACY_ALIASES = {
};
var bind = require('function-bind');
-var hasOwn = require('has');
+var hasOwn = require('hasown');
var $concat = bind.call(Function.call, Array.prototype.concat);
var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
var $replace = bind.call(Function.call, String.prototype.replace);
diff --git a/node_modules/get-intrinsic/package.json b/node_modules/get-intrinsic/package.json
index fd7c479..568dff9 100644
--- a/node_modules/get-intrinsic/package.json
+++ b/node_modules/get-intrinsic/package.json
@@ -1,17 +1,13 @@
{
"name": "get-intrinsic",
- "version": "1.2.0",
+ "version": "1.2.4",
"description": "Get and robustly cache all JS language-level intrinsics at first require time",
"main": "index.js",
"exports": {
- ".": [
- {
- "default": "./index.js"
- },
- "./index.js"
- ],
+ ".": "./index.js",
"./package.json": "./package.json"
},
+ "sideEffects": false,
"scripts": {
"prepack": "npmignore --auto --commentLines=autogenerated",
"prepublish": "not-in-publish || npm run prepublishOnly",
@@ -48,11 +44,11 @@
},
"homepage": "https://github.com/ljharb/get-intrinsic#readme",
"devDependencies": {
- "@ljharb/eslint-config": "^21.0.1",
- "aud": "^2.0.2",
+ "@ljharb/eslint-config": "^21.1.0",
+ "aud": "^2.0.4",
"auto-changelog": "^2.4.0",
- "call-bind": "^1.0.2",
- "es-abstract": "^1.21.1",
+ "call-bind": "^1.0.5",
+ "es-abstract": "^1.22.3",
"es-value-fixtures": "^1.4.2",
"eslint": "=8.8.0",
"evalmd": "^0.0.19",
@@ -61,12 +57,12 @@
"make-async-function": "^1.0.0",
"make-async-generator-function": "^1.0.0",
"make-generator-function": "^2.0.0",
- "mock-property": "^1.0.0",
- "npmignore": "^0.3.0",
+ "mock-property": "^1.0.3",
+ "npmignore": "^0.3.1",
"nyc": "^10.3.2",
- "object-inspect": "^1.12.3",
+ "object-inspect": "^1.13.1",
"safe-publish-latest": "^2.0.0",
- "tape": "^5.6.3"
+ "tape": "^5.7.4"
},
"auto-changelog": {
"output": "CHANGELOG.md",
@@ -77,9 +73,11 @@
"hideCredit": true
},
"dependencies": {
- "function-bind": "^1.1.1",
- "has": "^1.0.3",
- "has-symbols": "^1.0.3"
+ "es-errors": "^1.3.0",
+ "function-bind": "^1.1.2",
+ "has-proto": "^1.0.1",
+ "has-symbols": "^1.0.3",
+ "hasown": "^2.0.0"
},
"testling": {
"files": "test/GetIntrinsic.js"
@@ -88,5 +86,8 @@
"ignore": [
".github/workflows"
]
+ },
+ "engines": {
+ "node": ">= 0.4"
}
}
diff --git a/node_modules/gopd/.eslintrc b/node_modules/gopd/.eslintrc
new file mode 100644
index 0000000..e2550c0
--- /dev/null
+++ b/node_modules/gopd/.eslintrc
@@ -0,0 +1,16 @@
+{
+ "root": true,
+
+ "extends": "@ljharb",
+
+ "rules": {
+ "func-style": [2, "declaration"],
+ "id-length": 0,
+ "multiline-comment-style": 0,
+ "new-cap": [2, {
+ "capIsNewExceptions": [
+ "GetIntrinsic",
+ ],
+ }],
+ },
+}
diff --git a/node_modules/gopd/.github/FUNDING.yml b/node_modules/gopd/.github/FUNDING.yml
new file mode 100644
index 0000000..94a44a8
--- /dev/null
+++ b/node_modules/gopd/.github/FUNDING.yml
@@ -0,0 +1,12 @@
+# These are supported funding model platforms
+
+github: [ljharb]
+patreon: # Replace with a single Patreon username
+open_collective: # Replace with a single Open Collective username
+ko_fi: # Replace with a single Ko-fi username
+tidelift: npm/gopd
+community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
+liberapay: # Replace with a single Liberapay username
+issuehunt: # Replace with a single IssueHunt username
+otechie: # Replace with a single Otechie username
+custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
diff --git a/node_modules/gopd/CHANGELOG.md b/node_modules/gopd/CHANGELOG.md
new file mode 100644
index 0000000..f111eb1
--- /dev/null
+++ b/node_modules/gopd/CHANGELOG.md
@@ -0,0 +1,25 @@
+# Changelog
+
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [v1.0.1](https://github.com/ljharb/gopd/compare/v1.0.0...v1.0.1) - 2022-11-01
+
+### Commits
+
+- [Fix] actually export gOPD instead of dP [`4b624bf`](https://github.com/ljharb/gopd/commit/4b624bfbeff788c5e3ff16d9443a83627847234f)
+
+## v1.0.0 - 2022-11-01
+
+### Commits
+
+- Initial implementation, tests, readme [`0911e01`](https://github.com/ljharb/gopd/commit/0911e012cd642092bd88b732c161c58bf4f20bea)
+- Initial commit [`b84e33f`](https://github.com/ljharb/gopd/commit/b84e33f5808a805ac57ff88d4247ad935569acbe)
+- [actions] add reusable workflows [`12ae28a`](https://github.com/ljharb/gopd/commit/12ae28ae5f50f86e750215b6e2188901646d0119)
+- npm init [`280118b`](https://github.com/ljharb/gopd/commit/280118badb45c80b4483836b5cb5315bddf6e582)
+- [meta] add `auto-changelog` [`bb78de5`](https://github.com/ljharb/gopd/commit/bb78de5639a180747fb290c28912beaaf1615709)
+- [meta] create FUNDING.yml; add `funding` in package.json [`11c22e6`](https://github.com/ljharb/gopd/commit/11c22e6355bb01f24e7fac4c9bb3055eb5b25002)
+- [meta] use `npmignore` to autogenerate an npmignore file [`4f4537a`](https://github.com/ljharb/gopd/commit/4f4537a843b39f698c52f072845092e6fca345bb)
+- Only apps should have lockfiles [`c567022`](https://github.com/ljharb/gopd/commit/c567022a18573aa7951cf5399445d9840e23e98b)
diff --git a/node_modules/gopd/LICENSE b/node_modules/gopd/LICENSE
new file mode 100644
index 0000000..6abfe14
--- /dev/null
+++ b/node_modules/gopd/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2022 Jordan Harband
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/gopd/README.md b/node_modules/gopd/README.md
new file mode 100644
index 0000000..784e56a
--- /dev/null
+++ b/node_modules/gopd/README.md
@@ -0,0 +1,40 @@
+# gopd [![Version Badge][npm-version-svg]][package-url]
+
+[![github actions][actions-image]][actions-url]
+[![coverage][codecov-image]][codecov-url]
+[![License][license-image]][license-url]
+[![Downloads][downloads-image]][downloads-url]
+
+[![npm badge][npm-badge-png]][package-url]
+
+`Object.getOwnPropertyDescriptor`, but accounts for IE's broken implementation.
+
+## Usage
+
+```javascript
+var gOPD = require('gopd');
+var assert = require('assert');
+
+if (gOPD) {
+ assert.equal(typeof gOPD, 'function', 'descriptors supported');
+ // use gOPD like Object.getOwnPropertyDescriptor here
+} else {
+ assert.ok(!gOPD, 'descriptors not supported');
+}
+```
+
+[package-url]: https://npmjs.org/package/gopd
+[npm-version-svg]: https://versionbadg.es/ljharb/gopd.svg
+[deps-svg]: https://david-dm.org/ljharb/gopd.svg
+[deps-url]: https://david-dm.org/ljharb/gopd
+[dev-deps-svg]: https://david-dm.org/ljharb/gopd/dev-status.svg
+[dev-deps-url]: https://david-dm.org/ljharb/gopd#info=devDependencies
+[npm-badge-png]: https://nodei.co/npm/gopd.png?downloads=true&stars=true
+[license-image]: https://img.shields.io/npm/l/gopd.svg
+[license-url]: LICENSE
+[downloads-image]: https://img.shields.io/npm/dm/gopd.svg
+[downloads-url]: https://npm-stat.com/charts.html?package=gopd
+[codecov-image]: https://codecov.io/gh/ljharb/gopd/branch/main/graphs/badge.svg
+[codecov-url]: https://app.codecov.io/gh/ljharb/gopd/
+[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/gopd
+[actions-url]: https://github.com/ljharb/gopd/actions
diff --git a/node_modules/gopd/index.js b/node_modules/gopd/index.js
new file mode 100644
index 0000000..fb6d3bb
--- /dev/null
+++ b/node_modules/gopd/index.js
@@ -0,0 +1,16 @@
+'use strict';
+
+var GetIntrinsic = require('get-intrinsic');
+
+var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
+
+if ($gOPD) {
+ try {
+ $gOPD([], 'length');
+ } catch (e) {
+ // IE 8 has a broken gOPD
+ $gOPD = null;
+ }
+}
+
+module.exports = $gOPD;
diff --git a/node_modules/gopd/package.json b/node_modules/gopd/package.json
new file mode 100644
index 0000000..d5e1fa4
--- /dev/null
+++ b/node_modules/gopd/package.json
@@ -0,0 +1,71 @@
+{
+ "name": "gopd",
+ "version": "1.0.1",
+ "description": "`Object.getOwnPropertyDescriptor`, but accounts for IE's broken implementation.",
+ "main": "index.js",
+ "exports": {
+ ".": "./index.js",
+ "./package.json": "./package.json"
+ },
+ "sideEffects": false,
+ "scripts": {
+ "prepack": "npmignore --auto --commentLines=autogenerated",
+ "prepublishOnly": "safe-publish-latest",
+ "prepublish": "not-in-publish || npm run prepublishOnly",
+ "lint": "eslint --ext=js,mjs .",
+ "postlint": "evalmd README.md",
+ "pretest": "npm run lint",
+ "tests-only": "tape 'test/**/*.js'",
+ "test": "npm run tests-only",
+ "posttest": "aud --production",
+ "version": "auto-changelog && git add CHANGELOG.md",
+ "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/ljharb/gopd.git"
+ },
+ "keywords": [
+ "ecmascript",
+ "javascript",
+ "getownpropertydescriptor",
+ "property",
+ "descriptor"
+ ],
+ "author": "Jordan Harband ",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ },
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/ljharb/gopd/issues"
+ },
+ "homepage": "https://github.com/ljharb/gopd#readme",
+ "dependencies": {
+ "get-intrinsic": "^1.1.3"
+ },
+ "devDependencies": {
+ "@ljharb/eslint-config": "^21.0.0",
+ "aud": "^2.0.1",
+ "auto-changelog": "^2.4.0",
+ "eslint": "=8.8.0",
+ "evalmd": "^0.0.19",
+ "in-publish": "^2.0.1",
+ "npmignore": "^0.3.0",
+ "safe-publish-latest": "^2.0.0",
+ "tape": "^5.6.1"
+ },
+ "auto-changelog": {
+ "output": "CHANGELOG.md",
+ "template": "keepachangelog",
+ "unreleased": false,
+ "commitLimit": false,
+ "backfillLimit": false,
+ "hideCredit": true
+ },
+ "publishConfig": {
+ "ignore": [
+ ".github/workflows"
+ ]
+ }
+}
diff --git a/node_modules/gopd/test/index.js b/node_modules/gopd/test/index.js
new file mode 100644
index 0000000..0376bfb
--- /dev/null
+++ b/node_modules/gopd/test/index.js
@@ -0,0 +1,35 @@
+'use strict';
+
+var test = require('tape');
+var gOPD = require('../');
+
+test('gOPD', function (t) {
+ t.test('supported', { skip: !gOPD }, function (st) {
+ st.equal(typeof gOPD, 'function', 'is a function');
+
+ var obj = { x: 1 };
+ st.ok('x' in obj, 'property exists');
+
+ var desc = gOPD(obj, 'x');
+ st.deepEqual(
+ desc,
+ {
+ configurable: true,
+ enumerable: true,
+ value: 1,
+ writable: true
+ },
+ 'descriptor is as expected'
+ );
+
+ st.end();
+ });
+
+ t.test('not supported', { skip: gOPD }, function (st) {
+ st.notOk(gOPD, 'is falsy');
+
+ st.end();
+ });
+
+ t.end();
+});
diff --git a/node_modules/has-property-descriptors/.eslintrc b/node_modules/has-property-descriptors/.eslintrc
new file mode 100644
index 0000000..2fcc002
--- /dev/null
+++ b/node_modules/has-property-descriptors/.eslintrc
@@ -0,0 +1,13 @@
+{
+ "root": true,
+
+ "extends": "@ljharb",
+
+ "rules": {
+ "func-name-matching": 0,
+ "id-length": 0,
+ "new-cap": [2, {
+ "capIsNewExceptions": ["GetIntrinsic"],
+ }],
+ },
+}
diff --git a/node_modules/has-property-descriptors/.github/FUNDING.yml b/node_modules/has-property-descriptors/.github/FUNDING.yml
new file mode 100644
index 0000000..817aacf
--- /dev/null
+++ b/node_modules/has-property-descriptors/.github/FUNDING.yml
@@ -0,0 +1,12 @@
+# These are supported funding model platforms
+
+github: [ljharb]
+patreon: # Replace with a single Patreon username
+open_collective: # Replace with a single Open Collective username
+ko_fi: # Replace with a single Ko-fi username
+tidelift: npm/has-property-descriptors
+community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
+liberapay: # Replace with a single Liberapay username
+issuehunt: # Replace with a single IssueHunt username
+otechie: # Replace with a single Otechie username
+custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
diff --git a/node_modules/has-property-descriptors/.nycrc b/node_modules/has-property-descriptors/.nycrc
new file mode 100644
index 0000000..bdd626c
--- /dev/null
+++ b/node_modules/has-property-descriptors/.nycrc
@@ -0,0 +1,9 @@
+{
+ "all": true,
+ "check-coverage": false,
+ "reporter": ["text-summary", "text", "html", "json"],
+ "exclude": [
+ "coverage",
+ "test"
+ ]
+}
diff --git a/node_modules/has-property-descriptors/CHANGELOG.md b/node_modules/has-property-descriptors/CHANGELOG.md
new file mode 100644
index 0000000..19c8a95
--- /dev/null
+++ b/node_modules/has-property-descriptors/CHANGELOG.md
@@ -0,0 +1,35 @@
+# Changelog
+
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [v1.0.2](https://github.com/inspect-js/has-property-descriptors/compare/v1.0.1...v1.0.2) - 2024-02-12
+
+### Commits
+
+- [Refactor] use `es-define-property` [`f93a8c8`](https://github.com/inspect-js/has-property-descriptors/commit/f93a8c85eba70cbceab500f2619fb5cce73a1805)
+- [Dev Deps] update `aud`, `npmignore`, `tape` [`42b0c9d`](https://github.com/inspect-js/has-property-descriptors/commit/42b0c9d1c23e747755f0f2924923c418ea34a9ee)
+- [Deps] update `get-intrinsic` [`35e9b46`](https://github.com/inspect-js/has-property-descriptors/commit/35e9b46a7f14331bf0de98b644dd803676746037)
+
+## [v1.0.1](https://github.com/inspect-js/has-property-descriptors/compare/v1.0.0...v1.0.1) - 2023-10-20
+
+### Commits
+
+- [meta] use `npmignore` to autogenerate an npmignore file [`5bbf4da`](https://github.com/inspect-js/has-property-descriptors/commit/5bbf4dae1b58950d87bb3af508bee7513e640868)
+- [actions] update rebase action to use reusable workflow [`3a5585b`](https://github.com/inspect-js/has-property-descriptors/commit/3a5585bf74988f71a8f59e67a07d594e62c51fd8)
+- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`e5c1212`](https://github.com/inspect-js/has-property-descriptors/commit/e5c1212048a8fda549794c47863724ca60b89cae)
+- [Dev Deps] update `aud`, `tape` [`e942917`](https://github.com/inspect-js/has-property-descriptors/commit/e942917b6c2f7c090d5623048989cf20d0834ebf)
+- [Deps] update `get-intrinsic` [`f4a44ec`](https://github.com/inspect-js/has-property-descriptors/commit/f4a44ec6d94146fa6c550d3c15c31a2062c83ef4)
+- [Deps] update `get-intrinsic` [`eeb275b`](https://github.com/inspect-js/has-property-descriptors/commit/eeb275b473e5d72ca843b61ca25cfcb06a5d4300)
+
+## v1.0.0 - 2022-04-14
+
+### Commits
+
+- Initial implementation, tests [`303559f`](https://github.com/inspect-js/has-property-descriptors/commit/303559f2a72dfe7111573a1aec475ed4a184c35a)
+- Initial commit [`3a7ca2d`](https://github.com/inspect-js/has-property-descriptors/commit/3a7ca2dc49f1fff0279a28bb16265e7615e14749)
+- read me [`dd73dce`](https://github.com/inspect-js/has-property-descriptors/commit/dd73dce09d89d0f7a4a6e3b1e562a506f979a767)
+- npm init [`c1e6557`](https://github.com/inspect-js/has-property-descriptors/commit/c1e655779de632d68cb944c50da6b71bcb7b8c85)
+- Only apps should have lockfiles [`e72f7c6`](https://github.com/inspect-js/has-property-descriptors/commit/e72f7c68de534b2d273ee665f8b18d4ecc7f70b0)
diff --git a/node_modules/has-property-descriptors/LICENSE b/node_modules/has-property-descriptors/LICENSE
new file mode 100644
index 0000000..2e7b9a3
--- /dev/null
+++ b/node_modules/has-property-descriptors/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2022 Inspect JS
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/has-property-descriptors/README.md b/node_modules/has-property-descriptors/README.md
new file mode 100644
index 0000000..d81fbd9
--- /dev/null
+++ b/node_modules/has-property-descriptors/README.md
@@ -0,0 +1,43 @@
+# has-property-descriptors [![Version Badge][npm-version-svg]][package-url]
+
+[![github actions][actions-image]][actions-url]
+[![coverage][codecov-image]][codecov-url]
+[![dependency status][deps-svg]][deps-url]
+[![dev dependency status][dev-deps-svg]][dev-deps-url]
+[![License][license-image]][license-url]
+[![Downloads][downloads-image]][downloads-url]
+
+[![npm badge][npm-badge-png]][package-url]
+
+Does the environment have full property descriptor support? Handles IE 8's broken defineProperty/gOPD.
+
+## Example
+
+```js
+var hasPropertyDescriptors = require('has-property-descriptors');
+var assert = require('assert');
+
+assert.equal(hasPropertyDescriptors(), true); // will be `false` in IE 6-8, and ES5 engines
+
+// Arrays can not have their length `[[Defined]]` in some engines
+assert.equal(hasPropertyDescriptors.hasArrayLengthDefineBug(), false); // will be `true` in Firefox 4-22, and node v0.6
+```
+
+## Tests
+Simply clone the repo, `npm install`, and run `npm test`
+
+[package-url]: https://npmjs.org/package/has-property-descriptors
+[npm-version-svg]: https://versionbadg.es/inspect-js/has-property-descriptors.svg
+[deps-svg]: https://david-dm.org/inspect-js/has-property-descriptors.svg
+[deps-url]: https://david-dm.org/inspect-js/has-property-descriptors
+[dev-deps-svg]: https://david-dm.org/inspect-js/has-property-descriptors/dev-status.svg
+[dev-deps-url]: https://david-dm.org/inspect-js/has-property-descriptors#info=devDependencies
+[npm-badge-png]: https://nodei.co/npm/has-property-descriptors.png?downloads=true&stars=true
+[license-image]: https://img.shields.io/npm/l/has-property-descriptors.svg
+[license-url]: LICENSE
+[downloads-image]: https://img.shields.io/npm/dm/has-property-descriptors.svg
+[downloads-url]: https://npm-stat.com/charts.html?package=has-property-descriptors
+[codecov-image]: https://codecov.io/gh/inspect-js/has-property-descriptors/branch/main/graphs/badge.svg
+[codecov-url]: https://app.codecov.io/gh/inspect-js/has-property-descriptors/
+[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/has-property-descriptors
+[actions-url]: https://github.com/inspect-js/has-property-descriptors/actions
diff --git a/node_modules/has-property-descriptors/index.js b/node_modules/has-property-descriptors/index.js
new file mode 100644
index 0000000..0480437
--- /dev/null
+++ b/node_modules/has-property-descriptors/index.js
@@ -0,0 +1,22 @@
+'use strict';
+
+var $defineProperty = require('es-define-property');
+
+var hasPropertyDescriptors = function hasPropertyDescriptors() {
+ return !!$defineProperty;
+};
+
+hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
+ // node v0.6 has a bug where array lengths can be Set but not Defined
+ if (!$defineProperty) {
+ return null;
+ }
+ try {
+ return $defineProperty([], 'length', { value: 1 }).length !== 1;
+ } catch (e) {
+ // In Firefox 4-22, defining length on an array throws an exception.
+ return true;
+ }
+};
+
+module.exports = hasPropertyDescriptors;
diff --git a/node_modules/has-property-descriptors/package.json b/node_modules/has-property-descriptors/package.json
new file mode 100644
index 0000000..7e70218
--- /dev/null
+++ b/node_modules/has-property-descriptors/package.json
@@ -0,0 +1,77 @@
+{
+ "name": "has-property-descriptors",
+ "version": "1.0.2",
+ "description": "Does the environment have full property descriptor support? Handles IE 8's broken defineProperty/gOPD.",
+ "main": "index.js",
+ "exports": {
+ ".": "./index.js",
+ "./package.json": "./package.json"
+ },
+ "sideEffects": false,
+ "scripts": {
+ "prepack": "npmignore --auto --commentLines=autogenerated",
+ "prepublishOnly": "safe-publish-latest",
+ "prepublish": "not-in-publish || npm run prepublishOnly",
+ "pretest": "npm run lint",
+ "prelint": "evalmd README.md",
+ "lint": "eslint --ext=js,mjs .",
+ "tests-only": "nyc tape 'test/**/*.js'",
+ "test": "npm run tests-only",
+ "posttest": "aud --production",
+ "version": "auto-changelog && git add CHANGELOG.md",
+ "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/inspect-js/has-property-descriptors.git"
+ },
+ "keywords": [
+ "property",
+ "descriptors",
+ "has",
+ "environment",
+ "env",
+ "defineProperty",
+ "getOwnPropertyDescriptor"
+ ],
+ "author": "Jordan Harband ",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ },
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/inspect-js/has-property-descriptors/issues"
+ },
+ "homepage": "https://github.com/inspect-js/has-property-descriptors#readme",
+ "devDependencies": {
+ "@ljharb/eslint-config": "^21.1.0",
+ "aud": "^2.0.4",
+ "auto-changelog": "^2.4.0",
+ "eslint": "=8.8.0",
+ "evalmd": "^0.0.19",
+ "in-publish": "^2.0.1",
+ "npmignore": "^0.3.1",
+ "nyc": "^10.3.2",
+ "safe-publish-latest": "^2.0.0",
+ "tape": "^5.7.4"
+ },
+ "dependencies": {
+ "es-define-property": "^1.0.0"
+ },
+ "testling": {
+ "files": "test/index.js"
+ },
+ "auto-changelog": {
+ "output": "CHANGELOG.md",
+ "template": "keepachangelog",
+ "unreleased": false,
+ "commitLimit": false,
+ "backfillLimit": false,
+ "hideCredit": true
+ },
+ "publishConfig": {
+ "ignore": [
+ ".github/workflows"
+ ]
+ }
+}
diff --git a/node_modules/has-property-descriptors/test/index.js b/node_modules/has-property-descriptors/test/index.js
new file mode 100644
index 0000000..7f02bd3
--- /dev/null
+++ b/node_modules/has-property-descriptors/test/index.js
@@ -0,0 +1,57 @@
+'use strict';
+
+var test = require('tape');
+
+var hasPropertyDescriptors = require('../');
+
+var sentinel = {};
+
+test('hasPropertyDescriptors', function (t) {
+ t.equal(typeof hasPropertyDescriptors, 'function', 'is a function');
+ t.equal(typeof hasPropertyDescriptors.hasArrayLengthDefineBug, 'function', '`hasArrayLengthDefineBug` property is a function');
+
+ var yes = hasPropertyDescriptors();
+ t.test('property descriptors', { skip: !yes }, function (st) {
+ var o = { a: sentinel };
+
+ st.deepEqual(
+ Object.getOwnPropertyDescriptor(o, 'a'),
+ {
+ configurable: true,
+ enumerable: true,
+ value: sentinel,
+ writable: true
+ },
+ 'has expected property descriptor'
+ );
+
+ Object.defineProperty(o, 'a', { enumerable: false, writable: false });
+
+ st.deepEqual(
+ Object.getOwnPropertyDescriptor(o, 'a'),
+ {
+ configurable: true,
+ enumerable: false,
+ value: sentinel,
+ writable: false
+ },
+ 'has expected property descriptor after [[Define]]'
+ );
+
+ st.end();
+ });
+
+ var arrayBug = hasPropertyDescriptors.hasArrayLengthDefineBug();
+ t.test('defining array lengths', { skip: !yes || arrayBug }, function (st) {
+ var arr = [1, , 3]; // eslint-disable-line no-sparse-arrays
+ st.equal(arr.length, 3, 'array starts with length 3');
+
+ Object.defineProperty(arr, 'length', { value: 5 });
+
+ st.equal(arr.length, 5, 'array ends with length 5');
+
+ st.end();
+ });
+
+ t.end();
+});
diff --git a/node_modules/has-proto/.eslintrc b/node_modules/has-proto/.eslintrc
new file mode 100644
index 0000000..3b5d9e9
--- /dev/null
+++ b/node_modules/has-proto/.eslintrc
@@ -0,0 +1,5 @@
+{
+ "root": true,
+
+ "extends": "@ljharb",
+}
diff --git a/node_modules/has-proto/.github/FUNDING.yml b/node_modules/has-proto/.github/FUNDING.yml
new file mode 100644
index 0000000..613705c
--- /dev/null
+++ b/node_modules/has-proto/.github/FUNDING.yml
@@ -0,0 +1,12 @@
+# These are supported funding model platforms
+
+github: [ljharb]
+patreon: # Replace with a single Patreon username
+open_collective: # Replace with a single Open Collective username
+ko_fi: # Replace with a single Ko-fi username
+tidelift: npm/has-proto
+community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
+liberapay: # Replace with a single Liberapay username
+issuehunt: # Replace with a single IssueHunt username
+otechie: # Replace with a single Otechie username
+custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
diff --git a/node_modules/has-proto/CHANGELOG.md b/node_modules/has-proto/CHANGELOG.md
new file mode 100644
index 0000000..6690f28
--- /dev/null
+++ b/node_modules/has-proto/CHANGELOG.md
@@ -0,0 +1,38 @@
+# Changelog
+
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [v1.0.3](https://github.com/inspect-js/has-proto/compare/v1.0.2...v1.0.3) - 2024-02-19
+
+### Commits
+
+- [types] add missing declaration file [`26ecade`](https://github.com/inspect-js/has-proto/commit/26ecade05d253bb5dc376945ee3186d1fbe334f8)
+
+## [v1.0.2](https://github.com/inspect-js/has-proto/compare/v1.0.1...v1.0.2) - 2024-02-19
+
+### Commits
+
+- add types [`6435262`](https://github.com/inspect-js/has-proto/commit/64352626cf511c0276d5f4bb6be770a0bf0f8524)
+- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `npmignore`, `tape` [`f16a5e4`](https://github.com/inspect-js/has-proto/commit/f16a5e4121651e551271419f9d60fdd3561fd82c)
+- [Refactor] tiny cleanup [`d1f1a4b`](https://github.com/inspect-js/has-proto/commit/d1f1a4bdc135f115a10f148ce302676224534702)
+- [meta] add `sideEffects` flag [`e7ab1a6`](https://github.com/inspect-js/has-proto/commit/e7ab1a6f153b3e80dee68d1748b71e46767a0531)
+
+## [v1.0.1](https://github.com/inspect-js/has-proto/compare/v1.0.0...v1.0.1) - 2022-12-21
+
+### Commits
+
+- [meta] correct URLs and description [`ef34483`](https://github.com/inspect-js/has-proto/commit/ef34483ca0d35680f271b6b96e35526151b25dfc)
+- [patch] add an additional criteria [`e81959e`](https://github.com/inspect-js/has-proto/commit/e81959ed7c7a77fbf459f00cb4ef824f1099497f)
+- [Dev Deps] update `aud` [`2bec2c4`](https://github.com/inspect-js/has-proto/commit/2bec2c47b072b122ff5443fba0263f6dc649531f)
+
+## v1.0.0 - 2022-12-12
+
+### Commits
+
+- Initial implementation, tests, readme [`6886fea`](https://github.com/inspect-js/has-proto/commit/6886fea578f67daf69a7920b2eb7637ea6ebb0bc)
+- Initial commit [`99129c8`](https://github.com/inspect-js/has-proto/commit/99129c8f42471ac89cb681ba9cb9d52a583eb94f)
+- npm init [`2844ad8`](https://github.com/inspect-js/has-proto/commit/2844ad8e75b84d66a46765b3bab9d2e8ea692e10)
+- Only apps should have lockfiles [`c65bc5e`](https://github.com/inspect-js/has-proto/commit/c65bc5e40b9004463f7336d47c67245fb139a36a)
diff --git a/node_modules/has-proto/LICENSE b/node_modules/has-proto/LICENSE
new file mode 100644
index 0000000..2e7b9a3
--- /dev/null
+++ b/node_modules/has-proto/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2022 Inspect JS
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/has-proto/README.md b/node_modules/has-proto/README.md
new file mode 100644
index 0000000..1456765
--- /dev/null
+++ b/node_modules/has-proto/README.md
@@ -0,0 +1,38 @@
+# has-proto [![Version Badge][npm-version-svg]][package-url]
+
+[![github actions][actions-image]][actions-url]
+[![coverage][codecov-image]][codecov-url]
+[![License][license-image]][license-url]
+[![Downloads][downloads-image]][downloads-url]
+
+[![npm badge][npm-badge-png]][package-url]
+
+Does this environment have the ability to set the [[Prototype]] of an object on creation with `__proto__`?
+
+## Example
+
+```js
+var hasProto = require('has-proto');
+var assert = require('assert');
+
+assert.equal(typeof hasProto(), 'boolean');
+```
+
+## Tests
+Simply clone the repo, `npm install`, and run `npm test`
+
+[package-url]: https://npmjs.org/package/has-proto
+[npm-version-svg]: https://versionbadg.es/inspect-js/has-proto.svg
+[deps-svg]: https://david-dm.org/inspect-js/has-proto.svg
+[deps-url]: https://david-dm.org/inspect-js/has-proto
+[dev-deps-svg]: https://david-dm.org/inspect-js/has-proto/dev-status.svg
+[dev-deps-url]: https://david-dm.org/inspect-js/has-proto#info=devDependencies
+[npm-badge-png]: https://nodei.co/npm/has-proto.png?downloads=true&stars=true
+[license-image]: https://img.shields.io/npm/l/has-proto.svg
+[license-url]: LICENSE
+[downloads-image]: https://img.shields.io/npm/dm/has-proto.svg
+[downloads-url]: https://npm-stat.com/charts.html?package=has-proto
+[codecov-image]: https://codecov.io/gh/inspect-js/has-proto/branch/main/graphs/badge.svg
+[codecov-url]: https://app.codecov.io/gh/inspect-js/has-proto/
+[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/has-proto
+[actions-url]: https://github.com/inspect-js/has-proto/actions
diff --git a/node_modules/has-proto/index.d.ts b/node_modules/has-proto/index.d.ts
new file mode 100644
index 0000000..cfed695
--- /dev/null
+++ b/node_modules/has-proto/index.d.ts
@@ -0,0 +1,3 @@
+declare function hasProto(): boolean;
+
+export = hasProto;
\ No newline at end of file
diff --git a/node_modules/has-proto/index.js b/node_modules/has-proto/index.js
new file mode 100644
index 0000000..d3c8a0a
--- /dev/null
+++ b/node_modules/has-proto/index.js
@@ -0,0 +1,15 @@
+'use strict';
+
+var test = {
+ __proto__: null,
+ foo: {}
+};
+
+var $Object = Object;
+
+/** @type {import('.')} */
+module.exports = function hasProto() {
+ // @ts-expect-error: TS errors on an inherited property for some reason
+ return { __proto__: test }.foo === test.foo
+ && !(test instanceof $Object);
+};
diff --git a/node_modules/has-proto/package.json b/node_modules/has-proto/package.json
new file mode 100644
index 0000000..9d37e4e
--- /dev/null
+++ b/node_modules/has-proto/package.json
@@ -0,0 +1,78 @@
+{
+ "name": "has-proto",
+ "version": "1.0.3",
+ "description": "Does this environment have the ability to get the [[Prototype]] of an object on creation with `__proto__`?",
+ "main": "index.js",
+ "exports": {
+ ".": "./index.js",
+ "./package.json": "./package.json"
+ },
+ "sideEffects": false,
+ "scripts": {
+ "prepack": "npmignore --auto --commentLines=autogenerated",
+ "prepublishOnly": "safe-publish-latest",
+ "prepublish": "not-in-publish || npm run prepublishOnly",
+ "lint": "eslint --ext=js,mjs .",
+ "postlint": "tsc -p .",
+ "pretest": "npm run lint",
+ "tests-only": "tape 'test/**/*.js'",
+ "test": "npm run tests-only",
+ "posttest": "aud --production",
+ "version": "auto-changelog && git add CHANGELOG.md",
+ "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/inspect-js/has-proto.git"
+ },
+ "keywords": [
+ "prototype",
+ "proto",
+ "set",
+ "get",
+ "__proto__",
+ "getPrototypeOf",
+ "setPrototypeOf",
+ "has"
+ ],
+ "author": "Jordan Harband ",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ },
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/inspect-js/has-proto/issues"
+ },
+ "homepage": "https://github.com/inspect-js/has-proto#readme",
+ "testling": {
+ "files": "test/index.js"
+ },
+ "devDependencies": {
+ "@ljharb/eslint-config": "^21.1.0",
+ "@types/tape": "^5.6.4",
+ "aud": "^2.0.4",
+ "auto-changelog": "^2.4.0",
+ "eslint": "=8.8.0",
+ "in-publish": "^2.0.1",
+ "npmignore": "^0.3.1",
+ "safe-publish-latest": "^2.0.0",
+ "tape": "^5.7.5",
+ "typescript": "next"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "auto-changelog": {
+ "output": "CHANGELOG.md",
+ "template": "keepachangelog",
+ "unreleased": false,
+ "commitLimit": false,
+ "backfillLimit": false,
+ "hideCredit": true
+ },
+ "publishConfig": {
+ "ignore": [
+ ".github/workflows"
+ ]
+ }
+}
diff --git a/node_modules/has-proto/test/index.js b/node_modules/has-proto/test/index.js
new file mode 100644
index 0000000..5da1a3a
--- /dev/null
+++ b/node_modules/has-proto/test/index.js
@@ -0,0 +1,19 @@
+'use strict';
+
+var test = require('tape');
+var hasProto = require('../');
+
+test('hasProto', function (t) {
+ var result = hasProto();
+ t.equal(typeof result, 'boolean', 'returns a boolean (' + result + ')');
+
+ var obj = { __proto__: null };
+ if (result) {
+ t.notOk('toString' in obj, 'null object lacks toString');
+ } else {
+ t.ok('toString' in obj, 'without proto, null object has toString');
+ t.equal(obj.__proto__, null); // eslint-disable-line no-proto
+ }
+
+ t.end();
+});
diff --git a/node_modules/has-proto/tsconfig.json b/node_modules/has-proto/tsconfig.json
new file mode 100644
index 0000000..2002ce5
--- /dev/null
+++ b/node_modules/has-proto/tsconfig.json
@@ -0,0 +1,49 @@
+{
+ "compilerOptions": {
+ /* Visit https://aka.ms/tsconfig to read more about this file */
+
+ /* Projects */
+
+ /* Language and Environment */
+ "target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
+ // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
+ // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
+ "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
+ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
+
+ /* Modules */
+ "module": "commonjs", /* Specify what module code is generated. */
+ // "rootDir": "./", /* Specify the root folder within your source files. */
+ // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
+ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
+ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
+ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
+ "typeRoots": ["types"], /* Specify multiple folders that act like './node_modules/@types'. */
+ "resolveJsonModule": true, /* Enable importing .json files. */
+ // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
+
+ /* JavaScript Support */
+ "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
+ "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
+ "maxNodeModuleJsDepth": 0, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
+
+ /* Emit */
+ "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
+ "declarationMap": true, /* Create sourcemaps for d.ts files. */
+ "noEmit": true, /* Disable emitting files from a compilation. */
+
+ /* Interop Constraints */
+ "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
+ "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
+ "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
+
+ /* Type Checking */
+ "strict": true, /* Enable all strict type-checking options. */
+
+ /* Completeness */
+ //"skipLibCheck": true /* Skip type checking all .d.ts files. */
+ },
+ "exclude": [
+ "coverage"
+ ]
+}
diff --git a/node_modules/has-tostringtag/.eslintrc b/node_modules/has-tostringtag/.eslintrc
new file mode 100644
index 0000000..3b5d9e9
--- /dev/null
+++ b/node_modules/has-tostringtag/.eslintrc
@@ -0,0 +1,5 @@
+{
+ "root": true,
+
+ "extends": "@ljharb",
+}
diff --git a/node_modules/has-tostringtag/.github/FUNDING.yml b/node_modules/has-tostringtag/.github/FUNDING.yml
new file mode 100644
index 0000000..7a450e7
--- /dev/null
+++ b/node_modules/has-tostringtag/.github/FUNDING.yml
@@ -0,0 +1,12 @@
+# These are supported funding model platforms
+
+github: [ljharb]
+patreon: # Replace with a single Patreon username
+open_collective: # Replace with a single Open Collective username
+ko_fi: # Replace with a single Ko-fi username
+tidelift: npm/has-tostringtag
+community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
+liberapay: # Replace with a single Liberapay username
+issuehunt: # Replace with a single IssueHunt username
+otechie: # Replace with a single Otechie username
+custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
diff --git a/node_modules/has-tostringtag/.nycrc b/node_modules/has-tostringtag/.nycrc
new file mode 100644
index 0000000..1826526
--- /dev/null
+++ b/node_modules/has-tostringtag/.nycrc
@@ -0,0 +1,13 @@
+{
+ "all": true,
+ "check-coverage": false,
+ "reporter": ["text-summary", "text", "html", "json"],
+ "lines": 86,
+ "statements": 85.93,
+ "functions": 82.43,
+ "branches": 76.06,
+ "exclude": [
+ "coverage",
+ "test"
+ ]
+}
diff --git a/node_modules/has-tostringtag/CHANGELOG.md b/node_modules/has-tostringtag/CHANGELOG.md
new file mode 100644
index 0000000..eb186ec
--- /dev/null
+++ b/node_modules/has-tostringtag/CHANGELOG.md
@@ -0,0 +1,42 @@
+# Changelog
+
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [v1.0.2](https://github.com/inspect-js/has-tostringtag/compare/v1.0.1...v1.0.2) - 2024-02-01
+
+### Fixed
+
+- [Fix] move `has-symbols` back to prod deps [`#3`](https://github.com/inspect-js/has-tostringtag/issues/3)
+
+## [v1.0.1](https://github.com/inspect-js/has-tostringtag/compare/v1.0.0...v1.0.1) - 2024-02-01
+
+### Commits
+
+- [patch] add types [`9276414`](https://github.com/inspect-js/has-tostringtag/commit/9276414b22fab3eeb234688841722c4be113201f)
+- [meta] use `npmignore` to autogenerate an npmignore file [`5c0dcd1`](https://github.com/inspect-js/has-tostringtag/commit/5c0dcd1ff66419562a30d1fd88b966cc36bce5fc)
+- [actions] reuse common workflows [`dee9509`](https://github.com/inspect-js/has-tostringtag/commit/dee950904ab5719b62cf8d73d2ac950b09093266)
+- [actions] update codecov uploader [`b8cb3a0`](https://github.com/inspect-js/has-tostringtag/commit/b8cb3a0b8ffbb1593012c4c2daa45fb25642825d)
+- [Tests] generate coverage [`be5b288`](https://github.com/inspect-js/has-tostringtag/commit/be5b28889e2735cdbcef387f84c2829995f2f05e)
+- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape` [`69a0827`](https://github.com/inspect-js/has-tostringtag/commit/69a0827974e9b877b2c75b70b057555da8f25a65)
+- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`4c9e210`](https://github.com/inspect-js/has-tostringtag/commit/4c9e210a5682f0557a3235d36b68ce809d7fb825)
+- [actions] update rebase action to use reusable workflow [`ca8dcd3`](https://github.com/inspect-js/has-tostringtag/commit/ca8dcd3a6f3f5805d7e3fd461b654aedba0946e7)
+- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `npmignore`, `tape` [`07f3eaf`](https://github.com/inspect-js/has-tostringtag/commit/07f3eafa45dd98208c94479737da77f9a69b94c4)
+- [Deps] update `has-symbols` [`999e009`](https://github.com/inspect-js/has-tostringtag/commit/999e0095a7d1749a58f55472ec8bf8108cdfdcf3)
+- [Tests] remove staging tests since they fail on modern node [`9d9526b`](https://github.com/inspect-js/has-tostringtag/commit/9d9526b1dc1ca7f2292b52efda4c3d857b0e39bd)
+
+## v1.0.0 - 2021-08-05
+
+### Commits
+
+- Tests [`6b6f573`](https://github.com/inspect-js/has-tostringtag/commit/6b6f5734dc2058badb300ff0783efdad95fe1a65)
+- Initial commit [`2f8190e`](https://github.com/inspect-js/has-tostringtag/commit/2f8190e799fac32ba9b95a076c0255e01d7ce475)
+- [meta] do not publish github action workflow files [`6e08cc4`](https://github.com/inspect-js/has-tostringtag/commit/6e08cc4e0fea7ec71ef66e70734b2af2c4a8b71b)
+- readme [`94bed6c`](https://github.com/inspect-js/has-tostringtag/commit/94bed6c9560cbbfda034f8d6c260bb7b0db33c1a)
+- npm init [`be67840`](https://github.com/inspect-js/has-tostringtag/commit/be67840ab92ee7adb98bcc65261975543f815fa5)
+- Implementation [`c4914ec`](https://github.com/inspect-js/has-tostringtag/commit/c4914ecc51ddee692c85b471ae0a5d8123030fbf)
+- [meta] use `auto-changelog` [`4aaf768`](https://github.com/inspect-js/has-tostringtag/commit/4aaf76895ae01d7b739f2b19f967ef2372506cd7)
+- Only apps should have lockfiles [`bc4d99e`](https://github.com/inspect-js/has-tostringtag/commit/bc4d99e4bf494afbaa235c5f098df6e642edf724)
+- [meta] add `safe-publish-latest` [`6523c05`](https://github.com/inspect-js/has-tostringtag/commit/6523c05c9b87140f3ae74c9daf91633dd9ff4e1f)
diff --git a/node_modules/has-tostringtag/LICENSE b/node_modules/has-tostringtag/LICENSE
new file mode 100644
index 0000000..7948bc0
--- /dev/null
+++ b/node_modules/has-tostringtag/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2021 Inspect JS
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/has-tostringtag/README.md b/node_modules/has-tostringtag/README.md
new file mode 100644
index 0000000..67a5e92
--- /dev/null
+++ b/node_modules/has-tostringtag/README.md
@@ -0,0 +1,46 @@
+# has-tostringtag [![Version Badge][2]][1]
+
+[![github actions][actions-image]][actions-url]
+[![coverage][codecov-image]][codecov-url]
+[![dependency status][5]][6]
+[![dev dependency status][7]][8]
+[![License][license-image]][license-url]
+[![Downloads][downloads-image]][downloads-url]
+
+[![npm badge][11]][1]
+
+Determine if the JS environment has `Symbol.toStringTag` support. Supports spec, or shams.
+
+## Example
+
+```js
+var hasSymbolToStringTag = require('has-tostringtag');
+
+hasSymbolToStringTag() === true; // if the environment has native Symbol.toStringTag support. Not polyfillable, not forgeable.
+
+var hasSymbolToStringTagKinda = require('has-tostringtag/shams');
+hasSymbolToStringTagKinda() === true; // if the environment has a Symbol.toStringTag sham that mostly follows the spec.
+```
+
+## Supported Symbol shams
+ - get-own-property-symbols [npm](https://www.npmjs.com/package/get-own-property-symbols) | [github](https://github.com/WebReflection/get-own-property-symbols)
+ - core-js [npm](https://www.npmjs.com/package/core-js) | [github](https://github.com/zloirock/core-js)
+
+## Tests
+Simply clone the repo, `npm install`, and run `npm test`
+
+[1]: https://npmjs.org/package/has-tostringtag
+[2]: https://versionbadg.es/inspect-js/has-tostringtag.svg
+[5]: https://david-dm.org/inspect-js/has-tostringtag.svg
+[6]: https://david-dm.org/inspect-js/has-tostringtag
+[7]: https://david-dm.org/inspect-js/has-tostringtag/dev-status.svg
+[8]: https://david-dm.org/inspect-js/has-tostringtag#info=devDependencies
+[11]: https://nodei.co/npm/has-tostringtag.png?downloads=true&stars=true
+[license-image]: https://img.shields.io/npm/l/has-tostringtag.svg
+[license-url]: LICENSE
+[downloads-image]: https://img.shields.io/npm/dm/has-tostringtag.svg
+[downloads-url]: https://npm-stat.com/charts.html?package=has-tostringtag
+[codecov-image]: https://codecov.io/gh/inspect-js/has-tostringtag/branch/main/graphs/badge.svg
+[codecov-url]: https://app.codecov.io/gh/inspect-js/has-tostringtag/
+[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/has-tostringtag
+[actions-url]: https://github.com/inspect-js/has-tostringtag/actions
diff --git a/node_modules/has-tostringtag/index.d.ts b/node_modules/has-tostringtag/index.d.ts
new file mode 100644
index 0000000..a61bc60
--- /dev/null
+++ b/node_modules/has-tostringtag/index.d.ts
@@ -0,0 +1,3 @@
+declare function hasToStringTag(): boolean;
+
+export = hasToStringTag;
diff --git a/node_modules/has-tostringtag/index.js b/node_modules/has-tostringtag/index.js
new file mode 100644
index 0000000..77bfa00
--- /dev/null
+++ b/node_modules/has-tostringtag/index.js
@@ -0,0 +1,8 @@
+'use strict';
+
+var hasSymbols = require('has-symbols');
+
+/** @type {import('.')} */
+module.exports = function hasToStringTag() {
+ return hasSymbols() && typeof Symbol.toStringTag === 'symbol';
+};
diff --git a/node_modules/has-tostringtag/package.json b/node_modules/has-tostringtag/package.json
new file mode 100644
index 0000000..e5b0300
--- /dev/null
+++ b/node_modules/has-tostringtag/package.json
@@ -0,0 +1,108 @@
+{
+ "name": "has-tostringtag",
+ "version": "1.0.2",
+ "author": {
+ "name": "Jordan Harband",
+ "email": "ljharb@gmail.com",
+ "url": "http://ljharb.codes"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ },
+ "contributors": [
+ {
+ "name": "Jordan Harband",
+ "email": "ljharb@gmail.com",
+ "url": "http://ljharb.codes"
+ }
+ ],
+ "description": "Determine if the JS environment has `Symbol.toStringTag` support. Supports spec, or shams.",
+ "license": "MIT",
+ "main": "index.js",
+ "types": "./index.d.ts",
+ "exports": {
+ ".": [
+ {
+ "types": "./index.d.ts",
+ "default": "./index.js"
+ },
+ "./index.js"
+ ],
+ "./shams": [
+ {
+ "types": "./shams.d.ts",
+ "default": "./shams.js"
+ },
+ "./shams.js"
+ ],
+ "./package.json": "./package.json"
+ },
+ "scripts": {
+ "prepack": "npmignore --auto --commentLines=autogenerated",
+ "prepublishOnly": "safe-publish-latest",
+ "prepublish": "not-in-publish || npm run prepublishOnly",
+ "pretest": "npm run --silent lint",
+ "test": "npm run tests-only",
+ "posttest": "aud --production",
+ "tests-only": "npm run test:stock && npm run test:shams",
+ "test:stock": "nyc node test",
+ "test:staging": "nyc node --harmony --es-staging test",
+ "test:shams": "npm run --silent test:shams:getownpropertysymbols && npm run --silent test:shams:corejs",
+ "test:shams:corejs": "nyc node test/shams/core-js.js",
+ "test:shams:getownpropertysymbols": "nyc node test/shams/get-own-property-symbols.js",
+ "lint": "eslint --ext=js,mjs .",
+ "version": "auto-changelog && git add CHANGELOG.md",
+ "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/inspect-js/has-tostringtag.git"
+ },
+ "bugs": {
+ "url": "https://github.com/inspect-js/has-tostringtag/issues"
+ },
+ "homepage": "https://github.com/inspect-js/has-tostringtag#readme",
+ "keywords": [
+ "javascript",
+ "ecmascript",
+ "symbol",
+ "symbols",
+ "tostringtag",
+ "Symbol.toStringTag"
+ ],
+ "devDependencies": {
+ "@ljharb/eslint-config": "^21.1.0",
+ "@types/has-symbols": "^1.0.2",
+ "@types/tape": "^5.6.4",
+ "aud": "^2.0.4",
+ "auto-changelog": "^2.4.0",
+ "core-js": "^2.6.12",
+ "eslint": "=8.8.0",
+ "get-own-property-symbols": "^0.9.5",
+ "in-publish": "^2.0.1",
+ "npmignore": "^0.3.1",
+ "nyc": "^10.3.2",
+ "safe-publish-latest": "^2.0.0",
+ "tape": "^5.7.4",
+ "typescript": "next"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "auto-changelog": {
+ "output": "CHANGELOG.md",
+ "template": "keepachangelog",
+ "unreleased": false,
+ "commitLimit": false,
+ "backfillLimit": false,
+ "hideCredit": true
+ },
+ "publishConfig": {
+ "ignore": [
+ ".github/workflows"
+ ]
+ },
+ "dependencies": {
+ "has-symbols": "^1.0.3"
+ }
+}
diff --git a/node_modules/has-tostringtag/shams.d.ts b/node_modules/has-tostringtag/shams.d.ts
new file mode 100644
index 0000000..ea4aeec
--- /dev/null
+++ b/node_modules/has-tostringtag/shams.d.ts
@@ -0,0 +1,3 @@
+declare function hasToStringTagShams(): boolean;
+
+export = hasToStringTagShams;
diff --git a/node_modules/has-tostringtag/shams.js b/node_modules/has-tostringtag/shams.js
new file mode 100644
index 0000000..809580d
--- /dev/null
+++ b/node_modules/has-tostringtag/shams.js
@@ -0,0 +1,8 @@
+'use strict';
+
+var hasSymbols = require('has-symbols/shams');
+
+/** @type {import('.')} */
+module.exports = function hasToStringTagShams() {
+ return hasSymbols() && !!Symbol.toStringTag;
+};
diff --git a/node_modules/has-tostringtag/test/index.js b/node_modules/has-tostringtag/test/index.js
new file mode 100644
index 0000000..0679afd
--- /dev/null
+++ b/node_modules/has-tostringtag/test/index.js
@@ -0,0 +1,21 @@
+'use strict';
+
+var test = require('tape');
+var hasSymbolToStringTag = require('../');
+var runSymbolTests = require('./tests');
+
+test('interface', function (t) {
+ t.equal(typeof hasSymbolToStringTag, 'function', 'is a function');
+ t.equal(typeof hasSymbolToStringTag(), 'boolean', 'returns a boolean');
+ t.end();
+});
+
+test('Symbol.toStringTag exists', { skip: !hasSymbolToStringTag() }, function (t) {
+ runSymbolTests(t);
+ t.end();
+});
+
+test('Symbol.toStringTag does not exist', { skip: hasSymbolToStringTag() }, function (t) {
+ t.equal(typeof Symbol === 'undefined' ? 'undefined' : typeof Symbol.toStringTag, 'undefined', 'global Symbol.toStringTag is undefined');
+ t.end();
+});
diff --git a/node_modules/has-tostringtag/test/shams/core-js.js b/node_modules/has-tostringtag/test/shams/core-js.js
new file mode 100644
index 0000000..7ab214d
--- /dev/null
+++ b/node_modules/has-tostringtag/test/shams/core-js.js
@@ -0,0 +1,31 @@
+'use strict';
+
+var test = require('tape');
+
+if (typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol') {
+ test('has native Symbol.toStringTag support', function (t) {
+ t.equal(typeof Symbol, 'function');
+ t.equal(typeof Symbol.toStringTag, 'symbol');
+ t.end();
+ });
+ // @ts-expect-error CJS has top-level return
+ return;
+}
+
+var hasSymbolToStringTag = require('../../shams');
+
+test('polyfilled Symbols', function (t) {
+ /* eslint-disable global-require */
+ t.equal(hasSymbolToStringTag(), false, 'hasSymbolToStringTag is false before polyfilling');
+ // @ts-expect-error no types defined
+ require('core-js/fn/symbol');
+ // @ts-expect-error no types defined
+ require('core-js/fn/symbol/to-string-tag');
+
+ require('../tests')(t);
+
+ var hasToStringTagAfter = hasSymbolToStringTag();
+ t.equal(hasToStringTagAfter, true, 'hasSymbolToStringTag is true after polyfilling');
+ /* eslint-enable global-require */
+ t.end();
+});
diff --git a/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js b/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js
new file mode 100644
index 0000000..c8af44c
--- /dev/null
+++ b/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js
@@ -0,0 +1,30 @@
+'use strict';
+
+var test = require('tape');
+
+if (typeof Symbol === 'function' && typeof Symbol() === 'symbol') {
+ test('has native Symbol support', function (t) {
+ t.equal(typeof Symbol, 'function');
+ t.equal(typeof Symbol(), 'symbol');
+ t.end();
+ });
+ // @ts-expect-error CJS has top-level return
+ return;
+}
+
+var hasSymbolToStringTag = require('../../shams');
+
+test('polyfilled Symbols', function (t) {
+ /* eslint-disable global-require */
+ t.equal(hasSymbolToStringTag(), false, 'hasSymbolToStringTag is false before polyfilling');
+
+ // @ts-expect-error no types defined
+ require('get-own-property-symbols');
+
+ require('../tests')(t);
+
+ var hasToStringTagAfter = hasSymbolToStringTag();
+ t.equal(hasToStringTagAfter, true, 'hasSymbolToStringTag is true after polyfilling');
+ /* eslint-enable global-require */
+ t.end();
+});
diff --git a/node_modules/has-tostringtag/test/tests.js b/node_modules/has-tostringtag/test/tests.js
new file mode 100644
index 0000000..2aa0d48
--- /dev/null
+++ b/node_modules/has-tostringtag/test/tests.js
@@ -0,0 +1,15 @@
+'use strict';
+
+// eslint-disable-next-line consistent-return
+module.exports = /** @type {(t: import('tape').Test) => void | false} */ function runSymbolTests(t) {
+ t.equal(typeof Symbol, 'function', 'global Symbol is a function');
+ t.ok(Symbol.toStringTag, 'Symbol.toStringTag exists');
+
+ if (typeof Symbol !== 'function' || !Symbol.toStringTag) { return false; }
+
+ /** @type {{ [Symbol.toStringTag]?: 'test'}} */
+ var obj = {};
+ obj[Symbol.toStringTag] = 'test';
+
+ t.equal(Object.prototype.toString.call(obj), '[object test]');
+};
diff --git a/node_modules/has-tostringtag/tsconfig.json b/node_modules/has-tostringtag/tsconfig.json
new file mode 100644
index 0000000..2002ce5
--- /dev/null
+++ b/node_modules/has-tostringtag/tsconfig.json
@@ -0,0 +1,49 @@
+{
+ "compilerOptions": {
+ /* Visit https://aka.ms/tsconfig to read more about this file */
+
+ /* Projects */
+
+ /* Language and Environment */
+ "target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
+ // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
+ // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
+ "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
+ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
+
+ /* Modules */
+ "module": "commonjs", /* Specify what module code is generated. */
+ // "rootDir": "./", /* Specify the root folder within your source files. */
+ // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
+ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
+ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
+ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
+ "typeRoots": ["types"], /* Specify multiple folders that act like './node_modules/@types'. */
+ "resolveJsonModule": true, /* Enable importing .json files. */
+ // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
+
+ /* JavaScript Support */
+ "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
+ "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
+ "maxNodeModuleJsDepth": 0, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
+
+ /* Emit */
+ "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
+ "declarationMap": true, /* Create sourcemaps for d.ts files. */
+ "noEmit": true, /* Disable emitting files from a compilation. */
+
+ /* Interop Constraints */
+ "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
+ "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
+ "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
+
+ /* Type Checking */
+ "strict": true, /* Enable all strict type-checking options. */
+
+ /* Completeness */
+ //"skipLibCheck": true /* Skip type checking all .d.ts files. */
+ },
+ "exclude": [
+ "coverage"
+ ]
+}
diff --git a/node_modules/has/LICENSE-MIT b/node_modules/has/LICENSE-MIT
deleted file mode 100644
index ae7014d..0000000
--- a/node_modules/has/LICENSE-MIT
+++ /dev/null
@@ -1,22 +0,0 @@
-Copyright (c) 2013 Thiago de Arruda
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/has/README.md b/node_modules/has/README.md
deleted file mode 100644
index 635e3a4..0000000
--- a/node_modules/has/README.md
+++ /dev/null
@@ -1,18 +0,0 @@
-# has
-
-> Object.prototype.hasOwnProperty.call shortcut
-
-## Installation
-
-```sh
-npm install --save has
-```
-
-## Usage
-
-```js
-var has = require('has');
-
-has({}, 'hasOwnProperty'); // false
-has(Object.prototype, 'hasOwnProperty'); // true
-```
diff --git a/node_modules/has/package.json b/node_modules/has/package.json
deleted file mode 100644
index 7c4592f..0000000
--- a/node_modules/has/package.json
+++ /dev/null
@@ -1,48 +0,0 @@
-{
- "name": "has",
- "description": "Object.prototype.hasOwnProperty.call shortcut",
- "version": "1.0.3",
- "homepage": "https://github.com/tarruda/has",
- "author": {
- "name": "Thiago de Arruda",
- "email": "tpadilha84@gmail.com"
- },
- "contributors": [
- {
- "name": "Jordan Harband",
- "email": "ljharb@gmail.com",
- "url": "http://ljharb.codes"
- }
- ],
- "repository": {
- "type": "git",
- "url": "git://github.com/tarruda/has.git"
- },
- "bugs": {
- "url": "https://github.com/tarruda/has/issues"
- },
- "license": "MIT",
- "licenses": [
- {
- "type": "MIT",
- "url": "https://github.com/tarruda/has/blob/master/LICENSE-MIT"
- }
- ],
- "main": "./src",
- "dependencies": {
- "function-bind": "^1.1.1"
- },
- "devDependencies": {
- "@ljharb/eslint-config": "^12.2.1",
- "eslint": "^4.19.1",
- "tape": "^4.9.0"
- },
- "engines": {
- "node": ">= 0.4.0"
- },
- "scripts": {
- "lint": "eslint .",
- "pretest": "npm run lint",
- "test": "tape test"
- }
-}
diff --git a/node_modules/has/src/index.js b/node_modules/has/src/index.js
deleted file mode 100644
index dd92dd9..0000000
--- a/node_modules/has/src/index.js
+++ /dev/null
@@ -1,5 +0,0 @@
-'use strict';
-
-var bind = require('function-bind');
-
-module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);
diff --git a/node_modules/has/test/index.js b/node_modules/has/test/index.js
deleted file mode 100644
index 43d480b..0000000
--- a/node_modules/has/test/index.js
+++ /dev/null
@@ -1,10 +0,0 @@
-'use strict';
-
-var test = require('tape');
-var has = require('../');
-
-test('has', function (t) {
- t.equal(has({}, 'hasOwnProperty'), false, 'object literal does not have own property "hasOwnProperty"');
- t.equal(has(Object.prototype, 'hasOwnProperty'), true, 'Object.prototype has own property "hasOwnProperty"');
- t.end();
-});
diff --git a/node_modules/hasown/.eslintrc b/node_modules/hasown/.eslintrc
new file mode 100644
index 0000000..3b5d9e9
--- /dev/null
+++ b/node_modules/hasown/.eslintrc
@@ -0,0 +1,5 @@
+{
+ "root": true,
+
+ "extends": "@ljharb",
+}
diff --git a/node_modules/hasown/.github/FUNDING.yml b/node_modules/hasown/.github/FUNDING.yml
new file mode 100644
index 0000000..d68c8b7
--- /dev/null
+++ b/node_modules/hasown/.github/FUNDING.yml
@@ -0,0 +1,12 @@
+# These are supported funding model platforms
+
+github: [ljharb]
+patreon: # Replace with a single Patreon username
+open_collective: # Replace with a single Open Collective username
+ko_fi: # Replace with a single Ko-fi username
+tidelift: npm/hasown
+community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
+liberapay: # Replace with a single Liberapay username
+issuehunt: # Replace with a single IssueHunt username
+otechie: # Replace with a single Otechie username
+custom: # Replace with a single custom sponsorship URL
diff --git a/node_modules/hasown/.nycrc b/node_modules/hasown/.nycrc
new file mode 100644
index 0000000..1826526
--- /dev/null
+++ b/node_modules/hasown/.nycrc
@@ -0,0 +1,13 @@
+{
+ "all": true,
+ "check-coverage": false,
+ "reporter": ["text-summary", "text", "html", "json"],
+ "lines": 86,
+ "statements": 85.93,
+ "functions": 82.43,
+ "branches": 76.06,
+ "exclude": [
+ "coverage",
+ "test"
+ ]
+}
diff --git a/node_modules/hasown/CHANGELOG.md b/node_modules/hasown/CHANGELOG.md
new file mode 100644
index 0000000..2b0a980
--- /dev/null
+++ b/node_modules/hasown/CHANGELOG.md
@@ -0,0 +1,40 @@
+# Changelog
+
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [v2.0.2](https://github.com/inspect-js/hasOwn/compare/v2.0.1...v2.0.2) - 2024-03-10
+
+### Commits
+
+- [types] use shared config [`68e9d4d`](https://github.com/inspect-js/hasOwn/commit/68e9d4dab6facb4f05f02c6baea94a3f2a4e44b2)
+- [actions] remove redundant finisher; use reusable workflow [`241a68e`](https://github.com/inspect-js/hasOwn/commit/241a68e13ea1fe52bec5ba7f74144befc31fae7b)
+- [Tests] increase coverage [`4125c0d`](https://github.com/inspect-js/hasOwn/commit/4125c0d6121db56ae30e38346dfb0c000b04f0a7)
+- [Tests] skip `npm ls` in old node due to TS [`01b9282`](https://github.com/inspect-js/hasOwn/commit/01b92822f9971dea031eafdd14767df41d61c202)
+- [types] improve predicate type [`d340f85`](https://github.com/inspect-js/hasOwn/commit/d340f85ce02e286ef61096cbbb6697081d40a12b)
+- [Dev Deps] update `tape` [`70089fc`](https://github.com/inspect-js/hasOwn/commit/70089fcf544e64acc024cbe60f5a9b00acad86de)
+- [Tests] use `@arethetypeswrong/cli` [`50b272c`](https://github.com/inspect-js/hasOwn/commit/50b272c829f40d053a3dd91c9796e0ac0b2af084)
+
+## [v2.0.1](https://github.com/inspect-js/hasOwn/compare/v2.0.0...v2.0.1) - 2024-02-10
+
+### Commits
+
+- [types] use a handwritten d.ts file; fix exported type [`012b989`](https://github.com/inspect-js/hasOwn/commit/012b9898ccf91dc441e2ebf594ff70270a5fda58)
+- [Dev Deps] update `@types/function-bind`, `@types/mock-property`, `@types/tape`, `aud`, `mock-property`, `npmignore`, `tape`, `typescript` [`977a56f`](https://github.com/inspect-js/hasOwn/commit/977a56f51a1f8b20566f3c471612137894644025)
+- [meta] add `sideEffects` flag [`3a60b7b`](https://github.com/inspect-js/hasOwn/commit/3a60b7bf42fccd8c605e5f145a6fcc83b13cb46f)
+
+## [v2.0.0](https://github.com/inspect-js/hasOwn/compare/v1.0.1...v2.0.0) - 2023-10-19
+
+### Commits
+
+- revamped implementation, tests, readme [`72bf8b3`](https://github.com/inspect-js/hasOwn/commit/72bf8b338e77a638f0a290c63ffaed18339c36b4)
+- [meta] revamp package.json [`079775f`](https://github.com/inspect-js/hasOwn/commit/079775fb1ec72c1c6334069593617a0be3847458)
+- Only apps should have lockfiles [`6640e23`](https://github.com/inspect-js/hasOwn/commit/6640e233d1bb8b65260880f90787637db157d215)
+
+## v1.0.1 - 2023-10-10
+
+### Commits
+
+- Initial commit [`8dbfde6`](https://github.com/inspect-js/hasOwn/commit/8dbfde6e8fb0ebb076fab38d138f2984eb340a62)
diff --git a/node_modules/hasown/LICENSE b/node_modules/hasown/LICENSE
new file mode 100644
index 0000000..0314929
--- /dev/null
+++ b/node_modules/hasown/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) Jordan Harband and contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/hasown/README.md b/node_modules/hasown/README.md
new file mode 100644
index 0000000..f759b8a
--- /dev/null
+++ b/node_modules/hasown/README.md
@@ -0,0 +1,40 @@
+# hasown [![Version Badge][npm-version-svg]][package-url]
+
+[![github actions][actions-image]][actions-url]
+[![coverage][codecov-image]][codecov-url]
+[![License][license-image]][license-url]
+[![Downloads][downloads-image]][downloads-url]
+
+[![npm badge][npm-badge-png]][package-url]
+
+A robust, ES3 compatible, "has own property" predicate.
+
+## Example
+
+```js
+const assert = require('assert');
+const hasOwn = require('hasown');
+
+assert.equal(hasOwn({}, 'toString'), false);
+assert.equal(hasOwn([], 'length'), true);
+assert.equal(hasOwn({ a: 42 }, 'a'), true);
+```
+
+## Tests
+Simply clone the repo, `npm install`, and run `npm test`
+
+[package-url]: https://npmjs.org/package/hasown
+[npm-version-svg]: https://versionbadg.es/inspect-js/hasown.svg
+[deps-svg]: https://david-dm.org/inspect-js/hasOwn.svg
+[deps-url]: https://david-dm.org/inspect-js/hasOwn
+[dev-deps-svg]: https://david-dm.org/inspect-js/hasOwn/dev-status.svg
+[dev-deps-url]: https://david-dm.org/inspect-js/hasOwn#info=devDependencies
+[npm-badge-png]: https://nodei.co/npm/hasown.png?downloads=true&stars=true
+[license-image]: https://img.shields.io/npm/l/hasown.svg
+[license-url]: LICENSE
+[downloads-image]: https://img.shields.io/npm/dm/hasown.svg
+[downloads-url]: https://npm-stat.com/charts.html?package=hasown
+[codecov-image]: https://codecov.io/gh/inspect-js/hasOwn/branch/main/graphs/badge.svg
+[codecov-url]: https://app.codecov.io/gh/inspect-js/hasOwn/
+[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/hasOwn
+[actions-url]: https://github.com/inspect-js/hasOwn/actions
diff --git a/node_modules/hasown/index.d.ts b/node_modules/hasown/index.d.ts
new file mode 100644
index 0000000..aafdf3b
--- /dev/null
+++ b/node_modules/hasown/index.d.ts
@@ -0,0 +1,3 @@
+declare function hasOwn(o: O, p: K): o is O & Record;
+
+export = hasOwn;
diff --git a/node_modules/hasown/index.js b/node_modules/hasown/index.js
new file mode 100644
index 0000000..34e6059
--- /dev/null
+++ b/node_modules/hasown/index.js
@@ -0,0 +1,8 @@
+'use strict';
+
+var call = Function.prototype.call;
+var $hasOwn = Object.prototype.hasOwnProperty;
+var bind = require('function-bind');
+
+/** @type {import('.')} */
+module.exports = bind.call(call, $hasOwn);
diff --git a/node_modules/hasown/package.json b/node_modules/hasown/package.json
new file mode 100644
index 0000000..8502e13
--- /dev/null
+++ b/node_modules/hasown/package.json
@@ -0,0 +1,92 @@
+{
+ "name": "hasown",
+ "version": "2.0.2",
+ "description": "A robust, ES3 compatible, \"has own property\" predicate.",
+ "main": "index.js",
+ "exports": {
+ ".": "./index.js",
+ "./package.json": "./package.json"
+ },
+ "types": "index.d.ts",
+ "sideEffects": false,
+ "scripts": {
+ "prepack": "npmignore --auto --commentLines=autogenerated",
+ "prepublish": "not-in-publish || npm run prepublishOnly",
+ "prepublishOnly": "safe-publish-latest",
+ "prelint": "evalmd README.md",
+ "lint": "eslint --ext=js,mjs .",
+ "postlint": "npm run tsc",
+ "pretest": "npm run lint",
+ "tsc": "tsc -p .",
+ "posttsc": "attw -P",
+ "tests-only": "nyc tape 'test/**/*.js'",
+ "test": "npm run tests-only",
+ "posttest": "aud --production",
+ "version": "auto-changelog && git add CHANGELOG.md",
+ "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/inspect-js/hasOwn.git"
+ },
+ "keywords": [
+ "has",
+ "hasOwnProperty",
+ "hasOwn",
+ "has-own",
+ "own",
+ "has",
+ "property",
+ "in",
+ "javascript",
+ "ecmascript"
+ ],
+ "author": "Jordan Harband ",
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/inspect-js/hasOwn/issues"
+ },
+ "homepage": "https://github.com/inspect-js/hasOwn#readme",
+ "dependencies": {
+ "function-bind": "^1.1.2"
+ },
+ "devDependencies": {
+ "@arethetypeswrong/cli": "^0.15.1",
+ "@ljharb/eslint-config": "^21.1.0",
+ "@ljharb/tsconfig": "^0.2.0",
+ "@types/function-bind": "^1.1.10",
+ "@types/mock-property": "^1.0.2",
+ "@types/tape": "^5.6.4",
+ "aud": "^2.0.4",
+ "auto-changelog": "^2.4.0",
+ "eslint": "=8.8.0",
+ "evalmd": "^0.0.19",
+ "in-publish": "^2.0.1",
+ "mock-property": "^1.0.3",
+ "npmignore": "^0.3.1",
+ "nyc": "^10.3.2",
+ "safe-publish-latest": "^2.0.0",
+ "tape": "^5.7.5",
+ "typescript": "next"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "testling": {
+ "files": "test/index.js"
+ },
+ "auto-changelog": {
+ "output": "CHANGELOG.md",
+ "template": "keepachangelog",
+ "unreleased": false,
+ "commitLimit": false,
+ "backfillLimit": false,
+ "hideCredit": true
+ },
+ "publishConfig": {
+ "ignore": [
+ ".github/workflows",
+ "test"
+ ]
+ }
+}
diff --git a/node_modules/hasown/tsconfig.json b/node_modules/hasown/tsconfig.json
new file mode 100644
index 0000000..0930c56
--- /dev/null
+++ b/node_modules/hasown/tsconfig.json
@@ -0,0 +1,6 @@
+{
+ "extends": "@ljharb/tsconfig",
+ "exclude": [
+ "coverage",
+ ],
+}
diff --git a/node_modules/is-core-module/.eslintrc b/node_modules/is-core-module/.eslintrc
new file mode 100644
index 0000000..f2e0726
--- /dev/null
+++ b/node_modules/is-core-module/.eslintrc
@@ -0,0 +1,18 @@
+{
+ "extends": "@ljharb",
+ "root": true,
+ "rules": {
+ "func-style": 1,
+ },
+ "overrides": [
+ {
+ "files": "test/**",
+ "rules": {
+ "global-require": 0,
+ "max-depth": 0,
+ "max-lines-per-function": 0,
+ "no-negated-condition": 0,
+ },
+ },
+ ],
+}
diff --git a/node_modules/is-core-module/.nycrc b/node_modules/is-core-module/.nycrc
new file mode 100644
index 0000000..bdd626c
--- /dev/null
+++ b/node_modules/is-core-module/.nycrc
@@ -0,0 +1,9 @@
+{
+ "all": true,
+ "check-coverage": false,
+ "reporter": ["text-summary", "text", "html", "json"],
+ "exclude": [
+ "coverage",
+ "test"
+ ]
+}
diff --git a/node_modules/is-core-module/CHANGELOG.md b/node_modules/is-core-module/CHANGELOG.md
new file mode 100644
index 0000000..ae847df
--- /dev/null
+++ b/node_modules/is-core-module/CHANGELOG.md
@@ -0,0 +1,205 @@
+# Changelog
+
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [v2.15.1](https://github.com/inspect-js/is-core-module/compare/v2.15.0...v2.15.1) - 2024-08-21
+
+### Commits
+
+- [Tests] add `process.getBuiltinModule` tests [`28c7791`](https://github.com/inspect-js/is-core-module/commit/28c7791c196d58c64cfdf638b7e68ed1b62a4da0)
+- [Fix] `test/mock_loader` is no longer exposed as of v22.7 [`68b08b0`](https://github.com/inspect-js/is-core-module/commit/68b08b0d7963447dbffa5142e8810dca550383af)
+- [Tests] replace `aud` with `npm audit` [`32f8060`](https://github.com/inspect-js/is-core-module/commit/32f806026dac14f9016be4401a643851240c76b9)
+- [Dev Deps] update `mock-property` [`f7d3c8f`](https://github.com/inspect-js/is-core-module/commit/f7d3c8f01e922be49621683eb41477c4f50522e1)
+- [Dev Deps] add missing peer dep [`eaee885`](https://github.com/inspect-js/is-core-module/commit/eaee885b67238819e9c8ed5bd2098766e1d05331)
+
+## [v2.15.0](https://github.com/inspect-js/is-core-module/compare/v2.14.0...v2.15.0) - 2024-07-17
+
+### Commits
+
+- [New] add `node:sea` [`2819fb3`](https://github.com/inspect-js/is-core-module/commit/2819fb3eae312fa64643bc5430ebd06ec0f3fb88)
+
+## [v2.14.0](https://github.com/inspect-js/is-core-module/compare/v2.13.1...v2.14.0) - 2024-06-20
+
+### Commits
+
+- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `mock-property`, `npmignore`, `tape` [`0e43200`](https://github.com/inspect-js/is-core-module/commit/0e432006d97237cc082d41e6a593e87c81068364)
+- [meta] add missing `engines.node` [`4ea3af8`](https://github.com/inspect-js/is-core-module/commit/4ea3af88891a1d4f96026f0ec0ef08c67cd1bd24)
+- [New] add `test/mock_loader` [`e9fbd29`](https://github.com/inspect-js/is-core-module/commit/e9fbd2951383be070aeffb9ebbf3715237282610)
+- [Deps] update `hasown` [`57f1940`](https://github.com/inspect-js/is-core-module/commit/57f1940947b3e368abdf529232d2f17d88909358)
+
+## [v2.13.1](https://github.com/inspect-js/is-core-module/compare/v2.13.0...v2.13.1) - 2023-10-20
+
+### Commits
+
+- [Refactor] use `hasown` instead of `has` [`0e52096`](https://github.com/inspect-js/is-core-module/commit/0e520968b0a725276b67420ab4b877486b243ae0)
+- [Dev Deps] update `mock-property`, `tape` [`8736b35`](https://github.com/inspect-js/is-core-module/commit/8736b35464d0f297b55da2c6b30deee04b8303c5)
+
+## [v2.13.0](https://github.com/inspect-js/is-core-module/compare/v2.12.1...v2.13.0) - 2023-08-05
+
+### Commits
+
+- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `semver`, `tape` [`c75b263`](https://github.com/inspect-js/is-core-module/commit/c75b263d047cb53430c3970107e5eb64d6cd6c0c)
+- [New] `node:test/reporters` and `wasi`/`node:wasi` are in v18.17 [`d76cbf8`](https://github.com/inspect-js/is-core-module/commit/d76cbf8e9b208acfd98913fed5a5f45cb15fe5dc)
+
+## [v2.12.1](https://github.com/inspect-js/is-core-module/compare/v2.12.0...v2.12.1) - 2023-05-16
+
+### Commits
+
+- [Fix] `test/reporters` now requires the `node:` prefix as of v20.2 [`12183d0`](https://github.com/inspect-js/is-core-module/commit/12183d0d8e4edf56b6ce18a1b3be54bfce10175b)
+
+## [v2.12.0](https://github.com/inspect-js/is-core-module/compare/v2.11.0...v2.12.0) - 2023-04-10
+
+### Commits
+
+- [actions] update rebase action to use reusable workflow [`c0a7251`](https://github.com/inspect-js/is-core-module/commit/c0a7251f734f3c621932c5fcdfd1bf966b42ca32)
+- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`9ae8b7f`](https://github.com/inspect-js/is-core-module/commit/9ae8b7fac03c369861d0991b4a2ce8d4848e6a7d)
+- [New] `test/reporters` added in v19.9, `wasi` added in v20 [`9d5341a`](https://github.com/inspect-js/is-core-module/commit/9d5341ab32053f25b7fa7db3c0e18461db24a79c)
+- [Dev Deps] add missing `in-publish` dep [`5980245`](https://github.com/inspect-js/is-core-module/commit/59802456e9ac919fa748f53be9d8fbf304a197df)
+
+## [v2.11.0](https://github.com/inspect-js/is-core-module/compare/v2.10.0...v2.11.0) - 2022-10-18
+
+### Commits
+
+- [meta] use `npmignore` to autogenerate an npmignore file [`3360011`](https://github.com/inspect-js/is-core-module/commit/33600118857b46177178072fba2affcdeb009d12)
+- [Dev Deps] update `aud`, `tape` [`651c6b0`](https://github.com/inspect-js/is-core-module/commit/651c6b0cc2799d4130866cf43ad333dcade3d26c)
+- [New] `inspector/promises` and `node:inspector/promises` is now available in node 19 [`22d332f`](https://github.com/inspect-js/is-core-module/commit/22d332fe22ac050305444e0781ff85af819abcb0)
+
+## [v2.10.0](https://github.com/inspect-js/is-core-module/compare/v2.9.0...v2.10.0) - 2022-08-03
+
+### Commits
+
+- [New] `node:test` is now available in node ^16.17 [`e8fd36e`](https://github.com/inspect-js/is-core-module/commit/e8fd36e9b86c917775a07cc473b62a3294f459f2)
+- [Tests] improve skip message [`c014a4c`](https://github.com/inspect-js/is-core-module/commit/c014a4c0cd6eb15fff573ae4709191775e70cab4)
+
+## [v2.9.0](https://github.com/inspect-js/is-core-module/compare/v2.8.1...v2.9.0) - 2022-04-19
+
+### Commits
+
+- [New] add `node:test`, in node 18+ [`f853eca`](https://github.com/inspect-js/is-core-module/commit/f853eca801d0a7d4e1dbb670f1b6d9837d9533c5)
+- [Tests] use `mock-property` [`03b3644`](https://github.com/inspect-js/is-core-module/commit/03b3644dff4417f4ba5a7d0aa0138f5f6b3e5c46)
+- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`7c0e2d0`](https://github.com/inspect-js/is-core-module/commit/7c0e2d06ed2a89acf53abe2ab34d703ed5b03455)
+- [meta] simplify "exports" [`d6ed201`](https://github.com/inspect-js/is-core-module/commit/d6ed201eba7fbba0e59814a9050fc49a6e9878c8)
+
+## [v2.8.1](https://github.com/inspect-js/is-core-module/compare/v2.8.0...v2.8.1) - 2022-01-05
+
+### Commits
+
+- [actions] reuse common workflows [`cd2cf9b`](https://github.com/inspect-js/is-core-module/commit/cd2cf9b3b66c8d328f65610efe41e9325db7716d)
+- [Fix] update node 0.4 results [`062195d`](https://github.com/inspect-js/is-core-module/commit/062195d89f0876a88b95d378b43f7fcc1205bc5b)
+- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape` [`0790b62`](https://github.com/inspect-js/is-core-module/commit/0790b6222848c6167132f9f73acc3520fa8d1298)
+- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`7d139a6`](https://github.com/inspect-js/is-core-module/commit/7d139a6d767709eabf0a0251e074ec1fb230c06e)
+- [Tests] run `nyc` in `tests-only`, not `test` [`780e8a0`](https://github.com/inspect-js/is-core-module/commit/780e8a049951c71cf78b1707f0871c48a28bde14)
+
+## [v2.8.0](https://github.com/inspect-js/is-core-module/compare/v2.7.0...v2.8.0) - 2021-10-14
+
+### Commits
+
+- [actions] update codecov uploader [`0cfe94e`](https://github.com/inspect-js/is-core-module/commit/0cfe94e106a7d005ea03e008c0a21dec13a77904)
+- [New] add `readline/promises` to node v17+ [`4f78c30`](https://github.com/inspect-js/is-core-module/commit/4f78c3008b1b58b4db6dc91d99610b1bc859da7e)
+- [Tests] node ^14.18 supports `node:` prefixes for CJS [`43e2f17`](https://github.com/inspect-js/is-core-module/commit/43e2f177452cea2f0eaf34f61b5407217bbdb6f4)
+
+## [v2.7.0](https://github.com/inspect-js/is-core-module/compare/v2.6.0...v2.7.0) - 2021-09-27
+
+### Commits
+
+- [New] node `v14.18` added `node:`-prefixed core modules to `require` [`6d943ab`](https://github.com/inspect-js/is-core-module/commit/6d943abe81382b9bbe344384d80fbfebe1cc0526)
+- [Tests] add coverage for Object.prototype pollution [`c6baf5f`](https://github.com/inspect-js/is-core-module/commit/c6baf5f942311a1945c1af41167bb80b84df2af7)
+- [Dev Deps] update `@ljharb/eslint-config` [`6717f00`](https://github.com/inspect-js/is-core-module/commit/6717f000d063ea57beb772bded36c2f056ac404c)
+- [eslint] fix linter warning [`594c10b`](https://github.com/inspect-js/is-core-module/commit/594c10bb7d39d7eb00925c90924199ff596184b2)
+- [meta] add `sideEffects` flag [`c32cfa5`](https://github.com/inspect-js/is-core-module/commit/c32cfa5195632944c4dd4284a142b8476e75be13)
+
+## [v2.6.0](https://github.com/inspect-js/is-core-module/compare/v2.5.0...v2.6.0) - 2021-08-17
+
+### Commits
+
+- [Dev Deps] update `eslint`, `tape` [`6cc928f`](https://github.com/inspect-js/is-core-module/commit/6cc928f8a4bba66aeeccc4f6beeac736d4bd3081)
+- [New] add `stream/consumers` to node `>= 16.7` [`a1a423e`](https://github.com/inspect-js/is-core-module/commit/a1a423e467e4cc27df180234fad5bab45943e67d)
+- [Refactor] Remove duplicated `&&` operand [`86faea7`](https://github.com/inspect-js/is-core-module/commit/86faea738213a2433c62d1098488dc9314dca832)
+- [Tests] include prereleases [`a4da7a6`](https://github.com/inspect-js/is-core-module/commit/a4da7a6abf7568e2aa4fd98e69452179f1850963)
+
+## [v2.5.0](https://github.com/inspect-js/is-core-module/compare/v2.4.0...v2.5.0) - 2021-07-12
+
+### Commits
+
+- [Dev Deps] update `auto-changelog`, `eslint` [`6334cc9`](https://github.com/inspect-js/is-core-module/commit/6334cc94f3af7469685bd8f236740991baaf2705)
+- [New] add `stream/web` to node v16.5+ [`17ac59b`](https://github.com/inspect-js/is-core-module/commit/17ac59b662d63e220a2e5728625f005c24f177b2)
+
+## [v2.4.0](https://github.com/inspect-js/is-core-module/compare/v2.3.0...v2.4.0) - 2021-05-09
+
+### Commits
+
+- [readme] add actions and codecov badges [`82b7faa`](https://github.com/inspect-js/is-core-module/commit/82b7faa12b56dbe47fbea67e1a5b9e447027ba40)
+- [Dev Deps] update `@ljharb/eslint-config`, `aud` [`8096868`](https://github.com/inspect-js/is-core-module/commit/8096868c024a161ccd4d44110b136763e92eace8)
+- [Dev Deps] update `eslint` [`6726824`](https://github.com/inspect-js/is-core-module/commit/67268249b88230018c510f6532a8046d7326346f)
+- [New] add `diagnostics_channel` to node `^14.17` [`86c6563`](https://github.com/inspect-js/is-core-module/commit/86c65634201b8ff9b3e48a9a782594579c7f5c3c)
+- [meta] fix prepublish script [`697a01e`](https://github.com/inspect-js/is-core-module/commit/697a01e3c9c0be074066520954f30fb28532ec57)
+
+## [v2.3.0](https://github.com/inspect-js/is-core-module/compare/v2.2.0...v2.3.0) - 2021-04-24
+
+### Commits
+
+- [meta] do not publish github action workflow files [`060d4bb`](https://github.com/inspect-js/is-core-module/commit/060d4bb971a29451c19ff336eb56bee27f9fa95a)
+- [New] add support for `node:` prefix, in node 16+ [`7341223`](https://github.com/inspect-js/is-core-module/commit/73412230a769f6e81c05eea50b6520cebf54ed2f)
+- [actions] use `node/install` instead of `node/run`; use `codecov` action [`016269a`](https://github.com/inspect-js/is-core-module/commit/016269abae9f6657a5254adfbb813f09a05067f9)
+- [patch] remove unneeded `.0` in version ranges [`cb466a6`](https://github.com/inspect-js/is-core-module/commit/cb466a6d89e52b8389e5c12715efcd550c41cea3)
+- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`c9f9c39`](https://github.com/inspect-js/is-core-module/commit/c9f9c396ace60ef81906f98059c064e6452473ed)
+- [actions] update workflows [`3ee4a89`](https://github.com/inspect-js/is-core-module/commit/3ee4a89fd5a02fccd43882d905448ea6a98e9a3c)
+- [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`dee4fed`](https://github.com/inspect-js/is-core-module/commit/dee4fed79690c1d43a22f7fa9426abebdc6d727f)
+- [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`7d046ba`](https://github.com/inspect-js/is-core-module/commit/7d046ba07ae8c9292e43652694ca808d7b309de8)
+- [meta] use `prepublishOnly` script for npm 7+ [`149e677`](https://github.com/inspect-js/is-core-module/commit/149e6771a5ede6d097e71785b467a9c4b4977cc7)
+- [readme] remove travis badge [`903b51d`](https://github.com/inspect-js/is-core-module/commit/903b51d6b69b98abeabfbc3695c345b02646f19c)
+
+## [v2.2.0](https://github.com/inspect-js/is-core-module/compare/v2.1.0...v2.2.0) - 2020-11-26
+
+### Commits
+
+- [Tests] migrate tests to Github Actions [`c919f57`](https://github.com/inspect-js/is-core-module/commit/c919f573c0a92d10a0acad0b650b5aecb033d426)
+- [patch] `core.json`: %s/ /\t/g [`db3f685`](https://github.com/inspect-js/is-core-module/commit/db3f68581f53e73cc09cd675955eb1bdd6a5a39b)
+- [Tests] run `nyc` on all tests [`b2f925f`](https://github.com/inspect-js/is-core-module/commit/b2f925f8866f210ef441f39fcc8cc42692ab89b1)
+- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`; add `safe-publish-latest` [`89f02a2`](https://github.com/inspect-js/is-core-module/commit/89f02a2b4162246dea303a6ee31bb9a550b05c72)
+- [New] add `path/posix`, `path/win32`, `util/types` [`77f94f1`](https://github.com/inspect-js/is-core-module/commit/77f94f1e90ffd7c0be2a3f1aa8574ebf7fd981b3)
+
+## [v2.1.0](https://github.com/inspect-js/is-core-module/compare/v2.0.0...v2.1.0) - 2020-11-04
+
+### Commits
+
+- [Dev Deps] update `eslint` [`5e0034e`](https://github.com/inspect-js/is-core-module/commit/5e0034eae57c09c8f1bd769f502486a00f56c6e4)
+- [New] Add `diagnostics_channel` [`c2d83d0`](https://github.com/inspect-js/is-core-module/commit/c2d83d0a0225a1a658945d9bab7036ea347d29ec)
+
+## [v2.0.0](https://github.com/inspect-js/is-core-module/compare/v1.0.2...v2.0.0) - 2020-09-29
+
+### Commits
+
+- v2 implementation [`865aeb5`](https://github.com/inspect-js/is-core-module/commit/865aeb5ca0e90248a3dfff5d7622e4751fdeb9cd)
+- Only apps should have lockfiles [`5a5e660`](https://github.com/inspect-js/is-core-module/commit/5a5e660d568e37eb44e17fb1ebb12a105205fc2b)
+- Initial commit for v2 [`5a51524`](https://github.com/inspect-js/is-core-module/commit/5a51524e06f92adece5fbb138c69b7b9748a2348)
+- Tests [`116eae4`](https://github.com/inspect-js/is-core-module/commit/116eae4fccd01bc72c1fd3cc4b7561c387afc496)
+- [meta] add `auto-changelog` [`c24388b`](https://github.com/inspect-js/is-core-module/commit/c24388bee828d223040519d1f5b226ca35beee63)
+- [actions] add "Automatic Rebase" and "require allow edits" actions [`34292db`](https://github.com/inspect-js/is-core-module/commit/34292dbcbadae0868aff03c22dbd8b7b8a11558a)
+- [Tests] add `npm run lint` [`4f9eeee`](https://github.com/inspect-js/is-core-module/commit/4f9eeee7ddff10698bbf528620f4dc8d4fa3e697)
+- [readme] fix travis badges, https all URLs [`e516a73`](https://github.com/inspect-js/is-core-module/commit/e516a73b0dccce20938c432b1ba512eae8eff9e9)
+- [meta] create FUNDING.yml [`1aabebc`](https://github.com/inspect-js/is-core-module/commit/1aabebca98d01f8a04e46bc2e2520fa93cf21ac6)
+- [Fix] `domain`: domain landed sometime > v0.7.7 and <= v0.7.12 [`2df7d37`](https://github.com/inspect-js/is-core-module/commit/2df7d37595d41b15eeada732b706b926c2771655)
+- [Fix] `sys`: worked in 0.6, not 0.7, and 0.8+ [`a75c134`](https://github.com/inspect-js/is-core-module/commit/a75c134229e1e9441801f6b73f6a52489346eb65)
+
+## [v1.0.2](https://github.com/inspect-js/is-core-module/compare/v1.0.1...v1.0.2) - 2014-09-28
+
+### Commits
+
+- simpler [`66fe90f`](https://github.com/inspect-js/is-core-module/commit/66fe90f9771581b9adc0c3900baa52c21b5baea2)
+
+## [v1.0.1](https://github.com/inspect-js/is-core-module/compare/v1.0.0...v1.0.1) - 2014-09-28
+
+### Commits
+
+- remove stupid [`f21f906`](https://github.com/inspect-js/is-core-module/commit/f21f906f882c2bd656a5fc5ed6fbe48ddaffb2ac)
+- update readme [`1eff0ec`](https://github.com/inspect-js/is-core-module/commit/1eff0ec69798d1ec65771552d1562911e90a8027)
+
+## v1.0.0 - 2014-09-28
+
+### Commits
+
+- init [`48e5e76`](https://github.com/inspect-js/is-core-module/commit/48e5e76cac378fddb8c1f7d4055b8dfc943d6b96)
diff --git a/node_modules/is-core-module/LICENSE b/node_modules/is-core-module/LICENSE
new file mode 100644
index 0000000..2e50287
--- /dev/null
+++ b/node_modules/is-core-module/LICENSE
@@ -0,0 +1,20 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Dave Justice
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/node_modules/is-core-module/README.md b/node_modules/is-core-module/README.md
new file mode 100644
index 0000000..062d906
--- /dev/null
+++ b/node_modules/is-core-module/README.md
@@ -0,0 +1,40 @@
+# is-core-module [![Version Badge][2]][1]
+
+[![github actions][actions-image]][actions-url]
+[![coverage][codecov-image]][codecov-url]
+[![dependency status][5]][6]
+[![dev dependency status][7]][8]
+[![License][license-image]][license-url]
+[![Downloads][downloads-image]][downloads-url]
+
+[![npm badge][11]][1]
+
+Is this specifier a node.js core module? Optionally provide a node version to check; defaults to the current node version.
+
+## Example
+
+```js
+var isCore = require('is-core-module');
+var assert = require('assert');
+assert(isCore('fs'));
+assert(!isCore('butts'));
+```
+
+## Tests
+Clone the repo, `npm install`, and run `npm test`
+
+[1]: https://npmjs.org/package/is-core-module
+[2]: https://versionbadg.es/inspect-js/is-core-module.svg
+[5]: https://david-dm.org/inspect-js/is-core-module.svg
+[6]: https://david-dm.org/inspect-js/is-core-module
+[7]: https://david-dm.org/inspect-js/is-core-module/dev-status.svg
+[8]: https://david-dm.org/inspect-js/is-core-module#info=devDependencies
+[11]: https://nodei.co/npm/is-core-module.png?downloads=true&stars=true
+[license-image]: https://img.shields.io/npm/l/is-core-module.svg
+[license-url]: LICENSE
+[downloads-image]: https://img.shields.io/npm/dm/is-core-module.svg
+[downloads-url]: https://npm-stat.com/charts.html?package=is-core-module
+[codecov-image]: https://codecov.io/gh/inspect-js/is-core-module/branch/main/graphs/badge.svg
+[codecov-url]: https://app.codecov.io/gh/inspect-js/is-core-module/
+[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/is-core-module
+[actions-url]: https://github.com/inspect-js/is-core-module/actions
diff --git a/node_modules/is-core-module/core.json b/node_modules/is-core-module/core.json
new file mode 100644
index 0000000..91890be
--- /dev/null
+++ b/node_modules/is-core-module/core.json
@@ -0,0 +1,161 @@
+{
+ "assert": true,
+ "node:assert": [">= 14.18 && < 15", ">= 16"],
+ "assert/strict": ">= 15",
+ "node:assert/strict": ">= 16",
+ "async_hooks": ">= 8",
+ "node:async_hooks": [">= 14.18 && < 15", ">= 16"],
+ "buffer_ieee754": ">= 0.5 && < 0.9.7",
+ "buffer": true,
+ "node:buffer": [">= 14.18 && < 15", ">= 16"],
+ "child_process": true,
+ "node:child_process": [">= 14.18 && < 15", ">= 16"],
+ "cluster": ">= 0.5",
+ "node:cluster": [">= 14.18 && < 15", ">= 16"],
+ "console": true,
+ "node:console": [">= 14.18 && < 15", ">= 16"],
+ "constants": true,
+ "node:constants": [">= 14.18 && < 15", ">= 16"],
+ "crypto": true,
+ "node:crypto": [">= 14.18 && < 15", ">= 16"],
+ "_debug_agent": ">= 1 && < 8",
+ "_debugger": "< 8",
+ "dgram": true,
+ "node:dgram": [">= 14.18 && < 15", ">= 16"],
+ "diagnostics_channel": [">= 14.17 && < 15", ">= 15.1"],
+ "node:diagnostics_channel": [">= 14.18 && < 15", ">= 16"],
+ "dns": true,
+ "node:dns": [">= 14.18 && < 15", ">= 16"],
+ "dns/promises": ">= 15",
+ "node:dns/promises": ">= 16",
+ "domain": ">= 0.7.12",
+ "node:domain": [">= 14.18 && < 15", ">= 16"],
+ "events": true,
+ "node:events": [">= 14.18 && < 15", ">= 16"],
+ "freelist": "< 6",
+ "fs": true,
+ "node:fs": [">= 14.18 && < 15", ">= 16"],
+ "fs/promises": [">= 10 && < 10.1", ">= 14"],
+ "node:fs/promises": [">= 14.18 && < 15", ">= 16"],
+ "_http_agent": ">= 0.11.1",
+ "node:_http_agent": [">= 14.18 && < 15", ">= 16"],
+ "_http_client": ">= 0.11.1",
+ "node:_http_client": [">= 14.18 && < 15", ">= 16"],
+ "_http_common": ">= 0.11.1",
+ "node:_http_common": [">= 14.18 && < 15", ">= 16"],
+ "_http_incoming": ">= 0.11.1",
+ "node:_http_incoming": [">= 14.18 && < 15", ">= 16"],
+ "_http_outgoing": ">= 0.11.1",
+ "node:_http_outgoing": [">= 14.18 && < 15", ">= 16"],
+ "_http_server": ">= 0.11.1",
+ "node:_http_server": [">= 14.18 && < 15", ">= 16"],
+ "http": true,
+ "node:http": [">= 14.18 && < 15", ">= 16"],
+ "http2": ">= 8.8",
+ "node:http2": [">= 14.18 && < 15", ">= 16"],
+ "https": true,
+ "node:https": [">= 14.18 && < 15", ">= 16"],
+ "inspector": ">= 8",
+ "node:inspector": [">= 14.18 && < 15", ">= 16"],
+ "inspector/promises": [">= 19"],
+ "node:inspector/promises": [">= 19"],
+ "_linklist": "< 8",
+ "module": true,
+ "node:module": [">= 14.18 && < 15", ">= 16"],
+ "net": true,
+ "node:net": [">= 14.18 && < 15", ">= 16"],
+ "node-inspect/lib/_inspect": ">= 7.6 && < 12",
+ "node-inspect/lib/internal/inspect_client": ">= 7.6 && < 12",
+ "node-inspect/lib/internal/inspect_repl": ">= 7.6 && < 12",
+ "os": true,
+ "node:os": [">= 14.18 && < 15", ">= 16"],
+ "path": true,
+ "node:path": [">= 14.18 && < 15", ">= 16"],
+ "path/posix": ">= 15.3",
+ "node:path/posix": ">= 16",
+ "path/win32": ">= 15.3",
+ "node:path/win32": ">= 16",
+ "perf_hooks": ">= 8.5",
+ "node:perf_hooks": [">= 14.18 && < 15", ">= 16"],
+ "process": ">= 1",
+ "node:process": [">= 14.18 && < 15", ">= 16"],
+ "punycode": ">= 0.5",
+ "node:punycode": [">= 14.18 && < 15", ">= 16"],
+ "querystring": true,
+ "node:querystring": [">= 14.18 && < 15", ">= 16"],
+ "readline": true,
+ "node:readline": [">= 14.18 && < 15", ">= 16"],
+ "readline/promises": ">= 17",
+ "node:readline/promises": ">= 17",
+ "repl": true,
+ "node:repl": [">= 14.18 && < 15", ">= 16"],
+ "node:sea": [">= 20.12 && < 21", ">= 21.7"],
+ "smalloc": ">= 0.11.5 && < 3",
+ "_stream_duplex": ">= 0.9.4",
+ "node:_stream_duplex": [">= 14.18 && < 15", ">= 16"],
+ "_stream_transform": ">= 0.9.4",
+ "node:_stream_transform": [">= 14.18 && < 15", ">= 16"],
+ "_stream_wrap": ">= 1.4.1",
+ "node:_stream_wrap": [">= 14.18 && < 15", ">= 16"],
+ "_stream_passthrough": ">= 0.9.4",
+ "node:_stream_passthrough": [">= 14.18 && < 15", ">= 16"],
+ "_stream_readable": ">= 0.9.4",
+ "node:_stream_readable": [">= 14.18 && < 15", ">= 16"],
+ "_stream_writable": ">= 0.9.4",
+ "node:_stream_writable": [">= 14.18 && < 15", ">= 16"],
+ "stream": true,
+ "node:stream": [">= 14.18 && < 15", ">= 16"],
+ "stream/consumers": ">= 16.7",
+ "node:stream/consumers": ">= 16.7",
+ "stream/promises": ">= 15",
+ "node:stream/promises": ">= 16",
+ "stream/web": ">= 16.5",
+ "node:stream/web": ">= 16.5",
+ "string_decoder": true,
+ "node:string_decoder": [">= 14.18 && < 15", ">= 16"],
+ "sys": [">= 0.4 && < 0.7", ">= 0.8"],
+ "node:sys": [">= 14.18 && < 15", ">= 16"],
+ "test/reporters": ">= 19.9 && < 20.2",
+ "node:test/reporters": [">= 18.17 && < 19", ">= 19.9", ">= 20"],
+ "test/mock_loader": ">= 22.3 && < 22.7",
+ "node:test/mock_loader": ">= 22.3 && < 22.7",
+ "node:test": [">= 16.17 && < 17", ">= 18"],
+ "timers": true,
+ "node:timers": [">= 14.18 && < 15", ">= 16"],
+ "timers/promises": ">= 15",
+ "node:timers/promises": ">= 16",
+ "_tls_common": ">= 0.11.13",
+ "node:_tls_common": [">= 14.18 && < 15", ">= 16"],
+ "_tls_legacy": ">= 0.11.3 && < 10",
+ "_tls_wrap": ">= 0.11.3",
+ "node:_tls_wrap": [">= 14.18 && < 15", ">= 16"],
+ "tls": true,
+ "node:tls": [">= 14.18 && < 15", ">= 16"],
+ "trace_events": ">= 10",
+ "node:trace_events": [">= 14.18 && < 15", ">= 16"],
+ "tty": true,
+ "node:tty": [">= 14.18 && < 15", ">= 16"],
+ "url": true,
+ "node:url": [">= 14.18 && < 15", ">= 16"],
+ "util": true,
+ "node:util": [">= 14.18 && < 15", ">= 16"],
+ "util/types": ">= 15.3",
+ "node:util/types": ">= 16",
+ "v8/tools/arguments": ">= 10 && < 12",
+ "v8/tools/codemap": [">= 4.4 && < 5", ">= 5.2 && < 12"],
+ "v8/tools/consarray": [">= 4.4 && < 5", ">= 5.2 && < 12"],
+ "v8/tools/csvparser": [">= 4.4 && < 5", ">= 5.2 && < 12"],
+ "v8/tools/logreader": [">= 4.4 && < 5", ">= 5.2 && < 12"],
+ "v8/tools/profile_view": [">= 4.4 && < 5", ">= 5.2 && < 12"],
+ "v8/tools/splaytree": [">= 4.4 && < 5", ">= 5.2 && < 12"],
+ "v8": ">= 1",
+ "node:v8": [">= 14.18 && < 15", ">= 16"],
+ "vm": true,
+ "node:vm": [">= 14.18 && < 15", ">= 16"],
+ "wasi": [">= 13.4 && < 13.5", ">= 18.17 && < 19", ">= 20"],
+ "node:wasi": [">= 18.17 && < 19", ">= 20"],
+ "worker_threads": ">= 11.7",
+ "node:worker_threads": [">= 14.18 && < 15", ">= 16"],
+ "zlib": ">= 0.5",
+ "node:zlib": [">= 14.18 && < 15", ">= 16"]
+}
diff --git a/node_modules/is-core-module/index.js b/node_modules/is-core-module/index.js
new file mode 100644
index 0000000..423e20c
--- /dev/null
+++ b/node_modules/is-core-module/index.js
@@ -0,0 +1,69 @@
+'use strict';
+
+var hasOwn = require('hasown');
+
+function specifierIncluded(current, specifier) {
+ var nodeParts = current.split('.');
+ var parts = specifier.split(' ');
+ var op = parts.length > 1 ? parts[0] : '=';
+ var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.');
+
+ for (var i = 0; i < 3; ++i) {
+ var cur = parseInt(nodeParts[i] || 0, 10);
+ var ver = parseInt(versionParts[i] || 0, 10);
+ if (cur === ver) {
+ continue; // eslint-disable-line no-restricted-syntax, no-continue
+ }
+ if (op === '<') {
+ return cur < ver;
+ }
+ if (op === '>=') {
+ return cur >= ver;
+ }
+ return false;
+ }
+ return op === '>=';
+}
+
+function matchesRange(current, range) {
+ var specifiers = range.split(/ ?&& ?/);
+ if (specifiers.length === 0) {
+ return false;
+ }
+ for (var i = 0; i < specifiers.length; ++i) {
+ if (!specifierIncluded(current, specifiers[i])) {
+ return false;
+ }
+ }
+ return true;
+}
+
+function versionIncluded(nodeVersion, specifierValue) {
+ if (typeof specifierValue === 'boolean') {
+ return specifierValue;
+ }
+
+ var current = typeof nodeVersion === 'undefined'
+ ? process.versions && process.versions.node
+ : nodeVersion;
+
+ if (typeof current !== 'string') {
+ throw new TypeError(typeof nodeVersion === 'undefined' ? 'Unable to determine current node version' : 'If provided, a valid node version is required');
+ }
+
+ if (specifierValue && typeof specifierValue === 'object') {
+ for (var i = 0; i < specifierValue.length; ++i) {
+ if (matchesRange(current, specifierValue[i])) {
+ return true;
+ }
+ }
+ return false;
+ }
+ return matchesRange(current, specifierValue);
+}
+
+var data = require('./core.json');
+
+module.exports = function isCore(x, nodeVersion) {
+ return hasOwn(data, x) && versionIncluded(nodeVersion, data[x]);
+};
diff --git a/node_modules/is-core-module/package.json b/node_modules/is-core-module/package.json
new file mode 100644
index 0000000..3aba4a0
--- /dev/null
+++ b/node_modules/is-core-module/package.json
@@ -0,0 +1,76 @@
+{
+ "name": "is-core-module",
+ "version": "2.15.1",
+ "description": "Is this specifier a node.js core module?",
+ "main": "index.js",
+ "sideEffects": false,
+ "exports": {
+ ".": "./index.js",
+ "./package.json": "./package.json"
+ },
+ "scripts": {
+ "prepack": "npmignore --auto --commentLines=autogenerated",
+ "prepublish": "not-in-publish || npm run prepublishOnly",
+ "prepublishOnly": "safe-publish-latest",
+ "lint": "eslint .",
+ "pretest": "npm run lint",
+ "tests-only": "nyc tape 'test/**/*.js'",
+ "test": "npm run tests-only",
+ "posttest": "npx npm@'>=10.2' audit --production",
+ "version": "auto-changelog && git add CHANGELOG.md",
+ "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/inspect-js/is-core-module.git"
+ },
+ "keywords": [
+ "core",
+ "modules",
+ "module",
+ "npm",
+ "node",
+ "dependencies"
+ ],
+ "author": "Jordan Harband ",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ },
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/inspect-js/is-core-module/issues"
+ },
+ "homepage": "https://github.com/inspect-js/is-core-module",
+ "dependencies": {
+ "hasown": "^2.0.2"
+ },
+ "devDependencies": {
+ "@ljharb/eslint-config": "^21.1.1",
+ "auto-changelog": "^2.4.0",
+ "encoding": "^0.1.13",
+ "eslint": "=8.8.0",
+ "in-publish": "^2.0.1",
+ "mock-property": "^1.1.0",
+ "npmignore": "^0.3.1",
+ "nyc": "^10.3.2",
+ "safe-publish-latest": "^2.0.0",
+ "semver": "^6.3.1",
+ "tape": "^5.8.1"
+ },
+ "auto-changelog": {
+ "output": "CHANGELOG.md",
+ "template": "keepachangelog",
+ "unreleased": false,
+ "commitLimit": false,
+ "backfillLimit": false,
+ "hideCredit": true
+ },
+ "publishConfig": {
+ "ignore": [
+ ".github"
+ ]
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+}
diff --git a/node_modules/is-core-module/test/index.js b/node_modules/is-core-module/test/index.js
new file mode 100644
index 0000000..746e72a
--- /dev/null
+++ b/node_modules/is-core-module/test/index.js
@@ -0,0 +1,154 @@
+'use strict';
+
+var test = require('tape');
+var keys = require('object-keys');
+var semver = require('semver');
+var mockProperty = require('mock-property');
+
+var isCore = require('../');
+var data = require('../core.json');
+
+var supportsNodePrefix = semver.satisfies(process.versions.node, '^14.18 || >= 16', { includePrerelease: true });
+
+test('core modules', function (t) {
+ t.test('isCore()', function (st) {
+ st.ok(isCore('fs'));
+ st.ok(isCore('net'));
+ st.ok(isCore('http'));
+
+ st.ok(!isCore('seq'));
+ st.ok(!isCore('../'));
+
+ st.ok(!isCore('toString'));
+
+ st.end();
+ });
+
+ t.test('core list', function (st) {
+ var cores = keys(data);
+ st.plan(cores.length);
+
+ for (var i = 0; i < cores.length; ++i) {
+ var mod = cores[i];
+ var requireFunc = function () { require(mod); }; // eslint-disable-line no-loop-func
+ if (isCore(mod)) {
+ st.doesNotThrow(requireFunc, mod + ' supported; requiring does not throw');
+ } else {
+ st['throws'](requireFunc, mod + ' not supported; requiring throws');
+ }
+ }
+
+ st.end();
+ });
+
+ t.test('core via repl module', { skip: !data.repl }, function (st) {
+ var libs = require('repl')._builtinLibs; // eslint-disable-line no-underscore-dangle
+ if (!libs) {
+ st.skip('repl._builtinLibs does not exist');
+ } else {
+ for (var i = 0; i < libs.length; ++i) {
+ var mod = libs[i];
+ st.ok(data[mod], mod + ' is a core module');
+ st.doesNotThrow(
+ function () { require(mod); }, // eslint-disable-line no-loop-func
+ 'requiring ' + mod + ' does not throw'
+ );
+ if (mod.slice(0, 5) !== 'node:') {
+ if (supportsNodePrefix) {
+ st.doesNotThrow(
+ function () { require('node:' + mod); }, // eslint-disable-line no-loop-func
+ 'requiring node:' + mod + ' does not throw'
+ );
+ } else {
+ st['throws'](
+ function () { require('node:' + mod); }, // eslint-disable-line no-loop-func
+ 'requiring node:' + mod + ' throws'
+ );
+ }
+ }
+ }
+ }
+ st.end();
+ });
+
+ t.test('core via builtinModules list', { skip: !data.module }, function (st) {
+ var Module = require('module');
+ var libs = Module.builtinModules;
+ if (!libs) {
+ st.skip('module.builtinModules does not exist');
+ } else {
+ var excludeList = [
+ '_debug_agent',
+ 'v8/tools/tickprocessor-driver',
+ 'v8/tools/SourceMap',
+ 'v8/tools/tickprocessor',
+ 'v8/tools/profile'
+ ];
+
+ // see https://github.com/nodejs/node/issues/42785
+ if (semver.satisfies(process.version, '>= 18')) {
+ libs = libs.concat('node:test');
+ }
+ if (semver.satisfies(process.version, '^20.12 || >= 21.7')) {
+ libs = libs.concat('node:sea');
+ }
+
+ for (var i = 0; i < libs.length; ++i) {
+ var mod = libs[i];
+ if (excludeList.indexOf(mod) === -1) {
+ st.ok(data[mod], mod + ' is a core module');
+
+ if (Module.isBuiltin) {
+ st.ok(Module.isBuiltin(mod), 'module.isBuiltin(' + mod + ') is true');
+ }
+
+ st.doesNotThrow(
+ function () { require(mod); }, // eslint-disable-line no-loop-func
+ 'requiring ' + mod + ' does not throw'
+ );
+
+ if (process.getBuiltinModule) {
+ st.equal(
+ process.getBuiltinModule(mod),
+ require(mod),
+ 'process.getBuiltinModule(' + mod + ') === require(' + mod + ')'
+ );
+ }
+
+ if (mod.slice(0, 5) !== 'node:') {
+ if (supportsNodePrefix) {
+ st.doesNotThrow(
+ function () { require('node:' + mod); }, // eslint-disable-line no-loop-func
+ 'requiring node:' + mod + ' does not throw'
+ );
+ } else {
+ st['throws'](
+ function () { require('node:' + mod); }, // eslint-disable-line no-loop-func
+ 'requiring node:' + mod + ' throws'
+ );
+ }
+ }
+ }
+ }
+ }
+
+ st.end();
+ });
+
+ t.test('Object.prototype pollution', function (st) {
+ var nonKey = 'not a core module';
+ st.teardown(mockProperty(Object.prototype, 'fs', { value: false }));
+ st.teardown(mockProperty(Object.prototype, 'path', { value: '>= 999999999' }));
+ st.teardown(mockProperty(Object.prototype, 'http', { value: data.http }));
+ st.teardown(mockProperty(Object.prototype, nonKey, { value: true }));
+
+ st.equal(isCore('fs'), true, 'fs is a core module even if Object.prototype lies');
+ st.equal(isCore('path'), true, 'path is a core module even if Object.prototype lies');
+ st.equal(isCore('http'), true, 'path is a core module even if Object.prototype matches data');
+ st.equal(isCore(nonKey), false, '"' + nonKey + '" is not a core module even if Object.prototype lies');
+
+ st.end();
+ });
+
+ t.end();
+});
diff --git a/node_modules/is-expression/CHANGELOG.md b/node_modules/is-expression/CHANGELOG.md
new file mode 100644
index 0000000..abf03e8
--- /dev/null
+++ b/node_modules/is-expression/CHANGELOG.md
@@ -0,0 +1,48 @@
+# Change Log
+
+Version 4.0.0 onwards are documented in [Releases](https://github.com/pugjs/is-expression/releases).
+
+This project adheres to [Semantic Versioning](http://semver.org/).
+
+## 3.0.0 - 2016-09-11
+### Added
+- Updated to acorn ~4.0.0
+ - ES2016 has been made the default `ecmaVersion`.
+ - Async functions are now implemented for `{ecmaVersion: 8}`.
+ - See [acorn's CHANGELOG][acorn-4.0.0] for a full list of changes.
+
+## 2.1.0 - 2016-07-27
+### Added
+- Updated to acorn ~3.3.0
+ - The ES2016 check for strict mode in function parameters is now implemented
+ for `{ecmaVersion: 7}`.
+ - See [acorn's CHANGELOG][acorn-3.3.0] for a full list of changes.
+
+## 2.0.1 - 2016-06-04
+### Added
+- Updated to acorn ~3.1.0
+ - See [acorn's CHANGELOG][acorn-3.1.0] for a list of changes.
+ - Even though it is a minor version bump for acorn, the new features are not
+ in parts of acorn we are using, and thus a patch level bump is warranted.
+
+## 2.0.0 - 2016-02-12
+### Added
+- Updated to acorn ~3.0.2
+ - See [acorn's CHANGELOG][acorn-3.0.0] for a list of breaking changes.
+
+## 1.0.2 - 2016-01-06
+### Added
+- Updated to acorn ~2.7.0
+
+## 1.0.1 - 2015-11-12
+### Fixed
+- Use a stricter version range for Acorn since we depend on Acorn internals.
+
+## 1.0.0 - 2015-11-11
+### Added
+- Initial release
+
+[acorn-4.0.0]: https://github.com/ternjs/acorn/blob/master/CHANGELOG.md#400-2016-08-07
+[acorn-3.3.0]: https://github.com/ternjs/acorn/blob/master/CHANGELOG.md#330-2016-07-25
+[acorn-3.1.0]: https://github.com/ternjs/acorn/blob/master/CHANGELOG.md#310-2016-04-18
+[acorn-3.0.0]: https://github.com/ternjs/acorn/blob/master/CHANGELOG.md#300-2016-02-10
diff --git a/node_modules/is-expression/LICENSE.md b/node_modules/is-expression/LICENSE.md
new file mode 100644
index 0000000..6ee7c4a
--- /dev/null
+++ b/node_modules/is-expression/LICENSE.md
@@ -0,0 +1,19 @@
+Copyright (c) 2015 Tiancheng “Timothy” Gu
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/is-expression/README.md b/node_modules/is-expression/README.md
new file mode 100644
index 0000000..9c66c38
--- /dev/null
+++ b/node_modules/is-expression/README.md
@@ -0,0 +1,67 @@
+# is-expression
+
+Validates a string as a JavaScript expression
+
+[](https://travis-ci.org/pugjs/is-expression)
+[](https://david-dm.org/pugjs/is-expression)
+[](https://rollingversions.com/pugjs/is-expression)
+[](https://www.npmjs.org/package/is-expression)
+
+## Installation
+
+ npm install is-expression
+
+## Usage
+
+### `isExpression(src[, options])`
+
+Validates a string as a JavaScript expression.
+
+`src` contains the source.
+
+`options` can contain any Acorn options (since we use Acorn under-the-hood),
+or any of the following:
+
+- `throw`: Throw an error if the string is not an expression. The error can
+ be an Acorn error, with location information in `err.loc` and `err.pos`.
+ Defaults to `false`.
+- `strict`: Use strict mode when trying to parse the string. Defaults to
+ `false`. Even if this option is `false`, if you have provided
+ `options.sourceType === 'module'` which imples strict mode under ES2015,
+ strict mode will be used.
+- `lineComment`: When `true`, allows line comments in the expression.
+ Defaults to `false` for safety.
+
+See the examples below for usage.
+
+## Examples
+
+```js
+var isExpression = require('is-expression')
+
+isExpression('myVar')
+//=> true
+isExpression('var')
+//=> false
+isExpression('["an", "array", "\'s"].indexOf("index")')
+//=> true
+
+isExpression('var', {throw: true})
+// SyntaxError: Unexpected token (1:0)
+// at Parser.pp.raise (acorn/dist/acorn.js:940:13)
+// at ...
+
+isExpression('public')
+//=> true
+isExpression('public', {strict: true})
+//=> false
+
+isExpression('abc // my comment')
+//=> false
+isExpression('abc // my comment', {lineComment: true})
+//=> true
+```
+
+## License
+
+MIT
diff --git a/node_modules/is-expression/index.js b/node_modules/is-expression/index.js
new file mode 100644
index 0000000..7724c97
--- /dev/null
+++ b/node_modules/is-expression/index.js
@@ -0,0 +1,45 @@
+'use strict';
+
+var acorn = require('acorn');
+var objectAssign = require('object-assign');
+
+module.exports = isExpression;
+
+var DEFAULT_OPTIONS = {
+ throw: false,
+ strict: false,
+ lineComment: false
+};
+
+function isExpression(src, options) {
+ options = objectAssign({}, DEFAULT_OPTIONS, options);
+
+ try {
+ var parser = new acorn.Parser(options, src, 0);
+
+ if (options.strict) {
+ parser.strict = true;
+ }
+
+ if (!options.lineComment) {
+ parser.skipLineComment = function (startSkip) {
+ this.raise(this.pos, 'Line comments not allowed in an expression');
+ };
+ }
+
+ parser.nextToken();
+ parser.parseExpression();
+
+ if (parser.type !== acorn.tokTypes.eof) {
+ parser.unexpected();
+ }
+ } catch (ex) {
+ if (!options.throw) {
+ return false;
+ }
+
+ throw ex;
+ }
+
+ return true;
+}
diff --git a/node_modules/is-expression/package.json b/node_modules/is-expression/package.json
new file mode 100644
index 0000000..07f77c4
--- /dev/null
+++ b/node_modules/is-expression/package.json
@@ -0,0 +1,30 @@
+{
+ "name": "is-expression",
+ "version": "4.0.0",
+ "files": [
+ "index.js"
+ ],
+ "description": "Check if a string is a valid JavaScript expression",
+ "keywords": [
+ "javascript",
+ "expression"
+ ],
+ "dependencies": {
+ "acorn": "^7.1.1",
+ "object-assign": "^4.1.1"
+ },
+ "devDependencies": {
+ "nyc": "^15.0.1",
+ "testit": "^3.1.0"
+ },
+ "scripts": {
+ "test": "node test && npm run coverage",
+ "coverage": "nyc node test.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/pugjs/is-expression.git"
+ },
+ "author": "Timothy Gu ",
+ "license": "MIT"
+}
diff --git a/node_modules/is-promise/LICENSE b/node_modules/is-promise/LICENSE
new file mode 100644
index 0000000..27cc9f3
--- /dev/null
+++ b/node_modules/is-promise/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2014 Forbes Lindesay
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
\ No newline at end of file
diff --git a/node_modules/is-promise/index.js b/node_modules/is-promise/index.js
new file mode 100644
index 0000000..1bed087
--- /dev/null
+++ b/node_modules/is-promise/index.js
@@ -0,0 +1,6 @@
+module.exports = isPromise;
+module.exports.default = isPromise;
+
+function isPromise(obj) {
+ return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
+}
diff --git a/node_modules/is-promise/index.mjs b/node_modules/is-promise/index.mjs
new file mode 100644
index 0000000..bf9e99b
--- /dev/null
+++ b/node_modules/is-promise/index.mjs
@@ -0,0 +1,3 @@
+export default function isPromise(obj) {
+ return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
+}
diff --git a/node_modules/is-promise/package.json b/node_modules/is-promise/package.json
new file mode 100644
index 0000000..d70c7d8
--- /dev/null
+++ b/node_modules/is-promise/package.json
@@ -0,0 +1,23 @@
+{
+ "name": "is-promise",
+ "version": "2.2.2",
+ "description": "Test whether an object looks like a promises-a+ promise",
+ "main": "./index.js",
+ "scripts": {
+ "test": "mocha -R spec"
+ },
+ "files": [
+ "index.js",
+ "index.mjs"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/then/is-promise.git"
+ },
+ "author": "ForbesLindesay",
+ "license": "MIT",
+ "devDependencies": {
+ "better-assert": "^1.0.2",
+ "mocha": "~1.7.4"
+ }
+}
\ No newline at end of file
diff --git a/node_modules/is-promise/readme.md b/node_modules/is-promise/readme.md
new file mode 100644
index 0000000..d53d34b
--- /dev/null
+++ b/node_modules/is-promise/readme.md
@@ -0,0 +1,33 @@
+
+
+# is-promise
+
+ Test whether an object looks like a promises-a+ promise
+
+ [](https://travis-ci.org/then/is-promise)
+ [](https://david-dm.org/then/is-promise)
+ [](https://www.npmjs.org/package/is-promise)
+
+
+
+## Installation
+
+ $ npm install is-promise
+
+You can also use it client side via npm.
+
+## API
+
+```typescript
+import isPromise from 'is-promise';
+
+isPromise(Promise.resolve());//=>true
+isPromise({then:function () {...}});//=>true
+isPromise(null);//=>false
+isPromise({});//=>false
+isPromise({then: true})//=>false
+```
+
+## License
+
+ MIT
diff --git a/node_modules/function-bind/.editorconfig b/node_modules/is-regex/.editorconfig
similarity index 92%
rename from node_modules/function-bind/.editorconfig
rename to node_modules/is-regex/.editorconfig
index ac29ade..bc228f8 100644
--- a/node_modules/function-bind/.editorconfig
+++ b/node_modules/is-regex/.editorconfig
@@ -7,7 +7,7 @@ end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
-max_line_length = 120
+max_line_length = 150
[CHANGELOG.md]
indent_style = space
diff --git a/node_modules/side-channel/.eslintignore b/node_modules/is-regex/.eslintignore
similarity index 100%
rename from node_modules/side-channel/.eslintignore
rename to node_modules/is-regex/.eslintignore
diff --git a/node_modules/is-regex/.eslintrc b/node_modules/is-regex/.eslintrc
new file mode 100644
index 0000000..1f6f127
--- /dev/null
+++ b/node_modules/is-regex/.eslintrc
@@ -0,0 +1,19 @@
+{
+ "root": true,
+
+ "extends": "@ljharb",
+
+ "rules": {
+ "id-length": [1],
+ "operator-linebreak": [2, "before"],
+ },
+
+ "overrides": [
+ {
+ "files": ["test/**/*.js"],
+ "globals": {
+ "Proxy": false,
+ },
+ },
+ ],
+}
diff --git a/node_modules/is-regex/.nycrc b/node_modules/is-regex/.nycrc
new file mode 100644
index 0000000..a69aa2d
--- /dev/null
+++ b/node_modules/is-regex/.nycrc
@@ -0,0 +1,10 @@
+{
+ "all": true,
+ "check-coverage": false,
+ "reporter": ["text-summary", "text", "html", "json"],
+ "exclude": [
+ "coverage",
+ "test",
+ "test-corejs.js"
+ ]
+}
diff --git a/node_modules/is-regex/CHANGELOG.md b/node_modules/is-regex/CHANGELOG.md
new file mode 100644
index 0000000..b7496b2
--- /dev/null
+++ b/node_modules/is-regex/CHANGELOG.md
@@ -0,0 +1,197 @@
+# Changelog
+
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [v1.1.4](https://github.com/inspect-js/is-regex/compare/v1.1.3...v1.1.4) - 2021-08-05
+
+### Commits
+
+- [Dev Deps] update `auto-changelog`, `core-js`, `eslint`, `tape` [`4b17cad`](https://github.com/inspect-js/is-regex/commit/4b17cad8496b1ae621b18335fa3afe94d0c65e83)
+- [Refactor] use `has-tostringtag` to behave correctly in the presence of symbol shams [`2dad4af`](https://github.com/inspect-js/is-regex/commit/2dad4afffa15f07cbbf7675b77d1f650c92652c4)
+
+## [v1.1.3](https://github.com/inspect-js/is-regex/compare/v1.1.2...v1.1.3) - 2021-05-07
+
+### Commits
+
+- [actions] use `node/install` instead of `node/run`; use `codecov` action [`c681ab9`](https://github.com/inspect-js/is-regex/commit/c681ab99c07f8b3b7ae5f652b3105a30bce94f69)
+- [Fix] do not use `Object.prototype.toString` when `Symbol.toStringTag` is shammed [`ca019fd`](https://github.com/inspect-js/is-regex/commit/ca019fdb828dc7d32e323213403ac9995d8604e3)
+- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`605a66f`](https://github.com/inspect-js/is-regex/commit/605a66f278900f1c8ae9d1dfcec31e5f61b10ad3)
+- [readme] add actions and codecov badges [`8d7c6f0`](https://github.com/inspect-js/is-regex/commit/8d7c6f0e007bd982f21b958e0abc98b8a84e2a24)
+- [meta] use `prepublishOnly` script for npm 7+ [`8e50e91`](https://github.com/inspect-js/is-regex/commit/8e50e91f51aa5038745526710ef2e030527982a7)
+- [Deps] update `has-symbols` [`4742c81`](https://github.com/inspect-js/is-regex/commit/4742c81260c3db9a8c9ef57110981fb6175f58e0)
+
+## [v1.1.2](https://github.com/inspect-js/is-regex/compare/v1.1.1...v1.1.2) - 2021-02-01
+
+### Commits
+
+- [Tests] migrate tests to Github Actions [`cc1686e`](https://github.com/inspect-js/is-regex/commit/cc1686e25f446ca6948f43b3f180d6e55e31fb4e)
+- [readme] fix repo URLs; remove travis badge [`d1d1da6`](https://github.com/inspect-js/is-regex/commit/d1d1da647bb4e91589606f12470cd27a47b3bb81)
+- [meta] do not publish github action workflow files [`9f84b99`](https://github.com/inspect-js/is-regex/commit/9f84b993a995f057b4d2d097ef47b1ff9c84115d)
+- [Tests] run `nyc` on all tests [`c37aab9`](https://github.com/inspect-js/is-regex/commit/c37aab9d332c4834b08ada94736c45ab1d39cd2f)
+- [Robustness] use `call-bind` [`fbb61bf`](https://github.com/inspect-js/is-regex/commit/fbb61bf3e19ccc178e6ed1e0d7ab9cc7c7167393)
+- [actions] add "Allow Edits" workflow [`9022b53`](https://github.com/inspect-js/is-regex/commit/9022b53cb05b0f105cd179800cf96e055b249f08)
+- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog` [`d60f28f`](https://github.com/inspect-js/is-regex/commit/d60f28f7f2fb21dade7bce302b3e0246206423d3)
+- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`2c35c43`](https://github.com/inspect-js/is-regex/commit/2c35c437edf3eeb37129eea2404d8f465d27620f)
+- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`1009e25`](https://github.com/inspect-js/is-regex/commit/1009e259d49a63753dc6e79e2b876a30c00c6de6)
+- [meta] gitignore coverage output [`3b5fa9e`](https://github.com/inspect-js/is-regex/commit/3b5fa9ed2882c65ee81dff979f79f1a2751d3772)
+- [actions] update workflows [`1843ef6`](https://github.com/inspect-js/is-regex/commit/1843ef65b8b8c24a44e91bc4ed5ee60dffc31c2d)
+
+## [v1.1.1](https://github.com/inspect-js/is-regex/compare/v1.1.0...v1.1.1) - 2020-08-03
+
+### Commits
+
+- [Performance] Re-add lastIndex check to improve performance [`d8495cd`](https://github.com/inspect-js/is-regex/commit/d8495cd22d475ddca250818921b6088f631c1972)
+- [Dev Deps] update `auto-changelog`, `eslint` [`778fa6b`](https://github.com/inspect-js/is-regex/commit/778fa6b9d2b182ee6d73993e103532855e956f85)
+
+## [v1.1.0](https://github.com/inspect-js/is-regex/compare/v1.0.5...v1.1.0) - 2020-06-03
+
+### Commits
+
+- [New] use `badStringifier`‑based RegExp detection [`31eff67`](https://github.com/inspect-js/is-regex/commit/31eff673243d65c3d6c05848c0eb52f5380f1be3)
+- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`fc91458`](https://github.com/inspect-js/is-regex/commit/fc914588187b8bb00d8d792c84f06a6e15d883c1)
+- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`; add `safe-publish-latest` [`d43ed83`](https://github.com/inspect-js/is-regex/commit/d43ed83db54ea727bb0b1b77a50af79d1edb8a6d)
+- [Dev Deps] update `auto-changelog`, `tape`; add `aud` [`56647d1`](https://github.com/inspect-js/is-regex/commit/56647d196be34ef3c118ad67726e75169fbcb875)
+- [meta] only run `aud` on prod deps [`e0865b8`](https://github.com/inspect-js/is-regex/commit/e0865b8360b0ac1b9d17b7b81ae5f339e5c9036b)
+
+## [v1.0.5](https://github.com/inspect-js/is-regex/compare/v1.0.4...v1.0.5) - 2019-12-15
+
+### Commits
+
+- [Tests] use shared travis-ci configs [`af728b2`](https://github.com/inspect-js/is-regex/commit/af728b21c5cc9e41234fb4015594bffdcfff597c)
+- [Tests] remove `jscs` [`1b8cfe8`](https://github.com/inspect-js/is-regex/commit/1b8cfe8cfb14820c196775f19d370276e4034791)
+- [meta] add `auto-changelog` [`c3131d8`](https://github.com/inspect-js/is-regex/commit/c3131d8ab5d06ea5fa05a4bb2ad28bbfb81668ad)
+- [Tests] up to `node` `v8.1`, `v7.10`, `v6.11`, `v4.8`; newer npm fails on older nodes [`660b658`](https://github.com/inspect-js/is-regex/commit/660b6585d1a9607dbdae879b70ce2f6a5684616c)
+- [Tests] up to `node` `v9.3`, `v8.9`, `v6.12`; use `nvm install-latest-npm`; pin included builds to LTS [`7c25218`](https://github.com/inspect-js/is-regex/commit/7c25218d540ab17c18e4ae333677c5725806a778)
+- [Tests] up to `node` `v12.10`, `v11.15`, `v10.16`, `v8.16`, `v6.17` [`fa95547`](https://github.com/inspect-js/is-regex/commit/fa955478950a5ba0a920010d5daaa29487500b30)
+- [meta] remove unused Makefile and associated utilities [`9fd2a29`](https://github.com/inspect-js/is-regex/commit/9fd2a29dc57ed125f3d61e94f6254a9dd8ee0044)
+- [Tests] up to `node` `v11.3`, `v10.14`, `v8.14`, `v6.15` [`7f2ac41`](https://github.com/inspect-js/is-regex/commit/7f2ac41ef5dc4d53bfe2fb1c24486c688a2537bd)
+- [Tests] up to `node` `v10.0`, `v9.11`, `v8.11`, `v6.14`, `v4.9` [`6fa2b0f`](https://github.com/inspect-js/is-regex/commit/6fa2b0fe171a5b02086a06679a92d989e83a8b8e)
+- [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`697e1de`](https://github.com/inspect-js/is-regex/commit/697e1de1c9e69f08e591cc0040d81fdbbde6fe4e)
+- [actions] add automatic rebasing / merge commit blocking [`ad86dc9`](https://github.com/inspect-js/is-regex/commit/ad86dc97a52e4f66fbfb3b8c9c78da3963588b54)
+- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `jscs`, `nsp`, `replace`, `semver`, `tape` [`5c99c8e`](https://github.com/inspect-js/is-regex/commit/5c99c8e384d5ce2ef434be5853c301477cf35456)
+- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `replace`, `semver`, `tape` [`bb63686`](https://github.com/inspect-js/is-regex/commit/bb63686a9d0fc586d121549cf484da95edec3b0a)
+- [Dev Deps] update `eslint`, `@ljharb/eslint-config@`, `replace`, `semver`, `tape` [`ddf3670`](https://github.com/inspect-js/is-regex/commit/ddf36705e5f7bd29832721e4a23abf06195032c6)
+- [Dev Deps] update `tape`, `nsp`, `eslint`, `@ljharb/eslint-config` [`e7b5a62`](https://github.com/inspect-js/is-regex/commit/e7b5a626eef3b9648c7d52d4620ce2e2a98a9ab8)
+- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `covert`, `tape` [`c803db5`](https://github.com/inspect-js/is-regex/commit/c803db5cd94cf9e0a559617adbc1e4c9d22007ff)
+- [Tests] switch from `nsp` to `npm audit` [`b7239be`](https://github.com/inspect-js/is-regex/commit/b7239be9da263a0f7066f79d087eaf700a9613e9)
+- [Dev Deps] update `eslint`, `nsp`, `semver`, `tape` [`347ee6c`](https://github.com/inspect-js/is-regex/commit/347ee6c67ba0f56b03f21a5abe743658f6515963)
+- Only apps should have lockfiles. [`3866575`](https://github.com/inspect-js/is-regex/commit/38665755ecf028061f15816059e26023890a0dc7)
+- [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops [`d099a39`](https://github.com/inspect-js/is-regex/commit/d099a3943eb7e156a3e64fb8b74e11d7c83a4bec)
+- [meta] add `funding` field [`741aecd`](https://github.com/inspect-js/is-regex/commit/741aecd92cd49868b3606c8cc99ce299e5f3c7d5)
+- [Tests] use `eclint` instead of `editorconfig-tools` [`bc6aa75`](https://github.com/inspect-js/is-regex/commit/bc6aa7539e506788709b96f7bf3d7549850a81c3)
+- [Tests] on `node` `v10.1` [`262226f`](https://github.com/inspect-js/is-regex/commit/262226f08fa34dff9a8dffd16daabb3dc6e262eb)
+- [Dev Deps] update `eslint` [`31fd719`](https://github.com/inspect-js/is-regex/commit/31fd719dd59a6111ca710cdb0d19a8adadf9b8c6)
+- [Deps] update `has` [`e9e25a3`](https://github.com/inspect-js/is-regex/commit/e9e25a3de7e89faaa6aadf5010477074140e8218)
+- [Dev Deps] update `replace` [`aeeb968`](https://github.com/inspect-js/is-regex/commit/aeeb968bf5a4fc07f0fa6905f2c699fc563b6c32)
+- [Tests] set audit level [`2a6290e`](https://github.com/inspect-js/is-regex/commit/2a6290e78b58bf14b734d7998fe53b4a84db5e44)
+- [Tests] remove `nsp` [`fc74c2b`](https://github.com/inspect-js/is-regex/commit/fc74c2bb6970a7f3280abe6eff3b492d77d89c9f)
+
+## [v1.0.4](https://github.com/inspect-js/is-regex/compare/v1.0.3...v1.0.4) - 2017-02-18
+
+### Fixed
+
+- [Fix] ensure that `lastIndex` is not mutated [`#3`](https://github.com/inspect-js/is-regex/issues/3)
+
+### Commits
+
+- Update `eslint`, `tape`, `semver`; use my personal shared `eslint` config [`c4a41c3`](https://github.com/inspect-js/is-regex/commit/c4a41c3a8203a3919b01cd0d1b577daadf30a452)
+- [Tests] on all node minors; improve test matrix [`58d7508`](https://github.com/inspect-js/is-regex/commit/58d7508a36eb92bd76717486b9e78bde502ffe3e)
+- [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver` [`7290076`](https://github.com/inspect-js/is-regex/commit/729007606e9ed162953d1f5812c37eb06c554ec2)
+- Update `covert`, `jscs`, `eslint`, `semver` [`dabc729`](https://github.com/inspect-js/is-regex/commit/dabc729cfc4458264c6f7642004d41dd5c214bfd)
+- Update `eslint` [`a946b05`](https://github.com/inspect-js/is-regex/commit/a946b051159396b4311c564880f96e3d00e8b8e2)
+- Update `tape`, `jscs`, `eslint`, `@ljharb/eslint-config` [`1744dde`](https://github.com/inspect-js/is-regex/commit/1744dde77526841f216fa2c1c866c5a82b1638c0)
+- [Refactor] when try/catch is needed, bail early if the value lacks an own `lastIndex` data property. [`288ad93`](https://github.com/inspect-js/is-regex/commit/288ad93dbfed9f6828de20de67105ee6d6504425)
+- Update `editorconfig-tools`, `eslint`, `semver`, `replace` [`4d895c6`](https://github.com/inspect-js/is-regex/commit/4d895c68a0cdbb5803185928963c15147aad0404)
+- Update `eslint`, `tape`, `semver` [`f387f03`](https://github.com/inspect-js/is-regex/commit/f387f03b260b56372bfca301d4e79c4067633854)
+- All grade A-supported `node`/`iojs` versions now ship with an `npm` that understands `^`. [`55e480f`](https://github.com/inspect-js/is-regex/commit/55e480f407cafb6c21a6c32aef04ccaa3ba4216c)
+- [Dev Deps] update `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver` [`89d9528`](https://github.com/inspect-js/is-regex/commit/89d95285b364913ebcd8ac7e0872570fe009a5d3)
+- [Dev Deps] update `jscs` [`eb222a8`](https://github.com/inspect-js/is-regex/commit/eb222a8435e59909354f3700fd4880e4ce1cb13e)
+- [Tests] up to `io.js` `v3.3`, `node` `v4.1` [`c65429c`](https://github.com/inspect-js/is-regex/commit/c65429cea0366508c10ad2ab773af7b83a34fc81)
+- Update `nsp`, `eslint` [`c60fbd8`](https://github.com/inspect-js/is-regex/commit/c60fbd8680f7fb3508ec3c5be8ebb788672516c8)
+- Update `eslint`, `semver` [`6a62116`](https://github.com/inspect-js/is-regex/commit/6a621168c63616bf004ca8b1f885b4eb8a58a3e5)
+- [Tests] on `node` `v7.5`, `v4.7` [`e764651`](https://github.com/inspect-js/is-regex/commit/e764651336f5da5e239e9fe8869f3a3201c19d2b)
+- Test up to `io.js` `v2.1` [`3bf326a`](https://github.com/inspect-js/is-regex/commit/3bf326a9bcd530fd16c9fc806e249a68e25ab7e3)
+- Test on the latest `io.js` versions. [`693d047`](https://github.com/inspect-js/is-regex/commit/693d0477631c5d7671f6c99eca5594ffffa75771)
+- [Refactor] use an early return instead of a ternary. [`31eaca2`](https://github.com/inspect-js/is-regex/commit/31eaca28b7d0aaac0599fe7a569b93b842f8ab16)
+- Test on `io.js` `v2.2` [`c18c55a`](https://github.com/inspect-js/is-regex/commit/c18c55aee6358d70531f935e98851e42b698d93c)
+- Run `travis-ci` tests on `iojs` and `node` v0.12; speed up builds; allow 0.8 failures. [`a1c237d`](https://github.com/inspect-js/is-regex/commit/a1c237d35f880fe0bcbc9275254611a6a2300aaf)
+- [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`aa3ea0f`](https://github.com/inspect-js/is-regex/commit/aa3ea0f148af31d75f7ef8a800412729d82def04)
+- [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`d97831d`](https://github.com/inspect-js/is-regex/commit/d97831d0e2ccd3d00d1f7354b7f81e2575f90953)
+- [Dev Deps] Update `tape`, `eslint` [`95e6def`](https://github.com/inspect-js/is-regex/commit/95e6defe3178c45dc9df16e474e558979d5f5c05)
+- Update `eslint`, `nsp` [`3844c93`](https://github.com/inspect-js/is-regex/commit/3844c935cfe7c52fae0dc74d27e884c417cb4616)
+- Update `tape`, `jscs` [`0d6dac8`](https://github.com/inspect-js/is-regex/commit/0d6dac818ed251910171965932f021291919e770)
+- Fix tests for faked @@toStringTag [`2ebef9f`](https://github.com/inspect-js/is-regex/commit/2ebef9f0759843e9a063de7a512b46e3e7daea7e)
+- Test up to `io.js` `v3.0` [`ec1d2d4`](https://github.com/inspect-js/is-regex/commit/ec1d2d44481fa0fa11448527da8030c99fe47a12)
+- [Refactor] bail earlier when the value is falsy. [`a9e333e`](https://github.com/inspect-js/is-regex/commit/a9e333e2ac8912ca05b7e31d30e4eea683c0da4b)
+- [Dev Deps] update `tape` [`8cdcaae`](https://github.com/inspect-js/is-regex/commit/8cdcaae07be8c790cdb99849e6076ea7702a4c84)
+- Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG. [`281c4ef`](https://github.com/inspect-js/is-regex/commit/281c4efeb71c86dd380e741bcaee3f7dbf956151)
+- Test on `io.js` `v2.4` [`4d54c68`](https://github.com/inspect-js/is-regex/commit/4d54c68a81b5332a3b76259d8aa8f514be5efd13)
+- Test on `io.js` `v2.3` [`23170f5`](https://github.com/inspect-js/is-regex/commit/23170f5cae632d0377de73bd2febc53db8aebbc9)
+- Test on `iojs-v1.6` [`4487ad0`](https://github.com/inspect-js/is-regex/commit/4487ad0194a5684223bfa2690da4e0a441f7132a)
+
+## [v1.0.3](https://github.com/inspect-js/is-regex/compare/v1.0.2...v1.0.3) - 2015-01-29
+
+### Commits
+
+- Update npm run scripts. [`dc528dd`](https://github.com/inspect-js/is-regex/commit/dc528dd25e775089bc0a3f5a8f7ae7ffc4cdf52a)
+- Add toStringTag tests. [`f48a83a`](https://github.com/inspect-js/is-regex/commit/f48a83a78720b78ab60ca586c16f6f3dbcfec825)
+- If @@toStringTag is not present, use the old-school Object#toString test. [`50b0ffd`](https://github.com/inspect-js/is-regex/commit/50b0ffd9c7fdbd54aee8cde1b07e680ae84f6a0d)
+
+## [v1.0.2](https://github.com/inspect-js/is-regex/compare/v1.0.1...v1.0.2) - 2015-01-29
+
+### Commits
+
+- `make release` [`a1de7ec`](https://github.com/inspect-js/is-regex/commit/a1de7eca4cecc8015fd27804669f8fc61bd16a68)
+- Improve optimization by separating the try/catch, and bailing out early when not typeof "object". [`5ab7632`](https://github.com/inspect-js/is-regex/commit/5ab76322a348487fa8b16761e83f6824c3c27d11)
+
+## [v1.0.1](https://github.com/inspect-js/is-regex/compare/v1.0.0...v1.0.1) - 2015-01-28
+
+### Commits
+
+- Using my standard jscs.json file [`1f1733a`](https://github.com/inspect-js/is-regex/commit/1f1733ac8433cdcceb25356f86b74136a4477cb9)
+- Adding `npm run lint` [`51ea70f`](https://github.com/inspect-js/is-regex/commit/51ea70fa7e461d022f611c195f343ea8d0333d71)
+- Use RegExp#exec to test if something is a regex, which works even with ES6 @@toStringTag. [`042c8c7`](https://github.com/inspect-js/is-regex/commit/042c8c734faade9015932b61f1e8ea4f3a93b1b3)
+- Adding license and downloads badges [`366d619`](https://github.com/inspect-js/is-regex/commit/366d61965d3a4119126e78e09b2166bbcddd0c5a)
+- Use SVG badges instead of PNG [`6a32e4f`](https://github.com/inspect-js/is-regex/commit/6a32e4fc87d7d3a3787b800dd033c9293aead6df)
+- Update `tape`, `jscs` [`f1b9462`](https://github.com/inspect-js/is-regex/commit/f1b9462f86d1b69de07176e7f277f668757ba964)
+- Update `jscs` [`1bff23f`](https://github.com/inspect-js/is-regex/commit/1bff23ff0fe88c8263e8bf04cf99e290af96d5b0)
+- Update `tape`, `jscs` [`c22ea2e`](https://github.com/inspect-js/is-regex/commit/c22ea2e7967f45618deed01ff5ea483f918be216)
+- Update `tape`, `jscs` [`b0479db`](https://github.com/inspect-js/is-regex/commit/b0479db99a1b1b872d1618fb0a71f0c74a78b29b)
+- Use consistent quotes [`1a6e347`](https://github.com/inspect-js/is-regex/commit/1a6e34730d9270f3f20519139faa4c4e6ec2e1f5)
+- Make travis builds faster. [`090a4ea`](https://github.com/inspect-js/is-regex/commit/090a4ea7c5fa709d108d596e3bc304e6ce973dec)
+- Update `tape` [`7d76129`](https://github.com/inspect-js/is-regex/commit/7d7612928bdd43230fbd835db71797249ca24f35)
+- Lock covert to v1.0.0. [`9a90b03`](https://github.com/inspect-js/is-regex/commit/9a90b03fb390e66f874223a34c58ba2bb109edd3)
+- Updating tape [`bfbc7f5`](https://github.com/inspect-js/is-regex/commit/bfbc7f593a007acd0411152bbb55f724dc4ca935)
+- Updating jscs [`13ad511`](https://github.com/inspect-js/is-regex/commit/13ad511d80cd67300c2c0c5387fc4b3b423e2768)
+- Updating jscs [`cda1945`](https://github.com/inspect-js/is-regex/commit/cda1945d603dfe99e24d5a909a931d366451bc4d)
+- Updating jscs [`de96c99`](https://github.com/inspect-js/is-regex/commit/de96c99d4bf5787df671de6df9138b6547a6545b)
+- Running linter as part of tests [`2cb6567`](https://github.com/inspect-js/is-regex/commit/2cb656733b1ed0af14ad11fb584006d22de0c69d)
+- Updating covert [`a56ae74`](https://github.com/inspect-js/is-regex/commit/a56ae74ec8d5f0473295a8b10519a18580f16624)
+- Updating tape [`ffe47f7`](https://github.com/inspect-js/is-regex/commit/ffe47f7fe9cf6d16896b4bdc286bd1d0805d5c49)
+
+## [v1.0.0](https://github.com/inspect-js/is-regex/compare/v0.0.0...v1.0.0) - 2014-05-19
+
+### Commits
+
+- Make sure old and unstable nodes don't break Travis [`05da747`](https://github.com/inspect-js/is-regex/commit/05da7478f960dc131ec3ad864e27e8c6b7d74a80)
+- toString is a reserved var name in old Opera [`885c48c`](https://github.com/inspect-js/is-regex/commit/885c48c120f921a55f1842b0607d3e7875379821)
+- Updating deps [`2ca0e79`](https://github.com/inspect-js/is-regex/commit/2ca0e79a2443ca34d85e8b2ea2e26f55855b74a7)
+- Updating tape. [`9678435`](https://github.com/inspect-js/is-regex/commit/96784355611deb0c23b9064be774216d76e3e457)
+- Updating covert [`c3bb898`](https://github.com/inspect-js/is-regex/commit/c3bb8985a422e3e0c81f9c43899b6c19a72c755f)
+- Updating tape [`7811708`](https://github.com/inspect-js/is-regex/commit/78117089688258b8f939b397b37897b5b3e30f74)
+- Testing on node 0.6 again [`dec36ae`](https://github.com/inspect-js/is-regex/commit/dec36ae58a39a3f80e832b702c3e19406363c160)
+- Run code coverage as part of tests [`e6f4ebe`](https://github.com/inspect-js/is-regex/commit/e6f4ebec26894543747603f2cb360e839f2ca290)
+
+## v0.0.0 - 2014-01-15
+
+### Commits
+
+- package.json [`aa60d43`](https://github.com/inspect-js/is-regex/commit/aa60d43d2c8adb9fdd47f5898e5e1e570bd238d8)
+- read me [`861e944`](https://github.com/inspect-js/is-regex/commit/861e944de88e84010eaa662ea9ea9f17c90cff8c)
+- Initial commit [`d0cdd71`](https://github.com/inspect-js/is-regex/commit/d0cdd71a637d8490b7ee3eaaf75c7e31d0f9242f)
+- Tests. [`b533f74`](https://github.com/inspect-js/is-regex/commit/b533f741a88dff002790fb7af054b2a74e72d4da)
+- Implementation. [`3c9a8c0`](https://github.com/inspect-js/is-regex/commit/3c9a8c06994003cdfffeb3620f251f4c4cae7755)
+- Travis CI [`742c440`](https://github.com/inspect-js/is-regex/commit/742c4407015f9108875fd108fde137f5245e9e7a)
diff --git a/node_modules/is-regex/LICENSE b/node_modules/is-regex/LICENSE
new file mode 100644
index 0000000..47b7b50
--- /dev/null
+++ b/node_modules/is-regex/LICENSE
@@ -0,0 +1,20 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Jordan Harband
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/is-regex/README.md b/node_modules/is-regex/README.md
new file mode 100644
index 0000000..d61332b
--- /dev/null
+++ b/node_modules/is-regex/README.md
@@ -0,0 +1,52 @@
+# is-regex [![Version Badge][2]][1]
+
+[![github actions][actions-image]][actions-url]
+[![coverage][codecov-image]][codecov-url]
+[![dependency status][5]][6]
+[![dev dependency status][7]][8]
+[![License][license-image]][license-url]
+[![Downloads][downloads-image]][downloads-url]
+
+[![npm badge][11]][1]
+
+Is this value a JS regex?
+This module works cross-realm/iframe, and despite ES6 @@toStringTag.
+
+## Example
+
+```js
+var isRegex = require('is-regex');
+var assert = require('assert');
+
+assert.notOk(isRegex(undefined));
+assert.notOk(isRegex(null));
+assert.notOk(isRegex(false));
+assert.notOk(isRegex(true));
+assert.notOk(isRegex(42));
+assert.notOk(isRegex('foo'));
+assert.notOk(isRegex(function () {}));
+assert.notOk(isRegex([]));
+assert.notOk(isRegex({}));
+
+assert.ok(isRegex(/a/g));
+assert.ok(isRegex(new RegExp('a', 'g')));
+```
+
+## Tests
+Simply clone the repo, `npm install`, and run `npm test`
+
+[1]: https://npmjs.org/package/is-regex
+[2]: https://versionbadg.es/inspect-js/is-regex.svg
+[5]: https://david-dm.org/inspect-js/is-regex.svg
+[6]: https://david-dm.org/inspect-js/is-regex
+[7]: https://david-dm.org/inspect-js/is-regex/dev-status.svg
+[8]: https://david-dm.org/inspect-js/is-regex#info=devDependencies
+[11]: https://nodei.co/npm/is-regex.png?downloads=true&stars=true
+[license-image]: https://img.shields.io/npm/l/is-regex.svg
+[license-url]: LICENSE
+[downloads-image]: https://img.shields.io/npm/dm/is-regex.svg
+[downloads-url]: https://npm-stat.com/charts.html?package=is-regex
+[codecov-image]: https://codecov.io/gh/inspect-js/is-regex/branch/main/graphs/badge.svg
+[codecov-url]: https://app.codecov.io/gh/inspect-js/is-regex/
+[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/is-regex
+[actions-url]: https://github.com/inspect-js/is-regex/actions
diff --git a/node_modules/is-regex/index.js b/node_modules/is-regex/index.js
new file mode 100644
index 0000000..19780f4
--- /dev/null
+++ b/node_modules/is-regex/index.js
@@ -0,0 +1,58 @@
+'use strict';
+
+var callBound = require('call-bind/callBound');
+var hasToStringTag = require('has-tostringtag/shams')();
+var has;
+var $exec;
+var isRegexMarker;
+var badStringifier;
+
+if (hasToStringTag) {
+ has = callBound('Object.prototype.hasOwnProperty');
+ $exec = callBound('RegExp.prototype.exec');
+ isRegexMarker = {};
+
+ var throwRegexMarker = function () {
+ throw isRegexMarker;
+ };
+ badStringifier = {
+ toString: throwRegexMarker,
+ valueOf: throwRegexMarker
+ };
+
+ if (typeof Symbol.toPrimitive === 'symbol') {
+ badStringifier[Symbol.toPrimitive] = throwRegexMarker;
+ }
+}
+
+var $toString = callBound('Object.prototype.toString');
+var gOPD = Object.getOwnPropertyDescriptor;
+var regexClass = '[object RegExp]';
+
+module.exports = hasToStringTag
+ // eslint-disable-next-line consistent-return
+ ? function isRegex(value) {
+ if (!value || typeof value !== 'object') {
+ return false;
+ }
+
+ var descriptor = gOPD(value, 'lastIndex');
+ var hasLastIndexDataProperty = descriptor && has(descriptor, 'value');
+ if (!hasLastIndexDataProperty) {
+ return false;
+ }
+
+ try {
+ $exec(value, badStringifier);
+ } catch (e) {
+ return e === isRegexMarker;
+ }
+ }
+ : function isRegex(value) {
+ // In older browsers, typeof regex incorrectly returns 'function'
+ if (!value || (typeof value !== 'object' && typeof value !== 'function')) {
+ return false;
+ }
+
+ return $toString(value) === regexClass;
+ };
diff --git a/node_modules/is-regex/package.json b/node_modules/is-regex/package.json
new file mode 100644
index 0000000..094fd41
--- /dev/null
+++ b/node_modules/is-regex/package.json
@@ -0,0 +1,86 @@
+{
+ "name": "is-regex",
+ "version": "1.1.4",
+ "description": "Is this value a JS regex? Works cross-realm/iframe, and despite ES6 @@toStringTag",
+ "author": "Jordan Harband ",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ },
+ "license": "MIT",
+ "main": "index.js",
+ "scripts": {
+ "prepublishOnly": "safe-publish-latest",
+ "prepublish": "not-in-publish || npm run prepublishOnly",
+ "pretest": "npm run lint",
+ "test": "npm run tests-only && npm run test:harmony",
+ "tests-only": "nyc node test",
+ "test:harmony": "nyc node --harmony --es-staging test",
+ "test:corejs": "nyc tape test-corejs.js",
+ "posttest": "npx aud --production",
+ "lint": "eslint .",
+ "eccheck": "eclint check *.js **/*.js > /dev/null",
+ "version": "auto-changelog && git add CHANGELOG.md",
+ "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/inspect-js/is-regex.git"
+ },
+ "bugs": {
+ "url": "https://github.com/inspect-js/is-regex/issues"
+ },
+ "homepage": "https://github.com/inspect-js/is-regex",
+ "keywords": [
+ "regex",
+ "regexp",
+ "is",
+ "regular expression",
+ "regular",
+ "expression"
+ ],
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "has-tostringtag": "^1.0.0"
+ },
+ "devDependencies": {
+ "@ljharb/eslint-config": "^17.6.0",
+ "aud": "^1.1.5",
+ "auto-changelog": "^2.3.0",
+ "core-js": "^3.16.0",
+ "eclint": "^2.8.1",
+ "eslint": "^7.32.0",
+ "foreach": "^2.0.5",
+ "nyc": "^10.3.2",
+ "safe-publish-latest": "^1.1.4",
+ "tape": "^5.3.0"
+ },
+ "testling": {
+ "files": "test/index.js",
+ "browsers": [
+ "iexplore/6.0..latest",
+ "firefox/3.0..6.0",
+ "firefox/15.0..latest",
+ "firefox/nightly",
+ "chrome/4.0..10.0",
+ "chrome/20.0..latest",
+ "chrome/canary",
+ "opera/10.0..latest",
+ "opera/next",
+ "safari/4.0..latest",
+ "ipad/6.0..latest",
+ "iphone/6.0..latest",
+ "android-browser/4.2"
+ ]
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "auto-changelog": {
+ "output": "CHANGELOG.md",
+ "template": "keepachangelog",
+ "unreleased": false,
+ "commitLimit": false,
+ "backfillLimit": false,
+ "hideCredit": true
+ }
+}
diff --git a/node_modules/is-regex/test/index.js b/node_modules/is-regex/test/index.js
new file mode 100644
index 0000000..f6c0802
--- /dev/null
+++ b/node_modules/is-regex/test/index.js
@@ -0,0 +1,104 @@
+'use strict';
+
+var hasToStringTag = require('has-tostringtag/shams')();
+var forEach = require('foreach');
+var test = require('tape');
+var isRegex = require('..');
+
+test('not regexes', function (t) {
+ t.notOk(isRegex(), 'undefined is not regex');
+ t.notOk(isRegex(null), 'null is not regex');
+ t.notOk(isRegex(false), 'false is not regex');
+ t.notOk(isRegex(true), 'true is not regex');
+ t.notOk(isRegex(42), 'number is not regex');
+ t.notOk(isRegex('foo'), 'string is not regex');
+ t.notOk(isRegex([]), 'array is not regex');
+ t.notOk(isRegex({}), 'object is not regex');
+ t.notOk(isRegex(function () {}), 'function is not regex');
+ t.end();
+});
+
+test('@@toStringTag', { skip: !hasToStringTag }, function (t) {
+ var regex = /a/g;
+ var fakeRegex = {
+ toString: function () { return String(regex); },
+ valueOf: function () { return regex; }
+ };
+ fakeRegex[Symbol.toStringTag] = 'RegExp';
+ t.notOk(isRegex(fakeRegex), 'fake RegExp with @@toStringTag "RegExp" is not regex');
+ t.end();
+});
+
+test('regexes', function (t) {
+ t.ok(isRegex(/a/g), 'regex literal is regex');
+ t.ok(isRegex(new RegExp('a', 'g')), 'regex object is regex');
+ t.end();
+});
+
+test('does not mutate regexes', function (t) {
+ t.test('lastIndex is a marker object', function (st) {
+ var regex = /a/;
+ var marker = {};
+ regex.lastIndex = marker;
+ st.equal(regex.lastIndex, marker, 'lastIndex is the marker object');
+ st.ok(isRegex(regex), 'is regex');
+ st.equal(regex.lastIndex, marker, 'lastIndex is the marker object after isRegex');
+ st.end();
+ });
+
+ t.test('lastIndex is nonzero', function (st) {
+ var regex = /a/;
+ regex.lastIndex = 3;
+ st.equal(regex.lastIndex, 3, 'lastIndex is 3');
+ st.ok(isRegex(regex), 'is regex');
+ st.equal(regex.lastIndex, 3, 'lastIndex is 3 after isRegex');
+ st.end();
+ });
+
+ t.end();
+});
+
+test('does not perform operations observable to Proxies', { skip: typeof Proxy !== 'function' }, function (t) {
+ var Handler = function () {
+ this.trapCalls = [];
+ };
+
+ forEach([
+ 'defineProperty',
+ 'deleteProperty',
+ 'get',
+ 'getOwnPropertyDescriptor',
+ 'getPrototypeOf',
+ 'has',
+ 'isExtensible',
+ 'ownKeys',
+ 'preventExtensions',
+ 'set',
+ 'setPrototypeOf'
+ ], function (trapName) {
+ Handler.prototype[trapName] = function () {
+ this.trapCalls.push(trapName);
+ return Reflect[trapName].apply(Reflect, arguments);
+ };
+ });
+
+ t.test('proxy of object', function (st) {
+ var handler = new Handler();
+ var proxy = new Proxy({ lastIndex: 0 }, handler);
+
+ st.equal(isRegex(proxy), false, 'proxy of plain object is not regex');
+ st.deepEqual(handler.trapCalls, ['getOwnPropertyDescriptor'], 'no unexpected proxy traps were triggered');
+ st.end();
+ });
+
+ t.test('proxy of RegExp instance', function (st) {
+ var handler = new Handler();
+ var proxy = new Proxy(/a/, handler);
+
+ st.equal(isRegex(proxy), false, 'proxy of RegExp instance is not regex');
+ st.deepEqual(handler.trapCalls, ['getOwnPropertyDescriptor'], 'no unexpected proxy traps were triggered');
+ st.end();
+ });
+
+ t.end();
+});
diff --git a/node_modules/js-stringify/.npmignore b/node_modules/js-stringify/.npmignore
new file mode 100644
index 0000000..b83202d
--- /dev/null
+++ b/node_modules/js-stringify/.npmignore
@@ -0,0 +1,13 @@
+lib-cov
+*.seed
+*.log
+*.csv
+*.dat
+*.out
+*.pid
+*.gz
+pids
+logs
+results
+npm-debug.log
+node_modules
diff --git a/node_modules/js-stringify/.travis.yml b/node_modules/js-stringify/.travis.yml
new file mode 100644
index 0000000..6e5919d
--- /dev/null
+++ b/node_modules/js-stringify/.travis.yml
@@ -0,0 +1,3 @@
+language: node_js
+node_js:
+ - "0.10"
diff --git a/node_modules/js-stringify/LICENSE b/node_modules/js-stringify/LICENSE
new file mode 100644
index 0000000..27cc9f3
--- /dev/null
+++ b/node_modules/js-stringify/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2014 Forbes Lindesay
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
\ No newline at end of file
diff --git a/node_modules/js-stringify/README.md b/node_modules/js-stringify/README.md
new file mode 100644
index 0000000..657333f
--- /dev/null
+++ b/node_modules/js-stringify/README.md
@@ -0,0 +1,34 @@
+# js-stringify
+
+Stringify an object so it can be safely inlined in JavaScript code
+
+[](https://travis-ci.org/jadejs/js-stringify)
+[](https://gemnasium.com/jadejs/js-stringify)
+[](https://www.npmjs.org/package/js-stringify)
+
+## Installation
+
+ npm install js-stringify
+
+## Usage
+
+```js
+
+var assert = require('assert');
+var stringify = require('js-stringify');
+
+assert(stringify('foo') === '"foo"');
+assert(stringify('foo\u2028bar\u2029baz') === '"foo\\u2028bar\\u2029baz"');
+assert(stringify(new Date('2014-12-19T03:42:00.000Z')) === 'new Date("2014-12-19T03:42:00.000Z")');
+assert(stringify({foo: 'bar'}) === '{"foo":"bar"}');
+assert(stringify(undefined) === 'undefined');
+assert(stringify(null) === 'null');
+assert(
+ stringify({val: ""}) ===
+ '{"val":"\\u003C\\u002Fscript\\u003E\\u003Cscript\\u003Ealert(\'bad actor\')\\u003C\\u002Fscript\\u003E"}'
+);
+```
+
+## License
+
+ MIT
diff --git a/node_modules/js-stringify/index.js b/node_modules/js-stringify/index.js
new file mode 100644
index 0000000..8febfc4
--- /dev/null
+++ b/node_modules/js-stringify/index.js
@@ -0,0 +1,17 @@
+'use strict';
+
+module.exports = stringify;
+function stringify(obj) {
+ if (obj instanceof Date) {
+ return 'new Date(' + stringify(obj.toISOString()) + ')';
+ }
+ if (obj === undefined) {
+ return 'undefined';
+ }
+ return JSON.stringify(obj)
+ .replace(/\u2028/g, '\\u2028')
+ .replace(/\u2029/g, '\\u2029')
+ .replace(//g, '\\u003E')
+ .replace(/\//g, '\\u002F');
+}
diff --git a/node_modules/js-stringify/package.json b/node_modules/js-stringify/package.json
new file mode 100644
index 0000000..c5f1c17
--- /dev/null
+++ b/node_modules/js-stringify/package.json
@@ -0,0 +1,17 @@
+{
+ "name": "js-stringify",
+ "version": "1.0.2",
+ "description": "Stringify an object so it can be safely inlined in JavaScript code",
+ "keywords": [],
+ "dependencies": {},
+ "devDependencies": {},
+ "scripts": {
+ "test": "node test"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/jadejs/js-stringify.git"
+ },
+ "author": "ForbesLindesay",
+ "license": "MIT"
+}
\ No newline at end of file
diff --git a/node_modules/js-stringify/test/index.js b/node_modules/js-stringify/test/index.js
new file mode 100644
index 0000000..9a84a98
--- /dev/null
+++ b/node_modules/js-stringify/test/index.js
@@ -0,0 +1,17 @@
+'use strict';
+
+var assert = require('assert');
+var stringify = require('../');
+
+assert(stringify('foo') === '"foo"');
+assert(stringify('foo\u2028bar\u2029baz') === '"foo\\u2028bar\\u2029baz"');
+assert(stringify(new Date('2014-12-19T03:42:00.000Z')) === 'new Date("2014-12-19T03:42:00.000Z")');
+assert(stringify({foo: 'bar'}) === '{"foo":"bar"}');
+assert(stringify(undefined) === 'undefined');
+assert(stringify(null) === 'null');
+assert(
+ stringify({val: ""}) ===
+ '{"val":"\\u003C\\u002Fscript\\u003E\\u003Cscript\\u003Ealert(\'bad actor\')\\u003C\\u002Fscript\\u003E"}'
+);
+
+console.log('tests passed');
diff --git a/node_modules/jstransformer/CHANGELOG.md b/node_modules/jstransformer/CHANGELOG.md
new file mode 100644
index 0000000..f4655b0
--- /dev/null
+++ b/node_modules/jstransformer/CHANGELOG.md
@@ -0,0 +1,38 @@
+# Change Log
+All notable changes to this project will be documented in this file.
+This project adheres to [Semantic Versioning](http://semver.org/).
+
+## [1.0.0] - 2016-06-06
+### Changed
+- Browser support is fixed
+- Marked as stable
+
+## [0.0.4] - 2015-11-23
+### Changed
+- Switched to [Keep a Changelog](http://keepachangelog.com/) spec for CHANGELOG.md
+- Creates an `options.filename` for `*File()` functions, if one is not provided
+
+## [0.0.3] - 2015-07-13
+### Added
+- Added `.render()` fallbacks for `.compile()`
+
+### Changed
+- Prefers locals over options when passing a single argument to `.render()`
+- Updated dependencies
+
+## [0.0.2] - 2015-04-11
+### Added
+- Now have a logo
+- Added tests
+
+### Changed
+- Updated documentation
+
+## 0.0.1 - 2015-02-09
+### Added
+- Initial release
+
+[1.0.0]: https://github.com/jstransformers/jstransformer/compare/0.0.4...1.0.0
+[0.0.4]: https://github.com/jstransformers/jstransformer/compare/0.0.3...0.0.4
+[0.0.3]: https://github.com/jstransformers/jstransformer/compare/0.0.2...0.0.3
+[0.0.2]: https://github.com/jstransformers/jstransformer/compare/0.0.1...0.0.2
diff --git a/node_modules/jstransformer/LICENSE.md b/node_modules/jstransformer/LICENSE.md
new file mode 100644
index 0000000..006e201
--- /dev/null
+++ b/node_modules/jstransformer/LICENSE.md
@@ -0,0 +1,21 @@
+# The MIT License (MIT)
+
+Copyright (c) 2015 Forbes Lindesay
+
+> Permission is hereby granted, free of charge, to any person obtaining a copy
+> of this software and associated documentation files (the "Software"), to deal
+> in the Software without restriction, including without limitation the rights
+> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+> copies of the Software, and to permit persons to whom the Software is
+> furnished to do so, subject to the following conditions:
+>
+> The above copyright notice and this permission notice shall be included in
+> all copies or substantial portions of the Software.
+>
+> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+> SOFTWARE.
diff --git a/node_modules/jstransformer/README.md b/node_modules/jstransformer/README.md
new file mode 100644
index 0000000..99dca54
--- /dev/null
+++ b/node_modules/jstransformer/README.md
@@ -0,0 +1,114 @@
+