UNPKG

@codesandbox/sandpack-client

Version:

<img style="width:100%" src="https://user-images.githubusercontent.com/4838076/143581035-ebee5ba2-9cb1-4fe8-a05b-2f44bd69bb4b.gif" alt="Component toolkit for live running code editing experiences" />

2 lines 642 kB
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.pug=e()}}(function(){var e;return function e(t,n,r){function i(s,a){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[s]={exports:{}};t[s][0].call(l.exports,function(e){var n=t[s][1][e];return i(n||e)},l,l.exports,e,t,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(e,t,n){"use strict";function r(e){return"FunctionExpression"===e.type||"FunctionDeclaration"===e.type||"ArrowFunctionExpression"===e.type||"Program"===e.type}function i(e){return"BlockStatement"===e.type||r(e)}function o(e){return"FunctionExpression"===e.type||"FunctionDeclaration"===e.type}function s(e){return"FunctionExpression"===e.type||"FunctionDeclaration"===e.type}function a(e){return c.parse(e,{allowReturnOutsideFunction:!0,allowImportExportEverywhere:!0,allowHashBang:!0})}function u(e){function t(e,t){var n=e.name;if("undefined"!==n){for(var r=0;r<t.length;r++){if("arguments"===n&&o(t[r]))return;if(t[r].locals&&n in t[r].locals)return}e.parents=t,u.push(e)}}var n,u=[];if(!(n="string"==typeof e?a(e):e)||"object"!=typeof n||"Program"!==n.type)throw new TypeError("Source must be either a string of JavaScript or an acorn AST");var c=function(e){var t=e;t.locals=t.locals||{},e.params.forEach(function(e){p(e,t)}),e.id&&(t.locals[e.id.name]=!0)},p=function(e,t){switch(e.type){case"Identifier":t.locals[e.name]=!0;break;case"ObjectPattern":e.properties.forEach(function(e){p(e.value,t)});break;case"ArrayPattern":e.elements.forEach(function(e){e&&p(e,t)});break;case"RestElement":p(e.argument,t);break;case"AssignmentPattern":p(e.left,t);break;default:throw new Error("Unrecognized pattern type: "+e.type)}},f=function(e,t){n.locals=n.locals||{},n.locals[e.local.name]=!0};l.ancestor(n,{VariableDeclaration:function(e,t){for(var n=null,o=t.length-1;o>=0&&null===n;o--)("var"===e.kind?r(t[o]):i(t[o]))&&(n=t[o]);n.locals=n.locals||{},e.declarations.forEach(function(e){p(e.id,n)})},FunctionDeclaration:function(e,t){for(var n=null,i=t.length-2;i>=0&&null===n;i--)r(t[i])&&(n=t[i]);n.locals=n.locals||{},n.locals[e.id.name]=!0,c(e)},Function:c,ClassDeclaration:function(e,t){for(var n=null,i=t.length-2;i>=0&&null===n;i--)r(t[i])&&(n=t[i]);n.locals=n.locals||{},n.locals[e.id.name]=!0},TryStatement:function(e){null!==e.handler&&(e.handler.locals=e.handler.locals||{},e.handler.locals[e.handler.param.name]=!0)},ImportDefaultSpecifier:f,ImportSpecifier:f,ImportNamespaceSpecifier:f}),l.ancestor(n,{VariablePattern:t,Identifier:t,ThisExpression:function(e,t){for(var n=0;n<t.length;n++)if(s(t[n]))return;e.parents=t,u.push(e)}});var h={};return u.forEach(function(e){var t="ThisExpression"===e.type?"this":e.name;h[t]=h[t]||[],h[t].push(e)}),Object.keys(h).sort().map(function(e){return{name:e,nodes:h[e]}})}var c=e("acorn"),l=e("acorn/dist/walk");t.exports=u,t.exports.parse=a},{acorn:2,"acorn/dist/walk":3}],2:[function(t,n,r){!function(t,i){"object"==typeof r&&void 0!==n?i(r):"function"==typeof e&&e.amd?e(["exports"],i):i(t.acorn=t.acorn||{})}(this,function(e){"use strict";function t(e,t){for(var n=65536,r=0;r<t.length;r+=2){if((n+=t[r])>e)return!1;if((n+=t[r+1])>=e)return!0}}function n(e,n){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&A.test(String.fromCharCode(e)):n!==!1&&t(e,S)))}function r(e,n){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&C.test(String.fromCharCode(e)):n!==!1&&(t(e,S)||t(e,T)))))}function i(e,t){return new O(e,{beforeExpr:!0,binop:t})}function o(e,t){return void 0===t&&(t={}),t.keyword=e,B[e]=new O(e,t)}function s(e){return 10===e||13===e||8232===e||8233===e}function a(e){return"[object Array]"===Object.prototype.toString.call(e)}function u(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function c(e,t){for(var n=1,r=0;;){M.lastIndex=r;var i=M.exec(e);if(!(i&&i.index<t))return new I(n,t-r);++n,r=i.index+i[0].length}}function l(e){var t={};for(var n in V)t[n]=e&&u(e,n)?e[n]:V[n];if(t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),a(t.onToken)){var r=t.onToken;t.onToken=function(e){return r.push(e)}}return a(t.onComment)&&(t.onComment=p(t,t.onComment)),t}function p(e,t){return function(n,r,i,o,s,a){var u={type:n?"Block":"Line",value:r,start:i,end:o};e.locations&&(u.loc=new j(this,s,a)),e.ranges&&(u.range=[i,o]),t.push(u)}}function f(e){return new RegExp("^("+e.replace(/ /g,"|")+")$")}function h(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}function d(e,t,n,r){try{return new RegExp(e,t)}catch(e){if(void 0!==n)throw e instanceof SyntaxError&&r.raise(n,"Error parsing regular expression: "+e.message),e}}function m(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function g(e,t){return new z(t,e).parse()}function v(e,t,n){var r=new z(n,e,t);return r.nextToken(),r.parseExpression()}function y(e,t){return new z(t,e)}function b(t,n,r){e.parse_dammit=t,e.LooseParser=n,e.pluginsLoose=r}var _={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"},x="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",w={5:x,6:x+" const class extends export import super"},k="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢴࢶ-ࢽऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿕ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞮꞰ-ꞷꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭥꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",E="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣔ-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఃా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഁ-ഃാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᳸᳹᷀-᷵᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱꤀-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",A=new RegExp("["+k+"]"),C=new RegExp("["+k+E+"]");k=E=null;var S=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,17,26,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,26,45,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,785,52,76,44,33,24,27,35,42,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,54,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,86,25,391,63,32,0,449,56,264,8,2,36,18,0,50,29,881,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,881,68,12,0,67,12,65,0,32,6124,20,754,9486,1,3071,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,4149,196,60,67,1213,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,42710,42,4148,12,221,3,5761,10591,541],T=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,1306,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,52,0,13,2,49,13,10,2,4,9,83,11,7,0,161,11,6,9,7,3,57,0,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,87,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,423,9,838,7,2,7,17,9,57,21,2,13,19882,9,135,4,60,6,26,9,1016,45,17,3,19723,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,2214,6,110,6,6,9,792487,239],O=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},F={beforeExpr:!0},L={startsExpr:!0},B={},D={num:new O("num",L),regexp:new O("regexp",L),string:new O("string",L),name:new O("name",L),eof:new O("eof"),bracketL:new O("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new O("]"),braceL:new O("{",{beforeExpr:!0,startsExpr:!0}),braceR:new O("}"),parenL:new O("(",{beforeExpr:!0,startsExpr:!0}),parenR:new O(")"),comma:new O(",",F),semi:new O(";",F),colon:new O(":",F),dot:new O("."),question:new O("?",F),arrow:new O("=>",F),template:new O("template"),ellipsis:new O("...",F),backQuote:new O("`",L),dollarBraceL:new O("${",{beforeExpr:!0,startsExpr:!0}),eq:new O("=",{beforeExpr:!0,isAssign:!0}),assign:new O("_=",{beforeExpr:!0,isAssign:!0}),incDec:new O("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new O("prefix",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:i("||",1),logicalAND:i("&&",2),bitwiseOR:i("|",3),bitwiseXOR:i("^",4),bitwiseAND:i("&",5),equality:i("==/!=",6),relational:i("</>",7),bitShift:i("<</>>",8),plusMin:new O("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:i("%",10),star:i("*",10),slash:i("/",10),starstar:new O("**",{beforeExpr:!0}),_break:o("break"),_case:o("case",F),_catch:o("catch"),_continue:o("continue"),_debugger:o("debugger"),_default:o("default",F),_do:o("do",{isLoop:!0,beforeExpr:!0}),_else:o("else",F),_finally:o("finally"),_for:o("for",{isLoop:!0}),_function:o("function",L),_if:o("if"),_return:o("return",F),_switch:o("switch"),_throw:o("throw",F),_try:o("try"),_var:o("var"),_const:o("const"),_while:o("while",{isLoop:!0}),_with:o("with"),_new:o("new",{beforeExpr:!0,startsExpr:!0}),_this:o("this",L),_super:o("super",L),_class:o("class"),_extends:o("extends",F),_export:o("export"),_import:o("import"),_null:o("null",L),_true:o("true",L),_false:o("false",L),_in:o("in",{beforeExpr:!0,binop:7}),_instanceof:o("instanceof",{beforeExpr:!0,binop:7}),_typeof:o("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:o("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:o("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},R=/\r\n?|\n|\u2028|\u2029/,M=new RegExp(R.source,"g"),N=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/,P=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,I=function(e,t){this.line=e,this.column=t};I.prototype.offset=function(e){return new I(this.line,this.column+e)};var j=function(e,t,n){this.start=t,this.end=n,null!==e.sourceFile&&(this.source=e.sourceFile)},V={ecmaVersion:7,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1,plugins:{}},U={},z=function(e,t,n){this.options=e=l(e),this.sourceFile=e.sourceFile,this.keywords=f(w[e.ecmaVersion>=6?6:5]);var r="";if(!e.allowReserved){for(var i=e.ecmaVersion;!(r=_[i]);i--);"module"==e.sourceType&&(r+=" await")}this.reservedWords=f(r);var o=(r?r+" ":"")+_.strict;this.reservedWordsStrict=f(o),this.reservedWordsStrictBind=f(o+" "+_.strictBind),this.input=String(t),this.containsEsc=!1,this.loadPlugins(e.plugins),n?(this.pos=n,this.lineStart=this.input.lastIndexOf("\n",n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(R).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=D.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.inFunction=this.inGenerator=this.inAsync=!1,this.yieldPos=this.awaitPos=0,this.labels=[],0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2)};z.prototype.isKeyword=function(e){return this.keywords.test(e)},z.prototype.isReservedWord=function(e){return this.reservedWords.test(e)},z.prototype.extend=function(e,t){this[e]=t(this[e])},z.prototype.loadPlugins=function(e){var t=this;for(var n in e){var r=U[n];if(!r)throw new Error("Plugin '"+n+"' not found");r(t,e[n])}},z.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)};var q=z.prototype,$=/^(?:'((?:[^\']|\.)*)'|"((?:[^\"]|\.)*)"|;)/;q.strictDirective=function(e){for(var t=this;;){P.lastIndex=e,e+=P.exec(t.input)[0].length;var n=$.exec(t.input.slice(e));if(!n)return!1;if("use strict"==(n[1]||n[2]))return!0;e+=n[0].length}},q.eat=function(e){return this.type===e&&(this.next(),!0)},q.isContextual=function(e){return this.type===D.name&&this.value===e},q.eatContextual=function(e){return this.value===e&&this.eat(D.name)},q.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},q.canInsertSemicolon=function(){return this.type===D.eof||this.type===D.braceR||R.test(this.input.slice(this.lastTokEnd,this.start))},q.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},q.semicolon=function(){this.eat(D.semi)||this.insertSemicolon()||this.unexpected()},q.afterTrailingComma=function(e,t){if(this.type==e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},q.expect=function(e){this.eat(e)||this.unexpected()},q.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")};var H=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=-1};q.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,"Parenthesized pattern")}},q.checkExpressionErrors=function(e,t){var n=e?e.shorthandAssign:-1;if(!t)return n>=0;n>-1&&this.raise(n,"Shorthand property assignments are valid only in destructuring patterns")},q.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")},q.isSimpleAssignTarget=function(e){return"ParenthesizedExpression"===e.type?this.isSimpleAssignTarget(e.expression):"Identifier"===e.type||"MemberExpression"===e.type};var W=z.prototype;W.parseTopLevel=function(e){var t=this,n={};for(e.body||(e.body=[]);this.type!==D.eof;){var r=t.parseStatement(!0,!0,n);e.body.push(r)}return this.next(),this.options.ecmaVersion>=6&&(e.sourceType=this.options.sourceType),this.finishNode(e,"Program")};var G={kind:"loop"},X={kind:"switch"};W.isLet=function(){if(this.type!==D.name||this.options.ecmaVersion<6||"let"!=this.value)return!1;P.lastIndex=this.pos;var e=P.exec(this.input),t=this.pos+e[0].length,i=this.input.charCodeAt(t);if(91===i||123==i)return!0;if(n(i,!0)){for(var o=t+1;r(this.input.charCodeAt(o),!0);++o);var s=this.input.slice(t,o);if(!this.isKeyword(s))return!0}return!1},W.isAsyncFunction=function(){if(this.type!==D.name||this.options.ecmaVersion<8||"async"!=this.value)return!1;P.lastIndex=this.pos;var e=P.exec(this.input),t=this.pos+e[0].length;return!(R.test(this.input.slice(this.pos,t))||"function"!==this.input.slice(t,t+8)||t+8!=this.input.length&&r(this.input.charAt(t+8)))},W.parseStatement=function(e,t,n){var r,i=this.type,o=this.startNode();switch(this.isLet()&&(i=D._var,r="let"),i){case D._break:case D._continue:return this.parseBreakContinueStatement(o,i.keyword);case D._debugger:return this.parseDebuggerStatement(o);case D._do:return this.parseDoStatement(o);case D._for:return this.parseForStatement(o);case D._function:return!e&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(o,!1);case D._class:return e||this.unexpected(),this.parseClass(o,!0);case D._if:return this.parseIfStatement(o);case D._return:return this.parseReturnStatement(o);case D._switch:return this.parseSwitchStatement(o);case D._throw:return this.parseThrowStatement(o);case D._try:return this.parseTryStatement(o);case D._const:case D._var:return r=r||this.value,e||"var"==r||this.unexpected(),this.parseVarStatement(o,r);case D._while:return this.parseWhileStatement(o);case D._with:return this.parseWithStatement(o);case D.braceL:return this.parseBlock();case D.semi:return this.parseEmptyStatement(o);case D._export:case D._import: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'")),i===D._import?this.parseImport(o):this.parseExport(o,n);default:if(this.isAsyncFunction()&&e)return this.next(),this.parseFunctionStatement(o,!0);var s=this.value,a=this.parseExpression();return i===D.name&&"Identifier"===a.type&&this.eat(D.colon)?this.parseLabeledStatement(o,s,a):this.parseExpressionStatement(o,a)}},W.parseBreakContinueStatement=function(e,t){var n=this,r="break"==t;this.next(),this.eat(D.semi)||this.insertSemicolon()?e.label=null:this.type!==D.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var i=0;i<this.labels.length;++i){var o=n.labels[i];if(null==e.label||o.name===e.label.name){if(null!=o.kind&&(r||"loop"===o.kind))break;if(e.label&&r)break}}return i===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,r?"BreakStatement":"ContinueStatement")},W.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")},W.parseDoStatement=function(e){return this.next(),this.labels.push(G),e.body=this.parseStatement(!1),this.labels.pop(),this.expect(D._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(D.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},W.parseForStatement=function(e){if(this.next(),this.labels.push(G),this.expect(D.parenL),this.type===D.semi)return this.parseFor(e,null);var t=this.isLet();if(this.type===D._var||this.type===D._const||t){var n=this.startNode(),r=t?"let":this.value;return this.next(),this.parseVar(n,!0,r),this.finishNode(n,"VariableDeclaration"),!(this.type===D._in||this.options.ecmaVersion>=6&&this.isContextual("of"))||1!==n.declarations.length||"var"!==r&&n.declarations[0].init?this.parseFor(e,n):this.parseForIn(e,n)}var i=new H,o=this.parseExpression(!0,i);return this.type===D._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.toAssignable(o),this.checkLVal(o),this.checkPatternErrors(i,!0),this.parseForIn(e,o)):(this.checkExpressionErrors(i,!0),this.parseFor(e,o))},W.parseFunctionStatement=function(e,t){return this.next(),this.parseFunction(e,!0,!1,t)},W.isFunction=function(){return this.type===D._function||this.isAsyncFunction()},W.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(!this.strict&&this.isFunction()),e.alternate=this.eat(D._else)?this.parseStatement(!this.strict&&this.isFunction()):null,this.finishNode(e,"IfStatement")},W.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(D.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},W.parseSwitchStatement=function(e){var t=this;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(D.braceL),this.labels.push(X);for(var n,r=!1;this.type!=D.braceR;)if(t.type===D._case||t.type===D._default){var i=t.type===D._case;n&&t.finishNode(n,"SwitchCase"),e.cases.push(n=t.startNode()),n.consequent=[],t.next(),i?n.test=t.parseExpression():(r&&t.raiseRecoverable(t.lastTokStart,"Multiple default clauses"),r=!0,n.test=null),t.expect(D.colon)}else n||t.unexpected(),n.consequent.push(t.parseStatement(!0));return n&&this.finishNode(n,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},W.parseThrowStatement=function(e){return this.next(),R.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 Y=[];W.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===D._catch){var t=this.startNode();this.next(),this.expect(D.parenL),t.param=this.parseBindingAtom(),this.checkLVal(t.param,!0),this.expect(D.parenR),t.body=this.parseBlock(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(D._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},W.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},W.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(G),e.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(e,"WhileStatement")},W.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(!1),this.finishNode(e,"WithStatement")},W.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},W.parseLabeledStatement=function(e,t,n){for(var r=this,i=0;i<this.labels.length;++i)r.labels[i].name===t&&r.raise(n.start,"Label '"+t+"' is already declared");for(var o=this.type.isLoop?"loop":this.type===D._switch?"switch":null,s=this.labels.length-1;s>=0;s--){var a=r.labels[s];if(a.statementStart!=e.start)break;a.statementStart=r.start,a.kind=o}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(!0),("ClassDeclaration"==e.body.type||"VariableDeclaration"==e.body.type&&(this.strict||"var"!=e.body.kind)||"FunctionDeclaration"==e.body.type&&(this.strict||e.body.generator))&&this.raiseRecoverable(e.body.start,"Invalid labeled declaration"),this.labels.pop(),e.label=n,this.finishNode(e,"LabeledStatement")},W.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},W.parseBlock=function(){var e=this,t=this.startNode();for(t.body=[],this.expect(D.braceL);!this.eat(D.braceR);){var n=e.parseStatement(!0);t.body.push(n)}return this.finishNode(t,"BlockStatement")},W.parseFor=function(e,t){return e.init=t,this.expect(D.semi),e.test=this.type===D.semi?null:this.parseExpression(),this.expect(D.semi),e.update=this.type===D.parenR?null:this.parseExpression(),this.expect(D.parenR),e.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(e,"ForStatement")},W.parseForIn=function(e,t){var n=this.type===D._in?"ForInStatement":"ForOfStatement";return this.next(),e.left=t,e.right=this.parseExpression(),this.expect(D.parenR),e.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(e,n)},W.parseVar=function(e,t,n){var r=this;for(e.declarations=[],e.kind=n;;){var i=r.startNode();if(r.parseVarId(i),r.eat(D.eq)?i.init=r.parseMaybeAssign(t):"const"!==n||r.type===D._in||r.options.ecmaVersion>=6&&r.isContextual("of")?"Identifier"==i.id.type||t&&(r.type===D._in||r.isContextual("of"))?i.init=null:r.raise(r.lastTokEnd,"Complex binding patterns require an initialization value"):r.unexpected(),e.declarations.push(r.finishNode(i,"VariableDeclarator")),!r.eat(D.comma))break}return e},W.parseVarId=function(e){e.id=this.parseBindingAtom(),this.checkLVal(e.id,!0)},W.parseFunction=function(e,t,n,r){this.initFunction(e),this.options.ecmaVersion>=6&&!r&&(e.generator=this.eat(D.star)),this.options.ecmaVersion>=8&&(e.async=!!r),null==t&&(t=this.type==D.name),t&&(e.id=this.parseIdent());var i=this.inGenerator,o=this.inAsync,s=this.yieldPos,a=this.awaitPos,u=this.inFunction;return this.inGenerator=e.generator,this.inAsync=e.async,this.yieldPos=0,this.awaitPos=0,this.inFunction=!0,t||this.type!==D.name||(e.id=this.parseIdent()),this.parseFunctionParams(e),this.parseFunctionBody(e,n),this.inGenerator=i,this.inAsync=o,this.yieldPos=s,this.awaitPos=a,this.inFunction=u,this.finishNode(e,t?"FunctionDeclaration":"FunctionExpression")},W.parseFunctionParams=function(e){this.expect(D.parenL),e.params=this.parseBindingList(D.parenR,!1,this.options.ecmaVersion>=8,!0),this.checkYieldAwaitInDefaultParams()},W.parseClass=function(e,t){var n=this;this.next(),null==t&&(t=this.type===D.name),this.parseClassId(e,t),this.parseClassSuper(e);var r=this.startNode(),i=!1;for(r.body=[],this.expect(D.braceL);!this.eat(D.braceR);)if(!n.eat(D.semi)){var o=n.startNode(),s=n.eat(D.star),a=!1,u=n.type===D.name&&"static"===n.value;n.parsePropertyName(o),o.static=u&&n.type!==D.parenL,o.static&&(s&&n.unexpected(),s=n.eat(D.star),n.parsePropertyName(o)),n.options.ecmaVersion>=8&&!s&&!o.computed&&"Identifier"===o.key.type&&"async"===o.key.name&&n.type!==D.parenL&&!n.canInsertSemicolon()&&(a=!0,n.parsePropertyName(o)),o.kind="method";var c=!1;if(!o.computed){var l=o.key;s||a||"Identifier"!==l.type||n.type===D.parenL||"get"!==l.name&&"set"!==l.name||(c=!0,o.kind=l.name,l=n.parsePropertyName(o)),!o.static&&("Identifier"===l.type&&"constructor"===l.name||"Literal"===l.type&&"constructor"===l.value)&&(i&&n.raise(l.start,"Duplicate constructor in the same class"),c&&n.raise(l.start,"Constructor can't have get/set modifier"),s&&n.raise(l.start,"Constructor can't be a generator"),a&&n.raise(l.start,"Constructor can't be an async method"),o.kind="constructor",i=!0)}if(n.parseClassMethod(r,o,s,a),c){var p="get"===o.kind?0:1;if(o.value.params.length!==p){var f=o.value.start;"get"===o.kind?n.raiseRecoverable(f,"getter should have no params"):n.raiseRecoverable(f,"setter should have exactly one param")}else"set"===o.kind&&"RestElement"===o.value.params[0].type&&n.raiseRecoverable(o.value.params[0].start,"Setter cannot use rest params")}}return e.body=this.finishNode(r,"ClassBody"),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},W.parseClassMethod=function(e,t,n,r){t.value=this.parseMethod(n,r),e.body.push(this.finishNode(t,"MethodDefinition"))},W.parseClassId=function(e,t){e.id=this.type===D.name?this.parseIdent():t?this.unexpected():null},W.parseClassSuper=function(e){e.superClass=this.eat(D._extends)?this.parseExprSubscripts():null},W.parseExport=function(e,t){var n=this;if(this.next(),this.eat(D.star))return this.expectContextual("from"),e.source=this.type===D.string?this.parseExprAtom():this.unexpected(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(D._default)){this.checkExport(t,"default",this.lastTokStart);var r;if(this.type===D._function||(r=this.isAsyncFunction())){var i=this.startNode();this.next(),r&&this.next(),e.declaration=this.parseFunction(i,null,!1,r)}else if(this.type===D._class){var o=this.startNode();e.declaration=this.parseClass(o,null)}else e.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(!0),"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"))e.source=this.type===D.string?this.parseExprAtom():this.unexpected();else{for(var s=0;s<e.specifiers.length;s++)(n.keywords.test(e.specifiers[s].local.name)||n.reservedWords.test(e.specifiers[s].local.name))&&n.unexpected(e.specifiers[s].local.start);e.source=null}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")},W.checkExport=function(e,t,n){e&&(Object.prototype.hasOwnProperty.call(e,t)&&this.raiseRecoverable(n,"Duplicate export '"+t+"'"),e[t]=!0)},W.checkPatternExport=function(e,t){var n=this,r=t.type;if("Identifier"==r)this.checkExport(e,t.name,t.start);else if("ObjectPattern"==r)for(var i=0;i<t.properties.length;++i)n.checkPatternExport(e,t.properties[i].value);else if("ArrayPattern"==r)for(var o=0;o<t.elements.length;++o){var s=t.elements[o];s&&n.checkPatternExport(e,s)}else"AssignmentPattern"==r?this.checkPatternExport(e,t.left):"ParenthesizedExpression"==r&&this.checkPatternExport(e,t.expression)},W.checkVariableExport=function(e,t){var n=this;if(e)for(var r=0;r<t.length;r++)n.checkPatternExport(e,t[r].id)},W.shouldParseExportStatement=function(){return"var"===this.type.keyword||"const"===this.type.keyword||"class"===this.type.keyword||"function"===this.type.keyword||this.isLet()||this.isAsyncFunction()},W.parseExportSpecifiers=function(e){var t=this,n=[],r=!0;for(this.expect(D.braceL);!this.eat(D.braceR);){if(r)r=!1;else if(t.expect(D.comma),t.afterTrailingComma(D.braceR))break;var i=t.startNode();i.local=t.parseIdent(!0),i.exported=t.eatContextual("as")?t.parseIdent(!0):i.local,t.checkExport(e,i.exported.name,i.exported.start),n.push(t.finishNode(i,"ExportSpecifier"))}return n},W.parseImport=function(e){return this.next(),this.type===D.string?(e.specifiers=Y,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===D.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},W.parseImportSpecifiers=function(){var e=this,t=[],n=!0;if(this.type===D.name){var r=this.startNode();if(r.local=this.parseIdent(),this.checkLVal(r.local,!0),t.push(this.finishNode(r,"ImportDefaultSpecifier")),!this.eat(D.comma))return t}if(this.type===D.star){var i=this.startNode();return this.next(),this.expectContextual("as"),i.local=this.parseIdent(),this.checkLVal(i.local,!0),t.push(this.finishNode(i,"ImportNamespaceSpecifier")),t}for(this.expect(D.braceL);!this.eat(D.braceR);){if(n)n=!1;else if(e.expect(D.comma),e.afterTrailingComma(D.braceR))break;var o=e.startNode();o.imported=e.parseIdent(!0),e.eatContextual("as")?o.local=e.parseIdent():(o.local=o.imported,e.isKeyword(o.local.name)&&e.unexpected(o.local.start),e.reservedWordsStrict.test(o.local.name)&&e.raiseRecoverable(o.local.start,"The keyword '"+o.local.name+"' is reserved")),e.checkLVal(o.local,!0),t.push(e.finishNode(o,"ImportSpecifier"))}return t};var K=z.prototype;K.toAssignable=function(e,t){var n=this;if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier": this.inAsync&&"await"===e.name&&this.raise(e.start,"Can not use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":break;case"ObjectExpression":e.type="ObjectPattern";for(var r=0;r<e.properties.length;r++){var i=e.properties[r];"init"!==i.kind&&n.raise(i.key.start,"Object pattern can't contain getter or setter"),n.toAssignable(i.value,t)}break;case"ArrayExpression":e.type="ArrayPattern",this.toAssignableList(e.elements,t);break;case"AssignmentExpression":if("="!==e.operator){this.raise(e.left.end,"Only '=' operator can be used for specifying default value.");break}e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);case"AssignmentPattern":break;case"ParenthesizedExpression":e.expression=this.toAssignable(e.expression,t);break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}return e},K.toAssignableList=function(e,t){var n=this,r=e.length;if(r){var i=e[r-1];if(i&&"RestElement"==i.type)--r;else if(i&&"SpreadElement"==i.type){i.type="RestElement";var o=i.argument;this.toAssignable(o,t),"Identifier"!==o.type&&"MemberExpression"!==o.type&&"ArrayPattern"!==o.type&&this.unexpected(o.start),--r}t&&i&&"RestElement"===i.type&&"Identifier"!==i.argument.type&&this.unexpected(i.argument.start)}for(var s=0;s<r;s++){var a=e[s];a&&n.toAssignable(a,t)}return e},K.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")},K.parseRest=function(e){var t=this.startNode();return this.next(),t.argument=e?this.type===D.name?this.parseIdent():this.unexpected():this.type===D.name||this.type===D.bracketL?this.parseBindingAtom():this.unexpected(),this.finishNode(t,"RestElement")},K.parseBindingAtom=function(){if(this.options.ecmaVersion<6)return this.parseIdent();switch(this.type){case D.name:return this.parseIdent();case D.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(D.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case D.braceL:return this.parseObj(!0);default:this.unexpected()}},K.parseBindingList=function(e,t,n,r){for(var i=this,o=[],s=!0;!this.eat(e);)if(s?s=!1:i.expect(D.comma),t&&i.type===D.comma)o.push(null);else{if(n&&i.afterTrailingComma(e))break;if(i.type===D.ellipsis){var a=i.parseRest(r);i.parseBindingListItem(a),o.push(a),i.type===D.comma&&i.raise(i.start,"Comma is not permitted after the rest element"),i.expect(e);break}var u=i.parseMaybeDefault(i.start,i.startLoc);i.parseBindingListItem(u),o.push(u)}return o},K.parseBindingListItem=function(e){return e},K.parseMaybeDefault=function(e,t,n){if(n=n||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(D.eq))return n;var r=this.startNodeAt(e,t);return r.left=n,r.right=this.parseMaybeAssign(),this.finishNode(r,"AssignmentPattern")},K.checkLVal=function(e,t,n){var r=this;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(t?"Binding ":"Assigning to ")+e.name+" in strict mode"),n&&(u(n,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),n[e.name]=!0);break;case"MemberExpression":t&&this.raiseRecoverable(e.start,(t?"Binding":"Assigning to")+" member expression");break;case"ObjectPattern":for(var i=0;i<e.properties.length;i++)r.checkLVal(e.properties[i].value,t,n);break;case"ArrayPattern":for(var o=0;o<e.elements.length;o++){var s=e.elements[o];s&&r.checkLVal(s,t,n)}break;case"AssignmentPattern":this.checkLVal(e.left,t,n);break;case"RestElement":this.checkLVal(e.argument,t,n);break;case"ParenthesizedExpression":this.checkLVal(e.expression,t,n);break;default:this.raise(e.start,(t?"Binding":"Assigning to")+" rvalue")}};var J=z.prototype;J.checkPropClash=function(e,t){if(!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var n,r=e.key;switch(r.type){case"Identifier":n=r.name;break;case"Literal":n=String(r.value);break;default:return}var i=e.kind;if(this.options.ecmaVersion>=6)return void("__proto__"===n&&"init"===i&&(t.proto&&this.raiseRecoverable(r.start,"Redefinition of __proto__ property"),t.proto=!0));n="$"+n;var o=t[n];if(o){var s="init"!==i;(!this.strict&&!s||!o[i])&&s^o.init||this.raiseRecoverable(r.start,"Redefinition of property")}else o=t[n]={init:!1,get:!1,set:!1};o[i]=!0}},J.parseExpression=function(e,t){var n=this,r=this.start,i=this.startLoc,o=this.parseMaybeAssign(e,t);if(this.type===D.comma){var s=this.startNodeAt(r,i);for(s.expressions=[o];this.eat(D.comma);)s.expressions.push(n.parseMaybeAssign(e,t));return this.finishNode(s,"SequenceExpression")}return o},J.parseMaybeAssign=function(e,t,n){if(this.inGenerator&&this.isContextual("yield"))return this.parseYield();var r=!1,i=-1;t?(i=t.parenthesizedAssign,t.parenthesizedAssign=-1):(t=new H,r=!0);var o=this.start,s=this.startLoc;this.type!=D.parenL&&this.type!=D.name||(this.potentialArrowAt=this.start);var a=this.parseMaybeConditional(e,t);if(n&&(a=n.call(this,a,o,s)),this.type.isAssign){this.checkPatternErrors(t,!0),r||H.call(t);var u=this.startNodeAt(o,s);return u.operator=this.value,u.left=this.type===D.eq?this.toAssignable(a):a,t.shorthandAssign=-1,this.checkLVal(a),this.next(),u.right=this.parseMaybeAssign(e),this.finishNode(u,"AssignmentExpression")}return r&&this.checkExpressionErrors(t,!0),i>-1&&(t.parenthesizedAssign=i),a},J.parseMaybeConditional=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if(this.eat(D.question)){var o=this.startNodeAt(n,r);return o.test=i,o.consequent=this.parseMaybeAssign(),this.expect(D.colon),o.alternate=this.parseMaybeAssign(e),this.finishNode(o,"ConditionalExpression")}return i},J.parseExprOps=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeUnary(t,!1);return this.checkExpressionErrors(t)?i:this.parseExprOp(i,n,r,-1,e)},J.parseExprOp=function(e,t,n,r,i){var o=this.type.binop;if(null!=o&&(!i||this.type!==D._in)&&o>r){var s=this.type===D.logicalOR||this.type===D.logicalAND,a=this.value;this.next();var u=this.start,c=this.startLoc,l=this.parseExprOp(this.parseMaybeUnary(null,!1),u,c,o,i),p=this.buildBinary(t,n,e,l,a,s);return this.parseExprOp(p,t,n,r,i)}return e},J.buildBinary=function(e,t,n,r,i,o){var s=this.startNodeAt(e,t);return s.left=n,s.operator=i,s.right=r,this.finishNode(s,o?"LogicalExpression":"BinaryExpression")},J.parseMaybeUnary=function(e,t){var n,r=this,i=this.start,o=this.startLoc;if(this.inAsync&&this.isContextual("await"))n=this.parseAwait(e),t=!0;else if(this.type.prefix){var s=this.startNode(),a=this.type===D.incDec;s.operator=this.value,s.prefix=!0,this.next(),s.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(e,!0),a?this.checkLVal(s.argument):this.strict&&"delete"===s.operator&&"Identifier"===s.argument.type?this.raiseRecoverable(s.start,"Deleting local variable in strict mode"):t=!0,n=this.finishNode(s,a?"UpdateExpression":"UnaryExpression")}else{if(n=this.parseExprSubscripts(e),this.checkExpressionErrors(e))return n;for(;this.type.postfix&&!this.canInsertSemicolon();){var u=r.startNodeAt(i,o);u.operator=r.value,u.prefix=!1,u.argument=n,r.checkLVal(n),r.next(),n=r.finishNode(u,"UpdateExpression")}}return!t&&this.eat(D.starstar)?this.buildBinary(i,o,n,this.parseMaybeUnary(null,!1),"**",!1):n},J.parseExprSubscripts=function(e){var t=this.start,n=this.startLoc,r=this.parseExprAtom(e),i="ArrowFunctionExpression"===r.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd);if(this.checkExpressionErrors(e)||i)return r;var o=this.parseSubscripts(r,t,n);return e&&"MemberExpression"===o.type&&(e.parenthesizedAssign>=o.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=o.start&&(e.parenthesizedBind=-1)),o},J.parseSubscripts=function(e,t,n,r){for(var i,o=this,s=this.options.ecmaVersion>=8&&"Identifier"===e.type&&"async"===e.name&&this.lastTokEnd==e.end&&!this.canInsertSemicolon();;)if((i=o.eat(D.bracketL))||o.eat(D.dot)){var a=o.startNodeAt(t,n);a.object=e,a.property=i?o.parseExpression():o.parseIdent(!0),a.computed=!!i,i&&o.expect(D.bracketR),e=o.finishNode(a,"MemberExpression")}else if(!r&&o.eat(D.parenL)){var u=new H,c=o.yieldPos,l=o.awaitPos;o.yieldPos=0,o.awaitPos=0;var p=o.parseExprList(D.parenR,o.options.ecmaVersion>=8,!1,u);if(s&&!o.canInsertSemicolon()&&o.eat(D.arrow))return o.checkPatternErrors(u,!1),o.checkYieldAwaitInDefaultParams(),o.yieldPos=c,o.awaitPos=l,o.parseArrowExpression(o.startNodeAt(t,n),p,!0);o.checkExpressionErrors(u,!0),o.yieldPos=c||o.yieldPos,o.awaitPos=l||o.awaitPos;var f=o.startNodeAt(t,n);f.callee=e,f.arguments=p,e=o.finishNode(f,"CallExpression")}else{if(o.type!==D.backQuote)return e;var h=o.startNodeAt(t,n);h.tag=e,h.quasi=o.parseTemplate(),e=o.finishNode(h,"TaggedTemplateExpression")}},J.parseExprAtom=function(e){var t,n=this.potentialArrowAt==this.start;switch(this.type){case D._super:this.inFunction||this.raise(this.start,"'super' outside of function or class");case D._this:var r=this.type===D._this?"ThisExpression":"Super";return t=this.startNode(),this.next(),this.finishNode(t,r);case D.name:var i=this.start,o=this.startLoc,s=this.parseIdent(this.type!==D.name);if(this.options.ecmaVersion>=8&&"async"===s.name&&!this.canInsertSemicolon()&&this.eat(D._function))return this.parseFunction(this.startNodeAt(i,o),!1,!1,!0);if(n&&!this.canInsertSemicolon()){if(this.eat(D.arrow))return this.parseArrowExpression(this.startNodeAt(i,o),[s],!1);if(this.options.ecmaVersion>=8&&"async"===s.name&&this.type===D.name)return s=this.parseIdent(),!this.canInsertSemicolon()&&this.eat(D.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(i,o),[s],!0)}return s;case D.regexp:var a=this.value;return t=this.parseLiteral(a.value),t.regex={pattern:a.pattern,flags:a.flags},t;case D.num:case D.string:return this.parseLiteral(this.value);case D._null:case D._true:case D._false:return t=this.startNode(),t.value=this.type===D._null?null:this.type===D._true,t.raw=this.type.keyword,this.next(),this.finishNode(t,"Literal");case D.parenL:var u=this.start,c=this.parseParenAndDistinguishExpression(n);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(c)&&(e.parenthesizedAssign=u),e.parenthesizedBind<0&&(e.parenthesizedBind=u)),c;case D.bracketL:return t=this.startNode(),this.next(),t.elements=this.parseExprList(D.bracketR,!0,!0,e),this.finishNode(t,"ArrayExpression");case D.braceL:return this.parseObj(!1,e);case D._function:return t=this.startNode(),this.next(),this.parseFunction(t,!1);case D._class:return this.parseClass(this.startNode(),!1);case D._new:return this.parseNew();case D.backQuote:return this.parseTemplate();default:this.unexpected()}},J.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),this.next(),this.finishNode(t,"Literal")},J.parseParenExpression=function(){this.expect(D.parenL);var e=this.parseExpression();return this.expect(D.parenR),e},J.parseParenAndDistinguishExpression=function(e){var t,n=this,r=this.start,i=this.startLoc,o=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var s,a,u=this.start,c=this.startLoc,l=[],p=!0,f=!1,h=new H,d=this.yieldPos,m=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==D.parenR;){if(p?p=!1:n.expect(D.comma),o&&n.afterTrailingComma(D.parenR,!0)){f=!0;break}if(n.type===D.ellipsis){s=n.start,l.push(n.parseParenItem(n.parseRest())),n.type===D.comma&&n.raise(n.start,"Comma is not permitted after the rest element");break}n.type!==D.parenL||a||(a=n.start),l.push(n.parseMaybeAssign(!1,h,n.parseParenItem))}var g=this.start,v=this.startLoc;if(this.expect(D.parenR),e&&!this.canInsertSemicolon()&&this.eat(D.arrow))return this.checkPatternErrors(h,!1),this.checkYieldAwaitInDefaultParams(),a&&this.unexpected(a),this.yieldPos=d,this.awaitPos=m,this.parseParenArrowList(r,i,l);l.length&&!f||this.unexpected(this.lastTokStart),s&&this.unexpected(s),this.checkExpressionErrors(h,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=m||this.awaitPos,l.length>1?(t=this.startNodeAt(u,c),t.expressions=l,this.finishNodeAt(t,"SequenceExpression",g,v)):t=l[0]}else t=this.parseParenExpression();if(this.options.preserveParens){var y=this.startNodeAt(r,i);return y.expression=t,this.finishNode(y,"ParenthesizedExpression")}return t},J.parseParenItem=function(e){return e},J.parseParenArrowList=function(e,t,n){return this.parseArrowExpression(this.startNodeAt(e,t),n)};var Q=[];J.parseNew=function(){var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(D.dot))return e.meta=t,e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is new.target"),this.inFunction||this.raiseRecoverable(e.start,"new.target can only be used in functions"),this.finishNode(e,"MetaProperty");var n=this.start,r=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(),n,r,!0),this.eat(D.parenL)?e.arguments=this.parseExprList(D.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Q,this.finishNode(e,"NewExpression")},J.parseTemplateElement=function(){var e=this.startNode();return e.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),e.tail=this.type===D.backQuote,this.finishNode(e,"TemplateElement")},J.parseTemplate=function(){var e=this,t=this.startNode();this.next(),t.expressions=[];var n=this.parseTemplateElement();for(t.quasis=[n];!n.tail;)e.expect(D.dollarBraceL),t.expressions.push(e.parseExpression()),e.expect(D.braceR),t.quasis.push(n=e.parseTemplateElement());return this.next(),this.finishNode(t,"TemplateLiteral")},J.parseObj=function(e,t){var n=this,r=this.startNode(),i=!0,o={};for(r.properties=[],this.next();!this.eat(D.braceR);){if(i)i=!1;else if(n.expect(D.comma),n.afterTrailingComma(D.braceR))break;var s,a,u,c,l=n.startNode();n.options.ecmaVersion>=6&&(l.method=!1,l.shorthand=!1,(e||t)&&(u=n.start,c=n.startLoc),e||(s=n.eat(D.star))),n.parsePropertyName(l),e||!(n.options.ecmaVersion>=8)||s||l.computed||"Identifier"!==l.key.type||"async"!==l.key.name||n.type===D.parenL||n.type===D.colon||n.canInsertSemicolon()?a=!1:(a=!0,n.parsePropertyName(l,t)),n.parsePropertyValue(l,e,s,a,u,c,t),n.checkPropClash(l,o),r.properties.push(n.finishNode(l,"Property"))}return this.finishNode(r,e?"ObjectPattern":"ObjectExpression")},J.parsePropertyValue=function(e,t,n,r,i,o,s){if((n||r)&&this.type===D.colon&&this.unexpected(),this.eat(D.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,s),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===D.parenL)t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(n,r);else if(this.options.ecmaVersion>=5&&!e.computed&&"Identifier"===e.key.type&&("get"===e.key.name||"set"===e.key.name)&&this.type!=D.comma&&this.type!=D.braceR){(n||r||t)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var a="get"===e.kind?0:1;if(e.value.params.length!==a){var u=e.value.start;"get"===e.kind?this.raiseRecoverable(u,"getter should have no params"):this.raiseRecoverable(u,"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")}else this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((this.keywords.test(e.key.name)||(this.strict?this.reservedWordsStrict:this.reservedWords).test(e.key.name)||this.inGenerator&&"yield"==e.key.name||this.inAsync&&"await"==e.key.name)&&this.raiseRecoverable(e.key.start,"'"+e.key.name+"' can not be used as shorthand property"),e.kind="init",t?e.value=this.parseMaybeDefault(i,o,e.key):this.type===D.eq&&s?(s.shorthandAssign<0&&(s.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,o,e.key)):e.value=e.key,e.shorthand=!0):this.unexpected()},J.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(D.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(D.bracketR),e.key;e.computed=!1}return e.key=this.type===D.num||this.type===D.string?this.parseExprAtom():this.parseIdent(!0)},J.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=!1,e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},J.parseMethod=function(e,t){var n=this.startNode(),r=this.inGenerator,i=this.inAsync,o=this.yieldPos,s=this.awaitPos,a=this.inFunction;return this.initFunction(n),this.options.ecmaVersion>=6&&(n.generator=e),this.options.ecmaVersion>=8&&(n.async=!!t),this.inGenerator=n.generator,this.inAsync=n.async,this.yieldPos=0,this.awaitPos=0,this.inFunction=!0,this.expect(D.parenL),n.params=this.parseBindingList(D.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(n,!1),this.inGenerator=r,this.inAsync=i,this.yieldPos=o,this.awaitPos=s,this.inFunction=a,this.finishNode(n,"FunctionExpression")},J.parseArrowExpression=function(e,t,n){var r=this.inGenerator,i=this.inAsync,o=this.yieldPos,s=this.awaitPos,a=this.inFunction;return this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.inGenerator=!1,this.inAsync=e.async,this.yieldPos=0,this.awaitPos=0,this.inFunction=!0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0),this.inGenerator=r,this.inAsync=i,this.yieldPos=o,this.awaitPos=s,this.inFunction=a,this.finishNode(e,"ArrowFunctionExpression")},J.parseFunctionBody=function(e,t){var n=t&&this.type!==D.braceL,r=this.strict,i=!1;if(n)e.body=this.parseMaybeAssign(),e.expression=!0;else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);r&&!o||(i=this.strictDirective(this.end))&&o&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list");var s=this.labels;this.labels=[],i&&(this.strict=!0),e.body=this.parseBlock(!0),e.expression=!1,this.labels=s}r||i?(this.strict=!0,e.id&&this.checkLVal(e.id,!0),this.checkParams(e),this.strict=r):!t&&this.isSimpleParamList(e.params)||this.checkParams(e)},J.isSimpleParamList=function(e){for(var t=0;t<e.length;t++)i