From 0df54cca084cda786629f754bc8224ae4bb43739 Mon Sep 17 00:00:00 2001 From: Dinuka Date: Mon, 10 Aug 2015 21:52:42 +0530 Subject: [PATCH 1/5] js2coffee.js library was added --- content/lib/js2coffee.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 content/lib/js2coffee.js diff --git a/content/lib/js2coffee.js b/content/lib/js2coffee.js new file mode 100644 index 00000000..ea916827 --- /dev/null +++ b/content/lib/js2coffee.js @@ -0,0 +1,7 @@ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.js2coffee=e()}}(function(){var e,t,n;return function r(e,t,n){function i(s,a){if(!t[s]){if(!e[s]){var u=typeof require=="function"&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var f=t[s]={exports:{}};e[s][0].call(f.exports,function(t){var n=e[s][1][t];return i(n?n:t)},f,f.exports,r,e,t,n)}return t[s].exports}var o=typeof require=="function"&&require;for(var s=0;s0;if(e._isStatement&&r){return p([n,i])}else{return[n,this.paren(i,true)]}};t.prototype.IfStatement=function(e){var t,n;t=e.alternate;if((t!=null?t.type:void 0)==="IfStatement"){n=this.indent(["else ",this.walk(e.alternate,"IfStatement")])}else if((t!=null?t.type:void 0)==="BlockStatement"){n=this.indent(function(t){return function(n){return[n,"else","\n",t.walk(e.alternate)]}}(this))}else if(t!=null){n=this.indent(function(t){return function(n){return[n,"else","\n",t.indent(t.walk(e.alternate))]}}(this))}else{n=[]}return this.indent(function(t){return function(r){var i,o,s;o=t.walk(e.test);i=t.walk(e.consequent);if(e.consequent.type!=="BlockStatement"){i=t.indent(i)}s=e._negative?"unless":"if";return[s," ",o,"\n",i,n]}}(this))};t.prototype.BlockStatement=function(e){return this.makeStatements(e,e.body)};t.prototype.makeStatements=function(e,t){return f(t.map(this.walk),this.indent())};t.prototype.LineComment=function(e){return["#",e.value,"\n"]};t.prototype.BlockComment=function(e){var t,n;t=("###"+e.value+"###").split("\n");n=[a(t,["\n",this.indent()]),"\n"];return["\n",this.indent(),n,"\n"]};t.prototype.ReturnStatement=function(e){if(e.argument){return p(["return",[this.walk(e.argument),"\n"]])}else{return["return","\n"]}};t.prototype.ArrayExpression=function(e){var t,n;n=e.elements.length;t=n===1;if(n===0){return["[]"]}else if(t){return p(["[",e.elements.map(this.walk),"]"])}else{return this.indent(function(t){return function(n){var r,i;i=e.elements.map(function(e){return l(t.walk(e))});r=f(i,t.indent());return["[","\n",r,n,"]"]}}(this))}};t.prototype.ObjectExpression=function(e,t){var n,r;r=e.properties.length;n=e._braced;if(r===0){return["{}"]}else if(r===1){r=e.properties.map(this.walk);if(n){return this.paren(p(["{",r,"}"]))}else{return this.paren([r])}}else if(e._last){r=e.properties.map(this.walk);return a(r,["\n",this.indent()])}else{r=this.indent(function(t){return function(){r=e.properties.map(t.walk);return["\n",u(r,t.indent())]}}(this));if(n){return this.paren(["{",r,"\n",this.indent(),"}"])}else{return this.paren([r])}}};t.prototype.Property=function(e){if(e.kind!=="init"){throw new Error("Property: not sure about kind "+e.kind)}return p([[this.walk(e.key),":"],this.walk(e.value)])};t.prototype.VariableDeclaration=function(e){var t;t=e.declarations.map(this.walk);return a(t,this.indent())};t.prototype.VariableDeclarator=function(e){var t;t=[this.walk(e.id)," = ",l(this.walk(e.init))];if(e.init.type==="FunctionExpression"){t=["\n",this.indent(),t,"\n"]}return t};t.prototype.FunctionExpression=function(e,t){var n,r;r=this.makeParams(e.params,e.defaults);n=this.indent(function(t){return function(n){return[r,"->","\n",t.walk(e.body)]}}(this));if(e._parenthesized){return["(",n,this.indent(),")"]}else{return n}};t.prototype.EmptyStatement=function(e){return[]};t.prototype.SequenceExpression=function(e){var t;t=e.expressions.map(function(e){return function(t){return[e.walk(t),"\n"]}}(this));return a(t,this.indent())};t.prototype.NewExpression=function(e){var t,n,r,i;n=((r=e.callee)!=null?r.type:void 0)==="Identifier"?[this.walk(e.callee)]:["(",this.walk(e.callee),")"];t=((i=e["arguments"])!=null?i.length:void 0)?["(",this.makeSequence(e["arguments"]),")"]:[];return this.paren(["new ",n,t])};t.prototype.WhileStatement=function(e){return["while ",this.walk(e.test),"\n",this.makeLoopBody(e.body)]};t.prototype.CoffeeLoopStatement=function(e){return["loop","\n",this.makeLoopBody(e.body)]};t.prototype.BreakStatement=function(e){return["break","\n"]};t.prototype.ContinueStatement=function(e){return["continue","\n"]};t.prototype.DebuggerStatement=function(e){return["debugger","\n"]};t.prototype.TryStatement=function(e){var t,n,r;r=this.indent(function(t){return function(){return["try","\n",t.walk(e.block)]}}(this));t=f(e.handlers.map(this.walk),this.indent());n=e.finalizer!=null?this.indent(function(t){return function(n){return[n,"finally","\n",t.walk(e.finalizer)]}}(this)):[];return[r,t,n]};t.prototype.CatchClause=function(e){return this.indent(function(t){return function(){return["catch ",t.walk(e.param),"\n",t.walk(e.body)]}}(this))};t.prototype.ThrowStatement=function(e){return["throw ",this.walk(e.argument),"\n"]};t.prototype.ConditionalExpression=function(e){return this.paren(p(["if",this.walk(e.test),"then",this.walk(e.consequent),"else",this.walk(e.alternate)]))};t.prototype.UpdateExpression=function(e){if(e.prefix){return[e.operator,this.walk(e.argument)]}else{return[this.walk(e.argument),e.operator]}};t.prototype.SwitchStatement=function(e){var t,n;t=this.indent(function(t){return function(){return t.makeStatements(e,e.cases)}}(this));n=this.walk(e.discriminant);if(e.discriminant.type==="ConditionalExpression"){n=["(",n,")"]}return["switch ",n,"\n",t]};t.prototype.CoffeeListExpression=function(e){return this.makeSequence(e.expressions)};t.prototype.SwitchCase=function(e){var t,n;t=e.test?["when ",this.walk(e.test)]:["else"];n=this.indent(function(t){return function(){return t.makeStatements(e,e.consequent)}}(this));return[t,"\n",n]};t.prototype.ForInStatement=function(e){var t,n,r;if(e.left.type!=="VariableDeclaration"){n=this.walk(e.left);r={type:"ExpressionStatement",expression:{type:"CoffeeEscapedExpression",raw:n+" = "+n}};e.body.body=[r].concat(e.body.body)}else{n=this.walk(e.left.declarations[0].id)}t=this.makeLoopBody(e.body);return["for ",n," of ",this.walk(e.right),"\n",t]};t.prototype.makeLoopBody=function(e){var t;t=(e!=null?e.type:void 0)==="BlockStatement";if(!e||t&&e.body.length===0){return this.indent(function(e){return function(){return[e.indent(),"continue","\n"]}}(this))}else if(t){return this.indent(function(t){return function(){return t.walk(e)}}(this))}else{return this.indent(function(t){return function(){return[t.indent(),t.walk(e)]}}(this))}};t.prototype.CoffeeEscapedExpression=function(e){if(e._parenthesized){return["(`",e.raw,"`)"]}else{return["`",e.raw,"`"]}};t.prototype.CoffeePrototypeExpression=function(e){if(e.computed){return[this.walk(e.object),"::[",this.walk(e.property),"]"]}else{return[this.walk(e.object),"::",this.walk(e.property)]}};t.prototype.CoffeeDoExpression=function(e){return p(["do",this.walk(e["function"])])};t.prototype.makeSequence=function(e){var t,n,r,i,o;for(n=i=0,o=e.length;i=3){return""}else{return e}})};i=function(e,t,n){var r,i,o;if(t==null){t={}}r=false;i={"break":function(e){return r=true}};o=function(e,t,n){var s,a,u,l,f,c,p,h,m,d,g,y;if(t==null){t={}}l=t.reverse?function(){g=[];for(var t=m=e.children.length-1;m<=0?t<=0:t>=0;m<=0?t++:t--){g.push(t)}return g}.apply(this):function(){y=[];for(var t=0,n=e.children.length;0<=n?tn;0<=n?t++:t--){y.push(t)}return y}.apply(this);for(p=0,h=l.length;p0){i.push(t)}i.push(r)}return i};n.commaDelimit=function(e){var t,n,r,i,o;r=[];for(t=i=0,o=e.length;i0){if(/^\n/.test(n.toString())){r.push(",")}else{r.push(", ")}}r.push(n)}return r};n.prependAll=function(e,t){var n,r,i,o,s;i=[];for(n=o=0,s=e.length;o-1};t={"**":17,"*":14,"/":14,"%":14,"+":13,"-":13,"<<":12,">>":12,">>>":12,"<":11,">":11,"<=":11,">=":11,"in":11,"instanceof":11,"==":10,"===":10,"!=":10,"!==":10,"&":9,"^":8,"|":7};r={"&&":6,"||":5};switch(i){case"Literal":case"Identifier":return 99;case"MemberExpression":case"CallExpression":return 18;case"NewExpression":if(e["arguments"].length===0){return 17}else{return 18}break;case"UpdateExpression":if(e.prefix){return 15}else{return 16}break;case"UnaryExpression":return 15;case"BinaryExpression":return t[e.operator];case"LogicalExpression":return r[e.operator];case"ConditionalExpression":return 4;case"AssignmentExpression":return 3;case"SequenceExpression":return 0;default:return-1}};n.lastStatement=function(e){var t,r,i,o;for(t=i=o=e.length-1;o<=0?i<=0:i>=0;t=o<=0?++i:--i){r=e[t];if(!r){continue}if(!n.isComment(r)){return r}}};n.getReturnStatements=function(e){var t,r,i,o,s;i=n.getReturnStatements,o=n.lastStatement;if(!e){return}else if(e.length){s=o(e)}else{s=e}if(!s){return[]}else if(s.type==="ReturnStatement"){return[s]}else if(s.type==="BlockStatement"){return i(s.body)}else if(s.type==="IfStatement"&&s.consequent&&s.alternate){r=i(s.consequent);t=i(s.alternate);if(r.length>0&&t.length>0){return r.concat(t)}else{return[]}}else{return[]}};n.joinLines=function(e,t){var n,r,i,o,s,a;o=[];for(n=s=0,a=e.length;s=u;r=a<=u?++s:--s){o=e[r];if((o!=null?o.type:void 0)&&n(o)){return o}}};n.nextNonComment=function(e,t){return n.nextUntil(e,t,function(e){return e.type!=="BlockComment"&&e.type!=="LineComment"})};n.isLoop=function(e){return e.test==null||n.isTruthy(e.test)};n.isTruthy=function(e){return e.type==="Literal"&&e.value};n.escapeJs=function(t){return n.replace(t,{type:"CoffeeEscapedExpression",raw:e("escodegen").generate(t)})};n.nonComments=function(e){return e.filter(function(e){return!n.isComment(e)})};n.isComment=function(e){return e.type==="LineComment"||e.type==="BlockComment"};n.toIndent=function(e){if(e==="tab"||e==="t"){return" "}else if(typeof e==="string"&&""+ +e!==e){return e}else{return Array(+e+1).join(" ")}}},{escodegen:29,util:28}],6:[function(e,t,n){var r,i,o,s,a,u,l,f,c=function(e,t){for(var n in t){if(p.call(t,n))e[n]=t[n]}function r(){this.constructor=e}r.prototype=t.prototype;e.prototype=new r;e.__super__=t.prototype;return e},p={}.hasOwnProperty,h=[].slice;f=e("../helpers"),i=f.buildError,s=f.clone,a=f.replace,l=f.toIndent;t.exports=r=function(){t.run=function(e,n,r,i){var o,s,a;o=function(e){c(t,e);function t(){return t.__super__.constructor.apply(this,arguments)}return t}(t);u(o,r);a=new o(e,n);s=a.run();if(i.warnings==null){i.warnings=[]}i.warnings=i.warnings.concat(a.warnings);return s};function t(e,t){this.ast=e;this.options=t;this.scopes=[];this.ctx={vars:[]};this.warnings=[]}t.prototype.run=function(){return this.recurse(this.ast)};t.prototype.recurse=function(e){var t,n;n=this;this.depth=0;t=function(e){return function(t,n,r){var i,o,s,a;e.node=n;e.depth+=t==="Enter"?+1:-1;i=t==="Enter"?""+n.type:n.type+"Exit";if(typeof e[s="onBefore"+t]==="function"){e[s](n,r)}o=typeof e[i]==="function"?e[i](n,r):void 0;if(typeof e[a="on"+t]==="function"){e[a](n,r)}return o}}(this);this.estraverse().replace(e,{enter:function(e,r){n.controller=this;return t("Enter",e,r)},leave:function(e,n){return t("Exit",e,n)}});return e};t.prototype.skip=function(){var e;return(e=this.controller)!=null?e.skip():void 0};t.prototype.remove=function(){var e;return(e=this.controller)!=null?e.remove():void 0};t.prototype.estraverse=function(){return this._estraverse!=null?this._estraverse:this._estraverse=function(){var t;t=e("estraverse");t.VisitorKeys.CoffeeEscapedExpression=[];t.VisitorKeys.CoffeeListExpression=["test","body"];t.VisitorKeys.CoffeePrototypeExpression=["object","property","computed"];t.VisitorKeys.CoffeeLoopStatement=["body"];t.VisitorKeys.CoffeeDoExpression=["function"];t.VisitorKeys.BlockComment=[];t.VisitorKeys.LineComment=[];return t}()};t.prototype.pushStack=function(e){var t,n,r;r=[this.scope,this.ctx],n=r[0],t=r[1];this.scopes.push([e,this.ctx]);this.ctx=s(this.ctx);this.scope=e;return typeof this.onScopeEnter==="function"?this.onScopeEnter(this.scope,this.ctx,n,t):void 0};t.prototype.popStack=function(){var e,t,n,r;n=[this.scope,this.ctx],t=n[0],e=n[1];r=this.scopes.pop(),this.scope=r[0],this.ctx=r[1];return typeof this.onScopeExit==="function"?this.onScopeExit(this.scope,this.ctx,t,e):void 0};t.prototype.syntaxError=function(e,t){var n,r,o;n=i({start:(r=e.loc)!=null?r.start:void 0,end:(o=e.loc)!=null?o.end:void 0,description:t},this.options.source,this.options.filename);throw n};t.prototype.warn=function(e,t){var n,r;return this.warnings.push({start:(n=e.loc)!=null?n.start:void 0,end:(r=e.loc)!=null?r.end:void 0,filename:this.options.filename,description:t})};t.prototype.Program=function(e){this.pushStack(e);return e};t.prototype.ProgramExit=function(e){this.popStack();return e};t.prototype.FunctionExpression=function(e){this.pushStack(e.body);return e};t.prototype.FunctionExpressionExit=function(e){this.popStack();return e};t.prototype.escapeJs=function(t,n){if(n==null){n={}}return a(t,{type:"CoffeeEscapedExpression",_parenthesized:n.parenthesized,raw:e("escodegen").generate(t,{format:{indent:{style:l(this.options.indent)}}})})};return t}();u=function(e,t){var n;n={};t.forEach(function(t){var r,i,s,a;s=t.prototype;a=[];for(i in s){r=s[i];if(t.prototype.hasOwnProperty(i)){if(n[i]&&i!=="constructor"){e.prototype[i]=o(e.prototype[i],r)}else{e.prototype[i]=r}a.push(n[i]=true)}else{a.push(void 0)}}return a});return e};o=function(e,t){return function(){var n,r,i,o;r=arguments[0],n=2<=arguments.length?h.call(arguments,1):[];o=r.type;i=e.bind(this).apply(null,[r].concat(h.call(n)));if(i.type===o){i=t.bind(this).apply(null,[i].concat(h.call(n)))}return i}}},{"../helpers":5,escodegen:29,estraverse:47}],7:[function(e,t,n){var r,i=function(e,t){for(var n in t){if(o.call(t,n))e[n]=t[n]}function r(){this.constructor=e}r.prototype=t.prototype;e.prototype=new r;e.__super__=t.prototype;return e},o={}.hasOwnProperty;r=e("./base");t.exports=function(e){i(t,e);function t(){return t.__super__.constructor.apply(this,arguments)}t.prototype.BinaryExpression=function(e){this.warnAboutEquals(e);this.updateEquals(e);return this.escapeEqualsForCompatibility(e)};t.prototype.updateEquals=function(e){var t,n;t={"===":"==","!==":"!="};n=e.operator;if(t[n]){e.operator=t[n]}return e};t.prototype.escapeEqualsForCompatibility=function(e){var t;t=e.operator==="=="||e.operator==="!=";if(this.options.compat&&t){return this.escapeJs(e)}else{return e}};t.prototype.warnAboutEquals=function(e){var t,n,r;t=e.operator;r={"==":"===","!=":"!=="};if(t==="=="||t==="!="){n=r[t];this.warn(e,"Operator '"+t+"' is not supported in CoffeeScript, "+("use '"+n+"' instead"))}return e};return t}(r)},{"./base":6}],8:[function(e,t,n){var r,i,o=function(e,t){for(var n in t){if(s.call(t,n))e[n]=t[n]}function r(){this.constructor=e}r.prototype=t.prototype;e.prototype=new r;e.__super__=t.prototype;return e},s={}.hasOwnProperty,a=[].slice;i=e("./base");t.exports=r=function(e){o(t,e);function t(){return t.__super__.constructor.apply(this,arguments)}t.prototype.BlockStatement=function(e,t){return this.consolidateBlockIntoParent(e,t)};t.prototype.consolidateBlockIntoParent=function(e,t){var n,r;r=false;n=function(n){return function(n,i){var o,s,u;if(t.type===n&&((s=t[i])!=null?s.indexOf:void 0)){o=t[i].indexOf(e);if(t[i]&&~o){(u=t[i]).splice.apply(u,[o,1].concat(a.call(e.body)));r=true;return true}}}}(this);n("BlockStatement","body")||n("SwitchCase","consequent")||n("IfStatement","consequent")||n("IfStatement","alternate");if(r){return this.skip()}else{return e}};return t}(i)},{"./base":6}],9:[function(e,t,n){var r,i=function(e,t){for(var n in t){if(o.call(t,n))e[n]=t[n]}function r(){this.constructor=e}r.prototype=t.prototype;e.prototype=new r;e.__super__=t.prototype;return e},o={}.hasOwnProperty;r=e("./base");t.exports=function(e){i(t,e);function t(){return t.__super__.constructor.apply(this,arguments)}t.prototype.ProgramExit=null;t.prototype.FunctionExpression=null;t.prototype.FunctionExpressionExit=null;t.prototype.Program=function(e){this.comments=e.comments;this.updateCommentTypes();e.body=this.addCommentsToList([0,Infinity],e.body);return e};t.prototype.BlockStatement=function(e){return this.injectComments(e,"body")};t.prototype.SwitchStatement=function(e){return this.injectComments(e,"cases")};t.prototype.SwitchCase=function(e){return this.injectComments(e,"consequent")};t.prototype.BlockComment=function(e){return this.convertCommentPrefixes(e)};t.prototype.updateCommentTypes=function(){var e,t,n,r,i;r=this.comments;i=[];for(t=0,n=r.length;t=t&&e.range[1]<=n})}}(this);if(t.length>0){for(r=l=0,f=t.length;l-1){return}if(a==="NewExpression"&&t["arguments"].indexOf(e)>-1){return}if(a==="MemberExpression"&&t.property===e){return}r=i(e);if(r===-1){return}n=s(t,e)||o(t,e)||u(t,e)||r0){n=i(e[t]);if(n.length===0){e[t].push({type:"ReturnStatement"})}else{n.forEach(function(e){if(e.argument){e.type="ExpressionStatement";return e.expression=e.argument}})}}};return t}(r)},{"../helpers":5,"./base":6}],22:[function(e,t,n){var r,i=function(e,t){for(var n in t){if(o.call(t,n))e[n]=t[n]}function r(){this.constructor=e}r.prototype=t.prototype;e.prototype=new r;e.__super__=t.prototype;return e},o={}.hasOwnProperty;r=e("./base.coffee");t.exports=function(e){i(t,e);function t(){return t.__super__.constructor.apply(this,arguments)}t.prototype.SwitchStatement=function(e){this.consolidateCases(e);return this.ensureLastCaseIsDefault(e)};t.prototype.SwitchCase=function(e){return this.removeBreaksFromConsequents(e)};t.prototype.ensureLastCaseIsDefault=function(e){var t,n,r,i,o,s,a,u;t=e.cases.filter(function(e){return e.type==="SwitchCase"});s=t.length;for(n=a=0,u=t.length;a0){if(n.test){n.test={type:"CoffeeListExpression",expressions:i}}i=[];r.push(n)}}else{r.push(n)}}e.cases=r;return e};t.prototype.removeBreaksFromConsequents=function(e){var t,n;if(e.test){t=e.consequent.length-1;n=e.consequent[t];if((n!=null?n.type:void 0)==="BreakStatement"){delete e.consequent[t];e.consequent.length-=1}else if((n!=null?n.type:void 0)==="ContinueStatement"){}else if((n!=null?n.type:void 0)!=="ReturnStatement"){this.syntaxError(e,"No break or return statement found in a case")}return e}};return t}(r)},{"./base.coffee":6}],23:[function(e,t,n){var r,i=function(e,t){for(var n in t){if(o.call(t,n))e[n]=t[n]}function r(){this.constructor=e}r.prototype=t.prototype;e.prototype=new r;e.__super__=t.prototype;return e},o={}.hasOwnProperty;r=e("./base");t.exports=function(e){i(t,e);function t(){return t.__super__.constructor.apply(this,arguments)}t.prototype.LabeledStatement=function(e,t){return this.syntaxError(e,"Labeled statements are not supported in CoffeeScirpt")};t.prototype.WithStatement=function(e){return this.syntaxError(e,"'with' is not supported in CoffeeScript")};return t}(r)},{"./base":6}],24:[function(e,t,n){if(typeof Object.create==="function"){t.exports=function r(e,t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}else{t.exports=function i(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype;e.prototype=new n;e.prototype.constructor=e}}},{}],25:[function(e,t,n){(function(e){function t(e,t){var n=0;for(var r=e.length-1;r>=0;r--){var i=e[r];if(i==="."){e.splice(r,1)}else if(i===".."){e.splice(r,1);n++}else if(n){e.splice(r,1);n--}}if(t){for(;n--;n){e.unshift("..")}}return e}var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var i=function(e){return r.exec(e).slice(1)};n.resolve=function(){var n="",r=false;for(var i=arguments.length-1;i>=-1&&!r;i--){var s=i>=0?arguments[i]:e.cwd();if(typeof s!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!s){continue}n=s+"/"+n;r=s.charAt(0)==="/"}n=t(o(n.split("/"),function(e){return!!e}),!r).join("/");return(r?"/":"")+n||"."};n.normalize=function(e){var r=n.isAbsolute(e),i=s(e,-1)==="/";e=t(o(e.split("/"),function(e){return!!e}),!r).join("/");if(!e&&!r){e="."}if(e&&i){e+="/"}return(r?"/":"")+e};n.isAbsolute=function(e){return e.charAt(0)==="/"};n.join=function(){var e=Array.prototype.slice.call(arguments,0);return n.normalize(o(e,function(e,t){if(typeof e!=="string"){throw new TypeError("Arguments to path.join must be strings")}return e}).join("/"))};n.relative=function(e,t){e=n.resolve(e).substr(1);t=n.resolve(t).substr(1);function r(e){var t=0;for(;t=0;n--){if(e[n]!=="")break}if(t>n)return[];return e.slice(t,n-t+1)}var i=r(e.split("/"));var o=r(t.split("/"));var s=Math.min(i.length,o.length);var a=s;for(var u=0;u0){var r=n.shift();r()}}},true);return function r(e){n.push(e);window.postMessage("process-tick","*")}}return function i(e){setTimeout(e,0)}}();r.title="browser";r.browser=true;r.env={};r.argv=[];function i(){}r.on=i;r.addListener=i;r.once=i;r.off=i;r.removeListener=i;r.removeAllListeners=i;r.emit=i;r.binding=function(e){throw new Error("process.binding is not supported")};r.cwd=function(){return"/"};r.chdir=function(e){throw new Error("process.chdir is not supported")}},{}],27:[function(e,t,n){t.exports=function r(e){return e&&typeof e==="object"&&typeof e.copy==="function"&&typeof e.fill==="function"&&typeof e.readUInt8==="function"}},{}],28:[function(e,t,n){(function(t,r){var i=/%[sdj%]/g;n.format=function(e){if(!x(e)){var t=[];for(var n=0;n=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return e}});for(var u=r[n];n=3)r.depth=arguments[2];if(arguments.length>=4)r.colors=arguments[3];if(v(t)){r.showHidden=t}else if(t){n._extend(r,t)}if(_(r.showHidden))r.showHidden=false;if(_(r.depth))r.depth=2;if(_(r.colors))r.colors=false;if(_(r.customInspect))r.customInspect=true;if(r.colors)r.stylize=u;return c(r,e,r.depth)}n.inspect=a;a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};a.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"};function u(e,t){var n=a.styles[t];if(n){return"["+a.colors[n][0]+"m"+e+"["+a.colors[n][1]+"m"}else{return e}}function l(e,t){return e}function f(e){var t={};e.forEach(function(e,n){t[e]=true});return t}function c(e,t,r){if(e.customInspect&&t&&L(t.inspect)&&t.inspect!==n.inspect&&!(t.constructor&&t.constructor.prototype===t)){var i=t.inspect(r,e);if(!x(i)){i=c(e,i,r)}return i}var o=p(e,t);if(o){return o}var s=Object.keys(t);var a=f(s);if(e.showHidden){s=Object.getOwnPropertyNames(t)}if(I(t)&&(s.indexOf("message")>=0||s.indexOf("description")>=0)){return h(t)}if(s.length===0){if(L(t)){var u=t.name?": "+t.name:"";return e.stylize("[Function"+u+"]","special")}if(C(t)){return e.stylize(RegExp.prototype.toString.call(t),"regexp")}if(A(t)){return e.stylize(Date.prototype.toString.call(t),"date")}if(I(t)){return h(t)}}var l="",v=false,S=["{","}"];if(y(t)){v=true;S=["[","]"]}if(L(t)){var b=t.name?": "+t.name:"";l=" [Function"+b+"]"}if(C(t)){l=" "+RegExp.prototype.toString.call(t)}if(A(t)){l=" "+Date.prototype.toUTCString.call(t)}if(I(t)){l=" "+h(t)}if(s.length===0&&(!v||t.length==0)){return S[0]+l+S[1]}if(r<0){if(C(t)){return e.stylize(RegExp.prototype.toString.call(t),"regexp")}else{return e.stylize("[Object]","special")}}e.seen.push(t);var w;if(v){w=m(e,t,r,a,s)}else{w=s.map(function(n){return d(e,t,r,a,n,v)})}e.seen.pop();return g(w,l,S)}function p(e,t){if(_(t))return e.stylize("undefined","undefined");if(x(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(w(t))return e.stylize(""+t,"number");if(v(t))return e.stylize(""+t,"boolean");if(S(t))return e.stylize("null","null")}function h(e){return"["+Error.prototype.toString.call(e)+"]"}function m(e,t,n,r,i){var o=[];for(var s=0,a=t.length;s-1){if(o){a=a.split("\n").map(function(e){return" "+e}).join("\n").substr(2)}else{a="\n"+a.split("\n").map(function(e){return" "+e}).join("\n")}}}else{a=e.stylize("[Circular]","special")}}if(_(s)){if(o&&i.match(/^\d+$/)){return a}s=JSON.stringify(""+i);if(s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){s=s.substr(1,s.length-2);s=e.stylize(s,"name")}else{s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");s=e.stylize(s,"string")}}return s+": "+a}function g(e,t,n){var r=0;var i=e.reduce(function(e,t){r++;if(t.indexOf("\n")>=0)r++;return e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(i>60){return n[0]+(t===""?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]}return n[0]+t+" "+e.join(", ")+" "+n[1]}function y(e){return Array.isArray(e)}n.isArray=y;function v(e){return typeof e==="boolean"}n.isBoolean=v;function S(e){return e===null}n.isNull=S;function b(e){return e==null}n.isNullOrUndefined=b;function w(e){return typeof e==="number"}n.isNumber=w;function x(e){return typeof e==="string"}n.isString=x;function E(e){return typeof e==="symbol"}n.isSymbol=E;function _(e){return e===void 0}n.isUndefined=_;function C(e){return k(e)&&O(e)==="[object RegExp]"}n.isRegExp=C;function k(e){return typeof e==="object"&&e!==null}n.isObject=k;function A(e){return k(e)&&O(e)==="[object Date]"}n.isDate=A;function I(e){return k(e)&&(O(e)==="[object Error]"||e instanceof Error)}n.isError=I;function L(e){return typeof e==="function"}n.isFunction=L;function P(e){return e===null||typeof e==="boolean"||typeof e==="number"||typeof e==="string"||typeof e==="symbol"||typeof e==="undefined"}n.isPrimitive=P;n.isBuffer=e("./support/isBuffer");function O(e){return Object.prototype.toString.call(e)}function R(e){return e<10?"0"+e.toString(10):e.toString(10)}var D=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function j(){var e=new Date;var t=[R(e.getHours()),R(e.getMinutes()),R(e.getSeconds())].join(":");return[e.getDate(),D[e.getMonth()],t].join(" ")}n.log=function(){console.log("%s - %s",j(),n.format.apply(n,arguments))};n.inherits=e("inherits");n._extend=function(e,t){if(!t||!k(t))return e;var n=Object.keys(t);var r=n.length;while(r--){e[n[r]]=t[n[r]]}return e};function B(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./support/isBuffer":27,_process:26,inherits:24}],29:[function(e,t,n){(function(t){(function(){"use strict";var r,i,o,s,a,u,l,f,c,p,h,m,d,g,y,v,S,b,w,x,E,_,C,k,A,I,L;a=e("estraverse");u=e("esutils");r=a.Syntax;function P(e){return xt.Expression.hasOwnProperty(e.type)}function O(e){return xt.Statement.hasOwnProperty(e.type)}i={Sequence:0,Yield:1,Await:1,Assignment:1,Conditional:2,ArrowFunction:2,LogicalOR:3,LogicalAND:4,BitwiseOR:5,BitwiseXOR:6,BitwiseAND:7,Equality:8,Relational:9,BitwiseSHIFT:10,Additive:11,Multiplicative:12,Unary:13,Postfix:14,Call:15,New:16,TaggedTemplate:17,Member:18,Primary:19};o={"||":i.LogicalOR,"&&":i.LogicalAND,"|":i.BitwiseOR,"^":i.BitwiseXOR,"&":i.BitwiseAND,"==":i.Equality,"!=":i.Equality,"===":i.Equality,"!==":i.Equality,is:i.Equality,isnt:i.Equality,"<":i.Relational,">":i.Relational,"<=":i.Relational,">=":i.Relational,"in":i.Relational,"instanceof":i.Relational,"<<":i.BitwiseSHIFT,">>":i.BitwiseSHIFT,">>>":i.BitwiseSHIFT,"+":i.Additive,"-":i.Additive,"*":i.Multiplicative,"%":i.Multiplicative,"/":i.Multiplicative};var R=1,D=1<<1,j=1<<2,B=1<<3,F=1<<4,M=1<<5;var T=D|j,N=R|D,q=R|D|j,U=R,z=j,W=R|j;var V=R,G=R|M,Y=0,K=R|F,$=R|B;function H(){return{indent:null,base:null,parse:null,comment:false,format:{indent:{style:" ",base:0,adjustMultilineComment:false},newline:"\n",space:" ",json:false,renumber:false,hexadecimal:false,quotes:"single",escapeless:false,compact:false,parentheses:true,semicolons:true,safeConcatenation:false,preserveBlankLines:false},moz:{comprehensionExpressionStartsWithAssignment:false,starlessGenerator:false},sourceMap:null,sourceMapRoot:null,sourceMapWithCode:false,directive:false,raw:true,verbatim:null,sourceCode:null}}function J(e,t){var n="";for(t|=0;t>0;t>>>=1,e+=e){if(t&1){n+=e}}return n}l=Array.isArray;if(!l){l=function Lt(e){return Object.prototype.toString.call(e)==="[object Array]"}}function X(e){return/[\r\n]/g.test(e)}function Q(e){var t=e.length;return t&&u.code.isLineTerminator(e.charCodeAt(t-1))}function Z(e,t){var n;for(n in t){if(t.hasOwnProperty(n)){e[n]=t[n]}}return e}function et(e,t){var n,r;function i(e){return typeof e==="object"&&e instanceof Object&&!(e instanceof RegExp)}for(n in t){if(t.hasOwnProperty(n)){r=t[n];if(i(r)){if(i(e[n])){et(e[n],r)}else{e[n]=et({},r)}}else{e[n]=r}}}return e}function tt(e){var t,n,r,i,o;if(e!==e){throw new Error("Numeric literal whose value is NaN")}if(e<0||e===0&&1/e<0){throw new Error("Numeric literal whose value is negative")}if(e===1/0){return p?"null":h?"1e400":"1e+400"}t=""+e;if(!h||t.length<3){return t}n=t.indexOf(".");if(!p&&t.charCodeAt(0)===48&&n===1){n=0;t=t.slice(1)}r=t;t=t.replace("e+","e");i=0;if((o=r.indexOf("e"))>0){i=+r.slice(o+1);r=r.slice(0,o)}if(n>=0){i-=r.length-n-1;r=+(r.slice(0,n)+r.slice(n+1))+""}o=0;while(r.charCodeAt(r.length+o-1)===48){--o}if(o!==0){i-=o;r=r.slice(0,o)}if(i!==0){r+="e"+i}if((r.length1e12&&Math.floor(e)===e&&(r="0x"+e.toString(16)).length255){return"\\u"+"0000".slice(n.length)+n}else if(e===0&&!u.code.isDecimalDigit(t)){return"\\0"}else if(e===11){return"\\x0B"}else{return"\\x"+"00".slice(n.length)+n}}function ot(e){if(e===92){return"\\\\"}if(e===10){return"\\n"}if(e===13){return"\\r"}if(e===8232){return"\\u2028"}if(e===8233){return"\\u2029"}throw new Error("Incorrectly classified character")}function st(e){var t,n,r,i;i=d==="double"?'"':"'";for(t=0,n=e.length;t=32&&i<=126)){t+=it(i,e.charCodeAt(n+1));continue}t+=String.fromCharCode(i)}a=!(d==="double"||d==="auto"&&s=0;--t){if(u.code.isLineTerminator(e.charCodeAt(t))){break}}return e.length-1-t}function dt(e,t){var n,r,i,o,s,a,l,c;n=e.split(/\r\n|[\r\n]/);a=Number.MAX_VALUE;for(r=1,i=n.length;rs){a=s}}if(typeof t!=="undefined"){l=f;if(n[1][a]==="*"){t+=" "}f=t}else{if(a&1){--a}l=f}for(r=1,i=n.length;r0){s=t;if(A){o=e.leadingComments[0];t=[];p=o.extendedRange;h=o.range;d=k.substring(p[0],h[0]);v=(d.match(/\n/g)||[]).length;if(v>0){t.push(J("\n",v));t.push(pt(gt(o)))}else{t.push(d);t.push(gt(o))}m=h;for(n=1,i=e.leadingComments.length;n0){t.push(J("\n",v));t.push(pt(gt(o)))}else{t.push(d);t.push(gt(o))}}else{a=!Q(lt(t).toString());u=J(" ",mt(lt([f,t,c]).toString()));for(n=0,i=e.trailingComments.length;n")}if(e.expression){t.push(v);n=this.generateExpression(e.body,i.Assignment,q);if(n.toString().charAt(0)==="{"){n=["(",n,")"]}t.push(n)}else{t.push(this.maybeBlock(e.body,$))}return t};xt.prototype.generateIterationForStatement=function(e,t,n){var o=["for"+v+"("],s=this;ht(function(){if(t.left.type===r.VariableDeclaration){ht(function(){o.push(t.left.kind+ft());o.push(s.generateStatement(t.left.declarations[0],Y))})}else{o.push(s.generateExpression(t.left,i.Call,q))}o=ct(o,e);o=[ct(o,s.generateExpression(t.right,i.Sequence,q)),")"]});o.push(this.maybeBlock(t.body,n));return o};xt.prototype.generatePropertyKey=function(e,t){var n=[];if(t){n.push("[")}n.push(this.generateExpression(e,i.Sequence,q));if(t){n.push("]")}return n};xt.prototype.generateAssignment=function(e,t,n,r,o){if(i.Assignment2){r=k.substring(n[0]+1,n[1]-1);if(r[0]==="\n"){i=["{"]}i.push(r)}}var s,a,u,l;l=V;if(t&B){l|=F}for(s=0,a=e.body.length;s0){if(!e.body[s-1].trailingComments&&!e.body[s].leadingComments){vt(e.body[s-1].range[1],e.body[s].range[0],i)}}}if(s===a-1){l|=M}if(e.body[s].leadingComments&&A){u=o.generateStatement(e.body[s],l)}else{u=pt(o.generateStatement(e.body[s],l))}i.push(u);if(!Q(lt(u).toString())){if(A&&s=0||o.slice(0,8)==="function"&&"* (".indexOf(o.charAt(8))>=0||x&&t&F&&e.expression.type===r.Literal&&typeof e.expression.value==="string"){n=["(",n,")"+this.semicolon(t)]}else{n.push(this.semicolon(t))}return n},ImportDeclaration:function(e,t){var n,o,s=this;if(e.specifiers.length===0){return["import",v,this.generateExpression(e.source,i.Sequence,q),this.semicolon(t)]}n=["import"];o=0;if(e.specifiers[o].type===r.ImportDefaultSpecifier){n=ct(n,[this.generateExpression(e.specifiers[o],i.Sequence,q)]);++o}if(e.specifiers[o]){if(o!==0){n.push(",")}if(e.specifiers[o].type===r.ImportNamespaceSpecifier){n=ct(n,[v,this.generateExpression(e.specifiers[o],i.Sequence,q)])}else{n.push(v+"{");if(e.specifiers.length-o===1){n.push(v);n.push(this.generateExpression(e.specifiers[o],i.Sequence,q));n.push(v+"}"+v)}else{ht(function(t){var r,a;n.push(y);for(r=o,a=e.specifiers.length;r1){ht(u)}else{u()}n.push(this.semicolon(t));return n},ThrowStatement:function(e,t){return[ct("throw",this.generateExpression(e.argument,i.Sequence,q)),this.semicolon(t)]},TryStatement:function(e,t){var n,r,i,o;n=["try",this.maybeBlock(e.block,V)];n=this.maybeBlockSuffix(e.block,n);if(e.handlers){for(r=0,i=e.handlers.length;r0?"\n":""];s=K;for(i=0;i0){if(!e.body[i-1].trailingComments&&!e.body[i].leadingComments){vt(e.body[i-1].range[1],e.body[i].range[0],n)}}}r=pt(this.generateStatement(e.body[i],s));n.push(r);if(i+10){r.push("(");for(s=0,a=o;s=2&&s.charCodeAt(0)===48)){o.push(".")}}o.push(".");o.push(Et(e.property))}return St(o,i.Member,t)},UnaryExpression:function(e,t,n){var r,o,s,a,l;o=this.generateExpression(e.argument,i.Unary,q);if(v===""){r=ct(e.operator,o)}else{r=[e.operator];if(e.operator.length>2){r=ct(r,o)}else{a=lt(r).toString();l=a.charCodeAt(a.length-1);s=o.toString().charCodeAt(0);if((l===43||l===45)&&l===s||u.code.isIdentifierPart(l)&&u.code.isIdentifierPart(s)){r.push(ft());r.push(o)}else{r.push(o)}}}return St(r,i.Unary,t)},YieldExpression:function(e,t,n){var r;if(e.delegate){r="yield*"}else{r="yield"}if(e.argument){r=ct(r,this.generateExpression(e.argument,i.Yield,q))}return St(r,i.Yield,t)},AwaitExpression:function(e,t,n){var r=ct(e.delegate?"await*":"await",this.generateExpression(e.argument,i.Await,q));return St(r,i.Await,t)},UpdateExpression:function(e,t,n){if(e.prefix){return St([e.operator,this.generateExpression(e.argument,i.Unary,q)],i.Unary,t)}return St([this.generateExpression(e.argument,i.Postfix,q),e.operator],i.Postfix,t)},FunctionExpression:function(e,t,n){var r=[_t(e,true),"function"];if(e.id){r.push(Ct(e)||ft());r.push(Et(e.id))}else{r.push(Ct(e)||v)}r.push(this.generateFunctionBody(e));return r},ExportBatchSpecifier:function(e,t,n){return"*"},ArrayPattern:function(e,t,n){return this.ArrayExpression(e,t,n)},ArrayExpression:function(e,t,n){var r,o,s=this;if(!e.elements.length){return"[]"}o=e.elements.length>1;r=["[",o?y:""];ht(function(t){var n,a;for(n=0,a=e.elements.length;n1;ht(function(){s=a.generateExpression(e.properties[0],i.Sequence,q)});if(!r){if(!X(lt(s).toString())){return["{",v,s,v,"}"]}}ht(function(t){var n,u;o=["{",y,t,s];if(r){o.push(","+y);for(n=1,u=e.properties.length;n0||E.moz.comprehensionExpressionStartsWithAssignment){o=ct(o,u)}else{o.push(u)}}})}if(e.filter){o=ct(o,"if"+v);u=this.generateExpression(e.filter,i.Sequence,q);o=ct(o,["(",u,")"])}if(!E.moz.comprehensionExpressionStartsWithAssignment){u=this.generateExpression(e.body,i.Assignment,q);o=ct(o,u)}o.push(e.type===r.GeneratorExpression?")":"]");return o},ComprehensionBlock:function(e,t,n){var o;if(e.left.type===r.VariableDeclaration){o=[e.left.kind,ft(),this.generateStatement(e.left.declarations[0],Y)]}else{o=this.generateExpression(e.left,i.Call,q)}o=ct(o,e.of?"of":"in");o=ct(o,this.generateExpression(e.right,i.Sequence,q));return["for"+v+"(",o,")"]},SpreadElement:function(e,t,n){return["...",this.generateExpression(e.argument,i.Assignment,q)]},TaggedTemplateExpression:function(e,t,n){var r=N;if(!(n&D)){r=U}var o=[this.generateExpression(e.tag,i.Call,r),this.generateExpression(e.quasi,i.Primary,z)];return St(o,i.TaggedTemplate,t)},TemplateElement:function(e,t,n){return e.value.raw},TemplateLiteral:function(e,t,n){var r,o,s;r=["`"];for(o=0,s=e.quasis.length;o=48&&e<=57}function i(e){return r(e)||97<=e&&e<=102||65<=e&&e<=70}function o(e){return e>=48&&e<=55}n=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function s(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&n.indexOf(e)>=0}function a(e){return e===10||e===13||e===8232||e===8233}function u(t){return t>=97&&t<=122||t>=65&&t<=90||t===36||t===95||t===92||t>=128&&e.NonAsciiIdentifierStart.test(String.fromCharCode(t))}function l(t){return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||t===36||t===95||t===92||t>=128&&e.NonAsciiIdentifierPart.test(String.fromCharCode(t))}t.exports={isDecimalDigit:r,isHexDigit:i,isOctalDigit:o,isWhiteSpace:s,isLineTerminator:a,isIdentifierStart:u,isIdentifierPart:l}})()},{}],32:[function(e,t,n){(function(){"use strict";var n=e("./code");function r(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"let":return true;default:return false}}function i(e,t){if(!t&&e==="yield"){return false}return o(e,t)}function o(e,t){if(t&&r(e)){return true}switch(e.length){case 2:return e==="if"||e==="in"||e==="do";case 3:return e==="var"||e==="for"||e==="new"||e==="try";case 4:return e==="this"||e==="else"||e==="case"||e==="void"||e==="with"||e==="enum";case 5:return e==="while"||e==="break"||e==="catch"||e==="throw"||e==="const"||e==="yield"||e==="class"||e==="super";case 6:return e==="return"||e==="typeof"||e==="delete"||e==="switch"||e==="export"||e==="import";case 7:return e==="default"||e==="finally"||e==="extends";case 8:return e==="function"||e==="continue"||e==="debugger";case 10:return e==="instanceof";default:return false}}function s(e,t){return e==="null"||e==="true"||e==="false"||i(e,t)}function a(e,t){return e==="null"||e==="true"||e==="false"||o(e,t)}function u(e){return e==="eval"||e==="arguments"}function l(e){var t,r,i;if(e.length===0){return false}i=e.charCodeAt(0);if(!n.isIdentifierStart(i)||i===92){return false}for(t=1,r=e.length;t=0&&e>1;return t?-n:n}t.encode=function f(e){var t="";var n;var o=u(e);do{n=o&s;o>>>=i;if(o>0){n|=a}t+=r.encode(n)}while(o>0);return t};t.decode=function c(e,t){var n=0;var o=e.length;var u=0;var f=0;var c,p;do{if(n>=o){throw new Error("Expected more digits in base 64 VLQ value.")}p=r.decode(e.charAt(n++));c=!!(p&a);p&=s;u=u+(p<0){if(t-s>1){return r(s,t,n,i,o)}return s}else{if(s-e>1){return r(e,s,n,i,o)}return e<0?-1:e}}t.search=function i(e,t,n){if(t.length===0){return-1}return r(-1,t.length,e,t,n)}})},{amdefine:44}],39:[function(e,t,n){if(typeof r!=="function"){var r=e("amdefine")(t,e)}r(function(e,t,n){var r=e("./util");function i(e,t){var n=e.generatedLine;var i=t.generatedLine;var o=e.generatedColumn;var s=t.generatedColumn;return i>n||i==n&&s>=o||r.compareByGeneratedPositions(e,t)<=0}function o(){this._array=[];this._sorted=true;this._last={generatedLine:-1,generatedColumn:0}}o.prototype.unsortedForEach=function s(e,t){this._array.forEach(e,t)};o.prototype.add=function a(e){var t;if(i(this._last,e)){this._last=e;this._array.push(e)}else{this._sorted=false;this._array.push(e)}};o.prototype.toArray=function u(){if(!this._sorted){this._array.sort(r.compareByGeneratedPositions);this._sorted=true}return this._array};t.MappingList=o})},{"./util":43,amdefine:44}],40:[function(e,t,n){if(typeof r!=="function"){var r=e("amdefine")(t,e)}r(function(e,t,n){var r=e("./util");var i=e("./binary-search");var o=e("./array-set").ArraySet;var s=e("./base64-vlq");function a(e){var t=e;if(typeof e==="string"){t=JSON.parse(e.replace(/^\)\]\}'/,""))}var n=r.getArg(t,"version");var i=r.getArg(t,"sources");var s=r.getArg(t,"names",[]);var a=r.getArg(t,"sourceRoot",null);var u=r.getArg(t,"sourcesContent",null);var l=r.getArg(t,"mappings");var f=r.getArg(t,"file",null);if(n!=this._version){throw new Error("Unsupported version: "+n)}i=i.map(r.normalize);this._names=o.fromArray(s,true);this._sources=o.fromArray(i,true);this.sourceRoot=a;this.sourcesContent=u;this._mappings=l;this.file=f}a.fromSourceMap=function u(e){var t=Object.create(a.prototype);t._names=o.fromArray(e._names.toArray(),true);t._sources=o.fromArray(e._sources.toArray(),true);t.sourceRoot=e._sourceRoot;t.sourcesContent=e._generateSourcesContent(t._sources.toArray(),t.sourceRoot);t.file=e._file;t.__generatedMappings=e._mappings.toArray().slice();t.__originalMappings=e._mappings.toArray().slice().sort(r.compareByOriginalPositions);return t};a.prototype._version=3;Object.defineProperty(a.prototype,"sources",{get:function(){return this._sources.toArray().map(function(e){return this.sourceRoot!=null?r.join(this.sourceRoot,e):e},this)}});a.prototype.__generatedMappings=null;Object.defineProperty(a.prototype,"_generatedMappings",{get:function(){if(!this.__generatedMappings){this.__generatedMappings=[];this.__originalMappings=[];this._parseMappings(this._mappings,this.sourceRoot)}return this.__generatedMappings}});a.prototype.__originalMappings=null;Object.defineProperty(a.prototype,"_originalMappings",{get:function(){if(!this.__originalMappings){this.__generatedMappings=[];this.__originalMappings=[];this._parseMappings(this._mappings,this.sourceRoot)}return this.__originalMappings}});a.prototype._nextCharIsMappingSeparator=function l(e){var t=e.charAt(0);return t===";"||t===","};a.prototype._parseMappings=function f(e,t){var n=1;var i=0;var o=0;var a=0;var u=0;var l=0;var f=e;var c={};var p;while(f.length>0){if(f.charAt(0)===";"){n++;f=f.slice(1);i=0}else if(f.charAt(0)===","){f=f.slice(1)}else{p={};p.generatedLine=n;s.decode(f,c);p.generatedColumn=i+c.value;i=p.generatedColumn;f=c.rest;if(f.length>0&&!this._nextCharIsMappingSeparator(f)){s.decode(f,c);p.source=this._sources.at(u+c.value);u+=c.value;f=c.rest;if(f.length===0||this._nextCharIsMappingSeparator(f)){throw new Error("Found a source, but no line and column")}s.decode(f,c);p.originalLine=o+c.value;o=p.originalLine;p.originalLine+=1;f=c.rest;if(f.length===0||this._nextCharIsMappingSeparator(f)){throw new Error("Found a source and line, but no column")}s.decode(f,c);p.originalColumn=a+c.value;a=p.originalColumn;f=c.rest;if(f.length>0&&!this._nextCharIsMappingSeparator(f)){s.decode(f,c);p.name=this._names.at(l+c.value);l+=c.value;f=c.rest}}this.__generatedMappings.push(p);if(typeof p.originalLine==="number"){this.__originalMappings.push(p)}}}this.__generatedMappings.sort(r.compareByGeneratedPositions);this.__originalMappings.sort(r.compareByOriginalPositions)};a.prototype._findMapping=function c(e,t,n,r,o){if(e[n]<=0){throw new TypeError("Line must be greater than or equal to 1, got "+e[n])}if(e[r]<0){throw new TypeError("Column must be greater than or equal to 0, got "+e[r])}return i.search(e,t,o)};a.prototype.computeColumnSpans=function p(){for(var e=0;e=0){var i=this._generatedMappings[n];if(i.generatedLine===t.generatedLine){var o=r.getArg(i,"source",null);if(o!=null&&this.sourceRoot!=null){o=r.join(this.sourceRoot,o)}return{source:o,line:r.getArg(i,"originalLine",null),column:r.getArg(i,"originalColumn",null),name:r.getArg(i,"name",null)}}}return{source:null,line:null,column:null,name:null}};a.prototype.sourceContentFor=function m(e){if(!this.sourcesContent){return null}if(this.sourceRoot!=null){e=r.relative(this.sourceRoot,e)}if(this._sources.has(e)){return this.sourcesContent[this._sources.indexOf(e)]}var t;if(this.sourceRoot!=null&&(t=r.urlParse(this.sourceRoot))){var n=e.replace(/^file:\/\//,"");if(t.scheme=="file"&&this._sources.has(n)){return this.sourcesContent[this._sources.indexOf(n)]}if((!t.path||t.path=="/")&&this._sources.has("/"+e)){return this.sourcesContent[this._sources.indexOf("/"+e)]}}throw new Error('"'+e+'" is not in the SourceMap.')};a.prototype.generatedPositionFor=function d(e){var t={source:r.getArg(e,"source"),originalLine:r.getArg(e,"line"),originalColumn:r.getArg(e,"column")};if(this.sourceRoot!=null){t.source=r.relative(this.sourceRoot,t.source)}var n=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",r.compareByOriginalPositions);if(n>=0){var i=this._originalMappings[n];return{line:r.getArg(i,"generatedLine",null),column:r.getArg(i,"generatedColumn",null),lastColumn:r.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};a.prototype.allGeneratedPositionsFor=function g(e){var t={source:r.getArg(e,"source"),originalLine:r.getArg(e,"line"),originalColumn:Infinity};if(this.sourceRoot!=null){t.source=r.relative(this.sourceRoot,t.source)}var n=[];var i=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",r.compareByOriginalPositions);if(i>=0){var o=this._originalMappings[i];while(o&&o.originalLine===t.originalLine){n.push({line:r.getArg(o,"generatedLine",null),column:r.getArg(o,"generatedColumn",null),lastColumn:r.getArg(o,"lastGeneratedColumn",null)});o=this._originalMappings[--i]}}return n.reverse()};a.GENERATED_ORDER=1;a.ORIGINAL_ORDER=2;a.prototype.eachMapping=function y(e,t,n){var i=t||null;var o=n||a.GENERATED_ORDER;var s;switch(o){case a.GENERATED_ORDER:s=this._generatedMappings;break;case a.ORIGINAL_ORDER:s=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var u=this.sourceRoot;s.map(function(e){var t=e.source;if(t!=null&&u!=null){t=r.join(u,t)}return{source:t,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:e.name}}).forEach(e,i)};t.SourceMapConsumer=a})},{"./array-set":35,"./base64-vlq":36,"./binary-search":38,"./util":43,amdefine:44}],41:[function(e,t,n){if(typeof r!=="function"){var r=e("amdefine")(t,e)}r(function(e,t,n){var r=e("./base64-vlq");var i=e("./util");var o=e("./array-set").ArraySet;var s=e("./mapping-list").MappingList;function a(e){if(!e){e={}}this._file=i.getArg(e,"file",null);this._sourceRoot=i.getArg(e,"sourceRoot",null);this._skipValidation=i.getArg(e,"skipValidation",false);this._sources=new o;this._names=new o;this._mappings=new s;this._sourcesContents=null}a.prototype._version=3;a.fromSourceMap=function u(e){var t=e.sourceRoot;var n=new a({file:e.file,sourceRoot:t});e.eachMapping(function(e){var r={generated:{line:e.generatedLine,column:e.generatedColumn}};if(e.source!=null){r.source=e.source;if(t!=null){r.source=i.relative(t,r.source)}r.original={line:e.originalLine,column:e.originalColumn};if(e.name!=null){r.name=e.name}}n.addMapping(r)});e.sources.forEach(function(t){var r=e.sourceContentFor(t);if(r!=null){n.setSourceContent(t,r)}});return n};a.prototype.addMapping=function l(e){var t=i.getArg(e,"generated");var n=i.getArg(e,"original",null);var r=i.getArg(e,"source",null);var o=i.getArg(e,"name",null);if(!this._skipValidation){this._validateMapping(t,n,r,o)}if(r!=null&&!this._sources.has(r)){this._sources.add(r)}if(o!=null&&!this._names.has(o)){this._names.add(o)}this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:r,name:o})};a.prototype.setSourceContent=function f(e,t){var n=e;if(this._sourceRoot!=null){n=i.relative(this._sourceRoot,n)}if(t!=null){if(!this._sourcesContents){this._sourcesContents={}}this._sourcesContents[i.toSetString(n)]=t}else if(this._sourcesContents){delete this._sourcesContents[i.toSetString(n)];if(Object.keys(this._sourcesContents).length===0){this._sourcesContents=null}}};a.prototype.applySourceMap=function c(e,t,n){var r=t;if(t==null){if(e.file==null){throw new Error("SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, "+'or the source map\'s "file" property. Both were omitted.')}r=e.file}var s=this._sourceRoot;if(s!=null){r=i.relative(s,r)}var a=new o;var u=new o;this._mappings.unsortedForEach(function(t){if(t.source===r&&t.originalLine!=null){var o=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});if(o.source!=null){t.source=o.source;if(n!=null){t.source=i.join(n,t.source)}if(s!=null){t.source=i.relative(s,t.source)}t.originalLine=o.line;t.originalColumn=o.column;if(o.name!=null){t.name=o.name}}}var l=t.source;if(l!=null&&!a.has(l)){a.add(l)}var f=t.name;if(f!=null&&!u.has(f)){u.add(f)}},this);this._sources=a;this._names=u;e.sources.forEach(function(t){var r=e.sourceContentFor(t);if(r!=null){if(n!=null){t=i.join(n,t)}if(s!=null){t=i.relative(s,t)}this.setSourceContent(t,r)}},this)};a.prototype._validateMapping=function p(e,t,n,r){if(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!t&&!n&&!r){return}else if(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n){return}else{throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:r}))}};a.prototype._serializeMappings=function h(){var e=0;var t=1;var n=0;var o=0;var s=0;var a=0;var u="";var l;var f=this._mappings.toArray();for(var c=0,p=f.length;c0){if(!i.compareByGeneratedPositions(l,f[c-1])){continue}u+=","}}u+=r.encode(l.generatedColumn-e);e=l.generatedColumn;if(l.source!=null){u+=r.encode(this._sources.indexOf(l.source)-a);a=this._sources.indexOf(l.source);u+=r.encode(l.originalLine-1-o);o=l.originalLine-1;u+=r.encode(l.originalColumn-n);n=l.originalColumn;if(l.name!=null){u+=r.encode(this._names.indexOf(l.name)-s);s=this._names.indexOf(l.name)}}}return u};a.prototype._generateSourcesContent=function m(e,t){return e.map(function(e){if(!this._sourcesContents){return null}if(t!=null){e=i.relative(t,e)}var n=i.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null},this)};a.prototype.toJSON=function d(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};if(this._file!=null){e.file=this._file}if(this._sourceRoot!=null){e.sourceRoot=this._sourceRoot}if(this._sourcesContents){e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)}return e};a.prototype.toString=function g(){return JSON.stringify(this)};t.SourceMapGenerator=a})},{"./array-set":35,"./base64-vlq":36,"./mapping-list":39,"./util":43,amdefine:44}],42:[function(e,t,n){if(typeof r!=="function"){var r=e("amdefine")(t,e)}r(function(e,t,n){var r=e("./source-map-generator").SourceMapGenerator;var i=e("./util");var o=/(\r?\n)/;var s=10;var a="$$$isSourceNode$$$";function u(e,t,n,r,i){this.children=[];this.sourceContents={};this.line=e==null?null:e;this.column=t==null?null:t;this.source=n==null?null:n;this.name=i==null?null:i;this[a]=true;if(r!=null)this.add(r)}u.fromStringWithSourceMap=function l(e,t,n){var r=new u;var s=e.split(o);var a=function(){var e=s.shift();var t=s.shift()||"";return e+t};var l=1,f=0;var c=null;t.eachMapping(function(e){if(c!==null){if(l0){if(c){p(c,a())}r.add(s.join(""))}t.sources.forEach(function(e){var o=t.sourceContentFor(e);if(o!=null){if(n!=null){e=i.join(n,e)}r.setSourceContent(e,o)}});return r;function p(e,t){if(e===null||e.source===undefined){r.add(t)}else{var o=n?i.join(n,e.source):e.source;r.add(new u(e.originalLine,e.originalColumn,o,t,e.name))}}};u.prototype.add=function f(e){if(Array.isArray(e)){e.forEach(function(e){this.add(e)},this)}else if(e[a]||typeof e==="string"){if(e){this.children.push(e)}}else{throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e)}return this};u.prototype.prepend=function c(e){if(Array.isArray(e)){for(var t=e.length-1;t>=0;t--){this.prepend(e[t])}}else if(e[a]||typeof e==="string"){this.children.unshift(e)}else{throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e)}return this};u.prototype.walk=function p(e){var t;for(var n=0,r=this.children.length;n0){t=[];for(n=0;n=0;l--){o=i[l];if(o==="."){i.splice(l,1)}else if(o===".."){u++}else if(u>0){if(o===""){i.splice(l+1,u);u=0}else{i.splice(l,2);u--}}}t=i.join("/");if(t===""){t=r?"/":"."}if(n){n.path=t;return a(n)}return t}t.normalize=u;function l(e,t){if(e===""){e="."}if(t===""){t="."}var n=s(t);var r=s(e);if(r){e=r.path||"/"}if(n&&!n.scheme){if(r){n.scheme=r.scheme}return a(n)}if(n||t.match(o)){return t}if(r&&!r.host&&!r.path){r.host=t;return a(r)}var i=t.charAt(0)==="/"?t:u(e.replace(/\/+$/,"")+"/"+t);if(r){r.path=i;return a(r)}return i}t.join=l;function f(e,t){if(e===""){e="."}e=e.replace(/\/$/,"");var n=s(e);if(t.charAt(0)=="/"&&n&&n.path=="/"){return t.slice(1)}return t.indexOf(e+"/")===0?t.substr(e.length+1):t}t.relative=f;function c(e){return"$"+e}t.toSetString=c;function p(e){return e.substr(1)}t.fromSetString=p;function h(e,t){var n=e||"";var r=t||"";return(n>r)-(n0){e.splice(t-1,2);t-=2}}}}function p(e,t){var n;if(e&&e.charAt(0)==="."){if(t){n=t.split("/");n=n.slice(0,n.length-1);n=n.concat(e.split("/"));c(n);e=n.join("/")}}return e}function h(e){return function(t){return p(t,e)}}function m(e){function t(t){s[e]=t}t.fromText=function(e,t){throw new Error("amdefine does not implement load.fromText")};return t}l=function(e,t,r,i){function o(o,s){if(typeof o==="string"){return f(e,t,r,o,i)}else{o=o.map(function(n){return f(e,t,r,n,i)});n.nextTick(function(){s.apply(null,o)})}}o.toUrl=function(e){if(e.indexOf(".")===0){return p(e,u.dirname(r.filename))}else{return e}};return o};i=i||function y(){return t.require.apply(t,arguments)};function d(e,n,o){var u,f,c,p;if(e){f=s[e]={};c={id:e,uri:r,exports:f};u=l(i,f,c,e)}else{if(a){throw new Error("amdefine with no module ID cannot be called more than once per file.")}a=true;f=t.exports;c=t;u=l(i,f,c,t.id)}if(n){n=n.map(function(e){return u(e)})}if(typeof o==="function"){p=o.apply(c.exports,n)}else{p=o}if(p!==undefined){c.exports=p;if(e){s[e]=c.exports}}}f=function(e,t,n,r,i){var a=r.indexOf("!"),u=r,c,g;if(a===-1){r=p(r,i);if(r==="require"){return l(e,t,n,i)}else if(r==="exports"){return t}else if(r==="module"){return n}else if(s.hasOwnProperty(r)){return s[r]}else if(o[r]){d.apply(null,o[r]);return s[r]}else{if(e){return e(u)}else{throw new Error("No module with ID: "+r)}}}else{c=r.substring(0,a);r=r.substring(a+1,r.length);g=f(e,t,n,c,i);if(g.normalize){r=g.normalize(r,h(i))}else{r=p(r,i)}if(s[r]){return s[r]}else{g.load(r,l(e,t,n,i),m(r),{});return s[r]}}};function g(e,t,n){if(Array.isArray(e)){n=t;t=e;e=undefined}else if(typeof e!=="string"){n=e;e=t=undefined}if(t&&!Array.isArray(t)){n=t;t=undefined}if(!t){t=["require","exports","module"]}if(e){o[e]=[e,t,n]}else{d(e,t,n)}}g.require=function(e){if(s[e]){return s[e]}if(o[e]){d.apply(null,o[e]);return s[e]}};g.amd={};return g}t.exports=i}).call(this,e("_process"),"/node_modules/escodegen/node_modules/source-map/node_modules/amdefine/amdefine.js")},{_process:26,path:25}],45:[function(e,t,n){t.exports={name:"escodegen",description:"ECMAScript code generator",homepage:"http://github.com/estools/escodegen",main:"escodegen.js",bin:{esgenerate:"./bin/esgenerate.js",escodegen:"./bin/escodegen.js"},files:["LICENSE.BSD","LICENSE.source-map","README.md","bin","escodegen.js","package.json"],version:"1.6.0",engines:{node:">=0.10.0"},maintainers:[{name:"constellation",email:"utatane.tea@gmail.com"}],repository:{type:"git",url:"http://github.com/estools/escodegen.git"},dependencies:{estraverse:"^1.9.1",esutils:"^1.1.6",esprima:"^1.2.2",optionator:"^0.5.0","source-map":"~0.1.40"},optionalDependencies:{"source-map":"~0.1.40"},devDependencies:{"esprima-moz":"*",semver:"^4.1.0",bluebird:"^2.3.11",chai:"^1.10.0","gulp-mocha":"^2.0.0","gulp-eslint":"^0.2.0",gulp:"^3.8.10","bower-registry-client":"^0.2.1","commonjs-everywhere":"^0.9.7"},licenses:[{type:"BSD",url:"http://github.com/estools/escodegen/raw/master/LICENSE.BSD"}],scripts:{test:"gulp travis","unit-test":"gulp test",lint:"gulp lint",release:"node tools/release.js","build-min":"cjsify -ma path: tools/entry-point.js > escodegen.browser.min.js",build:"cjsify -a path: tools/entry-point.js > escodegen.browser.js"},gitHead:"ef3a75be69a7a92daa5650bf81fbd1e4203083d2",bugs:{url:"https://github.com/estools/escodegen/issues"},_id:"escodegen@1.6.0",_shasum:"b7dbcbd6586915d9da977f74ba2650d2e82bccfb",_from:"escodegen@*",_npmVersion:"2.0.0-alpha-5",_npmUser:{name:"constellation",email:"utatane.tea@gmail.com"},dist:{shasum:"b7dbcbd6586915d9da977f74ba2650d2e82bccfb",tarball:"http://registry.npmjs.org/escodegen/-/escodegen-1.6.0.tgz"},directories:{},_resolved:"https://registry.npmjs.org/escodegen/-/escodegen-1.6.0.tgz",readme:"ERROR: No README data found!"}},{}],46:[function(t,n,r){(function(t,n){"use strict";if(typeof e==="function"&&e.amd){e(["exports"],n)}else if(typeof r!=="undefined"){n(r)}else{n(t.esprima={})}})(this,function(e){"use strict";var t,n,r,i,o,s,a,u,l,f,c,p,h,m,d,g,y,v,S,b,w,x,E,_,C,k,A,I;t={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8,RegularExpression:9,Template:10};n={};n[t.BooleanLiteral]="Boolean";n[t.EOF]="";n[t.Identifier]="Identifier";n[t.Keyword]="Keyword";n[t.NullLiteral]="Null";n[t.NumericLiteral]="Numeric";n[t.Punctuator]="Punctuator";n[t.StringLiteral]="String";n[t.RegularExpression]="RegularExpression";n[t.Template]="Template";r=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="];i={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForOfStatement:"ForOfStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MethodDefinition:"MethodDefinition",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"};o={ArrowParameterPlaceHolder:"ArrowParameterPlaceHolder"};s={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedTemplate:"Unexpected quasi %0",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",InvalidLHSInForLoop:"Invalid left-hand side in for-loop",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",IllegalYield:"Unexpected token yield",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",TemplateOctalLiteral:"Octal literals are not allowed in template strings.",ParameterAfterRestParameter:"Rest parameter must be last formal parameter",DefaultRestParameter:"Unexpected token =",ObjectPatternAsRestParameter:"Unexpected token {",DuplicateProtoProperty:"Duplicate __proto__ fields are not allowed in object literals",ConstructorSpecialMethod:"Class constructor may not be an accessor",DuplicateConstructor:"A class may only have one constructor",StaticPrototype:"Classes may not have static property named prototype",MissingFromClause:"Unexpected token",NoAsAfterImportNamespace:"Unexpected token",InvalidModuleSpecifier:"Unexpected token",IllegalImportDeclaration:"Unexpected token",IllegalExportDeclaration:"Unexpected token",DuplicateBinding:"Duplicate binding %0"};a={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢲऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԯԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠ-ࢲࣤ-ॣ०-९ॱ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఀ-ఃఅ-ఌఎ-ఐఒ-నప-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಁ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲഁ-ഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟ෦-෯ෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤞᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧ᪰-᪽ᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶ᳸᳹ᴀ-᷵᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚝꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꧠ-ꧾꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︭︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")};function L(e,t){if(!e){throw new Error("ASSERT: "+t)}}function P(e){return e>=48&&e<=57}function O(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function R(e){return"01234567".indexOf(e)>=0}function D(e){var t=e!=="0",n="01234567".indexOf(e);if(c=0&&c=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function B(e){return e===10||e===13||e===8232||e===8233}function F(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&a.NonAsciiIdentifierStart.test(String.fromCharCode(e))}function M(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&a.NonAsciiIdentifierPart.test(String.fromCharCode(e))}function T(e){switch(e){case"enum":case"export":case"import":case"super":return true;default:return false}}function N(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return true; +default:return false}}function q(e){return e==="eval"||e==="arguments"}function U(e){switch(e.length){case 2:return e==="if"||e==="in"||e==="do";case 3:return e==="var"||e==="for"||e==="new"||e==="try"||e==="let";case 4:return e==="this"||e==="else"||e==="case"||e==="void"||e==="with"||e==="enum";case 5:return e==="while"||e==="break"||e==="catch"||e==="throw"||e==="const"||e==="yield"||e==="class"||e==="super";case 6:return e==="return"||e==="typeof"||e==="delete"||e==="switch"||e==="export"||e==="import";case 7:return e==="default"||e==="finally"||e==="extends";case 8:return e==="function"||e==="continue"||e==="debugger";case 10:return e==="instanceof";default:return false}}function z(e,t,n,r,i){var o;L(typeof n==="number","Comment must have valid position");_.lastCommentStart=n;o={type:e,value:t};if(C.range){o.range=[n,r]}if(C.loc){o.loc=i}C.comments.push(o);if(C.attachComment){C.leadingComments.push(o);C.trailingComments.push(o)}}function W(e){var t,n,r,i;t=c-e;n={start:{line:p,column:c-h-e}};while(c1114111||e!=="}"){kt()}if(t<=65535){return String.fromCharCode(t)}n=(t-65536>>10)+55296;r=(t-65536&1023)+56320;return String.fromCharCode(n,r)}function $(){var e,t;e=u.charCodeAt(c++);t=String.fromCharCode(e);if(e===92){if(u.charCodeAt(c)!==117){kt()}++c;e=Y("u");if(!e||e==="\\"||!F(e.charCodeAt(0))){kt()}t=e}while(c>>="){c+=4}else{n=n.substr(0,3);if(n==="==="||n==="!=="||n===">>>"||n==="<<="||n===">>="){c+=3}else{n=n.substr(0,2);if(n==="&&"||n==="||"||n==="=="||n==="!="||n==="+="||n==="-="||n==="*="||n==="/="||n==="++"||n==="--"||n==="<<"||n===">>"||n==="&="||n==="|="||n==="^="||n==="%="||n==="<="||n===">="||n==="=>"){c+=2}else{n=u[c];if("<>=!+-*%&|^/".indexOf(n)>=0){++c}}}}}if(c===e.start){kt()}e.end=c;e.value=n;return e}function Q(e){var n="";while(c=0){r=r.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g,function(e,t,r){var i=parseInt(t||r,16);if(i>1114111){kt(null,s.InvalidRegExp)}if(i<=65535){return String.fromCharCode(i)}return n}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,n)}try{RegExp(r)}catch(i){kt(null,s.InvalidRegExp)}try{return new RegExp(e,t)}catch(o){return null}}function st(){var e,t,n,r,i;e=u[c];L(e==="/","Regular expression literal must start with a slash");t=u[c++];n=false;r=false;while(c0){r=C.tokens[C.tokens.length-1];if(r.range[0]===e&&r.type==="Punctuator"){if(r.value==="/"||r.value==="/="){C.tokens.pop()}}}C.tokens.push({type:"RegularExpression",value:n.literal,regex:n.regex,range:[e,c],loc:t})}return n}function ft(e){return e.type===t.Identifier||e.type===t.Keyword||e.type===t.BooleanLiteral||e.type===t.NullLiteral}function ct(){var e,t;e=C.tokens[C.tokens.length-1];if(!e){return lt()}if(e.type==="Punctuator"){if(e.value==="]"){return X()}if(e.value===")"){t=C.tokens[C.openParenToken-1];if(t&&t.type==="Keyword"&&(t.value==="if"||t.value==="while"||t.value==="for"||t.value==="with")){return lt()}return X()}if(e.value==="}"){if(C.tokens[C.openCurlyToken-3]&&C.tokens[C.openCurlyToken-3].type==="Keyword"){t=C.tokens[C.openCurlyToken-4];if(!t){return X()}}else if(C.tokens[C.openCurlyToken-4]&&C.tokens[C.openCurlyToken-4].type==="Keyword"){t=C.tokens[C.openCurlyToken-5];if(!t){return lt()}}else{return X()}if(r.indexOf(t.value)>=0){return X()}return lt()}return lt()}if(e.type==="Keyword"&&e.value!=="this"){return lt()}return X()}function pt(){var e,n;if(c>=x){return{type:t.EOF,lineNumber:p,lineStart:h,start:c,end:c}}e=u.charCodeAt(c);if(F(e)){n=J();if(l&&N(n.value)){n.type=t.Keyword}return n}if(e===40||e===41||e===59){return X()}if(e===39||e===34){return rt()}if(e===46){if(P(u.charCodeAt(c+1))){return nt()}return X()}if(P(e)){return nt()}if(C.tokenize&&e===47){return ct()}if(e===96||e===125&&_.curlyStack[_.curlyStack.length-1]==="${"){return it()}return X()}function ht(){var e,r,i,o;e={start:{line:p,column:c-h}};r=pt();e.end={line:p,column:c-h};if(r.type!==t.EOF){i=u.slice(r.start,r.end);o={type:n[r.type],value:i,range:[r.start,r.end],loc:e};if(r.regex){o.regex={pattern:r.regex.pattern,flags:r.regex.flags}}C.tokens.push(o)}return r}function mt(){var e;w=true;d=c;g=p;y=h;G();e=E;v=c;S=p;b=h;E=typeof C.tokens!=="undefined"?ht():pt();w=false;return e}function dt(){w=true;G();d=c;g=p;y=h;v=c;S=p;b=h;E=typeof C.tokens!=="undefined"?ht():pt();w=false}function gt(){this.line=S;this.column=v-b}function yt(){this.start=new gt;this.end=null}function vt(e){this.start={line:e.lineNumber,column:e.start-e.lineStart};this.end=null}function St(){if(C.range){this.range=[v,0]}if(C.loc){this.loc=new yt}}function bt(e){if(C.range){this.range=[e.start,0]}if(C.loc){this.loc=new vt(e)}}bt.prototype=St.prototype={processComment:function(){var e,t,n,r=C.bottomRightStack,o,s,a=r[r.length-1];if(this.type===i.Program){if(this.body.length>0){return}}if(C.trailingComments.length>0){n=[];for(o=C.trailingComments.length-1;o>=0;--o){s=C.trailingComments[o];if(s.range[0]>=this.range[1]){n.unshift(s);C.trailingComments.splice(o,1)}}C.trailingComments=[]}else{if(a&&a.trailingComments&&a.trailingComments[0].range[0]>=this.range[1]){n=a.trailingComments;delete a.trailingComments}}while(a&&a.range[0]>=this.range[0]){e=r.pop();a=r[r.length-1]}if(e){if(e.leadingComments){t=[];for(o=e.leadingComments.length-1;o>=0;--o){s=e.leadingComments[o];if(s.range[1]<=this.range[0]){t.unshift(s);e.leadingComments.splice(o,1)}}if(!e.leadingComments.length){e.leadingComments=undefined}}}else if(C.leadingComments.length>0){t=[];for(o=C.leadingComments.length-1;o>=0;--o){s=C.leadingComments[o];if(s.range[1]<=this.range[0]){t.unshift(s);C.leadingComments.splice(o,1)}}}if(t&&t.length>0){this.leadingComments=t}if(n&&n.length>0){this.trailingComments=n}r.push(this)},finish:function(){if(C.range){this.range[1]=d}if(C.loc){this.loc.end={line:g,column:d-y};if(C.source){this.loc.source=C.source}}if(C.attachComment){this.processComment()}},finishArrayExpression:function(e){this.type=i.ArrayExpression;this.elements=e;this.finish();return this},finishArrayPattern:function(e){this.type=i.ArrayPattern;this.elements=e;this.finish();return this},finishArrowFunctionExpression:function(e,t,n,r){this.type=i.ArrowFunctionExpression;this.id=null;this.params=e;this.defaults=t;this.body=n;this.generator=false;this.expression=r;this.finish();return this},finishAssignmentExpression:function(e,t,n){this.type=i.AssignmentExpression;this.operator=e;this.left=t;this.right=n;this.finish();return this},finishAssignmentPattern:function(e,t){this.type=i.AssignmentPattern;this.left=e;this.right=t;this.finish();return this},finishBinaryExpression:function(e,t,n){this.type=e==="||"||e==="&&"?i.LogicalExpression:i.BinaryExpression;this.operator=e;this.left=t;this.right=n;this.finish();return this},finishBlockStatement:function(e){this.type=i.BlockStatement;this.body=e;this.finish();return this},finishBreakStatement:function(e){this.type=i.BreakStatement;this.label=e;this.finish();return this},finishCallExpression:function(e,t){this.type=i.CallExpression;this.callee=e;this.arguments=t;this.finish();return this},finishCatchClause:function(e,t){this.type=i.CatchClause;this.param=e;this.body=t;this.finish();return this},finishClassBody:function(e){this.type=i.ClassBody;this.body=e;this.finish();return this},finishClassDeclaration:function(e,t,n){this.type=i.ClassDeclaration;this.id=e;this.superClass=t;this.body=n;this.finish();return this},finishClassExpression:function(e,t,n){this.type=i.ClassExpression;this.id=e;this.superClass=t;this.body=n;this.finish();return this},finishConditionalExpression:function(e,t,n){this.type=i.ConditionalExpression;this.test=e;this.consequent=t;this.alternate=n;this.finish();return this},finishContinueStatement:function(e){this.type=i.ContinueStatement;this.label=e;this.finish();return this},finishDebuggerStatement:function(){this.type=i.DebuggerStatement;this.finish();return this},finishDoWhileStatement:function(e,t){this.type=i.DoWhileStatement;this.body=e;this.test=t;this.finish();return this},finishEmptyStatement:function(){this.type=i.EmptyStatement;this.finish();return this},finishExpressionStatement:function(e){this.type=i.ExpressionStatement;this.expression=e;this.finish();return this},finishForStatement:function(e,t,n,r){this.type=i.ForStatement;this.init=e;this.test=t;this.update=n;this.body=r;this.finish();return this},finishForOfStatement:function(e,t,n){this.type=i.ForOfStatement;this.left=e;this.right=t;this.body=n;this.finish();return this},finishForInStatement:function(e,t,n){this.type=i.ForInStatement;this.left=e;this.right=t;this.body=n;this.each=false;this.finish();return this},finishFunctionDeclaration:function(e,t,n,r,o){this.type=i.FunctionDeclaration;this.id=e;this.params=t;this.defaults=n;this.body=r;this.generator=o;this.expression=false;this.finish();return this},finishFunctionExpression:function(e,t,n,r,o){this.type=i.FunctionExpression;this.id=e;this.params=t;this.defaults=n;this.body=r;this.generator=o;this.expression=false;this.finish();return this},finishIdentifier:function(e){this.type=i.Identifier;this.name=e;this.finish();return this},finishIfStatement:function(e,t,n){this.type=i.IfStatement;this.test=e;this.consequent=t;this.alternate=n;this.finish();return this},finishLabeledStatement:function(e,t){this.type=i.LabeledStatement;this.label=e;this.body=t;this.finish();return this},finishLiteral:function(e){this.type=i.Literal;this.value=e.value;this.raw=u.slice(e.start,e.end);if(e.regex){this.regex=e.regex}this.finish();return this},finishMemberExpression:function(e,t,n){this.type=i.MemberExpression;this.computed=e==="[";this.object=t;this.property=n;this.finish();return this},finishNewExpression:function(e,t){this.type=i.NewExpression;this.callee=e;this.arguments=t;this.finish();return this},finishObjectExpression:function(e){this.type=i.ObjectExpression;this.properties=e;this.finish();return this},finishObjectPattern:function(e){this.type=i.ObjectPattern;this.properties=e;this.finish();return this},finishPostfixExpression:function(e,t){this.type=i.UpdateExpression;this.operator=e;this.argument=t;this.prefix=false;this.finish();return this},finishProgram:function(e){this.type=i.Program;this.body=e;if(f==="module"){this.sourceType=f}this.finish();return this},finishProperty:function(e,t,n,r,o,s){this.type=i.Property;this.key=t;this.computed=n;this.value=r;this.kind=e;this.method=o;this.shorthand=s;this.finish();return this},finishRestElement:function(e){this.type=i.RestElement;this.argument=e;this.finish();return this},finishReturnStatement:function(e){this.type=i.ReturnStatement;this.argument=e;this.finish();return this},finishSequenceExpression:function(e){this.type=i.SequenceExpression;this.expressions=e;this.finish();return this},finishSpreadElement:function(e){this.type=i.SpreadElement;this.argument=e;this.finish();return this},finishSwitchCase:function(e,t){this.type=i.SwitchCase;this.test=e;this.consequent=t;this.finish();return this},finishSuper:function(){this.type=i.Super;this.finish();return this},finishSwitchStatement:function(e,t){this.type=i.SwitchStatement;this.discriminant=e;this.cases=t;this.finish();return this},finishTaggedTemplateExpression:function(e,t){this.type=i.TaggedTemplateExpression;this.tag=e;this.quasi=t;this.finish();return this},finishTemplateElement:function(e,t){this.type=i.TemplateElement;this.value=e;this.tail=t;this.finish();return this},finishTemplateLiteral:function(e,t){this.type=i.TemplateLiteral;this.quasis=e;this.expressions=t;this.finish();return this},finishThisExpression:function(){this.type=i.ThisExpression;this.finish();return this},finishThrowStatement:function(e){this.type=i.ThrowStatement;this.argument=e;this.finish();return this},finishTryStatement:function(e,t,n){this.type=i.TryStatement;this.block=e;this.guardedHandlers=[];this.handlers=t?[t]:[];this.handler=t;this.finalizer=n;this.finish();return this},finishUnaryExpression:function(e,t){this.type=e==="++"||e==="--"?i.UpdateExpression:i.UnaryExpression;this.operator=e;this.argument=t;this.prefix=true;this.finish();return this},finishVariableDeclaration:function(e){this.type=i.VariableDeclaration;this.declarations=e;this.kind="var";this.finish();return this},finishLexicalDeclaration:function(e,t){this.type=i.VariableDeclaration;this.declarations=e;this.kind=t;this.finish();return this},finishVariableDeclarator:function(e,t){this.type=i.VariableDeclarator;this.id=e;this.init=t;this.finish();return this},finishWhileStatement:function(e,t){this.type=i.WhileStatement;this.test=e;this.body=t;this.finish();return this},finishWithStatement:function(e,t){this.type=i.WithStatement;this.object=e;this.body=t;this.finish();return this},finishExportSpecifier:function(e,t){this.type=i.ExportSpecifier;this.exported=t||e;this.local=e;this.finish();return this},finishImportDefaultSpecifier:function(e){this.type=i.ImportDefaultSpecifier;this.local=e;this.finish();return this},finishImportNamespaceSpecifier:function(e){this.type=i.ImportNamespaceSpecifier;this.local=e;this.finish();return this},finishExportNamedDeclaration:function(e,t,n){this.type=i.ExportNamedDeclaration;this.declaration=e;this.specifiers=t;this.source=n;this.finish();return this},finishExportDefaultDeclaration:function(e){this.type=i.ExportDefaultDeclaration;this.declaration=e;this.finish();return this},finishExportAllDeclaration:function(e){this.type=i.ExportAllDeclaration;this.source=e;this.finish();return this},finishImportSpecifier:function(e,t){this.type=i.ImportSpecifier;this.local=e||t;this.imported=t;this.finish();return this},finishImportDeclaration:function(e,t){this.type=i.ImportDeclaration;this.specifiers=e;this.source=t;this.finish();return this},finishYieldExpression:function(e,t){this.type=i.YieldExpression;this.argument=e;this.delegate=t;this.finish();return this}};function wt(e){var t,n;for(t=0;t>="||e===">>>="||e==="&="||e==="^="||e==="|="}function Bt(){if(u.charCodeAt(v)===59||Ot(";")){mt();return}if(m){return}d=v;g=S;y=b;if(E.type!==t.EOF&&!Ot("}")){kt(E)}}function Ft(e){var t=k,n=A,r=I,i;k=true;A=true;I=null;i=e();if(I!==null){kt(I)}k=t;A=n;I=r;return i}function Mt(e){var t=k,n=A,r=I,i;k=true;A=true;I=null;i=e();k=k&&t;A=A&&n;I=r||I;return i}function Tt(e){var t=new St,n=[],r,i;It("[");while(!Ot("]")){if(Ot(",")){mt();n.push(null)}else{if(Ot("...")){i=new St;mt();e.push(E);r=kn(e);n.push(i.finishRestElement(r));break}else{n.push(zt(e))}if(!Ot("]")){It(",")}}}It("]");return t.finishArrayPattern(n)}function Nt(e){var n=new St,r,i,o=Ot("["),s;if(E.type===t.Identifier){i=E;r=kn();if(Ot("=")){e.push(i);mt();s=wn();return n.finishProperty("init",r,false,new bt(i).finishAssignmentPattern(r,s),false,false)}else if(!Ot(":")){e.push(i);return n.finishProperty("init",r,false,r,false,true)}}else{r=Yt(e)}It(":");s=zt(e);return n.finishProperty("init",r,o,s,false,false)}function qt(e){var t=new St,n=[];It("{");while(!Ot("}")){n.push(Nt(e));if(!Ot("}")){It(",")}}mt();return t.finishObjectPattern(n)}function Ut(e){var n;if(E.type===t.Identifier){e.push(E);n=kn();return n}else if(Ot("[")){return Tt(e)}else if(Ot("{")){return qt(e)}kt(E)}function zt(e){var t=E,n,r;n=Ut(e);if(Ot("=")){mt();r=Ft(wn);n=new bt(t).finishAssignmentPattern(n,r)}return n}function Wt(){var e=[],t=new St,n;It("[");while(!Ot("]")){if(Ot(",")){mt();e.push(null)}else if(Ot("...")){n=new St;mt();n.finishSpreadElement(Mt(wn));if(!Ot("]")){A=k=false;It(",")}e.push(n)}else{e.push(Mt(wn));if(!Ot("]")){It(",")}}}mt();return t.finishArrayExpression(e)}function Vt(e,t,n){var r,i;A=k=false;r=l;i=Ft(Xn);if(l&&t.firstRestricted){At(t.firstRestricted,t.message)}if(l&&t.stricted){At(t.stricted,t.message)}l=r;return e.finishFunctionExpression(null,t.params,t.defaults,i,n)}function Gt(){var e,t,n=new St,r=_.allowYield;_.allowYield=false;e=er();_.allowYield=r;_.allowYield=false;t=Vt(n,e,false);_.allowYield=r;return t}function Yt(){var e,n=new St,r;e=mt();switch(e.type){case t.StringLiteral:case t.NumericLiteral:if(l&&e.octal){At(e,s.StrictOctalLiteral)}return n.finishLiteral(e);case t.Identifier:case t.BooleanLiteral:case t.NullLiteral:case t.Keyword:return n.finishIdentifier(e.value);case t.Punctuator:if(e.value==="["){r=Ft(wn);It("]");return r}break}kt(e)}function Kt(){switch(E.type){case t.Identifier:case t.StringLiteral:case t.BooleanLiteral:case t.NullLiteral:case t.NumericLiteral:case t.Keyword:return true;case t.Punctuator:return E.value==="["}return false}function $t(e,n,r,i){var o,s,a,u,l=_.allowYield;if(e.type===t.Identifier){if(e.value==="get"&&Kt()){r=Ot("[");n=Yt();a=new St;It("(");It(")");_.allowYield=false;o=Vt(a,{params:[],defaults:[],stricted:null,firstRestricted:null,message:null},false);_.allowYield=l;return i.finishProperty("get",n,r,o,false,false)}else if(e.value==="set"&&Kt()){r=Ot("[");n=Yt();a=new St;It("(");s={params:[],defaultCount:0,defaults:[],firstRestricted:null,paramSet:{}};if(Ot(")")){At(E)}else{_.allowYield=false;Zn(s);_.allowYield=l;if(s.defaultCount===0){s.defaults=[]}}It(")");_.allowYield=false;o=Vt(a,s,false);_.allowYield=l;return i.finishProperty("set",n,r,o,false,false)}}else if(e.type===t.Punctuator&&e.value==="*"&&Kt()){r=Ot("[");n=Yt();a=new St;_.allowYield=false;u=er();_.allowYield=l;_.allowYield=true;o=Vt(a,u,true);_.allowYield=l;return i.finishProperty("init",n,r,o,true,false)}if(n&&Ot("(")){o=Gt();return i.finishProperty("init",n,r,o,true,false)}return null}function Ht(e,t,n){if(t===false&&(e.type===i.Identifier&&e.name==="__proto__"||e.type===i.Literal&&e.value==="__proto__")){if(n.value){_t(s.DuplicateProtoProperty)}else{n.value=true}}}function Jt(e){var n=E,r=new St,i,o,s,a;i=Ot("[");if(Ot("*")){mt()}else{o=Yt()}s=$t(n,o,i,r);if(s){Ht(s.key,s.computed,e);return s}if(!o){kt(E)}Ht(o,i,e);if(Ot(":")){mt();a=Mt(wn);return r.finishProperty("init",o,i,a,false,false)}if(n.type===t.Identifier){if(Ot("=")){I=E;mt();a=Ft(wn);return r.finishProperty("init",o,i,new bt(n).finishAssignmentPattern(o,a),false,true)}return r.finishProperty("init",o,i,o,false,true)}kt(E)}function Xt(){var e=[],t={value:false},n=new St;It("{");while(!Ot("}")){e.push(Jt(t));if(!Ot("}")){Lt()}}It("}");return n.finishObjectExpression(e)}function Qt(e){var t;switch(e.type){case i.Identifier:case i.MemberExpression:case i.RestElement:case i.AssignmentPattern:break;case i.SpreadElement:e.type=i.RestElement;Qt(e.argument);break;case i.ArrayExpression:e.type=i.ArrayPattern;for(t=0;t")){It("=>")}return{type:o.ArrowParameterPlaceHolder,params:[],rawParams:[]}}n=E;if(Ot("...")){e=Dn(s);It(")");if(!Ot("=>")){It("=>")}return{type:o.ArrowParameterPlaceHolder,params:[e]}}k=true;e=Mt(wn);if(Ot(",")){A=false;t=[e];while(v")){It("=>")}k=false;for(r=0;r")){if(!k){kt(E)}if(e.type===i.SequenceExpression){for(r=0;r":case"<=":case">=":case"instanceof":r=7;break;case"in":r=n?7:0;break;case"<<":case">>":case">>>":r=8;break;case"+":case"-":r=9;break;case"*":case"/":case"%":r=11;break;default:break}return r +}function mn(){var e,t,n,r,i,o,s,a,u,l;e=E;u=Mt(pn);r=E;i=hn(r,_.allowIn);if(i===0){return u}A=k=false;r.prec=i;mt();t=[e,E];s=Ft(pn);o=[u,r,s];while((i=hn(E,_.allowIn))>0){while(o.length>2&&i<=o[o.length-2].prec){s=o.pop();a=o.pop().value;u=o.pop();t.pop();n=new bt(t[t.length-1]).finishBinaryExpression(a,u,s);o.push(n)}r=mt();r.prec=i;o.push(r);t.push(E);n=Ft(pn);o.push(n)}l=o.length-1;n=o[l];t.pop();while(l>1){n=new bt(t.pop()).finishBinaryExpression(o[l-1].value,o[l-2],n);l-=2}return n}function dn(){var e,t,n,r,i;i=E;e=Mt(mn);if(Ot("?")){mt();t=_.allowIn;_.allowIn=true;n=Ft(wn);_.allowIn=t;It(":");r=Ft(wn);e=new bt(i).finishConditionalExpression(e,n,r);A=k=false}return e}function gn(){if(Ot("{")){return Xn()}return Ft(wn)}function yn(e,t){var n;switch(t.type){case i.Identifier:Qn(e,t,t.name);break;case i.RestElement:yn(e,t.argument);break;case i.AssignmentPattern:yn(e,t.left);break;case i.ArrayPattern:for(n=0;n");n=l;r=gn();if(l&&e.firstRestricted){kt(e.firstRestricted,e.message)}if(l&&e.stricted){At(e.stricted,e.message)}l=n;return t.finishArrowFunctionExpression(e.params,e.defaults,r,r.type!==i.BlockStatement)}function bn(){var e,n,r;n=new St;if(!_.allowYield){At(E,s.IllegalYield)}Pt("yield");if(!m){r=Ot("*");if(r){mt();e=xn()}else{if(!Ot(";")&&!Ot("}")&&E.type!==t.EOF){e=xn()}}}return n.finishYieldExpression(e,r)}function wn(){var e,t,n,r,a;a=E;e=E;if(Rt("yield")){return bn()}t=dn();if(t.type===o.ArrowParameterPlaceHolder||Ot("=>")){A=k=false;r=vn(t);if(r){I=null;return Sn(r,new bt(a))}return t}if(jt()){if(!A){_t(s.InvalidLHSInAssignment)}if(l&&t.type===i.Identifier&&q(t.name)){At(e,s.StrictLHSAssignment)}if(!Ot("=")){A=k=false}else{Qt(t)}e=mt();n=Ft(wn);t=new bt(a).finishAssignmentExpression(e.value,t,n);I=null}return t}function xn(){var e,t=E,n;e=Ft(wn);if(Ot(",")){n=[e];while(v0?1:0;h=0;v=c;S=p;b=h;x=u.length;E=null;_={allowIn:true,allowYield:false,labelSet:{},inFunctionBody:false,inIteration:false,inSwitch:false,lastCommentStart:-1,curlyStack:[]};C={};n=n||{};n.tokens=true;C.tokens=[];C.tokenize=true;C.openParenToken=-1;C.openCurlyToken=-1;C.range=typeof n.range==="boolean"&&n.range;C.loc=typeof n.loc==="boolean"&&n.loc;if(typeof n.comment==="boolean"&&n.comment){C.comments=[]}if(typeof n.tolerant==="boolean"&&n.tolerant){C.errors=[]}try{dt();if(E.type===t.EOF){return C.tokens}mt();while(E.type!==t.EOF){try{mt()}catch(o){if(C.errors){wt(o);break}else{throw o}}}Sr();i=C.tokens;if(typeof C.comments!=="undefined"){i.comments=C.comments}if(typeof C.errors!=="undefined"){i.errors=C.errors}}catch(s){throw s}finally{C={}}return i}function wr(e,t){var n,r;r=String;if(typeof e!=="string"&&!(e instanceof String)){e=r(e)}u=e;c=0;p=u.length>0?1:0;h=0;v=c;S=p;b=h;x=u.length;E=null;_={allowIn:true,allowYield:false,labelSet:{},inFunctionBody:false,inIteration:false,inSwitch:false,lastCommentStart:-1,curlyStack:[]};f="script";l=false;C={};if(typeof t!=="undefined"){C.range=typeof t.range==="boolean"&&t.range;C.loc=typeof t.loc==="boolean"&&t.loc;C.attachComment=typeof t.attachComment==="boolean"&&t.attachComment;if(C.loc&&t.source!==null&&t.source!==undefined){C.source=r(t.source)}if(typeof t.tokens==="boolean"&&t.tokens){C.tokens=[]}if(typeof t.comment==="boolean"&&t.comment){C.comments=[]}if(typeof t.tolerant==="boolean"&&t.tolerant){C.errors=[]}if(C.attachComment){C.range=true;C.comments=[];C.bottomRightStack=[];C.trailingComments=[];C.leadingComments=[]}if(t.sourceType==="module"){f=t.sourceType;l=true}}try{n=vr();if(typeof C.comments!=="undefined"){n.comments=C.comments}if(typeof C.tokens!=="undefined"){Sr();n.tokens=C.tokens}if(typeof C.errors!=="undefined"){n.errors=C.errors}}catch(i){throw i}finally{C={}}return n}e.version="2.4.1";e.tokenize=br;e.parse=wr;e.Syntax=function(){var e,t={};if(typeof Object.create==="function"){t=Object.create(null)}for(e in i){if(i.hasOwnProperty(e)){t[e]=i[e]}}if(typeof Object.freeze==="function"){Object.freeze(t)}return t}()})},{}],47:[function(t,n,r){(function(t,n){"use strict";if(typeof e==="function"&&e.amd){e(["exports"],n)}else if(typeof r!=="undefined"){n(r)}else{n(t.estraverse={})}})(this,function i(e){"use strict";var t,n,r,o,s,a,u,l,f;function c(){}n=Array.isArray;if(!n){n=function k(e){return Object.prototype.toString.call(e)==="[object Array]"}}function p(e){var t={},n,r;for(n in e){if(e.hasOwnProperty(n)){r=e[n];if(typeof r==="object"&&r!==null){t[n]=p(r)}else{t[n]=r}}}return t}function h(e){var t={},n;for(n in e){if(e.hasOwnProperty(n)){t[n]=e[n]}}return t}c(h);function m(e,t){var n,r,i,o;r=e.length;i=0;while(r){n=r>>>1;o=i+n;if(t(e[o])){r=n}else{i=o+1;r-=n+1}}return i}function d(e,t){var n,r,i,o;r=e.length;i=0;while(r){n=r>>>1;o=i+n;if(t(e[o])){i=o+1;r-=n+1}else{r=n}}return i}c(d);s=Object.create||function(){function e(){}return function(t){e.prototype=t;return new e}}();a=Object.keys||function(e){var t=[],n;for(n in e){t.push(n)}return t};function g(e,t){a(t).forEach(function(n){e[n]=t[n]});return e}t={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportBatchSpecifier:"ExportBatchSpecifier",ExportDeclaration:"ExportDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"};o={AssignmentExpression:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","defaults","rest","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ClassBody:["body"],ClassDeclaration:["id","body","superClass"],ClassExpression:["id","body","superClass"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportBatchSpecifier:[],ExportDeclaration:["declaration","specifiers","source"],ExportSpecifier:["id","name"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","defaults","rest","body"],FunctionExpression:["id","params","defaults","rest","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["id"],ImportNamespaceSpecifier:["id"],ImportSpecifier:["id","name"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],Program:["body"],Property:["key","value"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handlers","handler","guardedHandlers","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]};u={};l={};f={};r={Break:u,Skip:l,Remove:f};function y(e,t){this.parent=e;this.key=t}y.prototype.replace=function A(e){this.parent[this.key]=e};y.prototype.remove=function I(){if(n(this.parent)){this.parent.splice(this.key,1);return true}else{this.replace(null);return false}};function v(e,t,n,r){this.node=e;this.path=t;this.wrap=n;this.ref=r}function S(){}S.prototype.path=function L(){var e,t,r,i,o,s;function a(e,t){if(n(t)){for(r=0,i=t.length;r=0){p=d[h];g=s[p];if(!g){continue}if(n(g)){m=g.length;while((m-=1)>=0){if(!g[m]){continue}if(w(f,d[h])){o=new v(g[m],[p,m],"Property",null)}else if(b(g[m])){o=new v(g[m],[p,m],null,null)}else{continue}r.push(o)}}else if(b(g)){r.push(new v(g,p,null,null))}}}}};S.prototype.replace=function B(e,t){function r(e){var t,n,r,o;if(e.ref.remove()){n=e.ref.key;o=e.ref.parent;t=i.length;while(t--){r=i[t];if(r.ref&&r.ref.parent===o){if(r.ref.key=0){_=g[m];S=s[_];if(!S){continue}if(n(S)){d=S.length;while((d-=1)>=0){if(!S[d]){continue}if(w(c,g[m])){h=new v(S[d],[_,d],"Property",new y(S,d))}else if(b(S[d])){h=new v(S[d],[_,d],null,new y(S,d))}else{continue}i.push(h)}}else if(b(S)){i.push(new v(S,_,null,new y(s,_)))}}}return E.root};function x(e,t){var n=new S;return n.traverse(e,t)}function E(e,t){var n=new S;return n.replace(e,t)}function _(e,t){var n;n=m(t,function r(t){return t.range[0]>e.range[0]});e.extendedRange=[e.range[0],e.range[1]];if(n!==t.length){e.extendedRange[1]=t[n].range[0]}n-=1;if(n>=0){e.extendedRange[0]=t[n].range[1]}return e}function C(e,t,n){var i=[],o,s,a,u;if(!e.range){throw new Error("attachComments needs range information")}if(!n.length){if(t.length){for(a=0,s=t.length;ae.range[0]){break}if(t.extendedRange[1]===e.range[0]){if(!e.leadingComments){e.leadingComments=[]}e.leadingComments.push(t);i.splice(u,1)}else{u+=1}}if(u===i.length){return r.Break}if(i[u].extendedRange[0]>e.range[1]){return r.Skip}}});u=0;x(e,{leave:function(e){var t;while(ue.range[1]){return r.Skip}}});return e}e.version="1.8.1-dev";e.Syntax=t;e.traverse=x;e.replace=E;e.attachComments=C;e.VisitorKeys=o;e.VisitorOption=r;e.Controller=S;e.cloneEnvironment=function(){return i({})};return e})},{}],48:[function(e,t,n){arguments[4][34][0].apply(n,arguments)},{"./source-map/source-map-consumer":53,"./source-map/source-map-generator":54,"./source-map/source-node":55}],49:[function(e,t,n){arguments[4][35][0].apply(n,arguments)},{"./util":56,amdefine:57}],50:[function(e,t,n){if(typeof r!=="function"){var r=e("amdefine")(t,e)}r(function(e,t,n){var r=e("./base64");var i=5;var o=1<>1;return t?-n:n}t.encode=function f(e){var t="";var n;var o=u(e);do{n=o&s;o>>>=i;if(o>0){n|=a}t+=r.encode(n)}while(o>0);return t};t.decode=function c(e){var t=0;var n=e.length;var o=0;var u=0;var f,c;do{if(t>=n){throw new Error("Expected more digits in base 64 VLQ value.")}c=r.decode(e.charAt(t++));f=!!(c&a);c&=s;o=o+(c<0){if(t-s>1){return r(s,t,n,i,o)}return i[s]}else{if(s-e>1){return r(e,s,n,i,o)}return e<0?null:i[e]}}t.search=function i(e,t,n){return t.length>0?r(-1,t.length,e,t,n):null}})},{amdefine:57}],53:[function(e,t,n){if(typeof r!=="function"){var r=e("amdefine")(t,e)}r(function(e,t,n){var r=e("./util");var i=e("./binary-search");var o=e("./array-set").ArraySet;var s=e("./base64-vlq");function a(e){var t=e;if(typeof e==="string"){t=JSON.parse(e.replace(/^\)\]\}'/,""))}var n=r.getArg(t,"version");var i=r.getArg(t,"sources");var s=r.getArg(t,"names",[]);var a=r.getArg(t,"sourceRoot",null);var u=r.getArg(t,"sourcesContent",null);var l=r.getArg(t,"mappings");var f=r.getArg(t,"file",null);if(n!=this._version){throw new Error("Unsupported version: "+n)}this._names=o.fromArray(s,true);this._sources=o.fromArray(i,true);this.sourceRoot=a;this.sourcesContent=u;this._mappings=l;this.file=f}a.fromSourceMap=function u(e){var t=Object.create(a.prototype);t._names=o.fromArray(e._names.toArray(),true);t._sources=o.fromArray(e._sources.toArray(),true);t.sourceRoot=e._sourceRoot; +t.sourcesContent=e._generateSourcesContent(t._sources.toArray(),t.sourceRoot);t.file=e._file;t.__generatedMappings=e._mappings.slice().sort(r.compareByGeneratedPositions);t.__originalMappings=e._mappings.slice().sort(r.compareByOriginalPositions);return t};a.prototype._version=3;Object.defineProperty(a.prototype,"sources",{get:function(){return this._sources.toArray().map(function(e){return this.sourceRoot!=null?r.join(this.sourceRoot,e):e},this)}});a.prototype.__generatedMappings=null;Object.defineProperty(a.prototype,"_generatedMappings",{get:function(){if(!this.__generatedMappings){this.__generatedMappings=[];this.__originalMappings=[];this._parseMappings(this._mappings,this.sourceRoot)}return this.__generatedMappings}});a.prototype.__originalMappings=null;Object.defineProperty(a.prototype,"_originalMappings",{get:function(){if(!this.__originalMappings){this.__generatedMappings=[];this.__originalMappings=[];this._parseMappings(this._mappings,this.sourceRoot)}return this.__originalMappings}});a.prototype._parseMappings=function l(e,t){var n=1;var i=0;var o=0;var a=0;var u=0;var l=0;var f=/^[,;]/;var c=e;var p;var h;while(c.length>0){if(c.charAt(0)===";"){n++;c=c.slice(1);i=0}else if(c.charAt(0)===","){c=c.slice(1)}else{p={};p.generatedLine=n;h=s.decode(c);p.generatedColumn=i+h.value;i=p.generatedColumn;c=h.rest;if(c.length>0&&!f.test(c.charAt(0))){h=s.decode(c);p.source=this._sources.at(u+h.value);u+=h.value;c=h.rest;if(c.length===0||f.test(c.charAt(0))){throw new Error("Found a source, but no line and column")}h=s.decode(c);p.originalLine=o+h.value;o=p.originalLine;p.originalLine+=1;c=h.rest;if(c.length===0||f.test(c.charAt(0))){throw new Error("Found a source and line, but no column")}h=s.decode(c);p.originalColumn=a+h.value;a=p.originalColumn;c=h.rest;if(c.length>0&&!f.test(c.charAt(0))){h=s.decode(c);p.name=this._names.at(l+h.value);l+=h.value;c=h.rest}}this.__generatedMappings.push(p);if(typeof p.originalLine==="number"){this.__originalMappings.push(p)}}}this.__generatedMappings.sort(r.compareByGeneratedPositions);this.__originalMappings.sort(r.compareByOriginalPositions)};a.prototype._findMapping=function f(e,t,n,r,o){if(e[n]<=0){throw new TypeError("Line must be greater than or equal to 1, got "+e[n])}if(e[r]<0){throw new TypeError("Column must be greater than or equal to 0, got "+e[r])}return i.search(e,t,o)};a.prototype.originalPositionFor=function c(e){var t={generatedLine:r.getArg(e,"line"),generatedColumn:r.getArg(e,"column")};var n=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",r.compareByGeneratedPositions);if(n&&n.generatedLine===t.generatedLine){var i=r.getArg(n,"source",null);if(i!=null&&this.sourceRoot!=null){i=r.join(this.sourceRoot,i)}return{source:i,line:r.getArg(n,"originalLine",null),column:r.getArg(n,"originalColumn",null),name:r.getArg(n,"name",null)}}return{source:null,line:null,column:null,name:null}};a.prototype.sourceContentFor=function p(e){if(!this.sourcesContent){return null}if(this.sourceRoot!=null){e=r.relative(this.sourceRoot,e)}if(this._sources.has(e)){return this.sourcesContent[this._sources.indexOf(e)]}var t;if(this.sourceRoot!=null&&(t=r.urlParse(this.sourceRoot))){var n=e.replace(/^file:\/\//,"");if(t.scheme=="file"&&this._sources.has(n)){return this.sourcesContent[this._sources.indexOf(n)]}if((!t.path||t.path=="/")&&this._sources.has("/"+e)){return this.sourcesContent[this._sources.indexOf("/"+e)]}}throw new Error('"'+e+'" is not in the SourceMap.')};a.prototype.generatedPositionFor=function h(e){var t={source:r.getArg(e,"source"),originalLine:r.getArg(e,"line"),originalColumn:r.getArg(e,"column")};if(this.sourceRoot!=null){t.source=r.relative(this.sourceRoot,t.source)}var n=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",r.compareByOriginalPositions);if(n){return{line:r.getArg(n,"generatedLine",null),column:r.getArg(n,"generatedColumn",null)}}return{line:null,column:null}};a.GENERATED_ORDER=1;a.ORIGINAL_ORDER=2;a.prototype.eachMapping=function m(e,t,n){var i=t||null;var o=n||a.GENERATED_ORDER;var s;switch(o){case a.GENERATED_ORDER:s=this._generatedMappings;break;case a.ORIGINAL_ORDER:s=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var u=this.sourceRoot;s.map(function(e){var t=e.source;if(t!=null&&u!=null){t=r.join(u,t)}return{source:t,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:e.name}}).forEach(e,i)};t.SourceMapConsumer=a})},{"./array-set":49,"./base64-vlq":50,"./binary-search":52,"./util":56,amdefine:57}],54:[function(e,t,n){if(typeof r!=="function"){var r=e("amdefine")(t,e)}r(function(e,t,n){var r=e("./base64-vlq");var i=e("./util");var o=e("./array-set").ArraySet;function s(e){if(!e){e={}}this._file=i.getArg(e,"file",null);this._sourceRoot=i.getArg(e,"sourceRoot",null);this._sources=new o;this._names=new o;this._mappings=[];this._sourcesContents=null}s.prototype._version=3;s.fromSourceMap=function a(e){var t=e.sourceRoot;var n=new s({file:e.file,sourceRoot:t});e.eachMapping(function(e){var r={generated:{line:e.generatedLine,column:e.generatedColumn}};if(e.source!=null){r.source=e.source;if(t!=null){r.source=i.relative(t,r.source)}r.original={line:e.originalLine,column:e.originalColumn};if(e.name!=null){r.name=e.name}}n.addMapping(r)});e.sources.forEach(function(t){var r=e.sourceContentFor(t);if(r!=null){n.setSourceContent(t,r)}});return n};s.prototype.addMapping=function u(e){var t=i.getArg(e,"generated");var n=i.getArg(e,"original",null);var r=i.getArg(e,"source",null);var o=i.getArg(e,"name",null);this._validateMapping(t,n,r,o);if(r!=null&&!this._sources.has(r)){this._sources.add(r)}if(o!=null&&!this._names.has(o)){this._names.add(o)}this._mappings.push({generatedLine:t.line,generatedColumn:t.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:r,name:o})};s.prototype.setSourceContent=function l(e,t){var n=e;if(this._sourceRoot!=null){n=i.relative(this._sourceRoot,n)}if(t!=null){if(!this._sourcesContents){this._sourcesContents={}}this._sourcesContents[i.toSetString(n)]=t}else{delete this._sourcesContents[i.toSetString(n)];if(Object.keys(this._sourcesContents).length===0){this._sourcesContents=null}}};s.prototype.applySourceMap=function f(e,t,n){var r=t;if(t==null){if(e.file==null){throw new Error("SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, "+'or the source map\'s "file" property. Both were omitted.')}r=e.file}var s=this._sourceRoot;if(s!=null){r=i.relative(s,r)}var a=new o;var u=new o;this._mappings.forEach(function(t){if(t.source===r&&t.originalLine!=null){var o=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});if(o.source!=null){t.source=o.source;if(n!=null){t.source=i.join(n,t.source)}if(s!=null){t.source=i.relative(s,t.source)}t.originalLine=o.line;t.originalColumn=o.column;if(o.name!=null&&t.name!=null){t.name=o.name}}}var l=t.source;if(l!=null&&!a.has(l)){a.add(l)}var f=t.name;if(f!=null&&!u.has(f)){u.add(f)}},this);this._sources=a;this._names=u;e.sources.forEach(function(t){var r=e.sourceContentFor(t);if(r!=null){if(n!=null){t=i.join(n,t)}if(s!=null){t=i.relative(s,t)}this.setSourceContent(t,r)}},this)};s.prototype._validateMapping=function c(e,t,n,r){if(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!t&&!n&&!r){return}else if(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n){return}else{throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:r}))}};s.prototype._serializeMappings=function p(){var e=0;var t=1;var n=0;var o=0;var s=0;var a=0;var u="";var l;this._mappings.sort(i.compareByGeneratedPositions);for(var f=0,c=this._mappings.length;f0){if(!i.compareByGeneratedPositions(l,this._mappings[f-1])){continue}u+=","}}u+=r.encode(l.generatedColumn-e);e=l.generatedColumn;if(l.source!=null){u+=r.encode(this._sources.indexOf(l.source)-a);a=this._sources.indexOf(l.source);u+=r.encode(l.originalLine-1-o);o=l.originalLine-1;u+=r.encode(l.originalColumn-n);n=l.originalColumn;if(l.name!=null){u+=r.encode(this._names.indexOf(l.name)-s);s=this._names.indexOf(l.name)}}}return u};s.prototype._generateSourcesContent=function h(e,t){return e.map(function(e){if(!this._sourcesContents){return null}if(t!=null){e=i.relative(t,e)}var n=i.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null},this)};s.prototype.toJSON=function m(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};if(this._file!=null){e.file=this._file}if(this._sourceRoot!=null){e.sourceRoot=this._sourceRoot}if(this._sourcesContents){e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)}return e};s.prototype.toString=function d(){return JSON.stringify(this)};t.SourceMapGenerator=s})},{"./array-set":49,"./base64-vlq":50,"./util":56,amdefine:57}],55:[function(e,t,n){if(typeof r!=="function"){var r=e("amdefine")(t,e)}r(function(e,t,n){var r=e("./source-map-generator").SourceMapGenerator;var i=e("./util");var o=/(\r?\n)/;var s=/\r\n|[\s\S]/g;function a(e,t,n,r,i){this.children=[];this.sourceContents={};this.line=e==null?null:e;this.column=t==null?null:t;this.source=n==null?null:n;this.name=i==null?null:i;if(r!=null)this.add(r)}a.fromStringWithSourceMap=function u(e,t,n){var r=new a;var s=e.split(o);var u=function(){var e=s.shift();var t=s.shift()||"";return e+t};var l=1,f=0;var c=null;t.eachMapping(function(e){if(c!==null){if(l0){if(c){p(c,u())}r.add(s.join(""))}t.sources.forEach(function(e){var o=t.sourceContentFor(e);if(o!=null){if(n!=null){e=i.join(n,e)}r.setSourceContent(e,o)}});return r;function p(e,t){if(e===null||e.source===undefined){r.add(t)}else{var o=n?i.join(n,e.source):e.source;r.add(new a(e.originalLine,e.originalColumn,o,t,e.name))}}};a.prototype.add=function l(e){if(Array.isArray(e)){e.forEach(function(e){this.add(e)},this)}else if(e instanceof a||typeof e==="string"){if(e){this.children.push(e)}}else{throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e)}return this};a.prototype.prepend=function f(e){if(Array.isArray(e)){for(var t=e.length-1;t>=0;t--){this.prepend(e[t])}}else if(e instanceof a||typeof e==="string"){this.children.unshift(e)}else{throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e)}return this};a.prototype.walk=function c(e){var t;for(var n=0,r=this.children.length;n0){t=[];for(n=0;n0){e.splice(t-1,2);t-=2}}}}function p(e,t){var n;if(e&&e.charAt(0)==="."){if(t){n=t.split("/");n=n.slice(0,n.length-1);n=n.concat(e.split("/"));c(n);e=n.join("/")}}return e}function h(e){return function(t){return p(t,e)}}function m(e){function t(t){s[e]=t}t.fromText=function(e,t){throw new Error("amdefine does not implement load.fromText")};return t}l=function(e,t,r,i){function o(o,s){if(typeof o==="string"){return f(e,t,r,o,i)}else{o=o.map(function(n){return f(e,t,r,n,i)});n.nextTick(function(){s.apply(null,o)})}}o.toUrl=function(e){if(e.indexOf(".")===0){return p(e,u.dirname(r.filename))}else{return e}};return o};i=i||function y(){return t.require.apply(t,arguments)};function d(e,n,o){var u,f,c,p;if(e){f=s[e]={};c={id:e,uri:r,exports:f};u=l(i,f,c,e)}else{if(a){throw new Error("amdefine with no module ID cannot be called more than once per file.")}a=true;f=t.exports;c=t;u=l(i,f,c,t.id)}if(n){n=n.map(function(e){return u(e)})}if(typeof o==="function"){p=o.apply(c.exports,n)}else{p=o}if(p!==undefined){c.exports=p;if(e){s[e]=c.exports}}}f=function(e,t,n,r,i){var a=r.indexOf("!"),u=r,c,g;if(a===-1){r=p(r,i);if(r==="require"){return l(e,t,n,i)}else if(r==="exports"){return t}else if(r==="module"){return n}else if(s.hasOwnProperty(r)){return s[r]}else if(o[r]){d.apply(null,o[r]);return s[r]}else{if(e){return e(u)}else{throw new Error("No module with ID: "+r)}}}else{c=r.substring(0,a);r=r.substring(a+1,r.length);g=f(e,t,n,c,i);if(g.normalize){r=g.normalize(r,h(i))}else{r=p(r,i)}if(s[r]){return s[r]}else{g.load(r,l(e,t,n,i),m(r),{});return s[r]}}};function g(e,t,n){if(Array.isArray(e)){n=t;t=e;e=undefined}else if(typeof e!=="string"){n=e;e=t=undefined}if(t&&!Array.isArray(t)){n=t;t=undefined}if(!t){t=["require","exports","module"]}if(e){o[e]=[e,t,n]}else{d(e,t,n)}}g.require=function(e){if(s[e]){return s[e]}if(o[e]){d.apply(null,o[e]);return s[e]}};g.amd={};return g}t.exports=i}).call(this,e("_process"),"/node_modules/source-map/node_modules/amdefine/amdefine.js")},{_process:26,path:25}],58:[function(e,t,n){t.exports={name:"js2coffee",version:"2.1.0",description:"JavaScript to CoffeeScript compiler",homepage:"http://js2.coffee",main:"dist/js2coffee.js",keywords:["javascript","coffeescript","language","compiler"],scripts:{test:"mocha",autotest:"mocha -R min -b --watch",prepublish:"mocha >/dev/null && make -B dist"},author:"Rico Sta. Cruz ",license:"MIT",bugs:{url:"https://github.com/js2coffee/js2coffee/issues"},repository:{type:"git",url:"https://github.com/js2coffee/js2coffee.git"},browser:"js2coffee.coffee",bin:{js2coffee:"./bin/js2coffee"},dependencies:{escodegen:"^1.6.0",esprima:"^2.4.0",estraverse:"^1.9.1",minimist:"^1.1.0","read-input":"^0.2.0","source-map":"^0.1.38"},devDependencies:{browserify:"^5.10.1",chai:"^1.9.1","coffee-script":"^1.8.0",coffeeify:"^1.0.0",coffeelint:"^1.6.0",glob:"^4.0.5","js-yaml":"^3.2.1",mocha:"^2.1.0","mocha-clean":"^0.4.0","uglify-js":"^2.4.16",underscore:"^1.7.0"}}},{}]},{},[1])(1)}); \ No newline at end of file From 4ab660cf87db8fb6d55a78538aa3bff165feaf37 Mon Sep 17 00:00:00 2001 From: Dinuka Date: Mon, 10 Aug 2015 21:55:01 +0530 Subject: [PATCH 2/5] Changes to auto reflect the code once the language settings are updated --- content/src/controller.js | 24 ++++++++++++++++++++- content/src/view.js | 44 +++++++++------------------------------ 2 files changed, 33 insertions(+), 35 deletions(-) diff --git a/content/src/controller.js b/content/src/controller.js index d7c481f7..c33fd2de 100644 --- a/content/src/controller.js +++ b/content/src/controller.js @@ -14,7 +14,8 @@ var $ = require('jquery'), pencilTracer = require('pencil-tracer'), icedCoffeeScript = require('iced-coffee-script'), drawProtractor = require('draw-protractor'), - cache = require('cache'); + js2coffee = require('js2coffee'), + cache = require('cache'); eval(see.scope('controller')); @@ -1929,6 +1930,27 @@ function createNewFileIntoPosition(position, filename, text, meta) { } +function changeEditorLanguage(pane, lang) { + var mpp = model.pane[pane]; + var text = view.getPaneEditorData(pane).data; + + try{ + var result; + if(lang == 'text/javascript') { + result = icedCoffeeScript.compile(text, {bare: true}); + } else if(lang == 'text/coffeescript') { + result = js2coffee.build(text).code; + } + view.changePaneEditorText(pane, result); + } catch(err) { + } + +} + +view.on('editorLanguageChanged', function(pane, lang) { + changeEditorLanguage(pane, lang); +}); + function loadFileIntoPosition(position, filename, isdir, forcenet, cb) { var pane = paneatpos(position); var mpp = model.pane[pane]; diff --git a/content/src/view.js b/content/src/view.js index 76e2888f..ec6947ec 100644 --- a/content/src/view.js +++ b/content/src/view.js @@ -2194,44 +2194,15 @@ function changeEditorText(paneState, text) { if (text.length && text.charAt(text.length - 1) != '\n') { text += '\n'; } - paneState.changeHandler.suppressChange = true; - var saved = {}, editor = paneState.editor, session = editor.session; - saved.selection = session.selection.toJSON() - saved.atend = session.selection.getCursor().row >= session.getLength() - 1; - saved.folds = session.getAllFolds().map(function(fold) { - return { - start : fold.start, - end : fold.end, - placeholder : fold.placeholder - }; - }); - saved.scrollTop = session.getScrollTop() - saved.scrollLeft = session.getScrollLeft() + var editor = paneState.editor, session = editor.session; + + session.changeHandler.suppressChange = true; // Now set the text and restore everything. session.setValue(text); - session.selection.fromJSON(saved.selection); - try { - saved.folds.forEach(function(fold){ - session.addFold(fold.placeholder, - ace.require('ace/range').Range.fromPoints(fold.start, fold.end)); - }); - } catch(e) { } - - session.setScrollTop(saved.scrollTop); - session.setScrollLeft(saved.scrollLeft); - - // If the cursor used to be at the end, keep it at the end. - if (session.selection.isEmpty() && saved.atend) { - session.selection.moveCursorTo(session.getLength() - 1, 0); - } - - // TODO: detect the case where some text is added and we should - // scroll down to make the changes visible. - - paneState.changeHandler.suppressChange = false; - paneState.changeHandler(); + session.changeHandler.suppressChange = false; + session.changeHandler(); } function editorMimeType(paneState) { @@ -2632,6 +2603,7 @@ function setupAceEditor(pane, elt, editor, mode, text) { // Publish the update event for hosting frame. if (hasSubscribers()) publish('update', [session.getValue()]); }); + editor.getSession().changeHandler = changeHandler; $(elt).data('changeHandler', changeHandler); editor.getSession().on('change', changeHandler); // Fold any blocks with a line that ends with "# fold" or "// fold" @@ -2718,6 +2690,10 @@ function setPaneEditorLanguageType(pane, type) { paneState.dropletEditor.setMode( dropletModeForMimeType(type), dropletOptionsForMimeType(type)); + + //Modify the code to the changed language + fireEvent('editorLanguageChanged',[pane,type]); + paneState.editor.getSession().setMode(modeForMimeType(type)); paneState.meta = filetype.effectiveMeta(paneState.meta); paneState.meta.type = type; From ce060c8d2dbc85fd8e20778b71c93c7d85332dca Mon Sep 17 00:00:00 2001 From: Dinuka Date: Mon, 10 Aug 2015 21:56:08 +0530 Subject: [PATCH 3/5] js2coffee module was added --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 13c918f1..25bd60e6 100644 --- a/package.json +++ b/package.json @@ -69,6 +69,7 @@ "html2canvas": "./content/lib/html2canvas.js", "iced-coffee-script": "./content/lib/iced-coffee-script.js", "jquery": "./content/lib/jquery.js", + "js2coffee": "./content/lib/js2coffee.js", "palette": "./content/src/palette.js", "pencil-tracer": "./content/lib/pencil-tracer.js", "see": "./content/lib/see.js", From 4391a0c8d02f76984bf898862ff7e390cc56c8ab Mon Sep 17 00:00:00 2001 From: Dinuka Date: Mon, 10 Aug 2015 21:56:49 +0530 Subject: [PATCH 4/5] js2coffee bower package was added --- bower.json | 1 + 1 file changed, 1 insertion(+) diff --git a/bower.json b/bower.json index 2770be99..107fa92d 100644 --- a/bower.json +++ b/bower.json @@ -14,6 +14,7 @@ "jquery": "latest", "jquery-deparam": "latest", "jquery-turtle": "PencilCode/jquery-turtle#master", + "js2coffee": "js2coffee/js2coffee#master", "lodash": "latest", "p5": "https://github.com/processing/p5.js/releases/download/0.4.6/p5.js", "pencil-tracer": "yjerem/pencil-tracer#master", From 1ec460a70ddd787b354f331a32d52be92c7738f6 Mon Sep 17 00:00:00 2001 From: Dinuka Date: Mon, 10 Aug 2015 21:57:19 +0530 Subject: [PATCH 5/5] js2coffee.js file was mapped to the build --- Gruntfile.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Gruntfile.js b/Gruntfile.js index 7374616e..04dda94f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -35,6 +35,7 @@ module.exports = function(grunt) { 'devbridge-autocomplete/dist/jquery.autocomplete.min.js', 'lib/jquery-deparam.js' : 'jquery-deparam/jquery-deparam.js', 'lib/jquery-turtle.js': 'jquery-turtle/jquery-turtle.js', + 'lib/js2coffee.js': 'js2coffee/dist/js2coffee.js', 'lib/lodash.js': 'lodash/dist/lodash.js', 'lib/p5.js': 'p5/index.js', 'lib/pencil-tracer.js': 'pencil-tracer/pencil-tracer.js', @@ -105,6 +106,7 @@ module.exports = function(grunt) { 'content/lib/iced-coffee-script.js', 'content/lib/jquery.js', 'content/lib/jquery-turtle.js', + 'content/lib/js2coffee.js', 'content/lib/lodash.js', 'content/lib/seedrandom.js', 'content/lib/socket.io.js', @@ -154,6 +156,7 @@ module.exports = function(grunt) { 'content/lib/iced-coffee-script.js', 'content/lib/jquery.js', 'content/lib/jquery-turtle.js', + 'content/lib/js2coffee.js', 'content/lib/lodash.js', 'content/lib/seedrandom.js', 'content/lib/socket.io.js',