From f275fcff7a0ab0772a0fec9c53f839436d4e4411 Mon Sep 17 00:00:00 2001 From: Daniel Lindenkreuz Date: Fri, 4 Feb 2022 22:33:10 +0100 Subject: [PATCH] Update Terser to v5.10.0, fix minification issues (#33045) Bumping Terser from v5.7.1 to v5.10.0 fixes some minification issues: - I specifically encountered this bug, where a boolean condition was flipped when a nullish coalescing operator was involved: https://github.com/terser/terser/pull/1045 - See [Terser's changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md) for more fixes ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [x] Make sure the linting passes by running `yarn lint` --- packages/next/compiled/terser/bundle.min.js | 2 +- packages/next/package.json | 2 +- yarn.lock | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/next/compiled/terser/bundle.min.js b/packages/next/compiled/terser/bundle.min.js index be28ed1f6cdfb4a..3c6b4c7d7821f23 100644 --- a/packages/next/compiled/terser/bundle.min.js +++ b/packages/next/compiled/terser/bundle.min.js @@ -1 +1 @@ -(()=>{var e={988:e=>{"use strict";e.exports=require("next/dist/compiled/acorn")},749:e=>{"use strict";e.exports=require("next/dist/compiled/source-map")},405:function(e,t,n){(function(e,r){true?r(t,n(749)):0})(this,(function(e,t){"use strict";function _interopDefaultLegacy(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var r=_interopDefaultLegacy(t);function characters(e){return e.split("")}function member(e,t){return t.includes(e)}class DefaultsError extends Error{constructor(e,t){super();this.name="DefaultsError";this.message=e;this.defs=t}}function defaults(e,t,n){if(e===true){e={}}else if(e!=null&&typeof e==="object"){e={...e}}const r=e||{};if(n)for(const e in r)if(HOP(r,e)&&!HOP(t,e)){throw new DefaultsError("`"+e+"` is not a supported option",t)}for(const n in t)if(HOP(t,n)){if(!e||!HOP(e,n)){r[n]=t[n]}else if(n==="ecma"){let t=e[n]|0;if(t>5&&t<2015)t+=2009;r[n]=t}else{r[n]=e&&HOP(e,n)?e[n]:t[n]}}return r}function noop(){}function return_false(){return false}function return_true(){return true}function return_this(){return this}function return_null(){return null}var i=function(){function MAP(t,n,r){var i=[],o=[],a;function doit(){var s=n(t[a],a);var u=s instanceof Last;if(u)s=s.v;if(s instanceof AtTop){s=s.v;if(s instanceof Splice){o.push.apply(o,r?s.v.slice().reverse():s.v)}else{o.push(s)}}else if(s!==e){if(s instanceof Splice){i.push.apply(i,r?s.v.slice().reverse():s.v)}else{i.push(s)}}return u}if(Array.isArray(t)){if(r){for(a=t.length;--a>=0;)if(doit())break;i.reverse();o.reverse()}else{for(a=0;a=0;){if(e[n]===t)e.splice(n,1)}}function mergeSort(e,t){if(e.length<2)return e.slice();function merge(e,n){var r=[],i=0,o=0,a=0;while(i{n+=e}))}return n}function has_annotation(e,t){return e._annotations&t}function set_annotation(e,t){e._annotations|=t}var s="";var u=true;var l="break case catch class const continue debugger default delete do else export extends finally for function if in instanceof let new return switch throw try typeof var void while with";var c="false null true";var f="enum implements import interface package private protected public static super this "+c+" "+l;var _="return new delete throw else case yield await";l=makePredicate(l);f=makePredicate(f);_=makePredicate(_);c=makePredicate(c);var p=makePredicate(characters("+-*&%=<>!?|~^"));var d=/[0-9a-f]/i;var m=/^0x[0-9a-f]+$/i;var h=/^0[0-7]+$/;var E=/^0o[0-7]+$/i;var g=/^0b[01]+$/i;var v=/^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i;var D=/^(0[xob])?[0-9a-f]+n$/i;var b=makePredicate(["in","instanceof","typeof","new","void","delete","++","--","+","-","!","~","&","|","^","*","**","/","%",">>","<<",">>>","<",">","<=",">=","==","===","!=","!==","?","=","+=","-=","||=","&&=","??=","/=","*=","**=","%=",">>=","<<=",">>>=","|=","^=","&=","&&","??","||"]);var S=makePredicate(characters("  \n\r\t\f\v​           \u2028\u2029   \ufeff"));var A=makePredicate(characters("\n\r\u2028\u2029"));var y=makePredicate(characters(";]),:"));var T=makePredicate(characters("[{(,;:"));var k=makePredicate(characters("[]{}(),;:"));var C={ID_Start:/[$A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,ID_Continue:/(?:[$0-9A-Z_a-z\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF])+/};function get_full_char(e,t){if(is_surrogate_pair_head(e.charCodeAt(t))){if(is_surrogate_pair_tail(e.charCodeAt(t+1))){return e.charAt(t)+e.charAt(t+1)}}else if(is_surrogate_pair_tail(e.charCodeAt(t))){if(is_surrogate_pair_head(e.charCodeAt(t-1))){return e.charAt(t-1)+e.charAt(t)}}return e.charAt(t)}function get_full_char_code(e,t){if(is_surrogate_pair_head(e.charCodeAt(t))){return 65536+(e.charCodeAt(t)-55296<<10)+e.charCodeAt(t+1)-56320}return e.charCodeAt(t)}function get_full_char_length(e){var t=0;for(var n=0;n65535){e-=65536;return String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)}return String.fromCharCode(e)}function is_surrogate_pair_head(e){return e>=55296&&e<=56319}function is_surrogate_pair_tail(e){return e>=56320&&e<=57343}function is_digit(e){return e>=48&&e<=57}function is_identifier_start(e){return C.ID_Start.test(e)}function is_identifier_char(e){return C.ID_Continue.test(e)}const R=/^[a-z_$][a-z0-9_$]*$/i;function is_basic_identifier_string(e){return R.test(e)}function is_identifier_string(e,t){if(R.test(e)){return true}if(!t&&/[\ud800-\udfff]/.test(e)){return false}var n=C.ID_Start.exec(e);if(!n||n.index!==0){return false}e=e.slice(n[0].length);if(!e){return true}n=C.ID_Continue.exec(e);return!!n&&n[0].length===e.length}function parse_js_number(e,t=true){if(!t&&e.includes("e")){return NaN}if(m.test(e)){return parseInt(e.substr(2),16)}else if(h.test(e)){return parseInt(e.substr(1),8)}else if(E.test(e)){return parseInt(e.substr(2),8)}else if(g.test(e)){return parseInt(e.substr(2),2)}else if(v.test(e)){return parseFloat(e)}else{var n=parseFloat(e);if(n==e)return n}}class JS_Parse_Error extends Error{constructor(e,t,n,r,i){super();this.name="SyntaxError";this.message=e;this.filename=t;this.line=n;this.col=r;this.pos=i}}function js_error(e,t,n,r,i){throw new JS_Parse_Error(e,t,n,r,i)}function is_token(e,t,n){return e.type==t&&(n==null||e.value==n)}var F={};function tokenizer(e,t,n,r){var i={text:e,filename:t,pos:0,tokpos:0,line:1,tokline:0,col:0,tokcol:0,newline_before:false,regex_allowed:false,brace_counter:0,template_braces:[],comments_before:[],directives:{},directive_stack:[]};function peek(){return get_full_char(i.text,i.pos)}function is_option_chain_op(){const e=i.text.charCodeAt(i.pos+1)===46;if(!e)return false;const t=i.text.charCodeAt(i.pos+2);return t<48||t>57}function next(e,t){var n=get_full_char(i.text,i.pos++);if(e&&!n)throw F;if(A.has(n)){i.newline_before=i.newline_before||!t;++i.line;i.col=0;if(n=="\r"&&peek()=="\n"){++i.pos;n="\n"}}else{if(n.length>1){++i.pos;++i.col}++i.col}return n}function forward(e){while(e--)next()}function looking_at(e){return i.text.substr(i.pos,e.length)==e}function find_eol(){var e=i.text;for(var t=i.pos,n=i.text.length;t="0"&&e<="7"}function read_escaped_char(e,t,n){var r=next(true,e);switch(r.charCodeAt(0)){case 110:return"\n";case 114:return"\r";case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 120:return String.fromCharCode(hex_bytes(2,t));case 117:if(peek()=="{"){next(true);if(peek()==="}")parse_error("Expecting hex-character between {}");while(peek()=="0")next(true);var o,a=find("}",true)-i.pos;if(a>6||(o=hex_bytes(a,t))>1114111){parse_error("Unicode reference out of bounds")}next(true);return from_char_code(o)}return String.fromCharCode(hex_bytes(4,t));case 10:return"";case 13:if(peek()=="\n"){next(true,e);return""}}if(is_octal(r)){if(n&&t){const e=r==="0"&&!is_octal(peek());if(!e){parse_error("Octal escape sequences are not allowed in template strings")}}return read_octal_escape_sequence(r,t)}return r}function read_octal_escape_sequence(e,t){var n=peek();if(n>="0"&&n<="7"){e+=next(true);if(e[0]<="3"&&(n=peek())>="0"&&n<="7")e+=next(true)}if(e==="0")return"\0";if(e.length>0&&next_token.has_directive("use strict")&&t)parse_error("Legacy octal escape sequences are not allowed in strict mode");return String.fromCharCode(parseInt(e,8))}function hex_bytes(e,t){var n=0;for(;e>0;--e){if(!t&&isNaN(parseInt(peek(),16))){return parseInt(n,16)||""}var r=next(true);if(isNaN(parseInt(r,16)))parse_error("Invalid hex-character pattern in string");n+=r}return parseInt(n,16)}var E=with_eof_error("Unterminated string constant",(function(){const e=i.pos;var t=next(),n=[];for(;;){var r=next(true,true);if(r=="\\")r=read_escaped_char(true,true);else if(r=="\r"||r=="\n")parse_error("Unterminated string constant");else if(r==t)break;n.push(r)}var o=token("string",n.join(""));s=i.text.slice(e,i.pos);o.quote=t;return o}));var g=with_eof_error("Unterminated template",(function(e){if(e){i.template_braces.push(i.brace_counter)}var t="",n="",r,o;next(true,true);while((r=next(true,true))!="`"){if(r=="\r"){if(peek()=="\n")++i.pos;r="\n"}else if(r=="$"&&peek()=="{"){next(true,true);i.brace_counter++;o=token(e?"template_head":"template_substitution",t);s=n;u=false;return o}n+=r;if(r=="\\"){var l=i.pos;var c=a&&(a.type==="name"||a.type==="punc"&&(a.value===")"||a.value==="]"));r=read_escaped_char(true,!c,true);n+=i.text.substr(l,i.pos-l)}t+=r}i.template_braces.pop();o=token(e?"template_head":"template_substitution",t);s=n;u=true;return o}));function skip_line_comment(e){var t=i.regex_allowed;var n=find_eol(),r;if(n==-1){r=i.text.substr(i.pos);i.pos=i.text.length}else{r=i.text.substring(i.pos,n);i.pos=n}i.col=i.tokcol+(i.pos-i.tokpos);i.comments_before.push(token(e,r,true));i.regex_allowed=t;return next_token}var v=with_eof_error("Unterminated multiline comment",(function(){var e=i.regex_allowed;var t=find("*/",true);var n=i.text.substring(i.pos,t).replace(/\r\n|\r|\u2028|\u2029/g,"\n");forward(get_full_char_length(n)+2);i.comments_before.push(token("comment2",n,true));i.newline_before=i.newline_before||n.includes("\n");i.regex_allowed=e;return next_token}));var y=with_eof_error("Unterminated identifier name",(function(){var e=[],t,n=false;var read_escaped_identifier_char=function(){n=true;next();if(peek()!=="u"){parse_error("Expecting UnicodeEscapeSequence -- uXXXX or u{XXXX}")}return read_escaped_char(false,true)};if((t=peek())==="\\"){t=read_escaped_identifier_char();if(!is_identifier_start(t)){parse_error("First identifier char is an invalid identifier char")}}else if(is_identifier_start(t)){next()}else{return""}e.push(t);while((t=peek())!=null){if((t=peek())==="\\"){t=read_escaped_identifier_char();if(!is_identifier_char(t)){parse_error("Invalid escaped identifier char")}}else{if(!is_identifier_char(t)){break}next()}e.push(t)}const r=e.join("");if(f.has(r)&&n){parse_error("Escaped characters are not allowed in keywords")}return r}));var C=with_eof_error("Unterminated regular expression",(function(e){var t=false,n,r=false;while(n=next(true))if(A.has(n)){parse_error("Unexpected line terminator")}else if(t){e+="\\"+n;t=false}else if(n=="["){r=true;e+=n}else if(n=="]"&&r){r=false;e+=n}else if(n=="/"&&!r){break}else if(n=="\\"){t=true}else{e+=n}const i=y();return token("regexp","/"+e+"/"+i)}));function read_operator(e){function grow(e){if(!peek())return e;var t=e+peek();if(b.has(t)){next();return grow(t)}else{return e}}return token("operator",grow(e||next()))}function handle_slash(){next();switch(peek()){case"/":next();return skip_line_comment("comment1");case"*":next();return v()}return i.regex_allowed?C(""):read_operator("/")}function handle_eq_sign(){next();if(peek()===">"){next();return token("arrow","=>")}else{return read_operator("=")}}function handle_dot(){next();if(is_digit(peek().charCodeAt(0))){return read_num(".")}if(peek()==="."){next();next();return token("expand","...")}return token("punc",".")}function read_word(){var e=y();if(o)return token("name",e);return c.has(e)?token("atom",e):!l.has(e)?token("name",e):b.has(e)?token("operator",e):token("keyword",e)}function read_private_word(){next();return token("privatename",y())}function with_eof_error(e,t){return function(n){try{return t(n)}catch(t){if(t===F)parse_error(e);else throw t}}}function next_token(e){if(e!=null)return C(e);if(r&&i.pos==0&&looking_at("#!")){start_token();forward(2);skip_line_comment("comment5")}for(;;){skip_whitespace();start_token();if(n){if(looking_at("\x3c!--")){forward(4);skip_line_comment("comment3");continue}if(looking_at("--\x3e")&&i.newline_before){forward(3);skip_line_comment("comment4");continue}}var t=peek();if(!t)return token("eof");var o=t.charCodeAt(0);switch(o){case 34:case 39:return E();case 46:return handle_dot();case 47:{var a=handle_slash();if(a===next_token)continue;return a}case 61:return handle_eq_sign();case 63:{if(!is_option_chain_op())break;next();next();return token("punc","?.")}case 96:return g(true);case 123:i.brace_counter++;break;case 125:i.brace_counter--;if(i.template_braces.length>0&&i.template_braces[i.template_braces.length-1]===i.brace_counter)return g(false);break}if(is_digit(o))return read_num();if(k.has(t))return token("punc",next());if(p.has(t))return read_operator();if(o==92||is_identifier_start(t))return read_word();if(o==35)return read_private_word();break}parse_error("Unexpected character '"+t+"'")}next_token.next=next;next_token.peek=peek;next_token.context=function(e){if(e)i=e;return i};next_token.add_directive=function(e){i.directive_stack[i.directive_stack.length-1].push(e);if(i.directives[e]===undefined){i.directives[e]=1}else{i.directives[e]++}};next_token.push_directives_stack=function(){i.directive_stack.push([])};next_token.pop_directives_stack=function(){var e=i.directive_stack[i.directive_stack.length-1];for(var t=0;t0};return next_token}var O=makePredicate(["typeof","void","delete","--","++","!","~","-","+"]);var M=makePredicate(["--","++"]);var x=makePredicate(["=","+=","-=","??=","&&=","||=","/=","*=","**=","%=",">>=","<<=",">>>=","|=","^=","&="]);var N=makePredicate(["??=","&&=","||="]);var w=function(e,t){for(var n=0;n","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]],{});var I=makePredicate(["atom","num","big_int","string","regexp","name"]);function parse(e,t){const n=new WeakMap;t=defaults(t,{bare_returns:false,ecma:null,expression:false,filename:null,html5_comments:true,module:false,shebang:true,strict:false,toplevel:null},true);var r={input:typeof e=="string"?tokenizer(e,t.filename,t.html5_comments,t.shebang):e,token:null,prev:null,peeked:null,in_function:0,in_async:-1,in_generator:-1,in_directives:true,in_loop:0,labels:[]};r.token=next();function is(e,t){return is_token(r.token,e,t)}function peek(){return r.peeked||(r.peeked=r.input())}function next(){r.prev=r.token;if(!r.peeked)peek();r.token=r.peeked;r.peeked=null;r.in_directives=r.in_directives&&(r.token.type=="string"||is("punc",";"));return r.token}function prev(){return r.prev}function croak(e,t,n,i){var o=r.input.context();js_error(e,o.filename,t!=null?t:o.tokline,n!=null?n:o.tokcol,i!=null?i:o.tokpos)}function token_error(e,t){croak(t,e.line,e.col)}function unexpected(e){if(e==null)e=r.token;token_error(e,"Unexpected token: "+e.type+" ("+e.value+")")}function expect_token(e,t){if(is(e,t)){return next()}token_error(r.token,"Unexpected token "+r.token.type+" «"+r.token.value+"»"+", expected "+e+" «"+t+"»")}function expect(e){return expect_token("punc",e)}function has_newline_before(e){return e.nlb||!e.comments_before.every((e=>!e.nlb))}function can_insert_semicolon(){return!t.strict&&(is("eof")||is("punc","}")||has_newline_before(r.token))}function is_in_generator(){return r.in_generator===r.in_function}function is_in_async(){return r.in_async===r.in_function}function can_await(){return r.in_async===r.in_function||r.in_function===0&&r.input.has_directive("use strict")}function semicolon(e){if(is("punc",";"))next();else if(!e&&!can_insert_semicolon())unexpected()}function parenthesised(){expect("(");var e=expression(true);expect(")");return e}function embed_tokens(e){return function _embed_tokens_wrapper(...t){const n=r.token;const i=e(...t);i.start=n;i.end=prev();return i}}function handle_regexp(){if(is("operator","/")||is("operator","/=")){r.peeked=null;r.token=r.input(r.token.value.substr(1))}}var i=embed_tokens((function statement(e,n,i){handle_regexp();switch(r.token.type){case"string":if(r.in_directives){var o=peek();if(!s.includes("\\")&&(is_token(o,"punc",";")||is_token(o,"punc","}")||has_newline_before(o)||is_token(o,"eof"))){r.input.add_directive(r.token.value)}else{r.in_directives=false}}var a=r.in_directives,u=simple_statement();return a&&u.body instanceof Kt?new K(u.body):u;case"template_head":case"num":case"big_int":case"regexp":case"operator":case"atom":return simple_statement();case"name":if(r.token.value=="async"&&is_token(peek(),"keyword","function")){next();next();if(n){croak("functions are not allowed as the body of a loop")}return function_(ce,false,true,e)}if(r.token.value=="import"&&!is_token(peek(),"punc","(")&&!is_token(peek(),"punc",".")){next();var l=import_();semicolon();return l}return is_token(peek(),"punc",":")?labeled_statement():simple_statement();case"punc":switch(r.token.value){case"{":return new X({start:r.token,body:block_(),end:prev()});case"[":case"(":return simple_statement();case";":r.in_directives=false;next();return new W;default:unexpected()}case"keyword":switch(r.token.value){case"break":next();return break_cont(De);case"continue":next();return break_cont(be);case"debugger":next();semicolon();return new z;case"do":next();var c=in_loop(statement);expect_token("keyword","while");var f=parenthesised();semicolon(true);return new Z({body:c,condition:f});case"while":next();return new Q({condition:parenthesised(),body:in_loop((function(){return statement(false,true)}))});case"for":next();return for_();case"class":next();if(n){croak("classes are not allowed as the body of a loop")}if(i){croak("classes are not allowed as the body of an if")}return class_(mt,e);case"function":next();if(n){croak("functions are not allowed as the body of a loop")}return function_(ce,false,false,e);case"if":next();return if_();case"return":if(r.in_function==0&&!t.bare_returns)croak("'return' outside of function");next();var _=null;if(is("punc",";")){next()}else if(!can_insert_semicolon()){_=expression(true);semicolon()}return new Ee({value:_});case"switch":next();return new Te({expression:parenthesised(),body:in_loop(switch_body_)});case"throw":next();if(has_newline_before(r.token))croak("Illegal newline after 'throw'");var _=expression(true);semicolon();return new ge({value:_});case"try":next();return try_();case"var":next();var l=var_();semicolon();return l;case"let":next();var l=let_();semicolon();return l;case"const":next();var l=const_();semicolon();return l;case"with":if(r.input.has_directive("use strict")){croak("Strict mode may not include a with statement")}next();return new ne({expression:parenthesised(),body:statement()});case"export":if(!is_token(peek(),"punc","(")){next();var l=export_();if(is("punc",";"))semicolon();return l}}}unexpected()}));function labeled_statement(){var e=as_symbol(wt);if(e.name==="await"&&is_in_async()){token_error(r.prev,"await cannot be used as label inside async function")}if(r.labels.some((t=>t.name===e.name))){croak("Label "+e.name+" defined twice")}expect(":");r.labels.push(e);var t=i();r.labels.pop();if(!(t instanceof j)){e.references.forEach((function(t){if(t instanceof be){t=t.label.start;croak("Continue label `"+e.name+"` refers to non-IterationStatement.",t.line,t.col,t.pos)}}))}return new Y({body:t,label:e})}function simple_statement(e){return new G({body:(e=expression(true),semicolon(),e)})}function break_cont(e){var t=null,n;if(!can_insert_semicolon()){t=as_symbol(Lt,true)}if(t!=null){n=r.labels.find((e=>e.name===t.name));if(!n)croak("Undefined label "+t.name);t.thedef=n}else if(r.in_loop==0)croak(e.TYPE+" not inside a loop or switch");semicolon();var i=new e({label:t});if(n)n.references.push(i);return i}function for_(){var e="`for await` invalid in this context";var t=r.token;if(t.type=="name"&&t.value=="await"){if(!can_await()){token_error(t,e)}next()}else{t=false}expect("(");var n=null;if(!is("punc",";")){n=is("keyword","var")?(next(),var_(true)):is("keyword","let")?(next(),let_(true)):is("keyword","const")?(next(),const_(true)):expression(true,true);var i=is("operator","in");var o=is("name","of");if(t&&!o){token_error(t,e)}if(i||o){if(n instanceof xe){if(n.definitions.length>1)token_error(n.start,"Only one variable declaration allowed in for..in loop")}else if(!(is_assignable(n)||(n=to_destructuring(n))instanceof fe)){token_error(n.start,"Invalid left-hand side in for..in loop")}next();if(i){return for_in(n)}else{return for_of(n,!!t)}}}else if(t){token_error(t,e)}return regular_for(n)}function regular_for(e){expect(";");var t=is("punc",";")?null:expression(true);expect(";");var n=is("punc",")")?null:expression(true);expect(")");return new J({init:e,condition:t,step:n,body:in_loop((function(){return i(false,true)}))})}function for_of(e,t){var n=e instanceof xe?e.definitions[0].name:null;var r=expression(true);expect(")");return new te({await:t,init:e,name:n,object:r,body:in_loop((function(){return i(false,true)}))})}function for_in(e){var t=expression(true);expect(")");return new ee({init:e,object:t,body:in_loop((function(){return i(false,true)}))})}var arrow_function=function(e,t,n){if(has_newline_before(r.token)){croak("Unexpected newline before arrow (=>)")}expect_token("arrow","=>");var i=_function_body(is("punc","{"),false,n);var o=i instanceof Array&&i.length?i[i.length-1].end:i instanceof Array?e:i.end;return new le({start:e,end:o,async:n,argnames:t,body:i})};var function_=function(e,t,n,r){var i=e===ce;var o=is("operator","*");if(o){next()}var a=is("name")?as_symbol(i?Tt:Rt):null;if(i&&!a){if(r){e=ue}else{unexpected()}}if(a&&e!==se&&!(a instanceof vt))unexpected(prev());var s=[];var u=_function_body(true,o||t,n,a,s);return new e({start:s.start,end:u.end,is_generator:o,async:n,name:a,argnames:s,body:u})};function track_used_binding_identifiers(e,t){var n=new Set;var r=false;var i=false;var o=false;var a=!!t;var s={add_parameter:function(t){if(n.has(t.value)){if(r===false){r=t}s.check_strict()}else{n.add(t.value);if(e){switch(t.value){case"arguments":case"eval":case"yield":if(a){token_error(t,"Unexpected "+t.value+" identifier as parameter inside strict mode")}break;default:if(f.has(t.value)){unexpected()}}}}},mark_default_assignment:function(e){if(i===false){i=e}},mark_spread:function(e){if(o===false){o=e}},mark_strict_mode:function(){a=true},is_strict:function(){return i!==false||o!==false||a},check_strict:function(){if(s.is_strict()&&r!==false){token_error(r,"Parameter "+r.value+" was used already")}}};return s}function parameters(e){var t=track_used_binding_identifiers(true,r.input.has_directive("use strict"));expect("(");while(!is("punc",")")){var n=parameter(t);e.push(n);if(!is("punc",")")){expect(",")}if(n instanceof oe){break}}next()}function parameter(e,t){var n;var i=false;if(e===undefined){e=track_used_binding_identifiers(true,r.input.has_directive("use strict"))}if(is("expand","...")){i=r.token;e.mark_spread(r.token);next()}n=binding_element(e,t);if(is("operator","=")&&i===false){e.mark_default_assignment(r.token);next();n=new tt({start:n.start,left:n,operator:"=",right:expression(false),end:r.token})}if(i!==false){if(!is("punc",")")){unexpected()}n=new oe({start:i,expression:n,end:i})}e.check_strict();return n}function binding_element(e,t){var n=[];var i=true;var o=false;var a;var s=r.token;if(e===undefined){e=track_used_binding_identifiers(false,r.input.has_directive("use strict"))}t=t===undefined?yt:t;if(is("punc","[")){next();while(!is("punc","]")){if(i){i=false}else{expect(",")}if(is("expand","...")){o=true;a=r.token;e.mark_spread(r.token);next()}if(is("punc")){switch(r.token.value){case",":n.push(new $t({start:r.token,end:r.token}));continue;case"]":break;case"[":case"{":n.push(binding_element(e,t));break;default:unexpected()}}else if(is("name")){e.add_parameter(r.token);n.push(as_symbol(t))}else{croak("Invalid function parameter")}if(is("operator","=")&&o===false){e.mark_default_assignment(r.token);next();n[n.length-1]=new tt({start:n[n.length-1].start,left:n[n.length-1],operator:"=",right:expression(false),end:r.token})}if(o){if(!is("punc","]")){croak("Rest element must be last element")}n[n.length-1]=new oe({start:a,expression:n[n.length-1],end:a})}}expect("]");e.check_strict();return new fe({start:s,names:n,is_array:true,end:prev()})}else if(is("punc","{")){next();while(!is("punc","}")){if(i){i=false}else{expect(",")}if(is("expand","...")){o=true;a=r.token;e.mark_spread(r.token);next()}if(is("name")&&(is_token(peek(),"punc")||is_token(peek(),"operator"))&&[",","}","="].includes(peek().value)){e.add_parameter(r.token);var u=prev();var l=as_symbol(t);if(o){n.push(new oe({start:a,expression:l,end:l.end}))}else{n.push(new ot({start:u,key:l.name,value:l,end:l.end}))}}else if(is("punc","}")){continue}else{var c=r.token;var f=as_property_name();if(f===null){unexpected(prev())}else if(prev().type==="name"&&!is("punc",":")){n.push(new ot({start:prev(),key:f,value:new t({start:prev(),name:f,end:prev()}),end:prev()}))}else{expect(":");n.push(new ot({start:c,quote:c.quote,key:f,value:binding_element(e,t),end:prev()}))}}if(o){if(!is("punc","}")){croak("Rest element must be last element")}}else if(is("operator","=")){e.mark_default_assignment(r.token);next();n[n.length-1].value=new tt({start:n[n.length-1].value.start,left:n[n.length-1].value,operator:"=",right:expression(false),end:r.token})}}expect("}");e.check_strict();return new fe({start:s,names:n,is_array:false,end:prev()})}else if(is("name")){e.add_parameter(r.token);return as_symbol(t)}else{croak("Invalid function parameter")}}function params_or_seq_(e,t){var n;var i;var o;var a=[];expect("(");while(!is("punc",")")){if(n)unexpected(n);if(is("expand","...")){n=r.token;if(t)i=r.token;next();a.push(new oe({start:prev(),expression:expression(),end:r.token}))}else{a.push(expression())}if(!is("punc",")")){expect(",");if(is("punc",")")){o=prev();if(t)i=o}}}expect(")");if(e&&is("arrow","=>")){if(n&&o)unexpected(o)}else if(i){unexpected(i)}return a}function _function_body(e,t,n,i,o){var a=r.in_loop;var s=r.labels;var u=r.in_generator;var l=r.in_async;++r.in_function;if(t)r.in_generator=r.in_function;if(n)r.in_async=r.in_function;if(o)parameters(o);if(e)r.in_directives=true;r.in_loop=0;r.labels=[];if(e){r.input.push_directives_stack();var c=block_();if(i)_verify_symbol(i);if(o)o.forEach(_verify_symbol);r.input.pop_directives_stack()}else{var c=[new Ee({start:r.token,value:expression(false),end:r.token})]}--r.in_function;r.in_loop=a;r.labels=s;r.in_generator=u;r.in_async=l;return c}function _await_expression(){if(!can_await()){croak("Unexpected await expression outside async function",r.prev.line,r.prev.col,r.prev.pos)}return new Se({start:prev(),end:r.token,expression:maybe_unary(true)})}function _yield_expression(){if(!is_in_generator()){croak("Unexpected yield expression outside generator function",r.prev.line,r.prev.col,r.prev.pos)}var e=r.token;var t=false;var n=true;if(can_insert_semicolon()||is("punc")&&y.has(r.token.value)){n=false}else if(is("operator","*")){t=true;next()}return new Ae({start:e,is_star:t,expression:n?expression():null,end:prev()})}function if_(){var e=parenthesised(),t=i(false,false,true),n=null;if(is("keyword","else")){next();n=i(false,false,true)}return new ye({condition:e,body:t,alternative:n})}function block_(){expect("{");var e=[];while(!is("punc","}")){if(is("eof"))unexpected();e.push(i())}next();return e}function switch_body_(){expect("{");var e=[],t=null,n=null,o;while(!is("punc","}")){if(is("eof"))unexpected();if(is("keyword","case")){if(n)n.end=prev();t=[];n=new Re({start:(o=r.token,next(),o),expression:expression(true),body:t});e.push(n);expect(":")}else if(is("keyword","default")){if(n)n.end=prev();t=[];n=new Ce({start:(o=r.token,next(),expect(":"),o),body:t});e.push(n)}else{if(!t)unexpected();t.push(i())}}if(n)n.end=prev();next();return e}function try_(){var e=block_(),t=null,n=null;if(is("keyword","catch")){var i=r.token;next();if(is("punc","{")){var o=null}else{expect("(");var o=parameter(undefined,Mt);expect(")")}t=new Oe({start:i,argname:o,body:block_(),end:prev()})}if(is("keyword","finally")){var i=r.token;next();n=new Me({start:i,body:block_(),end:prev()})}if(!t&&!n)croak("Missing catch/finally blocks");return new Fe({body:e,bcatch:t,bfinally:n})}function vardefs(e,t){var n=[];var i;for(;;){var o=t==="var"?Dt:t==="const"?St:t==="let"?At:null;if(is("punc","{")||is("punc","[")){i=new Pe({start:r.token,name:binding_element(undefined,o),value:is("operator","=")?(expect_token("operator","="),expression(false,e)):null,end:prev()})}else{i=new Pe({start:r.token,name:as_symbol(o),value:is("operator","=")?(next(),expression(false,e)):!e&&t==="const"?croak("Missing initializer in const declaration"):null,end:prev()});if(i.name.name=="import")croak("Unexpected token: import")}n.push(i);if(!is("punc",","))break;next()}return n}var var_=function(e){return new Ne({start:prev(),definitions:vardefs(e,"var"),end:prev()})};var let_=function(e){return new we({start:prev(),definitions:vardefs(e,"let"),end:prev()})};var const_=function(e){return new Ie({start:prev(),definitions:vardefs(e,"const"),end:prev()})};var new_=function(e){var t=r.token;expect_token("operator","new");if(is("punc",".")){next();expect_token("name","target");return subscripts(new gt({start:t,end:prev()}),e)}var n=expr_atom(false),i;if(is("punc","(")){next();i=expr_list(")",true)}else{i=[]}var o=new Ke({start:t,expression:n,args:i,end:prev()});annotate(o);return subscripts(o,e)};function as_atom_node(){var e=r.token,t;switch(e.type){case"name":t=_make_symbol(It);break;case"num":t=new Gt({start:e,end:e,value:e.value,raw:s});break;case"big_int":t=new Ht({start:e,end:e,value:e.value});break;case"string":t=new Kt({start:e,end:e,value:e.value,quote:e.quote});break;case"regexp":const[n,r,i]=e.value.match(/^\/(.*)\/(\w*)$/);t=new Xt({start:e,end:e,value:{source:r,flags:i}});break;case"atom":switch(e.value){case"false":t=new Jt({start:e,end:e});break;case"true":t=new en({start:e,end:e});break;case"null":t=new qt({start:e,end:e});break}break}next();return t}function to_fun_args(e,t){var insert_default=function(e,t){if(t){return new tt({start:e.start,left:e,operator:"=",right:t,end:t.end})}return e};if(e instanceof rt){return insert_default(new fe({start:e.start,end:e.end,is_array:false,names:e.properties.map((e=>to_fun_args(e)))}),t)}else if(e instanceof ot){e.value=to_fun_args(e.value);return insert_default(e,t)}else if(e instanceof $t){return e}else if(e instanceof fe){e.names=e.names.map((e=>to_fun_args(e)));return insert_default(e,t)}else if(e instanceof It){return insert_default(new yt({name:e.name,start:e.start,end:e.end}),t)}else if(e instanceof oe){e.expression=to_fun_args(e.expression);return insert_default(e,t)}else if(e instanceof nt){return insert_default(new fe({start:e.start,end:e.end,is_array:true,names:e.elements.map((e=>to_fun_args(e)))}),t)}else if(e instanceof et){return insert_default(to_fun_args(e.left,e.right),t)}else if(e instanceof tt){e.left=to_fun_args(e.left);return e}else{croak("Invalid function parameter",e.start.line,e.start.col)}}var expr_atom=function(e,t){if(is("operator","new")){return new_(e)}if(is("operator","import")){return import_meta()}var i=r.token;var a;var s=is("name","async")&&(a=peek()).value!="["&&a.type!="arrow"&&as_atom_node();if(is("punc")){switch(r.token.value){case"(":if(s&&!e)break;var u=params_or_seq_(t,!s);if(t&&is("arrow","=>")){return arrow_function(i,u.map((e=>to_fun_args(e))),!!s)}var c=s?new ze({expression:s,args:u}):u.length==1?u[0]:new Ge({expressions:u});if(c.start){const e=i.comments_before.length;n.set(i,e);c.start.comments_before.unshift(...i.comments_before);i.comments_before=c.start.comments_before;if(e==0&&i.comments_before.length>0){var f=i.comments_before[0];if(!f.nlb){f.nlb=i.nlb;i.nlb=false}}i.comments_after=c.start.comments_after}c.start=i;var _=prev();if(c.end){_.comments_before=c.end.comments_before;c.end.comments_after.push(..._.comments_after);_.comments_after=c.end.comments_after}c.end=_;if(c instanceof ze)annotate(c);return subscripts(c,e);case"[":return subscripts(o(),e);case"{":return subscripts(l(),e)}if(!s)unexpected()}if(t&&is("name")&&is_token(peek(),"arrow")){var p=new yt({name:r.token.value,start:i,end:i});next();return arrow_function(i,[p],!!s)}if(is("keyword","function")){next();var d=function_(ue,false,!!s);d.start=i;d.end=prev();return subscripts(d,e)}if(s)return subscripts(s,e);if(is("keyword","class")){next();var m=class_(ht);m.start=i;m.end=prev();return subscripts(m,e)}if(is("template_head")){return subscripts(template_string(),e)}if(I.has(r.token.type)){return subscripts(as_atom_node(),e)}unexpected()};function template_string(){var e=[],t=r.token;e.push(new de({start:r.token,raw:s,value:r.token.value,end:r.token}));while(!u){next();handle_regexp();e.push(expression(true));e.push(new de({start:r.token,raw:s,value:r.token.value,end:r.token}))}next();return new pe({start:t,segments:e,end:r.token})}function expr_list(e,t,n){var i=true,o=[];while(!is("punc",e)){if(i)i=false;else expect(",");if(t&&is("punc",e))break;if(is("punc",",")&&n){o.push(new $t({start:r.token,end:r.token}))}else if(is("expand","...")){next();o.push(new oe({start:prev(),expression:expression(),end:r.token}))}else{o.push(expression(false))}}next();return o}var o=embed_tokens((function(){expect("[");return new nt({elements:expr_list("]",!t.strict,true)})}));var a=embed_tokens(((e,t)=>function_(se,e,t)));var l=embed_tokens((function object_or_destructuring_(){var e=r.token,n=true,i=[];expect("{");while(!is("punc","}")){if(n)n=false;else expect(",");if(!t.strict&&is("punc","}"))break;e=r.token;if(e.type=="expand"){next();i.push(new oe({start:e,expression:expression(false),end:prev()}));continue}var o=as_property_name();var a;if(!is("punc",":")){var s=concise_method_or_getset(o,e);if(s){i.push(s);continue}a=new It({start:prev(),name:o,end:prev()})}else if(o===null){unexpected(prev())}else{next();a=expression(false)}if(is("operator","=")){next();a=new et({start:e,left:a,operator:"=",right:expression(false),logical:false,end:prev()})}i.push(new ot({start:e,quote:e.quote,key:o instanceof V?o:""+o,value:a,end:prev()}))}next();return new rt({properties:i})}));function class_(e,t){var n,i,o,a,s=[];r.input.push_directives_stack();r.input.add_directive("use strict");if(r.token.type=="name"&&r.token.value!="extends"){o=as_symbol(e===mt?Ft:Ot)}if(e===mt&&!o){if(t){e=ht}else{unexpected()}}if(r.token.value=="extends"){next();a=expression(true)}expect("{");while(is("punc",";")){next()}while(!is("punc","}")){n=r.token;i=concise_method_or_getset(as_property_name(),n,true);if(!i){unexpected()}s.push(i);while(is("punc",";")){next()}}r.input.pop_directives_stack();next();return new e({start:n,name:o,extends:a,properties:s,end:prev()})}function concise_method_or_getset(e,t,n){const get_symbol_ast=(e,n=kt)=>{if(typeof e==="string"||typeof e==="number"){return new n({start:t,name:""+e,end:prev()})}else if(e===null){unexpected()}return e};const is_not_method_start=()=>!is("punc","(")&&!is("punc",",")&&!is("punc","}")&&!is("operator","=");var r=false;var i=false;var o=false;var s=false;var u=null;if(n&&e==="static"&&is_not_method_start()){i=true;e=as_property_name()}if(e==="async"&&is_not_method_start()){r=true;e=as_property_name()}if(prev().type==="operator"&&prev().value==="*"){o=true;e=as_property_name()}if((e==="get"||e==="set")&&is_not_method_start()){u=e;e=as_property_name()}if(prev().type==="privatename"){s=true}const l=prev();if(u!=null){if(!s){const n=u==="get"?lt:ut;e=get_symbol_ast(e);return new n({start:t,static:i,key:e,quote:e instanceof kt?l.quote:undefined,value:a(),end:prev()})}else{const n=u==="get"?st:at;return new n({start:t,static:i,key:get_symbol_ast(e),value:a(),end:prev()})}}if(is("punc","(")){e=get_symbol_ast(e);const n=s?ft:ct;var c=new n({start:t,static:i,is_generator:o,async:r,key:e,quote:e instanceof kt?l.quote:undefined,value:a(o,r),end:prev()});return c}if(n){const n=get_symbol_ast(e,Ct);const r=n instanceof Ct?l.quote:undefined;const o=s?dt:pt;if(is("operator","=")){next();return new o({start:t,static:i,quote:r,key:n,value:expression(false),end:prev()})}else if(is("name")||is("privatename")||is("operator","*")||is("punc",";")||is("punc","}")){return new o({start:t,static:i,quote:r,key:n,end:prev()})}}}function import_(){var e=prev();var t;var n;if(is("name")){t=as_symbol(xt)}if(is("punc",",")){next()}n=map_names(true);if(n||t){expect_token("name","from")}var i=r.token;if(i.type!=="string"){unexpected()}next();return new Le({start:e,imported_name:t,imported_names:n,module_name:new Kt({start:i,value:i.value,quote:i.quote,end:i}),end:r.token})}function import_meta(){var e=r.token;expect_token("operator","import");expect_token("punc",".");expect_token("name","meta");return subscripts(new Ve({start:e,end:prev()}),false)}function map_name(e){function make_symbol(e){return new e({name:as_property_name(),start:prev(),end:prev()})}var t=e?Nt:Bt;var n=e?xt:Pt;var i=r.token;var o;var a;if(e){o=make_symbol(t)}else{a=make_symbol(n)}if(is("name","as")){next();if(e){a=make_symbol(n)}else{o=make_symbol(t)}}else if(e){a=new n(o)}else{o=new t(a)}return new Be({start:i,foreign_name:o,name:a,end:prev()})}function map_nameAsterisk(e,t){var n=e?Nt:Bt;var i=e?xt:Pt;var o=r.token;var a;var s=prev();t=t||new i({name:"*",start:o,end:s});a=new n({name:"*",start:o,end:s});return new Be({start:o,foreign_name:a,name:t,end:s})}function map_names(e){var t;if(is("punc","{")){next();t=[];while(!is("punc","}")){t.push(map_name(e));if(is("punc",",")){next()}}next()}else if(is("operator","*")){var n;next();if(e&&is("name","as")){next();n=as_symbol(e?xt:Bt)}t=[map_nameAsterisk(e,n)]}return t}function export_(){var e=r.token;var t;var n;if(is("keyword","default")){t=true;next()}else if(n=map_names(false)){if(is("name","from")){next();var o=r.token;if(o.type!=="string"){unexpected()}next();return new Ue({start:e,is_default:t,exported_names:n,module_name:new Kt({start:o,value:o.value,quote:o.quote,end:o}),end:prev()})}else{return new Ue({start:e,is_default:t,exported_names:n,end:prev()})}}var a;var s;var u;if(is("punc","{")||t&&(is("keyword","class")||is("keyword","function"))&&is_token(peek(),"punc")){s=expression(false);semicolon()}else if((a=i(t))instanceof xe&&t){unexpected(a.start)}else if(a instanceof xe||a instanceof ce||a instanceof mt){u=a}else if(a instanceof ht||a instanceof ue){s=a}else if(a instanceof G){s=a.body}else{unexpected(a.start)}return new Ue({start:e,is_default:t,exported_value:s,exported_definition:u,end:prev()})}function as_property_name(){var e=r.token;switch(e.type){case"punc":if(e.value==="["){next();var t=expression(false);expect("]");return t}else unexpected(e);case"operator":if(e.value==="*"){next();return null}if(!["delete","in","instanceof","new","typeof","void"].includes(e.value)){unexpected(e)}case"name":case"privatename":case"string":case"num":case"big_int":case"keyword":case"atom":next();return e.value;default:unexpected(e)}}function as_name(){var e=r.token;if(e.type!="name"&&e.type!="privatename")unexpected();next();return e.value}function _make_symbol(e){var t=r.token.value;return new(t=="this"?Vt:t=="super"?Ut:e)({name:String(t),start:r.token,end:r.token})}function _verify_symbol(e){var t=e.name;if(is_in_generator()&&t=="yield"){token_error(e.start,"Yield cannot be used as identifier inside generators")}if(r.input.has_directive("use strict")){if(t=="yield"){token_error(e.start,"Unexpected yield identifier inside strict mode")}if(e instanceof vt&&(t=="arguments"||t=="eval")){token_error(e.start,"Unexpected "+t+" in strict mode")}}}function as_symbol(e,t){if(!is("name")){if(!t)croak("Name expected");return null}var n=_make_symbol(e);_verify_symbol(n);next();return n}function annotate(e){var t=e.start;var r=t.comments_before;const i=n.get(t);var o=i!=null?i:r.length;while(--o>=0){var a=r[o];if(/[@#]__/.test(a.value)){if(/[@#]__PURE__/.test(a.value)){set_annotation(e,nn);break}if(/[@#]__INLINE__/.test(a.value)){set_annotation(e,rn);break}if(/[@#]__NOINLINE__/.test(a.value)){set_annotation(e,on);break}}}}var subscripts=function(e,t,n){var r=e.start;if(is("punc",".")){next();const i=is("privatename")?We:Xe;return subscripts(new i({start:r,expression:e,optional:false,property:as_name(),end:prev()}),t,n)}if(is("punc","[")){next();var i=expression(true);expect("]");return subscripts(new qe({start:r,expression:e,optional:false,property:i,end:prev()}),t,n)}if(t&&is("punc","(")){next();var o=new ze({start:r,expression:e,optional:false,args:call_args(),end:prev()});annotate(o);return subscripts(o,true,n)}if(is("punc","?.")){next();let n;if(t&&is("punc","(")){next();const t=new ze({start:r,optional:true,expression:e,args:call_args(),end:prev()});annotate(t);n=subscripts(t,true,true)}else if(is("name")||is("privatename")){const i=is("privatename")?We:Xe;n=subscripts(new i({start:r,expression:e,optional:true,property:as_name(),end:prev()}),t,true)}else if(is("punc","[")){next();const i=expression(true);expect("]");n=subscripts(new qe({start:r,expression:e,optional:true,property:i,end:prev()}),t,true)}if(!n)unexpected();if(n instanceof Ye)return n;return new Ye({start:r,expression:n,end:prev()})}if(is("template_head")){if(n){unexpected()}return subscripts(new _e({start:r,prefix:e,template_string:template_string(),end:prev()}),t)}return e};function call_args(){var e=[];while(!is("punc",")")){if(is("expand","...")){next();e.push(new oe({start:prev(),expression:expression(false),end:prev()}))}else{e.push(expression(false))}if(!is("punc",")")){expect(",")}}next();return e}var maybe_unary=function(e,t){var n=r.token;if(n.type=="name"&&n.value=="await"&&can_await()){next();return _await_expression()}if(is("operator")&&O.has(n.value)){next();handle_regexp();var i=make_unary($e,n,maybe_unary(e));i.start=n;i.end=prev();return i}var o=expr_atom(e,t);while(is("operator")&&M.has(r.token.value)&&!has_newline_before(r.token)){if(o instanceof le)unexpected();o=make_unary(Ze,r.token,o);o.start=n;o.end=r.token;next()}return o};function make_unary(e,t,n){var i=t.value;switch(i){case"++":case"--":if(!is_assignable(n))croak("Invalid use of "+i+" operator",t.line,t.col,t.pos);break;case"delete":if(n instanceof It&&r.input.has_directive("use strict"))croak("Calling delete on expression not allowed in strict mode",n.start.line,n.start.col,n.start.pos);break}return new e({operator:i,expression:n})}var expr_op=function(e,t,n){var i=is("operator")?r.token.value:null;if(i=="in"&&n)i=null;if(i=="**"&&e instanceof $e&&!is_token(e.start,"punc","(")&&e.operator!=="--"&&e.operator!=="++")unexpected(e.start);var o=i!=null?w[i]:null;if(o!=null&&(o>t||i==="**"&&t===o)){next();var a=expr_op(maybe_unary(true),o,n);return expr_op(new Qe({start:e.start,left:e,operator:i,right:a,end:a.end}),t,n)}return e};function expr_ops(e){return expr_op(maybe_unary(true,true),0,e)}var maybe_conditional=function(e){var t=r.token;var n=expr_ops(e);if(is("operator","?")){next();var i=expression(false);expect(":");return new Je({start:t,condition:n,consequent:i,alternative:expression(false,e),end:prev()})}return n};function is_assignable(e){return e instanceof He||e instanceof It}function to_destructuring(e){if(e instanceof rt){e=new fe({start:e.start,names:e.properties.map(to_destructuring),is_array:false,end:e.end})}else if(e instanceof nt){var t=[];for(var n=0;n=0;){o+="this."+t[a]+" = props."+t[a]+";"}const s=r&&Object.create(r.prototype);if(s&&s.initialize||n&&n.initialize)o+="this.initialize();";o+="}";o+="this.flags = 0;";o+="}";var u=new Function(o)();if(s){u.prototype=s;u.BASE=r}if(r)r.SUBCLASSES.push(u);u.prototype.CTOR=u;u.prototype.constructor=u;u.PROPS=t||null;u.SELF_PROPS=i;u.SUBCLASSES=[];if(e){u.prototype.TYPE=u.TYPE=e}if(n)for(a in n)if(HOP(n,a)){if(a[0]==="$"){u[a.substr(1)]=n[a]}else{u.prototype[a]=n[a]}}u.DEFMETHOD=function(e,t){this.prototype[e]=t};return u}const has_tok_flag=(e,t)=>Boolean(e.flags&t);const set_tok_flag=(e,t,n)=>{if(n){e.flags|=t}else{e.flags&=~t}};const P=1;const B=2;const L=4;class AST_Token{constructor(e,t,n,r,i,o,a,s,u){this.flags=o?1:0;this.type=e;this.value=t;this.line=n;this.col=r;this.pos=i;this.comments_before=a;this.comments_after=s;this.file=u;Object.seal(this)}get nlb(){return has_tok_flag(this,P)}set nlb(e){set_tok_flag(this,P,e)}get quote(){return!has_tok_flag(this,L)?"":has_tok_flag(this,B)?"'":'"'}set quote(e){set_tok_flag(this,B,e==="'");set_tok_flag(this,L,!!e)}}var V=DEFNODE("Node","start end",{_clone:function(e){if(e){var t=this.clone();return t.transform(new TreeTransformer((function(e){if(e!==t){return e.clone(true)}})))}return new this.CTOR(this)},clone:function(e){return this._clone(e)},$documentation:"Base class of all AST nodes",$propdoc:{start:"[AST_Token] The first token of this node",end:"[AST_Token] The last token of this node"},_walk:function(e){return e._visit(this)},walk:function(e){return this._walk(e)},_children_backwards:()=>{}},null);var U=DEFNODE("Statement",null,{$documentation:"Base class of all statements"});var z=DEFNODE("Debugger",null,{$documentation:"Represents a debugger statement"},U);var K=DEFNODE("Directive","value quote",{$documentation:'Represents a directive, like "use strict";',$propdoc:{value:"[string] The value of this directive as a plain string (it's not an AST_String!)",quote:"[string] the original quote character"}},U);var G=DEFNODE("SimpleStatement","body",{$documentation:"A statement consisting of an expression, i.e. a = 1 + 2",$propdoc:{body:"[AST_Node] an expression node (should not be instanceof AST_Statement)"},_walk:function(e){return e._visit(this,(function(){this.body._walk(e)}))},_children_backwards(e){e(this.body)}},U);function walk_body(e,t){const n=e.body;for(var r=0,i=n.length;r SymbolDef for all variables/functions defined in this scope",uses_with:"[boolean/S] tells whether this scope uses the `with` statement",uses_eval:"[boolean/S] tells whether this scope contains a direct call to the global `eval`",parent_scope:"[AST_Scope?/S] link to the parent scope",enclosed:"[SymbolDef*/S] a list of all symbol definitions that are accessed from this scope or any subscopes",cname:"[integer/S] current index for mangling variables (used internally by the mangler)"},get_defun_scope:function(){var e=this;while(e.is_block_scope()){e=e.parent_scope}return e},clone:function(e,t){var n=this._clone(e);if(e&&this.variables&&t&&!this._block_scope){n.figure_out_scope({},{toplevel:t,parent_scope:this.parent_scope})}else{if(this.variables)n.variables=new Map(this.variables);if(this.enclosed)n.enclosed=this.enclosed.slice();if(this._block_scope)n._block_scope=this._block_scope}return n},pinned:function(){return this.uses_eval||this.uses_with}},H);var ie=DEFNODE("Toplevel","globals",{$documentation:"The toplevel scope",$propdoc:{globals:"[Map/S] a map of name -> SymbolDef for all undeclared names"},wrap_commonjs:function(e){var t=this.body;var n="(function(exports){'$ORIG';})(typeof "+e+"=='undefined'?("+e+"={}):"+e+");";n=parse(n);n=n.transform(new TreeTransformer((function(e){if(e instanceof K&&e.value=="$ORIG"){return i.splice(t)}})));return n},wrap_enclose:function(e){if(typeof e!="string")e="";var t=e.indexOf(":");if(t<0)t=e.length;var n=this.body;return parse(["(function(",e.slice(0,t),'){"$ORIG"})(',e.slice(t+1),")"].join("")).transform(new TreeTransformer((function(e){if(e instanceof K&&e.value=="$ORIG"){return i.splice(n)}})))}},re);var oe=DEFNODE("Expansion","expression",{$documentation:"An expandible argument, such as ...rest, a splat, such as [1,2,...all], or an expansion in a variable declaration, such as var [first, ...rest] = list",$propdoc:{expression:"[AST_Node] the thing to be expanded"},_walk:function(e){return e._visit(this,(function(){this.expression.walk(e)}))},_children_backwards(e){e(this.expression)}});var ae=DEFNODE("Lambda","name argnames uses_arguments is_generator async",{$documentation:"Base class for functions",$propdoc:{name:"[AST_SymbolDeclaration?] the name of this function",argnames:"[AST_SymbolFunarg|AST_Destructuring|AST_Expansion|AST_DefaultAssign*] array of function arguments, destructurings, or expanding arguments",uses_arguments:"[boolean/S] tells whether this function accesses the arguments array",is_generator:"[boolean] is this a generator method",async:"[boolean] is this method async"},args_as_names:function(){var e=[];for(var t=0;t b)"},ae);var ce=DEFNODE("Defun",null,{$documentation:"A function definition"},ae);var fe=DEFNODE("Destructuring","names is_array",{$documentation:"A destructuring of several names. Used in destructuring assignment and with destructuring function argument names",$propdoc:{names:"[AST_Node*] Array of properties or elements",is_array:"[Boolean] Whether the destructuring represents an object or array"},_walk:function(e){return e._visit(this,(function(){this.names.forEach((function(t){t._walk(e)}))}))},_children_backwards(e){let t=this.names.length;while(t--)e(this.names[t])},all_symbols:function(){var e=[];this.walk(new TreeWalker((function(t){if(t instanceof Et){e.push(t)}})));return e}});var _e=DEFNODE("PrefixedTemplateString","template_string prefix",{$documentation:"A templatestring with a prefix, such as String.raw`foobarbaz`",$propdoc:{template_string:"[AST_TemplateString] The template string",prefix:"[AST_Node] The prefix, which will get called."},_walk:function(e){return e._visit(this,(function(){this.prefix._walk(e);this.template_string._walk(e)}))},_children_backwards(e){e(this.template_string);e(this.prefix)}});var pe=DEFNODE("TemplateString","segments",{$documentation:"A template string literal",$propdoc:{segments:"[AST_Node*] One or more segments, starting with AST_TemplateSegment. AST_Node may follow AST_TemplateSegment, but each AST_Node must be followed by AST_TemplateSegment."},_walk:function(e){return e._visit(this,(function(){this.segments.forEach((function(t){t._walk(e)}))}))},_children_backwards(e){let t=this.segments.length;while(t--)e(this.segments[t])}});var de=DEFNODE("TemplateSegment","value raw",{$documentation:"A segment of a template string literal",$propdoc:{value:"Content of the segment",raw:"Raw source of the segment"}});var me=DEFNODE("Jump",null,{$documentation:"Base class for “jumps” (for now that's `return`, `throw`, `break` and `continue`)"},U);var he=DEFNODE("Exit","value",{$documentation:"Base class for “exits” (`return` and `throw`)",$propdoc:{value:"[AST_Node?] the value returned or thrown by this statement; could be null for AST_Return"},_walk:function(e){return e._visit(this,this.value&&function(){this.value._walk(e)})},_children_backwards(e){if(this.value)e(this.value)}},me);var Ee=DEFNODE("Return",null,{$documentation:"A `return` statement"},he);var ge=DEFNODE("Throw",null,{$documentation:"A `throw` statement"},he);var ve=DEFNODE("LoopControl","label",{$documentation:"Base class for loop control statements (`break` and `continue`)",$propdoc:{label:"[AST_LabelRef?] the label, or null if none"},_walk:function(e){return e._visit(this,this.label&&function(){this.label._walk(e)})},_children_backwards(e){if(this.label)e(this.label)}},me);var De=DEFNODE("Break",null,{$documentation:"A `break` statement"},ve);var be=DEFNODE("Continue",null,{$documentation:"A `continue` statement"},ve);var Se=DEFNODE("Await","expression",{$documentation:"An `await` statement",$propdoc:{expression:"[AST_Node] the mandatory expression being awaited"},_walk:function(e){return e._visit(this,(function(){this.expression._walk(e)}))},_children_backwards(e){e(this.expression)}});var Ae=DEFNODE("Yield","expression is_star",{$documentation:"A `yield` statement",$propdoc:{expression:"[AST_Node?] the value returned or thrown by this statement; could be null (representing undefined) but only when is_star is set to false",is_star:"[Boolean] Whether this is a yield or yield* statement"},_walk:function(e){return e._visit(this,this.expression&&function(){this.expression._walk(e)})},_children_backwards(e){if(this.expression)e(this.expression)}});var ye=DEFNODE("If","condition alternative",{$documentation:"A `if` statement",$propdoc:{condition:"[AST_Node] the `if` condition",alternative:"[AST_Statement?] the `else` part, or null if not present"},_walk:function(e){return e._visit(this,(function(){this.condition._walk(e);this.body._walk(e);if(this.alternative)this.alternative._walk(e)}))},_children_backwards(e){if(this.alternative){e(this.alternative)}e(this.body);e(this.condition)}},q);var Te=DEFNODE("Switch","expression",{$documentation:"A `switch` statement",$propdoc:{expression:"[AST_Node] the `switch` “discriminant”"},_walk:function(e){return e._visit(this,(function(){this.expression._walk(e);walk_body(this,e)}))},_children_backwards(e){let t=this.body.length;while(t--)e(this.body[t]);e(this.expression)}},H);var ke=DEFNODE("SwitchBranch",null,{$documentation:"Base class for `switch` branches"},H);var Ce=DEFNODE("Default",null,{$documentation:"A `default` switch branch"},ke);var Re=DEFNODE("Case","expression",{$documentation:"A `case` switch branch",$propdoc:{expression:"[AST_Node] the `case` expression"},_walk:function(e){return e._visit(this,(function(){this.expression._walk(e);walk_body(this,e)}))},_children_backwards(e){let t=this.body.length;while(t--)e(this.body[t]);e(this.expression)}},ke);var Fe=DEFNODE("Try","bcatch bfinally",{$documentation:"A `try` statement",$propdoc:{bcatch:"[AST_Catch?] the catch block, or null if not present",bfinally:"[AST_Finally?] the finally block, or null if not present"},_walk:function(e){return e._visit(this,(function(){walk_body(this,e);if(this.bcatch)this.bcatch._walk(e);if(this.bfinally)this.bfinally._walk(e)}))},_children_backwards(e){if(this.bfinally)e(this.bfinally);if(this.bcatch)e(this.bcatch);let t=this.body.length;while(t--)e(this.body[t])}},H);var Oe=DEFNODE("Catch","argname",{$documentation:"A `catch` node; only makes sense as part of a `try` statement",$propdoc:{argname:"[AST_SymbolCatch|AST_Destructuring|AST_Expansion|AST_DefaultAssign] symbol for the exception"},_walk:function(e){return e._visit(this,(function(){if(this.argname)this.argname._walk(e);walk_body(this,e)}))},_children_backwards(e){let t=this.body.length;while(t--)e(this.body[t]);if(this.argname)e(this.argname)}},H);var Me=DEFNODE("Finally",null,{$documentation:"A `finally` node; only makes sense as part of a `try` statement"},H);var xe=DEFNODE("Definitions","definitions",{$documentation:"Base class for `var` or `const` nodes (variable declarations/initializations)",$propdoc:{definitions:"[AST_VarDef*] array of variable definitions"},_walk:function(e){return e._visit(this,(function(){var t=this.definitions;for(var n=0,r=t.length;n a`"},Qe);var nt=DEFNODE("Array","elements",{$documentation:"An array literal",$propdoc:{elements:"[AST_Node*] array of elements"},_walk:function(e){return e._visit(this,(function(){var t=this.elements;for(var n=0,r=t.length;nt._walk(e)))}))},_children_backwards(e){let t=this.properties.length;while(t--)e(this.properties[t]);if(this.extends)e(this.extends);if(this.name)e(this.name)}},re);var pt=DEFNODE("ClassProperty","static quote",{$documentation:"A class property",$propdoc:{static:"[boolean] whether this is a static key",quote:"[string] which quote is being used"},_walk:function(e){return e._visit(this,(function(){if(this.key instanceof V)this.key._walk(e);if(this.value instanceof V)this.value._walk(e)}))},_children_backwards(e){if(this.value instanceof V)e(this.value);if(this.key instanceof V)e(this.key)},computed_key(){return!(this.key instanceof Ct)}},it);var dt=DEFNODE("ClassProperty","",{$documentation:"A class property for a private property"},pt);var mt=DEFNODE("DefClass",null,{$documentation:"A class definition"},_t);var ht=DEFNODE("ClassExpression",null,{$documentation:"A class expression."},_t);var Et=DEFNODE("Symbol","scope name thedef",{$propdoc:{name:"[string] name of this symbol",scope:"[AST_Scope/S] the current scope (not necessarily the definition scope)",thedef:"[SymbolDef/S] the definition of this symbol"},$documentation:"Base class for all symbols"});var gt=DEFNODE("NewTarget",null,{$documentation:"A reference to new.target"});var vt=DEFNODE("SymbolDeclaration","init",{$documentation:"A declaration symbol (symbol in var/const, function name or argument, symbol in catch)"},Et);var Dt=DEFNODE("SymbolVar",null,{$documentation:"Symbol defining a variable"},vt);var bt=DEFNODE("SymbolBlockDeclaration",null,{$documentation:"Base class for block-scoped declaration symbols"},vt);var St=DEFNODE("SymbolConst",null,{$documentation:"A constant declaration"},bt);var At=DEFNODE("SymbolLet",null,{$documentation:"A block-scoped `let` declaration"},bt);var yt=DEFNODE("SymbolFunarg",null,{$documentation:"Symbol naming a function argument"},Dt);var Tt=DEFNODE("SymbolDefun",null,{$documentation:"Symbol defining a function"},vt);var kt=DEFNODE("SymbolMethod",null,{$documentation:"Symbol in an object defining a method"},Et);var Ct=DEFNODE("SymbolClassProperty",null,{$documentation:"Symbol for a class property"},Et);var Rt=DEFNODE("SymbolLambda",null,{$documentation:"Symbol naming a function expression"},vt);var Ft=DEFNODE("SymbolDefClass",null,{$documentation:"Symbol naming a class's name in a class declaration. Lexically scoped to its containing scope, and accessible within the class."},bt);var Ot=DEFNODE("SymbolClass",null,{$documentation:"Symbol naming a class's name. Lexically scoped to the class."},vt);var Mt=DEFNODE("SymbolCatch",null,{$documentation:"Symbol naming the exception in catch"},bt);var xt=DEFNODE("SymbolImport",null,{$documentation:"Symbol referring to an imported name"},bt);var Nt=DEFNODE("SymbolImportForeign",null,{$documentation:"A symbol imported from a module, but it is defined in the other module, and its real name is irrelevant for this module's purposes"},Et);var wt=DEFNODE("Label","references",{$documentation:"Symbol naming a label (declaration)",$propdoc:{references:"[AST_LoopControl*] a list of nodes referring to this label"},initialize:function(){this.references=[];this.thedef=this}},Et);var It=DEFNODE("SymbolRef",null,{$documentation:"Reference to some symbol (not definition/declaration)"},Et);var Pt=DEFNODE("SymbolExport",null,{$documentation:"Symbol referring to a name to export"},It);var Bt=DEFNODE("SymbolExportForeign",null,{$documentation:"A symbol exported from this module, but it is used in the other module, and its real name is irrelevant for this module's purposes"},Et);var Lt=DEFNODE("LabelRef",null,{$documentation:"Reference to a label symbol"},Et);var Vt=DEFNODE("This",null,{$documentation:"The `this` symbol"},Et);var Ut=DEFNODE("Super",null,{$documentation:"The `super` symbol"},Vt);var zt=DEFNODE("Constant",null,{$documentation:"Base class for all constants",getValue:function(){return this.value}});var Kt=DEFNODE("String","value quote",{$documentation:"A string literal",$propdoc:{value:"[string] the contents of this string",quote:"[string] the original quote character"}},zt);var Gt=DEFNODE("Number","value raw",{$documentation:"A number literal",$propdoc:{value:"[number] the numeric value",raw:"[string] numeric value as string"}},zt);var Ht=DEFNODE("BigInt","value",{$documentation:"A big int literal",$propdoc:{value:"[string] big int value"}},zt);var Xt=DEFNODE("RegExp","value",{$documentation:"A regexp literal",$propdoc:{value:"[RegExp] the actual regexp"}},zt);var Wt=DEFNODE("Atom",null,{$documentation:"Base class for atoms"},zt);var qt=DEFNODE("Null",null,{$documentation:"The `null` atom",value:null},Wt);var Yt=DEFNODE("NaN",null,{$documentation:"The impossible value",value:0/0},Wt);var jt=DEFNODE("Undefined",null,{$documentation:"The `undefined` value",value:function(){}()},Wt);var $t=DEFNODE("Hole",null,{$documentation:"A hole in an array",value:function(){}()},Wt);var Zt=DEFNODE("Infinity",null,{$documentation:"The `Infinity` value",value:1/0},Wt);var Qt=DEFNODE("Boolean",null,{$documentation:"Base class for booleans"},Wt);var Jt=DEFNODE("False",null,{$documentation:"The `false` atom",value:false},Qt);var en=DEFNODE("True",null,{$documentation:"The `true` atom",value:true},Qt);function walk(e,t,n=[e]){const r=n.push.bind(n);while(n.length){const e=n.pop();const i=t(e,n);if(i){if(i===tn)return true;continue}e._children_backwards(r)}return false}function walk_parent(e,t,n){const r=[e];const i=r.push.bind(r);const o=n?n.slice():[];const a=[];let s;const u={parent:(e=0)=>{if(e===-1){return s}if(n&&e>=o.length){e-=o.length;return n[n.length-(e+1)]}return o[o.length-(1+e)]}};while(r.length){s=r.pop();while(a.length&&r.length==a[a.length-1]){o.pop();a.pop()}const e=t(s,u);if(e){if(e===tn)return true;continue}const n=r.length;s._children_backwards(i);if(r.length>n){o.push(s);a.push(n-1)}}return false}const tn=Symbol("abort walk");class TreeWalker{constructor(e){this.visit=e;this.stack=[];this.directives=Object.create(null)}_visit(e,t){this.push(e);var n=this.visit(e,t?function(){t.call(e)}:noop);if(!n&&t){t.call(e)}this.pop();return n}parent(e){return this.stack[this.stack.length-2-(e||0)]}push(e){if(e instanceof ae){this.directives=Object.create(this.directives)}else if(e instanceof K&&!this.directives[e.value]){this.directives[e.value]=e}else if(e instanceof _t){this.directives=Object.create(this.directives);if(!this.directives["use strict"]){this.directives["use strict"]=e}}this.stack.push(e)}pop(){var e=this.stack.pop();if(e instanceof ae||e instanceof _t){this.directives=Object.getPrototypeOf(this.directives)}}self(){return this.stack[this.stack.length-1]}find_parent(e){var t=this.stack;for(var n=t.length;--n>=0;){var r=t[n];if(r instanceof e)return r}}has_directive(e){var t=this.directives[e];if(t)return t;var n=this.stack[this.stack.length-1];if(n instanceof re&&n.body){for(var r=0;r=0;){var r=t[n];if(r instanceof Y&&r.label.name==e.label.name)return r.body}else for(var n=t.length;--n>=0;){var r=t[n];if(r instanceof j||e instanceof De&&r instanceof Te)return r}}}class TreeTransformer extends TreeWalker{constructor(e,t){super();this.before=e;this.after=t}}const nn=1;const rn=2;const on=4;var an=Object.freeze({__proto__:null,AST_Accessor:se,AST_Array:nt,AST_Arrow:le,AST_Assign:et,AST_Atom:Wt,AST_Await:Se,AST_BigInt:Ht,AST_Binary:Qe,AST_Block:H,AST_BlockStatement:X,AST_Boolean:Qt,AST_Break:De,AST_Call:ze,AST_Case:Re,AST_Catch:Oe,AST_Chain:Ye,AST_Class:_t,AST_ClassExpression:ht,AST_ClassPrivateProperty:dt,AST_ClassProperty:pt,AST_ConciseMethod:ct,AST_Conditional:Je,AST_Const:Ie,AST_Constant:zt,AST_Continue:be,AST_Debugger:z,AST_Default:Ce,AST_DefaultAssign:tt,AST_DefClass:mt,AST_Definitions:xe,AST_Defun:ce,AST_Destructuring:fe,AST_Directive:K,AST_Do:Z,AST_Dot:Xe,AST_DotHash:We,AST_DWLoop:$,AST_EmptyStatement:W,AST_Exit:he,AST_Expansion:oe,AST_Export:Ue,AST_False:Jt,AST_Finally:Me,AST_For:J,AST_ForIn:ee,AST_ForOf:te,AST_Function:ue,AST_Hole:$t,AST_If:ye,AST_Import:Le,AST_ImportMeta:Ve,AST_Infinity:Zt,AST_IterationStatement:j,AST_Jump:me,AST_Label:wt,AST_LabeledStatement:Y,AST_LabelRef:Lt,AST_Lambda:ae,AST_Let:we,AST_LoopControl:ve,AST_NameMapping:Be,AST_NaN:Yt,AST_New:Ke,AST_NewTarget:gt,AST_Node:V,AST_Null:qt,AST_Number:Gt,AST_Object:rt,AST_ObjectGetter:lt,AST_ObjectKeyVal:ot,AST_ObjectProperty:it,AST_ObjectSetter:ut,AST_PrefixedTemplateString:_e,AST_PrivateGetter:st,AST_PrivateMethod:ft,AST_PrivateSetter:at,AST_PropAccess:He,AST_RegExp:Xt,AST_Return:Ee,AST_Scope:re,AST_Sequence:Ge,AST_SimpleStatement:G,AST_Statement:U,AST_StatementWithBody:q,AST_String:Kt,AST_Sub:qe,AST_Super:Ut,AST_Switch:Te,AST_SwitchBranch:ke,AST_Symbol:Et,AST_SymbolBlockDeclaration:bt,AST_SymbolCatch:Mt,AST_SymbolClass:Ot,AST_SymbolClassProperty:Ct,AST_SymbolConst:St,AST_SymbolDeclaration:vt,AST_SymbolDefClass:Ft,AST_SymbolDefun:Tt,AST_SymbolExport:Pt,AST_SymbolExportForeign:Bt,AST_SymbolFunarg:yt,AST_SymbolImport:xt,AST_SymbolImportForeign:Nt,AST_SymbolLambda:Rt,AST_SymbolLet:At,AST_SymbolMethod:kt,AST_SymbolRef:It,AST_SymbolVar:Dt,AST_TemplateSegment:de,AST_TemplateString:pe,AST_This:Vt,AST_Throw:ge,AST_Token:AST_Token,AST_Toplevel:ie,AST_True:en,AST_Try:Fe,AST_Unary:je,AST_UnaryPostfix:Ze,AST_UnaryPrefix:$e,AST_Undefined:jt,AST_Var:Ne,AST_VarDef:Pe,AST_While:Q,AST_With:ne,AST_Yield:Ae,TreeTransformer:TreeTransformer,TreeWalker:TreeWalker,walk:walk,walk_abort:tn,walk_body:walk_body,walk_parent:walk_parent,_INLINE:rn,_NOINLINE:on,_PURE:nn});function def_transform(e,t){e.DEFMETHOD("transform",(function(e,n){let r=undefined;e.push(this);if(e.before)r=e.before(this,t,n);if(r===undefined){r=this;t(r,e);if(e.after){const t=e.after(r,n);if(t!==undefined)r=t}}e.pop();return r}))}function do_list(e,t){return i(e,(function(e){return e.transform(t,true)}))}def_transform(V,noop);def_transform(Y,(function(e,t){e.label=e.label.transform(t);e.body=e.body.transform(t)}));def_transform(G,(function(e,t){e.body=e.body.transform(t)}));def_transform(H,(function(e,t){e.body=do_list(e.body,t)}));def_transform(Z,(function(e,t){e.body=e.body.transform(t);e.condition=e.condition.transform(t)}));def_transform(Q,(function(e,t){e.condition=e.condition.transform(t);e.body=e.body.transform(t)}));def_transform(J,(function(e,t){if(e.init)e.init=e.init.transform(t);if(e.condition)e.condition=e.condition.transform(t);if(e.step)e.step=e.step.transform(t);e.body=e.body.transform(t)}));def_transform(ee,(function(e,t){e.init=e.init.transform(t);e.object=e.object.transform(t);e.body=e.body.transform(t)}));def_transform(ne,(function(e,t){e.expression=e.expression.transform(t);e.body=e.body.transform(t)}));def_transform(he,(function(e,t){if(e.value)e.value=e.value.transform(t)}));def_transform(ve,(function(e,t){if(e.label)e.label=e.label.transform(t)}));def_transform(ye,(function(e,t){e.condition=e.condition.transform(t);e.body=e.body.transform(t);if(e.alternative)e.alternative=e.alternative.transform(t)}));def_transform(Te,(function(e,t){e.expression=e.expression.transform(t);e.body=do_list(e.body,t)}));def_transform(Re,(function(e,t){e.expression=e.expression.transform(t);e.body=do_list(e.body,t)}));def_transform(Fe,(function(e,t){e.body=do_list(e.body,t);if(e.bcatch)e.bcatch=e.bcatch.transform(t);if(e.bfinally)e.bfinally=e.bfinally.transform(t)}));def_transform(Oe,(function(e,t){if(e.argname)e.argname=e.argname.transform(t);e.body=do_list(e.body,t)}));def_transform(xe,(function(e,t){e.definitions=do_list(e.definitions,t)}));def_transform(Pe,(function(e,t){e.name=e.name.transform(t);if(e.value)e.value=e.value.transform(t)}));def_transform(fe,(function(e,t){e.names=do_list(e.names,t)}));def_transform(ae,(function(e,t){if(e.name)e.name=e.name.transform(t);e.argnames=do_list(e.argnames,t);if(e.body instanceof V){e.body=e.body.transform(t)}else{e.body=do_list(e.body,t)}}));def_transform(ze,(function(e,t){e.expression=e.expression.transform(t);e.args=do_list(e.args,t)}));def_transform(Ge,(function(e,t){const n=do_list(e.expressions,t);e.expressions=n.length?n:[new Gt({value:0})]}));def_transform(Xe,(function(e,t){e.expression=e.expression.transform(t)}));def_transform(qe,(function(e,t){e.expression=e.expression.transform(t);e.property=e.property.transform(t)}));def_transform(Ye,(function(e,t){e.expression=e.expression.transform(t)}));def_transform(Ae,(function(e,t){if(e.expression)e.expression=e.expression.transform(t)}));def_transform(Se,(function(e,t){e.expression=e.expression.transform(t)}));def_transform(je,(function(e,t){e.expression=e.expression.transform(t)}));def_transform(Qe,(function(e,t){e.left=e.left.transform(t);e.right=e.right.transform(t)}));def_transform(Je,(function(e,t){e.condition=e.condition.transform(t);e.consequent=e.consequent.transform(t);e.alternative=e.alternative.transform(t)}));def_transform(nt,(function(e,t){e.elements=do_list(e.elements,t)}));def_transform(rt,(function(e,t){e.properties=do_list(e.properties,t)}));def_transform(it,(function(e,t){if(e.key instanceof V){e.key=e.key.transform(t)}if(e.value)e.value=e.value.transform(t)}));def_transform(_t,(function(e,t){if(e.name)e.name=e.name.transform(t);if(e.extends)e.extends=e.extends.transform(t);e.properties=do_list(e.properties,t)}));def_transform(oe,(function(e,t){e.expression=e.expression.transform(t)}));def_transform(Be,(function(e,t){e.foreign_name=e.foreign_name.transform(t);e.name=e.name.transform(t)}));def_transform(Le,(function(e,t){if(e.imported_name)e.imported_name=e.imported_name.transform(t);if(e.imported_names)do_list(e.imported_names,t);e.module_name=e.module_name.transform(t)}));def_transform(Ue,(function(e,t){if(e.exported_definition)e.exported_definition=e.exported_definition.transform(t);if(e.exported_value)e.exported_value=e.exported_value.transform(t);if(e.exported_names)do_list(e.exported_names,t);if(e.module_name)e.module_name=e.module_name.transform(t)}));def_transform(pe,(function(e,t){e.segments=do_list(e.segments,t)}));def_transform(_e,(function(e,t){e.prefix=e.prefix.transform(t);e.template_string=e.template_string.transform(t)}));(function(){var normalize_directives=function(e){var t=true;for(var n=0;n1||e.guardedHandlers&&e.guardedHandlers.length){throw new Error("Multiple catch clauses are not supported.")}return new Fe({start:my_start_token(e),end:my_end_token(e),body:from_moz(e.block).body,bcatch:from_moz(t[0]),bfinally:e.finalizer?new Me(from_moz(e.finalizer)):null})},Property:function(e){var t=e.key;var n={start:my_start_token(t||e.value),end:my_end_token(e.value),key:t.type=="Identifier"?t.name:t.value,value:from_moz(e.value)};if(e.computed){n.key=from_moz(e.key)}if(e.method){n.is_generator=e.value.generator;n.async=e.value.async;if(!e.computed){n.key=new kt({name:n.key})}else{n.key=from_moz(e.key)}return new ct(n)}if(e.kind=="init"){if(t.type!="Identifier"&&t.type!="Literal"){n.key=from_moz(t)}return new ot(n)}if(typeof n.key==="string"||typeof n.key==="number"){n.key=new kt({name:n.key})}n.value=new se(n.value);if(e.kind=="get")return new lt(n);if(e.kind=="set")return new ut(n);if(e.kind=="method"){n.async=e.value.async;n.is_generator=e.value.generator;n.quote=e.computed?'"':null;return new ct(n)}},MethodDefinition:function(e){var t={start:my_start_token(e),end:my_end_token(e),key:e.computed?from_moz(e.key):new kt({name:e.key.name||e.key.value}),value:from_moz(e.value),static:e.static};if(e.kind=="get"){return new lt(t)}if(e.kind=="set"){return new ut(t)}t.is_generator=e.value.generator;t.async=e.value.async;return new ct(t)},FieldDefinition:function(e){let t;if(e.computed){t=from_moz(e.key)}else{if(e.key.type!=="Identifier")throw new Error("Non-Identifier key in FieldDefinition");t=from_moz(e.key)}return new pt({start:my_start_token(e),end:my_end_token(e),key:t,value:from_moz(e.value),static:e.static})},PropertyDefinition:function(e){let t;if(e.computed){t=from_moz(e.key)}else{if(e.key.type!=="Identifier")throw new Error("Non-Identifier key in PropertyDefinition");t=from_moz(e.key)}return new pt({start:my_start_token(e),end:my_end_token(e),key:t,value:from_moz(e.value),static:e.static})},ArrayExpression:function(e){return new nt({start:my_start_token(e),end:my_end_token(e),elements:e.elements.map((function(e){return e===null?new $t:from_moz(e)}))})},ObjectExpression:function(e){return new rt({start:my_start_token(e),end:my_end_token(e),properties:e.properties.map((function(e){if(e.type==="SpreadElement"){return from_moz(e)}e.type="Property";return from_moz(e)}))})},SequenceExpression:function(e){return new Ge({start:my_start_token(e),end:my_end_token(e),expressions:e.expressions.map(from_moz)})},MemberExpression:function(e){return new(e.computed?qe:Xe)({start:my_start_token(e),end:my_end_token(e),property:e.computed?from_moz(e.property):e.property.name,expression:from_moz(e.object),optional:e.optional||false})},ChainExpression:function(e){return new Ye({start:my_start_token(e),end:my_end_token(e),expression:from_moz(e.expression)})},SwitchCase:function(e){return new(e.test?Re:Ce)({start:my_start_token(e),end:my_end_token(e),expression:from_moz(e.test),body:e.consequent.map(from_moz)})},VariableDeclaration:function(e){return new(e.kind==="const"?Ie:e.kind==="let"?we:Ne)({start:my_start_token(e),end:my_end_token(e),definitions:e.declarations.map(from_moz)})},ImportDeclaration:function(e){var t=null;var n=null;e.specifiers.forEach((function(e){if(e.type==="ImportSpecifier"){if(!n){n=[]}n.push(new Be({start:my_start_token(e),end:my_end_token(e),foreign_name:from_moz(e.imported),name:from_moz(e.local)}))}else if(e.type==="ImportDefaultSpecifier"){t=from_moz(e.local)}else if(e.type==="ImportNamespaceSpecifier"){if(!n){n=[]}n.push(new Be({start:my_start_token(e),end:my_end_token(e),foreign_name:new Nt({name:"*"}),name:from_moz(e.local)}))}}));return new Le({start:my_start_token(e),end:my_end_token(e),imported_name:t,imported_names:n,module_name:from_moz(e.source)})},ExportAllDeclaration:function(e){return new Ue({start:my_start_token(e),end:my_end_token(e),exported_names:[new Be({name:new Bt({name:"*"}),foreign_name:new Bt({name:"*"})})],module_name:from_moz(e.source)})},ExportNamedDeclaration:function(e){return new Ue({start:my_start_token(e),end:my_end_token(e),exported_definition:from_moz(e.declaration),exported_names:e.specifiers&&e.specifiers.length?e.specifiers.map((function(e){return new Be({foreign_name:from_moz(e.exported),name:from_moz(e.local)})})):null,module_name:from_moz(e.source)})},ExportDefaultDeclaration:function(e){return new Ue({start:my_start_token(e),end:my_end_token(e),exported_value:from_moz(e.declaration),is_default:true})},Literal:function(e){var t=e.value,n={start:my_start_token(e),end:my_end_token(e)};var r=e.regex;if(r&&r.pattern){n.value={source:r.pattern,flags:r.flags};return new Xt(n)}else if(r){const r=e.raw||t;const i=r.match(/^\/(.*)\/(\w*)$/);if(!i)throw new Error("Invalid regex source "+r);const[o,a,s]=i;n.value={source:a,flags:s};return new Xt(n)}if(t===null)return new qt(n);switch(typeof t){case"string":n.value=t;return new Kt(n);case"number":n.value=t;n.raw=e.raw||t.toString();return new Gt(n);case"boolean":return new(t?en:Jt)(n)}},MetaProperty:function(e){if(e.meta.name==="new"&&e.property.name==="target"){return new gt({start:my_start_token(e),end:my_end_token(e)})}else if(e.meta.name==="import"&&e.property.name==="meta"){return new Ve({start:my_start_token(e),end:my_end_token(e)})}},Identifier:function(e){var n=t[t.length-2];return new(n.type=="LabeledStatement"?wt:n.type=="VariableDeclarator"&&n.id===e?n.kind=="const"?St:n.kind=="let"?At:Dt:/Import.*Specifier/.test(n.type)?n.local===e?xt:Nt:n.type=="ExportSpecifier"?n.local===e?Pt:Bt:n.type=="FunctionExpression"?n.id===e?Rt:yt:n.type=="FunctionDeclaration"?n.id===e?Tt:yt:n.type=="ArrowFunctionExpression"?n.params.includes(e)?yt:It:n.type=="ClassExpression"?n.id===e?Ot:It:n.type=="Property"?n.key===e&&n.computed||n.value===e?It:kt:n.type=="PropertyDefinition"||n.type==="FieldDefinition"?n.key===e&&n.computed||n.value===e?It:Ct:n.type=="ClassDeclaration"?n.id===e?Ft:It:n.type=="MethodDefinition"?n.computed?It:kt:n.type=="CatchClause"?Mt:n.type=="BreakStatement"||n.type=="ContinueStatement"?Lt:It)({start:my_start_token(e),end:my_end_token(e),name:e.name})},BigIntLiteral(e){return new Ht({start:my_start_token(e),end:my_end_token(e),value:e.value})}};e.UpdateExpression=e.UnaryExpression=function To_Moz_Unary(e){var t="prefix"in e?e.prefix:e.type=="UnaryExpression"?true:false;return new(t?$e:Ze)({start:my_start_token(e),end:my_end_token(e),operator:e.operator,expression:from_moz(e.argument)})};e.ClassDeclaration=e.ClassExpression=function From_Moz_Class(e){return new(e.type==="ClassDeclaration"?mt:ht)({start:my_start_token(e),end:my_end_token(e),name:from_moz(e.id),extends:from_moz(e.superClass),properties:e.body.body.map(from_moz)})};map("EmptyStatement",W);map("BlockStatement",X,"body@body");map("IfStatement",ye,"test>condition, consequent>body, alternate>alternative");map("LabeledStatement",Y,"label>label, body>body");map("BreakStatement",De,"label>label");map("ContinueStatement",be,"label>label");map("WithStatement",ne,"object>expression, body>body");map("SwitchStatement",Te,"discriminant>expression, cases@body");map("ReturnStatement",Ee,"argument>value");map("ThrowStatement",ge,"argument>value");map("WhileStatement",Q,"test>condition, body>body");map("DoWhileStatement",Z,"test>condition, body>body");map("ForStatement",J,"init>init, test>condition, update>step, body>body");map("ForInStatement",ee,"left>init, right>object, body>body");map("ForOfStatement",te,"left>init, right>object, body>body, await=await");map("AwaitExpression",Se,"argument>expression");map("YieldExpression",Ae,"argument>expression, delegate=is_star");map("DebuggerStatement",z);map("VariableDeclarator",Pe,"id>name, init>value");map("CatchClause",Oe,"param>argname, body%body");map("ThisExpression",Vt);map("Super",Ut);map("BinaryExpression",Qe,"operator=operator, left>left, right>right");map("LogicalExpression",Qe,"operator=operator, left>left, right>right");map("AssignmentExpression",et,"operator=operator, left>left, right>right");map("ConditionalExpression",Je,"test>condition, consequent>consequent, alternate>alternative");map("NewExpression",Ke,"callee>expression, arguments@args");map("CallExpression",ze,"callee>expression, optional=optional, arguments@args");def_to_moz(ie,(function To_Moz_Program(e){return to_moz_scope("Program",e)}));def_to_moz(oe,(function To_Moz_Spread(e){return{type:to_moz_in_destructuring()?"RestElement":"SpreadElement",argument:to_moz(e.expression)}}));def_to_moz(_e,(function To_Moz_TaggedTemplateExpression(e){return{type:"TaggedTemplateExpression",tag:to_moz(e.prefix),quasi:to_moz(e.template_string)}}));def_to_moz(pe,(function To_Moz_TemplateLiteral(e){var t=[];var n=[];for(var r=0;r({type:"BigIntLiteral",value:e.value})));Qt.DEFMETHOD("to_mozilla_ast",zt.prototype.to_mozilla_ast);qt.DEFMETHOD("to_mozilla_ast",zt.prototype.to_mozilla_ast);$t.DEFMETHOD("to_mozilla_ast",(function To_Moz_ArrayHole(){return null}));H.DEFMETHOD("to_mozilla_ast",X.prototype.to_mozilla_ast);ae.DEFMETHOD("to_mozilla_ast",ue.prototype.to_mozilla_ast);function my_start_token(e){var t=e.loc,n=t&&t.start;var r=e.range;return new AST_Token("","",n&&n.line||0,n&&n.column||0,r?r[0]:e.start,false,[],[],t&&t.source)}function my_end_token(e){var t=e.loc,n=t&&t.end;var r=e.range;return new AST_Token("","",n&&n.line||0,n&&n.column||0,r?r[0]:e.end,false,[],[],t&&t.source)}function map(t,n,r){var i="function From_Moz_"+t+"(M){\n";i+="return new U2."+n.name+"({\n"+"start: my_start_token(M),\n"+"end: my_end_token(M)";var o="function To_Moz_"+t+"(M){\n";o+="return {\n"+"type: "+JSON.stringify(t);if(r)r.split(/\s*,\s*/).forEach((function(e){var t=/([a-z0-9$_]+)([=@>%])([a-z0-9$_]+)/i.exec(e);if(!t)throw new Error("Can't understand property map: "+e);var n=t[1],r=t[2],a=t[3];i+=",\n"+a+": ";o+=",\n"+n+": ";switch(r){case"@":i+="M."+n+".map(from_moz)";o+="M."+a+".map(to_moz)";break;case">":i+="from_moz(M."+n+")";o+="to_moz(M."+a+")";break;case"=":i+="M."+n;o+="M."+a;break;case"%":i+="from_moz(M."+n+").body";o+="to_moz_block(M)";break;default:throw new Error("Can't understand operator in propmap: "+e)}}));i+="\n})\n}";o+="\n}\n}";i=new Function("U2","my_start_token","my_end_token","from_moz","return("+i+")")(an,my_start_token,my_end_token,from_moz);o=new Function("to_moz","to_moz_block","to_moz_scope","return("+o+")")(to_moz,to_moz_block,to_moz_scope);e[t]=i;def_to_moz(n,o)}var t=null;function from_moz(n){t.push(n);var r=n!=null?e[n.type](n):null;t.pop();return r}V.from_mozilla_ast=function(e){var n=t;t=[];var r=from_moz(e);t=n;return r};function set_moz_loc(e,t){var n=e.start;var r=e.end;if(!(n&&r)){return t}if(n.pos!=null&&r.endpos!=null){t.range=[n.pos,r.endpos]}if(n.line){t.loc={start:{line:n.line,column:n.col},end:r.endline?{line:r.endline,column:r.endcol}:null};if(n.file){t.loc.source=n.file}}return t}function def_to_moz(e,t){e.DEFMETHOD("to_mozilla_ast",(function(e){return set_moz_loc(this,t(this,e))}))}var n=null;function to_moz(e){if(n===null){n=[]}n.push(e);var t=e!=null?e.to_mozilla_ast(n[n.length-2]):null;n.pop();if(n.length===0){n=null}return t}function to_moz_in_destructuring(){var e=n.length;while(e--){if(n[e]instanceof fe){return true}}return false}function to_moz_block(e){return{type:"BlockStatement",body:e.body.map(to_moz)}}function to_moz_scope(e,t){var n=t.body.map(to_moz);if(t.body[0]instanceof G&&t.body[0].body instanceof Kt){n.unshift(to_moz(new W(t.body[0])))}return{type:e,body:n}}})();function first_in_statement(e){let t=e.parent(-1);for(let n=0,r;r=e.parent(n);n++){if(r instanceof U&&r.body===t)return true;if(r instanceof Ge&&r.expressions[0]===t||r.TYPE==="Call"&&r.expression===t||r instanceof _e&&r.prefix===t||r instanceof Xe&&r.expression===t||r instanceof qe&&r.expression===t||r instanceof Je&&r.condition===t||r instanceof Qe&&r.left===t||r instanceof Ze&&r.expression===t){t=r}else{return false}}}function left_is_object(e){if(e instanceof rt)return true;if(e instanceof Ge)return left_is_object(e.expressions[0]);if(e.TYPE==="Call")return left_is_object(e.expression);if(e instanceof _e)return left_is_object(e.prefix);if(e instanceof Xe||e instanceof qe)return left_is_object(e.expression);if(e instanceof Je)return left_is_object(e.condition);if(e instanceof Qe)return left_is_object(e.left);if(e instanceof Ze)return left_is_object(e.expression);return false}const sn=/^$|[;{][\s\n]*$/;const un=10;const ln=32;const cn=/[@#]__(PURE|INLINE|NOINLINE)__/g;function is_some_comments(e){return(e.type==="comment2"||e.type==="comment1")&&/@preserve|@lic|@cc_on|^\**!/i.test(e.value)}function OutputStream(e){var t=!e;e=defaults(e,{ascii_only:false,beautify:false,braces:false,comments:"some",ecma:5,ie8:false,indent_level:4,indent_start:0,inline_script:true,keep_numbers:false,keep_quoted_props:false,max_line_len:false,preamble:null,preserve_annotations:false,quote_keys:false,quote_style:0,safari10:false,semicolons:true,shebang:true,shorthand:undefined,source_map:null,webkit:false,width:80,wrap_iife:false,wrap_func_args:true},true);if(e.shorthand===undefined)e.shorthand=e.ecma>5;var n=return_false;if(e.comments){let t=e.comments;if(typeof e.comments==="string"&&/^\/.*\/[a-zA-Z]*$/.test(e.comments)){var r=e.comments.lastIndexOf("/");t=new RegExp(e.comments.substr(1,r-1),e.comments.substr(r+1))}if(t instanceof RegExp){n=function(e){return e.type!="comment5"&&t.test(e.value)}}else if(typeof t==="function"){n=function(e){return e.type!="comment5"&&t(this,e)}}else if(t==="some"){n=is_some_comments}else{n=return_true}}var i=0;var o=0;var a=1;var s=0;var u="";let l=new Set;var c=e.ascii_only?function(t,n){if(e.ecma>=2015&&!e.safari10){t=t.replace(/[\ud800-\udbff][\udc00-\udfff]/g,(function(e){var t=get_full_char_code(e,0).toString(16);return"\\u{"+t+"}"}))}return t.replace(/[\u0000-\u001f\u007f-\uffff]/g,(function(e){var t=e.charCodeAt(0).toString(16);if(t.length<=2&&!n){while(t.length<2)t="0"+t;return"\\x"+t}else{while(t.length<4)t="0"+t;return"\\u"+t}}))}:function(e){return e.replace(/[\ud800-\udbff][\udc00-\udfff]|([\ud800-\udbff]|[\udc00-\udfff])/g,(function(e,t){if(t){return"\\u"+t.charCodeAt(0).toString(16)}return e}))};function make_string(t,n){var r=0,i=0;t=t.replace(/[\\\b\f\n\r\v\t\x22\x27\u2028\u2029\0\ufeff]/g,(function(n,o){switch(n){case'"':++r;return'"';case"'":++i;return"'";case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r";case"\t":return"\\t";case"\b":return"\\b";case"\f":return"\\f";case"\v":return e.ie8?"\\x0B":"\\v";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";case"\ufeff":return"\\ufeff";case"\0":return/[0-9]/.test(get_full_char(t,o+1))?"\\x00":"\\0"}return n}));function quote_single(){return"'"+t.replace(/\x27/g,"\\'")+"'"}function quote_double(){return'"'+t.replace(/\x22/g,'\\"')+'"'}function quote_template(){return"`"+t.replace(/`/g,"\\`")+"`"}t=c(t);if(n==="`")return quote_template();switch(e.quote_style){case 1:return quote_single();case 2:return quote_double();case 3:return n=="'"?quote_single():quote_double();default:return r>i?quote_single():quote_double()}}function encode_string(t,n){var r=make_string(t,n);if(e.inline_script){r=r.replace(/<\x2f(script)([>\/\t\n\f\r ])/gi,"<\\/$1$2");r=r.replace(/\x3c!--/g,"\\x3c!--");r=r.replace(/--\x3e/g,"--\\x3e")}return r}function make_name(e){e=e.toString();e=c(e,true);return e}function make_indent(t){return" ".repeat(e.indent_start+i-t*e.indent_level)}var f=false;var _=false;var p=false;var d=0;var m=false;var h=false;var E=-1;var g="";var v,D,b=e.source_map&&[];var S=b?function(){b.forEach((function(t){try{let n=!t.name&&t.token.type=="name"?t.token.value:t.name;if(n instanceof Et){n=n.name}e.source_map.add(t.token.file,t.line,t.col,t.token.line,t.token.col,is_basic_identifier_string(n)?n:undefined)}catch(e){}}));b=[]}:noop;var A=e.max_line_len?function(){if(o>e.max_line_len){if(d){var t=u.slice(0,d);var n=u.slice(d);if(b){var r=n.length-o;b.forEach((function(e){e.line++;e.col+=r}))}u=t+"\n"+n;a++;s++;o=n.length}}if(d){d=0;S()}}:noop;var y=makePredicate("( [ + * / - , . `");function print(t){t=String(t);var n=get_full_char(t,0);if(m&&n){m=false;if(n!=="\n"){print("\n");k()}}if(h&&n){h=false;if(!/[\s;})]/.test(n)){T()}}E=-1;var r=g.charAt(g.length-1);if(p){p=false;if(r===":"&&n==="}"||(!n||!";}".includes(n))&&r!==";"){if(e.semicolons||y.has(n)){u+=";";o++;s++}else{A();if(o>0){u+="\n";s++;a++;o=0}if(/^\s+$/.test(t)){p=true}}if(!e.beautify)_=false}}if(_){if(is_identifier_char(r)&&(is_identifier_char(n)||n=="\\")||n=="/"&&n==r||(n=="+"||n=="-")&&n==g){u+=" ";o++;s++}_=false}if(v){b.push({token:v,name:D,line:a,col:o});v=false;if(!d)S()}u+=t;f=t[t.length-1]=="(";s+=t.length;var i=t.split(/\r?\n/),l=i.length-1;a+=l;o+=i[0].length;if(l>0){A();o=i[l].length}g=t}var star=function(){print("*")};var T=e.beautify?function(){print(" ")}:function(){_=true};var k=e.beautify?function(t){if(e.beautify){print(make_indent(t?.5:0))}}:noop;var C=e.beautify?function(e,t){if(e===true)e=next_indent();var n=i;i=e;var r=t();i=n;return r}:function(e,t){return t()};var R=e.beautify?function(){if(E<0)return print("\n");if(u[E]!="\n"){u=u.slice(0,E)+"\n"+u.slice(E);s++;a++}E++}:e.max_line_len?function(){A();d=u.length}:noop;var F=e.beautify?function(){print(";")}:function(){p=true};function force_semicolon(){p=false;print(";")}function next_indent(){return i+e.indent_level}function with_block(e){var t;print("{");R();C(next_indent(),(function(){t=e()}));k();print("}");return t}function with_parens(e){print("(");var t=e();print(")");return t}function with_square(e){print("[");var t=e();print("]");return t}function comma(){print(",");T()}function colon(){print(":");T()}var O=b?function(e,t){v=e;D=t}:noop;function get(){if(d){A()}return u}function has_nlb(){let e=u.length-1;while(e>=0){const t=u.charCodeAt(e);if(t===un){return true}if(t!==ln){return false}e--}return true}function filter_comment(t){if(!e.preserve_annotations){t=t.replace(cn," ")}if(/^\s*$/.test(t)){return""}return t.replace(/(<\s*\/\s*)(script)/i,"<\\/$2")}function prepend_comments(t){var r=this;var i=t.start;if(!i)return;var o=r.printed_comments;const a=t instanceof he&&t.value;if(i.comments_before&&o.has(i.comments_before)){if(a){i.comments_before=[]}else{return}}var u=i.comments_before;if(!u){u=i.comments_before=[]}o.add(u);if(a){var l=new TreeWalker((function(e){var t=l.parent();if(t instanceof he||t instanceof Qe&&t.left===e||t.TYPE=="Call"&&t.expression===e||t instanceof Je&&t.condition===e||t instanceof Xe&&t.expression===e||t instanceof Ge&&t.expressions[0]===e||t instanceof qe&&t.expression===e||t instanceof Ze){if(!e.start)return;var n=e.start.comments_before;if(n&&!o.has(n)){o.add(n);u=u.concat(n)}}else{return true}}));l.push(t);t.value.walk(l)}if(s==0){if(u.length>0&&e.shebang&&u[0].type==="comment5"&&!o.has(u[0])){print("#!"+u.shift().value+"\n");k()}var c=e.preamble;if(c){print(c.replace(/\r\n?|[\n\u2028\u2029]|\s*$/g,"\n"))}}u=u.filter(n,t).filter((e=>!o.has(e)));if(u.length==0)return;var f=has_nlb();u.forEach((function(e,t){o.add(e);if(!f){if(e.nlb){print("\n");k();f=true}else if(t>0){T()}}if(/comment[134]/.test(e.type)){var n=filter_comment(e.value);if(n){print("//"+n+"\n");k()}f=true}else if(e.type=="comment2"){var n=filter_comment(e.value);if(n){print("/*"+n+"*/")}f=false}}));if(!f){if(i.nlb){print("\n");k()}else{T()}}}function append_comments(e,t){var r=this;var i=e.end;if(!i)return;var o=r.printed_comments;var a=i[t?"comments_before":"comments_after"];if(!a||o.has(a))return;if(!(e instanceof U||a.every((e=>!/comment[134]/.test(e.type)))))return;o.add(a);var s=u.length;a.filter(n,e).forEach((function(e,n){if(o.has(e))return;o.add(e);h=false;if(m){print("\n");k();m=false}else if(e.nlb&&(n>0||!has_nlb())){print("\n");k()}else if(n>0||!t){T()}if(/comment[134]/.test(e.type)){const t=filter_comment(e.value);if(t){print("//"+t)}m=true}else if(e.type=="comment2"){const t=filter_comment(e.value);if(t){print("/*"+t+"*/")}h=true}}));if(u.length>s)E=s}var M=[];return{get:get,toString:get,indent:k,in_directive:false,use_asm:null,active_scope:null,indentation:function(){return i},current_width:function(){return o-i},should_break:function(){return e.width&&this.current_width()>=e.width},has_parens:function(){return f},newline:R,print:print,star:star,space:T,comma:comma,colon:colon,last:function(){return g},semicolon:F,force_semicolon:force_semicolon,to_utf8:c,print_name:function(e){print(make_name(e))},print_string:function(e,t,n){var r=encode_string(e,t);if(n===true&&!r.includes("\\")){if(!sn.test(u)){force_semicolon()}force_semicolon()}print(r)},print_template_string_chars:function(e){var t=encode_string(e,"`").replace(/\${/g,"\\${");return print(t.substr(1,t.length-2))},encode_string:encode_string,next_indent:next_indent,with_indent:C,with_block:with_block,with_parens:with_parens,with_square:with_square,add_mapping:O,option:function(t){return e[t]},printed_comments:l,prepend_comments:t?noop:prepend_comments,append_comments:t||n===return_false?noop:append_comments,line:function(){return a},col:function(){return o},pos:function(){return s},push_node:function(e){M.push(e)},pop_node:function(){return M.pop()},parent:function(e){return M[M.length-2-(e||0)]}}}(function(){function DEFPRINT(e,t){e.DEFMETHOD("_codegen",t)}V.DEFMETHOD("print",(function(e,t){var n=this,r=n._codegen;if(n instanceof re){e.active_scope=n}else if(!e.use_asm&&n instanceof K&&n.value=="use asm"){e.use_asm=e.active_scope}function doit(){e.prepend_comments(n);n.add_source_map(e);r(n,e);e.append_comments(n)}e.push_node(n);if(t||n.needs_parens(e)){e.with_parens(doit)}else{doit()}e.pop_node();if(n===e.use_asm){e.use_asm=null}}));V.DEFMETHOD("_print",V.prototype.print);V.DEFMETHOD("print_to_string",(function(e){var t=OutputStream(e);this.print(t);return t.get()}));function PARENS(e,t){if(Array.isArray(e)){e.forEach((function(e){PARENS(e,t)}))}else{e.DEFMETHOD("needs_parens",t)}}PARENS(V,return_false);PARENS(ue,(function(e){if(!e.has_parens()&&first_in_statement(e)){return true}if(e.option("webkit")){var t=e.parent();if(t instanceof He&&t.expression===this){return true}}if(e.option("wrap_iife")){var t=e.parent();if(t instanceof ze&&t.expression===this){return true}}if(e.option("wrap_func_args")){var t=e.parent();if(t instanceof ze&&t.args.includes(this)){return true}}return false}));PARENS(le,(function(e){var t=e.parent();if(e.option("wrap_func_args")&&t instanceof ze&&t.args.includes(this)){return true}return t instanceof He&&t.expression===this}));PARENS(rt,(function(e){return!e.has_parens()&&first_in_statement(e)}));PARENS(ht,first_in_statement);PARENS(je,(function(e){var t=e.parent();return t instanceof He&&t.expression===this||t instanceof ze&&t.expression===this||t instanceof Qe&&t.operator==="**"&&this instanceof $e&&t.left===this&&this.operator!=="++"&&this.operator!=="--"}));PARENS(Se,(function(e){var t=e.parent();return t instanceof He&&t.expression===this||t instanceof ze&&t.expression===this||t instanceof Qe&&t.operator==="**"&&t.left===this||e.option("safari10")&&t instanceof $e}));PARENS(Ge,(function(e){var t=e.parent();return t instanceof ze||t instanceof je||t instanceof Qe||t instanceof Pe||t instanceof He||t instanceof nt||t instanceof it||t instanceof Je||t instanceof le||t instanceof tt||t instanceof oe||t instanceof te&&this===t.object||t instanceof Ae||t instanceof Ue}));PARENS(Qe,(function(e){var t=e.parent();if(t instanceof ze&&t.expression===this)return true;if(t instanceof je)return true;if(t instanceof He&&t.expression===this)return true;if(t instanceof Qe){const e=t.operator;const n=this.operator;if(n==="??"&&(e==="||"||e==="&&")){return true}if(e==="??"&&(n==="||"||n==="&&")){return true}const r=w[e];const i=w[n];if(r>i||r==i&&(this===t.right||e=="**")){return true}}}));PARENS(Ae,(function(e){var t=e.parent();if(t instanceof Qe&&t.operator!=="=")return true;if(t instanceof ze&&t.expression===this)return true;if(t instanceof Je&&t.condition===this)return true;if(t instanceof je)return true;if(t instanceof He&&t.expression===this)return true}));PARENS(He,(function(e){var t=e.parent();if(t instanceof Ke&&t.expression===this){return walk(this,(e=>{if(e instanceof re)return true;if(e instanceof ze){return tn}}))}}));PARENS(ze,(function(e){var t=e.parent(),n;if(t instanceof Ke&&t.expression===this||t instanceof Ue&&t.is_default&&this.expression instanceof ue)return true;return this.expression instanceof ue&&t instanceof He&&t.expression===this&&(n=e.parent(1))instanceof et&&n.left===t}));PARENS(Ke,(function(e){var t=e.parent();if(this.args.length===0&&(t instanceof He||t instanceof ze&&t.expression===this))return true}));PARENS(Gt,(function(e){var t=e.parent();if(t instanceof He&&t.expression===this){var n=this.getValue();if(n<0||/^0/.test(make_num(n))){return true}}}));PARENS(Ht,(function(e){var t=e.parent();if(t instanceof He&&t.expression===this){var n=this.getValue();if(n.startsWith("-")){return true}}}));PARENS([et,Je],(function(e){var t=e.parent();if(t instanceof je)return true;if(t instanceof Qe&&!(t instanceof et))return true;if(t instanceof ze&&t.expression===this)return true;if(t instanceof Je&&t.condition===this)return true;if(t instanceof He&&t.expression===this)return true;if(this instanceof et&&this.left instanceof fe&&this.left.is_array===false)return true}));DEFPRINT(K,(function(e,t){t.print_string(e.value,e.quote);t.semicolon()}));DEFPRINT(oe,(function(e,t){t.print("...");e.expression.print(t)}));DEFPRINT(fe,(function(e,t){t.print(e.is_array?"[":"{");var n=e.names.length;e.names.forEach((function(e,r){if(r>0)t.comma();e.print(t);if(r==n-1&&e instanceof $t)t.comma()}));t.print(e.is_array?"]":"}")}));DEFPRINT(z,(function(e,t){t.print("debugger");t.semicolon()}));function display_body(e,t,n,r){var i=e.length-1;n.in_directive=r;e.forEach((function(e,r){if(n.in_directive===true&&!(e instanceof K||e instanceof W||e instanceof G&&e.body instanceof Kt)){n.in_directive=false}if(!(e instanceof W)){n.indent();e.print(n);if(!(r==i&&t)){n.newline();if(t)n.newline()}}if(n.in_directive===true&&e instanceof G&&e.body instanceof Kt){n.in_directive=false}}));n.in_directive=false}q.DEFMETHOD("_do_print_body",(function(e){force_statement(this.body,e)}));DEFPRINT(U,(function(e,t){e.body.print(t);t.semicolon()}));DEFPRINT(ie,(function(e,t){display_body(e.body,true,t,true);t.print("")}));DEFPRINT(Y,(function(e,t){e.label.print(t);t.colon();e.body.print(t)}));DEFPRINT(G,(function(e,t){e.body.print(t);t.semicolon()}));function print_braced_empty(e,t){t.print("{");t.with_indent(t.next_indent(),(function(){t.append_comments(e,true)}));t.print("}")}function print_braced(e,t,n){if(e.body.length>0){t.with_block((function(){display_body(e.body,false,t,n)}))}else print_braced_empty(e,t)}DEFPRINT(X,(function(e,t){print_braced(e,t)}));DEFPRINT(W,(function(e,t){t.semicolon()}));DEFPRINT(Z,(function(e,t){t.print("do");t.space();make_block(e.body,t);t.space();t.print("while");t.space();t.with_parens((function(){e.condition.print(t)}));t.semicolon()}));DEFPRINT(Q,(function(e,t){t.print("while");t.space();t.with_parens((function(){e.condition.print(t)}));t.space();e._do_print_body(t)}));DEFPRINT(J,(function(e,t){t.print("for");t.space();t.with_parens((function(){if(e.init){if(e.init instanceof xe){e.init.print(t)}else{parenthesize_for_noin(e.init,t,true)}t.print(";");t.space()}else{t.print(";")}if(e.condition){e.condition.print(t);t.print(";");t.space()}else{t.print(";")}if(e.step){e.step.print(t)}}));t.space();e._do_print_body(t)}));DEFPRINT(ee,(function(e,t){t.print("for");if(e.await){t.space();t.print("await")}t.space();t.with_parens((function(){e.init.print(t);t.space();t.print(e instanceof te?"of":"in");t.space();e.object.print(t)}));t.space();e._do_print_body(t)}));DEFPRINT(ne,(function(e,t){t.print("with");t.space();t.with_parens((function(){e.expression.print(t)}));t.space();e._do_print_body(t)}));ae.DEFMETHOD("_do_print",(function(e,t){var n=this;if(!t){if(n.async){e.print("async");e.space()}e.print("function");if(n.is_generator){e.star()}if(n.name){e.space()}}if(n.name instanceof Et){n.name.print(e)}else if(t&&n.name instanceof V){e.with_square((function(){n.name.print(e)}))}e.with_parens((function(){n.argnames.forEach((function(t,n){if(n)e.comma();t.print(e)}))}));e.space();print_braced(n,e,true)}));DEFPRINT(ae,(function(e,t){e._do_print(t)}));DEFPRINT(_e,(function(e,t){var n=e.prefix;var r=n instanceof ae||n instanceof Qe||n instanceof Je||n instanceof Ge||n instanceof je||n instanceof Xe&&n.expression instanceof rt;if(r)t.print("(");e.prefix.print(t);if(r)t.print(")");e.template_string.print(t)}));DEFPRINT(pe,(function(e,t){var n=t.parent()instanceof _e;t.print("`");for(var r=0;r");e.space();const i=t.body[0];if(t.body.length===1&&i instanceof Ee){const t=i.value;if(!t){e.print("{}")}else if(left_is_object(t)){e.print("(");t.print(e);e.print(")")}else{t.print(e)}}else{print_braced(t,e)}if(r){e.print(")")}}));he.DEFMETHOD("_do_print",(function(e,t){e.print(t);if(this.value){e.space();const t=this.value.start.comments_before;if(t&&t.length&&!e.printed_comments.has(t)){e.print("(");this.value.print(e);e.print(")")}else{this.value.print(e)}}e.semicolon()}));DEFPRINT(Ee,(function(e,t){e._do_print(t,"return")}));DEFPRINT(ge,(function(e,t){e._do_print(t,"throw")}));DEFPRINT(Ae,(function(e,t){var n=e.is_star?"*":"";t.print("yield"+n);if(e.expression){t.space();e.expression.print(t)}}));DEFPRINT(Se,(function(e,t){t.print("await");t.space();var n=e.expression;var r=!(n instanceof ze||n instanceof It||n instanceof He||n instanceof je||n instanceof zt||n instanceof Se||n instanceof rt);if(r)t.print("(");e.expression.print(t);if(r)t.print(")")}));ve.DEFMETHOD("_do_print",(function(e,t){e.print(t);if(this.label){e.space();this.label.print(e)}e.semicolon()}));DEFPRINT(De,(function(e,t){e._do_print(t,"break")}));DEFPRINT(be,(function(e,t){e._do_print(t,"continue")}));function make_then(e,t){var n=e.body;if(t.option("braces")||t.option("ie8")&&n instanceof Z)return make_block(n,t);if(!n)return t.force_semicolon();while(true){if(n instanceof ye){if(!n.alternative){make_block(e.body,t);return}n=n.alternative}else if(n instanceof q){n=n.body}else break}force_statement(e.body,t)}DEFPRINT(ye,(function(e,t){t.print("if");t.space();t.with_parens((function(){e.condition.print(t)}));t.space();if(e.alternative){make_then(e,t);t.space();t.print("else");t.space();if(e.alternative instanceof ye)e.alternative.print(t);else force_statement(e.alternative,t)}else{e._do_print_body(t)}}));DEFPRINT(Te,(function(e,t){t.print("switch");t.space();t.with_parens((function(){e.expression.print(t)}));t.space();var n=e.body.length-1;if(n<0)print_braced_empty(e,t);else t.with_block((function(){e.body.forEach((function(e,r){t.indent(true);e.print(t);if(r0)t.newline()}))}))}));ke.DEFMETHOD("_do_print_body",(function(e){e.newline();this.body.forEach((function(t){e.indent();t.print(e);e.newline()}))}));DEFPRINT(Ce,(function(e,t){t.print("default:");e._do_print_body(t)}));DEFPRINT(Re,(function(e,t){t.print("case");t.space();e.expression.print(t);t.print(":");e._do_print_body(t)}));DEFPRINT(Fe,(function(e,t){t.print("try");t.space();print_braced(e,t);if(e.bcatch){t.space();e.bcatch.print(t)}if(e.bfinally){t.space();e.bfinally.print(t)}}));DEFPRINT(Oe,(function(e,t){t.print("catch");if(e.argname){t.space();t.with_parens((function(){e.argname.print(t)}))}t.space();print_braced(e,t)}));DEFPRINT(Me,(function(e,t){t.print("finally");t.space();print_braced(e,t)}));xe.DEFMETHOD("_do_print",(function(e,t){e.print(t);e.space();this.definitions.forEach((function(t,n){if(n)e.comma();t.print(e)}));var n=e.parent();var r=n instanceof J||n instanceof ee;var i=!r||n&&n.init!==this;if(i)e.semicolon()}));DEFPRINT(we,(function(e,t){e._do_print(t,"let")}));DEFPRINT(Ne,(function(e,t){e._do_print(t,"var")}));DEFPRINT(Ie,(function(e,t){e._do_print(t,"const")}));DEFPRINT(Le,(function(e,t){t.print("import");t.space();if(e.imported_name){e.imported_name.print(t)}if(e.imported_name&&e.imported_names){t.print(",");t.space()}if(e.imported_names){if(e.imported_names.length===1&&e.imported_names[0].foreign_name.name==="*"){e.imported_names[0].print(t)}else{t.print("{");e.imported_names.forEach((function(n,r){t.space();n.print(t);if(r{if(e instanceof re)return true;if(e instanceof Qe&&e.operator=="in"){return tn}}))}e.print(t,r)}DEFPRINT(Pe,(function(e,t){e.name.print(t);if(e.value){t.space();t.print("=");t.space();var n=t.parent(1);var r=n instanceof J||n instanceof ee;parenthesize_for_noin(e.value,t,r)}}));DEFPRINT(ze,(function(e,t){e.expression.print(t);if(e instanceof Ke&&e.args.length===0)return;if(e.expression instanceof ze||e.expression instanceof ae){t.add_mapping(e.start)}if(e.optional)t.print("?.");t.with_parens((function(){e.args.forEach((function(e,n){if(n)t.comma();e.print(t)}))}))}));DEFPRINT(Ke,(function(e,t){t.print("new");t.space();ze.prototype._codegen(e,t)}));Ge.DEFMETHOD("_do_print",(function(e){this.expressions.forEach((function(t,n){if(n>0){e.comma();if(e.should_break()){e.newline();e.indent()}}t.print(e)}))}));DEFPRINT(Ge,(function(e,t){e._do_print(t)}));DEFPRINT(Xe,(function(e,t){var n=e.expression;n.print(t);var r=e.property;var i=f.has(r)?t.option("ie8"):!is_identifier_string(r,t.option("ecma")>=2015||t.option("safari10"));if(e.optional)t.print("?.");if(i){t.print("[");t.add_mapping(e.end);t.print_string(r);t.print("]")}else{if(n instanceof Gt&&n.getValue()>=0){if(!/[xa-f.)]/i.test(t.last())){t.print(".")}}if(!e.optional)t.print(".");t.add_mapping(e.end);t.print_name(r)}}));DEFPRINT(We,(function(e,t){var n=e.expression;n.print(t);var r=e.property;if(e.optional)t.print("?");t.print(".#");t.print_name(r)}));DEFPRINT(qe,(function(e,t){e.expression.print(t);if(e.optional)t.print("?.");t.print("[");e.property.print(t);t.print("]")}));DEFPRINT(Ye,(function(e,t){e.expression.print(t)}));DEFPRINT($e,(function(e,t){var n=e.operator;t.print(n);if(/^[a-z]/i.test(n)||/[+-]$/.test(n)&&e.expression instanceof $e&&/^[+-]/.test(e.expression.operator)){t.space()}e.expression.print(t)}));DEFPRINT(Ze,(function(e,t){e.expression.print(t);t.print(e.operator)}));DEFPRINT(Qe,(function(e,t){var n=e.operator;e.left.print(t);if(n[0]==">"&&e.left instanceof Ze&&e.left.operator=="--"){t.print(" ")}else{t.space()}t.print(n);if((n=="<"||n=="<<")&&e.right instanceof $e&&e.right.operator=="!"&&e.right.expression instanceof $e&&e.right.expression.operator=="--"){t.print(" ")}else{t.space()}e.right.print(t)}));DEFPRINT(Je,(function(e,t){e.condition.print(t);t.space();t.print("?");t.space();e.consequent.print(t);t.space();t.colon();e.alternative.print(t)}));DEFPRINT(nt,(function(e,t){t.with_square((function(){var n=e.elements,r=n.length;if(r>0)t.space();n.forEach((function(e,n){if(n)t.comma();e.print(t);if(n===r-1&&e instanceof $t)t.comma()}));if(r>0)t.space()}))}));DEFPRINT(rt,(function(e,t){if(e.properties.length>0)t.with_block((function(){e.properties.forEach((function(e,n){if(n){t.print(",");t.newline()}t.indent();e.print(t)}));t.newline()}));else print_braced_empty(e,t)}));DEFPRINT(_t,(function(e,t){t.print("class");t.space();if(e.name){e.name.print(t);t.space()}if(e.extends){var n=!(e.extends instanceof It)&&!(e.extends instanceof He)&&!(e.extends instanceof ht)&&!(e.extends instanceof ue);t.print("extends");if(n){t.print("(")}else{t.space()}e.extends.print(t);if(n){t.print(")")}else{t.space()}}if(e.properties.length>0)t.with_block((function(){e.properties.forEach((function(e,n){if(n){t.newline()}t.indent();e.print(t)}));t.newline()}));else t.print("{}")}));DEFPRINT(gt,(function(e,t){t.print("new.target")}));function print_property_name(e,t,n){if(n.option("quote_keys")){return n.print_string(e)}if(""+ +e==e&&e>=0){if(n.option("keep_numbers")){return n.print(e)}return n.print(make_num(e))}var r=f.has(e)?n.option("ie8"):n.option("ecma")<2015||n.option("safari10")?!is_basic_identifier_string(e):!is_identifier_string(e,true);if(r||t&&n.option("keep_quoted_props")){return n.print_string(e,t)}return n.print_name(e)}DEFPRINT(ot,(function(e,t){function get_name(e){var t=e.definition();return t?t.mangled_name||t.name:e.name}var n=t.option("shorthand");if(n&&e.value instanceof Et&&is_identifier_string(e.key,t.option("ecma")>=2015||t.option("safari10"))&&get_name(e.value)===e.key&&!f.has(e.key)){print_property_name(e.key,e.quote,t)}else if(n&&e.value instanceof tt&&e.value.left instanceof Et&&is_identifier_string(e.key,t.option("ecma")>=2015||t.option("safari10"))&&get_name(e.value.left)===e.key){print_property_name(e.key,e.quote,t);t.space();t.print("=");t.space();e.value.right.print(t)}else{if(!(e.key instanceof V)){print_property_name(e.key,e.quote,t)}else{t.with_square((function(){e.key.print(t)}))}t.colon();e.value.print(t)}}));DEFPRINT(dt,((e,t)=>{if(e.static){t.print("static");t.space()}t.print("#");print_property_name(e.key.name,e.quote,t);if(e.value){t.print("=");e.value.print(t)}t.semicolon()}));DEFPRINT(pt,((e,t)=>{if(e.static){t.print("static");t.space()}if(e.key instanceof Ct){print_property_name(e.key.name,e.quote,t)}else{t.print("[");e.key.print(t);t.print("]")}if(e.value){t.print("=");e.value.print(t)}t.semicolon()}));it.DEFMETHOD("_print_getter_setter",(function(e,t,n){var r=this;if(r.static){n.print("static");n.space()}if(e){n.print(e);n.space()}if(r.key instanceof kt){if(t)n.print("#");print_property_name(r.key.name,r.quote,n)}else{n.with_square((function(){r.key.print(n)}))}r.value._do_print(n,true)}));DEFPRINT(ut,(function(e,t){e._print_getter_setter("set",false,t)}));DEFPRINT(lt,(function(e,t){e._print_getter_setter("get",false,t)}));DEFPRINT(at,(function(e,t){e._print_getter_setter("set",true,t)}));DEFPRINT(st,(function(e,t){e._print_getter_setter("get",true,t)}));DEFPRINT(ft,(function(e,t){var n;if(e.is_generator&&e.async){n="async*"}else if(e.is_generator){n="*"}else if(e.async){n="async"}e._print_getter_setter(n,true,t)}));DEFPRINT(ct,(function(e,t){var n;if(e.is_generator&&e.async){n="async*"}else if(e.is_generator){n="*"}else if(e.async){n="async"}e._print_getter_setter(n,false,t)}));Et.DEFMETHOD("_do_print",(function(e){var t=this.definition();e.print_name(t?t.mangled_name||t.name:this.name)}));DEFPRINT(Et,(function(e,t){e._do_print(t)}));DEFPRINT($t,noop);DEFPRINT(Vt,(function(e,t){t.print("this")}));DEFPRINT(Ut,(function(e,t){t.print("super")}));DEFPRINT(zt,(function(e,t){t.print(e.getValue())}));DEFPRINT(Kt,(function(e,t){t.print_string(e.getValue(),e.quote,t.in_directive)}));DEFPRINT(Gt,(function(e,t){if((t.option("keep_numbers")||t.use_asm)&&e.raw){t.print(e.raw)}else{t.print(make_num(e.getValue()))}}));DEFPRINT(Ht,(function(e,t){t.print(e.getValue()+"n")}));const e=/(<\s*\/\s*script)/i;const slash_script_replace=(e,t)=>t.replace("/","\\/");DEFPRINT(Xt,(function(t,n){let{source:r,flags:i}=t.getValue();r=regexp_source_fix(r);i=i?sort_regexp_flags(i):"";r=r.replace(e,slash_script_replace);n.print(n.to_utf8(`/${r}/${i}`));const o=n.parent();if(o instanceof Qe&&/^\w/.test(o.operator)&&o.left===t){n.print(" ")}}));function force_statement(e,t){if(t.option("braces")){make_block(e,t)}else{if(!e||e instanceof W)t.force_semicolon();else e.print(t)}}function best_of(e){var t=e[0],n=t.length;for(var r=1;re===null&&t===null||e.TYPE===t.TYPE&&e.shallow_cmp(t);const equivalent_to=(e,t)=>{if(!shallow_cmp(e,t))return false;const n=[e];const r=[t];const i=n.push.bind(n);const o=r.push.bind(r);while(n.length&&r.length){const e=n.pop();const t=r.pop();if(!shallow_cmp(e,t))return false;e._children_backwards(i);t._children_backwards(o);if(n.length!==r.length){return false}}return n.length==0&&r.length==0};const mkshallow=e=>{const t=Object.keys(e).map((t=>{if(e[t]==="eq"){return`this.${t} === other.${t}`}else if(e[t]==="exist"){return`(this.${t} == null ? other.${t} == null : this.${t} === other.${t})`}else{throw new Error(`mkshallow: Unexpected instruction: ${e[t]}`)}})).join(" && ");return new Function("other","return "+t)};const pass_through=()=>true;V.prototype.shallow_cmp=function(){throw new Error("did not find a shallow_cmp function for "+this.constructor.name)};z.prototype.shallow_cmp=pass_through;K.prototype.shallow_cmp=mkshallow({value:"eq"});G.prototype.shallow_cmp=pass_through;H.prototype.shallow_cmp=pass_through;W.prototype.shallow_cmp=pass_through;Y.prototype.shallow_cmp=mkshallow({"label.name":"eq"});Z.prototype.shallow_cmp=pass_through;Q.prototype.shallow_cmp=pass_through;J.prototype.shallow_cmp=mkshallow({init:"exist",condition:"exist",step:"exist"});ee.prototype.shallow_cmp=pass_through;te.prototype.shallow_cmp=pass_through;ne.prototype.shallow_cmp=pass_through;ie.prototype.shallow_cmp=pass_through;oe.prototype.shallow_cmp=pass_through;ae.prototype.shallow_cmp=mkshallow({is_generator:"eq",async:"eq"});fe.prototype.shallow_cmp=mkshallow({is_array:"eq"});_e.prototype.shallow_cmp=pass_through;pe.prototype.shallow_cmp=pass_through;de.prototype.shallow_cmp=mkshallow({value:"eq"});me.prototype.shallow_cmp=pass_through;ve.prototype.shallow_cmp=pass_through;Se.prototype.shallow_cmp=pass_through;Ae.prototype.shallow_cmp=mkshallow({is_star:"eq"});ye.prototype.shallow_cmp=mkshallow({alternative:"exist"});Te.prototype.shallow_cmp=pass_through;ke.prototype.shallow_cmp=pass_through;Fe.prototype.shallow_cmp=mkshallow({bcatch:"exist",bfinally:"exist"});Oe.prototype.shallow_cmp=mkshallow({argname:"exist"});Me.prototype.shallow_cmp=pass_through;xe.prototype.shallow_cmp=pass_through;Pe.prototype.shallow_cmp=mkshallow({value:"exist"});Be.prototype.shallow_cmp=pass_through;Le.prototype.shallow_cmp=mkshallow({imported_name:"exist",imported_names:"exist"});Ve.prototype.shallow_cmp=pass_through;Ue.prototype.shallow_cmp=mkshallow({exported_definition:"exist",exported_value:"exist",exported_names:"exist",module_name:"eq",is_default:"eq"});ze.prototype.shallow_cmp=pass_through;Ge.prototype.shallow_cmp=pass_through;He.prototype.shallow_cmp=pass_through;Ye.prototype.shallow_cmp=pass_through;Xe.prototype.shallow_cmp=mkshallow({property:"eq"});We.prototype.shallow_cmp=mkshallow({property:"eq"});je.prototype.shallow_cmp=mkshallow({operator:"eq"});Qe.prototype.shallow_cmp=mkshallow({operator:"eq"});Je.prototype.shallow_cmp=pass_through;nt.prototype.shallow_cmp=pass_through;rt.prototype.shallow_cmp=pass_through;it.prototype.shallow_cmp=pass_through;ot.prototype.shallow_cmp=mkshallow({key:"eq"});ut.prototype.shallow_cmp=mkshallow({static:"eq"});lt.prototype.shallow_cmp=mkshallow({static:"eq"});ct.prototype.shallow_cmp=mkshallow({static:"eq",is_generator:"eq",async:"eq"});_t.prototype.shallow_cmp=mkshallow({name:"exist",extends:"exist"});pt.prototype.shallow_cmp=mkshallow({static:"eq"});Et.prototype.shallow_cmp=mkshallow({name:"eq"});gt.prototype.shallow_cmp=pass_through;Vt.prototype.shallow_cmp=pass_through;Ut.prototype.shallow_cmp=pass_through;Kt.prototype.shallow_cmp=mkshallow({value:"eq"});Gt.prototype.shallow_cmp=mkshallow({value:"eq"});Ht.prototype.shallow_cmp=mkshallow({value:"eq"});Xt.prototype.shallow_cmp=function(e){return this.value.flags===e.value.flags&&this.value.source===e.value.source};Wt.prototype.shallow_cmp=pass_through;const _n=1<<0;const pn=1<<1;let dn=null;let mn=null;class SymbolDef{constructor(e,t,n){this.name=t.name;this.orig=[t];this.init=n;this.eliminated=0;this.assignments=0;this.scope=e;this.replaced=0;this.global=false;this.export=0;this.mangled_name=null;this.undeclared=false;this.id=SymbolDef.next_id++;this.chained=false;this.direct_access=false;this.escaped=0;this.recursive_refs=0;this.references=[];this.should_replace=undefined;this.single_use=false;this.fixed=false;Object.seal(this)}fixed_value(){if(!this.fixed||this.fixed instanceof V)return this.fixed;return this.fixed()}unmangleable(e){if(!e)e={};if(dn&&dn.has(this.id)&&keep_name(e.keep_fnames,this.orig[0].name))return true;return this.global&&!e.toplevel||this.export&_n||this.undeclared||!e.eval&&this.scope.pinned()||(this.orig[0]instanceof Rt||this.orig[0]instanceof Tt)&&keep_name(e.keep_fnames,this.orig[0].name)||this.orig[0]instanceof kt||(this.orig[0]instanceof Ot||this.orig[0]instanceof Ft)&&keep_name(e.keep_classnames,this.orig[0].name)}mangle(e){const t=e.cache&&e.cache.props;if(this.global&&t&&t.has(this.name)){this.mangled_name=t.get(this.name)}else if(!this.mangled_name&&!this.unmangleable(e)){var n=this.scope;var r=this.orig[0];if(e.ie8&&r instanceof Rt)n=n.parent_scope;const i=redefined_catch_def(this);this.mangled_name=i?i.mangled_name||i.name:n.next_mangled(e,this);if(this.global&&t){t.set(this.name,this.mangled_name)}}}}SymbolDef.next_id=1;function redefined_catch_def(e){if(e.orig[0]instanceof Mt&&e.scope.is_block_scope()){return e.scope.get_defun_scope().variables.get(e.name)}}re.DEFMETHOD("figure_out_scope",(function(e,{parent_scope:t=null,toplevel:n=this}={}){e=defaults(e,{cache:null,ie8:false,safari10:false});if(!(n instanceof ie)){throw new Error("Invalid toplevel scope")}var r=this.parent_scope=t;var i=new Map;var o=null;var a=null;var s=[];var u=new TreeWalker(((t,n)=>{if(t.is_block_scope()){const i=r;t.block_scope=r=new re(t);r._block_scope=true;const o=t instanceof Oe?i.parent_scope:i;r.init_scope_vars(o);r.uses_with=i.uses_with;r.uses_eval=i.uses_eval;if(e.safari10){if(t instanceof J||t instanceof ee){s.push(r)}}if(t instanceof Te){const e=r;r=i;t.expression.walk(u);r=e;for(let e=0;e{if(e===t)return true;if(t instanceof bt){return e instanceof Rt}return!(e instanceof At||e instanceof St)}))){js_error(`"${t.name}" is redeclared`,t.start.file,t.start.line,t.start.col,t.start.pos)}if(!(t instanceof yt))mark_export(d,2);if(o!==r){t.mark_enclosed();var d=r.find_variable(t);if(t.thedef!==d){t.thedef=d;t.reference()}}}else if(t instanceof Lt){var m=i.get(t.name);if(!m)throw new Error(string_template("Undefined label {name} [{line},{col}]",{name:t.name,line:t.start.line,col:t.start.col}));t.thedef=m}if(!(r instanceof ie)&&(t instanceof Ue||t instanceof Le)){js_error(`"${t.TYPE}" statement may only appear at the top level`,t.start.file,t.start.line,t.start.col,t.start.pos)}}));this.walk(u);function mark_export(e,t){if(a){var n=0;do{t++}while(u.parent(n++)!==a)}var r=u.parent(t);if(e.export=r instanceof Ue?_n:0){var i=r.exported_definition;if((i instanceof ce||i instanceof mt)&&r.is_default){e.export=pn}}}const l=this instanceof ie;if(l){this.globals=new Map}var u=new TreeWalker((e=>{if(e instanceof ve&&e.label){e.label.thedef.references.push(e);return true}if(e instanceof It){var t=e.name;if(t=="eval"&&u.parent()instanceof ze){for(var r=e.scope;r&&!r.uses_eval;r=r.parent_scope){r.uses_eval=true}}var i;if(u.parent()instanceof Be&&u.parent(1).module_name||!(i=e.scope.find_variable(t))){i=n.def_global(e);if(e instanceof Pt)i.export=_n}else if(i.scope instanceof ae&&t=="arguments"){i.scope.uses_arguments=true}e.thedef=i;e.reference();if(e.scope.is_block_scope()&&!(i.orig[0]instanceof bt)){e.scope=e.scope.get_defun_scope()}return true}var o;if(e instanceof Mt&&(o=redefined_catch_def(e.definition()))){var r=e.scope;while(r){push_uniq(r.enclosed,o);if(r===o.scope)break;r=r.parent_scope}}}));this.walk(u);if(e.ie8||e.safari10){walk(this,(e=>{if(e instanceof Mt){var t=e.name;var r=e.thedef.references;var i=e.scope.get_defun_scope();var o=i.find_variable(t)||n.globals.get(t)||i.def_variable(e);r.forEach((function(e){e.thedef=o;e.reference()}));e.thedef=o;e.reference();return true}}))}if(e.safari10){for(const e of s){e.parent_scope.variables.forEach((function(t){push_uniq(e.enclosed,t)}))}}}));ie.DEFMETHOD("def_global",(function(e){var t=this.globals,n=e.name;if(t.has(n)){return t.get(n)}else{var r=new SymbolDef(this,e);r.undeclared=true;r.global=true;t.set(n,r);return r}}));re.DEFMETHOD("init_scope_vars",(function(e){this.variables=new Map;this.uses_with=false;this.uses_eval=false;this.parent_scope=e;this.enclosed=[];this.cname=-1}));re.DEFMETHOD("conflicting_def",(function(e){return this.enclosed.find((t=>t.name===e))||this.variables.has(e)||this.parent_scope&&this.parent_scope.conflicting_def(e)}));re.DEFMETHOD("conflicting_def_shallow",(function(e){return this.enclosed.find((t=>t.name===e))||this.variables.has(e)}));re.DEFMETHOD("add_child_scope",(function(e){if(e.parent_scope===this)return;e.parent_scope=this;const t=(()=>{const e=[];let t=this;do{e.push(t)}while(t=t.parent_scope);e.reverse();return e})();const n=new Set(e.enclosed);const r=[];for(const e of t){r.forEach((t=>push_uniq(e.enclosed,t)));for(const t of e.variables.values()){if(n.has(t)){push_uniq(r,t);push_uniq(e.enclosed,t)}}}}));function find_scopes_visible_from(e){const t=new Set;for(const n of new Set(e)){(function bubble_up(e){if(e==null||t.has(e))return;t.add(e);bubble_up(e.parent_scope)})(n)}return[...t]}re.DEFMETHOD("create_symbol",(function(e,{source:t,tentative_name:n,scope:r,conflict_scopes:i=[r],init:o=null}={}){let a;i=find_scopes_visible_from(i);if(n){n=a=n.replace(/(?:^[^a-z_$]|[^a-z0-9_$])/gi,"_");let e=0;while(i.find((e=>e.conflicting_def_shallow(a)))){a=n+"$"+e++}}if(!a){throw new Error("No symbol name could be generated in create_symbol()")}const s=make_node(e,t,{name:a,scope:r});this.def_variable(s,o||null);s.mark_enclosed();return s}));V.DEFMETHOD("is_block_scope",return_false);_t.DEFMETHOD("is_block_scope",return_false);ae.DEFMETHOD("is_block_scope",return_false);ie.DEFMETHOD("is_block_scope",return_false);ke.DEFMETHOD("is_block_scope",return_false);H.DEFMETHOD("is_block_scope",return_true);re.DEFMETHOD("is_block_scope",(function(){return this._block_scope||false}));j.DEFMETHOD("is_block_scope",return_true);ae.DEFMETHOD("init_scope_vars",(function(){re.prototype.init_scope_vars.apply(this,arguments);this.uses_arguments=false;this.def_variable(new yt({name:"arguments",start:this.start,end:this.end}))}));le.DEFMETHOD("init_scope_vars",(function(){re.prototype.init_scope_vars.apply(this,arguments);this.uses_arguments=false}));Et.DEFMETHOD("mark_enclosed",(function(){var e=this.definition();var t=this.scope;while(t){push_uniq(t.enclosed,e);if(t===e.scope)break;t=t.parent_scope}}));Et.DEFMETHOD("reference",(function(){this.definition().references.push(this);this.mark_enclosed()}));re.DEFMETHOD("find_variable",(function(e){if(e instanceof Et)e=e.name;return this.variables.get(e)||this.parent_scope&&this.parent_scope.find_variable(e)}));re.DEFMETHOD("def_function",(function(e,t){var n=this.def_variable(e,t);if(!n.init||n.init instanceof ce)n.init=t;return n}));re.DEFMETHOD("def_variable",(function(e,t){var n=this.variables.get(e.name);if(n){n.orig.push(e);if(n.init&&(n.scope!==e.scope||n.init instanceof ue)){n.init=t}}else{n=new SymbolDef(this,e,t);this.variables.set(e.name,n);n.global=!this.parent_scope}return e.thedef=n}));function next_mangled(e,t){var n=e.enclosed;e:while(true){var r=hn(++e.cname);if(f.has(r))continue;if(t.reserved.has(r))continue;if(mn&&mn.has(r))continue e;for(let e=n.length;--e>=0;){const i=n[e];const o=i.mangled_name||i.unmangleable(t)&&i.name;if(r==o)continue e}return r}}re.DEFMETHOD("next_mangled",(function(e){return next_mangled(this,e)}));ie.DEFMETHOD("next_mangled",(function(e){let t;const n=this.mangled_names;do{t=next_mangled(this,e)}while(n.has(t));return t}));ue.DEFMETHOD("next_mangled",(function(e,t){var n=t.orig[0]instanceof yt&&this.name&&this.name.definition();var r=n?n.mangled_name||n.name:null;while(true){var i=next_mangled(this,e);if(!r||r!=i)return i}}));Et.DEFMETHOD("unmangleable",(function(e){var t=this.definition();return!t||t.unmangleable(e)}));wt.DEFMETHOD("unmangleable",return_false);Et.DEFMETHOD("unreferenced",(function(){return!this.definition().references.length&&!this.scope.pinned()}));Et.DEFMETHOD("definition",(function(){return this.thedef}));Et.DEFMETHOD("global",(function(){return this.thedef.global}));ie.DEFMETHOD("_default_mangler_options",(function(e){e=defaults(e,{eval:false,ie8:false,keep_classnames:false,keep_fnames:false,module:false,reserved:[],toplevel:false});if(e.module)e.toplevel=true;if(!Array.isArray(e.reserved)&&!(e.reserved instanceof Set)){e.reserved=[]}e.reserved=new Set(e.reserved);e.reserved.add("arguments");return e}));ie.DEFMETHOD("mangle_names",(function(e){e=this._default_mangler_options(e);var t=-1;var n=[];if(e.keep_fnames){dn=new Set}const r=this.mangled_names=new Set;if(e.cache){this.globals.forEach(collect);if(e.cache.props){e.cache.props.forEach((function(e){r.add(e)}))}}var i=new TreeWalker((function(r,i){if(r instanceof Y){var o=t;i();t=o;return true}if(r instanceof re){r.variables.forEach(collect);return}if(r.is_block_scope()){r.block_scope.variables.forEach(collect);return}if(dn&&r instanceof Pe&&r.value instanceof ae&&!r.value.name&&keep_name(e.keep_fnames,r.name.name)){dn.add(r.name.definition().id);return}if(r instanceof wt){let e;do{e=hn(++t)}while(f.has(e));r.mangled_name=e;return true}if(!(e.ie8||e.safari10)&&r instanceof Mt){n.push(r.definition());return}}));this.walk(i);if(e.keep_fnames||e.keep_classnames){mn=new Set;n.forEach((t=>{if(t.name.length<6&&t.unmangleable(e)){mn.add(t.name)}}))}n.forEach((t=>{t.mangle(e)}));dn=null;mn=null;function collect(t){const r=!e.reserved.has(t.name)&&!(t.export&_n);if(r){n.push(t)}}}));ie.DEFMETHOD("find_colliding_names",(function(e){const t=e.cache&&e.cache.props;const n=new Set;e.reserved.forEach(to_avoid);this.globals.forEach(add_def);this.walk(new TreeWalker((function(e){if(e instanceof re)e.variables.forEach(add_def);if(e instanceof Mt)add_def(e.definition())})));return n;function to_avoid(e){n.add(e)}function add_def(n){var r=n.name;if(n.global&&t&&t.has(r))r=t.get(r);else if(!n.unmangleable(e))return;to_avoid(r)}}));ie.DEFMETHOD("expand_names",(function(e){hn.reset();hn.sort();e=this._default_mangler_options(e);var t=this.find_colliding_names(e);var n=0;this.globals.forEach(rename);this.walk(new TreeWalker((function(e){if(e instanceof re)e.variables.forEach(rename);if(e instanceof Mt)rename(e.definition())})));function next_name(){var e;do{e=hn(n++)}while(t.has(e)||f.has(e));return e}function rename(t){if(t.global&&e.cache)return;if(t.unmangleable(e))return;if(e.reserved.has(t.name))return;const n=redefined_catch_def(t);const r=t.name=n?n.name:next_name();t.orig.forEach((function(e){e.name=r}));t.references.forEach((function(e){e.name=r}))}}));V.DEFMETHOD("tail_node",return_this);Ge.DEFMETHOD("tail_node",(function(){return this.expressions[this.expressions.length-1]}));ie.DEFMETHOD("compute_char_frequency",(function(e){e=this._default_mangler_options(e);try{V.prototype.print=function(t,n){this._print(t,n);if(this instanceof Et&&!this.unmangleable(e)){hn.consider(this.name,-1)}else if(e.properties){if(this instanceof We){hn.consider("#"+this.property,-1)}else if(this instanceof Xe){hn.consider(this.property,-1)}else if(this instanceof qe){skip_string(this.property)}}};hn.consider(this.print_to_string(),1)}finally{V.prototype.print=V.prototype._print}hn.sort();function skip_string(e){if(e instanceof Kt){hn.consider(e.value,-1)}else if(e instanceof Je){skip_string(e.consequent);skip_string(e.alternative)}else if(e instanceof Ge){skip_string(e.tail_node())}}}));const hn=(()=>{const e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_".split("");const t="0123456789".split("");let n;let r;function reset(){r=new Map;e.forEach((function(e){r.set(e,0)}));t.forEach((function(e){r.set(e,0)}))}base54.consider=function(e,t){for(var n=e.length;--n>=0;){r.set(e[n],r.get(e[n])+t)}};function compare(e,t){return r.get(t)-r.get(e)}base54.sort=function(){n=mergeSort(e,compare).concat(mergeSort(t,compare))};base54.reset=reset;reset();function base54(e){var t="",r=54;e++;do{e--;t+=n[e%r];e=Math.floor(e/r);r=64}while(e>0);return t}return base54})();let En=undefined;V.prototype.size=function(e,t){En=e&&e.mangle_options;let n=0;walk_parent(this,((e,t)=>{n+=e._size(t);if(e instanceof le&&e.is_braceless()){n+=e.body[0].value._size(t);return true}}),t||e&&e.stack);En=undefined;return n};V.prototype._size=()=>0;z.prototype._size=()=>8;K.prototype._size=function(){return 2+this.value.length};const list_overhead=e=>e.length&&e.length-1;H.prototype._size=function(){return 2+list_overhead(this.body)};ie.prototype._size=function(){return list_overhead(this.body)};W.prototype._size=()=>1;Y.prototype._size=()=>2;Z.prototype._size=()=>9;Q.prototype._size=()=>7;J.prototype._size=()=>8;ee.prototype._size=()=>8;ne.prototype._size=()=>6;oe.prototype._size=()=>3;const lambda_modifiers=e=>(e.is_generator?1:0)+(e.async?6:0);se.prototype._size=function(){return lambda_modifiers(this)+4+list_overhead(this.argnames)+list_overhead(this.body)};ue.prototype._size=function(e){const t=!!first_in_statement(e);return t*2+lambda_modifiers(this)+12+list_overhead(this.argnames)+list_overhead(this.body)};ce.prototype._size=function(){return lambda_modifiers(this)+13+list_overhead(this.argnames)+list_overhead(this.body)};le.prototype._size=function(){let e=2+list_overhead(this.argnames);if(!(this.argnames.length===1&&this.argnames[0]instanceof Et)){e+=2}const t=this.is_braceless()?0:list_overhead(this.body)+2;return lambda_modifiers(this)+e+t};fe.prototype._size=()=>2;pe.prototype._size=function(){return 2+Math.floor(this.segments.length/2)*3};de.prototype._size=function(){return this.value.length};Ee.prototype._size=function(){return this.value?7:6};ge.prototype._size=()=>6;De.prototype._size=function(){return this.label?6:5};be.prototype._size=function(){return this.label?9:8};ye.prototype._size=()=>4;Te.prototype._size=function(){return 8+list_overhead(this.body)};Re.prototype._size=function(){return 5+list_overhead(this.body)};Ce.prototype._size=function(){return 8+list_overhead(this.body)};Fe.prototype._size=function(){return 3+list_overhead(this.body)};Oe.prototype._size=function(){let e=7+list_overhead(this.body);if(this.argname){e+=2}return e};Me.prototype._size=function(){return 7+list_overhead(this.body)};const def_size=(e,t)=>e+list_overhead(t.definitions);Ne.prototype._size=function(){return def_size(4,this)};we.prototype._size=function(){return def_size(4,this)};Ie.prototype._size=function(){return def_size(6,this)};Pe.prototype._size=function(){return this.value?1:0};Be.prototype._size=function(){return this.name?4:0};Le.prototype._size=function(){let e=6;if(this.imported_name)e+=1;if(this.imported_name||this.imported_names)e+=5;if(this.imported_names){e+=2+list_overhead(this.imported_names)}return e};Ve.prototype._size=()=>11;Ue.prototype._size=function(){let e=7+(this.is_default?8:0);if(this.exported_value){e+=this.exported_value._size()}if(this.exported_names){e+=2+list_overhead(this.exported_names)}if(this.module_name){e+=5}return e};ze.prototype._size=function(){if(this.optional){return 4+list_overhead(this.args)}return 2+list_overhead(this.args)};Ke.prototype._size=function(){return 6+list_overhead(this.args)};Ge.prototype._size=function(){return list_overhead(this.expressions)};Xe.prototype._size=function(){if(this.optional){return this.property.length+2}return this.property.length+1};We.prototype._size=function(){if(this.optional){return this.property.length+3}return this.property.length+2};qe.prototype._size=function(){return this.optional?4:2};je.prototype._size=function(){if(this.operator==="typeof")return 7;if(this.operator==="void")return 5;return this.operator.length};Qe.prototype._size=function(e){if(this.operator==="in")return 4;let t=this.operator.length;if((this.operator==="+"||this.operator==="-")&&this.right instanceof je&&this.right.operator===this.operator){t+=1}if(this.needs_parens(e)){t+=2}return t};Je.prototype._size=()=>3;nt.prototype._size=function(){return 2+list_overhead(this.elements)};rt.prototype._size=function(e){let t=2;if(first_in_statement(e)){t+=2}return t+list_overhead(this.properties)};const key_size=e=>typeof e==="string"?e.length:0;ot.prototype._size=function(){return key_size(this.key)+1};const static_size=e=>e?7:0;lt.prototype._size=function(){return 5+static_size(this.static)+key_size(this.key)};ut.prototype._size=function(){return 5+static_size(this.static)+key_size(this.key)};ct.prototype._size=function(){return static_size(this.static)+key_size(this.key)+lambda_modifiers(this)};ft.prototype._size=function(){return ct.prototype._size.call(this)+1};st.prototype._size=at.prototype._size=function(){return ct.prototype._size.call(this)+4};_t.prototype._size=function(){return(this.name?8:7)+(this.extends?8:0)};pt.prototype._size=function(){return static_size(this.static)+(typeof this.key==="string"?this.key.length+2:0)+(this.value?1:0)};dt.prototype._size=function(){return pt.prototype._size.call(this)+1};Et.prototype._size=function(){return!En||this.definition().unmangleable(En)?this.name.length:1};Ct.prototype._size=function(){return this.name.length};It.prototype._size=vt.prototype._size=function(){const{name:e,thedef:t}=this;if(t&&t.global)return e.length;if(e==="arguments")return 9;return Et.prototype._size.call(this)};gt.prototype._size=()=>10;Nt.prototype._size=function(){return this.name.length};Bt.prototype._size=function(){return this.name.length};Vt.prototype._size=()=>4;Ut.prototype._size=()=>5;Kt.prototype._size=function(){return this.value.length+2};Gt.prototype._size=function(){const{value:e}=this;if(e===0)return 1;if(e>0&&Math.floor(e)===e){return Math.floor(Math.log10(e)+1)}return e.toString().length};Ht.prototype._size=function(){return this.value.length};Xt.prototype._size=function(){return this.value.toString().length};qt.prototype._size=()=>4;Yt.prototype._size=()=>3;jt.prototype._size=()=>6;$t.prototype._size=()=>0;Zt.prototype._size=()=>8;en.prototype._size=()=>4;Jt.prototype._size=()=>5;Se.prototype._size=()=>6;Ae.prototype._size=()=>6;const gn=1;const vn=2;const Dn=4;const bn=8;const Sn=16;const An=32;const yn=256;const Tn=512;const kn=1024;const Cn=yn|Tn|kn;const has_flag=(e,t)=>e.flags&t;const set_flag=(e,t)=>{e.flags|=t};const clear_flag=(e,t)=>{e.flags&=~t};class Compressor extends TreeWalker{constructor(e,{false_by_default:t=false,mangle_options:n=false}){super();if(e.defaults!==undefined&&!e.defaults)t=true;this.options=defaults(e,{arguments:false,arrows:!t,booleans:!t,booleans_as_integers:false,collapse_vars:!t,comparisons:!t,computed_props:!t,conditionals:!t,dead_code:!t,defaults:true,directives:!t,drop_console:false,drop_debugger:!t,ecma:5,evaluate:!t,expression:false,global_defs:false,hoist_funs:false,hoist_props:!t,hoist_vars:false,ie8:false,if_return:!t,inline:!t,join_vars:!t,keep_classnames:false,keep_fargs:true,keep_fnames:false,keep_infinity:false,loops:!t,module:false,negate_iife:!t,passes:1,properties:!t,pure_getters:!t&&"strict",pure_funcs:null,reduce_funcs:!t,reduce_vars:!t,sequences:!t,side_effects:!t,switches:!t,top_retain:null,toplevel:!!(e&&e["top_retain"]),typeofs:!t,unsafe:false,unsafe_arrows:false,unsafe_comps:false,unsafe_Function:false,unsafe_math:false,unsafe_symbols:false,unsafe_methods:false,unsafe_proto:false,unsafe_regexp:false,unsafe_undefined:false,unused:!t,warnings:false},true);var r=this.options["global_defs"];if(typeof r=="object")for(var i in r){if(i[0]==="@"&&HOP(r,i)){r[i.slice(1)]=parse(r[i],{expression:true})}}if(this.options["inline"]===true)this.options["inline"]=3;var o=this.options["pure_funcs"];if(typeof o=="function"){this.pure_funcs=o}else{this.pure_funcs=o?function(e){return!o.includes(e.expression.print_to_string())}:return_true}var a=this.options["top_retain"];if(a instanceof RegExp){this.top_retain=function(e){return a.test(e.name)}}else if(typeof a=="function"){this.top_retain=a}else if(a){if(typeof a=="string"){a=a.split(/,/)}this.top_retain=function(e){return a.includes(e.name)}}if(this.options["module"]){this.directives["use strict"]=true;this.options["toplevel"]=true}var s=this.options["toplevel"];this.toplevel=typeof s=="string"?{funcs:/funcs/.test(s),vars:/vars/.test(s)}:{funcs:s,vars:s};var u=this.options["sequences"];this.sequences_limit=u==1?800:u|0;this.evaluated_regexps=new Map;this._toplevel=undefined;this.mangle_options=n}option(e){return this.options[e]}exposed(e){if(e.export)return true;if(e.global)for(var t=0,n=e.orig.length;t0||this.option("reduce_vars")){this._toplevel.reset_opt_flags(this)}this._toplevel=this._toplevel.transform(this);if(t>1){let e=0;walk(this._toplevel,(()=>{e++}));if(e=0){i.body[a]=i.body[a].transform(r)}}else if(i instanceof ye){i.body=i.body.transform(r);if(i.alternative){i.alternative=i.alternative.transform(r)}}else if(i instanceof ne){i.body=i.body.transform(r)}return i}));n.transform(r)}));function read_property(e,t){t=get_value(t);if(t instanceof V)return;var n;if(e instanceof nt){var r=e.elements;if(t=="length")return make_node_from_constant(r.length,e);if(typeof t=="number"&&t in r)n=r[t]}else if(e instanceof rt){t=""+t;var i=e.properties;for(var o=i.length;--o>=0;){var a=i[o];if(!(a instanceof ot))return;if(!n&&i[o].key===t)n=i[o].value}}return n instanceof It&&n.fixed_value()||n}function is_modified(e,t,n,r,i,o){var a=t.parent(i);var s=is_lhs(n,a);if(s)return s;if(!o&&a instanceof ze&&a.expression===n&&!(r instanceof le)&&!(r instanceof _t)&&!a.is_callee_pure(e)&&(!(r instanceof ue)||!(a instanceof Ke)&&r.contains_this())){return true}if(a instanceof nt){return is_modified(e,t,a,a,i+1)}if(a instanceof ot&&n===a.value){var u=t.parent(i+1);return is_modified(e,t,u,u,i+2)}if(a instanceof He&&a.expression===n){var l=read_property(r,a.property);return!o&&is_modified(e,t,a,l,i+1)}}(function(e){e(V,noop);function reset_def(e,t){t.assignments=0;t.chained=false;t.direct_access=false;t.escaped=0;t.recursive_refs=0;t.references=[];t.single_use=undefined;if(t.scope.pinned()){t.fixed=false}else if(t.orig[0]instanceof St||!e.exposed(t)){t.fixed=t.init}else{t.fixed=false}}function reset_variables(e,t,n){n.variables.forEach((function(n){reset_def(t,n);if(n.fixed===null){e.defs_to_safe_ids.set(n.id,e.safe_ids);mark(e,n,true)}else if(n.fixed){e.loop_ids.set(n.id,e.in_loop);mark(e,n,true)}}))}function reset_block_variables(e,t){if(t.block_scope)t.block_scope.variables.forEach((t=>{reset_def(e,t)}))}function push(e){e.safe_ids=Object.create(e.safe_ids)}function pop(e){e.safe_ids=Object.getPrototypeOf(e.safe_ids)}function mark(e,t,n){e.safe_ids[t.id]=n}function safe_to_read(e,t){if(t.single_use=="m")return false;if(e.safe_ids[t.id]){if(t.fixed==null){var n=t.orig[0];if(n instanceof yt||n.name=="arguments")return false;t.fixed=make_node(jt,n)}return true}return t.fixed instanceof ce}function safe_to_assign(e,t,n,r){if(t.fixed===undefined)return true;let i;if(t.fixed===null&&(i=e.defs_to_safe_ids.get(t.id))){i[t.id]=false;e.defs_to_safe_ids.delete(t.id);return true}if(!HOP(e.safe_ids,t.id))return false;if(!safe_to_read(e,t))return false;if(t.fixed===false)return false;if(t.fixed!=null&&(!r||t.references.length>t.assignments))return false;if(t.fixed instanceof ce){return r instanceof V&&t.fixed.parent_scope===n}return t.orig.every((e=>!(e instanceof St||e instanceof Tt||e instanceof Rt)))}function ref_once(e,t,n){return t.option("unused")&&!n.scope.pinned()&&n.references.length-n.recursive_refs==1&&e.loop_ids.get(n.id)===e.in_loop}function is_immutable(e){if(!e)return false;return e.is_constant()||e instanceof ae||e instanceof Vt}function mark_escaped(e,t,n,r,i,o=0,a=1){var s=e.parent(o);if(i){if(i.is_constant())return;if(i instanceof ht)return}if(s instanceof et&&(s.operator==="="||s.logical)&&r===s.right||s instanceof ze&&(r!==s.expression||s instanceof Ke)||s instanceof he&&r===s.value&&r.scope!==t.scope||s instanceof Pe&&r===s.value||s instanceof Ae&&r===s.value&&r.scope!==t.scope){if(a>1&&!(i&&i.is_constant_expression(n)))a=1;if(!t.escaped||t.escaped>a)t.escaped=a;return}else if(s instanceof nt||s instanceof Se||s instanceof Qe&&On.has(s.operator)||s instanceof Je&&r!==s.condition||s instanceof oe||s instanceof Ge&&r===s.tail_node()){mark_escaped(e,t,n,s,s,o+1,a)}else if(s instanceof ot&&r===s.value){var u=e.parent(o+1);mark_escaped(e,t,n,u,u,o+2,a)}else if(s instanceof He&&r===s.expression){i=read_property(i,s.property);mark_escaped(e,t,n,s,i,o+1,a+1);if(i)return}if(o>0)return;if(s instanceof Ge&&r!==s.tail_node())return;if(s instanceof G)return;t.direct_access=true}const suppress=e=>walk(e,(e=>{if(!(e instanceof Et))return;var t=e.definition();if(!t)return;if(e instanceof It)t.references.push(e);t.fixed=false}));e(se,(function(e,t,n){push(e);reset_variables(e,n,this);t();pop(e);return true}));e(et,(function(e,t,n){var r=this;if(r.left instanceof fe){suppress(r.left);return}const finish_walk=()=>{if(r.logical){r.left.walk(e);push(e);r.right.walk(e);pop(e);return true}};var i=r.left;if(!(i instanceof It))return finish_walk();var o=i.definition();var a=safe_to_assign(e,o,i.scope,r.right);o.assignments++;if(!a)return finish_walk();var s=o.fixed;if(!s&&r.operator!="="&&!r.logical)return finish_walk();var u=r.operator=="=";var l=u?r.right:r;if(is_modified(n,e,r,l,0))return finish_walk();o.references.push(i);if(!r.logical){if(!u)o.chained=true;o.fixed=u?function(){return r.right}:function(){return make_node(Qe,r,{operator:r.operator.slice(0,-1),left:s instanceof V?s:s(),right:r.right})}}if(r.logical){mark(e,o,false);push(e);r.right.walk(e);pop(e);return true}mark(e,o,false);r.right.walk(e);mark(e,o,true);mark_escaped(e,o,i.scope,r,l,0,1);return true}));e(Qe,(function(e){if(!On.has(this.operator))return;this.left.walk(e);push(e);this.right.walk(e);pop(e);return true}));e(H,(function(e,t,n){reset_block_variables(n,this)}));e(Re,(function(e){push(e);this.expression.walk(e);pop(e);push(e);walk_body(this,e);pop(e);return true}));e(_t,(function(e,t){clear_flag(this,Sn);push(e);t();pop(e);return true}));e(Je,(function(e){this.condition.walk(e);push(e);this.consequent.walk(e);pop(e);push(e);this.alternative.walk(e);pop(e);return true}));e(Ye,(function(e,t){const n=e.safe_ids;t();e.safe_ids=n;return true}));e(ze,(function(e){this.expression.walk(e);if(this.optional){push(e)}for(const t of this.args)t.walk(e);return true}));e(He,(function(e){if(!this.optional)return;this.expression.walk(e);push(e);if(this.property instanceof V)this.property.walk(e);return true}));e(Ce,(function(e,t){push(e);t();pop(e);return true}));function mark_lambda(e,t,n){clear_flag(this,Sn);push(e);reset_variables(e,n,this);if(this.uses_arguments){t();pop(e);return}var r;if(!this.name&&(r=e.parent())instanceof ze&&r.expression===this&&!r.args.some((e=>e instanceof oe))&&this.argnames.every((e=>e instanceof Et))){this.argnames.forEach(((t,n)=>{if(!t.definition)return;var i=t.definition();if(i.orig.length>1)return;if(i.fixed===undefined&&(!this.uses_arguments||e.has_directive("use strict"))){i.fixed=function(){return r.args[n]||make_node(jt,r)};e.loop_ids.set(i.id,e.in_loop);mark(e,i,true)}else{i.fixed=false}}))}t();pop(e);return true}e(ae,mark_lambda);e(Z,(function(e,t,n){reset_block_variables(n,this);const r=e.in_loop;e.in_loop=this;push(e);this.body.walk(e);if(has_break_or_continue(this)){pop(e);push(e)}this.condition.walk(e);pop(e);e.in_loop=r;return true}));e(J,(function(e,t,n){reset_block_variables(n,this);if(this.init)this.init.walk(e);const r=e.in_loop;e.in_loop=this;push(e);if(this.condition)this.condition.walk(e);this.body.walk(e);if(this.step){if(has_break_or_continue(this)){pop(e);push(e)}this.step.walk(e)}pop(e);e.in_loop=r;return true}));e(ee,(function(e,t,n){reset_block_variables(n,this);suppress(this.init);this.object.walk(e);const r=e.in_loop;e.in_loop=this;push(e);this.body.walk(e);pop(e);e.in_loop=r;return true}));e(ye,(function(e){this.condition.walk(e);push(e);this.body.walk(e);pop(e);if(this.alternative){push(e);this.alternative.walk(e);pop(e)}return true}));e(Y,(function(e){push(e);this.body.walk(e);pop(e);return true}));e(Mt,(function(){this.definition().fixed=false}));e(It,(function(e,t,n){var r=this.definition();r.references.push(this);if(r.references.length==1&&!r.fixed&&r.orig[0]instanceof Tt){e.loop_ids.set(r.id,e.in_loop)}var i;if(r.fixed===undefined||!safe_to_read(e,r)){r.fixed=false}else if(r.fixed){i=this.fixed_value();if(i instanceof ae&&recursive_ref(e,r)){r.recursive_refs++}else if(i&&!n.exposed(r)&&ref_once(e,n,r)){r.single_use=i instanceof ae&&!i.pinned()||i instanceof _t||r.scope===this.scope&&i.is_constant_expression()}else{r.single_use=false}if(is_modified(n,e,this,i,0,is_immutable(i))){if(r.single_use){r.single_use="m"}else{r.fixed=false}}}mark_escaped(e,r,this.scope,this,i,0,1)}));e(ie,(function(e,t,n){this.globals.forEach((function(e){reset_def(n,e)}));reset_variables(e,n,this)}));e(Fe,(function(e,t,n){reset_block_variables(n,this);push(e);walk_body(this,e);pop(e);if(this.bcatch){push(e);this.bcatch.walk(e);pop(e)}if(this.bfinally)this.bfinally.walk(e);return true}));e(je,(function(e){var t=this;if(t.operator!=="++"&&t.operator!=="--")return;var n=t.expression;if(!(n instanceof It))return;var r=n.definition();var i=safe_to_assign(e,r,n.scope,true);r.assignments++;if(!i)return;var o=r.fixed;if(!o)return;r.references.push(n);r.chained=true;r.fixed=function(){return make_node(Qe,t,{operator:t.operator.slice(0,-1),left:make_node($e,t,{operator:"+",expression:o instanceof V?o:o()}),right:make_node(Gt,t,{value:1})})};mark(e,r,true);return true}));e(Pe,(function(e,t){var n=this;if(n.name instanceof fe){suppress(n.name);return}var r=n.name.definition();if(n.value){if(safe_to_assign(e,r,n.name.scope,n.value)){r.fixed=function(){return n.value};e.loop_ids.set(r.id,e.in_loop);mark(e,r,false);t();mark(e,r,true);return true}else{r.fixed=false}}}));e(Q,(function(e,t,n){reset_block_variables(n,this);const r=e.in_loop;e.in_loop=this;push(e);t();pop(e);e.in_loop=r;return true}))})((function(e,t){e.DEFMETHOD("reduce_vars",t)}));ie.DEFMETHOD("reset_opt_flags",(function(e){const t=this;const n=e.option("reduce_vars");const r=new TreeWalker((function(i,o){clear_flag(i,Cn);if(n){if(e.top_retain&&i instanceof ce&&r.parent()===t){set_flag(i,kn)}return i.reduce_vars(r,o,e)}}));r.safe_ids=Object.create(null);r.in_loop=null;r.loop_ids=new Map;r.defs_to_safe_ids=new Map;t.walk(r)}));Et.DEFMETHOD("fixed_value",(function(){var e=this.thedef.fixed;if(!e||e instanceof V)return e;return e()}));It.DEFMETHOD("is_immutable",(function(){var e=this.definition().orig;return e.length==1&&e[0]instanceof Rt}));function is_func_expr(e){return e instanceof le||e instanceof ue}function is_lhs_read_only(e){if(e instanceof Vt)return true;if(e instanceof It)return e.definition().orig[0]instanceof Rt;if(e instanceof He){e=e.expression;if(e instanceof It){if(e.is_immutable())return false;e=e.fixed_value()}if(!e)return true;if(e instanceof Xt)return false;if(e instanceof zt)return true;return is_lhs_read_only(e)}return false}function is_ref_of(e,t){if(!(e instanceof It))return false;var n=e.definition().orig;for(var r=n.length;--r>=0;){if(n[r]instanceof t)return true}}function find_scope(e){for(let t=0;;t++){const n=e.parent(t);if(n instanceof ie)return n;if(n instanceof ae)return n;if(n.block_scope)return n.block_scope}}function find_variable(e,t){var n,r=0;while(n=e.parent(r++)){if(n instanceof re)break;if(n instanceof Oe&&n.argname){n=n.argname.definition().scope;break}}return n.find_variable(t)}function make_sequence(e,t){if(t.length==1)return t[0];if(t.length==0)throw new Error("trying to create a sequence with length zero!");return make_node(Ge,e,{expressions:t.reduce(merge_sequence,[])})}function make_node_from_constant(e,t){switch(typeof e){case"string":return make_node(Kt,t,{value:e});case"number":if(isNaN(e))return make_node(Yt,t);if(isFinite(e)){return 1/e<0?make_node($e,t,{operator:"-",expression:make_node(Gt,t,{value:-e})}):make_node(Gt,t,{value:e})}return e<0?make_node($e,t,{operator:"-",expression:make_node(Zt,t)}):make_node(Zt,t);case"boolean":return make_node(e?en:Jt,t);case"undefined":return make_node(jt,t);default:if(e===null){return make_node(qt,t,{value:null})}if(e instanceof RegExp){return make_node(Xt,t,{value:{source:regexp_source_fix(e.source),flags:e.flags}})}throw new Error(string_template("Can't handle constant of type: {type}",{type:typeof e}))}}function maintain_this_binding(e,t,n){if(e instanceof $e&&e.operator=="delete"||e instanceof ze&&e.expression===t&&(n instanceof He||n instanceof It&&n.name=="eval")){return make_sequence(t,[make_node(Gt,t,{value:0}),n])}return n}function merge_sequence(e,t){if(t instanceof Ge){e.push(...t.expressions)}else{e.push(t)}return e}function as_statement_array(e){if(e===null)return[];if(e instanceof X)return e.body;if(e instanceof W)return[];if(e instanceof U)return[e];throw new Error("Can't convert thing to statement array")}function is_empty(e){if(e===null)return true;if(e instanceof W)return true;if(e instanceof X)return e.body.length==0;return false}function can_be_evicted_from_block(e){return!(e instanceof mt||e instanceof ce||e instanceof we||e instanceof Ie||e instanceof Ue||e instanceof Le)}function loop_body(e){if(e instanceof j){return e.body instanceof X?e.body:e}return e}function is_iife_call(e){if(e.TYPE!="Call")return false;return e.expression instanceof ue||is_iife_call(e.expression)}function is_undeclared_ref(e){return e instanceof It&&e.definition().undeclared}var Rn=makePredicate("Array Boolean clearInterval clearTimeout console Date decodeURI decodeURIComponent encodeURI encodeURIComponent Error escape eval EvalError Function isFinite isNaN JSON Math Number parseFloat parseInt RangeError ReferenceError RegExp Object setInterval setTimeout String SyntaxError TypeError unescape URIError");It.DEFMETHOD("is_declared",(function(e){return!this.definition().undeclared||e.option("unsafe")&&Rn.has(this.name)}));var Fn=makePredicate("Infinity NaN undefined");function is_identifier_atom(e){return e instanceof Zt||e instanceof Yt||e instanceof jt}function tighten_body(e,t){var n,r;var o=t.find_parent(re).get_defun_scope();find_loop_scope_try();var a,s=10;do{a=false;eliminate_spurious_blocks(e);if(t.option("dead_code")){eliminate_dead_code(e,t)}if(t.option("if_return")){handle_if_return(e,t)}if(t.sequences_limit>0){sequencesize(e,t);sequencesize_2(e,t)}if(t.option("join_vars")){join_consecutive_vars(e)}if(t.option("collapse_vars")){collapse(e,t)}}while(a&&s-- >0);function find_loop_scope_try(){var e=t.self(),i=0;do{if(e instanceof Oe||e instanceof Me){i++}else if(e instanceof j){n=true}else if(e instanceof re){o=e;break}else if(e instanceof Fe){r=true}}while(e=t.parent(i++))}function collapse(e,t){if(o.pinned())return e;var s;var u=[];var l=e.length;var c=new TreeTransformer((function(e){if(k)return e;if(!T){if(e!==_[p])return e;p++;if(p<_.length)return handle_custom_scan_order(e);T=true;h=find_stop(e,0);if(h===e)k=true;return e}var n=c.parent();if(e instanceof et&&(e.logical||e.operator!="="&&g.equivalent_to(e.left))||e instanceof Se||e instanceof ze&&g instanceof He&&g.equivalent_to(e.expression)||e instanceof z||e instanceof fe||e instanceof oe&&e.expression instanceof Et&&(e.expression instanceof Vt||e.expression.definition().references.length>1)||e instanceof j&&!(e instanceof J)||e instanceof ve||e instanceof Fe||e instanceof ne||e instanceof Ae||e instanceof Ue||e instanceof _t||n instanceof J&&e!==n.init||!S&&(e instanceof It&&!e.is_declared(t)&&!Pn.has(e))||e instanceof It&&n instanceof ze&&has_annotation(n,on)){k=true;return e}if(!E&&(!D||!S)&&(n instanceof Qe&&On.has(n.operator)&&n.left!==e||n instanceof Je&&n.condition!==e||n instanceof ye&&n.condition!==e)){E=n}if(R&&!(e instanceof vt)&&g.equivalent_to(e)){if(E){k=true;return e}if(is_lhs(e,n)){if(m)C++;return e}else{C++;if(m&&d instanceof Pe)return e}a=k=true;if(d instanceof Ze){return make_node($e,d,d)}if(d instanceof Pe){var i=d.name.definition();var o=d.value;if(i.references.length-i.replaced==1&&!t.exposed(i)){i.replaced++;if(y&&is_identifier_atom(o)){return o.transform(t)}else{return maintain_this_binding(n,e,o)}}return make_node(et,d,{operator:"=",logical:false,left:make_node(It,d.name,d.name),right:o})}clear_flag(d,An);return d}var s;if(e instanceof ze||e instanceof he&&(b||g instanceof He||may_modify(g))||e instanceof He&&(b||e.expression.may_throw_on_access(t))||e instanceof It&&(v.get(e.name)||b&&may_modify(e))||e instanceof Pe&&e.value&&(v.has(e.name.name)||b&&may_modify(e.name))||(s=is_lhs(e.left,e))&&(s instanceof He||v.has(s.name))||A&&(r?e.has_side_effects(t):side_effects_external(e))){h=e;if(e instanceof re)k=true}return handle_custom_scan_order(e)}),(function(e){if(k)return;if(h===e)k=true;if(E===e)E=null}));var f=new TreeTransformer((function(e){if(k)return e;if(!T){if(e!==_[p])return e;p++;if(p<_.length)return;T=true;return e}if(e instanceof It&&e.name==M.name){if(!--C)k=true;if(is_lhs(e,f.parent()))return e;M.replaced++;m.replaced--;return d.value}if(e instanceof Ce||e instanceof re)return e}));while(--l>=0){if(l==0&&t.option("unused"))extract_args();var _=[];extract_candidates(e[l]);while(u.length>0){_=u.pop();var p=0;var d=_[_.length-1];var m=null;var h=null;var E=null;var g=get_lhs(d);if(!g||is_lhs_read_only(g)||g.has_side_effects(t))continue;var v=get_lvalues(d);var D=is_lhs_local(g);if(g instanceof It)v.set(g.name,false);var b=value_has_side_effects(d);var S=replace_all_symbols();var A=d.may_throw(t);var y=d.name instanceof yt;var T=y;var k=false,C=0,R=!s||!T;if(!R){for(var F=t.self().argnames.lastIndexOf(d.name)+1;!k&&FC)C=false;else{k=false;p=0;T=y;for(var O=l;!k&&O!(e instanceof oe)))){var r=t.has_directive("use strict");if(r&&!member(r,n.body))r=false;var i=n.argnames.length;s=e.args.slice(i);var o=new Set;for(var a=i;--a>=0;){var l=n.argnames[a];var c=e.args[a];const i=l.definition&&l.definition();const _=i&&i.orig.length>1;if(_)continue;s.unshift(make_node(Pe,l,{name:l,value:c}));if(o.has(l.name))continue;o.add(l.name);if(l instanceof oe){var f=e.args.slice(a);if(f.every((e=>!has_overlapping_symbol(n,e,r)))){u.unshift([make_node(Pe,l,{name:l.expression,value:make_node(nt,e,{elements:f})})])}}else{if(!c){c=make_node(jt,l).transform(t)}else if(c instanceof ae&&c.pinned()||has_overlapping_symbol(n,c,r)){c=null}if(c)u.unshift([make_node(Pe,l,{name:l,value:c})])}}}}function extract_candidates(e){_.push(e);if(e instanceof et){if(!e.left.has_side_effects(t)&&!(e.right instanceof Ye)){u.push(_.slice())}extract_candidates(e.right)}else if(e instanceof Qe){extract_candidates(e.left);extract_candidates(e.right)}else if(e instanceof ze&&!has_annotation(e,on)){extract_candidates(e.expression);e.args.forEach(extract_candidates)}else if(e instanceof Re){extract_candidates(e.expression)}else if(e instanceof Je){extract_candidates(e.condition);extract_candidates(e.consequent);extract_candidates(e.alternative)}else if(e instanceof xe){var n=e.definitions.length;var r=n-200;if(r<0)r=0;for(;r1&&!(e.name instanceof yt)||(r>1?mangleable_var(e):!t.exposed(n))){return make_node(It,e.name,e.name)}}else{const t=e instanceof et?e.left:e.expression;return!is_ref_of(t,St)&&!is_ref_of(t,At)&&t}}function get_rvalue(e){if(e instanceof et){return e.right}else{return e.value}}function get_lvalues(e){var n=new Map;if(e instanceof je)return n;var r=new TreeWalker((function(e){var i=e;while(i instanceof He)i=i.expression;if(i instanceof It||i instanceof Vt){n.set(i.name,n.get(i.name)||is_modified(t,r,e,e,0))}}));get_rvalue(e).walk(r);return n}function remove_candidate(n){if(n.name instanceof yt){var r=t.parent(),o=t.self().argnames;var a=o.indexOf(n.name);if(a<0){r.args.length=Math.min(r.args.length,o.length-1)}else{var s=r.args;if(s[a])s[a]=make_node(Gt,s[a],{value:0})}return true}var u=false;return e[l].transform(new TreeTransformer((function(e,t,r){if(u)return e;if(e===n||e.body===n){u=true;if(e instanceof Pe){e.value=e.name instanceof St?make_node(jt,e.value):null;return e}return r?i.skip:null}}),(function(e){if(e instanceof Ge)switch(e.expressions.length){case 0:return null;case 1:return e.expressions[0]}})))}function is_lhs_local(e){while(e instanceof He)e=e.expression;return e instanceof It&&e.definition().scope===o&&!(n&&(v.has(e.name)||d instanceof je||d instanceof et&&!d.logical&&d.operator!="="))}function value_has_side_effects(e){if(e instanceof je)return Mn.has(e.operator);return get_rvalue(e).has_side_effects(t)}function replace_all_symbols(){if(b)return false;if(m)return true;if(g instanceof It){var e=g.definition();if(e.references.length-e.replaced==(d instanceof Pe?1:2)){return true}}return false}function may_modify(e){if(!e.definition)return true;var t=e.definition();if(t.orig.length==1&&t.orig[0]instanceof Tt)return false;if(t.scope.get_defun_scope()!==o)return true;return!t.references.every((e=>{var t=e.scope.get_defun_scope();if(t.TYPE=="Scope")t=t.parent_scope;return t===o}))}function side_effects_external(e,t){if(e instanceof et)return side_effects_external(e.left,true);if(e instanceof je)return side_effects_external(e.expression,true);if(e instanceof Pe)return e.value&&side_effects_external(e.value);if(t){if(e instanceof Xe)return side_effects_external(e.expression,true);if(e instanceof qe)return side_effects_external(e.expression,true);if(e instanceof It)return e.definition().scope!==o}return false}}function eliminate_spurious_blocks(e){var t=[];for(var n=0;n=0;){var s=e[o];var u=next_index(o);var l=e[u];if(i&&!l&&s instanceof Ee){if(!s.value){a=true;e.splice(o,1);continue}if(s.value instanceof $e&&s.value.operator=="void"){a=true;e[o]=make_node(G,s,{body:s.value.expression});continue}}if(s instanceof ye){var c=aborts(s.body);if(can_merge_flow(c)){if(c.label){remove(c.label.thedef.references,c)}a=true;s=s.clone();s.condition=s.condition.negate(t);var f=as_statement_array_with_return(s.body,c);s.body=make_node(X,s,{body:as_statement_array(s.alternative).concat(extract_functions())});s.alternative=make_node(X,s,{body:f});e[o]=s.transform(t);continue}var c=aborts(s.alternative);if(can_merge_flow(c)){if(c.label){remove(c.label.thedef.references,c)}a=true;s=s.clone();s.body=make_node(X,s.body,{body:as_statement_array(s.body).concat(extract_functions())});var f=as_statement_array_with_return(s.alternative,c);s.alternative=make_node(X,s.alternative,{body:f});e[o]=s.transform(t);continue}}if(s instanceof ye&&s.body instanceof Ee){var _=s.body.value;if(!_&&!s.alternative&&(i&&!l||l instanceof Ee&&!l.value)){a=true;e[o]=make_node(G,s.condition,{body:s.condition});continue}if(_&&!s.alternative&&l instanceof Ee&&l.value){a=true;s=s.clone();s.alternative=l;e[o]=s.transform(t);e.splice(u,1);continue}if(_&&!s.alternative&&(!l&&i&&r||l instanceof Ee)){a=true;s=s.clone();s.alternative=l||make_node(Ee,s,{value:null});e[o]=s.transform(t);if(l)e.splice(u,1);continue}var p=e[prev_index(o)];if(t.option("sequences")&&i&&!s.alternative&&p instanceof ye&&p.body instanceof Ee&&next_index(u)==e.length&&l instanceof G){a=true;s=s.clone();s.alternative=make_node(X,l,{body:[l,make_node(Ee,l,{value:null})]});e[o]=s.transform(t);e.splice(u,1);continue}}}function has_multiple_if_returns(e){var t=0;for(var n=e.length;--n>=0;){var r=e[n];if(r instanceof ye&&r.body instanceof Ee){if(++t>1)return true}}return false}function is_return_void(e){return!e||e instanceof $e&&e.operator=="void"}function can_merge_flow(r){if(!r)return false;for(var a=o+1,s=e.length;a=0;){var r=e[n];if(!(r instanceof Ne&&declarations_only(r))){break}}return n}}function eliminate_dead_code(e,t){var n;var r=t.self();for(var i=0,o=0,s=e.length;i!e.value))}function sequencesize(e,t){if(e.length<2)return;var n=[],r=0;function push_seq(){if(!n.length)return;var t=make_sequence(n[0],n);e[r++]=make_node(G,t,{body:t});n=[]}for(var i=0,o=e.length;i=t.sequences_limit)push_seq();var u=s.body;if(n.length>0)u=u.drop_side_effect_free(t);if(u)merge_sequence(n,u)}else if(s instanceof xe&&declarations_only(s)||s instanceof ce){e[r++]=s}else{push_seq();e[r++]=s}}push_seq();e.length=r;if(r!=o)a=true}function to_simple_statement(e,t){if(!(e instanceof X))return e;var n=null;for(var r=0,i=e.body.length;r{if(e instanceof re)return true;if(e instanceof Qe&&e.operator==="in"){return tn}}));if(!e){if(o.init)o.init=cons_seq(o.init);else{o.init=r.body;n--;a=true}}}}else if(o instanceof ee){if(!(o.init instanceof Ie)&&!(o.init instanceof we)){o.object=cons_seq(o.object)}}else if(o instanceof ye){o.condition=cons_seq(o.condition)}else if(o instanceof Te){o.expression=cons_seq(o.expression)}else if(o instanceof ne){o.expression=cons_seq(o.expression)}}if(t.option("conditionals")&&o instanceof ye){var s=[];var u=to_simple_statement(o.body,s);var l=to_simple_statement(o.alternative,s);if(u!==false&&l!==false&&s.length>0){var c=s.length;s.push(make_node(ye,o,{condition:o.condition,body:u||make_node(W,o.body),alternative:l}));s.unshift(n,1);[].splice.apply(e,s);i+=c;n+=c+1;r=null;a=true;continue}}e[n++]=o;r=o instanceof G?o:null}e.length=n}function join_object_assignments(e,n){if(!(e instanceof xe))return;var r=e.definitions[e.definitions.length-1];if(!(r.value instanceof rt))return;var i;if(n instanceof et&&!n.logical){i=[n]}else if(n instanceof Ge){i=n.expressions.slice()}if(!i)return;var a=false;do{var s=i[0];if(!(s instanceof et))break;if(s.operator!="=")break;if(!(s.left instanceof He))break;var u=s.left.expression;if(!(u instanceof It))break;if(r.name.name!=u.name)break;if(!s.right.is_constant_expression(o))break;var l=s.left.property;if(l instanceof V){l=l.evaluate(t)}if(l instanceof V)break;l=""+l;var c=t.option("ecma")<2015&&t.has_directive("use strict")?function(e){return e.key!=l&&(e.key&&e.key.name!=l)}:function(e){return e.key&&e.key.name!=l};if(!r.value.properties.every(c))break;var f=r.value.properties.filter((function(e){return e.key===l}))[0];if(!f){r.value.properties.push(make_node(ot,s,{key:l,value:s.right}))}else{f.value=new Ge({start:f.start,expressions:[f.value.clone(),s.right.clone()],end:f.end})}i.shift();a=true}while(i.length);return a&&i}function join_consecutive_vars(e){var t;for(var n=0,r=-1,i=e.length;n{if(r instanceof Ne){r.remove_initializers();n.push(r);return true}if(r instanceof ce&&(r===t||!e.has_directive("use strict"))){n.push(r===t?r:make_node(Ne,r,{definitions:[make_node(Pe,r,{name:make_node(Dt,r.name,r.name),value:null})]}));return true}if(r instanceof Ue||r instanceof Le){n.push(r);return true}if(r instanceof re){return true}}))}function get_value(e){if(e instanceof zt){return e.getValue()}if(e instanceof $e&&e.operator=="void"&&e.expression instanceof zt){return}return e}function is_undefined(e,t){return has_flag(e,bn)||e instanceof jt||e instanceof $e&&e.operator=="void"&&!e.expression.has_side_effects(t)}(function(e){V.DEFMETHOD("may_throw_on_access",(function(e){return!e.option("pure_getters")||this._dot_throw(e)}));function is_strict(e){return/strict/.test(e.option("pure_getters"))}e(V,is_strict);e(qt,return_true);e(jt,return_true);e(zt,return_false);e(nt,return_false);e(rt,(function(e){if(!is_strict(e))return false;for(var t=this.properties.length;--t>=0;)if(this.properties[t]._dot_throw(e))return true;return false}));e(_t,return_false);e(it,return_false);e(lt,return_true);e(oe,(function(e){return this.expression._dot_throw(e)}));e(ue,return_false);e(le,return_false);e(Ze,return_false);e($e,(function(){return this.operator=="void"}));e(Qe,(function(e){return(this.operator=="&&"||this.operator=="||"||this.operator=="??")&&(this.left._dot_throw(e)||this.right._dot_throw(e))}));e(et,(function(e){if(this.logical)return true;return this.operator=="="&&this.right._dot_throw(e)}));e(Je,(function(e){return this.consequent._dot_throw(e)||this.alternative._dot_throw(e)}));e(Xe,(function(e){if(!is_strict(e))return false;if(this.property=="prototype"){return!(this.expression instanceof ue||this.expression instanceof _t)}return true}));e(Ye,(function(e){return this.expression._dot_throw(e)}));e(Ge,(function(e){return this.tail_node()._dot_throw(e)}));e(It,(function(e){if(this.name==="arguments")return false;if(has_flag(this,bn))return true;if(!is_strict(e))return false;if(is_undeclared_ref(this)&&this.is_declared(e))return false;if(this.is_immutable())return false;var t=this.fixed_value();return!t||t._dot_throw(e)}))})((function(e,t){e.DEFMETHOD("_dot_throw",t)}));(function(e){const t=makePredicate("! delete");const n=makePredicate("in instanceof == != === !== < <= >= >");e(V,return_false);e($e,(function(){return t.has(this.operator)}));e(Qe,(function(){return n.has(this.operator)||On.has(this.operator)&&this.left.is_boolean()&&this.right.is_boolean()}));e(Je,(function(){return this.consequent.is_boolean()&&this.alternative.is_boolean()}));e(et,(function(){return this.operator=="="&&this.right.is_boolean()}));e(Ge,(function(){return this.tail_node().is_boolean()}));e(en,return_true);e(Jt,return_true)})((function(e,t){e.DEFMETHOD("is_boolean",t)}));(function(e){e(V,return_false);e(Gt,return_true);var t=makePredicate("+ - ~ ++ --");e(je,(function(){return t.has(this.operator)}));var n=makePredicate("- * / % & | ^ << >> >>>");e(Qe,(function(e){return n.has(this.operator)||this.operator=="+"&&this.left.is_number(e)&&this.right.is_number(e)}));e(et,(function(e){return n.has(this.operator.slice(0,-1))||this.operator=="="&&this.right.is_number(e)}));e(Ge,(function(e){return this.tail_node().is_number(e)}));e(Je,(function(e){return this.consequent.is_number(e)&&this.alternative.is_number(e)}))})((function(e,t){e.DEFMETHOD("is_number",t)}));(function(e){e(V,return_false);e(Kt,return_true);e(pe,return_true);e($e,(function(){return this.operator=="typeof"}));e(Qe,(function(e){return this.operator=="+"&&(this.left.is_string(e)||this.right.is_string(e))}));e(et,(function(e){return(this.operator=="="||this.operator=="+=")&&this.right.is_string(e)}));e(Ge,(function(e){return this.tail_node().is_string(e)}));e(Je,(function(e){return this.consequent.is_string(e)&&this.alternative.is_string(e)}))})((function(e,t){e.DEFMETHOD("is_string",t)}));var On=makePredicate("&& || ??");var Mn=makePredicate("delete ++ --");function is_lhs(e,t){if(t instanceof je&&Mn.has(t.operator))return t.expression;if(t instanceof et&&t.left===e)return e}(function(e){function to_node(e,t){if(e instanceof V)return make_node(e.CTOR,t,e);if(Array.isArray(e))return make_node(nt,t,{elements:e.map((function(e){return to_node(e,t)}))});if(e&&typeof e=="object"){var n=[];for(var r in e)if(HOP(e,r)){n.push(make_node(ot,t,{key:r,value:to_node(e[r],t)}))}return make_node(rt,t,{properties:n})}return make_node_from_constant(e,t)}ie.DEFMETHOD("resolve_defines",(function(e){if(!e.option("global_defs"))return this;this.figure_out_scope({ie8:e.option("ie8")});return this.transform(new TreeTransformer((function(t){var n=t._find_defs(e,"");if(!n)return;var r=0,i=t,o;while(o=this.parent(r++)){if(!(o instanceof He))break;if(o.expression!==i)break;i=o}if(is_lhs(i,o)){return}return n})))}));e(V,noop);e(Ye,(function(e,t){return this.expression._find_defs(e,t)}));e(Xe,(function(e,t){return this.expression._find_defs(e,"."+this.property+t)}));e(vt,(function(){if(!this.global())return}));e(It,(function(e,t){if(!this.global())return;var n=e.option("global_defs");var r=this.name+t;if(HOP(n,r))return to_node(n[r],this)}))})((function(e,t){e.DEFMETHOD("_find_defs",t)}));function best_of_expression(e,t){return e.size()>t.size()?t:e}function best_of_statement(e,t){return best_of_expression(make_node(G,e,{body:e}),make_node(G,t,{body:t})).body}function best_of(e,t,n){return(first_in_statement(e)?best_of_statement:best_of_expression)(t,n)}function convert_to_predicate(e){const t=new Map;for(var n of Object.keys(e)){t.set(n,makePredicate(e[n]))}return t}var xn=["constructor","toString","valueOf"];var Nn=convert_to_predicate({Array:["indexOf","join","lastIndexOf","slice"].concat(xn),Boolean:xn,Function:xn,Number:["toExponential","toFixed","toPrecision"].concat(xn),Object:xn,RegExp:["test"].concat(xn),String:["charAt","charCodeAt","concat","indexOf","italics","lastIndexOf","match","replace","search","slice","split","substr","substring","toLowerCase","toUpperCase","trim"].concat(xn)});var wn=convert_to_predicate({Array:["isArray"],Math:["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan","atan2","pow","max","min"],Number:["isFinite","isNaN"],Object:["create","getOwnPropertyDescriptor","getOwnPropertyNames","getPrototypeOf","isExtensible","isFrozen","isSealed","keys"],String:["fromCharCode"]});(function(e){V.DEFMETHOD("evaluate",(function(e){if(!e.option("evaluate"))return this;var t=this._eval(e,1);if(!t||t instanceof RegExp)return t;if(typeof t=="function"||typeof t=="object")return this;return t}));var t=makePredicate("! ~ - + void");V.DEFMETHOD("is_constant",(function(){if(this instanceof zt){return!(this instanceof Xt)}else{return this instanceof $e&&this.expression instanceof zt&&t.has(this.operator)}}));e(U,(function(){throw new Error(string_template("Cannot evaluate a statement [{file}:{line},{col}]",this.start))}));e(ae,return_this);e(_t,return_this);e(V,return_this);e(zt,(function(){return this.getValue()}));e(Ht,return_this);e(Xt,(function(e){let t=e.evaluated_regexps.get(this);if(t===undefined){try{t=(0,eval)(this.print_to_string())}catch(e){t=null}e.evaluated_regexps.set(this,t)}return t||this}));e(pe,(function(){if(this.segments.length!==1)return this;return this.segments[0].value}));e(ue,(function(e){if(e.option("unsafe")){var fn=function(){};fn.node=this;fn.toString=()=>this.print_to_string();return fn}return this}));e(nt,(function(e,t){if(e.option("unsafe")){var n=[];for(var r=0,i=this.elements.length;rtypeof e==="object"||typeof e==="function"||typeof e==="symbol";e(Qe,(function(e,t){if(!r.has(this.operator))t++;var n=this.left._eval(e,t);if(n===this.left)return this;var o=this.right._eval(e,t);if(o===this.right)return this;var a;if(n!=null&&o!=null&&i.has(this.operator)&&has_identity(n)&&has_identity(o)&&typeof n===typeof o){return this}switch(this.operator){case"&&":a=n&&o;break;case"||":a=n||o;break;case"??":a=n!=null?n:o;break;case"|":a=n|o;break;case"&":a=n&o;break;case"^":a=n^o;break;case"+":a=n+o;break;case"*":a=n*o;break;case"**":a=Math.pow(n,o);break;case"/":a=n/o;break;case"%":a=n%o;break;case"-":a=n-o;break;case"<<":a=n<>":a=n>>o;break;case">>>":a=n>>>o;break;case"==":a=n==o;break;case"===":a=n===o;break;case"!=":a=n!=o;break;case"!==":a=n!==o;break;case"<":a=n":a=n>o;break;case">=":a=n>=o;break;default:return this}if(isNaN(a)&&e.find_parent(ne)){return this}return a}));e(Je,(function(e,t){var n=this.condition._eval(e,t);if(n===this.condition)return this;var r=n?this.consequent:this.alternative;var i=r._eval(e,t);return i===r?this:i}));const o=new Set;e(It,(function(e,t){if(o.has(this))return this;var n=this.fixed_value();if(!n)return this;o.add(this);const r=n._eval(e,t);o.delete(this);if(r===n)return this;if(r&&typeof r=="object"){var i=this.definition().escaped;if(i&&t>i)return this}return r}));var a={Array:Array,Math:Math,Number:Number,Object:Object,String:String};var s=convert_to_predicate({Math:["E","LN10","LN2","LOG2E","LOG10E","PI","SQRT1_2","SQRT2"],Number:["MAX_VALUE","MIN_VALUE","NaN","NEGATIVE_INFINITY","POSITIVE_INFINITY"]});const u=new Set(["dotAll","global","ignoreCase","multiline","sticky","unicode"]);e(He,(function(e,t){if(this.optional){const n=this.expression._eval(e,t);if(n==null)return undefined}if(e.option("unsafe")){var n=this.property;if(n instanceof V){n=n._eval(e,t);if(n===this.property)return this}var r=this.expression;var i;if(is_undeclared_ref(r)){var o;var l=r.name==="hasOwnProperty"&&n==="call"&&(o=e.parent()&&e.parent().args)&&(o&&o[0]&&o[0].evaluate(e));l=l instanceof Xe?l.expression:l;if(l==null||l.thedef&&l.thedef.undeclared){return this.clone()}var c=s.get(r.name);if(!c||!c.has(n))return this;i=a[r.name]}else{i=r._eval(e,t+1);if(i instanceof RegExp){if(n=="source"){return regexp_source_fix(i.source)}else if(n=="flags"||u.has(n)){return i[n]}}if(!i||i===r||!HOP(i,n))return this;if(typeof i=="function")switch(n){case"name":return i.node.name?i.node.name.name:"";case"length":return i.node.length_property();default:return this}}return i[n]}return this}));e(Ye,(function(e,t){const n=this.expression._eval(e,t);return n===this.expression?this:n}));e(ze,(function(e,t){var n=this.expression;if(this.optional){const n=this.expression._eval(e,t);if(n==null)return undefined}if(e.option("unsafe")&&n instanceof He){var r=n.property;if(r instanceof V){r=r._eval(e,t);if(r===n.property)return this}var i;var o=n.expression;if(is_undeclared_ref(o)){var s=o.name==="hasOwnProperty"&&r==="call"&&(this.args[0]&&this.args[0].evaluate(e));s=s instanceof Xe?s.expression:s;if(s==null||s.thedef&&s.thedef.undeclared){return this.clone()}var u=wn.get(o.name);if(!u||!u.has(r))return this;i=a[o.name]}else{i=o._eval(e,t+1);if(i===o||!i)return this;var l=Nn.get(i.constructor.name);if(!l||!l.has(r))return this}var c=[];for(var f=0,_=this.args.length;f<_;f++){var p=this.args[f];var d=p._eval(e,t);if(p===d)return this;if(p instanceof ae)return this;c.push(d)}try{return i[r].apply(i,c)}catch(e){}}return this}));e(Ke,return_this)})((function(e,t){e.DEFMETHOD("_eval",t)}));(function(e){function basic_negation(e){return make_node($e,e,{operator:"!",expression:e})}function best(e,t,n){var r=basic_negation(e);if(n){var i=make_node(G,t,{body:t});return best_of_expression(r,i)===i?t:r}return best_of_expression(r,t)}e(V,(function(){return basic_negation(this)}));e(U,(function(){throw new Error("Cannot negate a statement")}));e(ue,(function(){return basic_negation(this)}));e(le,(function(){return basic_negation(this)}));e($e,(function(){if(this.operator=="!")return this.expression;return basic_negation(this)}));e(Ge,(function(e){var t=this.expressions.slice();t.push(t.pop().negate(e));return make_sequence(this,t)}));e(Je,(function(e,t){var n=this.clone();n.consequent=n.consequent.negate(e);n.alternative=n.alternative.negate(e);return best(this,n,t)}));e(Qe,(function(e,t){var n=this.clone(),r=this.operator;if(e.option("unsafe_comps")){switch(r){case"<=":n.operator=">";return n;case"<":n.operator=">=";return n;case">=":n.operator="<";return n;case">":n.operator="<=";return n}}switch(r){case"==":n.operator="!=";return n;case"!=":n.operator="==";return n;case"===":n.operator="!==";return n;case"!==":n.operator="===";return n;case"&&":n.operator="||";n.left=n.left.negate(e,t);n.right=n.right.negate(e);return best(this,n,t);case"||":n.operator="&&";n.left=n.left.negate(e,t);n.right=n.right.negate(e);return best(this,n,t);case"??":n.right=n.right.negate(e);return best(this,n,t)}return basic_negation(this)}))})((function(e,t){e.DEFMETHOD("negate",(function(e,n){return t.call(this,e,n)}))}));var In=makePredicate("Boolean decodeURI decodeURIComponent Date encodeURI encodeURIComponent Error escape EvalError isFinite isNaN Number Object parseFloat parseInt RangeError ReferenceError String SyntaxError TypeError unescape URIError");ze.DEFMETHOD("is_callee_pure",(function(e){if(e.option("unsafe")){var t=this.expression;var n=this.args&&this.args[0]&&this.args[0].evaluate(e);if(t.expression&&t.expression.name==="hasOwnProperty"&&(n==null||n.thedef&&n.thedef.undeclared)){return false}if(is_undeclared_ref(t)&&In.has(t.name))return true;let r;if(t instanceof Xe&&is_undeclared_ref(t.expression)&&(r=wn.get(t.expression.name))&&r.has(t.property)){return true}}return!!has_annotation(this,nn)||!e.pure_funcs(this)}));V.DEFMETHOD("is_call_pure",return_false);Xe.DEFMETHOD("is_call_pure",(function(e){if(!e.option("unsafe"))return;const t=this.expression;let n;if(t instanceof nt){n=Nn.get("Array")}else if(t.is_boolean()){n=Nn.get("Boolean")}else if(t.is_number(e)){n=Nn.get("Number")}else if(t instanceof Xt){n=Nn.get("RegExp")}else if(t.is_string(e)){n=Nn.get("String")}else if(!this.may_throw_on_access(e)){n=Nn.get("Object")}return n&&n.has(this.property)}));const Pn=new Set(["Number","String","Array","Object","Function","Promise"]);(function(e){e(V,return_true);e(W,return_false);e(zt,return_false);e(Vt,return_false);function any(e,t){for(var n=e.length;--n>=0;)if(e[n].has_side_effects(t))return true;return false}e(H,(function(e){return any(this.body,e)}));e(ze,(function(e){if(!this.is_callee_pure(e)&&(!this.expression.is_call_pure(e)||this.expression.has_side_effects(e))){return true}return any(this.args,e)}));e(Te,(function(e){return this.expression.has_side_effects(e)||any(this.body,e)}));e(Re,(function(e){return this.expression.has_side_effects(e)||any(this.body,e)}));e(Fe,(function(e){return any(this.body,e)||this.bcatch&&this.bcatch.has_side_effects(e)||this.bfinally&&this.bfinally.has_side_effects(e)}));e(ye,(function(e){return this.condition.has_side_effects(e)||this.body&&this.body.has_side_effects(e)||this.alternative&&this.alternative.has_side_effects(e)}));e(Y,(function(e){return this.body.has_side_effects(e)}));e(G,(function(e){return this.body.has_side_effects(e)}));e(ae,return_false);e(_t,(function(e){if(this.extends&&this.extends.has_side_effects(e)){return true}return any(this.properties,e)}));e(Qe,(function(e){return this.left.has_side_effects(e)||this.right.has_side_effects(e)}));e(et,return_true);e(Je,(function(e){return this.condition.has_side_effects(e)||this.consequent.has_side_effects(e)||this.alternative.has_side_effects(e)}));e(je,(function(e){return Mn.has(this.operator)||this.expression.has_side_effects(e)}));e(It,(function(e){return!this.is_declared(e)&&!Pn.has(this.name)}));e(Ct,return_false);e(vt,return_false);e(rt,(function(e){return any(this.properties,e)}));e(it,(function(e){return this.computed_key()&&this.key.has_side_effects(e)||this.value&&this.value.has_side_effects(e)}));e(pt,(function(e){return this.computed_key()&&this.key.has_side_effects(e)||this.static&&this.value&&this.value.has_side_effects(e)}));e(ct,(function(e){return this.computed_key()&&this.key.has_side_effects(e)}));e(lt,(function(e){return this.computed_key()&&this.key.has_side_effects(e)}));e(ut,(function(e){return this.computed_key()&&this.key.has_side_effects(e)}));e(nt,(function(e){return any(this.elements,e)}));e(Xe,(function(e){return!this.optional&&this.expression.may_throw_on_access(e)||this.expression.has_side_effects(e)}));e(qe,(function(e){if(this.optional&&is_nullish(this.expression,e)){return false}return!this.optional&&this.expression.may_throw_on_access(e)||this.expression.has_side_effects(e)||this.property.has_side_effects(e)}));e(Ye,(function(e){return this.expression.has_side_effects(e)}));e(Ge,(function(e){return any(this.expressions,e)}));e(xe,(function(e){return any(this.definitions,e)}));e(Pe,(function(){return this.value}));e(de,return_false);e(pe,(function(e){return any(this.segments,e)}))})((function(e,t){e.DEFMETHOD("has_side_effects",t)}));(function(e){e(V,return_true);e(zt,return_false);e(W,return_false);e(ae,return_false);e(vt,return_false);e(Vt,return_false);function any(e,t){for(var n=e.length;--n>=0;)if(e[n].may_throw(t))return true;return false}e(_t,(function(e){if(this.extends&&this.extends.may_throw(e))return true;return any(this.properties,e)}));e(nt,(function(e){return any(this.elements,e)}));e(et,(function(e){if(this.right.may_throw(e))return true;if(!e.has_directive("use strict")&&this.operator=="="&&this.left instanceof It){return false}return this.left.may_throw(e)}));e(Qe,(function(e){return this.left.may_throw(e)||this.right.may_throw(e)}));e(H,(function(e){return any(this.body,e)}));e(ze,(function(e){if(this.optional&&is_nullish(this.expression,e))return false;if(any(this.args,e))return true;if(this.is_callee_pure(e))return false;if(this.expression.may_throw(e))return true;return!(this.expression instanceof ae)||any(this.expression.body,e)}));e(Re,(function(e){return this.expression.may_throw(e)||any(this.body,e)}));e(Je,(function(e){return this.condition.may_throw(e)||this.consequent.may_throw(e)||this.alternative.may_throw(e)}));e(xe,(function(e){return any(this.definitions,e)}));e(ye,(function(e){return this.condition.may_throw(e)||this.body&&this.body.may_throw(e)||this.alternative&&this.alternative.may_throw(e)}));e(Y,(function(e){return this.body.may_throw(e)}));e(rt,(function(e){return any(this.properties,e)}));e(it,(function(e){return this.value?this.value.may_throw(e):false}));e(pt,(function(e){return this.computed_key()&&this.key.may_throw(e)||this.static&&this.value&&this.value.may_throw(e)}));e(ct,(function(e){return this.computed_key()&&this.key.may_throw(e)}));e(lt,(function(e){return this.computed_key()&&this.key.may_throw(e)}));e(ut,(function(e){return this.computed_key()&&this.key.may_throw(e)}));e(Ee,(function(e){return this.value&&this.value.may_throw(e)}));e(Ge,(function(e){return any(this.expressions,e)}));e(G,(function(e){return this.body.may_throw(e)}));e(Xe,(function(e){return!this.optional&&this.expression.may_throw_on_access(e)||this.expression.may_throw(e)}));e(qe,(function(e){if(this.optional&&is_nullish(this.expression,e))return false;return!this.optional&&this.expression.may_throw_on_access(e)||this.expression.may_throw(e)||this.property.may_throw(e)}));e(Ye,(function(e){return this.expression.may_throw(e)}));e(Te,(function(e){return this.expression.may_throw(e)||any(this.body,e)}));e(It,(function(e){return!this.is_declared(e)&&!Pn.has(this.name)}));e(Ct,return_false);e(Fe,(function(e){return this.bcatch?this.bcatch.may_throw(e):any(this.body,e)||this.bfinally&&this.bfinally.may_throw(e)}));e(je,(function(e){if(this.operator=="typeof"&&this.expression instanceof It)return false;return this.expression.may_throw(e)}));e(Pe,(function(e){if(!this.value)return false;return this.value.may_throw(e)}))})((function(e,t){e.DEFMETHOD("may_throw",t)}));(function(e){function all_refs_local(e){let t=true;walk(this,(n=>{if(n instanceof It){if(has_flag(this,Sn)){t=false;return tn}var r=n.definition();if(member(r,this.enclosed)&&!this.variables.has(r.name)){if(e){var i=e.find_variable(n);if(r.undeclared?!i:i===r){t="f";return true}}t=false;return tn}return true}if(n instanceof Vt&&this instanceof le){t=false;return tn}}));return t}e(V,return_false);e(zt,return_true);e(_t,(function(e){if(this.extends&&!this.extends.is_constant_expression(e)){return false}for(const t of this.properties){if(t.computed_key()&&!t.key.is_constant_expression(e)){return false}if(t.static&&t.value&&!t.value.is_constant_expression(e)){return false}}return all_refs_local.call(this,e)}));e(ae,all_refs_local);e(je,(function(){return this.expression.is_constant_expression()}));e(Qe,(function(){return this.left.is_constant_expression()&&this.right.is_constant_expression()}));e(nt,(function(){return this.elements.every((e=>e.is_constant_expression()))}));e(rt,(function(){return this.properties.every((e=>e.is_constant_expression()))}));e(it,(function(){return!!(!(this.key instanceof V)&&this.value&&this.value.is_constant_expression())}))})((function(e,t){e.DEFMETHOD("is_constant_expression",t)}));function aborts(e){return e&&e.aborts()}(function(e){e(U,return_null);e(me,return_this);function block_aborts(){for(var e=0;e{if(e instanceof vt){const n=e.definition();if((t||n.global)&&!a.has(n.id)){a.set(n.id,n)}}}))}if(n.value){if(n.name instanceof fe){n.walk(f)}else{var i=n.name.definition();map_add(l,i.id,n.value);if(!i.chained&&n.name.fixed_value()===n.value){s.set(i.id,n)}}if(n.value.has_side_effects(e)){n.value.walk(f)}}}));return true}return scan_ref_scoped(i,o)}));t.walk(f);f=new TreeWalker(scan_ref_scoped);a.forEach((function(e){var t=l.get(e.id);if(t)t.forEach((function(e){e.walk(f)}))}));var _=new TreeTransformer((function before(l,f,p){var d=_.parent();if(r){const e=o(l);if(e instanceof It){var m=e.definition();var h=a.has(m.id);if(l instanceof et){if(!h||s.has(m.id)&&s.get(m.id)!==l){return maintain_this_binding(d,l,l.right.transform(_))}}else if(!h)return p?i.skip:make_node(Gt,l,{value:0})}}if(c!==t)return;var m;if(l.name&&(l instanceof ht&&!keep_name(e.option("keep_classnames"),(m=l.name.definition()).name)||l instanceof ue&&!keep_name(e.option("keep_fnames"),(m=l.name.definition()).name))){if(!a.has(m.id)||m.orig.length>1)l.name=null}if(l instanceof ae&&!(l instanceof se)){var E=!e.option("keep_fargs");for(var g=l.argnames,v=g.length;--v>=0;){var D=g[v];if(D instanceof oe){D=D.expression}if(D instanceof tt){D=D.left}if(!(D instanceof fe)&&!a.has(D.definition().id)){set_flag(D,gn);if(E){g.pop()}}else{E=false}}}if((l instanceof ce||l instanceof mt)&&l!==t){const t=l.name.definition();let r=t.global&&!n||a.has(t.id);if(!r){t.eliminated++;if(l instanceof mt){const t=l.drop_side_effect_free(e);if(t){return make_node(G,l,{body:t})}}return p?i.skip:make_node(W,l)}}if(l instanceof xe&&!(d instanceof ee&&d.init===l)){var b=!(d instanceof ie)&&!(l instanceof Ne);var S=[],A=[],y=[];var T=[];l.definitions.forEach((function(t){if(t.value)t.value=t.value.transform(_);var n=t.name instanceof fe;var i=n?new SymbolDef(null,{name:""}):t.name.definition();if(b&&i.global)return y.push(t);if(!(r||b)||n&&(t.name.names.length||t.name.is_array||e.option("pure_getters")!=true)||a.has(i.id)){if(t.value&&s.has(i.id)&&s.get(i.id)!==t){t.value=t.value.drop_side_effect_free(e)}if(t.name instanceof Dt){var o=u.get(i.id);if(o.length>1&&(!t.value||i.orig.indexOf(t.name)>i.eliminated)){if(t.value){var c=make_node(It,t.name,t.name);i.references.push(c);var f=make_node(et,t,{operator:"=",logical:false,left:c,right:t.value});if(s.get(i.id)===t){s.set(i.id,f)}T.push(f.transform(_))}remove(o,t);i.eliminated++;return}}if(t.value){if(T.length>0){if(y.length>0){T.push(t.value);t.value=make_sequence(t.value,T)}else{S.push(make_node(G,l,{body:make_sequence(l,T)}))}T=[]}y.push(t)}else{A.push(t)}}else if(i.orig[0]instanceof Mt){var p=t.value&&t.value.drop_side_effect_free(e);if(p)T.push(p);t.value=null;A.push(t)}else{var p=t.value&&t.value.drop_side_effect_free(e);if(p){T.push(p)}i.eliminated++}}));if(A.length>0||y.length>0){l.definitions=A.concat(y);S.push(l)}if(T.length>0){S.push(make_node(G,l,{body:make_sequence(l,T)}))}switch(S.length){case 0:return p?i.skip:make_node(W,l);case 1:return S[0];default:return p?i.splice(S):make_node(X,l,{body:S})}}if(l instanceof J){f(l,this);var k;if(l.init instanceof X){k=l.init;l.init=k.body.pop();k.body.push(l)}if(l.init instanceof G){l.init=l.init.body}else if(is_empty(l.init)){l.init=null}return!k?l:p?i.splice(k.body):k}if(l instanceof Y&&l.body instanceof J){f(l,this);if(l.body instanceof X){var k=l.body;l.body=k.body.pop();k.body.push(l);return p?i.splice(k.body):k}return l}if(l instanceof X){f(l,this);if(p&&l.body.every(can_be_evicted_from_block)){return i.splice(l.body)}return l}if(l instanceof re){const e=c;c=l;f(l,this);c=e;return l}}));t.transform(_);function scan_ref_scoped(e,n){var r;const i=o(e);if(i instanceof It&&!is_ref_of(e.left,bt)&&t.variables.get(i.name)===(r=i.definition())){if(e instanceof et){e.right.walk(f);if(!r.chained&&e.left.fixed_value()===e.right){s.set(r.id,e)}}return true}if(e instanceof It){r=e.definition();if(!a.has(r.id)){a.set(r.id,r);if(r.orig[0]instanceof Mt){const e=r.scope.is_block_scope()&&r.scope.get_defun_scope().variables.get(r.name);if(e)a.set(e.id,e)}}return true}if(e instanceof re){var u=c;c=e;n();c=u;return true}}}));re.DEFMETHOD("hoist_declarations",(function(e){var t=this;if(e.has_directive("use asm"))return t;if(!Array.isArray(t.body))return t;var n=e.option("hoist_funs");var r=e.option("hoist_vars");if(n||r){var i=[];var o=[];var a=new Map,s=0,u=0;walk(t,(e=>{if(e instanceof re&&e!==t)return true;if(e instanceof Ne){++u;return true}}));r=r&&u>1;var l=new TreeTransformer((function before(u){if(u!==t){if(u instanceof K){i.push(u);return make_node(W,u)}if(n&&u instanceof ce&&!(l.parent()instanceof Ue)&&l.parent()===t){o.push(u);return make_node(W,u)}if(r&&u instanceof Ne&&!u.definitions.some((e=>e.name instanceof fe))){u.definitions.forEach((function(e){a.set(e.name.name,e);++s}));var c=u.to_assignments(e);var f=l.parent();if(f instanceof ee&&f.init===u){if(c==null){var _=u.definitions[0].name;return make_node(It,_,_)}return c}if(f instanceof J&&f.init===u){return c}if(!c)return make_node(W,u);return make_node(G,u,{body:c})}if(u instanceof re)return u}}));t=t.transform(l);if(s>0){var c=[];const e=t instanceof ae;const n=e?t.args_as_names():null;a.forEach(((t,r)=>{if(e&&n.some((e=>e.name===t.name.name))){a.delete(r)}else{t=t.clone();t.value=null;c.push(t);a.set(r,t)}}));if(c.length>0){for(var f=0;fe instanceof oe||e.computed_key()))){s(a,this);const e=new Map;const n=[];c.properties.forEach((({key:r,value:i})=>{const s=find_scope(o);const l=t.create_symbol(u.CTOR,{source:u,scope:s,conflict_scopes:new Set([s,...u.definition().references.map((e=>e.scope))]),tentative_name:u.name+"_"+r});e.set(String(r),l.definition());n.push(make_node(Pe,a,{name:l,value:i}))}));r.set(l.id,e);return i.splice(n)}}else if(a instanceof He&&a.expression instanceof It){const e=r.get(a.expression.definition().id);if(e){const t=e.get(String(get_value(a.property)));const n=make_node(It,a,{name:t.name,scope:a.expression.scope,thedef:t});n.reference({});return n}}}));return t.transform(o)}));(function(e){function trim(e,t,n){var r=e.length;if(!r)return null;var i=[],o=false;for(var a=0;a0){a[0].body=o.concat(a[0].body)}e.body=a;while(n=a[a.length-1]){var d=n.body[n.body.length-1];if(d instanceof De&&t.loopcontrol_target(d)===e)n.body.pop();if(n.body.length||n instanceof Re&&(s||n.expression.has_side_effects(t)))break;if(a.pop()===s)s=null}if(a.length==0){return make_node(X,e,{body:o.concat(make_node(G,e.expression,{body:e.expression}))}).optimize(t)}if(a.length==1&&(a[0]===u||a[0]===s)){var m=false;var h=new TreeWalker((function(t){if(m||t instanceof ae||t instanceof G)return true;if(t instanceof De&&h.loopcontrol_target(t)===e)m=true}));e.walk(h);if(!m){var E=a[0].body.slice();var f=a[0].expression;if(f)E.unshift(make_node(G,f,{body:f}));E.unshift(make_node(G,e.expression,{body:e.expression}));return make_node(X,e,{body:E}).optimize(t)}}return e;function eliminate_branch(e,n){if(n&&!aborts(n)){n.body=n.body.concat(e.body)}else{trim_unreachable_code(t,e,o)}}}));def_optimize(Fe,(function(e,t){tighten_body(e.body,t);if(e.bcatch&&e.bfinally&&e.bfinally.body.every(is_empty))e.bfinally=null;if(t.option("dead_code")&&e.body.every(is_empty)){var n=[];if(e.bcatch){trim_unreachable_code(t,e.bcatch,n)}if(e.bfinally)n.push(...e.bfinally.body);return make_node(X,e,{body:n}).optimize(t)}return e}));xe.DEFMETHOD("remove_initializers",(function(){var e=[];this.definitions.forEach((function(t){if(t.name instanceof vt){t.value=null;e.push(t)}else{walk(t.name,(n=>{if(n instanceof vt){e.push(make_node(Pe,t,{name:n,value:null}))}}))}}));this.definitions=e}));xe.DEFMETHOD("to_assignments",(function(e){var t=e.option("reduce_vars");var n=[];for(const e of this.definitions){if(e.value){var r=make_node(It,e.name,e.name);n.push(make_node(et,e,{operator:"=",logical:false,left:r,right:e.value}));if(t)r.definition().fixed=false}else if(e.value){var i=make_node(Pe,e,{name:e.name,value:e.value});var o=make_node(Ne,e,{definitions:[i]});n.push(o)}const a=e.name.definition();a.eliminated++;a.replaced--}if(n.length==0)return null;return make_sequence(this,n)}));def_optimize(xe,(function(e){if(e.definitions.length==0)return make_node(W,e);return e}));def_optimize(Pe,(function(e,t){if(e.name instanceof At&&e.value!=null&&is_undefined(e.value,t)){e.value=null}return e}));def_optimize(Le,(function(e){return e}));function retain_top_func(e,t){return t.top_retain&&e instanceof ce&&has_flag(e,kn)&&e.name&&t.top_retain(e.name)}def_optimize(ze,(function(e,t){var n=e.expression;var r=n;inline_array_like_spread(e.args);var i=e.args.every((e=>!(e instanceof oe)));if(t.option("reduce_vars")&&r instanceof It&&!has_annotation(e,on)){const e=r.fixed_value();if(!retain_top_func(e,t)){r=e}}if(e.optional&&is_nullish(r,t)){return make_node(jt,e)}var o=r instanceof ae;if(o&&r.pinned())return e;if(t.option("unused")&&i&&o&&!r.uses_arguments){var a=0,s=0;for(var u=0,l=e.args.length;u=r.argnames.length;if(f||has_flag(r.argnames[u],gn)){var c=e.args[u].drop_side_effect_free(t);if(c){e.args[a++]=c}else if(!f){e.args[a++]=make_node(Gt,e.args[u],{value:0});continue}}else{e.args[a++]=e.args[u]}s=a}e.args.length=s}if(t.option("unsafe")){if(is_undeclared_ref(n))switch(n.name){case"Array":if(e.args.length!=1){return make_node(nt,e,{elements:e.args}).optimize(t)}else if(e.args[0]instanceof Gt&&e.args[0].value<=11){const t=[];for(let n=0;n=1&&e.args.length<=2&&e.args.every((e=>{var n=e.evaluate(t);_.push(n);return e!==n}))){let[n,r]=_;n=regexp_source_fix(new RegExp(n).source);const i=make_node(Xt,e,{value:{source:n,flags:r}});if(i._eval(t)!==i){return i}}break}else if(n instanceof Xe)switch(n.property){case"toString":if(e.args.length==0&&!n.expression.may_throw_on_access(t)){return make_node(Qe,e,{left:make_node(Kt,e,{value:""}),operator:"+",right:n.expression}).optimize(t)}break;case"join":if(n.expression instanceof nt)e:{var p;if(e.args.length>0){p=e.args[0].evaluate(t);if(p===e.args[0])break e}var d=[];var m=[];for(var u=0,l=n.expression.elements.length;u0){d.push(make_node(Kt,e,{value:m.join(p)}));m.length=0}d.push(h)}}if(m.length>0){d.push(make_node(Kt,e,{value:m.join(p)}))}if(d.length==0)return make_node(Kt,e,{value:""});if(d.length==1){if(d[0].is_string(t)){return d[0]}return make_node(Qe,d[0],{operator:"+",left:make_node(Kt,e,{value:""}),right:d[0]})}if(p==""){var g;if(d[0].is_string(t)||d[1].is_string(t)){g=d.shift()}else{g=make_node(Kt,e,{value:""})}return d.reduce((function(e,t){return make_node(Qe,t,{operator:"+",left:e,right:t})}),g).optimize(t)}var c=e.clone();c.expression=c.expression.clone();c.expression.expression=c.expression.expression.clone();c.expression.expression.elements=d;return best_of(t,e,c)}break;case"charAt":if(n.expression.is_string(t)){var v=e.args[0];var D=v?v.evaluate(t):0;if(D!==v){return make_node(qe,n,{expression:n.expression,property:make_node_from_constant(D|0,v||n)}).optimize(t)}}break;case"apply":if(e.args.length==2&&e.args[1]instanceof nt){var b=e.args[1].elements.slice();b.unshift(e.args[0]);return make_node(ze,e,{expression:make_node(Xe,n,{expression:n.expression,optional:false,property:"call"}),args:b}).optimize(t)}break;case"call":var S=n.expression;if(S instanceof It){S=S.fixed_value()}if(S instanceof ae&&!S.contains_this()){return(e.args.length?make_sequence(this,[e.args[0],make_node(ze,e,{expression:n.expression,args:e.args.slice(1)})]):make_node(ze,e,{expression:n.expression,args:[]})).optimize(t)}break}}if(t.option("unsafe_Function")&&is_undeclared_ref(n)&&n.name=="Function"){if(e.args.length==0)return make_node(ue,e,{argnames:[],body:[]}).optimize(t);if(e.args.every((e=>e instanceof Kt))){try{var A="n(function("+e.args.slice(0,-1).map((function(e){return e.value})).join(",")+"){"+e.args[e.args.length-1].value+"})";var y=parse(A);var T={ie8:t.option("ie8")};y.figure_out_scope(T);var k=new Compressor(t.options,{mangle_options:t.mangle_options});y=y.transform(k);y.figure_out_scope(T);hn.reset();y.compute_char_frequency(T);y.mangle_names(T);var C;walk(y,(e=>{if(is_func_expr(e)){C=e;return tn}}));var A=OutputStream();X.prototype._codegen.call(C,C,A);e.args=[make_node(Kt,e,{value:C.argnames.map((function(e){return e.print_to_string()})).join(",")}),make_node(Kt,e.args[e.args.length-1],{value:A.get().replace(/^{|}$/g,"")})];return e}catch(e){if(!(e instanceof JS_Parse_Error)){throw e}}}}var R=o&&r.body[0];var F=o&&!r.is_generator&&!r.async;var O=F&&t.option("inline")&&!e.is_callee_pure(t);if(O&&R instanceof Ee){let n=R.value;if(!n||n.is_constant_expression()){if(n){n=n.clone(true)}else{n=make_node(jt,e)}const r=e.args.concat(n);return make_sequence(e,r).optimize(t)}if(r.argnames.length===1&&r.argnames[0]instanceof yt&&e.args.length<2&&n instanceof It&&n.name===r.argnames[0].name){const n=(e.args[0]||make_node(jt)).optimize(t);let r;if(n instanceof He&&(r=t.parent())instanceof ze&&r.expression===e){return make_sequence(e,[make_node(Gt,e,{value:0}),n])}return n}}if(O){var M,x,N=-1;let o;let a;let s;if(i&&!r.uses_arguments&&!(t.parent()instanceof _t)&&!(r.name&&r instanceof ue)&&(a=can_flatten_body(R))&&(n===r||has_annotation(e,rn)||t.option("unused")&&(o=n.definition()).references.length==1&&!recursive_ref(t,o)&&r.is_constant_expression(n.scope))&&!has_annotation(e,nn|on)&&!r.contains_this()&&can_inject_symbols()&&(s=find_scope(t))&&!scope_encloses_variables_in_this_scope(s,r)&&!function in_default_assign(){let e=0;let n;while(n=t.parent(e++)){if(n instanceof tt)return true;if(n instanceof H)break}return false}()&&!(M instanceof _t)){set_flag(r,yn);s.add_child_scope(r);return make_sequence(e,flatten_fn(a)).optimize(t)}}if(O&&has_annotation(e,rn)){set_flag(r,yn);r=make_node(r.CTOR===ce?ue:r.CTOR,r,r);r.figure_out_scope({},{parent_scope:find_scope(t),toplevel:t.get_toplevel()});return make_node(ze,e,{expression:r,args:e.args}).optimize(t)}const w=F&&t.option("side_effects")&&r.body.every(is_empty);if(w){var b=e.args.concat(make_node(jt,e));return make_sequence(e,b).optimize(t)}if(t.option("negate_iife")&&t.parent()instanceof G&&is_iife_call(e)){return e.negate(t,true)}var I=e.evaluate(t);if(I!==e){I=make_node_from_constant(I,e).optimize(t);return best_of(t,I,e)}return e;function return_value(t){if(!t)return make_node(jt,e);if(t instanceof Ee){if(!t.value)return make_node(jt,e);return t.value.clone(true)}if(t instanceof G){return make_node($e,t,{operator:"void",expression:t.body.clone(true)})}}function can_flatten_body(e){var n=r.body;var i=n.length;if(t.option("inline")<3){return i==1&&return_value(e)}e=null;for(var o=0;o!e.value))){return false}}else if(e){return false}else if(!(a instanceof W)){e=a}}return return_value(e)}function can_inject_args(e,t){for(var n=0,i=r.argnames.length;n=0;){var s=o.definitions[a].name;if(s instanceof fe||e.has(s.name)||Fn.has(s.name)||M.conflicting_def(s.name)){return false}if(x)x.push(s.definition())}}return true}function can_inject_symbols(){var e=new Set;do{M=t.parent(++N);if(M.is_block_scope()&&M.block_scope){M.block_scope.variables.forEach((function(t){e.add(t.name)}))}if(M instanceof Oe){if(M.argname){e.add(M.argname.name)}}else if(M instanceof j){x=[]}else if(M instanceof It){if(M.fixed_value()instanceof re)return false}}while(!(M instanceof re));var n=!(M instanceof ie)||t.toplevel.vars;var i=t.option("inline");if(!can_inject_vars(e,i>=3&&n))return false;if(!can_inject_args(e,i>=2&&n))return false;return!x||x.length==0||!is_reachable(r,x)}function append_var(t,n,r,i){var o=r.definition();const a=M.variables.has(r.name);if(!a){M.variables.set(r.name,o);M.enclosed.push(o);t.push(make_node(Pe,r,{name:r,value:null}))}var s=make_node(It,r,r);o.references.push(s);if(i)n.push(make_node(et,e,{operator:"=",logical:false,left:s,right:i.clone()}))}function flatten_args(t,n){var i=r.argnames.length;for(var o=e.args.length;--o>=i;){n.push(e.args[o])}for(o=i;--o>=0;){var a=r.argnames[o];var s=e.args[o];if(has_flag(a,gn)||!a.name||M.conflicting_def(a.name)){if(s)n.push(s)}else{var u=make_node(Dt,a,a);a.definition().orig.push(u);if(!s&&x)s=make_node(jt,e);append_var(t,n,u,s)}}t.reverse();n.reverse()}function flatten_vars(e,t){var n=t.length;for(var i=0,o=r.body.length;ie.name!=c.name))){var f=r.variables.get(c.name);var _=make_node(It,c,c);f.references.push(_);t.splice(n++,0,make_node(et,l,{operator:"=",logical:false,left:_,right:make_node(jt,c)}))}}}}function flatten_fn(e){var n=[];var i=[];flatten_args(n,i);flatten_vars(n,i);i.push(e);if(n.length){const e=M.body.indexOf(t.parent(N-1))+1;M.body.splice(e,0,make_node(Ne,r,{definitions:n}))}return i.map((e=>e.clone(true)))}}));def_optimize(Ke,(function(e,t){if(t.option("unsafe")&&is_undeclared_ref(e.expression)&&["Object","RegExp","Function","Error","Array"].includes(e.expression.name))return make_node(ze,e,e).transform(t);return e}));def_optimize(Ge,(function(e,t){if(!t.option("side_effects"))return e;var n=[];filter_for_side_effects();var r=n.length-1;trim_right_for_undefined();if(r==0){e=maintain_this_binding(t.parent(),t.self(),n[0]);if(!(e instanceof Ge))e=e.optimize(t);return e}e.expressions=n;return e;function filter_for_side_effects(){var r=first_in_statement(t);var i=e.expressions.length-1;e.expressions.forEach((function(e,o){if(o0&&is_undefined(n[r],t))r--;if(r0){var n=this.clone();n.right=make_sequence(this.right,t.slice(o));t=t.slice(0,o);t.push(n);return make_sequence(this,t).optimize(e)}}}return this}));var Vn=makePredicate("== === != !== * & | ^");function is_object(e){return e instanceof nt||e instanceof ae||e instanceof rt||e instanceof _t}def_optimize(Qe,(function(e,t){function reversible(){return e.left.is_constant()||e.right.is_constant()||!e.left.has_side_effects(t)&&!e.right.has_side_effects(t)}function reverse(t){if(reversible()){if(t)e.operator=t;var n=e.left;e.left=e.right;e.right=n}}if(Vn.has(e.operator)){if(e.right.is_constant()&&!e.left.is_constant()){if(!(e.left instanceof Qe&&w[e.left.operator]>=w[e.operator])){reverse()}}}e=e.lift_sequences(t);if(t.option("comparisons"))switch(e.operator){case"===":case"!==":var n=true;if(e.left.is_string(t)&&e.right.is_string(t)||e.left.is_number(t)&&e.right.is_number(t)||e.left.is_boolean()&&e.right.is_boolean()||e.left.equivalent_to(e.right)){e.operator=e.operator.substr(0,2)}case"==":case"!=":if(!n&&is_undefined(e.left,t)){e.left=make_node(qt,e.left)}else if(t.option("typeofs")&&e.left instanceof Kt&&e.left.value=="undefined"&&e.right instanceof $e&&e.right.operator=="typeof"){var r=e.right.expression;if(r instanceof It?r.is_declared(t):!(r instanceof He&&t.option("ie8"))){e.right=r;e.left=make_node(jt,e.left).optimize(t);if(e.operator.length==2)e.operator+="="}}else if(e.left instanceof It&&e.right instanceof It&&e.left.definition()===e.right.definition()&&is_object(e.left.fixed_value())){return make_node(e.operator[0]=="="?en:Jt,e)}break;case"&&":case"||":var i=e.left;if(i.operator==e.operator){i=i.right}if(i instanceof Qe&&i.operator==(e.operator=="&&"?"!==":"===")&&e.right instanceof Qe&&i.operator==e.right.operator&&(is_undefined(i.left,t)&&e.right.left instanceof qt||i.left instanceof qt&&is_undefined(e.right.left,t))&&!i.right.has_side_effects(t)&&i.right.equivalent_to(e.right.right)){var o=make_node(Qe,e,{operator:i.operator.slice(0,-1),left:make_node(qt,e),right:i.right});if(i!==e.left){o=make_node(Qe,e,{operator:e.operator,left:e.left.left,right:o})}return o}break}if(e.operator=="+"&&t.in_boolean_context()){var a=e.left.evaluate(t);var s=e.right.evaluate(t);if(a&&typeof a=="string"){return make_sequence(e,[e.right,make_node(en,e)]).optimize(t)}if(s&&typeof s=="string"){return make_sequence(e,[e.left,make_node(en,e)]).optimize(t)}}if(t.option("comparisons")&&e.is_boolean()){if(!(t.parent()instanceof Qe)||t.parent()instanceof et){var u=make_node($e,e,{operator:"!",expression:e.negate(t,first_in_statement(t))});e=best_of(t,e,u)}if(t.option("unsafe_comps")){switch(e.operator){case"<":reverse(">");break;case"<=":reverse(">=");break}}}if(e.operator=="+"){if(e.right instanceof Kt&&e.right.getValue()==""&&e.left.is_string(t)){return e.left}if(e.left instanceof Kt&&e.left.getValue()==""&&e.right.is_string(t)){return e.right}if(e.left instanceof Qe&&e.left.operator=="+"&&e.left.left instanceof Kt&&e.left.left.getValue()==""&&e.right.is_string(t)){e.left=e.left.right;return e}}if(t.option("evaluate")){switch(e.operator){case"&&":var a=has_flag(e.left,vn)?true:has_flag(e.left,Dn)?false:e.left.evaluate(t);if(!a){return maintain_this_binding(t.parent(),t.self(),e.left).optimize(t)}else if(!(a instanceof V)){return make_sequence(e,[e.left,e.right]).optimize(t)}var s=e.right.evaluate(t);if(!s){if(t.in_boolean_context()){return make_sequence(e,[e.left,make_node(Jt,e)]).optimize(t)}else{set_flag(e,Dn)}}else if(!(s instanceof V)){var l=t.parent();if(l.operator=="&&"&&l.left===t.self()||t.in_boolean_context()){return e.left.optimize(t)}}if(e.left.operator=="||"){var c=e.left.right.evaluate(t);if(!c)return make_node(Je,e,{condition:e.left.left,consequent:e.right,alternative:e.left.right}).optimize(t)}break;case"||":var a=has_flag(e.left,vn)?true:has_flag(e.left,Dn)?false:e.left.evaluate(t);if(!a){return make_sequence(e,[e.left,e.right]).optimize(t)}else if(!(a instanceof V)){return maintain_this_binding(t.parent(),t.self(),e.left).optimize(t)}var s=e.right.evaluate(t);if(!s){var l=t.parent();if(l.operator=="||"&&l.left===t.self()||t.in_boolean_context()){return e.left.optimize(t)}}else if(!(s instanceof V)){if(t.in_boolean_context()){return make_sequence(e,[e.left,make_node(en,e)]).optimize(t)}else{set_flag(e,vn)}}if(e.left.operator=="&&"){var c=e.left.right.evaluate(t);if(c&&!(c instanceof V))return make_node(Je,e,{condition:e.left.left,consequent:e.left.right,alternative:e.right}).optimize(t)}break;case"??":if(is_nullish(e.left,t)){return e.right}var a=e.left.evaluate(t);if(!(a instanceof V)){return a==null?e.right:e.left}if(t.in_boolean_context()){const n=e.right.evaluate(t);if(!(n instanceof V)&&!n){return e.left}}}var f=true;switch(e.operator){case"+":if(e.right instanceof zt&&e.left instanceof Qe&&e.left.operator=="+"&&e.left.is_string(t)){var _=make_node(Qe,e,{operator:"+",left:e.left.right,right:e.right});var p=_.optimize(t);if(_!==p){e=make_node(Qe,e,{operator:"+",left:e.left.left,right:p})}}if(e.left instanceof Qe&&e.left.operator=="+"&&e.left.is_string(t)&&e.right instanceof Qe&&e.right.operator=="+"&&e.right.is_string(t)){var _=make_node(Qe,e,{operator:"+",left:e.left.right,right:e.right.left});var d=_.optimize(t);if(_!==d){e=make_node(Qe,e,{operator:"+",left:make_node(Qe,e.left,{operator:"+",left:e.left.left,right:d}),right:e.right.right})}}if(e.right instanceof $e&&e.right.operator=="-"&&e.left.is_number(t)){e=make_node(Qe,e,{operator:"-",left:e.left,right:e.right.expression});break}if(e.left instanceof $e&&e.left.operator=="-"&&reversible()&&e.right.is_number(t)){e=make_node(Qe,e,{operator:"-",left:e.right,right:e.left.expression});break}if(e.left instanceof pe){var m=e.left;var p=e.right.evaluate(t);if(p!=e.right){m.segments[m.segments.length-1].value+=String(p);return m}}if(e.right instanceof pe){var p=e.right;var m=e.left.evaluate(t);if(m!=e.left){p.segments[0].value=String(m)+p.segments[0].value;return p}}if(e.left instanceof pe&&e.right instanceof pe){var m=e.left;var h=m.segments;var p=e.right;h[h.length-1].value+=p.segments[0].value;for(var E=1;E=w[e.operator])){var g=make_node(Qe,e,{operator:e.operator,left:e.right,right:e.left});if(e.right instanceof zt&&!(e.left instanceof zt)){e=best_of(t,g,e)}else{e=best_of(t,e,g)}}if(f&&e.is_number(t)){if(e.right instanceof Qe&&e.right.operator==e.operator){e=make_node(Qe,e,{operator:e.operator,left:make_node(Qe,e.left,{operator:e.operator,left:e.left,right:e.right.left,start:e.left.start,end:e.right.left.end}),right:e.right.right})}if(e.right instanceof zt&&e.left instanceof Qe&&e.left.operator==e.operator){if(e.left.left instanceof zt){e=make_node(Qe,e,{operator:e.operator,left:make_node(Qe,e.left,{operator:e.operator,left:e.left.left,right:e.right,start:e.left.left.start,end:e.right.end}),right:e.left.right})}else if(e.left.right instanceof zt){e=make_node(Qe,e,{operator:e.operator,left:make_node(Qe,e.left,{operator:e.operator,left:e.left.right,right:e.right,start:e.left.right.start,end:e.right.end}),right:e.left.left})}}if(e.left instanceof Qe&&e.left.operator==e.operator&&e.left.right instanceof zt&&e.right instanceof Qe&&e.right.operator==e.operator&&e.right.left instanceof zt){e=make_node(Qe,e,{operator:e.operator,left:make_node(Qe,e.left,{operator:e.operator,left:make_node(Qe,e.left.left,{operator:e.operator,left:e.left.right,right:e.right.left,start:e.left.right.start,end:e.right.left.end}),right:e.left.left}),right:e.right.right})}}}}if(e.right instanceof Qe&&e.right.operator==e.operator&&(On.has(e.operator)||e.operator=="+"&&(e.right.left.is_string(t)||e.left.is_string(t)&&e.right.right.is_string(t)))){e.left=make_node(Qe,e.left,{operator:e.operator,left:e.left.transform(t),right:e.right.left.transform(t)});e.right=e.right.right.transform(t);return e.transform(t)}var v=e.evaluate(t);if(v!==e){v=make_node_from_constant(v,e).optimize(t);return best_of(t,v,e)}return e}));def_optimize(Pt,(function(e){return e}));function recursive_ref(e,t){var n;for(var r=0;n=e.parent(r);r++){if(n instanceof ae||n instanceof _t){var i=n.name;if(i&&i.definition()===t)break}}return n}function within_array_or_object_literal(e){var t,n=0;while(t=e.parent(n++)){if(t instanceof U)return false;if(t instanceof nt||t instanceof ot||t instanceof rt){return true}}return false}def_optimize(It,(function(e,t){if(!t.option("ie8")&&is_undeclared_ref(e)&&!t.find_parent(ne)){switch(e.name){case"undefined":return make_node(jt,e).optimize(t);case"NaN":return make_node(Yt,e).optimize(t);case"Infinity":return make_node(Zt,e).optimize(t)}}const n=t.parent();if(t.option("reduce_vars")&&is_lhs(e,n)!==e){const o=e.definition();const a=find_scope(t);if(t.top_retain&&o.global&&t.top_retain(o)){o.fixed=false;o.single_use=false;return e}let s=e.fixed_value();let u=o.single_use&&!(n instanceof ze&&n.is_callee_pure(t)||has_annotation(n,on))&&!(n instanceof Ue&&s instanceof ae&&s.name);if(u&&s instanceof V){u=!s.has_side_effects(t)&&!s.may_throw(t)}if(u&&(s instanceof ae||s instanceof _t)){if(retain_top_func(s,t)){u=false}else if(o.scope!==e.scope&&(o.escaped==1||has_flag(s,Sn)||within_array_or_object_literal(t)||!t.option("reduce_funcs"))){u=false}else if(recursive_ref(t,o)){u=false}else if(o.scope!==e.scope||o.orig[0]instanceof yt){u=s.is_constant_expression(e.scope);if(u=="f"){var r=e.scope;do{if(r instanceof ce||is_func_expr(r)){set_flag(r,Sn)}}while(r=r.parent_scope)}}}if(u&&s instanceof ae){u=o.scope===e.scope&&!scope_encloses_variables_in_this_scope(a,s)||n instanceof ze&&n.expression===e&&!scope_encloses_variables_in_this_scope(a,s)&&!(s.name&&s.name.definition().recursive_refs>0)}if(u&&s){if(s instanceof mt){set_flag(s,yn);s=make_node(ht,s,s)}if(s instanceof ce){set_flag(s,yn);s=make_node(ue,s,s)}if(o.recursive_refs>0&&s.name instanceof Tt){const e=s.name.definition();let t=s.variables.get(s.name.name);let n=t&&t.orig[0];if(!(n instanceof Rt)){n=make_node(Rt,s.name,s.name);n.scope=s;s.name=n;t=s.def_function(n)}walk(s,(n=>{if(n instanceof It&&n.definition()===e){n.thedef=t;t.references.push(n)}}))}if((s instanceof ae||s instanceof _t)&&s.parent_scope!==a){s=s.clone(true,t.get_toplevel());a.add_child_scope(s)}return s.optimize(t)}if(s){let n;if(s instanceof Vt){if(!(o.orig[0]instanceof yt)&&o.references.every((e=>o.scope===e.scope))){n=s}}else{var i=s.evaluate(t);if(i!==s&&(t.option("unsafe_regexp")||!(i instanceof RegExp))){n=make_node_from_constant(i,s)}}if(n){const r=e.size(t);const i=n.size(t);let a=0;if(t.option("unused")&&!t.exposed(o)){a=(r+2+i)/(o.references.length-o.assignments)}if(i<=r+a){return n}}}}return e}));function scope_encloses_variables_in_this_scope(e,t){for(const n of t.enclosed){if(t.variables.has(n.name)){continue}const r=e.find_variable(n.name);if(r){if(r===n)continue;return true}}return false}function is_atomic(e,t){return e instanceof It||e.TYPE===t.TYPE}def_optimize(jt,(function(e,t){if(t.option("unsafe_undefined")){var n=find_variable(t,"undefined");if(n){var r=make_node(It,e,{name:"undefined",scope:n.scope,thedef:n});set_flag(r,bn);return r}}var i=is_lhs(t.self(),t.parent());if(i&&is_atomic(i,e))return e;return make_node($e,e,{operator:"void",expression:make_node(Gt,e,{value:0})})}));def_optimize(Zt,(function(e,t){var n=is_lhs(t.self(),t.parent());if(n&&is_atomic(n,e))return e;if(t.option("keep_infinity")&&!(n&&!is_atomic(n,e))&&!find_variable(t,"Infinity")){return e}return make_node(Qe,e,{operator:"/",left:make_node(Gt,e,{value:1}),right:make_node(Gt,e,{value:0})})}));def_optimize(Yt,(function(e,t){var n=is_lhs(t.self(),t.parent());if(n&&!is_atomic(n,e)||find_variable(t,"NaN")){return make_node(Qe,e,{operator:"/",left:make_node(Gt,e,{value:0}),right:make_node(Gt,e,{value:0})})}return e}));function is_reachable(e,t){const find_ref=e=>{if(e instanceof It&&member(e.definition(),t)){return tn}};return walk_parent(e,((t,n)=>{if(t instanceof re&&t!==e){var r=n.parent();if(r instanceof ze&&r.expression===t)return;if(walk(t,find_ref))return tn;return true}}))}const Un=makePredicate("+ - / * % >> << >>> | ^ &");const zn=makePredicate("* | ^ &");def_optimize(et,(function(e,t){if(e.logical){return e.lift_sequences(t)}var n;if(t.option("dead_code")&&e.left instanceof It&&(n=e.left.definition()).scope===t.find_parent(ae)){var r=0,i,o=e;do{i=o;o=t.parent(r++);if(o instanceof he){if(in_try(r,o))break;if(is_reachable(n.scope,[n]))break;if(e.operator=="=")return e.right;n.fixed=false;return make_node(Qe,e,{operator:e.operator.slice(0,-1),left:e.left,right:e.right}).optimize(t)}}while(o instanceof Qe&&o.right===i||o instanceof Ge&&o.tail_node()===i)}e=e.lift_sequences(t);if(e.operator=="="&&e.left instanceof It&&e.right instanceof Qe){if(e.right.left instanceof It&&e.right.left.name==e.left.name&&Un.has(e.right.operator)){e.operator=e.right.operator+"=";e.right=e.right.right}else if(e.right.right instanceof It&&e.right.right.name==e.left.name&&zn.has(e.right.operator)&&!e.right.left.has_side_effects(t)){e.operator=e.right.operator+"=";e.right=e.right.left}}return e;function in_try(n,r){var i=e.right;e.right=make_node(qt,i);var o=r.may_throw(t);e.right=i;var a=e.left.definition().scope;var s;while((s=t.parent(n++))!==a){if(s instanceof Fe){if(s.bfinally)return true;if(o&&s.bcatch)return true}}}}));def_optimize(tt,(function(e,t){if(!t.option("evaluate")){return e}var n=e.right.evaluate(t);if(n===undefined){e=e.left}else if(n!==e.right){n=make_node_from_constant(n,e.right);e.right=best_of_expression(n,e.right)}return e}));function is_nullish(e,t){let n;return e instanceof qt||is_undefined(e,t)||e instanceof It&&(n=e.definition().fixed)instanceof V&&is_nullish(n,t)||e instanceof He&&e.optional&&is_nullish(e.expression,t)||e instanceof ze&&e.optional&&is_nullish(e.expression,t)||e instanceof Ye&&is_nullish(e.expression,t)}function is_nullish_check(e,t,n){if(t.may_throw(n))return false;let r;if(e instanceof Qe&&e.operator==="=="&&((r=is_nullish(e.left,n)&&e.left)||(r=is_nullish(e.right,n)&&e.right))&&(r===e.left?e.right:e.left).equivalent_to(t)){return true}if(e instanceof Qe&&e.operator==="||"){let r;let i;const find_comparison=e=>{if(!(e instanceof Qe&&(e.operator==="==="||e.operator==="=="))){return false}let o=0;let a;if(e.left instanceof qt){o++;r=e;a=e.right}if(e.right instanceof qt){o++;r=e;a=e.left}if(is_undefined(e.left,n)){o++;i=e;a=e.right}if(is_undefined(e.right,n)){o++;i=e;a=e.left}if(o!==1){return false}if(!a.equivalent_to(t)){return false}return true};if(!find_comparison(e.left))return false;if(!find_comparison(e.right))return false;if(r&&i&&r!==i){return true}}return false}def_optimize(Je,(function(e,t){if(!t.option("conditionals"))return e;if(e.condition instanceof Ge){var n=e.condition.expressions.slice();e.condition=n.pop();n.push(e);return make_sequence(e,n)}var r=e.condition.evaluate(t);if(r!==e.condition){if(r){return maintain_this_binding(t.parent(),t.self(),e.consequent)}else{return maintain_this_binding(t.parent(),t.self(),e.alternative)}}var i=r.negate(t,first_in_statement(t));if(best_of(t,r,i)===i){e=make_node(Je,e,{condition:i,consequent:e.alternative,alternative:e.consequent})}var o=e.condition;var a=e.consequent;var s=e.alternative;if(o instanceof It&&a instanceof It&&o.definition()===a.definition()){return make_node(Qe,e,{operator:"||",left:o,right:s})}if(a instanceof et&&s instanceof et&&a.operator===s.operator&&a.logical===s.logical&&a.left.equivalent_to(s.left)&&(!e.condition.has_side_effects(t)||a.operator=="="&&!a.left.has_side_effects(t))){return make_node(et,e,{operator:a.operator,left:a.left,logical:a.logical,right:make_node(Je,e,{condition:e.condition,consequent:a.right,alternative:s.right})})}var u;if(a instanceof ze&&s.TYPE===a.TYPE&&a.args.length>0&&a.args.length==s.args.length&&a.expression.equivalent_to(s.expression)&&!e.condition.has_side_effects(t)&&!a.expression.has_side_effects(t)&&typeof(u=single_arg_diff())=="number"){var l=a.clone();l.args[u]=make_node(Je,e,{condition:e.condition,consequent:a.args[u],alternative:s.args[u]});return l}if(s instanceof Je&&a.equivalent_to(s.consequent)){return make_node(Je,e,{condition:make_node(Qe,e,{operator:"||",left:o,right:s.condition}),consequent:a,alternative:s.alternative}).optimize(t)}if(t.option("ecma")>=2020&&is_nullish_check(o,s,t)){return make_node(Qe,e,{operator:"??",left:s,right:a}).optimize(t)}if(s instanceof Ge&&a.equivalent_to(s.expressions[s.expressions.length-1])){return make_sequence(e,[make_node(Qe,e,{operator:"||",left:o,right:make_sequence(e,s.expressions.slice(0,-1))}),a]).optimize(t)}if(s instanceof Qe&&s.operator=="&&"&&a.equivalent_to(s.right)){return make_node(Qe,e,{operator:"&&",left:make_node(Qe,e,{operator:"||",left:o,right:s.left}),right:a}).optimize(t)}if(a instanceof Je&&a.alternative.equivalent_to(s)){return make_node(Je,e,{condition:make_node(Qe,e,{left:e.condition,operator:"&&",right:a.condition}),consequent:a.consequent,alternative:s})}if(a.equivalent_to(s)){return make_sequence(e,[e.condition,a]).optimize(t)}if(a instanceof Qe&&a.operator=="||"&&a.right.equivalent_to(s)){return make_node(Qe,e,{operator:"||",left:make_node(Qe,e,{operator:"&&",left:e.condition,right:a.left}),right:s}).optimize(t)}var c=t.in_boolean_context();if(is_true(e.consequent)){if(is_false(e.alternative)){return booleanize(e.condition)}return make_node(Qe,e,{operator:"||",left:booleanize(e.condition),right:e.alternative})}if(is_false(e.consequent)){if(is_true(e.alternative)){return booleanize(e.condition.negate(t))}return make_node(Qe,e,{operator:"&&",left:booleanize(e.condition.negate(t)),right:e.alternative})}if(is_true(e.alternative)){return make_node(Qe,e,{operator:"||",left:booleanize(e.condition.negate(t)),right:e.consequent})}if(is_false(e.alternative)){return make_node(Qe,e,{operator:"&&",left:booleanize(e.condition),right:e.consequent})}return e;function booleanize(e){if(e.is_boolean())return e;return make_node($e,e,{operator:"!",expression:e.negate(t)})}function is_true(e){return e instanceof en||c&&e instanceof zt&&e.getValue()||e instanceof $e&&e.operator=="!"&&e.expression instanceof zt&&!e.expression.getValue()}function is_false(e){return e instanceof Jt||c&&e instanceof zt&&!e.getValue()||e instanceof $e&&e.operator=="!"&&e.expression instanceof zt&&e.expression.getValue()}function single_arg_diff(){var e=a.args;var t=s.args;for(var n=0,r=e.length;n=2015;var r=this.expression;if(r instanceof rt){var i=r.properties;for(var o=i.length;--o>=0;){var a=i[o];if(""+(a instanceof ct?a.key.name:a.key)==e){const e=i.every((e=>(e instanceof ot||n&&e instanceof ct&&!e.is_generator)&&!e.computed_key()));if(!e)return;if(!safe_to_flatten(a.value,t))return;return make_node(qe,this,{expression:make_node(nt,r,{elements:i.map((function(e){var t=e.value;if(t instanceof se){t=make_node(ue,t,t)}var n=e.key;if(n instanceof V&&!(n instanceof kt)){return make_sequence(e,[n,t])}return t}))}),property:make_node(Gt,this,{value:o})})}}}}));def_optimize(qe,(function(e,t){var n=e.expression;var r=e.property;if(t.option("properties")){var i=r.evaluate(t);if(i!==r){if(typeof i=="string"){if(i=="undefined"){i=undefined}else{var o=parseFloat(i);if(o.toString()==i){i=o}}}r=e.property=best_of_expression(r,make_node_from_constant(i,r).transform(t));var a=""+i;if(is_basic_identifier_string(a)&&a.length<=r.size()+1){return make_node(Xe,e,{expression:n,optional:e.optional,property:a,quote:r.quote}).optimize(t)}}}var s;e:if(t.option("arguments")&&n instanceof It&&n.name=="arguments"&&n.definition().orig.length==1&&(s=n.scope)instanceof ae&&s.uses_arguments&&!(s instanceof le)&&r instanceof Gt){var u=r.getValue();var l=new Set;var c=s.argnames;for(var f=0;f1){p=null}}else if(!p&&!t.option("keep_fargs")&&u=s.argnames.length){p=s.create_symbol(yt,{source:s,scope:s,tentative_name:"argument_"+s.argnames.length});s.argnames.push(p)}}if(p){var m=make_node(It,e,p);m.reference({});clear_flag(p,gn);return m}}if(is_lhs(e,t.parent()))return e;if(i!==r){var h=e.flatten_object(a,t);if(h){n=e.expression=h.expression;r=e.property=h.property}}if(t.option("properties")&&t.option("side_effects")&&r instanceof Gt&&n instanceof nt){var u=r.getValue();var E=n.elements;var g=E[u];e:if(safe_to_flatten(g,t)){var v=true;var D=[];for(var b=E.length;--b>u;){var o=E[b].drop_side_effect_free(t);if(o){D.unshift(o);if(v&&o.has_side_effects(t))v=false}}if(g instanceof oe)break e;g=g instanceof $t?make_node(jt,g):g;if(!v)D.unshift(g);while(--b>=0){var o=E[b];if(o instanceof oe)break e;o=o.drop_side_effect_free(t);if(o)D.unshift(o);else u--}if(v){D.push(g);return make_sequence(e,D).optimize(t)}else return make_node(qe,e,{expression:make_node(nt,n,{elements:D}),property:make_node(Gt,r,{value:u})})}}var S=e.evaluate(t);if(S!==e){S=make_node_from_constant(S,e).optimize(t);return best_of(t,S,e)}if(e.optional&&is_nullish(e.expression,t)){return make_node(jt,e)}return e}));def_optimize(Ye,(function(e,t){e.expression=e.expression.optimize(t);return e}));ae.DEFMETHOD("contains_this",(function(){return walk(this,(e=>{if(e instanceof Vt)return tn;if(e!==this&&e instanceof re&&!(e instanceof le)){return true}}))}));def_optimize(Xe,(function(e,t){const n=t.parent();if(is_lhs(e,n))return e;if(t.option("unsafe_proto")&&e.expression instanceof Xe&&e.expression.property=="prototype"){var r=e.expression.expression;if(is_undeclared_ref(r))switch(r.name){case"Array":e.expression=make_node(nt,e.expression,{elements:[]});break;case"Function":e.expression=make_node(ue,e.expression,{argnames:[],body:[]});break;case"Number":e.expression=make_node(Gt,e.expression,{value:0});break;case"Object":e.expression=make_node(rt,e.expression,{properties:[]});break;case"RegExp":e.expression=make_node(Xt,e.expression,{value:{source:"t",flags:""}});break;case"String":e.expression=make_node(Kt,e.expression,{value:""});break}}if(!(n instanceof ze)||!has_annotation(n,on)){const n=e.flatten_object(e.property,t);if(n)return n.optimize(t)}let i=e.evaluate(t);if(i!==e){i=make_node_from_constant(i,e).optimize(t);return best_of(t,i,e)}if(e.optional&&is_nullish(e.expression,t)){return make_node(jt,e)}return e}));function literals_in_boolean_context(e,t){if(t.in_boolean_context()){return best_of(t,e,make_sequence(e,[e,make_node(en,e)]).optimize(t))}return e}function inline_array_like_spread(e){for(var t=0;te instanceof $t))){e.splice(t,1,...r.elements);t--}}}}def_optimize(nt,(function(e,t){var n=literals_in_boolean_context(e,t);if(n!==e){return n}inline_array_like_spread(e.elements);return e}));function inline_object_prop_spread(e,t){for(var n=0;ne instanceof ot))){e.splice(n,1,...i.properties);n--}else if(i instanceof zt&&!(i instanceof Kt)){e.splice(n,1)}else if(is_nullish(i,t)){e.splice(n,1)}}}}def_optimize(rt,(function(e,t){var n=literals_in_boolean_context(e,t);if(n!==e){return n}inline_object_prop_spread(e.properties,t);return e}));def_optimize(Xt,literals_in_boolean_context);def_optimize(Ee,(function(e,t){if(e.value&&is_undefined(e.value,t)){e.value=null}return e}));def_optimize(le,opt_AST_Lambda);def_optimize(ue,(function(e,t){e=opt_AST_Lambda(e,t);if(t.option("unsafe_arrows")&&t.option("ecma")>=2015&&!e.name&&!e.is_generator&&!e.uses_arguments&&!e.pinned()){const n=walk(e,(e=>{if(e instanceof Vt)return tn}));if(!n)return make_node(le,e,e).optimize(t)}return e}));def_optimize(_t,(function(e){return e}));def_optimize(Ae,(function(e,t){if(e.expression&&!e.is_star&&is_undefined(e.expression,t)){e.expression=null}return e}));def_optimize(pe,(function(e,t){if(!t.option("evaluate")||t.parent()instanceof _e){return e}var n=[];for(var r=0;r=2015&&(!(n instanceof RegExp)||n.test(e.key+""))){var r=e.key;var i=e.value;var o=i instanceof le&&Array.isArray(i.body)&&!i.contains_this();if((o||i instanceof ue)&&!i.name){return make_node(ct,e,{async:i.async,is_generator:i.is_generator,key:r instanceof V?r:make_node(kt,e,{name:r}),value:make_node(se,i,i),quote:e.quote})}}return e}));def_optimize(fe,(function(e,t){if(t.option("pure_getters")==true&&t.option("unused")&&!e.is_array&&Array.isArray(e.names)&&!is_destructuring_export_decl(t)&&!(e.names[e.names.length-1]instanceof oe)){var n=[];for(var r=0;r1)throw new Error("inline source map only works with singular input");t.sourceMap.content=read_source_map(e[o])}}}i=t.parse.toplevel}if(r&&t.mangle.properties.keep_quoted!=="strict"){reserve_quoted_keys(i,r)}if(t.wrap){i=i.wrap_commonjs(t.wrap)}if(t.enclose){i=i.wrap_enclose(t.enclose)}if(n)n.rename=Date.now();if(n)n.compress=Date.now();if(t.compress){i=new Compressor(t.compress,{mangle_options:t.mangle}).compress(i)}if(n)n.scope=Date.now();if(t.mangle)i.figure_out_scope(t.mangle);if(n)n.mangle=Date.now();if(t.mangle){hn.reset();i.compute_char_frequency(t.mangle);i.mangle_names(t.mangle)}if(n)n.properties=Date.now();if(t.mangle&&t.mangle.properties){i=mangle_properties(i,t.mangle.properties)}if(n)n.format=Date.now();var a={};if(t.format.ast){a.ast=i}if(t.format.spidermonkey){a.ast=i.to_mozilla_ast()}if(!HOP(t.format,"code")||t.format.code){if(t.sourceMap){t.format.source_map=await SourceMap({file:t.sourceMap.filename,orig:t.sourceMap.content,root:t.sourceMap.root});if(t.sourceMap.includeSources){if(e instanceof ie){throw new Error("original source content unavailable")}else for(var o in e)if(HOP(e,o)){t.format.source_map.get().setSourceContent(o,e[o])}}}delete t.format.ast;delete t.format.code;delete t.format.spidermonkey;var s=OutputStream(t.format);i.print(s);a.code=s.get();if(t.sourceMap){if(t.sourceMap.asObject){a.map=t.format.source_map.get().toJSON()}else{a.map=t.format.source_map.toString()}if(t.sourceMap.url=="inline"){var u=typeof a.map==="object"?JSON.stringify(a.map):a.map;a.code+="\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,"+Hn(u)}else if(t.sourceMap.url){a.code+="\n//# sourceMappingURL="+t.sourceMap.url}}}if(t.nameCache&&t.mangle){if(t.mangle.cache)t.nameCache.vars=cache_to_json(t.mangle.cache);if(t.mangle.properties&&t.mangle.properties.cache){t.nameCache.props=cache_to_json(t.mangle.properties.cache)}}if(t.format&&t.format.source_map){t.format.source_map.destroy()}if(n){n.end=Date.now();a.timings={parse:.001*(n.rename-n.parse),rename:.001*(n.compress-n.rename),compress:.001*(n.scope-n.compress),scope:.001*(n.mangle-n.scope),mangle:.001*(n.properties-n.mangle),properties:.001*(n.format-n.properties),format:.001*(n.end-n.format),total:.001*(n.end-n.start)}}return a}async function run_cli({program:e,packageJson:t,fs:r,path:i}){const o=new Set(["cname","parent_scope","scope","uses_eval","uses_with"]);var a={};var s={compress:false,mangle:false};const u=await _default_options();e.version(t.name+" "+t.version);e.parseArgv=e.parse;e.parse=undefined;if(process.argv.includes("ast"))e.helpInformation=describe_ast;else if(process.argv.includes("options"))e.helpInformation=function(){var e=[];for(var t in u){e.push("--"+(t==="sourceMap"?"source-map":t)+" options:");e.push(format_object(u[t]));e.push("")}return e.join("\n")};e.option("-p, --parse ","Specify parser options.",parse_js());e.option("-c, --compress [options]","Enable compressor/specify compressor options.",parse_js());e.option("-m, --mangle [options]","Mangle names/specify mangler options.",parse_js());e.option("--mangle-props [options]","Mangle properties/specify mangler options.",parse_js());e.option("-f, --format [options]","Format options.",parse_js());e.option("-b, --beautify [options]","Alias for --format.",parse_js());e.option("-o, --output ","Output file (default STDOUT).");e.option("--comments [filter]","Preserve copyright comments in the output.");e.option("--config-file ","Read minify() options from JSON file.");e.option("-d, --define [=value]","Global definitions.",parse_js("define"));e.option("--ecma ","Specify ECMAScript release: 5, 2015, 2016 or 2017...");e.option("-e, --enclose [arg[,...][:value[,...]]]","Embed output in a big function with configurable arguments and values.");e.option("--ie8","Support non-standard Internet Explorer 8.");e.option("--keep-classnames","Do not mangle/drop class names.");e.option("--keep-fnames","Do not mangle/drop function names. Useful for code relying on Function.prototype.name.");e.option("--module","Input is an ES6 module");e.option("--name-cache ","File to hold mangled name mappings.");e.option("--rename","Force symbol expansion.");e.option("--no-rename","Disable symbol expansion.");e.option("--safari10","Support non-standard Safari 10.");e.option("--source-map [options]","Enable source map/specify source map options.",parse_js());e.option("--timings","Display operations run time on STDERR.");e.option("--toplevel","Compress and/or mangle variables in toplevel scope.");e.option("--wrap ","Embed everything as a function with “exports” corresponding to “name” globally.");e.arguments("[files...]").parseArgv(process.argv);if(e.configFile){s=JSON.parse(read_file(e.configFile))}if(!e.output&&e.sourceMap&&e.sourceMap.url!="inline"){fatal("ERROR: cannot write source map to STDOUT")}["compress","enclose","ie8","mangle","module","safari10","sourceMap","toplevel","wrap"].forEach((function(t){if(t in e){s[t]=e[t]}}));if("ecma"in e){if(e.ecma!=(e.ecma|0))fatal("ERROR: ecma must be an integer");const t=e.ecma|0;if(t>5&&t<2015)s.ecma=t+2009;else s.ecma=t}if(e.format||e.beautify){const t=e.format||e.beautify;s.format=typeof t==="object"?t:{}}if(e.comments){if(typeof s.format!="object")s.format={};s.format.comments=typeof e.comments=="string"?e.comments=="false"?false:e.comments:"some"}if(e.define){if(typeof s.compress!="object")s.compress={};if(typeof s.compress.global_defs!="object")s.compress.global_defs={};for(var l in e.define){s.compress.global_defs[l]=e.define[l]}}if(e.keepClassnames){s.keep_classnames=true}if(e.keepFnames){s.keep_fnames=true}if(e.mangleProps){if(e.mangleProps.domprops){delete e.mangleProps.domprops}else{if(typeof e.mangleProps!="object")e.mangleProps={};if(!Array.isArray(e.mangleProps.reserved))e.mangleProps.reserved=[]}if(typeof s.mangle!="object")s.mangle={};s.mangle.properties=e.mangleProps}if(e.nameCache){s.nameCache=JSON.parse(read_file(e.nameCache,"{}"))}if(e.output=="ast"){s.format={ast:true,code:false}}if(e.parse){if(!e.parse.acorn&&!e.parse.spidermonkey){s.parse=e.parse}else if(e.sourceMap&&e.sourceMap.content=="inline"){fatal("ERROR: inline source map only works with built-in parser")}}if(~e.rawArgs.indexOf("--rename")){s.rename=true}else if(!e.rename){s.rename=false}let convert_path=e=>e;if(typeof e.sourceMap=="object"&&"base"in e.sourceMap){convert_path=function(){var t=e.sourceMap.base;delete s.sourceMap.base;return function(e){return i.relative(t,e)}}()}let c;if(s.files&&s.files.length){c=s.files;delete s.files}else if(e.args.length){c=e.args}if(c){simple_glob(c).forEach((function(e){a[convert_path(e)]=read_file(e)}))}else{await new Promise((e=>{var t=[];process.stdin.setEncoding("utf8");process.stdin.on("data",(function(e){t.push(e)})).on("end",(function(){a=[t.join("")];e()}));process.stdin.resume()}))}await run_cli();function convert_ast(e){return V.from_mozilla_ast(Object.keys(a).reduce(e,null))}async function run_cli(){var t=e.sourceMap&&e.sourceMap.content;if(t&&t!=="inline"){s.sourceMap.content=read_file(t,t)}if(e.timings)s.timings=true;try{if(e.parse){if(e.parse.acorn){a=convert_ast((function(t,r){return n(988).parse(a[r],{ecmaVersion:2018,locations:true,program:t,sourceFile:r,sourceType:s.module||e.parse.module?"module":"script"})}))}else if(e.parse.spidermonkey){a=convert_ast((function(e,t){var n=JSON.parse(a[t]);if(!e)return n;e.body=e.body.concat(n.body);return e}))}}}catch(e){fatal(e)}let i;try{i=await minify(a,s)}catch(e){if(e.name=="SyntaxError"){print_error("Parse error at "+e.filename+":"+e.line+","+e.col);var u=e.col;var l=a[e.filename].split(/\r?\n/);var c=l[e.line-1];if(!c&&!u){c=l[e.line-2];u=c.length}if(c){var f=70;if(u>f){c=c.slice(u-f);u=f}print_error(c.slice(0,80));print_error(c.slice(0,u).replace(/\S/g," ")+"^")}}if(e.defs){print_error("Supported options:");print_error(format_object(e.defs))}fatal(e);return}if(e.output=="ast"){if(!s.compress&&!s.mangle){i.ast.figure_out_scope({})}console.log(JSON.stringify(i.ast,(function(e,t){if(t)switch(e){case"thedef":return symdef(t);case"enclosed":return t.length?t.map(symdef):undefined;case"variables":case"globals":return t.size?collect_from_map(t,symdef):undefined}if(o.has(e))return;if(t instanceof AST_Token)return;if(t instanceof Map)return;if(t instanceof V){var n={_class:"AST_"+t.TYPE};if(t.block_scope){n.variables=t.block_scope.variables;n.enclosed=t.block_scope.enclosed}t.CTOR.PROPS.forEach((function(e){n[e]=t[e]}));return n}return t}),2))}else if(e.output=="spidermonkey"){try{const e=await minify(i.code,{compress:false,mangle:false,format:{ast:true,code:false}});console.log(JSON.stringify(e.ast.to_mozilla_ast(),null,2))}catch(e){fatal(e);return}}else if(e.output){r.writeFileSync(e.output,i.code);if(s.sourceMap&&s.sourceMap.url!=="inline"&&i.map){r.writeFileSync(e.output+".map",i.map)}}else{console.log(i.code)}if(e.nameCache){r.writeFileSync(e.nameCache,JSON.stringify(s.nameCache))}if(i.timings)for(var _ in i.timings){print_error("- "+_+": "+i.timings[_].toFixed(3)+"s")}}function fatal(e){if(e instanceof Error)e=e.stack.replace(/^\S*?Error:/,"ERROR:");print_error(e);process.exit(1)}function simple_glob(e){if(Array.isArray(e)){return[].concat.apply([],e.map(simple_glob))}if(e&&e.match(/[*?]/)){var t=i.dirname(e);try{var n=r.readdirSync(t)}catch(e){}if(n){var o="^"+i.basename(e).replace(/[.+^$[\]\\(){}]/g,"\\$&").replace(/\*/g,"[^/\\\\]*").replace(/\?/g,"[^/\\\\]")+"$";var a=process.platform==="win32"?"i":"";var s=new RegExp(o,a);var u=n.filter((function(e){return s.test(e)})).map((function(e){return i.join(t,e)}));if(u.length)return u}}return[e]}function read_file(e,t){try{return r.readFileSync(e,"utf8")}catch(e){if((e.code=="ENOENT"||e.code=="ENAMETOOLONG")&&t!=null)return t;fatal(e)}}function parse_js(e){return function(t,n){n=n||{};try{walk(parse(t,{expression:true}),(t=>{if(t instanceof et){var r=t.left.print_to_string();var i=t.right;if(e){n[r]=i}else if(i instanceof nt){n[r]=i.elements.map(to_string)}else if(i instanceof Xt){i=i.value;n[r]=new RegExp(i.source,i.flags)}else{n[r]=to_string(i)}return true}if(t instanceof Et||t instanceof He){var r=t.print_to_string();n[r]=true;return true}if(!(t instanceof Ge))throw t;function to_string(e){return e instanceof zt?e.getValue():e.print_to_string({quote_keys:true})}}))}catch(r){if(e){fatal("Error parsing arguments for '"+e+"': "+t)}else{n[t]=null}}return n}}function symdef(e){var t=1e6+e.id+" "+e.name;if(e.mangled_name)t+=" "+e.mangled_name;return t}function collect_from_map(e,t){var n=[];e.forEach((function(e){n.push(t(e))}));return n}function format_object(e){var t=[];var n="";Object.keys(e).map((function(t){if(n.length!/^\$/.test(e)));if(n.length>0){e.space();e.with_parens((function(){n.forEach((function(t,n){if(n)e.space();e.print(t)}))}))}if(t.documentation){e.space();e.print_string(t.documentation)}if(t.SUBCLASSES.length>0){e.space();e.with_block((function(){t.SUBCLASSES.forEach((function(t){e.indent();doitem(t);e.newline()}))}))}}doitem(V);return e+"\n"}}async function _default_options(){const e={};Object.keys(infer_options({0:0})).forEach((t=>{const n=infer_options({[t]:{0:0}});if(n)e[t]=n}));return e}async function infer_options(e){try{await minify("",e)}catch(e){return e.defs}}e._default_options=_default_options;e._run_cli=run_cli;e.minify=minify}))}};var t={};function __nccwpck_require__(n){var r=t[n];if(r!==undefined){return r.exports}var i=t[n]={exports:{}};var o=true;try{e[n].call(i.exports,i,i.exports,__nccwpck_require__);o=false}finally{if(o)delete t[n]}return i.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var n=__nccwpck_require__(405);module.exports=n})(); \ No newline at end of file +(()=>{var e={988:e=>{"use strict";e.exports=require("next/dist/compiled/acorn")},749:e=>{"use strict";e.exports=require("next/dist/compiled/source-map")},405:function(e,t,n){(function(e,r){true?r(t,n(749)):0})(this,(function(e,t){"use strict";function _interopDefaultLegacy(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var r=_interopDefaultLegacy(t);function characters(e){return e.split("")}function member(e,t){return t.includes(e)}class DefaultsError extends Error{constructor(e,t){super();this.name="DefaultsError";this.message=e;this.defs=t}}function defaults(e,t,n){if(e===true){e={}}else if(e!=null&&typeof e==="object"){e={...e}}const r=e||{};if(n)for(const e in r)if(HOP(r,e)&&!HOP(t,e)){throw new DefaultsError("`"+e+"` is not a supported option",t)}for(const n in t)if(HOP(t,n)){if(!e||!HOP(e,n)){r[n]=t[n]}else if(n==="ecma"){let t=e[n]|0;if(t>5&&t<2015)t+=2009;r[n]=t}else{r[n]=e&&HOP(e,n)?e[n]:t[n]}}return r}function noop(){}function return_false(){return false}function return_true(){return true}function return_this(){return this}function return_null(){return null}var i=function(){function MAP(t,n,r){var i=[],o=[],a;function doit(){var s=n(t[a],a);var u=s instanceof Last;if(u)s=s.v;if(s instanceof AtTop){s=s.v;if(s instanceof Splice){o.push.apply(o,r?s.v.slice().reverse():s.v)}else{o.push(s)}}else if(s!==e){if(s instanceof Splice){i.push.apply(i,r?s.v.slice().reverse():s.v)}else{i.push(s)}}return u}if(Array.isArray(t)){if(r){for(a=t.length;--a>=0;)if(doit())break;i.reverse();o.reverse()}else{for(a=0;a=0;){if(e[n]===t)e.splice(n,1)}}function mergeSort(e,t){if(e.length<2)return e.slice();function merge(e,n){var r=[],i=0,o=0,a=0;while(i{n+=e}))}return n}function has_annotation(e,t){return e._annotations&t}function set_annotation(e,t){e._annotations|=t}var s="";var u=true;var l="break case catch class const continue debugger default delete do else export extends finally for function if in instanceof let new return switch throw try typeof var void while with";var c="false null true";var f="enum import super this "+c+" "+l;var _="implements interface package private protected public static "+f;var p="return new delete throw else case yield await";l=makePredicate(l);f=makePredicate(f);p=makePredicate(p);c=makePredicate(c);_=makePredicate(_);var d=makePredicate(characters("+-*&%=<>!?|~^"));var m=/[0-9a-f]/i;var h=/^0x[0-9a-f]+$/i;var E=/^0[0-7]+$/;var g=/^0o[0-7]+$/i;var v=/^0b[01]+$/i;var D=/^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i;var b=/^(0[xob])?[0-9a-f]+n$/i;var S=makePredicate(["in","instanceof","typeof","new","void","delete","++","--","+","-","!","~","&","|","^","*","**","/","%",">>","<<",">>>","<",">","<=",">=","==","===","!=","!==","?","=","+=","-=","||=","&&=","??=","/=","*=","**=","%=",">>=","<<=",">>>=","|=","^=","&=","&&","??","||"]);var y=makePredicate(characters("  \n\r\t\f\v​           \u2028\u2029   \ufeff"));var A=makePredicate(characters("\n\r\u2028\u2029"));var T=makePredicate(characters(";]),:"));var k=makePredicate(characters("[{(,;:"));var C=makePredicate(characters("[]{}(),;:"));var R={ID_Start:/[$A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,ID_Continue:/(?:[$0-9A-Z_a-z\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF])+/};function get_full_char(e,t){if(is_surrogate_pair_head(e.charCodeAt(t))){if(is_surrogate_pair_tail(e.charCodeAt(t+1))){return e.charAt(t)+e.charAt(t+1)}}else if(is_surrogate_pair_tail(e.charCodeAt(t))){if(is_surrogate_pair_head(e.charCodeAt(t-1))){return e.charAt(t-1)+e.charAt(t)}}return e.charAt(t)}function get_full_char_code(e,t){if(is_surrogate_pair_head(e.charCodeAt(t))){return 65536+(e.charCodeAt(t)-55296<<10)+e.charCodeAt(t+1)-56320}return e.charCodeAt(t)}function get_full_char_length(e){var t=0;for(var n=0;n65535){e-=65536;return String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)}return String.fromCharCode(e)}function is_surrogate_pair_head(e){return e>=55296&&e<=56319}function is_surrogate_pair_tail(e){return e>=56320&&e<=57343}function is_digit(e){return e>=48&&e<=57}function is_identifier_start(e){return R.ID_Start.test(e)}function is_identifier_char(e){return R.ID_Continue.test(e)}const F=/^[a-z_$][a-z0-9_$]*$/i;function is_basic_identifier_string(e){return F.test(e)}function is_identifier_string(e,t){if(F.test(e)){return true}if(!t&&/[\ud800-\udfff]/.test(e)){return false}var n=R.ID_Start.exec(e);if(!n||n.index!==0){return false}e=e.slice(n[0].length);if(!e){return true}n=R.ID_Continue.exec(e);return!!n&&n[0].length===e.length}function parse_js_number(e,t=true){if(!t&&e.includes("e")){return NaN}if(h.test(e)){return parseInt(e.substr(2),16)}else if(E.test(e)){return parseInt(e.substr(1),8)}else if(g.test(e)){return parseInt(e.substr(2),8)}else if(v.test(e)){return parseInt(e.substr(2),2)}else if(D.test(e)){return parseFloat(e)}else{var n=parseFloat(e);if(n==e)return n}}class JS_Parse_Error extends Error{constructor(e,t,n,r,i){super();this.name="SyntaxError";this.message=e;this.filename=t;this.line=n;this.col=r;this.pos=i}}function js_error(e,t,n,r,i){throw new JS_Parse_Error(e,t,n,r,i)}function is_token(e,t,n){return e.type==t&&(n==null||e.value==n)}var O={};function tokenizer(e,t,n,r){var i={text:e,filename:t,pos:0,tokpos:0,line:1,tokline:0,col:0,tokcol:0,newline_before:false,regex_allowed:false,brace_counter:0,template_braces:[],comments_before:[],directives:{},directive_stack:[]};function peek(){return get_full_char(i.text,i.pos)}function is_option_chain_op(){const e=i.text.charCodeAt(i.pos+1)===46;if(!e)return false;const t=i.text.charCodeAt(i.pos+2);return t<48||t>57}function next(e,t){var n=get_full_char(i.text,i.pos++);if(e&&!n)throw O;if(A.has(n)){i.newline_before=i.newline_before||!t;++i.line;i.col=0;if(n=="\r"&&peek()=="\n"){++i.pos;n="\n"}}else{if(n.length>1){++i.pos;++i.col}++i.col}return n}function forward(e){while(e--)next()}function looking_at(e){return i.text.substr(i.pos,e.length)==e}function find_eol(){var e=i.text;for(var t=i.pos,n=i.text.length;t="0"&&e<="7"}function read_escaped_char(e,t,n){var r=next(true,e);switch(r.charCodeAt(0)){case 110:return"\n";case 114:return"\r";case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 120:return String.fromCharCode(hex_bytes(2,t));case 117:if(peek()=="{"){next(true);if(peek()==="}")parse_error("Expecting hex-character between {}");while(peek()=="0")next(true);var o,a=find("}",true)-i.pos;if(a>6||(o=hex_bytes(a,t))>1114111){parse_error("Unicode reference out of bounds")}next(true);return from_char_code(o)}return String.fromCharCode(hex_bytes(4,t));case 10:return"";case 13:if(peek()=="\n"){next(true,e);return""}}if(is_octal(r)){if(n&&t){const e=r==="0"&&!is_octal(peek());if(!e){parse_error("Octal escape sequences are not allowed in template strings")}}return read_octal_escape_sequence(r,t)}return r}function read_octal_escape_sequence(e,t){var n=peek();if(n>="0"&&n<="7"){e+=next(true);if(e[0]<="3"&&(n=peek())>="0"&&n<="7")e+=next(true)}if(e==="0")return"\0";if(e.length>0&&next_token.has_directive("use strict")&&t)parse_error("Legacy octal escape sequences are not allowed in strict mode");return String.fromCharCode(parseInt(e,8))}function hex_bytes(e,t){var n=0;for(;e>0;--e){if(!t&&isNaN(parseInt(peek(),16))){return parseInt(n,16)||""}var r=next(true);if(isNaN(parseInt(r,16)))parse_error("Invalid hex-character pattern in string");n+=r}return parseInt(n,16)}var _=with_eof_error("Unterminated string constant",(function(){const e=i.pos;var t=next(),n=[];for(;;){var r=next(true,true);if(r=="\\")r=read_escaped_char(true,true);else if(r=="\r"||r=="\n")parse_error("Unterminated string constant");else if(r==t)break;n.push(r)}var o=token("string",n.join(""));s=i.text.slice(e,i.pos);o.quote=t;return o}));var g=with_eof_error("Unterminated template",(function(e){if(e){i.template_braces.push(i.brace_counter)}var t="",n="",r,o;next(true,true);while((r=next(true,true))!="`"){if(r=="\r"){if(peek()=="\n")++i.pos;r="\n"}else if(r=="$"&&peek()=="{"){next(true,true);i.brace_counter++;o=token(e?"template_head":"template_substitution",t);s=n;u=false;return o}n+=r;if(r=="\\"){var l=i.pos;var c=a&&(a.type==="name"||a.type==="punc"&&(a.value===")"||a.value==="]"));r=read_escaped_char(true,!c,true);n+=i.text.substr(l,i.pos-l)}t+=r}i.template_braces.pop();o=token(e?"template_head":"template_substitution",t);s=n;u=true;return o}));function skip_line_comment(e){var t=i.regex_allowed;var n=find_eol(),r;if(n==-1){r=i.text.substr(i.pos);i.pos=i.text.length}else{r=i.text.substring(i.pos,n);i.pos=n}i.col=i.tokcol+(i.pos-i.tokpos);i.comments_before.push(token(e,r,true));i.regex_allowed=t;return next_token}var v=with_eof_error("Unterminated multiline comment",(function(){var e=i.regex_allowed;var t=find("*/",true);var n=i.text.substring(i.pos,t).replace(/\r\n|\r|\u2028|\u2029/g,"\n");forward(get_full_char_length(n)+2);i.comments_before.push(token("comment2",n,true));i.newline_before=i.newline_before||n.includes("\n");i.regex_allowed=e;return next_token}));var D=with_eof_error("Unterminated identifier name",(function(){var e=[],t,n=false;var read_escaped_identifier_char=function(){n=true;next();if(peek()!=="u"){parse_error("Expecting UnicodeEscapeSequence -- uXXXX or u{XXXX}")}return read_escaped_char(false,true)};if((t=peek())==="\\"){t=read_escaped_identifier_char();if(!is_identifier_start(t)){parse_error("First identifier char is an invalid identifier char")}}else if(is_identifier_start(t)){next()}else{return""}e.push(t);while((t=peek())!=null){if((t=peek())==="\\"){t=read_escaped_identifier_char();if(!is_identifier_char(t)){parse_error("Invalid escaped identifier char")}}else{if(!is_identifier_char(t)){break}next()}e.push(t)}const r=e.join("");if(f.has(r)&&n){parse_error("Escaped characters are not allowed in keywords")}return r}));var T=with_eof_error("Unterminated regular expression",(function(e){var t=false,n,r=false;while(n=next(true))if(A.has(n)){parse_error("Unexpected line terminator")}else if(t){e+="\\"+n;t=false}else if(n=="["){r=true;e+=n}else if(n=="]"&&r){r=false;e+=n}else if(n=="/"&&!r){break}else if(n=="\\"){t=true}else{e+=n}const i=D();return token("regexp","/"+e+"/"+i)}));function read_operator(e){function grow(e){if(!peek())return e;var t=e+peek();if(S.has(t)){next();return grow(t)}else{return e}}return token("operator",grow(e||next()))}function handle_slash(){next();switch(peek()){case"/":next();return skip_line_comment("comment1");case"*":next();return v()}return i.regex_allowed?T(""):read_operator("/")}function handle_eq_sign(){next();if(peek()===">"){next();return token("arrow","=>")}else{return read_operator("=")}}function handle_dot(){next();if(is_digit(peek().charCodeAt(0))){return read_num(".")}if(peek()==="."){next();next();return token("expand","...")}return token("punc",".")}function read_word(){var e=D();if(o)return token("name",e);return c.has(e)?token("atom",e):!l.has(e)?token("name",e):S.has(e)?token("operator",e):token("keyword",e)}function read_private_word(){next();return token("privatename",D())}function with_eof_error(e,t){return function(n){try{return t(n)}catch(t){if(t===O)parse_error(e);else throw t}}}function next_token(e){if(e!=null)return T(e);if(r&&i.pos==0&&looking_at("#!")){start_token();forward(2);skip_line_comment("comment5")}for(;;){skip_whitespace();start_token();if(n){if(looking_at("\x3c!--")){forward(4);skip_line_comment("comment3");continue}if(looking_at("--\x3e")&&i.newline_before){forward(3);skip_line_comment("comment4");continue}}var t=peek();if(!t)return token("eof");var o=t.charCodeAt(0);switch(o){case 34:case 39:return _();case 46:return handle_dot();case 47:{var a=handle_slash();if(a===next_token)continue;return a}case 61:return handle_eq_sign();case 63:{if(!is_option_chain_op())break;next();next();return token("punc","?.")}case 96:return g(true);case 123:i.brace_counter++;break;case 125:i.brace_counter--;if(i.template_braces.length>0&&i.template_braces[i.template_braces.length-1]===i.brace_counter)return g(false);break}if(is_digit(o))return read_num();if(C.has(t))return token("punc",next());if(d.has(t))return read_operator();if(o==92||is_identifier_start(t))return read_word();if(o==35)return read_private_word();break}parse_error("Unexpected character '"+t+"'")}next_token.next=next;next_token.peek=peek;next_token.context=function(e){if(e)i=e;return i};next_token.add_directive=function(e){i.directive_stack[i.directive_stack.length-1].push(e);if(i.directives[e]===undefined){i.directives[e]=1}else{i.directives[e]++}};next_token.push_directives_stack=function(){i.directive_stack.push([])};next_token.pop_directives_stack=function(){var e=i.directive_stack[i.directive_stack.length-1];for(var t=0;t0};return next_token}var M=makePredicate(["typeof","void","delete","--","++","!","~","-","+"]);var x=makePredicate(["--","++"]);var N=makePredicate(["=","+=","-=","??=","&&=","||=","/=","*=","**=","%=",">>=","<<=",">>>=","|=","^=","&="]);var w=makePredicate(["??=","&&=","||="]);var I=function(e,t){for(var n=0;n","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]],{});var P=makePredicate(["atom","num","big_int","string","regexp","name"]);function parse(e,t){const n=new WeakMap;t=defaults(t,{bare_returns:false,ecma:null,expression:false,filename:null,html5_comments:true,module:false,shebang:true,strict:false,toplevel:null},true);var r={input:typeof e=="string"?tokenizer(e,t.filename,t.html5_comments,t.shebang):e,token:null,prev:null,peeked:null,in_function:0,in_async:-1,in_generator:-1,in_directives:true,in_loop:0,labels:[]};r.token=next();function is(e,t){return is_token(r.token,e,t)}function peek(){return r.peeked||(r.peeked=r.input())}function next(){r.prev=r.token;if(!r.peeked)peek();r.token=r.peeked;r.peeked=null;r.in_directives=r.in_directives&&(r.token.type=="string"||is("punc",";"));return r.token}function prev(){return r.prev}function croak(e,t,n,i){var o=r.input.context();js_error(e,o.filename,t!=null?t:o.tokline,n!=null?n:o.tokcol,i!=null?i:o.tokpos)}function token_error(e,t){croak(t,e.line,e.col)}function unexpected(e){if(e==null)e=r.token;token_error(e,"Unexpected token: "+e.type+" ("+e.value+")")}function expect_token(e,t){if(is(e,t)){return next()}token_error(r.token,"Unexpected token "+r.token.type+" «"+r.token.value+"»"+", expected "+e+" «"+t+"»")}function expect(e){return expect_token("punc",e)}function has_newline_before(e){return e.nlb||!e.comments_before.every((e=>!e.nlb))}function can_insert_semicolon(){return!t.strict&&(is("eof")||is("punc","}")||has_newline_before(r.token))}function is_in_generator(){return r.in_generator===r.in_function}function is_in_async(){return r.in_async===r.in_function}function can_await(){return r.in_async===r.in_function||r.in_function===0&&r.input.has_directive("use strict")}function semicolon(e){if(is("punc",";"))next();else if(!e&&!can_insert_semicolon())unexpected()}function parenthesised(){expect("(");var e=expression(true);expect(")");return e}function embed_tokens(e){return function _embed_tokens_wrapper(...t){const n=r.token;const i=e(...t);i.start=n;i.end=prev();return i}}function handle_regexp(){if(is("operator","/")||is("operator","/=")){r.peeked=null;r.token=r.input(r.token.value.substr(1))}}var i=embed_tokens((function statement(e,n,i){handle_regexp();switch(r.token.type){case"string":if(r.in_directives){var o=peek();if(!s.includes("\\")&&(is_token(o,"punc",";")||is_token(o,"punc","}")||has_newline_before(o)||is_token(o,"eof"))){r.input.add_directive(r.token.value)}else{r.in_directives=false}}var a=r.in_directives,u=simple_statement();return a&&u.body instanceof Gt?new G(u.body):u;case"template_head":case"num":case"big_int":case"regexp":case"operator":case"atom":return simple_statement();case"name":if(r.token.value=="async"&&is_token(peek(),"keyword","function")){next();next();if(n){croak("functions are not allowed as the body of a loop")}return function_(fe,false,true,e)}if(r.token.value=="import"&&!is_token(peek(),"punc","(")&&!is_token(peek(),"punc",".")){next();var l=import_statement();semicolon();return l}return is_token(peek(),"punc",":")?labeled_statement():simple_statement();case"punc":switch(r.token.value){case"{":return new W({start:r.token,body:block_(),end:prev()});case"[":case"(":return simple_statement();case";":r.in_directives=false;next();return new q;default:unexpected()}case"keyword":switch(r.token.value){case"break":next();return break_cont(be);case"continue":next();return break_cont(Se);case"debugger":next();semicolon();return new K;case"do":next();var c=in_loop(statement);expect_token("keyword","while");var f=parenthesised();semicolon(true);return new Q({body:c,condition:f});case"while":next();return new J({condition:parenthesised(),body:in_loop((function(){return statement(false,true)}))});case"for":next();return for_();case"class":next();if(n){croak("classes are not allowed as the body of a loop")}if(i){croak("classes are not allowed as the body of an if")}return class_(ht,e);case"function":next();if(n){croak("functions are not allowed as the body of a loop")}return function_(fe,false,false,e);case"if":next();return if_();case"return":if(r.in_function==0&&!t.bare_returns)croak("'return' outside of function");next();var _=null;if(is("punc",";")){next()}else if(!can_insert_semicolon()){_=expression(true);semicolon()}return new ge({value:_});case"switch":next();return new ke({expression:parenthesised(),body:in_loop(switch_body_)});case"throw":next();if(has_newline_before(r.token))croak("Illegal newline after 'throw'");var _=expression(true);semicolon();return new ve({value:_});case"try":next();return try_();case"var":next();var l=var_();semicolon();return l;case"let":next();var l=let_();semicolon();return l;case"const":next();var l=const_();semicolon();return l;case"with":if(r.input.has_directive("use strict")){croak("Strict mode may not include a with statement")}next();return new re({expression:parenthesised(),body:statement()});case"export":if(!is_token(peek(),"punc","(")){next();var l=export_statement();if(is("punc",";"))semicolon();return l}}}unexpected()}));function labeled_statement(){var e=as_symbol(It);if(e.name==="await"&&is_in_async()){token_error(r.prev,"await cannot be used as label inside async function")}if(r.labels.some((t=>t.name===e.name))){croak("Label "+e.name+" defined twice")}expect(":");r.labels.push(e);var t=i();r.labels.pop();if(!(t instanceof $)){e.references.forEach((function(t){if(t instanceof Se){t=t.label.start;croak("Continue label `"+e.name+"` refers to non-IterationStatement.",t.line,t.col,t.pos)}}))}return new j({body:t,label:e})}function simple_statement(e){return new H({body:(e=expression(true),semicolon(),e)})}function break_cont(e){var t=null,n;if(!can_insert_semicolon()){t=as_symbol(Vt,true)}if(t!=null){n=r.labels.find((e=>e.name===t.name));if(!n)croak("Undefined label "+t.name);t.thedef=n}else if(r.in_loop==0)croak(e.TYPE+" not inside a loop or switch");semicolon();var i=new e({label:t});if(n)n.references.push(i);return i}function for_(){var e="`for await` invalid in this context";var t=r.token;if(t.type=="name"&&t.value=="await"){if(!can_await()){token_error(t,e)}next()}else{t=false}expect("(");var n=null;if(!is("punc",";")){n=is("keyword","var")?(next(),var_(true)):is("keyword","let")?(next(),let_(true)):is("keyword","const")?(next(),const_(true)):expression(true,true);var i=is("operator","in");var o=is("name","of");if(t&&!o){token_error(t,e)}if(i||o){if(n instanceof Ne){if(n.definitions.length>1)token_error(n.start,"Only one variable declaration allowed in for..in loop")}else if(!(is_assignable(n)||(n=to_destructuring(n))instanceof _e)){token_error(n.start,"Invalid left-hand side in for..in loop")}next();if(i){return for_in(n)}else{return for_of(n,!!t)}}}else if(t){token_error(t,e)}return regular_for(n)}function regular_for(e){expect(";");var t=is("punc",";")?null:expression(true);expect(";");var n=is("punc",")")?null:expression(true);expect(")");return new ee({init:e,condition:t,step:n,body:in_loop((function(){return i(false,true)}))})}function for_of(e,t){var n=e instanceof Ne?e.definitions[0].name:null;var r=expression(true);expect(")");return new ne({await:t,init:e,name:n,object:r,body:in_loop((function(){return i(false,true)}))})}function for_in(e){var t=expression(true);expect(")");return new te({init:e,object:t,body:in_loop((function(){return i(false,true)}))})}var arrow_function=function(e,t,n){if(has_newline_before(r.token)){croak("Unexpected newline before arrow (=>)")}expect_token("arrow","=>");var i=_function_body(is("punc","{"),false,n);var o=i instanceof Array&&i.length?i[i.length-1].end:i instanceof Array?e:i.end;return new ce({start:e,end:o,async:n,argnames:t,body:i})};var function_=function(e,t,n,r){var i=e===fe;var o=is("operator","*");if(o){next()}var a=is("name")?as_symbol(i?kt:Ft):null;if(i&&!a){if(r){e=le}else{unexpected()}}if(a&&e!==ue&&!(a instanceof Dt))unexpected(prev());var s=[];var u=_function_body(true,o||t,n,a,s);return new e({start:s.start,end:u.end,is_generator:o,async:n,name:a,argnames:s,body:u})};function track_used_binding_identifiers(e,t){var n=new Set;var r=false;var i=false;var o=false;var a=!!t;var s={add_parameter:function(t){if(n.has(t.value)){if(r===false){r=t}s.check_strict()}else{n.add(t.value);if(e){switch(t.value){case"arguments":case"eval":case"yield":if(a){token_error(t,"Unexpected "+t.value+" identifier as parameter inside strict mode")}break;default:if(f.has(t.value)){unexpected()}}}}},mark_default_assignment:function(e){if(i===false){i=e}},mark_spread:function(e){if(o===false){o=e}},mark_strict_mode:function(){a=true},is_strict:function(){return i!==false||o!==false||a},check_strict:function(){if(s.is_strict()&&r!==false){token_error(r,"Parameter "+r.value+" was used already")}}};return s}function parameters(e){var t=track_used_binding_identifiers(true,r.input.has_directive("use strict"));expect("(");while(!is("punc",")")){var n=parameter(t);e.push(n);if(!is("punc",")")){expect(",")}if(n instanceof ae){break}}next()}function parameter(e,t){var n;var i=false;if(e===undefined){e=track_used_binding_identifiers(true,r.input.has_directive("use strict"))}if(is("expand","...")){i=r.token;e.mark_spread(r.token);next()}n=binding_element(e,t);if(is("operator","=")&&i===false){e.mark_default_assignment(r.token);next();n=new nt({start:n.start,left:n,operator:"=",right:expression(false),end:r.token})}if(i!==false){if(!is("punc",")")){unexpected()}n=new ae({start:i,expression:n,end:i})}e.check_strict();return n}function binding_element(e,t){var n=[];var i=true;var o=false;var a;var s=r.token;if(e===undefined){e=track_used_binding_identifiers(false,r.input.has_directive("use strict"))}t=t===undefined?Tt:t;if(is("punc","[")){next();while(!is("punc","]")){if(i){i=false}else{expect(",")}if(is("expand","...")){o=true;a=r.token;e.mark_spread(r.token);next()}if(is("punc")){switch(r.token.value){case",":n.push(new Zt({start:r.token,end:r.token}));continue;case"]":break;case"[":case"{":n.push(binding_element(e,t));break;default:unexpected()}}else if(is("name")){e.add_parameter(r.token);n.push(as_symbol(t))}else{croak("Invalid function parameter")}if(is("operator","=")&&o===false){e.mark_default_assignment(r.token);next();n[n.length-1]=new nt({start:n[n.length-1].start,left:n[n.length-1],operator:"=",right:expression(false),end:r.token})}if(o){if(!is("punc","]")){croak("Rest element must be last element")}n[n.length-1]=new ae({start:a,expression:n[n.length-1],end:a})}}expect("]");e.check_strict();return new _e({start:s,names:n,is_array:true,end:prev()})}else if(is("punc","{")){next();while(!is("punc","}")){if(i){i=false}else{expect(",")}if(is("expand","...")){o=true;a=r.token;e.mark_spread(r.token);next()}if(is("name")&&(is_token(peek(),"punc")||is_token(peek(),"operator"))&&[",","}","="].includes(peek().value)){e.add_parameter(r.token);var u=prev();var l=as_symbol(t);if(o){n.push(new ae({start:a,expression:l,end:l.end}))}else{n.push(new at({start:u,key:l.name,value:l,end:l.end}))}}else if(is("punc","}")){continue}else{var c=r.token;var f=as_property_name();if(f===null){unexpected(prev())}else if(prev().type==="name"&&!is("punc",":")){n.push(new at({start:prev(),key:f,value:new t({start:prev(),name:f,end:prev()}),end:prev()}))}else{expect(":");n.push(new at({start:c,quote:c.quote,key:f,value:binding_element(e,t),end:prev()}))}}if(o){if(!is("punc","}")){croak("Rest element must be last element")}}else if(is("operator","=")){e.mark_default_assignment(r.token);next();n[n.length-1].value=new nt({start:n[n.length-1].value.start,left:n[n.length-1].value,operator:"=",right:expression(false),end:r.token})}}expect("}");e.check_strict();return new _e({start:s,names:n,is_array:false,end:prev()})}else if(is("name")){e.add_parameter(r.token);return as_symbol(t)}else{croak("Invalid function parameter")}}function params_or_seq_(e,t){var n;var i;var o;var a=[];expect("(");while(!is("punc",")")){if(n)unexpected(n);if(is("expand","...")){n=r.token;if(t)i=r.token;next();a.push(new ae({start:prev(),expression:expression(),end:r.token}))}else{a.push(expression())}if(!is("punc",")")){expect(",");if(is("punc",")")){o=prev();if(t)i=o}}}expect(")");if(e&&is("arrow","=>")){if(n&&o)unexpected(o)}else if(i){unexpected(i)}return a}function _function_body(e,t,n,i,o){var a=r.in_loop;var s=r.labels;var u=r.in_generator;var l=r.in_async;++r.in_function;if(t)r.in_generator=r.in_function;if(n)r.in_async=r.in_function;if(o)parameters(o);if(e)r.in_directives=true;r.in_loop=0;r.labels=[];if(e){r.input.push_directives_stack();var c=block_();if(i)_verify_symbol(i);if(o)o.forEach(_verify_symbol);r.input.pop_directives_stack()}else{var c=[new ge({start:r.token,value:expression(false),end:r.token})]}--r.in_function;r.in_loop=a;r.labels=s;r.in_generator=u;r.in_async=l;return c}function _await_expression(){if(!can_await()){croak("Unexpected await expression outside async function",r.prev.line,r.prev.col,r.prev.pos)}return new ye({start:prev(),end:r.token,expression:maybe_unary(true)})}function _yield_expression(){if(!is_in_generator()){croak("Unexpected yield expression outside generator function",r.prev.line,r.prev.col,r.prev.pos)}var e=r.token;var t=false;var n=true;if(can_insert_semicolon()||is("punc")&&T.has(r.token.value)){n=false}else if(is("operator","*")){t=true;next()}return new Ae({start:e,is_star:t,expression:n?expression():null,end:prev()})}function if_(){var e=parenthesised(),t=i(false,false,true),n=null;if(is("keyword","else")){next();n=i(false,false,true)}return new Te({condition:e,body:t,alternative:n})}function block_(){expect("{");var e=[];while(!is("punc","}")){if(is("eof"))unexpected();e.push(i())}next();return e}function switch_body_(){expect("{");var e=[],t=null,n=null,o;while(!is("punc","}")){if(is("eof"))unexpected();if(is("keyword","case")){if(n)n.end=prev();t=[];n=new Fe({start:(o=r.token,next(),o),expression:expression(true),body:t});e.push(n);expect(":")}else if(is("keyword","default")){if(n)n.end=prev();t=[];n=new Re({start:(o=r.token,next(),expect(":"),o),body:t});e.push(n)}else{if(!t)unexpected();t.push(i())}}if(n)n.end=prev();next();return e}function try_(){var e=block_(),t=null,n=null;if(is("keyword","catch")){var i=r.token;next();if(is("punc","{")){var o=null}else{expect("(");var o=parameter(undefined,xt);expect(")")}t=new Me({start:i,argname:o,body:block_(),end:prev()})}if(is("keyword","finally")){var i=r.token;next();n=new xe({start:i,body:block_(),end:prev()})}if(!t&&!n)croak("Missing catch/finally blocks");return new Oe({body:e,bcatch:t,bfinally:n})}function vardefs(e,t){var n=[];var i;for(;;){var o=t==="var"?bt:t==="const"?yt:t==="let"?At:null;if(is("punc","{")||is("punc","[")){i=new Be({start:r.token,name:binding_element(undefined,o),value:is("operator","=")?(expect_token("operator","="),expression(false,e)):null,end:prev()})}else{i=new Be({start:r.token,name:as_symbol(o),value:is("operator","=")?(next(),expression(false,e)):!e&&t==="const"?croak("Missing initializer in const declaration"):null,end:prev()});if(i.name.name=="import")croak("Unexpected token: import")}n.push(i);if(!is("punc",","))break;next()}return n}var var_=function(e){return new we({start:prev(),definitions:vardefs(e,"var"),end:prev()})};var let_=function(e){return new Ie({start:prev(),definitions:vardefs(e,"let"),end:prev()})};var const_=function(e){return new Pe({start:prev(),definitions:vardefs(e,"const"),end:prev()})};var new_=function(e){var t=r.token;expect_token("operator","new");if(is("punc",".")){next();expect_token("name","target");return subscripts(new vt({start:t,end:prev()}),e)}var n=expr_atom(false),i;if(is("punc","(")){next();i=expr_list(")",true)}else{i=[]}var o=new Ge({start:t,expression:n,args:i,end:prev()});annotate(o);return subscripts(o,e)};function as_atom_node(){var e=r.token,t;switch(e.type){case"name":t=_make_symbol(Pt);break;case"num":t=new Ht({start:e,end:e,value:e.value,raw:s});break;case"big_int":t=new Xt({start:e,end:e,value:e.value});break;case"string":t=new Gt({start:e,end:e,value:e.value,quote:e.quote});break;case"regexp":const[n,r,i]=e.value.match(/^\/(.*)\/(\w*)$/);t=new Wt({start:e,end:e,value:{source:r,flags:i}});break;case"atom":switch(e.value){case"false":t=new en({start:e,end:e});break;case"true":t=new tn({start:e,end:e});break;case"null":t=new Yt({start:e,end:e});break}break}next();return t}function to_fun_args(e,t){var insert_default=function(e,t){if(t){return new nt({start:e.start,left:e,operator:"=",right:t,end:t.end})}return e};if(e instanceof it){return insert_default(new _e({start:e.start,end:e.end,is_array:false,names:e.properties.map((e=>to_fun_args(e)))}),t)}else if(e instanceof at){e.value=to_fun_args(e.value);return insert_default(e,t)}else if(e instanceof Zt){return e}else if(e instanceof _e){e.names=e.names.map((e=>to_fun_args(e)));return insert_default(e,t)}else if(e instanceof Pt){return insert_default(new Tt({name:e.name,start:e.start,end:e.end}),t)}else if(e instanceof ae){e.expression=to_fun_args(e.expression);return insert_default(e,t)}else if(e instanceof rt){return insert_default(new _e({start:e.start,end:e.end,is_array:true,names:e.elements.map((e=>to_fun_args(e)))}),t)}else if(e instanceof tt){return insert_default(to_fun_args(e.left,e.right),t)}else if(e instanceof nt){e.left=to_fun_args(e.left);return e}else{croak("Invalid function parameter",e.start.line,e.start.col)}}var expr_atom=function(e,t){if(is("operator","new")){return new_(e)}if(is("operator","import")){return import_meta()}var i=r.token;var a;var s=is("name","async")&&(a=peek()).value!="["&&a.type!="arrow"&&as_atom_node();if(is("punc")){switch(r.token.value){case"(":if(s&&!e)break;var u=params_or_seq_(t,!s);if(t&&is("arrow","=>")){return arrow_function(i,u.map((e=>to_fun_args(e))),!!s)}var c=s?new Ke({expression:s,args:u}):u.length==1?u[0]:new He({expressions:u});if(c.start){const e=i.comments_before.length;n.set(i,e);c.start.comments_before.unshift(...i.comments_before);i.comments_before=c.start.comments_before;if(e==0&&i.comments_before.length>0){var f=i.comments_before[0];if(!f.nlb){f.nlb=i.nlb;i.nlb=false}}i.comments_after=c.start.comments_after}c.start=i;var _=prev();if(c.end){_.comments_before=c.end.comments_before;c.end.comments_after.push(..._.comments_after);_.comments_after=c.end.comments_after}c.end=_;if(c instanceof Ke)annotate(c);return subscripts(c,e);case"[":return subscripts(o(),e);case"{":return subscripts(l(),e)}if(!s)unexpected()}if(t&&is("name")&&is_token(peek(),"arrow")){var p=new Tt({name:r.token.value,start:i,end:i});next();return arrow_function(i,[p],!!s)}if(is("keyword","function")){next();var d=function_(le,false,!!s);d.start=i;d.end=prev();return subscripts(d,e)}if(s)return subscripts(s,e);if(is("keyword","class")){next();var m=class_(Et);m.start=i;m.end=prev();return subscripts(m,e)}if(is("template_head")){return subscripts(template_string(),e)}if(P.has(r.token.type)){return subscripts(as_atom_node(),e)}unexpected()};function template_string(){var e=[],t=r.token;e.push(new me({start:r.token,raw:s,value:r.token.value,end:r.token}));while(!u){next();handle_regexp();e.push(expression(true));e.push(new me({start:r.token,raw:s,value:r.token.value,end:r.token}))}next();return new de({start:t,segments:e,end:r.token})}function expr_list(e,t,n){var i=true,o=[];while(!is("punc",e)){if(i)i=false;else expect(",");if(t&&is("punc",e))break;if(is("punc",",")&&n){o.push(new Zt({start:r.token,end:r.token}))}else if(is("expand","...")){next();o.push(new ae({start:prev(),expression:expression(),end:r.token}))}else{o.push(expression(false))}}next();return o}var o=embed_tokens((function(){expect("[");return new rt({elements:expr_list("]",!t.strict,true)})}));var a=embed_tokens(((e,t)=>function_(ue,e,t)));var l=embed_tokens((function object_or_destructuring_(){var e=r.token,n=true,i=[];expect("{");while(!is("punc","}")){if(n)n=false;else expect(",");if(!t.strict&&is("punc","}"))break;e=r.token;if(e.type=="expand"){next();i.push(new ae({start:e,expression:expression(false),end:prev()}));continue}var o=as_property_name();var a;if(!is("punc",":")){var s=concise_method_or_getset(o,e);if(s){i.push(s);continue}a=new Pt({start:prev(),name:o,end:prev()})}else if(o===null){unexpected(prev())}else{next();a=expression(false)}if(is("operator","=")){next();a=new tt({start:e,left:a,operator:"=",right:expression(false),logical:false,end:prev()})}i.push(new at({start:e,quote:e.quote,key:o instanceof U?o:""+o,value:a,end:prev()}))}next();return new it({properties:i})}));function class_(e,t){var n,i,o,a,s=[];r.input.push_directives_stack();r.input.add_directive("use strict");if(r.token.type=="name"&&r.token.value!="extends"){o=as_symbol(e===ht?Ot:Mt)}if(e===ht&&!o){if(t){e=Et}else{unexpected()}}if(r.token.value=="extends"){next();a=expression(true)}expect("{");while(is("punc",";")){next()}while(!is("punc","}")){n=r.token;i=concise_method_or_getset(as_property_name(),n,true);if(!i){unexpected()}s.push(i);while(is("punc",";")){next()}}r.input.pop_directives_stack();next();return new e({start:n,name:o,extends:a,properties:s,end:prev()})}function concise_method_or_getset(e,t,n){const get_symbol_ast=(e,n=Ct)=>{if(typeof e==="string"||typeof e==="number"){return new n({start:t,name:""+e,end:prev()})}else if(e===null){unexpected()}return e};const is_not_method_start=()=>!is("punc","(")&&!is("punc",",")&&!is("punc","}")&&!is("punc",";")&&!is("operator","=");var r=false;var i=false;var o=false;var s=false;var u=null;if(n&&e==="static"&&is_not_method_start()){i=true;e=as_property_name()}if(e==="async"&&is_not_method_start()){r=true;e=as_property_name()}if(prev().type==="operator"&&prev().value==="*"){o=true;e=as_property_name()}if((e==="get"||e==="set")&&is_not_method_start()){u=e;e=as_property_name()}if(prev().type==="privatename"){s=true}const l=prev();if(u!=null){if(!s){const n=u==="get"?ct:lt;e=get_symbol_ast(e);return new n({start:t,static:i,key:e,quote:e instanceof Ct?l.quote:undefined,value:a(),end:prev()})}else{const n=u==="get"?ut:st;return new n({start:t,static:i,key:get_symbol_ast(e),value:a(),end:prev()})}}if(is("punc","(")){e=get_symbol_ast(e);const n=s?_t:ft;var c=new n({start:t,static:i,is_generator:o,async:r,key:e,quote:e instanceof Ct?l.quote:undefined,value:a(o,r),end:prev()});return c}if(n){const n=get_symbol_ast(e,Rt);const r=n instanceof Rt?l.quote:undefined;const o=s?mt:dt;if(is("operator","=")){next();return new o({start:t,static:i,quote:r,key:n,value:expression(false),end:prev()})}else if(is("name")||is("privatename")||is("operator","*")||is("punc",";")||is("punc","}")){return new o({start:t,static:i,quote:r,key:n,end:prev()})}}}function maybe_import_assertion(){if(is("name","assert")&&!has_newline_before(r.token)){next();return l()}return null}function import_statement(){var e=prev();var t;var n;if(is("name")){t=as_symbol(Nt)}if(is("punc",",")){next()}n=map_names(true);if(n||t){expect_token("name","from")}var i=r.token;if(i.type!=="string"){unexpected()}next();const o=maybe_import_assertion();return new Ve({start:e,imported_name:t,imported_names:n,module_name:new Gt({start:i,value:i.value,quote:i.quote,end:i}),assert_clause:o,end:r.token})}function import_meta(){var e=r.token;expect_token("operator","import");expect_token("punc",".");expect_token("name","meta");return subscripts(new Ue({start:e,end:prev()}),false)}function map_name(e){function make_symbol(e){return new e({name:as_property_name(),start:prev(),end:prev()})}var t=e?wt:Lt;var n=e?Nt:Bt;var i=r.token;var o;var a;if(e){o=make_symbol(t)}else{a=make_symbol(n)}if(is("name","as")){next();if(e){a=make_symbol(n)}else{o=make_symbol(t)}}else if(e){a=new n(o)}else{o=new t(a)}return new Le({start:i,foreign_name:o,name:a,end:prev()})}function map_nameAsterisk(e,t){var n=e?wt:Lt;var i=e?Nt:Bt;var o=r.token;var a;var s=prev();t=t||new i({name:"*",start:o,end:s});a=new n({name:"*",start:o,end:s});return new Le({start:o,foreign_name:a,name:t,end:s})}function map_names(e){var t;if(is("punc","{")){next();t=[];while(!is("punc","}")){t.push(map_name(e));if(is("punc",",")){next()}}next()}else if(is("operator","*")){var n;next();if(e&&is("name","as")){next();n=as_symbol(e?Nt:Lt)}t=[map_nameAsterisk(e,n)]}return t}function export_statement(){var e=r.token;var t;var n;if(is("keyword","default")){t=true;next()}else if(n=map_names(false)){if(is("name","from")){next();var o=r.token;if(o.type!=="string"){unexpected()}next();const i=maybe_import_assertion();return new ze({start:e,is_default:t,exported_names:n,module_name:new Gt({start:o,value:o.value,quote:o.quote,end:o}),end:prev(),assert_clause:i})}else{return new ze({start:e,is_default:t,exported_names:n,end:prev()})}}var a;var s;var u;if(is("punc","{")||t&&(is("keyword","class")||is("keyword","function"))&&is_token(peek(),"punc")){s=expression(false);semicolon()}else if((a=i(t))instanceof Ne&&t){unexpected(a.start)}else if(a instanceof Ne||a instanceof fe||a instanceof ht){u=a}else if(a instanceof Et||a instanceof le){s=a}else if(a instanceof H){s=a.body}else{unexpected(a.start)}return new ze({start:e,is_default:t,exported_value:s,exported_definition:u,end:prev(),assert_clause:null})}function as_property_name(){var e=r.token;switch(e.type){case"punc":if(e.value==="["){next();var t=expression(false);expect("]");return t}else unexpected(e);case"operator":if(e.value==="*"){next();return null}if(!["delete","in","instanceof","new","typeof","void"].includes(e.value)){unexpected(e)}case"name":case"privatename":case"string":case"num":case"big_int":case"keyword":case"atom":next();return e.value;default:unexpected(e)}}function as_name(){var e=r.token;if(e.type!="name"&&e.type!="privatename")unexpected();next();return e.value}function _make_symbol(e){var t=r.token.value;return new(t=="this"?Ut:t=="super"?zt:e)({name:String(t),start:r.token,end:r.token})}function _verify_symbol(e){var t=e.name;if(is_in_generator()&&t=="yield"){token_error(e.start,"Yield cannot be used as identifier inside generators")}if(r.input.has_directive("use strict")){if(t=="yield"){token_error(e.start,"Unexpected yield identifier inside strict mode")}if(e instanceof Dt&&(t=="arguments"||t=="eval")){token_error(e.start,"Unexpected "+t+" in strict mode")}}}function as_symbol(e,t){if(!is("name")){if(!t)croak("Name expected");return null}var n=_make_symbol(e);_verify_symbol(n);next();return n}function annotate(e){var t=e.start;var r=t.comments_before;const i=n.get(t);var o=i!=null?i:r.length;while(--o>=0){var a=r[o];if(/[@#]__/.test(a.value)){if(/[@#]__PURE__/.test(a.value)){set_annotation(e,rn);break}if(/[@#]__INLINE__/.test(a.value)){set_annotation(e,on);break}if(/[@#]__NOINLINE__/.test(a.value)){set_annotation(e,an);break}}}}var subscripts=function(e,t,n){var r=e.start;if(is("punc",".")){next();const i=is("privatename")?qe:We;return subscripts(new i({start:r,expression:e,optional:false,property:as_name(),end:prev()}),t,n)}if(is("punc","[")){next();var i=expression(true);expect("]");return subscripts(new Ye({start:r,expression:e,optional:false,property:i,end:prev()}),t,n)}if(t&&is("punc","(")){next();var o=new Ke({start:r,expression:e,optional:false,args:call_args(),end:prev()});annotate(o);return subscripts(o,true,n)}if(is("punc","?.")){next();let n;if(t&&is("punc","(")){next();const t=new Ke({start:r,optional:true,expression:e,args:call_args(),end:prev()});annotate(t);n=subscripts(t,true,true)}else if(is("name")||is("privatename")){const i=is("privatename")?qe:We;n=subscripts(new i({start:r,expression:e,optional:true,property:as_name(),end:prev()}),t,true)}else if(is("punc","[")){next();const i=expression(true);expect("]");n=subscripts(new Ye({start:r,expression:e,optional:true,property:i,end:prev()}),t,true)}if(!n)unexpected();if(n instanceof je)return n;return new je({start:r,expression:n,end:prev()})}if(is("template_head")){if(n){unexpected()}return subscripts(new pe({start:r,prefix:e,template_string:template_string(),end:prev()}),t)}return e};function call_args(){var e=[];while(!is("punc",")")){if(is("expand","...")){next();e.push(new ae({start:prev(),expression:expression(false),end:prev()}))}else{e.push(expression(false))}if(!is("punc",")")){expect(",")}}next();return e}var maybe_unary=function(e,t){var n=r.token;if(n.type=="name"&&n.value=="await"&&can_await()){next();return _await_expression()}if(is("operator")&&M.has(n.value)){next();handle_regexp();var i=make_unary(Ze,n,maybe_unary(e));i.start=n;i.end=prev();return i}var o=expr_atom(e,t);while(is("operator")&&x.has(r.token.value)&&!has_newline_before(r.token)){if(o instanceof ce)unexpected();o=make_unary(Qe,r.token,o);o.start=n;o.end=r.token;next()}return o};function make_unary(e,t,n){var i=t.value;switch(i){case"++":case"--":if(!is_assignable(n))croak("Invalid use of "+i+" operator",t.line,t.col,t.pos);break;case"delete":if(n instanceof Pt&&r.input.has_directive("use strict"))croak("Calling delete on expression not allowed in strict mode",n.start.line,n.start.col,n.start.pos);break}return new e({operator:i,expression:n})}var expr_op=function(e,t,n){var i=is("operator")?r.token.value:null;if(i=="in"&&n)i=null;if(i=="**"&&e instanceof Ze&&!is_token(e.start,"punc","(")&&e.operator!=="--"&&e.operator!=="++")unexpected(e.start);var o=i!=null?I[i]:null;if(o!=null&&(o>t||i==="**"&&t===o)){next();var a=expr_op(maybe_unary(true),o,n);return expr_op(new Je({start:e.start,left:e,operator:i,right:a,end:a.end}),t,n)}return e};function expr_ops(e){return expr_op(maybe_unary(true,true),0,e)}var maybe_conditional=function(e){var t=r.token;var n=expr_ops(e);if(is("operator","?")){next();var i=expression(false);expect(":");return new et({start:t,condition:n,consequent:i,alternative:expression(false,e),end:prev()})}return n};function is_assignable(e){return e instanceof Xe||e instanceof Pt}function to_destructuring(e){if(e instanceof it){e=new _e({start:e.start,names:e.properties.map(to_destructuring),is_array:false,end:e.end})}else if(e instanceof rt){var t=[];for(var n=0;n=0;){o+="this."+t[a]+" = props."+t[a]+";"}const s=r&&Object.create(r.prototype);if(s&&s.initialize||n&&n.initialize)o+="this.initialize();";o+="}";o+="this.flags = 0;";o+="}";var u=new Function(o)();if(s){u.prototype=s;u.BASE=r}if(r)r.SUBCLASSES.push(u);u.prototype.CTOR=u;u.prototype.constructor=u;u.PROPS=t||null;u.SELF_PROPS=i;u.SUBCLASSES=[];if(e){u.prototype.TYPE=u.TYPE=e}if(n)for(a in n)if(HOP(n,a)){if(a[0]==="$"){u[a.substr(1)]=n[a]}else{u.prototype[a]=n[a]}}u.DEFMETHOD=function(e,t){this.prototype[e]=t};return u}const has_tok_flag=(e,t)=>Boolean(e.flags&t);const set_tok_flag=(e,t,n)=>{if(n){e.flags|=t}else{e.flags&=~t}};const B=1;const L=2;const V=4;class AST_Token{constructor(e,t,n,r,i,o,a,s,u){this.flags=o?1:0;this.type=e;this.value=t;this.line=n;this.col=r;this.pos=i;this.comments_before=a;this.comments_after=s;this.file=u;Object.seal(this)}get nlb(){return has_tok_flag(this,B)}set nlb(e){set_tok_flag(this,B,e)}get quote(){return!has_tok_flag(this,V)?"":has_tok_flag(this,L)?"'":'"'}set quote(e){set_tok_flag(this,L,e==="'");set_tok_flag(this,V,!!e)}}var U=DEFNODE("Node","start end",{_clone:function(e){if(e){var t=this.clone();return t.transform(new TreeTransformer((function(e){if(e!==t){return e.clone(true)}})))}return new this.CTOR(this)},clone:function(e){return this._clone(e)},$documentation:"Base class of all AST nodes",$propdoc:{start:"[AST_Token] The first token of this node",end:"[AST_Token] The last token of this node"},_walk:function(e){return e._visit(this)},walk:function(e){return this._walk(e)},_children_backwards:()=>{}},null);var z=DEFNODE("Statement",null,{$documentation:"Base class of all statements"});var K=DEFNODE("Debugger",null,{$documentation:"Represents a debugger statement"},z);var G=DEFNODE("Directive","value quote",{$documentation:'Represents a directive, like "use strict";',$propdoc:{value:"[string] The value of this directive as a plain string (it's not an AST_String!)",quote:"[string] the original quote character"}},z);var H=DEFNODE("SimpleStatement","body",{$documentation:"A statement consisting of an expression, i.e. a = 1 + 2",$propdoc:{body:"[AST_Node] an expression node (should not be instanceof AST_Statement)"},_walk:function(e){return e._visit(this,(function(){this.body._walk(e)}))},_children_backwards(e){e(this.body)}},z);function walk_body(e,t){const n=e.body;for(var r=0,i=n.length;r SymbolDef for all variables/functions defined in this scope",uses_with:"[boolean/S] tells whether this scope uses the `with` statement",uses_eval:"[boolean/S] tells whether this scope contains a direct call to the global `eval`",parent_scope:"[AST_Scope?/S] link to the parent scope",enclosed:"[SymbolDef*/S] a list of all symbol definitions that are accessed from this scope or any subscopes",cname:"[integer/S] current index for mangling variables (used internally by the mangler)"},get_defun_scope:function(){var e=this;while(e.is_block_scope()){e=e.parent_scope}return e},clone:function(e,t){var n=this._clone(e);if(e&&this.variables&&t&&!this._block_scope){n.figure_out_scope({},{toplevel:t,parent_scope:this.parent_scope})}else{if(this.variables)n.variables=new Map(this.variables);if(this.enclosed)n.enclosed=this.enclosed.slice();if(this._block_scope)n._block_scope=this._block_scope}return n},pinned:function(){return this.uses_eval||this.uses_with}},X);var oe=DEFNODE("Toplevel","globals",{$documentation:"The toplevel scope",$propdoc:{globals:"[Map/S] a map of name -> SymbolDef for all undeclared names"},wrap_commonjs:function(e){var t=this.body;var n="(function(exports){'$ORIG';})(typeof "+e+"=='undefined'?("+e+"={}):"+e+");";n=parse(n);n=n.transform(new TreeTransformer((function(e){if(e instanceof G&&e.value=="$ORIG"){return i.splice(t)}})));return n},wrap_enclose:function(e){if(typeof e!="string")e="";var t=e.indexOf(":");if(t<0)t=e.length;var n=this.body;return parse(["(function(",e.slice(0,t),'){"$ORIG"})(',e.slice(t+1),")"].join("")).transform(new TreeTransformer((function(e){if(e instanceof G&&e.value=="$ORIG"){return i.splice(n)}})))}},ie);var ae=DEFNODE("Expansion","expression",{$documentation:"An expandible argument, such as ...rest, a splat, such as [1,2,...all], or an expansion in a variable declaration, such as var [first, ...rest] = list",$propdoc:{expression:"[AST_Node] the thing to be expanded"},_walk:function(e){return e._visit(this,(function(){this.expression.walk(e)}))},_children_backwards(e){e(this.expression)}});var se=DEFNODE("Lambda","name argnames uses_arguments is_generator async",{$documentation:"Base class for functions",$propdoc:{name:"[AST_SymbolDeclaration?] the name of this function",argnames:"[AST_SymbolFunarg|AST_Destructuring|AST_Expansion|AST_DefaultAssign*] array of function arguments, destructurings, or expanding arguments",uses_arguments:"[boolean/S] tells whether this function accesses the arguments array",is_generator:"[boolean] is this a generator method",async:"[boolean] is this method async"},args_as_names:function(){var e=[];for(var t=0;t b)"},se);var fe=DEFNODE("Defun",null,{$documentation:"A function definition"},se);var _e=DEFNODE("Destructuring","names is_array",{$documentation:"A destructuring of several names. Used in destructuring assignment and with destructuring function argument names",$propdoc:{names:"[AST_Node*] Array of properties or elements",is_array:"[Boolean] Whether the destructuring represents an object or array"},_walk:function(e){return e._visit(this,(function(){this.names.forEach((function(t){t._walk(e)}))}))},_children_backwards(e){let t=this.names.length;while(t--)e(this.names[t])},all_symbols:function(){var e=[];this.walk(new TreeWalker((function(t){if(t instanceof gt){e.push(t)}})));return e}});var pe=DEFNODE("PrefixedTemplateString","template_string prefix",{$documentation:"A templatestring with a prefix, such as String.raw`foobarbaz`",$propdoc:{template_string:"[AST_TemplateString] The template string",prefix:"[AST_Node] The prefix, which will get called."},_walk:function(e){return e._visit(this,(function(){this.prefix._walk(e);this.template_string._walk(e)}))},_children_backwards(e){e(this.template_string);e(this.prefix)}});var de=DEFNODE("TemplateString","segments",{$documentation:"A template string literal",$propdoc:{segments:"[AST_Node*] One or more segments, starting with AST_TemplateSegment. AST_Node may follow AST_TemplateSegment, but each AST_Node must be followed by AST_TemplateSegment."},_walk:function(e){return e._visit(this,(function(){this.segments.forEach((function(t){t._walk(e)}))}))},_children_backwards(e){let t=this.segments.length;while(t--)e(this.segments[t])}});var me=DEFNODE("TemplateSegment","value raw",{$documentation:"A segment of a template string literal",$propdoc:{value:"Content of the segment",raw:"Raw source of the segment"}});var he=DEFNODE("Jump",null,{$documentation:"Base class for “jumps” (for now that's `return`, `throw`, `break` and `continue`)"},z);var Ee=DEFNODE("Exit","value",{$documentation:"Base class for “exits” (`return` and `throw`)",$propdoc:{value:"[AST_Node?] the value returned or thrown by this statement; could be null for AST_Return"},_walk:function(e){return e._visit(this,this.value&&function(){this.value._walk(e)})},_children_backwards(e){if(this.value)e(this.value)}},he);var ge=DEFNODE("Return",null,{$documentation:"A `return` statement"},Ee);var ve=DEFNODE("Throw",null,{$documentation:"A `throw` statement"},Ee);var De=DEFNODE("LoopControl","label",{$documentation:"Base class for loop control statements (`break` and `continue`)",$propdoc:{label:"[AST_LabelRef?] the label, or null if none"},_walk:function(e){return e._visit(this,this.label&&function(){this.label._walk(e)})},_children_backwards(e){if(this.label)e(this.label)}},he);var be=DEFNODE("Break",null,{$documentation:"A `break` statement"},De);var Se=DEFNODE("Continue",null,{$documentation:"A `continue` statement"},De);var ye=DEFNODE("Await","expression",{$documentation:"An `await` statement",$propdoc:{expression:"[AST_Node] the mandatory expression being awaited"},_walk:function(e){return e._visit(this,(function(){this.expression._walk(e)}))},_children_backwards(e){e(this.expression)}});var Ae=DEFNODE("Yield","expression is_star",{$documentation:"A `yield` statement",$propdoc:{expression:"[AST_Node?] the value returned or thrown by this statement; could be null (representing undefined) but only when is_star is set to false",is_star:"[Boolean] Whether this is a yield or yield* statement"},_walk:function(e){return e._visit(this,this.expression&&function(){this.expression._walk(e)})},_children_backwards(e){if(this.expression)e(this.expression)}});var Te=DEFNODE("If","condition alternative",{$documentation:"A `if` statement",$propdoc:{condition:"[AST_Node] the `if` condition",alternative:"[AST_Statement?] the `else` part, or null if not present"},_walk:function(e){return e._visit(this,(function(){this.condition._walk(e);this.body._walk(e);if(this.alternative)this.alternative._walk(e)}))},_children_backwards(e){if(this.alternative){e(this.alternative)}e(this.body);e(this.condition)}},Y);var ke=DEFNODE("Switch","expression",{$documentation:"A `switch` statement",$propdoc:{expression:"[AST_Node] the `switch` “discriminant”"},_walk:function(e){return e._visit(this,(function(){this.expression._walk(e);walk_body(this,e)}))},_children_backwards(e){let t=this.body.length;while(t--)e(this.body[t]);e(this.expression)}},X);var Ce=DEFNODE("SwitchBranch",null,{$documentation:"Base class for `switch` branches"},X);var Re=DEFNODE("Default",null,{$documentation:"A `default` switch branch"},Ce);var Fe=DEFNODE("Case","expression",{$documentation:"A `case` switch branch",$propdoc:{expression:"[AST_Node] the `case` expression"},_walk:function(e){return e._visit(this,(function(){this.expression._walk(e);walk_body(this,e)}))},_children_backwards(e){let t=this.body.length;while(t--)e(this.body[t]);e(this.expression)}},Ce);var Oe=DEFNODE("Try","bcatch bfinally",{$documentation:"A `try` statement",$propdoc:{bcatch:"[AST_Catch?] the catch block, or null if not present",bfinally:"[AST_Finally?] the finally block, or null if not present"},_walk:function(e){return e._visit(this,(function(){walk_body(this,e);if(this.bcatch)this.bcatch._walk(e);if(this.bfinally)this.bfinally._walk(e)}))},_children_backwards(e){if(this.bfinally)e(this.bfinally);if(this.bcatch)e(this.bcatch);let t=this.body.length;while(t--)e(this.body[t])}},X);var Me=DEFNODE("Catch","argname",{$documentation:"A `catch` node; only makes sense as part of a `try` statement",$propdoc:{argname:"[AST_SymbolCatch|AST_Destructuring|AST_Expansion|AST_DefaultAssign] symbol for the exception"},_walk:function(e){return e._visit(this,(function(){if(this.argname)this.argname._walk(e);walk_body(this,e)}))},_children_backwards(e){let t=this.body.length;while(t--)e(this.body[t]);if(this.argname)e(this.argname)}},X);var xe=DEFNODE("Finally",null,{$documentation:"A `finally` node; only makes sense as part of a `try` statement"},X);var Ne=DEFNODE("Definitions","definitions",{$documentation:"Base class for `var` or `const` nodes (variable declarations/initializations)",$propdoc:{definitions:"[AST_VarDef*] array of variable definitions"},_walk:function(e){return e._visit(this,(function(){var t=this.definitions;for(var n=0,r=t.length;n a`"},Je);var rt=DEFNODE("Array","elements",{$documentation:"An array literal",$propdoc:{elements:"[AST_Node*] array of elements"},_walk:function(e){return e._visit(this,(function(){var t=this.elements;for(var n=0,r=t.length;nt._walk(e)))}))},_children_backwards(e){let t=this.properties.length;while(t--)e(this.properties[t]);if(this.extends)e(this.extends);if(this.name)e(this.name)}},ie);var dt=DEFNODE("ClassProperty","static quote",{$documentation:"A class property",$propdoc:{static:"[boolean] whether this is a static key",quote:"[string] which quote is being used"},_walk:function(e){return e._visit(this,(function(){if(this.key instanceof U)this.key._walk(e);if(this.value instanceof U)this.value._walk(e)}))},_children_backwards(e){if(this.value instanceof U)e(this.value);if(this.key instanceof U)e(this.key)},computed_key(){return!(this.key instanceof Rt)}},ot);var mt=DEFNODE("ClassPrivateProperty","",{$documentation:"A class property for a private property"},dt);var ht=DEFNODE("DefClass",null,{$documentation:"A class definition"},pt);var Et=DEFNODE("ClassExpression",null,{$documentation:"A class expression."},pt);var gt=DEFNODE("Symbol","scope name thedef",{$propdoc:{name:"[string] name of this symbol",scope:"[AST_Scope/S] the current scope (not necessarily the definition scope)",thedef:"[SymbolDef/S] the definition of this symbol"},$documentation:"Base class for all symbols"});var vt=DEFNODE("NewTarget",null,{$documentation:"A reference to new.target"});var Dt=DEFNODE("SymbolDeclaration","init",{$documentation:"A declaration symbol (symbol in var/const, function name or argument, symbol in catch)"},gt);var bt=DEFNODE("SymbolVar",null,{$documentation:"Symbol defining a variable"},Dt);var St=DEFNODE("SymbolBlockDeclaration",null,{$documentation:"Base class for block-scoped declaration symbols"},Dt);var yt=DEFNODE("SymbolConst",null,{$documentation:"A constant declaration"},St);var At=DEFNODE("SymbolLet",null,{$documentation:"A block-scoped `let` declaration"},St);var Tt=DEFNODE("SymbolFunarg",null,{$documentation:"Symbol naming a function argument"},bt);var kt=DEFNODE("SymbolDefun",null,{$documentation:"Symbol defining a function"},Dt);var Ct=DEFNODE("SymbolMethod",null,{$documentation:"Symbol in an object defining a method"},gt);var Rt=DEFNODE("SymbolClassProperty",null,{$documentation:"Symbol for a class property"},gt);var Ft=DEFNODE("SymbolLambda",null,{$documentation:"Symbol naming a function expression"},Dt);var Ot=DEFNODE("SymbolDefClass",null,{$documentation:"Symbol naming a class's name in a class declaration. Lexically scoped to its containing scope, and accessible within the class."},St);var Mt=DEFNODE("SymbolClass",null,{$documentation:"Symbol naming a class's name. Lexically scoped to the class."},Dt);var xt=DEFNODE("SymbolCatch",null,{$documentation:"Symbol naming the exception in catch"},St);var Nt=DEFNODE("SymbolImport",null,{$documentation:"Symbol referring to an imported name"},St);var wt=DEFNODE("SymbolImportForeign",null,{$documentation:"A symbol imported from a module, but it is defined in the other module, and its real name is irrelevant for this module's purposes"},gt);var It=DEFNODE("Label","references",{$documentation:"Symbol naming a label (declaration)",$propdoc:{references:"[AST_LoopControl*] a list of nodes referring to this label"},initialize:function(){this.references=[];this.thedef=this}},gt);var Pt=DEFNODE("SymbolRef",null,{$documentation:"Reference to some symbol (not definition/declaration)"},gt);var Bt=DEFNODE("SymbolExport",null,{$documentation:"Symbol referring to a name to export"},Pt);var Lt=DEFNODE("SymbolExportForeign",null,{$documentation:"A symbol exported from this module, but it is used in the other module, and its real name is irrelevant for this module's purposes"},gt);var Vt=DEFNODE("LabelRef",null,{$documentation:"Reference to a label symbol"},gt);var Ut=DEFNODE("This",null,{$documentation:"The `this` symbol"},gt);var zt=DEFNODE("Super",null,{$documentation:"The `super` symbol"},Ut);var Kt=DEFNODE("Constant",null,{$documentation:"Base class for all constants",getValue:function(){return this.value}});var Gt=DEFNODE("String","value quote",{$documentation:"A string literal",$propdoc:{value:"[string] the contents of this string",quote:"[string] the original quote character"}},Kt);var Ht=DEFNODE("Number","value raw",{$documentation:"A number literal",$propdoc:{value:"[number] the numeric value",raw:"[string] numeric value as string"}},Kt);var Xt=DEFNODE("BigInt","value",{$documentation:"A big int literal",$propdoc:{value:"[string] big int value"}},Kt);var Wt=DEFNODE("RegExp","value",{$documentation:"A regexp literal",$propdoc:{value:"[RegExp] the actual regexp"}},Kt);var qt=DEFNODE("Atom",null,{$documentation:"Base class for atoms"},Kt);var Yt=DEFNODE("Null",null,{$documentation:"The `null` atom",value:null},qt);var jt=DEFNODE("NaN",null,{$documentation:"The impossible value",value:0/0},qt);var $t=DEFNODE("Undefined",null,{$documentation:"The `undefined` value",value:function(){}()},qt);var Zt=DEFNODE("Hole",null,{$documentation:"A hole in an array",value:function(){}()},qt);var Qt=DEFNODE("Infinity",null,{$documentation:"The `Infinity` value",value:1/0},qt);var Jt=DEFNODE("Boolean",null,{$documentation:"Base class for booleans"},qt);var en=DEFNODE("False",null,{$documentation:"The `false` atom",value:false},Jt);var tn=DEFNODE("True",null,{$documentation:"The `true` atom",value:true},Jt);function walk(e,t,n=[e]){const r=n.push.bind(n);while(n.length){const e=n.pop();const i=t(e,n);if(i){if(i===nn)return true;continue}e._children_backwards(r)}return false}function walk_parent(e,t,n){const r=[e];const i=r.push.bind(r);const o=n?n.slice():[];const a=[];let s;const u={parent:(e=0)=>{if(e===-1){return s}if(n&&e>=o.length){e-=o.length;return n[n.length-(e+1)]}return o[o.length-(1+e)]}};while(r.length){s=r.pop();while(a.length&&r.length==a[a.length-1]){o.pop();a.pop()}const e=t(s,u);if(e){if(e===nn)return true;continue}const n=r.length;s._children_backwards(i);if(r.length>n){o.push(s);a.push(n-1)}}return false}const nn=Symbol("abort walk");class TreeWalker{constructor(e){this.visit=e;this.stack=[];this.directives=Object.create(null)}_visit(e,t){this.push(e);var n=this.visit(e,t?function(){t.call(e)}:noop);if(!n&&t){t.call(e)}this.pop();return n}parent(e){return this.stack[this.stack.length-2-(e||0)]}push(e){if(e instanceof se){this.directives=Object.create(this.directives)}else if(e instanceof G&&!this.directives[e.value]){this.directives[e.value]=e}else if(e instanceof pt){this.directives=Object.create(this.directives);if(!this.directives["use strict"]){this.directives["use strict"]=e}}this.stack.push(e)}pop(){var e=this.stack.pop();if(e instanceof se||e instanceof pt){this.directives=Object.getPrototypeOf(this.directives)}}self(){return this.stack[this.stack.length-1]}find_parent(e){var t=this.stack;for(var n=t.length;--n>=0;){var r=t[n];if(r instanceof e)return r}}has_directive(e){var t=this.directives[e];if(t)return t;var n=this.stack[this.stack.length-1];if(n instanceof ie&&n.body){for(var r=0;r=0;){var r=t[n];if(r instanceof j&&r.label.name==e.label.name)return r.body}else for(var n=t.length;--n>=0;){var r=t[n];if(r instanceof $||e instanceof be&&r instanceof ke)return r}}}class TreeTransformer extends TreeWalker{constructor(e,t){super();this.before=e;this.after=t}}const rn=1;const on=2;const an=4;var sn=Object.freeze({__proto__:null,AST_Accessor:ue,AST_Array:rt,AST_Arrow:ce,AST_Assign:tt,AST_Atom:qt,AST_Await:ye,AST_BigInt:Xt,AST_Binary:Je,AST_Block:X,AST_BlockStatement:W,AST_Boolean:Jt,AST_Break:be,AST_Call:Ke,AST_Case:Fe,AST_Catch:Me,AST_Chain:je,AST_Class:pt,AST_ClassExpression:Et,AST_ClassPrivateProperty:mt,AST_ClassProperty:dt,AST_ConciseMethod:ft,AST_Conditional:et,AST_Const:Pe,AST_Constant:Kt,AST_Continue:Se,AST_Debugger:K,AST_Default:Re,AST_DefaultAssign:nt,AST_DefClass:ht,AST_Definitions:Ne,AST_Defun:fe,AST_Destructuring:_e,AST_Directive:G,AST_Do:Q,AST_Dot:We,AST_DotHash:qe,AST_DWLoop:Z,AST_EmptyStatement:q,AST_Exit:Ee,AST_Expansion:ae,AST_Export:ze,AST_False:en,AST_Finally:xe,AST_For:ee,AST_ForIn:te,AST_ForOf:ne,AST_Function:le,AST_Hole:Zt,AST_If:Te,AST_Import:Ve,AST_ImportMeta:Ue,AST_Infinity:Qt,AST_IterationStatement:$,AST_Jump:he,AST_Label:It,AST_LabeledStatement:j,AST_LabelRef:Vt,AST_Lambda:se,AST_Let:Ie,AST_LoopControl:De,AST_NameMapping:Le,AST_NaN:jt,AST_New:Ge,AST_NewTarget:vt,AST_Node:U,AST_Null:Yt,AST_Number:Ht,AST_Object:it,AST_ObjectGetter:ct,AST_ObjectKeyVal:at,AST_ObjectProperty:ot,AST_ObjectSetter:lt,AST_PrefixedTemplateString:pe,AST_PrivateGetter:ut,AST_PrivateMethod:_t,AST_PrivateSetter:st,AST_PropAccess:Xe,AST_RegExp:Wt,AST_Return:ge,AST_Scope:ie,AST_Sequence:He,AST_SimpleStatement:H,AST_Statement:z,AST_StatementWithBody:Y,AST_String:Gt,AST_Sub:Ye,AST_Super:zt,AST_Switch:ke,AST_SwitchBranch:Ce,AST_Symbol:gt,AST_SymbolBlockDeclaration:St,AST_SymbolCatch:xt,AST_SymbolClass:Mt,AST_SymbolClassProperty:Rt,AST_SymbolConst:yt,AST_SymbolDeclaration:Dt,AST_SymbolDefClass:Ot,AST_SymbolDefun:kt,AST_SymbolExport:Bt,AST_SymbolExportForeign:Lt,AST_SymbolFunarg:Tt,AST_SymbolImport:Nt,AST_SymbolImportForeign:wt,AST_SymbolLambda:Ft,AST_SymbolLet:At,AST_SymbolMethod:Ct,AST_SymbolRef:Pt,AST_SymbolVar:bt,AST_TemplateSegment:me,AST_TemplateString:de,AST_This:Ut,AST_Throw:ve,AST_Token:AST_Token,AST_Toplevel:oe,AST_True:tn,AST_Try:Oe,AST_Unary:$e,AST_UnaryPostfix:Qe,AST_UnaryPrefix:Ze,AST_Undefined:$t,AST_Var:we,AST_VarDef:Be,AST_While:J,AST_With:re,AST_Yield:Ae,TreeTransformer:TreeTransformer,TreeWalker:TreeWalker,walk:walk,walk_abort:nn,walk_body:walk_body,walk_parent:walk_parent,_INLINE:on,_NOINLINE:an,_PURE:rn});function def_transform(e,t){e.DEFMETHOD("transform",(function(e,n){let r=undefined;e.push(this);if(e.before)r=e.before(this,t,n);if(r===undefined){r=this;t(r,e);if(e.after){const t=e.after(r,n);if(t!==undefined)r=t}}e.pop();return r}))}function do_list(e,t){return i(e,(function(e){return e.transform(t,true)}))}def_transform(U,noop);def_transform(j,(function(e,t){e.label=e.label.transform(t);e.body=e.body.transform(t)}));def_transform(H,(function(e,t){e.body=e.body.transform(t)}));def_transform(X,(function(e,t){e.body=do_list(e.body,t)}));def_transform(Q,(function(e,t){e.body=e.body.transform(t);e.condition=e.condition.transform(t)}));def_transform(J,(function(e,t){e.condition=e.condition.transform(t);e.body=e.body.transform(t)}));def_transform(ee,(function(e,t){if(e.init)e.init=e.init.transform(t);if(e.condition)e.condition=e.condition.transform(t);if(e.step)e.step=e.step.transform(t);e.body=e.body.transform(t)}));def_transform(te,(function(e,t){e.init=e.init.transform(t);e.object=e.object.transform(t);e.body=e.body.transform(t)}));def_transform(re,(function(e,t){e.expression=e.expression.transform(t);e.body=e.body.transform(t)}));def_transform(Ee,(function(e,t){if(e.value)e.value=e.value.transform(t)}));def_transform(De,(function(e,t){if(e.label)e.label=e.label.transform(t)}));def_transform(Te,(function(e,t){e.condition=e.condition.transform(t);e.body=e.body.transform(t);if(e.alternative)e.alternative=e.alternative.transform(t)}));def_transform(ke,(function(e,t){e.expression=e.expression.transform(t);e.body=do_list(e.body,t)}));def_transform(Fe,(function(e,t){e.expression=e.expression.transform(t);e.body=do_list(e.body,t)}));def_transform(Oe,(function(e,t){e.body=do_list(e.body,t);if(e.bcatch)e.bcatch=e.bcatch.transform(t);if(e.bfinally)e.bfinally=e.bfinally.transform(t)}));def_transform(Me,(function(e,t){if(e.argname)e.argname=e.argname.transform(t);e.body=do_list(e.body,t)}));def_transform(Ne,(function(e,t){e.definitions=do_list(e.definitions,t)}));def_transform(Be,(function(e,t){e.name=e.name.transform(t);if(e.value)e.value=e.value.transform(t)}));def_transform(_e,(function(e,t){e.names=do_list(e.names,t)}));def_transform(se,(function(e,t){if(e.name)e.name=e.name.transform(t);e.argnames=do_list(e.argnames,t);if(e.body instanceof U){e.body=e.body.transform(t)}else{e.body=do_list(e.body,t)}}));def_transform(Ke,(function(e,t){e.expression=e.expression.transform(t);e.args=do_list(e.args,t)}));def_transform(He,(function(e,t){const n=do_list(e.expressions,t);e.expressions=n.length?n:[new Ht({value:0})]}));def_transform(Xe,(function(e,t){e.expression=e.expression.transform(t)}));def_transform(Ye,(function(e,t){e.expression=e.expression.transform(t);e.property=e.property.transform(t)}));def_transform(je,(function(e,t){e.expression=e.expression.transform(t)}));def_transform(Ae,(function(e,t){if(e.expression)e.expression=e.expression.transform(t)}));def_transform(ye,(function(e,t){e.expression=e.expression.transform(t)}));def_transform($e,(function(e,t){e.expression=e.expression.transform(t)}));def_transform(Je,(function(e,t){e.left=e.left.transform(t);e.right=e.right.transform(t)}));def_transform(et,(function(e,t){e.condition=e.condition.transform(t);e.consequent=e.consequent.transform(t);e.alternative=e.alternative.transform(t)}));def_transform(rt,(function(e,t){e.elements=do_list(e.elements,t)}));def_transform(it,(function(e,t){e.properties=do_list(e.properties,t)}));def_transform(ot,(function(e,t){if(e.key instanceof U){e.key=e.key.transform(t)}if(e.value)e.value=e.value.transform(t)}));def_transform(pt,(function(e,t){if(e.name)e.name=e.name.transform(t);if(e.extends)e.extends=e.extends.transform(t);e.properties=do_list(e.properties,t)}));def_transform(ae,(function(e,t){e.expression=e.expression.transform(t)}));def_transform(Le,(function(e,t){e.foreign_name=e.foreign_name.transform(t);e.name=e.name.transform(t)}));def_transform(Ve,(function(e,t){if(e.imported_name)e.imported_name=e.imported_name.transform(t);if(e.imported_names)do_list(e.imported_names,t);e.module_name=e.module_name.transform(t)}));def_transform(ze,(function(e,t){if(e.exported_definition)e.exported_definition=e.exported_definition.transform(t);if(e.exported_value)e.exported_value=e.exported_value.transform(t);if(e.exported_names)do_list(e.exported_names,t);if(e.module_name)e.module_name=e.module_name.transform(t)}));def_transform(de,(function(e,t){e.segments=do_list(e.segments,t)}));def_transform(pe,(function(e,t){e.prefix=e.prefix.transform(t);e.template_string=e.template_string.transform(t)}));(function(){var normalize_directives=function(e){var t=true;for(var n=0;n{if(e&&e.length>0){return new it({start:my_start_token(e),end:my_end_token(e),properties:e.map((e=>new at({start:my_start_token(e),end:my_end_token(e),key:e.key.name||e.key.value,value:from_moz(e.value)})))})}return null};var e={Program:function(e){return new oe({start:my_start_token(e),end:my_end_token(e),body:normalize_directives(e.body.map(from_moz))})},ArrayPattern:function(e){return new _e({start:my_start_token(e),end:my_end_token(e),names:e.elements.map((function(e){if(e===null){return new Zt}return from_moz(e)})),is_array:true})},ObjectPattern:function(e){return new _e({start:my_start_token(e),end:my_end_token(e),names:e.properties.map(from_moz),is_array:false})},AssignmentPattern:function(e){return new nt({start:my_start_token(e),end:my_end_token(e),left:from_moz(e.left),operator:"=",right:from_moz(e.right)})},SpreadElement:function(e){return new ae({start:my_start_token(e),end:my_end_token(e),expression:from_moz(e.argument)})},RestElement:function(e){return new ae({start:my_start_token(e),end:my_end_token(e),expression:from_moz(e.argument)})},TemplateElement:function(e){return new me({start:my_start_token(e),end:my_end_token(e),value:e.value.cooked,raw:e.value.raw})},TemplateLiteral:function(e){var t=[];for(var n=0;n1||e.guardedHandlers&&e.guardedHandlers.length){throw new Error("Multiple catch clauses are not supported.")}return new Oe({start:my_start_token(e),end:my_end_token(e),body:from_moz(e.block).body,bcatch:from_moz(t[0]),bfinally:e.finalizer?new xe(from_moz(e.finalizer)):null})},Property:function(e){var t=e.key;var n={start:my_start_token(t||e.value),end:my_end_token(e.value),key:t.type=="Identifier"?t.name:t.value,value:from_moz(e.value)};if(e.computed){n.key=from_moz(e.key)}if(e.method){n.is_generator=e.value.generator;n.async=e.value.async;if(!e.computed){n.key=new Ct({name:n.key})}else{n.key=from_moz(e.key)}return new ft(n)}if(e.kind=="init"){if(t.type!="Identifier"&&t.type!="Literal"){n.key=from_moz(t)}return new at(n)}if(typeof n.key==="string"||typeof n.key==="number"){n.key=new Ct({name:n.key})}n.value=new ue(n.value);if(e.kind=="get")return new ct(n);if(e.kind=="set")return new lt(n);if(e.kind=="method"){n.async=e.value.async;n.is_generator=e.value.generator;n.quote=e.computed?'"':null;return new ft(n)}},MethodDefinition:function(e){var t={start:my_start_token(e),end:my_end_token(e),key:e.computed?from_moz(e.key):new Ct({name:e.key.name||e.key.value}),value:from_moz(e.value),static:e.static};if(e.kind=="get"){return new ct(t)}if(e.kind=="set"){return new lt(t)}t.is_generator=e.value.generator;t.async=e.value.async;return new ft(t)},FieldDefinition:function(e){let t;if(e.computed){t=from_moz(e.key)}else{if(e.key.type!=="Identifier")throw new Error("Non-Identifier key in FieldDefinition");t=from_moz(e.key)}return new dt({start:my_start_token(e),end:my_end_token(e),key:t,value:from_moz(e.value),static:e.static})},PropertyDefinition:function(e){let t;if(e.computed){t=from_moz(e.key)}else{if(e.key.type!=="Identifier")throw new Error("Non-Identifier key in PropertyDefinition");t=from_moz(e.key)}return new dt({start:my_start_token(e),end:my_end_token(e),key:t,value:from_moz(e.value),static:e.static})},ArrayExpression:function(e){return new rt({start:my_start_token(e),end:my_end_token(e),elements:e.elements.map((function(e){return e===null?new Zt:from_moz(e)}))})},ObjectExpression:function(e){return new it({start:my_start_token(e),end:my_end_token(e),properties:e.properties.map((function(e){if(e.type==="SpreadElement"){return from_moz(e)}e.type="Property";return from_moz(e)}))})},SequenceExpression:function(e){return new He({start:my_start_token(e),end:my_end_token(e),expressions:e.expressions.map(from_moz)})},MemberExpression:function(e){return new(e.computed?Ye:We)({start:my_start_token(e),end:my_end_token(e),property:e.computed?from_moz(e.property):e.property.name,expression:from_moz(e.object),optional:e.optional||false})},ChainExpression:function(e){return new je({start:my_start_token(e),end:my_end_token(e),expression:from_moz(e.expression)})},SwitchCase:function(e){return new(e.test?Fe:Re)({start:my_start_token(e),end:my_end_token(e),expression:from_moz(e.test),body:e.consequent.map(from_moz)})},VariableDeclaration:function(e){return new(e.kind==="const"?Pe:e.kind==="let"?Ie:we)({start:my_start_token(e),end:my_end_token(e),definitions:e.declarations.map(from_moz)})},ImportDeclaration:function(e){var t=null;var n=null;e.specifiers.forEach((function(e){if(e.type==="ImportSpecifier"){if(!n){n=[]}n.push(new Le({start:my_start_token(e),end:my_end_token(e),foreign_name:from_moz(e.imported),name:from_moz(e.local)}))}else if(e.type==="ImportDefaultSpecifier"){t=from_moz(e.local)}else if(e.type==="ImportNamespaceSpecifier"){if(!n){n=[]}n.push(new Le({start:my_start_token(e),end:my_end_token(e),foreign_name:new wt({name:"*"}),name:from_moz(e.local)}))}}));return new Ve({start:my_start_token(e),end:my_end_token(e),imported_name:t,imported_names:n,module_name:from_moz(e.source),assert_clause:assert_clause_from_moz(e.assertions)})},ExportAllDeclaration:function(e){return new ze({start:my_start_token(e),end:my_end_token(e),exported_names:[new Le({name:new Lt({name:"*"}),foreign_name:new Lt({name:"*"})})],module_name:from_moz(e.source),assert_clause:assert_clause_from_moz(e.assertions)})},ExportNamedDeclaration:function(e){return new ze({start:my_start_token(e),end:my_end_token(e),exported_definition:from_moz(e.declaration),exported_names:e.specifiers&&e.specifiers.length?e.specifiers.map((function(e){return new Le({foreign_name:from_moz(e.exported),name:from_moz(e.local)})})):null,module_name:from_moz(e.source),assert_clause:assert_clause_from_moz(e.assertions)})},ExportDefaultDeclaration:function(e){return new ze({start:my_start_token(e),end:my_end_token(e),exported_value:from_moz(e.declaration),is_default:true})},Literal:function(e){var t=e.value,n={start:my_start_token(e),end:my_end_token(e)};var r=e.regex;if(r&&r.pattern){n.value={source:r.pattern,flags:r.flags};return new Wt(n)}else if(r){const r=e.raw||t;const i=r.match(/^\/(.*)\/(\w*)$/);if(!i)throw new Error("Invalid regex source "+r);const[o,a,s]=i;n.value={source:a,flags:s};return new Wt(n)}if(t===null)return new Yt(n);switch(typeof t){case"string":n.value=t;return new Gt(n);case"number":n.value=t;n.raw=e.raw||t.toString();return new Ht(n);case"boolean":return new(t?tn:en)(n)}},MetaProperty:function(e){if(e.meta.name==="new"&&e.property.name==="target"){return new vt({start:my_start_token(e),end:my_end_token(e)})}else if(e.meta.name==="import"&&e.property.name==="meta"){return new Ue({start:my_start_token(e),end:my_end_token(e)})}},Identifier:function(e){var n=t[t.length-2];return new(n.type=="LabeledStatement"?It:n.type=="VariableDeclarator"&&n.id===e?n.kind=="const"?yt:n.kind=="let"?At:bt:/Import.*Specifier/.test(n.type)?n.local===e?Nt:wt:n.type=="ExportSpecifier"?n.local===e?Bt:Lt:n.type=="FunctionExpression"?n.id===e?Ft:Tt:n.type=="FunctionDeclaration"?n.id===e?kt:Tt:n.type=="ArrowFunctionExpression"?n.params.includes(e)?Tt:Pt:n.type=="ClassExpression"?n.id===e?Mt:Pt:n.type=="Property"?n.key===e&&n.computed||n.value===e?Pt:Ct:n.type=="PropertyDefinition"||n.type==="FieldDefinition"?n.key===e&&n.computed||n.value===e?Pt:Rt:n.type=="ClassDeclaration"?n.id===e?Ot:Pt:n.type=="MethodDefinition"?n.computed?Pt:Ct:n.type=="CatchClause"?xt:n.type=="BreakStatement"||n.type=="ContinueStatement"?Vt:Pt)({start:my_start_token(e),end:my_end_token(e),name:e.name})},BigIntLiteral(e){return new Xt({start:my_start_token(e),end:my_end_token(e),value:e.value})}};e.UpdateExpression=e.UnaryExpression=function To_Moz_Unary(e){var t="prefix"in e?e.prefix:e.type=="UnaryExpression"?true:false;return new(t?Ze:Qe)({start:my_start_token(e),end:my_end_token(e),operator:e.operator,expression:from_moz(e.argument)})};e.ClassDeclaration=e.ClassExpression=function From_Moz_Class(e){return new(e.type==="ClassDeclaration"?ht:Et)({start:my_start_token(e),end:my_end_token(e),name:from_moz(e.id),extends:from_moz(e.superClass),properties:e.body.body.map(from_moz)})};map("EmptyStatement",q);map("BlockStatement",W,"body@body");map("IfStatement",Te,"test>condition, consequent>body, alternate>alternative");map("LabeledStatement",j,"label>label, body>body");map("BreakStatement",be,"label>label");map("ContinueStatement",Se,"label>label");map("WithStatement",re,"object>expression, body>body");map("SwitchStatement",ke,"discriminant>expression, cases@body");map("ReturnStatement",ge,"argument>value");map("ThrowStatement",ve,"argument>value");map("WhileStatement",J,"test>condition, body>body");map("DoWhileStatement",Q,"test>condition, body>body");map("ForStatement",ee,"init>init, test>condition, update>step, body>body");map("ForInStatement",te,"left>init, right>object, body>body");map("ForOfStatement",ne,"left>init, right>object, body>body, await=await");map("AwaitExpression",ye,"argument>expression");map("YieldExpression",Ae,"argument>expression, delegate=is_star");map("DebuggerStatement",K);map("VariableDeclarator",Be,"id>name, init>value");map("CatchClause",Me,"param>argname, body%body");map("ThisExpression",Ut);map("Super",zt);map("BinaryExpression",Je,"operator=operator, left>left, right>right");map("LogicalExpression",Je,"operator=operator, left>left, right>right");map("AssignmentExpression",tt,"operator=operator, left>left, right>right");map("ConditionalExpression",et,"test>condition, consequent>consequent, alternate>alternative");map("NewExpression",Ge,"callee>expression, arguments@args");map("CallExpression",Ke,"callee>expression, optional=optional, arguments@args");def_to_moz(oe,(function To_Moz_Program(e){return to_moz_scope("Program",e)}));def_to_moz(ae,(function To_Moz_Spread(e){return{type:to_moz_in_destructuring()?"RestElement":"SpreadElement",argument:to_moz(e.expression)}}));def_to_moz(pe,(function To_Moz_TaggedTemplateExpression(e){return{type:"TaggedTemplateExpression",tag:to_moz(e.prefix),quasi:to_moz(e.template_string)}}));def_to_moz(de,(function To_Moz_TemplateLiteral(e){var t=[];var n=[];for(var r=0;r{const t=[];if(e){for(const{key:n,value:r}of e.properties){const e=is_basic_identifier_string(n)?{type:"Identifier",name:n}:{type:"Literal",value:n,raw:JSON.stringify(n)};t.push({type:"ImportAttribute",key:e,value:to_moz(r)})}}return t};def_to_moz(ze,(function To_Moz_ExportDeclaration(e){if(e.exported_names){if(e.exported_names[0].name.name==="*"){return{type:"ExportAllDeclaration",source:to_moz(e.module_name),assertions:assert_clause_to_moz(e.assert_clause)}}return{type:"ExportNamedDeclaration",specifiers:e.exported_names.map((function(e){return{type:"ExportSpecifier",exported:to_moz(e.foreign_name),local:to_moz(e.name)}})),declaration:to_moz(e.exported_definition),source:to_moz(e.module_name),assertions:assert_clause_to_moz(e.assert_clause)}}return{type:e.is_default?"ExportDefaultDeclaration":"ExportNamedDeclaration",declaration:to_moz(e.exported_value||e.exported_definition)}}));def_to_moz(Ve,(function To_Moz_ImportDeclaration(e){var t=[];if(e.imported_name){t.push({type:"ImportDefaultSpecifier",local:to_moz(e.imported_name)})}if(e.imported_names&&e.imported_names[0].foreign_name.name==="*"){t.push({type:"ImportNamespaceSpecifier",local:to_moz(e.imported_names[0].name)})}else if(e.imported_names){e.imported_names.forEach((function(e){t.push({type:"ImportSpecifier",local:to_moz(e.name),imported:to_moz(e.foreign_name)})}))}return{type:"ImportDeclaration",specifiers:t,source:to_moz(e.module_name),assertions:assert_clause_to_moz(e.assert_clause)}}));def_to_moz(Ue,(function To_Moz_MetaProperty(){return{type:"MetaProperty",meta:{type:"Identifier",name:"import"},property:{type:"Identifier",name:"meta"}}}));def_to_moz(He,(function To_Moz_SequenceExpression(e){return{type:"SequenceExpression",expressions:e.expressions.map(to_moz)}}));def_to_moz(qe,(function To_Moz_PrivateMemberExpression(e){return{type:"MemberExpression",object:to_moz(e.expression),computed:false,property:{type:"PrivateIdentifier",name:e.property},optional:e.optional}}));def_to_moz(Xe,(function To_Moz_MemberExpression(e){var t=e instanceof Ye;return{type:"MemberExpression",object:to_moz(e.expression),computed:t,property:t?to_moz(e.property):{type:"Identifier",name:e.property},optional:e.optional}}));def_to_moz(je,(function To_Moz_ChainExpression(e){return{type:"ChainExpression",expression:to_moz(e.expression)}}));def_to_moz($e,(function To_Moz_Unary(e){return{type:e.operator=="++"||e.operator=="--"?"UpdateExpression":"UnaryExpression",operator:e.operator,prefix:e instanceof Ze,argument:to_moz(e.expression)}}));def_to_moz(Je,(function To_Moz_BinaryExpression(e){if(e.operator=="="&&to_moz_in_destructuring()){return{type:"AssignmentPattern",left:to_moz(e.left),right:to_moz(e.right)}}const t=e.operator=="&&"||e.operator=="||"||e.operator==="??"?"LogicalExpression":"BinaryExpression";return{type:t,left:to_moz(e.left),operator:e.operator,right:to_moz(e.right)}}));def_to_moz(rt,(function To_Moz_ArrayExpression(e){return{type:"ArrayExpression",elements:e.elements.map(to_moz)}}));def_to_moz(it,(function To_Moz_ObjectExpression(e){return{type:"ObjectExpression",properties:e.properties.map(to_moz)}}));def_to_moz(ot,(function To_Moz_Property(e,t){var n=e.key instanceof U?to_moz(e.key):{type:"Identifier",value:e.key};if(typeof e.key==="number"){n={type:"Literal",value:Number(e.key)}}if(typeof e.key==="string"){n={type:"Identifier",name:e.key}}var r;var i=typeof e.key==="string"||typeof e.key==="number";var o=i?false:!(e.key instanceof gt)||e.key instanceof Pt;if(e instanceof at){r="init";o=!i}else if(e instanceof ct){r="get"}else if(e instanceof lt){r="set"}if(e instanceof ut||e instanceof st){const t=e instanceof ut?"get":"set";return{type:"MethodDefinition",computed:false,kind:t,static:e.static,key:{type:"PrivateIdentifier",name:e.key.name},value:to_moz(e.value)}}if(e instanceof mt){return{type:"PropertyDefinition",key:{type:"PrivateIdentifier",name:e.key.name},value:to_moz(e.value),computed:false,static:e.static}}if(e instanceof dt){return{type:"PropertyDefinition",key:n,value:to_moz(e.value),computed:o,static:e.static}}if(t instanceof pt){return{type:"MethodDefinition",computed:o,kind:r,static:e.static,key:to_moz(e.key),value:to_moz(e.value)}}return{type:"Property",computed:o,kind:r,key:n,value:to_moz(e.value)}}));def_to_moz(ft,(function To_Moz_MethodDefinition(e,t){if(t instanceof it){return{type:"Property",computed:!(e.key instanceof gt)||e.key instanceof Pt,kind:"init",method:true,shorthand:false,key:to_moz(e.key),value:to_moz(e.value)}}const n=e instanceof _t?{type:"PrivateIdentifier",name:e.key.name}:to_moz(e.key);return{type:"MethodDefinition",kind:e.key==="constructor"?"constructor":"method",key:n,value:to_moz(e.value),computed:!(e.key instanceof gt)||e.key instanceof Pt,static:e.static}}));def_to_moz(pt,(function To_Moz_Class(e){var t=e instanceof Et?"ClassExpression":"ClassDeclaration";return{type:t,superClass:to_moz(e.extends),id:e.name?to_moz(e.name):null,body:{type:"ClassBody",body:e.properties.map(to_moz)}}}));def_to_moz(vt,(function To_Moz_MetaProperty(){return{type:"MetaProperty",meta:{type:"Identifier",name:"new"},property:{type:"Identifier",name:"target"}}}));def_to_moz(gt,(function To_Moz_Identifier(e,t){if(e instanceof Ct&&t.quote){return{type:"Literal",value:e.name}}var n=e.definition();return{type:"Identifier",name:n?n.mangled_name||n.name:e.name}}));def_to_moz(Wt,(function To_Moz_RegExpLiteral(e){const t=e.value.source;const n=e.value.flags;return{type:"Literal",value:null,raw:e.print_to_string(),regex:{pattern:t,flags:n}}}));def_to_moz(Kt,(function To_Moz_Literal(e){var t=e.value;return{type:"Literal",value:t,raw:e.raw||e.print_to_string()}}));def_to_moz(qt,(function To_Moz_Atom(e){return{type:"Identifier",name:String(e.value)}}));def_to_moz(Xt,(e=>({type:"BigIntLiteral",value:e.value})));Jt.DEFMETHOD("to_mozilla_ast",Kt.prototype.to_mozilla_ast);Yt.DEFMETHOD("to_mozilla_ast",Kt.prototype.to_mozilla_ast);Zt.DEFMETHOD("to_mozilla_ast",(function To_Moz_ArrayHole(){return null}));X.DEFMETHOD("to_mozilla_ast",W.prototype.to_mozilla_ast);se.DEFMETHOD("to_mozilla_ast",le.prototype.to_mozilla_ast);function my_start_token(e){var t=e.loc,n=t&&t.start;var r=e.range;return new AST_Token("","",n&&n.line||0,n&&n.column||0,r?r[0]:e.start,false,[],[],t&&t.source)}function my_end_token(e){var t=e.loc,n=t&&t.end;var r=e.range;return new AST_Token("","",n&&n.line||0,n&&n.column||0,r?r[0]:e.end,false,[],[],t&&t.source)}function map(t,n,r){var i="function From_Moz_"+t+"(M){\n";i+="return new U2."+n.name+"({\n"+"start: my_start_token(M),\n"+"end: my_end_token(M)";var o="function To_Moz_"+t+"(M){\n";o+="return {\n"+"type: "+JSON.stringify(t);if(r)r.split(/\s*,\s*/).forEach((function(e){var t=/([a-z0-9$_]+)([=@>%])([a-z0-9$_]+)/i.exec(e);if(!t)throw new Error("Can't understand property map: "+e);var n=t[1],r=t[2],a=t[3];i+=",\n"+a+": ";o+=",\n"+n+": ";switch(r){case"@":i+="M."+n+".map(from_moz)";o+="M."+a+".map(to_moz)";break;case">":i+="from_moz(M."+n+")";o+="to_moz(M."+a+")";break;case"=":i+="M."+n;o+="M."+a;break;case"%":i+="from_moz(M."+n+").body";o+="to_moz_block(M)";break;default:throw new Error("Can't understand operator in propmap: "+e)}}));i+="\n})\n}";o+="\n}\n}";i=new Function("U2","my_start_token","my_end_token","from_moz","return("+i+")")(sn,my_start_token,my_end_token,from_moz);o=new Function("to_moz","to_moz_block","to_moz_scope","return("+o+")")(to_moz,to_moz_block,to_moz_scope);e[t]=i;def_to_moz(n,o)}var t=null;function from_moz(n){t.push(n);var r=n!=null?e[n.type](n):null;t.pop();return r}U.from_mozilla_ast=function(e){var n=t;t=[];var r=from_moz(e);t=n;return r};function set_moz_loc(e,t){var n=e.start;var r=e.end;if(!(n&&r)){return t}if(n.pos!=null&&r.endpos!=null){t.range=[n.pos,r.endpos]}if(n.line){t.loc={start:{line:n.line,column:n.col},end:r.endline?{line:r.endline,column:r.endcol}:null};if(n.file){t.loc.source=n.file}}return t}function def_to_moz(e,t){e.DEFMETHOD("to_mozilla_ast",(function(e){return set_moz_loc(this,t(this,e))}))}var n=null;function to_moz(e){if(n===null){n=[]}n.push(e);var t=e!=null?e.to_mozilla_ast(n[n.length-2]):null;n.pop();if(n.length===0){n=null}return t}function to_moz_in_destructuring(){var e=n.length;while(e--){if(n[e]instanceof _e){return true}}return false}function to_moz_block(e){return{type:"BlockStatement",body:e.body.map(to_moz)}}function to_moz_scope(e,t){var n=t.body.map(to_moz);if(t.body[0]instanceof H&&t.body[0].body instanceof Gt){n.unshift(to_moz(new q(t.body[0])))}return{type:e,body:n}}})();function first_in_statement(e){let t=e.parent(-1);for(let n=0,r;r=e.parent(n);n++){if(r instanceof z&&r.body===t)return true;if(r instanceof He&&r.expressions[0]===t||r.TYPE==="Call"&&r.expression===t||r instanceof pe&&r.prefix===t||r instanceof We&&r.expression===t||r instanceof Ye&&r.expression===t||r instanceof et&&r.condition===t||r instanceof Je&&r.left===t||r instanceof Qe&&r.expression===t){t=r}else{return false}}}function left_is_object(e){if(e instanceof it)return true;if(e instanceof He)return left_is_object(e.expressions[0]);if(e.TYPE==="Call")return left_is_object(e.expression);if(e instanceof pe)return left_is_object(e.prefix);if(e instanceof We||e instanceof Ye)return left_is_object(e.expression);if(e instanceof et)return left_is_object(e.condition);if(e instanceof Je)return left_is_object(e.left);if(e instanceof Qe)return left_is_object(e.expression);return false}const un=/^$|[;{][\s\n]*$/;const ln=10;const cn=32;const _n=/[@#]__(PURE|INLINE|NOINLINE)__/g;function is_some_comments(e){return(e.type==="comment2"||e.type==="comment1")&&/@preserve|@lic|@cc_on|^\**!/i.test(e.value)}class Rope{constructor(){this.committed="";this.current=""}append(e){this.current+=e}insertAt(e,t){const{committed:n,current:r}=this;if(t5;var n=return_false;if(e.comments){let t=e.comments;if(typeof e.comments==="string"&&/^\/.*\/[a-zA-Z]*$/.test(e.comments)){var r=e.comments.lastIndexOf("/");t=new RegExp(e.comments.substr(1,r-1),e.comments.substr(r+1))}if(t instanceof RegExp){n=function(e){return e.type!="comment5"&&t.test(e.value)}}else if(typeof t==="function"){n=function(e){return e.type!="comment5"&&t(this,e)}}else if(t==="some"){n=is_some_comments}else{n=return_true}}var i=0;var o=0;var a=1;var s=0;var u=new Rope;let l=new Set;var c=e.ascii_only?function(t,n){if(e.ecma>=2015&&!e.safari10){t=t.replace(/[\ud800-\udbff][\udc00-\udfff]/g,(function(e){var t=get_full_char_code(e,0).toString(16);return"\\u{"+t+"}"}))}return t.replace(/[\u0000-\u001f\u007f-\uffff]/g,(function(e){var t=e.charCodeAt(0).toString(16);if(t.length<=2&&!n){while(t.length<2)t="0"+t;return"\\x"+t}else{while(t.length<4)t="0"+t;return"\\u"+t}}))}:function(e){return e.replace(/[\ud800-\udbff][\udc00-\udfff]|([\ud800-\udbff]|[\udc00-\udfff])/g,(function(e,t){if(t){return"\\u"+t.charCodeAt(0).toString(16)}return e}))};function make_string(t,n){var r=0,i=0;t=t.replace(/[\\\b\f\n\r\v\t\x22\x27\u2028\u2029\0\ufeff]/g,(function(n,o){switch(n){case'"':++r;return'"';case"'":++i;return"'";case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r";case"\t":return"\\t";case"\b":return"\\b";case"\f":return"\\f";case"\v":return e.ie8?"\\x0B":"\\v";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";case"\ufeff":return"\\ufeff";case"\0":return/[0-9]/.test(get_full_char(t,o+1))?"\\x00":"\\0"}return n}));function quote_single(){return"'"+t.replace(/\x27/g,"\\'")+"'"}function quote_double(){return'"'+t.replace(/\x22/g,'\\"')+'"'}function quote_template(){return"`"+t.replace(/`/g,"\\`")+"`"}t=c(t);if(n==="`")return quote_template();switch(e.quote_style){case 1:return quote_single();case 2:return quote_double();case 3:return n=="'"?quote_single():quote_double();default:return r>i?quote_single():quote_double()}}function encode_string(t,n){var r=make_string(t,n);if(e.inline_script){r=r.replace(/<\x2f(script)([>\/\t\n\f\r ])/gi,"<\\/$1$2");r=r.replace(/\x3c!--/g,"\\x3c!--");r=r.replace(/--\x3e/g,"--\\x3e")}return r}function make_name(e){e=e.toString();e=c(e,true);return e}function make_indent(t){return" ".repeat(e.indent_start+i-t*e.indent_level)}var f=false;var _=false;var p=false;var d=0;var m=false;var h=false;var E=-1;var g="";var v,D,b=e.source_map&&[];var S=b?function(){b.forEach((function(t){try{let{name:n,token:r}=t;if(r.type=="name"||r.type==="privatename"){n=r.value}else if(n instanceof gt){n=r.type==="string"?r.value:n.name}e.source_map.add(t.token.file,t.line,t.col,t.token.line,t.token.col,is_basic_identifier_string(n)?n:undefined)}catch(e){}}));b=[]}:noop;var y=e.max_line_len?function(){if(o>e.max_line_len){if(d){u.insertAt("\n",d);const e=u.curLength();if(b){var t=e-o;b.forEach((function(e){e.line++;e.col+=t}))}a++;s++;o=e}}if(d){d=0;S()}}:noop;var A=makePredicate("( [ + * / - , . `");function print(t){t=String(t);var n=get_full_char(t,0);if(m&&n){m=false;if(n!=="\n"){print("\n");k()}}if(h&&n){h=false;if(!/[\s;})]/.test(n)){T()}}E=-1;var r=g.charAt(g.length-1);if(p){p=false;if(r===":"&&n==="}"||(!n||!";}".includes(n))&&r!==";"){if(e.semicolons||A.has(n)){u.append(";");o++;s++}else{y();if(o>0){u.append("\n");s++;a++;o=0}if(/^\s+$/.test(t)){p=true}}if(!e.beautify)_=false}}if(_){if(is_identifier_char(r)&&(is_identifier_char(n)||n=="\\")||n=="/"&&n==r||(n=="+"||n=="-")&&n==g){u.append(" ");o++;s++}_=false}if(v){b.push({token:v,name:D,line:a,col:o});v=false;if(!d)S()}u.append(t);f=t[t.length-1]=="(";s+=t.length;var i=t.split(/\r?\n/),l=i.length-1;a+=l;o+=i[0].length;if(l>0){y();o=i[l].length}g=t}var star=function(){print("*")};var T=e.beautify?function(){print(" ")}:function(){_=true};var k=e.beautify?function(t){if(e.beautify){print(make_indent(t?.5:0))}}:noop;var C=e.beautify?function(e,t){if(e===true)e=next_indent();var n=i;i=e;var r=t();i=n;return r}:function(e,t){return t()};var R=e.beautify?function(){if(E<0)return print("\n");if(u.charAt(E)!="\n"){u.insertAt("\n",E);s++;a++}E++}:e.max_line_len?function(){y();d=u.length()}:noop;var F=e.beautify?function(){print(";")}:function(){p=true};function force_semicolon(){p=false;print(";")}function next_indent(){return i+e.indent_level}function with_block(e){var t;print("{");R();C(next_indent(),(function(){t=e()}));k();print("}");return t}function with_parens(e){print("(");var t=e();print(")");return t}function with_square(e){print("[");var t=e();print("]");return t}function comma(){print(",");T()}function colon(){print(":");T()}var O=b?function(e,t){v=e;D=t}:noop;function get(){if(d){y()}return u.toString()}function has_nlb(){const e=u.toString();let t=e.length-1;while(t>=0){const n=e.charCodeAt(t);if(n===ln){return true}if(n!==cn){return false}t--}return true}function filter_comment(t){if(!e.preserve_annotations){t=t.replace(_n," ")}if(/^\s*$/.test(t)){return""}return t.replace(/(<\s*\/\s*)(script)/i,"<\\/$2")}function prepend_comments(t){var r=this;var i=t.start;if(!i)return;var o=r.printed_comments;const a=t instanceof Ee&&t.value;if(i.comments_before&&o.has(i.comments_before)){if(a){i.comments_before=[]}else{return}}var u=i.comments_before;if(!u){u=i.comments_before=[]}o.add(u);if(a){var l=new TreeWalker((function(e){var t=l.parent();if(t instanceof Ee||t instanceof Je&&t.left===e||t.TYPE=="Call"&&t.expression===e||t instanceof et&&t.condition===e||t instanceof We&&t.expression===e||t instanceof He&&t.expressions[0]===e||t instanceof Ye&&t.expression===e||t instanceof Qe){if(!e.start)return;var n=e.start.comments_before;if(n&&!o.has(n)){o.add(n);u=u.concat(n)}}else{return true}}));l.push(t);t.value.walk(l)}if(s==0){if(u.length>0&&e.shebang&&u[0].type==="comment5"&&!o.has(u[0])){print("#!"+u.shift().value+"\n");k()}var c=e.preamble;if(c){print(c.replace(/\r\n?|[\n\u2028\u2029]|\s*$/g,"\n"))}}u=u.filter(n,t).filter((e=>!o.has(e)));if(u.length==0)return;var f=has_nlb();u.forEach((function(e,t){o.add(e);if(!f){if(e.nlb){print("\n");k();f=true}else if(t>0){T()}}if(/comment[134]/.test(e.type)){var n=filter_comment(e.value);if(n){print("//"+n+"\n");k()}f=true}else if(e.type=="comment2"){var n=filter_comment(e.value);if(n){print("/*"+n+"*/")}f=false}}));if(!f){if(i.nlb){print("\n");k()}else{T()}}}function append_comments(e,t){var r=this;var i=e.end;if(!i)return;var o=r.printed_comments;var a=i[t?"comments_before":"comments_after"];if(!a||o.has(a))return;if(!(e instanceof z||a.every((e=>!/comment[134]/.test(e.type)))))return;o.add(a);var s=u.length();a.filter(n,e).forEach((function(e,n){if(o.has(e))return;o.add(e);h=false;if(m){print("\n");k();m=false}else if(e.nlb&&(n>0||!has_nlb())){print("\n");k()}else if(n>0||!t){T()}if(/comment[134]/.test(e.type)){const t=filter_comment(e.value);if(t){print("//"+t)}m=true}else if(e.type=="comment2"){const t=filter_comment(e.value);if(t){print("/*"+t+"*/")}h=true}}));if(u.length()>s)E=s}var M=[];return{get:get,toString:get,indent:k,in_directive:false,use_asm:null,active_scope:null,indentation:function(){return i},current_width:function(){return o-i},should_break:function(){return e.width&&this.current_width()>=e.width},has_parens:function(){return f},newline:R,print:print,star:star,space:T,comma:comma,colon:colon,last:function(){return g},semicolon:F,force_semicolon:force_semicolon,to_utf8:c,print_name:function(e){print(make_name(e))},print_string:function(e,t,n){var r=encode_string(e,t);if(n===true&&!r.includes("\\")){if(!un.test(u.toString())){force_semicolon()}force_semicolon()}print(r)},print_template_string_chars:function(e){var t=encode_string(e,"`").replace(/\${/g,"\\${");return print(t.substr(1,t.length-2))},encode_string:encode_string,next_indent:next_indent,with_indent:C,with_block:with_block,with_parens:with_parens,with_square:with_square,add_mapping:O,option:function(t){return e[t]},printed_comments:l,prepend_comments:t?noop:prepend_comments,append_comments:t||n===return_false?noop:append_comments,line:function(){return a},col:function(){return o},pos:function(){return s},push_node:function(e){M.push(e)},pop_node:function(){return M.pop()},parent:function(e){return M[M.length-2-(e||0)]}}}(function(){function DEFPRINT(e,t){e.DEFMETHOD("_codegen",t)}U.DEFMETHOD("print",(function(e,t){var n=this,r=n._codegen;if(n instanceof ie){e.active_scope=n}else if(!e.use_asm&&n instanceof G&&n.value=="use asm"){e.use_asm=e.active_scope}function doit(){e.prepend_comments(n);n.add_source_map(e);r(n,e);e.append_comments(n)}e.push_node(n);if(t||n.needs_parens(e)){e.with_parens(doit)}else{doit()}e.pop_node();if(n===e.use_asm){e.use_asm=null}}));U.DEFMETHOD("_print",U.prototype.print);U.DEFMETHOD("print_to_string",(function(e){var t=OutputStream(e);this.print(t);return t.get()}));function PARENS(e,t){if(Array.isArray(e)){e.forEach((function(e){PARENS(e,t)}))}else{e.DEFMETHOD("needs_parens",t)}}PARENS(U,return_false);PARENS(le,(function(e){if(!e.has_parens()&&first_in_statement(e)){return true}if(e.option("webkit")){var t=e.parent();if(t instanceof Xe&&t.expression===this){return true}}if(e.option("wrap_iife")){var t=e.parent();if(t instanceof Ke&&t.expression===this){return true}}if(e.option("wrap_func_args")){var t=e.parent();if(t instanceof Ke&&t.args.includes(this)){return true}}return false}));PARENS(ce,(function(e){var t=e.parent();if(e.option("wrap_func_args")&&t instanceof Ke&&t.args.includes(this)){return true}return t instanceof Xe&&t.expression===this}));PARENS(it,(function(e){return!e.has_parens()&&first_in_statement(e)}));PARENS(Et,first_in_statement);PARENS($e,(function(e){var t=e.parent();return t instanceof Xe&&t.expression===this||t instanceof Ke&&t.expression===this||t instanceof Je&&t.operator==="**"&&this instanceof Ze&&t.left===this&&this.operator!=="++"&&this.operator!=="--"}));PARENS(ye,(function(e){var t=e.parent();return t instanceof Xe&&t.expression===this||t instanceof Ke&&t.expression===this||t instanceof Je&&t.operator==="**"&&t.left===this||e.option("safari10")&&t instanceof Ze}));PARENS(He,(function(e){var t=e.parent();return t instanceof Ke||t instanceof $e||t instanceof Je||t instanceof Be||t instanceof Xe||t instanceof rt||t instanceof ot||t instanceof et||t instanceof ce||t instanceof nt||t instanceof ae||t instanceof ne&&this===t.object||t instanceof Ae||t instanceof ze}));PARENS(Je,(function(e){var t=e.parent();if(t instanceof Ke&&t.expression===this)return true;if(t instanceof $e)return true;if(t instanceof Xe&&t.expression===this)return true;if(t instanceof Je){const e=t.operator;const n=this.operator;if(n==="??"&&(e==="||"||e==="&&")){return true}if(e==="??"&&(n==="||"||n==="&&")){return true}const r=I[e];const i=I[n];if(r>i||r==i&&(this===t.right||e=="**")){return true}}}));PARENS(Ae,(function(e){var t=e.parent();if(t instanceof Je&&t.operator!=="=")return true;if(t instanceof Ke&&t.expression===this)return true;if(t instanceof et&&t.condition===this)return true;if(t instanceof $e)return true;if(t instanceof Xe&&t.expression===this)return true}));PARENS(Xe,(function(e){var t=e.parent();if(t instanceof Ge&&t.expression===this){return walk(this,(e=>{if(e instanceof ie)return true;if(e instanceof Ke){return nn}}))}}));PARENS(Ke,(function(e){var t=e.parent(),n;if(t instanceof Ge&&t.expression===this||t instanceof ze&&t.is_default&&this.expression instanceof le)return true;return this.expression instanceof le&&t instanceof Xe&&t.expression===this&&(n=e.parent(1))instanceof tt&&n.left===t}));PARENS(Ge,(function(e){var t=e.parent();if(this.args.length===0&&(t instanceof Xe||t instanceof Ke&&t.expression===this))return true}));PARENS(Ht,(function(e){var t=e.parent();if(t instanceof Xe&&t.expression===this){var n=this.getValue();if(n<0||/^0/.test(make_num(n))){return true}}}));PARENS(Xt,(function(e){var t=e.parent();if(t instanceof Xe&&t.expression===this){var n=this.getValue();if(n.startsWith("-")){return true}}}));PARENS([tt,et],(function(e){var t=e.parent();if(t instanceof $e)return true;if(t instanceof Je&&!(t instanceof tt))return true;if(t instanceof Ke&&t.expression===this)return true;if(t instanceof et&&t.condition===this)return true;if(t instanceof Xe&&t.expression===this)return true;if(this instanceof tt&&this.left instanceof _e&&this.left.is_array===false)return true}));DEFPRINT(G,(function(e,t){t.print_string(e.value,e.quote);t.semicolon()}));DEFPRINT(ae,(function(e,t){t.print("...");e.expression.print(t)}));DEFPRINT(_e,(function(e,t){t.print(e.is_array?"[":"{");var n=e.names.length;e.names.forEach((function(e,r){if(r>0)t.comma();e.print(t);if(r==n-1&&e instanceof Zt)t.comma()}));t.print(e.is_array?"]":"}")}));DEFPRINT(K,(function(e,t){t.print("debugger");t.semicolon()}));function display_body(e,t,n,r){var i=e.length-1;n.in_directive=r;e.forEach((function(e,r){if(n.in_directive===true&&!(e instanceof G||e instanceof q||e instanceof H&&e.body instanceof Gt)){n.in_directive=false}if(!(e instanceof q)){n.indent();e.print(n);if(!(r==i&&t)){n.newline();if(t)n.newline()}}if(n.in_directive===true&&e instanceof H&&e.body instanceof Gt){n.in_directive=false}}));n.in_directive=false}Y.DEFMETHOD("_do_print_body",(function(e){force_statement(this.body,e)}));DEFPRINT(z,(function(e,t){e.body.print(t);t.semicolon()}));DEFPRINT(oe,(function(e,t){display_body(e.body,true,t,true);t.print("")}));DEFPRINT(j,(function(e,t){e.label.print(t);t.colon();e.body.print(t)}));DEFPRINT(H,(function(e,t){e.body.print(t);t.semicolon()}));function print_braced_empty(e,t){t.print("{");t.with_indent(t.next_indent(),(function(){t.append_comments(e,true)}));t.print("}")}function print_braced(e,t,n){if(e.body.length>0){t.with_block((function(){display_body(e.body,false,t,n)}))}else print_braced_empty(e,t)}DEFPRINT(W,(function(e,t){print_braced(e,t)}));DEFPRINT(q,(function(e,t){t.semicolon()}));DEFPRINT(Q,(function(e,t){t.print("do");t.space();make_block(e.body,t);t.space();t.print("while");t.space();t.with_parens((function(){e.condition.print(t)}));t.semicolon()}));DEFPRINT(J,(function(e,t){t.print("while");t.space();t.with_parens((function(){e.condition.print(t)}));t.space();e._do_print_body(t)}));DEFPRINT(ee,(function(e,t){t.print("for");t.space();t.with_parens((function(){if(e.init){if(e.init instanceof Ne){e.init.print(t)}else{parenthesize_for_noin(e.init,t,true)}t.print(";");t.space()}else{t.print(";")}if(e.condition){e.condition.print(t);t.print(";");t.space()}else{t.print(";")}if(e.step){e.step.print(t)}}));t.space();e._do_print_body(t)}));DEFPRINT(te,(function(e,t){t.print("for");if(e.await){t.space();t.print("await")}t.space();t.with_parens((function(){e.init.print(t);t.space();t.print(e instanceof ne?"of":"in");t.space();e.object.print(t)}));t.space();e._do_print_body(t)}));DEFPRINT(re,(function(e,t){t.print("with");t.space();t.with_parens((function(){e.expression.print(t)}));t.space();e._do_print_body(t)}));se.DEFMETHOD("_do_print",(function(e,t){var n=this;if(!t){if(n.async){e.print("async");e.space()}e.print("function");if(n.is_generator){e.star()}if(n.name){e.space()}}if(n.name instanceof gt){n.name.print(e)}else if(t&&n.name instanceof U){e.with_square((function(){n.name.print(e)}))}e.with_parens((function(){n.argnames.forEach((function(t,n){if(n)e.comma();t.print(e)}))}));e.space();print_braced(n,e,true)}));DEFPRINT(se,(function(e,t){e._do_print(t)}));DEFPRINT(pe,(function(e,t){var n=e.prefix;var r=n instanceof se||n instanceof Je||n instanceof et||n instanceof He||n instanceof $e||n instanceof We&&n.expression instanceof it;if(r)t.print("(");e.prefix.print(t);if(r)t.print(")");e.template_string.print(t)}));DEFPRINT(de,(function(e,t){var n=t.parent()instanceof pe;t.print("`");for(var r=0;r");e.space();const i=t.body[0];if(t.body.length===1&&i instanceof ge){const t=i.value;if(!t){e.print("{}")}else if(left_is_object(t)){e.print("(");t.print(e);e.print(")")}else{t.print(e)}}else{print_braced(t,e)}if(r){e.print(")")}}));Ee.DEFMETHOD("_do_print",(function(e,t){e.print(t);if(this.value){e.space();const t=this.value.start.comments_before;if(t&&t.length&&!e.printed_comments.has(t)){e.print("(");this.value.print(e);e.print(")")}else{this.value.print(e)}}e.semicolon()}));DEFPRINT(ge,(function(e,t){e._do_print(t,"return")}));DEFPRINT(ve,(function(e,t){e._do_print(t,"throw")}));DEFPRINT(Ae,(function(e,t){var n=e.is_star?"*":"";t.print("yield"+n);if(e.expression){t.space();e.expression.print(t)}}));DEFPRINT(ye,(function(e,t){t.print("await");t.space();var n=e.expression;var r=!(n instanceof Ke||n instanceof Pt||n instanceof Xe||n instanceof $e||n instanceof Kt||n instanceof ye||n instanceof it);if(r)t.print("(");e.expression.print(t);if(r)t.print(")")}));De.DEFMETHOD("_do_print",(function(e,t){e.print(t);if(this.label){e.space();this.label.print(e)}e.semicolon()}));DEFPRINT(be,(function(e,t){e._do_print(t,"break")}));DEFPRINT(Se,(function(e,t){e._do_print(t,"continue")}));function make_then(e,t){var n=e.body;if(t.option("braces")||t.option("ie8")&&n instanceof Q)return make_block(n,t);if(!n)return t.force_semicolon();while(true){if(n instanceof Te){if(!n.alternative){make_block(e.body,t);return}n=n.alternative}else if(n instanceof Y){n=n.body}else break}force_statement(e.body,t)}DEFPRINT(Te,(function(e,t){t.print("if");t.space();t.with_parens((function(){e.condition.print(t)}));t.space();if(e.alternative){make_then(e,t);t.space();t.print("else");t.space();if(e.alternative instanceof Te)e.alternative.print(t);else force_statement(e.alternative,t)}else{e._do_print_body(t)}}));DEFPRINT(ke,(function(e,t){t.print("switch");t.space();t.with_parens((function(){e.expression.print(t)}));t.space();var n=e.body.length-1;if(n<0)print_braced_empty(e,t);else t.with_block((function(){e.body.forEach((function(e,r){t.indent(true);e.print(t);if(r0)t.newline()}))}))}));Ce.DEFMETHOD("_do_print_body",(function(e){e.newline();this.body.forEach((function(t){e.indent();t.print(e);e.newline()}))}));DEFPRINT(Re,(function(e,t){t.print("default:");e._do_print_body(t)}));DEFPRINT(Fe,(function(e,t){t.print("case");t.space();e.expression.print(t);t.print(":");e._do_print_body(t)}));DEFPRINT(Oe,(function(e,t){t.print("try");t.space();print_braced(e,t);if(e.bcatch){t.space();e.bcatch.print(t)}if(e.bfinally){t.space();e.bfinally.print(t)}}));DEFPRINT(Me,(function(e,t){t.print("catch");if(e.argname){t.space();t.with_parens((function(){e.argname.print(t)}))}t.space();print_braced(e,t)}));DEFPRINT(xe,(function(e,t){t.print("finally");t.space();print_braced(e,t)}));Ne.DEFMETHOD("_do_print",(function(e,t){e.print(t);e.space();this.definitions.forEach((function(t,n){if(n)e.comma();t.print(e)}));var n=e.parent();var r=n instanceof ee||n instanceof te;var i=!r||n&&n.init!==this;if(i)e.semicolon()}));DEFPRINT(Ie,(function(e,t){e._do_print(t,"let")}));DEFPRINT(we,(function(e,t){e._do_print(t,"var")}));DEFPRINT(Pe,(function(e,t){e._do_print(t,"const")}));DEFPRINT(Ve,(function(e,t){t.print("import");t.space();if(e.imported_name){e.imported_name.print(t)}if(e.imported_name&&e.imported_names){t.print(",");t.space()}if(e.imported_names){if(e.imported_names.length===1&&e.imported_names[0].foreign_name.name==="*"){e.imported_names[0].print(t)}else{t.print("{");e.imported_names.forEach((function(n,r){t.space();n.print(t);if(r{if(e instanceof ie&&!(e instanceof ce)){return true}if(e instanceof Je&&e.operator=="in"){return nn}}))}e.print(t,r)}DEFPRINT(Be,(function(e,t){e.name.print(t);if(e.value){t.space();t.print("=");t.space();var n=t.parent(1);var r=n instanceof ee||n instanceof te;parenthesize_for_noin(e.value,t,r)}}));DEFPRINT(Ke,(function(e,t){e.expression.print(t);if(e instanceof Ge&&e.args.length===0)return;if(e.expression instanceof Ke||e.expression instanceof se){t.add_mapping(e.start)}if(e.optional)t.print("?.");t.with_parens((function(){e.args.forEach((function(e,n){if(n)t.comma();e.print(t)}))}))}));DEFPRINT(Ge,(function(e,t){t.print("new");t.space();Ke.prototype._codegen(e,t)}));He.DEFMETHOD("_do_print",(function(e){this.expressions.forEach((function(t,n){if(n>0){e.comma();if(e.should_break()){e.newline();e.indent()}}t.print(e)}))}));DEFPRINT(He,(function(e,t){e._do_print(t)}));DEFPRINT(We,(function(e,t){var n=e.expression;n.print(t);var r=e.property;var i=_.has(r)?t.option("ie8"):!is_identifier_string(r,t.option("ecma")>=2015||t.option("safari10"));if(e.optional)t.print("?.");if(i){t.print("[");t.add_mapping(e.end);t.print_string(r);t.print("]")}else{if(n instanceof Ht&&n.getValue()>=0){if(!/[xa-f.)]/i.test(t.last())){t.print(".")}}if(!e.optional)t.print(".");t.add_mapping(e.end);t.print_name(r)}}));DEFPRINT(qe,(function(e,t){var n=e.expression;n.print(t);var r=e.property;if(e.optional)t.print("?");t.print(".#");t.add_mapping(e.end);t.print_name(r)}));DEFPRINT(Ye,(function(e,t){e.expression.print(t);if(e.optional)t.print("?.");t.print("[");e.property.print(t);t.print("]")}));DEFPRINT(je,(function(e,t){e.expression.print(t)}));DEFPRINT(Ze,(function(e,t){var n=e.operator;t.print(n);if(/^[a-z]/i.test(n)||/[+-]$/.test(n)&&e.expression instanceof Ze&&/^[+-]/.test(e.expression.operator)){t.space()}e.expression.print(t)}));DEFPRINT(Qe,(function(e,t){e.expression.print(t);t.print(e.operator)}));DEFPRINT(Je,(function(e,t){var n=e.operator;e.left.print(t);if(n[0]==">"&&e.left instanceof Qe&&e.left.operator=="--"){t.print(" ")}else{t.space()}t.print(n);if((n=="<"||n=="<<")&&e.right instanceof Ze&&e.right.operator=="!"&&e.right.expression instanceof Ze&&e.right.expression.operator=="--"){t.print(" ")}else{t.space()}e.right.print(t)}));DEFPRINT(et,(function(e,t){e.condition.print(t);t.space();t.print("?");t.space();e.consequent.print(t);t.space();t.colon();e.alternative.print(t)}));DEFPRINT(rt,(function(e,t){t.with_square((function(){var n=e.elements,r=n.length;if(r>0)t.space();n.forEach((function(e,n){if(n)t.comma();e.print(t);if(n===r-1&&e instanceof Zt)t.comma()}));if(r>0)t.space()}))}));DEFPRINT(it,(function(e,t){if(e.properties.length>0)t.with_block((function(){e.properties.forEach((function(e,n){if(n){t.print(",");t.newline()}t.indent();e.print(t)}));t.newline()}));else print_braced_empty(e,t)}));DEFPRINT(pt,(function(e,t){t.print("class");t.space();if(e.name){e.name.print(t);t.space()}if(e.extends){var n=!(e.extends instanceof Pt)&&!(e.extends instanceof Xe)&&!(e.extends instanceof Et)&&!(e.extends instanceof le);t.print("extends");if(n){t.print("(")}else{t.space()}e.extends.print(t);if(n){t.print(")")}else{t.space()}}if(e.properties.length>0)t.with_block((function(){e.properties.forEach((function(e,n){if(n){t.newline()}t.indent();e.print(t)}));t.newline()}));else t.print("{}")}));DEFPRINT(vt,(function(e,t){t.print("new.target")}));function print_property_name(e,t,n){if(n.option("quote_keys")){return n.print_string(e)}if(""+ +e==e&&e>=0){if(n.option("keep_numbers")){return n.print(e)}return n.print(make_num(e))}var r=_.has(e)?n.option("ie8"):n.option("ecma")<2015||n.option("safari10")?!is_basic_identifier_string(e):!is_identifier_string(e,true);if(r||t&&n.option("keep_quoted_props")){return n.print_string(e,t)}return n.print_name(e)}DEFPRINT(at,(function(e,t){function get_name(e){var t=e.definition();return t?t.mangled_name||t.name:e.name}var n=t.option("shorthand");if(n&&e.value instanceof gt&&is_identifier_string(e.key,t.option("ecma")>=2015||t.option("safari10"))&&get_name(e.value)===e.key&&!_.has(e.key)){print_property_name(e.key,e.quote,t)}else if(n&&e.value instanceof nt&&e.value.left instanceof gt&&is_identifier_string(e.key,t.option("ecma")>=2015||t.option("safari10"))&&get_name(e.value.left)===e.key){print_property_name(e.key,e.quote,t);t.space();t.print("=");t.space();e.value.right.print(t)}else{if(!(e.key instanceof U)){print_property_name(e.key,e.quote,t)}else{t.with_square((function(){e.key.print(t)}))}t.colon();e.value.print(t)}}));DEFPRINT(mt,((e,t)=>{if(e.static){t.print("static");t.space()}t.print("#");print_property_name(e.key.name,e.quote,t);if(e.value){t.print("=");e.value.print(t)}t.semicolon()}));DEFPRINT(dt,((e,t)=>{if(e.static){t.print("static");t.space()}if(e.key instanceof Rt){print_property_name(e.key.name,e.quote,t)}else{t.print("[");e.key.print(t);t.print("]")}if(e.value){t.print("=");e.value.print(t)}t.semicolon()}));ot.DEFMETHOD("_print_getter_setter",(function(e,t,n){var r=this;if(r.static){n.print("static");n.space()}if(e){n.print(e);n.space()}if(r.key instanceof Ct){if(t)n.print("#");print_property_name(r.key.name,r.quote,n)}else{n.with_square((function(){r.key.print(n)}))}r.value._do_print(n,true)}));DEFPRINT(lt,(function(e,t){e._print_getter_setter("set",false,t)}));DEFPRINT(ct,(function(e,t){e._print_getter_setter("get",false,t)}));DEFPRINT(st,(function(e,t){e._print_getter_setter("set",true,t)}));DEFPRINT(ut,(function(e,t){e._print_getter_setter("get",true,t)}));DEFPRINT(_t,(function(e,t){var n;if(e.is_generator&&e.async){n="async*"}else if(e.is_generator){n="*"}else if(e.async){n="async"}e._print_getter_setter(n,true,t)}));DEFPRINT(ft,(function(e,t){var n;if(e.is_generator&&e.async){n="async*"}else if(e.is_generator){n="*"}else if(e.async){n="async"}e._print_getter_setter(n,false,t)}));gt.DEFMETHOD("_do_print",(function(e){var t=this.definition();e.print_name(t?t.mangled_name||t.name:this.name)}));DEFPRINT(gt,(function(e,t){e._do_print(t)}));DEFPRINT(Zt,noop);DEFPRINT(Ut,(function(e,t){t.print("this")}));DEFPRINT(zt,(function(e,t){t.print("super")}));DEFPRINT(Kt,(function(e,t){t.print(e.getValue())}));DEFPRINT(Gt,(function(e,t){t.print_string(e.getValue(),e.quote,t.in_directive)}));DEFPRINT(Ht,(function(e,t){if((t.option("keep_numbers")||t.use_asm)&&e.raw){t.print(e.raw)}else{t.print(make_num(e.getValue()))}}));DEFPRINT(Xt,(function(e,t){t.print(e.getValue()+"n")}));const e=/(<\s*\/\s*script)/i;const slash_script_replace=(e,t)=>t.replace("/","\\/");DEFPRINT(Wt,(function(t,n){let{source:r,flags:i}=t.getValue();r=regexp_source_fix(r);i=i?sort_regexp_flags(i):"";r=r.replace(e,slash_script_replace);n.print(n.to_utf8(`/${r}/${i}`));const o=n.parent();if(o instanceof Je&&/^\w/.test(o.operator)&&o.left===t){n.print(" ")}}));function force_statement(e,t){if(t.option("braces")){make_block(e,t)}else{if(!e||e instanceof q)t.force_semicolon();else e.print(t)}}function best_of(e){var t=e[0],n=t.length;for(var r=1;re===null&&t===null||e.TYPE===t.TYPE&&e.shallow_cmp(t);const equivalent_to=(e,t)=>{if(!shallow_cmp(e,t))return false;const n=[e];const r=[t];const i=n.push.bind(n);const o=r.push.bind(r);while(n.length&&r.length){const e=n.pop();const t=r.pop();if(!shallow_cmp(e,t))return false;e._children_backwards(i);t._children_backwards(o);if(n.length!==r.length){return false}}return n.length==0&&r.length==0};const mkshallow=e=>{const t=Object.keys(e).map((t=>{if(e[t]==="eq"){return`this.${t} === other.${t}`}else if(e[t]==="exist"){return`(this.${t} == null ? other.${t} == null : this.${t} === other.${t})`}else{throw new Error(`mkshallow: Unexpected instruction: ${e[t]}`)}})).join(" && ");return new Function("other","return "+t)};const pass_through=()=>true;U.prototype.shallow_cmp=function(){throw new Error("did not find a shallow_cmp function for "+this.constructor.name)};K.prototype.shallow_cmp=pass_through;G.prototype.shallow_cmp=mkshallow({value:"eq"});H.prototype.shallow_cmp=pass_through;X.prototype.shallow_cmp=pass_through;q.prototype.shallow_cmp=pass_through;j.prototype.shallow_cmp=mkshallow({"label.name":"eq"});Q.prototype.shallow_cmp=pass_through;J.prototype.shallow_cmp=pass_through;ee.prototype.shallow_cmp=mkshallow({init:"exist",condition:"exist",step:"exist"});te.prototype.shallow_cmp=pass_through;ne.prototype.shallow_cmp=pass_through;re.prototype.shallow_cmp=pass_through;oe.prototype.shallow_cmp=pass_through;ae.prototype.shallow_cmp=pass_through;se.prototype.shallow_cmp=mkshallow({is_generator:"eq",async:"eq"});_e.prototype.shallow_cmp=mkshallow({is_array:"eq"});pe.prototype.shallow_cmp=pass_through;de.prototype.shallow_cmp=pass_through;me.prototype.shallow_cmp=mkshallow({value:"eq"});he.prototype.shallow_cmp=pass_through;De.prototype.shallow_cmp=pass_through;ye.prototype.shallow_cmp=pass_through;Ae.prototype.shallow_cmp=mkshallow({is_star:"eq"});Te.prototype.shallow_cmp=mkshallow({alternative:"exist"});ke.prototype.shallow_cmp=pass_through;Ce.prototype.shallow_cmp=pass_through;Oe.prototype.shallow_cmp=mkshallow({bcatch:"exist",bfinally:"exist"});Me.prototype.shallow_cmp=mkshallow({argname:"exist"});xe.prototype.shallow_cmp=pass_through;Ne.prototype.shallow_cmp=pass_through;Be.prototype.shallow_cmp=mkshallow({value:"exist"});Le.prototype.shallow_cmp=pass_through;Ve.prototype.shallow_cmp=mkshallow({imported_name:"exist",imported_names:"exist"});Ue.prototype.shallow_cmp=pass_through;ze.prototype.shallow_cmp=mkshallow({exported_definition:"exist",exported_value:"exist",exported_names:"exist",module_name:"eq",is_default:"eq"});Ke.prototype.shallow_cmp=pass_through;He.prototype.shallow_cmp=pass_through;Xe.prototype.shallow_cmp=pass_through;je.prototype.shallow_cmp=pass_through;We.prototype.shallow_cmp=mkshallow({property:"eq"});qe.prototype.shallow_cmp=mkshallow({property:"eq"});$e.prototype.shallow_cmp=mkshallow({operator:"eq"});Je.prototype.shallow_cmp=mkshallow({operator:"eq"});et.prototype.shallow_cmp=pass_through;rt.prototype.shallow_cmp=pass_through;it.prototype.shallow_cmp=pass_through;ot.prototype.shallow_cmp=pass_through;at.prototype.shallow_cmp=mkshallow({key:"eq"});lt.prototype.shallow_cmp=mkshallow({static:"eq"});ct.prototype.shallow_cmp=mkshallow({static:"eq"});ft.prototype.shallow_cmp=mkshallow({static:"eq",is_generator:"eq",async:"eq"});pt.prototype.shallow_cmp=mkshallow({name:"exist",extends:"exist"});dt.prototype.shallow_cmp=mkshallow({static:"eq"});gt.prototype.shallow_cmp=mkshallow({name:"eq"});vt.prototype.shallow_cmp=pass_through;Ut.prototype.shallow_cmp=pass_through;zt.prototype.shallow_cmp=pass_through;Gt.prototype.shallow_cmp=mkshallow({value:"eq"});Ht.prototype.shallow_cmp=mkshallow({value:"eq"});Xt.prototype.shallow_cmp=mkshallow({value:"eq"});Wt.prototype.shallow_cmp=function(e){return this.value.flags===e.value.flags&&this.value.source===e.value.source};qt.prototype.shallow_cmp=pass_through;const pn=1<<0;const dn=1<<1;let mn=null;let hn=null;class SymbolDef{constructor(e,t,n){this.name=t.name;this.orig=[t];this.init=n;this.eliminated=0;this.assignments=0;this.scope=e;this.replaced=0;this.global=false;this.export=0;this.mangled_name=null;this.undeclared=false;this.id=SymbolDef.next_id++;this.chained=false;this.direct_access=false;this.escaped=0;this.recursive_refs=0;this.references=[];this.should_replace=undefined;this.single_use=false;this.fixed=false;Object.seal(this)}fixed_value(){if(!this.fixed||this.fixed instanceof U)return this.fixed;return this.fixed()}unmangleable(e){if(!e)e={};if(mn&&mn.has(this.id)&&keep_name(e.keep_fnames,this.orig[0].name))return true;return this.global&&!e.toplevel||this.export&pn||this.undeclared||!e.eval&&this.scope.pinned()||(this.orig[0]instanceof Ft||this.orig[0]instanceof kt)&&keep_name(e.keep_fnames,this.orig[0].name)||this.orig[0]instanceof Ct||(this.orig[0]instanceof Mt||this.orig[0]instanceof Ot)&&keep_name(e.keep_classnames,this.orig[0].name)}mangle(e){const t=e.cache&&e.cache.props;if(this.global&&t&&t.has(this.name)){this.mangled_name=t.get(this.name)}else if(!this.mangled_name&&!this.unmangleable(e)){var n=this.scope;var r=this.orig[0];if(e.ie8&&r instanceof Ft)n=n.parent_scope;const i=redefined_catch_def(this);this.mangled_name=i?i.mangled_name||i.name:n.next_mangled(e,this);if(this.global&&t){t.set(this.name,this.mangled_name)}}}}SymbolDef.next_id=1;function redefined_catch_def(e){if(e.orig[0]instanceof xt&&e.scope.is_block_scope()){return e.scope.get_defun_scope().variables.get(e.name)}}ie.DEFMETHOD("figure_out_scope",(function(e,{parent_scope:t=null,toplevel:n=this}={}){e=defaults(e,{cache:null,ie8:false,safari10:false});if(!(n instanceof oe)){throw new Error("Invalid toplevel scope")}var r=this.parent_scope=t;var i=new Map;var o=null;var a=null;var s=[];var u=new TreeWalker(((t,n)=>{if(t.is_block_scope()){const i=r;t.block_scope=r=new ie(t);r._block_scope=true;const o=t instanceof Me?i.parent_scope:i;r.init_scope_vars(o);r.uses_with=i.uses_with;r.uses_eval=i.uses_eval;if(e.safari10){if(t instanceof ee||t instanceof te){s.push(r)}}if(t instanceof ke){const e=r;r=i;t.expression.walk(u);r=e;for(let e=0;e{if(e===t)return true;if(t instanceof St){return e instanceof Ft}return!(e instanceof At||e instanceof yt)}))){js_error(`"${t.name}" is redeclared`,t.start.file,t.start.line,t.start.col,t.start.pos)}if(!(t instanceof Tt))mark_export(d,2);if(o!==r){t.mark_enclosed();var d=r.find_variable(t);if(t.thedef!==d){t.thedef=d;t.reference()}}}else if(t instanceof Vt){var m=i.get(t.name);if(!m)throw new Error(string_template("Undefined label {name} [{line},{col}]",{name:t.name,line:t.start.line,col:t.start.col}));t.thedef=m}if(!(r instanceof oe)&&(t instanceof ze||t instanceof Ve)){js_error(`"${t.TYPE}" statement may only appear at the top level`,t.start.file,t.start.line,t.start.col,t.start.pos)}}));this.walk(u);function mark_export(e,t){if(a){var n=0;do{t++}while(u.parent(n++)!==a)}var r=u.parent(t);if(e.export=r instanceof ze?pn:0){var i=r.exported_definition;if((i instanceof fe||i instanceof ht)&&r.is_default){e.export=dn}}}const l=this instanceof oe;if(l){this.globals=new Map}var u=new TreeWalker((e=>{if(e instanceof De&&e.label){e.label.thedef.references.push(e);return true}if(e instanceof Pt){var t=e.name;if(t=="eval"&&u.parent()instanceof Ke){for(var r=e.scope;r&&!r.uses_eval;r=r.parent_scope){r.uses_eval=true}}var i;if(u.parent()instanceof Le&&u.parent(1).module_name||!(i=e.scope.find_variable(t))){i=n.def_global(e);if(e instanceof Bt)i.export=pn}else if(i.scope instanceof se&&t=="arguments"){i.scope.uses_arguments=true}e.thedef=i;e.reference();if(e.scope.is_block_scope()&&!(i.orig[0]instanceof St)){e.scope=e.scope.get_defun_scope()}return true}var o;if(e instanceof xt&&(o=redefined_catch_def(e.definition()))){var r=e.scope;while(r){push_uniq(r.enclosed,o);if(r===o.scope)break;r=r.parent_scope}}}));this.walk(u);if(e.ie8||e.safari10){walk(this,(e=>{if(e instanceof xt){var t=e.name;var r=e.thedef.references;var i=e.scope.get_defun_scope();var o=i.find_variable(t)||n.globals.get(t)||i.def_variable(e);r.forEach((function(e){e.thedef=o;e.reference()}));e.thedef=o;e.reference();return true}}))}if(e.safari10){for(const e of s){e.parent_scope.variables.forEach((function(t){push_uniq(e.enclosed,t)}))}}}));oe.DEFMETHOD("def_global",(function(e){var t=this.globals,n=e.name;if(t.has(n)){return t.get(n)}else{var r=new SymbolDef(this,e);r.undeclared=true;r.global=true;t.set(n,r);return r}}));ie.DEFMETHOD("init_scope_vars",(function(e){this.variables=new Map;this.uses_with=false;this.uses_eval=false;this.parent_scope=e;this.enclosed=[];this.cname=-1}));ie.DEFMETHOD("conflicting_def",(function(e){return this.enclosed.find((t=>t.name===e))||this.variables.has(e)||this.parent_scope&&this.parent_scope.conflicting_def(e)}));ie.DEFMETHOD("conflicting_def_shallow",(function(e){return this.enclosed.find((t=>t.name===e))||this.variables.has(e)}));ie.DEFMETHOD("add_child_scope",(function(e){if(e.parent_scope===this)return;e.parent_scope=this;const t=(()=>{const e=[];let t=this;do{e.push(t)}while(t=t.parent_scope);e.reverse();return e})();const n=new Set(e.enclosed);const r=[];for(const e of t){r.forEach((t=>push_uniq(e.enclosed,t)));for(const t of e.variables.values()){if(n.has(t)){push_uniq(r,t);push_uniq(e.enclosed,t)}}}}));function find_scopes_visible_from(e){const t=new Set;for(const n of new Set(e)){(function bubble_up(e){if(e==null||t.has(e))return;t.add(e);bubble_up(e.parent_scope)})(n)}return[...t]}ie.DEFMETHOD("create_symbol",(function(e,{source:t,tentative_name:n,scope:r,conflict_scopes:i=[r],init:o=null}={}){let a;i=find_scopes_visible_from(i);if(n){n=a=n.replace(/(?:^[^a-z_$]|[^a-z0-9_$])/gi,"_");let e=0;while(i.find((e=>e.conflicting_def_shallow(a)))){a=n+"$"+e++}}if(!a){throw new Error("No symbol name could be generated in create_symbol()")}const s=make_node(e,t,{name:a,scope:r});this.def_variable(s,o||null);s.mark_enclosed();return s}));U.DEFMETHOD("is_block_scope",return_false);pt.DEFMETHOD("is_block_scope",return_false);se.DEFMETHOD("is_block_scope",return_false);oe.DEFMETHOD("is_block_scope",return_false);Ce.DEFMETHOD("is_block_scope",return_false);X.DEFMETHOD("is_block_scope",return_true);ie.DEFMETHOD("is_block_scope",(function(){return this._block_scope||false}));$.DEFMETHOD("is_block_scope",return_true);se.DEFMETHOD("init_scope_vars",(function(){ie.prototype.init_scope_vars.apply(this,arguments);this.uses_arguments=false;this.def_variable(new Tt({name:"arguments",start:this.start,end:this.end}))}));ce.DEFMETHOD("init_scope_vars",(function(){ie.prototype.init_scope_vars.apply(this,arguments);this.uses_arguments=false}));gt.DEFMETHOD("mark_enclosed",(function(){var e=this.definition();var t=this.scope;while(t){push_uniq(t.enclosed,e);if(t===e.scope)break;t=t.parent_scope}}));gt.DEFMETHOD("reference",(function(){this.definition().references.push(this);this.mark_enclosed()}));ie.DEFMETHOD("find_variable",(function(e){if(e instanceof gt)e=e.name;return this.variables.get(e)||this.parent_scope&&this.parent_scope.find_variable(e)}));ie.DEFMETHOD("def_function",(function(e,t){var n=this.def_variable(e,t);if(!n.init||n.init instanceof fe)n.init=t;return n}));ie.DEFMETHOD("def_variable",(function(e,t){var n=this.variables.get(e.name);if(n){n.orig.push(e);if(n.init&&(n.scope!==e.scope||n.init instanceof le)){n.init=t}}else{n=new SymbolDef(this,e,t);this.variables.set(e.name,n);n.global=!this.parent_scope}return e.thedef=n}));function next_mangled(e,t){var n=e.enclosed;var r=t.nth_identifier;e:while(true){var i=r.get(++e.cname);if(_.has(i))continue;if(t.reserved.has(i))continue;if(hn&&hn.has(i))continue e;for(let e=n.length;--e>=0;){const r=n[e];const o=r.mangled_name||r.unmangleable(t)&&r.name;if(i==o)continue e}return i}}ie.DEFMETHOD("next_mangled",(function(e){return next_mangled(this,e)}));oe.DEFMETHOD("next_mangled",(function(e){let t;const n=this.mangled_names;do{t=next_mangled(this,e)}while(n.has(t));return t}));le.DEFMETHOD("next_mangled",(function(e,t){var n=t.orig[0]instanceof Tt&&this.name&&this.name.definition();var r=n?n.mangled_name||n.name:null;while(true){var i=next_mangled(this,e);if(!r||r!=i)return i}}));gt.DEFMETHOD("unmangleable",(function(e){var t=this.definition();return!t||t.unmangleable(e)}));It.DEFMETHOD("unmangleable",return_false);gt.DEFMETHOD("unreferenced",(function(){return!this.definition().references.length&&!this.scope.pinned()}));gt.DEFMETHOD("definition",(function(){return this.thedef}));gt.DEFMETHOD("global",(function(){return this.thedef.global}));oe.DEFMETHOD("_default_mangler_options",(function(e){e=defaults(e,{eval:false,nth_identifier:En,ie8:false,keep_classnames:false,keep_fnames:false,module:false,reserved:[],toplevel:false});if(e.module)e.toplevel=true;if(!Array.isArray(e.reserved)&&!(e.reserved instanceof Set)){e.reserved=[]}e.reserved=new Set(e.reserved);e.reserved.add("arguments");return e}));oe.DEFMETHOD("mangle_names",(function(e){e=this._default_mangler_options(e);var t=e.nth_identifier;var n=-1;var r=[];if(e.keep_fnames){mn=new Set}const i=this.mangled_names=new Set;hn=new Set;if(e.cache){this.globals.forEach(collect);if(e.cache.props){e.cache.props.forEach((function(e){i.add(e)}))}}var o=new TreeWalker((function(i,o){if(i instanceof j){var a=n;o();n=a;return true}if(i instanceof ie){i.variables.forEach(collect);return}if(i.is_block_scope()){i.block_scope.variables.forEach(collect);return}if(mn&&i instanceof Be&&i.value instanceof se&&!i.value.name&&keep_name(e.keep_fnames,i.name.name)){mn.add(i.name.definition().id);return}if(i instanceof It){let e;do{e=t.get(++n)}while(_.has(e));i.mangled_name=e;return true}if(!(e.ie8||e.safari10)&&i instanceof xt){r.push(i.definition());return}}));this.walk(o);if(e.keep_fnames||e.keep_classnames){r.forEach((t=>{if(t.name.length<6&&t.unmangleable(e)){hn.add(t.name)}}))}r.forEach((t=>{t.mangle(e)}));mn=null;hn=null;function collect(t){if(t.export&pn){hn.add(t.name)}else if(!e.reserved.has(t.name)){r.push(t)}}}));oe.DEFMETHOD("find_colliding_names",(function(e){const t=e.cache&&e.cache.props;const n=new Set;e.reserved.forEach(to_avoid);this.globals.forEach(add_def);this.walk(new TreeWalker((function(e){if(e instanceof ie)e.variables.forEach(add_def);if(e instanceof xt)add_def(e.definition())})));return n;function to_avoid(e){n.add(e)}function add_def(n){var r=n.name;if(n.global&&t&&t.has(r))r=t.get(r);else if(!n.unmangleable(e))return;to_avoid(r)}}));oe.DEFMETHOD("expand_names",(function(e){e=this._default_mangler_options(e);var t=e.nth_identifier;if(t.reset&&t.sort){t.reset();t.sort()}var n=this.find_colliding_names(e);var r=0;this.globals.forEach(rename);this.walk(new TreeWalker((function(e){if(e instanceof ie)e.variables.forEach(rename);if(e instanceof xt)rename(e.definition())})));function next_name(){var e;do{e=t.get(r++)}while(n.has(e)||_.has(e));return e}function rename(t){if(t.global&&e.cache)return;if(t.unmangleable(e))return;if(e.reserved.has(t.name))return;const n=redefined_catch_def(t);const r=t.name=n?n.name:next_name();t.orig.forEach((function(e){e.name=r}));t.references.forEach((function(e){e.name=r}))}}));U.DEFMETHOD("tail_node",return_this);He.DEFMETHOD("tail_node",(function(){return this.expressions[this.expressions.length-1]}));oe.DEFMETHOD("compute_char_frequency",(function(e){e=this._default_mangler_options(e);var t=e.nth_identifier;if(!t.reset||!t.consider||!t.sort){return}t.reset();try{U.prototype.print=function(n,r){this._print(n,r);if(this instanceof gt&&!this.unmangleable(e)){t.consider(this.name,-1)}else if(e.properties){if(this instanceof qe){t.consider("#"+this.property,-1)}else if(this instanceof We){t.consider(this.property,-1)}else if(this instanceof Ye){skip_string(this.property)}}};t.consider(this.print_to_string(),1)}finally{U.prototype.print=U.prototype._print}t.sort();function skip_string(e){if(e instanceof Gt){t.consider(e.value,-1)}else if(e instanceof et){skip_string(e.consequent);skip_string(e.alternative)}else if(e instanceof He){skip_string(e.tail_node())}}}));const En=(()=>{const e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_".split("");const t="0123456789".split("");let n;let r;function reset(){r=new Map;e.forEach((function(e){r.set(e,0)}));t.forEach((function(e){r.set(e,0)}))}function consider(e,t){for(var n=e.length;--n>=0;){r.set(e[n],r.get(e[n])+t)}}function compare(e,t){return r.get(t)-r.get(e)}function sort(){n=mergeSort(e,compare).concat(mergeSort(t,compare))}reset();sort();function base54(e){var t="",r=54;e++;do{e--;t+=n[e%r];e=Math.floor(e/r);r=64}while(e>0);return t}return{get:base54,consider:consider,reset:reset,sort:sort}})();let gn=undefined;U.prototype.size=function(e,t){gn=e&&e.mangle_options;let n=0;walk_parent(this,((e,t)=>{n+=e._size(t);if(e instanceof ce&&e.is_braceless()){n+=e.body[0].value._size(t);return true}}),t||e&&e.stack);gn=undefined;return n};U.prototype._size=()=>0;K.prototype._size=()=>8;G.prototype._size=function(){return 2+this.value.length};const list_overhead=e=>e.length&&e.length-1;X.prototype._size=function(){return 2+list_overhead(this.body)};oe.prototype._size=function(){return list_overhead(this.body)};q.prototype._size=()=>1;j.prototype._size=()=>2;Q.prototype._size=()=>9;J.prototype._size=()=>7;ee.prototype._size=()=>8;te.prototype._size=()=>8;re.prototype._size=()=>6;ae.prototype._size=()=>3;const lambda_modifiers=e=>(e.is_generator?1:0)+(e.async?6:0);ue.prototype._size=function(){return lambda_modifiers(this)+4+list_overhead(this.argnames)+list_overhead(this.body)};le.prototype._size=function(e){const t=!!first_in_statement(e);return t*2+lambda_modifiers(this)+12+list_overhead(this.argnames)+list_overhead(this.body)};fe.prototype._size=function(){return lambda_modifiers(this)+13+list_overhead(this.argnames)+list_overhead(this.body)};ce.prototype._size=function(){let e=2+list_overhead(this.argnames);if(!(this.argnames.length===1&&this.argnames[0]instanceof gt)){e+=2}const t=this.is_braceless()?0:list_overhead(this.body)+2;return lambda_modifiers(this)+e+t};_e.prototype._size=()=>2;de.prototype._size=function(){return 2+Math.floor(this.segments.length/2)*3};me.prototype._size=function(){return this.value.length};ge.prototype._size=function(){return this.value?7:6};ve.prototype._size=()=>6;be.prototype._size=function(){return this.label?6:5};Se.prototype._size=function(){return this.label?9:8};Te.prototype._size=()=>4;ke.prototype._size=function(){return 8+list_overhead(this.body)};Fe.prototype._size=function(){return 5+list_overhead(this.body)};Re.prototype._size=function(){return 8+list_overhead(this.body)};Oe.prototype._size=function(){return 3+list_overhead(this.body)};Me.prototype._size=function(){let e=7+list_overhead(this.body);if(this.argname){e+=2}return e};xe.prototype._size=function(){return 7+list_overhead(this.body)};const def_size=(e,t)=>e+list_overhead(t.definitions);we.prototype._size=function(){return def_size(4,this)};Ie.prototype._size=function(){return def_size(4,this)};Pe.prototype._size=function(){return def_size(6,this)};Be.prototype._size=function(){return this.value?1:0};Le.prototype._size=function(){return this.name?4:0};Ve.prototype._size=function(){let e=6;if(this.imported_name)e+=1;if(this.imported_name||this.imported_names)e+=5;if(this.imported_names){e+=2+list_overhead(this.imported_names)}return e};Ue.prototype._size=()=>11;ze.prototype._size=function(){let e=7+(this.is_default?8:0);if(this.exported_value){e+=this.exported_value._size()}if(this.exported_names){e+=2+list_overhead(this.exported_names)}if(this.module_name){e+=5}return e};Ke.prototype._size=function(){if(this.optional){return 4+list_overhead(this.args)}return 2+list_overhead(this.args)};Ge.prototype._size=function(){return 6+list_overhead(this.args)};He.prototype._size=function(){return list_overhead(this.expressions)};We.prototype._size=function(){if(this.optional){return this.property.length+2}return this.property.length+1};qe.prototype._size=function(){if(this.optional){return this.property.length+3}return this.property.length+2};Ye.prototype._size=function(){return this.optional?4:2};$e.prototype._size=function(){if(this.operator==="typeof")return 7;if(this.operator==="void")return 5;return this.operator.length};Je.prototype._size=function(e){if(this.operator==="in")return 4;let t=this.operator.length;if((this.operator==="+"||this.operator==="-")&&this.right instanceof $e&&this.right.operator===this.operator){t+=1}if(this.needs_parens(e)){t+=2}return t};et.prototype._size=()=>3;rt.prototype._size=function(){return 2+list_overhead(this.elements)};it.prototype._size=function(e){let t=2;if(first_in_statement(e)){t+=2}return t+list_overhead(this.properties)};const key_size=e=>typeof e==="string"?e.length:0;at.prototype._size=function(){return key_size(this.key)+1};const static_size=e=>e?7:0;ct.prototype._size=function(){return 5+static_size(this.static)+key_size(this.key)};lt.prototype._size=function(){return 5+static_size(this.static)+key_size(this.key)};ft.prototype._size=function(){return static_size(this.static)+key_size(this.key)+lambda_modifiers(this)};_t.prototype._size=function(){return ft.prototype._size.call(this)+1};ut.prototype._size=st.prototype._size=function(){return ft.prototype._size.call(this)+4};pt.prototype._size=function(){return(this.name?8:7)+(this.extends?8:0)};dt.prototype._size=function(){return static_size(this.static)+(typeof this.key==="string"?this.key.length+2:0)+(this.value?1:0)};mt.prototype._size=function(){return dt.prototype._size.call(this)+1};gt.prototype._size=function(){return!gn||this.definition().unmangleable(gn)?this.name.length:1};Rt.prototype._size=function(){return this.name.length};Pt.prototype._size=Dt.prototype._size=function(){const{name:e,thedef:t}=this;if(t&&t.global)return e.length;if(e==="arguments")return 9;return gt.prototype._size.call(this)};vt.prototype._size=()=>10;wt.prototype._size=function(){return this.name.length};Lt.prototype._size=function(){return this.name.length};Ut.prototype._size=()=>4;zt.prototype._size=()=>5;Gt.prototype._size=function(){return this.value.length+2};Ht.prototype._size=function(){const{value:e}=this;if(e===0)return 1;if(e>0&&Math.floor(e)===e){return Math.floor(Math.log10(e)+1)}return e.toString().length};Xt.prototype._size=function(){return this.value.length};Wt.prototype._size=function(){return this.value.toString().length};Yt.prototype._size=()=>4;jt.prototype._size=()=>3;$t.prototype._size=()=>6;Zt.prototype._size=()=>0;Qt.prototype._size=()=>8;tn.prototype._size=()=>4;en.prototype._size=()=>5;ye.prototype._size=()=>6;Ae.prototype._size=()=>6;function merge_sequence(e,t){if(t instanceof He){e.push(...t.expressions)}else{e.push(t)}return e}function make_sequence(e,t){if(t.length==1)return t[0];if(t.length==0)throw new Error("trying to create a sequence with length zero!");return make_node(He,e,{expressions:t.reduce(merge_sequence,[])})}function make_node_from_constant(e,t){switch(typeof e){case"string":return make_node(Gt,t,{value:e});case"number":if(isNaN(e))return make_node(jt,t);if(isFinite(e)){return 1/e<0?make_node(Ze,t,{operator:"-",expression:make_node(Ht,t,{value:-e})}):make_node(Ht,t,{value:e})}return e<0?make_node(Ze,t,{operator:"-",expression:make_node(Qt,t)}):make_node(Qt,t);case"boolean":return make_node(e?tn:en,t);case"undefined":return make_node($t,t);default:if(e===null){return make_node(Yt,t,{value:null})}if(e instanceof RegExp){return make_node(Wt,t,{value:{source:regexp_source_fix(e.source),flags:e.flags}})}throw new Error(string_template("Can't handle constant of type: {type}",{type:typeof e}))}}function best_of_expression(e,t){return e.size()>t.size()?t:e}function best_of_statement(e,t){return best_of_expression(make_node(H,e,{body:e}),make_node(H,t,{body:t})).body}function best_of(e,t,n){if(first_in_statement(e)){return best_of_statement(t,n)}else{return best_of_expression(t,n)}}function get_simple_key(e){if(e instanceof Kt){return e.getValue()}if(e instanceof Ze&&e.operator=="void"&&e.expression instanceof Kt){return}return e}function read_property(e,t){t=get_simple_key(t);if(t instanceof U)return;var n;if(e instanceof rt){var r=e.elements;if(t=="length")return make_node_from_constant(r.length,e);if(typeof t=="number"&&t in r)n=r[t]}else if(e instanceof it){t=""+t;var i=e.properties;for(var o=i.length;--o>=0;){var a=i[o];if(!(a instanceof at))return;if(!n&&i[o].key===t)n=i[o].value}}return n instanceof Pt&&n.fixed_value()||n}function has_break_or_continue(e,t){var n=false;var r=new TreeWalker((function(t){if(n||t instanceof ie)return true;if(t instanceof De&&r.loopcontrol_target(t)===e){return n=true}}));if(t instanceof j)r.push(t);r.push(e);e.body.walk(r);return n}function maintain_this_binding(e,t,n){if(e instanceof Ze&&e.operator=="delete"||e instanceof Ke&&e.expression===t&&(n instanceof Xe||n instanceof Pt&&n.name=="eval")){const e=make_node(Ht,t,{value:0});return make_sequence(t,[e,n])}else{return n}}function is_func_expr(e){return e instanceof ce||e instanceof le}function is_iife_call(e){if(e.TYPE!="Call")return false;return e.expression instanceof le||is_iife_call(e.expression)}const vn=makePredicate("Infinity NaN undefined");function is_identifier_atom(e){return e instanceof Qt||e instanceof jt||e instanceof $t}function is_ref_of(e,t){if(!(e instanceof Pt))return false;var n=e.definition().orig;for(var r=n.length;--r>=0;){if(n[r]instanceof t)return true}}function can_be_evicted_from_block(e){return!(e instanceof ht||e instanceof fe||e instanceof Ie||e instanceof Pe||e instanceof ze||e instanceof Ve)}function as_statement_array(e){if(e===null)return[];if(e instanceof W)return e.body;if(e instanceof q)return[];if(e instanceof z)return[e];throw new Error("Can't convert thing to statement array")}function is_recursive_ref(e,t){var n;for(var r=0;n=e.parent(r);r++){if(n instanceof se||n instanceof pt){var i=n.name;if(i&&i.definition()===t){return true}}}return false}const Dn=1;const bn=2;const Sn=4;const yn=8;const An=16;const Tn=32;const kn=256;const Cn=512;const Rn=1024;const Fn=kn|Cn|Rn;const has_flag=(e,t)=>e.flags&t;const set_flag=(e,t)=>{e.flags|=t};const clear_flag=(e,t)=>{e.flags&=~t};function make_nested_lookup(e){const t=new Map;for(var n of Object.keys(e)){t.set(n,makePredicate(e[n]))}const does_have=(e,n)=>{const r=t.get(e);return r!=null&&r.has(n)};return does_have}const On=new Set(["Number","String","Array","Object","Function","Promise"]);const Mn=["constructor","toString","valueOf"];const xn=make_nested_lookup({Array:["indexOf","join","lastIndexOf","slice",...Mn],Boolean:Mn,Function:Mn,Number:["toExponential","toFixed","toPrecision",...Mn],Object:Mn,RegExp:["test",...Mn],String:["charAt","charCodeAt","concat","indexOf","italics","lastIndexOf","match","replace","search","slice","split","substr","substring","toLowerCase","toUpperCase","trim",...Mn]});const Nn=make_nested_lookup({Array:["isArray"],Math:["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan","atan2","pow","max","min"],Number:["isFinite","isNaN"],Object:["create","getOwnPropertyDescriptor","getOwnPropertyNames","getPrototypeOf","isExtensible","isFrozen","isSealed","hasOwn","keys"],String:["fromCharCode"]});const wn=make_nested_lookup({Math:["E","LN10","LN2","LOG2E","LOG10E","PI","SQRT1_2","SQRT2"],Number:["MAX_VALUE","MIN_VALUE","NaN","NEGATIVE_INFINITY","POSITIVE_INFINITY"]});const is_undeclared_ref=e=>e instanceof Pt&&e.definition().undeclared;const In=makePredicate("&& || ??");const Pn=makePredicate("delete ++ --");(function(e){const t=makePredicate("! delete");const n=makePredicate("in instanceof == != === !== < <= >= >");e(U,return_false);e(Ze,(function(){return t.has(this.operator)}));e(Je,(function(){return n.has(this.operator)||In.has(this.operator)&&this.left.is_boolean()&&this.right.is_boolean()}));e(et,(function(){return this.consequent.is_boolean()&&this.alternative.is_boolean()}));e(tt,(function(){return this.operator=="="&&this.right.is_boolean()}));e(He,(function(){return this.tail_node().is_boolean()}));e(tn,return_true);e(en,return_true)})((function(e,t){e.DEFMETHOD("is_boolean",t)}));(function(e){e(U,return_false);e(Ht,return_true);const t=makePredicate("+ - ~ ++ --");e($e,(function(){return t.has(this.operator)}));const n=makePredicate("- * / % & | ^ << >> >>>");e(Je,(function(e){return n.has(this.operator)||this.operator=="+"&&this.left.is_number(e)&&this.right.is_number(e)}));e(tt,(function(e){return n.has(this.operator.slice(0,-1))||this.operator=="="&&this.right.is_number(e)}));e(He,(function(e){return this.tail_node().is_number(e)}));e(et,(function(e){return this.consequent.is_number(e)&&this.alternative.is_number(e)}))})((function(e,t){e.DEFMETHOD("is_number",t)}));(function(e){e(U,return_false);e(Gt,return_true);e(de,return_true);e(Ze,(function(){return this.operator=="typeof"}));e(Je,(function(e){return this.operator=="+"&&(this.left.is_string(e)||this.right.is_string(e))}));e(tt,(function(e){return(this.operator=="="||this.operator=="+=")&&this.right.is_string(e)}));e(He,(function(e){return this.tail_node().is_string(e)}));e(et,(function(e){return this.consequent.is_string(e)&&this.alternative.is_string(e)}))})((function(e,t){e.DEFMETHOD("is_string",t)}));function is_undefined(e,t){return has_flag(e,yn)||e instanceof $t||e instanceof Ze&&e.operator=="void"&&!e.expression.has_side_effects(t)}function is_null_or_undefined(e,t){let n;return e instanceof Yt||is_undefined(e,t)||e instanceof Pt&&(n=e.definition().fixed)instanceof U&&is_nullish(n,t)}function is_nullish_shortcircuited(e,t){if(e instanceof Xe||e instanceof Ke){return e.optional&&is_null_or_undefined(e.expression,t)||is_nullish_shortcircuited(e.expression,t)}if(e instanceof je)return is_nullish_shortcircuited(e.expression,t);return false}function is_nullish(e,t){if(is_null_or_undefined(e,t))return true;return is_nullish_shortcircuited(e,t)}(function(e){e(U,return_true);e(q,return_false);e(Kt,return_false);e(Ut,return_false);function any(e,t){for(var n=e.length;--n>=0;)if(e[n].has_side_effects(t))return true;return false}e(X,(function(e){return any(this.body,e)}));e(Ke,(function(e){if(!this.is_callee_pure(e)&&(!this.expression.is_call_pure(e)||this.expression.has_side_effects(e))){return true}return any(this.args,e)}));e(ke,(function(e){return this.expression.has_side_effects(e)||any(this.body,e)}));e(Fe,(function(e){return this.expression.has_side_effects(e)||any(this.body,e)}));e(Oe,(function(e){return any(this.body,e)||this.bcatch&&this.bcatch.has_side_effects(e)||this.bfinally&&this.bfinally.has_side_effects(e)}));e(Te,(function(e){return this.condition.has_side_effects(e)||this.body&&this.body.has_side_effects(e)||this.alternative&&this.alternative.has_side_effects(e)}));e(j,(function(e){return this.body.has_side_effects(e)}));e(H,(function(e){return this.body.has_side_effects(e)}));e(se,return_false);e(pt,(function(e){if(this.extends&&this.extends.has_side_effects(e)){return true}return any(this.properties,e)}));e(Je,(function(e){return this.left.has_side_effects(e)||this.right.has_side_effects(e)}));e(tt,return_true);e(et,(function(e){return this.condition.has_side_effects(e)||this.consequent.has_side_effects(e)||this.alternative.has_side_effects(e)}));e($e,(function(e){return Pn.has(this.operator)||this.expression.has_side_effects(e)}));e(Pt,(function(e){return!this.is_declared(e)&&!On.has(this.name)}));e(Rt,return_false);e(Dt,return_false);e(it,(function(e){return any(this.properties,e)}));e(ot,(function(e){return this.computed_key()&&this.key.has_side_effects(e)||this.value&&this.value.has_side_effects(e)}));e(dt,(function(e){return this.computed_key()&&this.key.has_side_effects(e)||this.static&&this.value&&this.value.has_side_effects(e)}));e(ft,(function(e){return this.computed_key()&&this.key.has_side_effects(e)}));e(ct,(function(e){return this.computed_key()&&this.key.has_side_effects(e)}));e(lt,(function(e){return this.computed_key()&&this.key.has_side_effects(e)}));e(rt,(function(e){return any(this.elements,e)}));e(We,(function(e){if(is_nullish(this,e))return false;return!this.optional&&this.expression.may_throw_on_access(e)||this.expression.has_side_effects(e)}));e(Ye,(function(e){if(is_nullish(this,e))return false;return!this.optional&&this.expression.may_throw_on_access(e)||this.expression.has_side_effects(e)||this.property.has_side_effects(e)}));e(je,(function(e){return this.expression.has_side_effects(e)}));e(He,(function(e){return any(this.expressions,e)}));e(Ne,(function(e){return any(this.definitions,e)}));e(Be,(function(){return this.value}));e(me,return_false);e(de,(function(e){return any(this.segments,e)}))})((function(e,t){e.DEFMETHOD("has_side_effects",t)}));(function(e){e(U,return_true);e(Kt,return_false);e(q,return_false);e(se,return_false);e(Dt,return_false);e(Ut,return_false);function any(e,t){for(var n=e.length;--n>=0;)if(e[n].may_throw(t))return true;return false}e(pt,(function(e){if(this.extends&&this.extends.may_throw(e))return true;return any(this.properties,e)}));e(rt,(function(e){return any(this.elements,e)}));e(tt,(function(e){if(this.right.may_throw(e))return true;if(!e.has_directive("use strict")&&this.operator=="="&&this.left instanceof Pt){return false}return this.left.may_throw(e)}));e(Je,(function(e){return this.left.may_throw(e)||this.right.may_throw(e)}));e(X,(function(e){return any(this.body,e)}));e(Ke,(function(e){if(is_nullish(this,e))return false;if(any(this.args,e))return true;if(this.is_callee_pure(e))return false;if(this.expression.may_throw(e))return true;return!(this.expression instanceof se)||any(this.expression.body,e)}));e(Fe,(function(e){return this.expression.may_throw(e)||any(this.body,e)}));e(et,(function(e){return this.condition.may_throw(e)||this.consequent.may_throw(e)||this.alternative.may_throw(e)}));e(Ne,(function(e){return any(this.definitions,e)}));e(Te,(function(e){return this.condition.may_throw(e)||this.body&&this.body.may_throw(e)||this.alternative&&this.alternative.may_throw(e)}));e(j,(function(e){return this.body.may_throw(e)}));e(it,(function(e){return any(this.properties,e)}));e(ot,(function(e){return this.value?this.value.may_throw(e):false}));e(dt,(function(e){return this.computed_key()&&this.key.may_throw(e)||this.static&&this.value&&this.value.may_throw(e)}));e(ft,(function(e){return this.computed_key()&&this.key.may_throw(e)}));e(ct,(function(e){return this.computed_key()&&this.key.may_throw(e)}));e(lt,(function(e){return this.computed_key()&&this.key.may_throw(e)}));e(ge,(function(e){return this.value&&this.value.may_throw(e)}));e(He,(function(e){return any(this.expressions,e)}));e(H,(function(e){return this.body.may_throw(e)}));e(We,(function(e){if(is_nullish(this,e))return false;return!this.optional&&this.expression.may_throw_on_access(e)||this.expression.may_throw(e)}));e(Ye,(function(e){if(is_nullish(this,e))return false;return!this.optional&&this.expression.may_throw_on_access(e)||this.expression.may_throw(e)||this.property.may_throw(e)}));e(je,(function(e){return this.expression.may_throw(e)}));e(ke,(function(e){return this.expression.may_throw(e)||any(this.body,e)}));e(Pt,(function(e){return!this.is_declared(e)&&!On.has(this.name)}));e(Rt,return_false);e(Oe,(function(e){return this.bcatch?this.bcatch.may_throw(e):any(this.body,e)||this.bfinally&&this.bfinally.may_throw(e)}));e($e,(function(e){if(this.operator=="typeof"&&this.expression instanceof Pt)return false;return this.expression.may_throw(e)}));e(Be,(function(e){if(!this.value)return false;return this.value.may_throw(e)}))})((function(e,t){e.DEFMETHOD("may_throw",t)}));(function(e){function all_refs_local(e){let t=true;walk(this,(n=>{if(n instanceof Pt){if(has_flag(this,An)){t=false;return nn}var r=n.definition();if(member(r,this.enclosed)&&!this.variables.has(r.name)){if(e){var i=e.find_variable(n);if(r.undeclared?!i:i===r){t="f";return true}}t=false;return nn}return true}if(n instanceof Ut&&this instanceof ce){t=false;return nn}}));return t}e(U,return_false);e(Kt,return_true);e(pt,(function(e){if(this.extends&&!this.extends.is_constant_expression(e)){return false}for(const t of this.properties){if(t.computed_key()&&!t.key.is_constant_expression(e)){return false}if(t.static&&t.value&&!t.value.is_constant_expression(e)){return false}}return all_refs_local.call(this,e)}));e(se,all_refs_local);e($e,(function(){return this.expression.is_constant_expression()}));e(Je,(function(){return this.left.is_constant_expression()&&this.right.is_constant_expression()}));e(rt,(function(){return this.elements.every((e=>e.is_constant_expression()))}));e(it,(function(){return this.properties.every((e=>e.is_constant_expression()))}));e(ot,(function(){return!!(!(this.key instanceof U)&&this.value&&this.value.is_constant_expression())}))})((function(e,t){e.DEFMETHOD("is_constant_expression",t)}));(function(e){U.DEFMETHOD("may_throw_on_access",(function(e){return!e.option("pure_getters")||this._dot_throw(e)}));function is_strict(e){return/strict/.test(e.option("pure_getters"))}e(U,is_strict);e(Yt,return_true);e($t,return_true);e(Kt,return_false);e(rt,return_false);e(it,(function(e){if(!is_strict(e))return false;for(var t=this.properties.length;--t>=0;)if(this.properties[t]._dot_throw(e))return true;return false}));e(pt,return_false);e(ot,return_false);e(ct,return_true);e(ae,(function(e){return this.expression._dot_throw(e)}));e(le,return_false);e(ce,return_false);e(Qe,return_false);e(Ze,(function(){return this.operator=="void"}));e(Je,(function(e){return(this.operator=="&&"||this.operator=="||"||this.operator=="??")&&(this.left._dot_throw(e)||this.right._dot_throw(e))}));e(tt,(function(e){if(this.logical)return true;return this.operator=="="&&this.right._dot_throw(e)}));e(et,(function(e){return this.consequent._dot_throw(e)||this.alternative._dot_throw(e)}));e(We,(function(e){if(!is_strict(e))return false;if(this.property=="prototype"){return!(this.expression instanceof le||this.expression instanceof pt)}return true}));e(je,(function(e){return this.expression._dot_throw(e)}));e(He,(function(e){return this.tail_node()._dot_throw(e)}));e(Pt,(function(e){if(this.name==="arguments")return false;if(has_flag(this,yn))return true;if(!is_strict(e))return false;if(is_undeclared_ref(this)&&this.is_declared(e))return false;if(this.is_immutable())return false;var t=this.fixed_value();return!t||t._dot_throw(e)}))})((function(e,t){e.DEFMETHOD("_dot_throw",t)}));function is_lhs(e,t){if(t instanceof $e&&Pn.has(t.operator))return t.expression;if(t instanceof tt&&t.left===e)return e}(function(e){function to_node(e,t){if(e instanceof U){if(!(e instanceof Kt)){e=e.clone(true)}return make_node(e.CTOR,t,e)}if(Array.isArray(e))return make_node(rt,t,{elements:e.map((function(e){return to_node(e,t)}))});if(e&&typeof e=="object"){var n=[];for(var r in e)if(HOP(e,r)){n.push(make_node(at,t,{key:r,value:to_node(e[r],t)}))}return make_node(it,t,{properties:n})}return make_node_from_constant(e,t)}oe.DEFMETHOD("resolve_defines",(function(e){if(!e.option("global_defs"))return this;this.figure_out_scope({ie8:e.option("ie8")});return this.transform(new TreeTransformer((function(t){var n=t._find_defs(e,"");if(!n)return;var r=0,i=t,o;while(o=this.parent(r++)){if(!(o instanceof Xe))break;if(o.expression!==i)break;i=o}if(is_lhs(i,o)){return}return n})))}));e(U,noop);e(je,(function(e,t){return this.expression._find_defs(e,t)}));e(We,(function(e,t){return this.expression._find_defs(e,"."+this.property+t)}));e(Dt,(function(){if(!this.global())return}));e(Pt,(function(e,t){if(!this.global())return;var n=e.option("global_defs");var r=this.name+t;if(HOP(n,r))return to_node(n[r],this)}))})((function(e,t){e.DEFMETHOD("_find_defs",t)}));(function(e){function basic_negation(e){return make_node(Ze,e,{operator:"!",expression:e})}function best(e,t,n){var r=basic_negation(e);if(n){var i=make_node(H,t,{body:t});return best_of_expression(r,i)===i?t:r}return best_of_expression(r,t)}e(U,(function(){return basic_negation(this)}));e(z,(function(){throw new Error("Cannot negate a statement")}));e(le,(function(){return basic_negation(this)}));e(ce,(function(){return basic_negation(this)}));e(Ze,(function(){if(this.operator=="!")return this.expression;return basic_negation(this)}));e(He,(function(e){var t=this.expressions.slice();t.push(t.pop().negate(e));return make_sequence(this,t)}));e(et,(function(e,t){var n=this.clone();n.consequent=n.consequent.negate(e);n.alternative=n.alternative.negate(e);return best(this,n,t)}));e(Je,(function(e,t){var n=this.clone(),r=this.operator;if(e.option("unsafe_comps")){switch(r){case"<=":n.operator=">";return n;case"<":n.operator=">=";return n;case">=":n.operator="<";return n;case">":n.operator="<=";return n}}switch(r){case"==":n.operator="!=";return n;case"!=":n.operator="==";return n;case"===":n.operator="!==";return n;case"!==":n.operator="===";return n;case"&&":n.operator="||";n.left=n.left.negate(e,t);n.right=n.right.negate(e);return best(this,n,t);case"||":n.operator="&&";n.left=n.left.negate(e,t);n.right=n.right.negate(e);return best(this,n,t)}return basic_negation(this)}))})((function(e,t){e.DEFMETHOD("negate",(function(e,n){return t.call(this,e,n)}))}));var Bn=makePredicate("Boolean decodeURI decodeURIComponent Date encodeURI encodeURIComponent Error escape EvalError isFinite isNaN Number Object parseFloat parseInt RangeError ReferenceError String SyntaxError TypeError unescape URIError");Ke.DEFMETHOD("is_callee_pure",(function(e){if(e.option("unsafe")){var t=this.expression;var n=this.args&&this.args[0]&&this.args[0].evaluate(e);if(t.expression&&t.expression.name==="hasOwnProperty"&&(n==null||n.thedef&&n.thedef.undeclared)){return false}if(is_undeclared_ref(t)&&Bn.has(t.name))return true;if(t instanceof We&&is_undeclared_ref(t.expression)&&Nn(t.expression.name,t.property)){return true}}return!!has_annotation(this,rn)||!e.pure_funcs(this)}));U.DEFMETHOD("is_call_pure",return_false);We.DEFMETHOD("is_call_pure",(function(e){if(!e.option("unsafe"))return;const t=this.expression;let n;if(t instanceof rt){n="Array"}else if(t.is_boolean()){n="Boolean"}else if(t.is_number(e)){n="Number"}else if(t instanceof Wt){n="RegExp"}else if(t.is_string(e)){n="String"}else if(!this.may_throw_on_access(e)){n="Object"}return n!=null&&xn(n,this.property)}));const aborts=e=>e&&e.aborts();(function(e){e(z,return_null);e(he,return_this);function block_aborts(){for(var e=0;ethis.print_to_string();return fn}return this}));def_eval(rt,(function(e,t){if(e.option("unsafe")){var n=[];for(var r=0,i=this.elements.length;rtypeof e==="object"||typeof e==="function"||typeof e==="symbol";def_eval(Je,(function(e,t){if(!zn.has(this.operator))t++;var n=this.left._eval(e,t);if(n===this.left)return this;var r=this.right._eval(e,t);if(r===this.right)return this;var i;if(n!=null&&r!=null&&Kn.has(this.operator)&&has_identity(n)&&has_identity(r)&&typeof n===typeof r){return this}switch(this.operator){case"&&":i=n&&r;break;case"||":i=n||r;break;case"??":i=n!=null?n:r;break;case"|":i=n|r;break;case"&":i=n&r;break;case"^":i=n^r;break;case"+":i=n+r;break;case"*":i=n*r;break;case"**":i=Math.pow(n,r);break;case"/":i=n/r;break;case"%":i=n%r;break;case"-":i=n-r;break;case"<<":i=n<>":i=n>>r;break;case">>>":i=n>>>r;break;case"==":i=n==r;break;case"===":i=n===r;break;case"!=":i=n!=r;break;case"!==":i=n!==r;break;case"<":i=n":i=n>r;break;case">=":i=n>=r;break;default:return this}if(isNaN(i)&&e.find_parent(re)){return this}return i}));def_eval(et,(function(e,t){var n=this.condition._eval(e,t);if(n===this.condition)return this;var r=n?this.consequent:this.alternative;var i=r._eval(e,t);return i===r?this:i}));const Gn=new Set;def_eval(Pt,(function(e,t){if(Gn.has(this))return this;var n=this.fixed_value();if(!n)return this;Gn.add(this);const r=n._eval(e,t);Gn.delete(this);if(r===n)return this;if(r&&typeof r=="object"){var i=this.definition().escaped;if(i&&t>i)return this}return r}));const Hn={Array:Array,Math:Math,Number:Number,Object:Object,String:String};const Xn=new Set(["dotAll","global","ignoreCase","multiline","sticky","unicode"]);def_eval(Xe,(function(e,t){const n=this.expression._eval(e,t);if(n===Ln||this.optional&&n==null)return Ln;if(e.option("unsafe")){var r=this.property;if(r instanceof U){r=r._eval(e,t);if(r===this.property)return this}var i=this.expression;var o;if(is_undeclared_ref(i)){var a;var s=i.name==="hasOwnProperty"&&r==="call"&&(a=e.parent()&&e.parent().args)&&(a&&a[0]&&a[0].evaluate(e));s=s instanceof We?s.expression:s;if(s==null||s.thedef&&s.thedef.undeclared){return this.clone()}if(!wn(i.name,r))return this;o=Hn[i.name]}else{o=i._eval(e,t+1);if(o instanceof RegExp){if(r=="source"){return regexp_source_fix(o.source)}else if(r=="flags"||Xn.has(r)){return o[r]}}if(!o||o===i||!HOP(o,r))return this;if(typeof o=="function")switch(r){case"name":return o.node.name?o.node.name.name:"";case"length":return o.node.length_property();default:return this}}return o[r]}return this}));def_eval(je,(function(e,t){const n=this.expression._eval(e,t);return n===Ln?undefined:n===this.expression?this:n}));def_eval(Ke,(function(e,t){var n=this.expression;const r=n._eval(e,t);if(r===Ln||this.optional&&r==null)return Ln;if(e.option("unsafe")&&n instanceof Xe){var i=n.property;if(i instanceof U){i=i._eval(e,t);if(i===n.property)return this}var o;var a=n.expression;if(is_undeclared_ref(a)){var s=a.name==="hasOwnProperty"&&i==="call"&&(this.args[0]&&this.args[0].evaluate(e));s=s instanceof We?s.expression:s;if(s==null||s.thedef&&s.thedef.undeclared){return this.clone()}if(!Nn(a.name,i))return this;o=Hn[a.name]}else{o=a._eval(e,t+1);if(o===a||!o)return this;if(!xn(o.constructor.name,i))return this}var u=[];for(var l=0,c=this.args.length;l{reset_def(e,t)}))}function push(e){e.safe_ids=Object.create(e.safe_ids)}function pop(e){e.safe_ids=Object.getPrototypeOf(e.safe_ids)}function mark(e,t,n){e.safe_ids[t.id]=n}function safe_to_read(e,t){if(t.single_use=="m")return false;if(e.safe_ids[t.id]){if(t.fixed==null){var n=t.orig[0];if(n instanceof Tt||n.name=="arguments")return false;t.fixed=make_node($t,n)}return true}return t.fixed instanceof fe}function safe_to_assign(e,t,n,r){if(t.fixed===undefined)return true;let i;if(t.fixed===null&&(i=e.defs_to_safe_ids.get(t.id))){i[t.id]=false;e.defs_to_safe_ids.delete(t.id);return true}if(!HOP(e.safe_ids,t.id))return false;if(!safe_to_read(e,t))return false;if(t.fixed===false)return false;if(t.fixed!=null&&(!r||t.references.length>t.assignments))return false;if(t.fixed instanceof fe){return r instanceof U&&t.fixed.parent_scope===n}return t.orig.every((e=>!(e instanceof yt||e instanceof kt||e instanceof Ft)))}function ref_once(e,t,n){return t.option("unused")&&!n.scope.pinned()&&n.references.length-n.recursive_refs==1&&e.loop_ids.get(n.id)===e.in_loop}function is_immutable(e){if(!e)return false;return e.is_constant()||e instanceof se||e instanceof Ut}function mark_escaped(e,t,n,r,i,o=0,a=1){var s=e.parent(o);if(i){if(i.is_constant())return;if(i instanceof Et)return}if(s instanceof tt&&(s.operator==="="||s.logical)&&r===s.right||s instanceof Ke&&(r!==s.expression||s instanceof Ge)||s instanceof Ee&&r===s.value&&r.scope!==t.scope||s instanceof Be&&r===s.value||s instanceof Ae&&r===s.value&&r.scope!==t.scope){if(a>1&&!(i&&i.is_constant_expression(n)))a=1;if(!t.escaped||t.escaped>a)t.escaped=a;return}else if(s instanceof rt||s instanceof ye||s instanceof Je&&In.has(s.operator)||s instanceof et&&r!==s.condition||s instanceof ae||s instanceof He&&r===s.tail_node()){mark_escaped(e,t,n,s,s,o+1,a)}else if(s instanceof at&&r===s.value){var u=e.parent(o+1);mark_escaped(e,t,n,u,u,o+2,a)}else if(s instanceof Xe&&r===s.expression){i=read_property(i,s.property);mark_escaped(e,t,n,s,i,o+1,a+1);if(i)return}if(o>0)return;if(s instanceof He&&r!==s.tail_node())return;if(s instanceof H)return;t.direct_access=true}const suppress=e=>walk(e,(e=>{if(!(e instanceof gt))return;var t=e.definition();if(!t)return;if(e instanceof Pt)t.references.push(e);t.fixed=false}));def_reduce_vars(ue,(function(e,t,n){push(e);reset_variables(e,n,this);t();pop(e);return true}));def_reduce_vars(tt,(function(e,t,n){var r=this;if(r.left instanceof _e){suppress(r.left);return}const finish_walk=()=>{if(r.logical){r.left.walk(e);push(e);r.right.walk(e);pop(e);return true}};var i=r.left;if(!(i instanceof Pt))return finish_walk();var o=i.definition();var a=safe_to_assign(e,o,i.scope,r.right);o.assignments++;if(!a)return finish_walk();var s=o.fixed;if(!s&&r.operator!="="&&!r.logical)return finish_walk();var u=r.operator=="=";var l=u?r.right:r;if(is_modified(n,e,r,l,0))return finish_walk();o.references.push(i);if(!r.logical){if(!u)o.chained=true;o.fixed=u?function(){return r.right}:function(){return make_node(Je,r,{operator:r.operator.slice(0,-1),left:s instanceof U?s:s(),right:r.right})}}if(r.logical){mark(e,o,false);push(e);r.right.walk(e);pop(e);return true}mark(e,o,false);r.right.walk(e);mark(e,o,true);mark_escaped(e,o,i.scope,r,l,0,1);return true}));def_reduce_vars(Je,(function(e){if(!In.has(this.operator))return;this.left.walk(e);push(e);this.right.walk(e);pop(e);return true}));def_reduce_vars(X,(function(e,t,n){reset_block_variables(n,this)}));def_reduce_vars(Fe,(function(e){push(e);this.expression.walk(e);pop(e);push(e);walk_body(this,e);pop(e);return true}));def_reduce_vars(pt,(function(e,t){clear_flag(this,An);push(e);t();pop(e);return true}));def_reduce_vars(et,(function(e){this.condition.walk(e);push(e);this.consequent.walk(e);pop(e);push(e);this.alternative.walk(e);pop(e);return true}));def_reduce_vars(je,(function(e,t){const n=e.safe_ids;t();e.safe_ids=n;return true}));def_reduce_vars(Ke,(function(e){this.expression.walk(e);if(this.optional){push(e)}for(const t of this.args)t.walk(e);return true}));def_reduce_vars(Xe,(function(e){if(!this.optional)return;this.expression.walk(e);push(e);if(this.property instanceof U)this.property.walk(e);return true}));def_reduce_vars(Re,(function(e,t){push(e);t();pop(e);return true}));function mark_lambda(e,t,n){clear_flag(this,An);push(e);reset_variables(e,n,this);if(this.uses_arguments){t();pop(e);return}var r;if(!this.name&&(r=e.parent())instanceof Ke&&r.expression===this&&!r.args.some((e=>e instanceof ae))&&this.argnames.every((e=>e instanceof gt))){this.argnames.forEach(((t,n)=>{if(!t.definition)return;var i=t.definition();if(i.orig.length>1)return;if(i.fixed===undefined&&(!this.uses_arguments||e.has_directive("use strict"))){i.fixed=function(){return r.args[n]||make_node($t,r)};e.loop_ids.set(i.id,e.in_loop);mark(e,i,true)}else{i.fixed=false}}))}t();pop(e);return true}def_reduce_vars(se,mark_lambda);def_reduce_vars(Q,(function(e,t,n){reset_block_variables(n,this);const r=e.in_loop;e.in_loop=this;push(e);this.body.walk(e);if(has_break_or_continue(this)){pop(e);push(e)}this.condition.walk(e);pop(e);e.in_loop=r;return true}));def_reduce_vars(ee,(function(e,t,n){reset_block_variables(n,this);if(this.init)this.init.walk(e);const r=e.in_loop;e.in_loop=this;push(e);if(this.condition)this.condition.walk(e);this.body.walk(e);if(this.step){if(has_break_or_continue(this)){pop(e);push(e)}this.step.walk(e)}pop(e);e.in_loop=r;return true}));def_reduce_vars(te,(function(e,t,n){reset_block_variables(n,this);suppress(this.init);this.object.walk(e);const r=e.in_loop;e.in_loop=this;push(e);this.body.walk(e);pop(e);e.in_loop=r;return true}));def_reduce_vars(Te,(function(e){this.condition.walk(e);push(e);this.body.walk(e);pop(e);if(this.alternative){push(e);this.alternative.walk(e);pop(e)}return true}));def_reduce_vars(j,(function(e){push(e);this.body.walk(e);pop(e);return true}));def_reduce_vars(xt,(function(){this.definition().fixed=false}));def_reduce_vars(Pt,(function(e,t,n){var r=this.definition();r.references.push(this);if(r.references.length==1&&!r.fixed&&r.orig[0]instanceof kt){e.loop_ids.set(r.id,e.in_loop)}var i;if(r.fixed===undefined||!safe_to_read(e,r)){r.fixed=false}else if(r.fixed){i=this.fixed_value();if(i instanceof se&&is_recursive_ref(e,r)){r.recursive_refs++}else if(i&&!n.exposed(r)&&ref_once(e,n,r)){r.single_use=i instanceof se&&!i.pinned()||i instanceof pt||r.scope===this.scope&&i.is_constant_expression()}else{r.single_use=false}if(is_modified(n,e,this,i,0,is_immutable(i))){if(r.single_use){r.single_use="m"}else{r.fixed=false}}}mark_escaped(e,r,this.scope,this,i,0,1)}));def_reduce_vars(oe,(function(e,t,n){this.globals.forEach((function(e){reset_def(n,e)}));reset_variables(e,n,this)}));def_reduce_vars(Oe,(function(e,t,n){reset_block_variables(n,this);push(e);walk_body(this,e);pop(e);if(this.bcatch){push(e);this.bcatch.walk(e);pop(e)}if(this.bfinally)this.bfinally.walk(e);return true}));def_reduce_vars($e,(function(e){var t=this;if(t.operator!=="++"&&t.operator!=="--")return;var n=t.expression;if(!(n instanceof Pt))return;var r=n.definition();var i=safe_to_assign(e,r,n.scope,true);r.assignments++;if(!i)return;var o=r.fixed;if(!o)return;r.references.push(n);r.chained=true;r.fixed=function(){return make_node(Je,t,{operator:t.operator.slice(0,-1),left:make_node(Ze,t,{operator:"+",expression:o instanceof U?o:o()}),right:make_node(Ht,t,{value:1})})};mark(e,r,true);return true}));def_reduce_vars(Be,(function(e,t){var n=this;if(n.name instanceof _e){suppress(n.name);return}var r=n.name.definition();if(n.value){if(safe_to_assign(e,r,n.name.scope,n.value)){r.fixed=function(){return n.value};e.loop_ids.set(r.id,e.in_loop);mark(e,r,false);t();mark(e,r,true);return true}else{r.fixed=false}}}));def_reduce_vars(J,(function(e,t,n){reset_block_variables(n,this);const r=e.in_loop;e.in_loop=this;push(e);t();pop(e);e.in_loop=r;return true}));function loop_body(e){if(e instanceof $){return e.body instanceof W?e.body:e}return e}function is_lhs_read_only(e){if(e instanceof Ut)return true;if(e instanceof Pt)return e.definition().orig[0]instanceof Ft;if(e instanceof Xe){e=e.expression;if(e instanceof Pt){if(e.is_immutable())return false;e=e.fixed_value()}if(!e)return true;if(e instanceof Wt)return false;if(e instanceof Kt)return true;return is_lhs_read_only(e)}return false}function trim_unreachable_code(e,t,n){walk(t,(r=>{if(r instanceof we){r.remove_initializers();n.push(r);return true}if(r instanceof fe&&(r===t||!e.has_directive("use strict"))){n.push(r===t?r:make_node(we,r,{definitions:[make_node(Be,r,{name:make_node(bt,r.name,r.name),value:null})]}));return true}if(r instanceof ze||r instanceof Ve){n.push(r);return true}if(r instanceof ie){return true}}))}function tighten_body(e,t){var n,r;var o=t.find_parent(ie).get_defun_scope();find_loop_scope_try();var a,s=10;do{a=false;eliminate_spurious_blocks(e);if(t.option("dead_code")){eliminate_dead_code(e,t)}if(t.option("if_return")){handle_if_return(e,t)}if(t.sequences_limit>0){sequencesize(e,t);sequencesize_2(e,t)}if(t.option("join_vars")){join_consecutive_vars(e)}if(t.option("collapse_vars")){collapse(e,t)}}while(a&&s-- >0);function find_loop_scope_try(){var e=t.self(),i=0;do{if(e instanceof Me||e instanceof xe){i++}else if(e instanceof $){n=true}else if(e instanceof ie){o=e;break}else if(e instanceof Oe){r=true}}while(e=t.parent(i++))}function collapse(e,t){if(o.pinned())return e;var s;var u=[];var l=e.length;var c=new TreeTransformer((function(e){if(k)return e;if(!T){if(e!==_[p])return e;p++;if(p<_.length)return handle_custom_scan_order(e);T=true;h=find_stop(e,0);if(h===e)k=true;return e}var n=c.parent();if(e instanceof tt&&(e.logical||e.operator!="="&&g.equivalent_to(e.left))||e instanceof ye||e instanceof Ke&&g instanceof Xe&&g.equivalent_to(e.expression)||e instanceof K||e instanceof _e||e instanceof ae&&e.expression instanceof gt&&(e.expression instanceof Ut||e.expression.definition().references.length>1)||e instanceof $&&!(e instanceof ee)||e instanceof De||e instanceof Oe||e instanceof re||e instanceof Ae||e instanceof ze||e instanceof pt||n instanceof ee&&e!==n.init||!S&&(e instanceof Pt&&!e.is_declared(t)&&!On.has(e))||e instanceof Pt&&n instanceof Ke&&has_annotation(n,an)){k=true;return e}if(!E&&(!D||!S)&&(n instanceof Je&&In.has(n.operator)&&n.left!==e||n instanceof et&&n.condition!==e||n instanceof Te&&n.condition!==e)){E=n}if(R&&!(e instanceof Dt)&&g.equivalent_to(e)&&!shadows(e.scope,v)){if(E){k=true;return e}if(is_lhs(e,n)){if(m)C++;return e}else{C++;if(m&&d instanceof Be)return e}a=k=true;if(d instanceof Qe){return make_node(Ze,d,d)}if(d instanceof Be){var i=d.name.definition();var o=d.value;if(i.references.length-i.replaced==1&&!t.exposed(i)){i.replaced++;if(A&&is_identifier_atom(o)){return o.transform(t)}else{return maintain_this_binding(n,e,o)}}return make_node(tt,d,{operator:"=",logical:false,left:make_node(Pt,d.name,d.name),right:o})}clear_flag(d,Tn);return d}var s;if(e instanceof Ke||e instanceof Ee&&(b||g instanceof Xe||may_modify(g))||e instanceof Xe&&(b||e.expression.may_throw_on_access(t))||e instanceof Pt&&(v.has(e.name)&&v.get(e.name).modified||b&&may_modify(e))||e instanceof Be&&e.value&&(v.has(e.name.name)||b&&may_modify(e.name))||(s=is_lhs(e.left,e))&&(s instanceof Xe||v.has(s.name))||y&&(r?e.has_side_effects(t):side_effects_external(e))){h=e;if(e instanceof ie)k=true}return handle_custom_scan_order(e)}),(function(e){if(k)return;if(h===e)k=true;if(E===e)E=null}));var f=new TreeTransformer((function(e){if(k)return e;if(!T){if(e!==_[p])return e;p++;if(p<_.length)return;T=true;return e}if(e instanceof Pt&&e.name==M.name){if(!--C)k=true;if(is_lhs(e,f.parent()))return e;M.replaced++;m.replaced--;return d.value}if(e instanceof Re||e instanceof ie)return e}));while(--l>=0){if(l==0&&t.option("unused"))extract_args();var _=[];extract_candidates(e[l]);while(u.length>0){_=u.pop();var p=0;var d=_[_.length-1];var m=null;var h=null;var E=null;var g=get_lhs(d);if(!g||is_lhs_read_only(g)||g.has_side_effects(t))continue;var v=get_lvalues(d);var D=is_lhs_local(g);if(g instanceof Pt){v.set(g.name,{def:g.definition(),modified:false})}var b=value_has_side_effects(d);var S=replace_all_symbols();var y=d.may_throw(t);var A=d.name instanceof Tt;var T=A;var k=false,C=0,R=!s||!T;if(!R){for(var F=t.self().argnames.lastIndexOf(d.name)+1;!k&&FC)C=false;else{k=false;p=0;T=A;for(var O=l;!k&&O!(e instanceof ae)))){var r=t.has_directive("use strict");if(r&&!member(r,n.body))r=false;var i=n.argnames.length;s=e.args.slice(i);var o=new Set;for(var a=i;--a>=0;){var l=n.argnames[a];var c=e.args[a];const i=l.definition&&l.definition();const _=i&&i.orig.length>1;if(_)continue;s.unshift(make_node(Be,l,{name:l,value:c}));if(o.has(l.name))continue;o.add(l.name);if(l instanceof ae){var f=e.args.slice(a);if(f.every((e=>!has_overlapping_symbol(n,e,r)))){u.unshift([make_node(Be,l,{name:l.expression,value:make_node(rt,e,{elements:f})})])}}else{if(!c){c=make_node($t,l).transform(t)}else if(c instanceof se&&c.pinned()||has_overlapping_symbol(n,c,r)){c=null}if(c)u.unshift([make_node(Be,l,{name:l,value:c})])}}}}function extract_candidates(e){_.push(e);if(e instanceof tt){if(!e.left.has_side_effects(t)&&!(e.right instanceof je)){u.push(_.slice())}extract_candidates(e.right)}else if(e instanceof Je){extract_candidates(e.left);extract_candidates(e.right)}else if(e instanceof Ke&&!has_annotation(e,an)){extract_candidates(e.expression);e.args.forEach(extract_candidates)}else if(e instanceof Fe){extract_candidates(e.expression)}else if(e instanceof et){extract_candidates(e.condition);extract_candidates(e.consequent);extract_candidates(e.alternative)}else if(e instanceof Ne){var n=e.definitions.length;var r=n-200;if(r<0)r=0;for(;r1&&!(e.name instanceof Tt)||(r>1?mangleable_var(e):!t.exposed(n))){return make_node(Pt,e.name,e.name)}}else{const t=e instanceof tt?e.left:e.expression;return!is_ref_of(t,yt)&&!is_ref_of(t,At)&&t}}function get_rvalue(e){if(e instanceof tt){return e.right}else{return e.value}}function get_lvalues(e){var n=new Map;if(e instanceof $e)return n;var r=new TreeWalker((function(e){var i=e;while(i instanceof Xe)i=i.expression;if(i instanceof Pt){const o=n.get(i.name);if(!o||!o.modified){n.set(i.name,{def:i.definition(),modified:is_modified(t,r,e,e,0)})}}}));get_rvalue(e).walk(r);return n}function remove_candidate(n){if(n.name instanceof Tt){var r=t.parent(),o=t.self().argnames;var a=o.indexOf(n.name);if(a<0){r.args.length=Math.min(r.args.length,o.length-1)}else{var s=r.args;if(s[a])s[a]=make_node(Ht,s[a],{value:0})}return true}var u=false;return e[l].transform(new TreeTransformer((function(e,t,r){if(u)return e;if(e===n||e.body===n){u=true;if(e instanceof Be){e.value=e.name instanceof yt?make_node($t,e.value):null;return e}return r?i.skip:null}}),(function(e){if(e instanceof He)switch(e.expressions.length){case 0:return null;case 1:return e.expressions[0]}})))}function is_lhs_local(e){while(e instanceof Xe)e=e.expression;return e instanceof Pt&&e.definition().scope===o&&!(n&&(v.has(e.name)||d instanceof $e||d instanceof tt&&!d.logical&&d.operator!="="))}function value_has_side_effects(e){if(e instanceof $e)return Pn.has(e.operator);return get_rvalue(e).has_side_effects(t)}function replace_all_symbols(){if(b)return false;if(m)return true;if(g instanceof Pt){var e=g.definition();if(e.references.length-e.replaced==(d instanceof Be?1:2)){return true}}return false}function may_modify(e){if(!e.definition)return true;var t=e.definition();if(t.orig.length==1&&t.orig[0]instanceof kt)return false;if(t.scope.get_defun_scope()!==o)return true;return!t.references.every((e=>{var t=e.scope.get_defun_scope();if(t.TYPE=="Scope")t=t.parent_scope;return t===o}))}function side_effects_external(e,t){if(e instanceof tt)return side_effects_external(e.left,true);if(e instanceof $e)return side_effects_external(e.expression,true);if(e instanceof Be)return e.value&&side_effects_external(e.value);if(t){if(e instanceof We)return side_effects_external(e.expression,true);if(e instanceof Ye)return side_effects_external(e.expression,true);if(e instanceof Pt)return e.definition().scope!==o}return false}function shadows(e,t){for(const{def:n}of t.values()){let t=e;while(t&&t!==n.scope){let e=t.variables.get(n.name);if(e&&e!==n)return true;t=t.parent_scope}}return false}}function eliminate_spurious_blocks(e){var t=[];for(var n=0;n=0;){var s=e[o];var u=next_index(o);var l=e[u];if(i&&!l&&s instanceof ge){if(!s.value){a=true;e.splice(o,1);continue}if(s.value instanceof Ze&&s.value.operator=="void"){a=true;e[o]=make_node(H,s,{body:s.value.expression});continue}}if(s instanceof Te){var c=aborts(s.body);if(can_merge_flow(c)){if(c.label){remove(c.label.thedef.references,c)}a=true;s=s.clone();s.condition=s.condition.negate(t);var f=as_statement_array_with_return(s.body,c);s.body=make_node(W,s,{body:as_statement_array(s.alternative).concat(extract_functions())});s.alternative=make_node(W,s,{body:f});e[o]=s.transform(t);continue}var c=aborts(s.alternative);if(can_merge_flow(c)){if(c.label){remove(c.label.thedef.references,c)}a=true;s=s.clone();s.body=make_node(W,s.body,{body:as_statement_array(s.body).concat(extract_functions())});var f=as_statement_array_with_return(s.alternative,c);s.alternative=make_node(W,s.alternative,{body:f});e[o]=s.transform(t);continue}}if(s instanceof Te&&s.body instanceof ge){var _=s.body.value;if(!_&&!s.alternative&&(i&&!l||l instanceof ge&&!l.value)){a=true;e[o]=make_node(H,s.condition,{body:s.condition});continue}if(_&&!s.alternative&&l instanceof ge&&l.value){a=true;s=s.clone();s.alternative=l;e[o]=s.transform(t);e.splice(u,1);continue}if(_&&!s.alternative&&(!l&&i&&r||l instanceof ge)){a=true;s=s.clone();s.alternative=l||make_node(ge,s,{value:null});e[o]=s.transform(t);if(l)e.splice(u,1);continue}var p=e[prev_index(o)];if(t.option("sequences")&&i&&!s.alternative&&p instanceof Te&&p.body instanceof ge&&next_index(u)==e.length&&l instanceof H){a=true;s=s.clone();s.alternative=make_node(W,l,{body:[l,make_node(ge,l,{value:null})]});e[o]=s.transform(t);e.splice(u,1);continue}}}function has_multiple_if_returns(e){var t=0;for(var n=e.length;--n>=0;){var r=e[n];if(r instanceof Te&&r.body instanceof ge){if(++t>1)return true}}return false}function is_return_void(e){return!e||e instanceof Ze&&e.operator=="void"}function can_merge_flow(r){if(!r)return false;for(var a=o+1,s=e.length;a=0;){var r=e[n];if(!(r instanceof we&&declarations_only(r))){break}}return n}}function eliminate_dead_code(e,t){var n;var r=t.self();for(var i=0,o=0,s=e.length;i!e.value))}function sequencesize(e,t){if(e.length<2)return;var n=[],r=0;function push_seq(){if(!n.length)return;var t=make_sequence(n[0],n);e[r++]=make_node(H,t,{body:t});n=[]}for(var i=0,o=e.length;i=t.sequences_limit)push_seq();var u=s.body;if(n.length>0)u=u.drop_side_effect_free(t);if(u)merge_sequence(n,u)}else if(s instanceof Ne&&declarations_only(s)||s instanceof fe){e[r++]=s}else{push_seq();e[r++]=s}}push_seq();e.length=r;if(r!=o)a=true}function to_simple_statement(e,t){if(!(e instanceof W))return e;var n=null;for(var r=0,i=e.body.length;r{if(e instanceof ie)return true;if(e instanceof Je&&e.operator==="in"){return nn}}));if(!e){if(o.init)o.init=cons_seq(o.init);else{o.init=r.body;n--;a=true}}}}else if(o instanceof te){if(!(o.init instanceof Pe)&&!(o.init instanceof Ie)){o.object=cons_seq(o.object)}}else if(o instanceof Te){o.condition=cons_seq(o.condition)}else if(o instanceof ke){o.expression=cons_seq(o.expression)}else if(o instanceof re){o.expression=cons_seq(o.expression)}}if(t.option("conditionals")&&o instanceof Te){var s=[];var u=to_simple_statement(o.body,s);var l=to_simple_statement(o.alternative,s);if(u!==false&&l!==false&&s.length>0){var c=s.length;s.push(make_node(Te,o,{condition:o.condition,body:u||make_node(q,o.body),alternative:l}));s.unshift(n,1);[].splice.apply(e,s);i+=c;n+=c+1;r=null;a=true;continue}}e[n++]=o;r=o instanceof H?o:null}e.length=n}function join_object_assignments(e,n){if(!(e instanceof Ne))return;var r=e.definitions[e.definitions.length-1];if(!(r.value instanceof it))return;var i;if(n instanceof tt&&!n.logical){i=[n]}else if(n instanceof He){i=n.expressions.slice()}if(!i)return;var a=false;do{var s=i[0];if(!(s instanceof tt))break;if(s.operator!="=")break;if(!(s.left instanceof Xe))break;var u=s.left.expression;if(!(u instanceof Pt))break;if(r.name.name!=u.name)break;if(!s.right.is_constant_expression(o))break;var l=s.left.property;if(l instanceof U){l=l.evaluate(t)}if(l instanceof U)break;l=""+l;var c=t.option("ecma")<2015&&t.has_directive("use strict")?function(e){return e.key!=l&&(e.key&&e.key.name!=l)}:function(e){return e.key&&e.key.name!=l};if(!r.value.properties.every(c))break;var f=r.value.properties.filter((function(e){return e.key===l}))[0];if(!f){r.value.properties.push(make_node(at,s,{key:l,value:s.right}))}else{f.value=new He({start:f.start,expressions:[f.value.clone(),s.right.clone()],end:f.end})}i.shift();a=true}while(i.length);return a&&i}function join_consecutive_vars(e){var t;for(var n=0,r=-1,i=e.length;n0||this.option("reduce_vars")){this._toplevel.reset_opt_flags(this)}this._toplevel=this._toplevel.transform(this);if(t>1){let e=0;walk(this._toplevel,(()=>{e++}));if(e=0){i.body[a]=i.body[a].transform(r)}}else if(i instanceof Te){i.body=i.body.transform(r);if(i.alternative){i.alternative=i.alternative.transform(r)}}else if(i instanceof re){i.body=i.body.transform(r)}return i}));n.transform(r)}));oe.DEFMETHOD("reset_opt_flags",(function(e){const t=this;const n=e.option("reduce_vars");const r=new TreeWalker((function(i,o){clear_flag(i,Fn);if(n){if(e.top_retain&&i instanceof fe&&r.parent()===t){set_flag(i,Rn)}return i.reduce_vars(r,o,e)}}));r.safe_ids=Object.create(null);r.in_loop=null;r.loop_ids=new Map;r.defs_to_safe_ids=new Map;t.walk(r)}));gt.DEFMETHOD("fixed_value",(function(){var e=this.thedef.fixed;if(!e||e instanceof U)return e;return e()}));Pt.DEFMETHOD("is_immutable",(function(){var e=this.definition().orig;return e.length==1&&e[0]instanceof Ft}));function find_scope(e){for(let t=0;;t++){const n=e.parent(t);if(n instanceof oe)return n;if(n instanceof se)return n;if(n.block_scope)return n.block_scope}}function find_variable(e,t){var n,r=0;while(n=e.parent(r++)){if(n instanceof ie)break;if(n instanceof Me&&n.argname){n=n.argname.definition().scope;break}}return n.find_variable(t)}function is_empty(e){if(e===null)return true;if(e instanceof q)return true;if(e instanceof W)return e.body.length==0;return false}var Wn=makePredicate("Array Boolean clearInterval clearTimeout console Date decodeURI decodeURIComponent encodeURI encodeURIComponent Error escape eval EvalError Function isFinite isNaN JSON Math Number parseFloat parseInt RangeError ReferenceError RegExp Object setInterval setTimeout String SyntaxError TypeError unescape URIError");Pt.DEFMETHOD("is_declared",(function(e){return!this.definition().undeclared||e.option("unsafe")&&Wn.has(this.name)}));var qn=new Set(["use asm","use strict"]);def_optimize(G,(function(e,t){if(t.option("directives")&&(!qn.has(e.value)||t.has_directive(e.value)!==e)){return make_node(q,e)}return e}));def_optimize(K,(function(e,t){if(t.option("drop_debugger"))return make_node(q,e);return e}));def_optimize(j,(function(e,t){if(e.body instanceof be&&t.loopcontrol_target(e.body)===e.body){return make_node(q,e)}return e.label.references.length==0?e.body:e}));def_optimize(X,(function(e,t){tighten_body(e.body,t);return e}));function can_be_extracted_from_if_block(e){return!(e instanceof Pe||e instanceof Ie||e instanceof pt)}def_optimize(W,(function(e,t){tighten_body(e.body,t);switch(e.body.length){case 1:if(!t.has_directive("use strict")&&t.parent()instanceof Te&&can_be_extracted_from_if_block(e.body[0])||can_be_evicted_from_block(e.body[0])){return e.body[0]}break;case 0:return make_node(q,e)}return e}));function opt_AST_Lambda(e,t){tighten_body(e.body,t);if(t.option("side_effects")&&e.body.length==1&&e.body[0]===t.has_directive("use strict")){e.body.length=0}return e}def_optimize(se,opt_AST_Lambda);const Yn=/keep_assign/;ie.DEFMETHOD("drop_unused",(function(e){if(!e.option("unused"))return;if(e.has_directive("use asm"))return;var t=this;if(t.pinned())return;var n=!(t instanceof oe)||e.toplevel.funcs;var r=!(t instanceof oe)||e.toplevel.vars;const o=Yn.test(e.option("unused"))?return_false:function(e){if(e instanceof tt&&!e.logical&&(has_flag(e,Tn)||e.operator=="=")){return e.left}if(e instanceof $e&&has_flag(e,Tn)){return e.expression}};var a=new Map;var s=new Map;if(t instanceof oe&&e.top_retain){t.variables.forEach((function(t){if(e.top_retain(t)&&!a.has(t.id)){a.set(t.id,t)}}))}var u=new Map;var l=new Map;var c=this;var f=new TreeWalker((function(i,o){if(i instanceof se&&i.uses_arguments&&!f.has_directive("use strict")){i.argnames.forEach((function(e){if(!(e instanceof Dt))return;var t=e.definition();if(!a.has(t.id)){a.set(t.id,t)}}))}if(i===t)return;if(i instanceof fe||i instanceof ht){var _=i.name.definition();const r=f.parent()instanceof ze;if(r||!n&&c===t){if(_.global&&!a.has(_.id)){a.set(_.id,_)}}if(i instanceof ht){if(i.extends&&(i.extends.has_side_effects(e)||i.extends.may_throw(e))){i.extends.walk(f)}for(const t of i.properties){if(t.has_side_effects(e)||t.may_throw(e)){t.walk(f)}}}map_add(l,_.id,i);return true}if(i instanceof Tt&&c===t){map_add(u,i.definition().id,i)}if(i instanceof Ne&&c===t){const t=f.parent()instanceof ze;i.definitions.forEach((function(n){if(n.name instanceof bt){map_add(u,n.name.definition().id,n)}if(t||!r){walk(n.name,(e=>{if(e instanceof Dt){const n=e.definition();if((t||n.global)&&!a.has(n.id)){a.set(n.id,n)}}}))}if(n.value){if(n.name instanceof _e){n.walk(f)}else{var i=n.name.definition();map_add(l,i.id,n.value);if(!i.chained&&n.name.fixed_value()===n.value){s.set(i.id,n)}}if(n.value.has_side_effects(e)){n.value.walk(f)}}}));return true}return scan_ref_scoped(i,o)}));t.walk(f);f=new TreeWalker(scan_ref_scoped);a.forEach((function(e){var t=l.get(e.id);if(t)t.forEach((function(e){e.walk(f)}))}));var _=new TreeTransformer((function before(l,f,p){var d=_.parent();if(r){const e=o(l);if(e instanceof Pt){var m=e.definition();var h=a.has(m.id);if(l instanceof tt){if(!h||s.has(m.id)&&s.get(m.id)!==l){return maintain_this_binding(d,l,l.right.transform(_))}}else if(!h)return p?i.skip:make_node(Ht,l,{value:0})}}if(c!==t)return;var m;if(l.name&&(l instanceof Et&&!keep_name(e.option("keep_classnames"),(m=l.name.definition()).name)||l instanceof le&&!keep_name(e.option("keep_fnames"),(m=l.name.definition()).name))){if(!a.has(m.id)||m.orig.length>1)l.name=null}if(l instanceof se&&!(l instanceof ue)){var E=!e.option("keep_fargs");for(var g=l.argnames,v=g.length;--v>=0;){var D=g[v];if(D instanceof ae){D=D.expression}if(D instanceof nt){D=D.left}if(!(D instanceof _e)&&!a.has(D.definition().id)){set_flag(D,Dn);if(E){g.pop()}}else{E=false}}}if((l instanceof fe||l instanceof ht)&&l!==t){const t=l.name.definition();let r=t.global&&!n||a.has(t.id);if(!r){t.eliminated++;if(l instanceof ht){const t=l.drop_side_effect_free(e);if(t){return make_node(H,l,{body:t})}}return p?i.skip:make_node(q,l)}}if(l instanceof Ne&&!(d instanceof te&&d.init===l)){var b=!(d instanceof oe)&&!(l instanceof we);var S=[],y=[],A=[];var T=[];l.definitions.forEach((function(t){if(t.value)t.value=t.value.transform(_);var n=t.name instanceof _e;var i=n?new SymbolDef(null,{name:""}):t.name.definition();if(b&&i.global)return A.push(t);if(!(r||b)||n&&(t.name.names.length||t.name.is_array||e.option("pure_getters")!=true)||a.has(i.id)){if(t.value&&s.has(i.id)&&s.get(i.id)!==t){t.value=t.value.drop_side_effect_free(e)}if(t.name instanceof bt){var o=u.get(i.id);if(o.length>1&&(!t.value||i.orig.indexOf(t.name)>i.eliminated)){if(t.value){var c=make_node(Pt,t.name,t.name);i.references.push(c);var f=make_node(tt,t,{operator:"=",logical:false,left:c,right:t.value});if(s.get(i.id)===t){s.set(i.id,f)}T.push(f.transform(_))}remove(o,t);i.eliminated++;return}}if(t.value){if(T.length>0){if(A.length>0){T.push(t.value);t.value=make_sequence(t.value,T)}else{S.push(make_node(H,l,{body:make_sequence(l,T)}))}T=[]}A.push(t)}else{y.push(t)}}else if(i.orig[0]instanceof xt){var p=t.value&&t.value.drop_side_effect_free(e);if(p)T.push(p);t.value=null;y.push(t)}else{var p=t.value&&t.value.drop_side_effect_free(e);if(p){T.push(p)}i.eliminated++}}));if(y.length>0||A.length>0){l.definitions=y.concat(A);S.push(l)}if(T.length>0){S.push(make_node(H,l,{body:make_sequence(l,T)}))}switch(S.length){case 0:return p?i.skip:make_node(q,l);case 1:return S[0];default:return p?i.splice(S):make_node(W,l,{body:S})}}if(l instanceof ee){f(l,this);var k;if(l.init instanceof W){k=l.init;l.init=k.body.pop();k.body.push(l)}if(l.init instanceof H){l.init=l.init.body}else if(is_empty(l.init)){l.init=null}return!k?l:p?i.splice(k.body):k}if(l instanceof j&&l.body instanceof ee){f(l,this);if(l.body instanceof W){var k=l.body;l.body=k.body.pop();k.body.push(l);return p?i.splice(k.body):k}return l}if(l instanceof W){f(l,this);if(p&&l.body.every(can_be_evicted_from_block)){return i.splice(l.body)}return l}if(l instanceof ie){const e=c;c=l;f(l,this);c=e;return l}}));t.transform(_);function scan_ref_scoped(e,n){var r;const i=o(e);if(i instanceof Pt&&!is_ref_of(e.left,St)&&t.variables.get(i.name)===(r=i.definition())){if(e instanceof tt){e.right.walk(f);if(!r.chained&&e.left.fixed_value()===e.right){s.set(r.id,e)}}return true}if(e instanceof Pt){r=e.definition();if(!a.has(r.id)){a.set(r.id,r);if(r.orig[0]instanceof xt){const e=r.scope.is_block_scope()&&r.scope.get_defun_scope().variables.get(r.name);if(e)a.set(e.id,e)}}return true}if(e instanceof ie){var u=c;c=e;n();c=u;return true}}}));ie.DEFMETHOD("hoist_declarations",(function(e){var t=this;if(e.has_directive("use asm"))return t;if(!Array.isArray(t.body))return t;var n=e.option("hoist_funs");var r=e.option("hoist_vars");if(n||r){var i=[];var o=[];var a=new Map,s=0,u=0;walk(t,(e=>{if(e instanceof ie&&e!==t)return true;if(e instanceof we){++u;return true}}));r=r&&u>1;var l=new TreeTransformer((function before(u){if(u!==t){if(u instanceof G){i.push(u);return make_node(q,u)}if(n&&u instanceof fe&&!(l.parent()instanceof ze)&&l.parent()===t){o.push(u);return make_node(q,u)}if(r&&u instanceof we&&!u.definitions.some((e=>e.name instanceof _e))){u.definitions.forEach((function(e){a.set(e.name.name,e);++s}));var c=u.to_assignments(e);var f=l.parent();if(f instanceof te&&f.init===u){if(c==null){var _=u.definitions[0].name;return make_node(Pt,_,_)}return c}if(f instanceof ee&&f.init===u){return c}if(!c)return make_node(q,u);return make_node(H,u,{body:c})}if(u instanceof ie)return u}}));t=t.transform(l);if(s>0){var c=[];const e=t instanceof se;const n=e?t.args_as_names():null;a.forEach(((t,r)=>{if(e&&n.some((e=>e.name===t.name.name))){a.delete(r)}else{t=t.clone();t.value=null;c.push(t);a.set(r,t)}}));if(c.length>0){for(var f=0;fe instanceof ae||e.computed_key()))){s(a,this);const e=new Map;const n=[];c.properties.forEach((({key:r,value:i})=>{const s=find_scope(o);const l=t.create_symbol(u.CTOR,{source:u,scope:s,conflict_scopes:new Set([s,...u.definition().references.map((e=>e.scope))]),tentative_name:u.name+"_"+r});e.set(String(r),l.definition());n.push(make_node(Be,a,{name:l,value:i}))}));r.set(l.id,e);return i.splice(n)}}else if(a instanceof Xe&&a.expression instanceof Pt){const e=r.get(a.expression.definition().id);if(e){const t=e.get(String(get_simple_key(a.property)));const n=make_node(Pt,a,{name:t.name,scope:a.expression.scope,thedef:t});n.reference({});return n}}}));return t.transform(o)}));def_optimize(H,(function(e,t){if(t.option("side_effects")){var n=e.body;var r=n.drop_side_effect_free(t,true);if(!r){return make_node(q,e)}if(r!==n){return make_node(H,e,{body:r})}}return e}));def_optimize(J,(function(e,t){return t.option("loops")?make_node(ee,e,e).optimize(t):e}));def_optimize(Q,(function(e,t){if(!t.option("loops"))return e;var n=e.condition.tail_node().evaluate(t);if(!(n instanceof U)){if(n)return make_node(ee,e,{body:make_node(W,e.body,{body:[e.body,make_node(H,e.condition,{body:e.condition})]})}).optimize(t);if(!has_break_or_continue(e,t.parent())){return make_node(W,e.body,{body:[e.body,make_node(H,e.condition,{body:e.condition})]}).optimize(t)}}return e}));function if_break_in_loop(e,t){var n=e.body instanceof W?e.body.body[0]:e.body;if(t.option("dead_code")&&is_break(n)){var r=[];if(e.init instanceof z){r.push(e.init)}else if(e.init){r.push(make_node(H,e.init,{body:e.init}))}if(e.condition){r.push(make_node(H,e.condition,{body:e.condition}))}trim_unreachable_code(t,e.body,r);return make_node(W,e,{body:r})}if(n instanceof Te){if(is_break(n.body)){if(e.condition){e.condition=make_node(Je,e.condition,{left:e.condition,operator:"&&",right:n.condition.negate(t)})}else{e.condition=n.condition.negate(t)}drop_it(n.alternative)}else if(is_break(n.alternative)){if(e.condition){e.condition=make_node(Je,e.condition,{left:e.condition,operator:"&&",right:n.condition})}else{e.condition=n.condition}drop_it(n.body)}}return e;function is_break(e){return e instanceof be&&t.loopcontrol_target(e)===t.self()}function drop_it(n){n=as_statement_array(n);if(e.body instanceof W){e.body=e.body.clone();e.body.body=n.concat(e.body.body.slice(1));e.body=e.body.transform(t)}else{e.body=make_node(W,e.body,{body:n}).transform(t)}e=if_break_in_loop(e,t)}}def_optimize(ee,(function(e,t){if(!t.option("loops"))return e;if(t.option("side_effects")&&e.init){e.init=e.init.drop_side_effect_free(t)}if(e.condition){var n=e.condition.evaluate(t);if(!(n instanceof U)){if(n)e.condition=null;else if(!t.option("dead_code")){var r=e.condition;e.condition=make_node_from_constant(n,e.condition);e.condition=best_of_expression(e.condition.transform(t),r)}}if(t.option("dead_code")){if(n instanceof U)n=e.condition.tail_node().evaluate(t);if(!n){var i=[];trim_unreachable_code(t,e.body,i);if(e.init instanceof z){i.push(e.init)}else if(e.init){i.push(make_node(H,e.init,{body:e.init}))}i.push(make_node(H,e.condition,{body:e.condition}));return make_node(W,e,{body:i}).optimize(t)}}}return if_break_in_loop(e,t)}));def_optimize(Te,(function(e,t){if(is_empty(e.alternative))e.alternative=null;if(!t.option("conditionals"))return e;var n=e.condition.evaluate(t);if(!t.option("dead_code")&&!(n instanceof U)){var r=e.condition;e.condition=make_node_from_constant(n,r);e.condition=best_of_expression(e.condition.transform(t),r)}if(t.option("dead_code")){if(n instanceof U)n=e.condition.tail_node().evaluate(t);if(!n){var i=[];trim_unreachable_code(t,e.body,i);i.push(make_node(H,e.condition,{body:e.condition}));if(e.alternative)i.push(e.alternative);return make_node(W,e,{body:i}).optimize(t)}else if(!(n instanceof U)){var i=[];i.push(make_node(H,e.condition,{body:e.condition}));i.push(e.body);if(e.alternative){trim_unreachable_code(t,e.alternative,i)}return make_node(W,e,{body:i}).optimize(t)}}var o=e.condition.negate(t);var a=e.condition.size();var s=o.size();var u=s(e===p||e.expression instanceof Kt)&&(e.body.length===0||aborts(e)||a.length-1===t)))){for(let e=0;ee){if(is_inert_body(a[t--])){s++}else{break}}const u=a.splice(n-s,1+s);a.splice(e+1,0,...u);e+=u.length}}}}for(let e=0;e=0;e--){let n=a[e].body;if(is_break(n[n.length-1],t))n.pop();if(!is_inert_body(a[e]))break}e++;if(!p||a.indexOf(p)>=e){for(let n=a.length-1;n>=e;n--){let e=a[n];if(e===p){p=null;a.pop()}else if(!e.expression.has_side_effects(t)){a.pop()}else{break}}}}e:if(p){let e=a.indexOf(p);let n=e;for(;n=0;r--){let e=a[r];if(e===p)continue;if(e.expression.has_side_effects(t))break}if(n>r){let t=e-1;for(;t>=0;t--){if(!is_inert_body(a[t]))break}let i=Math.max(r,t)+1;let o=e;if(r>e){o=r;a[r].body=a[n].body}else{p.body=a[n].body}a.splice(o+1,n-o);a.splice(i,e-i)}}e:if(p){let n=a.findIndex((e=>!is_inert_body(e)));let r;if(n===a.length-1){let t=a[n];if(has_nested_break(e))break e;r=make_node(W,t,{body:t.body});t.body=[]}else if(n!==-1){break e}let i=a.find((e=>e!==p&&e.expression.has_side_effects(t)));if(!i){return make_node(W,e,{body:o.concat(statement(e.expression),p.expression?statement(p.expression):[],r||[])}).optimize(t)}const s=a.indexOf(p);a.splice(s,1);p=null;if(r){return make_node(W,e,{body:o.concat(e,r)}).optimize(t)}}if(a.length>0){a[0].body=o.concat(a[0].body)}if(a.length==0){return make_node(W,e,{body:o.concat(statement(e.expression))}).optimize(t)}if(a.length==1&&!has_nested_break(e)){let n=a[0];return make_node(Te,e,{condition:make_node(Je,e,{operator:"===",left:e.expression,right:n.expression}),body:make_node(W,n,{body:n.body}),alternative:null}).optimize(t)}if(a.length===2&&p&&!has_nested_break(e)){let n=a[0]===p?a[1]:a[0];let r=p.expression&&statement(p.expression);if(aborts(a[0])){let i=a[0];if(is_break(i.body[i.body.length-1],t)){i.body.pop()}return make_node(Te,e,{condition:make_node(Je,e,{operator:"===",left:e.expression,right:n.expression}),body:make_node(W,n,{body:n.body}),alternative:make_node(W,p,{body:[].concat(r||[],p.body)})}).optimize(t)}let i="===";let o=make_node(W,n,{body:n.body});let s=make_node(W,p,{body:[].concat(r||[],p.body)});if(a[0]===p){i="!==";let e=s;s=o;o=e}return make_node(W,e,{body:[make_node(Te,e,{condition:make_node(Je,e,{operator:i,left:e.expression,right:n.expression}),body:o,alternative:null})].concat(s)}).optimize(t)}return e;function eliminate_branch(e,n){if(n&&!aborts(n)){n.body=n.body.concat(e.body)}else{trim_unreachable_code(t,e,o)}}function branches_equivalent(e,t,n){let r=e.body;let i=t.body;if(n){r=r.concat(make_node(be))}if(r.length!==i.length)return false;let o=make_node(W,e,{body:r});let a=make_node(W,t,{body:i});return o.equivalent_to(a)}function statement(e){return make_node(H,e,{body:e})}function has_nested_break(e){let t=false;let n=new TreeWalker((e=>{if(t)return true;if(e instanceof se)return true;if(e instanceof H)return true;if(!is_break(e,n))return;let r=n.parent();if(r instanceof Ce&&r.body[r.body.length-1]===e){return}t=true}));e.walk(n);return t}function is_break(t,n){return t instanceof be&&n.loopcontrol_target(t)===e}function is_inert_body(e){return!aborts(e)&&!make_node(W,e,{body:e.body}).has_side_effects(t)}}));def_optimize(Oe,(function(e,t){tighten_body(e.body,t);if(e.bcatch&&e.bfinally&&e.bfinally.body.every(is_empty))e.bfinally=null;if(t.option("dead_code")&&e.body.every(is_empty)){var n=[];if(e.bcatch){trim_unreachable_code(t,e.bcatch,n)}if(e.bfinally)n.push(...e.bfinally.body);return make_node(W,e,{body:n}).optimize(t)}return e}));Ne.DEFMETHOD("remove_initializers",(function(){var e=[];this.definitions.forEach((function(t){if(t.name instanceof Dt){t.value=null;e.push(t)}else{walk(t.name,(n=>{if(n instanceof Dt){e.push(make_node(Be,t,{name:n,value:null}))}}))}}));this.definitions=e}));Ne.DEFMETHOD("to_assignments",(function(e){var t=e.option("reduce_vars");var n=[];for(const e of this.definitions){if(e.value){var r=make_node(Pt,e.name,e.name);n.push(make_node(tt,e,{operator:"=",logical:false,left:r,right:e.value}));if(t)r.definition().fixed=false}else if(e.value){var i=make_node(Be,e,{name:e.name,value:e.value});var o=make_node(we,e,{definitions:[i]});n.push(o)}const a=e.name.definition();a.eliminated++;a.replaced--}if(n.length==0)return null;return make_sequence(this,n)}));def_optimize(Ne,(function(e){if(e.definitions.length==0)return make_node(q,e);return e}));def_optimize(Be,(function(e,t){if(e.name instanceof At&&e.value!=null&&is_undefined(e.value,t)){e.value=null}return e}));def_optimize(Ve,(function(e){return e}));function retain_top_func(e,t){return t.top_retain&&e instanceof fe&&has_flag(e,Rn)&&e.name&&t.top_retain(e.name)}def_optimize(Ke,(function(e,t){var n=e.expression;var r=n;inline_array_like_spread(e.args);var i=e.args.every((e=>!(e instanceof ae)));if(t.option("reduce_vars")&&r instanceof Pt&&!has_annotation(e,an)){const e=r.fixed_value();if(!retain_top_func(e,t)){r=e}}var o=r instanceof se;if(o&&r.pinned())return e;if(t.option("unused")&&i&&o&&!r.uses_arguments){var a=0,s=0;for(var u=0,l=e.args.length;u=r.argnames.length;if(f||has_flag(r.argnames[u],Dn)){var c=e.args[u].drop_side_effect_free(t);if(c){e.args[a++]=c}else if(!f){e.args[a++]=make_node(Ht,e.args[u],{value:0});continue}}else{e.args[a++]=e.args[u]}s=a}e.args.length=s}if(t.option("unsafe")){if(n instanceof We&&n.start.value==="Array"&&n.property==="from"&&e.args.length===1){const[n]=e.args;if(n instanceof rt){return make_node(rt,n,{elements:n.elements}).optimize(t)}}if(is_undeclared_ref(n))switch(n.name){case"Array":if(e.args.length!=1){return make_node(rt,e,{elements:e.args}).optimize(t)}else if(e.args[0]instanceof Ht&&e.args[0].value<=11){const t=[];for(let n=0;n=1&&e.args.length<=2&&e.args.every((e=>{var n=e.evaluate(t);_.push(n);return e!==n}))){let[n,r]=_;n=regexp_source_fix(new RegExp(n).source);const i=make_node(Wt,e,{value:{source:n,flags:r}});if(i._eval(t)!==i){return i}}break}else if(n instanceof We)switch(n.property){case"toString":if(e.args.length==0&&!n.expression.may_throw_on_access(t)){return make_node(Je,e,{left:make_node(Gt,e,{value:""}),operator:"+",right:n.expression}).optimize(t)}break;case"join":if(n.expression instanceof rt)e:{var p;if(e.args.length>0){p=e.args[0].evaluate(t);if(p===e.args[0])break e}var d=[];var m=[];for(var u=0,l=n.expression.elements.length;u0){d.push(make_node(Gt,e,{value:m.join(p)}));m.length=0}d.push(h)}}if(m.length>0){d.push(make_node(Gt,e,{value:m.join(p)}))}if(d.length==0)return make_node(Gt,e,{value:""});if(d.length==1){if(d[0].is_string(t)){return d[0]}return make_node(Je,d[0],{operator:"+",left:make_node(Gt,e,{value:""}),right:d[0]})}if(p==""){var g;if(d[0].is_string(t)||d[1].is_string(t)){g=d.shift()}else{g=make_node(Gt,e,{value:""})}return d.reduce((function(e,t){return make_node(Je,t,{operator:"+",left:e,right:t})}),g).optimize(t)}var c=e.clone();c.expression=c.expression.clone();c.expression.expression=c.expression.expression.clone();c.expression.expression.elements=d;return best_of(t,e,c)}break;case"charAt":if(n.expression.is_string(t)){var v=e.args[0];var D=v?v.evaluate(t):0;if(D!==v){return make_node(Ye,n,{expression:n.expression,property:make_node_from_constant(D|0,v||n)}).optimize(t)}}break;case"apply":if(e.args.length==2&&e.args[1]instanceof rt){var b=e.args[1].elements.slice();b.unshift(e.args[0]);return make_node(Ke,e,{expression:make_node(We,n,{expression:n.expression,optional:false,property:"call"}),args:b}).optimize(t)}break;case"call":var S=n.expression;if(S instanceof Pt){S=S.fixed_value()}if(S instanceof se&&!S.contains_this()){return(e.args.length?make_sequence(this,[e.args[0],make_node(Ke,e,{expression:n.expression,args:e.args.slice(1)})]):make_node(Ke,e,{expression:n.expression,args:[]})).optimize(t)}break}}if(t.option("unsafe_Function")&&is_undeclared_ref(n)&&n.name=="Function"){if(e.args.length==0)return make_node(le,e,{argnames:[],body:[]}).optimize(t);var y=t.mangle_options&&t.mangle_options.nth_identifier||En;if(e.args.every((e=>e instanceof Gt))){try{var A="n(function("+e.args.slice(0,-1).map((function(e){return e.value})).join(",")+"){"+e.args[e.args.length-1].value+"})";var T=parse(A);var k={ie8:t.option("ie8"),nth_identifier:y};T.figure_out_scope(k);var C=new Compressor(t.options,{mangle_options:t.mangle_options});T=T.transform(C);T.figure_out_scope(k);T.compute_char_frequency(k);T.mangle_names(k);var R;walk(T,(e=>{if(is_func_expr(e)){R=e;return nn}}));var A=OutputStream();W.prototype._codegen.call(R,R,A);e.args=[make_node(Gt,e,{value:R.argnames.map((function(e){return e.print_to_string()})).join(",")}),make_node(Gt,e.args[e.args.length-1],{value:A.get().replace(/^{|}$/g,"")})];return e}catch(e){if(!(e instanceof JS_Parse_Error)){throw e}}}}var F=o&&r.body[0];var O=o&&!r.is_generator&&!r.async;var M=O&&t.option("inline")&&!e.is_callee_pure(t);if(M&&F instanceof ge){let n=F.value;if(!n||n.is_constant_expression()){if(n){n=n.clone(true)}else{n=make_node($t,e)}const r=e.args.concat(n);return make_sequence(e,r).optimize(t)}if(r.argnames.length===1&&r.argnames[0]instanceof Tt&&e.args.length<2&&n instanceof Pt&&n.name===r.argnames[0].name){const n=(e.args[0]||make_node($t)).optimize(t);let r;if(n instanceof Xe&&(r=t.parent())instanceof Ke&&r.expression===e){return make_sequence(e,[make_node(Ht,e,{value:0}),n])}return n}}if(M){var x,N,w=-1;let o;let a;let s;if(i&&!r.uses_arguments&&!(t.parent()instanceof pt)&&!(r.name&&r instanceof le)&&(a=can_flatten_body(F))&&(n===r||has_annotation(e,on)||t.option("unused")&&(o=n.definition()).references.length==1&&!is_recursive_ref(t,o)&&r.is_constant_expression(n.scope))&&!has_annotation(e,rn|an)&&!r.contains_this()&&can_inject_symbols()&&(s=find_scope(t))&&!scope_encloses_variables_in_this_scope(s,r)&&!function in_default_assign(){let e=0;let n;while(n=t.parent(e++)){if(n instanceof nt)return true;if(n instanceof X)break}return false}()&&!(x instanceof pt)){set_flag(r,kn);s.add_child_scope(r);return make_sequence(e,flatten_fn(a)).optimize(t)}}if(M&&has_annotation(e,on)){set_flag(r,kn);r=make_node(r.CTOR===fe?le:r.CTOR,r,r);r=r.clone(true);r.figure_out_scope({},{parent_scope:find_scope(t),toplevel:t.get_toplevel()});return make_node(Ke,e,{expression:r,args:e.args}).optimize(t)}const I=O&&t.option("side_effects")&&r.body.every(is_empty);if(I){var b=e.args.concat(make_node($t,e));return make_sequence(e,b).optimize(t)}if(t.option("negate_iife")&&t.parent()instanceof H&&is_iife_call(e)){return e.negate(t,true)}var P=e.evaluate(t);if(P!==e){P=make_node_from_constant(P,e).optimize(t);return best_of(t,P,e)}return e;function return_value(t){if(!t)return make_node($t,e);if(t instanceof ge){if(!t.value)return make_node($t,e);return t.value.clone(true)}if(t instanceof H){return make_node(Ze,t,{operator:"void",expression:t.body.clone(true)})}}function can_flatten_body(e){var n=r.body;var i=n.length;if(t.option("inline")<3){return i==1&&return_value(e)}e=null;for(var o=0;o!e.value))){return false}}else if(e){return false}else if(!(a instanceof q)){e=a}}return return_value(e)}function can_inject_args(e,t){for(var n=0,i=r.argnames.length;n=0;){var s=o.definitions[a].name;if(s instanceof _e||e.has(s.name)||vn.has(s.name)||x.conflicting_def(s.name)){return false}if(N)N.push(s.definition())}}return true}function can_inject_symbols(){var e=new Set;do{x=t.parent(++w);if(x.is_block_scope()&&x.block_scope){x.block_scope.variables.forEach((function(t){e.add(t.name)}))}if(x instanceof Me){if(x.argname){e.add(x.argname.name)}}else if(x instanceof $){N=[]}else if(x instanceof Pt){if(x.fixed_value()instanceof ie)return false}}while(!(x instanceof ie));var n=!(x instanceof oe)||t.toplevel.vars;var i=t.option("inline");if(!can_inject_vars(e,i>=3&&n))return false;if(!can_inject_args(e,i>=2&&n))return false;return!N||N.length==0||!is_reachable(r,N)}function append_var(t,n,r,i){var o=r.definition();const a=x.variables.has(r.name);if(!a){x.variables.set(r.name,o);x.enclosed.push(o);t.push(make_node(Be,r,{name:r,value:null}))}var s=make_node(Pt,r,r);o.references.push(s);if(i)n.push(make_node(tt,e,{operator:"=",logical:false,left:s,right:i.clone()}))}function flatten_args(t,n){var i=r.argnames.length;for(var o=e.args.length;--o>=i;){n.push(e.args[o])}for(o=i;--o>=0;){var a=r.argnames[o];var s=e.args[o];if(has_flag(a,Dn)||!a.name||x.conflicting_def(a.name)){if(s)n.push(s)}else{var u=make_node(bt,a,a);a.definition().orig.push(u);if(!s&&N)s=make_node($t,e);append_var(t,n,u,s)}}t.reverse();n.reverse()}function flatten_vars(e,t){var n=t.length;for(var i=0,o=r.body.length;ie.name!=c.name))){var f=r.variables.get(c.name);var _=make_node(Pt,c,c);f.references.push(_);t.splice(n++,0,make_node(tt,l,{operator:"=",logical:false,left:_,right:make_node($t,c)}))}}}}function flatten_fn(e){var n=[];var i=[];flatten_args(n,i);flatten_vars(n,i);i.push(e);if(n.length){const e=x.body.indexOf(t.parent(w-1))+1;x.body.splice(e,0,make_node(we,r,{definitions:n}))}return i.map((e=>e.clone(true)))}}));def_optimize(Ge,(function(e,t){if(t.option("unsafe")&&is_undeclared_ref(e.expression)&&["Object","RegExp","Function","Error","Array"].includes(e.expression.name))return make_node(Ke,e,e).transform(t);return e}));def_optimize(He,(function(e,t){if(!t.option("side_effects"))return e;var n=[];filter_for_side_effects();var r=n.length-1;trim_right_for_undefined();if(r==0){e=maintain_this_binding(t.parent(),t.self(),n[0]);if(!(e instanceof He))e=e.optimize(t);return e}e.expressions=n;return e;function filter_for_side_effects(){var r=first_in_statement(t);var i=e.expressions.length-1;e.expressions.forEach((function(e,o){if(o0&&is_undefined(n[r],t))r--;if(r0){var n=this.clone();n.right=make_sequence(this.right,t.slice(o));t=t.slice(0,o);t.push(n);return make_sequence(this,t).optimize(e)}}}return this}));var jn=makePredicate("== === != !== * & | ^");function is_object(e){return e instanceof rt||e instanceof se||e instanceof it||e instanceof pt}def_optimize(Je,(function(e,t){function reversible(){return e.left.is_constant()||e.right.is_constant()||!e.left.has_side_effects(t)&&!e.right.has_side_effects(t)}function reverse(t){if(reversible()){if(t)e.operator=t;var n=e.left;e.left=e.right;e.right=n}}if(jn.has(e.operator)){if(e.right.is_constant()&&!e.left.is_constant()){if(!(e.left instanceof Je&&I[e.left.operator]>=I[e.operator])){reverse()}}}e=e.lift_sequences(t);if(t.option("comparisons"))switch(e.operator){case"===":case"!==":var n=true;if(e.left.is_string(t)&&e.right.is_string(t)||e.left.is_number(t)&&e.right.is_number(t)||e.left.is_boolean()&&e.right.is_boolean()||e.left.equivalent_to(e.right)){e.operator=e.operator.substr(0,2)}case"==":case"!=":if(!n&&is_undefined(e.left,t)){e.left=make_node(Yt,e.left)}else if(t.option("typeofs")&&e.left instanceof Gt&&e.left.value=="undefined"&&e.right instanceof Ze&&e.right.operator=="typeof"){var r=e.right.expression;if(r instanceof Pt?r.is_declared(t):!(r instanceof Xe&&t.option("ie8"))){e.right=r;e.left=make_node($t,e.left).optimize(t);if(e.operator.length==2)e.operator+="="}}else if(e.left instanceof Pt&&e.right instanceof Pt&&e.left.definition()===e.right.definition()&&is_object(e.left.fixed_value())){return make_node(e.operator[0]=="="?tn:en,e)}break;case"&&":case"||":var i=e.left;if(i.operator==e.operator){i=i.right}if(i instanceof Je&&i.operator==(e.operator=="&&"?"!==":"===")&&e.right instanceof Je&&i.operator==e.right.operator&&(is_undefined(i.left,t)&&e.right.left instanceof Yt||i.left instanceof Yt&&is_undefined(e.right.left,t))&&!i.right.has_side_effects(t)&&i.right.equivalent_to(e.right.right)){var o=make_node(Je,e,{operator:i.operator.slice(0,-1),left:make_node(Yt,e),right:i.right});if(i!==e.left){o=make_node(Je,e,{operator:e.operator,left:e.left.left,right:o})}return o}break}if(e.operator=="+"&&t.in_boolean_context()){var a=e.left.evaluate(t);var s=e.right.evaluate(t);if(a&&typeof a=="string"){return make_sequence(e,[e.right,make_node(tn,e)]).optimize(t)}if(s&&typeof s=="string"){return make_sequence(e,[e.left,make_node(tn,e)]).optimize(t)}}if(t.option("comparisons")&&e.is_boolean()){if(!(t.parent()instanceof Je)||t.parent()instanceof tt){var u=make_node(Ze,e,{operator:"!",expression:e.negate(t,first_in_statement(t))});e=best_of(t,e,u)}if(t.option("unsafe_comps")){switch(e.operator){case"<":reverse(">");break;case"<=":reverse(">=");break}}}if(e.operator=="+"){if(e.right instanceof Gt&&e.right.getValue()==""&&e.left.is_string(t)){return e.left}if(e.left instanceof Gt&&e.left.getValue()==""&&e.right.is_string(t)){return e.right}if(e.left instanceof Je&&e.left.operator=="+"&&e.left.left instanceof Gt&&e.left.left.getValue()==""&&e.right.is_string(t)){e.left=e.left.right;return e}}if(t.option("evaluate")){switch(e.operator){case"&&":var a=has_flag(e.left,bn)?true:has_flag(e.left,Sn)?false:e.left.evaluate(t);if(!a){return maintain_this_binding(t.parent(),t.self(),e.left).optimize(t)}else if(!(a instanceof U)){return make_sequence(e,[e.left,e.right]).optimize(t)}var s=e.right.evaluate(t);if(!s){if(t.in_boolean_context()){return make_sequence(e,[e.left,make_node(en,e)]).optimize(t)}else{set_flag(e,Sn)}}else if(!(s instanceof U)){var l=t.parent();if(l.operator=="&&"&&l.left===t.self()||t.in_boolean_context()){return e.left.optimize(t)}}if(e.left.operator=="||"){var c=e.left.right.evaluate(t);if(!c)return make_node(et,e,{condition:e.left.left,consequent:e.right,alternative:e.left.right}).optimize(t)}break;case"||":var a=has_flag(e.left,bn)?true:has_flag(e.left,Sn)?false:e.left.evaluate(t);if(!a){return make_sequence(e,[e.left,e.right]).optimize(t)}else if(!(a instanceof U)){return maintain_this_binding(t.parent(),t.self(),e.left).optimize(t)}var s=e.right.evaluate(t);if(!s){var l=t.parent();if(l.operator=="||"&&l.left===t.self()||t.in_boolean_context()){return e.left.optimize(t)}}else if(!(s instanceof U)){if(t.in_boolean_context()){return make_sequence(e,[e.left,make_node(tn,e)]).optimize(t)}else{set_flag(e,bn)}}if(e.left.operator=="&&"){var c=e.left.right.evaluate(t);if(c&&!(c instanceof U))return make_node(et,e,{condition:e.left.left,consequent:e.left.right,alternative:e.right}).optimize(t)}break;case"??":if(is_nullish(e.left,t)){return e.right}var a=e.left.evaluate(t);if(!(a instanceof U)){return a==null?e.right:e.left}if(t.in_boolean_context()){const n=e.right.evaluate(t);if(!(n instanceof U)&&!n){return e.left}}}var f=true;switch(e.operator){case"+":if(e.right instanceof Kt&&e.left instanceof Je&&e.left.operator=="+"&&e.left.is_string(t)){var _=make_node(Je,e,{operator:"+",left:e.left.right,right:e.right});var p=_.optimize(t);if(_!==p){e=make_node(Je,e,{operator:"+",left:e.left.left,right:p})}}if(e.left instanceof Je&&e.left.operator=="+"&&e.left.is_string(t)&&e.right instanceof Je&&e.right.operator=="+"&&e.right.is_string(t)){var _=make_node(Je,e,{operator:"+",left:e.left.right,right:e.right.left});var d=_.optimize(t);if(_!==d){e=make_node(Je,e,{operator:"+",left:make_node(Je,e.left,{operator:"+",left:e.left.left,right:d}),right:e.right.right})}}if(e.right instanceof Ze&&e.right.operator=="-"&&e.left.is_number(t)){e=make_node(Je,e,{operator:"-",left:e.left,right:e.right.expression});break}if(e.left instanceof Ze&&e.left.operator=="-"&&reversible()&&e.right.is_number(t)){e=make_node(Je,e,{operator:"-",left:e.right,right:e.left.expression});break}if(e.left instanceof de){var m=e.left;var p=e.right.evaluate(t);if(p!=e.right){m.segments[m.segments.length-1].value+=String(p);return m}}if(e.right instanceof de){var p=e.right;var m=e.left.evaluate(t);if(m!=e.left){p.segments[0].value=String(m)+p.segments[0].value;return p}}if(e.left instanceof de&&e.right instanceof de){var m=e.left;var h=m.segments;var p=e.right;h[h.length-1].value+=p.segments[0].value;for(var E=1;E=I[e.operator])){var g=make_node(Je,e,{operator:e.operator,left:e.right,right:e.left});if(e.right instanceof Kt&&!(e.left instanceof Kt)){e=best_of(t,g,e)}else{e=best_of(t,e,g)}}if(f&&e.is_number(t)){if(e.right instanceof Je&&e.right.operator==e.operator){e=make_node(Je,e,{operator:e.operator,left:make_node(Je,e.left,{operator:e.operator,left:e.left,right:e.right.left,start:e.left.start,end:e.right.left.end}),right:e.right.right})}if(e.right instanceof Kt&&e.left instanceof Je&&e.left.operator==e.operator){if(e.left.left instanceof Kt){e=make_node(Je,e,{operator:e.operator,left:make_node(Je,e.left,{operator:e.operator,left:e.left.left,right:e.right,start:e.left.left.start,end:e.right.end}),right:e.left.right})}else if(e.left.right instanceof Kt){e=make_node(Je,e,{operator:e.operator,left:make_node(Je,e.left,{operator:e.operator,left:e.left.right,right:e.right,start:e.left.right.start,end:e.right.end}),right:e.left.left})}}if(e.left instanceof Je&&e.left.operator==e.operator&&e.left.right instanceof Kt&&e.right instanceof Je&&e.right.operator==e.operator&&e.right.left instanceof Kt){e=make_node(Je,e,{operator:e.operator,left:make_node(Je,e.left,{operator:e.operator,left:make_node(Je,e.left.left,{operator:e.operator,left:e.left.right,right:e.right.left,start:e.left.right.start,end:e.right.left.end}),right:e.left.left}),right:e.right.right})}}}}if(e.right instanceof Je&&e.right.operator==e.operator&&(In.has(e.operator)||e.operator=="+"&&(e.right.left.is_string(t)||e.left.is_string(t)&&e.right.right.is_string(t)))){e.left=make_node(Je,e.left,{operator:e.operator,left:e.left.transform(t),right:e.right.left.transform(t)});e.right=e.right.right.transform(t);return e.transform(t)}var v=e.evaluate(t);if(v!==e){v=make_node_from_constant(v,e).optimize(t);return best_of(t,v,e)}return e}));def_optimize(Bt,(function(e){return e}));function within_array_or_object_literal(e){var t,n=0;while(t=e.parent(n++)){if(t instanceof z)return false;if(t instanceof rt||t instanceof at||t instanceof it){return true}}return false}def_optimize(Pt,(function(e,t){if(!t.option("ie8")&&is_undeclared_ref(e)&&!t.find_parent(re)){switch(e.name){case"undefined":return make_node($t,e).optimize(t);case"NaN":return make_node(jt,e).optimize(t);case"Infinity":return make_node(Qt,e).optimize(t)}}const n=t.parent();if(t.option("reduce_vars")&&is_lhs(e,n)!==e){const o=e.definition();const a=find_scope(t);if(t.top_retain&&o.global&&t.top_retain(o)){o.fixed=false;o.single_use=false;return e}let s=e.fixed_value();let u=o.single_use&&!(n instanceof Ke&&n.is_callee_pure(t)||has_annotation(n,an))&&!(n instanceof ze&&s instanceof se&&s.name);if(u&&s instanceof U){u=!s.has_side_effects(t)&&!s.may_throw(t)}if(u&&(s instanceof se||s instanceof pt)){if(retain_top_func(s,t)){u=false}else if(o.scope!==e.scope&&(o.escaped==1||has_flag(s,An)||within_array_or_object_literal(t)||!t.option("reduce_funcs"))){u=false}else if(is_recursive_ref(t,o)){u=false}else if(o.scope!==e.scope||o.orig[0]instanceof Tt){u=s.is_constant_expression(e.scope);if(u=="f"){var r=e.scope;do{if(r instanceof fe||is_func_expr(r)){set_flag(r,An)}}while(r=r.parent_scope)}}}if(u&&s instanceof se){u=o.scope===e.scope&&!scope_encloses_variables_in_this_scope(a,s)||n instanceof Ke&&n.expression===e&&!scope_encloses_variables_in_this_scope(a,s)&&!(s.name&&s.name.definition().recursive_refs>0)}if(u&&s){if(s instanceof ht){set_flag(s,kn);s=make_node(Et,s,s)}if(s instanceof fe){set_flag(s,kn);s=make_node(le,s,s)}if(o.recursive_refs>0&&s.name instanceof kt){const e=s.name.definition();let t=s.variables.get(s.name.name);let n=t&&t.orig[0];if(!(n instanceof Ft)){n=make_node(Ft,s.name,s.name);n.scope=s;s.name=n;t=s.def_function(n)}walk(s,(n=>{if(n instanceof Pt&&n.definition()===e){n.thedef=t;t.references.push(n)}}))}if((s instanceof se||s instanceof pt)&&s.parent_scope!==a){s=s.clone(true,t.get_toplevel());a.add_child_scope(s)}return s.optimize(t)}if(s){let n;if(s instanceof Ut){if(!(o.orig[0]instanceof Tt)&&o.references.every((e=>o.scope===e.scope))){n=s}}else{var i=s.evaluate(t);if(i!==s&&(t.option("unsafe_regexp")||!(i instanceof RegExp))){n=make_node_from_constant(i,s)}}if(n){const r=e.size(t);const i=n.size(t);let a=0;if(t.option("unused")&&!t.exposed(o)){a=(r+2+i)/(o.references.length-o.assignments)}if(i<=r+a){return n}}}}return e}));function scope_encloses_variables_in_this_scope(e,t){for(const n of t.enclosed){if(t.variables.has(n.name)){continue}const r=e.find_variable(n.name);if(r){if(r===n)continue;return true}}return false}function is_atomic(e,t){return e instanceof Pt||e.TYPE===t.TYPE}def_optimize($t,(function(e,t){if(t.option("unsafe_undefined")){var n=find_variable(t,"undefined");if(n){var r=make_node(Pt,e,{name:"undefined",scope:n.scope,thedef:n});set_flag(r,yn);return r}}var i=is_lhs(t.self(),t.parent());if(i&&is_atomic(i,e))return e;return make_node(Ze,e,{operator:"void",expression:make_node(Ht,e,{value:0})})}));def_optimize(Qt,(function(e,t){var n=is_lhs(t.self(),t.parent());if(n&&is_atomic(n,e))return e;if(t.option("keep_infinity")&&!(n&&!is_atomic(n,e))&&!find_variable(t,"Infinity")){return e}return make_node(Je,e,{operator:"/",left:make_node(Ht,e,{value:1}),right:make_node(Ht,e,{value:0})})}));def_optimize(jt,(function(e,t){var n=is_lhs(t.self(),t.parent());if(n&&!is_atomic(n,e)||find_variable(t,"NaN")){return make_node(Je,e,{operator:"/",left:make_node(Ht,e,{value:0}),right:make_node(Ht,e,{value:0})})}return e}));function is_reachable(e,t){const find_ref=e=>{if(e instanceof Pt&&member(e.definition(),t)){return nn}};return walk_parent(e,((t,n)=>{if(t instanceof ie&&t!==e){var r=n.parent();if(r instanceof Ke&&r.expression===t&&!(t.async||t.is_generator)){return}if(walk(t,find_ref))return nn;return true}}))}const $n=makePredicate("+ - / * % >> << >>> | ^ &");const Zn=makePredicate("* | ^ &");def_optimize(tt,(function(e,t){if(e.logical){return e.lift_sequences(t)}var n;if(t.option("dead_code")&&e.left instanceof Pt&&(n=e.left.definition()).scope===t.find_parent(se)){var r=0,i,o=e;do{i=o;o=t.parent(r++);if(o instanceof Ee){if(in_try(r,o))break;if(is_reachable(n.scope,[n]))break;if(e.operator=="=")return e.right;n.fixed=false;return make_node(Je,e,{operator:e.operator.slice(0,-1),left:e.left,right:e.right}).optimize(t)}}while(o instanceof Je&&o.right===i||o instanceof He&&o.tail_node()===i)}e=e.lift_sequences(t);if(e.operator=="="&&e.left instanceof Pt&&e.right instanceof Je){if(e.right.left instanceof Pt&&e.right.left.name==e.left.name&&$n.has(e.right.operator)){e.operator=e.right.operator+"=";e.right=e.right.right}else if(e.right.right instanceof Pt&&e.right.right.name==e.left.name&&Zn.has(e.right.operator)&&!e.right.left.has_side_effects(t)){e.operator=e.right.operator+"=";e.right=e.right.left}}return e;function in_try(n,r){var i=e.right;e.right=make_node(Yt,i);var o=r.may_throw(t);e.right=i;var a=e.left.definition().scope;var s;while((s=t.parent(n++))!==a){if(s instanceof Oe){if(s.bfinally)return true;if(o&&s.bcatch)return true}}}}));def_optimize(nt,(function(e,t){if(!t.option("evaluate")){return e}var n=e.right.evaluate(t);if(n===undefined){e=e.left}else if(n!==e.right){n=make_node_from_constant(n,e.right);e.right=best_of_expression(n,e.right)}return e}));function is_nullish_check(e,t,n){if(t.may_throw(n))return false;let r;if(e instanceof Je&&e.operator==="=="&&((r=is_nullish(e.left,n)&&e.left)||(r=is_nullish(e.right,n)&&e.right))&&(r===e.left?e.right:e.left).equivalent_to(t)){return true}if(e instanceof Je&&e.operator==="||"){let r;let i;const find_comparison=e=>{if(!(e instanceof Je&&(e.operator==="==="||e.operator==="=="))){return false}let o=0;let a;if(e.left instanceof Yt){o++;r=e;a=e.right}if(e.right instanceof Yt){o++;r=e;a=e.left}if(is_undefined(e.left,n)){o++;i=e;a=e.right}if(is_undefined(e.right,n)){o++;i=e;a=e.left}if(o!==1){return false}if(!a.equivalent_to(t)){return false}return true};if(!find_comparison(e.left))return false;if(!find_comparison(e.right))return false;if(r&&i&&r!==i){return true}}return false}def_optimize(et,(function(e,t){if(!t.option("conditionals"))return e;if(e.condition instanceof He){var n=e.condition.expressions.slice();e.condition=n.pop();n.push(e);return make_sequence(e,n)}var r=e.condition.evaluate(t);if(r!==e.condition){if(r){return maintain_this_binding(t.parent(),t.self(),e.consequent)}else{return maintain_this_binding(t.parent(),t.self(),e.alternative)}}var i=r.negate(t,first_in_statement(t));if(best_of(t,r,i)===i){e=make_node(et,e,{condition:i,consequent:e.alternative,alternative:e.consequent})}var o=e.condition;var a=e.consequent;var s=e.alternative;if(o instanceof Pt&&a instanceof Pt&&o.definition()===a.definition()){return make_node(Je,e,{operator:"||",left:o,right:s})}if(a instanceof tt&&s instanceof tt&&a.operator===s.operator&&a.logical===s.logical&&a.left.equivalent_to(s.left)&&(!e.condition.has_side_effects(t)||a.operator=="="&&!a.left.has_side_effects(t))){return make_node(tt,e,{operator:a.operator,left:a.left,logical:a.logical,right:make_node(et,e,{condition:e.condition,consequent:a.right,alternative:s.right})})}var u;if(a instanceof Ke&&s.TYPE===a.TYPE&&a.args.length>0&&a.args.length==s.args.length&&a.expression.equivalent_to(s.expression)&&!e.condition.has_side_effects(t)&&!a.expression.has_side_effects(t)&&typeof(u=single_arg_diff())=="number"){var l=a.clone();l.args[u]=make_node(et,e,{condition:e.condition,consequent:a.args[u],alternative:s.args[u]});return l}if(s instanceof et&&a.equivalent_to(s.consequent)){return make_node(et,e,{condition:make_node(Je,e,{operator:"||",left:o,right:s.condition}),consequent:a,alternative:s.alternative}).optimize(t)}if(t.option("ecma")>=2020&&is_nullish_check(o,s,t)){return make_node(Je,e,{operator:"??",left:s,right:a}).optimize(t)}if(s instanceof He&&a.equivalent_to(s.expressions[s.expressions.length-1])){return make_sequence(e,[make_node(Je,e,{operator:"||",left:o,right:make_sequence(e,s.expressions.slice(0,-1))}),a]).optimize(t)}if(s instanceof Je&&s.operator=="&&"&&a.equivalent_to(s.right)){return make_node(Je,e,{operator:"&&",left:make_node(Je,e,{operator:"||",left:o,right:s.left}),right:a}).optimize(t)}if(a instanceof et&&a.alternative.equivalent_to(s)){return make_node(et,e,{condition:make_node(Je,e,{left:e.condition,operator:"&&",right:a.condition}),consequent:a.consequent,alternative:s})}if(a.equivalent_to(s)){return make_sequence(e,[e.condition,a]).optimize(t)}if(a instanceof Je&&a.operator=="||"&&a.right.equivalent_to(s)){return make_node(Je,e,{operator:"||",left:make_node(Je,e,{operator:"&&",left:e.condition,right:a.left}),right:s}).optimize(t)}const c=t.in_boolean_context();if(is_true(e.consequent)){if(is_false(e.alternative)){return booleanize(e.condition)}return make_node(Je,e,{operator:"||",left:booleanize(e.condition),right:e.alternative})}if(is_false(e.consequent)){if(is_true(e.alternative)){return booleanize(e.condition.negate(t))}return make_node(Je,e,{operator:"&&",left:booleanize(e.condition.negate(t)),right:e.alternative})}if(is_true(e.alternative)){return make_node(Je,e,{operator:"||",left:booleanize(e.condition.negate(t)),right:e.consequent})}if(is_false(e.alternative)){return make_node(Je,e,{operator:"&&",left:booleanize(e.condition),right:e.consequent})}return e;function booleanize(e){if(e.is_boolean())return e;return make_node(Ze,e,{operator:"!",expression:e.negate(t)})}function is_true(e){return e instanceof tn||c&&e instanceof Kt&&e.getValue()||e instanceof Ze&&e.operator=="!"&&e.expression instanceof Kt&&!e.expression.getValue()}function is_false(e){return e instanceof en||c&&e instanceof Kt&&!e.getValue()||e instanceof Ze&&e.operator=="!"&&e.expression instanceof Kt&&e.expression.getValue()}function single_arg_diff(){var e=a.args;var t=s.args;for(var n=0,r=e.length;n=2015;var r=this.expression;if(r instanceof it){var i=r.properties;for(var o=i.length;--o>=0;){var a=i[o];if(""+(a instanceof ft?a.key.name:a.key)==e){const e=i.every((e=>(e instanceof at||n&&e instanceof ft&&!e.is_generator)&&!e.computed_key()));if(!e)return;if(!safe_to_flatten(a.value,t))return;return make_node(Ye,this,{expression:make_node(rt,r,{elements:i.map((function(e){var t=e.value;if(t instanceof ue){t=make_node(le,t,t)}var n=e.key;if(n instanceof U&&!(n instanceof Ct)){return make_sequence(e,[n,t])}return t}))}),property:make_node(Ht,this,{value:o})})}}}}));def_optimize(Ye,(function(e,t){var n=e.expression;var r=e.property;if(t.option("properties")){var i=r.evaluate(t);if(i!==r){if(typeof i=="string"){if(i=="undefined"){i=undefined}else{var o=parseFloat(i);if(o.toString()==i){i=o}}}r=e.property=best_of_expression(r,make_node_from_constant(i,r).transform(t));var a=""+i;if(is_basic_identifier_string(a)&&a.length<=r.size()+1){return make_node(We,e,{expression:n,optional:e.optional,property:a,quote:r.quote}).optimize(t)}}}var s;e:if(t.option("arguments")&&n instanceof Pt&&n.name=="arguments"&&n.definition().orig.length==1&&(s=n.scope)instanceof se&&s.uses_arguments&&!(s instanceof ce)&&r instanceof Ht){var u=r.getValue();var l=new Set;var c=s.argnames;for(var f=0;f1){p=null}}else if(!p&&!t.option("keep_fargs")&&u=s.argnames.length){p=s.create_symbol(Tt,{source:s,scope:s,tentative_name:"argument_"+s.argnames.length});s.argnames.push(p)}}if(p){var m=make_node(Pt,e,p);m.reference({});clear_flag(p,Dn);return m}}if(is_lhs(e,t.parent()))return e;if(i!==r){var h=e.flatten_object(a,t);if(h){n=e.expression=h.expression;r=e.property=h.property}}if(t.option("properties")&&t.option("side_effects")&&r instanceof Ht&&n instanceof rt){var u=r.getValue();var E=n.elements;var g=E[u];e:if(safe_to_flatten(g,t)){var v=true;var D=[];for(var b=E.length;--b>u;){var o=E[b].drop_side_effect_free(t);if(o){D.unshift(o);if(v&&o.has_side_effects(t))v=false}}if(g instanceof ae)break e;g=g instanceof Zt?make_node($t,g):g;if(!v)D.unshift(g);while(--b>=0){var o=E[b];if(o instanceof ae)break e;o=o.drop_side_effect_free(t);if(o)D.unshift(o);else u--}if(v){D.push(g);return make_sequence(e,D).optimize(t)}else return make_node(Ye,e,{expression:make_node(rt,n,{elements:D}),property:make_node(Ht,r,{value:u})})}}var S=e.evaluate(t);if(S!==e){S=make_node_from_constant(S,e).optimize(t);return best_of(t,S,e)}return e}));def_optimize(je,(function(e,t){if(is_nullish(e.expression,t)){let n=t.parent();if(n instanceof Ze&&n.operator==="delete"){return make_node_from_constant(0,e)}return make_node($t,e)}return e}));se.DEFMETHOD("contains_this",(function(){return walk(this,(e=>{if(e instanceof Ut)return nn;if(e!==this&&e instanceof ie&&!(e instanceof ce)){return true}}))}));def_optimize(We,(function(e,t){const n=t.parent();if(is_lhs(e,n))return e;if(t.option("unsafe_proto")&&e.expression instanceof We&&e.expression.property=="prototype"){var r=e.expression.expression;if(is_undeclared_ref(r))switch(r.name){case"Array":e.expression=make_node(rt,e.expression,{elements:[]});break;case"Function":e.expression=make_node(le,e.expression,{argnames:[],body:[]});break;case"Number":e.expression=make_node(Ht,e.expression,{value:0});break;case"Object":e.expression=make_node(it,e.expression,{properties:[]});break;case"RegExp":e.expression=make_node(Wt,e.expression,{value:{source:"t",flags:""}});break;case"String":e.expression=make_node(Gt,e.expression,{value:""});break}}if(!(n instanceof Ke)||!has_annotation(n,an)){const n=e.flatten_object(e.property,t);if(n)return n.optimize(t)}let i=e.evaluate(t);if(i!==e){i=make_node_from_constant(i,e).optimize(t);return best_of(t,i,e)}return e}));function literals_in_boolean_context(e,t){if(t.in_boolean_context()){return best_of(t,e,make_sequence(e,[e,make_node(tn,e)]).optimize(t))}return e}function inline_array_like_spread(e){for(var t=0;te instanceof Zt))){e.splice(t,1,...r.elements);t--}}}}def_optimize(rt,(function(e,t){var n=literals_in_boolean_context(e,t);if(n!==e){return n}inline_array_like_spread(e.elements);return e}));function inline_object_prop_spread(e,t){for(var n=0;ne instanceof at))){e.splice(n,1,...i.properties);n--}else if(i instanceof Kt&&!(i instanceof Gt)){e.splice(n,1);n--}else if(is_nullish(i,t)){e.splice(n,1);n--}}}}def_optimize(it,(function(e,t){var n=literals_in_boolean_context(e,t);if(n!==e){return n}inline_object_prop_spread(e.properties,t);return e}));def_optimize(Wt,literals_in_boolean_context);def_optimize(ge,(function(e,t){if(e.value&&is_undefined(e.value,t)){e.value=null}return e}));def_optimize(ce,opt_AST_Lambda);def_optimize(le,(function(e,t){e=opt_AST_Lambda(e,t);if(t.option("unsafe_arrows")&&t.option("ecma")>=2015&&!e.name&&!e.is_generator&&!e.uses_arguments&&!e.pinned()){const n=walk(e,(e=>{if(e instanceof Ut)return nn}));if(!n)return make_node(ce,e,e).optimize(t)}return e}));def_optimize(pt,(function(e){return e}));def_optimize(Ae,(function(e,t){if(e.expression&&!e.is_star&&is_undefined(e.expression,t)){e.expression=null}return e}));def_optimize(de,(function(e,t){if(!t.option("evaluate")||t.parent()instanceof pe){return e}var n=[];for(var r=0;r=2015&&(!(n instanceof RegExp)||n.test(e.key+""))){var r=e.key;var i=e.value;var o=i instanceof ce&&Array.isArray(i.body)&&!i.contains_this();if((o||i instanceof le)&&!i.name){return make_node(ft,e,{async:i.async,is_generator:i.is_generator,key:r instanceof U?r:make_node(Ct,e,{name:r}),value:make_node(ue,i,i),quote:e.quote})}}return e}));def_optimize(_e,(function(e,t){if(t.option("pure_getters")==true&&t.option("unused")&&!e.is_array&&Array.isArray(e.names)&&!is_destructuring_export_decl(t)&&!(e.names[e.names.length-1]instanceof ae)){var n=[];for(var r=0;rf.add(e)));var _=!!t.keep_quoted;e.walk(new TreeWalker((function(e){if(e instanceof mt||e instanceof _t||e instanceof ut||e instanceof st||e instanceof qe);else if(e instanceof at){if(typeof e.key=="string"&&(!_||!e.quote)){add(e.key)}}else if(e instanceof ot){if(!_||!e.quote){add(e.key.name)}}else if(e instanceof We){var n=!!t.undeclared;if(!n){var r=e;while(r.expression){r=r.expression}n=!(r.thedef&&r.thedef.undeclared)}if(n&&(!_||!e.quote)){add(e.property)}}else if(e instanceof Ye){if(!_){addStrings(e.property,add)}}else if(e instanceof Ke&&e.expression.print_to_string()=="Object.defineProperty"){addStrings(e.args[1],add)}else if(e instanceof Je&&e.operator==="in"){addStrings(e.left,add)}})));return e.transform(new TreeTransformer((function(e){if(e instanceof mt||e instanceof _t||e instanceof ut||e instanceof st||e instanceof qe);else if(e instanceof at){if(typeof e.key=="string"&&(!_||!e.quote)){e.key=mangle(e.key)}}else if(e instanceof ot){if(!_||!e.quote){e.key.name=mangle(e.key.name)}}else if(e instanceof We){if(!_||!e.quote){e.property=mangle(e.property)}}else if(!_&&e instanceof Ye){e.property=mangleStrings(e.property)}else if(e instanceof Ke&&e.expression.print_to_string()=="Object.defineProperty"){e.args[1]=mangleStrings(e.args[1])}else if(e instanceof Je&&e.operator==="in"){e.left=mangleStrings(e.left)}})));function can_mangle(e){if(f.has(e))return false;if(i.has(e))return false;if(t.only_cache){return a.has(e)}if(/^-?[0-9]+(\.[0-9]+)?(e[+-][0-9]+)?$/.test(e))return false;return true}function should_mangle(e){if(s&&!s.test(e))return false;if(i.has(e))return false;return a.has(e)||c.has(e)}function add(e){if(can_mangle(e))c.add(e);if(!should_mangle(e)){f.add(e)}}function mangle(e){if(!should_mangle(e)){return e}var t=a.get(e);if(!t){if(u){var r="_$"+e+"$"+l+"_";if(can_mangle(r)){t=r}}if(!t){do{t=n.get(++o)}while(!can_mangle(t))}a.set(e,t)}return t}function mangleStrings(e){return e.transform(new TreeTransformer((function(e){if(e instanceof He){var t=e.expressions.length-1;e.expressions[t]=mangleStrings(e.expressions[t])}else if(e instanceof Gt){e.value=mangle(e.value)}else if(e instanceof et){e.consequent=mangleStrings(e.consequent);e.alternative=mangleStrings(e.alternative)}return e})))}}var Jn=typeof atob=="undefined"?function(e){return Buffer.from(e,"base64").toString()}:atob;var er=typeof btoa=="undefined"?function(e){return Buffer.from(e).toString("base64")}:btoa;function read_source_map(e){var t=/(?:^|[^.])\/\/# sourceMappingURL=data:application\/json(;[\w=-]*)?;base64,([+/0-9A-Za-z]*=*)\s*$/.exec(e);if(!t){console.warn("inline source map not found");return null}return Jn(t[2])}function set_shorthand(e,t,n){if(t[e]){n.forEach((function(n){if(t[n]){if(typeof t[n]!="object")t[n]={};if(!(e in t[n]))t[n][e]=t[e]}}))}}function init_cache(e){if(!e)return;if(!("props"in e)){e.props=new Map}else if(!(e.props instanceof Map)){e.props=map_from_object(e.props)}}function cache_to_json(e){return{props:map_to_object(e.props)}}async function minify(e,t){t=defaults(t,{compress:{},ecma:undefined,enclose:false,ie8:false,keep_classnames:undefined,keep_fnames:false,mangle:{},module:false,nameCache:null,output:null,format:null,parse:{},rename:undefined,safari10:false,sourceMap:false,spidermonkey:false,timings:false,toplevel:false,warnings:false,wrap:false},true);var n=t.timings&&{start:Date.now()};if(t.keep_classnames===undefined){t.keep_classnames=t.keep_fnames}if(t.rename===undefined){t.rename=t.compress&&t.mangle}if(t.output&&t.format){throw new Error("Please only specify either output or format option, preferrably format.")}t.format=t.format||t.output||{};set_shorthand("ecma",t,["parse","compress","format"]);set_shorthand("ie8",t,["compress","mangle","format"]);set_shorthand("keep_classnames",t,["compress","mangle"]);set_shorthand("keep_fnames",t,["compress","mangle"]);set_shorthand("module",t,["parse","compress","mangle"]);set_shorthand("safari10",t,["mangle","format"]);set_shorthand("toplevel",t,["compress","mangle"]);set_shorthand("warnings",t,["compress"]);var r;if(t.mangle){t.mangle=defaults(t.mangle,{cache:t.nameCache&&(t.nameCache.vars||{}),eval:false,ie8:false,keep_classnames:false,keep_fnames:false,module:false,nth_identifier:En,properties:false,reserved:[],safari10:false,toplevel:false},true);if(t.mangle.properties){if(typeof t.mangle.properties!="object"){t.mangle.properties={}}if(t.mangle.properties.keep_quoted){r=t.mangle.properties.reserved;if(!Array.isArray(r))r=[];t.mangle.properties.reserved=r}if(t.nameCache&&!("cache"in t.mangle.properties)){t.mangle.properties.cache=t.nameCache.props||{}}}init_cache(t.mangle.cache);init_cache(t.mangle.properties.cache)}if(t.sourceMap){t.sourceMap=defaults(t.sourceMap,{asObject:false,content:null,filename:null,includeSources:false,root:null,url:null},true)}if(n)n.parse=Date.now();var i;if(e instanceof oe){i=e}else{if(typeof e=="string"||t.parse.spidermonkey&&!Array.isArray(e)){e=[e]}t.parse=t.parse||{};t.parse.toplevel=null;if(t.parse.spidermonkey){t.parse.toplevel=U.from_mozilla_ast(Object.keys(e).reduce((function(t,n){if(!t)return e[n];t.body=t.body.concat(e[n].body);return t}),null))}else{delete t.parse.spidermonkey;for(var o in e)if(HOP(e,o)){t.parse.filename=o;t.parse.toplevel=parse(e[o],t.parse);if(t.sourceMap&&t.sourceMap.content=="inline"){if(Object.keys(e).length>1)throw new Error("inline source map only works with singular input");t.sourceMap.content=read_source_map(e[o])}}}i=t.parse.toplevel}if(r&&t.mangle.properties.keep_quoted!=="strict"){reserve_quoted_keys(i,r)}if(t.wrap){i=i.wrap_commonjs(t.wrap)}if(t.enclose){i=i.wrap_enclose(t.enclose)}if(n)n.rename=Date.now();if(n)n.compress=Date.now();if(t.compress){i=new Compressor(t.compress,{mangle_options:t.mangle}).compress(i)}if(n)n.scope=Date.now();if(t.mangle)i.figure_out_scope(t.mangle);if(n)n.mangle=Date.now();if(t.mangle){i.compute_char_frequency(t.mangle);i.mangle_names(t.mangle);i=mangle_private_properties(i,t.mangle)}if(n)n.properties=Date.now();if(t.mangle&&t.mangle.properties){i=mangle_properties(i,t.mangle.properties)}if(n)n.format=Date.now();var a={};if(t.format.ast){a.ast=i}if(t.format.spidermonkey){a.ast=i.to_mozilla_ast()}if(!HOP(t.format,"code")||t.format.code){if(t.sourceMap){t.format.source_map=await SourceMap({file:t.sourceMap.filename,orig:t.sourceMap.content,root:t.sourceMap.root});if(t.sourceMap.includeSources){if(e instanceof oe){throw new Error("original source content unavailable")}else for(var o in e)if(HOP(e,o)){t.format.source_map.get().setSourceContent(o,e[o])}}}delete t.format.ast;delete t.format.code;delete t.format.spidermonkey;var s=OutputStream(t.format);i.print(s);a.code=s.get();if(t.sourceMap){if(t.sourceMap.asObject){a.map=t.format.source_map.get().toJSON()}else{a.map=t.format.source_map.toString()}if(t.sourceMap.url=="inline"){var u=typeof a.map==="object"?JSON.stringify(a.map):a.map;a.code+="\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,"+er(u)}else if(t.sourceMap.url){a.code+="\n//# sourceMappingURL="+t.sourceMap.url}}}if(t.nameCache&&t.mangle){if(t.mangle.cache)t.nameCache.vars=cache_to_json(t.mangle.cache);if(t.mangle.properties&&t.mangle.properties.cache){t.nameCache.props=cache_to_json(t.mangle.properties.cache)}}if(t.format&&t.format.source_map){t.format.source_map.destroy()}if(n){n.end=Date.now();a.timings={parse:.001*(n.rename-n.parse),rename:.001*(n.compress-n.rename),compress:.001*(n.scope-n.compress),scope:.001*(n.mangle-n.scope),mangle:.001*(n.properties-n.mangle),properties:.001*(n.format-n.properties),format:.001*(n.end-n.format),total:.001*(n.end-n.start)}}return a}async function run_cli({program:e,packageJson:t,fs:r,path:i}){const o=new Set(["cname","parent_scope","scope","uses_eval","uses_with"]);var a={};var s={compress:false,mangle:false};const u=await _default_options();e.version(t.name+" "+t.version);e.parseArgv=e.parse;e.parse=undefined;if(process.argv.includes("ast"))e.helpInformation=describe_ast;else if(process.argv.includes("options"))e.helpInformation=function(){var e=[];for(var t in u){e.push("--"+(t==="sourceMap"?"source-map":t)+" options:");e.push(format_object(u[t]));e.push("")}return e.join("\n")};e.option("-p, --parse ","Specify parser options.",parse_js());e.option("-c, --compress [options]","Enable compressor/specify compressor options.",parse_js());e.option("-m, --mangle [options]","Mangle names/specify mangler options.",parse_js());e.option("--mangle-props [options]","Mangle properties/specify mangler options.",parse_js());e.option("-f, --format [options]","Format options.",parse_js());e.option("-b, --beautify [options]","Alias for --format.",parse_js());e.option("-o, --output ","Output file (default STDOUT).");e.option("--comments [filter]","Preserve copyright comments in the output.");e.option("--config-file ","Read minify() options from JSON file.");e.option("-d, --define [=value]","Global definitions.",parse_js("define"));e.option("--ecma ","Specify ECMAScript release: 5, 2015, 2016 or 2017...");e.option("-e, --enclose [arg[,...][:value[,...]]]","Embed output in a big function with configurable arguments and values.");e.option("--ie8","Support non-standard Internet Explorer 8.");e.option("--keep-classnames","Do not mangle/drop class names.");e.option("--keep-fnames","Do not mangle/drop function names. Useful for code relying on Function.prototype.name.");e.option("--module","Input is an ES6 module");e.option("--name-cache ","File to hold mangled name mappings.");e.option("--rename","Force symbol expansion.");e.option("--no-rename","Disable symbol expansion.");e.option("--safari10","Support non-standard Safari 10.");e.option("--source-map [options]","Enable source map/specify source map options.",parse_js());e.option("--timings","Display operations run time on STDERR.");e.option("--toplevel","Compress and/or mangle variables in toplevel scope.");e.option("--wrap ","Embed everything as a function with “exports” corresponding to “name” globally.");e.arguments("[files...]").parseArgv(process.argv);if(e.configFile){s=JSON.parse(read_file(e.configFile))}if(!e.output&&e.sourceMap&&e.sourceMap.url!="inline"){fatal("ERROR: cannot write source map to STDOUT")}["compress","enclose","ie8","mangle","module","safari10","sourceMap","toplevel","wrap"].forEach((function(t){if(t in e){s[t]=e[t]}}));if("ecma"in e){if(e.ecma!=(e.ecma|0))fatal("ERROR: ecma must be an integer");const t=e.ecma|0;if(t>5&&t<2015)s.ecma=t+2009;else s.ecma=t}if(e.format||e.beautify){const t=e.format||e.beautify;s.format=typeof t==="object"?t:{}}if(e.comments){if(typeof s.format!="object")s.format={};s.format.comments=typeof e.comments=="string"?e.comments=="false"?false:e.comments:"some"}if(e.define){if(typeof s.compress!="object")s.compress={};if(typeof s.compress.global_defs!="object")s.compress.global_defs={};for(var l in e.define){s.compress.global_defs[l]=e.define[l]}}if(e.keepClassnames){s.keep_classnames=true}if(e.keepFnames){s.keep_fnames=true}if(e.mangleProps){if(e.mangleProps.domprops){delete e.mangleProps.domprops}else{if(typeof e.mangleProps!="object")e.mangleProps={};if(!Array.isArray(e.mangleProps.reserved))e.mangleProps.reserved=[]}if(typeof s.mangle!="object")s.mangle={};s.mangle.properties=e.mangleProps}if(e.nameCache){s.nameCache=JSON.parse(read_file(e.nameCache,"{}"))}if(e.output=="ast"){s.format={ast:true,code:false}}if(e.parse){if(!e.parse.acorn&&!e.parse.spidermonkey){s.parse=e.parse}else if(e.sourceMap&&e.sourceMap.content=="inline"){fatal("ERROR: inline source map only works with built-in parser")}}if(~e.rawArgs.indexOf("--rename")){s.rename=true}else if(!e.rename){s.rename=false}let convert_path=e=>e;if(typeof e.sourceMap=="object"&&"base"in e.sourceMap){convert_path=function(){var t=e.sourceMap.base;delete s.sourceMap.base;return function(e){return i.relative(t,e)}}()}let c;if(s.files&&s.files.length){c=s.files;delete s.files}else if(e.args.length){c=e.args}if(c){simple_glob(c).forEach((function(e){a[convert_path(e)]=read_file(e)}))}else{await new Promise((e=>{var t=[];process.stdin.setEncoding("utf8");process.stdin.on("data",(function(e){t.push(e)})).on("end",(function(){a=[t.join("")];e()}));process.stdin.resume()}))}await run_cli();function convert_ast(e){return U.from_mozilla_ast(Object.keys(a).reduce(e,null))}async function run_cli(){var t=e.sourceMap&&e.sourceMap.content;if(t&&t!=="inline"){s.sourceMap.content=read_file(t,t)}if(e.timings)s.timings=true;try{if(e.parse){if(e.parse.acorn){a=convert_ast((function(t,r){return n(988).parse(a[r],{ecmaVersion:2018,locations:true,program:t,sourceFile:r,sourceType:s.module||e.parse.module?"module":"script"})}))}else if(e.parse.spidermonkey){a=convert_ast((function(e,t){var n=JSON.parse(a[t]);if(!e)return n;e.body=e.body.concat(n.body);return e}))}}}catch(e){fatal(e)}let i;try{i=await minify(a,s)}catch(e){if(e.name=="SyntaxError"){print_error("Parse error at "+e.filename+":"+e.line+","+e.col);var u=e.col;var l=a[e.filename].split(/\r?\n/);var c=l[e.line-1];if(!c&&!u){c=l[e.line-2];u=c.length}if(c){var f=70;if(u>f){c=c.slice(u-f);u=f}print_error(c.slice(0,80));print_error(c.slice(0,u).replace(/\S/g," ")+"^")}}if(e.defs){print_error("Supported options:");print_error(format_object(e.defs))}fatal(e);return}if(e.output=="ast"){if(!s.compress&&!s.mangle){i.ast.figure_out_scope({})}console.log(JSON.stringify(i.ast,(function(e,t){if(t)switch(e){case"thedef":return symdef(t);case"enclosed":return t.length?t.map(symdef):undefined;case"variables":case"globals":return t.size?collect_from_map(t,symdef):undefined}if(o.has(e))return;if(t instanceof AST_Token)return;if(t instanceof Map)return;if(t instanceof U){var n={_class:"AST_"+t.TYPE};if(t.block_scope){n.variables=t.block_scope.variables;n.enclosed=t.block_scope.enclosed}t.CTOR.PROPS.forEach((function(e){n[e]=t[e]}));return n}return t}),2))}else if(e.output=="spidermonkey"){try{const e=await minify(i.code,{compress:false,mangle:false,format:{ast:true,code:false}});console.log(JSON.stringify(e.ast.to_mozilla_ast(),null,2))}catch(e){fatal(e);return}}else if(e.output){r.writeFileSync(e.output,i.code);if(s.sourceMap&&s.sourceMap.url!=="inline"&&i.map){r.writeFileSync(e.output+".map",i.map)}}else{console.log(i.code)}if(e.nameCache){r.writeFileSync(e.nameCache,JSON.stringify(s.nameCache))}if(i.timings)for(var _ in i.timings){print_error("- "+_+": "+i.timings[_].toFixed(3)+"s")}}function fatal(e){if(e instanceof Error)e=e.stack.replace(/^\S*?Error:/,"ERROR:");print_error(e);process.exit(1)}function simple_glob(e){if(Array.isArray(e)){return[].concat.apply([],e.map(simple_glob))}if(e&&e.match(/[*?]/)){var t=i.dirname(e);try{var n=r.readdirSync(t)}catch(e){}if(n){var o="^"+i.basename(e).replace(/[.+^$[\]\\(){}]/g,"\\$&").replace(/\*/g,"[^/\\\\]*").replace(/\?/g,"[^/\\\\]")+"$";var a=process.platform==="win32"?"i":"";var s=new RegExp(o,a);var u=n.filter((function(e){return s.test(e)})).map((function(e){return i.join(t,e)}));if(u.length)return u}}return[e]}function read_file(e,t){try{return r.readFileSync(e,"utf8")}catch(e){if((e.code=="ENOENT"||e.code=="ENAMETOOLONG")&&t!=null)return t;fatal(e)}}function parse_js(e){return function(t,n){n=n||{};try{walk(parse(t,{expression:true}),(t=>{if(t instanceof tt){var r=t.left.print_to_string();var i=t.right;if(e){n[r]=i}else if(i instanceof rt){n[r]=i.elements.map(to_string)}else if(i instanceof Wt){i=i.value;n[r]=new RegExp(i.source,i.flags)}else{n[r]=to_string(i)}return true}if(t instanceof gt||t instanceof Xe){var r=t.print_to_string();n[r]=true;return true}if(!(t instanceof He))throw t;function to_string(e){return e instanceof Kt?e.getValue():e.print_to_string({quote_keys:true})}}))}catch(r){if(e){fatal("Error parsing arguments for '"+e+"': "+t)}else{n[t]=null}}return n}}function symdef(e){var t=1e6+e.id+" "+e.name;if(e.mangled_name)t+=" "+e.mangled_name;return t}function collect_from_map(e,t){var n=[];e.forEach((function(e){n.push(t(e))}));return n}function format_object(e){var t=[];var n="";Object.keys(e).map((function(t){if(n.length!/^\$/.test(e)));if(n.length>0){e.space();e.with_parens((function(){n.forEach((function(t,n){if(n)e.space();e.print(t)}))}))}if(t.documentation){e.space();e.print_string(t.documentation)}if(t.SUBCLASSES.length>0){e.space();e.with_block((function(){t.SUBCLASSES.forEach((function(t){e.indent();doitem(t);e.newline()}))}))}}doitem(U);return e+"\n"}}async function _default_options(){const e={};Object.keys(infer_options({0:0})).forEach((t=>{const n=infer_options({[t]:{0:0}});if(n)e[t]=n}));return e}async function infer_options(e){try{await minify("",e)}catch(e){return e.defs}}e._default_options=_default_options;e._run_cli=run_cli;e.minify=minify}))}};var t={};function __nccwpck_require__(n){var r=t[n];if(r!==undefined){return r.exports}var i=t[n]={exports:{}};var o=true;try{e[n].call(i.exports,i,i.exports,__nccwpck_require__);o=false}finally{if(o)delete t[n]}return i.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var n=__nccwpck_require__(405);module.exports=n})(); \ No newline at end of file diff --git a/packages/next/package.json b/packages/next/package.json index bcb221774520bc4..8d489c0bda6a6c8 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -252,7 +252,7 @@ "string_decoder": "1.3.0", "strip-ansi": "6.0.0", "taskr": "1.1.0", - "terser": "5.7.1", + "terser": "5.10.0", "text-table": "0.2.0", "timers-browserify": "2.0.12", "tty-browserify": "0.0.1", diff --git a/yarn.lock b/yarn.lock index e2a860045c9c297..8bc1852917bfd56 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19465,19 +19465,19 @@ terser-webpack-plugin@^5.1.3: source-map "^0.6.1" terser "^5.7.2" -terser@5.5.1, terser@^5.0.0: - version "5.5.1" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.5.1.tgz#540caa25139d6f496fdea056e414284886fb2289" - integrity sha512-6VGWZNVP2KTUcltUQJ25TtNjx/XgdDsBDKGt8nN0MpydU36LmbPPcMBd2kmtZNNGVVDLg44k7GKeHHj+4zPIBQ== +terser@5.10.0: + version "5.10.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.10.0.tgz#b86390809c0389105eb0a0b62397563096ddafcc" + integrity sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA== dependencies: commander "^2.20.0" source-map "~0.7.2" - source-map-support "~0.5.19" + source-map-support "~0.5.20" -terser@5.7.1: - version "5.7.1" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.7.1.tgz#2dc7a61009b66bb638305cb2a824763b116bf784" - integrity sha512-b3e+d5JbHAe/JSjwsC3Zn55wsBIM7AsHLjKxT31kGCldgbpFePaFo+PiddtO6uwRZWRw7sPXmAN8dTW61xmnSg== +terser@5.5.1, terser@^5.0.0: + version "5.5.1" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.5.1.tgz#540caa25139d6f496fdea056e414284886fb2289" + integrity sha512-6VGWZNVP2KTUcltUQJ25TtNjx/XgdDsBDKGt8nN0MpydU36LmbPPcMBd2kmtZNNGVVDLg44k7GKeHHj+4zPIBQ== dependencies: commander "^2.20.0" source-map "~0.7.2"