@dabapps/roe
Version:
A Collection of React Components for Project Development
1 lines • 1.61 MB
JavaScript
!function(e){var t=window.webpackJsonp;window.webpackJsonp=function webpackJsonpCallback(n,r,i){for(var s,o,l=0,d=[];l<n.length;l++)o=n[l],a[o]&&d.push(a[o][0]),a[o]=0;for(s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s]);for(t&&t(n,r,i);d.length;)d.shift()()};var n={},a={1:0};function __webpack_require__(t){if(n[t])return n[t].exports;var a=n[t]={i:t,l:!1,exports:{}};return e[t].call(a.exports,a,a.exports,__webpack_require__),a.l=!0,a.exports}__webpack_require__.e=function requireEnsure(e){var t=a[e];if(0===t)return new Promise(function(e){e()});if(t)return t[2];var n=new Promise(function(n,r){t=a[e]=[n,r]});t[2]=n;var r=document.getElementsByTagName("head")[0],i=document.createElement("script");i.type="text/javascript",i.charset="utf-8",i.async=!0,i.timeout=12e4,__webpack_require__.nc&&i.setAttribute("nonce",__webpack_require__.nc),i.src=__webpack_require__.p+"build/"+({}[e]||e)+"."+{0:"1fb12623"}[e]+".js";var s=setTimeout(onScriptComplete,12e4);function onScriptComplete(){i.onerror=i.onload=null,clearTimeout(s);var t=a[e];0!==t&&(t&&t[1](new Error("Loading chunk "+e+" failed.")),a[e]=void 0)}return i.onerror=i.onload=onScriptComplete,r.appendChild(i),n},__webpack_require__.m=e,__webpack_require__.c=n,__webpack_require__.d=function(e,t,n){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},__webpack_require__.n=function(e){var t=e&&e.__esModule?function getDefault(){return e.default}:function getModuleExports(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="",__webpack_require__.oe=function(e){throw console.error(e),e},__webpack_require__(__webpack_require__.s=0)}({"./docs/components/logo.js":function(e,t,n){"use strict";var a=n("./node_modules/react/react.js"),r=n("./node_modules/react-styleguidist/lib/rsg-components/Styled/index.js").default;e.exports=r(function styles(e){return{image:{fontFamily:e.fontFamily.base,width:63,height:24,display:"block"}}})(function Logo(e){return a.createElement("a",{href:"#"},a.createElement("img",{src:"images/roe-logo-small.png",alt:"Roe Logo",className:e.classes.image}))})},"./docs/less/index.less":function(e,t,n){var a=n('./node_modules/css-loader/index.js!./node_modules/postcss-loader/lib/index.js!./node_modules/less-loader/dist/cjs.js?{"paths":["/Users/jake/code/roe/node_modules"]}!./docs/less/index.less');"string"==typeof a&&(a=[[e.i,a,""]]);var r={hmr:!0,transform:void 0};n("./node_modules/style-loader/lib/addStyles.js")(a,r);a.locals&&(e.exports=a.locals)},"./node_modules/bail/index.js":function(e,t,n){"use strict";e.exports=function bail(e){if(e)throw e}},"./node_modules/base64-js/index.js":function(e,t,n){"use strict";t.byteLength=function byteLength(e){var t=getLens(e),n=t[0],a=t[1];return 3*(n+a)/4-a},t.toByteArray=function toByteArray(e){for(var t,n=getLens(e),a=n[0],s=n[1],o=new i(function _byteLength(e,t,n){return 3*(t+n)/4-n}(0,a,s)),l=0,d=s>0?a-4:a,u=0;u<d;u+=4)t=r[e.charCodeAt(u)]<<18|r[e.charCodeAt(u+1)]<<12|r[e.charCodeAt(u+2)]<<6|r[e.charCodeAt(u+3)],o[l++]=t>>16&255,o[l++]=t>>8&255,o[l++]=255&t;2===s&&(t=r[e.charCodeAt(u)]<<2|r[e.charCodeAt(u+1)]>>4,o[l++]=255&t);1===s&&(t=r[e.charCodeAt(u)]<<10|r[e.charCodeAt(u+1)]<<4|r[e.charCodeAt(u+2)]>>2,o[l++]=t>>8&255,o[l++]=255&t);return o},t.fromByteArray=function fromByteArray(e){for(var t,n=e.length,r=n%3,i=[],s=0,o=n-r;s<o;s+=16383)i.push(encodeChunk(e,s,s+16383>o?o:s+16383));1===r?(t=e[n-1],i.push(a[t>>2]+a[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],i.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"="));return i.join("")};for(var a=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,l=s.length;o<l;++o)a[o]=s[o],r[s.charCodeAt(o)]=o;function getLens(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function encodeChunk(e,t,n){for(var r,i,s=[],o=t;o<n;o+=3)r=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),s.push(a[(i=r)>>18&63]+a[i>>12&63]+a[i>>6&63]+a[63&i]);return s.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},"./node_modules/buble/dist/buble.umd.js":function(e,t,n){(function(e){var a;(function(t,r,i){"use strict";r="default"in r?r.default:r,i="default"in i?i.default:i;var s="undefined"!=typeof window?window:void 0!==e?e:this;function __commonjs(e,t){return e(t={exports:{}},t.exports,s),t.exports}var o=__commonjs(function(e){e.exports={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}}),l=o&&"object"==typeof o&&"default"in o?o.default:o,d=__commonjs(function(e){var t=l,n=/^[\da-fA-F]+$/,a=/^\d+$/;e.exports=function(e){var r=e.tokTypes,i=e.tokContexts;i.j_oTag=new e.TokContext("<tag",!1),i.j_cTag=new e.TokContext("</tag",!1),i.j_expr=new e.TokContext("<tag>...</tag>",!0,!0),r.jsxName=new e.TokenType("jsxName"),r.jsxText=new e.TokenType("jsxText",{beforeExpr:!0}),r.jsxTagStart=new e.TokenType("jsxTagStart"),r.jsxTagEnd=new e.TokenType("jsxTagEnd"),r.jsxTagStart.updateContext=function(){this.context.push(i.j_expr),this.context.push(i.j_oTag),this.exprAllowed=!1},r.jsxTagEnd.updateContext=function(e){var t=this.context.pop();t===i.j_oTag&&e===r.slash||t===i.j_cTag?(this.context.pop(),this.exprAllowed=this.curContext()===i.j_expr):this.exprAllowed=!0};var s=e.Parser.prototype;function getQualifiedJSXName(e){return"JSXIdentifier"===e.type?e.name:"JSXNamespacedName"===e.type?e.namespace.name+":"+e.name.name:"JSXMemberExpression"===e.type?getQualifiedJSXName(e.object)+"."+getQualifiedJSXName(e.property):void 0}return s.jsx_readToken=function(){for(var t="",n=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated JSX contents");var a=this.input.charCodeAt(this.pos);switch(a){case 60:case 123:return this.pos===this.start?60===a&&this.exprAllowed?(++this.pos,this.finishToken(r.jsxTagStart)):this.getTokenFromCode(a):(t+=this.input.slice(n,this.pos),this.finishToken(r.jsxText,t));case 38:t+=this.input.slice(n,this.pos),t+=this.jsx_readEntity(),n=this.pos;break;default:e.isNewLine(a)?(t+=this.input.slice(n,this.pos),t+=this.jsx_readNewLine(!0),n=this.pos):++this.pos}}},s.jsx_readNewLine=function(e){var t,n=this.input.charCodeAt(this.pos);return++this.pos,13===n&&10===this.input.charCodeAt(this.pos)?(++this.pos,t=e?"\n":"\r\n"):t=String.fromCharCode(n),this.options.locations&&(++this.curLine,this.lineStart=this.pos),t},s.jsx_readString=function(t){for(var n="",a=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var i=this.input.charCodeAt(this.pos);if(i===t)break;38===i?(n+=this.input.slice(a,this.pos),n+=this.jsx_readEntity(),a=this.pos):e.isNewLine(i)?(n+=this.input.slice(a,this.pos),n+=this.jsx_readNewLine(!1),a=this.pos):++this.pos}return n+=this.input.slice(a,this.pos++),this.finishToken(r.string,n)},s.jsx_readEntity=function(){var e,r="",i=0,s=this.input[this.pos];"&"!==s&&this.raise(this.pos,"Entity must start with an ampersand");for(var o=++this.pos;this.pos<this.input.length&&i++<10;){if(";"===(s=this.input[this.pos++])){"#"===r[0]?"x"===r[1]?(r=r.substr(2),n.test(r)&&(e=String.fromCharCode(parseInt(r,16)))):(r=r.substr(1),a.test(r)&&(e=String.fromCharCode(parseInt(r,10)))):e=t[r];break}r+=s}return e||(this.pos=o,"&")},s.jsx_readWord=function(){var t,n=this.pos;do{t=this.input.charCodeAt(++this.pos)}while(e.isIdentifierChar(t)||45===t);return this.finishToken(r.jsxName,this.input.slice(n,this.pos))},s.jsx_parseIdentifier=function(){var e=this.startNode();return this.type===r.jsxName?e.name=this.value:this.type.keyword?e.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(e,"JSXIdentifier")},s.jsx_parseNamespacedName=function(){var e=this.start,t=this.startLoc,n=this.jsx_parseIdentifier();if(!this.options.plugins.jsx.allowNamespaces||!this.eat(r.colon))return n;var a=this.startNodeAt(e,t);return a.namespace=n,a.name=this.jsx_parseIdentifier(),this.finishNode(a,"JSXNamespacedName")},s.jsx_parseElementName=function(){var e=this.start,t=this.startLoc,n=this.jsx_parseNamespacedName();for(this.type!==r.dot||"JSXNamespacedName"!==n.type||this.options.plugins.jsx.allowNamespacedObjects||this.unexpected();this.eat(r.dot);){var a=this.startNodeAt(e,t);a.object=n,a.property=this.jsx_parseIdentifier(),n=this.finishNode(a,"JSXMemberExpression")}return n},s.jsx_parseAttributeValue=function(){switch(this.type){case r.braceL:var e=this.jsx_parseExpressionContainer();return"JSXEmptyExpression"===e.expression.type&&this.raise(e.start,"JSX attributes must only be assigned a non-empty expression"),e;case r.jsxTagStart:case r.string:return this.parseExprAtom();default:this.raise(this.start,"JSX value should be either an expression or a quoted JSX text")}},s.jsx_parseEmptyExpression=function(){var e=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(e,"JSXEmptyExpression",this.start,this.startLoc)},s.jsx_parseExpressionContainer=function(){var e=this.startNode();return this.next(),e.expression=this.type===r.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(r.braceR),this.finishNode(e,"JSXExpressionContainer")},s.jsx_parseAttribute=function(){var e=this.startNode();return this.eat(r.braceL)?(this.expect(r.ellipsis),e.argument=this.parseMaybeAssign(),this.expect(r.braceR),this.finishNode(e,"JSXSpreadAttribute")):(e.name=this.jsx_parseNamespacedName(),e.value=this.eat(r.eq)?this.jsx_parseAttributeValue():null,this.finishNode(e,"JSXAttribute"))},s.jsx_parseOpeningElementAt=function(e,t){var n=this.startNodeAt(e,t);for(n.attributes=[],n.name=this.jsx_parseElementName();this.type!==r.slash&&this.type!==r.jsxTagEnd;)n.attributes.push(this.jsx_parseAttribute());return n.selfClosing=this.eat(r.slash),this.expect(r.jsxTagEnd),this.finishNode(n,"JSXOpeningElement")},s.jsx_parseClosingElementAt=function(e,t){var n=this.startNodeAt(e,t);return n.name=this.jsx_parseElementName(),this.expect(r.jsxTagEnd),this.finishNode(n,"JSXClosingElement")},s.jsx_parseElementAt=function(e,t){var n=this.startNodeAt(e,t),a=[],i=this.jsx_parseOpeningElementAt(e,t),s=null;if(!i.selfClosing){e:for(;;)switch(this.type){case r.jsxTagStart:if(e=this.start,t=this.startLoc,this.next(),this.eat(r.slash)){s=this.jsx_parseClosingElementAt(e,t);break e}a.push(this.jsx_parseElementAt(e,t));break;case r.jsxText:a.push(this.parseExprAtom());break;case r.braceL:a.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}getQualifiedJSXName(s.name)!==getQualifiedJSXName(i.name)&&this.raise(s.start,"Expected corresponding JSX closing tag for <"+getQualifiedJSXName(i.name)+">")}return n.openingElement=i,n.closingElement=s,n.children=a,this.type===r.relational&&"<"===this.value&&this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag"),this.finishNode(n,"JSXElement")},s.jsx_parseElement=function(){var e=this.start,t=this.startLoc;return this.next(),this.jsx_parseElementAt(e,t)},e.plugins.jsx=function(t,n){n&&("object"!=typeof n&&(n={}),t.options.plugins.jsx={allowNamespaces:!1!==n.allowNamespaces,allowNamespacedObjects:!!n.allowNamespacedObjects},t.extend("parseExprAtom",function(e){return function(t){return this.type===r.jsxText?this.parseLiteral(this.value):this.type===r.jsxTagStart?this.jsx_parseElement():e.call(this,t)}}),t.extend("readToken",function(t){return function(n){var a=this.curContext();if(a===i.j_expr)return this.jsx_readToken();if(a===i.j_oTag||a===i.j_cTag){if(e.isIdentifierStart(n))return this.jsx_readWord();if(62==n)return++this.pos,this.finishToken(r.jsxTagEnd);if((34===n||39===n)&&a==i.j_oTag)return this.jsx_readString(n)}return 60===n&&this.exprAllowed?(++this.pos,this.finishToken(r.jsxTagStart)):t.call(this,n)}}),t.extend("updateContext",function(e){return function(t){if(this.type==r.braceL){var n=this.curContext();n==i.j_oTag?this.context.push(i.b_expr):n==i.j_expr?this.context.push(i.b_tmpl):e.call(this,t),this.exprAllowed=!0}else{if(this.type!==r.slash||t!==r.jsxTagStart)return e.call(this,t);this.context.length-=2,this.context.push(i.j_cTag),this.exprAllowed=!1}}}))},e}}),u=d&&"object"==typeof d&&"default"in d?d.default:d,c=__commonjs(function(e){e.exports=function(e){var t=e.tokTypes,n=e.Parser.prototype;function parseObj(e,n){var a=this.startNode(),r=!0,i={};for(a.properties=[],this.next();!this.eat(t.braceR);){if(r)r=!1;else if(this.expect(t.comma),this.afterTrailingComma(t.braceR))break;var s,o,l,d=this.startNode();if(this.options.ecmaVersion>=6){if(this.type===t.ellipsis){(d=this.parseSpread()).type=e?"RestProperty":"SpreadProperty",a.properties.push(d);continue}d.method=!1,d.shorthand=!1,(e||n)&&(o=this.start,l=this.startLoc),e||(s=this.eat(t.star))}this.parsePropertyName(d),this.parsePropertyValue(d,e,s,o,l,n),this.checkPropClash(d,i),a.properties.push(this.finishNode(d,"Property"))}return this.finishNode(a,e?"ObjectPattern":"ObjectExpression")}return e.plugins.objectSpread=function objectSpreadPlugin(e){n.parseObj=parseObj},e}}),p=c&&"object"==typeof c&&"default"in c?c.default:c,m={Program:["body"],Literal:[]};function toJSON(e){var t={};return Object.keys(e).forEach(function(n){"parent"!==n&&"program"!==n&&"keys"!==n&&"__wrapped"!==n&&(Array.isArray(e[n])?t[n]=e[n].map(toJSON):e[n]&&e[n].toJSON?t[n]=e[n].toJSON():t[n]=e[n])}),t}var f=function Node(e,t){e.parent=t,e.program=t.program||t,e.depth=t.depth+1,e.keys=m[e.type],e.indentation=void 0;for(var n=0,a=m[e.type];n<a.length;n+=1){wrap(e[a[n]],e)}e.program.magicString.addSourcemapLocation(e.start),e.program.magicString.addSourcemapLocation(e.end)};function isArguments(e){return"Identifier"===e.type&&"arguments"===e.name}function spread(e,t,n,a,r){for(var i=t.length,s=-1;i--;){var o=t[i];o&&"SpreadElement"===o.type&&(isArguments(o.argument)&&e.overwrite(o.argument.start,o.argument.end,a),s=i)}if(-1===s)return!1;if(r){for(i=0;i<t.length;i+=1){var l=t[i];"SpreadElement"===l.type?e.remove(l.start,l.argument.start):(e.insertRight(l.start,"["),e.insertRight(l.end,"]"))}return!0}var d=t[s],u=t[s-1];for(u?e.overwrite(u.end,d.start," ].concat( "):(e.remove(n,d.start),e.overwrite(d.end,t[1].start,".concat( ")),i=s;i<t.length;i+=1)(d=t[i])&&("SpreadElement"===d.type?e.remove(d.start,d.argument.start):(e.insertLeft(d.start,"["),e.insertLeft(d.end,"]")));return!0}f.prototype.ancestor=function ancestor(e){for(var t=this;e--;)if(!(t=t.parent))return null;return t},f.prototype.contains=function contains(e){for(;e;){if(e===this)return!0;e=e.parent}return!1},f.prototype.findLexicalBoundary=function findLexicalBoundary(){return this.parent.findLexicalBoundary()},f.prototype.findNearest=function findNearest(e){return"string"==typeof e&&(e=new RegExp("^"+e+"$")),e.test(this.type)?this:this.parent.findNearest(e)},f.prototype.unparenthesizedParent=function unparenthesizedParent(){for(var e=this.parent;e&&"ParenthesizedExpression"===e.type;)e=e.parent;return e},f.prototype.unparenthesize=function unparenthesize(){for(var e=this;"ParenthesizedExpression"===e.type;)e=e.expression;return e},f.prototype.findScope=function findScope(e){return this.parent.findScope(e)},f.prototype.getIndentation=function getIndentation(){return this.parent.getIndentation()},f.prototype.initialise=function initialise(e){for(var t=0,n=this.keys;t<n.length;t+=1){var a=this[n[t]];Array.isArray(a)?a.forEach(function(t){return t&&t.initialise(e)}):a&&"object"==typeof a&&a.initialise(e)}},f.prototype.toJSON=function toJSON$1(){return toJSON(this)},f.prototype.toString=function toString(){return this.program.magicString.original.slice(this.start,this.end)},f.prototype.transpile=function transpile(e,t){for(var n=0,a=this.keys;n<a.length;n+=1){var r=this[a[n]];Array.isArray(r)?r.forEach(function(n){return n&&n.transpile(e,t)}):r&&"object"==typeof r&&r.transpile(e,t)}};var h=function(e){function ArrayExpression(){e.apply(this,arguments)}return e&&(ArrayExpression.__proto__=e),ArrayExpression.prototype=Object.create(e&&e.prototype),ArrayExpression.prototype.constructor=ArrayExpression,ArrayExpression.prototype.initialise=function initialise(t){if(t.spreadRest&&this.elements.length)for(var n=this.findLexicalBoundary(),a=this.elements.length;a--;){var r=this.elements[a];r&&"SpreadElement"===r.type&&isArguments(r.argument)&&(this.argumentsArrayAlias=n.getArgumentsArrayAlias())}e.prototype.initialise.call(this,t)},ArrayExpression.prototype.transpile=function transpile(t,n){if(n.spreadRest){if(this.elements.length){var a=this.elements[this.elements.length-1];a&&/\s*,/.test(t.original.slice(a.end,this.end))&&t.overwrite(a.end,this.end-1," ")}if(1===this.elements.length){var r=this.elements[0];r&&"SpreadElement"===r.type&&(isArguments(r.argument)?t.overwrite(this.start,this.end,"[].concat( "+this.argumentsArrayAlias+" )"):(t.overwrite(this.start,r.argument.start,"[].concat( "),t.overwrite(r.end,this.end," )")))}else{spread(t,this.elements,this.start,this.argumentsArrayAlias)&&t.overwrite(this.end-1,this.end,")")}}e.prototype.transpile.call(this,t,n)},ArrayExpression}(f),b=function(e){function ArrowFunctionExpression(){e.apply(this,arguments)}return e&&(ArrowFunctionExpression.__proto__=e),ArrowFunctionExpression.prototype=Object.create(e&&e.prototype),ArrowFunctionExpression.prototype.constructor=ArrowFunctionExpression,ArrowFunctionExpression.prototype.initialise=function initialise(t){this.body.createScope(),e.prototype.initialise.call(this,t)},ArrowFunctionExpression.prototype.transpile=function transpile(t,n){if(n.arrow){for(var a=this.body.start;"="!==t.original[a];)a-=1;t.remove(a,this.body.start),1===this.params.length&&this.start===this.params[0].start&&(t.insertRight(this.params[0].start,"("),t.insertLeft(this.params[0].end,")")),this.parent&&"ExpressionStatement"===this.parent.type?(t.insertRight(this.start,"(function"),t.insertRight(this.end,")")):t.insertRight(this.start,"function ")}e.prototype.transpile.call(this,t,n)},ArrowFunctionExpression}(f);function locate(e,t){var n,a=e.split("\n"),r=a.length,i=0;for(n=0;n<r;n+=1){var s=i+a[n].length+1;if(s>t)return{line:n+1,column:t-i,char:n};i=s}throw new Error("Could not determine location of character")}function repeat(e,t){for(var n="";t--;)n+=e;return n}function getSnippet(e,t,n){void 0===n&&(n=1);var a=Math.max(t.line-5,0),r=t.line,i=String(r).length,s=e.split("\n").slice(a,r),o=s[s.length-1].slice(0,t.column).replace(/\t/g," ").length,l=s.map(function(e,t){return function pad(e,t){var n=String(e);return n+repeat(" ",t-n.length)}(t+a+1,i)+" : "+e.replace(/\t/g," ")}).join("\n");return l+="\n"+repeat(" ",i+3+o)+repeat("^",n)}var g=function(e){function CompileError(t,n){e.call(this);var a=t.program.magicString.original,r=locate(a,t.start);this.name="CompileError",this.message=n+" ("+r.line+":"+r.column+")",this.stack=(new e).stack.replace(new RegExp(".+new "+this.name+".+\\n","m"),""),this.loc=r,this.snippet=getSnippet(a,r,t.end-t.start)}return e&&(CompileError.__proto__=e),CompileError.prototype=Object.create(e&&e.prototype),CompileError.prototype.constructor=CompileError,CompileError.prototype.toString=function toString(){return this.name+": "+this.message+"\n"+this.snippet},CompileError}(Error),y=function(e){function AssignmentExpression(){e.apply(this,arguments)}return e&&(AssignmentExpression.__proto__=e),AssignmentExpression.prototype=Object.create(e&&e.prototype),AssignmentExpression.prototype.constructor=AssignmentExpression,AssignmentExpression.prototype.initialise=function initialise(t){if("Identifier"===this.left.type){var n=this.findScope(!1).findDeclaration(this.left.name);if(n&&"const"===n.kind)throw new g(this.left,this.left.name+" is read-only");var a=n&&n.node.ancestor(3);a&&"ForStatement"===a.type&&a.body.contains(this)&&(a.reassigned[this.left.name]=!0)}e.prototype.initialise.call(this,t)},AssignmentExpression.prototype.transpile=function transpile(t,n){"**="===this.operator&&n.exponentiation?this.transpileExponentiation(t,n):/Pattern/.test(this.left.type)&&n.destructuring&&this.transpileDestructuring(t,n),e.prototype.transpile.call(this,t,n)},AssignmentExpression.prototype.transpileDestructuring=function transpileDestructuring(e){var t=this.findScope(!0),n=t.createIdentifier("assign"),a=[n],r=this.start,i="";function use(t){e.insertRight(t.start,i),e.move(t.start,t.end,r),i=""}function write(e){i+=e}write("("+n+" = "),use(this.right),function destructure(n,r,i){if("Identifier"===n.type||"MemberExpression"===n.type)write(", "),use(n),write(" = "+r);else if("AssignmentPattern"===n.type)if("Identifier"===n.left.type){var s=n.left.name,o=r;i||(write(", "+s+" = "+r),o=s),write(", "+s+" = "+o+" === void 0 ? "),use(n.right),write(" : "+o)}else{var l=t.createIdentifier("temp"),d=r;a.push(l),i||(write(", "+l+" = "+r),d=l),write(", "+l+" = "+d+" === void 0 ? "),use(n.right),write(" : "+d),destructure(n.left,l,!0)}else if("ArrayPattern"===n.type){var u=n.elements;if(1===u.length)destructure(u[0],r+"[0]",!1);else{if(!i){var c=t.createIdentifier("array");a.push(c),write(", "+c+" = "+r),r=c}u.forEach(function(e,t){e&&("RestElement"===e.type?destructure(e.argument,r+".slice("+t+")",!1):destructure(e,r+"["+t+"]",!1))})}}else{if("ObjectPattern"!==n.type)throw new Error("Unexpected node type in destructuring assignment ("+n.type+")");var p=n.properties;if(1==p.length){var m=p[0],f=m.computed||"Identifier"!==m.key.type?r+"["+e.slice(m.key.start,m.key.end)+"]":r+"."+m.key.name;destructure(m.value,f,!1)}else{if(!i){var h=t.createIdentifier("obj");a.push(h),write(", "+h+" = "+r),r=h}p.forEach(function(t){var n=t.computed||"Identifier"!==t.key.type?r+"["+e.slice(t.key.start,t.key.end)+"]":r+"."+t.key.name;destructure(t.value,n,!1)})}}}(this.left,n,!0),"ExpressionStatement"===this.unparenthesizedParent().type?e.insertRight(r,i+")"):e.insertRight(r,i+", "+n+")"),e.remove(r,this.right.start);var s=this.findNearest(/(?:Statement|Declaration)$/);e.insertLeft(s.start,"var "+a.join(", ")+";\n"+s.getIndentation())},AssignmentExpression.prototype.transpileExponentiation=function transpileExponentiation(e){for(var t,n=this.findScope(!1),a=function(e){var t=n.findDeclaration(e);return t?t.name:e},r=this.left.end;"*"!==e.original[r];)r+=1;e.remove(r,r+2);var i=this.left.unparenthesize();if("Identifier"===i.type)t=a(i.name);else if("MemberExpression"===i.type){var s,o,l=!1,d=!1,u=this.findNearest(/(?:Statement|Declaration)$/),c=u.getIndentation();if("Identifier"===i.property.type?o=i.computed?a(i.property.name):i.property.name:(o=n.createIdentifier("property"),d=!0),"Identifier"===i.object.type?s=a(i.object.name):(s=n.createIdentifier("object"),l=!0),i.start===u.start)l&&d?(e.insertRight(u.start,"var "+s+" = "),e.overwrite(i.object.end,i.property.start,";\n"+c+"var "+o+" = "),e.overwrite(i.property.end,i.end,";\n"+c+s+"["+o+"]")):l?(e.insertRight(u.start,"var "+s+" = "),e.insertLeft(i.object.end,";\n"+c),e.insertLeft(i.object.end,s)):d&&(e.insertRight(i.property.start,"var "+o+" = "),e.insertLeft(i.property.end,";\n"+c),e.move(i.property.start,i.property.end,this.start),e.insertLeft(i.object.end,"["+o+"]"),e.remove(i.object.end,i.property.start),e.remove(i.property.end,i.end));else{var p=[];l&&p.push(s),d&&p.push(o),p.length&&e.insertRight(u.start,"var "+p.join(", ")+";\n"+c),l&&d?(e.insertRight(i.start,"( "+s+" = "),e.overwrite(i.object.end,i.property.start,", "+o+" = "),e.overwrite(i.property.end,i.end,", "+s+"["+o+"]")):l?(e.insertRight(i.start,"( "+s+" = "),e.insertLeft(i.object.end,", "+s)):d&&(e.insertRight(i.property.start,"( "+o+" = "),e.insertLeft(i.property.end,", "),e.move(i.property.start,i.property.end,i.start),e.overwrite(i.object.end,i.property.start,"["+o+"]"),e.remove(i.property.end,i.end)),d&&e.insertLeft(this.end," )")}t=s+(i.computed||d?"["+o+"]":"."+o)}e.insertRight(this.right.start,"Math.pow( "+t+", "),e.insertLeft(this.right.end," )")},AssignmentExpression}(f),v=function(e){function BinaryExpression(){e.apply(this,arguments)}return e&&(BinaryExpression.__proto__=e),BinaryExpression.prototype=Object.create(e&&e.prototype),BinaryExpression.prototype.constructor=BinaryExpression,BinaryExpression.prototype.transpile=function transpile(t,n){"**"===this.operator&&n.exponentiation&&(t.insertRight(this.start,"Math.pow( "),t.overwrite(this.left.end,this.right.start,", "),t.insertLeft(this.end," )")),e.prototype.transpile.call(this,t,n)},BinaryExpression}(f),x=/(?:For(?:In|Of)?|While)Statement/,w=function(e){function BreakStatement(){e.apply(this,arguments)}return e&&(BreakStatement.__proto__=e),BreakStatement.prototype=Object.create(e&&e.prototype),BreakStatement.prototype.constructor=BreakStatement,BreakStatement.prototype.initialise=function initialise(){var e=this.findNearest(x),t=this.findNearest("SwitchCase");e&&(!t||e.depth>t.depth)&&(e.canBreak=!0,this.loop=e)},BreakStatement.prototype.transpile=function transpile(e){if(this.loop&&this.loop.shouldRewriteAsFunction){if(this.label)throw new g(this,"Labels are not currently supported in a loop with locally-scoped variables");e.overwrite(this.start,this.start+5,"return 'break'")}},BreakStatement}(f),_=function(e){function CallExpression(){e.apply(this,arguments)}return e&&(CallExpression.__proto__=e),CallExpression.prototype=Object.create(e&&e.prototype),CallExpression.prototype.constructor=CallExpression,CallExpression.prototype.initialise=function initialise(t){if(t.spreadRest&&this.arguments.length>1)for(var n=this.findLexicalBoundary(),a=this.arguments.length;a--;){var r=this.arguments[a];"SpreadElement"===r.type&&isArguments(r.argument)&&(this.argumentsArrayAlias=n.getArgumentsArrayAlias())}e.prototype.initialise.call(this,t)},CallExpression.prototype.transpile=function transpile(t,n){if(n.spreadRest&&this.arguments.length){var a,r=!1,i=this.arguments[0];if(1===this.arguments.length?"SpreadElement"===i.type&&(t.remove(i.start,i.argument.start),r=!0):r=spread(t,this.arguments,i.start,this.argumentsArrayAlias),r){var s=null;if("Super"===this.callee.type?s=this.callee:"MemberExpression"===this.callee.type&&"Super"===this.callee.object.type&&(s=this.callee.object),s||"MemberExpression"!==this.callee.type)a="void 0";else if("Identifier"===this.callee.object.type)a=this.callee.object.name;else{a=this.findScope(!0).createIdentifier("ref");var o=this.callee.object,l=o.findNearest(/Function/),d=l?l.body.body:o.findNearest(/^Program$/).body,u=d[d.length-1],c=u.getIndentation();t.insertRight(o.start,"("+a+" = "),t.insertLeft(o.end,")"),t.insertLeft(u.end,"\n"+c+"var "+a+";")}t.insertLeft(this.callee.end,".apply"),s?(s.noCall=!0,this.arguments.length>1&&("SpreadElement"!==i.type&&t.insertRight(i.start,"[ "),t.insertLeft(this.arguments[this.arguments.length-1].end," )"))):1===this.arguments.length?t.insertRight(i.start,a+", "):("SpreadElement"===i.type?t.insertLeft(i.start,a+", "):t.insertLeft(i.start,a+", [ "),t.insertLeft(this.arguments[this.arguments.length-1].end," )"))}}e.prototype.transpile.call(this,t,n)},CallExpression}(f);function findIndex(e,t){for(var n=0;n<e.length;n+=1)if(t(e[n],n))return n;return-1}var j=Object.create(null);"do if in for let new try var case else enum eval null this true void with await break catch class const false super throw while yield delete export import public return static switch typeof default extends finally package private continue debugger function arguments interface protected implements instanceof".split(" ").forEach(function(e){return j[e]=!0});var k=function(e){function ClassBody(){e.apply(this,arguments)}return e&&(ClassBody.__proto__=e),ClassBody.prototype=Object.create(e&&e.prototype),ClassBody.prototype.constructor=ClassBody,ClassBody.prototype.transpile=function transpile(t,n,a,r){var i=this;if(n.classes){var s=this.parent.name,o=t.getIndentString(),l=this.getIndentation()+(a?o:""),d=l+o,u=findIndex(this.body,function(e){return"constructor"===e.kind}),c=this.body[u],p="",m="";if(this.body.length?(t.remove(this.start,this.body[0].start),t.remove(this.body[this.body.length-1].end,this.end)):t.remove(this.start,this.end),c){c.value.body.isConstructorBody=!0;var f=this.body[u-1],h=this.body[u+1];u>0&&(t.remove(f.end,c.start),t.move(c.start,h?h.start:this.end-1,this.body[0].start)),a||t.insertLeft(c.end,";")}var b=!1!==this.program.options.namedFunctionExpressions,g=b||this.parent.superClass||"ClassDeclaration"!==this.parent.type;if(this.parent.superClass){var y="if ( "+r+" ) "+s+".__proto__ = "+r+";\n"+l+s+".prototype = Object.create( "+r+" && "+r+".prototype );\n"+l+s+".prototype.constructor = "+s+";";if(c)p+="\n\n"+l+y;else p+=(y="function "+s+" () {"+(r?"\n"+d+r+".apply(this, arguments);\n"+l+"}":"}")+(a?"":";")+(this.body.length?"\n\n"+l:"")+y)+"\n\n"+l}else if(!c){var v="function "+(g?s+" ":"")+"() {}";"ClassDeclaration"===this.parent.type&&(v+=";"),this.body.length&&(v+="\n\n"+l),p+=v}var x,w,_=this.findScope(!1),k=[],C=[];if(this.body.forEach(function(e,n){if("constructor"!==e.kind){if(e.static){var a=" "==t.original[e.start+6]?7:6;t.remove(e.start,e.start+a)}var r,o="method"!==e.kind,d=e.key.name;(j[d]||e.value.body.scope.references[d])&&(d=_.createIdentifier(d));var c=!1;if(e.computed||"Literal"!==e.key.type||(c=!0,e.computed=!0),o){if(e.computed)throw new Error("Computed accessor properties are not currently supported");t.remove(e.start,e.key.start),e.static?(~C.indexOf(e.key.name)||C.push(e.key.name),w||(w=_.createIdentifier("staticAccessors")),r=""+w):(~k.indexOf(e.key.name)||k.push(e.key.name),x||(x=_.createIdentifier("prototypeAccessors")),r=""+x)}else r=e.static?""+s:s+".prototype";e.computed||(r+="."),(u>0&&n===u+1||0===n&&u===i.body.length-1)&&(r="\n\n"+l+r);var p=e.key.end;if(e.computed)if(c)t.insertRight(e.key.start,"["),t.insertLeft(e.key.end,"]");else{for(;"]"!==t.original[p];)p+=1;p+=1}t.insertRight(e.start,r);var m=e.computed||o||!b?"":d+" ",f=(o?"."+e.kind:"")+" = function"+(e.value.generator?"* ":" ")+m;t.remove(p,e.value.start),t.insertRight(e.value.start,f),t.insertLeft(e.end,";"),e.value.generator&&t.remove(e.start,e.key.start)}else{var h=g?" "+s:"";t.overwrite(e.key.start,e.key.end,"function"+h)}}),k.length||C.length){var I=[],E=[];k.length&&(I.push("var "+x+" = { "+k.map(function(e){return e+": {}"}).join(",")+" };"),E.push("Object.defineProperties( "+s+".prototype, "+x+" );")),C.length&&(I.push("var "+w+" = { "+C.map(function(e){return e+": {}"}).join(",")+" };"),E.push("Object.defineProperties( "+s+", "+w+" );")),c&&(p+="\n\n"+l),p+=I.join("\n"+l),c||(p+="\n\n"+l),m+="\n\n"+l+E.join("\n"+l)}c?t.insertLeft(c.end,p):t.insertRight(this.start,p),t.insertLeft(this.end,m)}e.prototype.transpile.call(this,t,n)},ClassBody}(f);var C=function(e){function ClassDeclaration(){e.apply(this,arguments)}return e&&(ClassDeclaration.__proto__=e),ClassDeclaration.prototype=Object.create(e&&e.prototype),ClassDeclaration.prototype.constructor=ClassDeclaration,ClassDeclaration.prototype.initialise=function initialise(t){this.name=this.id.name,this.findScope(!0).addDeclaration(this.id,"class"),e.prototype.initialise.call(this,t)},ClassDeclaration.prototype.transpile=function transpile(e,t){if(t.classes){this.superClass||function deindent(e,t){var n=e.start,a=e.end,r=t.getIndentString(),i=r.length,s=n-i;e.program.indentExclusions[s]||t.original.slice(s,n)!==r||t.remove(s,n);for(var o,l=new RegExp(r+"\\S","g"),d=t.original.slice(n,a);o=l.exec(d);){var u=n+o.index;e.program.indentExclusions[u]||t.remove(u,u+i)}}(this.body,e);var n=this.superClass&&(this.superClass.name||"superclass"),a=this.getIndentation(),r=a+e.getIndentString(),i="ExportDefaultDeclaration"===this.parent.type?"\n\n"+a+"export default "+this.id.name+";":"";i&&e.remove(this.parent.start,this.start),e.overwrite(this.start,this.id.start,"var "),this.superClass?this.superClass.end===this.body.start?(e.remove(this.id.end,this.superClass.start),e.insertLeft(this.id.end," = (function ("+n+") {\n"+r)):(e.overwrite(this.id.end,this.superClass.start," = "),e.overwrite(this.superClass.end,this.body.start,"(function ("+n+") {\n"+r)):this.id.end===this.body.start?e.insertLeft(this.id.end," = "):e.overwrite(this.id.end,this.body.start," = "),this.body.transpile(e,t,!!this.superClass,n),this.superClass?(e.insertLeft(this.end,"\n\n"+r+"return "+this.name+";\n"+a+"}("),e.move(this.superClass.start,this.superClass.end,this.end),e.insertRight(this.end,"));"+i)):i&&e.insertRight(this.end,i)}else this.body.transpile(e,t,!1,null)},ClassDeclaration}(f),I=function(e){function ClassExpression(){e.apply(this,arguments)}return e&&(ClassExpression.__proto__=e),ClassExpression.prototype=Object.create(e&&e.prototype),ClassExpression.prototype.constructor=ClassExpression,ClassExpression.prototype.initialise=function initialise(t){this.name=this.id?this.id.name:"VariableDeclarator"===this.parent.type?this.parent.id.name:"AssignmentExpression"===this.parent.type?this.parent.left.name:this.findScope(!0).createIdentifier("anonymous"),e.prototype.initialise.call(this,t)},ClassExpression.prototype.transpile=function transpile(e,t){if(t.classes){var n=this.superClass&&(this.superClass.name||"superclass"),a=this.getIndentation(),r=a+e.getIndentString();this.superClass?(e.remove(this.start,this.superClass.start),e.remove(this.superClass.end,this.body.start),e.insertLeft(this.start,"(function ("+n+") {\n"+r)):e.overwrite(this.start,this.body.start,"(function () {\n"+r),this.body.transpile(e,t,!0,n);var i="\n\n"+r+"return "+this.name+";\n"+a+"}(";this.superClass?(e.insertLeft(this.end,i),e.move(this.superClass.start,this.superClass.end,this.end),e.insertRight(this.end,"))")):e.insertLeft(this.end,"\n\n"+r+"return "+this.name+";\n"+a+"}())")}else this.body.transpile(e,t,!1)},ClassExpression}(f),E=function(e){function ContinueStatement(){e.apply(this,arguments)}return e&&(ContinueStatement.__proto__=e),ContinueStatement.prototype=Object.create(e&&e.prototype),ContinueStatement.prototype.constructor=ContinueStatement,ContinueStatement.prototype.transpile=function transpile(e){if(this.findNearest(x).shouldRewriteAsFunction){if(this.label)throw new g(this,"Labels are not currently supported in a loop with locally-scoped variables");e.overwrite(this.start,this.start+8,"return")}},ContinueStatement}(f),D=function(e){function ExportDefaultDeclaration(){e.apply(this,arguments)}return e&&(ExportDefaultDeclaration.__proto__=e),ExportDefaultDeclaration.prototype=Object.create(e&&e.prototype),ExportDefaultDeclaration.prototype.constructor=ExportDefaultDeclaration,ExportDefaultDeclaration.prototype.initialise=function initialise(t){if(t.moduleExport)throw new g(this,"export is not supported");e.prototype.initialise.call(this,t)},ExportDefaultDeclaration}(f),q=function(e){function ExportNamedDeclaration(){e.apply(this,arguments)}return e&&(ExportNamedDeclaration.__proto__=e),ExportNamedDeclaration.prototype=Object.create(e&&e.prototype),ExportNamedDeclaration.prototype.constructor=ExportNamedDeclaration,ExportNamedDeclaration.prototype.initialise=function initialise(t){if(t.moduleExport)throw new g(this,"export is not supported");e.prototype.initialise.call(this,t)},ExportNamedDeclaration}(f),S=function(e){function LoopStatement(){e.apply(this,arguments)}return e&&(LoopStatement.__proto__=e),LoopStatement.prototype=Object.create(e&&e.prototype),LoopStatement.prototype.constructor=LoopStatement,LoopStatement.prototype.findScope=function findScope(e){return e||!this.createdScope?this.parent.findScope(e):this.body.scope},LoopStatement.prototype.initialise=function initialise(t){if(this.body.createScope(),this.createdScope=!0,this.reassigned=Object.create(null),this.aliases=Object.create(null),e.prototype.initialise.call(this,t),t.letConst)for(var n=Object.keys(this.body.scope.declarations),a=n.length;a--;){for(var r=n[a],i=this.body.scope.declarations[r],s=i.instances.length;s--;){var o=i.instances[s].findNearest(/Function/);if(o&&o.depth>this.depth){this.shouldRewriteAsFunction=!0;break}}if(this.shouldRewriteAsFunction)break}},LoopStatement.prototype.transpile=function transpile(t,n){var a="ForOfStatement"!=this.type&&("BlockStatement"!==this.body.type||"BlockStatement"===this.body.type&&this.body.synthetic);if(this.shouldRewriteAsFunction){var r=this.getIndentation(),i=r+t.getIndentString(),s=this.args?" "+this.args.join(", ")+" ":"",o=this.params?" "+this.params.join(", ")+" ":"",l=this.findScope(!0),d=l.createIdentifier("loop"),u="var "+d+" = function ("+o+") "+(this.body.synthetic?"{\n"+r+t.getIndentString():""),c=(this.body.synthetic?"\n"+r+"}":"")+";\n\n"+r;if(t.insertRight(this.body.start,u),t.insertLeft(this.body.end,c),t.move(this.start,this.body.start,this.body.end),this.canBreak||this.canReturn){var p=l.createIdentifier("returned"),m="{\n"+i+"var "+p+" = "+d+"("+s+");\n";this.canBreak&&(m+="\n"+i+"if ( "+p+" === 'break' ) break;"),this.canReturn&&(m+="\n"+i+"if ( "+p+" ) return "+p+".v;"),m+="\n"+r+"}",t.insertRight(this.body.end,m)}else{var f=d+"("+s+");";"DoWhileStatement"===this.type?t.overwrite(this.start,this.body.start,"do {\n"+i+f+"\n"+r+"}"):t.insertRight(this.body.end,f)}}else a&&(t.insertLeft(this.body.start,"{ "),t.insertRight(this.body.end," }"));e.prototype.transpile.call(this,t,n)},LoopStatement}(f);function extractNames(e){var t=[];return V[e.type](t,e),t}var V={Identifier:function Identifier(e,t){e.push(t)},ObjectPattern:function ObjectPattern(e,t){for(var n=0,a=t.properties;n<a.length;n+=1){var r=a[n];V[r.value.type](e,r.value)}},ArrayPattern:function ArrayPattern(e,t){for(var n=0,a=t.elements;n<a.length;n+=1){var r=a[n];r&&V[r.type](e,r)}},RestElement:function RestElement(e,t){V[t.argument.type](e,t.argument)},AssignmentPattern:function AssignmentPattern(e,t){V[t.left.type](e,t.left)}},R=function(e){function ForStatement(){e.apply(this,arguments)}return e&&(ForStatement.__proto__=e),ForStatement.prototype=Object.create(e&&e.prototype),ForStatement.prototype.constructor=ForStatement,ForStatement.prototype.findScope=function findScope(e){return e||!this.createdScope?this.parent.findScope(e):this.body.scope},ForStatement.prototype.transpile=function transpile(t,n){var a=this,r=this.getIndentation()+t.getIndentString();if(this.shouldRewriteAsFunction){var i="VariableDeclaration"===this.init.type?[].concat.apply([],this.init.declarations.map(function(e){return extractNames(e.id)})):[],s=this.aliases;this.args=i.map(function(e){return e in a.aliases?a.aliases[e].outer:e}),this.params=i.map(function(e){return e in a.aliases?a.aliases[e].inner:e});var o=Object.keys(this.reassigned).map(function(e){return s[e].outer+" = "+s[e].inner+";"});if(o.length)if(this.body.synthetic)t.insertLeft(this.body.body[0].end,"; "+o.join(" "));else{var l=this.body.body[this.body.body.length-1];t.insertLeft(l.end,"\n\n"+r+o.join("\n"+r))}}e.prototype.transpile.call(this,t,n)},ForStatement}(S),A=function(e){function ForInStatement(){e.apply(this,arguments)}return e&&(ForInStatement.__proto__=e),ForInStatement.prototype=Object.create(e&&e.prototype),ForInStatement.prototype.constructor=ForInStatement,ForInStatement.prototype.findScope=function findScope(e){return e||!this.createdScope?this.parent.findScope(e):this.body.scope},ForInStatement.prototype.transpile=function transpile(t,n){var a=this;if(this.shouldRewriteAsFunction){var r="VariableDeclaration"===this.left.type?[].concat.apply([],this.left.declarations.map(function(e){return extractNames(e.id)})):[];this.args=r.map(function(e){return e in a.aliases?a.aliases[e].outer:e}),this.params=r.map(function(e){return e in a.aliases?a.aliases[e].inner:e})}e.prototype.transpile.call(this,t,n)},ForInStatement}(S),O={Identifier:destructureIdentifier,AssignmentPattern:function destructureAssignmentPattern(e,t,n,a,r,i){var s="Identifier"===n.left.type,o=s?n.left.name:a;r||i.push(function(t,a,r){e.insertRight(n.left.end,a+"if ( "+o+" === void 0 ) "+o),e.move(n.left.end,n.right.end,t),e.insertLeft(n.right.end,r)});s||destructure(e,t,n.left,a,r,i)},ArrayPattern:function destructureArrayPattern(e,t,n,a,r,i){var s=n.start;n.elements.forEach(function(n,o){n&&("RestElement"===n.type?handleProperty(e,t,s,n.argument,a+".slice("+o+")",r,i):handleProperty(e,t,s,n,a+"["+o+"]",r,i),s=n.end)}),e.remove(s,n.end)},ObjectPattern:function destructureObjectPattern(e,t,n,a,r,i){var s=n.start;n.properties.forEach(function(n){var o=n.computed||"Identifier"!==n.key.type?a+"["+e.slice(n.key.start,n.key.end)+"]":a+"."+n.key.name;handleProperty(e,t,s,n.value,o,r,i),s=n.end}),e.remove(s,n.end)}};function destructure(e,t,n,a,r,i){O[n.type](e,t,n,a,r,i)}function destructureIdentifier(e,t,n,a,r,i){i.push(function(t,i,s){e.insertRight(n.start,r?i:i+"var "),e.insertLeft(n.end," = "+a+s),e.move(n.start,n.end,t)})}function handleProperty(e,t,n,a,r,i,s){switch(a.type){case"Identifier":e.remove(n,a.start),destructureIdentifier(e,0,a,r,i,s);break;case"AssignmentPattern":var o,l="Identifier"===a.left.type;if(l){o=a.left.name;var d=t.findDeclaration(o);d&&(o=d.name)}else o=t.createIdentifier(r);s.push(function(t,n,s){i?(e.insertRight(a.right.start,o+" = "+r+" === undefined ? "),e.insertLeft(a.right.end," : "+r)):(e.insertRight(a.right.start,n+"var "+o+" = "+r+"; if ( "+o+" === void 0 ) "+o+" = "),e.insertLeft(a.right.end,s)),e.move(a.right.start,a.right.end,t)}),l?e.remove(n,a.right.start):(e.remove(n,a.left.start),e.remove(a.left.end,a.right.start),handleProperty(e,t,n,a.left,o,i,s));break;case"ObjectPattern":if(e.remove(n,n=a.start),a.properties.length>1){var u=t.createIdentifier(r);s.push(function(t,i,s){e.insertRight(a.start,i+"var "+u+" = "),e.overwrite(a.start,n=a.start+1,r),e.insertLeft(n,s),e.move(a.start,n,t)}),a.properties.forEach(function(a){var r=a.computed||"Identifier"!==a.key.type?u+"["+e.slice(a.key.start,a.key.end)+"]":u+"."+a.key.name;handleProperty(e,t,n,a.value,r,i,s),n=a.end})}else{var c=a.properties[0],p=c.computed||"Identifier"!==c.key.type?"["+e.slice(c.key.start,c.key.end)+"]":"."+c.key.name;handleProperty(e,t,n,c.value,""+r+p,i,s),n=c.end}e.remove(n,a.end);break;case"ArrayPattern":if(e.remove(n,n=a.start),a.elements.filter(Boolean).length>1){var m=t.createIdentifier(r);s.push(function(t,i,s){e.insertRight(a.start,i+"var "+m+" = "),e.overwrite(a.start,n=a.start+1,r),e.insertLeft(n,s),e.move(a.start,n,t)}),a.elements.forEach(function(a,r){a&&("RestElement"===a.type?handleProperty(e,t,n,a.argument,m+".slice("+r+")",i,s):handleProperty(e,t,n,a,m+"["+r+"]",i,s),n=a.end)})}else{var f=findIndex(a.elements,Boolean),h=a.elements[f];"RestElement"===h.type?handleProperty(e,t,n,h.argument,r+".slice("+f+")",i,s):handleProperty(e,t,n,h,r+"["+f+"]",i,s),n=h.end}e.remove(n,a.end);break;default:throw new Error("Unexpected node type in destructuring ("+a.type+")")}}var T=function(e){function ForOfStatement(){e.apply(this,arguments)}return e&&(ForOfStatement.__proto__=e),ForOfStatement.prototype=Object.create(e&&e.prototype),ForOfStatement.prototype.constructor=ForOfStatement,ForOfStatement.prototype.initialise=function initialise(t){if(t.forOf&&!t.dangerousForOf)throw new g(this,"for...of statements are not supported. Use `transforms: { forOf: false }` to skip transformation and disable this error, or `transforms: { dangerousForOf: true }` if you know what you're doing");e.prototype.initialise.call(this,t)},ForOfStatement.prototype.transpile=function transpile(t,n){if(n.dangerousForOf)if(this.body.body[0]){var a=this.findScope(!0),r=this.getIndentation(),i=r+t.getIndentString(),s=a.createIdentifier("i"),o=a.createIdentifier("list");this.body.synthetic&&(t.insertRight(this.left.start,"{\n"+i),t.insertLeft(this.body.body[0].end,"\n"+r+"}"));var l=this.body.body[0].start;t.remove(this.left.end,this.right.start),t.move(this.left.start,this.left.end,l),t.insertRight(this.right.start,"var "+s+" = 0, "+o+" = "),t.insertLeft(this.right.end,"; "+s+" < "+o+".length; "+s+" += 1");var d="VariableDeclaration"===this.left.type&&this.left.declarations[0];if(d&&"Identifier"!==d.id.type){var u=[],c=a.createIdentifier("ref");destructure(t,a,d.id,c,!1,u);var p=";\n"+i;u.forEach(function(e,t){t===u.length-1&&(p=";\n\n"+i),e(l,"",p)}),t.insertLeft(this.left.start+this.left.kind.length+1,c),t.insertLeft(this.left.end," = "+o+"["+s+"];\n"+i)}else t.insertLeft(this.left.end," = "+o+"["+s+"];\n\n"+i);e.prototype.transpile.call(this,t,n)}else"VariableDeclaration"===this.left.type&&"var"===this.left.kind?(t.remove(this.start,this.left.start),t.insertLeft(this.left.end,";"),t.remove(this.left.end,this.end)):t.remove(this.start,this.end);else e.prototype.transpile.call(this,t,n)},ForOfStatement}(S),P=function(e){function FunctionDeclaration(){e.apply(this,arguments)}return e&&(FunctionDeclaration.__proto__=e),FunctionDeclaration.prototype=Object.create(e&&e.prototype),FunctionDeclaration.prototype.constructor=FunctionDeclaration,FunctionDeclaration.prototype.initialise=function initialise(t){if(this.generator&&t.generator)throw new g(this,"Generators are not supported");this.body.createScope(),this.findScope(!0).addDeclaration(this.id,"function"),e.prototype.initialise.call(this,t)},FunctionDeclaration}(f),M=function(e){function FunctionExpression(){e.apply(this,arguments)}return e&&(FunctionExpression.__proto__=e),FunctionExpression.prototype=Object.create(e&&e.prototype),FunctionExpression.prototype.constructor=FunctionExpression,FunctionExpression.prototype.initialise=function initialise(t){if(this.generator&&t.generator)throw new g(this,"Generators are not supported");this.body.createScope(),this.id&&this.body.scope.addDeclaration(this.id,"function"),e.prototype.initialise.call(this,t);var n,a=this.parent;if(t.conciseMethodProperty&&"Property"===a.type&&"init"===a.kind&&a.method&&"Identifier"===a.key.type?n=a.key.name:t.classes&&"MethodDefinition"===a.type&&"method"===a.kind&&"Identifier"===a.key.type?n=a.key.name:this.id&&"Identifier"===this.id.type&&(n=this.id.alias||this.id.name),n)for(var r=0,i=this.params;r<i.length;r+=1){var s=i[r];if("Identifier"===s.type&&n===s.name){var o=this.body.scope,l=o.declarations[n],d=o.createIdentifier(n);s.alias=d;for(var u=0,c=l.instances;u<c.length;u+=1){c[u].alias=d}break}}},FunctionExpression}(f);var N=function(e){function Identifier(){e.apply(this,arguments)}return e&&(Identifier.__proto__=e),Identifier.prototype=Object.create(e&&e.prototype),Identifier.prototype.constructor=Identifier,Identifier.prototype.findScope=function findScope(e){return this.parent.params&&~this.parent.params.indexOf(this)?this.parent.body.scope:"FunctionExpression"===this.parent.type&&this===this.parent.id?this.parent.body.scope:this.parent.findScope(e)},Identifier.prototype.initialise=function initialise(e){if(e.arrow&&function isReference(e,t){return"MemberExpression"===e.type?!e.computed&&isReference(e.object,e):"Identifier"===e.type?!t||!/(Function|Class)Expression/.test(t.type)&&("VariableDeclarator"===t.type?e===t.init:"MemberExpression"===t.type||"MethodDefinition"===t.type?t.computed||e===t.object:"ArrayPattern"!==t.type&&("Property"===t.type?"ObjectPattern"!==t.parent.type&&(t.computed||e===t.value):"MethodDefinition"!==t.type&&("ExportSpecifier"!==t.type||e===t.local))):void 0}(this,this.parent)){if("arguments"===this.name&&!this.findScope(!1).contains(this.name)){var t=this.findLexicalBoundary(),n=this.findNearest("ArrowFunctionExpression"),a=this.findNearest(x);n&&n.depth>t.depth&&(this.alias=t.getArgumentsAlias()),a&&a.body.contains(this)&&a.depth>t.depth&&(this.alias=t.getArgumentsAlias())}this.findScope(!1).addReference(this)}},Identifier.prototype.transpile=function transpile(e){this.alias&&e.overwrite(this.start,this.end,this.alias,!0)},Identifier}(f),F=function(e){function IfStatement(){e.apply(this,arguments)}return e&&(IfStatement.__proto__=e),IfStatement.prototype=Object.create(e&&e.prototype),IfStatement.prototype.constructor=IfSt