miniprogram-ci 1.5.1 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/README.md +71 -0
  3. package/dist/@types/ci/code-analyse.d.ts +4 -0
  4. package/dist/@types/ci/getLatestVersion.d.ts +7 -0
  5. package/dist/@types/ci/project.d.ts +4 -0
  6. package/dist/@types/cloud/cloudapi.d.ts +1 -1
  7. package/dist/@types/cloud/uploadContainer.d.ts +36 -7
  8. package/dist/@types/config.d.ts +3 -3
  9. package/dist/@types/core/js/enhance.d.ts +1 -0
  10. package/dist/@types/core/js/generateMap.d.ts +3 -0
  11. package/dist/@types/core/json/app/checkAppFields.d.ts +1 -0
  12. package/dist/@types/core/json/projectWithMockBuffer.d.ts +14 -0
  13. package/dist/@types/core/json/reactiveCache.d.ts +4 -0
  14. package/dist/@types/core/protect/uglifyfilenames.d.ts +2 -4
  15. package/dist/@types/core/worker_thread/task/minifywxml.d.ts +7 -0
  16. package/dist/@types/core.d.ts +1 -1
  17. package/dist/@types/index.d.ts +6 -0
  18. package/dist/@types/summer/ci.d.ts +3 -0
  19. package/dist/@types/summer/devtool.d.ts +9 -1
  20. package/dist/@types/summer/error.d.ts +14 -5
  21. package/dist/@types/summer/graph/appgraph.d.ts +1 -0
  22. package/dist/@types/summer/graph/basegraph.d.ts +4 -0
  23. package/dist/@types/summer/graph/plugingraph.d.ts +2 -1
  24. package/dist/@types/summer/initPlugin.d.ts +1 -1
  25. package/dist/@types/summer/module.d.ts +3 -2
  26. package/dist/@types/summer/plugins/base/es6module.d.ts +4 -2
  27. package/dist/@types/summer/plugins/base/wxss.d.ts +1 -1
  28. package/dist/@types/summer/plugins/enhance.d.ts +3 -1
  29. package/dist/@types/summer/plugins/index.d.ts +1 -16
  30. package/dist/@types/summer/project.d.ts +5 -3
  31. package/dist/@types/summer/summer.d.ts +2 -1
  32. package/dist/@types/summer/types.d.ts +1 -0
  33. package/dist/@types/types/index.d.ts +5 -0
  34. package/dist/@types/types/miniprogram-json/app.d.ts +2 -1
  35. package/dist/@types/types/miniprogram-json/page.d.ts +1 -0
  36. package/dist/@types/types/miniprogram-json/projectconfig.d.ts +2 -0
  37. package/dist/@types/utils/locales/locales.d.ts +4 -0
  38. package/dist/@types/utils/locales/zh.d.ts +4 -0
  39. package/dist/@types/utils/tools.d.ts +1 -0
  40. package/dist/@types/utils/url_config.d.ts +1 -0
  41. package/dist/@types/vendor/code-analyse/index.d.ts +4 -3
  42. package/dist/ci/code-analyse.js +3 -0
  43. package/dist/ci/cos-upload.js +3 -1
  44. package/dist/ci/getCompiledResult.js +3 -1
  45. package/dist/ci/getDevSourceMap.js +3 -1
  46. package/dist/ci/getLatestVersion.js +3 -0
  47. package/dist/ci/jsserver.js +3 -1
  48. package/dist/ci/preview.js +3 -1
  49. package/dist/ci/project.js +3 -1
  50. package/dist/ci/projectattr.js +3 -1
  51. package/dist/ci/upload.js +3 -1
  52. package/dist/ci/utils/pack.js +3 -1
  53. package/dist/ci/utils/packfile.js +3 -1
  54. package/dist/ci/utils/terminalQrcode.js +3 -1
  55. package/dist/cli.js +3 -1
  56. package/dist/cloud/cloudapi.js +3 -1
  57. package/dist/cloud/createTimeTrigger.js +3 -1
  58. package/dist/cloud/uploadContainer.js +3 -1
  59. package/dist/cloud/uploadFile.js +3 -1
  60. package/dist/cloud/uploadFunction.js +3 -1
  61. package/dist/cloud/utils.js +3 -1
  62. package/dist/config.js +3 -1
  63. package/dist/core/analyse/partial.js +3 -1
  64. package/dist/core/compile/common.js +3 -1
  65. package/dist/core/compile/game.js +3 -1
  66. package/dist/core/compile/game_plugin.js +3 -1
  67. package/dist/core/compile/handler/js.js +3 -1
  68. package/dist/core/compile/handler/mpjson.js +3 -1
  69. package/dist/core/compile/handler/wxml.js +3 -1
  70. package/dist/core/compile/handler/wxss.js +3 -1
  71. package/dist/core/compile/index.js +3 -1
  72. package/dist/core/compile/mini_program.js +3 -1
  73. package/dist/core/compile/mini_program_plugin.js +3 -1
  74. package/dist/core/js/enhance.js +1 -1
  75. package/dist/core/js/generateMap.js +1 -0
  76. package/dist/core/js/index.js +1 -1
  77. package/dist/core/js/minifyjs_after_wrap.js +1 -1
  78. package/dist/core/json/app/checkAppFields.js +3 -1
  79. package/dist/core/json/app/getAppJSON.js +3 -1
  80. package/dist/core/json/app/getExtJSON.js +3 -1
  81. package/dist/core/json/app/index.js +3 -1
  82. package/dist/core/json/common.js +3 -1
  83. package/dist/core/json/game.js +3 -1
  84. package/dist/core/json/page/checkPageJSON.js +3 -1
  85. package/dist/core/json/page/getPageJSON.js +3 -1
  86. package/dist/core/json/plugin/plugin.js +3 -1
  87. package/dist/core/json/plugin/plugin_page.js +3 -1
  88. package/dist/core/json/projectWithMockBuffer.js +3 -0
  89. package/dist/core/json/projectconfig.js +3 -1
  90. package/dist/core/json/reactiveCache.js +3 -1
  91. package/dist/core/json/signaturejson.js +3 -1
  92. package/dist/core/json/sitemap.js +3 -1
  93. package/dist/core/json/theme.js +3 -1
  94. package/dist/core/npm/filterdeps.js +3 -1
  95. package/dist/core/npm/packnpm.js +3 -1
  96. package/dist/core/protect/file_flatter.js +3 -1
  97. package/dist/core/protect/uglifyfilenames.js +3 -1
  98. package/dist/core/utils/env.js +3 -1
  99. package/dist/core/utils/logger.js +3 -1
  100. package/dist/core/validate/validate.js +1 -1
  101. package/dist/core/worker_thread/childprocess.js +1 -1
  102. package/dist/core/worker_thread/childprocess_manager.js +1 -1
  103. package/dist/core/worker_thread/fork.js +1 -1
  104. package/dist/core/worker_thread/index.js +1 -1
  105. package/dist/core/worker_thread/task/call_func.js +1 -1
  106. package/dist/core/worker_thread/task/compilejs.js +1 -1
  107. package/dist/core/worker_thread/task/compilewxss.js +1 -1
  108. package/dist/core/worker_thread/task/func.js +1 -1
  109. package/dist/core/worker_thread/task/minifywxml.js +1 -1
  110. package/dist/core/worker_thread/worker.js +1 -1
  111. package/dist/core/worker_thread/worker_manager.js +1 -1
  112. package/dist/core.js +3 -1
  113. package/dist/index.js +3 -1
  114. package/dist/manifest.json +3 -3
  115. package/dist/summer/ci.js +3 -0
  116. package/dist/summer/devtool.js +3 -1
  117. package/dist/summer/entry_process.js +1 -1
  118. package/dist/summer/error.js +3 -1
  119. package/dist/summer/graph/appconf.js +3 -1
  120. package/dist/summer/graph/appgraph.js +3 -1
  121. package/dist/summer/graph/basegraph.js +3 -1
  122. package/dist/summer/graph/pluginconf.js +3 -1
  123. package/dist/summer/graph/plugingraph.js +3 -1
  124. package/dist/summer/index.js +3 -1
  125. package/dist/summer/initPlugin.js +3 -1
  126. package/dist/summer/module.js +3 -1
  127. package/dist/summer/persist_cache.js +3 -1
  128. package/dist/summer/plugin_driver.js +3 -1
  129. package/dist/summer/plugins/base/es6module.js +1 -1
  130. package/dist/summer/plugins/base/javascript.js +1 -1
  131. package/dist/summer/plugins/base/wxss.js +1 -1
  132. package/dist/summer/plugins/enhance.js +1 -1
  133. package/dist/summer/plugins/index.js +1 -1
  134. package/dist/summer/plugins/less.js +1 -1
  135. package/dist/summer/plugins/sass.js +1 -1
  136. package/dist/summer/plugins/terser.js +1 -1
  137. package/dist/summer/plugins/typescript.js +1 -1
  138. package/dist/summer/project.js +3 -1
  139. package/dist/summer/recorder.js +3 -1
  140. package/dist/summer/resolver.js +3 -1
  141. package/dist/summer/summer.js +3 -1
  142. package/dist/summer/types.js +3 -1
  143. package/dist/summer/utils/async.js +3 -1
  144. package/dist/summer/utils/ensureArray.js +3 -1
  145. package/dist/summer/worker.js +3 -1
  146. package/dist/types/index.js +3 -1
  147. package/dist/types/miniprogram-json/app.js +3 -1
  148. package/dist/types/miniprogram-json/base.js +3 -1
  149. package/dist/types/miniprogram-json/ext.js +3 -1
  150. package/dist/types/miniprogram-json/game.js +3 -1
  151. package/dist/types/miniprogram-json/index.js +3 -1
  152. package/dist/types/miniprogram-json/page.js +3 -1
  153. package/dist/types/miniprogram-json/plugin.js +3 -1
  154. package/dist/types/miniprogram-json/projectconfig.js +3 -1
  155. package/dist/types/miniprogram-json/sitemap.js +3 -1
  156. package/dist/types/miniprogram-json/theme.js +3 -1
  157. package/dist/utils/babel_helper.js +3 -1
  158. package/dist/utils/babel_transform_plugin.js +3 -1
  159. package/dist/utils/cache.js +3 -1
  160. package/dist/utils/common.js +3 -1
  161. package/dist/utils/error.js +3 -1
  162. package/dist/utils/fs.js +3 -1
  163. package/dist/utils/fsagent.js +3 -1
  164. package/dist/utils/glob.js +3 -1
  165. package/dist/utils/interruptibletask.js +3 -1
  166. package/dist/utils/jsonParse.js +3 -1
  167. package/dist/utils/jsonlint.js +3 -1
  168. package/dist/utils/locales/en.js +3 -1
  169. package/dist/utils/locales/fomatable_string.js +3 -1
  170. package/dist/utils/locales/locales.js +3 -1
  171. package/dist/utils/locales/zh.js +3 -1
  172. package/dist/utils/log.js +3 -1
  173. package/dist/utils/report.js +3 -1
  174. package/dist/utils/request.js +3 -1
  175. package/dist/utils/sign.js +3 -1
  176. package/dist/utils/taskstatus.js +3 -1
  177. package/dist/utils/tools.js +3 -1
  178. package/dist/utils/url_config.js +3 -1
  179. package/dist/utils/white_ext_list.js +3 -1
  180. package/dist/utils/wxvpkgreader/wxvpkgreader.js +1 -1
  181. package/dist/vendor/cloud-api/src/apis/apis.js +3 -1
  182. package/dist/vendor/cloud-api/src/apis/cdn/cdn.apis.js +3 -1
  183. package/dist/vendor/cloud-api/src/apis/cdn/index.js +3 -1
  184. package/dist/vendor/cloud-api/src/apis/flexdb/flexdb.apis.js +3 -1
  185. package/dist/vendor/cloud-api/src/apis/flexdb/index.js +3 -1
  186. package/dist/vendor/cloud-api/src/apis/scf/index.js +3 -1
  187. package/dist/vendor/cloud-api/src/apis/scf/scf.apis.js +3 -1
  188. package/dist/vendor/cloud-api/src/apis/ssl/index.js +3 -1
  189. package/dist/vendor/cloud-api/src/apis/ssl/ssl.apis.js +3 -1
  190. package/dist/vendor/cloud-api/src/apis/tcb/general.apis.js +3 -1
  191. package/dist/vendor/cloud-api/src/apis/tcb/index.js +3 -1
  192. package/dist/vendor/cloud-api/src/apis/tcb/tcb.apis.js +3 -1
  193. package/dist/vendor/cloud-api/src/index.js +3 -1
  194. package/dist/vendor/cloud-api/src/transaction/contracts/cdn.contracts.js +3 -1
  195. package/dist/vendor/cloud-api/src/transaction/contracts/contracts.js +3 -1
  196. package/dist/vendor/cloud-api/src/transaction/contracts/factory.js +3 -1
  197. package/dist/vendor/cloud-api/src/transaction/contracts/flexdb.contracts.js +3 -1
  198. package/dist/vendor/cloud-api/src/transaction/contracts/scf.contracts.js +3 -1
  199. package/dist/vendor/cloud-api/src/transaction/contracts/ssl.contracts.js +3 -1
  200. package/dist/vendor/cloud-api/src/transaction/contracts/tcb.contracts.js +3 -1
  201. package/dist/vendor/cloud-api/src/transaction/transactor.js +3 -1
  202. package/dist/vendor/cloud-api/src/transaction/validations/cdn.validations.js +3 -1
  203. package/dist/vendor/cloud-api/src/transaction/validations/common.validations.js +3 -1
  204. package/dist/vendor/cloud-api/src/transaction/validations/flexdb.validations.js +3 -1
  205. package/dist/vendor/cloud-api/src/transaction/validations/scf.validations.js +3 -1
  206. package/dist/vendor/cloud-api/src/transaction/validations/ssl.validations.js +3 -1
  207. package/dist/vendor/cloud-api/src/transaction/validations/tcb.validations.js +3 -1
  208. package/dist/vendor/cloud-api/src/transaction/validations/validations.js +3 -1
  209. package/dist/vendor/cloud-api/src/utils/common.js +3 -1
  210. package/dist/vendor/cloud-api/src/utils/validator.js +3 -1
  211. package/dist/vendor/code-analyse/index.js +1 -1
  212. package/dist/vendor/schema/dist/app.js +26 -1
  213. package/dist/vendor/schema/dist/ext.js +21 -1
  214. package/dist/vendor/schema/dist/game.js +29 -1
  215. package/dist/vendor/schema/dist/page.js +18 -1
  216. package/dist/vendor/schema/dist/plugin.js +1 -1
  217. package/dist/vendor/schema/dist/pluginpage.js +1 -1
  218. package/dist/vendor/schema/dist/projectconfig.js +38 -1
  219. package/dist/vendor/schema/dist/sitemap.js +1 -1
  220. package/dist/vendor/schema/dist/theme.js +1 -1
  221. package/package.json +22 -24
  222. package/dist/@types/core/js/__tests__/minifyjs.spec.d.ts +0 -1
  223. package/dist/@types/summer/backup/appconf/index-old.d.ts +0 -0
  224. package/dist/@types/summer/backup/appconf/index.d.ts +0 -33
  225. package/dist/@types/summer/backup/detectors/es6/BasicEvaluatedExpression.d.ts +0 -51
  226. package/dist/@types/summer/backup/detectors/es6/ContextDependencyHelpers.d.ts +0 -4
  227. package/dist/@types/summer/backup/detectors/es6/Evaluator.d.ts +0 -29
  228. package/dist/@types/summer/backup/detectors/es6/Parser.d.ts +0 -134
  229. package/dist/@types/summer/backup/detectors/es6/StackedSetMap.d.ts +0 -17
  230. package/dist/@types/summer/backup/detectors/es6/acorn/acorn.d.ts +0 -0
  231. package/dist/@types/summer/backup/detectors/es6/types.d.ts +0 -37
  232. package/dist/@types/summer/backup/detectors/wxml/index.d.ts +0 -4
  233. package/dist/@types/summer/backup/detectors/wxss/index.d.ts +0 -5
  234. package/dist/@types/summer/backup/detectors/wxss/parse.d.ts +0 -1
  235. package/dist/@types/summer/backup/fslayer/fslayer.d.ts +0 -73
  236. package/dist/@types/summer/backup/graph.d.ts +0 -71
  237. package/dist/@types/summer/backup/module.d.ts +0 -34
  238. package/dist/@types/summer/backup/plugin_driver.d.ts +0 -41
  239. package/dist/@types/summer/backup/structs/app.d.ts +0 -0
  240. package/dist/@types/summer/backup/watcher.d.ts +0 -0
  241. package/dist/core/js/__tests__/minifyjs.spec.js +0 -1
  242. package/dist/summer/backup/appconf/index-old.js +0 -1
  243. package/dist/summer/backup/appconf/index.js +0 -1
  244. package/dist/summer/backup/detectors/es6/BasicEvaluatedExpression.js +0 -1
  245. package/dist/summer/backup/detectors/es6/ContextDependencyHelpers.js +0 -1
  246. package/dist/summer/backup/detectors/es6/Evaluator.js +0 -1
  247. package/dist/summer/backup/detectors/es6/Parser.js +0 -1
  248. package/dist/summer/backup/detectors/es6/StackedSetMap.js +0 -1
  249. package/dist/summer/backup/detectors/es6/acorn/acorn.js +0 -1
  250. package/dist/summer/backup/detectors/es6/types.js +0 -1
  251. package/dist/summer/backup/detectors/wxml/index.js +0 -1
  252. package/dist/summer/backup/detectors/wxss/index.js +0 -1
  253. package/dist/summer/backup/detectors/wxss/parse.js +0 -1
  254. package/dist/summer/backup/fslayer/fslayer.js +0 -1
  255. package/dist/summer/backup/graph.js +0 -1
  256. package/dist/summer/backup/module.js +0 -1
  257. package/dist/summer/backup/plugin_driver.js +0 -1
  258. package/dist/summer/backup/structs/app.js +0 -1
  259. package/dist/summer/backup/watcher.js +0 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("path"),t=require("glob"),s=require("fs-extra"),i=require("chokidar"),r=require("lodash");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=a(e),o=a(t),h=a(s),p=a(i);const l={".wxml":!0,".wxss":!0,".wxs":!0,".png":!0,".jpg":!0,".jpeg":!0,".gif":!0,".svg":!0,".js":!0,".json":!0,".cer":!0,".mp3":!0,".aac":!0,".m4a":!0,".mp4":!0,".wav":!0,".ogg":!0,".silk":!0,".wasm":!0,".br":!0},c={".png":!0,".jpg":!0,".jpeg":!0,".gif":!0,".svg":!0,".js":!0,".json":!0,".cer":!0,".obj":!0,".dae":!0,".fbx":!0,".mtl":!0,".stl":!0,".3ds":!0,".mp3":!0,".pvr":!0,".wav":!0,".plist":!0,".ttf":!0,".fnt":!0,".gz":!0,".ccz":!0,".m4a":!0,".mp4":!0,".bmp":!0,".atlas":!0,".swf":!0,".ani":!0,".part":!0,".proto":!0,".bin":!0,".sk":!0,".mipmaps":!0,".txt":!0,".zip":!0,".ogg":!0,".silk":!0,".dbbin":!0,".dbmv":!0,".etc":!0,".lmat":!0,".lm":!0,".ls":!0,".lh":!0,".lani":!0,".lav":!0,".lsani":!0,".ltc":!0,".csv":!0,".scene":!0,".prefab":!0,".lml":!0,".lmani":!0,".ktx":!0,".dds":!0,".xml":!0,".aac":!0,".pkm":!0,".skel":!0,".cur":!0,".ico":!0,".wasm":!0,".br":!0},u=["node_modules/**/*","**/node_modules/**","**/.git/**",".git/**/*","**/.svn/**",".svn/**/*",".DS_Store","**/.DS_Store"];class d{constructor(e,t="miniprogram"){this.root=e,this.type=t,this.dirSet=new Set,this.fileSet=new Set,this.init()}cacheDirName(e){this.dirSet.has(e)||(this.dirSet.add(e),this.cacheDirName(n.default.posix.dirname(e)))}get pattern(){let e;return e="miniprogram"===this.type||"plugin"===this.type?"**/*{"+Object.keys(l).join(",")+"}":"**/*{"+Object.keys(c).join(",")+"}",e}init(){const e=o.default.sync(this.pattern,{nodir:!1,ignore:[...u],nosort:!0,strict:!1,silent:!0,cwd:this.root,absolute:!1,mark:!0,dot:!0});for(const t of e)t.endsWith("/")?this.cacheDirName(t.replace(/\/$/,"")):(this.fileSet.add(t),this.cacheDirName(n.default.posix.dirname(t)))}stat(e){let t=n.default.join(this.root,e);if(this.exist(e)){let e=h.default.statSync(t);return{isFile:e.isFile(),isDirectory:e.isDirectory(),size:e.size,mtime:e.mtimeMs}}}mtime(e){let t=this.stat(e);return t?t.mtime:0}exist(e){return this.fileSet.has(e)||this.dirSet.has(e)}existDir(e){return e.endsWith("/")&&(e=e.replace(/\/$/,"")),this.dirSet.has(e)}existFile(e){return this.fileSet.has(e)}getFileList(e,t=""){return Array.from(this.fileSet).filter((s=>(!t||n.default.posix.extname(s)===t)&&!(e&&!s.startsWith(e))))}async getString(e){return h.default.readFile(n.default.join(this.root,e),"utf-8")}async getJSON(e){let t=await this.getString(e);try{return JSON.parse(t)}catch(e){}}async readdir(e){return h.default.readdir(n.default.join(this.root,e))}async onFileChange(e,t){if("add"===e&&(this.cacheDirName(n.default.posix.dirname(t)),this.fileSet.add(t)),"addDir"===e&&this.cacheDirName(t),"unlink"===e&&this.fileSet.has(t)&&this.fileSet.delete(t),"unlinkDir"===e&&this.dirSet.has(t)){this.dirSet.delete(t);const e=`${t}/`,s=Array.from(this.dirSet);for(const t of s)0===t.indexOf(e)&&this.dirSet.delete(t);const i=Array.from(this.fileSet);for(const t of i)0===t.indexOf(e)&&this.fileSet.delete(t)}}watchFileChange(e){const t=p.default.watch(this.pattern,{cwd:this.root,ignored:"**/miniprogram-analyse-result.json"}),s=r.debounce(e,200);let i=!1;t.on("all",((e,t)=>{this.onFileChange(e,t),i&&s()})).on("error",(e=>console.log(`Watcher error: ${e}`))).on("ready",(()=>{i=!0,console.log("Initial scan complete. Ready for changes")}))}}function f(e,t="js"){return e.endsWith("."+t)?e:e+"."+t}function m(e,t,s,i){const r=n.default.join(e,"miniprogram_npm/");let a;if(i.existDir(r)){if(a=n.default.join(r,t),a=f(a,s),i.existFile(a))return a;if(a=n.default.join(r,t,`index.${s}`),i.existFile(a))return a}return e.startsWith(".")?null:m(n.default.posix.join(e,"../"),t,s,i)}function g(e,t,s,i){const r=n.default.posix.dirname(e);let a=null;if(a=t.startsWith("/")?t.replace(/^\//,""):n.default.join(r,t),a=f(a,s),i.existFile(a))return a;if("js"===s||"json"===s)try{if(a=m(n.default.posix.dirname(e),t,s,i),a)return a}catch(e){console.error(e)}return null}class x{constructor(e,t,s){this.from="rule",this.path=null,this.module=null,this.originModule=null,this.error=null,this.type=e,this.request=t,this.originModule=s}serialize(){return{from:this.from,type:this.type,request:this.request,path:this.path,moduleId:this.module?this.module.id:null,originModuleId:this.originModule.id,error:this.error?this.error.message:null}}markError(e){return this.error=e,e}clearError(){this.error=null}}class y extends x{constructor(e,t,s,i,r=!1,a=!0){super(e,t,s),this.fileHelper=i,this.needResolve=r,this.necessary=a,s&&("MainPackage"===s.type||"Page"===s.type||"Component"===s.type)?this.from="rule":this.from="file"}async resolve(){if(this.clearError(),this.needResolve?this.path=g(this.originModule.path,this.request,this.type.toLowerCase(),this.fileHelper):this.path=this.request,this.path&&this.fileHelper.existFile(this.path))return!0;if(this.necessary)throw this.originModule?this.markError(new Error(`Couldn't resolve the ${this.type} file "${this.request}" relative to "${this.originModule.path}"`)):this.markError(new Error(`Couldn't resolve the ${this.type} file "${this.request}"`));return!1}}class k extends x{constructor({type:e,request:t,regExp:s,originModule:i,fileHelper:r,needResolve:a=!1,necessary:n=!0,from:o="file"}){super("ContextModule",t,i),this.needResolve=!1,this.necessary=!0,this.fileType="Js"===e?"js":"wxs",this.fileHelper=r,this.regExp=s,this.needResolve=a,this.necessary=n,this.from=o,this.context=t}async resolve(){if(this.clearError(),this.needResolve)if(this.request.startsWith("/"))this.context=this.request.replace(/^\//,"");else{const e=n.default.posix.dirname(this.originModule.path);this.context=n.default.join(e,this.request)}else this.context=this.request;if(this.fileHelper.existDir(this.context))return this.path=this.context+"/("+this.regExp.source+")",!0;if(this.necessary)throw this.markError(new Error(`Couldn't find the directory "${this.request}" relative to "${this.originModule.path}"`));return!1}}class w extends x{constructor(e,t,s){super("SubPackage",e.root.endsWith("/")?e.root:e.root+"/",t),this.fileHelper=s,this.config=e,this.from="json"}async resolve(){if(this.clearError(),this.path=null,this.fileHelper.existDir(this.config.root))return this.path=this.request,!0;throw this.markError(new Error(`The subpackage directory "${this.config.root}" doesn't exist`))}serialize(){return Object.assign(Object.assign({},super.serialize()),{config:this.config})}}class v extends x{constructor(e,t,s){super("Page",e,t),this.fileHelper=s,this.from="json","SubPackage"===t.type?this.path=t.path+e+".json":this.path=e+".json"}async resolve(){return!0}}class b extends x{constructor(e,t,s,i){super("Component",t,s),this.name=e,this.fileHelper=i,this.isPlugin=!1,this.isUseExtenedLib=!1,this.from="json"}async resolve(e){if(this.clearError(),this.request.startsWith("plugin://")||this.request.startsWith("plugin-private://"))return this.isPlugin=!0,this.path=null,!1;if(e.miniprogram.useExtendedPackages.find((e=>this.request.startsWith(e+"/")||this.request===e)))return this.isUseExtenedLib=!0,this.path=null,!1;if(this.path=g(this.originModule.path,this.request,"json",this.fileHelper),this.path)return!0;throw this.markError(new Error(`Couldn't resolve the Component "${this.request}" relative to "${this.originModule.path}"`))}serialize(){return Object.assign(Object.assign({},super.serialize()),{isPlugin:this.isPlugin})}}class E extends x{constructor(e,t,s,i="json"){super("Config",e,t),this.fileHelper=s,this.from=i}async resolve(){if(this.clearError(),this.path=null,this.fileHelper.existFile(this.request))return this.path=this.request,!0;throw this.markError(new Error(`The config file "${this.request}" doesn't exist`))}}class S extends x{constructor(e,t,s){super("Worker",e,t),this.fileHelper=s,this.from="json"}async resolve(){if(this.clearError(),this.path=null,this.fileHelper.existDir(this.request))return this.path=this.request,!0;throw this.markError(new Error(`The worker directory "${this.request}" doesn't exist`))}}class _ extends x{constructor(e,t){super("FunctionalPages","functional-pages",e),this.fileHelper=t,this.from="rule"}async resolve(){return this.clearError(),this.path=null,!!this.fileHelper.existDir(this.request)&&(this.path=this.request,!0)}}class C extends x{constructor(e){super("MainPackage","app.json"),this.fileHelper=e,this.from="rule"}async resolve(){if(this.clearError(),this.path=null,this.fileHelper.exist(this.request))return this.path=this.request,!0;throw this.markError(new Error(`The file ${this.request} doesn't exist`))}}class P extends x{constructor(e){super("PluginPackage","plugin.json"),this.fileHelper=e,this.from="rule"}async resolve(){if(this.clearError(),this.path=null,this.fileHelper.exist(this.request))return this.path=this.request,!0;throw this.markError(new Error(`The file ${this.request} doesn't exist`))}}class A extends x{constructor(e){super("GameMainPackage","game.json"),this.fileHelper=e,this.from="rule"}async resolve(){if(this.clearError(),this.path=null,this.fileHelper.exist(this.request))return this.path=this.request,!0;throw this.markError(new Error(`The file ${this.request} doesn't exist`))}}class I extends x{constructor(e,t,s){super("SubPackage",e.root.endsWith("/")||e.root.endsWith(".js")?e.root:e.root+"/",t),this.fileHelper=s,this.config=e,this.from="json"}async resolve(){if(this.clearError(),this.path=null,this.fileHelper.existDir(this.config.root)||this.fileHelper.existFile(this.config.root))return this.path=this.request,!0;throw this.markError(new Error(`The subpackage directory or file "${this.config.root}" doesn't exist`))}serialize(){return Object.assign(Object.assign({},super.serialize()),{config:this.config})}}class N{constructor(e,t){this.parentDeps=new Set,this.deps=new Set,this.warnings=[],this.errors=[],this.mtime=0,this.type=t.type,this.path=t.path,this.id=this.type+":"+this.path,this.parentDeps.add(t),this.fileHelper=e,this.mtime=this.fileHelper.mtime(this.path)}isValid(){return this.mtime===this.fileHelper.mtime(this.path)}addDep(e){this.deps.add(e)}removeDep(e){var t;this.deps.delete(e),null===(t=e.module)||void 0===t||t.parentDeps.delete(e)}removeAllDeps(){this.deps.forEach((e=>{this.removeDep(e)}))}addParentDep(e){e.module=this,this.parentDeps.add(e)}markError(e,t){this.errors.push({type:e,error:t})}serialize(){return{id:this.id,type:this.type,path:this.path,parentDeps:Array.from(this.parentDeps).sort(((e,t)=>e.originModule.id>t.originModule.id?1:-1)).map((e=>e.serialize())),deps:Array.from(this.deps).map((e=>e.serialize())),errors:this.errors.map((e=>({type:e.type,error:e.error instanceof Error?e.error.message:String(e.error)})))}}get childModules(){const e=[];for(const t of this.deps.values())t.module&&e.push(t.module);return e}findChild(e){var t;for(const s of this.deps.values())if((null===(t=s.module)||void 0===t?void 0:t.type)===e)return s.module;return null}findChildren(e){return this.childModules.filter((t=>t.type===e))}}var T;(T=exports.ModuleErrorType||(exports.ModuleErrorType={})).APP_JSON_NOT_FOUND="APP_JSON_NOT_FOUND",T.COMP_JSON_NOT_FOUND="COMP_JSON_NOT_FOUND",T.PLUGIN_JSON_NOT_FOUND="PLUGIN_JSON_NOT_FOUND",T.FILE_NOT_FOUND="FILE_NOT_FOUND",T.FILE_NOT_UTF8="FILE_NOT_UTF8",T.JSON_PARSE_ERR="JSON_PARSE_ERR",T.WXML_PARSE_ERR="WXML_PARSE_ERR",T.WXSS_PARSE_ERR="WXSS_PARSE_ERR",T.JS_PARSE_ERR="JS_PARSE_ERR",T.JS_RESOLVE_DEPENDENCY_ERR="JS_RESOLVE_DEPENDENCY_ERR",T.WORKER_DIR_NOT_EXIST="WORKER_DIR_NOT_EXIST";class D extends N{constructor(e,t){super(e,t),this.config=null}async build(e){let t=this.path.replace(/\.json$/,"");return this.addDep(new y("Wxml",t+".wxml",this,this.fileHelper,!1,!0)),this.addDep(new y("Js",t+".js",this,this.fileHelper,!1,!0)),this.addDep(new y("Wxss",t+".wxss",this,this.fileHelper,!1,!1)),this.fileHelper.existFile(this.path)&&await this.processJsonDeps(),Array.from(this.deps)}async loadJSON(e){const t=this.fileHelper;try{return await t.getJSON(e)}catch(e){this.markError(exports.ModuleErrorType.JSON_PARSE_ERR,e)}return null}async processJsonDeps(){let e=this.config=await this.loadJSON(this.path);e&&e.usingComponents&&Object.keys(e.usingComponents).forEach((t=>{let s=e.usingComponents[t],i=new b(t,s,this,this.fileHelper);this.addDep(i)}))}}var R={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},L="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",V={5:L,"5module":L+" export import",6:L+" const class extends export import super"},O=/^in(stanceof)?$/,M="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࣇऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-鿼ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-ꟊꟵ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",B="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿᫀᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",F=new RegExp("["+M+"]"),H=new RegExp("["+M+B+"]");M=B=null;var j=[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,157,310,10,21,11,7,153,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,107,20,28,22,13,52,76,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,85,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,230,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,35,56,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,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,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,8952,286,50,2,18,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,2357,44,11,6,17,0,370,43,1301,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,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938],q=[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,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,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,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,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,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239];function W(e,t){for(var s=65536,i=0;i<t.length;i+=2){if((s+=t[i])>e)return!1;if((s+=t[i+1])>=e)return!0}}function U(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&F.test(String.fromCharCode(e)):!1!==t&&W(e,j)))}function G(e,t){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&H.test(String.fromCharCode(e)):!1!==t&&(W(e,j)||W(e,q)))))}var J=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function z(e,t){return new J(e,{beforeExpr:!0,binop:t})}var $={beforeExpr:!0},K={startsExpr:!0},Q={};function X(e,t){return void 0===t&&(t={}),t.keyword=e,Q[e]=new J(e,t)}var Y={num:new J("num",K),regexp:new J("regexp",K),string:new J("string",K),name:new J("name",K),eof:new J("eof"),bracketL:new J("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new J("]"),braceL:new J("{",{beforeExpr:!0,startsExpr:!0}),braceR:new J("}"),parenL:new J("(",{beforeExpr:!0,startsExpr:!0}),parenR:new J(")"),comma:new J(",",$),semi:new J(";",$),colon:new J(":",$),dot:new J("."),question:new J("?",$),questionDot:new J("?."),arrow:new J("=>",$),template:new J("template"),invalidTemplate:new J("invalidTemplate"),ellipsis:new J("...",$),backQuote:new J("`",K),dollarBraceL:new J("${",{beforeExpr:!0,startsExpr:!0}),eq:new J("=",{beforeExpr:!0,isAssign:!0}),assign:new J("_=",{beforeExpr:!0,isAssign:!0}),incDec:new J("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new J("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:z("||",1),logicalAND:z("&&",2),bitwiseOR:z("|",3),bitwiseXOR:z("^",4),bitwiseAND:z("&",5),equality:z("==/!=/===/!==",6),relational:z("</>/<=/>=",7),bitShift:z("<</>>/>>>",8),plusMin:new J("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:z("%",10),star:z("*",10),slash:z("/",10),starstar:new J("**",{beforeExpr:!0}),coalesce:z("??",1),_break:X("break"),_case:X("case",$),_catch:X("catch"),_continue:X("continue"),_debugger:X("debugger"),_default:X("default",$),_do:X("do",{isLoop:!0,beforeExpr:!0}),_else:X("else",$),_finally:X("finally"),_for:X("for",{isLoop:!0}),_function:X("function",K),_if:X("if"),_return:X("return",$),_switch:X("switch"),_throw:X("throw",$),_try:X("try"),_var:X("var"),_const:X("const"),_while:X("while",{isLoop:!0}),_with:X("with"),_new:X("new",{beforeExpr:!0,startsExpr:!0}),_this:X("this",K),_super:X("super",K),_class:X("class",K),_extends:X("extends",$),_export:X("export"),_import:X("import",K),_null:X("null",K),_true:X("true",K),_false:X("false",K),_in:X("in",{beforeExpr:!0,binop:7}),_instanceof:X("instanceof",{beforeExpr:!0,binop:7}),_typeof:X("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:X("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:X("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},Z=/\r\n?|\n|\u2028|\u2029/,ee=new RegExp(Z.source,"g");function te(e,t){return 10===e||13===e||!t&&(8232===e||8233===e)}var se=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,ie=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,re=Object.prototype,ae=re.hasOwnProperty,ne=re.toString;function oe(e,t){return ae.call(e,t)}var he=Array.isArray||function(e){return"[object Array]"===ne.call(e)};function pe(e){return new RegExp("^(?:"+e.replace(/ /g,"|")+")$")}var le=function(e,t){this.line=e,this.column=t};le.prototype.offset=function(e){return new le(this.line,this.column+e)};var ce=function(e,t,s){this.start=t,this.end=s,null!==e.sourceFile&&(this.source=e.sourceFile)};function ue(e,t){for(var s=1,i=0;;){ee.lastIndex=i;var r=ee.exec(e);if(!(r&&r.index<t))return new le(s,t-i);++s,i=r.index+r[0].length}}var de={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:!1,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1,skipStatementPos:Number.POSITIVE_INFINITY},fe=!1;function me(e){var t={};for(var s in de)t[s]=e&&oe(e,s)?e[s]:de[s];if("latest"===t.ecmaVersion?t.ecmaVersion=1e8:null==t.ecmaVersion?(!fe&&"object"==typeof console&&console.warn&&(fe=!0,console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),he(t.onToken)){var i=t.onToken;t.onToken=function(e){return i.push(e)}}return he(t.onComment)&&(t.onComment=function(e,t){return function(s,i,r,a,n,o){var h={type:s?"Block":"Line",value:i,start:r,end:a};e.locations&&(h.loc=new ce(this,n,o)),e.ranges&&(h.range=[r,a]),t.push(h)}}(t,t.onComment)),t}function ge(e,t){return 2|(e?4:0)|(t?8:0)}var xe=function(e,t,s){this.options=e=me(e),this.sourceFile=e.sourceFile,this.keywords=pe(V[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var i="";!0!==e.allowReserved&&(i=R[e.ecmaVersion>=6?6:5===e.ecmaVersion?5:3],"module"===e.sourceType&&(i+=" await")),this.reservedWords=pe(i);var r=(i?i+" ":"")+R.strict;this.reservedWordsStrict=pe(r),this.reservedWordsStrictBind=pe(r+" "+R.strictBind),this.input=String(t),this.containsEsc=!1,s?(this.pos=s,this.lineStart=this.input.lastIndexOf("\n",s-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(Z).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=Y.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(1),this.regexpState=null},ye={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},inNonArrowFunction:{configurable:!0}};xe.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},ye.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},ye.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0},ye.inAsync.get=function(){return(4&this.currentVarScope().flags)>0},ye.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0},ye.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},ye.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},ye.inNonArrowFunction.get=function(){return(2&this.currentThisScope().flags)>0},xe.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var s=this,i=0;i<e.length;i++)s=e[i](s);return s},xe.parse=function(e,t){return new this(t,e).parse()},xe.parseExpressionAt=function(e,t,s){var i=new this(s,e,t);return i.nextToken(),i.parseExpression()},xe.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(xe.prototype,ye);var ke=xe.prototype,we=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;function ve(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}ke.strictDirective=function(e){for(;;){ie.lastIndex=e,e+=ie.exec(this.input)[0].length;var t=we.exec(this.input.slice(e));if(!t)return!1;if("use strict"===(t[1]||t[2])){ie.lastIndex=e+t[0].length;var s=ie.exec(this.input),i=s.index+s[0].length,r=this.input.charAt(i);return";"===r||"}"===r||Z.test(s[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(r)||"!"===r&&"="===this.input.charAt(i+1))}e+=t[0].length,ie.lastIndex=e,e+=ie.exec(this.input)[0].length,";"===this.input[e]&&e++}},ke.eat=function(e){return this.type===e&&(this.next(),!0)},ke.isContextual=function(e){return this.type===Y.name&&this.value===e&&!this.containsEsc},ke.eatContextual=function(e){return!!this.isContextual(e)&&(this.next(),!0)},ke.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},ke.canInsertSemicolon=function(){return this.type===Y.eof||this.type===Y.braceR||Z.test(this.input.slice(this.lastTokEnd,this.start))},ke.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},ke.semicolon=function(){this.eat(Y.semi)||this.insertSemicolon()||this.unexpected()},ke.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},ke.expect=function(e){this.eat(e)||this.unexpected()},ke.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")},ke.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var s=t?e.parenthesizedAssign:e.parenthesizedBind;s>-1&&this.raiseRecoverable(s,"Parenthesized pattern")}},ke.checkExpressionErrors=function(e,t){if(!e)return!1;var s=e.shorthandAssign,i=e.doubleProto;if(!t)return s>=0||i>=0;s>=0&&this.raise(s,"Shorthand property assignments are valid only in destructuring patterns"),i>=0&&this.raiseRecoverable(i,"Redefinition of __proto__ property")},ke.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},ke.isSimpleAssignTarget=function(e){return"ParenthesizedExpression"===e.type?this.isSimpleAssignTarget(e.expression):"Identifier"===e.type||"MemberExpression"===e.type};var be=xe.prototype;be.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==Y.eof&&this.start<=this.options.skipStatementPos;){var s=this.parseStatement(null,!0,t);e.body.push(s)}if(this.inModule)for(var i=0,r=Object.keys(this.undefinedExports);i<r.length;i+=1){var a=r[i];this.raiseRecoverable(this.undefinedExports[a].start,"Export '"+a+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,"Program")};var Ee={kind:"loop"},Se={kind:"switch"};be.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;ie.lastIndex=this.pos;var t=ie.exec(this.input),s=this.pos+t[0].length,i=this.input.charCodeAt(s);if(91===i)return!0;if(e)return!1;if(123===i)return!0;if(U(i,!0)){for(var r=s+1;G(this.input.charCodeAt(r),!0);)++r;var a=this.input.slice(s,r);if(!O.test(a))return!0}return!1},be.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;ie.lastIndex=this.pos;var e=ie.exec(this.input),t=this.pos+e[0].length;return!(Z.test(this.input.slice(this.pos,t))||"function"!==this.input.slice(t,t+8)||t+8!==this.input.length&&G(this.input.charAt(t+8)))},be.parseStatement=function(e,t,s){var i,r=this.type,a=this.startNode();switch(this.isLet(e)&&(r=Y._var,i="let"),r){case Y._break:case Y._continue:return this.parseBreakContinueStatement(a,r.keyword);case Y._debugger:return this.parseDebuggerStatement(a);case Y._do:return this.parseDoStatement(a);case Y._for:return this.parseForStatement(a);case Y._function:return e&&(this.strict||"if"!==e&&"label"!==e)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(a,!1,!e);case Y._class:return e&&this.unexpected(),this.parseClass(a,!0);case Y._if:return this.parseIfStatement(a);case Y._return:return this.parseReturnStatement(a);case Y._switch:return this.parseSwitchStatement(a);case Y._throw:return this.parseThrowStatement(a);case Y._try:return this.parseTryStatement(a);case Y._const:case Y._var:return i=i||this.value,e&&"var"!==i&&this.unexpected(),this.parseVarStatement(a,i);case Y._while:return this.parseWhileStatement(a);case Y._with:return this.parseWithStatement(a);case Y.braceL:return this.parseBlock(!0,a);case Y.semi:return this.parseEmptyStatement(a);case Y._export:case Y._import:if(this.options.ecmaVersion>10&&r===Y._import){ie.lastIndex=this.pos;var n=ie.exec(this.input),o=this.pos+n[0].length,h=this.input.charCodeAt(o);if(40===h||46===h)return this.parseExpressionStatement(a,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===Y._import?this.parseImport(a):this.parseExport(a,s);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(a,!0,!e);var p=this.value,l=this.parseExpression();return r===Y.name&&"Identifier"===l.type&&this.eat(Y.colon)?this.parseLabeledStatement(a,p,l,e):this.parseExpressionStatement(a,l)}},be.parseBreakContinueStatement=function(e,t){var s="break"===t;this.next(),this.eat(Y.semi)||this.insertSemicolon()?e.label=null:this.type!==Y.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var i=0;i<this.labels.length;++i){var r=this.labels[i];if(null==e.label||r.name===e.label.name){if(null!=r.kind&&(s||"loop"===r.kind))break;if(e.label&&s)break}}return i===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,s?"BreakStatement":"ContinueStatement")},be.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")},be.parseDoStatement=function(e){return this.next(),this.labels.push(Ee),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(Y._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(Y.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},be.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction)&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Ee),this.enterScope(0),this.expect(Y.parenL),this.type===Y.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var s=this.isLet();if(this.type===Y._var||this.type===Y._const||s){var i=this.startNode(),r=s?"let":this.value;return this.next(),this.parseVar(i,!0,r),this.finishNode(i,"VariableDeclaration"),(this.type===Y._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===i.declarations.length?(this.options.ecmaVersion>=9&&(this.type===Y._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,i)):(t>-1&&this.unexpected(t),this.parseFor(e,i))}var a=new ve,n=this.parseExpression(!0,a);return this.type===Y._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.options.ecmaVersion>=9&&(this.type===Y._in?t>-1&&this.unexpected(t):e.await=t>-1),this.toAssignable(n,!1,a),this.checkLValPattern(n),this.parseForIn(e,n)):(this.checkExpressionErrors(a,!0),t>-1&&this.unexpected(t),this.parseFor(e,n))},be.parseFunctionStatement=function(e,t,s){return this.next(),this.parseFunction(e,Ce|(s?0:Pe),!1,t)},be.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(Y._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},be.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(Y.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},be.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(Y.braceL),this.labels.push(Se),this.enterScope(0);for(var s=!1;this.type!==Y.braceR;)if(this.type===Y._case||this.type===Y._default){var i=this.type===Y._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),i?t.test=this.parseExpression():(s&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),s=!0,t.test=null),this.expect(Y.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},be.parseThrowStatement=function(e){return this.next(),Z.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var _e=[];be.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===Y._catch){var t=this.startNode();if(this.next(),this.eat(Y.parenL)){t.param=this.parseBindingAtom();var s="Identifier"===t.param.type;this.enterScope(s?32:0),this.checkLValPattern(t.param,s?4:2),this.expect(Y.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0);t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(Y._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},be.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},be.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Ee),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},be.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},be.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},be.parseLabeledStatement=function(e,t,s,i){for(var r=0,a=this.labels;r<a.length;r+=1){a[r].name===t&&this.raise(s.start,"Label '"+t+"' is already declared")}for(var n=this.type.isLoop?"loop":this.type===Y._switch?"switch":null,o=this.labels.length-1;o>=0;o--){var h=this.labels[o];if(h.statementStart!==e.start)break;h.statementStart=this.start,h.kind=n}return this.labels.push({name:t,kind:n,statementStart:this.start}),e.body=this.parseStatement(i?-1===i.indexOf("label")?i+"label":i:"label"),this.labels.pop(),e.label=s,this.finishNode(e,"LabeledStatement")},be.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},be.parseBlock=function(e,t,s){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect(Y.braceL),e&&this.enterScope(0);this.type!==Y.braceR;){var i=this.parseStatement(null);t.body.push(i)}return s&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},be.parseFor=function(e,t){return e.init=t,this.expect(Y.semi),e.test=this.type===Y.semi?null:this.parseExpression(),this.expect(Y.semi),e.update=this.type===Y.parenR?null:this.parseExpression(),this.expect(Y.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},be.parseForIn=function(e,t){var s=this.type===Y._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!s||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)&&this.raise(t.start,(s?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=s?this.parseExpression():this.parseMaybeAssign(),this.expect(Y.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,s?"ForInStatement":"ForOfStatement")},be.parseVar=function(e,t,s){for(e.declarations=[],e.kind=s;;){var i=this.startNode();if(this.parseVarId(i,s),this.eat(Y.eq)?i.init=this.parseMaybeAssign(t):"const"!==s||this.type===Y._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===i.id.type||t&&(this.type===Y._in||this.isContextual("of"))?i.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(i,"VariableDeclarator")),!this.eat(Y.comma))break}return e},be.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,"var"===t?1:2,!1)};var Ce=1,Pe=2;be.parseFunction=function(e,t,s,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!i)&&(this.type===Y.star&&t&Pe&&this.unexpected(),e.generator=this.eat(Y.star)),this.options.ecmaVersion>=8&&(e.async=!!i),t&Ce&&(e.id=4&t&&this.type!==Y.name?null:this.parseIdent(),!e.id||t&Pe||this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?1:2:3));var r=this.yieldPos,a=this.awaitPos,n=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ge(e.async,e.generator)),t&Ce||(e.id=this.type===Y.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,s,!1),this.yieldPos=r,this.awaitPos=a,this.awaitIdentPos=n,this.finishNode(e,t&Ce?"FunctionDeclaration":"FunctionExpression")},be.parseFunctionParams=function(e){this.expect(Y.parenL),e.params=this.parseBindingList(Y.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},be.parseClass=function(e,t){this.next();var s=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var i=this.startNode(),r=!1;for(i.body=[],this.expect(Y.braceL);this.type!==Y.braceR;){var a=this.parseClassElement(null!==e.superClass);a&&(i.body.push(a),"MethodDefinition"===a.type&&"constructor"===a.kind&&(r&&this.raise(a.start,"Duplicate constructor in the same class"),r=!0))}return this.strict=s,this.next(),e.body=this.finishNode(i,"ClassBody"),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},be.parseClassElement=function(e){var t=this;if(this.eat(Y.semi))return null;var s=this.startNode(),i=function(e,i){void 0===i&&(i=!1);var r=t.start,a=t.startLoc;return!!t.eatContextual(e)&&(!(t.type===Y.parenL||i&&t.canInsertSemicolon())||(s.key&&t.unexpected(),s.computed=!1,s.key=t.startNodeAt(r,a),s.key.name=e,t.finishNode(s.key,"Identifier"),!1))};s.kind="method",s.static=i("static");var r=this.eat(Y.star),a=!1;r||(this.options.ecmaVersion>=8&&i("async",!0)?(a=!0,r=this.options.ecmaVersion>=9&&this.eat(Y.star)):i("get")?s.kind="get":i("set")&&(s.kind="set")),s.key||this.parsePropertyName(s);var n=s.key,o=!1;return s.computed||s.static||!("Identifier"===n.type&&"constructor"===n.name||"Literal"===n.type&&"constructor"===n.value)?s.static&&"Identifier"===n.type&&"prototype"===n.name&&this.raise(n.start,"Classes may not have a static property named prototype"):("method"!==s.kind&&this.raise(n.start,"Constructor can't have get/set modifier"),r&&this.raise(n.start,"Constructor can't be a generator"),a&&this.raise(n.start,"Constructor can't be an async method"),s.kind="constructor",o=e),this.parseClassMethod(s,r,a,o),"get"===s.kind&&0!==s.value.params.length&&this.raiseRecoverable(s.value.start,"getter should have no params"),"set"===s.kind&&1!==s.value.params.length&&this.raiseRecoverable(s.value.start,"setter should have exactly one param"),"set"===s.kind&&"RestElement"===s.value.params[0].type&&this.raiseRecoverable(s.value.params[0].start,"Setter cannot use rest params"),s},be.parseClassMethod=function(e,t,s,i){return e.value=this.parseMethod(t,s,i),this.finishNode(e,"MethodDefinition")},be.parseClassId=function(e,t){this.type===Y.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,2,!1)):(!0===t&&this.unexpected(),e.id=null)},be.parseClassSuper=function(e){e.superClass=this.eat(Y._extends)?this.parseExprSubscripts():null},be.parseExport=function(e,t){if(this.next(),this.eat(Y.star))return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseIdent(!0),this.checkExport(t,e.exported.name,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==Y.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(Y._default)){var s;if(this.checkExport(t,"default",this.lastTokStart),this.type===Y._function||(s=this.isAsyncFunction())){var i=this.startNode();this.next(),s&&this.next(),e.declaration=this.parseFunction(i,4|Ce,!1,s)}else if(this.type===Y._class){var r=this.startNode();e.declaration=this.parseClass(r,"nullableID")}else e.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(null),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id.name,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==Y.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var a=0,n=e.specifiers;a<n.length;a+=1){var o=n[a];this.checkUnreserved(o.local),this.checkLocalExport(o.local)}e.source=null}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")},be.checkExport=function(e,t,s){e&&(oe(e,t)&&this.raiseRecoverable(s,"Duplicate export '"+t+"'"),e[t]=!0)},be.checkPatternExport=function(e,t){var s=t.type;if("Identifier"===s)this.checkExport(e,t.name,t.start);else if("ObjectPattern"===s)for(var i=0,r=t.properties;i<r.length;i+=1){var a=r[i];this.checkPatternExport(e,a)}else if("ArrayPattern"===s)for(var n=0,o=t.elements;n<o.length;n+=1){var h=o[n];h&&this.checkPatternExport(e,h)}else"Property"===s?this.checkPatternExport(e,t.value):"AssignmentPattern"===s?this.checkPatternExport(e,t.left):"RestElement"===s?this.checkPatternExport(e,t.argument):"ParenthesizedExpression"===s&&this.checkPatternExport(e,t.expression)},be.checkVariableExport=function(e,t){if(e)for(var s=0,i=t;s<i.length;s+=1){var r=i[s];this.checkPatternExport(e,r.id)}},be.shouldParseExportStatement=function(){return"var"===this.type.keyword||"const"===this.type.keyword||"class"===this.type.keyword||"function"===this.type.keyword||this.isLet()||this.isAsyncFunction()},be.parseExportSpecifiers=function(e){var t=[],s=!0;for(this.expect(Y.braceL);!this.eat(Y.braceR);){if(s)s=!1;else if(this.expect(Y.comma),this.afterTrailingComma(Y.braceR))break;var i=this.startNode();i.local=this.parseIdent(!0),i.exported=this.eatContextual("as")?this.parseIdent(!0):i.local,this.checkExport(e,i.exported.name,i.exported.start),t.push(this.finishNode(i,"ExportSpecifier"))}return t},be.parseImport=function(e){return this.next(),this.type===Y.string?(e.specifiers=_e,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===Y.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},be.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===Y.name){var s=this.startNode();if(s.local=this.parseIdent(),this.checkLValSimple(s.local,2),e.push(this.finishNode(s,"ImportDefaultSpecifier")),!this.eat(Y.comma))return e}if(this.type===Y.star){var i=this.startNode();return this.next(),this.expectContextual("as"),i.local=this.parseIdent(),this.checkLValSimple(i.local,2),e.push(this.finishNode(i,"ImportNamespaceSpecifier")),e}for(this.expect(Y.braceL);!this.eat(Y.braceR);){if(t)t=!1;else if(this.expect(Y.comma),this.afterTrailingComma(Y.braceR))break;var r=this.startNode();r.imported=this.parseIdent(!0),this.eatContextual("as")?r.local=this.parseIdent():(this.checkUnreserved(r.imported),r.local=r.imported),this.checkLValSimple(r.local,2),e.push(this.finishNode(r,"ImportSpecifier"))}return e},be.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},be.isDirectiveCandidate=function(e){return"ExpressionStatement"===e.type&&"Literal"===e.expression.type&&"string"==typeof e.expression.value&&('"'===this.input[e.start]||"'"===this.input[e.start])};var Ae=xe.prototype;Ae.toAssignable=function(e,t,s){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",s&&this.checkPatternErrors(s,!0);for(var i=0,r=e.properties;i<r.length;i+=1){var a=r[i];this.toAssignable(a,t),"RestElement"!==a.type||"ArrayPattern"!==a.argument.type&&"ObjectPattern"!==a.argument.type||this.raise(a.argument.start,"Unexpected token")}break;case"Property":"init"!==e.kind&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",s&&this.checkPatternErrors(s,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),"AssignmentPattern"===e.argument.type&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":"="!==e.operator&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,s);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else s&&this.checkPatternErrors(s,!0);return e},Ae.toAssignableList=function(e,t){for(var s=e.length,i=0;i<s;i++){var r=e[i];r&&this.toAssignable(r,t)}if(s){var a=e[s-1];6===this.options.ecmaVersion&&t&&a&&"RestElement"===a.type&&"Identifier"!==a.argument.type&&this.unexpected(a.argument.start)}return e},Ae.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")},Ae.parseRestBinding=function(){var e=this.startNode();return this.next(),6===this.options.ecmaVersion&&this.type!==Y.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")},Ae.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case Y.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(Y.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case Y.braceL:return this.parseObj(!0)}return this.parseIdent()},Ae.parseBindingList=function(e,t,s){for(var i=[],r=!0;!this.eat(e);)if(r?r=!1:this.expect(Y.comma),t&&this.type===Y.comma)i.push(null);else{if(s&&this.afterTrailingComma(e))break;if(this.type===Y.ellipsis){var a=this.parseRestBinding();this.parseBindingListItem(a),i.push(a),this.type===Y.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}var n=this.parseMaybeDefault(this.start,this.startLoc);this.parseBindingListItem(n),i.push(n)}return i},Ae.parseBindingListItem=function(e){return e},Ae.parseMaybeDefault=function(e,t,s){if(s=s||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(Y.eq))return s;var i=this.startNodeAt(e,t);return i.left=s,i.right=this.parseMaybeAssign(),this.finishNode(i,"AssignmentPattern")},Ae.checkLValSimple=function(e,t,s){void 0===t&&(t=0);var i=0!==t;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(i?"Binding ":"Assigning to ")+e.name+" in strict mode"),i&&(2===t&&"let"===e.name&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),s&&(oe(s,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),s[e.name]=!0),5!==t&&this.declareName(e.name,t,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":i&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return i&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,s);default:this.raise(e.start,(i?"Binding":"Assigning to")+" rvalue")}},Ae.checkLValPattern=function(e,t,s){switch(void 0===t&&(t=0),e.type){case"ObjectPattern":for(var i=0,r=e.properties;i<r.length;i+=1){var a=r[i];this.checkLValInnerPattern(a,t,s)}break;case"ArrayPattern":for(var n=0,o=e.elements;n<o.length;n+=1){var h=o[n];h&&this.checkLValInnerPattern(h,t,s)}break;default:this.checkLValSimple(e,t,s)}},Ae.checkLValInnerPattern=function(e,t,s){switch(void 0===t&&(t=0),e.type){case"Property":this.checkLValInnerPattern(e.value,t,s);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,s);break;case"RestElement":this.checkLValPattern(e.argument,t,s);break;default:this.checkLValPattern(e,t,s)}};var Ie=xe.prototype;Ie.checkPropClash=function(e,t,s){if(!(this.options.ecmaVersion>=9&&"SpreadElement"===e.type||this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var i,r=e.key;switch(r.type){case"Identifier":i=r.name;break;case"Literal":i=String(r.value);break;default:return}var a=e.kind;if(this.options.ecmaVersion>=6)"__proto__"===i&&"init"===a&&(t.proto&&(s?s.doubleProto<0&&(s.doubleProto=r.start):this.raiseRecoverable(r.start,"Redefinition of __proto__ property")),t.proto=!0);else{var n=t[i="$"+i];if(n)("init"===a?this.strict&&n.init||n.get||n.set:n.init||n[a])&&this.raiseRecoverable(r.start,"Redefinition of property");else n=t[i]={init:!1,get:!1,set:!1};n[a]=!0}}},Ie.parseExpression=function(e,t){var s=this.start,i=this.startLoc,r=this.parseMaybeAssign(e,t);if(this.type===Y.comma){var a=this.startNodeAt(s,i);for(a.expressions=[r];this.eat(Y.comma);)a.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(a,"SequenceExpression")}return r},Ie.parseMaybeAssign=function(e,t,s){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var i=!1,r=-1,a=-1;t?(r=t.parenthesizedAssign,a=t.trailingComma,t.parenthesizedAssign=t.trailingComma=-1):(t=new ve,i=!0);var n=this.start,o=this.startLoc;this.type!==Y.parenL&&this.type!==Y.name||(this.potentialArrowAt=this.start);var h=this.parseMaybeConditional(e,t);if(s&&(h=s.call(this,h,n,o)),this.type.isAssign){var p=this.startNodeAt(n,o);return p.operator=this.value,this.type===Y.eq&&(h=this.toAssignable(h,!1,t)),i||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=h.start&&(t.shorthandAssign=-1),this.type===Y.eq?this.checkLValPattern(h):this.checkLValSimple(h),p.left=h,this.next(),p.right=this.parseMaybeAssign(e),this.finishNode(p,"AssignmentExpression")}return i&&this.checkExpressionErrors(t,!0),r>-1&&(t.parenthesizedAssign=r),a>-1&&(t.trailingComma=a),h},Ie.parseMaybeConditional=function(e,t){var s=this.start,i=this.startLoc,r=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return r;if(this.eat(Y.question)){var a=this.startNodeAt(s,i);return a.test=r,a.consequent=this.parseMaybeAssign(),this.expect(Y.colon),a.alternate=this.parseMaybeAssign(e),this.finishNode(a,"ConditionalExpression")}return r},Ie.parseExprOps=function(e,t){var s=this.start,i=this.startLoc,r=this.parseMaybeUnary(t,!1);return this.checkExpressionErrors(t)||r.start===s&&"ArrowFunctionExpression"===r.type?r:this.parseExprOp(r,s,i,-1,e)},Ie.parseExprOp=function(e,t,s,i,r){var a=this.type.binop;if(null!=a&&(!r||this.type!==Y._in)&&a>i){var n=this.type===Y.logicalOR||this.type===Y.logicalAND,o=this.type===Y.coalesce;o&&(a=Y.logicalAND.binop);var h=this.value;this.next();var p=this.start,l=this.startLoc,c=this.parseExprOp(this.parseMaybeUnary(null,!1),p,l,a,r),u=this.buildBinary(t,s,e,c,h,n||o);return(n&&this.type===Y.coalesce||o&&(this.type===Y.logicalOR||this.type===Y.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(u,t,s,i,r)}return e},Ie.buildBinary=function(e,t,s,i,r,a){var n=this.startNodeAt(e,t);return n.left=s,n.operator=r,n.right=i,this.finishNode(n,a?"LogicalExpression":"BinaryExpression")},Ie.parseMaybeUnary=function(e,t){var s,i=this.start,r=this.startLoc;if(this.isContextual("await")&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction))s=this.parseAwait(),t=!0;else if(this.type.prefix){var a=this.startNode(),n=this.type===Y.incDec;a.operator=this.value,a.prefix=!0,this.next(),a.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(e,!0),n?this.checkLValSimple(a.argument):this.strict&&"delete"===a.operator&&"Identifier"===a.argument.type?this.raiseRecoverable(a.start,"Deleting local variable in strict mode"):t=!0,s=this.finishNode(a,n?"UpdateExpression":"UnaryExpression")}else{if(s=this.parseExprSubscripts(e),this.checkExpressionErrors(e))return s;for(;this.type.postfix&&!this.canInsertSemicolon();){var o=this.startNodeAt(i,r);o.operator=this.value,o.prefix=!1,o.argument=s,this.checkLValSimple(s),this.next(),s=this.finishNode(o,"UpdateExpression")}}return!t&&this.eat(Y.starstar)?this.buildBinary(i,r,s,this.parseMaybeUnary(null,!1),"**",!1):s},Ie.parseExprSubscripts=function(e){var t=this.start,s=this.startLoc,i=this.parseExprAtom(e);if("ArrowFunctionExpression"===i.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd))return i;var r=this.parseSubscripts(i,t,s);return e&&"MemberExpression"===r.type&&(e.parenthesizedAssign>=r.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=r.start&&(e.parenthesizedBind=-1)),r},Ie.parseSubscripts=function(e,t,s,i){for(var r=this.options.ecmaVersion>=8&&"Identifier"===e.type&&"async"===e.name&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start==5&&this.potentialArrowAt===e.start,a=!1;;){var n=this.parseSubscript(e,t,s,i,r,a);if(n.optional&&(a=!0),n===e||"ArrowFunctionExpression"===n.type){if(a){var o=this.startNodeAt(t,s);o.expression=n,n=this.finishNode(o,"ChainExpression")}return n}e=n}},Ie.parseSubscript=function(e,t,s,i,r,a){var n=this.options.ecmaVersion>=11,o=n&&this.eat(Y.questionDot);i&&o&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var h=this.eat(Y.bracketL);if(h||o&&this.type!==Y.parenL&&this.type!==Y.backQuote||this.eat(Y.dot)){var p=this.startNodeAt(t,s);p.object=e,p.property=h?this.parseExpression():this.parseIdent("never"!==this.options.allowReserved),p.computed=!!h,h&&this.expect(Y.bracketR),n&&(p.optional=o),e=this.finishNode(p,"MemberExpression")}else if(!i&&this.eat(Y.parenL)){var l=new ve,c=this.yieldPos,u=this.awaitPos,d=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var f=this.parseExprList(Y.parenR,this.options.ecmaVersion>=8,!1,l);if(r&&!o&&!this.canInsertSemicolon()&&this.eat(Y.arrow))return this.checkPatternErrors(l,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=c,this.awaitPos=u,this.awaitIdentPos=d,this.parseArrowExpression(this.startNodeAt(t,s),f,!0);this.checkExpressionErrors(l,!0),this.yieldPos=c||this.yieldPos,this.awaitPos=u||this.awaitPos,this.awaitIdentPos=d||this.awaitIdentPos;var m=this.startNodeAt(t,s);m.callee=e,m.arguments=f,n&&(m.optional=o),e=this.finishNode(m,"CallExpression")}else if(this.type===Y.backQuote){(o||a)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var g=this.startNodeAt(t,s);g.tag=e,g.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(g,"TaggedTemplateExpression")}return e},Ie.parseExprAtom=function(e){this.type===Y.slash&&this.readRegexp();var t,s=this.potentialArrowAt===this.start;switch(this.type){case Y._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),t=this.startNode(),this.next(),this.type!==Y.parenL||this.allowDirectSuper||this.raise(t.start,"super() call outside constructor of a subclass"),this.type!==Y.dot&&this.type!==Y.bracketL&&this.type!==Y.parenL&&this.unexpected(),this.finishNode(t,"Super");case Y._this:return t=this.startNode(),this.next(),this.finishNode(t,"ThisExpression");case Y.name:var i=this.start,r=this.startLoc,a=this.containsEsc,n=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!a&&"async"===n.name&&!this.canInsertSemicolon()&&this.eat(Y._function))return this.parseFunction(this.startNodeAt(i,r),0,!1,!0);if(s&&!this.canInsertSemicolon()){if(this.eat(Y.arrow))return this.parseArrowExpression(this.startNodeAt(i,r),[n],!1);if(this.options.ecmaVersion>=8&&"async"===n.name&&this.type===Y.name&&!a)return n=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(Y.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(i,r),[n],!0)}return n;case Y.regexp:var o=this.value;return(t=this.parseLiteral(o.value)).regex={pattern:o.pattern,flags:o.flags},t;case Y.num:case Y.string:return this.parseLiteral(this.value);case Y._null:case Y._true:case Y._false:return(t=this.startNode()).value=this.type===Y._null?null:this.type===Y._true,t.raw=this.type.keyword,this.next(),this.finishNode(t,"Literal");case Y.parenL:var h=this.start,p=this.parseParenAndDistinguishExpression(s);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(p)&&(e.parenthesizedAssign=h),e.parenthesizedBind<0&&(e.parenthesizedBind=h)),p;case Y.bracketL:return t=this.startNode(),this.next(),t.elements=this.parseExprList(Y.bracketR,!0,!0,e),this.finishNode(t,"ArrayExpression");case Y.braceL:return this.parseObj(!1,e);case Y._function:return t=this.startNode(),this.next(),this.parseFunction(t,0);case Y._class:return this.parseClass(this.startNode(),!1);case Y._new:return this.parseNew();case Y.backQuote:return this.parseTemplate();case Y._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}},Ie.parseExprImport=function(){var e=this.startNode();this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import");var t=this.parseIdent(!0);switch(this.type){case Y.parenL:return this.parseDynamicImport(e);case Y.dot:return e.meta=t,this.parseImportMeta(e);default:this.unexpected()}},Ie.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(Y.parenR)){var t=this.start;this.eat(Y.comma)&&this.eat(Y.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},Ie.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),"meta"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),"module"!==this.options.sourceType&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},Ie.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),110===t.raw.charCodeAt(t.raw.length-1)&&(t.bigint=t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")},Ie.parseParenExpression=function(){this.expect(Y.parenL);var e=this.parseExpression();return this.expect(Y.parenR),e},Ie.parseParenAndDistinguishExpression=function(e){var t,s=this.start,i=this.startLoc,r=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var a,n=this.start,o=this.startLoc,h=[],p=!0,l=!1,c=new ve,u=this.yieldPos,d=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==Y.parenR;){if(p?p=!1:this.expect(Y.comma),r&&this.afterTrailingComma(Y.parenR,!0)){l=!0;break}if(this.type===Y.ellipsis){a=this.start,h.push(this.parseParenItem(this.parseRestBinding())),this.type===Y.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}h.push(this.parseMaybeAssign(!1,c,this.parseParenItem))}var f=this.start,m=this.startLoc;if(this.expect(Y.parenR),e&&!this.canInsertSemicolon()&&this.eat(Y.arrow))return this.checkPatternErrors(c,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=u,this.awaitPos=d,this.parseParenArrowList(s,i,h);h.length&&!l||this.unexpected(this.lastTokStart),a&&this.unexpected(a),this.checkExpressionErrors(c,!0),this.yieldPos=u||this.yieldPos,this.awaitPos=d||this.awaitPos,h.length>1?((t=this.startNodeAt(n,o)).expressions=h,this.finishNodeAt(t,"SequenceExpression",f,m)):t=h[0]}else t=this.parseParenExpression();if(this.options.preserveParens){var g=this.startNodeAt(s,i);return g.expression=t,this.finishNode(g,"ParenthesizedExpression")}return t},Ie.parseParenItem=function(e){return e},Ie.parseParenArrowList=function(e,t,s){return this.parseArrowExpression(this.startNodeAt(e,t),s)};var Ne=[];Ie.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(Y.dot)){e.meta=t;var s=this.containsEsc;return e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),s&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.inNonArrowFunction||this.raiseRecoverable(e.start,"'new.target' can only be used in functions"),this.finishNode(e,"MetaProperty")}var i=this.start,r=this.startLoc,a=this.type===Y._import;return e.callee=this.parseSubscripts(this.parseExprAtom(),i,r,!0),a&&"ImportExpression"===e.callee.type&&this.raise(i,"Cannot use new with import()"),this.eat(Y.parenL)?e.arguments=this.parseExprList(Y.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Ne,this.finishNode(e,"NewExpression")},Ie.parseTemplateElement=function(e){var t=e.isTagged,s=this.startNode();return this.type===Y.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),s.value={raw:this.value,cooked:null}):s.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),s.tail=this.type===Y.backQuote,this.finishNode(s,"TemplateElement")},Ie.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var s=this.startNode();this.next(),s.expressions=[];var i=this.parseTemplateElement({isTagged:t});for(s.quasis=[i];!i.tail;)this.type===Y.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(Y.dollarBraceL),s.expressions.push(this.parseExpression()),this.expect(Y.braceR),s.quasis.push(i=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(s,"TemplateLiteral")},Ie.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===Y.name||this.type===Y.num||this.type===Y.string||this.type===Y.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===Y.star)&&!Z.test(this.input.slice(this.lastTokEnd,this.start))},Ie.parseObj=function(e,t){var s=this.startNode(),i=!0,r={};for(s.properties=[],this.next();!this.eat(Y.braceR);){if(i)i=!1;else if(this.expect(Y.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(Y.braceR))break;var a=this.parseProperty(e,t);e||this.checkPropClash(a,r,t),s.properties.push(a)}return this.finishNode(s,e?"ObjectPattern":"ObjectExpression")},Ie.parseProperty=function(e,t){var s,i,r,a,n=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(Y.ellipsis))return e?(n.argument=this.parseIdent(!1),this.type===Y.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(n,"RestElement")):(this.type===Y.parenL&&t&&(t.parenthesizedAssign<0&&(t.parenthesizedAssign=this.start),t.parenthesizedBind<0&&(t.parenthesizedBind=this.start)),n.argument=this.parseMaybeAssign(!1,t),this.type===Y.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(n,"SpreadElement"));this.options.ecmaVersion>=6&&(n.method=!1,n.shorthand=!1,(e||t)&&(r=this.start,a=this.startLoc),e||(s=this.eat(Y.star)));var o=this.containsEsc;return this.parsePropertyName(n),!e&&!o&&this.options.ecmaVersion>=8&&!s&&this.isAsyncProp(n)?(i=!0,s=this.options.ecmaVersion>=9&&this.eat(Y.star),this.parsePropertyName(n,t)):i=!1,this.parsePropertyValue(n,e,s,i,r,a,t,o),this.finishNode(n,"Property")},Ie.parsePropertyValue=function(e,t,s,i,r,a,n,o){if((s||i)&&this.type===Y.colon&&this.unexpected(),this.eat(Y.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,n),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===Y.parenL)t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(s,i);else if(t||o||!(this.options.ecmaVersion>=5)||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.type===Y.comma||this.type===Y.braceR||this.type===Y.eq)this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((s||i)&&this.unexpected(),this.checkUnreserved(e.key),"await"!==e.key.name||this.awaitIdentPos||(this.awaitIdentPos=r),e.kind="init",t?e.value=this.parseMaybeDefault(r,a,this.copyNode(e.key)):this.type===Y.eq&&n?(n.shorthandAssign<0&&(n.shorthandAssign=this.start),e.value=this.parseMaybeDefault(r,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected();else{(s||i)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var h="get"===e.kind?0:1;if(e.value.params.length!==h){var p=e.value.start;"get"===e.kind?this.raiseRecoverable(p,"getter should have no params"):this.raiseRecoverable(p,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")}},Ie.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(Y.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(Y.bracketR),e.key;e.computed=!1}return e.key=this.type===Y.num||this.type===Y.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},Ie.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},Ie.parseMethod=function(e,t,s){var i=this.startNode(),r=this.yieldPos,a=this.awaitPos,n=this.awaitIdentPos;return this.initFunction(i),this.options.ecmaVersion>=6&&(i.generator=e),this.options.ecmaVersion>=8&&(i.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|ge(t,i.generator)|(s?128:0)),this.expect(Y.parenL),i.params=this.parseBindingList(Y.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(i,!1,!0),this.yieldPos=r,this.awaitPos=a,this.awaitIdentPos=n,this.finishNode(i,"FunctionExpression")},Ie.parseArrowExpression=function(e,t,s){var i=this.yieldPos,r=this.awaitPos,a=this.awaitIdentPos;return this.enterScope(16|ge(s,!1)),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!s),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1),this.yieldPos=i,this.awaitPos=r,this.awaitIdentPos=a,this.finishNode(e,"ArrowFunctionExpression")},Ie.parseFunctionBody=function(e,t,s){var i=t&&this.type!==Y.braceL,r=this.strict,a=!1;if(i)e.body=this.parseMaybeAssign(),e.expression=!0,this.checkParams(e,!1);else{var n=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);r&&!n||(a=this.strictDirective(this.end))&&n&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list");var o=this.labels;this.labels=[],a&&(this.strict=!0),this.checkParams(e,!r&&!a&&!t&&!s&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,5),e.body=this.parseBlock(!1,void 0,a&&!r),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=o}this.exitScope()},Ie.isSimpleParamList=function(e){for(var t=0,s=e;t<s.length;t+=1){if("Identifier"!==s[t].type)return!1}return!0},Ie.checkParams=function(e,t){for(var s=Object.create(null),i=0,r=e.params;i<r.length;i+=1){var a=r[i];this.checkLValInnerPattern(a,1,t?null:s)}},Ie.parseExprList=function(e,t,s,i){for(var r=[],a=!0;!this.eat(e);){if(a)a=!1;else if(this.expect(Y.comma),t&&this.afterTrailingComma(e))break;var n=void 0;s&&this.type===Y.comma?n=null:this.type===Y.ellipsis?(n=this.parseSpread(i),i&&this.type===Y.comma&&i.trailingComma<0&&(i.trailingComma=this.start)):n=this.parseMaybeAssign(!1,i),r.push(n)}return r},Ie.checkUnreserved=function(e){var t=e.start,s=e.end,i=e.name;(this.inGenerator&&"yield"===i&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&"await"===i&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),this.keywords.test(i)&&this.raise(t,"Unexpected keyword '"+i+"'"),this.options.ecmaVersion<6&&-1!==this.input.slice(t,s).indexOf("\\"))||(this.strict?this.reservedWordsStrict:this.reservedWords).test(i)&&(this.inAsync||"await"!==i||this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+i+"' is reserved"))},Ie.parseIdent=function(e,t){var s=this.startNode();return this.type===Y.name?s.name=this.value:this.type.keyword?(s.name=this.type.keyword,"class"!==s.name&&"function"!==s.name||this.lastTokEnd===this.lastTokStart+1&&46===this.input.charCodeAt(this.lastTokStart)||this.context.pop()):this.unexpected(),this.next(!!e),this.finishNode(s,"Identifier"),e||(this.checkUnreserved(s),"await"!==s.name||this.awaitIdentPos||(this.awaitIdentPos=s.start)),s},Ie.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===Y.semi||this.canInsertSemicolon()||this.type!==Y.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(Y.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")},Ie.parseAwait=function(){this.awaitPos||(this.awaitPos=this.start);var e=this.startNode();return this.next(),e.argument=this.parseMaybeUnary(null,!0),this.finishNode(e,"AwaitExpression")};var Te=xe.prototype;Te.raise=function(e,t){var s=ue(this.input,e);t+=" ("+s.line+":"+s.column+")";var i=new SyntaxError(t);throw i.pos=e,i.loc=s,i.raisedAt=this.pos,i},Te.raiseRecoverable=Te.raise,Te.curPosition=function(){if(this.options.locations)return new le(this.curLine,this.pos-this.lineStart)};var De=xe.prototype,Re=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};De.enterScope=function(e){this.scopeStack.push(new Re(e))},De.exitScope=function(){this.scopeStack.pop()},De.treatFunctionsAsVarInScope=function(e){return 2&e.flags||!this.inModule&&1&e.flags},De.declareName=function(e,t,s){var i=!1;if(2===t){var r=this.currentScope();i=r.lexical.indexOf(e)>-1||r.functions.indexOf(e)>-1||r.var.indexOf(e)>-1,r.lexical.push(e),this.inModule&&1&r.flags&&delete this.undefinedExports[e]}else if(4===t){this.currentScope().lexical.push(e)}else if(3===t){var a=this.currentScope();i=this.treatFunctionsAsVar?a.lexical.indexOf(e)>-1:a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var n=this.scopeStack.length-1;n>=0;--n){var o=this.scopeStack[n];if(o.lexical.indexOf(e)>-1&&!(32&o.flags&&o.lexical[0]===e)||!this.treatFunctionsAsVarInScope(o)&&o.functions.indexOf(e)>-1){i=!0;break}if(o.var.push(e),this.inModule&&1&o.flags&&delete this.undefinedExports[e],3&o.flags)break}i&&this.raiseRecoverable(s,"Identifier '"+e+"' has already been declared")},De.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},De.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},De.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(3&t.flags)return t}},De.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(3&t.flags&&!(16&t.flags))return t}};var Le=function(e,t,s){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new ce(e,s)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},Ve=xe.prototype;function Oe(e,t,s,i){return e.type=t,e.end=s,this.options.locations&&(e.loc.end=i),this.options.ranges&&(e.range[1]=s),e}Ve.startNode=function(){return new Le(this,this.start,this.startLoc)},Ve.startNodeAt=function(e,t){return new Le(this,e,t)},Ve.finishNode=function(e,t){return Oe.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},Ve.finishNodeAt=function(e,t,s,i){return Oe.call(this,e,t,s,i)},Ve.copyNode=function(e){var t=new Le(this,e.start,this.startLoc);for(var s in e)t[s]=e[s];return t};var Me=function(e,t,s,i,r){this.token=e,this.isExpr=!!t,this.preserveSpace=!!s,this.override=i,this.generator=!!r},Be={b_stat:new Me("{",!1),b_expr:new Me("{",!0),b_tmpl:new Me("${",!1),p_stat:new Me("(",!1),p_expr:new Me("(",!0),q_tmpl:new Me("`",!0,!0,(function(e){return e.tryReadTemplateToken()})),f_stat:new Me("function",!1),f_expr:new Me("function",!0),f_expr_gen:new Me("function",!0,!1,null,!0),f_gen:new Me("function",!1,!1,null,!0)},Fe=xe.prototype;Fe.initialContext=function(){return[Be.b_stat]},Fe.braceIsBlock=function(e){var t=this.curContext();return t===Be.f_expr||t===Be.f_stat||(e!==Y.colon||t!==Be.b_stat&&t!==Be.b_expr?e===Y._return||e===Y.name&&this.exprAllowed?Z.test(this.input.slice(this.lastTokEnd,this.start)):e===Y._else||e===Y.semi||e===Y.eof||e===Y.parenR||e===Y.arrow||(e===Y.braceL?t===Be.b_stat:e!==Y._var&&e!==Y._const&&e!==Y.name&&!this.exprAllowed):!t.isExpr)},Fe.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if("function"===t.token)return t.generator}return!1},Fe.updateContext=function(e){var t,s=this.type;s.keyword&&e===Y.dot?this.exprAllowed=!1:(t=s.updateContext)?t.call(this,e):this.exprAllowed=s.beforeExpr},Y.parenR.updateContext=Y.braceR.updateContext=function(){if(1!==this.context.length){var e=this.context.pop();e===Be.b_stat&&"function"===this.curContext().token&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}else this.exprAllowed=!0},Y.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?Be.b_stat:Be.b_expr),this.exprAllowed=!0},Y.dollarBraceL.updateContext=function(){this.context.push(Be.b_tmpl),this.exprAllowed=!0},Y.parenL.updateContext=function(e){var t=e===Y._if||e===Y._for||e===Y._with||e===Y._while;this.context.push(t?Be.p_stat:Be.p_expr),this.exprAllowed=!0},Y.incDec.updateContext=function(){},Y._function.updateContext=Y._class.updateContext=function(e){!e.beforeExpr||e===Y._else||e===Y.semi&&this.curContext()!==Be.p_stat||e===Y._return&&Z.test(this.input.slice(this.lastTokEnd,this.start))||(e===Y.colon||e===Y.braceL)&&this.curContext()===Be.b_stat?this.context.push(Be.f_stat):this.context.push(Be.f_expr),this.exprAllowed=!1},Y.backQuote.updateContext=function(){this.curContext()===Be.q_tmpl?this.context.pop():this.context.push(Be.q_tmpl),this.exprAllowed=!1},Y.star.updateContext=function(e){if(e===Y._function){var t=this.context.length-1;this.context[t]===Be.f_expr?this.context[t]=Be.f_expr_gen:this.context[t]=Be.f_gen}this.exprAllowed=!0},Y.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==Y.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var He="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",je=He+" Extended_Pictographic",qe={9:He,10:je,11:je,12:"ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS Extended_Pictographic EBase EComp EMod EPres ExtPict"},We="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Ue="Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Ge=Ue+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Je=Ge+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",ze={9:Ue,10:Ge,11:Je,12:"Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi"},$e={};function Ke(e){var t=$e[e]={binary:pe(qe[e]+" "+We),nonBinary:{General_Category:pe(We),Script:pe(ze[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}Ke(9),Ke(10),Ke(11),Ke(12);var Qe=xe.prototype,Xe=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":""),this.unicodeProperties=$e[e.options.ecmaVersion>=12?12:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};function Ye(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function Ze(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function et(e){return e>=65&&e<=90||e>=97&&e<=122}function tt(e){return et(e)||95===e}function st(e){return tt(e)||it(e)}function it(e){return e>=48&&e<=57}function rt(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function at(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function nt(e){return e>=48&&e<=55}Xe.prototype.reset=function(e,t,s){var i=-1!==s.indexOf("u");this.start=0|e,this.source=t+"",this.flags=s,this.switchU=i&&this.parser.options.ecmaVersion>=6,this.switchN=i&&this.parser.options.ecmaVersion>=9},Xe.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},Xe.prototype.at=function(e,t){void 0===t&&(t=!1);var s=this.source,i=s.length;if(e>=i)return-1;var r=s.charCodeAt(e);if(!t&&!this.switchU||r<=55295||r>=57344||e+1>=i)return r;var a=s.charCodeAt(e+1);return a>=56320&&a<=57343?(r<<10)+a-56613888:r},Xe.prototype.nextIndex=function(e,t){void 0===t&&(t=!1);var s=this.source,i=s.length;if(e>=i)return i;var r,a=s.charCodeAt(e);return!t&&!this.switchU||a<=55295||a>=57344||e+1>=i||(r=s.charCodeAt(e+1))<56320||r>57343?e+1:e+2},Xe.prototype.current=function(e){return void 0===e&&(e=!1),this.at(this.pos,e)},Xe.prototype.lookahead=function(e){return void 0===e&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},Xe.prototype.advance=function(e){void 0===e&&(e=!1),this.pos=this.nextIndex(this.pos,e)},Xe.prototype.eat=function(e,t){return void 0===t&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},Qe.validateRegExpFlags=function(e){for(var t=e.validFlags,s=e.flags,i=0;i<s.length;i++){var r=s.charAt(i);-1===t.indexOf(r)&&this.raise(e.start,"Invalid regular expression flag"),s.indexOf(r,i+1)>-1&&this.raise(e.start,"Duplicate regular expression flag")}},Qe.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))},Qe.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,s=e.backReferenceNames;t<s.length;t+=1){var i=s[t];-1===e.groupNames.indexOf(i)&&e.raise("Invalid named capture referenced")}},Qe.regexp_disjunction=function(e){for(this.regexp_alternative(e);e.eat(124);)this.regexp_alternative(e);this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")},Qe.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},Qe.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):!!(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))&&(this.regexp_eatQuantifier(e),!0)},Qe.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var s=!1;if(this.options.ecmaVersion>=9&&(s=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!s,!0}return e.pos=t,!1},Qe.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},Qe.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},Qe.regexp_eatBracedQuantifier=function(e,t){var s=e.pos;if(e.eat(123)){var i=0,r=-1;if(this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue),e.eat(125)))return-1!==r&&r<i&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=s}return!1},Qe.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},Qe.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},Qe.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)&&e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}e.pos=t}return!1},Qe.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):63===e.current()&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},Qe.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},Qe.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},Qe.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!Ze(t)&&(e.lastIntValue=t,e.advance(),!0)},Qe.regexp_eatPatternCharacters=function(e){for(var t=e.pos,s=0;-1!==(s=e.current())&&!Ze(s);)e.advance();return e.pos!==t},Qe.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return!(-1===t||36===t||t>=40&&t<=43||46===t||63===t||91===t||94===t||124===t)&&(e.advance(),!0)},Qe.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e))return-1!==e.groupNames.indexOf(e.lastStringValue)&&e.raise("Duplicate capture group name"),void e.groupNames.push(e.lastStringValue);e.raise("Invalid group")}},Qe.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1},Qe.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=Ye(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=Ye(e.lastIntValue);return!0}return!1},Qe.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,s=this.options.ecmaVersion>=11,i=e.current(s);return e.advance(s),92===i&&this.regexp_eatRegExpUnicodeEscapeSequence(e,s)&&(i=e.lastIntValue),function(e){return U(e,!0)||36===e||95===e}(i)?(e.lastIntValue=i,!0):(e.pos=t,!1)},Qe.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,s=this.options.ecmaVersion>=11,i=e.current(s);return e.advance(s),92===i&&this.regexp_eatRegExpUnicodeEscapeSequence(e,s)&&(i=e.lastIntValue),function(e){return G(e,!0)||36===e||95===e||8204===e||8205===e}(i)?(e.lastIntValue=i,!0):(e.pos=t,!1)},Qe.regexp_eatAtomEscape=function(e){return!!(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))||(e.switchU&&(99===e.current()&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},Qe.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var s=e.lastIntValue;if(e.switchU)return s>e.maxBackReference&&(e.maxBackReference=s),!0;if(s<=e.numCapturingParens)return!0;e.pos=t}return!1},Qe.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},Qe.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},Qe.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},Qe.regexp_eatZero=function(e){return 48===e.current()&&!it(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},Qe.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},Qe.regexp_eatControlLetter=function(e){var t=e.current();return!!et(t)&&(e.lastIntValue=t%32,e.advance(),!0)},Qe.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){void 0===t&&(t=!1);var s,i=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var a=e.lastIntValue;if(r&&a>=55296&&a<=56319){var n=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=1024*(a-55296)+(o-56320)+65536,!0}e.pos=n,e.lastIntValue=a}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&((s=e.lastIntValue)>=0&&s<=1114111))return!0;r&&e.raise("Invalid unicode escape"),e.pos=i}return!1},Qe.regexp_eatIdentityEscape=function(e){if(e.switchU)return!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return!(99===t||e.switchN&&107===t)&&(e.lastIntValue=t,e.advance(),!0)},Qe.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48),e.advance()}while((t=e.current())>=48&&t<=57);return!0}return!1},Qe.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(function(e){return 100===e||68===e||115===e||83===e||119===e||87===e}(t))return e.lastIntValue=-1,e.advance(),!0;if(e.switchU&&this.options.ecmaVersion>=9&&(80===t||112===t)){if(e.lastIntValue=-1,e.advance(),e.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(e)&&e.eat(125))return!0;e.raise("Invalid property name")}return!1},Qe.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var s=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,s,i),!0}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,r),!0}return!1},Qe.regexp_validateUnicodePropertyNameAndValue=function(e,t,s){oe(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(s)||e.raise("Invalid property value")},Qe.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")},Qe.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";tt(t=e.current());)e.lastStringValue+=Ye(t),e.advance();return""!==e.lastStringValue},Qe.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";st(t=e.current());)e.lastStringValue+=Ye(t),e.advance();return""!==e.lastStringValue},Qe.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},Qe.regexp_eatCharacterClass=function(e){if(e.eat(91)){if(e.eat(94),this.regexp_classRanges(e),e.eat(93))return!0;e.raise("Unterminated character class")}return!1},Qe.regexp_classRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var s=e.lastIntValue;!e.switchU||-1!==t&&-1!==s||e.raise("Invalid character class"),-1!==t&&-1!==s&&t>s&&e.raise("Range out of order in character class")}}},Qe.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var s=e.current();(99===s||nt(s))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var i=e.current();return 93!==i&&(e.lastIntValue=i,e.advance(),!0)},Qe.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},Qe.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!it(t)&&95!==t)&&(e.lastIntValue=t%32,e.advance(),!0)},Qe.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1},Qe.regexp_eatDecimalDigits=function(e){var t=e.pos,s=0;for(e.lastIntValue=0;it(s=e.current());)e.lastIntValue=10*e.lastIntValue+(s-48),e.advance();return e.pos!==t},Qe.regexp_eatHexDigits=function(e){var t=e.pos,s=0;for(e.lastIntValue=0;rt(s=e.current());)e.lastIntValue=16*e.lastIntValue+at(s),e.advance();return e.pos!==t},Qe.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var s=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*s+e.lastIntValue:e.lastIntValue=8*t+s}else e.lastIntValue=t;return!0}return!1},Qe.regexp_eatOctalDigit=function(e){var t=e.current();return nt(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},Qe.regexp_eatFixedHexDigits=function(e,t){var s=e.pos;e.lastIntValue=0;for(var i=0;i<t;++i){var r=e.current();if(!rt(r))return e.pos=s,!1;e.lastIntValue=16*e.lastIntValue+at(r),e.advance()}return!0};var ot=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new ce(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},ht=xe.prototype;function pt(e){return"function"!=typeof BigInt?null:BigInt(e.replace(/_/g,""))}function lt(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}ht.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new ot(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},ht.getToken=function(){return this.next(),new ot(this)},"undefined"!=typeof Symbol&&(ht[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===Y.eof,value:t}}}}),ht.curContext=function(){return this.context[this.context.length-1]},ht.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(Y.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},ht.readToken=function(e){return U(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},ht.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);return e<=55295||e>=57344?e:(e<<10)+this.input.charCodeAt(this.pos+1)-56613888},ht.skipBlockComment=function(){var e,t=this.options.onComment&&this.curPosition(),s=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(-1===i&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(ee.lastIndex=s;(e=ee.exec(this.input))&&e.index<this.pos;)++this.curLine,this.lineStart=e.index+e[0].length;this.options.onComment&&this.options.onComment(!0,this.input.slice(s+2,i),s,this.pos,t,this.curPosition())},ht.skipLineComment=function(e){for(var t=this.pos,s=this.options.onComment&&this.curPosition(),i=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!te(i);)i=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,s,this.curPosition())},ht.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:10===this.input.charCodeAt(this.pos+1)&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(!(e>8&&e<14||e>=5760&&se.test(String.fromCharCode(e))))break e;++this.pos}}},ht.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var s=this.type;this.type=e,this.value=t,this.updateContext(s)},ht.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(Y.ellipsis)):(++this.pos,this.finishToken(Y.dot))},ht.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(Y.assign,2):this.finishOp(Y.slash,1)},ht.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),s=1,i=42===e?Y.star:Y.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++s,i=Y.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(Y.assign,s+1):this.finishOp(i,s)},ht.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(Y.assign,3);return this.finishOp(124===e?Y.logicalOR:Y.logicalAND,2)}return 61===t?this.finishOp(Y.assign,2):this.finishOp(124===e?Y.bitwiseOR:Y.bitwiseAND,1)},ht.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(Y.assign,2):this.finishOp(Y.bitwiseXOR,1)},ht.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45!==t||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!Z.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(Y.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(Y.assign,2):this.finishOp(Y.plusMin,1)},ht.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),s=1;return t===e?(s=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+s)?this.finishOp(Y.assign,s+1):this.finishOp(Y.bitShift,s)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(s=2),this.finishOp(Y.relational,s)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},ht.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(Y.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(Y.arrow)):this.finishOp(61===e?Y.eq:Y.prefix,1)},ht.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(46===t){var s=this.input.charCodeAt(this.pos+2);if(s<48||s>57)return this.finishOp(Y.questionDot,2)}if(63===t){if(e>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(Y.assign,3);return this.finishOp(Y.coalesce,2)}}return this.finishOp(Y.question,1)},ht.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(Y.parenL);case 41:return++this.pos,this.finishToken(Y.parenR);case 59:return++this.pos,this.finishToken(Y.semi);case 44:return++this.pos,this.finishToken(Y.comma);case 91:return++this.pos,this.finishToken(Y.bracketL);case 93:return++this.pos,this.finishToken(Y.bracketR);case 123:return++this.pos,this.finishToken(Y.braceL);case 125:return++this.pos,this.finishToken(Y.braceR);case 58:return++this.pos,this.finishToken(Y.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(Y.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(Y.prefix,1)}this.raise(this.pos,"Unexpected character '"+lt(e)+"'")},ht.finishOp=function(e,t){var s=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,s)},ht.readRegexp=function(){for(var e,t,s=this.pos;;){this.pos>=this.input.length&&this.raise(s,"Unterminated regular expression");var i=this.input.charAt(this.pos);if(Z.test(i)&&this.raise(s,"Unterminated regular expression"),e)e=!1;else{if("["===i)t=!0;else if("]"===i&&t)t=!1;else if("/"===i&&!t)break;e="\\"===i}++this.pos}var r=this.input.slice(s,this.pos);++this.pos;var a=this.pos,n=this.readWord1();this.containsEsc&&this.unexpected(a);var o=this.regexpState||(this.regexpState=new Xe(this));o.reset(s,r,n),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var h=null;try{h=new RegExp(r,n)}catch(e){}return this.finishToken(Y.regexp,{pattern:r,flags:n,value:h})},ht.readInt=function(e,t,s){for(var i=this.options.ecmaVersion>=12&&void 0===t,r=s&&48===this.input.charCodeAt(this.pos),a=this.pos,n=0,o=0,h=0,p=null==t?1/0:t;h<p;++h,++this.pos){var l=this.input.charCodeAt(this.pos),c=void 0;if(i&&95===l)r&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),95===o&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),0===h&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),o=l;else{if((c=l>=97?l-97+10:l>=65?l-65+10:l>=48&&l<=57?l-48:1/0)>=e)break;o=l,n=n*e+c}}return i&&95===o&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===a||null!=t&&this.pos-a!==t?null:n},ht.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var s=this.readInt(e);return null==s&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(s=pt(this.input.slice(t,this.pos)),++this.pos):U(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(Y.num,s)},ht.readNumber=function(e){var t=this.pos;e||null!==this.readInt(10,void 0,!0)||this.raise(t,"Invalid number");var s=this.pos-t>=2&&48===this.input.charCodeAt(t);s&&this.strict&&this.raise(t,"Invalid number");var i=this.input.charCodeAt(this.pos);if(!s&&!e&&this.options.ecmaVersion>=11&&110===i){var r=pt(this.input.slice(t,this.pos));return++this.pos,U(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(Y.num,r)}s&&/[89]/.test(this.input.slice(t,this.pos))&&(s=!1),46!==i||s||(++this.pos,this.readInt(10),i=this.input.charCodeAt(this.pos)),69!==i&&101!==i||s||(43!==(i=this.input.charCodeAt(++this.pos))&&45!==i||++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number")),U(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var a,n=(a=this.input.slice(t,this.pos),s?parseInt(a,8):parseFloat(a.replace(/_/g,"")));return this.finishToken(Y.num,n)},ht.readCodePoint=function(){var e;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e},ht.readString=function(e){for(var t="",s=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var i=this.input.charCodeAt(this.pos);if(i===e)break;92===i?(t+=this.input.slice(s,this.pos),t+=this.readEscapedChar(!1),s=this.pos):(te(i,this.options.ecmaVersion>=10)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(s,this.pos++),this.finishToken(Y.string,t)};var ct={};ht.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==ct)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},ht.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw ct;this.raise(e,t)},ht.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var s=this.input.charCodeAt(this.pos);if(96===s||36===s&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==Y.template&&this.type!==Y.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(Y.template,e)):36===s?(this.pos+=2,this.finishToken(Y.dollarBraceL)):(++this.pos,this.finishToken(Y.backQuote));if(92===s)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(te(s)){switch(e+=this.input.slice(t,this.pos),++this.pos,s){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(s)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},ht.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if("{"!==this.input[this.pos+1])break;case"`":return this.finishToken(Y.invalidTemplate,this.input.slice(this.start,this.pos))}this.raise(this.start,"Unterminated template")},ht.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return lt(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var s=this.pos-1;return this.invalidStringToken(s,"Invalid escape sequence in template string"),null}default:if(t>=48&&t<=55){var i=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],r=parseInt(i,8);return r>255&&(i=i.slice(0,-1),r=parseInt(i,8)),this.pos+=i.length-1,t=this.input.charCodeAt(this.pos),"0"===i&&56!==t&&57!==t||!this.strict&&!e||this.invalidStringToken(this.pos-1-i.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(r)}return te(t)?"":String.fromCharCode(t)}},ht.readHexChar=function(e){var t=this.pos,s=this.readInt(16,e);return null===s&&this.invalidStringToken(t,"Bad character escape sequence"),s},ht.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,s=this.pos,i=this.options.ecmaVersion>=6;this.pos<this.input.length;){var r=this.fullCharCodeAtPos();if(G(r,i))this.pos+=r<=65535?1:2;else{if(92!==r)break;this.containsEsc=!0,e+=this.input.slice(s,this.pos);var a=this.pos;117!==this.input.charCodeAt(++this.pos)&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var n=this.readCodePoint();(t?U:G)(n,i)||this.invalidStringToken(a,"Invalid Unicode escape"),e+=lt(n),s=this.pos}t=!1}return e+this.input.slice(s,this.pos)},ht.readWord=function(){var e=this.readWord1(),t=Y.name;return this.keywords.test(e)&&(t=Q[e]),this.finishToken(t,e)};function ut(e,t){return xe.parse(e,t)}xe.acorn={Parser:xe,version:"8.0.4",defaultOptions:de,Position:le,SourceLocation:ce,getLineInfo:ue,Node:Le,TokenType:J,tokTypes:Y,keywordTypes:Q,TokContext:Me,tokContexts:Be,isIdentifierChar:G,isIdentifierStart:U,Token:ot,isNewLine:te,lineBreak:Z,lineBreakG:ee,nonASCIIwhitespace:se};const dt={},ft={};class mt{constructor(e){this.stack=void 0===e?[]:e.slice(),this.map=new Map,this.stack.push(this.map)}add(e){this.map.set(e,!0)}set(e,t){this.map.set(e,void 0===t?ft:t)}delete(e){this.stack.length>1?this.map.set(e,dt):this.map.delete(e)}has(e){const t=this.map.get(e);if(void 0!==t)return t!==dt;if(this.stack.length>1){for(var s=this.stack.length-2;s>=0;s--){const t=this.stack[s].get(e);if(void 0!==t)return this.map.set(e,t),t!==dt}this.map.set(e,dt)}return!1}get(e){const t=this.map.get(e);if(void 0!==t)return t===dt||t===ft?void 0:t;if(this.stack.length>1){for(var s=this.stack.length-2;s>=0;s--){const t=this.stack[s].get(e);if(void 0!==t)return this.map.set(e,t),t===dt||t===ft?void 0:t}this.map.set(e,dt)}}_compress(){if(1!==this.stack.length){this.map=new Map;for(const e of this.stack)for(const t of e)t[1]===dt?this.map.delete(t[0]):this.map.set(t[0],t[1]);this.stack=[this.map]}}asArray(){return this._compress(),Array.from(this.map.entries(),(e=>e[0]))}asSet(){return new Set(this.asArray())}asPairArray(){return this._compress(),Array.from(this.map.entries(),(e=>e[1]===ft?[e[0],void 0]:e))}asMap(){return new Map(this.asPairArray())}get size(){return this._compress(),this.map.size}createChild(){return new mt(this.stack)}get length(){throw new Error("This is no longer an Array")}set length(e){throw new Error("This is no longer an Array")}}const gt=e=>e.replace(/[-[\]\\/{}()*+?.^$|]/g,"\\$&"),xt=e=>{const t=e.lastIndexOf("/");let s=".";return t>=0&&(s=e.substr(0,t),e=`.${e.substr(t)}`),{context:s,prefix:e}},yt=e=>{const t=e.indexOf("?");let s="";return t>=0&&(s=e.substr(t),e=e.substr(0,t)),{postfix:e,query:s}};class kt{constructor(){this.type=0,this.range=null,this.falsy=!1,this.truthy=!1,this.bool=null,this.number=null,this.regExp=null,this.string=null,this.quasis=null,this.parts=null,this.array=null,this.items=null,this.options=null,this.prefix=null,this.postfix=null,this.wrappedInnerExpressions=null,this.expression=null}isNull(){return 1===this.type}isString(){return 2===this.type}isNumber(){return 3===this.type}isBoolean(){return 4===this.type}isRegExp(){return 5===this.type}isConditional(){return 6===this.type}isArray(){return 7===this.type}isConstArray(){return 8===this.type}isIdentifier(){return 9===this.type}isWrapped(){return 10===this.type}isTemplateString(){return 11===this.type}isTruthy(){return this.truthy}isFalsy(){return this.falsy}asBool(){if(this.truthy)return!0;if(this.falsy)return!1;if(this.isBoolean())return this.bool;if(this.isNull())return!1;if(this.isString())return""!==this.string;if(this.isNumber())return 0!==this.number;if(this.isRegExp())return!0;if(this.isArray())return!0;if(this.isConstArray())return!0;if(this.isWrapped())return!!(this.prefix&&this.prefix.asBool()||this.postfix&&this.postfix.asBool())||void 0;if(this.isTemplateString()){const e=this.asString();if("string"==typeof e)return""!==e}}asString(){if(this.isBoolean())return`${this.bool}`;if(this.isNull())return"null";if(this.isString())return this.string;if(this.isNumber())return`${this.number}`;if(this.isRegExp())return`${this.regExp}`;if(this.isArray()){let e=[];for(const t of this.items){const s=t.asString();if(void 0===s)return;e.push(s)}return`${e}`}if(this.isConstArray())return`${this.array}`;if(this.isTemplateString()){let e="";for(const t of this.parts){const s=t.asString();if(void 0===s)return;e+=s}return e}}setString(e){return this.type=2,this.string=e,this}setNull(){return this.type=1,this}setNumber(e){return this.type=3,this.number=e,this}setBoolean(e){return this.type=4,this.bool=e,this}setRegExp(e){return this.type=5,this.regExp=e,this}setIdentifier(e){return this.type=9,this.identifier=e,this}setWrapped(e,t,s){return this.type=10,this.prefix=e,this.postfix=t,this.wrappedInnerExpressions=s,this}setOptions(e){return this.type=6,this.options=e,this}addOptions(e){this.options||(this.type=6,this.options=[]);for(const t of e)this.options.push(t);return this}setItems(e){return this.type=7,this.items=e,this}setArray(e){return this.type=8,this.array=e,this}setTemplateString(e,t,s){return this.type=11,this.quasis=e,this.parts=t,this.templateStringKind=s,this}setTruthy(){return this.falsy=!1,this.truthy=!0,this}setFalsy(){return this.falsy=!0,this.truthy=!1,this}setRange(e){return this.range=e,this}setExpression(e){return this.expression=e,this}}const wt=(e,t)=>t?e?[e[0],t[1]]:t:e;class vt{constructor(e){this.parser=e,this.hooks={evaluateTypeof:{},evaluate:{}},this.initializeEvaluating()}initializeEvaluating(){this.hooks.evaluate.Literal=e=>{switch(typeof e.value){case"number":return(new kt).setNumber(e.value).setRange(e.range);case"string":return(new kt).setString(e.value).setRange(e.range);case"boolean":return(new kt).setBoolean(e.value).setRange(e.range)}return null===e.value?(new kt).setNull().setRange(e.range):e.value instanceof RegExp?(new kt).setRegExp(e.value).setRange(e.range):void 0},this.hooks.evaluate.LogicalExpression=e=>{let t,s,i;if("&&"===e.operator){if(t=this.evaluateExpression(e.left),s=t&&t.asBool(),!1===s)return t.setRange(e.range);if(!0!==s)return;return i=this.evaluateExpression(e.right),i.setRange(e.range)}if("||"===e.operator){if(t=this.evaluateExpression(e.left),s=t&&t.asBool(),!0===s)return t.setRange(e.range);if(!1!==s)return;return i=this.evaluateExpression(e.right),i.setRange(e.range)}},this.hooks.evaluate.BinaryExpression=e=>{let t,s,i;if("+"===e.operator){if(t=this.evaluateExpression(e.left),s=this.evaluateExpression(e.right),!t||!s)return;if(i=new kt,t.isString())s.isString()?i.setString(t.string+s.string):s.isNumber()?i.setString(t.string+s.number):s.isWrapped()&&s.prefix&&s.prefix.isString()?i.setWrapped((new kt).setString(t.string+s.prefix.string).setRange(wt(t.range,s.prefix.range)),s.postfix,s.wrappedInnerExpressions):s.isWrapped()?i.setWrapped(t,s.postfix,s.wrappedInnerExpressions):i.setWrapped(t,null,[s]);else if(t.isNumber())if(s.isString())i.setString(t.number+s.string);else{if(!s.isNumber())return;i.setNumber(t.number+s.number)}else if(t.isWrapped())t.postfix&&t.postfix.isString()&&s.isString()?i.setWrapped(t.prefix,(new kt).setString(t.postfix.string+s.string).setRange(wt(t.postfix.range,s.range)),t.wrappedInnerExpressions):t.postfix&&t.postfix.isString()&&s.isNumber()?i.setWrapped(t.prefix,(new kt).setString(t.postfix.string+s.number).setRange(wt(t.postfix.range,s.range)),t.wrappedInnerExpressions):s.isString()?i.setWrapped(t.prefix,s,t.wrappedInnerExpressions):s.isNumber()?i.setWrapped(t.prefix,(new kt).setString(s.number+"").setRange(s.range),t.wrappedInnerExpressions):s.isWrapped()?i.setWrapped(t.prefix,s.postfix,t.wrappedInnerExpressions&&s.wrappedInnerExpressions&&t.wrappedInnerExpressions.concat(t.postfix?[t.postfix]:[]).concat(s.prefix?[s.prefix]:[]).concat(s.wrappedInnerExpressions)):i.setWrapped(t.prefix,null,t.wrappedInnerExpressions&&t.wrappedInnerExpressions.concat(t.postfix?[t.postfix,s]:[s]));else if(s.isString())i.setWrapped(null,s,[t]);else{if(!s.isWrapped())return;i.setWrapped(null,s.postfix,s.wrappedInnerExpressions&&(s.prefix?[t,s.prefix]:[t]).concat(s.wrappedInnerExpressions))}return i.setRange(e.range),i}if("-"===e.operator){if(t=this.evaluateExpression(e.left),s=this.evaluateExpression(e.right),!t||!s)return;if(!t.isNumber()||!s.isNumber())return;return i=new kt,i.setNumber(t.number-s.number),i.setRange(e.range),i}if("*"===e.operator){if(t=this.evaluateExpression(e.left),s=this.evaluateExpression(e.right),!t||!s)return;if(!t.isNumber()||!s.isNumber())return;return i=new kt,i.setNumber(t.number*s.number),i.setRange(e.range),i}if("/"===e.operator){if(t=this.evaluateExpression(e.left),s=this.evaluateExpression(e.right),!t||!s)return;if(!t.isNumber()||!s.isNumber())return;return i=new kt,i.setNumber(t.number/s.number),i.setRange(e.range),i}if("**"===e.operator){if(t=this.evaluateExpression(e.left),s=this.evaluateExpression(e.right),!t||!s)return;if(!t.isNumber()||!s.isNumber())return;return i=new kt,i.setNumber(Math.pow(t.number,s.number)),i.setRange(e.range),i}if("=="===e.operator||"==="===e.operator){if(t=this.evaluateExpression(e.left),s=this.evaluateExpression(e.right),!t||!s)return;if(i=new kt,i.setRange(e.range),t.isString()&&s.isString())return i.setBoolean(t.string===s.string);if(t.isNumber()&&s.isNumber())return i.setBoolean(t.number===s.number);if(t.isBoolean()&&s.isBoolean())return i.setBoolean(t.bool===s.bool)}else if("!="===e.operator||"!=="===e.operator){if(t=this.evaluateExpression(e.left),s=this.evaluateExpression(e.right),!t||!s)return;if(i=new kt,i.setRange(e.range),t.isString()&&s.isString())return i.setBoolean(t.string!==s.string);if(t.isNumber()&&s.isNumber())return i.setBoolean(t.number!==s.number);if(t.isBoolean()&&s.isBoolean())return i.setBoolean(t.bool!==s.bool)}else{if("&"===e.operator){if(t=this.evaluateExpression(e.left),s=this.evaluateExpression(e.right),!t||!s)return;if(!t.isNumber()||!s.isNumber())return;return i=new kt,i.setNumber(t.number&s.number),i.setRange(e.range),i}if("|"===e.operator){if(t=this.evaluateExpression(e.left),s=this.evaluateExpression(e.right),!t||!s)return;if(!t.isNumber()||!s.isNumber())return;return i=new kt,i.setNumber(t.number|s.number),i.setRange(e.range),i}if("^"===e.operator){if(t=this.evaluateExpression(e.left),s=this.evaluateExpression(e.right),!t||!s)return;if(!t.isNumber()||!s.isNumber())return;return i=new kt,i.setNumber(t.number^s.number),i.setRange(e.range),i}if(">>>"===e.operator){if(t=this.evaluateExpression(e.left),s=this.evaluateExpression(e.right),!t||!s)return;if(!t.isNumber()||!s.isNumber())return;return i=new kt,i.setNumber(t.number>>>s.number),i.setRange(e.range),i}if(">>"===e.operator){if(t=this.evaluateExpression(e.left),s=this.evaluateExpression(e.right),!t||!s)return;if(!t.isNumber()||!s.isNumber())return;return i=new kt,i.setNumber(t.number>>s.number),i.setRange(e.range),i}if("<<"===e.operator){if(t=this.evaluateExpression(e.left),s=this.evaluateExpression(e.right),!t||!s)return;if(!t.isNumber()||!s.isNumber())return;return i=new kt,i.setNumber(t.number<<s.number),i.setRange(e.range),i}}},this.hooks.evaluate.UnaryExpression=e=>{if("typeof"===e.operator){let t,s;if("Identifier"===e.argument.type&&(s=this.parser.scope.renames.get(e.argument.name)||e.argument.name,!this.parser.scope.definitions.has(s))){const i=this.hooks.evaluateTypeof[s];if(void 0!==i&&(t=i.call(null,e),void 0!==t))return t}if("MemberExpression"===e.argument.type){const s=this.parser.getNameForExpression(e.argument);if(s&&s.free){const i=this.hooks.evaluateTypeof[s.name];if(void 0!==i&&(t=i.call(e),void 0!==t))return t}}if("FunctionExpression"===e.argument.type)return(new kt).setString("function").setRange(e.range);const i=this.evaluateExpression(e.argument);if(i.isString()||i.isWrapped())return(new kt).setString("string").setRange(e.range);if(i.isNumber())return(new kt).setString("number").setRange(e.range);if(i.isBoolean())return(new kt).setString("boolean").setRange(e.range);if(i.isArray()||i.isConstArray()||i.isRegExp())return(new kt).setString("object").setRange(e.range)}else if("!"===e.operator){const t=this.evaluateExpression(e.argument);if(!t)return;if(t.isBoolean())return(new kt).setBoolean(!t.bool).setRange(e.range);if(t.isTruthy())return(new kt).setBoolean(!1).setRange(e.range);if(t.isFalsy())return(new kt).setBoolean(!0).setRange(e.range);if(t.isString())return(new kt).setBoolean(!t.string).setRange(e.range);if(t.isNumber())return(new kt).setBoolean(!t.number).setRange(e.range)}else if("~"===e.operator){const t=this.evaluateExpression(e.argument);if(!t)return;if(!t.isNumber())return;const s=new kt;return s.setNumber(~t.number),s.setRange(e.range),s}},this.hooks.evaluateTypeof.undefined=e=>(new kt).setString("undefined").setRange(e.range),this.hooks.evaluateTypeof.require=e=>(new kt).setString("function").setRange(e.range),this.hooks.evaluate.Identifier=e=>{const t=this.parser.scope.renames.get(e.name)||e.name;if(!this.parser.scope.definitions.has(e.name))return(new kt).setIdentifier(t).setRange(e.range)},this.hooks.evaluate.ThisExpression=e=>{const t=this.parser.scope.renames.get("this");if(t)return(new kt).setIdentifier(t).setRange(e.range)},this.hooks.evaluate.MemberExpression=e=>{let t=this.parser.getNameForExpression(e);if(t&&t.free)return(new kt).setIdentifier(t.name).setRange(e.range)};const e=(e,t)=>{const s=[],i=[];for(let r=0;r<t.quasis.length;r++){const a=t.quasis[r],n=a.value[e];if(r>0){const e=i[i.length-1],s=this.evaluateExpression(t.expressions[r-1]),o=s.asString();if("string"==typeof o){e.setString(e.string+o+n),e.setRange([e.range[0],a.range[1]]),e.setExpression(void 0);continue}i.push(s)}const o=(new kt).setString(n).setRange(a.range).setExpression(a);s.push(o),i.push(o)}return{quasis:s,parts:i}};this.hooks.evaluate.TemplateLiteral=t=>{const{quasis:s,parts:i}=e("cooked",t);return 1===i.length?i[0].setRange(t.range):(new kt).setTemplateString(s,i,"cooked").setRange(t.range)},this.hooks.evaluate.TaggedTemplateExpression=t=>{if("String.raw"!==this.evaluateExpression(t.tag).identifier)return;const{quasis:s,parts:i}=e("raw",t.quasi);return 1===i.length?i[0].setRange(t.range):(new kt).setTemplateString(s,i,"raw").setRange(t.range)},this.hooks.evaluate.ConditionalExpression=e=>{const t=this.evaluateExpression(e.test).asBool();let s;if(void 0===t){const t=this.evaluateExpression(e.consequent),i=this.evaluateExpression(e.alternate);if(!t||!i)return;s=new kt,t.isConditional()?s.setOptions(t.options):s.setOptions([t]),i.isConditional()?s.addOptions(i.options):s.addOptions([i])}else s=this.evaluateExpression(t?e.consequent:e.alternate);return s.setRange(e.range),s}}evaluateExpression(e){try{let t=e.type;if(t in this.hooks.evaluate){const s=this.hooks.evaluate[t](e);if(void 0!==s)return s&&s.setExpression(e),s}}catch(e){console.warn(e)}return(new kt).setRange(e.range).setExpression(e)}}const bt=xe;class Et{constructor(e){this.scope={topLevelScope:!0,inTry:!1,inShorthand:!1,isStrict:!1,isAsmJs:!1,definitions:new mt,renames:new mt},this.state={deps:[],warnings:[],errors:[],assignRequire:!1},this.evaluator=new vt(this),this.parserContext=e}parse(e){const t=this.scope,s=this.state,i=this.state={deps:[],warnings:[],errors:[],assignRequire:!1};let r;if("object"==typeof e&&null!==e)r=e;else try{r=Et.parse(e)}catch(e){return i.errors.push({msg:e.message}),i}return this.scope={topLevelScope:!0,inTry:!1,inShorthand:!1,isStrict:!1,isAsmJs:!1,definitions:new mt,renames:new mt},this.detectMode(r.body),this.prewalkStatements(r.body),this.blockPrewalkStatements(r.body),this.walkStatements(r.body),this.scope=t,this.state=s,i}static parse(e){let t;return t=bt.parse(e,{ecmaVersion:"latest",ranges:!0,locations:!0,allowHashBang:!0,sourceType:"module"}),t}detectMode(e){const t=e.length>=1&&"ExpressionStatement"===e[0].type&&"Literal"===e[0].expression.type;t&&"use strict"===e[0].expression.value&&(this.scope.isStrict=!0),t&&"use asm"===e[0].expression.value&&(this.scope.isAsmJs=!0)}getRenameIdentifier(e){const t=this.evaluateExpression(e);if(t&&t.isIdentifier())return t.identifier}walkClass(e){if(e.superClass&&this.walkExpression(e.superClass),e.body&&"ClassBody"===e.body.type){const t=this.scope.topLevelScope;this.scope.topLevelScope=!1;for(const t of e.body.body)"MethodDefinition"===t.type&&this.walkMethodDefinition(t);this.scope.topLevelScope=t}}walkMethodDefinition(e){e.computed&&e.key&&this.walkExpression(e.key),e.value&&this.walkExpression(e.value)}prewalkStatements(e){for(let t=0,s=e.length;t<s;t++){const s=e[t];this.prewalkStatement(s)}}blockPrewalkStatements(e){for(let t=0,s=e.length;t<s;t++){const s=e[t];this.blockPrewalkStatement(s)}}walkStatements(e){for(let t=0,s=e.length;t<s;t++){const s=e[t];this.walkStatement(s)}}prewalkStatement(e){switch(e.type){case"BlockStatement":this.prewalkBlockStatement(e);break;case"DoWhileStatement":this.prewalkDoWhileStatement(e);break;case"ExportAllDeclaration":this.prewalkExportAllDeclaration(e);break;case"ExportDefaultDeclaration":this.prewalkExportDefaultDeclaration(e);break;case"ExportNamedDeclaration":this.prewalkExportNamedDeclaration(e);break;case"ForInStatement":this.prewalkForInStatement(e);break;case"ForOfStatement":this.prewalkForOfStatement(e);break;case"ForStatement":this.prewalkForStatement(e);break;case"FunctionDeclaration":this.prewalkFunctionDeclaration(e);break;case"IfStatement":this.prewalkIfStatement(e);break;case"ImportDeclaration":this.prewalkImportDeclaration(e);break;case"LabeledStatement":this.prewalkLabeledStatement(e);break;case"SwitchStatement":this.prewalkSwitchStatement(e);break;case"TryStatement":this.prewalkTryStatement(e);break;case"VariableDeclaration":this.prewalkVariableDeclaration(e);break;case"WhileStatement":this.prewalkWhileStatement(e);break;case"WithStatement":this.prewalkWithStatement(e)}}blockPrewalkStatement(e){switch(e.type){case"VariableDeclaration":this.blockPrewalkVariableDeclaration(e);break;case"ExportDefaultDeclaration":this.blockPrewalkExportDefaultDeclaration(e);break;case"ExportNamedDeclaration":this.blockPrewalkExportNamedDeclaration(e);break;case"ClassDeclaration":this.blockPrewalkClassDeclaration(e)}}walkStatement(e){switch(e.type){case"BlockStatement":this.walkBlockStatement(e);break;case"ClassDeclaration":this.walkClassDeclaration(e);break;case"DoWhileStatement":this.walkDoWhileStatement(e);break;case"ExportDefaultDeclaration":this.walkExportDefaultDeclaration(e);break;case"ExportNamedDeclaration":this.walkExportNamedDeclaration(e);break;case"ExpressionStatement":this.walkExpressionStatement(e);break;case"ForInStatement":this.walkForInStatement(e);break;case"ForOfStatement":this.walkForOfStatement(e);break;case"ForStatement":this.walkForStatement(e);break;case"FunctionDeclaration":this.walkFunctionDeclaration(e);break;case"IfStatement":this.walkIfStatement(e);break;case"LabeledStatement":this.walkLabeledStatement(e);break;case"ReturnStatement":this.walkReturnStatement(e);break;case"SwitchStatement":this.walkSwitchStatement(e);break;case"ThrowStatement":this.walkThrowStatement(e);break;case"TryStatement":this.walkTryStatement(e);break;case"VariableDeclaration":this.walkVariableDeclaration(e);break;case"WhileStatement":this.walkWhileStatement(e);break;case"WithStatement":this.walkWithStatement(e)}}prewalkBlockStatement(e){this.prewalkStatements(e.body)}walkBlockStatement(e){this.inBlockScope((()=>{const t=e.body;this.blockPrewalkStatements(t),this.walkStatements(t)}))}walkExpressionStatement(e){this.walkExpression(e.expression)}prewalkIfStatement(e){this.prewalkStatement(e.consequent),e.alternate&&this.prewalkStatement(e.alternate)}walkIfStatement(e){this.walkExpression(e.test),this.walkStatement(e.consequent),e.alternate&&this.walkStatement(e.alternate)}prewalkLabeledStatement(e){this.prewalkStatement(e.body)}walkLabeledStatement(e){this.walkStatement(e.body)}prewalkWithStatement(e){this.prewalkStatement(e.body)}walkWithStatement(e){this.walkExpression(e.object),this.walkStatement(e.body)}prewalkSwitchStatement(e){this.prewalkSwitchCases(e.cases)}walkSwitchStatement(e){this.walkExpression(e.discriminant),this.walkSwitchCases(e.cases)}walkTerminatingStatement(e){e.argument&&this.walkExpression(e.argument)}walkReturnStatement(e){this.walkTerminatingStatement(e)}walkThrowStatement(e){this.walkTerminatingStatement(e)}prewalkTryStatement(e){this.prewalkStatement(e.block)}walkTryStatement(e){this.scope.inTry?this.walkStatement(e.block):(this.scope.inTry=!0,this.walkStatement(e.block),this.scope.inTry=!1),e.handler&&this.walkCatchClause(e.handler),e.finalizer&&this.walkStatement(e.finalizer)}prewalkWhileStatement(e){this.prewalkStatement(e.body)}walkWhileStatement(e){this.walkExpression(e.test),this.walkStatement(e.body)}prewalkDoWhileStatement(e){this.prewalkStatement(e.body)}walkDoWhileStatement(e){this.walkStatement(e.body),this.walkExpression(e.test)}prewalkForStatement(e){e.init&&"VariableDeclaration"===e.init.type&&this.prewalkStatement(e.init),this.prewalkStatement(e.body)}walkForStatement(e){this.inBlockScope((()=>{e.init&&("VariableDeclaration"===e.init.type?(this.blockPrewalkVariableDeclaration(e.init),this.walkStatement(e.init)):this.walkExpression(e.init)),e.test&&this.walkExpression(e.test),e.update&&this.walkExpression(e.update);const t=e.body;"BlockStatement"===t.type?(this.blockPrewalkStatements(t.body),this.walkStatements(t.body)):this.walkStatement(t)}))}prewalkForInStatement(e){"VariableDeclaration"===e.left.type&&this.prewalkVariableDeclaration(e.left),this.prewalkStatement(e.body)}walkForInStatement(e){this.inBlockScope((()=>{"VariableDeclaration"===e.left.type?(this.blockPrewalkVariableDeclaration(e.left),this.walkVariableDeclaration(e.left)):this.walkPattern(e.left),this.walkExpression(e.right);const t=e.body;"BlockStatement"===t.type?(this.blockPrewalkStatements(t.body),this.walkStatements(t.body)):this.walkStatement(t)}))}prewalkForOfStatement(e){"VariableDeclaration"===e.left.type&&this.prewalkVariableDeclaration(e.left),this.prewalkStatement(e.body)}walkForOfStatement(e){this.inBlockScope((()=>{"VariableDeclaration"===e.left.type?(this.blockPrewalkVariableDeclaration(e.left),this.walkVariableDeclaration(e.left)):this.walkPattern(e.left),this.walkExpression(e.right);const t=e.body;"BlockStatement"===t.type?(this.blockPrewalkStatements(t.body),this.walkStatements(t.body)):this.walkStatement(t)}))}prewalkFunctionDeclaration(e){e.id&&(this.scope.renames.set(e.id.name,null),this.scope.definitions.add(e.id.name))}walkFunctionDeclaration(e){const t=this.scope.topLevelScope;this.scope.topLevelScope=!1,this.inFunctionScope(!0,e.params,(()=>{for(const t of e.params)this.walkPattern(t);"BlockStatement"===e.body.type?(this.detectMode(e.body.body),this.prewalkStatement(e.body),this.walkStatement(e.body)):this.walkExpression(e.body)})),this.scope.topLevelScope=t}prewalkImportDeclaration(e){this.trackHarmonyImport(e);for(const t of e.specifiers){const e=t.local.name;this.scope.renames.set(e,null),this.scope.definitions.add(e)}}enterDeclaration(e,t){switch(e.type){case"VariableDeclaration":for(const s of e.declarations)switch(s.type){case"VariableDeclarator":this.enterPattern(s.id,t)}break;case"FunctionDeclaration":case"ClassDeclaration":this.enterPattern(e.id,t)}}blockPrewalkExportNamedDeclaration(e){e.declaration&&this.blockPrewalkStatement(e.declaration)}prewalkExportNamedDeclaration(e){e.source&&this.trackHarmonyExportImport(e),e.declaration&&this.prewalkStatement(e.declaration)}walkExportNamedDeclaration(e){e.declaration&&this.walkStatement(e.declaration)}blockPrewalkExportDefaultDeclaration(e){"ClassDeclaration"===e.declaration.type&&this.blockPrewalkClassDeclaration(e.declaration)}prewalkExportDefaultDeclaration(e){this.prewalkStatement(e.declaration)}walkExportDefaultDeclaration(e){e.declaration.id&&"FunctionExpression"!==e.declaration.type&&"ClassExpression"!==e.declaration.type?this.walkStatement(e.declaration):"FunctionDeclaration"===e.declaration.type?this.walkFunctionDeclaration(e.declaration):"ClassDeclaration"===e.declaration.type?this.walkClassDeclaration(e.declaration):this.walkExpression(e.declaration)}prewalkExportAllDeclaration(e){this.trackHarmonyExportImport(e)}prewalkVariableDeclaration(e){"var"===e.kind&&this._prewalkVariableDeclaration(e)}blockPrewalkVariableDeclaration(e){"var"!==e.kind&&this._prewalkVariableDeclaration(e)}_prewalkVariableDeclaration(e){for(const t of e.declarations)switch(t.type){case"VariableDeclarator":this.enterPattern(t.id,(e=>{this.scope.renames.set(e,null),this.scope.definitions.add(e)}))}}walkVariableDeclaration(e){for(const t of e.declarations)switch(t.type){case"VariableDeclarator":{const e=t.init&&this.getRenameIdentifier(t.init);if(e&&"Identifier"===t.id.type&&"require"===e){this.scope.renames.set(t.id.name,this.scope.renames.get(e)||e),this.scope.definitions.delete(t.id.name);break}this.walkPattern(t.id),t.init&&this.walkExpression(t.init);break}}}blockPrewalkClassDeclaration(e){e.id&&(this.scope.renames.set(e.id.name,null),this.scope.definitions.add(e.id.name))}walkClassDeclaration(e){this.walkClass(e)}prewalkSwitchCases(e){for(let t=0,s=e.length;t<s;t++){const s=e[t];this.prewalkStatements(s.consequent)}}walkSwitchCases(e){for(let t=0,s=e.length;t<s;t++){const s=e[t];s.test&&this.walkExpression(s.test),this.walkStatements(s.consequent)}}walkCatchClause(e){this.inBlockScope((()=>{null!==e.param&&(this.enterPattern(e.param,(e=>{this.scope.renames.set(e,null),this.scope.definitions.add(e)})),this.walkPattern(e.param)),this.prewalkStatement(e.body),this.walkStatement(e.body)}))}walkPattern(e){switch(e.type){case"ArrayPattern":this.walkArrayPattern(e);break;case"AssignmentPattern":this.walkAssignmentPattern(e);break;case"MemberExpression":this.walkMemberExpression(e);break;case"ObjectPattern":this.walkObjectPattern(e);break;case"RestElement":this.walkRestElement(e)}}walkAssignmentPattern(e){this.walkExpression(e.right),this.walkPattern(e.left)}walkObjectPattern(e){for(let t=0,s=e.properties.length;t<s;t++){const s=e.properties[t];s&&("computed"in s&&this.walkExpression(s.key),"value"in s&&this.walkPattern(s.value))}}walkArrayPattern(e){for(let t=0,s=e.elements.length;t<s;t++){const s=e.elements[t];s&&this.walkPattern(s)}}walkRestElement(e){this.walkPattern(e.argument)}walkExpressions(e){for(const t of e)t&&this.walkExpression(t)}walkExpression(e){switch(e.type){case"ArrayExpression":this.walkArrayExpression(e);break;case"ArrowFunctionExpression":this.walkArrowFunctionExpression(e);break;case"AssignmentExpression":this.walkAssignmentExpression(e);break;case"AwaitExpression":this.walkAwaitExpression(e);break;case"BinaryExpression":this.walkBinaryExpression(e);break;case"CallExpression":this.walkCallExpression(e);break;case"ClassExpression":this.walkClassExpression(e);break;case"ConditionalExpression":this.walkConditionalExpression(e);break;case"FunctionExpression":this.walkFunctionExpression(e);break;case"Identifier":this.walkIdentifier(e);break;case"LogicalExpression":this.walkLogicalExpression(e);break;case"MemberExpression":this.walkMemberExpression(e);break;case"NewExpression":this.walkNewExpression(e);break;case"ObjectExpression":this.walkObjectExpression(e);break;case"SequenceExpression":this.walkSequenceExpression(e);break;case"SpreadElement":this.walkSpreadElement(e);break;case"TaggedTemplateExpression":this.walkTaggedTemplateExpression(e);break;case"TemplateLiteral":this.walkTemplateLiteral(e);break;case"UnaryExpression":this.walkUnaryExpression(e);break;case"UpdateExpression":this.walkUpdateExpression(e);break;case"YieldExpression":this.walkYieldExpression(e)}}walkAwaitExpression(e){this.walkExpression(e.argument)}walkArrayExpression(e){e.elements&&this.walkExpressions(e.elements)}walkSpreadElement(e){e.argument&&this.walkExpression(e.argument)}walkObjectExpression(e){for(let t=0,s=e.properties.length;t<s;t++){const s=e.properties[t];"SpreadElement"!==s.type?(s.computed&&this.walkExpression(s.key),s.shorthand&&(this.scope.inShorthand=!0),this.walkExpression(s.value),s.shorthand&&(this.scope.inShorthand=!1)):this.walkExpression(s.argument)}}walkFunctionExpression(e){const t=this.scope.topLevelScope;this.scope.topLevelScope=!1;const s=e.params;e.id&&s.push(e.id.name),this.inFunctionScope(!0,s,(()=>{for(const t of e.params)this.walkPattern(t);"BlockStatement"===e.body.type?(this.detectMode(e.body.body),this.prewalkStatement(e.body),this.walkStatement(e.body)):this.walkExpression(e.body)})),this.scope.topLevelScope=t}walkArrowFunctionExpression(e){this.inFunctionScope(!1,e.params,(()=>{for(const t of e.params)this.walkPattern(t);"BlockStatement"===e.body.type?(this.detectMode(e.body.body),this.prewalkStatement(e.body),this.walkStatement(e.body)):this.walkExpression(e.body)}))}walkSequenceExpression(e){e.expressions&&this.walkExpressions(e.expressions)}walkUpdateExpression(e){this.walkExpression(e.argument)}walkUnaryExpression(e){this.walkExpression(e.argument)}walkLeftRightExpression(e){this.walkExpression(e.left),this.walkExpression(e.right)}walkBinaryExpression(e){this.walkLeftRightExpression(e)}walkLogicalExpression(e){this.walkLeftRightExpression(e)}walkAssignmentExpression(e){const t=this.getRenameIdentifier(e.right);if(t&&"require"===t){if("Identifier"===e.left.type)return this.state.assignRequire=!0,this.scope.renames.set(e.left.name,t),void this.scope.definitions.delete(e.left.name);"MemberExpression"===e.left.type&&"Identifier"===e.left.object.type&&"window"===e.left.object.name&&"Identifier"===e.left.property.type&&"loadLib"===e.left.property.name&&(this.state.assignRequire=!0,this.parserContext.isLayaGame=!0)}this.walkExpression(e.right),this.walkPattern(e.left),this.enterPattern(e.left,((e,t)=>{this.scope.renames.set(e,null)}))}walkConditionalExpression(e){this.walkExpression(e.test),this.walkExpression(e.consequent),e.alternate&&this.walkExpression(e.alternate)}walkNewExpression(e){this.walkExpression(e.callee),e.arguments&&this.walkExpressions(e.arguments)}walkYieldExpression(e){e.argument&&this.walkExpression(e.argument)}walkTemplateLiteral(e){e.expressions&&this.walkExpressions(e.expressions)}walkTaggedTemplateExpression(e){e.tag&&this.walkExpression(e.tag),e.quasi&&e.quasi.expressions&&this.walkExpressions(e.quasi.expressions)}walkClassExpression(e){this.walkClass(e)}_walkIIFE(e,t,s){const i=e=>{const t=this.getRenameIdentifier(e);if("require"===t)return t;this.walkExpression(e)},r=e.params,a=s?i(s):null,n=t.map(i),o=this.scope.topLevelScope;this.scope.topLevelScope=!1;const h=r.filter(((e,t)=>!n[t]));e.id&&h.push(e.id.name),this.inFunctionScope(!0,h,(()=>{a&&this.scope.renames.set("this",a);for(let e=0;e<n.length;e++){const t=n[e];t&&(r[e]&&"Identifier"===r[e].type&&this.scope.renames.set(r[e].name,t))}"BlockStatement"===e.body.type?(this.detectMode(e.body.body),this.prewalkStatement(e.body),this.walkStatement(e.body)):this.walkExpression(e.body)})),this.scope.topLevelScope=o}walkCallExpression(e){if("MemberExpression"===e.callee.type&&"FunctionExpression"===e.callee.object.type&&!e.callee.computed&&("call"===e.callee.property.name||"bind"===e.callee.property.name)&&e.arguments.length>0)this._walkIIFE(e.callee.object,e.arguments.slice(1),e.arguments[0]);else if("FunctionExpression"===e.callee.type)this._walkIIFE(e.callee,e.arguments,null);else if("ImportExpression"===e.callee.type){if(!0===this.trackImportOrRequireCall(e,"import"))return;e.arguments&&this.walkExpressions(e.arguments)}else{const t=this.evaluateExpression(e.callee);if(t.isIdentifier())if("require"===t.identifier){if(!0===this.trackImportOrRequireCall(e,"require"))return}else this.parserContext.isLayaGame&&"loadLib"===t.identifier&&this.trackImportOrRequireCall(e,"require");e.callee&&this.walkExpression(e.callee),e.arguments&&this.walkExpressions(e.arguments)}}walkMemberExpression(e){const t=this.getNameForExpression(e);if(t&&t.free&&"require"===t.name){if(!0===this.warnRequireExpression(e))return}this.walkExpression(e.object),!0===e.computed&&this.walkExpression(e.property)}walkIdentifier(e){if(!this.scope.definitions.has(e.name)){if("require"===(this.scope.renames.get(e.name)||e.name)){if(!0===this.warnRequireExpression(e))return}}}inFunctionScope(e,t,s){const i=this.scope;this.scope={topLevelScope:i.topLevelScope,inTry:!1,inShorthand:!1,isStrict:i.isStrict,isAsmJs:i.isAsmJs,definitions:i.definitions.createChild(),renames:i.renames.createChild()},e&&this.scope.renames.set("this",null),this.enterPatterns(t,(e=>{this.scope.renames.set(e,null),this.scope.definitions.add(e)})),s(),this.scope=i}inBlockScope(e){const t=this.scope;this.scope={topLevelScope:t.topLevelScope,inTry:t.inTry,inShorthand:!1,isStrict:t.isStrict,isAsmJs:t.isAsmJs,definitions:t.definitions.createChild(),renames:t.renames.createChild()},e(),this.scope=t}enterPatterns(e,t){for(const s of e)"string"!=typeof s?this.enterPattern(s,t):s&&t(s)}enterPattern(e,t){if(e)switch(e.type){case"ArrayPattern":this.enterArrayPattern(e,t);break;case"AssignmentPattern":this.enterAssignmentPattern(e,t);break;case"Identifier":this.enterIdentifier(e,t);break;case"ObjectPattern":this.enterObjectPattern(e,t);break;case"RestElement":this.enterRestElement(e,t);break;case"Property":this.enterPattern(e.value,t)}}enterIdentifier(e,t){t(e.name,e)}enterObjectPattern(e,t){for(let s=0,i=e.properties.length;s<i;s++){const i=e.properties[s];this.enterPattern(i,t)}}enterArrayPattern(e,t){for(let s=0,i=e.elements.length;s<i;s++){const i=e.elements[s];this.enterPattern(i,t)}}enterRestElement(e,t){this.enterPattern(e.argument,t)}enterAssignmentPattern(e,t){this.enterPattern(e.left,t)}getNameForExpression(e){let t=e;const s=[];for(;"MemberExpression"===t.type&&t.property.type===(t.computed?"Literal":"Identifier");)s.push(t.computed?t.property.value:t.property.name),t=t.object;let i;if("Identifier"===t.type)i=!this.scope.definitions.has(t.name),s.push(this.scope.renames.get(t.name)||t.name);else if("ThisExpression"===t.type&&this.scope.renames.get("this"))i=!0,s.push(this.scope.renames.get("this"));else{if("ThisExpression"!==t.type)return null;i=this.scope.topLevelScope,s.push("this")}let r="";for(let e=s.length-1;e>=2;e--)r+=s[e]+".";s.length>1&&(r+=s[1]);return{name:r?r+"."+s[0]:s[0],nameGeneral:r,free:i}}evaluateExpression(e){return this.evaluator.evaluateExpression(e)}trackHarmonyExportImport(e){this.state.deps.push({type:"normal",request:e.source.value,range:e.range,loc:e.loc})}trackHarmonyImport(e){this.state.deps.push({type:"normal",request:e.source.value,range:e.range,loc:e.loc})}trackImportOrRequireCall(e,t){const s=(e,t)=>{if(t.isString())return this.state.deps.push({type:"normal",request:t.string,range:t.range,loc:e.loc}),!0},i=(e,t)=>(function(e,t,s){if(e.isTemplateString()){let i=e.quasis[0].string,r=e.quasis.length>1?e.quasis[e.quasis.length-1].string:"";e.range;const{context:a,prefix:n}=xt(i),{postfix:o,query:h}=yt(r),p=".*"+e.quasis.slice(1,e.quasis.length-1).map((e=>gt(e.string)+".*")).join("");let l={type:"context",context:a,regExp:new RegExp(`^${gt(n)}${p}${gt(o)}$`),range:t.range,loc:t.loc};s.state.deps.push(l),e.parts.forEach(((e,t)=>{t%2==0||s.walkExpression(e.expression)}))}else if(e.isWrapped()&&(e.prefix&&e.prefix.isString()||e.postfix&&e.postfix.isString())){let i=e.prefix&&e.prefix.isString()?e.prefix.string:"",r=e.postfix&&e.postfix.isString()?e.postfix.string:"";e.prefix&&e.prefix.isString()&&e.prefix.range,e.postfix&&e.postfix.isString()&&e.postfix.range,e.range;const{context:a,prefix:n}=xt(i),{postfix:o,query:h}=yt(r);let p={type:"context",context:a,regExp:new RegExp(`^${gt(n)}.*${gt(o)}$`),range:t.range,loc:t.loc};if(s.state.deps.push(p),e.wrappedInnerExpressions)for(const t of e.wrappedInnerExpressions)t.expression&&s.walkExpression(t.expression)}else s.state.warnings.push({msg:"the request of a dependency is an expression",range:t.range,loc:t.loc}),s.walkExpression(e.expression)}(t,e,this),!0);e.arguments.length>1&&this.state.warnings.push({msg:`call ${t} function with more than one parameter`,range:e.range,loc:e.loc});const r=this.evaluateExpression(e.arguments[0]);if(r.isConditional()){let t=!1;const i=this.state.deps.length;for(const i of r.options){void 0===s(e,i)&&(t=!0)}if(!t)return!0;this.state.deps.length=i}return void 0===s(e,r)&&i(e,r),!0}warnRequireExpression(e){return this.state.warnings.push({msg:"require function is used in a way in which dependencies cannot be statically extracted",range:e.range,loc:e.loc}),!0}}class St extends N{constructor(e,t){super(e,t)}async build(e){let t;try{t=await this.fileHelper.getString(this.path)}catch(e){throw this.markError(exports.ModuleErrorType.FILE_NOT_UTF8,e),e}const s=e.es6Parser.isLayaGame;let i,r;if(!s){let s;i=function(e){const t=/(?<![\w|\.])import(?![\w|\.])/g,s=/(?<![\w|\.])export(?![\w|\.])/g,i=/(?<![\w|\.])from(?![\w|\.])/g,r=/(?<![\w|\.])require(?![\w|\.])/g;let a=-1,n=!1,o=!1,h=null;for(;h=t.exec(e);)a=Math.max(h.index,a);for(;h=s.exec(e);)a=Math.max(h.index,a),o=!0;for(;h=r.exec(e);)a=Math.max(h.index,a),n=!0;return o&&(i.lastIndex=a,(h=i.exec(e))&&(a=Math.max(h.index,a))),{lastIndex:a,hasRequire:n}}(t);try{s=ut(t,{ecmaVersion:"latest",ranges:!0,locations:!0,allowHashBang:!0,sourceType:"module",sourceFile:this.path,skipStatementPos:i.lastIndex})}catch(e){throw this.markError(exports.ModuleErrorType.JS_PARSE_ERR,e),e}r=new Et(e.es6Parser).parse(s)}if(s||i&&i.hasRequire&&r&&r.assignRequire){let s=ut(t,{ecmaVersion:"latest",ranges:!0,locations:!0,allowHashBang:!0,sourceType:"module",sourceFile:this.path});r=new Et(e.es6Parser).parse(s)}let a=r.deps.filter((e=>"normal"===e.type)),n=r.deps.filter((e=>"context"===e.type));return a.forEach((async e=>{this.addDep(new y("Js"===this.type?"Js":"Wxs",e.request,this,this.fileHelper,!0,!0))})),n.forEach((async e=>{this.addDep(new k({type:"Js"===this.type?"Js":"Wxs",request:e.context,regExp:e.regExp,originModule:this,fileHelper:this.fileHelper,needResolve:!0,necessary:!0,from:"file"}))})),r.warnings&&r.warnings.forEach((e=>{var t,s,i;this.markError(exports.ModuleErrorType.JS_RESOLVE_DEPENDENCY_ERR,new Error(`${e.msg} (${null===(t=e.loc)||void 0===t?void 0:t.source} ${null===(s=e.loc)||void 0===s?void 0:s.end.line}:${null===(i=e.loc)||void 0===i?void 0:i.end.column})`))})),r.errors&&r.errors.forEach((e=>{this.markError(exports.ModuleErrorType.JS_RESOLVE_DEPENDENCY_ERR,e)})),Array.from(this.deps)}}var _t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Ct(e,t){t=t||{};var s=1,i=1;function r(e){var t=e.match(/\n/g);t&&(s+=t.length);var r=e.lastIndexOf("\n");i=~r?e.length-r:i+e.length}function a(){var e={line:s,column:i};return function(t){return t.position=new n(e),d(),t}}function n(e){this.start=e,this.end={line:s,column:i},this.source=t.source}n.prototype.content=e;var o=[];function h(r){var a=new Error(t.source+":"+s+":"+i+": "+r);if(a.reason=r,a.filename=t.source,a.line=s,a.column=i,a.source=e,!t.silent)throw a;o.push(a)}function p(){return u(/^{\s*/)}function l(){return u(/^}/)}function c(){var i,r=[];for(d(),f(r);s<=(t.skipRuleLineno||Number.MAX_SAFE_INTEGER)&&e.length&&"}"!=e.charAt(0)&&(i=_()||C());)!1!==i&&(r.push(i),f(r));return r}function u(t){var s=t.exec(e);if(s){var i=s[0];return r(i),e=e.slice(i.length),s}}function d(){u(/^\s*/)}function f(e){var t;for(e=e||[];t=m();)!1!==t&&e.push(t);return e}function m(){var t=a();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var s=2;""!=e.charAt(s)&&("*"!=e.charAt(s)||"/"!=e.charAt(s+1));)++s;if(s+=2,""===e.charAt(s-1))return h("End of comment missing");var n=e.slice(2,s-2);return i+=2,r(n),e=e.slice(s),i+=2,t({type:"comment",comment:n})}}function g(){var e=u(/^([^{]+)/);if(e)return Pt(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"‌")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function x(){var e=a(),t=u(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){if(t=Pt(t[0]),!u(/^:\s*/))return h("property missing ':'");var s=u(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),i=e({type:"declaration",property:t.replace(_t,""),value:s?Pt(s[0]).replace(_t,""):""});return u(/^[;\s]*/),i}}function y(){var e,t=[];if(!p())return h("missing '{'");for(f(t);e=x();)!1!==e&&(t.push(e),f(t));return l()?t:h("missing '}'")}function k(){for(var e,t=[],s=a();e=u(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),u(/^,\s*/);if(t.length)return s({type:"keyframe",values:t,declarations:y()})}var w,v=S("import"),b=S("charset"),E=S("namespace");function S(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var s=a(),i=u(t);if(i){var r={type:e};return r[e]=i[1].trim(),s(r)}}}function _(){if("@"==e[0])return function(){var e=a();if(t=u(/^@([-\w]+)?keyframes\s*/)){var t,s=t[1];if(!(t=u(/^([-\w]+)\s*/)))return h("@keyframes missing name");var i,r=t[1];if(!p())return h("@keyframes missing '{'");for(var n=f();i=k();)n.push(i),n=n.concat(f());return l()?e({type:"keyframes",name:r,vendor:s,keyframes:n}):h("@keyframes missing '}'")}}()||function(){var e=a(),t=u(/^@media *([^{]+)/);if(t){var s=Pt(t[1]);if(!p())return h("@media missing '{'");var i=f().concat(c());return l()?e({type:"media",media:s,rules:i}):h("@media missing '}'")}}()||function(){var e=a(),t=u(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:Pt(t[1]),media:Pt(t[2])})}()||function(){var e=a(),t=u(/^@supports *([^{]+)/);if(t){var s=Pt(t[1]);if(!p())return h("@supports missing '{'");var i=f().concat(c());return l()?e({type:"supports",supports:s,rules:i}):h("@supports missing '}'")}}()||v()||b()||E()||function(){var e=a(),t=u(/^@([-\w]+)?document *([^{]+)/);if(t){var s=Pt(t[1]),i=Pt(t[2]);if(!p())return h("@document missing '{'");var r=f().concat(c());return l()?e({type:"document",document:i,vendor:s,rules:r}):h("@document missing '}'")}}()||function(){var e=a();if(u(/^@page */)){var t=g()||[];if(!p())return h("@page missing '{'");for(var s,i=f();s=x();)i.push(s),i=i.concat(f());return l()?e({type:"page",selectors:t,declarations:i}):h("@page missing '}'")}}()||function(){var e=a();if(u(/^@host\s*/)){if(!p())return h("@host missing '{'");var t=f().concat(c());return l()?e({type:"host",rules:t}):h("@host missing '}'")}}()||function(){var e=a();if(u(/^@font-face\s*/)){if(!p())return h("@font-face missing '{'");for(var t,s=f();t=x();)s.push(t),s=s.concat(f());return l()?e({type:"font-face",declarations:s}):h("@font-face missing '}'")}}()}function C(){var e=a(),t=g();return t?(f(),e({type:"rule",selectors:t,declarations:y()})):h("selector missing")}return At((w=c(),{type:"stylesheet",stylesheet:{source:t.source,rules:w,parsingErrors:o}}))}function Pt(e){return e?e.replace(/^\s+|\s+$/g,""):""}function At(e,t){var s=e&&"string"==typeof e.type,i=s?e:t;for(var r in e){var a=e[r];Array.isArray(a)?a.forEach((function(e){At(e,i)})):a&&"object"==typeof a&&At(a,i)}return s&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}const It={MainPackage:class extends N{constructor(e,t){super(e,t),t.originModule=this}get subpackages(){return Array.from(this.deps).filter((e=>"SubPackage"===e.type&&e.module)).map((e=>e.module))}addParentDep(e){super.addParentDep(e),e.originModule=this}async build(e){let t=this;this.addDep(new y("Js","app.js",t,this.fileHelper,!1,!0)),this.addDep(new y("Wxss","app.wxss",t,this.fileHelper,!1,!1));let s=await this.loadAppJSON();return s&&(this.config=s,this.trackUseExtendedLibs(s,e),s.pages.forEach((e=>{this.addDep(new v(e,t,this.fileHelper))})),s.usingComponents&&Object.keys(s.usingComponents).forEach((e=>{let i=s.usingComponents[e];this.addDep(new b(e,i,t,this.fileHelper))})),s.subPackages&&s.subPackages.forEach((e=>{this.addDep(new w(e,t,this.fileHelper))})),s.subpackages&&s.subpackages.forEach((e=>{this.addDep(new w(e,t,this.fileHelper))})),s.workers&&this.addDep(new S(s.workers,t,this.fileHelper)),s.sitemapLocation?this.addDep(new E(s.sitemapLocation,t,this.fileHelper)):this.fileHelper.existFile("sitemap.json")&&this.addDep(new E("sitemap.json",t,this.fileHelper,"rule")),s.themeLocation&&this.addDep(new E(s.themeLocation,t,this.fileHelper)),s.tabBar&&!0===s.tabBar.custom&&this.addDep(new b("custom-tab-bar","custom-tab-bar/index",t,this.fileHelper)),this.fileHelper.existFile("project.config.json")&&this.addDep(new E("project.config.json",t,this.fileHelper,"rule")),this.addDep(new _(t,this.fileHelper))),Array.from(this.deps)}trackUseExtendedLibs(e,t){var s;if(e.useExtendedLib)for(const i in e.useExtendedLib)if(e.useExtendedLib[i]){const e={kbone:{packages:["miniprogram-element","miniprogram-render"]},weui:{packages:["weui-miniprogram"]}};"kbone"!==i&&"weui"!==i||null===(s=t.miniprogram.useExtendedPackages)||void 0===s||s.push(...e[i].packages)}}async loadAppJSON(){const e=this.fileHelper,t="app.json";if(e.existFile(t))try{return await e.getJSON(t)}catch(e){console.error(e),this.markError(exports.ModuleErrorType.JSON_PARSE_ERR,e)}else this.markError(exports.ModuleErrorType.APP_JSON_NOT_FOUND,new Error("Couldn't find the app.json file"))}},SubPackage:class extends N{constructor(e,t){super(e,t),this.config=t.config,this.mtime=this.fileHelper.mtime("app.json")}isValid(){return this.mtime===this.fileHelper.mtime("app.json")}async build(e){return this.config.pages.forEach((e=>{this.addDep(new v(e,this,this.fileHelper))})),Array.from(this.deps)}},Page:class extends D{constructor(e,t){super(e,t)}},Component:D,Wxml:class extends N{constructor(e,t){super(e,t)}async build(e){let t;try{t=await this.fileHelper.getString(this.path)}catch(e){throw this.markError(exports.ModuleErrorType.FILE_NOT_UTF8,e),e}return function(e){e=e.replace(/<!--([\s\S]*?)-->/g,"");const t=/<(import|include|wxs)[^>]*src\s*=\s*['"]([^'"]*)['"][^>]*>/gi,s=[];let i=null;for(;i=t.exec(e);)s.push({type:"wxs"===i[1]?"wxs":"wxml",route:i[2]});return s}(t).forEach((async e=>{this.addDep(new y("wxml"===e.type?"Wxml":"Wxs",e.route,this,this.fileHelper,!0,!0))})),Array.from(this.deps)}},Wxss:class extends N{constructor(e,t){super(e,t)}async build(e){let t;try{t=await this.fileHelper.getString(this.path)}catch(e){throw this.markError(exports.ModuleErrorType.FILE_NOT_UTF8,e),e}try{(function(e,t){const s=function(e){const t=e.lastIndexOf("@import");if(t>=0){let s=1;const i=e.slice(0,t).match(/\n/g);return i&&(s+=i.length),s}return 0}(e);if(s<=0)return[];const i=Ct(e,{source:t.path,skipRuleLineno:s}),r=[];return(i.stylesheet?i.stylesheet.rules:[]).forEach((e=>{if(function(e){return"import"===e.type}(e)&&e.import){const t=e.import.replace(/'|"/g,"");r.push(t)}})),r})(t,{path:this.path}).forEach((async e=>{this.addDep(new y("Wxss",e,this,this.fileHelper,!0,!0))}))}catch(e){throw this.markError(exports.ModuleErrorType.WXSS_PARSE_ERR,e),e}return Array.from(this.deps)}},Js:St,Wxs:class extends St{constructor(e,t){super(e,t)}},Plugin:St,Worker:class extends N{constructor(e,t){super(e,t)}async build(e){const t=this.path;return this.fileHelper.getFileList(t+"/","js").forEach((async e=>{this.addDep(new y("Js",e,this,this.fileHelper,!1,!0))})),Array.from(this.deps)}isValid(){return!1}},FunctionalPages:class extends N{constructor(e,t){super(e,t)}async build(e){return this.fileHelper.getFileList(this.path+"/","js").forEach((async e=>{this.addDep(new y("Js",e,this,this.fileHelper,!1,!0))})),Array.from(this.deps)}isValid(){return!1}},ContextModule:class extends N{constructor(e,t){super(e,t),this.dep=t}async build(e){const t=this.dep.context,s=this.dep.regExp;let i=async e=>{let r=await this.fileHelper.readdir(e);r=r.filter((e=>0!==e.indexOf(".")));let a=[];return await Promise.all(r.map((async r=>{const o=n.default.join(e,r);try{let e=await this.fileHelper.stat(o);if(null==e?void 0:e.isDirectory){let e=await i(o);a=a.concat(e)}else{if(!(null==e?void 0:e.isFile)||!o.endsWith("."+this.dep.fileType))return;{let e="."+o.substr(t.length).replace(/\\/g,"/"),i=e.replace(/\.(js|wxs)$/,"");(s.test(e)||s.test(i))&&a.push(o)}}}catch(e){if("ENOENT"===e.code)return;throw e}}))),a};return(await i(t)).forEach((async e=>{this.addDep(new y("js"===this.dep.fileType?"Js":"Wxs",e,this,this.fileHelper,!1,!0))})),Array.from(this.deps)}isValid(){return!1}},Config:class extends N{constructor(e,t){super(e,t)}async build(e){return[]}},PluginPackage:class extends N{constructor(e,t){super(e,t),t.originModule=this}async build(e){let t=this,s=await this.loadPluginJSON();return s&&(this.config=s,Object.values(s.pages).forEach((e=>{this.addDep(new v(e,t,this.fileHelper))})),s.usingComponents&&Object.keys(s.usingComponents).forEach((e=>{let i=s.usingComponents[e];this.addDep(new b(e,i,t,this.fileHelper))})),s.publicComponents&&Object.keys(s.publicComponents).forEach((e=>{let i=s.publicComponents[e];this.addDep(new b(e,i,t,this.fileHelper))})),s.themeLocation&&this.addDep(new E(s.themeLocation,t,this.fileHelper)),s.main&&this.addDep(new y("Js",s.main,t,this.fileHelper,!1,!0))),Array.from(this.deps)}async loadPluginJSON(){const e=this.fileHelper,t="plugin.json";if(e.existFile(t))try{return await e.getJSON(t)}catch(e){console.error(e),this.markError(exports.ModuleErrorType.JSON_PARSE_ERR,e)}else this.markError(exports.ModuleErrorType.PLUGIN_JSON_NOT_FOUND,new Error("Couldn't find the plugin.json file"))}},GameMainPackage:class extends N{constructor(e,t){super(e,t),t.originModule=this}get subpackages(){return Array.from(this.deps).filter((e=>"GameSubPackage"===e.type&&e.module)).map((e=>e.module))}addParentDep(e){super.addParentDep(e),e.originModule=this}async build(e){let t=this;this.addDep(new y("Js","game.js",t,this.fileHelper,!1,!0));let s=await this.loadGameJSON();return s&&(this.config=s,s.subPackages&&s.subPackages.forEach((e=>{this.addDep(new I(e,t,this.fileHelper))})),s.subpackages&&s.subpackages.forEach((e=>{this.addDep(new I(e,t,this.fileHelper))})),s.workers&&this.addDep(new S(s.workers,t,this.fileHelper)),s.openDataContext&&this.addDep(new y("Js",n.default.join(s.openDataContext,"index.js"),t,this.fileHelper,!1,!0)),this.fileHelper.existFile("project.config.json")&&this.addDep(new E("project.config.json",t,this.fileHelper,"rule"))),Array.from(this.deps)}async loadGameJSON(){const e=this.fileHelper,t="game.json";if(e.existFile(t))try{return await e.getJSON(t)}catch(e){console.error(e),this.markError(exports.ModuleErrorType.JSON_PARSE_ERR,e)}else this.markError(exports.ModuleErrorType.APP_JSON_NOT_FOUND,new Error("Couldn't find the game.json file"))}},GameSubPackage:class extends N{constructor(e,t){super(e,t),this.config=t.config,this.mtime=this.fileHelper.mtime("game.json")}isValid(){return this.mtime===this.fileHelper.mtime("game.json")}async build(e){return this.fileHelper.existFile(this.config.root)?this.addDep(new y("Js",this.config.root,this,this.fileHelper,!1,!0)):this.addDep(new y("Js",n.default.join(this.config.root,"game.js"),this,this.fileHelper,!1,!0)),Array.from(this.deps)}}};function Nt(e,t){return new It[t.type](e,t)}var Tt;!function(e){e.beforeBuild="beforeBuild",e.afterBuild="afterBuild"}(Tt||(Tt={}));class Dt{constructor(e,t){this.status="inited",this.pluginDriver=void 0,this._modules=[],this.prevGraph=void 0,this.costTime=0,this.runningTasks=[],this.pendingTasks=[],this.resolve=null,this.fileHelper=e.fileHelper,this.pluginDriver=e.pluginDriver,this.prevGraph=t,this.graphContext=this.initGraphContext(e)}get modules(){return this._modules}initGraphContext(e){return{fileHelper:e.fileHelper,es6Parser:{isLayaGame:!1},miniprogram:this.initMiniprogramGraphContext()}}initMiniprogramGraphContext(){return{useExtendedPackages:[]}}processDep(e){let t=this.getModule(e.type,e.path);t?t.addParentDep(e):(this.prevGraph&&(t=this.prevGraph.getModule(e.type,e.path),t&&t.isValid()?(t.parentDeps.clear(),t.addParentDep(e),this.modules.push(t),this.pendingTasks.push({module:t,type:"reuse"})):t=void 0),t||(t=Nt(this.fileHelper,e),t.addParentDep(e),this.modules.push(t),this.pendingTasks.push({module:t,type:"build"})))}async processDeps(e){await Promise.all(e.map((async e=>{var t,s;try{await e.resolve(this.graphContext)&&this.processDep(e),null===(t=this.pluginDriver)||void 0===t||t.callPlugin("onDepResolveSucceed",e)}catch(t){null===(s=this.pluginDriver)||void 0===s||s.callPlugin("onDepResolveFailed",e,t)}})))}async processTask(e){var t,s,i,r,a;const n=Date.now(),o=e.module;let h=[];if("build"===e.type){null===(t=this.pluginDriver)||void 0===t||t.callPlugin("beforeModuleBuild",o,e.type);let a=null;try{h=await o.build(this.graphContext)}catch(e){a=e}const p=Date.now()-n;a?null===(s=this.pluginDriver)||void 0===s||s.callPlugin("onModuleBuildSucceed",o,p):null===(i=this.pluginDriver)||void 0===i||i.callPlugin("onModuleBuildSucceed",o,p,a),null===(r=this.pluginDriver)||void 0===r||r.callPlugin("afterModuleBuild",o,p,a)}else null===(a=this.pluginDriver)||void 0===a||a.callPlugin("onModuleReuse",o),h=Array.from(o.deps);await this.processDeps(h),this.runningTasks.splice(this.runningTasks.indexOf(e),1),this.run()}run(){let e=100-this.runningTasks.length;if(e>0&&this.pendingTasks.length>0){let t=e>this.pendingTasks.length?this.pendingTasks.length:e,s=this.pendingTasks.slice(0,t);this.pendingTasks=this.pendingTasks.slice(t),this.runningTasks=this.runningTasks.concat(s),s.forEach((e=>{this.processTask(e)}))}0===this.pendingTasks.length&&0===this.runningTasks.length&&this.resolve(!0)}getModule(e,t){return this._modules.find((s=>s.type===e&&s.path===t))}async build(e){this.status="building";const t=Date.now();if(Array.isArray(e)){let t=e;for(let e of t)await this._build(e)}else await this._build(e);this._modules=this._modules.sort(((e,t)=>e.id>t.id?1:-1)),this.costTime=Date.now()-t,this.status="completed"}async _build(e){await e.resolve(this.graphContext)&&await new Promise(((t,s)=>{this.resolve=t,this.processDep(e),this.run()}))}}exports.Analyzer=class{constructor(e){this.root="",this.modules=[],this.graph=void 0,this.invalid=!1,this.root=e.root,this.type=e.type,this.plugins=e.plugins||[],this.fileHelper=e.fileHelper?e.fileHelper:new d(e.root,e.type),this.callPlugin("created",this)}getEntryDep(){switch(this.type){case"miniprogram":return new C(this.fileHelper);case"plugin":return new P(this.fileHelper);case"game":return new A(this.fileHelper);case"gamePlugin":throw new Error("not support gamePlugin yet")}}async analyse(){this.invalid=!1;const e=this.getEntryDep();let t=this.graph;this.graph=new Dt({fileHelper:this.fileHelper,pluginDriver:this},t),this.callPlugin("beforeAnalyseProcessStart",this.graph,t),await this.graph.build(e),this.modules=this.graph.modules,this.callPlugin("afterAnalyseProcessComplete",this.graph),this.invalid&&this.analyse()}watch(e){this.fileHelper.watchFileChange((async()=>{this.graph&&"building"===this.graph.status?this.invalid=!0:(await this.analyse(),e())}))}serialize(){if(this.graph){let e=function(e){let t=Object.keys(l);return e.getFileList("").filter((e=>t.indexOf(n.default.posix.extname(e))>=0)).map((t=>{let s=e.stat(t);return{path:t,ext:n.default.extname(t),size:s.size,moduleId:null,subPackage:null}}))}(this.fileHelper);!function(e,t){e.modules.forEach((e=>{if("SubPackage"===e.type){const s=e.path;t.forEach((t=>{t.path.startsWith(s)&&(t.subPackage=e.path)}))}const s=t.find((t=>t.path===e.path));s&&(s.moduleId=e.id)}))}(this.graph,e);let t={files:e,modules:this.graph.modules.map((e=>{let t=e.serialize();return this.callPlugin("onModuleSerialize",e,t),t}))};return this.callPlugin("onSerialize",t),t}}callPlugin(e,...t){this.plugins.forEach((s=>{if(s[e])try{s[e].apply(s,t)}catch(t){console.error(`plugin ${s.name} call ${e} occur some error`,t)}}))}},exports.FileHelper=d,exports.Graph=Dt,exports.analyseJsDependenies=async function(e,t){let s;s="string"==typeof e?[e]:e;const i=s.map((e=>new y("Js",e,null,t,!1,!0))),r=new Dt({fileHelper:t});if(await r.build(i),i[0].error)throw i[0].error;return{startModules:i.map((e=>e.module)),modules:r.modules}},exports.analyseSingeFile=async function(e,t){const s={".js":"Js",".wxs":"Wxs",".wxml":"Wxml",".wxss":"Wxss"}[n.default.extname(e)];if(!s)throw new Error("Unsupported file");const i=new y(s,e,null,t,!1,!1);i.path=e;const r=Nt(t,i),a=await r.build({fileHelper:t,es6Parser:{isLayaGame:!1}});return await Promise.all(a.map((e=>{try{e.resolve()}catch(e){}}))),a},exports.findAllDescendant=function(e,t){let s;s=Array.isArray(e)?e:[e];const i=s.slice(0),r=[],a=[];for(;i.length>0;){const e=i.pop();r.push(e),e.childModules.forEach((e=>{i.indexOf(e)<0&&r.indexOf(e)<0&&(i.push(e),e.type===t&&a.push(e))}))}return a};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("path"),t=require("glob"),s=require("fs-extra"),i=require("chokidar"),r=require("lodash");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=a(e),o=a(t),h=a(s),p=a(i);const l={".wxml":!0,".wxss":!0,".wxs":!0,".png":!0,".jpg":!0,".jpeg":!0,".gif":!0,".svg":!0,".js":!0,".json":!0,".cer":!0,".mp3":!0,".aac":!0,".m4a":!0,".mp4":!0,".wav":!0,".ogg":!0,".silk":!0,".wasm":!0,".br":!0},c={".png":!0,".jpg":!0,".jpeg":!0,".gif":!0,".svg":!0,".js":!0,".json":!0,".cer":!0,".obj":!0,".dae":!0,".fbx":!0,".mtl":!0,".stl":!0,".3ds":!0,".mp3":!0,".pvr":!0,".wav":!0,".plist":!0,".ttf":!0,".fnt":!0,".gz":!0,".ccz":!0,".m4a":!0,".mp4":!0,".bmp":!0,".atlas":!0,".swf":!0,".ani":!0,".part":!0,".proto":!0,".bin":!0,".sk":!0,".mipmaps":!0,".txt":!0,".zip":!0,".ogg":!0,".silk":!0,".dbbin":!0,".dbmv":!0,".etc":!0,".lmat":!0,".lm":!0,".ls":!0,".lh":!0,".lani":!0,".lav":!0,".lsani":!0,".ltc":!0,".csv":!0,".scene":!0,".prefab":!0,".lml":!0,".lmani":!0,".ktx":!0,".dds":!0,".xml":!0,".aac":!0,".pkm":!0,".skel":!0,".cur":!0,".ico":!0,".wasm":!0,".br":!0},u=["node_modules/**/*","**/node_modules/**","**/.git/**",".git/**/*","**/.svn/**",".svn/**/*",".DS_Store","**/.DS_Store"];class d{constructor(e,t="miniprogram"){this.root=e,this.type=t,this.dirSet=new Set,this.fileSet=new Set,this.init()}cacheDirName(e){this.dirSet.has(e)||(this.dirSet.add(e),this.cacheDirName(n.default.posix.dirname(e)))}get pattern(){let e;return e="miniprogram"===this.type||"plugin"===this.type?"**/*{"+Object.keys(l).join(",")+"}":"**/*{"+Object.keys(c).join(",")+"}",e}init(){const e=o.default.sync(this.pattern,{nodir:!1,ignore:[...u],nosort:!0,strict:!1,silent:!0,cwd:this.root,absolute:!1,mark:!0,dot:!0});for(const t of e)t.endsWith("/")?this.cacheDirName(t.replace(/\/$/,"")):(this.fileSet.add(t),this.cacheDirName(n.default.posix.dirname(t)))}stat(e){let t=n.default.posix.join(this.root,e);if(this.exist(e)){let e=h.default.statSync(t);return{isFile:e.isFile(),isDirectory:e.isDirectory(),size:e.size,mtime:e.mtimeMs}}}mtime(e){let t=this.stat(e);return t?t.mtime:0}exist(e){return this.fileSet.has(e)||this.dirSet.has(e)}existDir(e){return e.endsWith("/")&&(e=e.replace(/\/$/,"")),this.dirSet.has(e)}existFile(e){return this.fileSet.has(e)}getFileList(e,t=""){return Array.from(this.fileSet).filter((s=>(!t||n.default.posix.extname(s)===t)&&!(e&&!s.startsWith(e))))}async getString(e){return h.default.readFile(n.default.join(this.root,e),"utf-8")}async getJSON(e){let t=await this.getString(e);try{return JSON.parse(t)}catch(e){}}async readdir(e){return h.default.readdir(n.default.join(this.root,e))}async onFileChange(e,t){if("add"===e&&(this.cacheDirName(n.default.posix.dirname(t)),this.fileSet.add(t)),"addDir"===e&&this.cacheDirName(t),"unlink"===e&&this.fileSet.has(t)&&this.fileSet.delete(t),"unlinkDir"===e&&this.dirSet.has(t)){this.dirSet.delete(t);const e=`${t}/`,s=Array.from(this.dirSet);for(const t of s)0===t.indexOf(e)&&this.dirSet.delete(t);const i=Array.from(this.fileSet);for(const t of i)0===t.indexOf(e)&&this.fileSet.delete(t)}}watchFileChange(e){const t=p.default.watch(this.pattern,{cwd:this.root,ignored:"**/miniprogram-analyse-result.json"}),s=r.debounce(e,200);let i=!1;t.on("all",((e,t)=>{this.onFileChange(e,t),i&&s()})).on("error",(e=>console.log(`Watcher error: ${e}`))).on("ready",(()=>{i=!0,console.log("Initial scan complete. Ready for changes")}))}}function f(e,t="js"){return e.endsWith(`.${t}`)?e:`${e}.${t}`}function m(e,t,s,i){const r=n.default.posix.join(e,"miniprogram_npm/");let a;if(i.existDir(r)){if(a=n.default.posix.join(r,t),a=f(a,s),i.existFile(a))return a;if(a=n.default.posix.join(r,t,`index.${s}`),i.existFile(a))return a}if(e.startsWith(".")||"/"===e)return null;const o=n.default.posix.join(e,"../");return o===e?null:m(o,t,s,i)}function g(e,t,s,i){const r=n.default.posix.dirname(e);let a=null;a=t.startsWith("/")?t.replace(/^\//,""):n.default.posix.join(r,t);const o=f(a,s);if(i.existFile(o))return o;if("json"===s&&i.existFile(`${a}/index.json`))return`${a}/index.json`;if("js"===s||"json"===s)try{if(a=m(n.default.posix.dirname(e),t,s,i),a)return a}catch(e){console.error(e)}return null}class x{constructor(e,t,s){this.from="rule",this.path=null,this.module=null,this.originModule=null,this.error=null,this.type=e,this.request=t,this.originModule=s}serialize(){return{from:this.from,type:this.type,request:this.request,path:this.path,moduleId:this.module?this.module.id:null,originModuleId:this.originModule.id,error:this.error?this.error.message:null}}markError(e){return this.error=e,e}clearError(){this.error=null}}class y extends x{constructor(e,t,s,i,r=!1,a=!0){super(e,t,s),this.fileHelper=i,this.needResolve=r,this.necessary=a,s&&("MainPackage"===s.type||"Page"===s.type||"Component"===s.type)?this.from="rule":this.from="file"}async resolve(){if(this.clearError(),this.needResolve?this.path=g(this.originModule.path,this.request,this.type.toLowerCase(),this.fileHelper):this.path=this.request,this.path&&this.fileHelper.existFile(this.path))return!0;if(this.necessary)throw this.originModule?this.markError(new Error(`Couldn't resolve the ${this.type} file "${this.request}" relative to "${this.originModule.path}"`)):this.markError(new Error(`Couldn't resolve the ${this.type} file "${this.request}"`));return!1}}class k extends x{constructor({type:e,request:t,regExp:s,originModule:i,fileHelper:r,needResolve:a=!1,necessary:n=!0,from:o="file"}){super("ContextModule",t,i),this.needResolve=!1,this.necessary=!0,this.fileType="Js"===e?"js":"wxs",this.fileHelper=r,this.regExp=s,this.needResolve=a,this.necessary=n,this.from=o,this.context=t}async resolve(){if(this.clearError(),this.needResolve)if(this.request.startsWith("/"))this.context=this.request.replace(/^\//,"");else{const e=n.default.posix.dirname(this.originModule.path);this.context=n.default.posix.join(e,this.request)}else this.context=this.request;if(this.fileHelper.existDir(this.context))return this.path=this.context+"/("+this.regExp.source+")",!0;if(this.necessary)throw this.markError(new Error(`Couldn't find the directory "${this.request}" relative to "${this.originModule.path}"`));return!1}}class w extends x{constructor(e,t,s){super("SubPackage",e.root.endsWith("/")?e.root:e.root+"/",t),this.fileHelper=s,this.config=e,this.from="json"}async resolve(){if(this.clearError(),this.path=null,this.fileHelper.existDir(this.config.root))return this.path=this.request,!0;throw this.markError(new Error(`The subpackage directory "${this.config.root}" doesn't exist`))}serialize(){return Object.assign(Object.assign({},super.serialize()),{config:this.config})}}class v extends x{constructor(e,t,s){super("Page",e,t),this.fileHelper=s,this.from="json","SubPackage"===t.type?this.path=t.path+e+".json":this.path=e+".json"}async resolve(){return!0}}class b extends x{constructor(e,t,s,i){super("Component",t,s),this.name=e,this.fileHelper=i,this.isPlugin=!1,this.isUseExtenedLib=!1,this.from="json"}async resolve(e){if(this.clearError(),this.request.startsWith("plugin://")||this.request.startsWith("plugin-private://"))return this.isPlugin=!0,this.path=null,!1;if(e.miniprogram.useExtendedPackages.find((e=>this.request.startsWith(e+"/")||this.request===e)))return this.isUseExtenedLib=!0,this.path=null,!1;if(this.path=g(this.originModule.path,this.request,"json",this.fileHelper),this.path)return!0;throw this.markError(new Error(`Couldn't resolve the Component "${this.request}" relative to "${this.originModule.path}"`))}serialize(){return Object.assign(Object.assign({},super.serialize()),{isPlugin:this.isPlugin})}}class E extends x{constructor(e,t,s,i="json"){super("Config",e,t),this.fileHelper=s,this.from=i}async resolve(){if(this.clearError(),this.path=null,this.fileHelper.existFile(this.request))return this.path=this.request,!0;throw this.markError(new Error(`The config file "${this.request}" doesn't exist`))}}class S extends x{constructor(e,t,s){super("Worker",e,t),this.fileHelper=s,this.from="json"}async resolve(){if(this.clearError(),this.path=null,this.fileHelper.existDir(this.request))return this.path=this.request,!0;throw this.markError(new Error(`The worker directory "${this.request}" doesn't exist`))}}class _ extends x{constructor(e,t){super("FunctionalPages","functional-pages",e),this.fileHelper=t,this.from="rule"}async resolve(){return this.clearError(),this.path=null,!!this.fileHelper.existDir(this.request)&&(this.path=this.request,!0)}}class C extends x{constructor(e){super("MainPackage","app.json"),this.fileHelper=e,this.from="rule"}async resolve(){if(this.clearError(),this.path=null,this.fileHelper.exist(this.request))return this.path=this.request,!0;throw this.markError(new Error(`The file ${this.request} doesn't exist`))}}class P extends x{constructor(e){super("PluginPackage","plugin.json"),this.fileHelper=e,this.from="rule"}async resolve(){if(this.clearError(),this.path=null,this.fileHelper.exist(this.request))return this.path=this.request,!0;throw this.markError(new Error(`The file ${this.request} doesn't exist`))}}class A extends x{constructor(e){super("GameMainPackage","game.json"),this.fileHelper=e,this.from="rule"}async resolve(){if(this.clearError(),this.path=null,this.fileHelper.exist(this.request))return this.path=this.request,!0;throw this.markError(new Error(`The file ${this.request} doesn't exist`))}}class I extends x{constructor(e,t,s){super("SubPackage",e.root.endsWith("/")||e.root.endsWith(".js")?e.root:e.root+"/",t),this.fileHelper=s,this.config=e,this.from="json"}async resolve(){if(this.clearError(),this.path=null,this.fileHelper.existDir(this.config.root)||this.fileHelper.existFile(this.config.root))return this.path=this.request,!0;throw this.markError(new Error(`The subpackage directory or file "${this.config.root}" doesn't exist`))}serialize(){return Object.assign(Object.assign({},super.serialize()),{config:this.config})}}class N{constructor(e,t){this.parentDeps=new Set,this.deps=new Set,this.warnings=[],this.errors=[],this.mtime=0,this.type=t.type,this.path=t.path,this.id=this.type+":"+this.path,this.parentDeps.add(t),this.fileHelper=e,this.mtime=this.fileHelper.mtime(this.path)}isValid(){return this.mtime===this.fileHelper.mtime(this.path)}addDep(e){this.deps.add(e)}removeDep(e){var t;this.deps.delete(e),null===(t=e.module)||void 0===t||t.parentDeps.delete(e)}removeAllDeps(){this.deps.forEach((e=>{this.removeDep(e)}))}addParentDep(e){e.module=this,this.parentDeps.add(e)}markError(e,t){this.errors.push({type:e,error:t})}serialize(){return{id:this.id,type:this.type,path:this.path,parentDeps:Array.from(this.parentDeps).sort(((e,t)=>e.originModule.id>t.originModule.id?1:-1)).map((e=>e.serialize())),deps:Array.from(this.deps).map((e=>e.serialize())),errors:this.errors.map((e=>({type:e.type,error:e.error instanceof Error?e.error.message:String(e.error)})))}}get childModules(){const e=[];for(const t of this.deps.values())t.module&&e.push(t.module);return e}findChild(e){var t;for(const s of this.deps.values())if((null===(t=s.module)||void 0===t?void 0:t.type)===e)return s.module;return null}findChildren(e){return this.childModules.filter((t=>t.type===e))}}var T;(T=exports.ModuleErrorType||(exports.ModuleErrorType={})).APP_JSON_NOT_FOUND="APP_JSON_NOT_FOUND",T.COMP_JSON_NOT_FOUND="COMP_JSON_NOT_FOUND",T.PLUGIN_JSON_NOT_FOUND="PLUGIN_JSON_NOT_FOUND",T.FILE_NOT_FOUND="FILE_NOT_FOUND",T.FILE_NOT_UTF8="FILE_NOT_UTF8",T.JSON_PARSE_ERR="JSON_PARSE_ERR",T.WXML_PARSE_ERR="WXML_PARSE_ERR",T.WXSS_PARSE_ERR="WXSS_PARSE_ERR",T.JS_PARSE_ERR="JS_PARSE_ERR",T.JS_RESOLVE_DEPENDENCY_ERR="JS_RESOLVE_DEPENDENCY_ERR",T.WORKER_DIR_NOT_EXIST="WORKER_DIR_NOT_EXIST";class D extends N{constructor(e,t){super(e,t),this.config=null}async build(e){let t=this.path.replace(/\.json$/,"");return this.addDep(new y("Wxml",t+".wxml",this,this.fileHelper,!1,!0)),this.addDep(new y("Js",t+".js",this,this.fileHelper,!1,!0)),this.addDep(new y("Wxss",t+".wxss",this,this.fileHelper,!1,!1)),this.fileHelper.existFile(this.path)&&await this.processJsonDeps(),Array.from(this.deps)}async loadJSON(e){const t=this.fileHelper;try{return await t.getJSON(e)}catch(e){this.markError(exports.ModuleErrorType.JSON_PARSE_ERR,e)}return null}async processJsonDeps(){let e=this.config=await this.loadJSON(this.path);e&&e.usingComponents&&Object.keys(e.usingComponents).forEach((t=>{let s=e.usingComponents[t],i=new b(t,s,this,this.fileHelper);this.addDep(i)}))}}var R={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},L="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",V={5:L,"5module":L+" export import",6:L+" const class extends export import super"},O=/^in(stanceof)?$/,M="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࣇऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-鿼ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-ꟊꟵ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",B="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿᫀᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",F=new RegExp("["+M+"]"),H=new RegExp("["+M+B+"]");M=B=null;var j=[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,157,310,10,21,11,7,153,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,107,20,28,22,13,52,76,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,85,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,230,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,35,56,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,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,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,8952,286,50,2,18,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,2357,44,11,6,17,0,370,43,1301,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,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938],q=[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,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,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,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,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,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239];function W(e,t){for(var s=65536,i=0;i<t.length;i+=2){if((s+=t[i])>e)return!1;if((s+=t[i+1])>=e)return!0}}function U(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&F.test(String.fromCharCode(e)):!1!==t&&W(e,j)))}function G(e,t){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&H.test(String.fromCharCode(e)):!1!==t&&(W(e,j)||W(e,q)))))}var J=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function z(e,t){return new J(e,{beforeExpr:!0,binop:t})}var $={beforeExpr:!0},K={startsExpr:!0},Q={};function X(e,t){return void 0===t&&(t={}),t.keyword=e,Q[e]=new J(e,t)}var Y={num:new J("num",K),regexp:new J("regexp",K),string:new J("string",K),name:new J("name",K),eof:new J("eof"),bracketL:new J("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new J("]"),braceL:new J("{",{beforeExpr:!0,startsExpr:!0}),braceR:new J("}"),parenL:new J("(",{beforeExpr:!0,startsExpr:!0}),parenR:new J(")"),comma:new J(",",$),semi:new J(";",$),colon:new J(":",$),dot:new J("."),question:new J("?",$),questionDot:new J("?."),arrow:new J("=>",$),template:new J("template"),invalidTemplate:new J("invalidTemplate"),ellipsis:new J("...",$),backQuote:new J("`",K),dollarBraceL:new J("${",{beforeExpr:!0,startsExpr:!0}),eq:new J("=",{beforeExpr:!0,isAssign:!0}),assign:new J("_=",{beforeExpr:!0,isAssign:!0}),incDec:new J("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new J("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:z("||",1),logicalAND:z("&&",2),bitwiseOR:z("|",3),bitwiseXOR:z("^",4),bitwiseAND:z("&",5),equality:z("==/!=/===/!==",6),relational:z("</>/<=/>=",7),bitShift:z("<</>>/>>>",8),plusMin:new J("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:z("%",10),star:z("*",10),slash:z("/",10),starstar:new J("**",{beforeExpr:!0}),coalesce:z("??",1),_break:X("break"),_case:X("case",$),_catch:X("catch"),_continue:X("continue"),_debugger:X("debugger"),_default:X("default",$),_do:X("do",{isLoop:!0,beforeExpr:!0}),_else:X("else",$),_finally:X("finally"),_for:X("for",{isLoop:!0}),_function:X("function",K),_if:X("if"),_return:X("return",$),_switch:X("switch"),_throw:X("throw",$),_try:X("try"),_var:X("var"),_const:X("const"),_while:X("while",{isLoop:!0}),_with:X("with"),_new:X("new",{beforeExpr:!0,startsExpr:!0}),_this:X("this",K),_super:X("super",K),_class:X("class",K),_extends:X("extends",$),_export:X("export"),_import:X("import",K),_null:X("null",K),_true:X("true",K),_false:X("false",K),_in:X("in",{beforeExpr:!0,binop:7}),_instanceof:X("instanceof",{beforeExpr:!0,binop:7}),_typeof:X("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:X("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:X("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},Z=/\r\n?|\n|\u2028|\u2029/,ee=new RegExp(Z.source,"g");function te(e,t){return 10===e||13===e||!t&&(8232===e||8233===e)}var se=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,ie=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,re=Object.prototype,ae=re.hasOwnProperty,ne=re.toString;function oe(e,t){return ae.call(e,t)}var he=Array.isArray||function(e){return"[object Array]"===ne.call(e)};function pe(e){return new RegExp("^(?:"+e.replace(/ /g,"|")+")$")}var le=function(e,t){this.line=e,this.column=t};le.prototype.offset=function(e){return new le(this.line,this.column+e)};var ce=function(e,t,s){this.start=t,this.end=s,null!==e.sourceFile&&(this.source=e.sourceFile)};function ue(e,t){for(var s=1,i=0;;){ee.lastIndex=i;var r=ee.exec(e);if(!(r&&r.index<t))return new le(s,t-i);++s,i=r.index+r[0].length}}var de={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:!1,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1,skipStatementPos:Number.POSITIVE_INFINITY},fe=!1;function me(e){var t={};for(var s in de)t[s]=e&&oe(e,s)?e[s]:de[s];if("latest"===t.ecmaVersion?t.ecmaVersion=1e8:null==t.ecmaVersion?(!fe&&"object"==typeof console&&console.warn&&(fe=!0,console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),he(t.onToken)){var i=t.onToken;t.onToken=function(e){return i.push(e)}}return he(t.onComment)&&(t.onComment=function(e,t){return function(s,i,r,a,n,o){var h={type:s?"Block":"Line",value:i,start:r,end:a};e.locations&&(h.loc=new ce(this,n,o)),e.ranges&&(h.range=[r,a]),t.push(h)}}(t,t.onComment)),t}function ge(e,t){return 2|(e?4:0)|(t?8:0)}var xe=function(e,t,s){this.options=e=me(e),this.sourceFile=e.sourceFile,this.keywords=pe(V[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var i="";!0!==e.allowReserved&&(i=R[e.ecmaVersion>=6?6:5===e.ecmaVersion?5:3],"module"===e.sourceType&&(i+=" await")),this.reservedWords=pe(i);var r=(i?i+" ":"")+R.strict;this.reservedWordsStrict=pe(r),this.reservedWordsStrictBind=pe(r+" "+R.strictBind),this.input=String(t),this.containsEsc=!1,s?(this.pos=s,this.lineStart=this.input.lastIndexOf("\n",s-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(Z).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=Y.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(1),this.regexpState=null},ye={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},inNonArrowFunction:{configurable:!0}};xe.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},ye.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},ye.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0},ye.inAsync.get=function(){return(4&this.currentVarScope().flags)>0},ye.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0},ye.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},ye.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},ye.inNonArrowFunction.get=function(){return(2&this.currentThisScope().flags)>0},xe.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var s=this,i=0;i<e.length;i++)s=e[i](s);return s},xe.parse=function(e,t){return new this(t,e).parse()},xe.parseExpressionAt=function(e,t,s){var i=new this(s,e,t);return i.nextToken(),i.parseExpression()},xe.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(xe.prototype,ye);var ke=xe.prototype,we=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;function ve(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}ke.strictDirective=function(e){for(;;){ie.lastIndex=e,e+=ie.exec(this.input)[0].length;var t=we.exec(this.input.slice(e));if(!t)return!1;if("use strict"===(t[1]||t[2])){ie.lastIndex=e+t[0].length;var s=ie.exec(this.input),i=s.index+s[0].length,r=this.input.charAt(i);return";"===r||"}"===r||Z.test(s[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(r)||"!"===r&&"="===this.input.charAt(i+1))}e+=t[0].length,ie.lastIndex=e,e+=ie.exec(this.input)[0].length,";"===this.input[e]&&e++}},ke.eat=function(e){return this.type===e&&(this.next(),!0)},ke.isContextual=function(e){return this.type===Y.name&&this.value===e&&!this.containsEsc},ke.eatContextual=function(e){return!!this.isContextual(e)&&(this.next(),!0)},ke.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},ke.canInsertSemicolon=function(){return this.type===Y.eof||this.type===Y.braceR||Z.test(this.input.slice(this.lastTokEnd,this.start))},ke.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},ke.semicolon=function(){this.eat(Y.semi)||this.insertSemicolon()||this.unexpected()},ke.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},ke.expect=function(e){this.eat(e)||this.unexpected()},ke.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")},ke.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var s=t?e.parenthesizedAssign:e.parenthesizedBind;s>-1&&this.raiseRecoverable(s,"Parenthesized pattern")}},ke.checkExpressionErrors=function(e,t){if(!e)return!1;var s=e.shorthandAssign,i=e.doubleProto;if(!t)return s>=0||i>=0;s>=0&&this.raise(s,"Shorthand property assignments are valid only in destructuring patterns"),i>=0&&this.raiseRecoverable(i,"Redefinition of __proto__ property")},ke.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},ke.isSimpleAssignTarget=function(e){return"ParenthesizedExpression"===e.type?this.isSimpleAssignTarget(e.expression):"Identifier"===e.type||"MemberExpression"===e.type};var be=xe.prototype;be.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==Y.eof&&this.start<=this.options.skipStatementPos;){var s=this.parseStatement(null,!0,t);e.body.push(s)}if(this.inModule)for(var i=0,r=Object.keys(this.undefinedExports);i<r.length;i+=1){var a=r[i];this.raiseRecoverable(this.undefinedExports[a].start,"Export '"+a+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,"Program")};var Ee={kind:"loop"},Se={kind:"switch"};be.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;ie.lastIndex=this.pos;var t=ie.exec(this.input),s=this.pos+t[0].length,i=this.input.charCodeAt(s);if(91===i)return!0;if(e)return!1;if(123===i)return!0;if(U(i,!0)){for(var r=s+1;G(this.input.charCodeAt(r),!0);)++r;var a=this.input.slice(s,r);if(!O.test(a))return!0}return!1},be.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;ie.lastIndex=this.pos;var e=ie.exec(this.input),t=this.pos+e[0].length;return!(Z.test(this.input.slice(this.pos,t))||"function"!==this.input.slice(t,t+8)||t+8!==this.input.length&&G(this.input.charAt(t+8)))},be.parseStatement=function(e,t,s){var i,r=this.type,a=this.startNode();switch(this.isLet(e)&&(r=Y._var,i="let"),r){case Y._break:case Y._continue:return this.parseBreakContinueStatement(a,r.keyword);case Y._debugger:return this.parseDebuggerStatement(a);case Y._do:return this.parseDoStatement(a);case Y._for:return this.parseForStatement(a);case Y._function:return e&&(this.strict||"if"!==e&&"label"!==e)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(a,!1,!e);case Y._class:return e&&this.unexpected(),this.parseClass(a,!0);case Y._if:return this.parseIfStatement(a);case Y._return:return this.parseReturnStatement(a);case Y._switch:return this.parseSwitchStatement(a);case Y._throw:return this.parseThrowStatement(a);case Y._try:return this.parseTryStatement(a);case Y._const:case Y._var:return i=i||this.value,e&&"var"!==i&&this.unexpected(),this.parseVarStatement(a,i);case Y._while:return this.parseWhileStatement(a);case Y._with:return this.parseWithStatement(a);case Y.braceL:return this.parseBlock(!0,a);case Y.semi:return this.parseEmptyStatement(a);case Y._export:case Y._import:if(this.options.ecmaVersion>10&&r===Y._import){ie.lastIndex=this.pos;var n=ie.exec(this.input),o=this.pos+n[0].length,h=this.input.charCodeAt(o);if(40===h||46===h)return this.parseExpressionStatement(a,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===Y._import?this.parseImport(a):this.parseExport(a,s);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(a,!0,!e);var p=this.value,l=this.parseExpression();return r===Y.name&&"Identifier"===l.type&&this.eat(Y.colon)?this.parseLabeledStatement(a,p,l,e):this.parseExpressionStatement(a,l)}},be.parseBreakContinueStatement=function(e,t){var s="break"===t;this.next(),this.eat(Y.semi)||this.insertSemicolon()?e.label=null:this.type!==Y.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var i=0;i<this.labels.length;++i){var r=this.labels[i];if(null==e.label||r.name===e.label.name){if(null!=r.kind&&(s||"loop"===r.kind))break;if(e.label&&s)break}}return i===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,s?"BreakStatement":"ContinueStatement")},be.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")},be.parseDoStatement=function(e){return this.next(),this.labels.push(Ee),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(Y._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(Y.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},be.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction)&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Ee),this.enterScope(0),this.expect(Y.parenL),this.type===Y.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var s=this.isLet();if(this.type===Y._var||this.type===Y._const||s){var i=this.startNode(),r=s?"let":this.value;return this.next(),this.parseVar(i,!0,r),this.finishNode(i,"VariableDeclaration"),(this.type===Y._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===i.declarations.length?(this.options.ecmaVersion>=9&&(this.type===Y._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,i)):(t>-1&&this.unexpected(t),this.parseFor(e,i))}var a=new ve,n=this.parseExpression(!0,a);return this.type===Y._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.options.ecmaVersion>=9&&(this.type===Y._in?t>-1&&this.unexpected(t):e.await=t>-1),this.toAssignable(n,!1,a),this.checkLValPattern(n),this.parseForIn(e,n)):(this.checkExpressionErrors(a,!0),t>-1&&this.unexpected(t),this.parseFor(e,n))},be.parseFunctionStatement=function(e,t,s){return this.next(),this.parseFunction(e,Ce|(s?0:Pe),!1,t)},be.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(Y._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},be.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(Y.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},be.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(Y.braceL),this.labels.push(Se),this.enterScope(0);for(var s=!1;this.type!==Y.braceR;)if(this.type===Y._case||this.type===Y._default){var i=this.type===Y._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),i?t.test=this.parseExpression():(s&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),s=!0,t.test=null),this.expect(Y.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},be.parseThrowStatement=function(e){return this.next(),Z.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var _e=[];be.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===Y._catch){var t=this.startNode();if(this.next(),this.eat(Y.parenL)){t.param=this.parseBindingAtom();var s="Identifier"===t.param.type;this.enterScope(s?32:0),this.checkLValPattern(t.param,s?4:2),this.expect(Y.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0);t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(Y._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},be.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},be.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Ee),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},be.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},be.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},be.parseLabeledStatement=function(e,t,s,i){for(var r=0,a=this.labels;r<a.length;r+=1){a[r].name===t&&this.raise(s.start,"Label '"+t+"' is already declared")}for(var n=this.type.isLoop?"loop":this.type===Y._switch?"switch":null,o=this.labels.length-1;o>=0;o--){var h=this.labels[o];if(h.statementStart!==e.start)break;h.statementStart=this.start,h.kind=n}return this.labels.push({name:t,kind:n,statementStart:this.start}),e.body=this.parseStatement(i?-1===i.indexOf("label")?i+"label":i:"label"),this.labels.pop(),e.label=s,this.finishNode(e,"LabeledStatement")},be.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},be.parseBlock=function(e,t,s){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect(Y.braceL),e&&this.enterScope(0);this.type!==Y.braceR;){var i=this.parseStatement(null);t.body.push(i)}return s&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},be.parseFor=function(e,t){return e.init=t,this.expect(Y.semi),e.test=this.type===Y.semi?null:this.parseExpression(),this.expect(Y.semi),e.update=this.type===Y.parenR?null:this.parseExpression(),this.expect(Y.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},be.parseForIn=function(e,t){var s=this.type===Y._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!s||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)&&this.raise(t.start,(s?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=s?this.parseExpression():this.parseMaybeAssign(),this.expect(Y.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,s?"ForInStatement":"ForOfStatement")},be.parseVar=function(e,t,s){for(e.declarations=[],e.kind=s;;){var i=this.startNode();if(this.parseVarId(i,s),this.eat(Y.eq)?i.init=this.parseMaybeAssign(t):"const"!==s||this.type===Y._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===i.id.type||t&&(this.type===Y._in||this.isContextual("of"))?i.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(i,"VariableDeclarator")),!this.eat(Y.comma))break}return e},be.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,"var"===t?1:2,!1)};var Ce=1,Pe=2;be.parseFunction=function(e,t,s,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!i)&&(this.type===Y.star&&t&Pe&&this.unexpected(),e.generator=this.eat(Y.star)),this.options.ecmaVersion>=8&&(e.async=!!i),t&Ce&&(e.id=4&t&&this.type!==Y.name?null:this.parseIdent(),!e.id||t&Pe||this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?1:2:3));var r=this.yieldPos,a=this.awaitPos,n=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ge(e.async,e.generator)),t&Ce||(e.id=this.type===Y.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,s,!1),this.yieldPos=r,this.awaitPos=a,this.awaitIdentPos=n,this.finishNode(e,t&Ce?"FunctionDeclaration":"FunctionExpression")},be.parseFunctionParams=function(e){this.expect(Y.parenL),e.params=this.parseBindingList(Y.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},be.parseClass=function(e,t){this.next();var s=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var i=this.startNode(),r=!1;for(i.body=[],this.expect(Y.braceL);this.type!==Y.braceR;){var a=this.parseClassElement(null!==e.superClass);a&&(i.body.push(a),"MethodDefinition"===a.type&&"constructor"===a.kind&&(r&&this.raise(a.start,"Duplicate constructor in the same class"),r=!0))}return this.strict=s,this.next(),e.body=this.finishNode(i,"ClassBody"),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},be.parseClassElement=function(e){var t=this;if(this.eat(Y.semi))return null;var s=this.startNode(),i=function(e,i){void 0===i&&(i=!1);var r=t.start,a=t.startLoc;return!!t.eatContextual(e)&&(!(t.type===Y.parenL||i&&t.canInsertSemicolon())||(s.key&&t.unexpected(),s.computed=!1,s.key=t.startNodeAt(r,a),s.key.name=e,t.finishNode(s.key,"Identifier"),!1))};s.kind="method",s.static=i("static");var r=this.eat(Y.star),a=!1;r||(this.options.ecmaVersion>=8&&i("async",!0)?(a=!0,r=this.options.ecmaVersion>=9&&this.eat(Y.star)):i("get")?s.kind="get":i("set")&&(s.kind="set")),s.key||this.parsePropertyName(s);var n=s.key,o=!1;return s.computed||s.static||!("Identifier"===n.type&&"constructor"===n.name||"Literal"===n.type&&"constructor"===n.value)?s.static&&"Identifier"===n.type&&"prototype"===n.name&&this.raise(n.start,"Classes may not have a static property named prototype"):("method"!==s.kind&&this.raise(n.start,"Constructor can't have get/set modifier"),r&&this.raise(n.start,"Constructor can't be a generator"),a&&this.raise(n.start,"Constructor can't be an async method"),s.kind="constructor",o=e),this.parseClassMethod(s,r,a,o),"get"===s.kind&&0!==s.value.params.length&&this.raiseRecoverable(s.value.start,"getter should have no params"),"set"===s.kind&&1!==s.value.params.length&&this.raiseRecoverable(s.value.start,"setter should have exactly one param"),"set"===s.kind&&"RestElement"===s.value.params[0].type&&this.raiseRecoverable(s.value.params[0].start,"Setter cannot use rest params"),s},be.parseClassMethod=function(e,t,s,i){return e.value=this.parseMethod(t,s,i),this.finishNode(e,"MethodDefinition")},be.parseClassId=function(e,t){this.type===Y.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,2,!1)):(!0===t&&this.unexpected(),e.id=null)},be.parseClassSuper=function(e){e.superClass=this.eat(Y._extends)?this.parseExprSubscripts():null},be.parseExport=function(e,t){if(this.next(),this.eat(Y.star))return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseIdent(!0),this.checkExport(t,e.exported.name,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==Y.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(Y._default)){var s;if(this.checkExport(t,"default",this.lastTokStart),this.type===Y._function||(s=this.isAsyncFunction())){var i=this.startNode();this.next(),s&&this.next(),e.declaration=this.parseFunction(i,4|Ce,!1,s)}else if(this.type===Y._class){var r=this.startNode();e.declaration=this.parseClass(r,"nullableID")}else e.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(null),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id.name,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==Y.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var a=0,n=e.specifiers;a<n.length;a+=1){var o=n[a];this.checkUnreserved(o.local),this.checkLocalExport(o.local)}e.source=null}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")},be.checkExport=function(e,t,s){e&&(oe(e,t)&&this.raiseRecoverable(s,"Duplicate export '"+t+"'"),e[t]=!0)},be.checkPatternExport=function(e,t){var s=t.type;if("Identifier"===s)this.checkExport(e,t.name,t.start);else if("ObjectPattern"===s)for(var i=0,r=t.properties;i<r.length;i+=1){var a=r[i];this.checkPatternExport(e,a)}else if("ArrayPattern"===s)for(var n=0,o=t.elements;n<o.length;n+=1){var h=o[n];h&&this.checkPatternExport(e,h)}else"Property"===s?this.checkPatternExport(e,t.value):"AssignmentPattern"===s?this.checkPatternExport(e,t.left):"RestElement"===s?this.checkPatternExport(e,t.argument):"ParenthesizedExpression"===s&&this.checkPatternExport(e,t.expression)},be.checkVariableExport=function(e,t){if(e)for(var s=0,i=t;s<i.length;s+=1){var r=i[s];this.checkPatternExport(e,r.id)}},be.shouldParseExportStatement=function(){return"var"===this.type.keyword||"const"===this.type.keyword||"class"===this.type.keyword||"function"===this.type.keyword||this.isLet()||this.isAsyncFunction()},be.parseExportSpecifiers=function(e){var t=[],s=!0;for(this.expect(Y.braceL);!this.eat(Y.braceR);){if(s)s=!1;else if(this.expect(Y.comma),this.afterTrailingComma(Y.braceR))break;var i=this.startNode();i.local=this.parseIdent(!0),i.exported=this.eatContextual("as")?this.parseIdent(!0):i.local,this.checkExport(e,i.exported.name,i.exported.start),t.push(this.finishNode(i,"ExportSpecifier"))}return t},be.parseImport=function(e){return this.next(),this.type===Y.string?(e.specifiers=_e,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===Y.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},be.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===Y.name){var s=this.startNode();if(s.local=this.parseIdent(),this.checkLValSimple(s.local,2),e.push(this.finishNode(s,"ImportDefaultSpecifier")),!this.eat(Y.comma))return e}if(this.type===Y.star){var i=this.startNode();return this.next(),this.expectContextual("as"),i.local=this.parseIdent(),this.checkLValSimple(i.local,2),e.push(this.finishNode(i,"ImportNamespaceSpecifier")),e}for(this.expect(Y.braceL);!this.eat(Y.braceR);){if(t)t=!1;else if(this.expect(Y.comma),this.afterTrailingComma(Y.braceR))break;var r=this.startNode();r.imported=this.parseIdent(!0),this.eatContextual("as")?r.local=this.parseIdent():(this.checkUnreserved(r.imported),r.local=r.imported),this.checkLValSimple(r.local,2),e.push(this.finishNode(r,"ImportSpecifier"))}return e},be.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},be.isDirectiveCandidate=function(e){return"ExpressionStatement"===e.type&&"Literal"===e.expression.type&&"string"==typeof e.expression.value&&('"'===this.input[e.start]||"'"===this.input[e.start])};var Ae=xe.prototype;Ae.toAssignable=function(e,t,s){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",s&&this.checkPatternErrors(s,!0);for(var i=0,r=e.properties;i<r.length;i+=1){var a=r[i];this.toAssignable(a,t),"RestElement"!==a.type||"ArrayPattern"!==a.argument.type&&"ObjectPattern"!==a.argument.type||this.raise(a.argument.start,"Unexpected token")}break;case"Property":"init"!==e.kind&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",s&&this.checkPatternErrors(s,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),"AssignmentPattern"===e.argument.type&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":"="!==e.operator&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,s);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else s&&this.checkPatternErrors(s,!0);return e},Ae.toAssignableList=function(e,t){for(var s=e.length,i=0;i<s;i++){var r=e[i];r&&this.toAssignable(r,t)}if(s){var a=e[s-1];6===this.options.ecmaVersion&&t&&a&&"RestElement"===a.type&&"Identifier"!==a.argument.type&&this.unexpected(a.argument.start)}return e},Ae.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")},Ae.parseRestBinding=function(){var e=this.startNode();return this.next(),6===this.options.ecmaVersion&&this.type!==Y.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")},Ae.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case Y.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(Y.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case Y.braceL:return this.parseObj(!0)}return this.parseIdent()},Ae.parseBindingList=function(e,t,s){for(var i=[],r=!0;!this.eat(e);)if(r?r=!1:this.expect(Y.comma),t&&this.type===Y.comma)i.push(null);else{if(s&&this.afterTrailingComma(e))break;if(this.type===Y.ellipsis){var a=this.parseRestBinding();this.parseBindingListItem(a),i.push(a),this.type===Y.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}var n=this.parseMaybeDefault(this.start,this.startLoc);this.parseBindingListItem(n),i.push(n)}return i},Ae.parseBindingListItem=function(e){return e},Ae.parseMaybeDefault=function(e,t,s){if(s=s||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(Y.eq))return s;var i=this.startNodeAt(e,t);return i.left=s,i.right=this.parseMaybeAssign(),this.finishNode(i,"AssignmentPattern")},Ae.checkLValSimple=function(e,t,s){void 0===t&&(t=0);var i=0!==t;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(i?"Binding ":"Assigning to ")+e.name+" in strict mode"),i&&(2===t&&"let"===e.name&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),s&&(oe(s,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),s[e.name]=!0),5!==t&&this.declareName(e.name,t,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":i&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return i&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,s);default:this.raise(e.start,(i?"Binding":"Assigning to")+" rvalue")}},Ae.checkLValPattern=function(e,t,s){switch(void 0===t&&(t=0),e.type){case"ObjectPattern":for(var i=0,r=e.properties;i<r.length;i+=1){var a=r[i];this.checkLValInnerPattern(a,t,s)}break;case"ArrayPattern":for(var n=0,o=e.elements;n<o.length;n+=1){var h=o[n];h&&this.checkLValInnerPattern(h,t,s)}break;default:this.checkLValSimple(e,t,s)}},Ae.checkLValInnerPattern=function(e,t,s){switch(void 0===t&&(t=0),e.type){case"Property":this.checkLValInnerPattern(e.value,t,s);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,s);break;case"RestElement":this.checkLValPattern(e.argument,t,s);break;default:this.checkLValPattern(e,t,s)}};var Ie=xe.prototype;Ie.checkPropClash=function(e,t,s){if(!(this.options.ecmaVersion>=9&&"SpreadElement"===e.type||this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var i,r=e.key;switch(r.type){case"Identifier":i=r.name;break;case"Literal":i=String(r.value);break;default:return}var a=e.kind;if(this.options.ecmaVersion>=6)"__proto__"===i&&"init"===a&&(t.proto&&(s?s.doubleProto<0&&(s.doubleProto=r.start):this.raiseRecoverable(r.start,"Redefinition of __proto__ property")),t.proto=!0);else{var n=t[i="$"+i];if(n)("init"===a?this.strict&&n.init||n.get||n.set:n.init||n[a])&&this.raiseRecoverable(r.start,"Redefinition of property");else n=t[i]={init:!1,get:!1,set:!1};n[a]=!0}}},Ie.parseExpression=function(e,t){var s=this.start,i=this.startLoc,r=this.parseMaybeAssign(e,t);if(this.type===Y.comma){var a=this.startNodeAt(s,i);for(a.expressions=[r];this.eat(Y.comma);)a.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(a,"SequenceExpression")}return r},Ie.parseMaybeAssign=function(e,t,s){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var i=!1,r=-1,a=-1;t?(r=t.parenthesizedAssign,a=t.trailingComma,t.parenthesizedAssign=t.trailingComma=-1):(t=new ve,i=!0);var n=this.start,o=this.startLoc;this.type!==Y.parenL&&this.type!==Y.name||(this.potentialArrowAt=this.start);var h=this.parseMaybeConditional(e,t);if(s&&(h=s.call(this,h,n,o)),this.type.isAssign){var p=this.startNodeAt(n,o);return p.operator=this.value,this.type===Y.eq&&(h=this.toAssignable(h,!1,t)),i||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=h.start&&(t.shorthandAssign=-1),this.type===Y.eq?this.checkLValPattern(h):this.checkLValSimple(h),p.left=h,this.next(),p.right=this.parseMaybeAssign(e),this.finishNode(p,"AssignmentExpression")}return i&&this.checkExpressionErrors(t,!0),r>-1&&(t.parenthesizedAssign=r),a>-1&&(t.trailingComma=a),h},Ie.parseMaybeConditional=function(e,t){var s=this.start,i=this.startLoc,r=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return r;if(this.eat(Y.question)){var a=this.startNodeAt(s,i);return a.test=r,a.consequent=this.parseMaybeAssign(),this.expect(Y.colon),a.alternate=this.parseMaybeAssign(e),this.finishNode(a,"ConditionalExpression")}return r},Ie.parseExprOps=function(e,t){var s=this.start,i=this.startLoc,r=this.parseMaybeUnary(t,!1);return this.checkExpressionErrors(t)||r.start===s&&"ArrowFunctionExpression"===r.type?r:this.parseExprOp(r,s,i,-1,e)},Ie.parseExprOp=function(e,t,s,i,r){var a=this.type.binop;if(null!=a&&(!r||this.type!==Y._in)&&a>i){var n=this.type===Y.logicalOR||this.type===Y.logicalAND,o=this.type===Y.coalesce;o&&(a=Y.logicalAND.binop);var h=this.value;this.next();var p=this.start,l=this.startLoc,c=this.parseExprOp(this.parseMaybeUnary(null,!1),p,l,a,r),u=this.buildBinary(t,s,e,c,h,n||o);return(n&&this.type===Y.coalesce||o&&(this.type===Y.logicalOR||this.type===Y.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(u,t,s,i,r)}return e},Ie.buildBinary=function(e,t,s,i,r,a){var n=this.startNodeAt(e,t);return n.left=s,n.operator=r,n.right=i,this.finishNode(n,a?"LogicalExpression":"BinaryExpression")},Ie.parseMaybeUnary=function(e,t){var s,i=this.start,r=this.startLoc;if(this.isContextual("await")&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction))s=this.parseAwait(),t=!0;else if(this.type.prefix){var a=this.startNode(),n=this.type===Y.incDec;a.operator=this.value,a.prefix=!0,this.next(),a.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(e,!0),n?this.checkLValSimple(a.argument):this.strict&&"delete"===a.operator&&"Identifier"===a.argument.type?this.raiseRecoverable(a.start,"Deleting local variable in strict mode"):t=!0,s=this.finishNode(a,n?"UpdateExpression":"UnaryExpression")}else{if(s=this.parseExprSubscripts(e),this.checkExpressionErrors(e))return s;for(;this.type.postfix&&!this.canInsertSemicolon();){var o=this.startNodeAt(i,r);o.operator=this.value,o.prefix=!1,o.argument=s,this.checkLValSimple(s),this.next(),s=this.finishNode(o,"UpdateExpression")}}return!t&&this.eat(Y.starstar)?this.buildBinary(i,r,s,this.parseMaybeUnary(null,!1),"**",!1):s},Ie.parseExprSubscripts=function(e){var t=this.start,s=this.startLoc,i=this.parseExprAtom(e);if("ArrowFunctionExpression"===i.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd))return i;var r=this.parseSubscripts(i,t,s);return e&&"MemberExpression"===r.type&&(e.parenthesizedAssign>=r.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=r.start&&(e.parenthesizedBind=-1)),r},Ie.parseSubscripts=function(e,t,s,i){for(var r=this.options.ecmaVersion>=8&&"Identifier"===e.type&&"async"===e.name&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start==5&&this.potentialArrowAt===e.start,a=!1;;){var n=this.parseSubscript(e,t,s,i,r,a);if(n.optional&&(a=!0),n===e||"ArrowFunctionExpression"===n.type){if(a){var o=this.startNodeAt(t,s);o.expression=n,n=this.finishNode(o,"ChainExpression")}return n}e=n}},Ie.parseSubscript=function(e,t,s,i,r,a){var n=this.options.ecmaVersion>=11,o=n&&this.eat(Y.questionDot);i&&o&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var h=this.eat(Y.bracketL);if(h||o&&this.type!==Y.parenL&&this.type!==Y.backQuote||this.eat(Y.dot)){var p=this.startNodeAt(t,s);p.object=e,p.property=h?this.parseExpression():this.parseIdent("never"!==this.options.allowReserved),p.computed=!!h,h&&this.expect(Y.bracketR),n&&(p.optional=o),e=this.finishNode(p,"MemberExpression")}else if(!i&&this.eat(Y.parenL)){var l=new ve,c=this.yieldPos,u=this.awaitPos,d=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var f=this.parseExprList(Y.parenR,this.options.ecmaVersion>=8,!1,l);if(r&&!o&&!this.canInsertSemicolon()&&this.eat(Y.arrow))return this.checkPatternErrors(l,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=c,this.awaitPos=u,this.awaitIdentPos=d,this.parseArrowExpression(this.startNodeAt(t,s),f,!0);this.checkExpressionErrors(l,!0),this.yieldPos=c||this.yieldPos,this.awaitPos=u||this.awaitPos,this.awaitIdentPos=d||this.awaitIdentPos;var m=this.startNodeAt(t,s);m.callee=e,m.arguments=f,n&&(m.optional=o),e=this.finishNode(m,"CallExpression")}else if(this.type===Y.backQuote){(o||a)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var g=this.startNodeAt(t,s);g.tag=e,g.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(g,"TaggedTemplateExpression")}return e},Ie.parseExprAtom=function(e){this.type===Y.slash&&this.readRegexp();var t,s=this.potentialArrowAt===this.start;switch(this.type){case Y._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),t=this.startNode(),this.next(),this.type!==Y.parenL||this.allowDirectSuper||this.raise(t.start,"super() call outside constructor of a subclass"),this.type!==Y.dot&&this.type!==Y.bracketL&&this.type!==Y.parenL&&this.unexpected(),this.finishNode(t,"Super");case Y._this:return t=this.startNode(),this.next(),this.finishNode(t,"ThisExpression");case Y.name:var i=this.start,r=this.startLoc,a=this.containsEsc,n=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!a&&"async"===n.name&&!this.canInsertSemicolon()&&this.eat(Y._function))return this.parseFunction(this.startNodeAt(i,r),0,!1,!0);if(s&&!this.canInsertSemicolon()){if(this.eat(Y.arrow))return this.parseArrowExpression(this.startNodeAt(i,r),[n],!1);if(this.options.ecmaVersion>=8&&"async"===n.name&&this.type===Y.name&&!a)return n=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(Y.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(i,r),[n],!0)}return n;case Y.regexp:var o=this.value;return(t=this.parseLiteral(o.value)).regex={pattern:o.pattern,flags:o.flags},t;case Y.num:case Y.string:return this.parseLiteral(this.value);case Y._null:case Y._true:case Y._false:return(t=this.startNode()).value=this.type===Y._null?null:this.type===Y._true,t.raw=this.type.keyword,this.next(),this.finishNode(t,"Literal");case Y.parenL:var h=this.start,p=this.parseParenAndDistinguishExpression(s);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(p)&&(e.parenthesizedAssign=h),e.parenthesizedBind<0&&(e.parenthesizedBind=h)),p;case Y.bracketL:return t=this.startNode(),this.next(),t.elements=this.parseExprList(Y.bracketR,!0,!0,e),this.finishNode(t,"ArrayExpression");case Y.braceL:return this.parseObj(!1,e);case Y._function:return t=this.startNode(),this.next(),this.parseFunction(t,0);case Y._class:return this.parseClass(this.startNode(),!1);case Y._new:return this.parseNew();case Y.backQuote:return this.parseTemplate();case Y._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}},Ie.parseExprImport=function(){var e=this.startNode();this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import");var t=this.parseIdent(!0);switch(this.type){case Y.parenL:return this.parseDynamicImport(e);case Y.dot:return e.meta=t,this.parseImportMeta(e);default:this.unexpected()}},Ie.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(Y.parenR)){var t=this.start;this.eat(Y.comma)&&this.eat(Y.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},Ie.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),"meta"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),"module"!==this.options.sourceType&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},Ie.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),110===t.raw.charCodeAt(t.raw.length-1)&&(t.bigint=t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")},Ie.parseParenExpression=function(){this.expect(Y.parenL);var e=this.parseExpression();return this.expect(Y.parenR),e},Ie.parseParenAndDistinguishExpression=function(e){var t,s=this.start,i=this.startLoc,r=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var a,n=this.start,o=this.startLoc,h=[],p=!0,l=!1,c=new ve,u=this.yieldPos,d=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==Y.parenR;){if(p?p=!1:this.expect(Y.comma),r&&this.afterTrailingComma(Y.parenR,!0)){l=!0;break}if(this.type===Y.ellipsis){a=this.start,h.push(this.parseParenItem(this.parseRestBinding())),this.type===Y.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}h.push(this.parseMaybeAssign(!1,c,this.parseParenItem))}var f=this.start,m=this.startLoc;if(this.expect(Y.parenR),e&&!this.canInsertSemicolon()&&this.eat(Y.arrow))return this.checkPatternErrors(c,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=u,this.awaitPos=d,this.parseParenArrowList(s,i,h);h.length&&!l||this.unexpected(this.lastTokStart),a&&this.unexpected(a),this.checkExpressionErrors(c,!0),this.yieldPos=u||this.yieldPos,this.awaitPos=d||this.awaitPos,h.length>1?((t=this.startNodeAt(n,o)).expressions=h,this.finishNodeAt(t,"SequenceExpression",f,m)):t=h[0]}else t=this.parseParenExpression();if(this.options.preserveParens){var g=this.startNodeAt(s,i);return g.expression=t,this.finishNode(g,"ParenthesizedExpression")}return t},Ie.parseParenItem=function(e){return e},Ie.parseParenArrowList=function(e,t,s){return this.parseArrowExpression(this.startNodeAt(e,t),s)};var Ne=[];Ie.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(Y.dot)){e.meta=t;var s=this.containsEsc;return e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),s&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.inNonArrowFunction||this.raiseRecoverable(e.start,"'new.target' can only be used in functions"),this.finishNode(e,"MetaProperty")}var i=this.start,r=this.startLoc,a=this.type===Y._import;return e.callee=this.parseSubscripts(this.parseExprAtom(),i,r,!0),a&&"ImportExpression"===e.callee.type&&this.raise(i,"Cannot use new with import()"),this.eat(Y.parenL)?e.arguments=this.parseExprList(Y.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Ne,this.finishNode(e,"NewExpression")},Ie.parseTemplateElement=function(e){var t=e.isTagged,s=this.startNode();return this.type===Y.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),s.value={raw:this.value,cooked:null}):s.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),s.tail=this.type===Y.backQuote,this.finishNode(s,"TemplateElement")},Ie.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var s=this.startNode();this.next(),s.expressions=[];var i=this.parseTemplateElement({isTagged:t});for(s.quasis=[i];!i.tail;)this.type===Y.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(Y.dollarBraceL),s.expressions.push(this.parseExpression()),this.expect(Y.braceR),s.quasis.push(i=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(s,"TemplateLiteral")},Ie.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===Y.name||this.type===Y.num||this.type===Y.string||this.type===Y.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===Y.star)&&!Z.test(this.input.slice(this.lastTokEnd,this.start))},Ie.parseObj=function(e,t){var s=this.startNode(),i=!0,r={};for(s.properties=[],this.next();!this.eat(Y.braceR);){if(i)i=!1;else if(this.expect(Y.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(Y.braceR))break;var a=this.parseProperty(e,t);e||this.checkPropClash(a,r,t),s.properties.push(a)}return this.finishNode(s,e?"ObjectPattern":"ObjectExpression")},Ie.parseProperty=function(e,t){var s,i,r,a,n=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(Y.ellipsis))return e?(n.argument=this.parseIdent(!1),this.type===Y.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(n,"RestElement")):(this.type===Y.parenL&&t&&(t.parenthesizedAssign<0&&(t.parenthesizedAssign=this.start),t.parenthesizedBind<0&&(t.parenthesizedBind=this.start)),n.argument=this.parseMaybeAssign(!1,t),this.type===Y.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(n,"SpreadElement"));this.options.ecmaVersion>=6&&(n.method=!1,n.shorthand=!1,(e||t)&&(r=this.start,a=this.startLoc),e||(s=this.eat(Y.star)));var o=this.containsEsc;return this.parsePropertyName(n),!e&&!o&&this.options.ecmaVersion>=8&&!s&&this.isAsyncProp(n)?(i=!0,s=this.options.ecmaVersion>=9&&this.eat(Y.star),this.parsePropertyName(n,t)):i=!1,this.parsePropertyValue(n,e,s,i,r,a,t,o),this.finishNode(n,"Property")},Ie.parsePropertyValue=function(e,t,s,i,r,a,n,o){if((s||i)&&this.type===Y.colon&&this.unexpected(),this.eat(Y.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,n),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===Y.parenL)t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(s,i);else if(t||o||!(this.options.ecmaVersion>=5)||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.type===Y.comma||this.type===Y.braceR||this.type===Y.eq)this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((s||i)&&this.unexpected(),this.checkUnreserved(e.key),"await"!==e.key.name||this.awaitIdentPos||(this.awaitIdentPos=r),e.kind="init",t?e.value=this.parseMaybeDefault(r,a,this.copyNode(e.key)):this.type===Y.eq&&n?(n.shorthandAssign<0&&(n.shorthandAssign=this.start),e.value=this.parseMaybeDefault(r,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected();else{(s||i)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var h="get"===e.kind?0:1;if(e.value.params.length!==h){var p=e.value.start;"get"===e.kind?this.raiseRecoverable(p,"getter should have no params"):this.raiseRecoverable(p,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")}},Ie.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(Y.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(Y.bracketR),e.key;e.computed=!1}return e.key=this.type===Y.num||this.type===Y.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},Ie.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},Ie.parseMethod=function(e,t,s){var i=this.startNode(),r=this.yieldPos,a=this.awaitPos,n=this.awaitIdentPos;return this.initFunction(i),this.options.ecmaVersion>=6&&(i.generator=e),this.options.ecmaVersion>=8&&(i.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|ge(t,i.generator)|(s?128:0)),this.expect(Y.parenL),i.params=this.parseBindingList(Y.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(i,!1,!0),this.yieldPos=r,this.awaitPos=a,this.awaitIdentPos=n,this.finishNode(i,"FunctionExpression")},Ie.parseArrowExpression=function(e,t,s){var i=this.yieldPos,r=this.awaitPos,a=this.awaitIdentPos;return this.enterScope(16|ge(s,!1)),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!s),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1),this.yieldPos=i,this.awaitPos=r,this.awaitIdentPos=a,this.finishNode(e,"ArrowFunctionExpression")},Ie.parseFunctionBody=function(e,t,s){var i=t&&this.type!==Y.braceL,r=this.strict,a=!1;if(i)e.body=this.parseMaybeAssign(),e.expression=!0,this.checkParams(e,!1);else{var n=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);r&&!n||(a=this.strictDirective(this.end))&&n&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list");var o=this.labels;this.labels=[],a&&(this.strict=!0),this.checkParams(e,!r&&!a&&!t&&!s&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,5),e.body=this.parseBlock(!1,void 0,a&&!r),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=o}this.exitScope()},Ie.isSimpleParamList=function(e){for(var t=0,s=e;t<s.length;t+=1){if("Identifier"!==s[t].type)return!1}return!0},Ie.checkParams=function(e,t){for(var s=Object.create(null),i=0,r=e.params;i<r.length;i+=1){var a=r[i];this.checkLValInnerPattern(a,1,t?null:s)}},Ie.parseExprList=function(e,t,s,i){for(var r=[],a=!0;!this.eat(e);){if(a)a=!1;else if(this.expect(Y.comma),t&&this.afterTrailingComma(e))break;var n=void 0;s&&this.type===Y.comma?n=null:this.type===Y.ellipsis?(n=this.parseSpread(i),i&&this.type===Y.comma&&i.trailingComma<0&&(i.trailingComma=this.start)):n=this.parseMaybeAssign(!1,i),r.push(n)}return r},Ie.checkUnreserved=function(e){var t=e.start,s=e.end,i=e.name;(this.inGenerator&&"yield"===i&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&"await"===i&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),this.keywords.test(i)&&this.raise(t,"Unexpected keyword '"+i+"'"),this.options.ecmaVersion<6&&-1!==this.input.slice(t,s).indexOf("\\"))||(this.strict?this.reservedWordsStrict:this.reservedWords).test(i)&&(this.inAsync||"await"!==i||this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+i+"' is reserved"))},Ie.parseIdent=function(e,t){var s=this.startNode();return this.type===Y.name?s.name=this.value:this.type.keyword?(s.name=this.type.keyword,"class"!==s.name&&"function"!==s.name||this.lastTokEnd===this.lastTokStart+1&&46===this.input.charCodeAt(this.lastTokStart)||this.context.pop()):this.unexpected(),this.next(!!e),this.finishNode(s,"Identifier"),e||(this.checkUnreserved(s),"await"!==s.name||this.awaitIdentPos||(this.awaitIdentPos=s.start)),s},Ie.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===Y.semi||this.canInsertSemicolon()||this.type!==Y.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(Y.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")},Ie.parseAwait=function(){this.awaitPos||(this.awaitPos=this.start);var e=this.startNode();return this.next(),e.argument=this.parseMaybeUnary(null,!0),this.finishNode(e,"AwaitExpression")};var Te=xe.prototype;Te.raise=function(e,t){var s=ue(this.input,e);t+=" ("+s.line+":"+s.column+")";var i=new SyntaxError(t);throw i.pos=e,i.loc=s,i.raisedAt=this.pos,i},Te.raiseRecoverable=Te.raise,Te.curPosition=function(){if(this.options.locations)return new le(this.curLine,this.pos-this.lineStart)};var De=xe.prototype,Re=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};De.enterScope=function(e){this.scopeStack.push(new Re(e))},De.exitScope=function(){this.scopeStack.pop()},De.treatFunctionsAsVarInScope=function(e){return 2&e.flags||!this.inModule&&1&e.flags},De.declareName=function(e,t,s){var i=!1;if(2===t){var r=this.currentScope();i=r.lexical.indexOf(e)>-1||r.functions.indexOf(e)>-1||r.var.indexOf(e)>-1,r.lexical.push(e),this.inModule&&1&r.flags&&delete this.undefinedExports[e]}else if(4===t){this.currentScope().lexical.push(e)}else if(3===t){var a=this.currentScope();i=this.treatFunctionsAsVar?a.lexical.indexOf(e)>-1:a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var n=this.scopeStack.length-1;n>=0;--n){var o=this.scopeStack[n];if(o.lexical.indexOf(e)>-1&&!(32&o.flags&&o.lexical[0]===e)||!this.treatFunctionsAsVarInScope(o)&&o.functions.indexOf(e)>-1){i=!0;break}if(o.var.push(e),this.inModule&&1&o.flags&&delete this.undefinedExports[e],3&o.flags)break}i&&this.raiseRecoverable(s,"Identifier '"+e+"' has already been declared")},De.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},De.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},De.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(3&t.flags)return t}},De.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(3&t.flags&&!(16&t.flags))return t}};var Le=function(e,t,s){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new ce(e,s)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},Ve=xe.prototype;function Oe(e,t,s,i){return e.type=t,e.end=s,this.options.locations&&(e.loc.end=i),this.options.ranges&&(e.range[1]=s),e}Ve.startNode=function(){return new Le(this,this.start,this.startLoc)},Ve.startNodeAt=function(e,t){return new Le(this,e,t)},Ve.finishNode=function(e,t){return Oe.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},Ve.finishNodeAt=function(e,t,s,i){return Oe.call(this,e,t,s,i)},Ve.copyNode=function(e){var t=new Le(this,e.start,this.startLoc);for(var s in e)t[s]=e[s];return t};var Me=function(e,t,s,i,r){this.token=e,this.isExpr=!!t,this.preserveSpace=!!s,this.override=i,this.generator=!!r},Be={b_stat:new Me("{",!1),b_expr:new Me("{",!0),b_tmpl:new Me("${",!1),p_stat:new Me("(",!1),p_expr:new Me("(",!0),q_tmpl:new Me("`",!0,!0,(function(e){return e.tryReadTemplateToken()})),f_stat:new Me("function",!1),f_expr:new Me("function",!0),f_expr_gen:new Me("function",!0,!1,null,!0),f_gen:new Me("function",!1,!1,null,!0)},Fe=xe.prototype;Fe.initialContext=function(){return[Be.b_stat]},Fe.braceIsBlock=function(e){var t=this.curContext();return t===Be.f_expr||t===Be.f_stat||(e!==Y.colon||t!==Be.b_stat&&t!==Be.b_expr?e===Y._return||e===Y.name&&this.exprAllowed?Z.test(this.input.slice(this.lastTokEnd,this.start)):e===Y._else||e===Y.semi||e===Y.eof||e===Y.parenR||e===Y.arrow||(e===Y.braceL?t===Be.b_stat:e!==Y._var&&e!==Y._const&&e!==Y.name&&!this.exprAllowed):!t.isExpr)},Fe.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if("function"===t.token)return t.generator}return!1},Fe.updateContext=function(e){var t,s=this.type;s.keyword&&e===Y.dot?this.exprAllowed=!1:(t=s.updateContext)?t.call(this,e):this.exprAllowed=s.beforeExpr},Y.parenR.updateContext=Y.braceR.updateContext=function(){if(1!==this.context.length){var e=this.context.pop();e===Be.b_stat&&"function"===this.curContext().token&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}else this.exprAllowed=!0},Y.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?Be.b_stat:Be.b_expr),this.exprAllowed=!0},Y.dollarBraceL.updateContext=function(){this.context.push(Be.b_tmpl),this.exprAllowed=!0},Y.parenL.updateContext=function(e){var t=e===Y._if||e===Y._for||e===Y._with||e===Y._while;this.context.push(t?Be.p_stat:Be.p_expr),this.exprAllowed=!0},Y.incDec.updateContext=function(){},Y._function.updateContext=Y._class.updateContext=function(e){!e.beforeExpr||e===Y._else||e===Y.semi&&this.curContext()!==Be.p_stat||e===Y._return&&Z.test(this.input.slice(this.lastTokEnd,this.start))||(e===Y.colon||e===Y.braceL)&&this.curContext()===Be.b_stat?this.context.push(Be.f_stat):this.context.push(Be.f_expr),this.exprAllowed=!1},Y.backQuote.updateContext=function(){this.curContext()===Be.q_tmpl?this.context.pop():this.context.push(Be.q_tmpl),this.exprAllowed=!1},Y.star.updateContext=function(e){if(e===Y._function){var t=this.context.length-1;this.context[t]===Be.f_expr?this.context[t]=Be.f_expr_gen:this.context[t]=Be.f_gen}this.exprAllowed=!0},Y.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==Y.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var He="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",je=He+" Extended_Pictographic",qe={9:He,10:je,11:je,12:"ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS Extended_Pictographic EBase EComp EMod EPres ExtPict"},We="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Ue="Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Ge=Ue+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Je=Ge+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",ze={9:Ue,10:Ge,11:Je,12:"Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi"},$e={};function Ke(e){var t=$e[e]={binary:pe(qe[e]+" "+We),nonBinary:{General_Category:pe(We),Script:pe(ze[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}Ke(9),Ke(10),Ke(11),Ke(12);var Qe=xe.prototype,Xe=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":""),this.unicodeProperties=$e[e.options.ecmaVersion>=12?12:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};function Ye(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function Ze(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function et(e){return e>=65&&e<=90||e>=97&&e<=122}function tt(e){return et(e)||95===e}function st(e){return tt(e)||it(e)}function it(e){return e>=48&&e<=57}function rt(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function at(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function nt(e){return e>=48&&e<=55}Xe.prototype.reset=function(e,t,s){var i=-1!==s.indexOf("u");this.start=0|e,this.source=t+"",this.flags=s,this.switchU=i&&this.parser.options.ecmaVersion>=6,this.switchN=i&&this.parser.options.ecmaVersion>=9},Xe.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},Xe.prototype.at=function(e,t){void 0===t&&(t=!1);var s=this.source,i=s.length;if(e>=i)return-1;var r=s.charCodeAt(e);if(!t&&!this.switchU||r<=55295||r>=57344||e+1>=i)return r;var a=s.charCodeAt(e+1);return a>=56320&&a<=57343?(r<<10)+a-56613888:r},Xe.prototype.nextIndex=function(e,t){void 0===t&&(t=!1);var s=this.source,i=s.length;if(e>=i)return i;var r,a=s.charCodeAt(e);return!t&&!this.switchU||a<=55295||a>=57344||e+1>=i||(r=s.charCodeAt(e+1))<56320||r>57343?e+1:e+2},Xe.prototype.current=function(e){return void 0===e&&(e=!1),this.at(this.pos,e)},Xe.prototype.lookahead=function(e){return void 0===e&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},Xe.prototype.advance=function(e){void 0===e&&(e=!1),this.pos=this.nextIndex(this.pos,e)},Xe.prototype.eat=function(e,t){return void 0===t&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},Qe.validateRegExpFlags=function(e){for(var t=e.validFlags,s=e.flags,i=0;i<s.length;i++){var r=s.charAt(i);-1===t.indexOf(r)&&this.raise(e.start,"Invalid regular expression flag"),s.indexOf(r,i+1)>-1&&this.raise(e.start,"Duplicate regular expression flag")}},Qe.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))},Qe.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,s=e.backReferenceNames;t<s.length;t+=1){var i=s[t];-1===e.groupNames.indexOf(i)&&e.raise("Invalid named capture referenced")}},Qe.regexp_disjunction=function(e){for(this.regexp_alternative(e);e.eat(124);)this.regexp_alternative(e);this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")},Qe.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},Qe.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):!!(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))&&(this.regexp_eatQuantifier(e),!0)},Qe.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var s=!1;if(this.options.ecmaVersion>=9&&(s=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!s,!0}return e.pos=t,!1},Qe.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},Qe.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},Qe.regexp_eatBracedQuantifier=function(e,t){var s=e.pos;if(e.eat(123)){var i=0,r=-1;if(this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue),e.eat(125)))return-1!==r&&r<i&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=s}return!1},Qe.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},Qe.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},Qe.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)&&e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}e.pos=t}return!1},Qe.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):63===e.current()&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},Qe.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},Qe.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},Qe.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!Ze(t)&&(e.lastIntValue=t,e.advance(),!0)},Qe.regexp_eatPatternCharacters=function(e){for(var t=e.pos,s=0;-1!==(s=e.current())&&!Ze(s);)e.advance();return e.pos!==t},Qe.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return!(-1===t||36===t||t>=40&&t<=43||46===t||63===t||91===t||94===t||124===t)&&(e.advance(),!0)},Qe.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e))return-1!==e.groupNames.indexOf(e.lastStringValue)&&e.raise("Duplicate capture group name"),void e.groupNames.push(e.lastStringValue);e.raise("Invalid group")}},Qe.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1},Qe.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=Ye(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=Ye(e.lastIntValue);return!0}return!1},Qe.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,s=this.options.ecmaVersion>=11,i=e.current(s);return e.advance(s),92===i&&this.regexp_eatRegExpUnicodeEscapeSequence(e,s)&&(i=e.lastIntValue),function(e){return U(e,!0)||36===e||95===e}(i)?(e.lastIntValue=i,!0):(e.pos=t,!1)},Qe.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,s=this.options.ecmaVersion>=11,i=e.current(s);return e.advance(s),92===i&&this.regexp_eatRegExpUnicodeEscapeSequence(e,s)&&(i=e.lastIntValue),function(e){return G(e,!0)||36===e||95===e||8204===e||8205===e}(i)?(e.lastIntValue=i,!0):(e.pos=t,!1)},Qe.regexp_eatAtomEscape=function(e){return!!(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))||(e.switchU&&(99===e.current()&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},Qe.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var s=e.lastIntValue;if(e.switchU)return s>e.maxBackReference&&(e.maxBackReference=s),!0;if(s<=e.numCapturingParens)return!0;e.pos=t}return!1},Qe.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},Qe.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},Qe.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},Qe.regexp_eatZero=function(e){return 48===e.current()&&!it(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},Qe.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},Qe.regexp_eatControlLetter=function(e){var t=e.current();return!!et(t)&&(e.lastIntValue=t%32,e.advance(),!0)},Qe.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){void 0===t&&(t=!1);var s,i=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var a=e.lastIntValue;if(r&&a>=55296&&a<=56319){var n=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=1024*(a-55296)+(o-56320)+65536,!0}e.pos=n,e.lastIntValue=a}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&((s=e.lastIntValue)>=0&&s<=1114111))return!0;r&&e.raise("Invalid unicode escape"),e.pos=i}return!1},Qe.regexp_eatIdentityEscape=function(e){if(e.switchU)return!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return!(99===t||e.switchN&&107===t)&&(e.lastIntValue=t,e.advance(),!0)},Qe.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48),e.advance()}while((t=e.current())>=48&&t<=57);return!0}return!1},Qe.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(function(e){return 100===e||68===e||115===e||83===e||119===e||87===e}(t))return e.lastIntValue=-1,e.advance(),!0;if(e.switchU&&this.options.ecmaVersion>=9&&(80===t||112===t)){if(e.lastIntValue=-1,e.advance(),e.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(e)&&e.eat(125))return!0;e.raise("Invalid property name")}return!1},Qe.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var s=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,s,i),!0}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,r),!0}return!1},Qe.regexp_validateUnicodePropertyNameAndValue=function(e,t,s){oe(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(s)||e.raise("Invalid property value")},Qe.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")},Qe.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";tt(t=e.current());)e.lastStringValue+=Ye(t),e.advance();return""!==e.lastStringValue},Qe.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";st(t=e.current());)e.lastStringValue+=Ye(t),e.advance();return""!==e.lastStringValue},Qe.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},Qe.regexp_eatCharacterClass=function(e){if(e.eat(91)){if(e.eat(94),this.regexp_classRanges(e),e.eat(93))return!0;e.raise("Unterminated character class")}return!1},Qe.regexp_classRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var s=e.lastIntValue;!e.switchU||-1!==t&&-1!==s||e.raise("Invalid character class"),-1!==t&&-1!==s&&t>s&&e.raise("Range out of order in character class")}}},Qe.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var s=e.current();(99===s||nt(s))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var i=e.current();return 93!==i&&(e.lastIntValue=i,e.advance(),!0)},Qe.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},Qe.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!it(t)&&95!==t)&&(e.lastIntValue=t%32,e.advance(),!0)},Qe.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1},Qe.regexp_eatDecimalDigits=function(e){var t=e.pos,s=0;for(e.lastIntValue=0;it(s=e.current());)e.lastIntValue=10*e.lastIntValue+(s-48),e.advance();return e.pos!==t},Qe.regexp_eatHexDigits=function(e){var t=e.pos,s=0;for(e.lastIntValue=0;rt(s=e.current());)e.lastIntValue=16*e.lastIntValue+at(s),e.advance();return e.pos!==t},Qe.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var s=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*s+e.lastIntValue:e.lastIntValue=8*t+s}else e.lastIntValue=t;return!0}return!1},Qe.regexp_eatOctalDigit=function(e){var t=e.current();return nt(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},Qe.regexp_eatFixedHexDigits=function(e,t){var s=e.pos;e.lastIntValue=0;for(var i=0;i<t;++i){var r=e.current();if(!rt(r))return e.pos=s,!1;e.lastIntValue=16*e.lastIntValue+at(r),e.advance()}return!0};var ot=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new ce(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},ht=xe.prototype;function pt(e){return"function"!=typeof BigInt?null:BigInt(e.replace(/_/g,""))}function lt(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}ht.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new ot(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},ht.getToken=function(){return this.next(),new ot(this)},"undefined"!=typeof Symbol&&(ht[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===Y.eof,value:t}}}}),ht.curContext=function(){return this.context[this.context.length-1]},ht.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(Y.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},ht.readToken=function(e){return U(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},ht.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);return e<=55295||e>=57344?e:(e<<10)+this.input.charCodeAt(this.pos+1)-56613888},ht.skipBlockComment=function(){var e,t=this.options.onComment&&this.curPosition(),s=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(-1===i&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(ee.lastIndex=s;(e=ee.exec(this.input))&&e.index<this.pos;)++this.curLine,this.lineStart=e.index+e[0].length;this.options.onComment&&this.options.onComment(!0,this.input.slice(s+2,i),s,this.pos,t,this.curPosition())},ht.skipLineComment=function(e){for(var t=this.pos,s=this.options.onComment&&this.curPosition(),i=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!te(i);)i=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,s,this.curPosition())},ht.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:10===this.input.charCodeAt(this.pos+1)&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(!(e>8&&e<14||e>=5760&&se.test(String.fromCharCode(e))))break e;++this.pos}}},ht.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var s=this.type;this.type=e,this.value=t,this.updateContext(s)},ht.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(Y.ellipsis)):(++this.pos,this.finishToken(Y.dot))},ht.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(Y.assign,2):this.finishOp(Y.slash,1)},ht.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),s=1,i=42===e?Y.star:Y.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++s,i=Y.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(Y.assign,s+1):this.finishOp(i,s)},ht.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(Y.assign,3);return this.finishOp(124===e?Y.logicalOR:Y.logicalAND,2)}return 61===t?this.finishOp(Y.assign,2):this.finishOp(124===e?Y.bitwiseOR:Y.bitwiseAND,1)},ht.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(Y.assign,2):this.finishOp(Y.bitwiseXOR,1)},ht.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45!==t||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!Z.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(Y.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(Y.assign,2):this.finishOp(Y.plusMin,1)},ht.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),s=1;return t===e?(s=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+s)?this.finishOp(Y.assign,s+1):this.finishOp(Y.bitShift,s)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(s=2),this.finishOp(Y.relational,s)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},ht.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(Y.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(Y.arrow)):this.finishOp(61===e?Y.eq:Y.prefix,1)},ht.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(46===t){var s=this.input.charCodeAt(this.pos+2);if(s<48||s>57)return this.finishOp(Y.questionDot,2)}if(63===t){if(e>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(Y.assign,3);return this.finishOp(Y.coalesce,2)}}return this.finishOp(Y.question,1)},ht.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(Y.parenL);case 41:return++this.pos,this.finishToken(Y.parenR);case 59:return++this.pos,this.finishToken(Y.semi);case 44:return++this.pos,this.finishToken(Y.comma);case 91:return++this.pos,this.finishToken(Y.bracketL);case 93:return++this.pos,this.finishToken(Y.bracketR);case 123:return++this.pos,this.finishToken(Y.braceL);case 125:return++this.pos,this.finishToken(Y.braceR);case 58:return++this.pos,this.finishToken(Y.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(Y.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(Y.prefix,1)}this.raise(this.pos,"Unexpected character '"+lt(e)+"'")},ht.finishOp=function(e,t){var s=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,s)},ht.readRegexp=function(){for(var e,t,s=this.pos;;){this.pos>=this.input.length&&this.raise(s,"Unterminated regular expression");var i=this.input.charAt(this.pos);if(Z.test(i)&&this.raise(s,"Unterminated regular expression"),e)e=!1;else{if("["===i)t=!0;else if("]"===i&&t)t=!1;else if("/"===i&&!t)break;e="\\"===i}++this.pos}var r=this.input.slice(s,this.pos);++this.pos;var a=this.pos,n=this.readWord1();this.containsEsc&&this.unexpected(a);var o=this.regexpState||(this.regexpState=new Xe(this));o.reset(s,r,n),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var h=null;try{h=new RegExp(r,n)}catch(e){}return this.finishToken(Y.regexp,{pattern:r,flags:n,value:h})},ht.readInt=function(e,t,s){for(var i=this.options.ecmaVersion>=12&&void 0===t,r=s&&48===this.input.charCodeAt(this.pos),a=this.pos,n=0,o=0,h=0,p=null==t?1/0:t;h<p;++h,++this.pos){var l=this.input.charCodeAt(this.pos),c=void 0;if(i&&95===l)r&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),95===o&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),0===h&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),o=l;else{if((c=l>=97?l-97+10:l>=65?l-65+10:l>=48&&l<=57?l-48:1/0)>=e)break;o=l,n=n*e+c}}return i&&95===o&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===a||null!=t&&this.pos-a!==t?null:n},ht.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var s=this.readInt(e);return null==s&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(s=pt(this.input.slice(t,this.pos)),++this.pos):U(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(Y.num,s)},ht.readNumber=function(e){var t=this.pos;e||null!==this.readInt(10,void 0,!0)||this.raise(t,"Invalid number");var s=this.pos-t>=2&&48===this.input.charCodeAt(t);s&&this.strict&&this.raise(t,"Invalid number");var i=this.input.charCodeAt(this.pos);if(!s&&!e&&this.options.ecmaVersion>=11&&110===i){var r=pt(this.input.slice(t,this.pos));return++this.pos,U(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(Y.num,r)}s&&/[89]/.test(this.input.slice(t,this.pos))&&(s=!1),46!==i||s||(++this.pos,this.readInt(10),i=this.input.charCodeAt(this.pos)),69!==i&&101!==i||s||(43!==(i=this.input.charCodeAt(++this.pos))&&45!==i||++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number")),U(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var a,n=(a=this.input.slice(t,this.pos),s?parseInt(a,8):parseFloat(a.replace(/_/g,"")));return this.finishToken(Y.num,n)},ht.readCodePoint=function(){var e;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e},ht.readString=function(e){for(var t="",s=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var i=this.input.charCodeAt(this.pos);if(i===e)break;92===i?(t+=this.input.slice(s,this.pos),t+=this.readEscapedChar(!1),s=this.pos):(te(i,this.options.ecmaVersion>=10)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(s,this.pos++),this.finishToken(Y.string,t)};var ct={};ht.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==ct)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},ht.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw ct;this.raise(e,t)},ht.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var s=this.input.charCodeAt(this.pos);if(96===s||36===s&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==Y.template&&this.type!==Y.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(Y.template,e)):36===s?(this.pos+=2,this.finishToken(Y.dollarBraceL)):(++this.pos,this.finishToken(Y.backQuote));if(92===s)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(te(s)){switch(e+=this.input.slice(t,this.pos),++this.pos,s){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(s)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},ht.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if("{"!==this.input[this.pos+1])break;case"`":return this.finishToken(Y.invalidTemplate,this.input.slice(this.start,this.pos))}this.raise(this.start,"Unterminated template")},ht.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return lt(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var s=this.pos-1;return this.invalidStringToken(s,"Invalid escape sequence in template string"),null}default:if(t>=48&&t<=55){var i=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],r=parseInt(i,8);return r>255&&(i=i.slice(0,-1),r=parseInt(i,8)),this.pos+=i.length-1,t=this.input.charCodeAt(this.pos),"0"===i&&56!==t&&57!==t||!this.strict&&!e||this.invalidStringToken(this.pos-1-i.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(r)}return te(t)?"":String.fromCharCode(t)}},ht.readHexChar=function(e){var t=this.pos,s=this.readInt(16,e);return null===s&&this.invalidStringToken(t,"Bad character escape sequence"),s},ht.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,s=this.pos,i=this.options.ecmaVersion>=6;this.pos<this.input.length;){var r=this.fullCharCodeAtPos();if(G(r,i))this.pos+=r<=65535?1:2;else{if(92!==r)break;this.containsEsc=!0,e+=this.input.slice(s,this.pos);var a=this.pos;117!==this.input.charCodeAt(++this.pos)&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var n=this.readCodePoint();(t?U:G)(n,i)||this.invalidStringToken(a,"Invalid Unicode escape"),e+=lt(n),s=this.pos}t=!1}return e+this.input.slice(s,this.pos)},ht.readWord=function(){var e=this.readWord1(),t=Y.name;return this.keywords.test(e)&&(t=Q[e]),this.finishToken(t,e)};function ut(e,t){return xe.parse(e,t)}xe.acorn={Parser:xe,version:"8.0.4",defaultOptions:de,Position:le,SourceLocation:ce,getLineInfo:ue,Node:Le,TokenType:J,tokTypes:Y,keywordTypes:Q,TokContext:Me,tokContexts:Be,isIdentifierChar:G,isIdentifierStart:U,Token:ot,isNewLine:te,lineBreak:Z,lineBreakG:ee,nonASCIIwhitespace:se};const dt={},ft={};class mt{constructor(e){this.stack=void 0===e?[]:e.slice(),this.map=new Map,this.stack.push(this.map)}add(e){this.map.set(e,!0)}set(e,t){this.map.set(e,void 0===t?ft:t)}delete(e){this.stack.length>1?this.map.set(e,dt):this.map.delete(e)}has(e){const t=this.map.get(e);if(void 0!==t)return t!==dt;if(this.stack.length>1){for(var s=this.stack.length-2;s>=0;s--){const t=this.stack[s].get(e);if(void 0!==t)return this.map.set(e,t),t!==dt}this.map.set(e,dt)}return!1}get(e){const t=this.map.get(e);if(void 0!==t)return t===dt||t===ft?void 0:t;if(this.stack.length>1){for(var s=this.stack.length-2;s>=0;s--){const t=this.stack[s].get(e);if(void 0!==t)return this.map.set(e,t),t===dt||t===ft?void 0:t}this.map.set(e,dt)}}_compress(){if(1!==this.stack.length){this.map=new Map;for(const e of this.stack)for(const t of e)t[1]===dt?this.map.delete(t[0]):this.map.set(t[0],t[1]);this.stack=[this.map]}}asArray(){return this._compress(),Array.from(this.map.entries(),(e=>e[0]))}asSet(){return new Set(this.asArray())}asPairArray(){return this._compress(),Array.from(this.map.entries(),(e=>e[1]===ft?[e[0],void 0]:e))}asMap(){return new Map(this.asPairArray())}get size(){return this._compress(),this.map.size}createChild(){return new mt(this.stack)}get length(){throw new Error("This is no longer an Array")}set length(e){throw new Error("This is no longer an Array")}}const gt=e=>e.replace(/[-[\]\\/{}()*+?.^$|]/g,"\\$&"),xt=e=>{const t=e.lastIndexOf("/");let s=".";return t>=0&&(s=e.substr(0,t),e=`.${e.substr(t)}`),{context:s,prefix:e}},yt=e=>{const t=e.indexOf("?");let s="";return t>=0&&(s=e.substr(t),e=e.substr(0,t)),{postfix:e,query:s}};class kt{constructor(){this.type=0,this.range=null,this.falsy=!1,this.truthy=!1,this.bool=null,this.number=null,this.regExp=null,this.string=null,this.quasis=null,this.parts=null,this.array=null,this.items=null,this.options=null,this.prefix=null,this.postfix=null,this.wrappedInnerExpressions=null,this.expression=null}isNull(){return 1===this.type}isString(){return 2===this.type}isNumber(){return 3===this.type}isBoolean(){return 4===this.type}isRegExp(){return 5===this.type}isConditional(){return 6===this.type}isArray(){return 7===this.type}isConstArray(){return 8===this.type}isIdentifier(){return 9===this.type}isWrapped(){return 10===this.type}isTemplateString(){return 11===this.type}isTruthy(){return this.truthy}isFalsy(){return this.falsy}asBool(){if(this.truthy)return!0;if(this.falsy)return!1;if(this.isBoolean())return this.bool;if(this.isNull())return!1;if(this.isString())return""!==this.string;if(this.isNumber())return 0!==this.number;if(this.isRegExp())return!0;if(this.isArray())return!0;if(this.isConstArray())return!0;if(this.isWrapped())return!!(this.prefix&&this.prefix.asBool()||this.postfix&&this.postfix.asBool())||void 0;if(this.isTemplateString()){const e=this.asString();if("string"==typeof e)return""!==e}}asString(){if(this.isBoolean())return`${this.bool}`;if(this.isNull())return"null";if(this.isString())return this.string;if(this.isNumber())return`${this.number}`;if(this.isRegExp())return`${this.regExp}`;if(this.isArray()){let e=[];for(const t of this.items){const s=t.asString();if(void 0===s)return;e.push(s)}return`${e}`}if(this.isConstArray())return`${this.array}`;if(this.isTemplateString()){let e="";for(const t of this.parts){const s=t.asString();if(void 0===s)return;e+=s}return e}}setString(e){return this.type=2,this.string=e,this}setNull(){return this.type=1,this}setNumber(e){return this.type=3,this.number=e,this}setBoolean(e){return this.type=4,this.bool=e,this}setRegExp(e){return this.type=5,this.regExp=e,this}setIdentifier(e){return this.type=9,this.identifier=e,this}setWrapped(e,t,s){return this.type=10,this.prefix=e,this.postfix=t,this.wrappedInnerExpressions=s,this}setOptions(e){return this.type=6,this.options=e,this}addOptions(e){this.options||(this.type=6,this.options=[]);for(const t of e)this.options.push(t);return this}setItems(e){return this.type=7,this.items=e,this}setArray(e){return this.type=8,this.array=e,this}setTemplateString(e,t,s){return this.type=11,this.quasis=e,this.parts=t,this.templateStringKind=s,this}setTruthy(){return this.falsy=!1,this.truthy=!0,this}setFalsy(){return this.falsy=!0,this.truthy=!1,this}setRange(e){return this.range=e,this}setExpression(e){return this.expression=e,this}}const wt=(e,t)=>t?e?[e[0],t[1]]:t:e;class vt{constructor(e){this.parser=e,this.hooks={evaluateTypeof:{},evaluate:{}},this.initializeEvaluating()}initializeEvaluating(){this.hooks.evaluate.Literal=e=>{switch(typeof e.value){case"number":return(new kt).setNumber(e.value).setRange(e.range);case"string":return(new kt).setString(e.value).setRange(e.range);case"boolean":return(new kt).setBoolean(e.value).setRange(e.range)}return null===e.value?(new kt).setNull().setRange(e.range):e.value instanceof RegExp?(new kt).setRegExp(e.value).setRange(e.range):void 0},this.hooks.evaluate.LogicalExpression=e=>{let t,s,i;if("&&"===e.operator){if(t=this.evaluateExpression(e.left),s=t&&t.asBool(),!1===s)return t.setRange(e.range);if(!0!==s)return;return i=this.evaluateExpression(e.right),i.setRange(e.range)}if("||"===e.operator){if(t=this.evaluateExpression(e.left),s=t&&t.asBool(),!0===s)return t.setRange(e.range);if(!1!==s)return;return i=this.evaluateExpression(e.right),i.setRange(e.range)}},this.hooks.evaluate.BinaryExpression=e=>{let t,s,i;if("+"===e.operator){if(t=this.evaluateExpression(e.left),s=this.evaluateExpression(e.right),!t||!s)return;if(i=new kt,t.isString())s.isString()?i.setString(t.string+s.string):s.isNumber()?i.setString(t.string+s.number):s.isWrapped()&&s.prefix&&s.prefix.isString()?i.setWrapped((new kt).setString(t.string+s.prefix.string).setRange(wt(t.range,s.prefix.range)),s.postfix,s.wrappedInnerExpressions):s.isWrapped()?i.setWrapped(t,s.postfix,s.wrappedInnerExpressions):i.setWrapped(t,null,[s]);else if(t.isNumber())if(s.isString())i.setString(t.number+s.string);else{if(!s.isNumber())return;i.setNumber(t.number+s.number)}else if(t.isWrapped())t.postfix&&t.postfix.isString()&&s.isString()?i.setWrapped(t.prefix,(new kt).setString(t.postfix.string+s.string).setRange(wt(t.postfix.range,s.range)),t.wrappedInnerExpressions):t.postfix&&t.postfix.isString()&&s.isNumber()?i.setWrapped(t.prefix,(new kt).setString(t.postfix.string+s.number).setRange(wt(t.postfix.range,s.range)),t.wrappedInnerExpressions):s.isString()?i.setWrapped(t.prefix,s,t.wrappedInnerExpressions):s.isNumber()?i.setWrapped(t.prefix,(new kt).setString(s.number+"").setRange(s.range),t.wrappedInnerExpressions):s.isWrapped()?i.setWrapped(t.prefix,s.postfix,t.wrappedInnerExpressions&&s.wrappedInnerExpressions&&t.wrappedInnerExpressions.concat(t.postfix?[t.postfix]:[]).concat(s.prefix?[s.prefix]:[]).concat(s.wrappedInnerExpressions)):i.setWrapped(t.prefix,null,t.wrappedInnerExpressions&&t.wrappedInnerExpressions.concat(t.postfix?[t.postfix,s]:[s]));else if(s.isString())i.setWrapped(null,s,[t]);else{if(!s.isWrapped())return;i.setWrapped(null,s.postfix,s.wrappedInnerExpressions&&(s.prefix?[t,s.prefix]:[t]).concat(s.wrappedInnerExpressions))}return i.setRange(e.range),i}if("-"===e.operator){if(t=this.evaluateExpression(e.left),s=this.evaluateExpression(e.right),!t||!s)return;if(!t.isNumber()||!s.isNumber())return;return i=new kt,i.setNumber(t.number-s.number),i.setRange(e.range),i}if("*"===e.operator){if(t=this.evaluateExpression(e.left),s=this.evaluateExpression(e.right),!t||!s)return;if(!t.isNumber()||!s.isNumber())return;return i=new kt,i.setNumber(t.number*s.number),i.setRange(e.range),i}if("/"===e.operator){if(t=this.evaluateExpression(e.left),s=this.evaluateExpression(e.right),!t||!s)return;if(!t.isNumber()||!s.isNumber())return;return i=new kt,i.setNumber(t.number/s.number),i.setRange(e.range),i}if("**"===e.operator){if(t=this.evaluateExpression(e.left),s=this.evaluateExpression(e.right),!t||!s)return;if(!t.isNumber()||!s.isNumber())return;return i=new kt,i.setNumber(Math.pow(t.number,s.number)),i.setRange(e.range),i}if("=="===e.operator||"==="===e.operator){if(t=this.evaluateExpression(e.left),s=this.evaluateExpression(e.right),!t||!s)return;if(i=new kt,i.setRange(e.range),t.isString()&&s.isString())return i.setBoolean(t.string===s.string);if(t.isNumber()&&s.isNumber())return i.setBoolean(t.number===s.number);if(t.isBoolean()&&s.isBoolean())return i.setBoolean(t.bool===s.bool)}else if("!="===e.operator||"!=="===e.operator){if(t=this.evaluateExpression(e.left),s=this.evaluateExpression(e.right),!t||!s)return;if(i=new kt,i.setRange(e.range),t.isString()&&s.isString())return i.setBoolean(t.string!==s.string);if(t.isNumber()&&s.isNumber())return i.setBoolean(t.number!==s.number);if(t.isBoolean()&&s.isBoolean())return i.setBoolean(t.bool!==s.bool)}else{if("&"===e.operator){if(t=this.evaluateExpression(e.left),s=this.evaluateExpression(e.right),!t||!s)return;if(!t.isNumber()||!s.isNumber())return;return i=new kt,i.setNumber(t.number&s.number),i.setRange(e.range),i}if("|"===e.operator){if(t=this.evaluateExpression(e.left),s=this.evaluateExpression(e.right),!t||!s)return;if(!t.isNumber()||!s.isNumber())return;return i=new kt,i.setNumber(t.number|s.number),i.setRange(e.range),i}if("^"===e.operator){if(t=this.evaluateExpression(e.left),s=this.evaluateExpression(e.right),!t||!s)return;if(!t.isNumber()||!s.isNumber())return;return i=new kt,i.setNumber(t.number^s.number),i.setRange(e.range),i}if(">>>"===e.operator){if(t=this.evaluateExpression(e.left),s=this.evaluateExpression(e.right),!t||!s)return;if(!t.isNumber()||!s.isNumber())return;return i=new kt,i.setNumber(t.number>>>s.number),i.setRange(e.range),i}if(">>"===e.operator){if(t=this.evaluateExpression(e.left),s=this.evaluateExpression(e.right),!t||!s)return;if(!t.isNumber()||!s.isNumber())return;return i=new kt,i.setNumber(t.number>>s.number),i.setRange(e.range),i}if("<<"===e.operator){if(t=this.evaluateExpression(e.left),s=this.evaluateExpression(e.right),!t||!s)return;if(!t.isNumber()||!s.isNumber())return;return i=new kt,i.setNumber(t.number<<s.number),i.setRange(e.range),i}}},this.hooks.evaluate.UnaryExpression=e=>{if("typeof"===e.operator){let t,s;if("Identifier"===e.argument.type&&(s=this.parser.scope.renames.get(e.argument.name)||e.argument.name,!this.parser.scope.definitions.has(s))){const i=this.hooks.evaluateTypeof[s];if(void 0!==i&&(t=i.call(null,e),void 0!==t))return t}if("MemberExpression"===e.argument.type){const s=this.parser.getNameForExpression(e.argument);if(s&&s.free){const i=this.hooks.evaluateTypeof[s.name];if(void 0!==i&&(t=i.call(e),void 0!==t))return t}}if("FunctionExpression"===e.argument.type)return(new kt).setString("function").setRange(e.range);const i=this.evaluateExpression(e.argument);if(i.isString()||i.isWrapped())return(new kt).setString("string").setRange(e.range);if(i.isNumber())return(new kt).setString("number").setRange(e.range);if(i.isBoolean())return(new kt).setString("boolean").setRange(e.range);if(i.isArray()||i.isConstArray()||i.isRegExp())return(new kt).setString("object").setRange(e.range)}else if("!"===e.operator){const t=this.evaluateExpression(e.argument);if(!t)return;if(t.isBoolean())return(new kt).setBoolean(!t.bool).setRange(e.range);if(t.isTruthy())return(new kt).setBoolean(!1).setRange(e.range);if(t.isFalsy())return(new kt).setBoolean(!0).setRange(e.range);if(t.isString())return(new kt).setBoolean(!t.string).setRange(e.range);if(t.isNumber())return(new kt).setBoolean(!t.number).setRange(e.range)}else if("~"===e.operator){const t=this.evaluateExpression(e.argument);if(!t)return;if(!t.isNumber())return;const s=new kt;return s.setNumber(~t.number),s.setRange(e.range),s}},this.hooks.evaluateTypeof.undefined=e=>(new kt).setString("undefined").setRange(e.range),this.hooks.evaluateTypeof.require=e=>(new kt).setString("function").setRange(e.range),this.hooks.evaluate.Identifier=e=>{const t=this.parser.scope.renames.get(e.name)||e.name;if(!this.parser.scope.definitions.has(e.name))return(new kt).setIdentifier(t).setRange(e.range)},this.hooks.evaluate.ThisExpression=e=>{const t=this.parser.scope.renames.get("this");if(t)return(new kt).setIdentifier(t).setRange(e.range)},this.hooks.evaluate.MemberExpression=e=>{let t=this.parser.getNameForExpression(e);if(t&&t.free)return(new kt).setIdentifier(t.name).setRange(e.range)};const e=(e,t)=>{const s=[],i=[];for(let r=0;r<t.quasis.length;r++){const a=t.quasis[r],n=a.value[e];if(r>0){const e=i[i.length-1],s=this.evaluateExpression(t.expressions[r-1]),o=s.asString();if("string"==typeof o){e.setString(e.string+o+n),e.setRange([e.range[0],a.range[1]]),e.setExpression(void 0);continue}i.push(s)}const o=(new kt).setString(n).setRange(a.range).setExpression(a);s.push(o),i.push(o)}return{quasis:s,parts:i}};this.hooks.evaluate.TemplateLiteral=t=>{const{quasis:s,parts:i}=e("cooked",t);return 1===i.length?i[0].setRange(t.range):(new kt).setTemplateString(s,i,"cooked").setRange(t.range)},this.hooks.evaluate.TaggedTemplateExpression=t=>{if("String.raw"!==this.evaluateExpression(t.tag).identifier)return;const{quasis:s,parts:i}=e("raw",t.quasi);return 1===i.length?i[0].setRange(t.range):(new kt).setTemplateString(s,i,"raw").setRange(t.range)},this.hooks.evaluate.ConditionalExpression=e=>{const t=this.evaluateExpression(e.test).asBool();let s;if(void 0===t){const t=this.evaluateExpression(e.consequent),i=this.evaluateExpression(e.alternate);if(!t||!i)return;s=new kt,t.isConditional()?s.setOptions(t.options):s.setOptions([t]),i.isConditional()?s.addOptions(i.options):s.addOptions([i])}else s=this.evaluateExpression(t?e.consequent:e.alternate);return s.setRange(e.range),s}}evaluateExpression(e){try{let t=e.type;if(t in this.hooks.evaluate){const s=this.hooks.evaluate[t](e);if(void 0!==s)return s&&s.setExpression(e),s}}catch(e){console.warn(e)}return(new kt).setRange(e.range).setExpression(e)}}const bt=xe;class Et{constructor(e){this.scope={topLevelScope:!0,inTry:!1,inShorthand:!1,isStrict:!1,isAsmJs:!1,definitions:new mt,renames:new mt},this.state={deps:[],warnings:[],errors:[],assignRequire:!1},this.evaluator=new vt(this),this.parserContext=e}parse(e){const t=this.scope,s=this.state,i=this.state={deps:[],warnings:[],errors:[],assignRequire:!1};let r;if("object"==typeof e&&null!==e)r=e;else try{r=Et.parse(e)}catch(e){return i.errors.push({msg:e.message}),i}return this.scope={topLevelScope:!0,inTry:!1,inShorthand:!1,isStrict:!1,isAsmJs:!1,definitions:new mt,renames:new mt},this.detectMode(r.body),this.prewalkStatements(r.body),this.blockPrewalkStatements(r.body),this.walkStatements(r.body),this.scope=t,this.state=s,i}static parse(e){let t;return t=bt.parse(e,{ecmaVersion:"latest",ranges:!0,locations:!0,allowHashBang:!0,sourceType:"module"}),t}detectMode(e){const t=e.length>=1&&"ExpressionStatement"===e[0].type&&"Literal"===e[0].expression.type;t&&"use strict"===e[0].expression.value&&(this.scope.isStrict=!0),t&&"use asm"===e[0].expression.value&&(this.scope.isAsmJs=!0)}getRenameIdentifier(e){const t=this.evaluateExpression(e);if(t&&t.isIdentifier())return t.identifier}walkClass(e){if(e.superClass&&this.walkExpression(e.superClass),e.body&&"ClassBody"===e.body.type){const t=this.scope.topLevelScope;this.scope.topLevelScope=!1;for(const t of e.body.body)"MethodDefinition"===t.type&&this.walkMethodDefinition(t);this.scope.topLevelScope=t}}walkMethodDefinition(e){e.computed&&e.key&&this.walkExpression(e.key),e.value&&this.walkExpression(e.value)}prewalkStatements(e){for(let t=0,s=e.length;t<s;t++){const s=e[t];this.prewalkStatement(s)}}blockPrewalkStatements(e){for(let t=0,s=e.length;t<s;t++){const s=e[t];this.blockPrewalkStatement(s)}}walkStatements(e){for(let t=0,s=e.length;t<s;t++){const s=e[t];this.walkStatement(s)}}prewalkStatement(e){switch(e.type){case"BlockStatement":this.prewalkBlockStatement(e);break;case"DoWhileStatement":this.prewalkDoWhileStatement(e);break;case"ExportAllDeclaration":this.prewalkExportAllDeclaration(e);break;case"ExportDefaultDeclaration":this.prewalkExportDefaultDeclaration(e);break;case"ExportNamedDeclaration":this.prewalkExportNamedDeclaration(e);break;case"ForInStatement":this.prewalkForInStatement(e);break;case"ForOfStatement":this.prewalkForOfStatement(e);break;case"ForStatement":this.prewalkForStatement(e);break;case"FunctionDeclaration":this.prewalkFunctionDeclaration(e);break;case"IfStatement":this.prewalkIfStatement(e);break;case"ImportDeclaration":this.prewalkImportDeclaration(e);break;case"LabeledStatement":this.prewalkLabeledStatement(e);break;case"SwitchStatement":this.prewalkSwitchStatement(e);break;case"TryStatement":this.prewalkTryStatement(e);break;case"VariableDeclaration":this.prewalkVariableDeclaration(e);break;case"WhileStatement":this.prewalkWhileStatement(e);break;case"WithStatement":this.prewalkWithStatement(e)}}blockPrewalkStatement(e){switch(e.type){case"VariableDeclaration":this.blockPrewalkVariableDeclaration(e);break;case"ExportDefaultDeclaration":this.blockPrewalkExportDefaultDeclaration(e);break;case"ExportNamedDeclaration":this.blockPrewalkExportNamedDeclaration(e);break;case"ClassDeclaration":this.blockPrewalkClassDeclaration(e)}}walkStatement(e){switch(e.type){case"BlockStatement":this.walkBlockStatement(e);break;case"ClassDeclaration":this.walkClassDeclaration(e);break;case"DoWhileStatement":this.walkDoWhileStatement(e);break;case"ExportDefaultDeclaration":this.walkExportDefaultDeclaration(e);break;case"ExportNamedDeclaration":this.walkExportNamedDeclaration(e);break;case"ExpressionStatement":this.walkExpressionStatement(e);break;case"ForInStatement":this.walkForInStatement(e);break;case"ForOfStatement":this.walkForOfStatement(e);break;case"ForStatement":this.walkForStatement(e);break;case"FunctionDeclaration":this.walkFunctionDeclaration(e);break;case"IfStatement":this.walkIfStatement(e);break;case"LabeledStatement":this.walkLabeledStatement(e);break;case"ReturnStatement":this.walkReturnStatement(e);break;case"SwitchStatement":this.walkSwitchStatement(e);break;case"ThrowStatement":this.walkThrowStatement(e);break;case"TryStatement":this.walkTryStatement(e);break;case"VariableDeclaration":this.walkVariableDeclaration(e);break;case"WhileStatement":this.walkWhileStatement(e);break;case"WithStatement":this.walkWithStatement(e)}}prewalkBlockStatement(e){this.prewalkStatements(e.body)}walkBlockStatement(e){this.inBlockScope((()=>{const t=e.body;this.blockPrewalkStatements(t),this.walkStatements(t)}))}walkExpressionStatement(e){this.walkExpression(e.expression)}prewalkIfStatement(e){this.prewalkStatement(e.consequent),e.alternate&&this.prewalkStatement(e.alternate)}walkIfStatement(e){this.walkExpression(e.test),this.walkStatement(e.consequent),e.alternate&&this.walkStatement(e.alternate)}prewalkLabeledStatement(e){this.prewalkStatement(e.body)}walkLabeledStatement(e){this.walkStatement(e.body)}prewalkWithStatement(e){this.prewalkStatement(e.body)}walkWithStatement(e){this.walkExpression(e.object),this.walkStatement(e.body)}prewalkSwitchStatement(e){this.prewalkSwitchCases(e.cases)}walkSwitchStatement(e){this.walkExpression(e.discriminant),this.walkSwitchCases(e.cases)}walkTerminatingStatement(e){e.argument&&this.walkExpression(e.argument)}walkReturnStatement(e){this.walkTerminatingStatement(e)}walkThrowStatement(e){this.walkTerminatingStatement(e)}prewalkTryStatement(e){this.prewalkStatement(e.block)}walkTryStatement(e){this.scope.inTry?this.walkStatement(e.block):(this.scope.inTry=!0,this.walkStatement(e.block),this.scope.inTry=!1),e.handler&&this.walkCatchClause(e.handler),e.finalizer&&this.walkStatement(e.finalizer)}prewalkWhileStatement(e){this.prewalkStatement(e.body)}walkWhileStatement(e){this.walkExpression(e.test),this.walkStatement(e.body)}prewalkDoWhileStatement(e){this.prewalkStatement(e.body)}walkDoWhileStatement(e){this.walkStatement(e.body),this.walkExpression(e.test)}prewalkForStatement(e){e.init&&"VariableDeclaration"===e.init.type&&this.prewalkStatement(e.init),this.prewalkStatement(e.body)}walkForStatement(e){this.inBlockScope((()=>{e.init&&("VariableDeclaration"===e.init.type?(this.blockPrewalkVariableDeclaration(e.init),this.walkStatement(e.init)):this.walkExpression(e.init)),e.test&&this.walkExpression(e.test),e.update&&this.walkExpression(e.update);const t=e.body;"BlockStatement"===t.type?(this.blockPrewalkStatements(t.body),this.walkStatements(t.body)):this.walkStatement(t)}))}prewalkForInStatement(e){"VariableDeclaration"===e.left.type&&this.prewalkVariableDeclaration(e.left),this.prewalkStatement(e.body)}walkForInStatement(e){this.inBlockScope((()=>{"VariableDeclaration"===e.left.type?(this.blockPrewalkVariableDeclaration(e.left),this.walkVariableDeclaration(e.left)):this.walkPattern(e.left),this.walkExpression(e.right);const t=e.body;"BlockStatement"===t.type?(this.blockPrewalkStatements(t.body),this.walkStatements(t.body)):this.walkStatement(t)}))}prewalkForOfStatement(e){"VariableDeclaration"===e.left.type&&this.prewalkVariableDeclaration(e.left),this.prewalkStatement(e.body)}walkForOfStatement(e){this.inBlockScope((()=>{"VariableDeclaration"===e.left.type?(this.blockPrewalkVariableDeclaration(e.left),this.walkVariableDeclaration(e.left)):this.walkPattern(e.left),this.walkExpression(e.right);const t=e.body;"BlockStatement"===t.type?(this.blockPrewalkStatements(t.body),this.walkStatements(t.body)):this.walkStatement(t)}))}prewalkFunctionDeclaration(e){e.id&&(this.scope.renames.set(e.id.name,null),this.scope.definitions.add(e.id.name))}walkFunctionDeclaration(e){const t=this.scope.topLevelScope;this.scope.topLevelScope=!1,this.inFunctionScope(!0,e.params,(()=>{for(const t of e.params)this.walkPattern(t);"BlockStatement"===e.body.type?(this.detectMode(e.body.body),this.prewalkStatement(e.body),this.walkStatement(e.body)):this.walkExpression(e.body)})),this.scope.topLevelScope=t}prewalkImportDeclaration(e){this.trackHarmonyImport(e);for(const t of e.specifiers){const e=t.local.name;this.scope.renames.set(e,null),this.scope.definitions.add(e)}}enterDeclaration(e,t){switch(e.type){case"VariableDeclaration":for(const s of e.declarations)switch(s.type){case"VariableDeclarator":this.enterPattern(s.id,t)}break;case"FunctionDeclaration":case"ClassDeclaration":this.enterPattern(e.id,t)}}blockPrewalkExportNamedDeclaration(e){e.declaration&&this.blockPrewalkStatement(e.declaration)}prewalkExportNamedDeclaration(e){e.source&&this.trackHarmonyExportImport(e),e.declaration&&this.prewalkStatement(e.declaration)}walkExportNamedDeclaration(e){e.declaration&&this.walkStatement(e.declaration)}blockPrewalkExportDefaultDeclaration(e){"ClassDeclaration"===e.declaration.type&&this.blockPrewalkClassDeclaration(e.declaration)}prewalkExportDefaultDeclaration(e){this.prewalkStatement(e.declaration)}walkExportDefaultDeclaration(e){e.declaration.id&&"FunctionExpression"!==e.declaration.type&&"ClassExpression"!==e.declaration.type?this.walkStatement(e.declaration):"FunctionDeclaration"===e.declaration.type?this.walkFunctionDeclaration(e.declaration):"ClassDeclaration"===e.declaration.type?this.walkClassDeclaration(e.declaration):this.walkExpression(e.declaration)}prewalkExportAllDeclaration(e){this.trackHarmonyExportImport(e)}prewalkVariableDeclaration(e){"var"===e.kind&&this._prewalkVariableDeclaration(e)}blockPrewalkVariableDeclaration(e){"var"!==e.kind&&this._prewalkVariableDeclaration(e)}_prewalkVariableDeclaration(e){for(const t of e.declarations)switch(t.type){case"VariableDeclarator":this.enterPattern(t.id,(e=>{this.scope.renames.set(e,null),this.scope.definitions.add(e)}))}}walkVariableDeclaration(e){for(const t of e.declarations)switch(t.type){case"VariableDeclarator":{const e=t.init&&this.getRenameIdentifier(t.init);if(e&&"Identifier"===t.id.type&&"require"===e){this.scope.renames.set(t.id.name,this.scope.renames.get(e)||e),this.scope.definitions.delete(t.id.name);break}this.walkPattern(t.id),t.init&&this.walkExpression(t.init);break}}}blockPrewalkClassDeclaration(e){e.id&&(this.scope.renames.set(e.id.name,null),this.scope.definitions.add(e.id.name))}walkClassDeclaration(e){this.walkClass(e)}prewalkSwitchCases(e){for(let t=0,s=e.length;t<s;t++){const s=e[t];this.prewalkStatements(s.consequent)}}walkSwitchCases(e){for(let t=0,s=e.length;t<s;t++){const s=e[t];s.test&&this.walkExpression(s.test),this.walkStatements(s.consequent)}}walkCatchClause(e){this.inBlockScope((()=>{null!==e.param&&(this.enterPattern(e.param,(e=>{this.scope.renames.set(e,null),this.scope.definitions.add(e)})),this.walkPattern(e.param)),this.prewalkStatement(e.body),this.walkStatement(e.body)}))}walkPattern(e){switch(e.type){case"ArrayPattern":this.walkArrayPattern(e);break;case"AssignmentPattern":this.walkAssignmentPattern(e);break;case"MemberExpression":this.walkMemberExpression(e);break;case"ObjectPattern":this.walkObjectPattern(e);break;case"RestElement":this.walkRestElement(e)}}walkAssignmentPattern(e){this.walkExpression(e.right),this.walkPattern(e.left)}walkObjectPattern(e){for(let t=0,s=e.properties.length;t<s;t++){const s=e.properties[t];s&&("computed"in s&&this.walkExpression(s.key),"value"in s&&this.walkPattern(s.value))}}walkArrayPattern(e){for(let t=0,s=e.elements.length;t<s;t++){const s=e.elements[t];s&&this.walkPattern(s)}}walkRestElement(e){this.walkPattern(e.argument)}walkExpressions(e){for(const t of e)t&&this.walkExpression(t)}walkExpression(e){switch(e.type){case"ArrayExpression":this.walkArrayExpression(e);break;case"ArrowFunctionExpression":this.walkArrowFunctionExpression(e);break;case"AssignmentExpression":this.walkAssignmentExpression(e);break;case"AwaitExpression":this.walkAwaitExpression(e);break;case"BinaryExpression":this.walkBinaryExpression(e);break;case"CallExpression":this.walkCallExpression(e);break;case"ClassExpression":this.walkClassExpression(e);break;case"ConditionalExpression":this.walkConditionalExpression(e);break;case"FunctionExpression":this.walkFunctionExpression(e);break;case"Identifier":this.walkIdentifier(e);break;case"LogicalExpression":this.walkLogicalExpression(e);break;case"MemberExpression":this.walkMemberExpression(e);break;case"NewExpression":this.walkNewExpression(e);break;case"ObjectExpression":this.walkObjectExpression(e);break;case"SequenceExpression":this.walkSequenceExpression(e);break;case"SpreadElement":this.walkSpreadElement(e);break;case"TaggedTemplateExpression":this.walkTaggedTemplateExpression(e);break;case"TemplateLiteral":this.walkTemplateLiteral(e);break;case"UnaryExpression":this.walkUnaryExpression(e);break;case"UpdateExpression":this.walkUpdateExpression(e);break;case"YieldExpression":this.walkYieldExpression(e)}}walkAwaitExpression(e){this.walkExpression(e.argument)}walkArrayExpression(e){e.elements&&this.walkExpressions(e.elements)}walkSpreadElement(e){e.argument&&this.walkExpression(e.argument)}walkObjectExpression(e){for(let t=0,s=e.properties.length;t<s;t++){const s=e.properties[t];"SpreadElement"!==s.type?(s.computed&&this.walkExpression(s.key),s.shorthand&&(this.scope.inShorthand=!0),this.walkExpression(s.value),s.shorthand&&(this.scope.inShorthand=!1)):this.walkExpression(s.argument)}}walkFunctionExpression(e){const t=this.scope.topLevelScope;this.scope.topLevelScope=!1;const s=e.params;e.id&&s.push(e.id.name),this.inFunctionScope(!0,s,(()=>{for(const t of e.params)this.walkPattern(t);"BlockStatement"===e.body.type?(this.detectMode(e.body.body),this.prewalkStatement(e.body),this.walkStatement(e.body)):this.walkExpression(e.body)})),this.scope.topLevelScope=t}walkArrowFunctionExpression(e){this.inFunctionScope(!1,e.params,(()=>{for(const t of e.params)this.walkPattern(t);"BlockStatement"===e.body.type?(this.detectMode(e.body.body),this.prewalkStatement(e.body),this.walkStatement(e.body)):this.walkExpression(e.body)}))}walkSequenceExpression(e){e.expressions&&this.walkExpressions(e.expressions)}walkUpdateExpression(e){this.walkExpression(e.argument)}walkUnaryExpression(e){this.walkExpression(e.argument)}walkLeftRightExpression(e){this.walkExpression(e.left),this.walkExpression(e.right)}walkBinaryExpression(e){this.walkLeftRightExpression(e)}walkLogicalExpression(e){this.walkLeftRightExpression(e)}walkAssignmentExpression(e){const t=this.getRenameIdentifier(e.right);if(t&&"require"===t){if("Identifier"===e.left.type)return this.state.assignRequire=!0,this.scope.renames.set(e.left.name,t),void this.scope.definitions.delete(e.left.name);"MemberExpression"===e.left.type&&"Identifier"===e.left.object.type&&"window"===e.left.object.name&&"Identifier"===e.left.property.type&&"loadLib"===e.left.property.name&&(this.state.assignRequire=!0,this.parserContext.isLayaGame=!0)}this.walkExpression(e.right),this.walkPattern(e.left),this.enterPattern(e.left,((e,t)=>{this.scope.renames.set(e,null)}))}walkConditionalExpression(e){this.walkExpression(e.test),this.walkExpression(e.consequent),e.alternate&&this.walkExpression(e.alternate)}walkNewExpression(e){this.walkExpression(e.callee),e.arguments&&this.walkExpressions(e.arguments)}walkYieldExpression(e){e.argument&&this.walkExpression(e.argument)}walkTemplateLiteral(e){e.expressions&&this.walkExpressions(e.expressions)}walkTaggedTemplateExpression(e){e.tag&&this.walkExpression(e.tag),e.quasi&&e.quasi.expressions&&this.walkExpressions(e.quasi.expressions)}walkClassExpression(e){this.walkClass(e)}_walkIIFE(e,t,s){const i=e=>{const t=this.getRenameIdentifier(e);if("require"===t)return t;this.walkExpression(e)},r=e.params,a=s?i(s):null,n=t.map(i),o=this.scope.topLevelScope;this.scope.topLevelScope=!1;const h=r.filter(((e,t)=>!n[t]));e.id&&h.push(e.id.name),this.inFunctionScope(!0,h,(()=>{a&&this.scope.renames.set("this",a);for(let e=0;e<n.length;e++){const t=n[e];t&&(r[e]&&"Identifier"===r[e].type&&this.scope.renames.set(r[e].name,t))}"BlockStatement"===e.body.type?(this.detectMode(e.body.body),this.prewalkStatement(e.body),this.walkStatement(e.body)):this.walkExpression(e.body)})),this.scope.topLevelScope=o}walkCallExpression(e){if("MemberExpression"===e.callee.type&&"FunctionExpression"===e.callee.object.type&&!e.callee.computed&&("call"===e.callee.property.name||"bind"===e.callee.property.name)&&e.arguments.length>0)this._walkIIFE(e.callee.object,e.arguments.slice(1),e.arguments[0]);else if("FunctionExpression"===e.callee.type)this._walkIIFE(e.callee,e.arguments,null);else if("ImportExpression"===e.callee.type){if(!0===this.trackImportOrRequireCall(e,"import"))return;e.arguments&&this.walkExpressions(e.arguments)}else{const t=this.evaluateExpression(e.callee);if(t.isIdentifier())if("require"===t.identifier){if(!0===this.trackImportOrRequireCall(e,"require"))return}else this.parserContext.isLayaGame&&"loadLib"===t.identifier&&this.trackImportOrRequireCall(e,"require");e.callee&&this.walkExpression(e.callee),e.arguments&&this.walkExpressions(e.arguments)}}walkMemberExpression(e){const t=this.getNameForExpression(e);if(t&&t.free&&"require"===t.name){if(!0===this.warnRequireExpression(e))return}this.walkExpression(e.object),!0===e.computed&&this.walkExpression(e.property)}walkIdentifier(e){if(!this.scope.definitions.has(e.name)){if("require"===(this.scope.renames.get(e.name)||e.name)){if(!0===this.warnRequireExpression(e))return}}}inFunctionScope(e,t,s){const i=this.scope;this.scope={topLevelScope:i.topLevelScope,inTry:!1,inShorthand:!1,isStrict:i.isStrict,isAsmJs:i.isAsmJs,definitions:i.definitions.createChild(),renames:i.renames.createChild()},e&&this.scope.renames.set("this",null),this.enterPatterns(t,(e=>{this.scope.renames.set(e,null),this.scope.definitions.add(e)})),s(),this.scope=i}inBlockScope(e){const t=this.scope;this.scope={topLevelScope:t.topLevelScope,inTry:t.inTry,inShorthand:!1,isStrict:t.isStrict,isAsmJs:t.isAsmJs,definitions:t.definitions.createChild(),renames:t.renames.createChild()},e(),this.scope=t}enterPatterns(e,t){for(const s of e)"string"!=typeof s?this.enterPattern(s,t):s&&t(s)}enterPattern(e,t){if(e)switch(e.type){case"ArrayPattern":this.enterArrayPattern(e,t);break;case"AssignmentPattern":this.enterAssignmentPattern(e,t);break;case"Identifier":this.enterIdentifier(e,t);break;case"ObjectPattern":this.enterObjectPattern(e,t);break;case"RestElement":this.enterRestElement(e,t);break;case"Property":this.enterPattern(e.value,t)}}enterIdentifier(e,t){t(e.name,e)}enterObjectPattern(e,t){for(let s=0,i=e.properties.length;s<i;s++){const i=e.properties[s];this.enterPattern(i,t)}}enterArrayPattern(e,t){for(let s=0,i=e.elements.length;s<i;s++){const i=e.elements[s];this.enterPattern(i,t)}}enterRestElement(e,t){this.enterPattern(e.argument,t)}enterAssignmentPattern(e,t){this.enterPattern(e.left,t)}getNameForExpression(e){let t=e;const s=[];for(;"MemberExpression"===t.type&&t.property.type===(t.computed?"Literal":"Identifier");)s.push(t.computed?t.property.value:t.property.name),t=t.object;let i;if("Identifier"===t.type)i=!this.scope.definitions.has(t.name),s.push(this.scope.renames.get(t.name)||t.name);else if("ThisExpression"===t.type&&this.scope.renames.get("this"))i=!0,s.push(this.scope.renames.get("this"));else{if("ThisExpression"!==t.type)return null;i=this.scope.topLevelScope,s.push("this")}let r="";for(let e=s.length-1;e>=2;e--)r+=s[e]+".";s.length>1&&(r+=s[1]);return{name:r?r+"."+s[0]:s[0],nameGeneral:r,free:i}}evaluateExpression(e){return this.evaluator.evaluateExpression(e)}trackHarmonyExportImport(e){this.state.deps.push({type:"normal",request:e.source.value,range:e.range,loc:e.loc})}trackHarmonyImport(e){this.state.deps.push({type:"normal",request:e.source.value,range:e.range,loc:e.loc})}trackImportOrRequireCall(e,t){const s=(e,t)=>{if(t.isString())return this.state.deps.push({type:"normal",request:t.string,range:t.range,loc:e.loc}),!0},i=(e,t)=>(function(e,t,s){if(e.isTemplateString()){let i=e.quasis[0].string,r=e.quasis.length>1?e.quasis[e.quasis.length-1].string:"";e.range;const{context:a,prefix:n}=xt(i),{postfix:o,query:h}=yt(r),p=".*"+e.quasis.slice(1,e.quasis.length-1).map((e=>gt(e.string)+".*")).join("");let l={type:"context",context:a,regExp:new RegExp(`^${gt(n)}${p}${gt(o)}$`),range:t.range,loc:t.loc};s.state.deps.push(l),e.parts.forEach(((e,t)=>{t%2==0||s.walkExpression(e.expression)}))}else if(e.isWrapped()&&(e.prefix&&e.prefix.isString()||e.postfix&&e.postfix.isString())){let i=e.prefix&&e.prefix.isString()?e.prefix.string:"",r=e.postfix&&e.postfix.isString()?e.postfix.string:"";e.prefix&&e.prefix.isString()&&e.prefix.range,e.postfix&&e.postfix.isString()&&e.postfix.range,e.range;const{context:a,prefix:n}=xt(i),{postfix:o,query:h}=yt(r);let p={type:"context",context:a,regExp:new RegExp(`^${gt(n)}.*${gt(o)}$`),range:t.range,loc:t.loc};if(s.state.deps.push(p),e.wrappedInnerExpressions)for(const t of e.wrappedInnerExpressions)t.expression&&s.walkExpression(t.expression)}else s.state.warnings.push({msg:"the request of a dependency is an expression",range:t.range,loc:t.loc}),s.walkExpression(e.expression)}(t,e,this),!0);e.arguments.length>1&&this.state.warnings.push({msg:`call ${t} function with more than one parameter`,range:e.range,loc:e.loc});const r=this.evaluateExpression(e.arguments[0]);if(r.isConditional()){let t=!1;const i=this.state.deps.length;for(const i of r.options){void 0===s(e,i)&&(t=!0)}if(!t)return!0;this.state.deps.length=i}return void 0===s(e,r)&&i(e,r),!0}warnRequireExpression(e){return this.state.warnings.push({msg:"require function is used in a way in which dependencies cannot be statically extracted",range:e.range,loc:e.loc}),!0}}class St extends N{constructor(e,t){super(e,t)}async build(e){let t;try{t=await this.fileHelper.getString(this.path)}catch(e){throw this.markError(exports.ModuleErrorType.FILE_NOT_UTF8,e),e}if(this.path.indexOf("miniprogram_npm")>=0&&t.indexOf("//miniprogram-npm-outsideDeps=")>=0){const e=/\/\/miniprogram-npm-outsideDeps=(.*)/.exec(t);if(e){let t=[];try{t=JSON.parse(e[1])}catch(e){console.error(e),this.markError(exports.ModuleErrorType.JS_RESOLVE_DEPENDENCY_ERR,new Error(`failed collect outsideDeps from miniprogram_npm file, ${e.message}`))}for(const e of t)this.addDep(new y("Js",e,this,this.fileHelper,!0,!0));return Array.from(this.deps)}}const s=e.es6Parser.isLayaGame;let i,r;if(!s){let s;i=function(e){const t=/(?<![\w|\.])import(?![\w|\.])/g,s=/(?<![\w|\.])export(?![\w|\.])/g,i=/(?<![\w|\.])from(?![\w|\.])/g,r=/(?<![\w|\.])require(?![\w|\.])/g;let a=-1,n=!1,o=!1,h=null;for(;h=t.exec(e);)a=Math.max(h.index,a);for(;h=s.exec(e);)a=Math.max(h.index,a),o=!0;for(;h=r.exec(e);)a=Math.max(h.index,a),n=!0;return o&&(i.lastIndex=a,(h=i.exec(e))&&(a=Math.max(h.index,a))),{lastIndex:a,hasRequire:n}}(t);try{s=ut(t,{ecmaVersion:"latest",ranges:!0,locations:!0,allowHashBang:!0,sourceType:"module",sourceFile:this.path,skipStatementPos:i.lastIndex})}catch(e){throw this.markError(exports.ModuleErrorType.JS_PARSE_ERR,e),e}r=new Et(e.es6Parser).parse(s)}if(s||i&&i.hasRequire&&r&&r.assignRequire){let s=ut(t,{ecmaVersion:"latest",ranges:!0,locations:!0,allowHashBang:!0,sourceType:"module",sourceFile:this.path});r=new Et(e.es6Parser).parse(s)}let a=r.deps.filter((e=>"normal"===e.type)),n=r.deps.filter((e=>"context"===e.type));return a.forEach((async e=>{this.addDep(new y("Js"===this.type?"Js":"Wxs",e.request,this,this.fileHelper,!0,!0))})),n.forEach((async e=>{this.addDep(new k({type:"Js"===this.type?"Js":"Wxs",request:e.context,regExp:e.regExp,originModule:this,fileHelper:this.fileHelper,needResolve:!0,necessary:!0,from:"file"}))})),r.warnings&&r.warnings.forEach((e=>{var t,s,i;this.markError(exports.ModuleErrorType.JS_RESOLVE_DEPENDENCY_ERR,new Error(`${e.msg} (${null===(t=e.loc)||void 0===t?void 0:t.source} ${null===(s=e.loc)||void 0===s?void 0:s.end.line}:${null===(i=e.loc)||void 0===i?void 0:i.end.column})`))})),r.errors&&r.errors.forEach((e=>{this.markError(exports.ModuleErrorType.JS_RESOLVE_DEPENDENCY_ERR,e)})),Array.from(this.deps)}}var _t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Ct(e,t){t=t||{};var s=1,i=1;function r(e){var t=e.match(/\n/g);t&&(s+=t.length);var r=e.lastIndexOf("\n");i=~r?e.length-r:i+e.length}function a(){var e={line:s,column:i};return function(t){return t.position=new n(e),d(),t}}function n(e){this.start=e,this.end={line:s,column:i},this.source=t.source}n.prototype.content=e;var o=[];function h(r){var a=new Error(t.source+":"+s+":"+i+": "+r);if(a.reason=r,a.filename=t.source,a.line=s,a.column=i,a.source=e,!t.silent)throw a;o.push(a)}function p(){return u(/^{\s*/)}function l(){return u(/^}/)}function c(){var i,r=[];for(d(),f(r);s<=(t.skipRuleLineno||Number.MAX_SAFE_INTEGER)&&e.length&&"}"!=e.charAt(0)&&(i=P()||A());)!1!==i&&(r.push(i),f(r));return r}function u(t){var s=t.exec(e);if(s){var i=s[0];return r(i),e=e.slice(i.length),s}}function d(){u(/^\s*/)}function f(e){var t;for(e=e||[];t=m();)!1!==t&&e.push(t);return e}function m(){var t=a();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var s=2;""!=e.charAt(s)&&("*"!=e.charAt(s)||"/"!=e.charAt(s+1));)++s;if(s+=2,""===e.charAt(s-1))return h("End of comment missing");var n=e.slice(2,s-2);return i+=2,r(n),e=e.slice(s),i+=2,t({type:"comment",comment:n})}}function g(){var e=u(/^([^{]+)/);if(e)return Pt(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"‌")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function x(){var e=a(),t=u(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){if(t=Pt(t[0]),!u(/^:\s*/))return h("property missing ':'");var s=u(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),i=e({type:"declaration",property:t.replace(_t,""),value:s?Pt(s[0]).replace(_t,""):""});return u(/^[;\s]*/),i}}function y(){var e,t=[];if(!p())return h("missing '{'");for(f(t);e=x();)!1!==e&&(t.push(e),f(t));return l()?t:h("missing '}'")}function k(){for(var e,t=[],s=a();e=u(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),u(/^,\s*/);if(t.length)return s({type:"keyframe",values:t,declarations:y()})}var w,v,b,E=(w="import",v=new RegExp("^@"+w+"\\s*([^;\n\r]+);?"),function(){var e=a(),t=u(v);if(t){var s={type:w};return s[w]=t[1].trim(),e(s)}}),S=C("charset"),_=C("namespace");function C(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var s=a(),i=u(t);if(i){var r={type:e};return r[e]=i[1].trim(),s(r)}}}function P(){if("@"==e[0])return function(){var e=a();if(t=u(/^@([-\w]+)?keyframes\s*/)){var t,s=t[1];if(!(t=u(/^([-\w]+)\s*/)))return h("@keyframes missing name");var i,r=t[1];if(!p())return h("@keyframes missing '{'");for(var n=f();i=k();)n.push(i),n=n.concat(f());return l()?e({type:"keyframes",name:r,vendor:s,keyframes:n}):h("@keyframes missing '}'")}}()||function(){var e=a(),t=u(/^@media *([^{]+)/);if(t){var s=Pt(t[1]);if(!p())return h("@media missing '{'");var i=f().concat(c());return l()?e({type:"media",media:s,rules:i}):h("@media missing '}'")}}()||function(){var e=a(),t=u(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:Pt(t[1]),media:Pt(t[2])})}()||function(){var e=a(),t=u(/^@supports *([^{]+)/);if(t){var s=Pt(t[1]);if(!p())return h("@supports missing '{'");var i=f().concat(c());return l()?e({type:"supports",supports:s,rules:i}):h("@supports missing '}'")}}()||E()||S()||_()||function(){var e=a(),t=u(/^@([-\w]+)?document *([^{]+)/);if(t){var s=Pt(t[1]),i=Pt(t[2]);if(!p())return h("@document missing '{'");var r=f().concat(c());return l()?e({type:"document",document:i,vendor:s,rules:r}):h("@document missing '}'")}}()||function(){var e=a();if(u(/^@page */)){var t=g()||[];if(!p())return h("@page missing '{'");for(var s,i=f();s=x();)i.push(s),i=i.concat(f());return l()?e({type:"page",selectors:t,declarations:i}):h("@page missing '}'")}}()||function(){var e=a();if(u(/^@host\s*/)){if(!p())return h("@host missing '{'");var t=f().concat(c());return l()?e({type:"host",rules:t}):h("@host missing '}'")}}()||function(){var e=a();if(u(/^@font-face\s*/)){if(!p())return h("@font-face missing '{'");for(var t,s=f();t=x();)s.push(t),s=s.concat(f());return l()?e({type:"font-face",declarations:s}):h("@font-face missing '}'")}}()}function A(){var e=a(),t=g();return t?(f(),e({type:"rule",selectors:t,declarations:y()})):h("selector missing")}return At((b=c(),{type:"stylesheet",stylesheet:{source:t.source,rules:b,parsingErrors:o}}))}function Pt(e){return e?e.replace(/^\s+|\s+$/g,""):""}function At(e,t){var s=e&&"string"==typeof e.type,i=s?e:t;for(var r in e){var a=e[r];Array.isArray(a)?a.forEach((function(e){At(e,i)})):a&&"object"==typeof a&&At(a,i)}return s&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}const It={MainPackage:class extends N{constructor(e,t){super(e,t),t.originModule=this}get subpackages(){return Array.from(this.deps).filter((e=>"SubPackage"===e.type&&e.module)).map((e=>e.module))}addParentDep(e){super.addParentDep(e),e.originModule=this}async build(e){let t=this;this.addDep(new y("Js","app.js",t,this.fileHelper,!1,!0)),this.addDep(new y("Wxss","app.wxss",t,this.fileHelper,!1,!1));let s=await this.loadAppJSON();return s&&(this.config=s,this.trackUseExtendedLibs(s,e),s.pages.forEach((e=>{this.addDep(new v(e,t,this.fileHelper))})),s.usingComponents&&Object.keys(s.usingComponents).forEach((e=>{let i=s.usingComponents[e];this.addDep(new b(e,i,t,this.fileHelper))})),s.subPackages&&s.subPackages.forEach((e=>{this.addDep(new w(e,t,this.fileHelper))})),s.subpackages&&s.subpackages.forEach((e=>{this.addDep(new w(e,t,this.fileHelper))})),s.workers&&this.addDep(new S(s.workers,t,this.fileHelper)),s.sitemapLocation?this.addDep(new E(s.sitemapLocation,t,this.fileHelper)):this.fileHelper.existFile("sitemap.json")&&this.addDep(new E("sitemap.json",t,this.fileHelper,"rule")),s.themeLocation&&this.addDep(new E(s.themeLocation,t,this.fileHelper)),s.tabBar&&!0===s.tabBar.custom&&this.addDep(new b("custom-tab-bar","custom-tab-bar/index",t,this.fileHelper)),this.fileHelper.existFile("project.config.json")&&this.addDep(new E("project.config.json",t,this.fileHelper,"rule")),this.addDep(new _(t,this.fileHelper))),Array.from(this.deps)}async reuse(e){this.trackUseExtendedLibs(this.config,e)}trackUseExtendedLibs(e,t){var s;if(e.useExtendedLib)for(const i in e.useExtendedLib)if(e.useExtendedLib[i]){const e={kbone:{packages:["miniprogram-element","miniprogram-render"]},weui:{packages:["weui-miniprogram"]}};"kbone"!==i&&"weui"!==i||null===(s=t.miniprogram.useExtendedPackages)||void 0===s||s.push(...e[i].packages)}}async loadAppJSON(){const e=this.fileHelper,t="app.json";if(e.existFile(t))try{return await e.getJSON(t)}catch(e){console.error(e),this.markError(exports.ModuleErrorType.JSON_PARSE_ERR,e)}else this.markError(exports.ModuleErrorType.APP_JSON_NOT_FOUND,new Error("Couldn't find the app.json file"))}},SubPackage:class extends N{constructor(e,t){super(e,t),this.config=t.config,this.mtime=this.fileHelper.mtime("app.json")}isValid(){return this.mtime===this.fileHelper.mtime("app.json")}async build(e){return this.config.pages.forEach((e=>{this.addDep(new v(e,this,this.fileHelper))})),Array.from(this.deps)}},Page:class extends D{constructor(e,t){super(e,t)}},Component:D,Wxml:class extends N{constructor(e,t){super(e,t)}async build(e){let t;try{t=await this.fileHelper.getString(this.path)}catch(e){throw this.markError(exports.ModuleErrorType.FILE_NOT_UTF8,e),e}return function(e){e=e.replace(/<!--([\s\S]*?)-->/g,"");const t=/<(import|include|wxs)[^>]*src\s*=\s*['"]([^'"]*)['"][^>]*>/gi,s=[];let i=null;for(;i=t.exec(e);)s.push({type:"wxs"===i[1]?"wxs":"wxml",route:i[2]});return s}(t).forEach((async e=>{this.addDep(new y("wxml"===e.type?"Wxml":"Wxs",e.route,this,this.fileHelper,!0,!0))})),Array.from(this.deps)}},Wxss:class extends N{constructor(e,t){super(e,t)}async build(e){let t;try{t=await this.fileHelper.getString(this.path)}catch(e){throw this.markError(exports.ModuleErrorType.FILE_NOT_UTF8,e),e}try{(function(e,t){const s=function(e){const t=e.lastIndexOf("@import");if(t>=0){let s=1;const i=e.slice(0,t).match(/\n/g);return i&&(s+=i.length),s}return 0}(e);if(s<=0)return[];const i=Ct(e,{source:t.path,skipRuleLineno:s}),r=[];return(i.stylesheet?i.stylesheet.rules:[]).forEach((e=>{if(function(e){return"import"===e.type}(e)&&e.import){const t=e.import.replace(/'|"/g,"");r.push(t)}})),r})(t,{path:this.path}).forEach((async e=>{this.addDep(new y("Wxss",e,this,this.fileHelper,!0,!0))}))}catch(e){throw this.markError(exports.ModuleErrorType.WXSS_PARSE_ERR,e),e}return Array.from(this.deps)}},Js:St,Wxs:class extends St{constructor(e,t){super(e,t)}},Plugin:St,Worker:class extends N{constructor(e,t){super(e,t)}async build(e){const t=this.path;return this.fileHelper.getFileList(t+"/","js").forEach((async e=>{this.addDep(new y("Js",e,this,this.fileHelper,!1,!0))})),Array.from(this.deps)}isValid(){return!1}},FunctionalPages:class extends N{constructor(e,t){super(e,t)}async build(e){return this.fileHelper.getFileList(this.path+"/","js").forEach((async e=>{this.addDep(new y("Js",e,this,this.fileHelper,!1,!0))})),Array.from(this.deps)}isValid(){return!1}},ContextModule:class extends N{constructor(e,t){super(e,t),this.dep=t}async build(e){const t=this.dep.context,s=this.dep.regExp;let i=async e=>{let r=await this.fileHelper.readdir(e);r=r.filter((e=>0!==e.indexOf(".")));let a=[];return await Promise.all(r.map((async r=>{const o=n.default.posix.join(e,r);try{let e=await this.fileHelper.stat(o);if(null==e?void 0:e.isDirectory){let e=await i(o);a=a.concat(e)}else{if(!(null==e?void 0:e.isFile)||!o.endsWith("."+this.dep.fileType))return;{let e="."+o.substr(t.length).replace(/\\/g,"/"),i=e.replace(/\.(js|wxs)$/,"");(s.test(e)||s.test(i))&&a.push(o)}}}catch(e){if("ENOENT"===e.code)return;throw e}}))),a};return(await i(t)).forEach((async e=>{this.addDep(new y("js"===this.dep.fileType?"Js":"Wxs",e,this,this.fileHelper,!1,!0))})),Array.from(this.deps)}isValid(){return!1}},Config:class extends N{constructor(e,t){super(e,t)}async build(e){return[]}},PluginPackage:class extends N{constructor(e,t){super(e,t),t.originModule=this}async build(e){let t=this,s=await this.loadPluginJSON();return s&&(this.config=s,Object.values(s.pages).forEach((e=>{this.addDep(new v(e,t,this.fileHelper))})),s.usingComponents&&Object.keys(s.usingComponents).forEach((e=>{let i=s.usingComponents[e];this.addDep(new b(e,i,t,this.fileHelper))})),s.publicComponents&&Object.keys(s.publicComponents).forEach((e=>{let i=s.publicComponents[e];this.addDep(new b(e,i,t,this.fileHelper))})),s.themeLocation&&this.addDep(new E(s.themeLocation,t,this.fileHelper)),s.main&&this.addDep(new y("Js",s.main,t,this.fileHelper,!1,!0))),Array.from(this.deps)}async loadPluginJSON(){const e=this.fileHelper,t="plugin.json";if(e.existFile(t))try{return await e.getJSON(t)}catch(e){console.error(e),this.markError(exports.ModuleErrorType.JSON_PARSE_ERR,e)}else this.markError(exports.ModuleErrorType.PLUGIN_JSON_NOT_FOUND,new Error("Couldn't find the plugin.json file"))}},GameMainPackage:class extends N{constructor(e,t){super(e,t),t.originModule=this}get subpackages(){return Array.from(this.deps).filter((e=>"GameSubPackage"===e.type&&e.module)).map((e=>e.module))}addParentDep(e){super.addParentDep(e),e.originModule=this}async build(e){let t=this;this.addDep(new y("Js","game.js",t,this.fileHelper,!1,!0));let s=await this.loadGameJSON();return s&&(this.config=s,s.subPackages&&s.subPackages.forEach((e=>{this.addDep(new I(e,t,this.fileHelper))})),s.subpackages&&s.subpackages.forEach((e=>{this.addDep(new I(e,t,this.fileHelper))})),s.workers&&this.addDep(new S(s.workers,t,this.fileHelper)),s.openDataContext&&this.addDep(new y("Js",n.default.posix.join(s.openDataContext,"index.js"),t,this.fileHelper,!1,!0)),this.fileHelper.existFile("project.config.json")&&this.addDep(new E("project.config.json",t,this.fileHelper,"rule"))),Array.from(this.deps)}async loadGameJSON(){const e=this.fileHelper,t="game.json";if(e.existFile(t))try{return await e.getJSON(t)}catch(e){console.error(e),this.markError(exports.ModuleErrorType.JSON_PARSE_ERR,e)}else this.markError(exports.ModuleErrorType.APP_JSON_NOT_FOUND,new Error("Couldn't find the game.json file"))}},GameSubPackage:class extends N{constructor(e,t){super(e,t),this.config=t.config,this.mtime=this.fileHelper.mtime("game.json")}isValid(){return this.mtime===this.fileHelper.mtime("game.json")}async build(e){return this.fileHelper.existFile(this.config.root)?this.addDep(new y("Js",this.config.root,this,this.fileHelper,!1,!0)):this.addDep(new y("Js",n.default.posix.join(this.config.root,"game.js"),this,this.fileHelper,!1,!0)),Array.from(this.deps)}}};function Nt(e,t){return new It[t.type](e,t)}var Tt;!function(e){e.beforeBuild="beforeBuild",e.afterBuild="afterBuild"}(Tt||(Tt={}));class Dt{constructor(e){this.fileHelper=e.fileHelper,this.es6Parser={isLayaGame:!1},this.miniprogram=this.initMiniprogram()}initMiniprogram(){return{useExtendedPackages:[]}}}class Rt{constructor(e,t){this.status="inited",this.pluginDriver=void 0,this._modules=[],this.prevGraph=void 0,this.costTime=0,this.runningTasks=[],this.pendingTasks=[],this.resolve=null,this.fileHelper=e.fileHelper,this.pluginDriver=e.pluginDriver,this.prevGraph=t,this.graphContext=new Dt(e)}get modules(){return this._modules}processDep(e){let t=this.getModule(e.type,e.path);t?t.addParentDep(e):(this.prevGraph&&(t=this.prevGraph.getModule(e.type,e.path),t&&t.isValid()?(t.parentDeps.clear(),t.addParentDep(e),this.modules.push(t),this.pendingTasks.push({module:t,type:"reuse"})):t=void 0),t||(t=Nt(this.fileHelper,e),t.addParentDep(e),this.modules.push(t),this.pendingTasks.push({module:t,type:"build"})))}async processDeps(e){await Promise.all(e.map((async e=>{var t,s;try{await e.resolve(this.graphContext)&&this.processDep(e),null===(t=this.pluginDriver)||void 0===t||t.callPlugin("onDepResolveSucceed",e)}catch(t){null===(s=this.pluginDriver)||void 0===s||s.callPlugin("onDepResolveFailed",e,t)}})))}async processTask(e){var t,s,i,r,a;const n=Date.now(),o=e.module;let h=[];if("build"===e.type){null===(t=this.pluginDriver)||void 0===t||t.callPlugin("beforeModuleBuild",o,e.type);let a=null;try{h=await o.build(this.graphContext)}catch(e){a=e}const p=Date.now()-n;a?null===(s=this.pluginDriver)||void 0===s||s.callPlugin("onModuleBuildSucceed",o,p):null===(i=this.pluginDriver)||void 0===i||i.callPlugin("onModuleBuildSucceed",o,p,a),null===(r=this.pluginDriver)||void 0===r||r.callPlugin("afterModuleBuild",o,p,a)}else"reuse"in o&&o.reuse(this.graphContext),null===(a=this.pluginDriver)||void 0===a||a.callPlugin("onModuleReuse",o),h=Array.from(o.deps);await this.processDeps(h),this.runningTasks.splice(this.runningTasks.indexOf(e),1),this.run()}run(){let e=100-this.runningTasks.length;if(e>0&&this.pendingTasks.length>0){let t=e>this.pendingTasks.length?this.pendingTasks.length:e,s=this.pendingTasks.slice(0,t);this.pendingTasks=this.pendingTasks.slice(t),this.runningTasks=this.runningTasks.concat(s),s.forEach((e=>{this.processTask(e)}))}0===this.pendingTasks.length&&0===this.runningTasks.length&&this.resolve(!0)}getModule(e,t){return this._modules.find((s=>s.type===e&&s.path===t))}async build(e){this.status="building";const t=Date.now();if(Array.isArray(e)){let t=e;for(let e of t)await this._build(e)}else await this._build(e);this._modules=this._modules.sort(((e,t)=>e.id>t.id?1:-1)),this.costTime=Date.now()-t,this.status="completed"}async _build(e){await e.resolve(this.graphContext)&&await new Promise(((t,s)=>{this.resolve=t,this.processDep(e),this.run()}))}}exports.Analyzer=class{constructor(e){this.root="",this.modules=[],this.graph=void 0,this.invalid=!1,this.root=e.root,this.type=e.type,this.plugins=e.plugins||[],this.fileHelper=e.fileHelper?e.fileHelper:new d(e.root,e.type),this.callPlugin("created",this)}getEntryDep(){switch(this.type){case"miniprogram":return new C(this.fileHelper);case"plugin":return new P(this.fileHelper);case"game":return new A(this.fileHelper);case"gamePlugin":throw new Error("not support gamePlugin yet")}}async analyse(){this.invalid=!1;const e=this.getEntryDep();let t=this.graph;this.graph=new Rt({fileHelper:this.fileHelper,pluginDriver:this},t),this.callPlugin("beforeAnalyseProcessStart",this.graph,t),await this.graph.build(e),this.modules=this.graph.modules,this.callPlugin("afterAnalyseProcessComplete",this.graph),this.invalid&&this.analyse()}watch(e){this.fileHelper.watchFileChange((async()=>{this.graph&&"building"===this.graph.status?this.invalid=!0:(await this.analyse(),e())}))}serialize(){if(this.graph){let e=function(e){let t=Object.keys(l);return e.getFileList("").filter((e=>t.indexOf(n.default.posix.extname(e))>=0)).map((t=>{let s=e.stat(t);return{path:t,ext:n.default.extname(t),size:s.size,moduleId:null,subPackage:null}}))}(this.fileHelper);!function(e,t){e.modules.forEach((e=>{if("SubPackage"===e.type){const s=e.path;t.forEach((t=>{t.path.startsWith(s)&&(t.subPackage=e.path)}))}const s=t.find((t=>t.path===e.path));s&&(s.moduleId=e.id)}))}(this.graph,e);let t={files:e,modules:this.graph.modules.map((e=>{let t=e.serialize();return this.callPlugin("onModuleSerialize",e,t),t}))};return this.callPlugin("onSerialize",t),t}}callPlugin(e,...t){this.plugins.forEach((s=>{if(s[e])try{s[e].apply(s,t)}catch(t){console.error(`plugin ${s.name} call ${e} occur some error`,t)}}))}},exports.FileHelper=d,exports.Graph=Rt,exports.analyseJsDependenies=async function(e,t){let s;s="string"==typeof e?[e]:e;const i=s.map((e=>new y("Js",e,null,t,!1,!0))),r=new Rt({fileHelper:t});if(await r.build(i),i[0].error)throw i[0].error;return{startModules:i.map((e=>e.module)),modules:r.modules}},exports.analyseSingeFile=async function(e,t){const s={".js":"Js",".wxs":"Wxs",".wxml":"Wxml",".wxss":"Wxss"}[n.default.posix.extname(e)];if(!s)throw new Error("Unsupported file");const i=new y(s,e,null,t,!1,!1);i.path=e;const r=Nt(t,i),a=new Dt({fileHelper:t}),o=await r.build(a);return await Promise.all(o.map((e=>{try{e.resolve(a)}catch(e){}}))),o},exports.findAllDescendant=function(e,t){let s;s=Array.isArray(e)?e:[e];const i=s.slice(0),r=[],a=[];for(;i.length>0;){const e=i.pop();r.push(e),e.childModules.forEach((e=>{i.indexOf(e)<0&&r.indexOf(e)<0&&(i.push(e),e.type===t&&a.push(e))}))}return a};
2
2
  //# sourceMappingURL=index.js.map