From 58b54293f8d052eb74c0aeff64e1cc5d46803dfb Mon Sep 17 00:00:00 2001 From: sanex3339 Date: Sat, 3 Mar 2018 00:08:37 +0300 Subject: [PATCH 1/3] Switching on webpack@4 --- dist/index.js | 25 +- package.json | 3 +- scripts/watch | 2 +- scripts/webpack | 2 +- webpack.config.js | 3 - yarn.lock | 2377 +++++++++++++++++++++++++++++++++++++++++---- 6 files changed, 2207 insertions(+), 205 deletions(-) diff --git a/dist/index.js b/dist/index.js index 71a9da51..292da8be 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,25 +1,2 @@ -/*! -Copyright (C) 2016-2018 Timofey Kachalov - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -require("source-map-support").install(),module.exports=function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=68)}([function(e,t){e.exports=require("@babel/runtime/helpers/classCallCheck")},function(e,t){e.exports=require("inversify")},function(e,t){e.exports=require("@babel/runtime/helpers/createClass")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e.Factory__ICalleeDataExtractor="Factory",e.Factory__IControlFlowCustomNode="Factory",e.Factory__IControlFlowReplacer="Factory",e.Factory__ICustomNode="Factory",e.Factory__ICustomNodeGroup="Factory",e.Factory__IDeadCodeInjectionCustomNode="Factory",e.Factory__IIdentifierNamesGenerator="Factory",e.Factory__IIdentifierObfuscatingReplacer="Factory",e.Factory__INodeGuard="Factory",e.Factory__INodeTransformer="Factory",e.Factory__IObfuscationResult="Factory",e.Factory__IObfuscatingReplacer="Factory",e.Factory__TControlFlowStorage="Factory",e.IArrayUtils="IArrayUtils",e.ICalleeDataExtractor="ICalleeDataExtractor",e.ICryptUtils="ICryptUtils",e.ICustomNode="ICustomNode",e.ICustomNodeGroup="ICustomNodeGroup",e.IControlFlowReplacer="IControlFlowReplacer",e.IEscapeSequenceEncoder="IEscapeSequenceEncoder",e.IIdentifierNamesGenerator="IIdentifierNamesGenerator",e.IIdentifierObfuscatingReplacer="IIdentifierObfuscatingReplacer",e.IJavaScriptObfuscator="IJavaScriptObfuscator",e.ILogger="ILogger",e.INodeGuard="INodeGuard",e.INodeTransformer="INodeTransformer",e.IObfuscationEventEmitter="IObfuscationEventEmitter",e.IObfuscationResult="IObfuscationResult",e.IOptions="IOptions",e.IOptionsNormalizer="IOptionsNormalizer",e.IObfuscatingReplacer="IObfuscatingReplacer",e.IRandomGenerator="IRandomGenerator",e.ISourceCode="ISourceCode",e.ISourceMapCorrector="ISourceMapCorrector",e.IStackTraceAnalyzer="IStackTraceAnalyzer",e.ITransformersRunner="ITransformersRunner",e.Newable__ICustomNode="Newable",e.Newable__TControlFlowStorage="Newable",e.TCustomNodeGroupStorage="TCustomNodeGroupStorage",e.TInputOptions="TInputOptions",e.TStringArrayStorage="TStringArrayStorage"}(t.ServiceIdentifiers||(t.ServiceIdentifiers={}))},function(e,t){e.exports=require("tslib")},function(e,t){e.exports=require("@babel/runtime/core-js/object/get-prototype-of")},function(e,t){e.exports=require("@babel/runtime/helpers/possibleConstructorReturn")},function(e,t){e.exports=require("@babel/runtime/helpers/inherits")},function(e,t,r){"use strict";var n=r(0),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a=r(18),i=function(){function e(){n(this,e)}return o(e,null,[{key:"isArrayPatternNode",value:function(e){return e.type===a.NodeType.ArrayPattern}},{key:"isArrowFunctionExpressionNode",value:function(e){return e.type===a.NodeType.ArrowFunctionExpression}},{key:"isAssignmentPatternNode",value:function(e){return e.type===a.NodeType.AssignmentPattern}},{key:"isAwaitExpressionNode",value:function(e){return e.type===a.NodeType.AwaitExpression}},{key:"isBlockStatementNode",value:function(e){return e.type===a.NodeType.BlockStatement}},{key:"isBreakStatementNode",value:function(e){return e.type===a.NodeType.BreakStatement}},{key:"isCallExpressionNode",value:function(e){return e.type===a.NodeType.CallExpression}},{key:"isCatchClauseNode",value:function(e){return e.type===a.NodeType.CatchClause}},{key:"isClassDeclarationNode",value:function(e){return e.type===a.NodeType.ClassDeclaration}},{key:"isContinueStatementNode",value:function(e){return e.type===a.NodeType.ContinueStatement}},{key:"isExpressionStatementNode",value:function(e){return e.type===a.NodeType.ExpressionStatement}},{key:"isFunctionDeclarationNode",value:function(e){return e.type===a.NodeType.FunctionDeclaration}},{key:"isFunctionExpressionNode",value:function(e){return e.type===a.NodeType.FunctionExpression}},{key:"isIdentifierNode",value:function(e){return e.type===a.NodeType.Identifier}},{key:"isIfStatementNode",value:function(e){return e.type===a.NodeType.IfStatement}},{key:"isLabelIdentifierNode",value:function(t,r){var n=e.isLabeledStatementNode(r)&&r.label===t,o=e.isContinueStatementNode(r)&&r.label===t,a=e.isBreakStatementNode(r)&&r.label===t;return n||o||a}},{key:"isLabeledStatementNode",value:function(e){return e.type===a.NodeType.LabeledStatement}},{key:"isLiteralNode",value:function(e){return e.type===a.NodeType.Literal}},{key:"isMemberExpressionNode",value:function(e){return e.type===a.NodeType.MemberExpression}},{key:"isMethodDefinitionNode",value:function(e){return e.type===a.NodeType.MethodDefinition}},{key:"isNode",value:function(e){return e&&void 0!==!e.type}},{key:"isNodeHasBlockScope",value:function(t,r){return e.isProgramNode(t)||e.isBlockStatementNode(t)&&e.nodesWithBlockScope.includes(r.type)}},{key:"isNodeHasScope",value:function(t){return e.isProgramNode(t)||e.isBlockStatementNode(t)||e.isSwitchCaseNode(t)}},{key:"isNodeWithComments",value:function(e){return Boolean(e.leadingComments)||Boolean(e.trailingComments)}},{key:"isObjectPatternNode",value:function(e){return e.type===a.NodeType.ObjectPattern}},{key:"isObjectExpressionNode",value:function(e){return e.type===a.NodeType.ObjectExpression}},{key:"isProgramNode",value:function(e){return e.type===a.NodeType.Program}},{key:"isPropertyNode",value:function(e){return e.type===a.NodeType.Property}},{key:"isReplaceableIdentifierNode",value:function(t,r){if(!e.isIdentifierNode(t))return!1;var n=e.isPropertyNode(r)&&!r.computed&&r.key===t,o=e.isMemberExpressionNode(r)&&!r.computed&&r.property===t,a=e.isMethodDefinitionNode(r)&&!r.computed,i=e.isLabelIdentifierNode(t,r);return!(n||o||a||i)}},{key:"isRestElementNode",value:function(e){return e.type===a.NodeType.RestElement}},{key:"isReturnStatementNode",value:function(e){return e.type===a.NodeType.ReturnStatement}},{key:"isSuperNode",value:function(e){return e.type===a.NodeType.Super}},{key:"isSwitchCaseNode",value:function(e){return e.type===a.NodeType.SwitchCase}},{key:"isTemplateLiteralNode",value:function(e){return e.type===a.NodeType.TemplateLiteral}},{key:"isUnaryExpressionNode",value:function(e){return e.type===a.NodeType.UnaryExpression}},{key:"isUseStrictOperator",value:function(e){return e.type===a.NodeType.ExpressionStatement&&"use strict"===e.directive}},{key:"isVariableDeclarationNode",value:function(e){return e.type===a.NodeType.VariableDeclaration}},{key:"isVariableDeclaratorNode",value:function(e){return e.type===a.NodeType.VariableDeclarator}},{key:"isWhileStatementNode",value:function(e){return e.type===a.NodeType.WhileStatement}}]),e}();i.nodesWithBlockScope=[a.NodeType.ArrowFunctionExpression,a.NodeType.FunctionDeclaration,a.NodeType.FunctionExpression,a.NodeType.MethodDefinition],t.NodeGuards=i},function(e,t,r){"use strict";var n=r(50),o=r(0),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i=__importStar(r(42)),s=__importStar(r(51)),c=__importStar(r(17)),u=r(8),d=function(){function e(){o(this,e)}return a(e,null,[{key:"addXVerbatimPropertyToLiterals",value:function(e){return c.replace(e,{leave:function(e){u.NodeGuards.isLiteralNode(e)&&(e["x-verbatim-property"]={content:e.raw,precedence:i.Precedence.Primary})}}),e}},{key:"clone",value:function(t){return e.parentize(e.cloneRecursive(t))}},{key:"convertCodeToStructure",value:function(t){var r=s.parseScript(t);return r=e.addXVerbatimPropertyToLiterals(r),r=e.parentize(r),r.body}},{key:"convertStructureToCode",value:function(e){return e.reduce(function(e,t){return e+i.generate(t,{sourceMapWithCode:!0}).code},"")}},{key:"getBlockScopesOfNode",value:function(t){return e.getBlockScopesOfNodeRecursive(t)}},{key:"getNextSiblingStatementNode",value:function(t){return e.getSiblingStatementNodeByOffset(t,1)}},{key:"getPreviousSiblingStatementNode",value:function(t){return e.getSiblingStatementNodeByOffset(t,-1)}},{key:"getScopeOfNode",value:function(t){var r=t.parentNode;if(!r)throw new ReferenceError("`parentNode` property of given node is `undefined`");return u.NodeGuards.isNodeHasScope(r)?r:e.getScopeOfNode(r)}},{key:"getUnaryExpressionArgumentNode",value:function(t){return u.NodeGuards.isUnaryExpressionNode(t.argument)?e.getUnaryExpressionArgumentNode(t.argument):t.argument}},{key:"parentize",value:function(t){return c.replace(t,{enter:e.parentizeNode}),t}},{key:"parentizeNode",value:function(e,t){return e.parentNode=t||e,e.obfuscatedNode=!1,e}},{key:"cloneRecursive",value:function(t){if(null===t)return t;var r={};for(var o in t)if(t.hasOwnProperty(o)&&"parentNode"!==o){var a=t[o],i=void 0;i=null===a||a instanceof RegExp?a:Array.isArray(a)?a.map(e.cloneRecursive):"object"===n(a)?e.cloneRecursive(a):a,r[o]=i}return r}},{key:"getBlockScopesOfNodeRecursive",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=t.parentNode;if(!o)throw new ReferenceError("`parentNode` property of given node is `undefined`");return u.NodeGuards.isBlockStatementNode(t)&&o===t&&r.push(t),(u.NodeGuards.isProgramNode(t)||n&&u.NodeGuards.isNodeHasBlockScope(t,o))&&r.push(t),t!==o?e.getBlockScopesOfNodeRecursive(o,r,++n):r}},{key:"getSiblingStatementNodeByOffset",value:function(t,r){var n=e.getScopeOfNode(t),o=u.NodeGuards.isSwitchCaseNode(n)?n.consequent:n.body;return o[o.indexOf(t)+r]||null}}]),e}();t.NodeUtils=d},function(e,t,r){"use strict";function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"initialize",t=_(this)[0];return function(r,n){var c=r[e];if(!c||"function"!=typeof c)throw new Error("`".concat(e,"` method with initialization logic not ")+"found. `@".concat(t,"` decorator requires `").concat(e,"` method"));return o(v,!1,r),o(y,new g,r),o(h,new g,r),a(r,e),i(r,e,n),s(r,n)}}function o(e,t,r){m(e,r)||p(e,t,r)}function a(e,t){var r=[t,b];f(e).forEach(function(n){var o=l(y,e),a=l(h,e);if(!(r.includes(n)||o.has(n)||a.has(n))&&"function"==typeof e[n]){var i=d(e,n)||N,s=i.value;u(e,n,c({},i,{value:function(){if(!l(v,this))throw new Error("Class should be initialized with `".concat(t,"()` method"));return s.apply(this,arguments)}})),a.add(n)}})}function i(e,t,r){var n=d(e,t)||N,o=n.value;u(e,t,c({},n,{value:function(){p(v,!0,this);var e=o.apply(this,arguments);return this[r],e}}))}function s(e,t){l(y,e).add(t);var r="_".concat(t),n=d(e,r)||N;return u(e,t,c({},n,{get:function(){if(void 0===this[r])throw new Error("Property `".concat(t,"` is not initialized! Initialize it first!"));return this[r]},set:function(e){this[r]=e}})),n}var c=r(11),u=r(78),d=r(79),l=r(80),f=r(81),p=r(82),m=r(83),g=r(29),_=r(38);Object.defineProperty(t,"__esModule",{value:!0});var N={configurable:!0,enumerable:!0},v="_initialized",y="_initializablePropertiesSet",h="_wrappedMethodsSet",b="constructor";t.initializable=n},function(e,t){e.exports=require("@babel/runtime/core-js/object/assign")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e.Preparing="Preparing",e.DeadCodeInjection="DeadCodeInjection",e.ControlFlowFlattening="ControlFlowFlattening",e.Converting="Converting",e.Obfuscating="Obfuscating",e.Finalizing="Finalizing"}(t.TransformationStage||(t.TransformationStage={}))},function(e,t,r){"use strict";var n=r(0),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a=r(4),i=r(1),s=r(3),c=r(10),u=function(){function e(t,r){n(this,e),this.randomGenerator=t,this.options=r}return o(e,[{key:"initialize",value:function(){this.nodeIdentifier=this.randomGenerator.getRandomInteger(0,1e4)}}]),e}();a.__decorate([c.initializable(),a.__metadata("design:type",Number)],u.prototype,"nodeIdentifier",void 0),a.__decorate([i.postConstruct(),a.__metadata("design:type",Function),a.__metadata("design:paramtypes",[]),a.__metadata("design:returntype",void 0)],u.prototype,"initialize",null),u=a.__decorate([i.injectable(),a.__param(0,i.inject(s.ServiceIdentifiers.IRandomGenerator)),a.__param(1,i.inject(s.ServiceIdentifiers.IOptions)),a.__metadata("design:paramtypes",[Object,Object])],u),t.AbstractNodeTransformer=u},function(e,t,r){"use strict";var n=r(0),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a=r(4),i=r(1),s=r(3),c=r(101),u=r(102),d=l=function(){function e(t,r,o){n(this,e),this.cachedNode=null,this.identifierNamesGenerator=t(o),this.randomGenerator=r,this.options=o}return o(e,[{key:"getNode",value:function(){return this.cachedNode||(this.cachedNode=this.getNodeStructure()),this.cachedNode}},{key:"getGlobalVariableTemplate",value:function(){return this.randomGenerator.getRandomGenerator().pickone(l.globalVariableTemplateFunctions)}}]),e}();d.globalVariableTemplateFunctions=[c.GlobalVariableTemplate1(),u.GlobalVariableTemplate2()],d=l=a.__decorate([i.injectable(),a.__param(0,i.inject(s.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),a.__param(1,i.inject(s.ServiceIdentifiers.IRandomGenerator)),a.__param(2,i.inject(s.ServiceIdentifiers.IOptions)),a.__metadata("design:paramtypes",[Function,Object,Object])],d),t.AbstractCustomNode=d;var l},function(e,t,r){"use strict";var n=r(11),o=r(0),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i=__importStar(r(42)),s=r(18),c=function(){function e(){o(this,e)}return a(e,null,[{key:"getProgramNode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:s.NodeType.Program,body:e,sourceType:"script",obfuscatedNode:!1}}},{key:"getArrayExpressionNode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:s.NodeType.ArrayExpression,elements:e}}},{key:"getAssignmentExpressionNode",value:function(e,t,r){return{type:s.NodeType.AssignmentExpression,operator:e,left:t,right:r,obfuscatedNode:!1}}},{key:"getBinaryExpressionNode",value:function(e,t,r){return{type:s.NodeType.BinaryExpression,operator:e,left:t,right:r,obfuscatedNode:!1}}},{key:"getBlockStatementNode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:s.NodeType.BlockStatement,body:e,obfuscatedNode:!1}}},{key:"getBreakStatement",value:function(e){var t={type:s.NodeType.BreakStatement,obfuscatedNode:!1};return e&&(t.label=e),t}},{key:"getCallExpressionNode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return{type:s.NodeType.CallExpression,callee:e,arguments:t,obfuscatedNode:!1}}},{key:"getContinueStatement",value:function(e){var t={type:s.NodeType.ContinueStatement,obfuscatedNode:!1};return e&&(t.label=e),t}},{key:"getExpressionStatementNode",value:function(e){return{type:s.NodeType.ExpressionStatement,expression:e,obfuscatedNode:!1}}},{key:"getFunctionDeclarationNode",value:function(t,r,n){return{type:s.NodeType.FunctionDeclaration,id:e.getIdentifierNode(t),params:r,body:n,generator:!1,obfuscatedNode:!1}}},{key:"getFunctionExpressionNode",value:function(e,t){return{type:s.NodeType.FunctionExpression,params:e,body:t,generator:!1,obfuscatedNode:!1}}},{key:"getIfStatementNode",value:function(e,t,r){return n({type:s.NodeType.IfStatement,test:e,consequent:t},r&&{alternate:r},{obfuscatedNode:!1})}},{key:"getIdentifierNode",value:function(e){return{type:s.NodeType.Identifier,name:e,obfuscatedNode:!1}}},{key:"getLiteralNode",value:function(e,t){return t=void 0!==t?t:"'".concat(e,"'"),{type:s.NodeType.Literal,value:e,raw:t,"x-verbatim-property":{content:t,precedence:i.Precedence.Primary},obfuscatedNode:!1}}},{key:"getLogicalExpressionNode",value:function(e,t,r){return{type:s.NodeType.LogicalExpression,operator:e,left:t,right:r,obfuscatedNode:!1}}},{key:"getMemberExpressionNode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:s.NodeType.MemberExpression,computed:r,object:e,property:t,obfuscatedNode:!1}}},{key:"getMethodDefinitionNode",value:function(e,t,r,n){return{type:s.NodeType.MethodDefinition,key:e,value:t,kind:r,computed:n,static:!1,obfuscatedNode:!1}}},{key:"getObjectExpressionNode",value:function(e){return{type:s.NodeType.ObjectExpression,properties:e,obfuscatedNode:!1}}},{key:"getPropertyNode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:s.NodeType.Property,key:e,value:t,kind:"init",method:!1,shorthand:!1,computed:r,obfuscatedNode:!1}}},{key:"getUnaryExpressionNode",value:function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return{type:s.NodeType.UnaryExpression,operator:e,argument:t,prefix:r,obfuscatedNode:!1}}},{key:"getReturnStatementNode",value:function(e){return{type:s.NodeType.ReturnStatement,argument:e,obfuscatedNode:!1}}},{key:"getSwitchStatementNode",value:function(e,t){return{type:s.NodeType.SwitchStatement,discriminant:e,cases:t,obfuscatedNode:!1}}},{key:"getSwitchCaseNode",value:function(e,t){return{type:s.NodeType.SwitchCase,test:e,consequent:t,obfuscatedNode:!1}}},{key:"getUpdateExpressionNode",value:function(e,t){return{type:s.NodeType.UpdateExpression,operator:e,argument:t,prefix:!1,obfuscatedNode:!1}}},{key:"getVariableDeclarationNode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"var";return{type:s.NodeType.VariableDeclaration,declarations:e,kind:t,obfuscatedNode:!1}}},{key:"getVariableDeclaratorNode",value:function(e,t){return{type:s.NodeType.VariableDeclarator,id:e,init:t,obfuscatedNode:!1}}},{key:"getWhileStatementNode",value:function(e,t){return{type:s.NodeType.WhileStatement,test:e,body:t,obfuscatedNode:!1}}}]),e}();t.Nodes=c},function(e,t){e.exports=require("@babel/runtime/core-js/map")},function(e,t){e.exports=require("estraverse")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e.ArrayExpression="ArrayExpression",e.ArrayPattern="ArrayPattern",e.ArrowFunctionExpression="ArrowFunctionExpression",e.AssignmentExpression="AssignmentExpression",e.AssignmentPattern="AssignmentPattern",e.AwaitExpression="AwaitExpression",e.BinaryExpression="BinaryExpression",e.BlockStatement="BlockStatement",e.BreakStatement="BreakStatement",e.CallExpression="CallExpression",e.CatchClause="CatchClause",e.ClassDeclaration="ClassDeclaration",e.ContinueStatement="ContinueStatement",e.ExpressionStatement="ExpressionStatement",e.FunctionDeclaration="FunctionDeclaration",e.FunctionExpression="FunctionExpression",e.Identifier="Identifier",e.IfStatement="IfStatement",e.LabeledStatement="LabeledStatement",e.Literal="Literal",e.LogicalExpression="LogicalExpression",e.MemberExpression="MemberExpression",e.MethodDefinition="MethodDefinition",e.ObjectExpression="ObjectExpression",e.ObjectPattern="ObjectPattern",e.Program="Program",e.Property="Property",e.RestElement="RestElement",e.ReturnStatement="ReturnStatement",e.Super="Super",e.SwitchCase="SwitchCase",e.SwitchStatement="SwitchStatement",e.TemplateLiteral="TemplateLiteral",e.TryStatement="TryStatement",e.UnaryExpression="UnaryExpression",e.UpdateExpression="UpdateExpression",e.VariableDeclaration="VariableDeclaration",e.VariableDeclarator="VariableDeclarator",e.WhileStatement="WhileStatement"}(t.NodeType||(t.NodeType={}))},function(e,t){e.exports=require("string-template")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e.BinaryExpressionFunctionNode="BinaryExpressionFunctionNode",e.BlockStatementControlFlowFlatteningNode="BlockStatementControlFlowFlatteningNode",e.CallExpressionControlFlowStorageCallNode="CallExpressionControlFlowStorageCallNode",e.CallExpressionFunctionNode="CallExpressionFunctionNode",e.ControlFlowStorageNode="ControlFlowStorageNode",e.ExpressionWithOperatorControlFlowStorageCallNode="ExpressionWithOperatorControlFlowStorageCallNode",e.LogicalExpressionFunctionNode="LogicalExpressionFunctionNode",e.StringLiteralControlFlowStorageCallNode="StringLiteralControlFlowStorageCallNode",e.StringLiteralNode="StringLiteralNode"}(t.ControlFlowCustomNode||(t.ControlFlowCustomNode={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e.Browser="browser",e.Extension="extension",e.Node="node"}(t.ObfuscationTarget||(t.ObfuscationTarget={}))},function(e,t,r){"use strict";var n=r(16),o=r(0),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),s=r(3),c=r(70),u=r(75),d=r(89),l=r(94),f=r(141),p=r(142),m=r(145),g=r(146),_=r(159),N=r(174),v=r(183),y=r(188),h=r(194),b=r(65),S=r(197),I=r(199),C=r(200),O=r(201),j=r(202),F=function(){function e(){o(this,e),this.container=new i.Container}return a(e,[{key:"get",value:function(e){return this.container.get(e)}},{key:"getNamed",value:function(e,t){return this.container.getNamed(e,t)}},{key:"load",value:function(e,t){this.container.bind(s.ServiceIdentifiers.ISourceCode).toDynamicValue(function(){return new C.SourceCode(e)}).inSingletonScope(),this.container.bind(s.ServiceIdentifiers.TInputOptions).toDynamicValue(function(){return t}).inSingletonScope(),this.container.bind(s.ServiceIdentifiers.ILogger).to(b.Logger).inSingletonScope(),this.container.bind(s.ServiceIdentifiers.IJavaScriptObfuscator).to(h.JavaScriptObfuscator).inSingletonScope(),this.container.bind(s.ServiceIdentifiers.ITransformersRunner).to(j.TransformersRunner).inSingletonScope(),this.container.bind(s.ServiceIdentifiers.IObfuscationResult).to(I.ObfuscationResult).inSingletonScope(),this.container.bind(s.ServiceIdentifiers.Factory__IObfuscationResult).toFactory(function(e){return function(t,r){var n=e.container.get(s.ServiceIdentifiers.IObfuscationResult);return n.initialize(t,r),n}}),this.container.bind(s.ServiceIdentifiers.ISourceMapCorrector).to(O.SourceMapCorrector).inSingletonScope(),this.container.bind(s.ServiceIdentifiers.IObfuscationEventEmitter).to(S.ObfuscationEventEmitter).inSingletonScope(),this.container.load(c.analyzersModule),this.container.load(u.controlFlowTransformersModule),this.container.load(d.convertingTransformersModule),this.container.load(l.customNodesModule),this.container.load(f.finalizingTransformersModule),this.container.load(p.generatorsModule),this.container.load(m.nodeTransformersModule),this.container.load(g.obfuscatingTransformersModule),this.container.load(_.optionsModule),this.container.load(N.preparingTransformersModule),this.container.load(v.storagesModule),this.container.load(y.utilsModule)}},{key:"unload",value:function(){this.container.unbindAll()}}],[{key:"getFactory",value:function(e){return function(t){return function(r){return t.container.getNamed(e,r)}}}},{key:"getCacheFactory",value:function(e){return function(t){var r=new n;return function(n){if(r.has(n))return r.get(n);var o=t.container.getNamed(e,n);return r.set(n,o),o}}}},{key:"getConstructorFactory",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o3&&void 0!==arguments[3]?arguments[3]:0;o=t.length?e.getOptimalBlockScope(t,a):r,e.prependNode(o,n)}},{key:"getOptimalBlockScope",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,o=t[r];if(n<=0)throw new Error("Invalid `deep` argument value. Value should be bigger then 0.");return n>1&&o.stackTrace.length?e.getOptimalBlockScope(o.stackTrace,0,--n):o.callee}},{key:"insertNodeAfter",value:function(t,r,n){var o=e.getScopeNodeStatements(t).indexOf(n);e.insertNodeAtIndex(t,r,o+1)}},{key:"insertNodeAtIndex",value:function(t,r,o){r=e.parentizeScopeStatementsBeforeAppend(t,r),e.setScopeNodeStatements(t,n(e.getScopeNodeStatements(t).slice(0,o)).concat(n(r),n(e.getScopeNodeStatements(t).slice(o))))}},{key:"prependNode",value:function(t,r){r=e.parentizeScopeStatementsBeforeAppend(t,r),e.setScopeNodeStatements(t,n(r).concat(n(e.getScopeNodeStatements(t))))}},{key:"getScopeNodeStatements",value:function(e){return i.NodeGuards.isSwitchCaseNode(e)?e.consequent:e.body}},{key:"parentizeScopeStatementsBeforeAppend",value:function(e,t){return t.forEach(function(t){t.parentNode=e}),t}},{key:"setScopeNodeStatements",value:function(e,t){if(i.NodeGuards.isSwitchCaseNode(e))return void(e.consequent=t);e.body=t}}]),e}();t.NodeAppender=s},function(e,t){e.exports=require("@babel/runtime/helpers/toConsumableArray")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e.AfterObfuscation="afterObfuscation",e.BeforeObfuscation="beforeObfuscation"}(t.ObfuscationEvent||(t.ObfuscationEvent={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e.BaseIdentifierObfuscatingReplacer="BaseIdentifierObfuscatingReplacer"}(t.IdentifierObfuscatingReplacer||(t.IdentifierObfuscatingReplacer={}))},function(e,t,r){"use strict";var n=r(0),o=r(2);Object.defineProperty(t,"__esModule",{value:!0}),r(69);var a=r(3),i=r(22),s=r(47),c=function(){function e(){n(this,e)}return o(e,null,[{key:"obfuscate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new i.InversifyContainerFacade;r.load(e,t);var n=r.get(a.ServiceIdentifiers.IJavaScriptObfuscator),o=n.obfuscate(e);return r.unload(),o}},{key:"runCLI",value:function(e){var t=new s.JavaScriptObfuscatorCLI(e);t.initialize(),t.run()}}]),e}();t.JavaScriptObfuscator=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e.BlockStatementControlFlowTransformer="BlockStatementControlFlowTransformer",e.ClassDeclarationTransformer="ClassDeclarationTransformer",e.CommentsTransformer="CommentsTransformer",e.CustomNodesTransformer="CustomNodesTransformer",e.DeadCodeInjectionTransformer="DeadCodeInjectionTransformer",e.EvalCallExpressionTransformer="EvalCallExpressionTransformer",e.FunctionControlFlowTransformer="FunctionControlFlowTransformer",e.CatchClauseTransformer="CatchClauseTransformer",e.FunctionDeclarationTransformer="FunctionDeclarationTransformer",e.FunctionTransformer="FunctionTransformer",e.LabeledStatementTransformer="LabeledStatementTransformer",e.LiteralTransformer="LiteralTransformer",e.MemberExpressionTransformer="MemberExpressionTransformer",e.MethodDefinitionTransformer="MethodDefinitionTransformer",e.ObfuscatingGuardsTransformer="ObfuscatingGuardsTransformer",e.ObjectExpressionKeysTransformer="ObjectExpressionKeysTransformer",e.ObjectExpressionTransformer="ObjectExpressionTransformer",e.ParentificationTransformer="ParentificationTransformer",e.TemplateLiteralTransformer="TemplateLiteralTransformer",e.VariableDeclarationTransformer="VariableDeclarationTransformer"}(t.NodeTransformer||(t.NodeTransformer={}))},function(e,t){e.exports=require("@babel/runtime/core-js/set")},function(e,t){e.exports=require("@babel/runtime/helpers/slicedToArray")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e.ConsoleOutputDisableExpressionNode="ConsoleOutputDisableExpressionNode",e.DebugProtectionFunctionCallNode="DebugProtectionFunctionCallNode",e.DebugProtectionFunctionIntervalNode="DebugProtectionFunctionIntervalNode",e.DebugProtectionFunctionNode="DebugProtectionFunctionNode",e.DomainLockNode="DomainLockNode",e.NodeCallsControllerFunctionNode="NodeCallsControllerFunctionNode",e.SelfDefendingUnicodeNode="SelfDefendingUnicodeNode",e.StringArrayCallsWrapper="StringArrayCallsWrapper",e.StringArrayNode="StringArrayNode",e.StringArrayRotateFunctionNode="StringArrayRotateFunctionNode"}(t.CustomNode||(t.CustomNode={}))},function(e,t,r){"use strict";var n=r(56),o=r(0),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i=r(138),s=function(){function e(){o(this,e)}return a(e,null,[{key:"decToHex",value:function(e){return e.toString(16)}},{key:"extractDomainFromUrl",value:function(e){var t;return t=e.indexOf("://")>-1||0===e.indexOf("//")?e.split("/")[2]:e.split("/")[0],t=t.split(":")[0]}},{key:"isCeilNumber",value:function(e){return e%1==0}},{key:"stringRotate",value:function(e,t){if(!e)throw new ReferenceError("Cannot rotate empty string.");for(var r=0;r [options]").version(c.version,"-v, --version").option("-o, --output ","Output path for obfuscated code").option("--compact ","Disable one line output code compacting",p.BooleanSanitizer).option("--config ","Name of js / json config file").option("--control-flow-flattening ","Enables control flow flattening",p.BooleanSanitizer).option("--control-flow-flattening-threshold ","The probability that the control flow flattening transformation will be applied to the node",parseFloat).option("--dead-code-injection ","Enables dead code injection",p.BooleanSanitizer).option("--dead-code-injection-threshold ","The probability that the dead code injection transformation will be applied to the node",parseFloat).option("--debug-protection ","Disable browser Debug panel (can cause DevTools enabled browser freeze)",p.BooleanSanitizer).option("--debug-protection-interval ","Disable browser Debug panel even after page was loaded (can cause DevTools enabled browser freeze)",p.BooleanSanitizer).option("--disable-console-output ","Allow console.log, console.info, console.error and console.warn messages output into browser console",p.BooleanSanitizer).option("--domain-lock (comma separated, without whitespaces)","Blocks the execution of the code in domains that do not match the passed RegExp patterns (comma separated)",f.ArraySanitizer).option("--exclude (comma separated, without whitespaces)","A filename or glob which indicates files to exclude from obfuscation",f.ArraySanitizer).option("--identifier-names-generator [hexadecimal, mangled]","Sets identifier names generator (Default: hexadecimal)",m.IdentifierNamesGeneratorSanitizer).option("--identifiers-prefix ","Sets prefix for all global identifiers.").option("--log ","Enables logging of the information to the console",p.BooleanSanitizer).option("--reserved-names (comma separated, without whitespaces)","Disable obfuscation of variable names, function names and names of function parameters that match the passed RegExp patterns (comma separated)",f.ArraySanitizer).option("--rename-globals ","Allows to enable obfuscation of global variable and function names with declaration.",p.BooleanSanitizer).option("--rotate-string-array ","Disable rotation of unicode array values during obfuscation",p.BooleanSanitizer).option("--seed ","Sets seed for random generator. This is useful for creating repeatable results.",parseFloat).option("--self-defending ","Disables self-defending for obfuscated code",p.BooleanSanitizer).option("--source-map ","Enables source map generation",p.BooleanSanitizer).option("--source-map-base-url ","Sets base url to the source map import url when `--source-map-mode=separate`").option("--source-map-file-name ","Sets file name for output source map when `--source-map-mode=separate`").option("--source-map-mode [inline, separate]","Specify source map output mode",_.SourceMapModeSanitizer).option("--string-array ","Disables gathering of all literal strings into an array and replacing every literal string with an array call",p.BooleanSanitizer).option("--string-array-encoding [true, false, base64, rc4]","Encodes all strings in strings array using base64 or rc4 (this option can slow down your code speed",N.StringArrayEncodingSanitizer).option("--string-array-threshold ","The probability that the literal string will be inserted into stringArray (Default: 0.8, Min: 0, Max: 1)",parseFloat).option("--target ","Allows to set target environment for obfuscated code.",g.ObfuscationTargetSanitizer).option("--transform-object-keys ","Enables transformation of object keys",p.BooleanSanitizer).option("--unicode-escape-sequence ","Allows to enable/disable string conversion to unicode escape sequence",p.BooleanSanitizer).parse(this.rawArguments)}},{key:"configureHelp",value:function(){this.commands.on("--help",function(){console.log(" Examples:\n"),console.log(" %> javascript-obfuscator input_file_name.js --compact true --self-defending false"),console.log(" %> javascript-obfuscator input_file_name.js --output output_file_name.js --compact true --self-defending false"),console.log(" %> javascript-obfuscator input_directory_name --compact true --self-defending false"),console.log("")})}},{key:"processSourceCodeData",value:function(e){var t=this,r=this.inputCLIOptions.output?u.normalize(this.inputCLIOptions.output):"";if(Array.isArray(e))e.forEach(function(e,n){var o=e.filePath,a=e.content,i=r?u.join(r,o):v.CLIUtils.getOutputCodePath(o);t.processSourceCode(a,i,n)});else{var n=r||v.CLIUtils.getOutputCodePath(this.inputPath);this.processSourceCode(e,n,null)}}},{key:"processSourceCode",value:function(t,r,o){var a=this.buildOptions();if(null!==o){var i=this.inputCLIOptions.identifiersPrefix||e.baseIdentifiersPrefix,s="".concat(i).concat(o);a=n({},a,{identifiersPrefix:s})}a.sourceMap?e.processSourceCodeWithSourceMap(t,r,a):e.processSourceCodeWithoutSourceMap(t,r,a)}}],[{key:"filterOptions",value:function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&void 0!==e[r]&&(t[r]=e[r]);return t}},{key:"processSourceCodeWithoutSourceMap",value:function(e,t,r){var n=y.JavaScriptObfuscator.obfuscate(e,r).getObfuscatedCode();v.CLIUtils.writeFile(t,n)}},{key:"processSourceCodeWithSourceMap",value:function(e,t,r){var o=v.CLIUtils.getOutputSourceMapPath(t,r.sourceMapFileName||"");r=n({},r,{sourceMapFileName:u.basename(o)});var a=y.JavaScriptObfuscator.obfuscate(e,r);v.CLIUtils.writeFile(t,a.getObfuscatedCode()),"separate"===r.sourceMapMode&&a.getSourceMap()&&v.CLIUtils.writeFile(o,a.getSourceMap())}}]),e}();b.encoding="utf8",b.obfuscatedFilePrefix="-obfuscated",b.baseIdentifiersPrefix="a",i.__decorate([d.initializable(),i.__metadata("design:type",Object)],b.prototype,"commands",void 0),i.__decorate([d.initializable(),i.__metadata("design:type",Object)],b.prototype,"inputCLIOptions",void 0),i.__decorate([d.initializable(),i.__metadata("design:type",String)],b.prototype,"inputPath",void 0),t.JavaScriptObfuscatorCLI=b},function(e,t){e.exports=require("path")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e.FunctionDeclarationCalleeDataExtractor="FunctionDeclarationCalleeDataExtractor",e.FunctionExpressionCalleeDataExtractor="FunctionExpressionCalleeDataExtractor",e.ObjectExpressionCalleeDataExtractor="ObjectExpressionCalleeDataExtractor"}(t.CalleeDataExtractor||(t.CalleeDataExtractor={}))},function(e,t){e.exports=require("@babel/runtime/helpers/typeof")},function(e,t){e.exports=require("esprima")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e.BinaryExpressionControlFlowReplacer="BinaryExpressionControlFlowReplacer",e.CallExpressionControlFlowReplacer="CallExpressionControlFlowReplacer",e.LogicalExpressionControlFlowReplacer="LogicalExpressionControlFlowReplacer",e.StringLiteralControlFlowReplacer="StringLiteralControlFlowReplacer"}(t.ControlFlowReplacer||(t.ControlFlowReplacer={}))},function(e,t,r){"use strict";var n=r(5),o=r(0),a=r(2),i=r(6),s=r(7);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(1),d=r(3),l=r(20),f=r(43),p=r(8),m=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"getControlFlowStorageCallNode",value:function(e,t,r,n){var o=this.controlFlowCustomNodeFactory(l.ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode);o.initialize(e,t,r,n);var a=o.getNode()[0];if(!a||!p.NodeGuards.isExpressionStatementNode(a))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return a.expression}}]),t}(f.AbstractControlFlowReplacer);m=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IControlFlowCustomNode)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],m),t.ExpressionWithOperatorControlFlowReplacer=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e.BlockStatementDeadCodeInjectionNode="BlockStatementDeadCodeInjectionNode"}(t.DeadCodeInjectionCustomNode||(t.DeadCodeInjectionCustomNode={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e.ConsoleOutputCustomNodeGroup="ConsoleOutputCustomNodeGroup",e.DebugProtectionCustomNodeGroup="DebugProtectionCustomNodeGroup",e.DomainLockCustomNodeGroup="DomainLockCustomNodeGroup",e.SelfDefendingCustomNodeGroup="SelfDefendingCustomNodeGroup",e.StringArrayCustomNodeGroup="StringArrayCustomNodeGroup"}(t.CustomNodeGroup||(t.CustomNodeGroup={}))},function(e,t){e.exports=require("@babel/runtime/core-js/array/from")},function(e,t){e.exports=require("@babel/runtime/core-js/object/freeze")},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0});var o=r(4),a=r(1),i=r(3),s=function e(t,r){n(this,e),this.randomGenerator=t,this.options=r};s=o.__decorate([a.injectable(),o.__param(0,a.inject(i.ServiceIdentifiers.IRandomGenerator)),o.__param(1,a.inject(i.ServiceIdentifiers.IOptions)),o.__metadata("design:paramtypes",[Object,Object])],s),t.AbstractIdentifierNamesGenerator=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e.BooleanLiteralObfuscatingReplacer="BooleanLiteralObfuscatingReplacer",e.NumberLiteralObfuscatingReplacer="NumberLiteralObfuscatingReplacer",e.StringLiteralObfuscatingReplacer="StringLiteralObfuscatingReplacer"}(t.LiteralObfuscatingReplacer||(t.LiteralObfuscatingReplacer={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e.BlackListNodeGuard="BlackListNodeGuard",e.ConditionalCommentNodeGuard="ConditionalCommentNodeGuard"}(t.ObfuscatingGuard||(t.ObfuscatingGuard={}))},function(e,t,r){"use strict";var n=r(24),o=r(33),a=r(30),i=r(16),s=r(0),c=r(2);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(1),l=r(3),f=r(10),p=function(){function e(t,r){s(this,e),this.randomGenerator=t,this.options=r}return c(e,[{key:"initialize",value:function(){this.storage=new i,this.storageId=this.randomGenerator.getRandomString(6)}},{key:"get",value:function(e){var t=this.storage.get(e);if(!t)throw new Error("No value found in map storage with key `".concat(e,"`"));return t}},{key:"getKeyOf",value:function(e){var t=!0,r=!1,n=void 0;try{for(var i,s=o(this.storage);!(t=(i=s.next()).done);t=!0){var c=i.value,u=a(c,2),d=u[0];if(e===u[1])return d}}catch(e){r=!0,n=e}finally{try{t||null==s.return||s.return()}finally{if(r)throw n}}return null}},{key:"getLength",value:function(){return this.storage.size}},{key:"getStorage",value:function(){return this.storage}},{key:"getStorageId",value:function(){return this.storageId}},{key:"mergeWith",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.storage=new i(n(this.storage).concat(n(e.getStorage()))),t&&(this.storageId=e.getStorageId())}},{key:"set",value:function(e,t){this.storage.set(e,t)}}]),e}();u.__decorate([f.initializable(),u.__metadata("design:type",String)],p.prototype,"storageId",void 0),u.__decorate([f.initializable(),u.__metadata("design:type",i)],p.prototype,"storage",void 0),u.__decorate([d.postConstruct(),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[]),u.__metadata("design:returntype",void 0)],p.prototype,"initialize",null),p=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Object,Object])],p),t.MapStorage=p},function(e,t,r){"use strict";var n=r(0),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a=r(4),i=r(1),s=r(3),c=a.__importDefault(r(191)),u=r(192),d=r(10),l=f=function(){function e(t,r){n(this,e),this.sourceCode=t,this.options=r}return o(e,[{key:"initialize",value:function(){var e=this;this.seed=0!==this.options.seed?this.options.seed:function(e,t){return Math.floor(Math.random()*(t-e+1)+e)}(0,999999999),this.randomGenerator=new u.Chance(function(){var t=c.default(e.sourceCode.getSourceCode());return e.seed+Number(t.replace(/\D/g,""))}())}},{key:"getMathRandom",value:function(){return this.getRandomInteger(0,99999)/1e5}},{key:"getRandomFloat",value:function(e,t){return this.getRandomGenerator().floating({min:e,max:t,fixed:7})}},{key:"getRandomGenerator",value:function(){return this.randomGenerator}},{key:"getRandomInteger",value:function(e,t){return this.getRandomGenerator().integer({min:e,max:t})}},{key:"getRandomString",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f.randomGeneratorPool;return this.getRandomGenerator().string({length:e,pool:t})}},{key:"getSeed",value:function(){return this.seed}}]),e}();l.randomGeneratorPool="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",a.__decorate([d.initializable(),a.__metadata("design:type",Object)],l.prototype,"randomGenerator",void 0),a.__decorate([d.initializable(),a.__metadata("design:type",Number)],l.prototype,"seed",void 0),a.__decorate([i.postConstruct(),a.__metadata("design:type",Function),a.__metadata("design:paramtypes",[]),a.__metadata("design:returntype",void 0)],l.prototype,"initialize",null),l=f=a.__decorate([i.injectable(),a.__param(0,i.inject(s.ServiceIdentifiers.ISourceCode)),a.__param(1,i.inject(s.ServiceIdentifiers.IOptions)),a.__metadata("design:paramtypes",[Object,Object])],l),t.RandomGenerator=l;var f},function(e,t){e.exports=require("pjson")},function(e,t){e.exports=require("chalk")},function(e,t,r){"use strict";var n=r(0),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a=r(4),i=r(1),s=r(3),c=a.__importDefault(r(64)),u=r(66),d=l=function(){function e(t){n(this,e),this.options=t}return o(e,[{key:"info",value:function(e,t){this.options.log&&l.log(l.colorInfo,u.LoggingPrefix.Base,e,t)}},{key:"success",value:function(e,t){this.options.log&&l.log(l.colorSuccess,u.LoggingPrefix.Base,e,t)}},{key:"warn",value:function(e,t){this.options.log&&l.log(l.colorWarn,u.LoggingPrefix.Base,e,t)}}],[{key:"log",value:function(e,t,r,n){var o=e("\n".concat(t," ").concat(r));n?console.log(o,n):console.log(o)}}]),e}();d.colorInfo=c.default.cyan,d.colorSuccess=c.default.green,d.colorWarn=c.default.yellow,d=l=a.__decorate([i.injectable(),a.__param(0,i.inject(s.ServiceIdentifiers.IOptions)),a.__metadata("design:paramtypes",[Object])],d),t.Logger=d;var l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e.Base="[javascript-obfuscator]",e.CLI="[javascript-obfuscator-cli]"}(t.LoggingPrefix||(t.LoggingPrefix={}))},function(e,t){e.exports=require("fs")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(27);e.exports=n.JavaScriptObfuscator},function(e,t){e.exports=require("reflect-metadata")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(22),o=r(1),a=r(3),i=r(49),s=r(71),c=r(72),u=r(73),d=r(74);t.analyzersModule=new o.ContainerModule(function(e){e(a.ServiceIdentifiers.IStackTraceAnalyzer).to(d.StackTraceAnalyzer).inSingletonScope(),e(a.ServiceIdentifiers.ICalleeDataExtractor).to(s.FunctionDeclarationCalleeDataExtractor).whenTargetNamed(i.CalleeDataExtractor.FunctionDeclarationCalleeDataExtractor),e(a.ServiceIdentifiers.ICalleeDataExtractor).to(c.FunctionExpressionCalleeDataExtractor).whenTargetNamed(i.CalleeDataExtractor.FunctionExpressionCalleeDataExtractor),e(a.ServiceIdentifiers.ICalleeDataExtractor).to(u.ObjectExpressionCalleeDataExtractor).whenTargetNamed(i.CalleeDataExtractor.ObjectExpressionCalleeDataExtractor),e(a.ServiceIdentifiers.Factory__ICalleeDataExtractor).toFactory(n.InversifyContainerFacade.getCacheFactory(a.ServiceIdentifiers.ICalleeDataExtractor))})},function(e,t,r){"use strict";var n=r(5),o=r(0),a=r(2),i=r(6),s=r(7);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(1),d=c.__importStar(r(17)),l=r(41),f=r(8),p=r(9),m=function(e){function t(){return o(this,t),i(this,(t.__proto__||n(t)).apply(this,arguments))}return s(t,e),a(t,[{key:"extract",value:function(e,t){if(!f.NodeGuards.isIdentifierNode(t))return null;var r=this.getCalleeBlockStatement(p.NodeUtils.getBlockScopesOfNode(e[0])[0],t.name);return r?{callee:r,name:t.name}:null}},{key:"getCalleeBlockStatement",value:function(e,t){var r=null;return d.traverse(e,{enter:function(e){if(f.NodeGuards.isFunctionDeclarationNode(e)&&e.id.name===t)return r=e.body,d.VisitorOption.Break}}),r}}]),t}(l.AbstractCalleeDataExtractor);m=c.__decorate([u.injectable()],m),t.FunctionDeclarationCalleeDataExtractor=m},function(e,t,r){"use strict";var n=r(5),o=r(0),a=r(2),i=r(6),s=r(7);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(1),d=c.__importStar(r(17)),l=r(41),f=r(8),p=r(9),m=function(e){function t(){return o(this,t),i(this,(t.__proto__||n(t)).apply(this,arguments))}return s(t,e),a(t,[{key:"extract",value:function(e,t){var r=null;return f.NodeGuards.isIdentifierNode(t)&&(r=this.getCalleeBlockStatement(p.NodeUtils.getBlockScopesOfNode(e[0])[0],t.name)),f.NodeGuards.isFunctionExpressionNode(t)&&(r=t.body),r?{callee:r,name:t.name||null}:null}},{key:"getCalleeBlockStatement",value:function(e,t){var r=null;return d.traverse(e,{enter:function(e,n){if(f.NodeGuards.isFunctionExpressionNode(e)&&n&&f.NodeGuards.isVariableDeclaratorNode(n)&&f.NodeGuards.isIdentifierNode(n.id)&&n.id.name===t)return r=e.body,d.VisitorOption.Break}}),r}}]),t}(l.AbstractCalleeDataExtractor);m=c.__decorate([u.injectable()],m),t.FunctionExpressionCalleeDataExtractor=m},function(e,t,r){"use strict";var n=r(33),o=r(5),a=r(0),i=r(2),s=r(6),c=r(7);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(1),l=u.__importStar(r(17)),f=r(41),p=r(8),m=r(9),g=function(e){function t(){return a(this,t),s(this,(t.__proto__||o(t)).apply(this,arguments))}return c(t,e),i(t,[{key:"extract",value:function(e,t){if(!p.NodeGuards.isMemberExpressionNode(t))return null;var r=this.createObjectMembersCallsChain([],t);if(!r.length)return null;var n=r[r.length-1],o=this.getCalleeBlockStatement(m.NodeUtils.getBlockScopesOfNode(e[0])[0],r);return o?{callee:o,name:n}:null}},{key:"createObjectMembersCallsChain",value:function(e,t){if(p.NodeGuards.isIdentifierNode(t.property)&&!1===t.computed)e.unshift(t.property.name);else{if(!p.NodeGuards.isLiteralNode(t.property)||"string"!=typeof t.property.value&&"number"!=typeof t.property.value)return e;e.unshift(t.property.value)}return p.NodeGuards.isMemberExpressionNode(t.object)?this.createObjectMembersCallsChain(e,t.object):(p.NodeGuards.isIdentifierNode(t.object)&&e.unshift(t.object.name),e)}},{key:"getCalleeBlockStatement",value:function(e,t){var r=this,n=t.shift();if(!n)return null;var o=null;return l.traverse(e,{enter:function(e){if(p.NodeGuards.isVariableDeclaratorNode(e)&&p.NodeGuards.isIdentifierNode(e.id)&&e.init&&p.NodeGuards.isObjectExpressionNode(e.init)&&e.id.name===n)return o=r.findCalleeBlockStatement(e.init.properties,t),l.VisitorOption.Break}}),o}},{key:"findCalleeBlockStatement",value:function(e,t){var r=t.shift();if(!r)return null;var o=!0,a=!1,i=void 0;try{for(var s,c=n(e);!(o=(s=c.next()).done);o=!0){var u=s.value,d=p.NodeGuards.isIdentifierNode(u.key)&&u.key.name===r,l=p.NodeGuards.isLiteralNode(u.key)&&Boolean(u.key.value)&&u.key.value===r;if(d||l){if(p.NodeGuards.isObjectExpressionNode(u.value))return this.findCalleeBlockStatement(u.value.properties,t);if(p.NodeGuards.isFunctionExpressionNode(u.value))return u.value.body}}}catch(e){a=!0,i=e}finally{try{o||null==c.return||c.return()}finally{if(a)throw i}}return null}}]),t}(f.AbstractCalleeDataExtractor);g=u.__decorate([d.injectable()],g),t.ObjectExpressionCalleeDataExtractor=g},function(e,t,r){"use strict";var n=r(11),o=r(0),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i=r(4),s=r(1),c=r(3),u=i.__importStar(r(17)),d=r(49),l=r(8),f=r(9),p=m=function(){function e(t){o(this,e),this.calleeDataExtractorFactory=t}return a(e,[{key:"analyze",value:function(e){return this.analyzeRecursive(e.body)}},{key:"analyzeRecursive",value:function(e){for(var t=this,r=m.getLimitIndex(e.length),n=[],o=e.length,a=0;ar)return"break";var a=e[o];u.traverse(a,{enter:function(r){if(l.NodeGuards.isCallExpressionNode(r))return a.parentNode!==f.NodeUtils.getBlockScopesOfNode(r)[0]?u.VisitorOption.Skip:void t.analyzeCallExpressionNode(n,e,r)}})}(a))break}return n}},{key:"analyzeCallExpressionNode",value:function(e,t,r){var o=this;m.calleeDataExtractorsList.forEach(function(a){var i=o.calleeDataExtractorFactory(a).extract(t,r.callee);i&&e.push(n({},i,{stackTrace:o.analyzeRecursive(i.callee.body)}))})}}],[{key:"getLimitIndex",value:function(e){var t=e-1,r=m.limitThresholdActivationLength-1,n=t;return t>r&&(n=Math.round(r+t*m.limitThreshold))>t&&(n=t),n}}]),e}();p.calleeDataExtractorsList=[d.CalleeDataExtractor.FunctionDeclarationCalleeDataExtractor,d.CalleeDataExtractor.FunctionExpressionCalleeDataExtractor,d.CalleeDataExtractor.ObjectExpressionCalleeDataExtractor],p.limitThresholdActivationLength=25,p.limitThreshold=.002,p=m=i.__decorate([s.injectable(),i.__param(0,s.inject(c.ServiceIdentifiers.Factory__ICalleeDataExtractor)),i.__metadata("design:paramtypes",[Function])],p),t.StackTraceAnalyzer=p;var m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(22),o=r(1),a=r(3),i=r(52),s=r(28),c=r(76),u=r(77),d=r(84),l=r(85),f=r(86),p=r(87),m=r(88);t.controlFlowTransformersModule=new o.ContainerModule(function(e){e(a.ServiceIdentifiers.INodeTransformer).to(u.BlockStatementControlFlowTransformer).whenTargetNamed(s.NodeTransformer.BlockStatementControlFlowTransformer),e(a.ServiceIdentifiers.INodeTransformer).to(l.DeadCodeInjectionTransformer).whenTargetNamed(s.NodeTransformer.DeadCodeInjectionTransformer),e(a.ServiceIdentifiers.INodeTransformer).to(f.FunctionControlFlowTransformer).whenTargetNamed(s.NodeTransformer.FunctionControlFlowTransformer),e(a.ServiceIdentifiers.IControlFlowReplacer).to(c.BinaryExpressionControlFlowReplacer).whenTargetNamed(i.ControlFlowReplacer.BinaryExpressionControlFlowReplacer),e(a.ServiceIdentifiers.IControlFlowReplacer).to(d.CallExpressionControlFlowReplacer).whenTargetNamed(i.ControlFlowReplacer.CallExpressionControlFlowReplacer),e(a.ServiceIdentifiers.IControlFlowReplacer).to(p.LogicalExpressionControlFlowReplacer).whenTargetNamed(i.ControlFlowReplacer.LogicalExpressionControlFlowReplacer),e(a.ServiceIdentifiers.IControlFlowReplacer).to(m.StringLiteralControlFlowReplacer).whenTargetNamed(i.ControlFlowReplacer.StringLiteralControlFlowReplacer),e(a.ServiceIdentifiers.Factory__IControlFlowReplacer).toFactory(n.InversifyContainerFacade.getCacheFactory(a.ServiceIdentifiers.IControlFlowReplacer))})},function(e,t,r){"use strict";var n=r(5),o=r(0),a=r(2),i=r(6),s=r(7);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(1),d=r(3),l=r(20),f=r(53),p=m=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"replace",value:function(e,t,r){var n=e.operator,o=this.controlFlowCustomNodeFactory(l.ControlFlowCustomNode.BinaryExpressionFunctionNode);o.initialize(n);var a=this.insertCustomNodeToControlFlowStorage(o,r,n,m.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(r.getStorageId(),a,e.left,e.right)}}]),t}(f.ExpressionWithOperatorControlFlowReplacer);p.usingExistingIdentifierChance=.5,p=m=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IControlFlowCustomNode)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],p),t.BinaryExpressionControlFlowReplacer=p;var m},function(e,t,r){"use strict";var n=r(5),o=r(0),a=r(2),i=r(6),s=r(7);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(1),d=r(3),l=c.__importStar(r(17)),f=r(20),p=r(12),m=r(13),g=r(8),_=r(9),N=v=function(e){function t(e,r,a,s){var c;return o(this,t),c=i(this,(t.__proto__||n(t)).call(this,a,s)),c.controlFlowCustomNodeFactory=e,c.arrayUtils=r,c}return s(t,e),a(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case p.TransformationStage.ControlFlowFlattening:return{leave:function(e,r){if(r&&g.NodeGuards.isBlockStatementNode(e))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){if(this.randomGenerator.getMathRandom()>this.options.controlFlowFlatteningThreshold||!v.canTransformBlockStatementNode(e))return e;var r=e.body,n=this.arrayUtils.arrayRange(r.length),o=this.arrayUtils.arrayShuffle(n),a=n.map(function(e){return o.indexOf(e)}),i=this.controlFlowCustomNodeFactory(f.ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode);i.initialize(r,o,a);var s=i.getNode()[0];return _.NodeUtils.parentizeNode(s,t),s}}],[{key:"blockStatementHasProhibitedStatements",value:function(e){return e.body.some(function(e){var t=g.NodeGuards.isBreakStatementNode(e)||g.NodeGuards.isContinueStatementNode(e),r=g.NodeGuards.isVariableDeclarationNode(e)&&("const"===e.kind||"let"===e.kind),n=g.NodeGuards.isClassDeclarationNode(e);return g.NodeGuards.isFunctionDeclarationNode(e)||t||r||n})}},{key:"canTransformBlockStatementNode",value:function(e){var t=!0;return l.traverse(e,{enter:function(e){if(g.NodeGuards.isWhileStatementNode(e))return l.VisitorOption.Skip;g.NodeGuards.isBlockStatementNode(e)&&v.blockStatementHasProhibitedStatements(e)&&(t=!1)}}),e.body.length<=4&&(t=!1),t}}]),t}(m.AbstractNodeTransformer);N=v=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IControlFlowCustomNode)),c.__param(1,u.inject(d.ServiceIdentifiers.IArrayUtils)),c.__param(2,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(3,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object,Object])],N),t.BlockStatementControlFlowTransformer=N;var v},function(e,t){e.exports=require("@babel/runtime/core-js/object/define-property")},function(e,t){e.exports=require("@babel/runtime/core-js/object/get-own-property-descriptor")},function(e,t){e.exports=require("@babel/runtime/core-js/reflect/get-metadata")},function(e,t){e.exports=require("@babel/runtime/core-js/object/get-own-property-names")},function(e,t){e.exports=require("@babel/runtime/core-js/reflect/define-metadata")},function(e,t){e.exports=require("@babel/runtime/core-js/reflect/has-metadata")},function(e,t,r){"use strict";var n=r(5),o=r(0),a=r(2),i=r(6),s=r(7);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(1),d=r(3),l=r(20),f=r(43),p=r(8),m=g=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"replace",value:function(e,t,r){var n=e.callee;if(!p.NodeGuards.isIdentifierNode(n))return e;var o=String(e.arguments.length),a=this.controlFlowCustomNodeFactory(l.ControlFlowCustomNode.CallExpressionFunctionNode),i=e.arguments;a.initialize(i);var s=this.insertCustomNodeToControlFlowStorage(a,r,o,g.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(r.getStorageId(),s,n,i)}},{key:"getControlFlowStorageCallNode",value:function(e,t,r,n){var o=this.controlFlowCustomNodeFactory(l.ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode);o.initialize(e,t,r,n);var a=o.getNode()[0];if(!a||!p.NodeGuards.isExpressionStatementNode(a))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return a.expression}}]),t}(f.AbstractControlFlowReplacer);m.usingExistingIdentifierChance=.5,m=g=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IControlFlowCustomNode)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],m),t.CallExpressionControlFlowReplacer=m;var g},function(e,t,r){"use strict";var n=r(29),o=r(5),a=r(0),i=r(2),s=r(6),c=r(7);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(1),l=r(3),f=u.__importStar(r(17)),p=r(54),m=r(28),g=r(18),_=r(12),N=r(13),v=r(8),y=r(15),h=r(9),b=S=function(e){function t(e,r,i,c){var u;return a(this,t),u=s(this,(t.__proto__||o(t)).call(this,i,c)),u.deadCodeInjectionRootAstHostNodeSet=new n,u.collectedBlockStatements=[],u.collectedBlockStatementsTotalLength=0,u.deadCodeInjectionCustomNodeFactory=e,u.transformersRunner=r,u}return c(t,e),i(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case _.TransformationStage.DeadCodeInjection:return{enter:function(e,r){if(r&&v.NodeGuards.isProgramNode(e))return t.analyzeNode(e,r),e},leave:function(e,r){if(r&&v.NodeGuards.isBlockStatementNode(e))return t.transformNode(e,r)}};case _.TransformationStage.Finalizing:return this.deadCodeInjectionRootAstHostNodeSet.size?{enter:function(e,r){if(r&&t.isDeadCodeInjectionRootAstHostNode(e))return t.restoreNode(e,r)}}:null;default:return null}}},{key:"analyzeNode",value:function(e,t){var r=this;f.traverse(e,{enter:function(e){if(v.NodeGuards.isBlockStatementNode(e)){var t=h.NodeUtils.clone(e);S.isValidCollectedBlockStatementNode(t)&&(h.NodeUtils.parentizeNode(t,t),t=r.transformersRunner.transform(t,S.transformersToRenameBlockScopeIdentifiers,_.TransformationStage.Obfuscating),r.collectedBlockStatements.push(t))}}}),this.collectedBlockStatementsTotalLength=this.collectedBlockStatements.length}},{key:"transformNode",value:function(e,t){if(!this.collectedBlockStatements.length||this.collectedBlockStatementsTotalLengththis.options.deadCodeInjectionThreshold||!S.isValidWrappedBlockStatementNode(e))return e;var r=this.collectedBlockStatements.length-1,n=this.randomGenerator.getRandomInteger(0,r),o=this.collectedBlockStatements.splice(n,1)[0];return o===e?e:this.replaceBlockStatementNode(e,o,t)}},{key:"restoreNode",value:function(e,t){var r=e.body[0];if(!v.NodeGuards.isFunctionDeclarationNode(r))throw new Error("Wrong dead code injection root AST host node. Host node should contain `FunctionDeclaration` node");return r.body}},{key:"isDeadCodeInjectionRootAstHostNode",value:function(e){return v.NodeGuards.isBlockStatementNode(e)&&this.deadCodeInjectionRootAstHostNodeSet.has(e)}},{key:"replaceBlockStatementNode",value:function(e,t,r){var n=y.Nodes.getBlockStatementNode([y.Nodes.getFunctionDeclarationNode(S.deadCodeInjectionRootAstHostNodeName,[],t)]);this.deadCodeInjectionRootAstHostNodeSet.add(n);var o=this.deadCodeInjectionCustomNodeFactory(p.DeadCodeInjectionCustomNode.BlockStatementDeadCodeInjectionNode);o.initialize(e,n);var a=o.getNode()[0];return h.NodeUtils.parentizeNode(a,r),a}}],[{key:"isProhibitedNodeInsideCollectedBlockStatement",value:function(e){return v.NodeGuards.isBreakStatementNode(e)||v.NodeGuards.isContinueStatementNode(e)||v.NodeGuards.isAwaitExpressionNode(e)||v.NodeGuards.isSuperNode(e)}},{key:"isScopeHoistingFunctionDeclaration",value:function(e){if(!v.NodeGuards.isFunctionDeclarationNode(e))return!1;var t=h.NodeUtils.getScopeOfNode(e),r=v.NodeGuards.isSwitchCaseNode(t)?t.consequent:t.body,n=r.indexOf(e);if(0===n)return!1;var o=r.slice(0,n),a=y.Nodes.getBlockStatementNode(o),i=e.id.name,s=!1;return f.traverse(a,{enter:function(e){if(v.NodeGuards.isIdentifierNode(e)&&e.name===i)return s=!0,f.VisitorOption.Break}}),s}},{key:"isValidCollectedBlockStatementNode",value:function(e){if(!e.body.length)return!1;var t=0,r=!0;return f.traverse(e,{enter:function(e){if(v.NodeGuards.isBlockStatementNode(e)&&t++,t>S.maxNestedBlockStatementsCount||S.isProhibitedNodeInsideCollectedBlockStatement(e)||S.isScopeHoistingFunctionDeclaration(e))return r=!1,f.VisitorOption.Break}}),r}},{key:"isValidWrappedBlockStatementNode",value:function(e){if(!e.body.length)return!1;var t=!0;return f.traverse(e,{enter:function(e){if(S.isScopeHoistingFunctionDeclaration(e))return t=!1,f.VisitorOption.Break}}),!!t&&h.NodeUtils.getBlockScopesOfNode(e)[0].type!==g.NodeType.Program}}]),t}(N.AbstractNodeTransformer);b.deadCodeInjectionRootAstHostNodeName="deadCodeInjectionRootAstHostNode",b.maxNestedBlockStatementsCount=4,b.minCollectedBlockStatementsCount=5,b.transformersToRenameBlockScopeIdentifiers=[m.NodeTransformer.CatchClauseTransformer,m.NodeTransformer.ClassDeclarationTransformer,m.NodeTransformer.FunctionDeclarationTransformer,m.NodeTransformer.FunctionTransformer,m.NodeTransformer.LabeledStatementTransformer,m.NodeTransformer.VariableDeclarationTransformer],b=S=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode)),u.__param(1,d.inject(l.ServiceIdentifiers.ITransformersRunner)),u.__param(2,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object,Object])],b),t.DeadCodeInjectionTransformer=b;var S},function(e,t,r){"use strict";var n=r(11),o=r(29),a=r(16),i=r(5),s=r(0),c=r(2),u=r(6),d=r(7);Object.defineProperty(t,"__esModule",{value:!0});var l=r(4),f=r(1),p=r(3),m=l.__importStar(r(17)),g=r(20),_=r(52),N=r(18),v=r(12),y=r(13),h=r(8),b=r(23),S=r(9),I=C=function(e){function t(e,r,n,c,d){var l;return s(this,t),l=u(this,(t.__proto__||i(t)).call(this,c,d)),l.controlFlowData=new a,l.visitedFunctionNodes=new o,l.hostNodesWithControlFlowNode=new o,l.controlFlowStorageFactory=e,l.controlFlowReplacerFactory=r,l.controlFlowCustomNodeFactory=n,l}return d(t,e),c(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case v.TransformationStage.ControlFlowFlattening:return{leave:function(e,r){if(r&&(h.NodeGuards.isFunctionDeclarationNode(e)||h.NodeGuards.isFunctionExpressionNode(e)||h.NodeGuards.isArrowFunctionExpressionNode(e)))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){if(this.visitedFunctionNodes.add(e),!h.NodeGuards.isBlockStatementNode(e.body))return e;var r=this.getHostNode(e.body),n=this.getControlFlowStorage(r);if(this.controlFlowData.set(r,n),this.transformFunctionBody(e.body,n),!n.getLength())return e;var o=this.controlFlowCustomNodeFactory(g.ControlFlowCustomNode.ControlFlowStorageNode);return o.initialize(n),b.NodeAppender.prependNode(r,o.getNode()),this.hostNodesWithControlFlowNode.add(r),e}},{key:"getControlFlowStorage",value:function(e){var t=this.controlFlowStorageFactory();if(this.controlFlowData.has(e)){this.hostNodesWithControlFlowNode.has(e)&&e.body.shift();var r=this.controlFlowData.get(e);t.mergeWith(r,!0)}return t}},{key:"getHostNode",value:function(e){var t=S.NodeUtils.getBlockScopesOfNode(e);return 1===t.length?e:(t.pop(),t.length>C.hostNodeSearchMinDepth&&t.splice(0,C.hostNodeSearchMinDepth),t.length>C.hostNodeSearchMaxDepth&&(t.length=C.hostNodeSearchMaxDepth),this.randomGenerator.getRandomGenerator().pickone(t))}},{key:"isVisitedFunctionNode",value:function(e){return(h.NodeGuards.isFunctionDeclarationNode(e)||h.NodeGuards.isFunctionExpressionNode(e)||h.NodeGuards.isArrowFunctionExpressionNode(e))&&this.visitedFunctionNodes.has(e)}},{key:"transformFunctionBody",value:function(e,t){var r=this;m.replace(e,{enter:function(e,o){if(e.ignoredNode)return m.VisitorOption.Skip;if(r.isVisitedFunctionNode(e)||!o)return m.VisitorOption.Skip;if(!C.controlFlowReplacersMap.has(e.type))return e;if(r.randomGenerator.getMathRandom()>r.options.controlFlowFlatteningThreshold)return e;var a=C.controlFlowReplacersMap.get(e.type);return void 0===a?e:n({},r.controlFlowReplacerFactory(a).replace(e,o,t),{parentNode:o})}})}}]),t}(y.AbstractNodeTransformer);I.controlFlowReplacersMap=new a([[N.NodeType.BinaryExpression,_.ControlFlowReplacer.BinaryExpressionControlFlowReplacer],[N.NodeType.CallExpression,_.ControlFlowReplacer.CallExpressionControlFlowReplacer],[N.NodeType.LogicalExpression,_.ControlFlowReplacer.LogicalExpressionControlFlowReplacer],[N.NodeType.Literal,_.ControlFlowReplacer.StringLiteralControlFlowReplacer]]),I.hostNodeSearchMinDepth=0,I.hostNodeSearchMaxDepth=2,I=C=l.__decorate([f.injectable(),l.__param(0,f.inject(p.ServiceIdentifiers.Factory__TControlFlowStorage)),l.__param(1,f.inject(p.ServiceIdentifiers.Factory__IControlFlowReplacer)),l.__param(2,f.inject(p.ServiceIdentifiers.Factory__IControlFlowCustomNode)),l.__param(3,f.inject(p.ServiceIdentifiers.IRandomGenerator)),l.__param(4,f.inject(p.ServiceIdentifiers.IOptions)),l.__metadata("design:paramtypes",[Function,Function,Function,Object,Object])],I),t.FunctionControlFlowTransformer=I;var C},function(e,t,r){"use strict";var n=r(5),o=r(0),a=r(2),i=r(6),s=r(7);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(1),d=r(3),l=r(20),f=r(53),p=r(8),m=r(9),g=_=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"replace",value:function(e,t,r){if(this.checkForProhibitedExpressions(e.left,e.right))return e;var n=e.operator,o=this.controlFlowCustomNodeFactory(l.ControlFlowCustomNode.LogicalExpressionFunctionNode);o.initialize(n);var a=this.insertCustomNodeToControlFlowStorage(o,r,n,_.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(r.getStorageId(),a,e.left,e.right)}},{key:"checkForProhibitedExpressions",value:function(e,t){return[e,t].some(function(e){var t;return t=p.NodeGuards.isUnaryExpressionNode(e)?m.NodeUtils.getUnaryExpressionArgumentNode(e):e,!(p.NodeGuards.isLiteralNode(t)||p.NodeGuards.isIdentifierNode(t)||p.NodeGuards.isObjectExpressionNode(t)||p.NodeGuards.isExpressionStatementNode(t))})}}]),t}(f.ExpressionWithOperatorControlFlowReplacer);g.usingExistingIdentifierChance=.5,g=_=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IControlFlowCustomNode)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],g),t.LogicalExpressionControlFlowReplacer=g;var _},function(e,t,r){"use strict";var n=r(5),o=r(0),a=r(2),i=r(6),s=r(7);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(1),d=r(3),l=r(20),f=r(43),p=r(8),m=g=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"replace",value:function(e,t,r){if(p.NodeGuards.isPropertyNode(t)&&t.key===e)return e;if("string"!=typeof e.value||e.value.length<3)return e;var n=String(e.value),o=this.controlFlowCustomNodeFactory(l.ControlFlowCustomNode.StringLiteralNode);o.initialize(e.value);var a=this.insertCustomNodeToControlFlowStorage(o,r,n,g.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(r.getStorageId(),a)}},{key:"getControlFlowStorageCallNode",value:function(e,t){var r=this.controlFlowCustomNodeFactory(l.ControlFlowCustomNode.StringLiteralControlFlowStorageCallNode);r.initialize(e,t);var n=r.getNode()[0];if(!n||!p.NodeGuards.isExpressionStatementNode(n))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return n.expression}}]),t}(f.AbstractControlFlowReplacer);m.usingExistingIdentifierChance=1,m=g=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IControlFlowCustomNode)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],m),t.StringLiteralControlFlowReplacer=m;var g},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),o=r(3),a=r(28),i=r(90),s=r(91),c=r(92),u=r(93);t.convertingTransformersModule=new n.ContainerModule(function(e){e(o.ServiceIdentifiers.INodeTransformer).to(i.MemberExpressionTransformer).whenTargetNamed(a.NodeTransformer.MemberExpressionTransformer),e(o.ServiceIdentifiers.INodeTransformer).to(s.MethodDefinitionTransformer).whenTargetNamed(a.NodeTransformer.MethodDefinitionTransformer),e(o.ServiceIdentifiers.INodeTransformer).to(c.ObjectExpressionKeysTransformer).whenTargetNamed(a.NodeTransformer.ObjectExpressionKeysTransformer),e(o.ServiceIdentifiers.INodeTransformer).to(u.TemplateLiteralTransformer).whenTargetNamed(a.NodeTransformer.TemplateLiteralTransformer)})},function(e,t,r){"use strict";var n=r(5),o=r(0),a=r(2),i=r(6),s=r(7);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(1),d=r(3),l=r(18),f=r(12),p=r(13),m=r(8),g=function(e){function t(e,r){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r))}return s(t,e),a(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case f.TransformationStage.Converting:return{enter:function(e,r){if(r&&m.NodeGuards.isMemberExpressionNode(e))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){if(m.NodeGuards.isIdentifierNode(e.property)){if(e.computed)return e;e.computed=!0,e.property={type:l.NodeType.Literal,value:e.property.name,raw:"'".concat(e.property.name,"'")}}return e}}]),t}(p.AbstractNodeTransformer);g=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Object,Object])],g),t.MemberExpressionTransformer=g},function(e,t,r){"use strict";var n=r(5),o=r(0),a=r(2),i=r(6),s=r(7);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(1),d=r(3),l=r(18),f=r(12),p=r(13),m=r(8),g=_=function(e){function t(e,r){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r))}return s(t,e),a(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case f.TransformationStage.Converting:return{enter:function(e,r){if(r&&m.NodeGuards.isMethodDefinitionNode(e))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){return m.NodeGuards.isIdentifierNode(e.key)&&!_.ignoredNames.includes(e.key.name)&&!1===e.computed&&(e.computed=!0,e.key={type:l.NodeType.Literal,value:e.key.name,raw:"'".concat(e.key.name,"'")}),e}}]),t}(p.AbstractNodeTransformer);g.ignoredNames=["constructor"],g=_=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Object,Object])],g),t.MethodDefinitionTransformer=g;var _},function(e,t,r){"use strict";var n=r(30),o=r(16),a=r(5),i=r(0),s=r(2),c=r(6),u=r(7);Object.defineProperty(t,"__esModule",{value:!0});var d=r(4),l=r(1),f=r(3),p=r(12),m=r(13),g=r(23),_=r(8),N=r(15),v=r(9),y=h=function(e){function t(e,r){var n;return i(this,t),n=c(this,(t.__proto__||a(t)).call(this,e,r)),n.cachedScopeNodesMap=new o,n}return u(t,e),s(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case p.TransformationStage.Converting:return{enter:function(e,r){if(t.options.transformObjectKeys&&r&&_.NodeGuards.isObjectExpressionNode(e)&&_.NodeGuards.isVariableDeclaratorNode(r))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){if(!_.NodeGuards.isIdentifierNode(t.id))return e;var r=v.NodeUtils.getScopeOfNode(t);return r&&_.NodeGuards.isNodeHasScope(r)?(this.cachedScopeNodesMap.set(t,r),this.transformObjectExpressionNode(e,t.id,t)):e}},{key:"extractPropertiesToExpressionStatements",value:function(e,t,r){for(var n=e.length,o=[],a=[],i=0;i1){var o=_.Nodes.getBinaryExpressionNode("+",n.shift(),n.shift());return n.forEach(function(e){o=_.Nodes.getBinaryExpressionNode("+",o,e)}),o}return n[0]}},{key:"fixEsprimaReturnStatementTemplateLiteralNode",value:function(e){var t=N.NodeUtils.getScopeOfNode(e),r=g.NodeGuards.isSwitchCaseNode(t)?t.consequent:t.body,o=r.indexOf(e);if(o===r.length-2){var a=r[o+1];if(a&&g.NodeGuards.isExpressionStatementNode(a)){var i=!1;if(f.traverse(a,{enter:function(e,t){if(g.NodeGuards.isTemplateLiteralNode(e))return i=!0,f.VisitorOption.Break}}),i)return e.argument=a.expression,r.pop(),g.NodeGuards.isSwitchCaseNode(t)?t.consequent=n(r):t.body=n(r),e}}}}],[{key:"isLiteralNodeWithStringValue",value:function(e){return e&&g.NodeGuards.isLiteralNode(e)&&"string"==typeof e.value}}]),t}(m.AbstractNodeTransformer);v=y=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Object,Object])],v),t.TemplateLiteralTransformer=v;var y},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(22),o=r(1),a=r(3),i=r(20),s=r(31),c=r(55),u=r(54),d=r(95),l=r(96),f=r(97),p=r(98),m=r(99),g=r(100),_=r(103),N=r(104),v=r(105),y=r(106),h=r(107),b=r(108),S=r(110),I=r(112),C=r(114),O=r(118),j=r(120),F=r(121),k=r(122),T=r(124),x=r(126),w=r(133),E=r(135),G=r(139),R=r(140);t.customNodesModule=new o.ContainerModule(function(e){e(a.ServiceIdentifiers.ICustomNode).to(b.ConsoleOutputDisableExpressionNode).whenTargetNamed(s.CustomNode.ConsoleOutputDisableExpressionNode),e(a.ServiceIdentifiers.ICustomNode).to(S.DebugProtectionFunctionCallNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionCallNode),e(a.ServiceIdentifiers.ICustomNode).to(I.DebugProtectionFunctionIntervalNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionIntervalNode),e(a.ServiceIdentifiers.ICustomNode).to(C.DebugProtectionFunctionNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionNode),e(a.ServiceIdentifiers.ICustomNode).to(O.DomainLockNode).whenTargetNamed(s.CustomNode.DomainLockNode),e(a.ServiceIdentifiers.ICustomNode).to(k.NodeCallsControllerFunctionNode).whenTargetNamed(s.CustomNode.NodeCallsControllerFunctionNode),e(a.ServiceIdentifiers.ICustomNode).to(T.SelfDefendingUnicodeNode).whenTargetNamed(s.CustomNode.SelfDefendingUnicodeNode),e(a.ServiceIdentifiers.ICustomNode).to(x.StringArrayCallsWrapper).whenTargetNamed(s.CustomNode.StringArrayCallsWrapper),e(a.ServiceIdentifiers.ICustomNode).to(w.StringArrayNode).whenTargetNamed(s.CustomNode.StringArrayNode),e(a.ServiceIdentifiers.ICustomNode).to(E.StringArrayRotateFunctionNode).whenTargetNamed(s.CustomNode.StringArrayRotateFunctionNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(g.BinaryExpressionFunctionNode).whenTargetNamed(i.ControlFlowCustomNode.BinaryExpressionFunctionNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(_.BlockStatementControlFlowFlatteningNode).whenTargetNamed(i.ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(v.CallExpressionControlFlowStorageCallNode).whenTargetNamed(i.ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(y.CallExpressionFunctionNode).whenTargetNamed(i.ControlFlowCustomNode.CallExpressionFunctionNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(h.ControlFlowStorageNode).whenTargetNamed(i.ControlFlowCustomNode.ControlFlowStorageNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(j.ExpressionWithOperatorControlFlowStorageCallNode).whenTargetNamed(i.ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(F.LogicalExpressionFunctionNode).whenTargetNamed(i.ControlFlowCustomNode.LogicalExpressionFunctionNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(R.StringLiteralNode).whenTargetNamed(i.ControlFlowCustomNode.StringLiteralNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(G.StringLiteralControlFlowStorageCallNode).whenTargetNamed(i.ControlFlowCustomNode.StringLiteralControlFlowStorageCallNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(N.BlockStatementDeadCodeInjectionNode).whenTargetNamed(u.DeadCodeInjectionCustomNode.BlockStatementDeadCodeInjectionNode),e(a.ServiceIdentifiers.ICustomNodeGroup).to(d.ConsoleOutputCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.ConsoleOutputCustomNodeGroup),e(a.ServiceIdentifiers.ICustomNodeGroup).to(l.DebugProtectionCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.DebugProtectionCustomNodeGroup),e(a.ServiceIdentifiers.ICustomNodeGroup).to(f.DomainLockCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.DomainLockCustomNodeGroup),e(a.ServiceIdentifiers.ICustomNodeGroup).to(p.SelfDefendingCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.SelfDefendingCustomNodeGroup),e(a.ServiceIdentifiers.ICustomNodeGroup).to(m.StringArrayCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.StringArrayCustomNodeGroup),e(a.ServiceIdentifiers.Factory__ICustomNode).toFactory(n.InversifyContainerFacade.getFactory(a.ServiceIdentifiers.ICustomNode)),e(a.ServiceIdentifiers.Factory__IControlFlowCustomNode).toFactory(n.InversifyContainerFacade.getConstructorFactory(a.ServiceIdentifiers.Newable__ICustomNode,a.ServiceIdentifiers.Factory__IIdentifierNamesGenerator,a.ServiceIdentifiers.IRandomGenerator,a.ServiceIdentifiers.IOptions)),e(a.ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode).toFactory(n.InversifyContainerFacade.getConstructorFactory(a.ServiceIdentifiers.Newable__ICustomNode,a.ServiceIdentifiers.Factory__IIdentifierNamesGenerator,a.ServiceIdentifiers.IRandomGenerator,a.ServiceIdentifiers.IOptions)),e(a.ServiceIdentifiers.Factory__ICustomNodeGroup).toFactory(n.InversifyContainerFacade.getFactory(a.ServiceIdentifiers.ICustomNodeGroup))})},function(e,t,r){"use strict";var n=r(16),o=r(5),a=r(0),i=r(2),s=r(6),c=r(7);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(1),l=r(3),f=r(10),p=r(31),m=r(25),g=r(34),_=r(23),N=function(e){function t(e,r,n,i){var c;return a(this,t),c=s(this,(t.__proto__||o(t)).call(this,r,n,i)),c.appendEvent=m.ObfuscationEvent.BeforeObfuscation,c.customNodeFactory=e,c}return c(t,e),i(t,[{key:"appendCustomNodes",value:function(e,t){var r=this.getRandomStackTraceIndex(t.length);this.appendCustomNodeIfExist(p.CustomNode.ConsoleOutputDisableExpressionNode,function(n){_.NodeAppender.appendNodeToOptimalBlockScope(t,e,n.getNode(),r)}),this.appendCustomNodeIfExist(p.CustomNode.NodeCallsControllerFunctionNode,function(n){var o;o=t.length?_.NodeAppender.getOptimalBlockScope(t,r,1):e,_.NodeAppender.prependNode(o,n.getNode())})}},{key:"initialize",value:function(){if(this.customNodes=new n,this.options.disableConsoleOutput){var e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(p.CustomNode.ConsoleOutputDisableExpressionNode),r=this.customNodeFactory(p.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),r.initialize(this.appendEvent,e),this.customNodes.set(p.CustomNode.ConsoleOutputDisableExpressionNode,t),this.customNodes.set(p.CustomNode.NodeCallsControllerFunctionNode,r)}}}]),t}(g.AbstractCustomNodeGroup);u.__decorate([f.initializable(),u.__metadata("design:type",n)],N.prototype,"customNodes",void 0),N=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__ICustomNode)),u.__param(1,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Function,Object,Object])],N),t.ConsoleOutputCustomNodeGroup=N},function(e,t,r){"use strict";var n=r(16),o=r(5),a=r(0),i=r(2),s=r(6),c=r(7);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(1),l=r(3),f=r(10),p=r(31),m=r(25),g=r(34),_=r(23),N=function(e){function t(e,r,n,i){var c;return a(this,t),c=s(this,(t.__proto__||o(t)).call(this,r,n,i)),c.appendEvent=m.ObfuscationEvent.BeforeObfuscation,c.customNodeFactory=e,c}return c(t,e),i(t,[{key:"appendCustomNodes",value:function(e,t){var r=this,n=this.getRandomStackTraceIndex(t.length);this.appendCustomNodeIfExist(p.CustomNode.DebugProtectionFunctionCallNode,function(r){_.NodeAppender.appendNodeToOptimalBlockScope(t,e,r.getNode(),n)}),this.appendCustomNodeIfExist(p.CustomNode.DebugProtectionFunctionNode,function(t){_.NodeAppender.appendNode(e,t.getNode())}),this.appendCustomNodeIfExist(p.CustomNode.DebugProtectionFunctionIntervalNode,function(t){var n=e.body.length,o=r.randomGenerator.getRandomInteger(0,n);_.NodeAppender.insertNodeAtIndex(e,t.getNode(),o)}),this.appendCustomNodeIfExist(p.CustomNode.NodeCallsControllerFunctionNode,function(r){var o;o=t.length?_.NodeAppender.getOptimalBlockScope(t,n,1):e,_.NodeAppender.prependNode(o,r.getNode())})}},{key:"initialize",value:function(){if(this.customNodes=new n,this.options.debugProtection){var e=this.identifierNamesGenerator.generate(),t=this.identifierNamesGenerator.generate(),r=this.customNodeFactory(p.CustomNode.DebugProtectionFunctionNode),o=this.customNodeFactory(p.CustomNode.DebugProtectionFunctionCallNode),a=this.customNodeFactory(p.CustomNode.DebugProtectionFunctionIntervalNode),i=this.customNodeFactory(p.CustomNode.NodeCallsControllerFunctionNode);r.initialize(e),o.initialize(e,t),a.initialize(e),i.initialize(this.appendEvent,t),this.customNodes.set(p.CustomNode.DebugProtectionFunctionNode,r),this.customNodes.set(p.CustomNode.DebugProtectionFunctionCallNode,o),this.options.debugProtectionInterval&&this.customNodes.set(p.CustomNode.DebugProtectionFunctionIntervalNode,a),this.customNodes.set(p.CustomNode.NodeCallsControllerFunctionNode,i)}}}]),t}(g.AbstractCustomNodeGroup);u.__decorate([f.initializable(),u.__metadata("design:type",n)],N.prototype,"customNodes",void 0),N=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__ICustomNode)),u.__param(1,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Function,Object,Object])],N),t.DebugProtectionCustomNodeGroup=N},function(e,t,r){"use strict";var n=r(16),o=r(5),a=r(0),i=r(2),s=r(6),c=r(7);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(1),l=r(3),f=r(10),p=r(31),m=r(25),g=r(34),_=r(23),N=function(e){function t(e,r,n,i){var c;return a(this,t),c=s(this,(t.__proto__||o(t)).call(this,r,n,i)),c.appendEvent=m.ObfuscationEvent.BeforeObfuscation,c.customNodeFactory=e,c}return c(t,e),i(t,[{key:"appendCustomNodes",value:function(e,t){var r=this.getRandomStackTraceIndex(t.length);this.appendCustomNodeIfExist(p.CustomNode.DomainLockNode,function(n){_.NodeAppender.appendNodeToOptimalBlockScope(t,e,n.getNode(),r)}),this.appendCustomNodeIfExist(p.CustomNode.NodeCallsControllerFunctionNode,function(n){var o;o=t.length?_.NodeAppender.getOptimalBlockScope(t,r,1):e,_.NodeAppender.prependNode(o,n.getNode())})}},{key:"initialize",value:function(){if(this.customNodes=new n,this.options.domainLock.length){var e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(p.CustomNode.DomainLockNode),r=this.customNodeFactory(p.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),r.initialize(this.appendEvent,e),this.customNodes.set(p.CustomNode.DomainLockNode,t),this.customNodes.set(p.CustomNode.NodeCallsControllerFunctionNode,r)}}}]),t}(g.AbstractCustomNodeGroup);u.__decorate([f.initializable(),u.__metadata("design:type",n)],N.prototype,"customNodes",void 0),N=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__ICustomNode)),u.__param(1,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Function,Object,Object])],N),t.DomainLockCustomNodeGroup=N},function(e,t,r){"use strict";var n=r(16),o=r(5),a=r(0),i=r(2),s=r(6),c=r(7);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(1),l=r(3),f=r(10),p=r(31),m=r(25),g=r(34),_=r(23),N=function(e){function t(e,r,n,i){var c;return a(this,t),c=s(this,(t.__proto__||o(t)).call(this,r,n,i)),c.appendEvent=m.ObfuscationEvent.AfterObfuscation,c.customNodeFactory=e,c}return c(t,e),i(t,[{key:"appendCustomNodes",value:function(e,t){var r=this.getRandomStackTraceIndex(t.length);this.appendCustomNodeIfExist(p.CustomNode.SelfDefendingUnicodeNode,function(n){_.NodeAppender.appendNodeToOptimalBlockScope(t,e,n.getNode(),r)}),this.appendCustomNodeIfExist(p.CustomNode.NodeCallsControllerFunctionNode,function(n){var o;o=t.length?_.NodeAppender.getOptimalBlockScope(t,r,1):e,_.NodeAppender.prependNode(o,n.getNode())})}},{key:"initialize",value:function(){if(this.customNodes=new n,this.options.selfDefending){var e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(p.CustomNode.SelfDefendingUnicodeNode),r=this.customNodeFactory(p.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),r.initialize(this.appendEvent,e),this.customNodes.set(p.CustomNode.SelfDefendingUnicodeNode,t),this.customNodes.set(p.CustomNode.NodeCallsControllerFunctionNode,r)}}}]),t}(g.AbstractCustomNodeGroup);u.__decorate([f.initializable(),u.__metadata("design:type",n)],N.prototype,"customNodes",void 0),N=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__ICustomNode)),u.__param(1,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Function,Object,Object])],N),t.SelfDefendingCustomNodeGroup=N},function(e,t,r){"use strict";var n=r(30),o=r(16),a=r(5),i=r(0),s=r(2),c=r(6),u=r(7);Object.defineProperty(t,"__esModule",{value:!0});var d=r(4),l=r(1),f=r(3),p=r(10),m=r(31),g=r(25),_=r(34),N=r(23),v=function(e){function t(e,r,n,o,s){var u;return i(this,t),u=c(this,(t.__proto__||a(t)).call(this,n,o,s)),u.appendEvent=g.ObfuscationEvent.AfterObfuscation,u.customNodeFactory=e,u.stringArrayStorage=r,u}return u(t,e),s(t,[{key:"appendCustomNodes",value:function(e,t){this.stringArrayStorage.getLength()&&(this.appendCustomNodeIfExist(m.CustomNode.StringArrayNode,function(t){N.NodeAppender.prependNode(e,t.getNode())}),this.appendCustomNodeIfExist(m.CustomNode.StringArrayCallsWrapper,function(t){N.NodeAppender.insertNodeAtIndex(e,t.getNode(),1)}),this.appendCustomNodeIfExist(m.CustomNode.StringArrayRotateFunctionNode,function(t){N.NodeAppender.insertNodeAtIndex(e,t.getNode(),1)}))}},{key:"initialize",value:function(){if(this.customNodes=new o,this.options.stringArray){var e,t=this.customNodeFactory(m.CustomNode.StringArrayNode),r=this.customNodeFactory(m.CustomNode.StringArrayCallsWrapper),a=this.customNodeFactory(m.CustomNode.StringArrayRotateFunctionNode),i=this.stringArrayStorage.getStorageId(),s=i.split("|"),c=n(s,2),u=c[0],d=c[1];e=this.options.rotateStringArray?this.randomGenerator.getRandomInteger(100,500):0,t.initialize(this.stringArrayStorage,u,e),r.initialize(u,d),a.initialize(u,e),this.customNodes.set(m.CustomNode.StringArrayNode,t),this.customNodes.set(m.CustomNode.StringArrayCallsWrapper,r),this.options.rotateStringArray&&this.customNodes.set(m.CustomNode.StringArrayRotateFunctionNode,a)}}}]),t}(_.AbstractCustomNodeGroup);d.__decorate([p.initializable(),d.__metadata("design:type",o)],v.prototype,"customNodes",void 0),v=d.__decorate([l.injectable(),d.__param(0,l.inject(f.ServiceIdentifiers.Factory__ICustomNode)),d.__param(1,l.inject(f.ServiceIdentifiers.TStringArrayStorage)),d.__param(2,l.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d.__param(3,l.inject(f.ServiceIdentifiers.IRandomGenerator)),d.__param(4,l.inject(f.ServiceIdentifiers.IOptions)),d.__metadata("design:paramtypes",[Function,Object,Function,Object,Object])],v),t.StringArrayCustomNodeGroup=v},function(e,t,r){"use strict";var n=r(5),o=r(0),a=r(2),i=r(6),s=r(7);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(1),d=r(3),l=r(10),f=r(14),p=r(15),m=r(9),g=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e){this.operator=e}},{key:"getNodeStructure",value:function(){var e=p.Nodes.getExpressionStatementNode(p.Nodes.getFunctionExpressionNode([p.Nodes.getIdentifierNode("x"),p.Nodes.getIdentifierNode("y")],p.Nodes.getBlockStatementNode([p.Nodes.getReturnStatementNode(p.Nodes.getBinaryExpressionNode(this.operator,p.Nodes.getIdentifierNode("x"),p.Nodes.getIdentifierNode("y")))])));return m.NodeUtils.parentize(e),[e]}}]),t}(f.AbstractCustomNode);c.__decorate([l.initializable(),c.__metadata("design:type",String)],g.prototype,"operator",void 0),g=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],g),t.BinaryExpressionFunctionNode=g},function(e,t,r){"use strict";function n(){return"\n var that;\n \n try {\n var getGlobal = Function('return (function() ' + '{}.constructor(\"return this\")( )' + ');');\n \n that = getGlobal();\n } catch (e) {\n that = window;\n }\n "}Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableTemplate1=n},function(e,t,r){"use strict";function n(){return"\n var getGlobal = function () {\n var globalObject;\n \n try {\n globalObject = Function('return (function() ' + '{}.constructor(\"return this\")( )' + ');')();\n } catch (e) {\n globalObject = window;\n }\n \n return globalObject;\n };\n var that = getGlobal();\n "}Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableTemplate2=n},function(e,t,r){"use strict";var n=r(5),o=r(0),a=r(2),i=r(6),s=r(7);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(1),d=r(3),l=r(10),f=r(14),p=r(8),m=r(15),g=r(9),_=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e,t,r){this.blockStatementBody=e,this.shuffledKeys=t,this.originalKeysIndexesInShuffledArray=r}},{key:"getNodeStructure",value:function(){var e=this,t=this.randomGenerator.getRandomString(6),r=this.randomGenerator.getRandomString(6),n=m.Nodes.getBlockStatementNode([m.Nodes.getVariableDeclarationNode([m.Nodes.getVariableDeclaratorNode(m.Nodes.getIdentifierNode(t),m.Nodes.getCallExpressionNode(m.Nodes.getMemberExpressionNode(m.Nodes.getLiteralNode(this.originalKeysIndexesInShuffledArray.join("|")),m.Nodes.getIdentifierNode("split")),[m.Nodes.getLiteralNode("|")])),m.Nodes.getVariableDeclaratorNode(m.Nodes.getIdentifierNode(r),m.Nodes.getLiteralNode(0))]),m.Nodes.getWhileStatementNode(m.Nodes.getLiteralNode(!0),m.Nodes.getBlockStatementNode([m.Nodes.getSwitchStatementNode(m.Nodes.getMemberExpressionNode(m.Nodes.getIdentifierNode(t),m.Nodes.getUpdateExpressionNode("++",m.Nodes.getIdentifierNode(r)),!0),this.shuffledKeys.map(function(t,r){var n=e.blockStatementBody[t],o=[n];return p.NodeGuards.isReturnStatementNode(n)||o.push(m.Nodes.getContinueStatement()),m.Nodes.getSwitchCaseNode(m.Nodes.getLiteralNode(String(r)),o)})),m.Nodes.getBreakStatement()]))]);return g.NodeUtils.parentize(n),[n]}}]),t}(f.AbstractCustomNode);c.__decorate([l.initializable(),c.__metadata("design:type",Array)],_.prototype,"blockStatementBody",void 0),c.__decorate([l.initializable(),c.__metadata("design:type",Array)],_.prototype,"originalKeysIndexesInShuffledArray",void 0),c.__decorate([l.initializable(),c.__metadata("design:type",Array)],_.prototype,"shuffledKeys",void 0),_=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],_),t.BlockStatementControlFlowFlatteningNode=_},function(e,t,r){"use strict";var n=r(30),o=r(5),a=r(0),i=r(2),s=r(6),c=r(7);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(1),l=r(3),f=r(10),p=r(14),m=r(15),g=r(9),_=function(e){function t(e,r,n){return a(this,t),s(this,(t.__proto__||o(t)).call(this,e,r,n))}return c(t,e),i(t,[{key:"initialize",value:function(e,t){this.blockStatementNode=e,this.deadCodeInjectionRootAstHostNode=t}},{key:"getNodeStructure",value:function(){var e=this.randomGenerator.getMathRandom()>.5,t=this.randomGenerator.getMathRandom()>.5,r=e?"===":"!==",o=this.randomGenerator.getRandomString(5),a=t?o:this.randomGenerator.getRandomString(5),i=e===t?[this.blockStatementNode,this.deadCodeInjectionRootAstHostNode]:[this.deadCodeInjectionRootAstHostNode,this.blockStatementNode],s=n(i,2),c=s[0],u=s[1],d=m.Nodes.getBlockStatementNode([m.Nodes.getIfStatementNode(m.Nodes.getBinaryExpressionNode(r,m.Nodes.getLiteralNode(o),m.Nodes.getLiteralNode(a)),c,u)]);return g.NodeUtils.parentize(d),[d]}}]),t}(p.AbstractCustomNode);u.__decorate([f.initializable(),u.__metadata("design:type",Object)],_.prototype,"blockStatementNode",void 0),u.__decorate([f.initializable(),u.__metadata("design:type",Object)],_.prototype,"deadCodeInjectionRootAstHostNode",void 0),_=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object])],_),t.BlockStatementDeadCodeInjectionNode=_},function(e,t,r){"use strict";var n=r(24),o=r(5),a=r(0),i=r(2),s=r(6),c=r(7);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(1),l=r(3),f=r(10),p=r(14),m=r(15),g=r(9),_=function(e){function t(e,r,n){return a(this,t),s(this,(t.__proto__||o(t)).call(this,e,r,n))}return c(t,e),i(t,[{key:"initialize",value:function(e,t,r,n){this.controlFlowStorageName=e,this.controlFlowStorageKey=t,this.callee=r,this.expressionArguments=n}},{key:"getNodeStructure",value:function(){var e=m.Nodes.getExpressionStatementNode(m.Nodes.getCallExpressionNode(m.Nodes.getMemberExpressionNode(m.Nodes.getIdentifierNode(this.controlFlowStorageName),m.Nodes.getIdentifierNode(this.controlFlowStorageKey)),[this.callee].concat(n(this.expressionArguments))));return g.NodeUtils.parentize(e),[e]}}]),t}(p.AbstractCustomNode);u.__decorate([f.initializable(),u.__metadata("design:type",Object)],_.prototype,"callee",void 0),u.__decorate([f.initializable(),u.__metadata("design:type",String)],_.prototype,"controlFlowStorageKey",void 0),u.__decorate([f.initializable(),u.__metadata("design:type",String)],_.prototype,"controlFlowStorageName",void 0),u.__decorate([f.initializable(),u.__metadata("design:type",Array)],_.prototype,"expressionArguments",void 0),_=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object])],_),t.CallExpressionControlFlowStorageCallNode=_},function(e,t,r){"use strict";var n=r(5),o=r(0),a=r(2),i=r(6),s=r(7);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(1),d=r(3),l=r(10),f=r(14),p=r(15),m=r(9),g=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e){this.expressionArguments=e}},{key:"getNodeStructure",value:function(){for(var e=p.Nodes.getIdentifierNode("callee"),t=[],r=this.expressionArguments.length,n=0;n 0;\n \n switch (isPositive) {\n case true:\n return this.item + \'_\' + this.value + \'_\' + i;\n default:\n this.item + \'_\' + this.value;\n }\n }\n }()\n };\n };\n \n var regExp = new RegExp("[{diff}]", "g");\n var domains = "{domains}".replace(regExp, "").split(";");\n var document;\n var domain;\n \n for (var d in that) {\n if (d.length == 8 && d.charCodeAt(7) == 116 && d.charCodeAt(5) == 101 && d.charCodeAt(3) == 117 && d.charCodeAt(0) == 100) {\n document = d;\n \n break;\n }\n }\n\n for (var d1 in that[document]) {\n if (d1.length == 6 && d1.charCodeAt(5) == 110 && d1.charCodeAt(0) == 100) {\n domain = d1;\n \n break;\n }\n }\n \n if ((!document && !domain) || (!that[document] && !that[document][domain])) {\n return;\n }\n \n var currentDomain = that[document][domain];\n\n var ok = false;\n \n for (var i = 0; i < domains.length; i++) {\n var domain = domains[i];\n var position = currentDomain.length - domain.length;\n var lastIndex = currentDomain.indexOf(domain, position);\n var endsWith = lastIndex !== -1 && lastIndex === position;\n \n if (endsWith) {\n if (currentDomain.length == domain.length || domain.indexOf(".") === 0) {\n ok = true;\n }\n \n break;\n }\n }\n \n if (!ok) {\n data;\n } else {\n return;\n }\n \n func();\n });\n\n {domainLockFunctionName}();\n '}Object.defineProperty(t,"__esModule",{value:!0}),t.DomainLockNodeTemplate=n},function(e,t,r){"use strict";var n=r(5),o=r(0),a=r(2),i=r(6),s=r(7);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(1),d=r(3),l=r(10),f=r(14),p=r(15),m=r(9),g=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e,t,r,n){this.controlFlowStorageName=e,this.controlFlowStorageKey=t,this.leftValue=r,this.rightValue=n}},{key:"getNodeStructure",value:function(){var e=p.Nodes.getExpressionStatementNode(p.Nodes.getCallExpressionNode(p.Nodes.getMemberExpressionNode(p.Nodes.getIdentifierNode(this.controlFlowStorageName),p.Nodes.getIdentifierNode(this.controlFlowStorageKey)),[this.leftValue,this.rightValue]));return m.NodeUtils.parentize(e),[e]}}]),t}(f.AbstractCustomNode);c.__decorate([l.initializable(),c.__metadata("design:type",String)],g.prototype,"controlFlowStorageKey",void 0),c.__decorate([l.initializable(),c.__metadata("design:type",String)],g.prototype,"controlFlowStorageName",void 0),c.__decorate([l.initializable(),c.__metadata("design:type",Object)],g.prototype,"leftValue",void 0),c.__decorate([l.initializable(),c.__metadata("design:type",Object)],g.prototype,"rightValue",void 0),g=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],g),t.ExpressionWithOperatorControlFlowStorageCallNode=g},function(e,t,r){"use strict";var n=r(5),o=r(0),a=r(2),i=r(6),s=r(7);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(1),d=r(3),l=r(10),f=r(14),p=r(15),m=r(9),g=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e){this.operator=e}},{key:"getNodeStructure",value:function(){var e=p.Nodes.getExpressionStatementNode(p.Nodes.getFunctionExpressionNode([p.Nodes.getIdentifierNode("x"),p.Nodes.getIdentifierNode("y")],p.Nodes.getBlockStatementNode([p.Nodes.getReturnStatementNode(p.Nodes.getLogicalExpressionNode(this.operator,p.Nodes.getIdentifierNode("x"),p.Nodes.getIdentifierNode("y")))])));return m.NodeUtils.parentize(e),[e]}}]),t}(f.AbstractCustomNode);c.__decorate([l.initializable(),c.__metadata("design:type",String)],g.prototype,"operator",void 0),g=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],g),t.LogicalExpressionFunctionNode=g},function(e,t,r){"use strict";var n=r(11),o=r(5),a=r(0),i=r(2),s=r(6),c=r(7);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(1),l=r(3),f=u.__importDefault(r(19)),p=r(25),m=r(10),g=r(123),_=r(39),N=r(14),v=r(27),y=r(9),h=function(e){function t(e,r,n){return a(this,t),s(this,(t.__proto__||o(t)).call(this,e,r,n))}return c(t,e),i(t,[{key:"initialize",value:function(e,t){this.appendEvent=e,this.callsControllerFunctionName=t}},{key:"getNodeStructure",value:function(){return y.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){return this.appendEvent===p.ObfuscationEvent.AfterObfuscation?v.JavaScriptObfuscator.obfuscate(f.default(g.SingleNodeCallControllerTemplate(),{singleNodeCallControllerFunctionName:this.callsControllerFunctionName}),n({},_.NO_ADDITIONAL_NODES_PRESET,{identifierNamesGenerator:this.options.identifierNamesGenerator,seed:this.options.seed})).getObfuscatedCode():f.default(g.SingleNodeCallControllerTemplate(),{singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}}]),t}(N.AbstractCustomNode);u.__decorate([m.initializable(),u.__metadata("design:type",String)],h.prototype,"callsControllerFunctionName",void 0),u.__decorate([m.initializable(),u.__metadata("design:type",String)],h.prototype,"appendEvent",void 0),h=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object])],h),t.NodeCallsControllerFunctionNode=h},function(e,t,r){"use strict";function n(){return"\n var {singleNodeCallControllerFunctionName} = (function(){\n var firstCall = true;\n \n return function (context, fn){\n var rfn = firstCall ? function(){\n if(fn){\n var res = fn.apply(context, arguments);\n fn = null;\n return res;\n }\n } : function(){}\n \n firstCall = false;\n \n return rfn;\n }\n })();\n "}Object.defineProperty(t,"__esModule",{value:!0}),t.SingleNodeCallControllerTemplate=n},function(e,t,r){"use strict";var n=r(11),o=r(5),a=r(0),i=r(2),s=r(6),c=r(7);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(1),l=r(3),f=u.__importDefault(r(19)),p=r(10),m=r(39),g=r(125),_=r(14),N=r(27),v=r(9),y=function(e){function t(e,r,n,i){var c;return a(this,t),c=s(this,(t.__proto__||o(t)).call(this,e,r,i)),c.escapeSequenceEncoder=n,c}return c(t,e),i(t,[{key:"initialize",value:function(e){this.callsControllerFunctionName=e}},{key:"getNodeStructure",value:function(){return v.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){return N.JavaScriptObfuscator.obfuscate(f.default(g.SelfDefendingTemplate(this.escapeSequenceEncoder),{selfDefendingFunctionName:this.identifierNamesGenerator.generate(),singleNodeCallControllerFunctionName:this.callsControllerFunctionName}),n({},m.NO_ADDITIONAL_NODES_PRESET,{identifierNamesGenerator:this.options.identifierNamesGenerator,seed:this.options.seed,unicodeEscapeSequence:!0})).getObfuscatedCode()}}]),t}(_.AbstractCustomNode);u.__decorate([p.initializable(),u.__metadata("design:type",String)],y.prototype,"callsControllerFunctionName",void 0),y=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IEscapeSequenceEncoder)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object,Object])],y),t.SelfDefendingUnicodeNode=y},function(e,t,r){"use strict";function n(e){return"\n var {selfDefendingFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n var func1 = function(){return 'dev';},\n func2 = function () {\n return 'window';\n };\n \n var test1 = function () {\n var regExp = new RegExp('".concat(e.encode("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}",!0),"');\n \n return !regExp.test(func1.toString());\n };\n \n var test2 = function () {\n var regExp = new RegExp('").concat(e.encode("(\\\\[x|u](\\w){2,4})+",!0),"');\n \n return regExp.test(func2.toString());\n };\n \n var recursiveFunc1 = function (string) {\n var i = ~-1 >> 1 + 255 % 0;\n \n if (string.indexOf('i' === i)) {\n recursiveFunc2(string)\n }\n };\n \n var recursiveFunc2 = function (string) {\n var i = ~-4 >> 1 + 255 % 0;\n \n if (string.indexOf((true+\"\")[3]) !== i) {\n recursiveFunc1(string)\n }\n };\n \n if (!test1()) {\n if (!test2()) {\n recursiveFunc1('indеxOf');\n } else {\n recursiveFunc1('indexOf');\n }\n } else {\n recursiveFunc1('indеxOf');\n }\n })\n \n {selfDefendingFunctionName}();\n ")}Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=n},function(e,t,r){"use strict";var n=r(11),o=r(5),a=r(0),i=r(2),s=r(6),c=r(7);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(1),l=r(3),f=u.__importDefault(r(19)),p=r(21),m=r(37),g=r(10),_=r(39),N=r(127),v=r(44),y=r(128),h=r(129),b=r(130),S=r(131),I=r(132),C=r(14),O=r(27),j=r(9),F=function(e){function t(e,r,n,i){var c;return a(this,t),c=s(this,(t.__proto__||o(t)).call(this,e,r,i)),c.escapeSequenceEncoder=n,c}return c(t,e),i(t,[{key:"initialize",value:function(e,t){this.stringArrayName=e,this.stringArrayCallsWrapperName=t}},{key:"getNodeStructure",value:function(){return j.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){var e=this.getDecodeStringArrayTemplate();return O.JavaScriptObfuscator.obfuscate(f.default(S.StringArrayCallsWrapperTemplate(),{decodeNodeTemplate:e,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName,stringArrayName:this.stringArrayName}),n({},_.NO_ADDITIONAL_NODES_PRESET,{identifierNamesGenerator:this.options.identifierNamesGenerator,seed:this.options.seed})).getObfuscatedCode()}},{key:"getDecodeStringArrayTemplate",value:function(){var e=this.options.target!==p.ObfuscationTarget.Extension?this.getGlobalVariableTemplate():v.GlobalVariableNoEvalTemplate(),t=f.default(N.AtobTemplate(),{globalVariableTemplate:e}),r="",n="";switch(this.options.selfDefending&&(n=f.default(h.SelfDefendingTemplate(this.randomGenerator,this.escapeSequenceEncoder),{stringArrayCallsWrapperName:this.stringArrayCallsWrapperName,stringArrayName:this.stringArrayName})),this.options.stringArrayEncoding){case m.StringArrayEncoding.Rc4:r=f.default(I.StringArrayRc4DecodeNodeTemplate(this.randomGenerator),{atobPolyfill:t,rc4Polyfill:y.Rc4Template(),selfDefendingCode:n,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName});break;case m.StringArrayEncoding.Base64:r=f.default(b.StringArrayBase64DecodeNodeTemplate(this.randomGenerator),{atobPolyfill:t,selfDefendingCode:n,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName})}return r}}]),t}(C.AbstractCustomNode);u.__decorate([g.initializable(),u.__metadata("design:type",String)],F.prototype,"stringArrayName",void 0),u.__decorate([g.initializable(),u.__metadata("design:type",String)],F.prototype,"stringArrayCallsWrapperName",void 0),F=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IEscapeSequenceEncoder)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object,Object])],F),t.StringArrayCallsWrapper=F},function(e,t,r){"use strict";function n(){return"\n (function () {\n {globalVariableTemplate}\n \n var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\n that.atob || (\n that.atob = function(input) {\n var str = String(input).replace(/=+$/, '');\n for (\n var bc = 0, bs, buffer, idx = 0, output = '';\n buffer = str.charAt(idx++);\n ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,\n bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0\n ) {\n buffer = chars.indexOf(buffer);\n }\n return output;\n });\n })();\n "}Object.defineProperty(t,"__esModule",{value:!0}),t.AtobTemplate=n},function(e,t,r){"use strict";function n(){return"\n var rc4 = function (str, key) {\n var s = [], j = 0, x, res = '', newStr = '';\n \n str = atob(str);\n \n for (var k = 0, length = str.length; k < length; k++) {\n newStr += '%' + ('00' + str.charCodeAt(k).toString(16)).slice(-2);\n }\n \n str = decodeURIComponent(newStr);\n \t \n\t for (var i = 0; i < 256; i++) {\n s[i] = i;\n }\n \n for (i = 0; i < 256; i++) {\n j = (j + s[i] + key.charCodeAt(i % key.length)) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n }\n \n i = 0;\n j = 0;\n \n for (var y = 0; y < str.length; y++) {\n i = (i + 1) % 256;\n j = (j + s[i]) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n res += String.fromCharCode(str.charCodeAt(y) ^ s[(s[i] + s[j]) % 256]);\n }\n \n return res;\n }\n "}Object.defineProperty(t,"__esModule",{value:!0}),t.Rc4Template=n},function(e,t,r){"use strict";function n(e,t){var r=e.getRandomString(6),n=e.getRandomString(6),o=e.getRandomString(6),a=e.getRandomString(6),i=e.getRandomString(6),s=e.getRandomString(6),c=e.getRandomString(6),u=e.getRandomString(6),d=e.getRandomString(6);return"\n var StatesClass = function (".concat(r,") {\n this.").concat(r," = ").concat(r,";\n this.").concat(n," = [1, 0, 0];\n this.").concat(o," = function(){return 'newState';};\n this.").concat(a," = '").concat(t.encode("\\w+ *\\(\\) *{\\w+ *",!0),"';\n this.").concat(i," = '").concat(t.encode("['|\"].+['|\"];? *}",!0),"';\n };\n \n StatesClass.prototype.").concat(s," = function () {\n var regExp = new RegExp(this.").concat(a," + this.").concat(i,");\n var expression = regExp.test(this.").concat(o,".toString())\n ? --this.").concat(n,"[1]\n : --this.").concat(n,"[0];\n \n return this.").concat(c,"(expression);\n };\n \n StatesClass.prototype.").concat(c," = function (").concat(d,") {\n if (!Boolean(~").concat(d,")) {\n return ").concat(d,";\n }\n \n return this.").concat(u,"(this.").concat(r,");\n };\n\n StatesClass.prototype.").concat(u," = function (").concat(r,") {\n for (var i = 0, len = this.").concat(n,".length; i < len; i++) {\n this.").concat(n,".push(Math.round(Math.random()));\n len = this.").concat(n,".length;\n }\n \n return ").concat(r,"(this.").concat(n,"[0]);\n };\n\n new StatesClass({stringArrayCallsWrapperName}).").concat(s,"();\n ")}Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=n},function(e,t,r){"use strict";function n(e){var t=e.getRandomString(6),r=e.getRandomString(6),n=e.getRandomString(6);return"\n if ({stringArrayCallsWrapperName}.".concat(t," === undefined) {\n {atobPolyfill}\n \n {stringArrayCallsWrapperName}.").concat(r," = function (str) {\n var string = atob(str);\n var newStringChars = [];\n \n for (var i = 0, length = string.length; i < length; i++) {\n newStringChars += '%' + ('00' + string.charCodeAt(i).toString(16)).slice(-2);\n }\n \n return decodeURIComponent(newStringChars);\n };\n \n {stringArrayCallsWrapperName}.").concat(n," = {};\n \n {stringArrayCallsWrapperName}.").concat(t," = true;\n }\n \n var cachedValue = {stringArrayCallsWrapperName}.").concat(n,"[index];\n \n if (cachedValue === undefined) {\n {selfDefendingCode}\n \n value = {stringArrayCallsWrapperName}.").concat(r,"(value);\n {stringArrayCallsWrapperName}.").concat(n,"[index] = value;\n } else {\n value = cachedValue;\n }\n ")}Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayBase64DecodeNodeTemplate=n},function(e,t,r){"use strict";function n(){return"\n var {stringArrayCallsWrapperName} = function (index, key) {\n index = index - 0;\n \n var value = {stringArrayName}[index];\n \n {decodeNodeTemplate}\n \n return value;\n };\n "}Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayCallsWrapperTemplate=n},function(e,t,r){"use strict";function n(e){var t=e.getRandomString(6),r=e.getRandomString(6),n=e.getRandomString(6),o=e.getRandomString(6);return"\n if ({stringArrayCallsWrapperName}.".concat(t," === undefined) {\n {atobPolyfill}\n \n {rc4Polyfill}\n {stringArrayCallsWrapperName}.").concat(r," = rc4;\n \n {stringArrayCallsWrapperName}.").concat(n," = {};\n \n {stringArrayCallsWrapperName}.").concat(t," = true;\n }\n \n var cachedValue = {stringArrayCallsWrapperName}.").concat(n,"[index];\n\n if (cachedValue === undefined) {\n if ({stringArrayCallsWrapperName}.").concat(o," === undefined) {\n {selfDefendingCode}\n \n {stringArrayCallsWrapperName}.").concat(o," = true;\n }\n \n value = {stringArrayCallsWrapperName}.").concat(r,"(value, key);\n {stringArrayCallsWrapperName}.").concat(n,"[index] = value;\n } else {\n value = cachedValue;\n }\n ")}Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRc4DecodeNodeTemplate=n},function(e,t,r){"use strict";var n=r(5),o=r(0),a=r(2),i=r(6),s=r(45),c=r(7);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(1),l=r(3),f=u.__importDefault(r(19)),p=r(10),m=r(134),g=r(14),_=r(9),N=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return c(t,e),a(t,[{key:"initialize",value:function(e,t,r){this.stringArrayStorage=e,this.stringArrayName=t,this.stringArrayRotateValue=r}},{key:"getNode",value:function(){return this.stringArrayStorage.rotateArray(this.stringArrayRotateValue),s(t.prototype.__proto__||n(t.prototype),"getNode",this).call(this)}},{key:"getNodeStructure",value:function(){return _.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){return f.default(m.StringArrayTemplate(),{stringArrayName:this.stringArrayName,stringArray:this.stringArrayStorage.toString()})}}]),t}(g.AbstractCustomNode);u.__decorate([p.initializable(),u.__metadata("design:type",Object)],N.prototype,"stringArrayStorage",void 0),u.__decorate([p.initializable(),u.__metadata("design:type",String)],N.prototype,"stringArrayName",void 0),u.__decorate([p.initializable(),u.__metadata("design:type",Number)],N.prototype,"stringArrayRotateValue",void 0),N=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object])],N),t.StringArrayNode=N},function(e,t,r){"use strict";function n(){return"\n var {stringArrayName} = [{stringArray}];\n "}Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayTemplate=n},function(e,t,r){"use strict";var n=r(11),o=r(5),a=r(0),i=r(2),s=r(6),c=r(7);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(1),l=r(3),f=u.__importDefault(r(19)),p=r(10),m=r(39),g=r(136),_=r(137),N=r(14),v=r(27),y=r(9),h=r(32),b=function(e){function t(e,r,n,i){var c;return a(this,t),c=s(this,(t.__proto__||o(t)).call(this,e,r,i)),c.escapeSequenceEncoder=n,c}return c(t,e),i(t,[{key:"initialize",value:function(e,t){this.stringArrayName=e,this.stringArrayRotateValue=t}},{key:"getNodeStructure",value:function(){return y.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){var e=this.identifierNamesGenerator.generate(),t=this.identifierNamesGenerator.generate(),r="";return r=this.options.selfDefending?f.default(g.SelfDefendingTemplate(this.escapeSequenceEncoder),{timesName:e,whileFunctionName:t}):"".concat(t,"(++").concat(e,")"),v.JavaScriptObfuscator.obfuscate(f.default(_.StringArrayRotateFunctionTemplate(),{code:r,timesName:e,stringArrayName:this.stringArrayName,stringArrayRotateValue:h.Utils.decToHex(this.stringArrayRotateValue),whileFunctionName:t}),n({},m.NO_ADDITIONAL_NODES_PRESET,{identifierNamesGenerator:this.options.identifierNamesGenerator,seed:this.options.seed})).getObfuscatedCode()}}]),t}(N.AbstractCustomNode);u.__decorate([p.initializable(),u.__metadata("design:type",String)],b.prototype,"stringArrayName",void 0),u.__decorate([p.initializable(),u.__metadata("design:type",Number)],b.prototype,"stringArrayRotateValue",void 0),b=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IEscapeSequenceEncoder)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object,Object])],b),t.StringArrayRotateFunctionNode=b},function(e,t,r){"use strict";function n(e){return"\n var selfDefendingFunc = function () {\n var object = {\n data: {\n key: 'cookie',\n value: 'timeout'\n },\n setCookie: function (options, name, value, document) {\n document = document || {};\n \n var updatedCookie = name + \"=\" + value;\n\n var i = 0;\n \n for (var i = 0, len = options.length; i < len; i++) {\n var propName = options[i];\n \n updatedCookie += \"; \" + propName;\n \n var propValue = options[propName];\n \n options.push(propValue);\n len = options.length;\n \n if (propValue !== true) {\n updatedCookie += \"=\" + propValue;\n }\n }\n\n document['cookie'] = updatedCookie;\n },\n removeCookie: function(){return 'dev';},\n getCookie: function (document, name) {\n document = document || function (value) { return value };\n var matches = document(new RegExp(\n \"(?:^|; )\" + name.replace(/([.$?*|{}()[]\\/+^])/g, '\\$1') + \"=([^;]*)\"\n ));\n \n var func = function (param1, param2) {\n param1(++param2);\n };\n \n func({whileFunctionName}, {timesName});\n \n return matches ? decodeURIComponent(matches[1]) : undefined;\n }\n };\n \n var test1 = function () {\n var regExp = new RegExp('".concat(e.encode("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}",!0),"');\n \n return regExp.test(object.removeCookie.toString());\n };\n \n object['updateCookie'] = test1;\n \n var cookie = '';\n var result = object['updateCookie']();\n \n if (!result) {\n object['setCookie'](['*'], 'counter', 1);\n } else if (result) {\n cookie = object['getCookie'](null, 'counter');\n } else {\n object['removeCookie']();\n }\n };\n \n selfDefendingFunc();\n ")}Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=n},function(e,t,r){"use strict";function n(){return"\n (function (array, {timesName}) {\n var {whileFunctionName} = function (times) {\n while (--times) {\n array['push'](array['shift']());\n }\n };\n \n {code}\n })({stringArrayName}, 0x{stringArrayRotateValue});\n "}Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRotateFunctionTemplate=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e.False="![]",e.True="!![]",e.a='(false+"")[1]',e.b='([]["entries"]()+"")[2]',e.c='([]["fill"]+"")[3]',e.d='(undefined+"")[2]',e.e='(true+"")[3]',e.f='(false+"")[0]',e.g="(false+[0]+String)[20]",e.h='(+(101))["toString"](21)[1]',e.i="([false]+undefined)[10]",e.j='([]["entries"]()+"")[3]',e.k='(+(20))["toString"](21)',e.l='(false+"")[2]',e.m='(Number+"")[11]',e.n='(undefined+"")[1]',e.o='(true+[]["fill"])[10]',e.p='(+(211))["toString"](31)[1]',e.q='(+(212))["toString"](31)[1]',e.r='(true+"")[1]',e.s='(false+"")[3]',e.t='(true+"")[0]',e.u='(undefined+"")[0]',e.v='(+(31))["toString"](32)',e.w='(+(32))["toString"](33)',e.x='(+(101))["toString"](34)[1]',e.y="(NaN+[Infinity])[10]",e.z='(+(35))["toString"](36)',e.A="(+[]+Array)[10]",e.B="(+[]+Boolean)[10]",e.C='Function("return escape")()(("")["italics"]())[2]',e.D='Function("return escape")()([]["fill"])["slice"]("-1")',e.E='(RegExp+"")[12]',e.F="(+[]+Function)[10]",e.G='(false+Function("return Date")()())[30]',e.H="'H'",e.I='(Infinity+"")[0]',e.J="'J'",e.K="'K'",e.L="'L'",e.M='(true+Function("return Date")()())[30]',e.N='(NaN+"")[0]',e.O='(NaN+Function("return{}")())[11]',e.P="'P'",e.Q="'Q'",e.R="(+[]+RegExp)[10]",e.S="(+[]+String)[10]",e.T='(NaN+Function("return Date")()())[30]',e.U='(NaN+Function("return{}")()["toString"]["call"]())[11]',e.V="'V'",e.W="'W'",e.X="'X'",e.Y="'Y'",e.Z="'Z'"}(t.JSFuck||(t.JSFuck={}))},function(e,t,r){"use strict";var n=r(5),o=r(0),a=r(2),i=r(6),s=r(7);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(1),d=r(3),l=r(10),f=r(14),p=r(15),m=r(9),g=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e,t){this.controlFlowStorageName=e,this.controlFlowStorageKey=t}},{key:"getNodeStructure",value:function(){var e=p.Nodes.getExpressionStatementNode(p.Nodes.getMemberExpressionNode(p.Nodes.getIdentifierNode(this.controlFlowStorageName),p.Nodes.getIdentifierNode(this.controlFlowStorageKey)));return m.NodeUtils.parentize(e),[e]}}]),t}(f.AbstractCustomNode);c.__decorate([l.initializable(),c.__metadata("design:type",String)],g.prototype,"controlFlowStorageKey",void 0),c.__decorate([l.initializable(),c.__metadata("design:type",String)],g.prototype,"controlFlowStorageName",void 0),g=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],g),t.StringLiteralControlFlowStorageCallNode=g},function(e,t,r){"use strict";var n=r(5),o=r(0),a=r(2),i=r(6),s=r(7);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(1),d=r(3),l=r(10),f=r(14),p=r(15),m=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e){this.literalValue=e}},{key:"getNodeStructure",value:function(){return[p.Nodes.getExpressionStatementNode(p.Nodes.getLiteralNode(this.literalValue))]}}]),t}(f.AbstractCustomNode);c.__decorate([l.initializable(),c.__metadata("design:type",String)],m.prototype,"literalValue",void 0),m=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],m),t.StringLiteralNode=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1);t.finalizingTransformersModule=new n.ContainerModule(function(e){})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),o=r(3),a=r(35),i=r(143),s=r(144);t.generatorsModule=new n.ContainerModule(function(e){e(o.ServiceIdentifiers.IIdentifierNamesGenerator).to(i.HexadecimalIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(a.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator),e(o.ServiceIdentifiers.IIdentifierNamesGenerator).to(s.MangledIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(a.IdentifierNamesGenerator.MangledIdentifierNamesGenerator),e(o.ServiceIdentifiers.Factory__IIdentifierNamesGenerator).toFactory(function(e){var t=null;return function(r){if(t)return t;var n;switch(r.identifierNamesGenerator){case a.IdentifierNamesGenerator.MangledIdentifierNamesGenerator:n=e.container.getNamed(o.ServiceIdentifiers.IIdentifierNamesGenerator,a.IdentifierNamesGenerator.MangledIdentifierNamesGenerator);break;case a.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator:default:n=e.container.getNamed(o.ServiceIdentifiers.IIdentifierNamesGenerator,a.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator)}return t=n,n}})})},function(e,t,r){"use strict";var n=r(29),o=r(5),a=r(0),i=r(2),s=r(6),c=r(7);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(1),l=r(3),f=r(58),p=r(32),m=g=function(e){function t(e,r){var i;return a(this,t),i=s(this,(t.__proto__||o(t)).call(this,e,r)),i.randomVariableNameSet=new n,i}return c(t,e),i(t,[{key:"generate",value:function(){var e=this.randomGenerator.getRandomInteger(1e4,99999999),t=p.Utils.decToHex(e),r=t.substr(0,g.baseIdentifierNameLength),n="_".concat(p.Utils.hexadecimalPrefix).concat(r);return this.randomVariableNameSet.has(n)?this.generate():(this.randomVariableNameSet.add(n),n)}},{key:"generateWithPrefix",value:function(){var e=this.generate();return"".concat(this.options.identifiersPrefix).concat(e).replace("__","_")}}]),t}(f.AbstractIdentifierNamesGenerator);m.baseIdentifierNameLength=6,m=g=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Object,Object])],m),t.HexadecimalIdentifierNamesGenerator=m;var g},function(e,t,r){"use strict";var n=r(5),o=r(0),a=r(2),i=r(6),s=r(7);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(1),d=r(3),l=r(58),f=p=function(e){function t(e,r){var a;return o(this,t),a=i(this,(t.__proto__||n(t)).call(this,e,r)),a.previousMangledName=p.initMangledNameCharacter,a}return s(t,e),a(t,[{key:"generate",value:function(){var e=p.generateNewMangledName(this.previousMangledName);return this.previousMangledName=e,e}},{key:"generateWithPrefix",value:function(){var e=this.options.identifiersPrefix?"".concat(this.options.identifiersPrefix,"_"):"",t=this.generate();return"".concat(e).concat(t)}}],[{key:"generateNewMangledName",value:function(e){var t=function(e){var t=p.nameSequence,r=e.length,n=function(e){return"0".repeat(e)},o=r-1;do{var a=e.charAt(o),i=t.indexOf(a);if(i!==t.length-1){return e.substring(0,o)+t[i+1]+n(r-(o+1))}--o}while(o>=0);return"a".concat(n(r))}(e);return p.validateMangledName(t)||(t=p.generateNewMangledName(t)),t}},{key:"validateMangledName",value:function(e){return!p.reservedNames.includes(e)}}]),t}(l.AbstractIdentifierNamesGenerator);f.initMangledNameCharacter="9",f.nameSequence="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),f.reservedNames=["byte","case","char","do","else","enum","eval","for","goto","if","in","int","let","long","new","null","this","true","try","var","void","with"],f=p=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Object,Object])],f),t.MangledIdentifierNamesGenerator=f;var p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(22),o=r(1),a=r(3);t.nodeTransformersModule=new o.ContainerModule(function(e){e(a.ServiceIdentifiers.Factory__INodeTransformer).toFactory(n.InversifyContainerFacade.getCacheFactory(a.ServiceIdentifiers.INodeTransformer))})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(22),o=r(1),a=r(3),i=r(26),s=r(59),c=r(28),u=r(147),d=r(148),l=r(149),f=r(150),p=r(151),m=r(152),g=r(153),_=r(154),N=r(155),v=r(156),y=r(157),h=r(158);t.obfuscatingTransformersModule=new o.ContainerModule(function(e){e(a.ServiceIdentifiers.INodeTransformer).to(l.CatchClauseTransformer).whenTargetNamed(c.NodeTransformer.CatchClauseTransformer),e(a.ServiceIdentifiers.INodeTransformer).to(f.ClassDeclarationTransformer).whenTargetNamed(c.NodeTransformer.ClassDeclarationTransformer),e(a.ServiceIdentifiers.INodeTransformer).to(p.FunctionDeclarationTransformer).whenTargetNamed(c.NodeTransformer.FunctionDeclarationTransformer),e(a.ServiceIdentifiers.INodeTransformer).to(m.FunctionTransformer).whenTargetNamed(c.NodeTransformer.FunctionTransformer),e(a.ServiceIdentifiers.INodeTransformer).to(g.LabeledStatementTransformer).whenTargetNamed(c.NodeTransformer.LabeledStatementTransformer),e(a.ServiceIdentifiers.INodeTransformer).to(_.LiteralTransformer).whenTargetNamed(c.NodeTransformer.LiteralTransformer),e(a.ServiceIdentifiers.INodeTransformer).to(v.ObjectExpressionTransformer).whenTargetNamed(c.NodeTransformer.ObjectExpressionTransformer),e(a.ServiceIdentifiers.INodeTransformer).to(h.VariableDeclarationTransformer).whenTargetNamed(c.NodeTransformer.VariableDeclarationTransformer),e(a.ServiceIdentifiers.IObfuscatingReplacer).to(d.BooleanLiteralObfuscatingReplacer).whenTargetNamed(s.LiteralObfuscatingReplacer.BooleanLiteralObfuscatingReplacer),e(a.ServiceIdentifiers.IObfuscatingReplacer).to(N.NumberLiteralObfuscatingReplacer).whenTargetNamed(s.LiteralObfuscatingReplacer.NumberLiteralObfuscatingReplacer),e(a.ServiceIdentifiers.IObfuscatingReplacer).to(y.StringLiteralObfuscatingReplacer).whenTargetNamed(s.LiteralObfuscatingReplacer.StringLiteralObfuscatingReplacer),e(a.ServiceIdentifiers.IIdentifierObfuscatingReplacer).to(u.BaseIdentifierObfuscatingReplacer).whenTargetNamed(i.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),e(a.ServiceIdentifiers.Factory__IObfuscatingReplacer).toFactory(n.InversifyContainerFacade.getCacheFactory(a.ServiceIdentifiers.IObfuscatingReplacer)),e(a.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer).toFactory(n.InversifyContainerFacade.getCacheFactory(a.ServiceIdentifiers.IIdentifierObfuscatingReplacer))})},function(e,t,r){"use strict";var n=r(16),o=r(5),a=r(0),i=r(2),s=r(6),c=r(7);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(1),l=r(3),f=r(40),p=r(15),m=function(e){function t(e,r){var i;return a(this,t),i=s(this,(t.__proto__||o(t)).call(this,r)),i.namesMap=new n,i.identifierNamesGenerator=e(r),i}return c(t,e),i(t,[{key:"replace",value:function(e,t){var r="".concat(e,"-").concat(String(t));return this.namesMap.has(r)&&(e=this.namesMap.get(r)),p.Nodes.getIdentifierNode(e)}},{key:"storeGlobalName",value:function(e,t){if(!this.isReservedName(e)){var r=this.identifierNamesGenerator.generateWithPrefix();this.namesMap.set("".concat(e,"-").concat(String(t)),r)}}},{key:"storeLocalName",value:function(e,t){if(!this.isReservedName(e)){var r=this.identifierNamesGenerator.generate();this.namesMap.set("".concat(e,"-").concat(String(t)),r)}}},{key:"isReservedName",value:function(e){return this.options.reservedNames.some(function(t){return null!==new RegExp(t,"g").exec(e)})}}]),t}(f.AbstractObfuscatingReplacer);m=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object])],m),t.BaseIdentifierObfuscatingReplacer=m},function(e,t,r){"use strict";var n=r(5),o=r(0),a=r(2),i=r(6),s=r(7);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(1),d=r(3),l=r(40),f=r(15),p=m=function(e){function t(e){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e))}return s(t,e),a(t,[{key:"replace",value:function(e){return e?m.getTrueUnaryExpressionNode():m.getFalseUnaryExpressionNode()}}],[{key:"getTrueUnaryExpressionNode",value:function(){return f.Nodes.getUnaryExpressionNode("!",m.getFalseUnaryExpressionNode())}},{key:"getFalseUnaryExpressionNode",value:function(){return f.Nodes.getUnaryExpressionNode("!",f.Nodes.getArrayExpressionNode())}}]),t}(l.AbstractObfuscatingReplacer);p=m=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Object])],p),t.BooleanLiteralObfuscatingReplacer=p;var m},function(e,t,r){"use strict";var n=r(5),o=r(0),a=r(2),i=r(6),s=r(7);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(1),d=r(3),l=c.__importStar(r(17)),f=r(26),p=r(12),m=r(13),g=r(8),_=function(e){function t(e,r,a){var s;return o(this,t),s=i(this,(t.__proto__||n(t)).call(this,r,a)),s.identifierObfuscatingReplacer=e(f.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),s}return s(t,e),a(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case p.TransformationStage.Obfuscating:return{enter:function(e,r){if(r&&g.NodeGuards.isCatchClauseNode(e))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){var r=this.nodeIdentifier++;return this.storeCatchClauseParam(e,r),this.replaceCatchClauseParam(e,r),e}},{key:"storeCatchClauseParam",value:function(e,t){g.NodeGuards.isIdentifierNode(e.param)&&this.identifierObfuscatingReplacer.storeLocalName(e.param.name,t)}},{key:"replaceCatchClauseParam",value:function(e,t){var r=this;l.replace(e,{enter:function(e,n){if(n&&g.NodeGuards.isReplaceableIdentifierNode(e,n)){var o=r.identifierObfuscatingReplacer.replace(e.name,t),a=o.name;e.name!==a&&(e.name=a,e.obfuscatedNode=!0)}}})}}]),t}(m.AbstractNodeTransformer);_=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],_),t.CatchClauseTransformer=_},function(e,t,r){"use strict";var n=r(16),o=r(5),a=r(0),i=r(2),s=r(6),c=r(7);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(1),l=r(3),f=u.__importStar(r(17)),p=r(26),m=r(18),g=r(12),_=r(13),N=r(8),v=r(9),y=function(e){function t(e,r,i){var c;return a(this,t),c=s(this,(t.__proto__||o(t)).call(this,r,i)),c.replaceableIdentifiers=new n,c.identifierObfuscatingReplacer=e(p.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),c}return c(t,e),i(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case g.TransformationStage.Obfuscating:return{enter:function(e,r){if(r&&N.NodeGuards.isClassDeclarationNode(e))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){var r=this.nodeIdentifier++,n=v.NodeUtils.getBlockScopesOfNode(e)[0],o=n.type===m.NodeType.Program;return!this.options.renameGlobals&&o?e:(this.storeClassName(e,o,r),this.replaceableIdentifiers.has(n)?this.replaceScopeCachedIdentifiers(n,r):this.replaceScopeIdentifiers(n,r),e)}},{key:"storeClassName",value:function(e,t,r){t?this.identifierObfuscatingReplacer.storeGlobalName(e.id.name,r):this.identifierObfuscatingReplacer.storeLocalName(e.id.name,r)}},{key:"replaceScopeCachedIdentifiers",value:function(e,t){var r=this;this.replaceableIdentifiers.get(e).forEach(function(e){var n=r.identifierObfuscatingReplacer.replace(e.name,t);e.name=n.name})}},{key:"replaceScopeIdentifiers",value:function(e,t){var r=this,n=[];f.replace(e,{enter:function(e,o){if(o&&N.NodeGuards.isReplaceableIdentifierNode(e,o)){var a=r.identifierObfuscatingReplacer.replace(e.name,t),i=a.name;e.name!==i?e.name=i:n.push(e)}}}),this.replaceableIdentifiers.set(e,n)}}]),t}(_.AbstractNodeTransformer);y=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object])],y),t.ClassDeclarationTransformer=y},function(e,t,r){"use strict";var n=r(16),o=r(5),a=r(0),i=r(2),s=r(6),c=r(7);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(1),l=r(3),f=u.__importStar(r(17)),p=r(26),m=r(18),g=r(12),_=r(13),N=r(8),v=r(9),y=function(e){function t(e,r,i){var c;return a(this,t),c=s(this,(t.__proto__||o(t)).call(this,r,i)),c.replaceableIdentifiers=new n,c.identifierObfuscatingReplacer=e(p.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),c}return c(t,e),i(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case g.TransformationStage.Obfuscating:return{enter:function(e,r){if(r&&N.NodeGuards.isFunctionDeclarationNode(e))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){var r=this.nodeIdentifier++,n=v.NodeUtils.getBlockScopesOfNode(e)[0],o=n.type===m.NodeType.Program;return!this.options.renameGlobals&&o?e:(this.storeFunctionName(e,o,r),this.replaceableIdentifiers.has(n)?this.replaceScopeCachedIdentifiers(e,n,r):this.replaceScopeIdentifiers(n,r),e)}},{key:"storeFunctionName",value:function(e,t,r){t?this.identifierObfuscatingReplacer.storeGlobalName(e.id.name,r):this.identifierObfuscatingReplacer.storeLocalName(e.id.name,r)}},{key:"replaceScopeCachedIdentifiers",value:function(e,t,r){var n=this.replaceableIdentifiers.get(t);if(n){var o=n.get(e.id.name);if(o)for(var a=o.length,i=0;i=N.minimumLengthForStringArray&&this.randomGenerator.getMathRandom()<=this.options.stringArrayThreshold}},{key:"getStringArrayHexadecimalIndex",value:function(e,t){if(this.stringLiteralHexadecimalIndexCache.has(e))return{fromCache:!0,index:this.stringLiteralHexadecimalIndexCache.get(e)};var r=g.Utils.decToHex(t),n="".concat(g.Utils.hexadecimalPrefix).concat(r);return this.stringLiteralHexadecimalIndexCache.set(e,n),{fromCache:!1,index:n}}},{key:"getEncodedValue",value:function(e){var t,r=null;switch(this.options.stringArrayEncoding){case f.StringArrayEncoding.Rc4:r=this.randomGenerator.getRandomGenerator().pickone(this.rc4Keys),t=this.cryptUtils.btoa(this.cryptUtils.rc4(e,r));break;case f.StringArrayEncoding.Base64:t=this.cryptUtils.btoa(e);break;default:t=e}return{encodedValue:t,key:r}}},{key:"replaceWithLiteralNode",value:function(e){return m.Nodes.getLiteralNode(this.escapeSequenceEncoder.encode(e,this.options.unicodeEscapeSequence))}},{key:"replaceWithStringArrayCallNode",value:function(e){var t=this.getEncodedValue(e),r=t.encodedValue,n=t.key,o=this.escapeSequenceEncoder.encode(r,this.options.unicodeEscapeSequence),a=this.stringArrayStorage.getLength(),i=this.stringArrayStorage.getStorageId().split("|")[1],s=this.getStringArrayHexadecimalIndex(o,a),c=s.fromCache,u=s.index;c||this.stringArrayStorage.set(a,o);var d=[N.getHexadecimalLiteralNode(u)];n&&d.push(N.getRc4KeyLiteralNode(this.escapeSequenceEncoder.encode(n,this.options.unicodeEscapeSequence)));var l=m.Nodes.getIdentifierNode(i);return l.obfuscatedNode=!0,m.Nodes.getCallExpressionNode(l,d)}}],[{key:"getHexadecimalLiteralNode",value:function(e){var t=m.Nodes.getLiteralNode(e);return t.obfuscatedNode=!0,t}},{key:"getRc4KeyLiteralNode",value:function(e){var t=m.Nodes.getLiteralNode(e);return t.obfuscatedNode=!0,t}}]),t}(p.AbstractObfuscatingReplacer);_.minimumLengthForStringArray=3,_.rc4KeyLength=4,_.rc4KeysCount=50,_=N=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.TStringArrayStorage)),u.__param(1,d.inject(l.ServiceIdentifiers.IEscapeSequenceEncoder)),u.__param(2,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(3,d.inject(l.ServiceIdentifiers.ICryptUtils)),u.__param(4,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Object,Object,Object,Object,Object])],_),t.StringLiteralObfuscatingReplacer=_;var N},function(e,t,r){"use strict";var n=r(16),o=r(5),a=r(0),i=r(2),s=r(6),c=r(7);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(1),l=r(3),f=u.__importStar(r(17)),p=r(26),m=r(18),g=r(12),_=r(13),N=r(8),v=r(9),y=function(e){function t(e,r,i){var c;return a(this,t),c=s(this,(t.__proto__||o(t)).call(this,r,i)),c.replaceableIdentifiers=new n,c.identifierObfuscatingReplacer=e(p.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),c}return c(t,e),i(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case g.TransformationStage.Obfuscating:return{enter:function(e,r){if(r&&N.NodeGuards.isVariableDeclarationNode(e))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){var r=v.NodeUtils.getBlockScopesOfNode(e)[0],n=r.type===m.NodeType.Program;if(!this.options.renameGlobals&&n)return e;var o=this.nodeIdentifier++,a="var"===e.kind?r:t;return this.storeVariableNames(e,n,o),this.replaceableIdentifiers.has(a)?this.replaceScopeCachedIdentifiers(e,a,o):this.replaceScopeIdentifiers(a,o),e}},{key:"storeVariableNames",value:function(e,t,r){var n=this;this.traverseDeclarationIdentifiers(e,function(e){t?n.identifierObfuscatingReplacer.storeGlobalName(e.name,r):n.identifierObfuscatingReplacer.storeLocalName(e.name,r)})}},{key:"replaceScopeCachedIdentifiers",value:function(e,t,r){var n=this,o=this.replaceableIdentifiers.get(t);if(o){var a=[];this.traverseDeclarationIdentifiers(e,function(e){a.push(e.name)}),a.forEach(function(e){var t=o.get(e);if(t)for(var a=t.length,i=0;i=0?t:null}},{key:"getLength",value:function(){return this.storageLength}},{key:"getStorage",value:function(){return this.storage}},{key:"getStorageId",value:function(){return this.storageId}},{key:"mergeWith",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.storage=n(this.storage).concat(n(e.getStorage())),t&&(this.storageId=e.getStorageId())}},{key:"set",value:function(e,t){e===this.storageLength?this.storage.push(t):this.storage.splice(e,0,t),this.storageLength++}}]),e}();i.__decorate([u.initializable(),i.__metadata("design:type",Array)],d.prototype,"storage",void 0),i.__decorate([u.initializable(),i.__metadata("design:type",String)],d.prototype,"storageId",void 0),i.__decorate([s.postConstruct(),i.__metadata("design:type",Function),i.__metadata("design:paramtypes",[]),i.__metadata("design:returntype",void 0)],d.prototype,"initialize",null),d=i.__decorate([s.injectable(),i.__param(0,s.inject(c.ServiceIdentifiers.IRandomGenerator)),i.__param(1,s.inject(c.ServiceIdentifiers.IOptions)),i.__metadata("design:paramtypes",[Object,Object])],d),t.ArrayStorage=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),o=r(3),a=r(189),i=r(190),s=r(193),c=r(62);t.utilsModule=new n.ContainerModule(function(e){e(o.ServiceIdentifiers.IArrayUtils).to(a.ArrayUtils).inSingletonScope(),e(o.ServiceIdentifiers.IRandomGenerator).to(c.RandomGenerator).inSingletonScope(),e(o.ServiceIdentifiers.ICryptUtils).to(i.CryptUtils).inSingletonScope(),e(o.ServiceIdentifiers.IEscapeSequenceEncoder).to(s.EscapeSequenceEncoder).inSingletonScope()})},function(e,t,r){"use strict";var n=r(24),o=r(0),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i=r(4),s=r(1),c=r(3),u=function(){function e(t){o(this,e),this.randomGenerator=t}return a(e,[{key:"arrayRange",value:function(e){for(var t=[],r=0;r>8-o%1*8)){if((n=e.charCodeAt(o+=.75))>255)throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");r=r<<8|n}return t}},{key:"hideString",value:function(e,t){var r=this,n=this.randomGenerator.getRandomGenerator().string({length:t,pool:c.RandomGenerator.randomGeneratorPool}),o=n.replace(new RegExp("[".concat(function(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(e),"]"),"g"),""),a=o.split("");return this.randomGenerator.getRandomGenerator().shuffle(a),o=a.join(""),[function(e,t){for(var n=-1,o=-1,a="";n"),l="...".concat(s.substring(c,u).replace(/^\s+/,""),"...");throw new Error("".concat(r,"\n").concat(d," ").concat(l))}}]),e}();c.colorError=s.default.red,c.nearestSymbolsCount=10,t.EsprimaFacade=c},function(e,t,r){"use strict";var n=r(5),o=r(0),a=r(6),i=r(7);Object.defineProperty(t,"__esModule",{value:!0});var s=r(4),c=r(1),u=r(198);c.decorate(c.injectable(),u.EventEmitter);var d=function(e){function t(){return o(this,t),a(this,(t.__proto__||n(t)).apply(this,arguments))}return i(t,e),t}(u.EventEmitter);d=s.__decorate([c.injectable()],d),t.ObfuscationEventEmitter=d},function(e,t){e.exports=require("events")},function(e,t,r){"use strict";var n=r(0),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a=r(4),i=r(1),s=r(10),c=function(){function e(){n(this,e)}return o(e,[{key:"initialize",value:function(e,t){this.obfuscatedCode=e,this.sourceMap=t}},{key:"getObfuscatedCode",value:function(){return this.obfuscatedCode}},{key:"getSourceMap",value:function(){return this.sourceMap}},{key:"toString",value:function(){return this.obfuscatedCode}}]),e}();a.__decorate([s.initializable(),a.__metadata("design:type",String)],c.prototype,"obfuscatedCode",void 0),a.__decorate([s.initializable(),a.__metadata("design:type",String)],c.prototype,"sourceMap",void 0),c=a.__decorate([i.injectable()],c),t.ObfuscationResult=c},function(e,t,r){"use strict";var n=r(0),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(t){n(this,e),this.sourceCode=t}return o(e,[{key:"getSourceCode",value:function(){return this.sourceCode}}]),e}();t.SourceCode=a},function(e,t,r){"use strict";var n=r(0),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a=r(4),i=r(1),s=r(3),c=r(36),u=function(){function e(t,r,o){n(this,e),this.obfuscationResultFactory=t,this.cryptUtils=r,this.options=o}return o(e,[{key:"correct",value:function(e,t){return this.obfuscationResultFactory(this.correctObfuscatedCode(e,t),t)}},{key:"correctObfuscatedCode",value:function(e,t){if(!t)return e;var r=this.options.sourceMapBaseUrl+this.options.sourceMapFileName,n="//# sourceMappingURL=";switch(this.options.sourceMapMode){case c.SourceMapMode.Inline:n+="data:application/json;base64,".concat(this.cryptUtils.btoa(t));break;case c.SourceMapMode.Separate:default:if(!r)return e;n+=r}return"".concat(e,"\n").concat(n)}}]),e}();u=a.__decorate([i.injectable(),a.__param(0,i.inject(s.ServiceIdentifiers.Factory__IObfuscationResult)),a.__param(1,i.inject(s.ServiceIdentifiers.ICryptUtils)),a.__param(2,i.inject(s.ServiceIdentifiers.IOptions)),a.__metadata("design:paramtypes",[Function,Object,Object])],u),t.SourceMapCorrector=u},function(e,t,r){"use strict";var n=r(0),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a=r(4),i=r(1),s=r(3),c=a.__importStar(r(17)),u=r(203),d=r(8),l=function(){function e(t){n(this,e),this.nodeTransformerFactory=t}return o(e,[{key:"transform",value:function(e,t,r){if(!t.length)return e;for(var n,o=[],a=[],i=t.length,s=0;s values should be wrapped inside quotes: --option-name 'value1, value2'");return e.split(",").map(function(e){return e.trim()})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanSanitizer=function(e){return"true"===e||"1"===e}},function(e,t,r){"use strict";var n=r(38);Object.defineProperty(t,"__esModule",{value:!0});var o=r(35);t.IdentifierNamesGeneratorSanitizer=function(e){if(!n(o.IdentifierNamesGenerator).some(function(t){return o.IdentifierNamesGenerator[t]===e}))throw new ReferenceError("Invalid value of `--identifier-names-generator` option");return e}},function(e,t,r){"use strict";var n=r(38);Object.defineProperty(t,"__esModule",{value:!0});var o=r(21);t.ObfuscationTargetSanitizer=function(e){if(!n(o.ObfuscationTarget).some(function(t){return o.ObfuscationTarget[t]===e}))throw new ReferenceError("Invalid value of `--target` option");return e}},function(e,t,r){"use strict";var n=r(38);Object.defineProperty(t,"__esModule",{value:!0});var o=r(36);t.SourceMapModeSanitizer=function(e){if(!n(o.SourceMapMode).some(function(t){return o.SourceMapMode[t]===e}))throw new ReferenceError("Invalid value of `--source-map-mode` option");return e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(37);t.StringArrayEncodingSanitizer=function(e){switch(e){case"true":case"1":case n.StringArrayEncoding.Base64:return!0;case n.StringArrayEncoding.Rc4:return n.StringArrayEncoding.Rc4;default:return!1}}},function(e,t,r){"use strict";var n=r(0),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a=__importStar(r(67)),i=__importStar(r(212)),s=__importStar(r(48)),c=r(47),u=function(){function e(){n(this,e)}return o(e,null,[{key:"getOutputCodePath",value:function(e){return s.normalize(e).split(".").map(function(e,t){return 0===t?"".concat(e).concat(c.JavaScriptObfuscatorCLI.obfuscatedFilePrefix):e}).join(".")}},{key:"getOutputSourceMapPath",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return t&&(e="".concat(e.substring(0,e.lastIndexOf("/")),"/").concat(t)),/\.js\.map$/.test(e)?/\.js$/.test(e)&&(e+=".map"):e="".concat(e.split(".")[0],".js.map"),e}},{key:"getUserConfig",value:function(e){var t;try{t=!function(){var e=new Error('Cannot find module "."');throw e.code="MODULE_NOT_FOUND",e}()}catch(r){try{t=require(e)}catch(e){throw new ReferenceError("Given config path must be a valid `.js` or `.json` file path")}}return t}},{key:"writeFile",value:function(e,t){i.sync(s.dirname(e)),a.writeFileSync(e,t,{encoding:c.JavaScriptObfuscatorCLI.encoding})}}]),e}();t.CLIUtils=u},function(e,t){e.exports=require("mkdirp")},function(e,t){function r(e){throw new Error("Cannot find module '"+e+"'.")}r.keys=function(){return[]},r.resolve=r,e.exports=r,r.id=213},function(e,t,r){"use strict";var n=r(24),o=r(0),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i=__importStar(r(67)),s=__importStar(r(48)),c=__importDefault(r(215)),u=r(66),d=r(47),l=r(65),f=function(){function e(t){o(this,e),this.options=t}return a(e,[{key:"readSourceCode",value:function(t){if(e.isFilePath(t)&&this.isValidFile(t))return this.readFile(t);if(e.isDirectoryPath(t)&&this.isValidDirectory(t))return this.readDirectoryRecursive(t);var r=e.availableInputExtensions.map(function(e){return"`".concat(e,"`")}).join(", ");throw new ReferenceError("Given input path must be a valid ".concat(r," file or directory path"))}},{key:"readDirectoryRecursive",value:function(t){var r=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return i.readdirSync(t,d.JavaScriptObfuscatorCLI.encoding).forEach(function(a){var i="".concat(t,"/").concat(a);if(e.isDirectoryPath(i)&&r.isValidDirectory(i))o.push.apply(o,n(r.readDirectoryRecursive(i)));else if(e.isFilePath(i)&&r.isValidFile(i)){var s=r.readFile(i);o.push({filePath:i,content:s})}}),o}},{key:"readFile",value:function(t){return e.logFilePath(t),i.readFileSync(t,d.JavaScriptObfuscatorCLI.encoding)}},{key:"isValidDirectory",value:function(t){return!e.isExcludedPath(t,this.options.exclude)}},{key:"isValidFile",value:function(t){return e.availableInputExtensions.includes(s.extname(t))&&!t.includes(d.JavaScriptObfuscatorCLI.obfuscatedFilePrefix)&&!e.isExcludedPath(t,this.options.exclude)}}],[{key:"isExcludedPath",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!t.length)return!1;var r=s.basename(e),n=!!c.default([e],t).length;return t.some(function(t){return e.includes(t)||r.includes(t)})||n}},{key:"isDirectoryPath",value:function(e){try{return i.statSync(e).isDirectory()}catch(e){return!1}}},{key:"isFilePath",value:function(e){try{return i.statSync(e).isFile()}catch(e){return!1}}},{key:"logFilePath",value:function(e){var t=s.normalize(e);l.Logger.log(l.Logger.colorInfo,u.LoggingPrefix.CLI,"Obfuscating file: ".concat(t,"..."))}}]),e}();f.availableInputExtensions=[".js"],t.SourceCodeReader=f},function(e,t){e.exports=require("multimatch")}]); +require("source-map-support").install(),module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r.w={},r(r.s=215)}([function(e,t){e.exports=require("inversify")},function(e,t){e.exports=require("@babel/runtime/helpers/classCallCheck")},function(e,t){e.exports=require("@babel/runtime/helpers/createClass")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Factory__ICalleeDataExtractor="Factory",e.Factory__IControlFlowCustomNode="Factory",e.Factory__IControlFlowReplacer="Factory",e.Factory__ICustomNode="Factory",e.Factory__ICustomNodeGroup="Factory",e.Factory__IDeadCodeInjectionCustomNode="Factory",e.Factory__IIdentifierNamesGenerator="Factory",e.Factory__IIdentifierObfuscatingReplacer="Factory",e.Factory__INodeGuard="Factory",e.Factory__INodeTransformer="Factory",e.Factory__IObfuscationResult="Factory",e.Factory__IObfuscatingReplacer="Factory",e.Factory__TControlFlowStorage="Factory",e.IArrayUtils="IArrayUtils",e.ICalleeDataExtractor="ICalleeDataExtractor",e.ICryptUtils="ICryptUtils",e.ICustomNode="ICustomNode",e.ICustomNodeGroup="ICustomNodeGroup",e.IControlFlowReplacer="IControlFlowReplacer",e.IEscapeSequenceEncoder="IEscapeSequenceEncoder",e.IIdentifierNamesGenerator="IIdentifierNamesGenerator",e.IIdentifierObfuscatingReplacer="IIdentifierObfuscatingReplacer",e.IJavaScriptObfuscator="IJavaScriptObfuscator",e.ILogger="ILogger",e.INodeGuard="INodeGuard",e.INodeTransformer="INodeTransformer",e.IObfuscationEventEmitter="IObfuscationEventEmitter",e.IObfuscationResult="IObfuscationResult",e.IOptions="IOptions",e.IOptionsNormalizer="IOptionsNormalizer",e.IObfuscatingReplacer="IObfuscatingReplacer",e.IRandomGenerator="IRandomGenerator",e.ISourceCode="ISourceCode",e.ISourceMapCorrector="ISourceMapCorrector",e.IStackTraceAnalyzer="IStackTraceAnalyzer",e.ITransformersRunner="ITransformersRunner",e.Newable__ICustomNode="Newable",e.Newable__TControlFlowStorage="Newable",e.TCustomNodeGroupStorage="TCustomNodeGroupStorage",e.TInputOptions="TInputOptions",e.TStringArrayStorage="TStringArrayStorage"}(t.ServiceIdentifiers||(t.ServiceIdentifiers={}))},function(e,t){e.exports=require("tslib")},function(e,t){e.exports=require("@babel/runtime/helpers/inherits")},function(e,t){e.exports=require("@babel/runtime/helpers/possibleConstructorReturn")},function(e,t){e.exports=require("@babel/runtime/core-js/object/get-prototype-of")},function(e,t,r){"use strict";var n=r(66),o=r(1),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i=__importStar(r(47)),s=__importStar(r(65)),c=__importStar(r(17)),u=r(9),d=function(){function e(){o(this,e)}return a(e,null,[{key:"addXVerbatimPropertyToLiterals",value:function(e){return c.replace(e,{leave:function(e){u.NodeGuards.isLiteralNode(e)&&(e["x-verbatim-property"]={content:e.raw,precedence:i.Precedence.Primary})}}),e}},{key:"clone",value:function(t){return e.parentize(e.cloneRecursive(t))}},{key:"convertCodeToStructure",value:function(t){var r=s.parseScript(t);return r=e.addXVerbatimPropertyToLiterals(r),(r=e.parentize(r)).body}},{key:"convertStructureToCode",value:function(e){return e.reduce(function(e,t){return e+i.generate(t,{sourceMapWithCode:!0}).code},"")}},{key:"getBlockScopesOfNode",value:function(t){return e.getBlockScopesOfNodeRecursive(t)}},{key:"getNextSiblingStatementNode",value:function(t){return e.getSiblingStatementNodeByOffset(t,1)}},{key:"getPreviousSiblingStatementNode",value:function(t){return e.getSiblingStatementNodeByOffset(t,-1)}},{key:"getScopeOfNode",value:function(t){var r=t.parentNode;if(!r)throw new ReferenceError("`parentNode` property of given node is `undefined`");return u.NodeGuards.isNodeHasScope(r)?r:e.getScopeOfNode(r)}},{key:"getUnaryExpressionArgumentNode",value:function(t){return u.NodeGuards.isUnaryExpressionNode(t.argument)?e.getUnaryExpressionArgumentNode(t.argument):t.argument}},{key:"parentize",value:function(t){return c.replace(t,{enter:e.parentizeNode}),t}},{key:"parentizeNode",value:function(e,t){return e.parentNode=t||e,e.obfuscatedNode=!1,e}},{key:"cloneRecursive",value:function(t){if(null===t)return t;var r={};for(var o in t)if(t.hasOwnProperty(o)&&"parentNode"!==o){var a=t[o],i=void 0;i=null===a||a instanceof RegExp?a:Array.isArray(a)?a.map(e.cloneRecursive):"object"===n(a)?e.cloneRecursive(a):a,r[o]=i}return r}},{key:"getBlockScopesOfNodeRecursive",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=t.parentNode;if(!o)throw new ReferenceError("`parentNode` property of given node is `undefined`");return u.NodeGuards.isBlockStatementNode(t)&&o===t&&r.push(t),(u.NodeGuards.isProgramNode(t)||n&&u.NodeGuards.isNodeHasBlockScope(t,o))&&r.push(t),t!==o?e.getBlockScopesOfNodeRecursive(o,r,++n):r}},{key:"getSiblingStatementNodeByOffset",value:function(t,r){var n=e.getScopeOfNode(t),o=u.NodeGuards.isSwitchCaseNode(n)?n.consequent:n.body;return o[o.indexOf(t)+r]||null}}]),e}();t.NodeUtils=d},function(e,t,r){"use strict";var n=r(1),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a=r(19),i=function(){function e(){n(this,e)}return o(e,null,[{key:"isArrayPatternNode",value:function(e){return e.type===a.NodeType.ArrayPattern}},{key:"isArrowFunctionExpressionNode",value:function(e){return e.type===a.NodeType.ArrowFunctionExpression}},{key:"isAssignmentPatternNode",value:function(e){return e.type===a.NodeType.AssignmentPattern}},{key:"isAwaitExpressionNode",value:function(e){return e.type===a.NodeType.AwaitExpression}},{key:"isBlockStatementNode",value:function(e){return e.type===a.NodeType.BlockStatement}},{key:"isBreakStatementNode",value:function(e){return e.type===a.NodeType.BreakStatement}},{key:"isCallExpressionNode",value:function(e){return e.type===a.NodeType.CallExpression}},{key:"isCatchClauseNode",value:function(e){return e.type===a.NodeType.CatchClause}},{key:"isClassDeclarationNode",value:function(e){return e.type===a.NodeType.ClassDeclaration}},{key:"isContinueStatementNode",value:function(e){return e.type===a.NodeType.ContinueStatement}},{key:"isExpressionStatementNode",value:function(e){return e.type===a.NodeType.ExpressionStatement}},{key:"isFunctionDeclarationNode",value:function(e){return e.type===a.NodeType.FunctionDeclaration}},{key:"isFunctionExpressionNode",value:function(e){return e.type===a.NodeType.FunctionExpression}},{key:"isIdentifierNode",value:function(e){return e.type===a.NodeType.Identifier}},{key:"isIfStatementNode",value:function(e){return e.type===a.NodeType.IfStatement}},{key:"isLabelIdentifierNode",value:function(t,r){var n=e.isLabeledStatementNode(r)&&r.label===t,o=e.isContinueStatementNode(r)&&r.label===t,a=e.isBreakStatementNode(r)&&r.label===t;return n||o||a}},{key:"isLabeledStatementNode",value:function(e){return e.type===a.NodeType.LabeledStatement}},{key:"isLiteralNode",value:function(e){return e.type===a.NodeType.Literal}},{key:"isMemberExpressionNode",value:function(e){return e.type===a.NodeType.MemberExpression}},{key:"isMethodDefinitionNode",value:function(e){return e.type===a.NodeType.MethodDefinition}},{key:"isNode",value:function(e){return e&&void 0!==!e.type}},{key:"isNodeHasBlockScope",value:function(t,r){return e.isProgramNode(t)||e.isBlockStatementNode(t)&&e.nodesWithBlockScope.includes(r.type)}},{key:"isNodeHasScope",value:function(t){return e.isProgramNode(t)||e.isBlockStatementNode(t)||e.isSwitchCaseNode(t)}},{key:"isNodeWithComments",value:function(e){return Boolean(e.leadingComments)||Boolean(e.trailingComments)}},{key:"isObjectPatternNode",value:function(e){return e.type===a.NodeType.ObjectPattern}},{key:"isObjectExpressionNode",value:function(e){return e.type===a.NodeType.ObjectExpression}},{key:"isProgramNode",value:function(e){return e.type===a.NodeType.Program}},{key:"isPropertyNode",value:function(e){return e.type===a.NodeType.Property}},{key:"isReplaceableIdentifierNode",value:function(t,r){if(!e.isIdentifierNode(t))return!1;var n=e.isPropertyNode(r)&&!r.computed&&r.key===t,o=e.isMemberExpressionNode(r)&&!r.computed&&r.property===t,a=e.isMethodDefinitionNode(r)&&!r.computed,i=e.isLabelIdentifierNode(t,r);return!(n||o||a||i)}},{key:"isRestElementNode",value:function(e){return e.type===a.NodeType.RestElement}},{key:"isReturnStatementNode",value:function(e){return e.type===a.NodeType.ReturnStatement}},{key:"isSuperNode",value:function(e){return e.type===a.NodeType.Super}},{key:"isSwitchCaseNode",value:function(e){return e.type===a.NodeType.SwitchCase}},{key:"isTemplateLiteralNode",value:function(e){return e.type===a.NodeType.TemplateLiteral}},{key:"isUnaryExpressionNode",value:function(e){return e.type===a.NodeType.UnaryExpression}},{key:"isUseStrictOperator",value:function(e){return e.type===a.NodeType.ExpressionStatement&&"use strict"===e.directive}},{key:"isVariableDeclarationNode",value:function(e){return e.type===a.NodeType.VariableDeclaration}},{key:"isVariableDeclaratorNode",value:function(e){return e.type===a.NodeType.VariableDeclarator}},{key:"isWhileStatementNode",value:function(e){return e.type===a.NodeType.WhileStatement}}]),e}();i.nodesWithBlockScope=[a.NodeType.ArrowFunctionExpression,a.NodeType.FunctionDeclaration,a.NodeType.FunctionExpression,a.NodeType.MethodDefinition],t.NodeGuards=i},function(e,t,r){"use strict";var n=r(11),o=r(205),a=r(204),i=r(203),s=r(202),c=r(201),u=r(200),d=r(30),l=r(40);Object.defineProperty(t,"__esModule",{value:!0});var f={configurable:!0,enumerable:!0},p="_initialized",m="_initializablePropertiesSet",g="_wrappedMethodsSet",_="constructor";function N(e,t,r){u(e,r)||c(e,t,r)}t.initializable=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"initialize",t=l(this)[0];return function(r,u){var l=r[e];if(!l||"function"!=typeof l)throw new Error("`".concat(e,"` method with initialization logic not ")+"found. `@".concat(t,"` decorator requires `").concat(e,"` method"));return N(p,!1,r),N(m,new d,r),N(g,new d,r),function(e,t){var r=s(e),c=[t,_];r.forEach(function(r){var s=i(m,e),u=i(g,e),d=c.includes(r)||s.has(r)||u.has(r);if(!d){var l=e[r];if("function"==typeof l){var _=a(e,r)||f,N=_.value;o(e,r,n({},_,{value:function(){if(!i(p,this))throw new Error("Class should be initialized with `".concat(t,"()` method"));return N.apply(this,arguments)}})),u.add(r)}}})}(r,e),function(e,t,r){var i=a(e,t)||f,s=i.value;o(e,t,n({},i,{value:function(){c(p,!0,this);var e=s.apply(this,arguments);return this[r],e}}))}(r,e,u),function(e,t){i(m,e).add(t);var r="_".concat(t),s=a(e,r)||f;return o(e,t,n({},s,{get:function(){if(void 0===this[r])throw new Error("Property `".concat(t,"` is not initialized! Initialize it first!"));return this[r]},set:function(e){this[r]=e}})),s}(r,u)}}},function(e,t){e.exports=require("@babel/runtime/core-js/object/assign")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Preparing="Preparing",e.DeadCodeInjection="DeadCodeInjection",e.ControlFlowFlattening="ControlFlowFlattening",e.Converting="Converting",e.Obfuscating="Obfuscating",e.Finalizing="Finalizing"}(t.TransformationStage||(t.TransformationStage={}))},function(e,t,r){"use strict";var n=r(1),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a,i=r(4),s=r(0),c=r(3),u=r(182),d=r(181),l=a=function(){function e(t,r,o){n(this,e),this.cachedNode=null,this.identifierNamesGenerator=t(o),this.randomGenerator=r,this.options=o}return o(e,[{key:"getNode",value:function(){return this.cachedNode||(this.cachedNode=this.getNodeStructure()),this.cachedNode}},{key:"getGlobalVariableTemplate",value:function(){return this.randomGenerator.getRandomGenerator().pickone(a.globalVariableTemplateFunctions)}}]),e}();l.globalVariableTemplateFunctions=[u.GlobalVariableTemplate1(),d.GlobalVariableTemplate2()],l=a=i.__decorate([s.injectable(),i.__param(0,s.inject(c.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),i.__param(1,s.inject(c.ServiceIdentifiers.IRandomGenerator)),i.__param(2,s.inject(c.ServiceIdentifiers.IOptions)),i.__metadata("design:paramtypes",[Function,Object,Object])],l),t.AbstractCustomNode=l},function(e,t,r){"use strict";var n=r(1),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a=r(4),i=r(0),s=r(3),c=r(10),u=function(){function e(t,r){n(this,e),this.randomGenerator=t,this.options=r}return o(e,[{key:"initialize",value:function(){this.nodeIdentifier=this.randomGenerator.getRandomInteger(0,1e4)}}]),e}();a.__decorate([c.initializable(),a.__metadata("design:type",Number)],u.prototype,"nodeIdentifier",void 0),a.__decorate([i.postConstruct(),a.__metadata("design:type",Function),a.__metadata("design:paramtypes",[]),a.__metadata("design:returntype",void 0)],u.prototype,"initialize",null),u=a.__decorate([i.injectable(),a.__param(0,i.inject(s.ServiceIdentifiers.IRandomGenerator)),a.__param(1,i.inject(s.ServiceIdentifiers.IOptions)),a.__metadata("design:paramtypes",[Object,Object])],u),t.AbstractNodeTransformer=u},function(e,t,r){"use strict";var n=r(11),o=r(1),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i=__importStar(r(47)),s=r(19),c=function(){function e(){o(this,e)}return a(e,null,[{key:"getProgramNode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:s.NodeType.Program,body:e,sourceType:"script",obfuscatedNode:!1}}},{key:"getArrayExpressionNode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:s.NodeType.ArrayExpression,elements:e}}},{key:"getAssignmentExpressionNode",value:function(e,t,r){return{type:s.NodeType.AssignmentExpression,operator:e,left:t,right:r,obfuscatedNode:!1}}},{key:"getBinaryExpressionNode",value:function(e,t,r){return{type:s.NodeType.BinaryExpression,operator:e,left:t,right:r,obfuscatedNode:!1}}},{key:"getBlockStatementNode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:s.NodeType.BlockStatement,body:e,obfuscatedNode:!1}}},{key:"getBreakStatement",value:function(e){var t={type:s.NodeType.BreakStatement,obfuscatedNode:!1};return e&&(t.label=e),t}},{key:"getCallExpressionNode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return{type:s.NodeType.CallExpression,callee:e,arguments:t,obfuscatedNode:!1}}},{key:"getContinueStatement",value:function(e){var t={type:s.NodeType.ContinueStatement,obfuscatedNode:!1};return e&&(t.label=e),t}},{key:"getExpressionStatementNode",value:function(e){return{type:s.NodeType.ExpressionStatement,expression:e,obfuscatedNode:!1}}},{key:"getFunctionDeclarationNode",value:function(t,r,n){return{type:s.NodeType.FunctionDeclaration,id:e.getIdentifierNode(t),params:r,body:n,generator:!1,obfuscatedNode:!1}}},{key:"getFunctionExpressionNode",value:function(e,t){return{type:s.NodeType.FunctionExpression,params:e,body:t,generator:!1,obfuscatedNode:!1}}},{key:"getIfStatementNode",value:function(e,t,r){return n({type:s.NodeType.IfStatement,test:e,consequent:t},r&&{alternate:r},{obfuscatedNode:!1})}},{key:"getIdentifierNode",value:function(e){return{type:s.NodeType.Identifier,name:e,obfuscatedNode:!1}}},{key:"getLiteralNode",value:function(e,t){return t=void 0!==t?t:"'".concat(e,"'"),{type:s.NodeType.Literal,value:e,raw:t,"x-verbatim-property":{content:t,precedence:i.Precedence.Primary},obfuscatedNode:!1}}},{key:"getLogicalExpressionNode",value:function(e,t,r){return{type:s.NodeType.LogicalExpression,operator:e,left:t,right:r,obfuscatedNode:!1}}},{key:"getMemberExpressionNode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:s.NodeType.MemberExpression,computed:r,object:e,property:t,obfuscatedNode:!1}}},{key:"getMethodDefinitionNode",value:function(e,t,r,n){return{type:s.NodeType.MethodDefinition,key:e,value:t,kind:r,computed:n,static:!1,obfuscatedNode:!1}}},{key:"getObjectExpressionNode",value:function(e){return{type:s.NodeType.ObjectExpression,properties:e,obfuscatedNode:!1}}},{key:"getPropertyNode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:s.NodeType.Property,key:e,value:t,kind:"init",method:!1,shorthand:!1,computed:r,obfuscatedNode:!1}}},{key:"getUnaryExpressionNode",value:function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return{type:s.NodeType.UnaryExpression,operator:e,argument:t,prefix:r,obfuscatedNode:!1}}},{key:"getReturnStatementNode",value:function(e){return{type:s.NodeType.ReturnStatement,argument:e,obfuscatedNode:!1}}},{key:"getSwitchStatementNode",value:function(e,t){return{type:s.NodeType.SwitchStatement,discriminant:e,cases:t,obfuscatedNode:!1}}},{key:"getSwitchCaseNode",value:function(e,t){return{type:s.NodeType.SwitchCase,test:e,consequent:t,obfuscatedNode:!1}}},{key:"getUpdateExpressionNode",value:function(e,t){return{type:s.NodeType.UpdateExpression,operator:e,argument:t,prefix:!1,obfuscatedNode:!1}}},{key:"getVariableDeclarationNode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"var";return{type:s.NodeType.VariableDeclaration,declarations:e,kind:t,obfuscatedNode:!1}}},{key:"getVariableDeclaratorNode",value:function(e,t){return{type:s.NodeType.VariableDeclarator,id:e,init:t,obfuscatedNode:!1}}},{key:"getWhileStatementNode",value:function(e,t){return{type:s.NodeType.WhileStatement,test:e,body:t,obfuscatedNode:!1}}}]),e}();t.Nodes=c},function(e,t){e.exports=require("@babel/runtime/core-js/map")},function(e,t){e.exports=require("estraverse")},function(e,t){e.exports=require("string-template")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ArrayExpression="ArrayExpression",e.ArrayPattern="ArrayPattern",e.ArrowFunctionExpression="ArrowFunctionExpression",e.AssignmentExpression="AssignmentExpression",e.AssignmentPattern="AssignmentPattern",e.AwaitExpression="AwaitExpression",e.BinaryExpression="BinaryExpression",e.BlockStatement="BlockStatement",e.BreakStatement="BreakStatement",e.CallExpression="CallExpression",e.CatchClause="CatchClause",e.ClassDeclaration="ClassDeclaration",e.ContinueStatement="ContinueStatement",e.ExpressionStatement="ExpressionStatement",e.FunctionDeclaration="FunctionDeclaration",e.FunctionExpression="FunctionExpression",e.Identifier="Identifier",e.IfStatement="IfStatement",e.LabeledStatement="LabeledStatement",e.Literal="Literal",e.LogicalExpression="LogicalExpression",e.MemberExpression="MemberExpression",e.MethodDefinition="MethodDefinition",e.ObjectExpression="ObjectExpression",e.ObjectPattern="ObjectPattern",e.Program="Program",e.Property="Property",e.RestElement="RestElement",e.ReturnStatement="ReturnStatement",e.Super="Super",e.SwitchCase="SwitchCase",e.SwitchStatement="SwitchStatement",e.TemplateLiteral="TemplateLiteral",e.TryStatement="TryStatement",e.UnaryExpression="UnaryExpression",e.UpdateExpression="UpdateExpression",e.VariableDeclaration="VariableDeclaration",e.VariableDeclarator="VariableDeclarator",e.WhileStatement="WhileStatement"}(t.NodeType||(t.NodeType={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Browser="browser",e.Extension="extension",e.Node="node"}(t.ObfuscationTarget||(t.ObfuscationTarget={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BinaryExpressionFunctionNode="BinaryExpressionFunctionNode",e.BlockStatementControlFlowFlatteningNode="BlockStatementControlFlowFlatteningNode",e.CallExpressionControlFlowStorageCallNode="CallExpressionControlFlowStorageCallNode",e.CallExpressionFunctionNode="CallExpressionFunctionNode",e.ControlFlowStorageNode="ControlFlowStorageNode",e.ExpressionWithOperatorControlFlowStorageCallNode="ExpressionWithOperatorControlFlowStorageCallNode",e.LogicalExpressionFunctionNode="LogicalExpressionFunctionNode",e.StringLiteralControlFlowStorageCallNode="StringLiteralControlFlowStorageCallNode",e.StringLiteralNode="StringLiteralNode"}(t.ControlFlowCustomNode||(t.ControlFlowCustomNode={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BaseIdentifierObfuscatingReplacer="BaseIdentifierObfuscatingReplacer"}(t.IdentifierObfuscatingReplacer||(t.IdentifierObfuscatingReplacer={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.AfterObfuscation="afterObfuscation",e.BeforeObfuscation="beforeObfuscation"}(t.ObfuscationEvent||(t.ObfuscationEvent={}))},function(e,t){e.exports=require("@babel/runtime/helpers/toConsumableArray")},function(e,t,r){"use strict";var n=r(24),o=r(1),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i=r(9),s=function(){function e(){o(this,e)}return a(e,null,[{key:"appendNode",value:function(t,r){r=e.parentizeScopeStatementsBeforeAppend(t,r),e.setScopeNodeStatements(t,n(e.getScopeNodeStatements(t)).concat(n(r)))}},{key:"appendNodeToOptimalBlockScope",value:function(t,r,n){var o,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;o=t.length?e.getOptimalBlockScope(t,a):r,e.prependNode(o,n)}},{key:"getOptimalBlockScope",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,o=t[r];if(n<=0)throw new Error("Invalid `deep` argument value. Value should be bigger then 0.");return n>1&&o.stackTrace.length?e.getOptimalBlockScope(o.stackTrace,0,--n):o.callee}},{key:"insertNodeAfter",value:function(t,r,n){var o=e.getScopeNodeStatements(t).indexOf(n);e.insertNodeAtIndex(t,r,o+1)}},{key:"insertNodeAtIndex",value:function(t,r,o){r=e.parentizeScopeStatementsBeforeAppend(t,r),e.setScopeNodeStatements(t,n(e.getScopeNodeStatements(t).slice(0,o)).concat(n(r),n(e.getScopeNodeStatements(t).slice(o))))}},{key:"prependNode",value:function(t,r){r=e.parentizeScopeStatementsBeforeAppend(t,r),e.setScopeNodeStatements(t,n(r).concat(n(e.getScopeNodeStatements(t))))}},{key:"getScopeNodeStatements",value:function(e){return i.NodeGuards.isSwitchCaseNode(e)?e.consequent:e.body}},{key:"parentizeScopeStatementsBeforeAppend",value:function(e,t){return t.forEach(function(t){t.parentNode=e}),t}},{key:"setScopeNodeStatements",value:function(e,t){i.NodeGuards.isSwitchCaseNode(e)?e.consequent=t:e.body=t}}]),e}();t.NodeAppender=s},function(e,t,r){"use strict";var n=r(16),o=r(1),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),s=r(3),c=r(213),u=r(208),d=r(194),l=r(189),f=r(142),p=r(141),m=r(138),g=r(137),_=r(124),N=r(109),v=r(100),y=r(95),h=r(89),b=r(51),S=r(86),I=r(84),C=r(83),O=r(82),j=r(81),F=function(){function e(){o(this,e),this.container=new i.Container}return a(e,[{key:"get",value:function(e){return this.container.get(e)}},{key:"getNamed",value:function(e,t){return this.container.getNamed(e,t)}},{key:"load",value:function(e,t){this.container.bind(s.ServiceIdentifiers.ISourceCode).toDynamicValue(function(){return new C.SourceCode(e)}).inSingletonScope(),this.container.bind(s.ServiceIdentifiers.TInputOptions).toDynamicValue(function(){return t}).inSingletonScope(),this.container.bind(s.ServiceIdentifiers.ILogger).to(b.Logger).inSingletonScope(),this.container.bind(s.ServiceIdentifiers.IJavaScriptObfuscator).to(h.JavaScriptObfuscator).inSingletonScope(),this.container.bind(s.ServiceIdentifiers.ITransformersRunner).to(j.TransformersRunner).inSingletonScope(),this.container.bind(s.ServiceIdentifiers.IObfuscationResult).to(I.ObfuscationResult).inSingletonScope(),this.container.bind(s.ServiceIdentifiers.Factory__IObfuscationResult).toFactory(function(e){return function(t,r){var n=e.container.get(s.ServiceIdentifiers.IObfuscationResult);return n.initialize(t,r),n}}),this.container.bind(s.ServiceIdentifiers.ISourceMapCorrector).to(O.SourceMapCorrector).inSingletonScope(),this.container.bind(s.ServiceIdentifiers.IObfuscationEventEmitter).to(S.ObfuscationEventEmitter).inSingletonScope(),this.container.load(c.analyzersModule),this.container.load(u.controlFlowTransformersModule),this.container.load(d.convertingTransformersModule),this.container.load(l.customNodesModule),this.container.load(f.finalizingTransformersModule),this.container.load(p.generatorsModule),this.container.load(m.nodeTransformersModule),this.container.load(g.obfuscatingTransformersModule),this.container.load(_.optionsModule),this.container.load(N.preparingTransformersModule),this.container.load(v.storagesModule),this.container.load(y.utilsModule)}},{key:"unload",value:function(){this.container.unbindAll()}}],[{key:"getFactory",value:function(e){return function(t){return function(r){return t.container.getNamed(e,r)}}}},{key:"getCacheFactory",value:function(e){return function(t){var r=new n;return function(n){if(r.has(n))return r.get(n);var o=t.container.getNamed(e,n);return r.set(n,o),o}}}},{key:"getConstructorFactory",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o-1||0===e.indexOf("//")?e.split("/")[2]:e.split("/")[0]).split(":")[0]}},{key:"isCeilNumber",value:function(e){return e%1==0}},{key:"stringRotate",value:function(e,t){if(!e)throw new ReferenceError("Cannot rotate empty string.");for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{},r=new i.InversifyContainerFacade;r.load(e,t);var n=r.get(a.ServiceIdentifiers.IJavaScriptObfuscator).obfuscate(e);return r.unload(),n}},{key:"runCLI",value:function(e){var t=new s.JavaScriptObfuscatorCLI(e);t.initialize(),t.run()}}]),e}();t.JavaScriptObfuscator=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Base64="base64",e.Rc4="rc4"}(t.StringArrayEncoding||(t.StringArrayEncoding={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Inline="inline",e.Separate="separate"}(t.SourceMapMode||(t.SourceMapMode={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.HexadecimalIdentifierNamesGenerator="hexadecimal",e.MangledIdentifierNamesGenerator="mangled"}(t.IdentifierNamesGenerator||(t.IdentifierNamesGenerator={}))},function(e,t,r){"use strict";var n=r(1),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a=r(4),i=r(0),s=r(3),c=function(){function e(t,r,o){n(this,e),this.identifierNamesGenerator=t(o),this.randomGenerator=r,this.options=o}return o(e,[{key:"getAppendEvent",value:function(){return this.appendEvent}},{key:"getCustomNodes",value:function(){return this.customNodes}},{key:"appendCustomNodeIfExist",value:function(e,t){var r=this.customNodes.get(e);r&&t(r)}},{key:"getRandomStackTraceIndex",value:function(e){return this.randomGenerator.getRandomInteger(0,Math.max(0,Math.round(e-1)))}}]),e}();c=a.__decorate([i.injectable(),a.__param(0,i.inject(s.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),a.__param(1,i.inject(s.ServiceIdentifiers.IRandomGenerator)),a.__param(2,i.inject(s.ServiceIdentifiers.IOptions)),a.__metadata("design:paramtypes",[Function,Object,Object])],c),t.AbstractCustomNodeGroup=c},function(e,t){e.exports=require("@babel/runtime/core-js/get-iterator")},function(e,t,r){"use strict";var n=r(1);Object.defineProperty(t,"__esModule",{value:!0});var o=r(4),a=r(0),i=r(3),s=function e(t){n(this,e),this.options=t};s=o.__decorate([a.injectable(),o.__param(0,a.inject(i.ServiceIdentifiers.IOptions)),o.__metadata("design:paramtypes",[Object])],s),t.AbstractObfuscatingReplacer=s},function(e,t,r){"use strict";var n=r(59);Object.defineProperty(t,"__esModule",{value:!0});var o=r(35),a=r(20),i=r(34);t.NO_ADDITIONAL_NODES_PRESET=n({compact:!0,controlFlowFlattening:!1,controlFlowFlatteningThreshold:0,deadCodeInjection:!1,deadCodeInjectionThreshold:0,debugProtection:!1,debugProtectionInterval:!1,disableConsoleOutput:!1,domainLock:[],exclude:[],identifierNamesGenerator:o.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,identifiersPrefix:"",log:!1,renameGlobals:!1,reservedNames:[],rotateStringArray:!1,seed:0,selfDefending:!1,sourceMap:!1,sourceMapBaseUrl:"",sourceMapFileName:"",sourceMapMode:i.SourceMapMode.Separate,stringArray:!1,stringArrayEncoding:!1,stringArrayThreshold:0,target:a.ObfuscationTarget.Browser,transformObjectKeys:!1,unicodeEscapeSequence:!1})},function(e,t){e.exports=require("@babel/runtime/core-js/object/keys")},function(e,t){e.exports=require("path")},function(e,t,r){"use strict";var n=r(11),o=r(1),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i=r(4),s=i.__importStar(r(79)),c=i.__importStar(r(53)),u=i.__importStar(r(41)),d=r(10),l=r(43),f=r(78),p=r(77),m=r(76),g=r(75),_=r(74),N=r(73),v=r(72),y=r(32),h=r(69),b=function(){function e(t){o(this,e),this.rawArguments=t,this.arguments=t.slice(2)}return a(e,[{key:"initialize",value:function(){this.inputPath=u.normalize(this.arguments[0]||""),this.commands=new s.Command,this.configureCommands(),this.configureHelp(),this.inputCLIOptions=this.commands.opts()}},{key:"run",value:function(){if(!this.arguments.length||this.arguments.includes("--help"))return this.commands.outputHelp();var e=new h.SourceCodeReader(this.inputCLIOptions).readSourceCode(this.inputPath);this.processSourceCodeData(e)}},{key:"buildOptions",value:function(){var t=e.filterOptions(this.inputCLIOptions),r=this.inputCLIOptions.config,o=r?u.resolve(r,"."):"",a=o?v.CLIUtils.getUserConfig(o):{};return n({},l.DEFAULT_PRESET,a,t)}},{key:"configureCommands",value:function(){this.commands.usage(" [options]").version(c.version,"-v, --version").option("-o, --output ","Output path for obfuscated code").option("--compact ","Disable one line output code compacting",p.BooleanSanitizer).option("--config ","Name of js / json config file").option("--control-flow-flattening ","Enables control flow flattening",p.BooleanSanitizer).option("--control-flow-flattening-threshold ","The probability that the control flow flattening transformation will be applied to the node",parseFloat).option("--dead-code-injection ","Enables dead code injection",p.BooleanSanitizer).option("--dead-code-injection-threshold ","The probability that the dead code injection transformation will be applied to the node",parseFloat).option("--debug-protection ","Disable browser Debug panel (can cause DevTools enabled browser freeze)",p.BooleanSanitizer).option("--debug-protection-interval ","Disable browser Debug panel even after page was loaded (can cause DevTools enabled browser freeze)",p.BooleanSanitizer).option("--disable-console-output ","Allow console.log, console.info, console.error and console.warn messages output into browser console",p.BooleanSanitizer).option("--domain-lock (comma separated, without whitespaces)","Blocks the execution of the code in domains that do not match the passed RegExp patterns (comma separated)",f.ArraySanitizer).option("--exclude (comma separated, without whitespaces)","A filename or glob which indicates files to exclude from obfuscation",f.ArraySanitizer).option("--identifier-names-generator [hexadecimal, mangled]","Sets identifier names generator (Default: hexadecimal)",m.IdentifierNamesGeneratorSanitizer).option("--identifiers-prefix ","Sets prefix for all global identifiers.").option("--log ","Enables logging of the information to the console",p.BooleanSanitizer).option("--reserved-names (comma separated, without whitespaces)","Disable obfuscation of variable names, function names and names of function parameters that match the passed RegExp patterns (comma separated)",f.ArraySanitizer).option("--rename-globals ","Allows to enable obfuscation of global variable and function names with declaration.",p.BooleanSanitizer).option("--rotate-string-array ","Disable rotation of unicode array values during obfuscation",p.BooleanSanitizer).option("--seed ","Sets seed for random generator. This is useful for creating repeatable results.",parseFloat).option("--self-defending ","Disables self-defending for obfuscated code",p.BooleanSanitizer).option("--source-map ","Enables source map generation",p.BooleanSanitizer).option("--source-map-base-url ","Sets base url to the source map import url when `--source-map-mode=separate`").option("--source-map-file-name ","Sets file name for output source map when `--source-map-mode=separate`").option("--source-map-mode [inline, separate]","Specify source map output mode",_.SourceMapModeSanitizer).option("--string-array ","Disables gathering of all literal strings into an array and replacing every literal string with an array call",p.BooleanSanitizer).option("--string-array-encoding [true, false, base64, rc4]","Encodes all strings in strings array using base64 or rc4 (this option can slow down your code speed",N.StringArrayEncodingSanitizer).option("--string-array-threshold ","The probability that the literal string will be inserted into stringArray (Default: 0.8, Min: 0, Max: 1)",parseFloat).option("--target ","Allows to set target environment for obfuscated code.",g.ObfuscationTargetSanitizer).option("--transform-object-keys ","Enables transformation of object keys",p.BooleanSanitizer).option("--unicode-escape-sequence ","Allows to enable/disable string conversion to unicode escape sequence",p.BooleanSanitizer).parse(this.rawArguments)}},{key:"configureHelp",value:function(){this.commands.on("--help",function(){console.log(" Examples:\n"),console.log(" %> javascript-obfuscator input_file_name.js --compact true --self-defending false"),console.log(" %> javascript-obfuscator input_file_name.js --output output_file_name.js --compact true --self-defending false"),console.log(" %> javascript-obfuscator input_directory_name --compact true --self-defending false"),console.log("")})}},{key:"processSourceCodeData",value:function(e){var t=this,r=this.inputCLIOptions.output?u.normalize(this.inputCLIOptions.output):"";if(Array.isArray(e))e.forEach(function(e,n){var o=e.filePath,a=e.content,i=r?u.join(r,o):v.CLIUtils.getOutputCodePath(o);t.processSourceCode(a,i,n)});else{var n=r||v.CLIUtils.getOutputCodePath(this.inputPath);this.processSourceCode(e,n,null)}}},{key:"processSourceCode",value:function(t,r,o){var a=this.buildOptions();if(null!==o){var i=this.inputCLIOptions.identifiersPrefix||e.baseIdentifiersPrefix,s="".concat(i).concat(o);a=n({},a,{identifiersPrefix:s})}a.sourceMap?e.processSourceCodeWithSourceMap(t,r,a):e.processSourceCodeWithoutSourceMap(t,r,a)}}],[{key:"filterOptions",value:function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&void 0!==e[r]&&(t[r]=e[r]);return t}},{key:"processSourceCodeWithoutSourceMap",value:function(e,t,r){var n=y.JavaScriptObfuscator.obfuscate(e,r).getObfuscatedCode();v.CLIUtils.writeFile(t,n)}},{key:"processSourceCodeWithSourceMap",value:function(e,t,r){var o=v.CLIUtils.getOutputSourceMapPath(t,r.sourceMapFileName||"");r=n({},r,{sourceMapFileName:u.basename(o)});var a=y.JavaScriptObfuscator.obfuscate(e,r);v.CLIUtils.writeFile(t,a.getObfuscatedCode()),"separate"===r.sourceMapMode&&a.getSourceMap()&&v.CLIUtils.writeFile(o,a.getSourceMap())}}]),e}();b.encoding="utf8",b.obfuscatedFilePrefix="-obfuscated",b.baseIdentifiersPrefix="a",i.__decorate([d.initializable(),i.__metadata("design:type",Object)],b.prototype,"commands",void 0),i.__decorate([d.initializable(),i.__metadata("design:type",Object)],b.prototype,"inputCLIOptions",void 0),i.__decorate([d.initializable(),i.__metadata("design:type",String)],b.prototype,"inputPath",void 0),t.JavaScriptObfuscatorCLI=b},function(e,t,r){"use strict";var n=r(59);Object.defineProperty(t,"__esModule",{value:!0});var o=r(35),a=r(20),i=r(34);t.DEFAULT_PRESET=n({compact:!0,config:"",controlFlowFlattening:!1,controlFlowFlatteningThreshold:.75,deadCodeInjection:!1,deadCodeInjectionThreshold:.4,debugProtection:!1,debugProtectionInterval:!1,disableConsoleOutput:!1,domainLock:[],exclude:[],identifierNamesGenerator:o.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,identifiersPrefix:"",log:!1,renameGlobals:!1,reservedNames:[],rotateStringArray:!0,seed:0,selfDefending:!1,sourceMap:!1,sourceMapBaseUrl:"",sourceMapFileName:"",sourceMapMode:i.SourceMapMode.Separate,stringArray:!0,stringArrayEncoding:!1,stringArrayThreshold:.75,target:a.ObfuscationTarget.Browser,transformObjectKeys:!1,unicodeEscapeSequence:!1})},function(e,t){e.exports=require("@babel/runtime/helpers/get")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableNoEvalTemplate=function(){return"\n var that = (typeof window !== 'undefined'\n ? window\n : (typeof process === 'object' &&\n typeof require === 'function' &&\n typeof global === 'object')\n ? global\n : this);\n "}},function(e,t,r){"use strict";var n=r(16),o=r(1),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i,s=r(4),c=r(0),u=r(3),d=i=function(){function e(t,r,a){o(this,e),this.replacerDataByControlFlowStorageId=new n,this.controlFlowCustomNodeFactory=t,this.randomGenerator=r,this.options=a}return a(e,[{key:"insertCustomNodeToControlFlowStorage",value:function(e,t,r,n){var o=this,a=t.getStorageId(),s=i.getStorageKeysByIdForCurrentStorage(this.replacerDataByControlFlowStorageId,a),c=s.get(r);if(this.randomGenerator.getMathRandom()1&&void 0!==arguments[1]?arguments[1]:a.randomGeneratorPool;return this.getRandomGenerator().string({length:e,pool:t})}},{key:"getSeed",value:function(){return this.seed}}]),e}();f.randomGeneratorPool="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",i.__decorate([l.initializable(),i.__metadata("design:type",Object)],f.prototype,"randomGenerator",void 0),i.__decorate([l.initializable(),i.__metadata("design:type",Number)],f.prototype,"seed",void 0),i.__decorate([s.postConstruct(),i.__metadata("design:type",Function),i.__metadata("design:paramtypes",[]),i.__metadata("design:returntype",void 0)],f.prototype,"initialize",null),f=a=i.__decorate([s.injectable(),i.__param(0,s.inject(c.ServiceIdentifiers.ISourceCode)),i.__param(1,s.inject(c.ServiceIdentifiers.IOptions)),i.__metadata("design:paramtypes",[Object,Object])],f),t.RandomGenerator=f},function(e,t,r){"use strict";var n=r(24),o=r(37),a=r(29),i=r(16),s=r(1),c=r(2);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=r(10),p=function(){function e(t,r){s(this,e),this.randomGenerator=t,this.options=r}return c(e,[{key:"initialize",value:function(){this.storage=new i,this.storageId=this.randomGenerator.getRandomString(6)}},{key:"get",value:function(e){var t=this.storage.get(e);if(!t)throw new Error("No value found in map storage with key `".concat(e,"`"));return t}},{key:"getKeyOf",value:function(e){var t=!0,r=!1,n=void 0;try{for(var i,s=o(this.storage);!(t=(i=s.next()).done);t=!0){var c=i.value,u=a(c,2),d=u[0];if(e===u[1])return d}}catch(e){r=!0,n=e}finally{try{t||null==s.return||s.return()}finally{if(r)throw n}}return null}},{key:"getLength",value:function(){return this.storage.size}},{key:"getStorage",value:function(){return this.storage}},{key:"getStorageId",value:function(){return this.storageId}},{key:"mergeWith",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.storage=new i(n(this.storage).concat(n(e.getStorage()))),t&&(this.storageId=e.getStorageId())}},{key:"set",value:function(e,t){this.storage.set(e,t)}}]),e}();u.__decorate([f.initializable(),u.__metadata("design:type",String)],p.prototype,"storageId",void 0),u.__decorate([f.initializable(),u.__metadata("design:type",i)],p.prototype,"storage",void 0),u.__decorate([d.postConstruct(),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[]),u.__metadata("design:returntype",void 0)],p.prototype,"initialize",null),p=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Object,Object])],p),t.MapStorage=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BlackListNodeGuard="BlackListNodeGuard",e.ConditionalCommentNodeGuard="ConditionalCommentNodeGuard"}(t.ObfuscatingGuard||(t.ObfuscatingGuard={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BooleanLiteralObfuscatingReplacer="BooleanLiteralObfuscatingReplacer",e.NumberLiteralObfuscatingReplacer="NumberLiteralObfuscatingReplacer",e.StringLiteralObfuscatingReplacer="StringLiteralObfuscatingReplacer"}(t.LiteralObfuscatingReplacer||(t.LiteralObfuscatingReplacer={}))},function(e,t,r){"use strict";var n=r(1);Object.defineProperty(t,"__esModule",{value:!0});var o=r(4),a=r(0),i=r(3),s=function e(t,r){n(this,e),this.randomGenerator=t,this.options=r};s=o.__decorate([a.injectable(),o.__param(0,a.inject(i.ServiceIdentifiers.IRandomGenerator)),o.__param(1,a.inject(i.ServiceIdentifiers.IOptions)),o.__metadata("design:paramtypes",[Object,Object])],s),t.AbstractIdentifierNamesGenerator=s},function(e,t){e.exports=require("@babel/runtime/core-js/object/freeze")},function(e,t){e.exports=require("@babel/runtime/core-js/array/from")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ConsoleOutputCustomNodeGroup="ConsoleOutputCustomNodeGroup",e.DebugProtectionCustomNodeGroup="DebugProtectionCustomNodeGroup",e.DomainLockCustomNodeGroup="DomainLockCustomNodeGroup",e.SelfDefendingCustomNodeGroup="SelfDefendingCustomNodeGroup",e.StringArrayCustomNodeGroup="StringArrayCustomNodeGroup"}(t.CustomNodeGroup||(t.CustomNodeGroup={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BlockStatementDeadCodeInjectionNode="BlockStatementDeadCodeInjectionNode"}(t.DeadCodeInjectionCustomNode||(t.DeadCodeInjectionCustomNode={}))},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=r(21),f=r(46),p=r(9),m=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"getControlFlowStorageCallNode",value:function(e,t,r,n){var o=this.controlFlowCustomNodeFactory(l.ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode);o.initialize(e,t,r,n);var a=o.getNode()[0];if(!a||!p.NodeGuards.isExpressionStatementNode(a))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return a.expression}}]),t}(f.AbstractControlFlowReplacer);m=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IControlFlowCustomNode)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],m),t.ExpressionWithOperatorControlFlowReplacer=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BinaryExpressionControlFlowReplacer="BinaryExpressionControlFlowReplacer",e.CallExpressionControlFlowReplacer="CallExpressionControlFlowReplacer",e.LogicalExpressionControlFlowReplacer="LogicalExpressionControlFlowReplacer",e.StringLiteralControlFlowReplacer="StringLiteralControlFlowReplacer"}(t.ControlFlowReplacer||(t.ControlFlowReplacer={}))},function(e,t){e.exports=require("esprima")},function(e,t){e.exports=require("@babel/runtime/helpers/typeof")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.FunctionDeclarationCalleeDataExtractor="FunctionDeclarationCalleeDataExtractor",e.FunctionExpressionCalleeDataExtractor="FunctionExpressionCalleeDataExtractor",e.ObjectExpressionCalleeDataExtractor="ObjectExpressionCalleeDataExtractor"}(t.CalleeDataExtractor||(t.CalleeDataExtractor={}))},function(e,t){e.exports=require("multimatch")},function(e,t,r){"use strict";var n=r(24),o=r(1),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i=__importStar(r(49)),s=__importStar(r(41)),c=__importDefault(r(68)),u=r(50),d=r(42),l=r(51),f=function(){function e(t){o(this,e),this.options=t}return a(e,[{key:"readSourceCode",value:function(t){if(e.isFilePath(t)&&this.isValidFile(t))return this.readFile(t);if(e.isDirectoryPath(t)&&this.isValidDirectory(t))return this.readDirectoryRecursive(t);var r=e.availableInputExtensions.map(function(e){return"`".concat(e,"`")}).join(", ");throw new ReferenceError("Given input path must be a valid ".concat(r," file or directory path"))}},{key:"readDirectoryRecursive",value:function(t){var r=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return i.readdirSync(t,d.JavaScriptObfuscatorCLI.encoding).forEach(function(a){var i="".concat(t,"/").concat(a);if(e.isDirectoryPath(i)&&r.isValidDirectory(i))o.push.apply(o,n(r.readDirectoryRecursive(i)));else if(e.isFilePath(i)&&r.isValidFile(i)){var s=r.readFile(i);o.push({filePath:i,content:s})}}),o}},{key:"readFile",value:function(t){return e.logFilePath(t),i.readFileSync(t,d.JavaScriptObfuscatorCLI.encoding)}},{key:"isValidDirectory",value:function(t){return!e.isExcludedPath(t,this.options.exclude)}},{key:"isValidFile",value:function(t){return e.availableInputExtensions.includes(s.extname(t))&&!t.includes(d.JavaScriptObfuscatorCLI.obfuscatedFilePrefix)&&!e.isExcludedPath(t,this.options.exclude)}}],[{key:"isExcludedPath",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!t.length)return!1;var r=s.basename(e),n=!!c.default([e],t).length;return t.some(function(t){return e.includes(t)||r.includes(t)})||n}},{key:"isDirectoryPath",value:function(e){try{return i.statSync(e).isDirectory()}catch(e){return!1}}},{key:"isFilePath",value:function(e){try{return i.statSync(e).isFile()}catch(e){return!1}}},{key:"logFilePath",value:function(e){var t=s.normalize(e);l.Logger.log(l.Logger.colorInfo,u.LoggingPrefix.CLI,"Obfuscating file: ".concat(t,"..."))}}]),e}();f.availableInputExtensions=[".js"],t.SourceCodeReader=f},function(e,t){function r(e){var t=new Error('Cannot find module "'+e+'".');throw t.code="MODULE_NOT_FOUND",t}r.keys=function(){return[]},r.resolve=r,e.exports=r,r.id=70},function(e,t){e.exports=require("mkdirp")},function(e,t,r){"use strict";var n=r(1),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a=__importStar(r(49)),i=__importStar(r(71)),s=__importStar(r(41)),c=r(42),u=function(){function e(){n(this,e)}return o(e,null,[{key:"getOutputCodePath",value:function(e){return s.normalize(e).split(".").map(function(e,t){return 0===t?"".concat(e).concat(c.JavaScriptObfuscatorCLI.obfuscatedFilePrefix):e}).join(".")}},{key:"getOutputSourceMapPath",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return t&&(e="".concat(e.substring(0,e.lastIndexOf("/")),"/").concat(t)),/\.js\.map$/.test(e)?/\.js$/.test(e)&&(e+=".map"):e="".concat(e.split(".")[0],".js.map"),e}},{key:"getUserConfig",value:function(e){var t;try{t=r(70)(e)}catch(r){try{t=require(e)}catch(e){throw new ReferenceError("Given config path must be a valid `.js` or `.json` file path")}}return t}},{key:"writeFile",value:function(e,t){i.sync(s.dirname(e)),a.writeFileSync(e,t,{encoding:c.JavaScriptObfuscatorCLI.encoding})}}]),e}();t.CLIUtils=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(33);t.StringArrayEncodingSanitizer=function(e){switch(e){case"true":case"1":case n.StringArrayEncoding.Base64:return!0;case n.StringArrayEncoding.Rc4:return n.StringArrayEncoding.Rc4;default:return!1}}},function(e,t,r){"use strict";var n=r(40);Object.defineProperty(t,"__esModule",{value:!0});var o=r(34);t.SourceMapModeSanitizer=function(e){if(!n(o.SourceMapMode).some(function(t){return o.SourceMapMode[t]===e}))throw new ReferenceError("Invalid value of `--source-map-mode` option");return e}},function(e,t,r){"use strict";var n=r(40);Object.defineProperty(t,"__esModule",{value:!0});var o=r(20);t.ObfuscationTargetSanitizer=function(e){if(!n(o.ObfuscationTarget).some(function(t){return o.ObfuscationTarget[t]===e}))throw new ReferenceError("Invalid value of `--target` option");return e}},function(e,t,r){"use strict";var n=r(40);Object.defineProperty(t,"__esModule",{value:!0});var o=r(35);t.IdentifierNamesGeneratorSanitizer=function(e){if(!n(o.IdentifierNamesGenerator).some(function(t){return o.IdentifierNamesGenerator[t]===e}))throw new ReferenceError("Invalid value of `--identifier-names-generator` option");return e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanSanitizer=function(e){return"true"===e||"1"===e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArraySanitizer=function(e){if(/,$/.test(e))throw new SyntaxError("Multiple values should be wrapped inside quotes: --option-name 'value1, value2'");return e.split(",").map(function(e){return e.trim()})}},function(e,t){e.exports=require("commander")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Enter="enter",e.Leave="leave"}(t.VisitorDirection||(t.VisitorDirection={}))},function(e,t,r){"use strict";var n=r(1),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a=r(4),i=r(0),s=r(3),c=a.__importStar(r(17)),u=r(80),d=r(9),l=function(){function e(t){n(this,e),this.nodeTransformerFactory=t}return o(e,[{key:"transform",value:function(e,t,r){if(!t.length)return e;for(var n,o=[],a=[],i=t.length,s=0;s"),d="...".concat(i.substring(s,c).replace(/^\s+/,""),"...");throw new Error("".concat(r,"\n").concat(u," ").concat(d))}}]),e}();c.colorError=s.default.red,c.nearestSymbolsCount=10,t.EsprimaFacade=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.EmptySourceCode="Empty source code. Obfuscation canceled...",e.ObfuscationCompleted="Obfuscation completed. Total time: %s sec.",e.ObfuscationStarted="Obfuscation started...",e.RandomGeneratorSeed="Random generator seed: %s...",e.TransformationStage="Transformation stage: %s...",e.Version="Version: %s"}(t.LoggingMessage||(t.LoggingMessage={}))},function(e,t,r){"use strict";var n=r(11),o=r(1),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i,s=r(4),c=r(0),u=r(3),d=s.__importStar(r(47)),l=s.__importStar(r(53)),f=r(88),p=r(31),m=r(12),g=r(87),_=r(9),N=i=function(){function e(t,r,n,a,i){o(this,e),this.transformersRunner=t,this.sourceMapCorrector=r,this.randomGenerator=n,this.logger=a,this.options=i}return a(e,[{key:"obfuscate",value:function(e){var t=Date.now();this.logger.info(f.LoggingMessage.Version,l.version),this.logger.info(f.LoggingMessage.ObfuscationStarted),this.logger.info(f.LoggingMessage.RandomGeneratorSeed,this.randomGenerator.getSeed());var r=this.parseCode(e),n=this.transformAstTree(r),o=this.generateCode(e,n),a=(Date.now()-t)/1e3;return this.logger.success(f.LoggingMessage.ObfuscationCompleted,a),this.getObfuscationResult(o)}},{key:"parseCode",value:function(e){return g.EsprimaFacade.parse(e,{attachComment:!0,loc:this.options.sourceMap})}},{key:"transformAstTree",value:function(e){return!_.NodeGuards.isProgramNode(e)||e.body.length||e.leadingComments?(e=this.runTransformationStage(e,m.TransformationStage.Preparing),this.options.deadCodeInjection&&(e=this.runTransformationStage(e,m.TransformationStage.DeadCodeInjection)),this.options.controlFlowFlattening&&(e=this.runTransformationStage(e,m.TransformationStage.ControlFlowFlattening)),e=this.runTransformationStage(e,m.TransformationStage.Converting),e=this.runTransformationStage(e,m.TransformationStage.Obfuscating),e=this.runTransformationStage(e,m.TransformationStage.Finalizing)):(this.logger.warn(f.LoggingMessage.EmptySourceCode),e)}},{key:"generateCode",value:function(e,t){var r=n({},i.escodegenParams);this.options.sourceMap&&(r.sourceMap="sourceMap",r.sourceContent=e);var o=d.generate(t,n({},r,{format:{compact:this.options.compact}}));return o.map=o.map?o.map.toString():"",o}},{key:"getObfuscationResult",value:function(e){return this.sourceMapCorrector.correct(e.code,e.map)}},{key:"runTransformationStage",value:function(e,t){return this.logger.info(f.LoggingMessage.TransformationStage,t),this.transformersRunner.transform(e,i.transformersList,t)}}]),e}();N.escodegenParams={comment:!0,verbatim:"x-verbatim-property",sourceMapWithCode:!0},N.transformersList=[p.NodeTransformer.BlockStatementControlFlowTransformer,p.NodeTransformer.ClassDeclarationTransformer,p.NodeTransformer.CommentsTransformer,p.NodeTransformer.CustomNodesTransformer,p.NodeTransformer.DeadCodeInjectionTransformer,p.NodeTransformer.EvalCallExpressionTransformer,p.NodeTransformer.FunctionControlFlowTransformer,p.NodeTransformer.CatchClauseTransformer,p.NodeTransformer.FunctionDeclarationTransformer,p.NodeTransformer.FunctionTransformer,p.NodeTransformer.LabeledStatementTransformer,p.NodeTransformer.LiteralTransformer,p.NodeTransformer.MemberExpressionTransformer,p.NodeTransformer.MethodDefinitionTransformer,p.NodeTransformer.ObfuscatingGuardsTransformer,p.NodeTransformer.ObjectExpressionKeysTransformer,p.NodeTransformer.ObjectExpressionTransformer,p.NodeTransformer.ParentificationTransformer,p.NodeTransformer.TemplateLiteralTransformer,p.NodeTransformer.VariableDeclarationTransformer],N=i=s.__decorate([c.injectable(),s.__param(0,c.inject(u.ServiceIdentifiers.ITransformersRunner)),s.__param(1,c.inject(u.ServiceIdentifiers.ISourceMapCorrector)),s.__param(2,c.inject(u.ServiceIdentifiers.IRandomGenerator)),s.__param(3,c.inject(u.ServiceIdentifiers.ILogger)),s.__param(4,c.inject(u.ServiceIdentifiers.IOptions)),s.__metadata("design:paramtypes",[Object,Object,Object,Object,Object])],N),t.JavaScriptObfuscator=N},function(e,t,r){"use strict";var n=r(16),o=r(1),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i=r(4),s=r(0),c=function(){function e(){o(this,e),this.stringsCache=new n}return a(e,[{key:"encode",value:function(e,t){var r="".concat(e,"-").concat(String(t));if(this.stringsCache.has(r))return this.stringsCache.get(r);var n,o,a=new RegExp("[\\s\\S]","g"),i=new RegExp("['\"\\\\\\s]"),s=new RegExp("[\\x00-\\x7F]"),c=e.replace(a,function(e){return t||i.exec(e)?(s.exec(e)?(n="\\x",o="00"):(n="\\u",o="0000"),"".concat(n).concat((o+e.charCodeAt(0).toString(16)).slice(-o.length))):e});return this.stringsCache.set(r,c),c}}]),e}();c=i.__decorate([s.injectable()],c),t.EscapeSequenceEncoder=c},function(e,t){e.exports=require("chance")},function(e,t){e.exports=require("md5")},function(e,t,r){"use strict";var n=r(1),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a=r(4),i=r(0),s=r(3),c=r(54),u=r(27),d=function(){function e(t){n(this,e),this.randomGenerator=t}return o(e,[{key:"btoa",value:function(e){var t="";e=encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode(parseInt("".concat(u.Utils.hexadecimalPrefix).concat(t)))});for(var r,n,o=0,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e.charAt(0|o)||(a="=",o%1);t+=a.charAt(63&r>>8-o%1*8)){if((n=e.charCodeAt(o+=.75))>255)throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");r=r<<8|n}return t}},{key:"hideString",value:function(e,t){var r=this,n=this.randomGenerator.getRandomGenerator().string({length:t,pool:c.RandomGenerator.randomGeneratorPool}).replace(new RegExp("[".concat(e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"]"),"g"),""),o=n.split("");return this.randomGenerator.getRandomGenerator().shuffle(o),[function(e,t){for(var n=-1,o=-1,a="";n=0?t:null}},{key:"getLength",value:function(){return this.storageLength}},{key:"getStorage",value:function(){return this.storage}},{key:"getStorageId",value:function(){return this.storageId}},{key:"mergeWith",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.storage=n(this.storage).concat(n(e.getStorage())),t&&(this.storageId=e.getStorageId())}},{key:"set",value:function(e,t){e===this.storageLength?this.storage.push(t):this.storage.splice(e,0,t),this.storageLength++}}]),e}();i.__decorate([u.initializable(),i.__metadata("design:type",Array)],d.prototype,"storage",void 0),i.__decorate([u.initializable(),i.__metadata("design:type",String)],d.prototype,"storageId",void 0),i.__decorate([s.postConstruct(),i.__metadata("design:type",Function),i.__metadata("design:paramtypes",[]),i.__metadata("design:returntype",void 0)],d.prototype,"initialize",null),d=i.__decorate([s.injectable(),i.__param(0,s.inject(c.ServiceIdentifiers.IRandomGenerator)),i.__param(1,s.inject(c.ServiceIdentifiers.IOptions)),i.__metadata("design:paramtypes",[Object,Object])],d),t.ArrayStorage=d},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(44),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u,d=r(4),l=r(0),f=r(3),p=r(96),m=u=function(e){function t(e,r,a,s){var c;return o(this,t),(c=i(this,(t.__proto__||n(t)).call(this,a,s))).identifierNamesGenerator=e(s),c.arrayUtils=r,c}return c(t,e),a(t,[{key:"initialize",value:function(){s(t.prototype.__proto__||n(t.prototype),"initialize",this).call(this);var e=this.identifierNamesGenerator.generate().slice(0,u.stringArrayNameLength),r=this.identifierNamesGenerator.generate().slice(0,u.stringArrayNameLength),o="".concat(this.options.identifiersPrefix).concat(e),a="".concat(this.options.identifiersPrefix).concat(r);this.storageId="".concat(o,"|").concat(a)}},{key:"rotateArray",value:function(e){this.storage=this.arrayUtils.arrayRotate(this.storage,e)}},{key:"toString",value:function(){return this.storage.map(function(e){return"'".concat(e,"'")}).toString()}}]),t}(p.ArrayStorage);m.stringArrayNameLength=7,d.__decorate([l.postConstruct(),d.__metadata("design:type",Function),d.__metadata("design:paramtypes",[]),d.__metadata("design:returntype",void 0)],m.prototype,"initialize",null),m=u=d.__decorate([l.injectable(),d.__param(0,l.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d.__param(1,l.inject(f.ServiceIdentifiers.IArrayUtils)),d.__param(2,l.inject(f.ServiceIdentifiers.IRandomGenerator)),d.__param(3,l.inject(f.ServiceIdentifiers.IOptions)),d.__metadata("design:paramtypes",[Function,Object,Object,Object])],m),t.StringArrayStorage=m},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(44),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u,d=r(4),l=r(0),f=r(3),p=r(61),m=r(55),g=u=function(e){function t(e,r,a){var s;return o(this,t),(s=i(this,(t.__proto__||n(t)).call(this,r,a))).customNodeGroupFactory=e,s}return c(t,e),a(t,[{key:"initialize",value:function(){var e=this;s(t.prototype.__proto__||n(t.prototype),"initialize",this).call(this),u.customNodeGroupsList.forEach(function(t){var r=e.customNodeGroupFactory(t);r&&e.storage.set(t,r)})}}]),t}(m.MapStorage);g.customNodeGroupsList=[p.CustomNodeGroup.ConsoleOutputCustomNodeGroup,p.CustomNodeGroup.DebugProtectionCustomNodeGroup,p.CustomNodeGroup.DomainLockCustomNodeGroup,p.CustomNodeGroup.SelfDefendingCustomNodeGroup,p.CustomNodeGroup.StringArrayCustomNodeGroup],d.__decorate([l.postConstruct(),d.__metadata("design:type",Function),d.__metadata("design:paramtypes",[]),d.__metadata("design:returntype",void 0)],g.prototype,"initialize",null),g=u=d.__decorate([l.injectable(),d.__param(0,l.inject(f.ServiceIdentifiers.Factory__ICustomNodeGroup)),d.__param(1,l.inject(f.ServiceIdentifiers.IRandomGenerator)),d.__param(2,l.inject(f.ServiceIdentifiers.IOptions)),d.__metadata("design:paramtypes",[Function,Object,Object])],g),t.CustomNodeGroupStorage=g},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(6),i=r(5);Object.defineProperty(t,"__esModule",{value:!0});var s=r(4),c=r(0),u=r(3),d=function(e){function t(e,r){return o(this,t),a(this,(t.__proto__||n(t)).call(this,e,r))}return i(t,e),t}(r(55).MapStorage);d=s.__decorate([c.injectable(),s.__param(0,c.inject(u.ServiceIdentifiers.IRandomGenerator)),s.__param(1,c.inject(u.ServiceIdentifiers.IOptions)),s.__metadata("design:paramtypes",[Object,Object])],d),t.ControlFlowStorage=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),o=r(3),a=r(99),i=r(98),s=r(97);t.storagesModule=new n.ContainerModule(function(e){e(o.ServiceIdentifiers.TCustomNodeGroupStorage).to(i.CustomNodeGroupStorage).inSingletonScope(),e(o.ServiceIdentifiers.TStringArrayStorage).to(s.StringArrayStorage).inSingletonScope(),e(o.ServiceIdentifiers.Newable__TControlFlowStorage).toConstructor(a.ControlFlowStorage),e(o.ServiceIdentifiers.Factory__TControlFlowStorage).toFactory(function(e){return function(){var t=new(e.container.get(o.ServiceIdentifiers.Newable__TControlFlowStorage))(e.container.get(o.ServiceIdentifiers.IRandomGenerator),e.container.get(o.ServiceIdentifiers.IOptions));return t.initialize(),t}})})},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=r(12),f=r(14),p=r(8),m=function(e){function t(e,r){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r))}return s(t,e),a(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case l.TransformationStage.Preparing:return{enter:function(e,r){return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){return p.NodeUtils.parentizeNode(e,t)}}]),t}(f.AbstractNodeTransformer);m=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Object,Object])],m),t.ParentificationTransformer=m},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c,u=r(4),d=r(0),l=r(3),f=r(56),p=r(12),m=r(14),g=c=function(e){function t(e,r,a){var s;return o(this,t),(s=i(this,(t.__proto__||n(t)).call(this,r,a))).obfuscatingGuards=c.obfuscatingGuardsList.map(e),s}return s(t,e),a(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case p.TransformationStage.Preparing:return{enter:function(e,r){return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){var r=this.obfuscatingGuards.every(function(t){return t.check(e)});return e.ignoredNode=!r,e}}]),t}(m.AbstractNodeTransformer);g.obfuscatingGuardsList=[f.ObfuscatingGuard.BlackListNodeGuard,f.ObfuscatingGuard.ConditionalCommentNodeGuard],g=c=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__INodeGuard)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object])],g),t.ObfuscatingGuardsTransformer=g},function(e,t){e.exports=require("js-string-escape")},function(e,t,r){"use strict";var n=r(30),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u,d=r(4),l=r(0),f=r(3),p=d.__importDefault(r(103)),m=r(12),g=r(14),_=r(9),N=r(15),v=r(8),y=u=function(e){function t(e,r){var i;return a(this,t),(i=s(this,(t.__proto__||o(t)).call(this,e,r))).evalRootAstHostNodeSet=new n,i}return c(t,e),i(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case m.TransformationStage.Preparing:return{enter:function(e,r){if(r&&_.NodeGuards.isCallExpressionNode(e)&&_.NodeGuards.isIdentifierNode(e.callee)&&"eval"===e.callee.name)return t.transformNode(e,r)}};case m.TransformationStage.Finalizing:return this.evalRootAstHostNodeSet.size?{leave:function(e,r){if(r&&t.isEvalRootAstHostNode(e))return t.restoreNode(e,r)}}:null;default:return null}}},{key:"transformNode",value:function(e,t){var r=e.arguments[0];if(!r)return e;var n,o=u.extractEvalStringFromCallExpressionArgument(r);if(!o)return e;try{n=v.NodeUtils.convertCodeToStructure(o)}catch(t){return e}var a=N.Nodes.getFunctionExpressionNode([],N.Nodes.getBlockStatementNode(n));return this.evalRootAstHostNodeSet.add(a),a}},{key:"restoreNode",value:function(e,t){var r=e.body.body,n=v.NodeUtils.convertStructureToCode(r);return N.Nodes.getCallExpressionNode(N.Nodes.getIdentifierNode("eval"),[N.Nodes.getLiteralNode(p.default(n))])}},{key:"isEvalRootAstHostNode",value:function(e){return _.NodeGuards.isFunctionExpressionNode(e)&&this.evalRootAstHostNodeSet.has(e)}}],[{key:"extractEvalStringFromCallExpressionArgument",value:function(e){return _.NodeGuards.isLiteralNode(e)?u.extractEvalStringFromLiteralNode(e):_.NodeGuards.isTemplateLiteralNode(e)?u.extractEvalStringFromTemplateLiteralNode(e):null}},{key:"extractEvalStringFromLiteralNode",value:function(e){return"string"==typeof e.value?e.value:null}},{key:"extractEvalStringFromTemplateLiteralNode",value:function(e){var t=e.quasis;return 1!==t.length||e.expressions.length?null:t[0].value.cooked}}]),t}(g.AbstractNodeTransformer);y=u=d.__decorate([l.injectable(),d.__param(0,l.inject(f.ServiceIdentifiers.IRandomGenerator)),d.__param(1,l.inject(f.ServiceIdentifiers.IOptions)),d.__metadata("design:paramtypes",[Object,Object])],y),t.EvalCallExpressionTransformer=y},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=r(23),f=r(12),p=r(14),m=r(9),g=function(e){function t(e,r,a,s,c){var u;return o(this,t),(u=i(this,(t.__proto__||n(t)).call(this,s,c))).stackTraceData=[],u.stackTraceAnalyzer=e,u.obfuscationEventEmitter=r,u.customNodeGroupStorage=a,u}return s(t,e),a(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case f.TransformationStage.Preparing:return{leave:function(e,r){if(m.NodeGuards.isProgramNode(e))return t.analyzeNode(e,r),t.appendCustomNodesBeforeObfuscation(e,r),t.transformNode(e,r)}};case f.TransformationStage.Finalizing:return{leave:function(e,r){m.NodeGuards.isProgramNode(e)&&t.appendCustomNodesAfterObfuscation(e,r)}};default:return null}}},{key:"analyzeNode",value:function(e,t){this.stackTraceData=this.stackTraceAnalyzer.analyze(e)}},{key:"transformNode",value:function(e,t){return e}},{key:"appendCustomNodesBeforeObfuscation",value:function(e,t){var r=this;this.customNodeGroupStorage.getStorage().forEach(function(e){e.initialize(),r.obfuscationEventEmitter.once(e.getAppendEvent(),e.appendCustomNodes.bind(e))}),this.obfuscationEventEmitter.emit(l.ObfuscationEvent.BeforeObfuscation,e,this.stackTraceData)}},{key:"appendCustomNodesAfterObfuscation",value:function(e,t){this.obfuscationEventEmitter.emit(l.ObfuscationEvent.AfterObfuscation,e,this.stackTraceData)}}]),t}(p.AbstractNodeTransformer);g=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.IStackTraceAnalyzer)),c.__param(1,u.inject(d.ServiceIdentifiers.IObfuscationEventEmitter)),c.__param(2,u.inject(d.ServiceIdentifiers.TCustomNodeGroupStorage)),c.__param(3,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(4,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Object,Object,Object,Object,Object])],g),t.CustomNodesTransformer=g},function(e,t,r){"use strict";var n=r(1),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a,i=r(4),s=r(0),c=r(9),u=a=function(){function e(){n(this,e),this.obfuscationAllowedForCurrentNode=!0,this.obfuscationAllowedForNextNode=null}return o(e,[{key:"check",value:function(e){if(this.obfuscationAllowedForNextNode&&(this.obfuscationAllowedForCurrentNode=this.obfuscationAllowedForNextNode,this.obfuscationAllowedForNextNode=null),!c.NodeGuards.isNodeWithComments(e))return this.obfuscationAllowedForCurrentNode;var t=e.leadingComments,r=e.trailingComments;return t&&(this.obfuscationAllowedForCurrentNode=this.checkComments(t)),r&&(this.obfuscationAllowedForNextNode=this.checkComments(r)),this.obfuscationAllowedForCurrentNode}},{key:"checkComments",value:function(e){for(var t=e.length,r=this.obfuscationAllowedForCurrentNode,n=0;n=u.minimumLengthForStringArray&&this.randomGenerator.getMathRandom()<=this.options.stringArrayThreshold}},{key:"getStringArrayHexadecimalIndex",value:function(e,t){if(this.stringLiteralHexadecimalIndexCache.has(e))return{fromCache:!0,index:this.stringLiteralHexadecimalIndexCache.get(e)};var r=_.Utils.decToHex(t),n="".concat(_.Utils.hexadecimalPrefix).concat(r);return this.stringLiteralHexadecimalIndexCache.set(e,n),{fromCache:!1,index:n}}},{key:"getEncodedValue",value:function(e){var t,r=null;switch(this.options.stringArrayEncoding){case p.StringArrayEncoding.Rc4:r=this.randomGenerator.getRandomGenerator().pickone(this.rc4Keys),t=this.cryptUtils.btoa(this.cryptUtils.rc4(e,r));break;case p.StringArrayEncoding.Base64:t=this.cryptUtils.btoa(e);break;default:t=e}return{encodedValue:t,key:r}}},{key:"replaceWithLiteralNode",value:function(e){return g.Nodes.getLiteralNode(this.escapeSequenceEncoder.encode(e,this.options.unicodeEscapeSequence))}},{key:"replaceWithStringArrayCallNode",value:function(e){var t=this.getEncodedValue(e),r=t.encodedValue,n=t.key,o=this.escapeSequenceEncoder.encode(r,this.options.unicodeEscapeSequence),a=this.stringArrayStorage.getLength(),i=this.stringArrayStorage.getStorageId().split("|")[1],s=this.getStringArrayHexadecimalIndex(o,a),c=s.fromCache,d=s.index;c||this.stringArrayStorage.set(a,o);var l=[u.getHexadecimalLiteralNode(d)];n&&l.push(u.getRc4KeyLiteralNode(this.escapeSequenceEncoder.encode(n,this.options.unicodeEscapeSequence)));var f=g.Nodes.getIdentifierNode(i);return f.obfuscatedNode=!0,g.Nodes.getCallExpressionNode(f,l)}}],[{key:"getHexadecimalLiteralNode",value:function(e){var t=g.Nodes.getLiteralNode(e);return t.obfuscatedNode=!0,t}},{key:"getRc4KeyLiteralNode",value:function(e){var t=g.Nodes.getLiteralNode(e);return t.obfuscatedNode=!0,t}}]),t}(m.AbstractObfuscatingReplacer);N.minimumLengthForStringArray=3,N.rc4KeyLength=4,N.rc4KeysCount=50,N=u=d.__decorate([l.injectable(),d.__param(0,l.inject(f.ServiceIdentifiers.TStringArrayStorage)),d.__param(1,l.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d.__param(2,l.inject(f.ServiceIdentifiers.IRandomGenerator)),d.__param(3,l.inject(f.ServiceIdentifiers.ICryptUtils)),d.__param(4,l.inject(f.ServiceIdentifiers.IOptions)),d.__metadata("design:paramtypes",[Object,Object,Object,Object,Object])],N),t.StringLiteralObfuscatingReplacer=N},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c,u=r(4),d=r(0),l=r(3),f=r(19),p=r(12),m=r(14),g=r(9),_=c=function(e){function t(e,r){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r))}return s(t,e),a(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case p.TransformationStage.Obfuscating:return{enter:function(e,r){if(r&&g.NodeGuards.isObjectExpressionNode(e))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){return e.properties.forEach(function(e){e.computed||(e.shorthand&&(e.shorthand=!1),g.NodeGuards.isIdentifierNode(e.key)&&(e.key=c.transformIdentifierPropertyKey(e.key)))}),e}}],[{key:"transformIdentifierPropertyKey",value:function(e){return{type:f.NodeType.Literal,value:e.name,raw:"'".concat(e.name,"'")}}}]),t}(m.AbstractNodeTransformer);_=c=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Object,Object])],_),t.ObjectExpressionTransformer=_},function(e,t,r){"use strict";var n=r(16),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=r(38),p=r(15),m=r(27),g=function(e){function t(e){var r;return a(this,t),(r=s(this,(t.__proto__||o(t)).call(this,e))).numberLiteralCache=new n,r}return c(t,e),i(t,[{key:"replace",value:function(e){var t;return this.numberLiteralCache.has(e)?t=this.numberLiteralCache.get(e):(t=m.Utils.isCeilNumber(e)?"".concat(m.Utils.hexadecimalPrefix).concat(m.Utils.decToHex(e)):String(e),this.numberLiteralCache.set(e,t)),p.Nodes.getLiteralNode(e,t)}}]),t}(f.AbstractObfuscatingReplacer);g=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Object])],g),t.NumberLiteralObfuscatingReplacer=g},function(e,t,r){"use strict";var n=r(66),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=r(57),p=r(12),m=r(14),g=r(9),_=function(e){function t(e,r,n){var i;return a(this,t),(i=s(this,(t.__proto__||o(t)).call(this,r,n))).literalObfuscatingReplacerFactory=e,i}return c(t,e),i(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case p.TransformationStage.Obfuscating:return{enter:function(e,r){if(r&&g.NodeGuards.isLiteralNode(e)&&!e.obfuscatedNode)return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){if(t&&g.NodeGuards.isPropertyNode(t)&&t.key===e)return e;switch(n(e.value)){case"boolean":return this.literalObfuscatingReplacerFactory(f.LiteralObfuscatingReplacer.BooleanLiteralObfuscatingReplacer).replace(e.value);case"number":return this.literalObfuscatingReplacerFactory(f.LiteralObfuscatingReplacer.NumberLiteralObfuscatingReplacer).replace(e.value);case"string":return this.literalObfuscatingReplacerFactory(f.LiteralObfuscatingReplacer.StringLiteralObfuscatingReplacer).replace(e.value);default:return e}}}]),t}(m.AbstractNodeTransformer);_=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IObfuscatingReplacer)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object])],_),t.LiteralTransformer=_},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=c.__importStar(r(17)),f=r(22),p=r(12),m=r(14),g=r(9),_=function(e){function t(e,r,a){var s;return o(this,t),(s=i(this,(t.__proto__||n(t)).call(this,r,a))).identifierObfuscatingReplacer=e(f.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),s}return s(t,e),a(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case p.TransformationStage.Obfuscating:return{enter:function(e,r){if(r&&g.NodeGuards.isLabeledStatementNode(e))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){var r=this.nodeIdentifier++;return this.storeLabeledStatementName(e,r),this.replaceLabeledStatementName(e,r),e}},{key:"storeLabeledStatementName",value:function(e,t){this.identifierObfuscatingReplacer.storeLocalName(e.label.name,t)}},{key:"replaceLabeledStatementName",value:function(e,t){var r=this;l.replace(e,{enter:function(e,n){if(n&&g.NodeGuards.isLabelIdentifierNode(e,n)){var o=r.identifierObfuscatingReplacer.replace(e.name,t);e.name=o.name}}})}}]),t}(m.AbstractNodeTransformer);_=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],_),t.LabeledStatementTransformer=_},function(e,t,r){"use strict";var n=r(30),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=u.__importStar(r(17)),p=r(22),m=r(12),g=r(14),_=r(9),N=function(e){function t(e,r,n){var i;return a(this,t),(i=s(this,(t.__proto__||o(t)).call(this,r,n))).identifierObfuscatingReplacer=e(p.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),i}return c(t,e),i(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case m.TransformationStage.Obfuscating:return{enter:function(e,r){if(r&&(_.NodeGuards.isFunctionDeclarationNode(e)||_.NodeGuards.isFunctionExpressionNode(e)||_.NodeGuards.isArrowFunctionExpressionNode(e)))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){var r=this.nodeIdentifier++;return this.storeFunctionParams(e,r),this.replaceFunctionParams(e,r),e}},{key:"storeFunctionParams",value:function(e,t){var r=this;e.params.forEach(function(e){if(_.NodeGuards.isObjectPatternNode(e))return f.VisitorOption.Skip;f.traverse(e,{enter:function(e){if(_.NodeGuards.isAssignmentPatternNode(e)&&_.NodeGuards.isIdentifierNode(e.left))return r.identifierObfuscatingReplacer.storeLocalName(e.left.name,t),f.VisitorOption.Skip;_.NodeGuards.isIdentifierNode(e)&&r.identifierObfuscatingReplacer.storeLocalName(e.name,t)}})})}},{key:"addIdentifiersToIgnoredIdentifierNamesSet",value:function(e,t){e.forEach(function(e){_.NodeGuards.isIdentifierNode(e.key)&&t.add(e.key.name)})}},{key:"replaceFunctionParams",value:function(e,t){var r=this,o=new n,a={enter:function(e,n){if(_.NodeGuards.isObjectPatternNode(e)&&r.addIdentifiersToIgnoredIdentifierNamesSet(e.properties,o),n&&_.NodeGuards.isReplaceableIdentifierNode(e,n)&&!o.has(e.name)){var a=r.identifierObfuscatingReplacer.replace(e.name,t).name;e.name!==a&&(e.name=a,e.obfuscatedNode=!0)}}};e.params.forEach(function(e){return f.replace(e,a)}),f.replace(e.body,a)}}]),t}(g.AbstractNodeTransformer);N=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object])],N),t.FunctionTransformer=N},function(e,t,r){"use strict";var n=r(16),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=u.__importStar(r(17)),p=r(22),m=r(19),g=r(12),_=r(14),N=r(9),v=r(8),y=function(e){function t(e,r,i){var c;return a(this,t),(c=s(this,(t.__proto__||o(t)).call(this,r,i))).replaceableIdentifiers=new n,c.identifierObfuscatingReplacer=e(p.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),c}return c(t,e),i(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case g.TransformationStage.Obfuscating:return{enter:function(e,r){if(r&&N.NodeGuards.isFunctionDeclarationNode(e))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){var r=this.nodeIdentifier++,n=v.NodeUtils.getBlockScopesOfNode(e)[0],o=n.type===m.NodeType.Program;return!this.options.renameGlobals&&o?e:(this.storeFunctionName(e,o,r),this.replaceableIdentifiers.has(n)?this.replaceScopeCachedIdentifiers(e,n,r):this.replaceScopeIdentifiers(n,r),e)}},{key:"storeFunctionName",value:function(e,t,r){t?this.identifierObfuscatingReplacer.storeGlobalName(e.id.name,r):this.identifierObfuscatingReplacer.storeLocalName(e.id.name,r)}},{key:"replaceScopeCachedIdentifiers",value:function(e,t,r){var n=this.replaceableIdentifiers.get(t);if(n){var o=n.get(e.id.name);if(o)for(var a=o.length,i=0;i=0);return"a".concat(n(r))},r=t(e);return c.validateMangledName(r)||(r=c.generateNewMangledName(r)),r}},{key:"validateMangledName",value:function(e){return!c.reservedNames.includes(e)}}]),t}(f.AbstractIdentifierNamesGenerator);p.initMangledNameCharacter="9",p.nameSequence="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),p.reservedNames=["byte","case","char","do","else","enum","eval","for","goto","if","in","int","let","long","new","null","this","true","try","var","void","with"],p=c=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Object,Object])],p),t.MangledIdentifierNamesGenerator=p},function(e,t,r){"use strict";var n=r(30),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u,d=r(4),l=r(0),f=r(3),p=r(58),m=r(27),g=u=function(e){function t(e,r){var i;return a(this,t),(i=s(this,(t.__proto__||o(t)).call(this,e,r))).randomVariableNameSet=new n,i}return c(t,e),i(t,[{key:"generate",value:function(){var e=this.randomGenerator.getRandomInteger(1e4,99999999),t=m.Utils.decToHex(e).substr(0,u.baseIdentifierNameLength),r="_".concat(m.Utils.hexadecimalPrefix).concat(t);return this.randomVariableNameSet.has(r)?this.generate():(this.randomVariableNameSet.add(r),r)}},{key:"generateWithPrefix",value:function(){var e=this.generate();return"".concat(this.options.identifiersPrefix).concat(e).replace("__","_")}}]),t}(p.AbstractIdentifierNamesGenerator);g.baseIdentifierNameLength=6,g=u=d.__decorate([l.injectable(),d.__param(0,l.inject(f.ServiceIdentifiers.IRandomGenerator)),d.__param(1,l.inject(f.ServiceIdentifiers.IOptions)),d.__metadata("design:paramtypes",[Object,Object])],g),t.HexadecimalIdentifierNamesGenerator=g},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),o=r(3),a=r(35),i=r(140),s=r(139);t.generatorsModule=new n.ContainerModule(function(e){e(o.ServiceIdentifiers.IIdentifierNamesGenerator).to(i.HexadecimalIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(a.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator),e(o.ServiceIdentifiers.IIdentifierNamesGenerator).to(s.MangledIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(a.IdentifierNamesGenerator.MangledIdentifierNamesGenerator),e(o.ServiceIdentifiers.Factory__IIdentifierNamesGenerator).toFactory(function(e){var t=null;return function(r){if(t)return t;var n;switch(r.identifierNamesGenerator){case a.IdentifierNamesGenerator.MangledIdentifierNamesGenerator:n=e.container.getNamed(o.ServiceIdentifiers.IIdentifierNamesGenerator,a.IdentifierNamesGenerator.MangledIdentifierNamesGenerator);break;case a.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator:default:n=e.container.getNamed(o.ServiceIdentifiers.IIdentifierNamesGenerator,a.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator)}return t=n,n}})})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);t.finalizingTransformersModule=new n.ContainerModule(function(e){})},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=r(10),f=r(13),p=r(15),m=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e){this.literalValue=e}},{key:"getNodeStructure",value:function(){return[p.Nodes.getExpressionStatementNode(p.Nodes.getLiteralNode(this.literalValue))]}}]),t}(f.AbstractCustomNode);c.__decorate([l.initializable(),c.__metadata("design:type",String)],m.prototype,"literalValue",void 0),m=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],m),t.StringLiteralNode=m},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=r(10),f=r(13),p=r(15),m=r(8),g=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e,t){this.controlFlowStorageName=e,this.controlFlowStorageKey=t}},{key:"getNodeStructure",value:function(){var e=p.Nodes.getExpressionStatementNode(p.Nodes.getMemberExpressionNode(p.Nodes.getIdentifierNode(this.controlFlowStorageName),p.Nodes.getIdentifierNode(this.controlFlowStorageKey)));return m.NodeUtils.parentize(e),[e]}}]),t}(f.AbstractCustomNode);c.__decorate([l.initializable(),c.__metadata("design:type",String)],g.prototype,"controlFlowStorageKey",void 0),c.__decorate([l.initializable(),c.__metadata("design:type",String)],g.prototype,"controlFlowStorageName",void 0),g=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],g),t.StringLiteralControlFlowStorageCallNode=g},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.False="![]",e.True="!![]",e.a='(false+"")[1]',e.b='([]["entries"]()+"")[2]',e.c='([]["fill"]+"")[3]',e.d='(undefined+"")[2]',e.e='(true+"")[3]',e.f='(false+"")[0]',e.g="(false+[0]+String)[20]",e.h='(+(101))["toString"](21)[1]',e.i="([false]+undefined)[10]",e.j='([]["entries"]()+"")[3]',e.k='(+(20))["toString"](21)',e.l='(false+"")[2]',e.m='(Number+"")[11]',e.n='(undefined+"")[1]',e.o='(true+[]["fill"])[10]',e.p='(+(211))["toString"](31)[1]',e.q='(+(212))["toString"](31)[1]',e.r='(true+"")[1]',e.s='(false+"")[3]',e.t='(true+"")[0]',e.u='(undefined+"")[0]',e.v='(+(31))["toString"](32)',e.w='(+(32))["toString"](33)',e.x='(+(101))["toString"](34)[1]',e.y="(NaN+[Infinity])[10]",e.z='(+(35))["toString"](36)',e.A="(+[]+Array)[10]",e.B="(+[]+Boolean)[10]",e.C='Function("return escape")()(("")["italics"]())[2]',e.D='Function("return escape")()([]["fill"])["slice"]("-1")',e.E='(RegExp+"")[12]',e.F="(+[]+Function)[10]",e.G='(false+Function("return Date")()())[30]',e.H="'H'",e.I='(Infinity+"")[0]',e.J="'J'",e.K="'K'",e.L="'L'",e.M='(true+Function("return Date")()())[30]',e.N='(NaN+"")[0]',e.O='(NaN+Function("return{}")())[11]',e.P="'P'",e.Q="'Q'",e.R="(+[]+RegExp)[10]",e.S="(+[]+String)[10]",e.T='(NaN+Function("return Date")()())[30]',e.U='(NaN+Function("return{}")()["toString"]["call"]())[11]',e.V="'V'",e.W="'W'",e.X="'X'",e.Y="'Y'",e.Z="'Z'"}(t.JSFuck||(t.JSFuck={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRotateFunctionTemplate=function(){return"\n (function (array, {timesName}) {\n var {whileFunctionName} = function (times) {\n while (--times) {\n array['push'](array['shift']());\n }\n };\n \n {code}\n })({stringArrayName}, 0x{stringArrayRotateValue});\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e){return"\n var selfDefendingFunc = function () {\n var object = {\n data: {\n key: 'cookie',\n value: 'timeout'\n },\n setCookie: function (options, name, value, document) {\n document = document || {};\n \n var updatedCookie = name + \"=\" + value;\n\n var i = 0;\n \n for (var i = 0, len = options.length; i < len; i++) {\n var propName = options[i];\n \n updatedCookie += \"; \" + propName;\n \n var propValue = options[propName];\n \n options.push(propValue);\n len = options.length;\n \n if (propValue !== true) {\n updatedCookie += \"=\" + propValue;\n }\n }\n\n document['cookie'] = updatedCookie;\n },\n removeCookie: function(){return 'dev';},\n getCookie: function (document, name) {\n document = document || function (value) { return value };\n var matches = document(new RegExp(\n \"(?:^|; )\" + name.replace(/([.$?*|{}()[]\\/+^])/g, '\\$1') + \"=([^;]*)\"\n ));\n \n var func = function (param1, param2) {\n param1(++param2);\n };\n \n func({whileFunctionName}, {timesName});\n \n return matches ? decodeURIComponent(matches[1]) : undefined;\n }\n };\n \n var test1 = function () {\n var regExp = new RegExp('".concat(e.encode("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}",!0),"');\n \n return regExp.test(object.removeCookie.toString());\n };\n \n object['updateCookie'] = test1;\n \n var cookie = '';\n var result = object['updateCookie']();\n \n if (!result) {\n object['setCookie'](['*'], 'counter', 1);\n } else if (result) {\n cookie = object['getCookie'](null, 'counter');\n } else {\n object['removeCookie']();\n }\n };\n \n selfDefendingFunc();\n ")}},function(e,t,r){"use strict";var n=r(11),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=u.__importDefault(r(18)),p=r(10),m=r(39),g=r(147),_=r(146),N=r(13),v=r(32),y=r(8),h=r(27),b=function(e){function t(e,r,n,i){var c;return a(this,t),(c=s(this,(t.__proto__||o(t)).call(this,e,r,i))).escapeSequenceEncoder=n,c}return c(t,e),i(t,[{key:"initialize",value:function(e,t){this.stringArrayName=e,this.stringArrayRotateValue=t}},{key:"getNodeStructure",value:function(){return y.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){var e=this.identifierNamesGenerator.generate(),t=this.identifierNamesGenerator.generate(),r="";return r=this.options.selfDefending?f.default(g.SelfDefendingTemplate(this.escapeSequenceEncoder),{timesName:e,whileFunctionName:t}):"".concat(t,"(++").concat(e,")"),v.JavaScriptObfuscator.obfuscate(f.default(_.StringArrayRotateFunctionTemplate(),{code:r,timesName:e,stringArrayName:this.stringArrayName,stringArrayRotateValue:h.Utils.decToHex(this.stringArrayRotateValue),whileFunctionName:t}),n({},m.NO_ADDITIONAL_NODES_PRESET,{identifierNamesGenerator:this.options.identifierNamesGenerator,seed:this.options.seed})).getObfuscatedCode()}}]),t}(N.AbstractCustomNode);u.__decorate([p.initializable(),u.__metadata("design:type",String)],b.prototype,"stringArrayName",void 0),u.__decorate([p.initializable(),u.__metadata("design:type",Number)],b.prototype,"stringArrayRotateValue",void 0),b=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IEscapeSequenceEncoder)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object,Object])],b),t.StringArrayRotateFunctionNode=b},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayTemplate=function(){return"\n var {stringArrayName} = [{stringArray}];\n "}},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(44),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=u.__importDefault(r(18)),p=r(10),m=r(149),g=r(13),_=r(8),N=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return c(t,e),a(t,[{key:"initialize",value:function(e,t,r){this.stringArrayStorage=e,this.stringArrayName=t,this.stringArrayRotateValue=r}},{key:"getNode",value:function(){return this.stringArrayStorage.rotateArray(this.stringArrayRotateValue),s(t.prototype.__proto__||n(t.prototype),"getNode",this).call(this)}},{key:"getNodeStructure",value:function(){return _.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){return f.default(m.StringArrayTemplate(),{stringArrayName:this.stringArrayName,stringArray:this.stringArrayStorage.toString()})}}]),t}(g.AbstractCustomNode);u.__decorate([p.initializable(),u.__metadata("design:type",Object)],N.prototype,"stringArrayStorage",void 0),u.__decorate([p.initializable(),u.__metadata("design:type",String)],N.prototype,"stringArrayName",void 0),u.__decorate([p.initializable(),u.__metadata("design:type",Number)],N.prototype,"stringArrayRotateValue",void 0),N=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object])],N),t.StringArrayNode=N},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRc4DecodeNodeTemplate=function(e){var t=e.getRandomString(6),r=e.getRandomString(6),n=e.getRandomString(6),o=e.getRandomString(6);return"\n if ({stringArrayCallsWrapperName}.".concat(t," === undefined) {\n {atobPolyfill}\n \n {rc4Polyfill}\n {stringArrayCallsWrapperName}.").concat(r," = rc4;\n \n {stringArrayCallsWrapperName}.").concat(n," = {};\n \n {stringArrayCallsWrapperName}.").concat(t," = true;\n }\n \n var cachedValue = {stringArrayCallsWrapperName}.").concat(n,"[index];\n\n if (cachedValue === undefined) {\n if ({stringArrayCallsWrapperName}.").concat(o," === undefined) {\n {selfDefendingCode}\n \n {stringArrayCallsWrapperName}.").concat(o," = true;\n }\n \n value = {stringArrayCallsWrapperName}.").concat(r,"(value, key);\n {stringArrayCallsWrapperName}.").concat(n,"[index] = value;\n } else {\n value = cachedValue;\n }\n ")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayCallsWrapperTemplate=function(){return"\n var {stringArrayCallsWrapperName} = function (index, key) {\n index = index - 0;\n \n var value = {stringArrayName}[index];\n \n {decodeNodeTemplate}\n \n return value;\n };\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayBase64DecodeNodeTemplate=function(e){var t=e.getRandomString(6),r=e.getRandomString(6),n=e.getRandomString(6);return"\n if ({stringArrayCallsWrapperName}.".concat(t," === undefined) {\n {atobPolyfill}\n \n {stringArrayCallsWrapperName}.").concat(r," = function (str) {\n var string = atob(str);\n var newStringChars = [];\n \n for (var i = 0, length = string.length; i < length; i++) {\n newStringChars += '%' + ('00' + string.charCodeAt(i).toString(16)).slice(-2);\n }\n \n return decodeURIComponent(newStringChars);\n };\n \n {stringArrayCallsWrapperName}.").concat(n," = {};\n \n {stringArrayCallsWrapperName}.").concat(t," = true;\n }\n \n var cachedValue = {stringArrayCallsWrapperName}.").concat(n,"[index];\n \n if (cachedValue === undefined) {\n {selfDefendingCode}\n \n value = {stringArrayCallsWrapperName}.").concat(r,"(value);\n {stringArrayCallsWrapperName}.").concat(n,"[index] = value;\n } else {\n value = cachedValue;\n }\n ")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e,t){var r=e.getRandomString(6),n=e.getRandomString(6),o=e.getRandomString(6),a=e.getRandomString(6),i=e.getRandomString(6),s=e.getRandomString(6),c=e.getRandomString(6),u=e.getRandomString(6),d=e.getRandomString(6);return"\n var StatesClass = function (".concat(r,") {\n this.").concat(r," = ").concat(r,";\n this.").concat(n," = [1, 0, 0];\n this.").concat(o," = function(){return 'newState';};\n this.").concat(a," = '").concat(t.encode("\\w+ *\\(\\) *{\\w+ *",!0),"';\n this.").concat(i," = '").concat(t.encode("['|\"].+['|\"];? *}",!0),"';\n };\n \n StatesClass.prototype.").concat(s," = function () {\n var regExp = new RegExp(this.").concat(a," + this.").concat(i,");\n var expression = regExp.test(this.").concat(o,".toString())\n ? --this.").concat(n,"[1]\n : --this.").concat(n,"[0];\n \n return this.").concat(c,"(expression);\n };\n \n StatesClass.prototype.").concat(c," = function (").concat(d,") {\n if (!Boolean(~").concat(d,")) {\n return ").concat(d,";\n }\n \n return this.").concat(u,"(this.").concat(r,");\n };\n\n StatesClass.prototype.").concat(u," = function (").concat(r,") {\n for (var i = 0, len = this.").concat(n,".length; i < len; i++) {\n this.").concat(n,".push(Math.round(Math.random()));\n len = this.").concat(n,".length;\n }\n \n return ").concat(r,"(this.").concat(n,"[0]);\n };\n\n new StatesClass({stringArrayCallsWrapperName}).").concat(s,"();\n ")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Rc4Template=function(){return"\n var rc4 = function (str, key) {\n var s = [], j = 0, x, res = '', newStr = '';\n \n str = atob(str);\n \n for (var k = 0, length = str.length; k < length; k++) {\n newStr += '%' + ('00' + str.charCodeAt(k).toString(16)).slice(-2);\n }\n \n str = decodeURIComponent(newStr);\n \t \n\t for (var i = 0; i < 256; i++) {\n s[i] = i;\n }\n \n for (i = 0; i < 256; i++) {\n j = (j + s[i] + key.charCodeAt(i % key.length)) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n }\n \n i = 0;\n j = 0;\n \n for (var y = 0; y < str.length; y++) {\n i = (i + 1) % 256;\n j = (j + s[i]) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n res += String.fromCharCode(str.charCodeAt(y) ^ s[(s[i] + s[j]) % 256]);\n }\n \n return res;\n }\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AtobTemplate=function(){return"\n (function () {\n {globalVariableTemplate}\n \n var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\n that.atob || (\n that.atob = function(input) {\n var str = String(input).replace(/=+$/, '');\n for (\n var bc = 0, bs, buffer, idx = 0, output = '';\n buffer = str.charAt(idx++);\n ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,\n bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0\n ) {\n buffer = chars.indexOf(buffer);\n }\n return output;\n });\n })();\n "}},function(e,t,r){"use strict";var n=r(11),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=u.__importDefault(r(18)),p=r(20),m=r(33),g=r(10),_=r(39),N=r(156),v=r(45),y=r(155),h=r(154),b=r(153),S=r(152),I=r(151),C=r(13),O=r(32),j=r(8),F=function(e){function t(e,r,n,i){var c;return a(this,t),(c=s(this,(t.__proto__||o(t)).call(this,e,r,i))).escapeSequenceEncoder=n,c}return c(t,e),i(t,[{key:"initialize",value:function(e,t){this.stringArrayName=e,this.stringArrayCallsWrapperName=t}},{key:"getNodeStructure",value:function(){return j.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){var e=this.getDecodeStringArrayTemplate();return O.JavaScriptObfuscator.obfuscate(f.default(S.StringArrayCallsWrapperTemplate(),{decodeNodeTemplate:e,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName,stringArrayName:this.stringArrayName}),n({},_.NO_ADDITIONAL_NODES_PRESET,{identifierNamesGenerator:this.options.identifierNamesGenerator,seed:this.options.seed})).getObfuscatedCode()}},{key:"getDecodeStringArrayTemplate",value:function(){var e=this.options.target!==p.ObfuscationTarget.Extension?this.getGlobalVariableTemplate():v.GlobalVariableNoEvalTemplate(),t=f.default(N.AtobTemplate(),{globalVariableTemplate:e}),r="",n="";switch(this.options.selfDefending&&(n=f.default(h.SelfDefendingTemplate(this.randomGenerator,this.escapeSequenceEncoder),{stringArrayCallsWrapperName:this.stringArrayCallsWrapperName,stringArrayName:this.stringArrayName})),this.options.stringArrayEncoding){case m.StringArrayEncoding.Rc4:r=f.default(I.StringArrayRc4DecodeNodeTemplate(this.randomGenerator),{atobPolyfill:t,rc4Polyfill:y.Rc4Template(),selfDefendingCode:n,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName});break;case m.StringArrayEncoding.Base64:r=f.default(b.StringArrayBase64DecodeNodeTemplate(this.randomGenerator),{atobPolyfill:t,selfDefendingCode:n,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName})}return r}}]),t}(C.AbstractCustomNode);u.__decorate([g.initializable(),u.__metadata("design:type",String)],F.prototype,"stringArrayName",void 0),u.__decorate([g.initializable(),u.__metadata("design:type",String)],F.prototype,"stringArrayCallsWrapperName",void 0),F=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IEscapeSequenceEncoder)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object,Object])],F),t.StringArrayCallsWrapper=F},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e){return"\n var {selfDefendingFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n var func1 = function(){return 'dev';},\n func2 = function () {\n return 'window';\n };\n \n var test1 = function () {\n var regExp = new RegExp('".concat(e.encode("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}",!0),"');\n \n return !regExp.test(func1.toString());\n };\n \n var test2 = function () {\n var regExp = new RegExp('").concat(e.encode("(\\\\[x|u](\\w){2,4})+",!0),"');\n \n return regExp.test(func2.toString());\n };\n \n var recursiveFunc1 = function (string) {\n var i = ~-1 >> 1 + 255 % 0;\n \n if (string.indexOf('i' === i)) {\n recursiveFunc2(string)\n }\n };\n \n var recursiveFunc2 = function (string) {\n var i = ~-4 >> 1 + 255 % 0;\n \n if (string.indexOf((true+\"\")[3]) !== i) {\n recursiveFunc1(string)\n }\n };\n \n if (!test1()) {\n if (!test2()) {\n recursiveFunc1('indеxOf');\n } else {\n recursiveFunc1('indexOf');\n }\n } else {\n recursiveFunc1('indеxOf');\n }\n })\n \n {selfDefendingFunctionName}();\n ")}},function(e,t,r){"use strict";var n=r(11),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=u.__importDefault(r(18)),p=r(10),m=r(39),g=r(158),_=r(13),N=r(32),v=r(8),y=function(e){function t(e,r,n,i){var c;return a(this,t),(c=s(this,(t.__proto__||o(t)).call(this,e,r,i))).escapeSequenceEncoder=n,c}return c(t,e),i(t,[{key:"initialize",value:function(e){this.callsControllerFunctionName=e}},{key:"getNodeStructure",value:function(){return v.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){return N.JavaScriptObfuscator.obfuscate(f.default(g.SelfDefendingTemplate(this.escapeSequenceEncoder),{selfDefendingFunctionName:this.identifierNamesGenerator.generate(),singleNodeCallControllerFunctionName:this.callsControllerFunctionName}),n({},m.NO_ADDITIONAL_NODES_PRESET,{identifierNamesGenerator:this.options.identifierNamesGenerator,seed:this.options.seed,unicodeEscapeSequence:!0})).getObfuscatedCode()}}]),t}(_.AbstractCustomNode);u.__decorate([p.initializable(),u.__metadata("design:type",String)],y.prototype,"callsControllerFunctionName",void 0),y=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IEscapeSequenceEncoder)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object,Object])],y),t.SelfDefendingUnicodeNode=y},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SingleNodeCallControllerTemplate=function(){return"\n var {singleNodeCallControllerFunctionName} = (function(){\n var firstCall = true;\n \n return function (context, fn){\n var rfn = firstCall ? function(){\n if(fn){\n var res = fn.apply(context, arguments);\n fn = null;\n return res;\n }\n } : function(){}\n \n firstCall = false;\n \n return rfn;\n }\n })();\n "}},function(e,t,r){"use strict";var n=r(11),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=u.__importDefault(r(18)),p=r(23),m=r(10),g=r(160),_=r(39),N=r(13),v=r(32),y=r(8),h=function(e){function t(e,r,n){return a(this,t),s(this,(t.__proto__||o(t)).call(this,e,r,n))}return c(t,e),i(t,[{key:"initialize",value:function(e,t){this.appendEvent=e,this.callsControllerFunctionName=t}},{key:"getNodeStructure",value:function(){return y.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){return this.appendEvent===p.ObfuscationEvent.AfterObfuscation?v.JavaScriptObfuscator.obfuscate(f.default(g.SingleNodeCallControllerTemplate(),{singleNodeCallControllerFunctionName:this.callsControllerFunctionName}),n({},_.NO_ADDITIONAL_NODES_PRESET,{identifierNamesGenerator:this.options.identifierNamesGenerator,seed:this.options.seed})).getObfuscatedCode():f.default(g.SingleNodeCallControllerTemplate(),{singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}}]),t}(N.AbstractCustomNode);u.__decorate([m.initializable(),u.__metadata("design:type",String)],h.prototype,"callsControllerFunctionName",void 0),u.__decorate([m.initializable(),u.__metadata("design:type",String)],h.prototype,"appendEvent",void 0),h=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object])],h),t.NodeCallsControllerFunctionNode=h},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=r(10),f=r(13),p=r(15),m=r(8),g=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e){this.operator=e}},{key:"getNodeStructure",value:function(){var e=p.Nodes.getExpressionStatementNode(p.Nodes.getFunctionExpressionNode([p.Nodes.getIdentifierNode("x"),p.Nodes.getIdentifierNode("y")],p.Nodes.getBlockStatementNode([p.Nodes.getReturnStatementNode(p.Nodes.getLogicalExpressionNode(this.operator,p.Nodes.getIdentifierNode("x"),p.Nodes.getIdentifierNode("y")))])));return m.NodeUtils.parentize(e),[e]}}]),t}(f.AbstractCustomNode);c.__decorate([l.initializable(),c.__metadata("design:type",String)],g.prototype,"operator",void 0),g=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],g),t.LogicalExpressionFunctionNode=g},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=r(10),f=r(13),p=r(15),m=r(8),g=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e,t,r,n){this.controlFlowStorageName=e,this.controlFlowStorageKey=t,this.leftValue=r,this.rightValue=n}},{key:"getNodeStructure",value:function(){var e=p.Nodes.getExpressionStatementNode(p.Nodes.getCallExpressionNode(p.Nodes.getMemberExpressionNode(p.Nodes.getIdentifierNode(this.controlFlowStorageName),p.Nodes.getIdentifierNode(this.controlFlowStorageKey)),[this.leftValue,this.rightValue]));return m.NodeUtils.parentize(e),[e]}}]),t}(f.AbstractCustomNode);c.__decorate([l.initializable(),c.__metadata("design:type",String)],g.prototype,"controlFlowStorageKey",void 0),c.__decorate([l.initializable(),c.__metadata("design:type",String)],g.prototype,"controlFlowStorageName",void 0),c.__decorate([l.initializable(),c.__metadata("design:type",Object)],g.prototype,"leftValue",void 0),c.__decorate([l.initializable(),c.__metadata("design:type",Object)],g.prototype,"rightValue",void 0),g=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],g),t.ExpressionWithOperatorControlFlowStorageCallNode=g},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DomainLockNodeTemplate=function(){return'\n var {domainLockFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n \n {globalVariableTemplate}\n \n var func = function () {\n return {\n key: \'item\',\n value: \'attribute\',\n getAttribute: function () {\n for (var i = 0; i < 1000; i--) {\n var isPositive = i > 0;\n \n switch (isPositive) {\n case true:\n return this.item + \'_\' + this.value + \'_\' + i;\n default:\n this.item + \'_\' + this.value;\n }\n }\n }()\n };\n };\n \n var regExp = new RegExp("[{diff}]", "g");\n var domains = "{domains}".replace(regExp, "").split(";");\n var document;\n var domain;\n \n for (var d in that) {\n if (d.length == 8 && d.charCodeAt(7) == 116 && d.charCodeAt(5) == 101 && d.charCodeAt(3) == 117 && d.charCodeAt(0) == 100) {\n document = d;\n \n break;\n }\n }\n\n for (var d1 in that[document]) {\n if (d1.length == 6 && d1.charCodeAt(5) == 110 && d1.charCodeAt(0) == 100) {\n domain = d1;\n \n break;\n }\n }\n \n if ((!document && !domain) || (!that[document] && !that[document][domain])) {\n return;\n }\n \n var currentDomain = that[document][domain];\n\n var ok = false;\n \n for (var i = 0; i < domains.length; i++) {\n var domain = domains[i];\n var position = currentDomain.length - domain.length;\n var lastIndex = currentDomain.indexOf(domain, position);\n var endsWith = lastIndex !== -1 && lastIndex === position;\n \n if (endsWith) {\n if (currentDomain.length == domain.length || domain.indexOf(".") === 0) {\n ok = true;\n }\n \n break;\n }\n }\n \n if (!ok) {\n data;\n } else {\n return;\n }\n \n func();\n });\n\n {domainLockFunctionName}();\n '}},function(e,t,r){"use strict";var n=r(29),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=u.__importDefault(r(18)),p=r(20),m=r(10),g=r(164),_=r(45),N=r(13),v=r(8),y=function(e){function t(e,r,n,i){var c;return a(this,t),(c=s(this,(t.__proto__||o(t)).call(this,e,r,i))).cryptUtils=n,c}return c(t,e),i(t,[{key:"initialize",value:function(e){this.callsControllerFunctionName=e}},{key:"getNodeStructure",value:function(){return v.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){var e=this.options.domainLock.join(";"),t=this.cryptUtils.hideString(e,3*e.length),r=n(t,2),o=r[0],a=r[1],i=this.options.target!==p.ObfuscationTarget.Extension?this.getGlobalVariableTemplate():_.GlobalVariableNoEvalTemplate();return f.default(g.DomainLockNodeTemplate(),{domainLockFunctionName:this.identifierNamesGenerator.generate(),diff:a,domains:o,globalVariableTemplate:i,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}}]),t}(N.AbstractCustomNode);u.__decorate([m.initializable(),u.__metadata("design:type",String)],y.prototype,"callsControllerFunctionName",void 0),y=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.ICryptUtils)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object,Object])],y),t.DomainLockNode=y},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionTemplate=function(){return"\n function {debugProtectionFunctionName} (ret) {\n function debuggerProtection (counter) {\n \n {debuggerTemplate}\n \n debuggerProtection(++counter);\n }\n \n try {\n if (ret) {\n return debuggerProtection;\n } else {\n debuggerProtection(0);\n }\n } catch (y) {}\n }\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerTemplateNoEval=function(){return"\n if (typeof counter === 'string') {\n var func = function () {\n while (true) {}\n };\n \n return func();\n } else {\n if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) {\n debugger;\n } else {\n debugger;\n }\n \n }\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerTemplate=function(){return"\n if (typeof counter === 'string') {\n return (function (arg) {}.constructor('while (true) {}').apply('counter'));\n } else {\n if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) {\n (function () {return true;}.constructor('debu' + 'gger').call('action'));\n } else {\n (function () {return false;}.constructor('debu' + 'gger').apply('stateObject'));\n }\n \n }\n "}},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=c.__importDefault(r(18)),f=r(20),p=r(10),m=r(168),g=r(167),_=r(166),N=r(13),v=r(8),y=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e){this.debugProtectionFunctionName=e}},{key:"getNodeStructure",value:function(){return v.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){var e=this.options.target!==f.ObfuscationTarget.Extension?m.DebuggerTemplate():g.DebuggerTemplateNoEval();return l.default(_.DebugProtectionFunctionTemplate(),{debuggerTemplate:e,debugProtectionFunctionName:this.debugProtectionFunctionName})}}]),t}(N.AbstractCustomNode);c.__decorate([p.initializable(),c.__metadata("design:type",String)],y.prototype,"debugProtectionFunctionName",void 0),y=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],y),t.DebugProtectionFunctionNode=y},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionIntervalTemplate=function(){return"\n setInterval(function () {\n {debugProtectionFunctionName}();\n }, 4000);\n "}},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=c.__importDefault(r(18)),f=r(10),p=r(170),m=r(13),g=r(8),_=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e){this.debugProtectionFunctionName=e}},{key:"getNodeStructure",value:function(){return g.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){return l.default(p.DebugProtectionFunctionIntervalTemplate(),{debugProtectionFunctionName:this.debugProtectionFunctionName})}}]),t}(m.AbstractCustomNode);c.__decorate([f.initializable(),c.__metadata("design:type",String)],_.prototype,"debugProtectionFunctionName",void 0),_=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],_),t.DebugProtectionFunctionIntervalNode=_},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionCallTemplate=function(){return"\n (function () {\n {singleNodeCallControllerFunctionName}(this, function () {\n var regExp1 = new RegExp('function *\\\\( *\\\\)');\n var regExp2 = new RegExp('\\\\+\\\\+ *\\(?:_0x(?:[a-f0-9]){4,6}|(?:\\\\b|\\\\d)[a-z0-9]{1,4}(?:\\\\b|\\\\d)\\)', 'i');\n \n var result = {debugProtectionFunctionName}('init');\n \n if (!regExp1.test(result + 'chain') || !regExp2.test(result + 'input')) {\n result('0');\n } else {\n {debugProtectionFunctionName}();\n }\n })();\n })();\n "}},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=c.__importDefault(r(18)),f=r(10),p=r(172),m=r(13),g=r(8),_=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e,t){this.debugProtectionFunctionName=e,this.callsControllerFunctionName=t}},{key:"getNodeStructure",value:function(){return g.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){return l.default(p.DebugProtectionFunctionCallTemplate(),{debugProtectionFunctionName:this.debugProtectionFunctionName,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}}]),t}(m.AbstractCustomNode);c.__decorate([f.initializable(),c.__metadata("design:type",String)],_.prototype,"callsControllerFunctionName",void 0),c.__decorate([f.initializable(),c.__metadata("design:type",String)],_.prototype,"debugProtectionFunctionName",void 0),_=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],_),t.DebugProtectionFunctionCallNode=_},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConsoleOutputDisableExpressionTemplate=function(){return"\n var {consoleLogDisableFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n var func = function () {};\n \n {globalVariableTemplate}\n \n if (!that.console) {\n that.console = (function (func){\n var c = {};\n \n c.log = func;\n c.warn = func;\n c.debug = func;\n c.info = func;\n c.error = func;\n c.exception = func;\n c.trace = func;\n \n return c;\n })(func);\n } else {\n that.console.log = func;\n that.console.warn = func;\n that.console.debug = func;\n that.console.info = func;\n that.console.error = func;\n that.console.exception = func;\n that.console.trace = func;\n }\n });\n \n {consoleLogDisableFunctionName}();\n "}},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=c.__importDefault(r(18)),f=r(20),p=r(174),m=r(45),g=r(10),_=r(13),N=r(8),v=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e){this.callsControllerFunctionName=e}},{key:"getNodeStructure",value:function(){return N.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){var e=this.options.target!==f.ObfuscationTarget.Extension?this.getGlobalVariableTemplate():m.GlobalVariableNoEvalTemplate();return l.default(p.ConsoleOutputDisableExpressionTemplate(),{consoleLogDisableFunctionName:this.identifierNamesGenerator.generate(),globalVariableTemplate:e,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}}]),t}(_.AbstractCustomNode);c.__decorate([g.initializable(),c.__metadata("design:type",String)],v.prototype,"callsControllerFunctionName",void 0),v=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],v),t.ConsoleOutputDisableExpressionNode=v},function(e,t,r){"use strict";var n=r(29),o=r(60),a=r(7),i=r(1),s=r(2),c=r(6),u=r(5);Object.defineProperty(t,"__esModule",{value:!0});var d=r(4),l=r(0),f=r(3),p=r(10),m=r(13),g=r(9),_=r(15),N=r(8),v=function(e){function t(e,r,n){return i(this,t),c(this,(t.__proto__||a(t)).call(this,e,r,n))}return u(t,e),s(t,[{key:"initialize",value:function(e){this.controlFlowStorage=e}},{key:"getNodeStructure",value:function(){var e=o(this.controlFlowStorage.getStorage()).map(function(e){var t=n(e,2),r=t[0],o=t[1].getNode()[0];if(!g.NodeGuards.isExpressionStatementNode(o))throw new Error("Function node for control flow storage object should be passed inside the `ExpressionStatement` node!");return _.Nodes.getPropertyNode(_.Nodes.getIdentifierNode(r),o.expression)}),t=_.Nodes.getVariableDeclarationNode([_.Nodes.getVariableDeclaratorNode(_.Nodes.getIdentifierNode(this.controlFlowStorage.getStorageId()),_.Nodes.getObjectExpressionNode(e))]);return[t=N.NodeUtils.parentize(t)]}}]),t}(m.AbstractCustomNode);d.__decorate([p.initializable(),d.__metadata("design:type",Object)],v.prototype,"controlFlowStorage",void 0),v=d.__decorate([l.injectable(),d.__param(0,l.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d.__param(1,l.inject(f.ServiceIdentifiers.IRandomGenerator)),d.__param(2,l.inject(f.ServiceIdentifiers.IOptions)),d.__metadata("design:paramtypes",[Function,Object,Object])],v),t.ControlFlowStorageNode=v},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=r(10),f=r(13),p=r(15),m=r(8),g=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e){this.expressionArguments=e}},{key:"getNodeStructure",value:function(){for(var e=p.Nodes.getIdentifierNode("callee"),t=[],r=this.expressionArguments.length,n=0;n.5,t=this.randomGenerator.getMathRandom()>.5,r=e?"===":"!==",o=this.randomGenerator.getRandomString(5),a=t?o:this.randomGenerator.getRandomString(5),i=e===t?[this.blockStatementNode,this.deadCodeInjectionRootAstHostNode]:[this.deadCodeInjectionRootAstHostNode,this.blockStatementNode],s=n(i,2),c=s[0],u=s[1],d=m.Nodes.getBlockStatementNode([m.Nodes.getIfStatementNode(m.Nodes.getBinaryExpressionNode(r,m.Nodes.getLiteralNode(o),m.Nodes.getLiteralNode(a)),c,u)]);return g.NodeUtils.parentize(d),[d]}}]),t}(p.AbstractCustomNode);u.__decorate([f.initializable(),u.__metadata("design:type",Object)],_.prototype,"blockStatementNode",void 0),u.__decorate([f.initializable(),u.__metadata("design:type",Object)],_.prototype,"deadCodeInjectionRootAstHostNode",void 0),_=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object])],_),t.BlockStatementDeadCodeInjectionNode=_},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=r(10),f=r(13),p=r(9),m=r(15),g=r(8),_=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e,t,r){this.blockStatementBody=e,this.shuffledKeys=t,this.originalKeysIndexesInShuffledArray=r}},{key:"getNodeStructure",value:function(){var e=this,t=this.randomGenerator.getRandomString(6),r=this.randomGenerator.getRandomString(6),n=m.Nodes.getBlockStatementNode([m.Nodes.getVariableDeclarationNode([m.Nodes.getVariableDeclaratorNode(m.Nodes.getIdentifierNode(t),m.Nodes.getCallExpressionNode(m.Nodes.getMemberExpressionNode(m.Nodes.getLiteralNode(this.originalKeysIndexesInShuffledArray.join("|")),m.Nodes.getIdentifierNode("split")),[m.Nodes.getLiteralNode("|")])),m.Nodes.getVariableDeclaratorNode(m.Nodes.getIdentifierNode(r),m.Nodes.getLiteralNode(0))]),m.Nodes.getWhileStatementNode(m.Nodes.getLiteralNode(!0),m.Nodes.getBlockStatementNode([m.Nodes.getSwitchStatementNode(m.Nodes.getMemberExpressionNode(m.Nodes.getIdentifierNode(t),m.Nodes.getUpdateExpressionNode("++",m.Nodes.getIdentifierNode(r)),!0),this.shuffledKeys.map(function(t,r){var n=e.blockStatementBody[t],o=[n];return p.NodeGuards.isReturnStatementNode(n)||o.push(m.Nodes.getContinueStatement()),m.Nodes.getSwitchCaseNode(m.Nodes.getLiteralNode(String(r)),o)})),m.Nodes.getBreakStatement()]))]);return g.NodeUtils.parentize(n),[n]}}]),t}(f.AbstractCustomNode);c.__decorate([l.initializable(),c.__metadata("design:type",Array)],_.prototype,"blockStatementBody",void 0),c.__decorate([l.initializable(),c.__metadata("design:type",Array)],_.prototype,"originalKeysIndexesInShuffledArray",void 0),c.__decorate([l.initializable(),c.__metadata("design:type",Array)],_.prototype,"shuffledKeys",void 0),_=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],_),t.BlockStatementControlFlowFlatteningNode=_},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableTemplate2=function(){return"\n var getGlobal = function () {\n var globalObject;\n \n try {\n globalObject = Function('return (function() ' + '{}.constructor(\"return this\")( )' + ');')();\n } catch (e) {\n globalObject = window;\n }\n \n return globalObject;\n };\n var that = getGlobal();\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableTemplate1=function(){return"\n var that;\n \n try {\n var getGlobal = Function('return (function() ' + '{}.constructor(\"return this\")( )' + ');');\n \n that = getGlobal();\n } catch (e) {\n that = window;\n }\n "}},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=r(10),f=r(13),p=r(15),m=r(8),g=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e){this.operator=e}},{key:"getNodeStructure",value:function(){var e=p.Nodes.getExpressionStatementNode(p.Nodes.getFunctionExpressionNode([p.Nodes.getIdentifierNode("x"),p.Nodes.getIdentifierNode("y")],p.Nodes.getBlockStatementNode([p.Nodes.getReturnStatementNode(p.Nodes.getBinaryExpressionNode(this.operator,p.Nodes.getIdentifierNode("x"),p.Nodes.getIdentifierNode("y")))])));return m.NodeUtils.parentize(e),[e]}}]),t}(f.AbstractCustomNode);c.__decorate([l.initializable(),c.__metadata("design:type",String)],g.prototype,"operator",void 0),g=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],g),t.BinaryExpressionFunctionNode=g},function(e,t,r){"use strict";var n=r(29),o=r(16),a=r(7),i=r(1),s=r(2),c=r(6),u=r(5);Object.defineProperty(t,"__esModule",{value:!0});var d=r(4),l=r(0),f=r(3),p=r(10),m=r(28),g=r(23),_=r(36),N=r(25),v=function(e){function t(e,r,n,o,s){var u;return i(this,t),(u=c(this,(t.__proto__||a(t)).call(this,n,o,s))).appendEvent=g.ObfuscationEvent.AfterObfuscation,u.customNodeFactory=e,u.stringArrayStorage=r,u}return u(t,e),s(t,[{key:"appendCustomNodes",value:function(e,t){this.stringArrayStorage.getLength()&&(this.appendCustomNodeIfExist(m.CustomNode.StringArrayNode,function(t){N.NodeAppender.prependNode(e,t.getNode())}),this.appendCustomNodeIfExist(m.CustomNode.StringArrayCallsWrapper,function(t){N.NodeAppender.insertNodeAtIndex(e,t.getNode(),1)}),this.appendCustomNodeIfExist(m.CustomNode.StringArrayRotateFunctionNode,function(t){N.NodeAppender.insertNodeAtIndex(e,t.getNode(),1)}))}},{key:"initialize",value:function(){if(this.customNodes=new o,this.options.stringArray){var e,t=this.customNodeFactory(m.CustomNode.StringArrayNode),r=this.customNodeFactory(m.CustomNode.StringArrayCallsWrapper),a=this.customNodeFactory(m.CustomNode.StringArrayRotateFunctionNode),i=this.stringArrayStorage.getStorageId().split("|"),s=n(i,2),c=s[0],u=s[1];e=this.options.rotateStringArray?this.randomGenerator.getRandomInteger(100,500):0,t.initialize(this.stringArrayStorage,c,e),r.initialize(c,u),a.initialize(c,e),this.customNodes.set(m.CustomNode.StringArrayNode,t),this.customNodes.set(m.CustomNode.StringArrayCallsWrapper,r),this.options.rotateStringArray&&this.customNodes.set(m.CustomNode.StringArrayRotateFunctionNode,a)}}}]),t}(_.AbstractCustomNodeGroup);d.__decorate([p.initializable(),d.__metadata("design:type",o)],v.prototype,"customNodes",void 0),v=d.__decorate([l.injectable(),d.__param(0,l.inject(f.ServiceIdentifiers.Factory__ICustomNode)),d.__param(1,l.inject(f.ServiceIdentifiers.TStringArrayStorage)),d.__param(2,l.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d.__param(3,l.inject(f.ServiceIdentifiers.IRandomGenerator)),d.__param(4,l.inject(f.ServiceIdentifiers.IOptions)),d.__metadata("design:paramtypes",[Function,Object,Function,Object,Object])],v),t.StringArrayCustomNodeGroup=v},function(e,t,r){"use strict";var n=r(16),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=r(10),p=r(28),m=r(23),g=r(36),_=r(25),N=function(e){function t(e,r,n,i){var c;return a(this,t),(c=s(this,(t.__proto__||o(t)).call(this,r,n,i))).appendEvent=m.ObfuscationEvent.AfterObfuscation,c.customNodeFactory=e,c}return c(t,e),i(t,[{key:"appendCustomNodes",value:function(e,t){var r=this.getRandomStackTraceIndex(t.length);this.appendCustomNodeIfExist(p.CustomNode.SelfDefendingUnicodeNode,function(n){_.NodeAppender.appendNodeToOptimalBlockScope(t,e,n.getNode(),r)}),this.appendCustomNodeIfExist(p.CustomNode.NodeCallsControllerFunctionNode,function(n){var o;o=t.length?_.NodeAppender.getOptimalBlockScope(t,r,1):e,_.NodeAppender.prependNode(o,n.getNode())})}},{key:"initialize",value:function(){if(this.customNodes=new n,this.options.selfDefending){var e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(p.CustomNode.SelfDefendingUnicodeNode),r=this.customNodeFactory(p.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),r.initialize(this.appendEvent,e),this.customNodes.set(p.CustomNode.SelfDefendingUnicodeNode,t),this.customNodes.set(p.CustomNode.NodeCallsControllerFunctionNode,r)}}}]),t}(g.AbstractCustomNodeGroup);u.__decorate([f.initializable(),u.__metadata("design:type",n)],N.prototype,"customNodes",void 0),N=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__ICustomNode)),u.__param(1,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Function,Object,Object])],N),t.SelfDefendingCustomNodeGroup=N},function(e,t,r){"use strict";var n=r(16),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=r(10),p=r(28),m=r(23),g=r(36),_=r(25),N=function(e){function t(e,r,n,i){var c;return a(this,t),(c=s(this,(t.__proto__||o(t)).call(this,r,n,i))).appendEvent=m.ObfuscationEvent.BeforeObfuscation,c.customNodeFactory=e,c}return c(t,e),i(t,[{key:"appendCustomNodes",value:function(e,t){var r=this.getRandomStackTraceIndex(t.length);this.appendCustomNodeIfExist(p.CustomNode.DomainLockNode,function(n){_.NodeAppender.appendNodeToOptimalBlockScope(t,e,n.getNode(),r)}),this.appendCustomNodeIfExist(p.CustomNode.NodeCallsControllerFunctionNode,function(n){var o;o=t.length?_.NodeAppender.getOptimalBlockScope(t,r,1):e,_.NodeAppender.prependNode(o,n.getNode())})}},{key:"initialize",value:function(){if(this.customNodes=new n,this.options.domainLock.length){var e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(p.CustomNode.DomainLockNode),r=this.customNodeFactory(p.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),r.initialize(this.appendEvent,e),this.customNodes.set(p.CustomNode.DomainLockNode,t),this.customNodes.set(p.CustomNode.NodeCallsControllerFunctionNode,r)}}}]),t}(g.AbstractCustomNodeGroup);u.__decorate([f.initializable(),u.__metadata("design:type",n)],N.prototype,"customNodes",void 0),N=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__ICustomNode)),u.__param(1,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Function,Object,Object])],N),t.DomainLockCustomNodeGroup=N},function(e,t,r){"use strict";var n=r(16),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=r(10),p=r(28),m=r(23),g=r(36),_=r(25),N=function(e){function t(e,r,n,i){var c;return a(this,t),(c=s(this,(t.__proto__||o(t)).call(this,r,n,i))).appendEvent=m.ObfuscationEvent.BeforeObfuscation,c.customNodeFactory=e,c}return c(t,e),i(t,[{key:"appendCustomNodes",value:function(e,t){var r=this,n=this.getRandomStackTraceIndex(t.length);this.appendCustomNodeIfExist(p.CustomNode.DebugProtectionFunctionCallNode,function(r){_.NodeAppender.appendNodeToOptimalBlockScope(t,e,r.getNode(),n)}),this.appendCustomNodeIfExist(p.CustomNode.DebugProtectionFunctionNode,function(t){_.NodeAppender.appendNode(e,t.getNode())}),this.appendCustomNodeIfExist(p.CustomNode.DebugProtectionFunctionIntervalNode,function(t){var n=e.body.length,o=r.randomGenerator.getRandomInteger(0,n);_.NodeAppender.insertNodeAtIndex(e,t.getNode(),o)}),this.appendCustomNodeIfExist(p.CustomNode.NodeCallsControllerFunctionNode,function(r){var o;o=t.length?_.NodeAppender.getOptimalBlockScope(t,n,1):e,_.NodeAppender.prependNode(o,r.getNode())})}},{key:"initialize",value:function(){if(this.customNodes=new n,this.options.debugProtection){var e=this.identifierNamesGenerator.generate(),t=this.identifierNamesGenerator.generate(),r=this.customNodeFactory(p.CustomNode.DebugProtectionFunctionNode),o=this.customNodeFactory(p.CustomNode.DebugProtectionFunctionCallNode),a=this.customNodeFactory(p.CustomNode.DebugProtectionFunctionIntervalNode),i=this.customNodeFactory(p.CustomNode.NodeCallsControllerFunctionNode);r.initialize(e),o.initialize(e,t),a.initialize(e),i.initialize(this.appendEvent,t),this.customNodes.set(p.CustomNode.DebugProtectionFunctionNode,r),this.customNodes.set(p.CustomNode.DebugProtectionFunctionCallNode,o),this.options.debugProtectionInterval&&this.customNodes.set(p.CustomNode.DebugProtectionFunctionIntervalNode,a),this.customNodes.set(p.CustomNode.NodeCallsControllerFunctionNode,i)}}}]),t}(g.AbstractCustomNodeGroup);u.__decorate([f.initializable(),u.__metadata("design:type",n)],N.prototype,"customNodes",void 0),N=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__ICustomNode)),u.__param(1,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Function,Object,Object])],N),t.DebugProtectionCustomNodeGroup=N},function(e,t,r){"use strict";var n=r(16),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=r(10),p=r(28),m=r(23),g=r(36),_=r(25),N=function(e){function t(e,r,n,i){var c;return a(this,t),(c=s(this,(t.__proto__||o(t)).call(this,r,n,i))).appendEvent=m.ObfuscationEvent.BeforeObfuscation,c.customNodeFactory=e,c}return c(t,e),i(t,[{key:"appendCustomNodes",value:function(e,t){var r=this.getRandomStackTraceIndex(t.length);this.appendCustomNodeIfExist(p.CustomNode.ConsoleOutputDisableExpressionNode,function(n){_.NodeAppender.appendNodeToOptimalBlockScope(t,e,n.getNode(),r)}),this.appendCustomNodeIfExist(p.CustomNode.NodeCallsControllerFunctionNode,function(n){var o;o=t.length?_.NodeAppender.getOptimalBlockScope(t,r,1):e,_.NodeAppender.prependNode(o,n.getNode())})}},{key:"initialize",value:function(){if(this.customNodes=new n,this.options.disableConsoleOutput){var e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(p.CustomNode.ConsoleOutputDisableExpressionNode),r=this.customNodeFactory(p.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),r.initialize(this.appendEvent,e),this.customNodes.set(p.CustomNode.ConsoleOutputDisableExpressionNode,t),this.customNodes.set(p.CustomNode.NodeCallsControllerFunctionNode,r)}}}]),t}(g.AbstractCustomNodeGroup);u.__decorate([f.initializable(),u.__metadata("design:type",n)],N.prototype,"customNodes",void 0),N=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__ICustomNode)),u.__param(1,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Function,Object,Object])],N),t.ConsoleOutputCustomNodeGroup=N},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(26),o=r(0),a=r(3),i=r(21),s=r(28),c=r(61),u=r(62),d=r(188),l=r(187),f=r(186),p=r(185),m=r(184),g=r(183),_=r(180),N=r(179),v=r(178),y=r(177),h=r(176),b=r(175),S=r(173),I=r(171),C=r(169),O=r(165),j=r(163),F=r(162),k=r(161),T=r(159),x=r(157),w=r(150),E=r(148),G=r(144),R=r(143);t.customNodesModule=new o.ContainerModule(function(e){e(a.ServiceIdentifiers.ICustomNode).to(b.ConsoleOutputDisableExpressionNode).whenTargetNamed(s.CustomNode.ConsoleOutputDisableExpressionNode),e(a.ServiceIdentifiers.ICustomNode).to(S.DebugProtectionFunctionCallNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionCallNode),e(a.ServiceIdentifiers.ICustomNode).to(I.DebugProtectionFunctionIntervalNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionIntervalNode),e(a.ServiceIdentifiers.ICustomNode).to(C.DebugProtectionFunctionNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionNode),e(a.ServiceIdentifiers.ICustomNode).to(O.DomainLockNode).whenTargetNamed(s.CustomNode.DomainLockNode),e(a.ServiceIdentifiers.ICustomNode).to(k.NodeCallsControllerFunctionNode).whenTargetNamed(s.CustomNode.NodeCallsControllerFunctionNode),e(a.ServiceIdentifiers.ICustomNode).to(T.SelfDefendingUnicodeNode).whenTargetNamed(s.CustomNode.SelfDefendingUnicodeNode),e(a.ServiceIdentifiers.ICustomNode).to(x.StringArrayCallsWrapper).whenTargetNamed(s.CustomNode.StringArrayCallsWrapper),e(a.ServiceIdentifiers.ICustomNode).to(w.StringArrayNode).whenTargetNamed(s.CustomNode.StringArrayNode),e(a.ServiceIdentifiers.ICustomNode).to(E.StringArrayRotateFunctionNode).whenTargetNamed(s.CustomNode.StringArrayRotateFunctionNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(g.BinaryExpressionFunctionNode).whenTargetNamed(i.ControlFlowCustomNode.BinaryExpressionFunctionNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(_.BlockStatementControlFlowFlatteningNode).whenTargetNamed(i.ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(v.CallExpressionControlFlowStorageCallNode).whenTargetNamed(i.ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(y.CallExpressionFunctionNode).whenTargetNamed(i.ControlFlowCustomNode.CallExpressionFunctionNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(h.ControlFlowStorageNode).whenTargetNamed(i.ControlFlowCustomNode.ControlFlowStorageNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(j.ExpressionWithOperatorControlFlowStorageCallNode).whenTargetNamed(i.ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(F.LogicalExpressionFunctionNode).whenTargetNamed(i.ControlFlowCustomNode.LogicalExpressionFunctionNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(R.StringLiteralNode).whenTargetNamed(i.ControlFlowCustomNode.StringLiteralNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(G.StringLiteralControlFlowStorageCallNode).whenTargetNamed(i.ControlFlowCustomNode.StringLiteralControlFlowStorageCallNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(N.BlockStatementDeadCodeInjectionNode).whenTargetNamed(u.DeadCodeInjectionCustomNode.BlockStatementDeadCodeInjectionNode),e(a.ServiceIdentifiers.ICustomNodeGroup).to(d.ConsoleOutputCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.ConsoleOutputCustomNodeGroup),e(a.ServiceIdentifiers.ICustomNodeGroup).to(l.DebugProtectionCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.DebugProtectionCustomNodeGroup),e(a.ServiceIdentifiers.ICustomNodeGroup).to(f.DomainLockCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.DomainLockCustomNodeGroup),e(a.ServiceIdentifiers.ICustomNodeGroup).to(p.SelfDefendingCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.SelfDefendingCustomNodeGroup),e(a.ServiceIdentifiers.ICustomNodeGroup).to(m.StringArrayCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.StringArrayCustomNodeGroup),e(a.ServiceIdentifiers.Factory__ICustomNode).toFactory(n.InversifyContainerFacade.getFactory(a.ServiceIdentifiers.ICustomNode)),e(a.ServiceIdentifiers.Factory__IControlFlowCustomNode).toFactory(n.InversifyContainerFacade.getConstructorFactory(a.ServiceIdentifiers.Newable__ICustomNode,a.ServiceIdentifiers.Factory__IIdentifierNamesGenerator,a.ServiceIdentifiers.IRandomGenerator,a.ServiceIdentifiers.IOptions)),e(a.ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode).toFactory(n.InversifyContainerFacade.getConstructorFactory(a.ServiceIdentifiers.Newable__ICustomNode,a.ServiceIdentifiers.Factory__IIdentifierNamesGenerator,a.ServiceIdentifiers.IRandomGenerator,a.ServiceIdentifiers.IOptions)),e(a.ServiceIdentifiers.Factory__ICustomNodeGroup).toFactory(n.InversifyContainerFacade.getFactory(a.ServiceIdentifiers.ICustomNodeGroup))})},function(e,t,r){"use strict";var n=r(24),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u,d=r(4),l=r(0),f=r(3),p=d.__importStar(r(17)),m=r(12),g=r(14),_=r(9),N=r(15),v=r(8),y=u=function(e){function t(e,r){return a(this,t),s(this,(t.__proto__||o(t)).call(this,e,r))}return c(t,e),i(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case m.TransformationStage.Converting:return{enter:function(e,r){if(r&&_.NodeGuards.isReturnStatementNode(e)&&null===e.argument)return t.fixEsprimaReturnStatementTemplateLiteralNode(e)},leave:function(e,r){if(r&&_.NodeGuards.isTemplateLiteralNode(e))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){var r=e.expressions,n=[];if(e.quasis.forEach(function(e){n.push(N.Nodes.getLiteralNode(e.value.cooked));var t=r.shift();t&&n.push(t)}),n=n.filter(function(e){return!(_.NodeGuards.isLiteralNode(e)&&""===e.value)}),u.isLiteralNodeWithStringValue(n[0])||u.isLiteralNodeWithStringValue(n[1])||n.unshift(N.Nodes.getLiteralNode("")),n.length>1){var o=N.Nodes.getBinaryExpressionNode("+",n.shift(),n.shift());return n.forEach(function(e){o=N.Nodes.getBinaryExpressionNode("+",o,e)}),o}return n[0]}},{key:"fixEsprimaReturnStatementTemplateLiteralNode",value:function(e){var t=v.NodeUtils.getScopeOfNode(e),r=_.NodeGuards.isSwitchCaseNode(t)?t.consequent:t.body,o=r.indexOf(e);if(o===r.length-2){var a=r[o+1];if(a&&_.NodeGuards.isExpressionStatementNode(a)){var i=!1;if(p.traverse(a,{enter:function(e,t){if(_.NodeGuards.isTemplateLiteralNode(e))return i=!0,p.VisitorOption.Break}}),i)return e.argument=a.expression,r.pop(),_.NodeGuards.isSwitchCaseNode(t)?t.consequent=n(r):t.body=n(r),e}}}}],[{key:"isLiteralNodeWithStringValue",value:function(e){return e&&_.NodeGuards.isLiteralNode(e)&&"string"==typeof e.value}}]),t}(g.AbstractNodeTransformer);y=u=d.__decorate([l.injectable(),d.__param(0,l.inject(f.ServiceIdentifiers.IRandomGenerator)),d.__param(1,l.inject(f.ServiceIdentifiers.IOptions)),d.__metadata("design:paramtypes",[Object,Object])],y),t.TemplateLiteralTransformer=y},function(e,t,r){"use strict";var n=r(29),o=r(16),a=r(7),i=r(1),s=r(2),c=r(6),u=r(5);Object.defineProperty(t,"__esModule",{value:!0});var d,l=r(4),f=r(0),p=r(3),m=r(12),g=r(14),_=r(25),N=r(9),v=r(15),y=r(8),h=d=function(e){function t(e,r){var n;return i(this,t),(n=c(this,(t.__proto__||a(t)).call(this,e,r))).cachedScopeNodesMap=new o,n}return u(t,e),s(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case m.TransformationStage.Converting:return{enter:function(e,r){if(t.options.transformObjectKeys&&r&&N.NodeGuards.isObjectExpressionNode(e)&&N.NodeGuards.isVariableDeclaratorNode(r))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){if(!N.NodeGuards.isIdentifierNode(t.id))return e;var r=y.NodeUtils.getScopeOfNode(t);return r&&N.NodeGuards.isNodeHasScope(r)?(this.cachedScopeNodesMap.set(t,r),this.transformObjectExpressionNode(e,t.id,t)):e}},{key:"extractPropertiesToExpressionStatements",value:function(e,t,r){for(var n=e.length,o=[],a=[],i=0;il.hostNodeSearchMinDepth&&t.splice(0,l.hostNodeSearchMinDepth),t.length>l.hostNodeSearchMaxDepth&&(t.length=l.hostNodeSearchMaxDepth),this.randomGenerator.getRandomGenerator().pickone(t))}},{key:"isVisitedFunctionNode",value:function(e){return(b.NodeGuards.isFunctionDeclarationNode(e)||b.NodeGuards.isFunctionExpressionNode(e)||b.NodeGuards.isArrowFunctionExpressionNode(e))&&this.visitedFunctionNodes.has(e)}},{key:"transformFunctionBody",value:function(e,t){var r=this;g.replace(e,{enter:function(e,o){if(e.ignoredNode)return g.VisitorOption.Skip;if(r.isVisitedFunctionNode(e)||!o)return g.VisitorOption.Skip;if(!l.controlFlowReplacersMap.has(e.type))return e;if(r.randomGenerator.getMathRandom()>r.options.controlFlowFlatteningThreshold)return e;var a=l.controlFlowReplacersMap.get(e.type);return void 0===a?e:n({},r.controlFlowReplacerFactory(a).replace(e,o,t),{parentNode:o})}})}}]),t}(h.AbstractNodeTransformer);C.controlFlowReplacersMap=new a([[v.NodeType.BinaryExpression,N.ControlFlowReplacer.BinaryExpressionControlFlowReplacer],[v.NodeType.CallExpression,N.ControlFlowReplacer.CallExpressionControlFlowReplacer],[v.NodeType.LogicalExpression,N.ControlFlowReplacer.LogicalExpressionControlFlowReplacer],[v.NodeType.Literal,N.ControlFlowReplacer.StringLiteralControlFlowReplacer]]),C.hostNodeSearchMinDepth=0,C.hostNodeSearchMaxDepth=2,C=l=f.__decorate([p.injectable(),f.__param(0,p.inject(m.ServiceIdentifiers.Factory__TControlFlowStorage)),f.__param(1,p.inject(m.ServiceIdentifiers.Factory__IControlFlowReplacer)),f.__param(2,p.inject(m.ServiceIdentifiers.Factory__IControlFlowCustomNode)),f.__param(3,p.inject(m.ServiceIdentifiers.IRandomGenerator)),f.__param(4,p.inject(m.ServiceIdentifiers.IOptions)),f.__metadata("design:paramtypes",[Function,Function,Function,Object,Object])],C),t.FunctionControlFlowTransformer=C},function(e,t,r){"use strict";var n=r(30),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u,d=r(4),l=r(0),f=r(3),p=d.__importStar(r(17)),m=r(62),g=r(31),_=r(19),N=r(12),v=r(14),y=r(9),h=r(15),b=r(8),S=u=function(e){function t(e,r,i,c){var u;return a(this,t),(u=s(this,(t.__proto__||o(t)).call(this,i,c))).deadCodeInjectionRootAstHostNodeSet=new n,u.collectedBlockStatements=[],u.collectedBlockStatementsTotalLength=0,u.deadCodeInjectionCustomNodeFactory=e,u.transformersRunner=r,u}return c(t,e),i(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case N.TransformationStage.DeadCodeInjection:return{enter:function(e,r){if(r&&y.NodeGuards.isProgramNode(e))return t.analyzeNode(e,r),e},leave:function(e,r){if(r&&y.NodeGuards.isBlockStatementNode(e))return t.transformNode(e,r)}};case N.TransformationStage.Finalizing:return this.deadCodeInjectionRootAstHostNodeSet.size?{enter:function(e,r){if(r&&t.isDeadCodeInjectionRootAstHostNode(e))return t.restoreNode(e,r)}}:null;default:return null}}},{key:"analyzeNode",value:function(e,t){var r=this;p.traverse(e,{enter:function(e){if(y.NodeGuards.isBlockStatementNode(e)){var t=b.NodeUtils.clone(e);u.isValidCollectedBlockStatementNode(t)&&(b.NodeUtils.parentizeNode(t,t),t=r.transformersRunner.transform(t,u.transformersToRenameBlockScopeIdentifiers,N.TransformationStage.Obfuscating),r.collectedBlockStatements.push(t))}}}),this.collectedBlockStatementsTotalLength=this.collectedBlockStatements.length}},{key:"transformNode",value:function(e,t){if(!this.collectedBlockStatements.length||this.collectedBlockStatementsTotalLengththis.options.deadCodeInjectionThreshold||!u.isValidWrappedBlockStatementNode(e))return e;var r=this.collectedBlockStatements.length-1,n=this.randomGenerator.getRandomInteger(0,r),o=this.collectedBlockStatements.splice(n,1)[0];return o===e?e:this.replaceBlockStatementNode(e,o,t)}},{key:"restoreNode",value:function(e,t){var r=e.body[0];if(!y.NodeGuards.isFunctionDeclarationNode(r))throw new Error("Wrong dead code injection root AST host node. Host node should contain `FunctionDeclaration` node");return r.body}},{key:"isDeadCodeInjectionRootAstHostNode",value:function(e){return y.NodeGuards.isBlockStatementNode(e)&&this.deadCodeInjectionRootAstHostNodeSet.has(e)}},{key:"replaceBlockStatementNode",value:function(e,t,r){var n=h.Nodes.getBlockStatementNode([h.Nodes.getFunctionDeclarationNode(u.deadCodeInjectionRootAstHostNodeName,[],t)]);this.deadCodeInjectionRootAstHostNodeSet.add(n);var o=this.deadCodeInjectionCustomNodeFactory(m.DeadCodeInjectionCustomNode.BlockStatementDeadCodeInjectionNode);o.initialize(e,n);var a=o.getNode()[0];return b.NodeUtils.parentizeNode(a,r),a}}],[{key:"isProhibitedNodeInsideCollectedBlockStatement",value:function(e){return y.NodeGuards.isBreakStatementNode(e)||y.NodeGuards.isContinueStatementNode(e)||y.NodeGuards.isAwaitExpressionNode(e)||y.NodeGuards.isSuperNode(e)}},{key:"isScopeHoistingFunctionDeclaration",value:function(e){if(!y.NodeGuards.isFunctionDeclarationNode(e))return!1;var t=b.NodeUtils.getScopeOfNode(e),r=y.NodeGuards.isSwitchCaseNode(t)?t.consequent:t.body,n=r.indexOf(e);if(0===n)return!1;var o=r.slice(0,n),a=h.Nodes.getBlockStatementNode(o),i=e.id.name,s=!1;return p.traverse(a,{enter:function(e){if(y.NodeGuards.isIdentifierNode(e)&&e.name===i)return s=!0,p.VisitorOption.Break}}),s}},{key:"isValidCollectedBlockStatementNode",value:function(e){if(!e.body.length)return!1;var t=0,r=!0;return p.traverse(e,{enter:function(e){if(y.NodeGuards.isBlockStatementNode(e)&&t++,t>u.maxNestedBlockStatementsCount||u.isProhibitedNodeInsideCollectedBlockStatement(e)||u.isScopeHoistingFunctionDeclaration(e))return r=!1,p.VisitorOption.Break}}),r}},{key:"isValidWrappedBlockStatementNode",value:function(e){if(!e.body.length)return!1;var t=!0;return p.traverse(e,{enter:function(e){if(u.isScopeHoistingFunctionDeclaration(e))return t=!1,p.VisitorOption.Break}}),!!t&&b.NodeUtils.getBlockScopesOfNode(e)[0].type!==_.NodeType.Program}}]),t}(v.AbstractNodeTransformer);S.deadCodeInjectionRootAstHostNodeName="deadCodeInjectionRootAstHostNode",S.maxNestedBlockStatementsCount=4,S.minCollectedBlockStatementsCount=5,S.transformersToRenameBlockScopeIdentifiers=[g.NodeTransformer.CatchClauseTransformer,g.NodeTransformer.ClassDeclarationTransformer,g.NodeTransformer.FunctionDeclarationTransformer,g.NodeTransformer.FunctionTransformer,g.NodeTransformer.LabeledStatementTransformer,g.NodeTransformer.VariableDeclarationTransformer],S=u=d.__decorate([l.injectable(),d.__param(0,l.inject(f.ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode)),d.__param(1,l.inject(f.ServiceIdentifiers.ITransformersRunner)),d.__param(2,l.inject(f.ServiceIdentifiers.IRandomGenerator)),d.__param(3,l.inject(f.ServiceIdentifiers.IOptions)),d.__metadata("design:paramtypes",[Function,Object,Object,Object])],S),t.DeadCodeInjectionTransformer=S},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c,u=r(4),d=r(0),l=r(3),f=r(21),p=r(46),m=r(9),g=c=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"replace",value:function(e,t,r){var n=e.callee;if(!m.NodeGuards.isIdentifierNode(n))return e;var o=String(e.arguments.length),a=this.controlFlowCustomNodeFactory(f.ControlFlowCustomNode.CallExpressionFunctionNode),i=e.arguments;a.initialize(i);var s=this.insertCustomNodeToControlFlowStorage(a,r,o,c.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(r.getStorageId(),s,n,i)}},{key:"getControlFlowStorageCallNode",value:function(e,t,r,n){var o=this.controlFlowCustomNodeFactory(f.ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode);o.initialize(e,t,r,n);var a=o.getNode()[0];if(!a||!m.NodeGuards.isExpressionStatementNode(a))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return a.expression}}]),t}(p.AbstractControlFlowReplacer);g.usingExistingIdentifierChance=.5,g=c=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IControlFlowCustomNode)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object])],g),t.CallExpressionControlFlowReplacer=g},function(e,t){e.exports=require("@babel/runtime/core-js/reflect/has-metadata")},function(e,t){e.exports=require("@babel/runtime/core-js/reflect/define-metadata")},function(e,t){e.exports=require("@babel/runtime/core-js/object/get-own-property-names")},function(e,t){e.exports=require("@babel/runtime/core-js/reflect/get-metadata")},function(e,t){e.exports=require("@babel/runtime/core-js/object/get-own-property-descriptor")},function(e,t){e.exports=require("@babel/runtime/core-js/object/define-property")},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c,u=r(4),d=r(0),l=r(3),f=u.__importStar(r(17)),p=r(21),m=r(12),g=r(14),_=r(9),N=r(8),v=c=function(e){function t(e,r,a,s){var c;return o(this,t),(c=i(this,(t.__proto__||n(t)).call(this,a,s))).controlFlowCustomNodeFactory=e,c.arrayUtils=r,c}return s(t,e),a(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case m.TransformationStage.ControlFlowFlattening:return{leave:function(e,r){if(r&&_.NodeGuards.isBlockStatementNode(e))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){if(this.randomGenerator.getMathRandom()>this.options.controlFlowFlatteningThreshold||!c.canTransformBlockStatementNode(e))return e;var r=e.body,n=this.arrayUtils.arrayRange(r.length),o=this.arrayUtils.arrayShuffle(n),a=n.map(function(e){return o.indexOf(e)}),i=this.controlFlowCustomNodeFactory(p.ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode);i.initialize(r,o,a);var s=i.getNode()[0];return N.NodeUtils.parentizeNode(s,t),s}}],[{key:"blockStatementHasProhibitedStatements",value:function(e){return e.body.some(function(e){var t=_.NodeGuards.isBreakStatementNode(e)||_.NodeGuards.isContinueStatementNode(e),r=_.NodeGuards.isVariableDeclarationNode(e)&&("const"===e.kind||"let"===e.kind),n=_.NodeGuards.isClassDeclarationNode(e);return _.NodeGuards.isFunctionDeclarationNode(e)||t||r||n})}},{key:"canTransformBlockStatementNode",value:function(e){var t=!0;return f.traverse(e,{enter:function(e){if(_.NodeGuards.isWhileStatementNode(e))return f.VisitorOption.Skip;_.NodeGuards.isBlockStatementNode(e)&&c.blockStatementHasProhibitedStatements(e)&&(t=!1)}}),e.body.length<=4&&(t=!1),t}}]),t}(g.AbstractNodeTransformer);v=c=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IControlFlowCustomNode)),u.__param(1,d.inject(l.ServiceIdentifiers.IArrayUtils)),u.__param(2,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object,Object])],v),t.BlockStatementControlFlowTransformer=v},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c,u=r(4),d=r(0),l=r(3),f=r(21),p=r(63),m=c=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"replace",value:function(e,t,r){var n=e.operator,o=this.controlFlowCustomNodeFactory(f.ControlFlowCustomNode.BinaryExpressionFunctionNode);o.initialize(n);var a=this.insertCustomNodeToControlFlowStorage(o,r,n,c.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(r.getStorageId(),a,e.left,e.right)}}]),t}(p.ExpressionWithOperatorControlFlowReplacer);m.usingExistingIdentifierChance=.5,m=c=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IControlFlowCustomNode)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object])],m),t.BinaryExpressionControlFlowReplacer=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(26),o=r(0),a=r(3),i=r(64),s=r(31),c=r(207),u=r(206),d=r(199),l=r(198),f=r(197),p=r(196),m=r(195);t.controlFlowTransformersModule=new o.ContainerModule(function(e){e(a.ServiceIdentifiers.INodeTransformer).to(u.BlockStatementControlFlowTransformer).whenTargetNamed(s.NodeTransformer.BlockStatementControlFlowTransformer),e(a.ServiceIdentifiers.INodeTransformer).to(l.DeadCodeInjectionTransformer).whenTargetNamed(s.NodeTransformer.DeadCodeInjectionTransformer),e(a.ServiceIdentifiers.INodeTransformer).to(f.FunctionControlFlowTransformer).whenTargetNamed(s.NodeTransformer.FunctionControlFlowTransformer),e(a.ServiceIdentifiers.IControlFlowReplacer).to(c.BinaryExpressionControlFlowReplacer).whenTargetNamed(i.ControlFlowReplacer.BinaryExpressionControlFlowReplacer),e(a.ServiceIdentifiers.IControlFlowReplacer).to(d.CallExpressionControlFlowReplacer).whenTargetNamed(i.ControlFlowReplacer.CallExpressionControlFlowReplacer),e(a.ServiceIdentifiers.IControlFlowReplacer).to(p.LogicalExpressionControlFlowReplacer).whenTargetNamed(i.ControlFlowReplacer.LogicalExpressionControlFlowReplacer),e(a.ServiceIdentifiers.IControlFlowReplacer).to(m.StringLiteralControlFlowReplacer).whenTargetNamed(i.ControlFlowReplacer.StringLiteralControlFlowReplacer),e(a.ServiceIdentifiers.Factory__IControlFlowReplacer).toFactory(n.InversifyContainerFacade.getCacheFactory(a.ServiceIdentifiers.IControlFlowReplacer))})},function(e,t,r){"use strict";var n=r(11),o=r(1),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i,s=r(4),c=r(0),u=r(3),d=s.__importStar(r(17)),l=r(67),f=r(9),p=r(8),m=i=function(){function e(t){o(this,e),this.calleeDataExtractorFactory=t}return a(e,[{key:"analyze",value:function(e){return this.analyzeRecursive(e.body)}},{key:"analyzeRecursive",value:function(e){for(var t=this,r=i.getLimitIndex(e.length),n=[],o=e.length,a=function(o){if(o>r)return"break";var a=e[o];d.traverse(a,{enter:function(r){if(f.NodeGuards.isCallExpressionNode(r))return a.parentNode!==p.NodeUtils.getBlockScopesOfNode(r)[0]?d.VisitorOption.Skip:void t.analyzeCallExpressionNode(n,e,r)}})},s=0;sr&&(n=Math.round(r+t*i.limitThreshold))>t&&(n=t),n}}]),e}();m.calleeDataExtractorsList=[l.CalleeDataExtractor.FunctionDeclarationCalleeDataExtractor,l.CalleeDataExtractor.FunctionExpressionCalleeDataExtractor,l.CalleeDataExtractor.ObjectExpressionCalleeDataExtractor],m.limitThresholdActivationLength=25,m.limitThreshold=.002,m=i=s.__decorate([c.injectable(),s.__param(0,c.inject(u.ServiceIdentifiers.Factory__ICalleeDataExtractor)),s.__metadata("design:paramtypes",[Function])],m),t.StackTraceAnalyzer=m},function(e,t,r){"use strict";var n=r(37),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=u.__importStar(r(17)),f=r(48),p=r(9),m=r(8),g=function(e){function t(){return a(this,t),s(this,(t.__proto__||o(t)).apply(this,arguments))}return c(t,e),i(t,[{key:"extract",value:function(e,t){if(!p.NodeGuards.isMemberExpressionNode(t))return null;var r=this.createObjectMembersCallsChain([],t);if(!r.length)return null;var n=r[r.length-1],o=this.getCalleeBlockStatement(m.NodeUtils.getBlockScopesOfNode(e[0])[0],r);return o?{callee:o,name:n}:null}},{key:"createObjectMembersCallsChain",value:function(e,t){if(p.NodeGuards.isIdentifierNode(t.property)&&!1===t.computed)e.unshift(t.property.name);else{if(!p.NodeGuards.isLiteralNode(t.property)||"string"!=typeof t.property.value&&"number"!=typeof t.property.value)return e;e.unshift(t.property.value)}return p.NodeGuards.isMemberExpressionNode(t.object)?this.createObjectMembersCallsChain(e,t.object):(p.NodeGuards.isIdentifierNode(t.object)&&e.unshift(t.object.name),e)}},{key:"getCalleeBlockStatement",value:function(e,t){var r=this,n=t.shift();if(!n)return null;var o=null;return l.traverse(e,{enter:function(e){if(p.NodeGuards.isVariableDeclaratorNode(e)&&p.NodeGuards.isIdentifierNode(e.id)&&e.init&&p.NodeGuards.isObjectExpressionNode(e.init)&&e.id.name===n)return o=r.findCalleeBlockStatement(e.init.properties,t),l.VisitorOption.Break}}),o}},{key:"findCalleeBlockStatement",value:function(e,t){var r=t.shift();if(!r)return null;var o=!0,a=!1,i=void 0;try{for(var s,c=n(e);!(o=(s=c.next()).done);o=!0){var u=s.value,d=p.NodeGuards.isIdentifierNode(u.key)&&u.key.name===r,l=p.NodeGuards.isLiteralNode(u.key)&&Boolean(u.key.value)&&u.key.value===r;if(d||l){if(p.NodeGuards.isObjectExpressionNode(u.value))return this.findCalleeBlockStatement(u.value.properties,t);if(p.NodeGuards.isFunctionExpressionNode(u.value))return u.value.body}}}catch(e){a=!0,i=e}finally{try{o||null==c.return||c.return()}finally{if(a)throw i}}return null}}]),t}(f.AbstractCalleeDataExtractor);g=u.__decorate([d.injectable()],g),t.ObjectExpressionCalleeDataExtractor=g},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=c.__importStar(r(17)),l=r(48),f=r(9),p=r(8),m=function(e){function t(){return o(this,t),i(this,(t.__proto__||n(t)).apply(this,arguments))}return s(t,e),a(t,[{key:"extract",value:function(e,t){var r=null;return f.NodeGuards.isIdentifierNode(t)&&(r=this.getCalleeBlockStatement(p.NodeUtils.getBlockScopesOfNode(e[0])[0],t.name)),f.NodeGuards.isFunctionExpressionNode(t)&&(r=t.body),r?{callee:r,name:t.name||null}:null}},{key:"getCalleeBlockStatement",value:function(e,t){var r=null;return d.traverse(e,{enter:function(e,n){if(f.NodeGuards.isFunctionExpressionNode(e)&&n&&f.NodeGuards.isVariableDeclaratorNode(n)&&f.NodeGuards.isIdentifierNode(n.id)&&n.id.name===t)return r=e.body,d.VisitorOption.Break}}),r}}]),t}(l.AbstractCalleeDataExtractor);m=c.__decorate([u.injectable()],m),t.FunctionExpressionCalleeDataExtractor=m},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=c.__importStar(r(17)),l=r(48),f=r(9),p=r(8),m=function(e){function t(){return o(this,t),i(this,(t.__proto__||n(t)).apply(this,arguments))}return s(t,e),a(t,[{key:"extract",value:function(e,t){if(!f.NodeGuards.isIdentifierNode(t))return null;var r=this.getCalleeBlockStatement(p.NodeUtils.getBlockScopesOfNode(e[0])[0],t.name);return r?{callee:r,name:t.name}:null}},{key:"getCalleeBlockStatement",value:function(e,t){var r=null;return d.traverse(e,{enter:function(e){if(f.NodeGuards.isFunctionDeclarationNode(e)&&e.id.name===t)return r=e.body,d.VisitorOption.Break}}),r}}]),t}(l.AbstractCalleeDataExtractor);m=c.__decorate([u.injectable()],m),t.FunctionDeclarationCalleeDataExtractor=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(26),o=r(0),a=r(3),i=r(67),s=r(212),c=r(211),u=r(210),d=r(209);t.analyzersModule=new o.ContainerModule(function(e){e(a.ServiceIdentifiers.IStackTraceAnalyzer).to(d.StackTraceAnalyzer).inSingletonScope(),e(a.ServiceIdentifiers.ICalleeDataExtractor).to(s.FunctionDeclarationCalleeDataExtractor).whenTargetNamed(i.CalleeDataExtractor.FunctionDeclarationCalleeDataExtractor),e(a.ServiceIdentifiers.ICalleeDataExtractor).to(c.FunctionExpressionCalleeDataExtractor).whenTargetNamed(i.CalleeDataExtractor.FunctionExpressionCalleeDataExtractor),e(a.ServiceIdentifiers.ICalleeDataExtractor).to(u.ObjectExpressionCalleeDataExtractor).whenTargetNamed(i.CalleeDataExtractor.ObjectExpressionCalleeDataExtractor),e(a.ServiceIdentifiers.Factory__ICalleeDataExtractor).toFactory(n.InversifyContainerFacade.getCacheFactory(a.ServiceIdentifiers.ICalleeDataExtractor))})},function(e,t){e.exports=require("reflect-metadata")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(32);e.exports=n.JavaScriptObfuscator}]); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/package.json b/package.json index 0de936ee..cf31b462 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,8 @@ "tslint-language-service": "0.9.8", "tslint-webpack-plugin": "1.2.0", "typescript": "2.7.2", - "webpack": "3.11.0", + "webpack": "4.0.1", + "webpack-cli": "^2.0.10", "webpack-node-externals": "1.6.0" }, "repository": { diff --git a/scripts/watch b/scripts/watch index 7ab753ce..f1fa9e8e 100755 --- a/scripts/watch +++ b/scripts/watch @@ -1,3 +1,3 @@ #!/bin/bash -$(yarn bin)/webpack --watch \ No newline at end of file +$(yarn bin)/webpack --mode development --watch \ No newline at end of file diff --git a/scripts/webpack b/scripts/webpack index db1a3597..c07a5a16 100755 --- a/scripts/webpack +++ b/scripts/webpack @@ -1,3 +1,3 @@ #!/bin/bash -$(yarn bin)/webpack -p \ No newline at end of file +$(yarn bin)/webpack --mode production \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index f9207077..bb6a1ebc 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -39,7 +39,6 @@ module.exports = { entry: { 'index': './index.ts' }, - cache: true, devtool: 'source-map', target: 'node', externals: [nodeExternals()], @@ -76,8 +75,6 @@ module.exports = { }) ], output: { - path: __dirname + '/dist', - filename: '[name].js', libraryTarget: "commonjs2", library: "JavaScriptObfuscator" }, diff --git a/yarn.lock b/yarn.lock index 0202f2eb..fa1ed3e5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -448,6 +448,10 @@ lodash "^4.2.0" to-fast-properties "^2.0.0" +"@sindresorhus/is@^0.7.0": + version "0.7.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.7.0.tgz#9a06f4f137ee84d7df0460c1fdb1135ffa6c50fd" + "@sinonjs/formatio@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@sinonjs/formatio/-/formatio-2.0.0.tgz#84db7e9eb5531df18a8c5e0bfb6e449e55e654b2" @@ -549,15 +553,11 @@ abbrev@1, abbrev@1.0.x: version "1.0.9" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" -acorn-dynamic-import@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-2.0.2.tgz#c752bd210bef679501b6c6cb7fc84f8f47158cc4" +acorn-dynamic-import@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-3.0.0.tgz#901ceee4c7faaef7e07ad2a47e890675da50a278" dependencies: - acorn "^4.0.3" - -acorn@^4.0.3: - version "4.0.13" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" + acorn "^5.0.0" acorn@^5.0.0: version "5.2.1" @@ -594,10 +594,14 @@ amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" -ansi-escapes@^1.1.0: +ansi-escapes@^1.0.0, ansi-escapes@^1.1.0: version "1.4.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" +ansi-escapes@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.0.0.tgz#ec3e8b4e9f8064fc02c3ac9b65f1c275bda8ef92" + ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" @@ -616,6 +620,20 @@ ansi-styles@^3.1.0, ansi-styles@^3.2.0: dependencies: color-convert "^1.9.0" +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + dependencies: + color-convert "^1.9.0" + +ansi-styles@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-1.0.0.tgz#cb102df1c56f5123eab8b67cd7b98027a0279178" + +any-observable@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/any-observable/-/any-observable-0.2.0.tgz#c67870058003579009083f54ac0abafb5c33d242" + anymatch@^1.3.0: version "1.3.2" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" @@ -629,7 +647,7 @@ append-transform@^0.4.0: dependencies: default-require-extensions "^1.0.0" -aproba@^1.0.3: +aproba@^1.0.3, aproba@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" @@ -646,6 +664,10 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" +argv@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/argv/-/argv-0.0.2.tgz#ecbd16f8949b157183711b1bda334f37840185ab" + arr-diff@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" @@ -720,14 +742,32 @@ assertion-error@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.0.2.tgz#13ca515d86206da0bac66e834dd397d87581094c" +assign-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + +ast-types@0.10.1: + version "0.10.1" + resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.10.1.tgz#f52fca9715579a14f841d67d7f8d25432ab6a3dd" + +ast-types@0.11.2: + version "0.11.2" + resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.11.2.tgz#cc4e1d15a36b39979a1986fe1e91321cbfae7783" + async-each@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" -async@1.x, async@^1.4.0: +async@1.x, async@^1.4.0, async@^1.5.0: version "1.5.2" resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" +async@^2.0.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.0.tgz#61a29abb6fcc026fea77e56d1c6ec53a795951f4" + dependencies: + lodash "^4.14.0" + async@^2.1.2, async@^2.1.4: version "2.5.0" resolved "https://registry.yarnpkg.com/async/-/async-2.5.0.tgz#843190fd6b7357a0b9e1c956edddd5ec8462b54d" @@ -813,6 +853,30 @@ babel-core@7.0.0-beta.3: resolve "^1.3.2" source-map "^0.5.0" +babel-core@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.0.tgz#af32f78b31a6fcef119c87b0fd8d9753f03a0bb8" + dependencies: + babel-code-frame "^6.26.0" + babel-generator "^6.26.0" + babel-helpers "^6.24.1" + babel-messages "^6.23.0" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + convert-source-map "^1.5.0" + debug "^2.6.8" + json5 "^0.5.1" + lodash "^4.17.4" + minimatch "^3.0.4" + path-is-absolute "^1.0.1" + private "^0.1.7" + slash "^1.0.0" + source-map "^0.5.6" + babel-generator@7.0.0-beta.3: version "7.0.0-beta.3" resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-7.0.0-beta.3.tgz#afa85e34c50ef52ccd0ef37f4c4b5e1df65cac04" @@ -836,6 +900,70 @@ babel-generator@^6.18.0: source-map "^0.5.6" trim-right "^1.0.1" +babel-generator@^6.26.0: + version "6.26.1" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" + dependencies: + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + detect-indent "^4.0.0" + jsesc "^1.3.0" + lodash "^4.17.4" + source-map "^0.5.7" + trim-right "^1.0.1" + +babel-helper-bindify-decorators@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-bindify-decorators/-/babel-helper-bindify-decorators-6.24.1.tgz#14c19e5f142d7b47f19a52431e52b1ccbc40a330" + dependencies: + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664" + dependencies: + babel-helper-explode-assignable-expression "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-call-delegate@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" + dependencies: + babel-helper-hoist-variables "^6.24.1" + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-define-map@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-helper-explode-assignable-expression@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa" + dependencies: + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-explode-class@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-explode-class/-/babel-helper-explode-class-6.24.1.tgz#7dc2a3910dee007056e1e31d640ced3d54eaa9eb" + dependencies: + babel-helper-bindify-decorators "^6.24.1" + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + babel-helper-function-name@7.0.0-beta.3: version "7.0.0-beta.3" resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-7.0.0-beta.3.tgz#e86dd2eb2c09e06e392e79e203fc02427b24c871" @@ -845,12 +973,72 @@ babel-helper-function-name@7.0.0-beta.3: babel-traverse "7.0.0-beta.3" babel-types "7.0.0-beta.3" +babel-helper-function-name@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" + dependencies: + babel-helper-get-function-arity "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + babel-helper-get-function-arity@7.0.0-beta.3: version "7.0.0-beta.3" resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-7.0.0-beta.3.tgz#61a47709318a31bc2db872f4be9b4c8447198be8" dependencies: babel-types "7.0.0-beta.3" +babel-helper-get-function-arity@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-hoist-variables@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-optimise-call-expression@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-regex@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72" + dependencies: + babel-runtime "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-helper-remap-async-to-generator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-replace-supers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" + dependencies: + babel-helper-optimise-call-expression "^6.24.1" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + babel-helpers@7.0.0-beta.3: version "7.0.0-beta.3" resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-7.0.0-beta.3.tgz#1758004cb44f6e4d9b7a3adfaeaa82acfddc0c4c" @@ -859,6 +1047,13 @@ babel-helpers@7.0.0-beta.3: babel-traverse "7.0.0-beta.3" babel-types "7.0.0-beta.3" +babel-helpers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-loader@8.0.0-beta.2: version "8.0.0-beta.2" resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.0.0-beta.2.tgz#4d5b67c964dc8c9cba866fd13d6b90df3acf8723" @@ -873,6 +1068,309 @@ babel-messages@^6.23.0: dependencies: babel-runtime "^6.22.0" +babel-plugin-check-es2015-constants@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-syntax-async-functions@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" + +babel-plugin-syntax-async-generators@^6.5.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz#6bc963ebb16eccbae6b92b596eb7f35c342a8b9a" + +babel-plugin-syntax-class-constructor-call@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-class-constructor-call/-/babel-plugin-syntax-class-constructor-call-6.18.0.tgz#9cb9d39fe43c8600bec8146456ddcbd4e1a76416" + +babel-plugin-syntax-class-properties@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz#d7eb23b79a317f8543962c505b827c7d6cac27de" + +babel-plugin-syntax-decorators@^6.13.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-decorators/-/babel-plugin-syntax-decorators-6.13.0.tgz#312563b4dbde3cc806cee3e416cceeaddd11ac0b" + +babel-plugin-syntax-dynamic-import@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz#8d6a26229c83745a9982a441051572caa179b1da" + +babel-plugin-syntax-exponentiation-operator@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" + +babel-plugin-syntax-export-extensions@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-export-extensions/-/babel-plugin-syntax-export-extensions-6.13.0.tgz#70a1484f0f9089a4e84ad44bac353c95b9b12721" + +babel-plugin-syntax-flow@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz#4c3ab20a2af26aa20cd25995c398c4eb70310c8d" + +babel-plugin-syntax-object-rest-spread@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" + +babel-plugin-syntax-trailing-function-commas@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" + +babel-plugin-transform-async-generator-functions@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.24.1.tgz#f058900145fd3e9907a6ddf28da59f215258a5db" + dependencies: + babel-helper-remap-async-to-generator "^6.24.1" + babel-plugin-syntax-async-generators "^6.5.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-async-to-generator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761" + dependencies: + babel-helper-remap-async-to-generator "^6.24.1" + babel-plugin-syntax-async-functions "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-class-constructor-call@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-constructor-call/-/babel-plugin-transform-class-constructor-call-6.24.1.tgz#80dc285505ac067dcb8d6c65e2f6f11ab7765ef9" + dependencies: + babel-plugin-syntax-class-constructor-call "^6.18.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-class-properties@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz#6a79763ea61d33d36f37b611aa9def81a81b46ac" + dependencies: + babel-helper-function-name "^6.24.1" + babel-plugin-syntax-class-properties "^6.8.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-decorators@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.24.1.tgz#788013d8f8c6b5222bdf7b344390dfd77569e24d" + dependencies: + babel-helper-explode-class "^6.24.1" + babel-plugin-syntax-decorators "^6.13.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-arrow-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-block-scoping@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" + dependencies: + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-plugin-transform-es2015-classes@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" + dependencies: + babel-helper-define-map "^6.24.1" + babel-helper-function-name "^6.24.1" + babel-helper-optimise-call-expression "^6.24.1" + babel-helper-replace-supers "^6.24.1" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-computed-properties@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-destructuring@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-duplicate-keys@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-for-of@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-function-name@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-modules-amd@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" + dependencies: + babel-plugin-transform-es2015-modules-commonjs "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-modules-commonjs@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz#0d8394029b7dc6abe1a97ef181e00758dd2e5d8a" + dependencies: + babel-plugin-transform-strict-mode "^6.24.1" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-types "^6.26.0" + +babel-plugin-transform-es2015-modules-systemjs@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" + dependencies: + babel-helper-hoist-variables "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-modules-umd@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" + dependencies: + babel-plugin-transform-es2015-modules-amd "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-object-super@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" + dependencies: + babel-helper-replace-supers "^6.24.1" + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-parameters@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" + dependencies: + babel-helper-call-delegate "^6.24.1" + babel-helper-get-function-arity "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-shorthand-properties@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-spread@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-sticky-regex@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" + dependencies: + babel-helper-regex "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-template-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-typeof-symbol@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-unicode-regex@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" + dependencies: + babel-helper-regex "^6.24.1" + babel-runtime "^6.22.0" + regexpu-core "^2.0.0" + +babel-plugin-transform-exponentiation-operator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" + dependencies: + babel-helper-builder-binary-assignment-operator-visitor "^6.24.1" + babel-plugin-syntax-exponentiation-operator "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-export-extensions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-export-extensions/-/babel-plugin-transform-export-extensions-6.22.0.tgz#53738b47e75e8218589eea946cbbd39109bbe653" + dependencies: + babel-plugin-syntax-export-extensions "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-flow-strip-types@^6.8.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz#84cb672935d43714fdc32bce84568d87441cf7cf" + dependencies: + babel-plugin-syntax-flow "^6.18.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-object-rest-spread@^6.22.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz#0f36692d50fef6b7e2d4b3ac1478137a963b7b06" + dependencies: + babel-plugin-syntax-object-rest-spread "^6.8.0" + babel-runtime "^6.26.0" + +babel-plugin-transform-regenerator@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" + dependencies: + regenerator-transform "^0.10.0" + +babel-plugin-transform-strict-mode@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + babel-polyfill@6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.23.0.tgz#8364ca62df8eafb830499f699177466c3b03499d" @@ -881,7 +1379,75 @@ babel-polyfill@6.23.0: core-js "^2.4.0" regenerator-runtime "^0.10.0" -babel-runtime@^6.22.0, babel-runtime@^6.26.0: +babel-preset-es2015@^6.9.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939" + dependencies: + babel-plugin-check-es2015-constants "^6.22.0" + babel-plugin-transform-es2015-arrow-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoping "^6.24.1" + babel-plugin-transform-es2015-classes "^6.24.1" + babel-plugin-transform-es2015-computed-properties "^6.24.1" + babel-plugin-transform-es2015-destructuring "^6.22.0" + babel-plugin-transform-es2015-duplicate-keys "^6.24.1" + babel-plugin-transform-es2015-for-of "^6.22.0" + babel-plugin-transform-es2015-function-name "^6.24.1" + babel-plugin-transform-es2015-literals "^6.22.0" + babel-plugin-transform-es2015-modules-amd "^6.24.1" + babel-plugin-transform-es2015-modules-commonjs "^6.24.1" + babel-plugin-transform-es2015-modules-systemjs "^6.24.1" + babel-plugin-transform-es2015-modules-umd "^6.24.1" + babel-plugin-transform-es2015-object-super "^6.24.1" + babel-plugin-transform-es2015-parameters "^6.24.1" + babel-plugin-transform-es2015-shorthand-properties "^6.24.1" + babel-plugin-transform-es2015-spread "^6.22.0" + babel-plugin-transform-es2015-sticky-regex "^6.24.1" + babel-plugin-transform-es2015-template-literals "^6.22.0" + babel-plugin-transform-es2015-typeof-symbol "^6.22.0" + babel-plugin-transform-es2015-unicode-regex "^6.24.1" + babel-plugin-transform-regenerator "^6.24.1" + +babel-preset-stage-1@^6.5.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-stage-1/-/babel-preset-stage-1-6.24.1.tgz#7692cd7dcd6849907e6ae4a0a85589cfb9e2bfb0" + dependencies: + babel-plugin-transform-class-constructor-call "^6.24.1" + babel-plugin-transform-export-extensions "^6.22.0" + babel-preset-stage-2 "^6.24.1" + +babel-preset-stage-2@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-stage-2/-/babel-preset-stage-2-6.24.1.tgz#d9e2960fb3d71187f0e64eec62bc07767219bdc1" + dependencies: + babel-plugin-syntax-dynamic-import "^6.18.0" + babel-plugin-transform-class-properties "^6.24.1" + babel-plugin-transform-decorators "^6.24.1" + babel-preset-stage-3 "^6.24.1" + +babel-preset-stage-3@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-stage-3/-/babel-preset-stage-3-6.24.1.tgz#836ada0a9e7a7fa37cb138fb9326f87934a48395" + dependencies: + babel-plugin-syntax-trailing-function-commas "^6.22.0" + babel-plugin-transform-async-generator-functions "^6.24.1" + babel-plugin-transform-async-to-generator "^6.24.1" + babel-plugin-transform-exponentiation-operator "^6.24.1" + babel-plugin-transform-object-rest-spread "^6.22.0" + +babel-register@^6.26.0, babel-register@^6.9.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" + dependencies: + babel-core "^6.26.0" + babel-runtime "^6.26.0" + core-js "^2.5.0" + home-or-tmp "^2.0.0" + lodash "^4.17.4" + mkdirp "^0.5.1" + source-map-support "^0.4.15" + +babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" dependencies: @@ -898,7 +1464,7 @@ babel-template@7.0.0-beta.3: babylon "7.0.0-beta.27" lodash "^4.2.0" -babel-template@^6.16.0: +babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" dependencies: @@ -921,7 +1487,7 @@ babel-traverse@7.0.0-beta.3: invariant "^2.2.0" lodash "^4.2.0" -babel-traverse@^6.18.0, babel-traverse@^6.26.0: +babel-traverse@^6.18.0, babel-traverse@^6.24.1, babel-traverse@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" dependencies: @@ -943,7 +1509,7 @@ babel-types@7.0.0-beta.3: lodash "^4.2.0" to-fast-properties "^2.0.0" -babel-types@^6.18.0, babel-types@^6.26.0: +babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" dependencies: @@ -960,7 +1526,7 @@ babylon@7.0.0-beta.40: version "7.0.0-beta.40" resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.40.tgz#91fc8cd56d5eb98b28e6fde41045f2957779940a" -babylon@^6.18.0: +babylon@^6.17.3, babylon@^6.18.0: version "6.18.0" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" @@ -998,12 +1564,20 @@ binary-extensions@^1.0.0: version "1.10.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.10.0.tgz#9aeb9a6c5e88638aad171e167f5900abe24835d0" +binaryextensions@2: + version "2.1.1" + resolved "https://registry.yarnpkg.com/binaryextensions/-/binaryextensions-2.1.1.tgz#3209a51ca4a4ad541a3b8d3d6a6d5b83a2485935" + block-stream@*: version "0.0.9" resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" dependencies: inherits "~2.0.0" +bluebird@^3.5.1: + version "3.5.1" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9" + bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: version "4.11.8" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" @@ -1045,6 +1619,23 @@ braces@^2.3.0: split-string "^3.0.2" to-regex "^3.0.1" +braces@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.1.tgz#7086c913b4e5a08dbe37ac0ee6a2500c4ba691bb" + dependencies: + arr-flatten "^1.1.0" + array-unique "^0.3.2" + define-property "^1.0.0" + extend-shallow "^2.0.1" + fill-range "^4.0.0" + isobject "^3.0.1" + kind-of "^6.0.2" + repeat-element "^1.1.2" + snapdragon "^0.8.1" + snapdragon-node "^2.0.1" + split-string "^3.0.2" + to-regex "^3.0.1" + brorand@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" @@ -1132,6 +1723,24 @@ builtin-status-codes@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" +cacache@^10.0.1: + version "10.0.4" + resolved "https://registry.yarnpkg.com/cacache/-/cacache-10.0.4.tgz#6452367999eff9d4188aefd9a14e9d7c6a263460" + dependencies: + bluebird "^3.5.1" + chownr "^1.0.1" + glob "^7.1.2" + graceful-fs "^4.1.11" + lru-cache "^4.1.1" + mississippi "^2.0.0" + mkdirp "^0.5.1" + move-concurrently "^1.0.1" + promise-inflight "^1.0.1" + rimraf "^2.6.2" + ssri "^5.2.4" + unique-filename "^1.1.0" + y18n "^4.0.0" + cache-base@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" @@ -1146,6 +1755,18 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" +cacheable-request@^2.1.1: + version "2.1.4" + resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-2.1.4.tgz#0d808801b6342ad33c91df9d0b44dc09b91e5c3d" + dependencies: + clone-response "1.0.2" + get-stream "3.0.0" + http-cache-semantics "3.8.1" + keyv "3.0.0" + lowercase-keys "1.0.0" + normalize-url "2.0.1" + responselike "1.0.2" + camelcase@^1.0.2: version "1.2.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" @@ -1180,7 +1801,7 @@ chai@4.1.2: pathval "^1.0.0" type-detect "^4.0.0" -chalk@1.1.3, chalk@^1.0.0, chalk@^1.1.3: +chalk@1.1.3, chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" dependencies: @@ -1190,7 +1811,15 @@ chalk@1.1.3, chalk@^1.0.0, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@2.3.1, chalk@^2.0.0, chalk@^2.3.1: +chalk@2.3.2, chalk@^2.0.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.2.tgz#250dc96b07491bfd601e648d66ddf5f60c7a5c65" + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chalk@^2.0.0, chalk@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.1.tgz#523fe2678aec7b04e8041909292fe8b17059b796" dependencies: @@ -1206,10 +1835,22 @@ chalk@^2.1.0, chalk@^2.3.0: escape-string-regexp "^1.0.5" supports-color "^4.0.0" +chalk@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-0.4.0.tgz#5199a3ddcd0c1efe23bc08c1b027b06176e0c64f" + dependencies: + ansi-styles "~1.0.0" + has-color "~0.1.0" + strip-ansi "~0.1.0" + chance@1.0.13: version "1.0.13" resolved "https://registry.yarnpkg.com/chance/-/chance-1.0.13.tgz#666bec2db42b3084456a3e4f4c28a82db5ccb7e6" +chardet@^0.4.0: + version "0.4.2" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" + charenc@~0.0.1: version "0.0.2" resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667" @@ -1233,6 +1874,14 @@ chokidar@^1.6.1, chokidar@^1.7.0: optionalDependencies: fsevents "^1.0.0" +chownr@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.0.1.tgz#e2a75042a9551908bebd25b8523d5f9769d79181" + +chrome-trace-event@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-0.1.2.tgz#90f36885d5345a50621332f0717b595883d5d982" + cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" @@ -1256,12 +1905,35 @@ class-validator@0.8.1: dependencies: validator "9.2.0" +cli-cursor@^1.0.1, cli-cursor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" + dependencies: + restore-cursor "^1.0.1" + cli-cursor@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" dependencies: restore-cursor "^2.0.0" +cli-spinners@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-0.1.2.tgz#bb764d88e185fb9e1e6a2a1f19772318f605e31c" + +cli-table@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/cli-table/-/cli-table-0.3.1.tgz#f53b05266a8b1a0b934b3d0821e6e2dc5914ae23" + dependencies: + colors "1.0.3" + +cli-truncate@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-0.2.1.tgz#9f15cfbb0705005369216c626ac7d05ab90dd574" + dependencies: + slice-ansi "0.0.4" + string-width "^1.0.1" + cli-width@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" @@ -1282,6 +1954,40 @@ cliui@^3.2.0: strip-ansi "^3.0.1" wrap-ansi "^2.0.0" +clone-buffer@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/clone-buffer/-/clone-buffer-1.0.0.tgz#e3e25b207ac4e701af721e2cb5a16792cac3dc58" + +clone-response@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" + dependencies: + mimic-response "^1.0.0" + +clone-stats@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-0.0.1.tgz#b88f94a82cf38b8791d58046ea4029ad88ca99d1" + +clone-stats@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-1.0.0.tgz#b3782dff8bb5474e18b9b6bf0fdfe782f8777680" + +clone@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.3.tgz#298d7e2231660f40c003c2ed3140decf3f53085f" + +clone@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.1.tgz#d217d1e961118e3ac9a4b8bba3285553bf647cdb" + +cloneable-readable@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/cloneable-readable/-/cloneable-readable-1.0.0.tgz#a6290d413f217a61232f95e458ff38418cfb0117" + dependencies: + inherits "^2.0.1" + process-nextick-args "^1.0.6" + through2 "^2.0.1" + co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" @@ -1290,6 +1996,14 @@ code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" +codecov@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/codecov/-/codecov-3.0.0.tgz#c273b8c4f12945723e8dc9d25803d89343e5f28e" + dependencies: + argv "0.0.2" + request "2.81.0" + urlgrey "0.4.4" + collection-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" @@ -1307,6 +2021,14 @@ color-name@^1.1.1: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" +colors@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b" + +colors@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" + combined-stream@^1.0.5, combined-stream@~1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" @@ -1321,7 +2043,7 @@ commander@2.14.1, commander@^2.8.1: version "2.14.1" resolved "https://registry.yarnpkg.com/commander/-/commander-2.14.1.tgz#2235123e37af8ca3c65df45b026dbd357b01b9aa" -commander@^2.12.1: +commander@^2.12.1, commander@~2.13.0: version "2.13.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c" @@ -1345,6 +2067,14 @@ concat-stream@^1.4.7: readable-stream "^2.2.2" typedarray "^0.0.6" +concat-stream@^1.5.0: + version "1.6.1" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.1.tgz#261b8f518301f1d834e36342b9fea095d2620a26" + dependencies: + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" + console-browserify@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" @@ -1359,10 +2089,21 @@ constants-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" -convert-source-map@^1.1.0: +convert-source-map@^1.1.0, convert-source-map@^1.5.0: version "1.5.1" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" +copy-concurrently@^1.0.0: + version "1.0.5" + resolved "https://registry.yarnpkg.com/copy-concurrently/-/copy-concurrently-1.0.5.tgz#92297398cae34937fcafd6ec8139c18051f0b5e0" + dependencies: + aproba "^1.1.1" + fs-write-stream-atomic "^1.0.8" + iferr "^0.1.5" + mkdirp "^0.5.1" + rimraf "^2.5.4" + run-queue "^1.0.0" + copy-descriptor@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" @@ -1371,7 +2112,7 @@ core-js@^2.4.0: version "2.5.1" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.1.tgz#ae6874dc66937789b80754ff5428df66819ca50b" -core-js@^2.5.3: +core-js@^2.4.1, core-js@^2.5.0, core-js@^2.5.3: version "2.5.3" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.3.tgz#8acc38345824f16d8365b7c9b4259168e8ed603e" @@ -1424,6 +2165,16 @@ cross-spawn@^5.0.1: shebang-command "^1.2.0" which "^1.2.9" +cross-spawn@^6.0.4: + version "6.0.4" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.4.tgz#bbf44ccb30fb8314a08f178b62290c669c36d808" + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + crypt@~0.0.1: version "0.0.2" resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b" @@ -1450,11 +2201,13 @@ crypto-browserify@^3.11.0: randombytes "^2.0.0" randomfill "^1.0.3" -d@1: - version "1.0.0" - resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" - dependencies: - es5-ext "^0.10.9" +cyclist@~0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-0.2.2.tgz#1b33792e11e914a2fd6d6ed6447464444e5fa640" + +dargs@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/dargs/-/dargs-5.1.0.tgz#ec7ea50c78564cd36c9d5ec18f66329fade27829" dashdash@^1.12.0: version "1.14.1" @@ -1462,17 +2215,25 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" +date-fns@^1.27.2: + version "1.29.0" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.29.0.tgz#12e609cdcb935127311d04d33334e2960a2a54e6" + date-now@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" +dateformat@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-2.2.0.tgz#4065e2013cf9fb916ddfd82efb506ad4c6769062" + debug@3.1.0, debug@^3.0.1, debug@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" dependencies: ms "2.0.0" -debug@^2.2.0, debug@^2.3.3, debug@^2.6.8: +debug@^2.0.0, debug@^2.1.0, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" dependencies: @@ -1486,13 +2247,19 @@ decode-uri-component@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" +decompress-response@^3.2.0, decompress-response@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" + dependencies: + mimic-response "^1.0.0" + deep-eql@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" dependencies: type-detect "^4.0.0" -deep-extend@~0.4.0: +deep-extend@^0.4.0, deep-extend@~0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f" @@ -1518,6 +2285,13 @@ define-property@^1.0.0: dependencies: is-descriptor "^1.0.0" +define-property@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + dependencies: + is-descriptor "^1.0.2" + isobject "^3.0.1" + delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" @@ -1533,6 +2307,10 @@ des.js@^1.0.0: inherits "^2.0.1" minimalistic-assert "^1.0.0" +detect-conflict@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/detect-conflict/-/detect-conflict-1.0.1.tgz#088657a66a961c05019db7c4230883b1c6b4176e" + detect-indent@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" @@ -1547,6 +2325,14 @@ diff@3.3.1, diff@^3.1.0, diff@^3.2.0: version "3.3.1" resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.1.tgz#aa8567a6eed03c531fc89d3f711cd0e5259dec75" +diff@^2.1.2: + version "2.2.3" + resolved "https://registry.yarnpkg.com/diff/-/diff-2.2.3.tgz#60eafd0d28ee906e4e8ff0a52c1229521033bf99" + +diff@^3.3.0, diff@^3.3.1: + version "3.4.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.4.0.tgz#b1d85507daf3964828de54b37d0d73ba67dda56c" + diffie-hellman@^5.0.0: version "5.0.2" resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.2.tgz#b5835739270cfe26acf632099fded2a07f209e5e" @@ -1562,20 +2348,49 @@ doctrine@0.7.2: esutils "^1.1.6" isarray "0.0.1" +dom-walk@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.1.tgz#672226dc74c8f799ad35307df936aba11acd6018" + domain-browser@^1.1.1: version "1.1.7" resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.1.7.tgz#867aa4b093faa05f1de08c06f4d7b21fdf8698bc" +duplexer3@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" + +duplexify@^3.4.2, duplexify@^3.5.3: + version "3.5.4" + resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.5.4.tgz#4bb46c1796eabebeec4ca9a2e66b808cb7a3d8b4" + dependencies: + end-of-stream "^1.0.0" + inherits "^2.0.1" + readable-stream "^2.0.0" + stream-shift "^1.0.0" + ecc-jsbn@~0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" dependencies: jsbn "~0.1.0" +editions@^1.3.3: + version "1.3.4" + resolved "https://registry.yarnpkg.com/editions/-/editions-1.3.4.tgz#3662cb592347c3168eb8e498a0ff73271d67f50b" + +ejs@^2.3.1: + version "2.5.7" + resolved "https://registry.yarnpkg.com/ejs/-/ejs-2.5.7.tgz#cc872c168880ae3c7189762fd5ffc00896c9518a" + electron-to-chromium@^1.3.33: version "1.3.34" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.34.tgz#d93498f40391bb0c16a603d8241b9951404157ed" +elegant-spinner@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e" + elliptic@^6.0.0: version "6.4.0" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.0.tgz#cac9af8762c85836187003c8dfe193e5e2eae5df" @@ -1598,6 +2413,12 @@ encoding@^0.1.11: dependencies: iconv-lite "~0.4.13" +end-of-stream@^1.0.0, end-of-stream@^1.1.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" + dependencies: + once "^1.4.0" + enhanced-resolve@3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-3.3.0.tgz#950964ecc7f0332a42321b673b38dc8ff15535b3" @@ -1607,14 +2428,13 @@ enhanced-resolve@3.3.0: object-assign "^4.0.1" tapable "^0.2.5" -enhanced-resolve@^3.4.0: - version "3.4.1" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-3.4.1.tgz#0421e339fd71419b3da13d129b3979040230476e" +enhanced-resolve@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.0.0.tgz#e34a6eaa790f62fccd71d93959f56b2b432db10a" dependencies: graceful-fs "^4.1.2" memory-fs "^0.4.0" - object-assign "^4.0.1" - tapable "^0.2.7" + tapable "^1.0.0" errno@^0.1.3: version "0.1.4" @@ -1622,63 +2442,24 @@ errno@^0.1.3: dependencies: prr "~0.0.0" +errno@~0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" + dependencies: + prr "~1.0.1" + error-ex@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" dependencies: is-arrayish "^0.2.1" -es5-ext@^0.10.14, es5-ext@^0.10.35, es5-ext@^0.10.9, es5-ext@~0.10.14: - version "0.10.35" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.35.tgz#18ee858ce6a3c45c7d79e91c15fcca9ec568494f" +error@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/error/-/error-7.0.2.tgz#a5f75fff4d9926126ddac0ea5dc38e689153cb02" dependencies: - es6-iterator "~2.0.1" - es6-symbol "~3.1.1" - -es6-iterator@^2.0.1, es6-iterator@~2.0.1: - version "2.0.3" - resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" - dependencies: - d "1" - es5-ext "^0.10.35" - es6-symbol "^3.1.1" - -es6-map@^0.1.3: - version "0.1.5" - resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.5.tgz#9136e0503dcc06a301690f0bb14ff4e364e949f0" - dependencies: - d "1" - es5-ext "~0.10.14" - es6-iterator "~2.0.1" - es6-set "~0.1.5" - es6-symbol "~3.1.1" - event-emitter "~0.3.5" - -es6-set@~0.1.5: - version "0.1.5" - resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" - dependencies: - d "1" - es5-ext "~0.10.14" - es6-iterator "~2.0.1" - es6-symbol "3.1.1" - event-emitter "~0.3.5" - -es6-symbol@3.1.1, es6-symbol@^3.1.1, es6-symbol@~3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" - dependencies: - d "1" - es5-ext "~0.10.14" - -es6-weak-map@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f" - dependencies: - d "1" - es5-ext "^0.10.14" - es6-iterator "^2.0.1" - es6-symbol "^3.1.1" + string-template "~0.2.1" + xtend "~4.0.0" escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" @@ -1695,16 +2476,14 @@ escodegen-wallaby@1.6.18: optionalDependencies: source-map "~0.2.0" -escope@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3" +eslint-scope@^3.7.1: + version "3.7.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" dependencies: - es6-map "^0.1.3" - es6-weak-map "^2.0.1" esrecurse "^4.1.0" estraverse "^4.1.1" -esprima@4.0.0, esprima@^4.0.0: +esprima@4.0.0, esprima@^4.0.0, esprima@~4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" @@ -1735,13 +2514,6 @@ esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" -event-emitter@~0.3.5: - version "0.3.5" - resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" - dependencies: - d "1" - es5-ext "~0.10.14" - eventemitter3@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-2.0.3.tgz#b5e1079b59fb5e1ba2771c0a993be060a58c99ba" @@ -1769,6 +2541,10 @@ execa@^0.7.0: signal-exit "^3.0.0" strip-eof "^1.0.0" +exit-hook@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" + expand-brackets@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" @@ -1793,16 +2569,37 @@ expand-range@^1.8.1: dependencies: fill-range "^2.1.0" +expand-tilde@^2.0.0, expand-tilde@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/expand-tilde/-/expand-tilde-2.0.2.tgz#97e801aa052df02454de46b02bf621642cdc8502" + dependencies: + homedir-polyfill "^1.0.1" + extend-shallow@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" dependencies: is-extendable "^0.1.0" -extend@~3.0.0: +extend-shallow@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + dependencies: + assign-symbols "^1.0.0" + is-extendable "^1.0.1" + +extend@^3.0.0, extend@~3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" +external-editor@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-1.1.1.tgz#12d7b0db850f7ff7e7081baf4005700060c4600b" + dependencies: + extend "^3.0.0" + spawn-sync "^1.0.15" + tmp "^0.0.29" + external-editor@^2.0.1: version "2.0.5" resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.0.5.tgz#52c249a3981b9ba187c7cacf5beb50bf1d91a6bc" @@ -1811,6 +2608,14 @@ external-editor@^2.0.1: jschardet "^1.4.2" tmp "^0.0.33" +external-editor@^2.0.4, external-editor@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.1.0.tgz#3d026a21b7f95b5726387d4200ac160d372c3b48" + dependencies: + chardet "^0.4.0" + iconv-lite "^0.4.17" + tmp "^0.0.33" + extglob@^0.3.1: version "0.3.2" resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" @@ -1830,6 +2635,19 @@ extglob@^2.0.2: snapdragon "^0.8.1" to-regex "^3.0.1" +extglob@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + dependencies: + array-unique "^0.3.2" + define-property "^1.0.0" + expand-brackets "^2.1.4" + extend-shallow "^2.0.1" + fragment-cache "^0.2.1" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + extsprintf@1.3.0, extsprintf@^1.2.0: version "1.3.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" @@ -1846,6 +2664,13 @@ fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" +figures@^1.3.5, figures@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" + dependencies: + escape-string-regexp "^1.0.5" + object-assign "^4.1.0" + figures@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" @@ -1896,6 +2721,23 @@ find-up@^2.0.0, find-up@^2.1.0: dependencies: locate-path "^2.0.0" +first-chunk-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/first-chunk-stream/-/first-chunk-stream-2.0.0.tgz#1bdecdb8e083c0664b91945581577a43a9f31d70" + dependencies: + readable-stream "^2.0.2" + +flow-parser@^0.*: + version "0.66.0" + resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.66.0.tgz#be583fefb01192aa5164415d31a6241b35718983" + +flush-write-stream@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.0.2.tgz#c81b90d8746766f1a609a46809946c45dd8ae417" + dependencies: + inherits "^2.0.1" + readable-stream "^2.0.4" + for-in@^1.0.1, for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" @@ -1930,10 +2772,26 @@ fragment-cache@^0.2.1: dependencies: map-cache "^0.2.2" +from2@^2.1.0, from2@^2.1.1: + version "2.3.0" + resolved "https://registry.yarnpkg.com/from2/-/from2-2.3.0.tgz#8bfb5502bde4a4d36cfdeea007fcca21d7e382af" + dependencies: + inherits "^2.0.1" + readable-stream "^2.0.0" + fs-readdir-recursive@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.0.0.tgz#8cd1745c8b4f8a29c8caec392476921ba195f560" +fs-write-stream-atomic@^1.0.8: + version "1.0.10" + resolved "https://registry.yarnpkg.com/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz#b47df53493ef911df75731e70a9ded0189db40c9" + dependencies: + graceful-fs "^4.1.2" + iferr "^0.1.5" + imurmurhash "^0.1.4" + readable-stream "1 || 2" + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -1983,7 +2841,7 @@ get-func-name@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" -get-stream@^3.0.0: +get-stream@3.0.0, get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" @@ -1997,6 +2855,26 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" +gh-got@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/gh-got/-/gh-got-6.0.0.tgz#d74353004c6ec466647520a10bd46f7299d268d0" + dependencies: + got "^7.0.0" + is-plain-obj "^1.1.0" + +github-username@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/github-username/-/github-username-4.1.0.tgz#cbe280041883206da4212ae9e4b5f169c30bf417" + dependencies: + gh-got "^6.0.0" + +glob-all@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/glob-all/-/glob-all-3.1.0.tgz#8913ddfb5ee1ac7812656241b03d5217c64b02ab" + dependencies: + glob "^7.0.5" + yargs "~1.2.6" + glob-base@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" @@ -2010,7 +2888,7 @@ glob-parent@^2.0.0: dependencies: is-glob "^2.0.0" -glob@7.1.2, glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1: +glob@7.1.2, glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" dependencies: @@ -2021,6 +2899,41 @@ glob@7.1.2, glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1: once "^1.3.0" path-is-absolute "^1.0.0" +glob@^6.0.1: + version "6.0.4" + resolved "https://registry.yarnpkg.com/glob/-/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22" + dependencies: + inflight "^1.0.4" + inherits "2" + minimatch "2 || 3" + once "^1.3.0" + path-is-absolute "^1.0.0" + +global-modules@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-1.0.0.tgz#6d770f0eb523ac78164d72b5e71a8877265cc3ea" + dependencies: + global-prefix "^1.0.1" + is-windows "^1.0.1" + resolve-dir "^1.0.0" + +global-prefix@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-1.0.2.tgz#dbf743c6c14992593c655568cb66ed32c0122ebe" + dependencies: + expand-tilde "^2.0.2" + homedir-polyfill "^1.0.1" + ini "^1.3.4" + is-windows "^1.0.1" + which "^1.2.14" + +global@^4.3.2: + version "4.3.2" + resolved "https://registry.yarnpkg.com/global/-/global-4.3.2.tgz#e76989268a6c74c38908b1305b10fc0e394e9d0f" + dependencies: + min-document "^2.19.0" + process "~0.5.1" + globals@^10.0.0: version "10.4.0" resolved "https://registry.yarnpkg.com/globals/-/globals-10.4.0.tgz#5c477388b128a9e4c5c5d01c7a2aca68c68b2da7" @@ -2033,10 +2946,78 @@ globals@^9.18.0: version "9.18.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" +globby@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-4.1.0.tgz#080f54549ec1b82a6c60e631fc82e1211dbe95f8" + dependencies: + array-union "^1.0.1" + arrify "^1.0.0" + glob "^6.0.1" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +globby@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c" + dependencies: + array-union "^1.0.1" + glob "^7.0.3" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +got@^7.0.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/got/-/got-7.1.0.tgz#05450fd84094e6bbea56f451a43a9c289166385a" + dependencies: + decompress-response "^3.2.0" + duplexer3 "^0.1.4" + get-stream "^3.0.0" + is-plain-obj "^1.1.0" + is-retry-allowed "^1.0.0" + is-stream "^1.0.0" + isurl "^1.0.0-alpha5" + lowercase-keys "^1.0.0" + p-cancelable "^0.3.0" + p-timeout "^1.1.1" + safe-buffer "^5.0.1" + timed-out "^4.0.0" + url-parse-lax "^1.0.0" + url-to-options "^1.0.1" + +got@^8.2.0: + version "8.2.0" + resolved "https://registry.yarnpkg.com/got/-/got-8.2.0.tgz#0d11a071d05046348a2f5c0a5fa047fb687fdfc6" + dependencies: + "@sindresorhus/is" "^0.7.0" + cacheable-request "^2.1.1" + decompress-response "^3.3.0" + duplexer3 "^0.1.4" + get-stream "^3.0.0" + into-stream "^3.1.0" + is-retry-allowed "^1.1.0" + isurl "^1.0.0-alpha5" + lowercase-keys "^1.0.0" + mimic-response "^1.0.0" + p-cancelable "^0.3.0" + p-timeout "^2.0.1" + pify "^3.0.0" + safe-buffer "^5.1.1" + timed-out "^4.0.1" + url-parse-lax "^3.0.0" + url-to-options "^1.0.1" + graceful-fs@^4.1.11, graceful-fs@^4.1.2: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" +grouped-queue@^0.3.0, grouped-queue@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/grouped-queue/-/grouped-queue-0.3.3.tgz#c167d2a5319c5a0e0964ef6a25b7c2df8996c85c" + dependencies: + lodash "^4.17.2" + growl@1.10.3: version "1.10.3" resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.3.tgz#1926ba90cf3edfe2adb4927f5880bc22c66c790f" @@ -2068,6 +3049,10 @@ has-ansi@^2.0.0: dependencies: ansi-regex "^2.0.0" +has-color@~0.1.0: + version "0.1.7" + resolved "https://registry.yarnpkg.com/has-color/-/has-color-0.1.7.tgz#67144a5260c34fc3cca677d041daf52fe7b78b2f" + has-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" @@ -2080,6 +3065,16 @@ has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" +has-symbol-support-x@^1.4.1: + version "1.4.2" + resolved "https://registry.yarnpkg.com/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz#1409f98bc00247da45da67cee0a36f282ff26455" + +has-to-string-tag-x@^1.2.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz#a045ab383d7b4b2012a00148ab0aa5f290044d4d" + dependencies: + has-symbol-support-x "^1.4.1" + has-unicode@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" @@ -2156,10 +3151,27 @@ hoek@2.x.x: version "2.16.3" resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" +home-or-tmp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.1" + +homedir-polyfill@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz#4c2bbc8a758998feebf5ed68580f76d46768b4bc" + dependencies: + parse-passwd "^1.0.0" + hosted-git-info@^2.1.4: version "2.5.0" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.5.0.tgz#6d60e34b3abbc8313062c3b798ef8d901a07af3c" +http-cache-semantics@3.8.1: + version "3.8.1" + resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz#39b0e16add9b605bf0a9ef3d9daaf4843b4cacd2" + http-signature@~1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf" @@ -2180,6 +3192,24 @@ ieee754@^1.1.4: version "1.1.8" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4" +iferr@^0.1.5: + version "0.1.5" + resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + +indent-string@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-2.1.0.tgz#8e2d48348742121b4a8218b7a137e9a52049dc80" + dependencies: + repeating "^2.0.0" + +indent-string@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" + indexof@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" @@ -2199,6 +3229,10 @@ inherits@2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" +ini@^1.3.4: + version "1.3.5" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" + ini@~1.3.0: version "1.3.4" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e" @@ -2221,9 +3255,72 @@ inquirer@3.0.6: strip-ansi "^3.0.0" through "^2.3.6" -interpret@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.4.tgz#820cdd588b868ffb191a809506d6c9c8f212b1b0" +inquirer@^1.0.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-1.2.3.tgz#4dec6f32f37ef7bb0b2ed3f1d1a5c3f545074918" + dependencies: + ansi-escapes "^1.1.0" + chalk "^1.0.0" + cli-cursor "^1.0.1" + cli-width "^2.0.0" + external-editor "^1.1.0" + figures "^1.3.5" + lodash "^4.3.0" + mute-stream "0.0.6" + pinkie-promise "^2.0.0" + run-async "^2.2.0" + rx "^4.1.0" + string-width "^1.0.1" + strip-ansi "^3.0.0" + through "^2.3.6" + +inquirer@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9" + dependencies: + ansi-escapes "^3.0.0" + chalk "^2.0.0" + cli-cursor "^2.1.0" + cli-width "^2.0.0" + external-editor "^2.0.4" + figures "^2.0.0" + lodash "^4.3.0" + mute-stream "0.0.7" + run-async "^2.2.0" + rx-lite "^4.0.8" + rx-lite-aggregates "^4.0.8" + string-width "^2.1.0" + strip-ansi "^4.0.0" + through "^2.3.6" + +inquirer@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-5.1.0.tgz#19da508931892328abbbdd4c477f1efc65abfd67" + dependencies: + ansi-escapes "^3.0.0" + chalk "^2.0.0" + cli-cursor "^2.1.0" + cli-width "^2.0.0" + external-editor "^2.1.0" + figures "^2.0.0" + lodash "^4.3.0" + mute-stream "0.0.7" + run-async "^2.2.0" + rxjs "^5.5.2" + string-width "^2.1.0" + strip-ansi "^4.0.0" + through "^2.3.6" + +interpret@^1.0.0, interpret@^1.0.4: + version "1.1.0" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614" + +into-stream@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/into-stream/-/into-stream-3.1.0.tgz#96fb0a936c12babd6ff1752a17d05616abd094c6" + dependencies: + from2 "^2.1.1" + p-is-promise "^1.1.0" invariant@^2.2.0: version "2.2.3" @@ -2251,6 +3348,12 @@ is-accessor-descriptor@^0.1.6: dependencies: kind-of "^3.0.2" +is-accessor-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + dependencies: + kind-of "^6.0.0" + is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" @@ -2277,6 +3380,12 @@ is-data-descriptor@^0.1.4: dependencies: kind-of "^3.0.2" +is-data-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + dependencies: + kind-of "^6.0.0" + is-descriptor@^0.1.0: version "0.1.6" resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" @@ -2293,6 +3402,14 @@ is-descriptor@^1.0.0: is-data-descriptor "^0.1.4" kind-of "^5.0.0" +is-descriptor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + dependencies: + is-accessor-descriptor "^1.0.0" + is-data-descriptor "^1.0.0" + kind-of "^6.0.2" + is-dotfile@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" @@ -2307,6 +3424,12 @@ is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" +is-extendable@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + dependencies: + is-plain-object "^2.0.4" + is-extglob@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" @@ -2345,17 +3468,37 @@ is-number@^3.0.0: dependencies: kind-of "^3.0.2" +is-number@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" + +is-object@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.1.tgz#8952688c5ec2ffd6b03ecc85e769e02903083470" + +is-observable@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/is-observable/-/is-observable-0.2.0.tgz#b361311d83c6e5d726cabf5e250b0237106f5ae2" + dependencies: + symbol-observable "^0.2.2" + is-odd@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-odd/-/is-odd-1.0.0.tgz#3b8a932eb028b3775c39bb09e91767accdb69088" dependencies: is-number "^3.0.0" -is-plain-obj@^1.1.0: +is-odd@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-odd/-/is-odd-2.0.0.tgz#7646624671fd7ea558ccd9a2795182f2958f1b24" + dependencies: + is-number "^4.0.0" + +is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" -is-plain-object@^2.0.1, is-plain-object@^2.0.3: +is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" dependencies: @@ -2373,7 +3516,17 @@ is-promise@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" -is-stream@^1.0.1, is-stream@^1.1.0: +is-retry-allowed@^1.0.0, is-retry-allowed@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz#11a060568b67339444033d0125a61a20d564fb34" + +is-scoped@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-scoped/-/is-scoped-1.0.0.tgz#449ca98299e713038256289ecb2b540dc437cb30" + dependencies: + scoped-regex "^1.0.0" + +is-stream@^1.0.0, is-stream@^1.0.1, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" @@ -2385,6 +3538,10 @@ is-utf8@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" +is-windows@^1.0.1, is-windows@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + isarray@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" @@ -2487,6 +3644,21 @@ istanbul@1.1.0-alpha.1: which "^1.1.1" wordwrap "^1.0.0" +istextorbinary@^2.1.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/istextorbinary/-/istextorbinary-2.2.1.tgz#a5231a08ef6dd22b268d0895084cf8d58b5bec53" + dependencies: + binaryextensions "2" + editions "^1.3.3" + textextensions "2" + +isurl@^1.0.0-alpha5: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isurl/-/isurl-1.0.0.tgz#b27f4f49f3cdaa3ea44a0a5b7f3462e6edc39d67" + dependencies: + has-to-string-tag-x "^1.2.0" + is-object "^1.0.1" + js-string-escape@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/js-string-escape/-/js-string-escape-1.0.1.tgz#e2625badbc0d67c7533e9edc1068c587ae4137ef" @@ -2510,6 +3682,26 @@ jschardet@^1.4.2: version "1.6.0" resolved "https://registry.yarnpkg.com/jschardet/-/jschardet-1.6.0.tgz#c7d1a71edcff2839db2f9ec30fc5d5ebd3c1a678" +jscodeshift@^0.4.0, jscodeshift@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/jscodeshift/-/jscodeshift-0.4.1.tgz#da91a1c2eccfa03a3387a21d39948e251ced444a" + dependencies: + async "^1.5.0" + babel-plugin-transform-flow-strip-types "^6.8.0" + babel-preset-es2015 "^6.9.0" + babel-preset-stage-1 "^6.5.0" + babel-register "^6.9.0" + babylon "^6.17.3" + colors "^1.1.2" + flow-parser "^0.*" + lodash "^4.13.1" + micromatch "^2.3.7" + node-dir "0.1.8" + nomnom "^1.8.1" + recast "^0.12.5" + temp "^0.8.1" + write-file-atomic "^1.2.0" + jsesc@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" @@ -2522,9 +3714,9 @@ jsesc@~0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" -json-loader@^0.5.4: - version "0.5.7" - resolved "https://registry.yarnpkg.com/json-loader/-/json-loader-0.5.7.tgz#dca14a70235ff82f0ac9a3abeb60d337a365185d" +json-buffer@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" json-schema-traverse@^0.3.0: version "0.3.1" @@ -2565,6 +3757,12 @@ just-extend@^1.1.26: version "1.1.27" resolved "https://registry.yarnpkg.com/just-extend/-/just-extend-1.1.27.tgz#ec6e79410ff914e472652abfa0e603c03d60e905" +keyv@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.0.0.tgz#44923ba39e68b12a7cec7df6c3268c031f2ef373" + dependencies: + json-buffer "3.0.0" + kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" @@ -2585,6 +3783,10 @@ kind-of@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.0.tgz#3606e9e2fa960e7ddaa8898c03804e47e5d66644" +kind-of@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" + lazy-cache@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" @@ -2612,6 +3814,54 @@ levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" +listr-silent-renderer@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz#924b5a3757153770bf1a8e3fbf74b8bbf3f9242e" + +listr-update-renderer@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/listr-update-renderer/-/listr-update-renderer-0.4.0.tgz#344d980da2ca2e8b145ba305908f32ae3f4cc8a7" + dependencies: + chalk "^1.1.3" + cli-truncate "^0.2.1" + elegant-spinner "^1.0.1" + figures "^1.7.0" + indent-string "^3.0.0" + log-symbols "^1.0.2" + log-update "^1.0.2" + strip-ansi "^3.0.1" + +listr-verbose-renderer@^0.4.0: + version "0.4.1" + resolved "https://registry.yarnpkg.com/listr-verbose-renderer/-/listr-verbose-renderer-0.4.1.tgz#8206f4cf6d52ddc5827e5fd14989e0e965933a35" + dependencies: + chalk "^1.1.3" + cli-cursor "^1.0.2" + date-fns "^1.27.2" + figures "^1.7.0" + +listr@^0.13.0: + version "0.13.0" + resolved "https://registry.yarnpkg.com/listr/-/listr-0.13.0.tgz#20bb0ba30bae660ee84cc0503df4be3d5623887d" + dependencies: + chalk "^1.1.3" + cli-truncate "^0.2.1" + figures "^1.7.0" + indent-string "^2.1.0" + is-observable "^0.2.0" + is-promise "^2.1.0" + is-stream "^1.1.0" + listr-silent-renderer "^1.1.1" + listr-update-renderer "^0.4.0" + listr-verbose-renderer "^0.4.0" + log-symbols "^1.0.2" + log-update "^1.0.2" + ora "^0.2.3" + p-map "^1.1.1" + rxjs "^5.4.2" + stream-to-observable "^0.2.0" + strip-ansi "^3.0.1" + load-json-file@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" @@ -2644,18 +3894,37 @@ lodash.get@^4.4.2: version "4.4.2" resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" +lodash@^4.11.1, lodash@^4.13.1, lodash@^4.17.2, lodash@^4.17.5, lodash@^4.2.0: + version "4.17.5" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511" + lodash@^4.14.0, lodash@^4.17.4, lodash@^4.3.0: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" -lodash@^4.2.0: - version "4.17.5" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511" - log-driver@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.5.tgz#7ae4ec257302fd790d557cb10c97100d857b0056" +log-symbols@2.2.0, log-symbols@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" + dependencies: + chalk "^2.0.1" + +log-symbols@^1.0.1, log-symbols@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18" + dependencies: + chalk "^1.0.0" + +log-update@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/log-update/-/log-update-1.0.2.tgz#19929f64c4093d2d2e7075a1dad8af59c296b8d1" + dependencies: + ansi-escapes "^1.0.0" + cli-cursor "^1.0.2" + lolex@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/lolex/-/lolex-1.6.0.tgz#3a9a0283452a47d7439e72731b9e07d7386e49f6" @@ -2674,7 +3943,11 @@ loose-envify@^1.0.0: dependencies: js-tokens "^3.0.0" -lru-cache@^4.0.1: +lowercase-keys@1.0.0, lowercase-keys@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.0.tgz#4e3366b39e7f5457e35f1324bdf6f88d0bfc7306" + +lru-cache@^4.0.1, lru-cache@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.1.tgz#622e32e82488b49279114a4f9ecf45e7cd6bba55" dependencies: @@ -2716,6 +3989,29 @@ md5@2.2.1: crypt "~0.0.1" is-buffer "~1.1.1" +mem-fs-editor@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/mem-fs-editor/-/mem-fs-editor-3.0.2.tgz#dd0a6eaf2bb8a6b37740067aa549eb530105af9f" + dependencies: + commondir "^1.0.1" + deep-extend "^0.4.0" + ejs "^2.3.1" + glob "^7.0.3" + globby "^6.1.0" + mkdirp "^0.5.0" + multimatch "^2.0.0" + rimraf "^2.2.8" + through2 "^2.0.0" + vinyl "^2.0.1" + +mem-fs@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/mem-fs/-/mem-fs-1.1.3.tgz#b8ae8d2e3fcb6f5d3f9165c12d4551a065d989cc" + dependencies: + through2 "^2.0.0" + vinyl "^1.1.0" + vinyl-file "^2.0.0" + mem@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" @@ -2729,7 +4025,7 @@ memory-fs@^0.4.0, memory-fs@~0.4.1: errno "^0.1.3" readable-stream "^2.0.1" -micromatch@^2.1.5, micromatch@^2.3.11: +micromatch@^2.1.5, micromatch@^2.3.11, micromatch@^2.3.7: version "2.3.11" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" dependencies: @@ -2765,6 +4061,24 @@ micromatch@^3.0.3: snapdragon "^0.8.1" to-regex "^3.0.1" +micromatch@^3.1.8: + version "3.1.9" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.9.tgz#15dc93175ae39e52e93087847096effc73efcf89" + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + braces "^2.3.1" + define-property "^2.0.2" + extend-shallow "^3.0.2" + extglob "^2.0.4" + fragment-cache "^0.2.1" + kind-of "^6.0.2" + nanomatch "^1.2.9" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + miller-rabin@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" @@ -2786,6 +4100,16 @@ mimic-fn@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" +mimic-response@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.0.tgz#df3d3652a73fded6b9b0b24146e6fd052353458e" + +min-document@^2.19.0: + version "2.19.0" + resolved "https://registry.yarnpkg.com/min-document/-/min-document-2.19.0.tgz#7bd282e3f5842ed295bb748cdd9f1ffa2c824685" + dependencies: + dom-walk "^0.1.0" + minimalistic-assert@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz#702be2dda6b37f4836bcb3f5db56641b64a1d3d3" @@ -2794,7 +4118,7 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" -minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4: +"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" dependencies: @@ -2808,6 +4132,25 @@ minimist@1.2.0, minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" +minimist@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.1.0.tgz#99df657a52574c21c9057497df742790b2b4c0de" + +mississippi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-2.0.0.tgz#3442a508fafc28500486feea99409676e4ee5a6f" + dependencies: + concat-stream "^1.5.0" + duplexify "^3.4.2" + end-of-stream "^1.1.0" + flush-write-stream "^1.0.0" + from2 "^2.1.0" + parallel-transform "^1.1.0" + pump "^2.0.1" + pumpify "^1.3.3" + stream-each "^1.1.0" + through2 "^2.0.0" + mixin-deep@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.2.0.tgz#d02b8c6f8b6d4b8f5982d3fd009c4919851c3fe2" @@ -2815,7 +4158,7 @@ mixin-deep@^1.2.0: for-in "^1.0.2" is-extendable "^0.1.1" -mkdirp@0.5.1, mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.1, mkdirp@~0.5.0: +mkdirp@0.5.1, mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: @@ -2836,11 +4179,22 @@ mocha@5.0.1: mkdirp "0.5.1" supports-color "4.4.0" +move-concurrently@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92" + dependencies: + aproba "^1.1.1" + copy-concurrently "^1.0.0" + fs-write-stream-atomic "^1.0.8" + mkdirp "^0.5.1" + rimraf "^2.5.4" + run-queue "^1.0.3" + ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" -multimatch@2.1.0: +multimatch@2.1.0, multimatch@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/multimatch/-/multimatch-2.1.0.tgz#9c7906a22fb4c02919e2f5f75161b4cdbd4b2a2b" dependencies: @@ -2849,6 +4203,10 @@ multimatch@2.1.0: arrify "^1.0.0" minimatch "^3.0.0" +mute-stream@0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.6.tgz#48962b19e169fd1dfc240b3f1e7317627bbc47db" + mute-stream@0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" @@ -2873,10 +4231,35 @@ nanomatch@^1.2.5: snapdragon "^0.8.1" to-regex "^3.0.1" +nanomatch@^1.2.9: + version "1.2.9" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.9.tgz#879f7150cb2dab7a471259066c104eee6e0fa7c2" + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + define-property "^2.0.2" + extend-shallow "^3.0.2" + fragment-cache "^0.2.1" + is-odd "^2.0.0" + is-windows "^1.0.2" + kind-of "^6.0.2" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + native-promise-only@^0.8.1: version "0.8.1" resolved "https://registry.yarnpkg.com/native-promise-only/-/native-promise-only-0.8.1.tgz#20a318c30cb45f71fe7adfbf7b21c99c1472ef11" +neo-async@^2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.5.0.tgz#76b1c823130cca26acfbaccc8fbaf0a2fa33b18f" + +nice-try@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.4.tgz#d93962f6c52f2c1558c0fbda6d512819f1efe1c4" + nise@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/nise/-/nise-1.2.0.tgz#079d6cadbbcb12ba30e38f1c999f36ad4d6baa53" @@ -2887,6 +4270,10 @@ nise@^1.2.0: path-to-regexp "^1.7.0" text-encoding "^0.6.4" +node-dir@0.1.8: + version "0.1.8" + resolved "https://registry.yarnpkg.com/node-dir/-/node-dir-0.1.8.tgz#55fb8deb699070707fb67f91a460f0448294c77d" + node-fetch@1.6.3: version "1.6.3" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.6.3.tgz#dc234edd6489982d58e8f0db4f695029abcd8c04" @@ -2938,6 +4325,13 @@ node-pre-gyp@^0.6.36: tar "^2.2.1" tar-pack "^3.4.0" +nomnom@^1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/nomnom/-/nomnom-1.8.1.tgz#2151f722472ba79e50a76fc125bb8c8f2e4dc2a7" + dependencies: + chalk "~0.4.0" + underscore "~1.6.0" + nopt@3.x: version "3.0.6" resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" @@ -2966,6 +4360,14 @@ normalize-path@^2.0.0, normalize-path@^2.0.1: dependencies: remove-trailing-separator "^1.0.1" +normalize-url@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-2.0.1.tgz#835a9da1551fa26f70e92329069a23aa6574d7e6" + dependencies: + prepend-http "^2.0.0" + query-string "^5.0.1" + sort-keys "^2.0.0" + npm-run-path@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" @@ -3020,12 +4422,16 @@ object.pick@^1.3.0: dependencies: isobject "^3.0.1" -once@^1.3.0, once@^1.3.3, once@^1.4.0: +once@^1.3.0, once@^1.3.1, once@^1.3.3, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" dependencies: wrappy "1" +onetime@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" + onetime@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" @@ -3068,6 +4474,15 @@ optionator@^0.8.1: type-check "~0.3.2" wordwrap "~1.0.0" +ora@^0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/ora/-/ora-0.2.3.tgz#37527d220adcd53c39b73571d754156d5db657a4" + dependencies: + chalk "^1.1.1" + cli-cursor "^1.0.2" + cli-spinners "^0.1.2" + object-assign "^4.0.1" + os-browserify@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.2.1.tgz#63fc4ccee5d2d7763d26bbf8601078e6c2e0044f" @@ -3088,7 +4503,7 @@ os-shim@^0.1.2: version "0.1.3" resolved "https://registry.yarnpkg.com/os-shim/-/os-shim-0.1.3.tgz#6b62c3791cf7909ea35ed46e17658bb417cb3917" -os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: +os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.1, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" @@ -3107,10 +4522,28 @@ output-file-sync@^2.0.0: is-plain-obj "^1.1.0" mkdirp "^0.5.1" +p-cancelable@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-0.3.0.tgz#b9e123800bcebb7ac13a479be195b507b98d30fa" + +p-each-series@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-1.0.0.tgz#930f3d12dd1f50e7434457a22cd6f04ac6ad7f71" + dependencies: + p-reduce "^1.0.0" + p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" +p-is-promise@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-1.1.0.tgz#9c9456989e9f6588017b0434d56097675c3da05e" + +p-lazy@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-lazy/-/p-lazy-1.0.0.tgz#ec53c802f2ee3ac28f166cc82d0b2b02de27a835" + p-limit@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.1.0.tgz#b07ff2d9a5d88bec806035895a2bab66a27988bc" @@ -3121,10 +4554,38 @@ p-locate@^2.0.0: dependencies: p-limit "^1.1.0" +p-map@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.2.0.tgz#e4e94f311eabbc8633a1e79908165fca26241b6b" + +p-reduce@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-reduce/-/p-reduce-1.0.0.tgz#18c2b0dd936a4690a529f8231f58a0fdb6a47dfa" + +p-timeout@^1.1.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-1.2.1.tgz#5eb3b353b7fce99f101a1038880bb054ebbea386" + dependencies: + p-finally "^1.0.0" + +p-timeout@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-2.0.1.tgz#d8dd1979595d2dc0139e1fe46b8b646cb3cdf038" + dependencies: + p-finally "^1.0.0" + pako@~0.2.0: version "0.2.9" resolved "https://registry.yarnpkg.com/pako/-/pako-0.2.9.tgz#f3f7522f4ef782348da8161bad9ecfd51bf83a75" +parallel-transform@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/parallel-transform/-/parallel-transform-1.1.0.tgz#d410f065b05da23081fcd10f28854c29bda33b06" + dependencies: + cyclist "~0.2.2" + inherits "^2.0.3" + readable-stream "^2.1.5" + parse-asn1@^5.0.0: version "5.1.0" resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.0.tgz#37c4f9b7ed3ab65c74817b5f2480937fbf97c712" @@ -3150,6 +4611,10 @@ parse-json@^2.2.0: dependencies: error-ex "^1.2.0" +parse-passwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" + pascalcase@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" @@ -3162,11 +4627,11 @@ path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" -path-is-absolute@^1.0.0: +path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" -path-key@^2.0.0: +path-key@^2.0.0, path-key@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" @@ -3204,7 +4669,7 @@ performance-now@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5" -pify@^2.0.0: +pify@^2.0.0, pify@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -3248,26 +4713,58 @@ prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" +prepend-http@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" + +prepend-http@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" + preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" -private@^0.1.6: +prettier@^1.5.3: + version "1.11.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.11.1.tgz#61e43fc4cd44e68f2b0dfc2c38cd4bb0fccdcc75" + +pretty-bytes@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-4.0.2.tgz#b2bf82e7350d65c6c33aa95aaa5a4f6327f61cd9" + +private@^0.1.6, private@^0.1.7, private@~0.1.5: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" -process-nextick-args@~1.0.6: +process-nextick-args@^1.0.6, process-nextick-args@~1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" +process-nextick-args@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" + process@^0.11.0: version "0.11.10" resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" +process@~0.5.1: + version "0.5.2" + resolved "https://registry.yarnpkg.com/process/-/process-0.5.2.tgz#1638d8a8e34c2f440a91db95ab9aeb677fc185cf" + +promise-inflight@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" + prr@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a" +prr@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" + pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" @@ -3282,6 +4779,21 @@ public-encrypt@^4.0.0: parse-asn1 "^5.0.0" randombytes "^2.0.1" +pump@^2.0.0, pump@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pump/-/pump-2.0.1.tgz#12399add6e4cf7526d973cbc8b5ce2e2908b3909" + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +pumpify@^1.3.3: + version "1.4.0" + resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.4.0.tgz#80b7c5df7e24153d03f0e7ac8a05a5d068bd07fb" + dependencies: + duplexify "^3.5.3" + inherits "^2.0.3" + pump "^2.0.0" + punycode@1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" @@ -3294,6 +4806,14 @@ qs@~6.4.0: version "6.4.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" +query-string@^5.0.1: + version "5.1.0" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-5.1.0.tgz#9583b15fd1307f899e973ed418886426a9976469" + dependencies: + decode-uri-component "^0.2.0" + object-assign "^4.1.0" + strict-uri-encode "^1.0.0" + querystring-es3@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" @@ -3331,6 +4851,13 @@ rc@^1.1.7: minimist "^1.2.0" strip-json-comments "~2.0.1" +read-chunk@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/read-chunk/-/read-chunk-2.1.0.tgz#6a04c0928005ed9d42e1a6ac5600e19cbc7ff655" + dependencies: + pify "^3.0.0" + safe-buffer "^5.1.1" + read-pkg-up@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" @@ -3346,6 +4873,18 @@ read-pkg@^2.0.0: normalize-package-data "^2.3.2" path-type "^2.0.0" +"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.4, readable-stream@^2.1.5: + version "2.3.4" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.4.tgz#c946c3f47fa7d8eabc0b6150f4a12f69a4574071" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.0.3" + util-deprecate "~1.0.1" + readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.2.2, readable-stream@^2.2.6: version "2.3.3" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c" @@ -3367,6 +4906,31 @@ readdirp@^2.0.0: readable-stream "^2.0.2" set-immediate-shim "^1.0.1" +recast@^0.12.5: + version "0.12.9" + resolved "https://registry.yarnpkg.com/recast/-/recast-0.12.9.tgz#e8e52bdb9691af462ccbd7c15d5a5113647a15f1" + dependencies: + ast-types "0.10.1" + core-js "^2.4.1" + esprima "~4.0.0" + private "~0.1.5" + source-map "~0.6.1" + +recast@^0.14.4: + version "0.14.4" + resolved "https://registry.yarnpkg.com/recast/-/recast-0.14.4.tgz#383dd606eac924c1157b0293b53191c34bd3c641" + dependencies: + ast-types "0.11.2" + esprima "~4.0.0" + private "~0.1.5" + source-map "~0.6.1" + +rechoir@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" + dependencies: + resolve "^1.1.6" + reflect-metadata@0.1.12: version "0.1.12" resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.1.12.tgz#311bf0c6b63cd782f228a81abe146a2bfa9c56f2" @@ -3377,7 +4941,7 @@ regenerate-unicode-properties@^5.1.1: dependencies: regenerate "^1.3.3" -regenerate@^1.3.3: +regenerate@^1.2.1, regenerate@^1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.3.tgz#0c336d3980553d755c39b586ae3b20aa49c82b7f" @@ -3393,6 +4957,14 @@ regenerator-runtime@^0.11.1: version "0.11.1" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" +regenerator-transform@^0.10.0: + version "0.10.1" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd" + dependencies: + babel-runtime "^6.18.0" + babel-types "^6.19.0" + private "^0.1.6" + regenerator-transform@^0.12.3: version "0.12.3" resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.12.3.tgz#459adfb64f6a27164ab991b7873f45ab969eca8b" @@ -3411,6 +4983,14 @@ regex-not@^1.0.0: dependencies: extend-shallow "^2.0.1" +regexpu-core@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" + dependencies: + regenerate "^1.2.1" + regjsgen "^0.2.0" + regjsparser "^0.1.4" + regexpu-core@^4.1.3: version "4.1.3" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.1.3.tgz#fb81616dbbc2a917a7419b33f8379144f51eb8d0" @@ -3422,10 +5002,20 @@ regexpu-core@^4.1.3: unicode-match-property-ecmascript "^1.0.3" unicode-match-property-value-ecmascript "^1.0.1" +regjsgen@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" + regjsgen@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.3.0.tgz#0ee4a3e9276430cda25f1e789ea6c15b87b0cb43" +regjsparser@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" + dependencies: + jsesc "~0.5.0" + regjsparser@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.2.1.tgz#c3787553faf04e775c302102ef346d995000ec1c" @@ -3450,6 +5040,14 @@ repeating@^2.0.0: dependencies: is-finite "^1.0.0" +replace-ext@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-0.0.1.tgz#29bbd92078a739f0bcce2b4ee41e837953522924" + +replace-ext@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb" + request@2.81.0, request@^2.79.0: version "2.81.0" resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" @@ -3485,16 +5083,46 @@ require-main-filename@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" +resolve-cwd@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" + dependencies: + resolve-from "^3.0.0" + +resolve-dir@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/resolve-dir/-/resolve-dir-1.0.1.tgz#79a40644c362be82f26effe739c9bb5382046f43" + dependencies: + expand-tilde "^2.0.0" + global-modules "^1.0.0" + +resolve-from@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" + resolve-url@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" -resolve@^1.3.2: +resolve@^1.1.6, resolve@^1.3.2: version "1.5.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36" dependencies: path-parse "^1.0.5" +responselike@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" + dependencies: + lowercase-keys "^1.0.0" + +restore-cursor@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541" + dependencies: + exit-hook "^1.0.0" + onetime "^1.0.0" + restore-cursor@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" @@ -3508,12 +5136,16 @@ right-align@^0.1.1: dependencies: align-text "^0.1.1" -rimraf@2, rimraf@2.6.2, rimraf@^2.5.1, rimraf@^2.6.1: +rimraf@2, rimraf@2.6.2, rimraf@^2.2.0, rimraf@^2.2.8, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" dependencies: glob "^7.0.5" +rimraf@~2.2.6: + version "2.2.8" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.2.8.tgz#e439be2aaee327321952730f99a8929e4fc50582" + ripemd160@^2.0.0, ripemd160@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.1.tgz#0f4584295c53a3628af7e6d79aca21ce57d1c6e7" @@ -3521,16 +5153,38 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^2.0.0" inherits "^2.0.1" -run-async@^2.2.0: +run-async@^2.0.0, run-async@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" dependencies: is-promise "^2.1.0" +run-queue@^1.0.0, run-queue@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/run-queue/-/run-queue-1.0.3.tgz#e848396f057d223f24386924618e25694161ec47" + dependencies: + aproba "^1.1.1" + +rx-lite-aggregates@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be" + dependencies: + rx-lite "*" + +rx-lite@*, rx-lite@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" + rx@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/rx/-/rx-4.1.0.tgz#a5f13ff79ef3b740fe30aa803fb09f98805d4782" +rxjs@^5.4.2, rxjs@^5.5.2: + version "5.5.6" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.5.6.tgz#e31fb96d6fd2ff1fd84bcea8ae9c02d007179c02" + dependencies: + symbol-observable "1.0.1" + safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" @@ -3539,10 +5193,29 @@ samsam@1.3.0, samsam@1.x: version "1.3.0" resolved "https://registry.yarnpkg.com/samsam/-/samsam-1.3.0.tgz#8d1d9350e25622da30de3e44ba692b5221ab7c50" -"semver@2 || 3 || 4 || 5", semver@^5.3.0: +schema-utils@^0.4.2: + version "0.4.5" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-0.4.5.tgz#21836f0608aac17b78f9e3e24daff14a5ca13a3e" + dependencies: + ajv "^6.1.0" + ajv-keywords "^3.1.0" + +scoped-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/scoped-regex/-/scoped-regex-1.0.0.tgz#a346bb1acd4207ae70bd7c0c7ca9e566b6baddb8" + +"semver@2 || 3 || 4 || 5", semver@^5.5.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" + +semver@^5.3.0: version "5.4.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" +serialize-javascript@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.4.0.tgz#7c958514db6ac2443a8abc062dc9f7886a7f6005" + set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" @@ -3596,6 +5269,14 @@ shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" +shelljs@^0.7.0: + version "0.7.8" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3" + dependencies: + glob "^7.0.0" + interpret "^1.0.0" + rechoir "^0.6.2" + signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" @@ -3616,6 +5297,14 @@ slash@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" +slice-ansi@0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" + +slide@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" + snapdragon-node@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" @@ -3649,6 +5338,12 @@ sntp@1.x.x: dependencies: hoek "2.x.x" +sort-keys@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-2.0.0.tgz#658535584861ec97d730d6cf41822e1f56684128" + dependencies: + is-plain-obj "^1.0.0" + source-list-map@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.0.tgz#aaa47403f7b245a92fbc97ea08f250d6087ed085" @@ -3669,6 +5364,12 @@ source-map-support@0.5.3, source-map-support@^0.5.3: dependencies: source-map "^0.6.0" +source-map-support@^0.4.15: + version "0.4.18" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" + dependencies: + source-map "^0.5.6" + source-map-url@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" @@ -3679,11 +5380,11 @@ source-map@^0.4.4: dependencies: amdefine ">=0.0.4" -source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1, source-map@~0.5.3: +source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.1, source-map@~0.5.3: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" -source-map@^0.6.0: +source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" @@ -3700,19 +5401,27 @@ spawn-sync@^1.0.15: concat-stream "^1.4.7" os-shim "^0.1.2" -spdx-correct@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" +spdx-correct@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.0.0.tgz#05a5b4d7153a195bc92c3c425b69f3b2a9524c82" dependencies: - spdx-license-ids "^1.0.2" + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" -spdx-expression-parse@~1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz#9bdf2f20e1f40ed447fbe273266191fced51626c" +spdx-exceptions@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz#2c7ae61056c714a5b9b9b2b2af7d311ef5c78fe9" -spdx-license-ids@^1.0.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz#c9df7a3424594ade6bd11900d596696dc06bac57" +spdx-expression-parse@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz#7a7cd28470cc6d3a1cfe6d66886f6bc430d3ac87" split-string@^3.0.1, split-string@^3.0.2: version "3.0.2" @@ -3738,6 +5447,12 @@ sshpk@^1.7.0: jsbn "~0.1.0" tweetnacl "~0.14.0" +ssri@^5.2.4: + version "5.2.4" + resolved "https://registry.yarnpkg.com/ssri/-/ssri-5.2.4.tgz#9985e14041e65fc397af96542be35724ac11da52" + dependencies: + safe-buffer "^5.1.1" + static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" @@ -3752,6 +5467,13 @@ stream-browserify@^2.0.1: inherits "~2.0.1" readable-stream "^2.0.2" +stream-each@^1.1.0: + version "1.2.2" + resolved "https://registry.yarnpkg.com/stream-each/-/stream-each-1.2.2.tgz#8e8c463f91da8991778765873fe4d960d8f616bd" + dependencies: + end-of-stream "^1.1.0" + stream-shift "^1.0.0" + stream-http@^2.3.1: version "2.7.2" resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.7.2.tgz#40a050ec8dc3b53b33d9909415c02c0bf1abfbad" @@ -3762,10 +5484,28 @@ stream-http@^2.3.1: to-arraybuffer "^1.0.0" xtend "^4.0.0" +stream-shift@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952" + +stream-to-observable@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/stream-to-observable/-/stream-to-observable-0.2.0.tgz#59d6ea393d87c2c0ddac10aa0d561bc6ba6f0e10" + dependencies: + any-observable "^0.2.0" + +strict-uri-encode@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" + string-template@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/string-template/-/string-template-1.0.0.tgz#9e9f2233dc00f218718ec379a28a5673ecca8b96" +string-template@~0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/string-template/-/string-template-0.2.1.tgz#42932e598a352d01fc22ec3367d9d84eec6c9add" + string-width@^1.0.1, string-width@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" @@ -3774,7 +5514,7 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -string-width@^2.0.0: +string-width@^2.0.0, string-width@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" dependencies: @@ -3807,6 +5547,17 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" +strip-ansi@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-0.1.1.tgz#39e8a98d044d150660abe4a6808acf70bb7bc991" + +strip-bom-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-bom-stream/-/strip-bom-stream-2.0.0.tgz#f87db5ef2613f6968aa545abfe1ec728b6a829ca" + dependencies: + first-chunk-stream "^2.0.0" + strip-bom "^2.0.0" + strip-bom@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" @@ -3841,7 +5592,7 @@ supports-color@^3.1.2: dependencies: has-flag "^1.0.0" -supports-color@^4.0.0, supports-color@^4.2.1: +supports-color@^4.0.0: version "4.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.5.0.tgz#be7a0de484dec5c5cddf8b3d59125044912f635b" dependencies: @@ -3859,10 +5610,28 @@ supports-color@^5.2.0: dependencies: has-flag "^3.0.0" -tapable@^0.2.5, tapable@^0.2.7: +supports-color@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.3.0.tgz#5b24ac15db80fa927cf5227a4a33fd3c4c7676c0" + dependencies: + has-flag "^3.0.0" + +symbol-observable@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.1.tgz#8340fc4702c3122df5d22288f88283f513d3fdd4" + +symbol-observable@^0.2.2: + version "0.2.4" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-0.2.4.tgz#95a83db26186d6af7e7a18dbd9760a2f86d08f40" + +tapable@^0.2.5: version "0.2.8" resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.2.8.tgz#99372a5c999bf2df160afc0d74bed4f47948cd22" +tapable@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.0.0.tgz#cbb639d9002eed9c6b5975eb20598d7936f1f9f2" + tar-pack@^3.4.0: version "3.4.1" resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.4.1.tgz#e1dbc03a9b9d3ba07e896ad027317eb679a10a1f" @@ -3884,10 +5653,25 @@ tar@^2.2.1: fstream "^1.0.2" inherits "2" +temp@^0.8.1: + version "0.8.3" + resolved "https://registry.yarnpkg.com/temp/-/temp-0.8.3.tgz#e0c6bc4d26b903124410e4fed81103014dfc1f59" + dependencies: + os-tmpdir "^1.0.0" + rimraf "~2.2.6" + text-encoding@^0.6.4: version "0.6.4" resolved "https://registry.yarnpkg.com/text-encoding/-/text-encoding-0.6.4.tgz#e399a982257a276dae428bb92845cb71bdc26d19" +text-table@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + +textextensions@2: + version "2.2.0" + resolved "https://registry.yarnpkg.com/textextensions/-/textextensions-2.2.0.tgz#38ac676151285b658654581987a0ce1a4490d286" + threads@0.10.1: version "0.10.1" resolved "https://registry.yarnpkg.com/threads/-/threads-0.10.1.tgz#637765dc434ab3373d3c14754c8f7ac6515d6815" @@ -3895,16 +5679,33 @@ threads@0.10.1: eventemitter3 "^2.0.2" native-promise-only "^0.8.1" +through2@^2.0.0, through2@^2.0.1: + version "2.0.3" + resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" + dependencies: + readable-stream "^2.1.5" + xtend "~4.0.1" + through@^2.3.6: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" +timed-out@^4.0.0, timed-out@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" + timers-browserify@^2.0.2: version "2.0.4" resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.4.tgz#96ca53f4b794a5e7c0e1bd7cc88a372298fa01e6" dependencies: setimmediate "^1.0.4" +tmp@^0.0.29: + version "0.0.29" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.29.tgz#f25125ff0dd9da3ccb0c2dd371ee1288bb9128c0" + dependencies: + os-tmpdir "~1.0.1" + tmp@^0.0.33: version "0.0.33" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" @@ -4058,7 +5859,14 @@ typescript@2.7.2: version "2.7.2" resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.7.2.tgz#2d615a1ef4aee4f574425cdff7026edf81919836" -uglify-js@^2.6, uglify-js@^2.8.29: +uglify-es@^3.3.4: + version "3.3.9" + resolved "https://registry.yarnpkg.com/uglify-es/-/uglify-es-3.3.9.tgz#0c1c4f0700bed8dbc124cdb304d2592ca203e677" + dependencies: + commander "~2.13.0" + source-map "~0.6.1" + +uglify-js@^2.6: version "2.8.29" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" dependencies: @@ -4071,18 +5879,27 @@ uglify-to-browserify@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" -uglifyjs-webpack-plugin@^0.4.6: - version "0.4.6" - resolved "https://registry.yarnpkg.com/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-0.4.6.tgz#b951f4abb6bd617e66f63eb891498e391763e309" +uglifyjs-webpack-plugin@^1.1.1, uglifyjs-webpack-plugin@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-1.2.2.tgz#e7516d4367afdb715c3847841eb46f94c45ca2b9" dependencies: - source-map "^0.5.6" - uglify-js "^2.8.29" - webpack-sources "^1.0.1" + cacache "^10.0.1" + find-cache-dir "^1.0.0" + schema-utils "^0.4.2" + serialize-javascript "^1.4.0" + source-map "^0.6.1" + uglify-es "^3.3.4" + webpack-sources "^1.1.0" + worker-farm "^1.5.2" uid-number@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" +underscore@~1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.6.0.tgz#8b38b10cacdef63337b8b24e4ff86d45aea529a8" + unicode-canonical-property-names-ecmascript@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.3.tgz#f6119f417467593c0086357c85546b6ad5abc583" @@ -4111,6 +5928,18 @@ union-value@^1.0.0: is-extendable "^0.1.1" set-value "^0.4.3" +unique-filename@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-1.1.0.tgz#d05f2fe4032560871f30e93cbe735eea201514f3" + dependencies: + unique-slug "^2.0.0" + +unique-slug@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/unique-slug/-/unique-slug-2.0.0.tgz#db6676e7c7cc0629878ff196097c78855ae9f4ab" + dependencies: + imurmurhash "^0.1.4" + unset-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" @@ -4118,10 +5947,36 @@ unset-value@^1.0.0: has-value "^0.3.1" isobject "^3.0.0" +untildify@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/untildify/-/untildify-2.1.0.tgz#17eb2807987f76952e9c0485fc311d06a826a2e0" + dependencies: + os-homedir "^1.0.0" + +untildify@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/untildify/-/untildify-3.0.2.tgz#7f1f302055b3fea0f3e81dc78eb36766cb65e3f1" + urix@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" +url-parse-lax@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" + dependencies: + prepend-http "^1.0.1" + +url-parse-lax@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c" + dependencies: + prepend-http "^2.0.0" + +url-to-options@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/url-to-options/-/url-to-options-1.0.1.tgz#1505a03a289a48cbd7a434efbaeec5055f5633a9" + url@^0.11.0: version "0.11.0" resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" @@ -4129,6 +5984,10 @@ url@^0.11.0: punycode "1.3.2" querystring "0.2.0" +urlgrey@0.4.4: + version "0.4.4" + resolved "https://registry.yarnpkg.com/urlgrey/-/urlgrey-0.4.4.tgz#892fe95960805e85519f1cd4389f2cb4cbb7652f" + use@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/use/-/use-2.0.2.tgz#ae28a0d72f93bf22422a18a2e379993112dec8e8" @@ -4151,12 +6010,16 @@ uuid@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" +v8-compile-cache@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-1.1.2.tgz#8d32e4f16974654657e676e0e467a348e89b0dc4" + validate-npm-package-license@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc" + version "3.0.3" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz#81643bcbef1bdfecd4623793dc4648948ba98338" dependencies: - spdx-correct "~1.0.0" - spdx-expression-parse "~1.0.0" + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" validator@9.2.0: version "9.2.0" @@ -4170,6 +6033,36 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" +vinyl-file@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/vinyl-file/-/vinyl-file-2.0.0.tgz#a7ebf5ffbefda1b7d18d140fcb07b223efb6751a" + dependencies: + graceful-fs "^4.1.2" + pify "^2.3.0" + pinkie-promise "^2.0.0" + strip-bom "^2.0.0" + strip-bom-stream "^2.0.0" + vinyl "^1.1.0" + +vinyl@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-1.2.0.tgz#5c88036cf565e5df05558bfc911f8656df218884" + dependencies: + clone "^1.0.0" + clone-stats "^0.0.1" + replace-ext "0.0.1" + +vinyl@^2.0.1: + version "2.1.0" + resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-2.1.0.tgz#021f9c2cf951d6b939943c89eb5ee5add4fd924c" + dependencies: + clone "^2.1.1" + clone-buffer "^1.0.0" + clone-stats "^1.0.0" + cloneable-readable "^1.0.0" + remove-trailing-separator "^1.0.1" + replace-ext "^1.0.0" + vm-browserify@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73" @@ -4184,6 +6077,46 @@ watchpack@^1.4.0: chokidar "^1.7.0" graceful-fs "^4.1.2" +webpack-addons@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/webpack-addons/-/webpack-addons-1.1.5.tgz#2b178dfe873fb6e75e40a819fa5c26e4a9bc837a" + dependencies: + jscodeshift "^0.4.0" + +webpack-cli@^2.0.10: + version "2.0.10" + resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-2.0.10.tgz#09b888fbaa0b4288ba4b94c4462b6f559dfcf51e" + dependencies: + chalk "^2.3.1" + codecov "^3.0.0" + cross-spawn "^6.0.4" + diff "^3.3.0" + enhanced-resolve "^4.0.0" + glob-all "^3.1.0" + global "^4.3.2" + global-modules "^1.0.0" + got "^8.2.0" + inquirer "^5.1.0" + interpret "^1.0.4" + jscodeshift "^0.4.1" + listr "^0.13.0" + loader-utils "^1.1.0" + lodash "^4.17.5" + log-symbols "2.2.0" + mkdirp "^0.5.1" + p-each-series "^1.0.0" + p-lazy "^1.0.0" + prettier "^1.5.3" + recast "^0.14.4" + resolve-cwd "^2.0.0" + supports-color "^5.2.0" + uglifyjs-webpack-plugin "^1.2.2" + v8-compile-cache "^1.1.2" + webpack-addons "^1.1.5" + yargs "9.0.1" + yeoman-environment "^2.0.0" + yeoman-generator "github:ev1stensberg/generator#Feature-getArgument" + webpack-node-externals@1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/webpack-node-externals/-/webpack-node-externals-1.6.0.tgz#232c62ec6092b100635a3d29d83c1747128df9bd" @@ -4195,32 +6128,36 @@ webpack-sources@^1.0.1: source-list-map "^2.0.0" source-map "~0.5.3" -webpack@3.11.0: - version "3.11.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.11.0.tgz#77da451b1d7b4b117adaf41a1a93b5742f24d894" +webpack-sources@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.1.0.tgz#a101ebae59d6507354d71d8013950a3a8b7a5a54" + dependencies: + source-list-map "^2.0.0" + source-map "~0.6.1" + +webpack@4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.0.1.tgz#768d708beeca4c5f77f6c2d38a240fb6ff50ba5d" dependencies: acorn "^5.0.0" - acorn-dynamic-import "^2.0.0" + acorn-dynamic-import "^3.0.0" ajv "^6.1.0" ajv-keywords "^3.1.0" - async "^2.1.2" - enhanced-resolve "^3.4.0" - escope "^3.6.0" - interpret "^1.0.0" - json-loader "^0.5.4" - json5 "^0.5.1" + chrome-trace-event "^0.1.1" + enhanced-resolve "^4.0.0" + eslint-scope "^3.7.1" loader-runner "^2.3.0" loader-utils "^1.1.0" memory-fs "~0.4.1" + micromatch "^3.1.8" mkdirp "~0.5.0" + neo-async "^2.5.0" node-libs-browser "^2.0.0" - source-map "^0.5.3" - supports-color "^4.2.1" - tapable "^0.2.7" - uglifyjs-webpack-plugin "^0.4.6" + schema-utils "^0.4.2" + tapable "^1.0.0" + uglifyjs-webpack-plugin "^1.1.1" watchpack "^1.4.0" webpack-sources "^1.0.1" - yargs "^8.0.2" which-module@^2.0.0: version "2.0.0" @@ -4232,7 +6169,7 @@ which@1.2.x: dependencies: isexe "^2.0.0" -which@^1.1.1, which@^1.2.9: +which@^1.1.1, which@^1.2.14, which@^1.2.9: version "1.3.0" resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" dependencies: @@ -4260,6 +6197,13 @@ wordwrap@~0.0.2: version "0.0.3" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" +worker-farm@^1.5.2: + version "1.5.4" + resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.5.4.tgz#4debbe46b40edefcc717ebde74a90b1ae1e909a1" + dependencies: + errno "~0.1.7" + xtend "~4.0.1" + wrap-ansi@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" @@ -4271,7 +6215,15 @@ wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" -xtend@^4.0.0: +write-file-atomic@^1.2.0: + version "1.3.4" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-1.3.4.tgz#f807a4f0b1d9e913ae7a48112e6cc3af1991b45f" + dependencies: + graceful-fs "^4.1.11" + imurmurhash "^0.1.4" + slide "^1.1.5" + +xtend@^4.0.0, xtend@~4.0.0, xtend@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" @@ -4279,6 +6231,10 @@ y18n@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" +y18n@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" + yallist@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" @@ -4289,9 +6245,9 @@ yargs-parser@^7.0.0: dependencies: camelcase "^4.1.0" -yargs@^8.0.2: - version "8.0.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-8.0.2.tgz#6299a9055b1cefc969ff7e79c1d918dceb22c360" +yargs@9.0.1: + version "9.0.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-9.0.1.tgz#52acc23feecac34042078ee78c0c007f5085db4c" dependencies: camelcase "^4.1.0" cliui "^3.2.0" @@ -4307,6 +6263,12 @@ yargs@^8.0.2: y18n "^3.2.1" yargs-parser "^7.0.0" +yargs@~1.2.6: + version "1.2.6" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-1.2.6.tgz#9c7b4a82fd5d595b2bf17ab6dcc43135432fe34b" + dependencies: + minimist "^0.1.0" + yargs@~3.10.0: version "3.10.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" @@ -4316,6 +6278,71 @@ yargs@~3.10.0: decamelize "^1.0.0" window-size "0.1.0" +yeoman-environment@^1.1.0: + version "1.6.6" + resolved "https://registry.yarnpkg.com/yeoman-environment/-/yeoman-environment-1.6.6.tgz#cd85fa67d156060e440d7807d7ef7cf0d2d1d671" + dependencies: + chalk "^1.0.0" + debug "^2.0.0" + diff "^2.1.2" + escape-string-regexp "^1.0.2" + globby "^4.0.0" + grouped-queue "^0.3.0" + inquirer "^1.0.2" + lodash "^4.11.1" + log-symbols "^1.0.1" + mem-fs "^1.1.0" + text-table "^0.2.0" + untildify "^2.0.0" + +yeoman-environment@^2.0.0: + version "2.0.5" + resolved "https://registry.yarnpkg.com/yeoman-environment/-/yeoman-environment-2.0.5.tgz#84f22bafa84088971fe99ea85f654a3a3dd2b693" + dependencies: + chalk "^2.1.0" + debug "^3.1.0" + diff "^3.3.1" + escape-string-regexp "^1.0.2" + globby "^6.1.0" + grouped-queue "^0.3.3" + inquirer "^3.3.0" + is-scoped "^1.0.0" + lodash "^4.17.4" + log-symbols "^2.1.0" + mem-fs "^1.1.0" + text-table "^0.2.0" + untildify "^3.0.2" + +"yeoman-generator@github:ev1stensberg/generator#Feature-getArgument": + version "1.1.1" + resolved "https://codeload.github.com/ev1stensberg/generator/tar.gz/9e24fa31c85302ca1145ae34fc68b4f133251ca0" + dependencies: + async "^2.0.0" + chalk "^1.0.0" + cli-table "^0.3.1" + cross-spawn "^5.0.1" + dargs "^5.1.0" + dateformat "^2.0.0" + debug "^2.1.0" + detect-conflict "^1.0.0" + error "^7.0.2" + find-up "^2.1.0" + github-username "^4.0.0" + istextorbinary "^2.1.0" + lodash "^4.11.1" + mem-fs-editor "^3.0.0" + minimist "^1.2.0" + mkdirp "^0.5.0" + pretty-bytes "^4.0.2" + read-chunk "^2.0.0" + read-pkg-up "^2.0.0" + rimraf "^2.2.0" + run-async "^2.0.0" + shelljs "^0.7.0" + text-table "^0.2.0" + through2 "^2.0.0" + yeoman-environment "^1.1.0" + yn@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a" From 945802bd50f084a86f34a831605c05ed688828c7 Mon Sep 17 00:00:00 2001 From: sanex3339 Date: Sat, 3 Mar 2018 11:32:53 +0300 Subject: [PATCH 2/3] Updated at-loader --- dist/index.js | 12887 +++++++++++++++++++++++++++++++++++++++++++++++- package.json | 4 +- yarn.lock | 64 +- 3 files changed, 12918 insertions(+), 37 deletions(-) diff --git a/dist/index.js b/dist/index.js index 292da8be..d90896b5 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,2 +1,12887 @@ -require("source-map-support").install(),module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r.w={},r(r.s=215)}([function(e,t){e.exports=require("inversify")},function(e,t){e.exports=require("@babel/runtime/helpers/classCallCheck")},function(e,t){e.exports=require("@babel/runtime/helpers/createClass")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Factory__ICalleeDataExtractor="Factory",e.Factory__IControlFlowCustomNode="Factory",e.Factory__IControlFlowReplacer="Factory",e.Factory__ICustomNode="Factory",e.Factory__ICustomNodeGroup="Factory",e.Factory__IDeadCodeInjectionCustomNode="Factory",e.Factory__IIdentifierNamesGenerator="Factory",e.Factory__IIdentifierObfuscatingReplacer="Factory",e.Factory__INodeGuard="Factory",e.Factory__INodeTransformer="Factory",e.Factory__IObfuscationResult="Factory",e.Factory__IObfuscatingReplacer="Factory",e.Factory__TControlFlowStorage="Factory",e.IArrayUtils="IArrayUtils",e.ICalleeDataExtractor="ICalleeDataExtractor",e.ICryptUtils="ICryptUtils",e.ICustomNode="ICustomNode",e.ICustomNodeGroup="ICustomNodeGroup",e.IControlFlowReplacer="IControlFlowReplacer",e.IEscapeSequenceEncoder="IEscapeSequenceEncoder",e.IIdentifierNamesGenerator="IIdentifierNamesGenerator",e.IIdentifierObfuscatingReplacer="IIdentifierObfuscatingReplacer",e.IJavaScriptObfuscator="IJavaScriptObfuscator",e.ILogger="ILogger",e.INodeGuard="INodeGuard",e.INodeTransformer="INodeTransformer",e.IObfuscationEventEmitter="IObfuscationEventEmitter",e.IObfuscationResult="IObfuscationResult",e.IOptions="IOptions",e.IOptionsNormalizer="IOptionsNormalizer",e.IObfuscatingReplacer="IObfuscatingReplacer",e.IRandomGenerator="IRandomGenerator",e.ISourceCode="ISourceCode",e.ISourceMapCorrector="ISourceMapCorrector",e.IStackTraceAnalyzer="IStackTraceAnalyzer",e.ITransformersRunner="ITransformersRunner",e.Newable__ICustomNode="Newable",e.Newable__TControlFlowStorage="Newable",e.TCustomNodeGroupStorage="TCustomNodeGroupStorage",e.TInputOptions="TInputOptions",e.TStringArrayStorage="TStringArrayStorage"}(t.ServiceIdentifiers||(t.ServiceIdentifiers={}))},function(e,t){e.exports=require("tslib")},function(e,t){e.exports=require("@babel/runtime/helpers/inherits")},function(e,t){e.exports=require("@babel/runtime/helpers/possibleConstructorReturn")},function(e,t){e.exports=require("@babel/runtime/core-js/object/get-prototype-of")},function(e,t,r){"use strict";var n=r(66),o=r(1),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i=__importStar(r(47)),s=__importStar(r(65)),c=__importStar(r(17)),u=r(9),d=function(){function e(){o(this,e)}return a(e,null,[{key:"addXVerbatimPropertyToLiterals",value:function(e){return c.replace(e,{leave:function(e){u.NodeGuards.isLiteralNode(e)&&(e["x-verbatim-property"]={content:e.raw,precedence:i.Precedence.Primary})}}),e}},{key:"clone",value:function(t){return e.parentize(e.cloneRecursive(t))}},{key:"convertCodeToStructure",value:function(t){var r=s.parseScript(t);return r=e.addXVerbatimPropertyToLiterals(r),(r=e.parentize(r)).body}},{key:"convertStructureToCode",value:function(e){return e.reduce(function(e,t){return e+i.generate(t,{sourceMapWithCode:!0}).code},"")}},{key:"getBlockScopesOfNode",value:function(t){return e.getBlockScopesOfNodeRecursive(t)}},{key:"getNextSiblingStatementNode",value:function(t){return e.getSiblingStatementNodeByOffset(t,1)}},{key:"getPreviousSiblingStatementNode",value:function(t){return e.getSiblingStatementNodeByOffset(t,-1)}},{key:"getScopeOfNode",value:function(t){var r=t.parentNode;if(!r)throw new ReferenceError("`parentNode` property of given node is `undefined`");return u.NodeGuards.isNodeHasScope(r)?r:e.getScopeOfNode(r)}},{key:"getUnaryExpressionArgumentNode",value:function(t){return u.NodeGuards.isUnaryExpressionNode(t.argument)?e.getUnaryExpressionArgumentNode(t.argument):t.argument}},{key:"parentize",value:function(t){return c.replace(t,{enter:e.parentizeNode}),t}},{key:"parentizeNode",value:function(e,t){return e.parentNode=t||e,e.obfuscatedNode=!1,e}},{key:"cloneRecursive",value:function(t){if(null===t)return t;var r={};for(var o in t)if(t.hasOwnProperty(o)&&"parentNode"!==o){var a=t[o],i=void 0;i=null===a||a instanceof RegExp?a:Array.isArray(a)?a.map(e.cloneRecursive):"object"===n(a)?e.cloneRecursive(a):a,r[o]=i}return r}},{key:"getBlockScopesOfNodeRecursive",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=t.parentNode;if(!o)throw new ReferenceError("`parentNode` property of given node is `undefined`");return u.NodeGuards.isBlockStatementNode(t)&&o===t&&r.push(t),(u.NodeGuards.isProgramNode(t)||n&&u.NodeGuards.isNodeHasBlockScope(t,o))&&r.push(t),t!==o?e.getBlockScopesOfNodeRecursive(o,r,++n):r}},{key:"getSiblingStatementNodeByOffset",value:function(t,r){var n=e.getScopeOfNode(t),o=u.NodeGuards.isSwitchCaseNode(n)?n.consequent:n.body;return o[o.indexOf(t)+r]||null}}]),e}();t.NodeUtils=d},function(e,t,r){"use strict";var n=r(1),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a=r(19),i=function(){function e(){n(this,e)}return o(e,null,[{key:"isArrayPatternNode",value:function(e){return e.type===a.NodeType.ArrayPattern}},{key:"isArrowFunctionExpressionNode",value:function(e){return e.type===a.NodeType.ArrowFunctionExpression}},{key:"isAssignmentPatternNode",value:function(e){return e.type===a.NodeType.AssignmentPattern}},{key:"isAwaitExpressionNode",value:function(e){return e.type===a.NodeType.AwaitExpression}},{key:"isBlockStatementNode",value:function(e){return e.type===a.NodeType.BlockStatement}},{key:"isBreakStatementNode",value:function(e){return e.type===a.NodeType.BreakStatement}},{key:"isCallExpressionNode",value:function(e){return e.type===a.NodeType.CallExpression}},{key:"isCatchClauseNode",value:function(e){return e.type===a.NodeType.CatchClause}},{key:"isClassDeclarationNode",value:function(e){return e.type===a.NodeType.ClassDeclaration}},{key:"isContinueStatementNode",value:function(e){return e.type===a.NodeType.ContinueStatement}},{key:"isExpressionStatementNode",value:function(e){return e.type===a.NodeType.ExpressionStatement}},{key:"isFunctionDeclarationNode",value:function(e){return e.type===a.NodeType.FunctionDeclaration}},{key:"isFunctionExpressionNode",value:function(e){return e.type===a.NodeType.FunctionExpression}},{key:"isIdentifierNode",value:function(e){return e.type===a.NodeType.Identifier}},{key:"isIfStatementNode",value:function(e){return e.type===a.NodeType.IfStatement}},{key:"isLabelIdentifierNode",value:function(t,r){var n=e.isLabeledStatementNode(r)&&r.label===t,o=e.isContinueStatementNode(r)&&r.label===t,a=e.isBreakStatementNode(r)&&r.label===t;return n||o||a}},{key:"isLabeledStatementNode",value:function(e){return e.type===a.NodeType.LabeledStatement}},{key:"isLiteralNode",value:function(e){return e.type===a.NodeType.Literal}},{key:"isMemberExpressionNode",value:function(e){return e.type===a.NodeType.MemberExpression}},{key:"isMethodDefinitionNode",value:function(e){return e.type===a.NodeType.MethodDefinition}},{key:"isNode",value:function(e){return e&&void 0!==!e.type}},{key:"isNodeHasBlockScope",value:function(t,r){return e.isProgramNode(t)||e.isBlockStatementNode(t)&&e.nodesWithBlockScope.includes(r.type)}},{key:"isNodeHasScope",value:function(t){return e.isProgramNode(t)||e.isBlockStatementNode(t)||e.isSwitchCaseNode(t)}},{key:"isNodeWithComments",value:function(e){return Boolean(e.leadingComments)||Boolean(e.trailingComments)}},{key:"isObjectPatternNode",value:function(e){return e.type===a.NodeType.ObjectPattern}},{key:"isObjectExpressionNode",value:function(e){return e.type===a.NodeType.ObjectExpression}},{key:"isProgramNode",value:function(e){return e.type===a.NodeType.Program}},{key:"isPropertyNode",value:function(e){return e.type===a.NodeType.Property}},{key:"isReplaceableIdentifierNode",value:function(t,r){if(!e.isIdentifierNode(t))return!1;var n=e.isPropertyNode(r)&&!r.computed&&r.key===t,o=e.isMemberExpressionNode(r)&&!r.computed&&r.property===t,a=e.isMethodDefinitionNode(r)&&!r.computed,i=e.isLabelIdentifierNode(t,r);return!(n||o||a||i)}},{key:"isRestElementNode",value:function(e){return e.type===a.NodeType.RestElement}},{key:"isReturnStatementNode",value:function(e){return e.type===a.NodeType.ReturnStatement}},{key:"isSuperNode",value:function(e){return e.type===a.NodeType.Super}},{key:"isSwitchCaseNode",value:function(e){return e.type===a.NodeType.SwitchCase}},{key:"isTemplateLiteralNode",value:function(e){return e.type===a.NodeType.TemplateLiteral}},{key:"isUnaryExpressionNode",value:function(e){return e.type===a.NodeType.UnaryExpression}},{key:"isUseStrictOperator",value:function(e){return e.type===a.NodeType.ExpressionStatement&&"use strict"===e.directive}},{key:"isVariableDeclarationNode",value:function(e){return e.type===a.NodeType.VariableDeclaration}},{key:"isVariableDeclaratorNode",value:function(e){return e.type===a.NodeType.VariableDeclarator}},{key:"isWhileStatementNode",value:function(e){return e.type===a.NodeType.WhileStatement}}]),e}();i.nodesWithBlockScope=[a.NodeType.ArrowFunctionExpression,a.NodeType.FunctionDeclaration,a.NodeType.FunctionExpression,a.NodeType.MethodDefinition],t.NodeGuards=i},function(e,t,r){"use strict";var n=r(11),o=r(205),a=r(204),i=r(203),s=r(202),c=r(201),u=r(200),d=r(30),l=r(40);Object.defineProperty(t,"__esModule",{value:!0});var f={configurable:!0,enumerable:!0},p="_initialized",m="_initializablePropertiesSet",g="_wrappedMethodsSet",_="constructor";function N(e,t,r){u(e,r)||c(e,t,r)}t.initializable=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"initialize",t=l(this)[0];return function(r,u){var l=r[e];if(!l||"function"!=typeof l)throw new Error("`".concat(e,"` method with initialization logic not ")+"found. `@".concat(t,"` decorator requires `").concat(e,"` method"));return N(p,!1,r),N(m,new d,r),N(g,new d,r),function(e,t){var r=s(e),c=[t,_];r.forEach(function(r){var s=i(m,e),u=i(g,e),d=c.includes(r)||s.has(r)||u.has(r);if(!d){var l=e[r];if("function"==typeof l){var _=a(e,r)||f,N=_.value;o(e,r,n({},_,{value:function(){if(!i(p,this))throw new Error("Class should be initialized with `".concat(t,"()` method"));return N.apply(this,arguments)}})),u.add(r)}}})}(r,e),function(e,t,r){var i=a(e,t)||f,s=i.value;o(e,t,n({},i,{value:function(){c(p,!0,this);var e=s.apply(this,arguments);return this[r],e}}))}(r,e,u),function(e,t){i(m,e).add(t);var r="_".concat(t),s=a(e,r)||f;return o(e,t,n({},s,{get:function(){if(void 0===this[r])throw new Error("Property `".concat(t,"` is not initialized! Initialize it first!"));return this[r]},set:function(e){this[r]=e}})),s}(r,u)}}},function(e,t){e.exports=require("@babel/runtime/core-js/object/assign")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Preparing="Preparing",e.DeadCodeInjection="DeadCodeInjection",e.ControlFlowFlattening="ControlFlowFlattening",e.Converting="Converting",e.Obfuscating="Obfuscating",e.Finalizing="Finalizing"}(t.TransformationStage||(t.TransformationStage={}))},function(e,t,r){"use strict";var n=r(1),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a,i=r(4),s=r(0),c=r(3),u=r(182),d=r(181),l=a=function(){function e(t,r,o){n(this,e),this.cachedNode=null,this.identifierNamesGenerator=t(o),this.randomGenerator=r,this.options=o}return o(e,[{key:"getNode",value:function(){return this.cachedNode||(this.cachedNode=this.getNodeStructure()),this.cachedNode}},{key:"getGlobalVariableTemplate",value:function(){return this.randomGenerator.getRandomGenerator().pickone(a.globalVariableTemplateFunctions)}}]),e}();l.globalVariableTemplateFunctions=[u.GlobalVariableTemplate1(),d.GlobalVariableTemplate2()],l=a=i.__decorate([s.injectable(),i.__param(0,s.inject(c.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),i.__param(1,s.inject(c.ServiceIdentifiers.IRandomGenerator)),i.__param(2,s.inject(c.ServiceIdentifiers.IOptions)),i.__metadata("design:paramtypes",[Function,Object,Object])],l),t.AbstractCustomNode=l},function(e,t,r){"use strict";var n=r(1),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a=r(4),i=r(0),s=r(3),c=r(10),u=function(){function e(t,r){n(this,e),this.randomGenerator=t,this.options=r}return o(e,[{key:"initialize",value:function(){this.nodeIdentifier=this.randomGenerator.getRandomInteger(0,1e4)}}]),e}();a.__decorate([c.initializable(),a.__metadata("design:type",Number)],u.prototype,"nodeIdentifier",void 0),a.__decorate([i.postConstruct(),a.__metadata("design:type",Function),a.__metadata("design:paramtypes",[]),a.__metadata("design:returntype",void 0)],u.prototype,"initialize",null),u=a.__decorate([i.injectable(),a.__param(0,i.inject(s.ServiceIdentifiers.IRandomGenerator)),a.__param(1,i.inject(s.ServiceIdentifiers.IOptions)),a.__metadata("design:paramtypes",[Object,Object])],u),t.AbstractNodeTransformer=u},function(e,t,r){"use strict";var n=r(11),o=r(1),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i=__importStar(r(47)),s=r(19),c=function(){function e(){o(this,e)}return a(e,null,[{key:"getProgramNode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:s.NodeType.Program,body:e,sourceType:"script",obfuscatedNode:!1}}},{key:"getArrayExpressionNode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:s.NodeType.ArrayExpression,elements:e}}},{key:"getAssignmentExpressionNode",value:function(e,t,r){return{type:s.NodeType.AssignmentExpression,operator:e,left:t,right:r,obfuscatedNode:!1}}},{key:"getBinaryExpressionNode",value:function(e,t,r){return{type:s.NodeType.BinaryExpression,operator:e,left:t,right:r,obfuscatedNode:!1}}},{key:"getBlockStatementNode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:s.NodeType.BlockStatement,body:e,obfuscatedNode:!1}}},{key:"getBreakStatement",value:function(e){var t={type:s.NodeType.BreakStatement,obfuscatedNode:!1};return e&&(t.label=e),t}},{key:"getCallExpressionNode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return{type:s.NodeType.CallExpression,callee:e,arguments:t,obfuscatedNode:!1}}},{key:"getContinueStatement",value:function(e){var t={type:s.NodeType.ContinueStatement,obfuscatedNode:!1};return e&&(t.label=e),t}},{key:"getExpressionStatementNode",value:function(e){return{type:s.NodeType.ExpressionStatement,expression:e,obfuscatedNode:!1}}},{key:"getFunctionDeclarationNode",value:function(t,r,n){return{type:s.NodeType.FunctionDeclaration,id:e.getIdentifierNode(t),params:r,body:n,generator:!1,obfuscatedNode:!1}}},{key:"getFunctionExpressionNode",value:function(e,t){return{type:s.NodeType.FunctionExpression,params:e,body:t,generator:!1,obfuscatedNode:!1}}},{key:"getIfStatementNode",value:function(e,t,r){return n({type:s.NodeType.IfStatement,test:e,consequent:t},r&&{alternate:r},{obfuscatedNode:!1})}},{key:"getIdentifierNode",value:function(e){return{type:s.NodeType.Identifier,name:e,obfuscatedNode:!1}}},{key:"getLiteralNode",value:function(e,t){return t=void 0!==t?t:"'".concat(e,"'"),{type:s.NodeType.Literal,value:e,raw:t,"x-verbatim-property":{content:t,precedence:i.Precedence.Primary},obfuscatedNode:!1}}},{key:"getLogicalExpressionNode",value:function(e,t,r){return{type:s.NodeType.LogicalExpression,operator:e,left:t,right:r,obfuscatedNode:!1}}},{key:"getMemberExpressionNode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:s.NodeType.MemberExpression,computed:r,object:e,property:t,obfuscatedNode:!1}}},{key:"getMethodDefinitionNode",value:function(e,t,r,n){return{type:s.NodeType.MethodDefinition,key:e,value:t,kind:r,computed:n,static:!1,obfuscatedNode:!1}}},{key:"getObjectExpressionNode",value:function(e){return{type:s.NodeType.ObjectExpression,properties:e,obfuscatedNode:!1}}},{key:"getPropertyNode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:s.NodeType.Property,key:e,value:t,kind:"init",method:!1,shorthand:!1,computed:r,obfuscatedNode:!1}}},{key:"getUnaryExpressionNode",value:function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return{type:s.NodeType.UnaryExpression,operator:e,argument:t,prefix:r,obfuscatedNode:!1}}},{key:"getReturnStatementNode",value:function(e){return{type:s.NodeType.ReturnStatement,argument:e,obfuscatedNode:!1}}},{key:"getSwitchStatementNode",value:function(e,t){return{type:s.NodeType.SwitchStatement,discriminant:e,cases:t,obfuscatedNode:!1}}},{key:"getSwitchCaseNode",value:function(e,t){return{type:s.NodeType.SwitchCase,test:e,consequent:t,obfuscatedNode:!1}}},{key:"getUpdateExpressionNode",value:function(e,t){return{type:s.NodeType.UpdateExpression,operator:e,argument:t,prefix:!1,obfuscatedNode:!1}}},{key:"getVariableDeclarationNode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"var";return{type:s.NodeType.VariableDeclaration,declarations:e,kind:t,obfuscatedNode:!1}}},{key:"getVariableDeclaratorNode",value:function(e,t){return{type:s.NodeType.VariableDeclarator,id:e,init:t,obfuscatedNode:!1}}},{key:"getWhileStatementNode",value:function(e,t){return{type:s.NodeType.WhileStatement,test:e,body:t,obfuscatedNode:!1}}}]),e}();t.Nodes=c},function(e,t){e.exports=require("@babel/runtime/core-js/map")},function(e,t){e.exports=require("estraverse")},function(e,t){e.exports=require("string-template")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ArrayExpression="ArrayExpression",e.ArrayPattern="ArrayPattern",e.ArrowFunctionExpression="ArrowFunctionExpression",e.AssignmentExpression="AssignmentExpression",e.AssignmentPattern="AssignmentPattern",e.AwaitExpression="AwaitExpression",e.BinaryExpression="BinaryExpression",e.BlockStatement="BlockStatement",e.BreakStatement="BreakStatement",e.CallExpression="CallExpression",e.CatchClause="CatchClause",e.ClassDeclaration="ClassDeclaration",e.ContinueStatement="ContinueStatement",e.ExpressionStatement="ExpressionStatement",e.FunctionDeclaration="FunctionDeclaration",e.FunctionExpression="FunctionExpression",e.Identifier="Identifier",e.IfStatement="IfStatement",e.LabeledStatement="LabeledStatement",e.Literal="Literal",e.LogicalExpression="LogicalExpression",e.MemberExpression="MemberExpression",e.MethodDefinition="MethodDefinition",e.ObjectExpression="ObjectExpression",e.ObjectPattern="ObjectPattern",e.Program="Program",e.Property="Property",e.RestElement="RestElement",e.ReturnStatement="ReturnStatement",e.Super="Super",e.SwitchCase="SwitchCase",e.SwitchStatement="SwitchStatement",e.TemplateLiteral="TemplateLiteral",e.TryStatement="TryStatement",e.UnaryExpression="UnaryExpression",e.UpdateExpression="UpdateExpression",e.VariableDeclaration="VariableDeclaration",e.VariableDeclarator="VariableDeclarator",e.WhileStatement="WhileStatement"}(t.NodeType||(t.NodeType={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Browser="browser",e.Extension="extension",e.Node="node"}(t.ObfuscationTarget||(t.ObfuscationTarget={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BinaryExpressionFunctionNode="BinaryExpressionFunctionNode",e.BlockStatementControlFlowFlatteningNode="BlockStatementControlFlowFlatteningNode",e.CallExpressionControlFlowStorageCallNode="CallExpressionControlFlowStorageCallNode",e.CallExpressionFunctionNode="CallExpressionFunctionNode",e.ControlFlowStorageNode="ControlFlowStorageNode",e.ExpressionWithOperatorControlFlowStorageCallNode="ExpressionWithOperatorControlFlowStorageCallNode",e.LogicalExpressionFunctionNode="LogicalExpressionFunctionNode",e.StringLiteralControlFlowStorageCallNode="StringLiteralControlFlowStorageCallNode",e.StringLiteralNode="StringLiteralNode"}(t.ControlFlowCustomNode||(t.ControlFlowCustomNode={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BaseIdentifierObfuscatingReplacer="BaseIdentifierObfuscatingReplacer"}(t.IdentifierObfuscatingReplacer||(t.IdentifierObfuscatingReplacer={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.AfterObfuscation="afterObfuscation",e.BeforeObfuscation="beforeObfuscation"}(t.ObfuscationEvent||(t.ObfuscationEvent={}))},function(e,t){e.exports=require("@babel/runtime/helpers/toConsumableArray")},function(e,t,r){"use strict";var n=r(24),o=r(1),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i=r(9),s=function(){function e(){o(this,e)}return a(e,null,[{key:"appendNode",value:function(t,r){r=e.parentizeScopeStatementsBeforeAppend(t,r),e.setScopeNodeStatements(t,n(e.getScopeNodeStatements(t)).concat(n(r)))}},{key:"appendNodeToOptimalBlockScope",value:function(t,r,n){var o,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;o=t.length?e.getOptimalBlockScope(t,a):r,e.prependNode(o,n)}},{key:"getOptimalBlockScope",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,o=t[r];if(n<=0)throw new Error("Invalid `deep` argument value. Value should be bigger then 0.");return n>1&&o.stackTrace.length?e.getOptimalBlockScope(o.stackTrace,0,--n):o.callee}},{key:"insertNodeAfter",value:function(t,r,n){var o=e.getScopeNodeStatements(t).indexOf(n);e.insertNodeAtIndex(t,r,o+1)}},{key:"insertNodeAtIndex",value:function(t,r,o){r=e.parentizeScopeStatementsBeforeAppend(t,r),e.setScopeNodeStatements(t,n(e.getScopeNodeStatements(t).slice(0,o)).concat(n(r),n(e.getScopeNodeStatements(t).slice(o))))}},{key:"prependNode",value:function(t,r){r=e.parentizeScopeStatementsBeforeAppend(t,r),e.setScopeNodeStatements(t,n(r).concat(n(e.getScopeNodeStatements(t))))}},{key:"getScopeNodeStatements",value:function(e){return i.NodeGuards.isSwitchCaseNode(e)?e.consequent:e.body}},{key:"parentizeScopeStatementsBeforeAppend",value:function(e,t){return t.forEach(function(t){t.parentNode=e}),t}},{key:"setScopeNodeStatements",value:function(e,t){i.NodeGuards.isSwitchCaseNode(e)?e.consequent=t:e.body=t}}]),e}();t.NodeAppender=s},function(e,t,r){"use strict";var n=r(16),o=r(1),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),s=r(3),c=r(213),u=r(208),d=r(194),l=r(189),f=r(142),p=r(141),m=r(138),g=r(137),_=r(124),N=r(109),v=r(100),y=r(95),h=r(89),b=r(51),S=r(86),I=r(84),C=r(83),O=r(82),j=r(81),F=function(){function e(){o(this,e),this.container=new i.Container}return a(e,[{key:"get",value:function(e){return this.container.get(e)}},{key:"getNamed",value:function(e,t){return this.container.getNamed(e,t)}},{key:"load",value:function(e,t){this.container.bind(s.ServiceIdentifiers.ISourceCode).toDynamicValue(function(){return new C.SourceCode(e)}).inSingletonScope(),this.container.bind(s.ServiceIdentifiers.TInputOptions).toDynamicValue(function(){return t}).inSingletonScope(),this.container.bind(s.ServiceIdentifiers.ILogger).to(b.Logger).inSingletonScope(),this.container.bind(s.ServiceIdentifiers.IJavaScriptObfuscator).to(h.JavaScriptObfuscator).inSingletonScope(),this.container.bind(s.ServiceIdentifiers.ITransformersRunner).to(j.TransformersRunner).inSingletonScope(),this.container.bind(s.ServiceIdentifiers.IObfuscationResult).to(I.ObfuscationResult).inSingletonScope(),this.container.bind(s.ServiceIdentifiers.Factory__IObfuscationResult).toFactory(function(e){return function(t,r){var n=e.container.get(s.ServiceIdentifiers.IObfuscationResult);return n.initialize(t,r),n}}),this.container.bind(s.ServiceIdentifiers.ISourceMapCorrector).to(O.SourceMapCorrector).inSingletonScope(),this.container.bind(s.ServiceIdentifiers.IObfuscationEventEmitter).to(S.ObfuscationEventEmitter).inSingletonScope(),this.container.load(c.analyzersModule),this.container.load(u.controlFlowTransformersModule),this.container.load(d.convertingTransformersModule),this.container.load(l.customNodesModule),this.container.load(f.finalizingTransformersModule),this.container.load(p.generatorsModule),this.container.load(m.nodeTransformersModule),this.container.load(g.obfuscatingTransformersModule),this.container.load(_.optionsModule),this.container.load(N.preparingTransformersModule),this.container.load(v.storagesModule),this.container.load(y.utilsModule)}},{key:"unload",value:function(){this.container.unbindAll()}}],[{key:"getFactory",value:function(e){return function(t){return function(r){return t.container.getNamed(e,r)}}}},{key:"getCacheFactory",value:function(e){return function(t){var r=new n;return function(n){if(r.has(n))return r.get(n);var o=t.container.getNamed(e,n);return r.set(n,o),o}}}},{key:"getConstructorFactory",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o-1||0===e.indexOf("//")?e.split("/")[2]:e.split("/")[0]).split(":")[0]}},{key:"isCeilNumber",value:function(e){return e%1==0}},{key:"stringRotate",value:function(e,t){if(!e)throw new ReferenceError("Cannot rotate empty string.");for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{},r=new i.InversifyContainerFacade;r.load(e,t);var n=r.get(a.ServiceIdentifiers.IJavaScriptObfuscator).obfuscate(e);return r.unload(),n}},{key:"runCLI",value:function(e){var t=new s.JavaScriptObfuscatorCLI(e);t.initialize(),t.run()}}]),e}();t.JavaScriptObfuscator=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Base64="base64",e.Rc4="rc4"}(t.StringArrayEncoding||(t.StringArrayEncoding={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Inline="inline",e.Separate="separate"}(t.SourceMapMode||(t.SourceMapMode={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.HexadecimalIdentifierNamesGenerator="hexadecimal",e.MangledIdentifierNamesGenerator="mangled"}(t.IdentifierNamesGenerator||(t.IdentifierNamesGenerator={}))},function(e,t,r){"use strict";var n=r(1),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a=r(4),i=r(0),s=r(3),c=function(){function e(t,r,o){n(this,e),this.identifierNamesGenerator=t(o),this.randomGenerator=r,this.options=o}return o(e,[{key:"getAppendEvent",value:function(){return this.appendEvent}},{key:"getCustomNodes",value:function(){return this.customNodes}},{key:"appendCustomNodeIfExist",value:function(e,t){var r=this.customNodes.get(e);r&&t(r)}},{key:"getRandomStackTraceIndex",value:function(e){return this.randomGenerator.getRandomInteger(0,Math.max(0,Math.round(e-1)))}}]),e}();c=a.__decorate([i.injectable(),a.__param(0,i.inject(s.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),a.__param(1,i.inject(s.ServiceIdentifiers.IRandomGenerator)),a.__param(2,i.inject(s.ServiceIdentifiers.IOptions)),a.__metadata("design:paramtypes",[Function,Object,Object])],c),t.AbstractCustomNodeGroup=c},function(e,t){e.exports=require("@babel/runtime/core-js/get-iterator")},function(e,t,r){"use strict";var n=r(1);Object.defineProperty(t,"__esModule",{value:!0});var o=r(4),a=r(0),i=r(3),s=function e(t){n(this,e),this.options=t};s=o.__decorate([a.injectable(),o.__param(0,a.inject(i.ServiceIdentifiers.IOptions)),o.__metadata("design:paramtypes",[Object])],s),t.AbstractObfuscatingReplacer=s},function(e,t,r){"use strict";var n=r(59);Object.defineProperty(t,"__esModule",{value:!0});var o=r(35),a=r(20),i=r(34);t.NO_ADDITIONAL_NODES_PRESET=n({compact:!0,controlFlowFlattening:!1,controlFlowFlatteningThreshold:0,deadCodeInjection:!1,deadCodeInjectionThreshold:0,debugProtection:!1,debugProtectionInterval:!1,disableConsoleOutput:!1,domainLock:[],exclude:[],identifierNamesGenerator:o.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,identifiersPrefix:"",log:!1,renameGlobals:!1,reservedNames:[],rotateStringArray:!1,seed:0,selfDefending:!1,sourceMap:!1,sourceMapBaseUrl:"",sourceMapFileName:"",sourceMapMode:i.SourceMapMode.Separate,stringArray:!1,stringArrayEncoding:!1,stringArrayThreshold:0,target:a.ObfuscationTarget.Browser,transformObjectKeys:!1,unicodeEscapeSequence:!1})},function(e,t){e.exports=require("@babel/runtime/core-js/object/keys")},function(e,t){e.exports=require("path")},function(e,t,r){"use strict";var n=r(11),o=r(1),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i=r(4),s=i.__importStar(r(79)),c=i.__importStar(r(53)),u=i.__importStar(r(41)),d=r(10),l=r(43),f=r(78),p=r(77),m=r(76),g=r(75),_=r(74),N=r(73),v=r(72),y=r(32),h=r(69),b=function(){function e(t){o(this,e),this.rawArguments=t,this.arguments=t.slice(2)}return a(e,[{key:"initialize",value:function(){this.inputPath=u.normalize(this.arguments[0]||""),this.commands=new s.Command,this.configureCommands(),this.configureHelp(),this.inputCLIOptions=this.commands.opts()}},{key:"run",value:function(){if(!this.arguments.length||this.arguments.includes("--help"))return this.commands.outputHelp();var e=new h.SourceCodeReader(this.inputCLIOptions).readSourceCode(this.inputPath);this.processSourceCodeData(e)}},{key:"buildOptions",value:function(){var t=e.filterOptions(this.inputCLIOptions),r=this.inputCLIOptions.config,o=r?u.resolve(r,"."):"",a=o?v.CLIUtils.getUserConfig(o):{};return n({},l.DEFAULT_PRESET,a,t)}},{key:"configureCommands",value:function(){this.commands.usage(" [options]").version(c.version,"-v, --version").option("-o, --output ","Output path for obfuscated code").option("--compact ","Disable one line output code compacting",p.BooleanSanitizer).option("--config ","Name of js / json config file").option("--control-flow-flattening ","Enables control flow flattening",p.BooleanSanitizer).option("--control-flow-flattening-threshold ","The probability that the control flow flattening transformation will be applied to the node",parseFloat).option("--dead-code-injection ","Enables dead code injection",p.BooleanSanitizer).option("--dead-code-injection-threshold ","The probability that the dead code injection transformation will be applied to the node",parseFloat).option("--debug-protection ","Disable browser Debug panel (can cause DevTools enabled browser freeze)",p.BooleanSanitizer).option("--debug-protection-interval ","Disable browser Debug panel even after page was loaded (can cause DevTools enabled browser freeze)",p.BooleanSanitizer).option("--disable-console-output ","Allow console.log, console.info, console.error and console.warn messages output into browser console",p.BooleanSanitizer).option("--domain-lock (comma separated, without whitespaces)","Blocks the execution of the code in domains that do not match the passed RegExp patterns (comma separated)",f.ArraySanitizer).option("--exclude (comma separated, without whitespaces)","A filename or glob which indicates files to exclude from obfuscation",f.ArraySanitizer).option("--identifier-names-generator [hexadecimal, mangled]","Sets identifier names generator (Default: hexadecimal)",m.IdentifierNamesGeneratorSanitizer).option("--identifiers-prefix ","Sets prefix for all global identifiers.").option("--log ","Enables logging of the information to the console",p.BooleanSanitizer).option("--reserved-names (comma separated, without whitespaces)","Disable obfuscation of variable names, function names and names of function parameters that match the passed RegExp patterns (comma separated)",f.ArraySanitizer).option("--rename-globals ","Allows to enable obfuscation of global variable and function names with declaration.",p.BooleanSanitizer).option("--rotate-string-array ","Disable rotation of unicode array values during obfuscation",p.BooleanSanitizer).option("--seed ","Sets seed for random generator. This is useful for creating repeatable results.",parseFloat).option("--self-defending ","Disables self-defending for obfuscated code",p.BooleanSanitizer).option("--source-map ","Enables source map generation",p.BooleanSanitizer).option("--source-map-base-url ","Sets base url to the source map import url when `--source-map-mode=separate`").option("--source-map-file-name ","Sets file name for output source map when `--source-map-mode=separate`").option("--source-map-mode [inline, separate]","Specify source map output mode",_.SourceMapModeSanitizer).option("--string-array ","Disables gathering of all literal strings into an array and replacing every literal string with an array call",p.BooleanSanitizer).option("--string-array-encoding [true, false, base64, rc4]","Encodes all strings in strings array using base64 or rc4 (this option can slow down your code speed",N.StringArrayEncodingSanitizer).option("--string-array-threshold ","The probability that the literal string will be inserted into stringArray (Default: 0.8, Min: 0, Max: 1)",parseFloat).option("--target ","Allows to set target environment for obfuscated code.",g.ObfuscationTargetSanitizer).option("--transform-object-keys ","Enables transformation of object keys",p.BooleanSanitizer).option("--unicode-escape-sequence ","Allows to enable/disable string conversion to unicode escape sequence",p.BooleanSanitizer).parse(this.rawArguments)}},{key:"configureHelp",value:function(){this.commands.on("--help",function(){console.log(" Examples:\n"),console.log(" %> javascript-obfuscator input_file_name.js --compact true --self-defending false"),console.log(" %> javascript-obfuscator input_file_name.js --output output_file_name.js --compact true --self-defending false"),console.log(" %> javascript-obfuscator input_directory_name --compact true --self-defending false"),console.log("")})}},{key:"processSourceCodeData",value:function(e){var t=this,r=this.inputCLIOptions.output?u.normalize(this.inputCLIOptions.output):"";if(Array.isArray(e))e.forEach(function(e,n){var o=e.filePath,a=e.content,i=r?u.join(r,o):v.CLIUtils.getOutputCodePath(o);t.processSourceCode(a,i,n)});else{var n=r||v.CLIUtils.getOutputCodePath(this.inputPath);this.processSourceCode(e,n,null)}}},{key:"processSourceCode",value:function(t,r,o){var a=this.buildOptions();if(null!==o){var i=this.inputCLIOptions.identifiersPrefix||e.baseIdentifiersPrefix,s="".concat(i).concat(o);a=n({},a,{identifiersPrefix:s})}a.sourceMap?e.processSourceCodeWithSourceMap(t,r,a):e.processSourceCodeWithoutSourceMap(t,r,a)}}],[{key:"filterOptions",value:function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&void 0!==e[r]&&(t[r]=e[r]);return t}},{key:"processSourceCodeWithoutSourceMap",value:function(e,t,r){var n=y.JavaScriptObfuscator.obfuscate(e,r).getObfuscatedCode();v.CLIUtils.writeFile(t,n)}},{key:"processSourceCodeWithSourceMap",value:function(e,t,r){var o=v.CLIUtils.getOutputSourceMapPath(t,r.sourceMapFileName||"");r=n({},r,{sourceMapFileName:u.basename(o)});var a=y.JavaScriptObfuscator.obfuscate(e,r);v.CLIUtils.writeFile(t,a.getObfuscatedCode()),"separate"===r.sourceMapMode&&a.getSourceMap()&&v.CLIUtils.writeFile(o,a.getSourceMap())}}]),e}();b.encoding="utf8",b.obfuscatedFilePrefix="-obfuscated",b.baseIdentifiersPrefix="a",i.__decorate([d.initializable(),i.__metadata("design:type",Object)],b.prototype,"commands",void 0),i.__decorate([d.initializable(),i.__metadata("design:type",Object)],b.prototype,"inputCLIOptions",void 0),i.__decorate([d.initializable(),i.__metadata("design:type",String)],b.prototype,"inputPath",void 0),t.JavaScriptObfuscatorCLI=b},function(e,t,r){"use strict";var n=r(59);Object.defineProperty(t,"__esModule",{value:!0});var o=r(35),a=r(20),i=r(34);t.DEFAULT_PRESET=n({compact:!0,config:"",controlFlowFlattening:!1,controlFlowFlatteningThreshold:.75,deadCodeInjection:!1,deadCodeInjectionThreshold:.4,debugProtection:!1,debugProtectionInterval:!1,disableConsoleOutput:!1,domainLock:[],exclude:[],identifierNamesGenerator:o.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,identifiersPrefix:"",log:!1,renameGlobals:!1,reservedNames:[],rotateStringArray:!0,seed:0,selfDefending:!1,sourceMap:!1,sourceMapBaseUrl:"",sourceMapFileName:"",sourceMapMode:i.SourceMapMode.Separate,stringArray:!0,stringArrayEncoding:!1,stringArrayThreshold:.75,target:a.ObfuscationTarget.Browser,transformObjectKeys:!1,unicodeEscapeSequence:!1})},function(e,t){e.exports=require("@babel/runtime/helpers/get")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableNoEvalTemplate=function(){return"\n var that = (typeof window !== 'undefined'\n ? window\n : (typeof process === 'object' &&\n typeof require === 'function' &&\n typeof global === 'object')\n ? global\n : this);\n "}},function(e,t,r){"use strict";var n=r(16),o=r(1),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i,s=r(4),c=r(0),u=r(3),d=i=function(){function e(t,r,a){o(this,e),this.replacerDataByControlFlowStorageId=new n,this.controlFlowCustomNodeFactory=t,this.randomGenerator=r,this.options=a}return a(e,[{key:"insertCustomNodeToControlFlowStorage",value:function(e,t,r,n){var o=this,a=t.getStorageId(),s=i.getStorageKeysByIdForCurrentStorage(this.replacerDataByControlFlowStorageId,a),c=s.get(r);if(this.randomGenerator.getMathRandom()1&&void 0!==arguments[1]?arguments[1]:a.randomGeneratorPool;return this.getRandomGenerator().string({length:e,pool:t})}},{key:"getSeed",value:function(){return this.seed}}]),e}();f.randomGeneratorPool="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",i.__decorate([l.initializable(),i.__metadata("design:type",Object)],f.prototype,"randomGenerator",void 0),i.__decorate([l.initializable(),i.__metadata("design:type",Number)],f.prototype,"seed",void 0),i.__decorate([s.postConstruct(),i.__metadata("design:type",Function),i.__metadata("design:paramtypes",[]),i.__metadata("design:returntype",void 0)],f.prototype,"initialize",null),f=a=i.__decorate([s.injectable(),i.__param(0,s.inject(c.ServiceIdentifiers.ISourceCode)),i.__param(1,s.inject(c.ServiceIdentifiers.IOptions)),i.__metadata("design:paramtypes",[Object,Object])],f),t.RandomGenerator=f},function(e,t,r){"use strict";var n=r(24),o=r(37),a=r(29),i=r(16),s=r(1),c=r(2);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=r(10),p=function(){function e(t,r){s(this,e),this.randomGenerator=t,this.options=r}return c(e,[{key:"initialize",value:function(){this.storage=new i,this.storageId=this.randomGenerator.getRandomString(6)}},{key:"get",value:function(e){var t=this.storage.get(e);if(!t)throw new Error("No value found in map storage with key `".concat(e,"`"));return t}},{key:"getKeyOf",value:function(e){var t=!0,r=!1,n=void 0;try{for(var i,s=o(this.storage);!(t=(i=s.next()).done);t=!0){var c=i.value,u=a(c,2),d=u[0];if(e===u[1])return d}}catch(e){r=!0,n=e}finally{try{t||null==s.return||s.return()}finally{if(r)throw n}}return null}},{key:"getLength",value:function(){return this.storage.size}},{key:"getStorage",value:function(){return this.storage}},{key:"getStorageId",value:function(){return this.storageId}},{key:"mergeWith",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.storage=new i(n(this.storage).concat(n(e.getStorage()))),t&&(this.storageId=e.getStorageId())}},{key:"set",value:function(e,t){this.storage.set(e,t)}}]),e}();u.__decorate([f.initializable(),u.__metadata("design:type",String)],p.prototype,"storageId",void 0),u.__decorate([f.initializable(),u.__metadata("design:type",i)],p.prototype,"storage",void 0),u.__decorate([d.postConstruct(),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[]),u.__metadata("design:returntype",void 0)],p.prototype,"initialize",null),p=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Object,Object])],p),t.MapStorage=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BlackListNodeGuard="BlackListNodeGuard",e.ConditionalCommentNodeGuard="ConditionalCommentNodeGuard"}(t.ObfuscatingGuard||(t.ObfuscatingGuard={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BooleanLiteralObfuscatingReplacer="BooleanLiteralObfuscatingReplacer",e.NumberLiteralObfuscatingReplacer="NumberLiteralObfuscatingReplacer",e.StringLiteralObfuscatingReplacer="StringLiteralObfuscatingReplacer"}(t.LiteralObfuscatingReplacer||(t.LiteralObfuscatingReplacer={}))},function(e,t,r){"use strict";var n=r(1);Object.defineProperty(t,"__esModule",{value:!0});var o=r(4),a=r(0),i=r(3),s=function e(t,r){n(this,e),this.randomGenerator=t,this.options=r};s=o.__decorate([a.injectable(),o.__param(0,a.inject(i.ServiceIdentifiers.IRandomGenerator)),o.__param(1,a.inject(i.ServiceIdentifiers.IOptions)),o.__metadata("design:paramtypes",[Object,Object])],s),t.AbstractIdentifierNamesGenerator=s},function(e,t){e.exports=require("@babel/runtime/core-js/object/freeze")},function(e,t){e.exports=require("@babel/runtime/core-js/array/from")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ConsoleOutputCustomNodeGroup="ConsoleOutputCustomNodeGroup",e.DebugProtectionCustomNodeGroup="DebugProtectionCustomNodeGroup",e.DomainLockCustomNodeGroup="DomainLockCustomNodeGroup",e.SelfDefendingCustomNodeGroup="SelfDefendingCustomNodeGroup",e.StringArrayCustomNodeGroup="StringArrayCustomNodeGroup"}(t.CustomNodeGroup||(t.CustomNodeGroup={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BlockStatementDeadCodeInjectionNode="BlockStatementDeadCodeInjectionNode"}(t.DeadCodeInjectionCustomNode||(t.DeadCodeInjectionCustomNode={}))},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=r(21),f=r(46),p=r(9),m=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"getControlFlowStorageCallNode",value:function(e,t,r,n){var o=this.controlFlowCustomNodeFactory(l.ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode);o.initialize(e,t,r,n);var a=o.getNode()[0];if(!a||!p.NodeGuards.isExpressionStatementNode(a))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return a.expression}}]),t}(f.AbstractControlFlowReplacer);m=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IControlFlowCustomNode)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],m),t.ExpressionWithOperatorControlFlowReplacer=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BinaryExpressionControlFlowReplacer="BinaryExpressionControlFlowReplacer",e.CallExpressionControlFlowReplacer="CallExpressionControlFlowReplacer",e.LogicalExpressionControlFlowReplacer="LogicalExpressionControlFlowReplacer",e.StringLiteralControlFlowReplacer="StringLiteralControlFlowReplacer"}(t.ControlFlowReplacer||(t.ControlFlowReplacer={}))},function(e,t){e.exports=require("esprima")},function(e,t){e.exports=require("@babel/runtime/helpers/typeof")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.FunctionDeclarationCalleeDataExtractor="FunctionDeclarationCalleeDataExtractor",e.FunctionExpressionCalleeDataExtractor="FunctionExpressionCalleeDataExtractor",e.ObjectExpressionCalleeDataExtractor="ObjectExpressionCalleeDataExtractor"}(t.CalleeDataExtractor||(t.CalleeDataExtractor={}))},function(e,t){e.exports=require("multimatch")},function(e,t,r){"use strict";var n=r(24),o=r(1),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i=__importStar(r(49)),s=__importStar(r(41)),c=__importDefault(r(68)),u=r(50),d=r(42),l=r(51),f=function(){function e(t){o(this,e),this.options=t}return a(e,[{key:"readSourceCode",value:function(t){if(e.isFilePath(t)&&this.isValidFile(t))return this.readFile(t);if(e.isDirectoryPath(t)&&this.isValidDirectory(t))return this.readDirectoryRecursive(t);var r=e.availableInputExtensions.map(function(e){return"`".concat(e,"`")}).join(", ");throw new ReferenceError("Given input path must be a valid ".concat(r," file or directory path"))}},{key:"readDirectoryRecursive",value:function(t){var r=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return i.readdirSync(t,d.JavaScriptObfuscatorCLI.encoding).forEach(function(a){var i="".concat(t,"/").concat(a);if(e.isDirectoryPath(i)&&r.isValidDirectory(i))o.push.apply(o,n(r.readDirectoryRecursive(i)));else if(e.isFilePath(i)&&r.isValidFile(i)){var s=r.readFile(i);o.push({filePath:i,content:s})}}),o}},{key:"readFile",value:function(t){return e.logFilePath(t),i.readFileSync(t,d.JavaScriptObfuscatorCLI.encoding)}},{key:"isValidDirectory",value:function(t){return!e.isExcludedPath(t,this.options.exclude)}},{key:"isValidFile",value:function(t){return e.availableInputExtensions.includes(s.extname(t))&&!t.includes(d.JavaScriptObfuscatorCLI.obfuscatedFilePrefix)&&!e.isExcludedPath(t,this.options.exclude)}}],[{key:"isExcludedPath",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!t.length)return!1;var r=s.basename(e),n=!!c.default([e],t).length;return t.some(function(t){return e.includes(t)||r.includes(t)})||n}},{key:"isDirectoryPath",value:function(e){try{return i.statSync(e).isDirectory()}catch(e){return!1}}},{key:"isFilePath",value:function(e){try{return i.statSync(e).isFile()}catch(e){return!1}}},{key:"logFilePath",value:function(e){var t=s.normalize(e);l.Logger.log(l.Logger.colorInfo,u.LoggingPrefix.CLI,"Obfuscating file: ".concat(t,"..."))}}]),e}();f.availableInputExtensions=[".js"],t.SourceCodeReader=f},function(e,t){function r(e){var t=new Error('Cannot find module "'+e+'".');throw t.code="MODULE_NOT_FOUND",t}r.keys=function(){return[]},r.resolve=r,e.exports=r,r.id=70},function(e,t){e.exports=require("mkdirp")},function(e,t,r){"use strict";var n=r(1),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a=__importStar(r(49)),i=__importStar(r(71)),s=__importStar(r(41)),c=r(42),u=function(){function e(){n(this,e)}return o(e,null,[{key:"getOutputCodePath",value:function(e){return s.normalize(e).split(".").map(function(e,t){return 0===t?"".concat(e).concat(c.JavaScriptObfuscatorCLI.obfuscatedFilePrefix):e}).join(".")}},{key:"getOutputSourceMapPath",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return t&&(e="".concat(e.substring(0,e.lastIndexOf("/")),"/").concat(t)),/\.js\.map$/.test(e)?/\.js$/.test(e)&&(e+=".map"):e="".concat(e.split(".")[0],".js.map"),e}},{key:"getUserConfig",value:function(e){var t;try{t=r(70)(e)}catch(r){try{t=require(e)}catch(e){throw new ReferenceError("Given config path must be a valid `.js` or `.json` file path")}}return t}},{key:"writeFile",value:function(e,t){i.sync(s.dirname(e)),a.writeFileSync(e,t,{encoding:c.JavaScriptObfuscatorCLI.encoding})}}]),e}();t.CLIUtils=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(33);t.StringArrayEncodingSanitizer=function(e){switch(e){case"true":case"1":case n.StringArrayEncoding.Base64:return!0;case n.StringArrayEncoding.Rc4:return n.StringArrayEncoding.Rc4;default:return!1}}},function(e,t,r){"use strict";var n=r(40);Object.defineProperty(t,"__esModule",{value:!0});var o=r(34);t.SourceMapModeSanitizer=function(e){if(!n(o.SourceMapMode).some(function(t){return o.SourceMapMode[t]===e}))throw new ReferenceError("Invalid value of `--source-map-mode` option");return e}},function(e,t,r){"use strict";var n=r(40);Object.defineProperty(t,"__esModule",{value:!0});var o=r(20);t.ObfuscationTargetSanitizer=function(e){if(!n(o.ObfuscationTarget).some(function(t){return o.ObfuscationTarget[t]===e}))throw new ReferenceError("Invalid value of `--target` option");return e}},function(e,t,r){"use strict";var n=r(40);Object.defineProperty(t,"__esModule",{value:!0});var o=r(35);t.IdentifierNamesGeneratorSanitizer=function(e){if(!n(o.IdentifierNamesGenerator).some(function(t){return o.IdentifierNamesGenerator[t]===e}))throw new ReferenceError("Invalid value of `--identifier-names-generator` option");return e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanSanitizer=function(e){return"true"===e||"1"===e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArraySanitizer=function(e){if(/,$/.test(e))throw new SyntaxError("Multiple values should be wrapped inside quotes: --option-name 'value1, value2'");return e.split(",").map(function(e){return e.trim()})}},function(e,t){e.exports=require("commander")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Enter="enter",e.Leave="leave"}(t.VisitorDirection||(t.VisitorDirection={}))},function(e,t,r){"use strict";var n=r(1),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a=r(4),i=r(0),s=r(3),c=a.__importStar(r(17)),u=r(80),d=r(9),l=function(){function e(t){n(this,e),this.nodeTransformerFactory=t}return o(e,[{key:"transform",value:function(e,t,r){if(!t.length)return e;for(var n,o=[],a=[],i=t.length,s=0;s"),d="...".concat(i.substring(s,c).replace(/^\s+/,""),"...");throw new Error("".concat(r,"\n").concat(u," ").concat(d))}}]),e}();c.colorError=s.default.red,c.nearestSymbolsCount=10,t.EsprimaFacade=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.EmptySourceCode="Empty source code. Obfuscation canceled...",e.ObfuscationCompleted="Obfuscation completed. Total time: %s sec.",e.ObfuscationStarted="Obfuscation started...",e.RandomGeneratorSeed="Random generator seed: %s...",e.TransformationStage="Transformation stage: %s...",e.Version="Version: %s"}(t.LoggingMessage||(t.LoggingMessage={}))},function(e,t,r){"use strict";var n=r(11),o=r(1),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i,s=r(4),c=r(0),u=r(3),d=s.__importStar(r(47)),l=s.__importStar(r(53)),f=r(88),p=r(31),m=r(12),g=r(87),_=r(9),N=i=function(){function e(t,r,n,a,i){o(this,e),this.transformersRunner=t,this.sourceMapCorrector=r,this.randomGenerator=n,this.logger=a,this.options=i}return a(e,[{key:"obfuscate",value:function(e){var t=Date.now();this.logger.info(f.LoggingMessage.Version,l.version),this.logger.info(f.LoggingMessage.ObfuscationStarted),this.logger.info(f.LoggingMessage.RandomGeneratorSeed,this.randomGenerator.getSeed());var r=this.parseCode(e),n=this.transformAstTree(r),o=this.generateCode(e,n),a=(Date.now()-t)/1e3;return this.logger.success(f.LoggingMessage.ObfuscationCompleted,a),this.getObfuscationResult(o)}},{key:"parseCode",value:function(e){return g.EsprimaFacade.parse(e,{attachComment:!0,loc:this.options.sourceMap})}},{key:"transformAstTree",value:function(e){return!_.NodeGuards.isProgramNode(e)||e.body.length||e.leadingComments?(e=this.runTransformationStage(e,m.TransformationStage.Preparing),this.options.deadCodeInjection&&(e=this.runTransformationStage(e,m.TransformationStage.DeadCodeInjection)),this.options.controlFlowFlattening&&(e=this.runTransformationStage(e,m.TransformationStage.ControlFlowFlattening)),e=this.runTransformationStage(e,m.TransformationStage.Converting),e=this.runTransformationStage(e,m.TransformationStage.Obfuscating),e=this.runTransformationStage(e,m.TransformationStage.Finalizing)):(this.logger.warn(f.LoggingMessage.EmptySourceCode),e)}},{key:"generateCode",value:function(e,t){var r=n({},i.escodegenParams);this.options.sourceMap&&(r.sourceMap="sourceMap",r.sourceContent=e);var o=d.generate(t,n({},r,{format:{compact:this.options.compact}}));return o.map=o.map?o.map.toString():"",o}},{key:"getObfuscationResult",value:function(e){return this.sourceMapCorrector.correct(e.code,e.map)}},{key:"runTransformationStage",value:function(e,t){return this.logger.info(f.LoggingMessage.TransformationStage,t),this.transformersRunner.transform(e,i.transformersList,t)}}]),e}();N.escodegenParams={comment:!0,verbatim:"x-verbatim-property",sourceMapWithCode:!0},N.transformersList=[p.NodeTransformer.BlockStatementControlFlowTransformer,p.NodeTransformer.ClassDeclarationTransformer,p.NodeTransformer.CommentsTransformer,p.NodeTransformer.CustomNodesTransformer,p.NodeTransformer.DeadCodeInjectionTransformer,p.NodeTransformer.EvalCallExpressionTransformer,p.NodeTransformer.FunctionControlFlowTransformer,p.NodeTransformer.CatchClauseTransformer,p.NodeTransformer.FunctionDeclarationTransformer,p.NodeTransformer.FunctionTransformer,p.NodeTransformer.LabeledStatementTransformer,p.NodeTransformer.LiteralTransformer,p.NodeTransformer.MemberExpressionTransformer,p.NodeTransformer.MethodDefinitionTransformer,p.NodeTransformer.ObfuscatingGuardsTransformer,p.NodeTransformer.ObjectExpressionKeysTransformer,p.NodeTransformer.ObjectExpressionTransformer,p.NodeTransformer.ParentificationTransformer,p.NodeTransformer.TemplateLiteralTransformer,p.NodeTransformer.VariableDeclarationTransformer],N=i=s.__decorate([c.injectable(),s.__param(0,c.inject(u.ServiceIdentifiers.ITransformersRunner)),s.__param(1,c.inject(u.ServiceIdentifiers.ISourceMapCorrector)),s.__param(2,c.inject(u.ServiceIdentifiers.IRandomGenerator)),s.__param(3,c.inject(u.ServiceIdentifiers.ILogger)),s.__param(4,c.inject(u.ServiceIdentifiers.IOptions)),s.__metadata("design:paramtypes",[Object,Object,Object,Object,Object])],N),t.JavaScriptObfuscator=N},function(e,t,r){"use strict";var n=r(16),o=r(1),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i=r(4),s=r(0),c=function(){function e(){o(this,e),this.stringsCache=new n}return a(e,[{key:"encode",value:function(e,t){var r="".concat(e,"-").concat(String(t));if(this.stringsCache.has(r))return this.stringsCache.get(r);var n,o,a=new RegExp("[\\s\\S]","g"),i=new RegExp("['\"\\\\\\s]"),s=new RegExp("[\\x00-\\x7F]"),c=e.replace(a,function(e){return t||i.exec(e)?(s.exec(e)?(n="\\x",o="00"):(n="\\u",o="0000"),"".concat(n).concat((o+e.charCodeAt(0).toString(16)).slice(-o.length))):e});return this.stringsCache.set(r,c),c}}]),e}();c=i.__decorate([s.injectable()],c),t.EscapeSequenceEncoder=c},function(e,t){e.exports=require("chance")},function(e,t){e.exports=require("md5")},function(e,t,r){"use strict";var n=r(1),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a=r(4),i=r(0),s=r(3),c=r(54),u=r(27),d=function(){function e(t){n(this,e),this.randomGenerator=t}return o(e,[{key:"btoa",value:function(e){var t="";e=encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode(parseInt("".concat(u.Utils.hexadecimalPrefix).concat(t)))});for(var r,n,o=0,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e.charAt(0|o)||(a="=",o%1);t+=a.charAt(63&r>>8-o%1*8)){if((n=e.charCodeAt(o+=.75))>255)throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");r=r<<8|n}return t}},{key:"hideString",value:function(e,t){var r=this,n=this.randomGenerator.getRandomGenerator().string({length:t,pool:c.RandomGenerator.randomGeneratorPool}).replace(new RegExp("[".concat(e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"]"),"g"),""),o=n.split("");return this.randomGenerator.getRandomGenerator().shuffle(o),[function(e,t){for(var n=-1,o=-1,a="";n=0?t:null}},{key:"getLength",value:function(){return this.storageLength}},{key:"getStorage",value:function(){return this.storage}},{key:"getStorageId",value:function(){return this.storageId}},{key:"mergeWith",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.storage=n(this.storage).concat(n(e.getStorage())),t&&(this.storageId=e.getStorageId())}},{key:"set",value:function(e,t){e===this.storageLength?this.storage.push(t):this.storage.splice(e,0,t),this.storageLength++}}]),e}();i.__decorate([u.initializable(),i.__metadata("design:type",Array)],d.prototype,"storage",void 0),i.__decorate([u.initializable(),i.__metadata("design:type",String)],d.prototype,"storageId",void 0),i.__decorate([s.postConstruct(),i.__metadata("design:type",Function),i.__metadata("design:paramtypes",[]),i.__metadata("design:returntype",void 0)],d.prototype,"initialize",null),d=i.__decorate([s.injectable(),i.__param(0,s.inject(c.ServiceIdentifiers.IRandomGenerator)),i.__param(1,s.inject(c.ServiceIdentifiers.IOptions)),i.__metadata("design:paramtypes",[Object,Object])],d),t.ArrayStorage=d},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(44),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u,d=r(4),l=r(0),f=r(3),p=r(96),m=u=function(e){function t(e,r,a,s){var c;return o(this,t),(c=i(this,(t.__proto__||n(t)).call(this,a,s))).identifierNamesGenerator=e(s),c.arrayUtils=r,c}return c(t,e),a(t,[{key:"initialize",value:function(){s(t.prototype.__proto__||n(t.prototype),"initialize",this).call(this);var e=this.identifierNamesGenerator.generate().slice(0,u.stringArrayNameLength),r=this.identifierNamesGenerator.generate().slice(0,u.stringArrayNameLength),o="".concat(this.options.identifiersPrefix).concat(e),a="".concat(this.options.identifiersPrefix).concat(r);this.storageId="".concat(o,"|").concat(a)}},{key:"rotateArray",value:function(e){this.storage=this.arrayUtils.arrayRotate(this.storage,e)}},{key:"toString",value:function(){return this.storage.map(function(e){return"'".concat(e,"'")}).toString()}}]),t}(p.ArrayStorage);m.stringArrayNameLength=7,d.__decorate([l.postConstruct(),d.__metadata("design:type",Function),d.__metadata("design:paramtypes",[]),d.__metadata("design:returntype",void 0)],m.prototype,"initialize",null),m=u=d.__decorate([l.injectable(),d.__param(0,l.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d.__param(1,l.inject(f.ServiceIdentifiers.IArrayUtils)),d.__param(2,l.inject(f.ServiceIdentifiers.IRandomGenerator)),d.__param(3,l.inject(f.ServiceIdentifiers.IOptions)),d.__metadata("design:paramtypes",[Function,Object,Object,Object])],m),t.StringArrayStorage=m},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(44),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u,d=r(4),l=r(0),f=r(3),p=r(61),m=r(55),g=u=function(e){function t(e,r,a){var s;return o(this,t),(s=i(this,(t.__proto__||n(t)).call(this,r,a))).customNodeGroupFactory=e,s}return c(t,e),a(t,[{key:"initialize",value:function(){var e=this;s(t.prototype.__proto__||n(t.prototype),"initialize",this).call(this),u.customNodeGroupsList.forEach(function(t){var r=e.customNodeGroupFactory(t);r&&e.storage.set(t,r)})}}]),t}(m.MapStorage);g.customNodeGroupsList=[p.CustomNodeGroup.ConsoleOutputCustomNodeGroup,p.CustomNodeGroup.DebugProtectionCustomNodeGroup,p.CustomNodeGroup.DomainLockCustomNodeGroup,p.CustomNodeGroup.SelfDefendingCustomNodeGroup,p.CustomNodeGroup.StringArrayCustomNodeGroup],d.__decorate([l.postConstruct(),d.__metadata("design:type",Function),d.__metadata("design:paramtypes",[]),d.__metadata("design:returntype",void 0)],g.prototype,"initialize",null),g=u=d.__decorate([l.injectable(),d.__param(0,l.inject(f.ServiceIdentifiers.Factory__ICustomNodeGroup)),d.__param(1,l.inject(f.ServiceIdentifiers.IRandomGenerator)),d.__param(2,l.inject(f.ServiceIdentifiers.IOptions)),d.__metadata("design:paramtypes",[Function,Object,Object])],g),t.CustomNodeGroupStorage=g},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(6),i=r(5);Object.defineProperty(t,"__esModule",{value:!0});var s=r(4),c=r(0),u=r(3),d=function(e){function t(e,r){return o(this,t),a(this,(t.__proto__||n(t)).call(this,e,r))}return i(t,e),t}(r(55).MapStorage);d=s.__decorate([c.injectable(),s.__param(0,c.inject(u.ServiceIdentifiers.IRandomGenerator)),s.__param(1,c.inject(u.ServiceIdentifiers.IOptions)),s.__metadata("design:paramtypes",[Object,Object])],d),t.ControlFlowStorage=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),o=r(3),a=r(99),i=r(98),s=r(97);t.storagesModule=new n.ContainerModule(function(e){e(o.ServiceIdentifiers.TCustomNodeGroupStorage).to(i.CustomNodeGroupStorage).inSingletonScope(),e(o.ServiceIdentifiers.TStringArrayStorage).to(s.StringArrayStorage).inSingletonScope(),e(o.ServiceIdentifiers.Newable__TControlFlowStorage).toConstructor(a.ControlFlowStorage),e(o.ServiceIdentifiers.Factory__TControlFlowStorage).toFactory(function(e){return function(){var t=new(e.container.get(o.ServiceIdentifiers.Newable__TControlFlowStorage))(e.container.get(o.ServiceIdentifiers.IRandomGenerator),e.container.get(o.ServiceIdentifiers.IOptions));return t.initialize(),t}})})},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=r(12),f=r(14),p=r(8),m=function(e){function t(e,r){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r))}return s(t,e),a(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case l.TransformationStage.Preparing:return{enter:function(e,r){return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){return p.NodeUtils.parentizeNode(e,t)}}]),t}(f.AbstractNodeTransformer);m=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Object,Object])],m),t.ParentificationTransformer=m},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c,u=r(4),d=r(0),l=r(3),f=r(56),p=r(12),m=r(14),g=c=function(e){function t(e,r,a){var s;return o(this,t),(s=i(this,(t.__proto__||n(t)).call(this,r,a))).obfuscatingGuards=c.obfuscatingGuardsList.map(e),s}return s(t,e),a(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case p.TransformationStage.Preparing:return{enter:function(e,r){return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){var r=this.obfuscatingGuards.every(function(t){return t.check(e)});return e.ignoredNode=!r,e}}]),t}(m.AbstractNodeTransformer);g.obfuscatingGuardsList=[f.ObfuscatingGuard.BlackListNodeGuard,f.ObfuscatingGuard.ConditionalCommentNodeGuard],g=c=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__INodeGuard)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object])],g),t.ObfuscatingGuardsTransformer=g},function(e,t){e.exports=require("js-string-escape")},function(e,t,r){"use strict";var n=r(30),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u,d=r(4),l=r(0),f=r(3),p=d.__importDefault(r(103)),m=r(12),g=r(14),_=r(9),N=r(15),v=r(8),y=u=function(e){function t(e,r){var i;return a(this,t),(i=s(this,(t.__proto__||o(t)).call(this,e,r))).evalRootAstHostNodeSet=new n,i}return c(t,e),i(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case m.TransformationStage.Preparing:return{enter:function(e,r){if(r&&_.NodeGuards.isCallExpressionNode(e)&&_.NodeGuards.isIdentifierNode(e.callee)&&"eval"===e.callee.name)return t.transformNode(e,r)}};case m.TransformationStage.Finalizing:return this.evalRootAstHostNodeSet.size?{leave:function(e,r){if(r&&t.isEvalRootAstHostNode(e))return t.restoreNode(e,r)}}:null;default:return null}}},{key:"transformNode",value:function(e,t){var r=e.arguments[0];if(!r)return e;var n,o=u.extractEvalStringFromCallExpressionArgument(r);if(!o)return e;try{n=v.NodeUtils.convertCodeToStructure(o)}catch(t){return e}var a=N.Nodes.getFunctionExpressionNode([],N.Nodes.getBlockStatementNode(n));return this.evalRootAstHostNodeSet.add(a),a}},{key:"restoreNode",value:function(e,t){var r=e.body.body,n=v.NodeUtils.convertStructureToCode(r);return N.Nodes.getCallExpressionNode(N.Nodes.getIdentifierNode("eval"),[N.Nodes.getLiteralNode(p.default(n))])}},{key:"isEvalRootAstHostNode",value:function(e){return _.NodeGuards.isFunctionExpressionNode(e)&&this.evalRootAstHostNodeSet.has(e)}}],[{key:"extractEvalStringFromCallExpressionArgument",value:function(e){return _.NodeGuards.isLiteralNode(e)?u.extractEvalStringFromLiteralNode(e):_.NodeGuards.isTemplateLiteralNode(e)?u.extractEvalStringFromTemplateLiteralNode(e):null}},{key:"extractEvalStringFromLiteralNode",value:function(e){return"string"==typeof e.value?e.value:null}},{key:"extractEvalStringFromTemplateLiteralNode",value:function(e){var t=e.quasis;return 1!==t.length||e.expressions.length?null:t[0].value.cooked}}]),t}(g.AbstractNodeTransformer);y=u=d.__decorate([l.injectable(),d.__param(0,l.inject(f.ServiceIdentifiers.IRandomGenerator)),d.__param(1,l.inject(f.ServiceIdentifiers.IOptions)),d.__metadata("design:paramtypes",[Object,Object])],y),t.EvalCallExpressionTransformer=y},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=r(23),f=r(12),p=r(14),m=r(9),g=function(e){function t(e,r,a,s,c){var u;return o(this,t),(u=i(this,(t.__proto__||n(t)).call(this,s,c))).stackTraceData=[],u.stackTraceAnalyzer=e,u.obfuscationEventEmitter=r,u.customNodeGroupStorage=a,u}return s(t,e),a(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case f.TransformationStage.Preparing:return{leave:function(e,r){if(m.NodeGuards.isProgramNode(e))return t.analyzeNode(e,r),t.appendCustomNodesBeforeObfuscation(e,r),t.transformNode(e,r)}};case f.TransformationStage.Finalizing:return{leave:function(e,r){m.NodeGuards.isProgramNode(e)&&t.appendCustomNodesAfterObfuscation(e,r)}};default:return null}}},{key:"analyzeNode",value:function(e,t){this.stackTraceData=this.stackTraceAnalyzer.analyze(e)}},{key:"transformNode",value:function(e,t){return e}},{key:"appendCustomNodesBeforeObfuscation",value:function(e,t){var r=this;this.customNodeGroupStorage.getStorage().forEach(function(e){e.initialize(),r.obfuscationEventEmitter.once(e.getAppendEvent(),e.appendCustomNodes.bind(e))}),this.obfuscationEventEmitter.emit(l.ObfuscationEvent.BeforeObfuscation,e,this.stackTraceData)}},{key:"appendCustomNodesAfterObfuscation",value:function(e,t){this.obfuscationEventEmitter.emit(l.ObfuscationEvent.AfterObfuscation,e,this.stackTraceData)}}]),t}(p.AbstractNodeTransformer);g=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.IStackTraceAnalyzer)),c.__param(1,u.inject(d.ServiceIdentifiers.IObfuscationEventEmitter)),c.__param(2,u.inject(d.ServiceIdentifiers.TCustomNodeGroupStorage)),c.__param(3,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(4,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Object,Object,Object,Object,Object])],g),t.CustomNodesTransformer=g},function(e,t,r){"use strict";var n=r(1),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a,i=r(4),s=r(0),c=r(9),u=a=function(){function e(){n(this,e),this.obfuscationAllowedForCurrentNode=!0,this.obfuscationAllowedForNextNode=null}return o(e,[{key:"check",value:function(e){if(this.obfuscationAllowedForNextNode&&(this.obfuscationAllowedForCurrentNode=this.obfuscationAllowedForNextNode,this.obfuscationAllowedForNextNode=null),!c.NodeGuards.isNodeWithComments(e))return this.obfuscationAllowedForCurrentNode;var t=e.leadingComments,r=e.trailingComments;return t&&(this.obfuscationAllowedForCurrentNode=this.checkComments(t)),r&&(this.obfuscationAllowedForNextNode=this.checkComments(r)),this.obfuscationAllowedForCurrentNode}},{key:"checkComments",value:function(e){for(var t=e.length,r=this.obfuscationAllowedForCurrentNode,n=0;n=u.minimumLengthForStringArray&&this.randomGenerator.getMathRandom()<=this.options.stringArrayThreshold}},{key:"getStringArrayHexadecimalIndex",value:function(e,t){if(this.stringLiteralHexadecimalIndexCache.has(e))return{fromCache:!0,index:this.stringLiteralHexadecimalIndexCache.get(e)};var r=_.Utils.decToHex(t),n="".concat(_.Utils.hexadecimalPrefix).concat(r);return this.stringLiteralHexadecimalIndexCache.set(e,n),{fromCache:!1,index:n}}},{key:"getEncodedValue",value:function(e){var t,r=null;switch(this.options.stringArrayEncoding){case p.StringArrayEncoding.Rc4:r=this.randomGenerator.getRandomGenerator().pickone(this.rc4Keys),t=this.cryptUtils.btoa(this.cryptUtils.rc4(e,r));break;case p.StringArrayEncoding.Base64:t=this.cryptUtils.btoa(e);break;default:t=e}return{encodedValue:t,key:r}}},{key:"replaceWithLiteralNode",value:function(e){return g.Nodes.getLiteralNode(this.escapeSequenceEncoder.encode(e,this.options.unicodeEscapeSequence))}},{key:"replaceWithStringArrayCallNode",value:function(e){var t=this.getEncodedValue(e),r=t.encodedValue,n=t.key,o=this.escapeSequenceEncoder.encode(r,this.options.unicodeEscapeSequence),a=this.stringArrayStorage.getLength(),i=this.stringArrayStorage.getStorageId().split("|")[1],s=this.getStringArrayHexadecimalIndex(o,a),c=s.fromCache,d=s.index;c||this.stringArrayStorage.set(a,o);var l=[u.getHexadecimalLiteralNode(d)];n&&l.push(u.getRc4KeyLiteralNode(this.escapeSequenceEncoder.encode(n,this.options.unicodeEscapeSequence)));var f=g.Nodes.getIdentifierNode(i);return f.obfuscatedNode=!0,g.Nodes.getCallExpressionNode(f,l)}}],[{key:"getHexadecimalLiteralNode",value:function(e){var t=g.Nodes.getLiteralNode(e);return t.obfuscatedNode=!0,t}},{key:"getRc4KeyLiteralNode",value:function(e){var t=g.Nodes.getLiteralNode(e);return t.obfuscatedNode=!0,t}}]),t}(m.AbstractObfuscatingReplacer);N.minimumLengthForStringArray=3,N.rc4KeyLength=4,N.rc4KeysCount=50,N=u=d.__decorate([l.injectable(),d.__param(0,l.inject(f.ServiceIdentifiers.TStringArrayStorage)),d.__param(1,l.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d.__param(2,l.inject(f.ServiceIdentifiers.IRandomGenerator)),d.__param(3,l.inject(f.ServiceIdentifiers.ICryptUtils)),d.__param(4,l.inject(f.ServiceIdentifiers.IOptions)),d.__metadata("design:paramtypes",[Object,Object,Object,Object,Object])],N),t.StringLiteralObfuscatingReplacer=N},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c,u=r(4),d=r(0),l=r(3),f=r(19),p=r(12),m=r(14),g=r(9),_=c=function(e){function t(e,r){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r))}return s(t,e),a(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case p.TransformationStage.Obfuscating:return{enter:function(e,r){if(r&&g.NodeGuards.isObjectExpressionNode(e))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){return e.properties.forEach(function(e){e.computed||(e.shorthand&&(e.shorthand=!1),g.NodeGuards.isIdentifierNode(e.key)&&(e.key=c.transformIdentifierPropertyKey(e.key)))}),e}}],[{key:"transformIdentifierPropertyKey",value:function(e){return{type:f.NodeType.Literal,value:e.name,raw:"'".concat(e.name,"'")}}}]),t}(m.AbstractNodeTransformer);_=c=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Object,Object])],_),t.ObjectExpressionTransformer=_},function(e,t,r){"use strict";var n=r(16),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=r(38),p=r(15),m=r(27),g=function(e){function t(e){var r;return a(this,t),(r=s(this,(t.__proto__||o(t)).call(this,e))).numberLiteralCache=new n,r}return c(t,e),i(t,[{key:"replace",value:function(e){var t;return this.numberLiteralCache.has(e)?t=this.numberLiteralCache.get(e):(t=m.Utils.isCeilNumber(e)?"".concat(m.Utils.hexadecimalPrefix).concat(m.Utils.decToHex(e)):String(e),this.numberLiteralCache.set(e,t)),p.Nodes.getLiteralNode(e,t)}}]),t}(f.AbstractObfuscatingReplacer);g=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Object])],g),t.NumberLiteralObfuscatingReplacer=g},function(e,t,r){"use strict";var n=r(66),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=r(57),p=r(12),m=r(14),g=r(9),_=function(e){function t(e,r,n){var i;return a(this,t),(i=s(this,(t.__proto__||o(t)).call(this,r,n))).literalObfuscatingReplacerFactory=e,i}return c(t,e),i(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case p.TransformationStage.Obfuscating:return{enter:function(e,r){if(r&&g.NodeGuards.isLiteralNode(e)&&!e.obfuscatedNode)return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){if(t&&g.NodeGuards.isPropertyNode(t)&&t.key===e)return e;switch(n(e.value)){case"boolean":return this.literalObfuscatingReplacerFactory(f.LiteralObfuscatingReplacer.BooleanLiteralObfuscatingReplacer).replace(e.value);case"number":return this.literalObfuscatingReplacerFactory(f.LiteralObfuscatingReplacer.NumberLiteralObfuscatingReplacer).replace(e.value);case"string":return this.literalObfuscatingReplacerFactory(f.LiteralObfuscatingReplacer.StringLiteralObfuscatingReplacer).replace(e.value);default:return e}}}]),t}(m.AbstractNodeTransformer);_=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IObfuscatingReplacer)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object])],_),t.LiteralTransformer=_},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=c.__importStar(r(17)),f=r(22),p=r(12),m=r(14),g=r(9),_=function(e){function t(e,r,a){var s;return o(this,t),(s=i(this,(t.__proto__||n(t)).call(this,r,a))).identifierObfuscatingReplacer=e(f.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),s}return s(t,e),a(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case p.TransformationStage.Obfuscating:return{enter:function(e,r){if(r&&g.NodeGuards.isLabeledStatementNode(e))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){var r=this.nodeIdentifier++;return this.storeLabeledStatementName(e,r),this.replaceLabeledStatementName(e,r),e}},{key:"storeLabeledStatementName",value:function(e,t){this.identifierObfuscatingReplacer.storeLocalName(e.label.name,t)}},{key:"replaceLabeledStatementName",value:function(e,t){var r=this;l.replace(e,{enter:function(e,n){if(n&&g.NodeGuards.isLabelIdentifierNode(e,n)){var o=r.identifierObfuscatingReplacer.replace(e.name,t);e.name=o.name}}})}}]),t}(m.AbstractNodeTransformer);_=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],_),t.LabeledStatementTransformer=_},function(e,t,r){"use strict";var n=r(30),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=u.__importStar(r(17)),p=r(22),m=r(12),g=r(14),_=r(9),N=function(e){function t(e,r,n){var i;return a(this,t),(i=s(this,(t.__proto__||o(t)).call(this,r,n))).identifierObfuscatingReplacer=e(p.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),i}return c(t,e),i(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case m.TransformationStage.Obfuscating:return{enter:function(e,r){if(r&&(_.NodeGuards.isFunctionDeclarationNode(e)||_.NodeGuards.isFunctionExpressionNode(e)||_.NodeGuards.isArrowFunctionExpressionNode(e)))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){var r=this.nodeIdentifier++;return this.storeFunctionParams(e,r),this.replaceFunctionParams(e,r),e}},{key:"storeFunctionParams",value:function(e,t){var r=this;e.params.forEach(function(e){if(_.NodeGuards.isObjectPatternNode(e))return f.VisitorOption.Skip;f.traverse(e,{enter:function(e){if(_.NodeGuards.isAssignmentPatternNode(e)&&_.NodeGuards.isIdentifierNode(e.left))return r.identifierObfuscatingReplacer.storeLocalName(e.left.name,t),f.VisitorOption.Skip;_.NodeGuards.isIdentifierNode(e)&&r.identifierObfuscatingReplacer.storeLocalName(e.name,t)}})})}},{key:"addIdentifiersToIgnoredIdentifierNamesSet",value:function(e,t){e.forEach(function(e){_.NodeGuards.isIdentifierNode(e.key)&&t.add(e.key.name)})}},{key:"replaceFunctionParams",value:function(e,t){var r=this,o=new n,a={enter:function(e,n){if(_.NodeGuards.isObjectPatternNode(e)&&r.addIdentifiersToIgnoredIdentifierNamesSet(e.properties,o),n&&_.NodeGuards.isReplaceableIdentifierNode(e,n)&&!o.has(e.name)){var a=r.identifierObfuscatingReplacer.replace(e.name,t).name;e.name!==a&&(e.name=a,e.obfuscatedNode=!0)}}};e.params.forEach(function(e){return f.replace(e,a)}),f.replace(e.body,a)}}]),t}(g.AbstractNodeTransformer);N=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object])],N),t.FunctionTransformer=N},function(e,t,r){"use strict";var n=r(16),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=u.__importStar(r(17)),p=r(22),m=r(19),g=r(12),_=r(14),N=r(9),v=r(8),y=function(e){function t(e,r,i){var c;return a(this,t),(c=s(this,(t.__proto__||o(t)).call(this,r,i))).replaceableIdentifiers=new n,c.identifierObfuscatingReplacer=e(p.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),c}return c(t,e),i(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case g.TransformationStage.Obfuscating:return{enter:function(e,r){if(r&&N.NodeGuards.isFunctionDeclarationNode(e))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){var r=this.nodeIdentifier++,n=v.NodeUtils.getBlockScopesOfNode(e)[0],o=n.type===m.NodeType.Program;return!this.options.renameGlobals&&o?e:(this.storeFunctionName(e,o,r),this.replaceableIdentifiers.has(n)?this.replaceScopeCachedIdentifiers(e,n,r):this.replaceScopeIdentifiers(n,r),e)}},{key:"storeFunctionName",value:function(e,t,r){t?this.identifierObfuscatingReplacer.storeGlobalName(e.id.name,r):this.identifierObfuscatingReplacer.storeLocalName(e.id.name,r)}},{key:"replaceScopeCachedIdentifiers",value:function(e,t,r){var n=this.replaceableIdentifiers.get(t);if(n){var o=n.get(e.id.name);if(o)for(var a=o.length,i=0;i=0);return"a".concat(n(r))},r=t(e);return c.validateMangledName(r)||(r=c.generateNewMangledName(r)),r}},{key:"validateMangledName",value:function(e){return!c.reservedNames.includes(e)}}]),t}(f.AbstractIdentifierNamesGenerator);p.initMangledNameCharacter="9",p.nameSequence="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),p.reservedNames=["byte","case","char","do","else","enum","eval","for","goto","if","in","int","let","long","new","null","this","true","try","var","void","with"],p=c=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Object,Object])],p),t.MangledIdentifierNamesGenerator=p},function(e,t,r){"use strict";var n=r(30),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u,d=r(4),l=r(0),f=r(3),p=r(58),m=r(27),g=u=function(e){function t(e,r){var i;return a(this,t),(i=s(this,(t.__proto__||o(t)).call(this,e,r))).randomVariableNameSet=new n,i}return c(t,e),i(t,[{key:"generate",value:function(){var e=this.randomGenerator.getRandomInteger(1e4,99999999),t=m.Utils.decToHex(e).substr(0,u.baseIdentifierNameLength),r="_".concat(m.Utils.hexadecimalPrefix).concat(t);return this.randomVariableNameSet.has(r)?this.generate():(this.randomVariableNameSet.add(r),r)}},{key:"generateWithPrefix",value:function(){var e=this.generate();return"".concat(this.options.identifiersPrefix).concat(e).replace("__","_")}}]),t}(p.AbstractIdentifierNamesGenerator);g.baseIdentifierNameLength=6,g=u=d.__decorate([l.injectable(),d.__param(0,l.inject(f.ServiceIdentifiers.IRandomGenerator)),d.__param(1,l.inject(f.ServiceIdentifiers.IOptions)),d.__metadata("design:paramtypes",[Object,Object])],g),t.HexadecimalIdentifierNamesGenerator=g},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),o=r(3),a=r(35),i=r(140),s=r(139);t.generatorsModule=new n.ContainerModule(function(e){e(o.ServiceIdentifiers.IIdentifierNamesGenerator).to(i.HexadecimalIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(a.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator),e(o.ServiceIdentifiers.IIdentifierNamesGenerator).to(s.MangledIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(a.IdentifierNamesGenerator.MangledIdentifierNamesGenerator),e(o.ServiceIdentifiers.Factory__IIdentifierNamesGenerator).toFactory(function(e){var t=null;return function(r){if(t)return t;var n;switch(r.identifierNamesGenerator){case a.IdentifierNamesGenerator.MangledIdentifierNamesGenerator:n=e.container.getNamed(o.ServiceIdentifiers.IIdentifierNamesGenerator,a.IdentifierNamesGenerator.MangledIdentifierNamesGenerator);break;case a.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator:default:n=e.container.getNamed(o.ServiceIdentifiers.IIdentifierNamesGenerator,a.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator)}return t=n,n}})})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);t.finalizingTransformersModule=new n.ContainerModule(function(e){})},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=r(10),f=r(13),p=r(15),m=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e){this.literalValue=e}},{key:"getNodeStructure",value:function(){return[p.Nodes.getExpressionStatementNode(p.Nodes.getLiteralNode(this.literalValue))]}}]),t}(f.AbstractCustomNode);c.__decorate([l.initializable(),c.__metadata("design:type",String)],m.prototype,"literalValue",void 0),m=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],m),t.StringLiteralNode=m},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=r(10),f=r(13),p=r(15),m=r(8),g=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e,t){this.controlFlowStorageName=e,this.controlFlowStorageKey=t}},{key:"getNodeStructure",value:function(){var e=p.Nodes.getExpressionStatementNode(p.Nodes.getMemberExpressionNode(p.Nodes.getIdentifierNode(this.controlFlowStorageName),p.Nodes.getIdentifierNode(this.controlFlowStorageKey)));return m.NodeUtils.parentize(e),[e]}}]),t}(f.AbstractCustomNode);c.__decorate([l.initializable(),c.__metadata("design:type",String)],g.prototype,"controlFlowStorageKey",void 0),c.__decorate([l.initializable(),c.__metadata("design:type",String)],g.prototype,"controlFlowStorageName",void 0),g=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],g),t.StringLiteralControlFlowStorageCallNode=g},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.False="![]",e.True="!![]",e.a='(false+"")[1]',e.b='([]["entries"]()+"")[2]',e.c='([]["fill"]+"")[3]',e.d='(undefined+"")[2]',e.e='(true+"")[3]',e.f='(false+"")[0]',e.g="(false+[0]+String)[20]",e.h='(+(101))["toString"](21)[1]',e.i="([false]+undefined)[10]",e.j='([]["entries"]()+"")[3]',e.k='(+(20))["toString"](21)',e.l='(false+"")[2]',e.m='(Number+"")[11]',e.n='(undefined+"")[1]',e.o='(true+[]["fill"])[10]',e.p='(+(211))["toString"](31)[1]',e.q='(+(212))["toString"](31)[1]',e.r='(true+"")[1]',e.s='(false+"")[3]',e.t='(true+"")[0]',e.u='(undefined+"")[0]',e.v='(+(31))["toString"](32)',e.w='(+(32))["toString"](33)',e.x='(+(101))["toString"](34)[1]',e.y="(NaN+[Infinity])[10]",e.z='(+(35))["toString"](36)',e.A="(+[]+Array)[10]",e.B="(+[]+Boolean)[10]",e.C='Function("return escape")()(("")["italics"]())[2]',e.D='Function("return escape")()([]["fill"])["slice"]("-1")',e.E='(RegExp+"")[12]',e.F="(+[]+Function)[10]",e.G='(false+Function("return Date")()())[30]',e.H="'H'",e.I='(Infinity+"")[0]',e.J="'J'",e.K="'K'",e.L="'L'",e.M='(true+Function("return Date")()())[30]',e.N='(NaN+"")[0]',e.O='(NaN+Function("return{}")())[11]',e.P="'P'",e.Q="'Q'",e.R="(+[]+RegExp)[10]",e.S="(+[]+String)[10]",e.T='(NaN+Function("return Date")()())[30]',e.U='(NaN+Function("return{}")()["toString"]["call"]())[11]',e.V="'V'",e.W="'W'",e.X="'X'",e.Y="'Y'",e.Z="'Z'"}(t.JSFuck||(t.JSFuck={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRotateFunctionTemplate=function(){return"\n (function (array, {timesName}) {\n var {whileFunctionName} = function (times) {\n while (--times) {\n array['push'](array['shift']());\n }\n };\n \n {code}\n })({stringArrayName}, 0x{stringArrayRotateValue});\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e){return"\n var selfDefendingFunc = function () {\n var object = {\n data: {\n key: 'cookie',\n value: 'timeout'\n },\n setCookie: function (options, name, value, document) {\n document = document || {};\n \n var updatedCookie = name + \"=\" + value;\n\n var i = 0;\n \n for (var i = 0, len = options.length; i < len; i++) {\n var propName = options[i];\n \n updatedCookie += \"; \" + propName;\n \n var propValue = options[propName];\n \n options.push(propValue);\n len = options.length;\n \n if (propValue !== true) {\n updatedCookie += \"=\" + propValue;\n }\n }\n\n document['cookie'] = updatedCookie;\n },\n removeCookie: function(){return 'dev';},\n getCookie: function (document, name) {\n document = document || function (value) { return value };\n var matches = document(new RegExp(\n \"(?:^|; )\" + name.replace(/([.$?*|{}()[]\\/+^])/g, '\\$1') + \"=([^;]*)\"\n ));\n \n var func = function (param1, param2) {\n param1(++param2);\n };\n \n func({whileFunctionName}, {timesName});\n \n return matches ? decodeURIComponent(matches[1]) : undefined;\n }\n };\n \n var test1 = function () {\n var regExp = new RegExp('".concat(e.encode("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}",!0),"');\n \n return regExp.test(object.removeCookie.toString());\n };\n \n object['updateCookie'] = test1;\n \n var cookie = '';\n var result = object['updateCookie']();\n \n if (!result) {\n object['setCookie'](['*'], 'counter', 1);\n } else if (result) {\n cookie = object['getCookie'](null, 'counter');\n } else {\n object['removeCookie']();\n }\n };\n \n selfDefendingFunc();\n ")}},function(e,t,r){"use strict";var n=r(11),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=u.__importDefault(r(18)),p=r(10),m=r(39),g=r(147),_=r(146),N=r(13),v=r(32),y=r(8),h=r(27),b=function(e){function t(e,r,n,i){var c;return a(this,t),(c=s(this,(t.__proto__||o(t)).call(this,e,r,i))).escapeSequenceEncoder=n,c}return c(t,e),i(t,[{key:"initialize",value:function(e,t){this.stringArrayName=e,this.stringArrayRotateValue=t}},{key:"getNodeStructure",value:function(){return y.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){var e=this.identifierNamesGenerator.generate(),t=this.identifierNamesGenerator.generate(),r="";return r=this.options.selfDefending?f.default(g.SelfDefendingTemplate(this.escapeSequenceEncoder),{timesName:e,whileFunctionName:t}):"".concat(t,"(++").concat(e,")"),v.JavaScriptObfuscator.obfuscate(f.default(_.StringArrayRotateFunctionTemplate(),{code:r,timesName:e,stringArrayName:this.stringArrayName,stringArrayRotateValue:h.Utils.decToHex(this.stringArrayRotateValue),whileFunctionName:t}),n({},m.NO_ADDITIONAL_NODES_PRESET,{identifierNamesGenerator:this.options.identifierNamesGenerator,seed:this.options.seed})).getObfuscatedCode()}}]),t}(N.AbstractCustomNode);u.__decorate([p.initializable(),u.__metadata("design:type",String)],b.prototype,"stringArrayName",void 0),u.__decorate([p.initializable(),u.__metadata("design:type",Number)],b.prototype,"stringArrayRotateValue",void 0),b=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IEscapeSequenceEncoder)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object,Object])],b),t.StringArrayRotateFunctionNode=b},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayTemplate=function(){return"\n var {stringArrayName} = [{stringArray}];\n "}},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(44),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=u.__importDefault(r(18)),p=r(10),m=r(149),g=r(13),_=r(8),N=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return c(t,e),a(t,[{key:"initialize",value:function(e,t,r){this.stringArrayStorage=e,this.stringArrayName=t,this.stringArrayRotateValue=r}},{key:"getNode",value:function(){return this.stringArrayStorage.rotateArray(this.stringArrayRotateValue),s(t.prototype.__proto__||n(t.prototype),"getNode",this).call(this)}},{key:"getNodeStructure",value:function(){return _.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){return f.default(m.StringArrayTemplate(),{stringArrayName:this.stringArrayName,stringArray:this.stringArrayStorage.toString()})}}]),t}(g.AbstractCustomNode);u.__decorate([p.initializable(),u.__metadata("design:type",Object)],N.prototype,"stringArrayStorage",void 0),u.__decorate([p.initializable(),u.__metadata("design:type",String)],N.prototype,"stringArrayName",void 0),u.__decorate([p.initializable(),u.__metadata("design:type",Number)],N.prototype,"stringArrayRotateValue",void 0),N=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object])],N),t.StringArrayNode=N},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRc4DecodeNodeTemplate=function(e){var t=e.getRandomString(6),r=e.getRandomString(6),n=e.getRandomString(6),o=e.getRandomString(6);return"\n if ({stringArrayCallsWrapperName}.".concat(t," === undefined) {\n {atobPolyfill}\n \n {rc4Polyfill}\n {stringArrayCallsWrapperName}.").concat(r," = rc4;\n \n {stringArrayCallsWrapperName}.").concat(n," = {};\n \n {stringArrayCallsWrapperName}.").concat(t," = true;\n }\n \n var cachedValue = {stringArrayCallsWrapperName}.").concat(n,"[index];\n\n if (cachedValue === undefined) {\n if ({stringArrayCallsWrapperName}.").concat(o," === undefined) {\n {selfDefendingCode}\n \n {stringArrayCallsWrapperName}.").concat(o," = true;\n }\n \n value = {stringArrayCallsWrapperName}.").concat(r,"(value, key);\n {stringArrayCallsWrapperName}.").concat(n,"[index] = value;\n } else {\n value = cachedValue;\n }\n ")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayCallsWrapperTemplate=function(){return"\n var {stringArrayCallsWrapperName} = function (index, key) {\n index = index - 0;\n \n var value = {stringArrayName}[index];\n \n {decodeNodeTemplate}\n \n return value;\n };\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayBase64DecodeNodeTemplate=function(e){var t=e.getRandomString(6),r=e.getRandomString(6),n=e.getRandomString(6);return"\n if ({stringArrayCallsWrapperName}.".concat(t," === undefined) {\n {atobPolyfill}\n \n {stringArrayCallsWrapperName}.").concat(r," = function (str) {\n var string = atob(str);\n var newStringChars = [];\n \n for (var i = 0, length = string.length; i < length; i++) {\n newStringChars += '%' + ('00' + string.charCodeAt(i).toString(16)).slice(-2);\n }\n \n return decodeURIComponent(newStringChars);\n };\n \n {stringArrayCallsWrapperName}.").concat(n," = {};\n \n {stringArrayCallsWrapperName}.").concat(t," = true;\n }\n \n var cachedValue = {stringArrayCallsWrapperName}.").concat(n,"[index];\n \n if (cachedValue === undefined) {\n {selfDefendingCode}\n \n value = {stringArrayCallsWrapperName}.").concat(r,"(value);\n {stringArrayCallsWrapperName}.").concat(n,"[index] = value;\n } else {\n value = cachedValue;\n }\n ")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e,t){var r=e.getRandomString(6),n=e.getRandomString(6),o=e.getRandomString(6),a=e.getRandomString(6),i=e.getRandomString(6),s=e.getRandomString(6),c=e.getRandomString(6),u=e.getRandomString(6),d=e.getRandomString(6);return"\n var StatesClass = function (".concat(r,") {\n this.").concat(r," = ").concat(r,";\n this.").concat(n," = [1, 0, 0];\n this.").concat(o," = function(){return 'newState';};\n this.").concat(a," = '").concat(t.encode("\\w+ *\\(\\) *{\\w+ *",!0),"';\n this.").concat(i," = '").concat(t.encode("['|\"].+['|\"];? *}",!0),"';\n };\n \n StatesClass.prototype.").concat(s," = function () {\n var regExp = new RegExp(this.").concat(a," + this.").concat(i,");\n var expression = regExp.test(this.").concat(o,".toString())\n ? --this.").concat(n,"[1]\n : --this.").concat(n,"[0];\n \n return this.").concat(c,"(expression);\n };\n \n StatesClass.prototype.").concat(c," = function (").concat(d,") {\n if (!Boolean(~").concat(d,")) {\n return ").concat(d,";\n }\n \n return this.").concat(u,"(this.").concat(r,");\n };\n\n StatesClass.prototype.").concat(u," = function (").concat(r,") {\n for (var i = 0, len = this.").concat(n,".length; i < len; i++) {\n this.").concat(n,".push(Math.round(Math.random()));\n len = this.").concat(n,".length;\n }\n \n return ").concat(r,"(this.").concat(n,"[0]);\n };\n\n new StatesClass({stringArrayCallsWrapperName}).").concat(s,"();\n ")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Rc4Template=function(){return"\n var rc4 = function (str, key) {\n var s = [], j = 0, x, res = '', newStr = '';\n \n str = atob(str);\n \n for (var k = 0, length = str.length; k < length; k++) {\n newStr += '%' + ('00' + str.charCodeAt(k).toString(16)).slice(-2);\n }\n \n str = decodeURIComponent(newStr);\n \t \n\t for (var i = 0; i < 256; i++) {\n s[i] = i;\n }\n \n for (i = 0; i < 256; i++) {\n j = (j + s[i] + key.charCodeAt(i % key.length)) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n }\n \n i = 0;\n j = 0;\n \n for (var y = 0; y < str.length; y++) {\n i = (i + 1) % 256;\n j = (j + s[i]) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n res += String.fromCharCode(str.charCodeAt(y) ^ s[(s[i] + s[j]) % 256]);\n }\n \n return res;\n }\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AtobTemplate=function(){return"\n (function () {\n {globalVariableTemplate}\n \n var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\n that.atob || (\n that.atob = function(input) {\n var str = String(input).replace(/=+$/, '');\n for (\n var bc = 0, bs, buffer, idx = 0, output = '';\n buffer = str.charAt(idx++);\n ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,\n bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0\n ) {\n buffer = chars.indexOf(buffer);\n }\n return output;\n });\n })();\n "}},function(e,t,r){"use strict";var n=r(11),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=u.__importDefault(r(18)),p=r(20),m=r(33),g=r(10),_=r(39),N=r(156),v=r(45),y=r(155),h=r(154),b=r(153),S=r(152),I=r(151),C=r(13),O=r(32),j=r(8),F=function(e){function t(e,r,n,i){var c;return a(this,t),(c=s(this,(t.__proto__||o(t)).call(this,e,r,i))).escapeSequenceEncoder=n,c}return c(t,e),i(t,[{key:"initialize",value:function(e,t){this.stringArrayName=e,this.stringArrayCallsWrapperName=t}},{key:"getNodeStructure",value:function(){return j.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){var e=this.getDecodeStringArrayTemplate();return O.JavaScriptObfuscator.obfuscate(f.default(S.StringArrayCallsWrapperTemplate(),{decodeNodeTemplate:e,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName,stringArrayName:this.stringArrayName}),n({},_.NO_ADDITIONAL_NODES_PRESET,{identifierNamesGenerator:this.options.identifierNamesGenerator,seed:this.options.seed})).getObfuscatedCode()}},{key:"getDecodeStringArrayTemplate",value:function(){var e=this.options.target!==p.ObfuscationTarget.Extension?this.getGlobalVariableTemplate():v.GlobalVariableNoEvalTemplate(),t=f.default(N.AtobTemplate(),{globalVariableTemplate:e}),r="",n="";switch(this.options.selfDefending&&(n=f.default(h.SelfDefendingTemplate(this.randomGenerator,this.escapeSequenceEncoder),{stringArrayCallsWrapperName:this.stringArrayCallsWrapperName,stringArrayName:this.stringArrayName})),this.options.stringArrayEncoding){case m.StringArrayEncoding.Rc4:r=f.default(I.StringArrayRc4DecodeNodeTemplate(this.randomGenerator),{atobPolyfill:t,rc4Polyfill:y.Rc4Template(),selfDefendingCode:n,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName});break;case m.StringArrayEncoding.Base64:r=f.default(b.StringArrayBase64DecodeNodeTemplate(this.randomGenerator),{atobPolyfill:t,selfDefendingCode:n,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName})}return r}}]),t}(C.AbstractCustomNode);u.__decorate([g.initializable(),u.__metadata("design:type",String)],F.prototype,"stringArrayName",void 0),u.__decorate([g.initializable(),u.__metadata("design:type",String)],F.prototype,"stringArrayCallsWrapperName",void 0),F=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IEscapeSequenceEncoder)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object,Object])],F),t.StringArrayCallsWrapper=F},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e){return"\n var {selfDefendingFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n var func1 = function(){return 'dev';},\n func2 = function () {\n return 'window';\n };\n \n var test1 = function () {\n var regExp = new RegExp('".concat(e.encode("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}",!0),"');\n \n return !regExp.test(func1.toString());\n };\n \n var test2 = function () {\n var regExp = new RegExp('").concat(e.encode("(\\\\[x|u](\\w){2,4})+",!0),"');\n \n return regExp.test(func2.toString());\n };\n \n var recursiveFunc1 = function (string) {\n var i = ~-1 >> 1 + 255 % 0;\n \n if (string.indexOf('i' === i)) {\n recursiveFunc2(string)\n }\n };\n \n var recursiveFunc2 = function (string) {\n var i = ~-4 >> 1 + 255 % 0;\n \n if (string.indexOf((true+\"\")[3]) !== i) {\n recursiveFunc1(string)\n }\n };\n \n if (!test1()) {\n if (!test2()) {\n recursiveFunc1('indеxOf');\n } else {\n recursiveFunc1('indexOf');\n }\n } else {\n recursiveFunc1('indеxOf');\n }\n })\n \n {selfDefendingFunctionName}();\n ")}},function(e,t,r){"use strict";var n=r(11),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=u.__importDefault(r(18)),p=r(10),m=r(39),g=r(158),_=r(13),N=r(32),v=r(8),y=function(e){function t(e,r,n,i){var c;return a(this,t),(c=s(this,(t.__proto__||o(t)).call(this,e,r,i))).escapeSequenceEncoder=n,c}return c(t,e),i(t,[{key:"initialize",value:function(e){this.callsControllerFunctionName=e}},{key:"getNodeStructure",value:function(){return v.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){return N.JavaScriptObfuscator.obfuscate(f.default(g.SelfDefendingTemplate(this.escapeSequenceEncoder),{selfDefendingFunctionName:this.identifierNamesGenerator.generate(),singleNodeCallControllerFunctionName:this.callsControllerFunctionName}),n({},m.NO_ADDITIONAL_NODES_PRESET,{identifierNamesGenerator:this.options.identifierNamesGenerator,seed:this.options.seed,unicodeEscapeSequence:!0})).getObfuscatedCode()}}]),t}(_.AbstractCustomNode);u.__decorate([p.initializable(),u.__metadata("design:type",String)],y.prototype,"callsControllerFunctionName",void 0),y=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IEscapeSequenceEncoder)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object,Object])],y),t.SelfDefendingUnicodeNode=y},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SingleNodeCallControllerTemplate=function(){return"\n var {singleNodeCallControllerFunctionName} = (function(){\n var firstCall = true;\n \n return function (context, fn){\n var rfn = firstCall ? function(){\n if(fn){\n var res = fn.apply(context, arguments);\n fn = null;\n return res;\n }\n } : function(){}\n \n firstCall = false;\n \n return rfn;\n }\n })();\n "}},function(e,t,r){"use strict";var n=r(11),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=u.__importDefault(r(18)),p=r(23),m=r(10),g=r(160),_=r(39),N=r(13),v=r(32),y=r(8),h=function(e){function t(e,r,n){return a(this,t),s(this,(t.__proto__||o(t)).call(this,e,r,n))}return c(t,e),i(t,[{key:"initialize",value:function(e,t){this.appendEvent=e,this.callsControllerFunctionName=t}},{key:"getNodeStructure",value:function(){return y.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){return this.appendEvent===p.ObfuscationEvent.AfterObfuscation?v.JavaScriptObfuscator.obfuscate(f.default(g.SingleNodeCallControllerTemplate(),{singleNodeCallControllerFunctionName:this.callsControllerFunctionName}),n({},_.NO_ADDITIONAL_NODES_PRESET,{identifierNamesGenerator:this.options.identifierNamesGenerator,seed:this.options.seed})).getObfuscatedCode():f.default(g.SingleNodeCallControllerTemplate(),{singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}}]),t}(N.AbstractCustomNode);u.__decorate([m.initializable(),u.__metadata("design:type",String)],h.prototype,"callsControllerFunctionName",void 0),u.__decorate([m.initializable(),u.__metadata("design:type",String)],h.prototype,"appendEvent",void 0),h=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object])],h),t.NodeCallsControllerFunctionNode=h},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=r(10),f=r(13),p=r(15),m=r(8),g=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e){this.operator=e}},{key:"getNodeStructure",value:function(){var e=p.Nodes.getExpressionStatementNode(p.Nodes.getFunctionExpressionNode([p.Nodes.getIdentifierNode("x"),p.Nodes.getIdentifierNode("y")],p.Nodes.getBlockStatementNode([p.Nodes.getReturnStatementNode(p.Nodes.getLogicalExpressionNode(this.operator,p.Nodes.getIdentifierNode("x"),p.Nodes.getIdentifierNode("y")))])));return m.NodeUtils.parentize(e),[e]}}]),t}(f.AbstractCustomNode);c.__decorate([l.initializable(),c.__metadata("design:type",String)],g.prototype,"operator",void 0),g=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],g),t.LogicalExpressionFunctionNode=g},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=r(10),f=r(13),p=r(15),m=r(8),g=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e,t,r,n){this.controlFlowStorageName=e,this.controlFlowStorageKey=t,this.leftValue=r,this.rightValue=n}},{key:"getNodeStructure",value:function(){var e=p.Nodes.getExpressionStatementNode(p.Nodes.getCallExpressionNode(p.Nodes.getMemberExpressionNode(p.Nodes.getIdentifierNode(this.controlFlowStorageName),p.Nodes.getIdentifierNode(this.controlFlowStorageKey)),[this.leftValue,this.rightValue]));return m.NodeUtils.parentize(e),[e]}}]),t}(f.AbstractCustomNode);c.__decorate([l.initializable(),c.__metadata("design:type",String)],g.prototype,"controlFlowStorageKey",void 0),c.__decorate([l.initializable(),c.__metadata("design:type",String)],g.prototype,"controlFlowStorageName",void 0),c.__decorate([l.initializable(),c.__metadata("design:type",Object)],g.prototype,"leftValue",void 0),c.__decorate([l.initializable(),c.__metadata("design:type",Object)],g.prototype,"rightValue",void 0),g=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],g),t.ExpressionWithOperatorControlFlowStorageCallNode=g},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DomainLockNodeTemplate=function(){return'\n var {domainLockFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n \n {globalVariableTemplate}\n \n var func = function () {\n return {\n key: \'item\',\n value: \'attribute\',\n getAttribute: function () {\n for (var i = 0; i < 1000; i--) {\n var isPositive = i > 0;\n \n switch (isPositive) {\n case true:\n return this.item + \'_\' + this.value + \'_\' + i;\n default:\n this.item + \'_\' + this.value;\n }\n }\n }()\n };\n };\n \n var regExp = new RegExp("[{diff}]", "g");\n var domains = "{domains}".replace(regExp, "").split(";");\n var document;\n var domain;\n \n for (var d in that) {\n if (d.length == 8 && d.charCodeAt(7) == 116 && d.charCodeAt(5) == 101 && d.charCodeAt(3) == 117 && d.charCodeAt(0) == 100) {\n document = d;\n \n break;\n }\n }\n\n for (var d1 in that[document]) {\n if (d1.length == 6 && d1.charCodeAt(5) == 110 && d1.charCodeAt(0) == 100) {\n domain = d1;\n \n break;\n }\n }\n \n if ((!document && !domain) || (!that[document] && !that[document][domain])) {\n return;\n }\n \n var currentDomain = that[document][domain];\n\n var ok = false;\n \n for (var i = 0; i < domains.length; i++) {\n var domain = domains[i];\n var position = currentDomain.length - domain.length;\n var lastIndex = currentDomain.indexOf(domain, position);\n var endsWith = lastIndex !== -1 && lastIndex === position;\n \n if (endsWith) {\n if (currentDomain.length == domain.length || domain.indexOf(".") === 0) {\n ok = true;\n }\n \n break;\n }\n }\n \n if (!ok) {\n data;\n } else {\n return;\n }\n \n func();\n });\n\n {domainLockFunctionName}();\n '}},function(e,t,r){"use strict";var n=r(29),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=u.__importDefault(r(18)),p=r(20),m=r(10),g=r(164),_=r(45),N=r(13),v=r(8),y=function(e){function t(e,r,n,i){var c;return a(this,t),(c=s(this,(t.__proto__||o(t)).call(this,e,r,i))).cryptUtils=n,c}return c(t,e),i(t,[{key:"initialize",value:function(e){this.callsControllerFunctionName=e}},{key:"getNodeStructure",value:function(){return v.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){var e=this.options.domainLock.join(";"),t=this.cryptUtils.hideString(e,3*e.length),r=n(t,2),o=r[0],a=r[1],i=this.options.target!==p.ObfuscationTarget.Extension?this.getGlobalVariableTemplate():_.GlobalVariableNoEvalTemplate();return f.default(g.DomainLockNodeTemplate(),{domainLockFunctionName:this.identifierNamesGenerator.generate(),diff:a,domains:o,globalVariableTemplate:i,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}}]),t}(N.AbstractCustomNode);u.__decorate([m.initializable(),u.__metadata("design:type",String)],y.prototype,"callsControllerFunctionName",void 0),y=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.ICryptUtils)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object,Object])],y),t.DomainLockNode=y},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionTemplate=function(){return"\n function {debugProtectionFunctionName} (ret) {\n function debuggerProtection (counter) {\n \n {debuggerTemplate}\n \n debuggerProtection(++counter);\n }\n \n try {\n if (ret) {\n return debuggerProtection;\n } else {\n debuggerProtection(0);\n }\n } catch (y) {}\n }\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerTemplateNoEval=function(){return"\n if (typeof counter === 'string') {\n var func = function () {\n while (true) {}\n };\n \n return func();\n } else {\n if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) {\n debugger;\n } else {\n debugger;\n }\n \n }\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerTemplate=function(){return"\n if (typeof counter === 'string') {\n return (function (arg) {}.constructor('while (true) {}').apply('counter'));\n } else {\n if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) {\n (function () {return true;}.constructor('debu' + 'gger').call('action'));\n } else {\n (function () {return false;}.constructor('debu' + 'gger').apply('stateObject'));\n }\n \n }\n "}},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=c.__importDefault(r(18)),f=r(20),p=r(10),m=r(168),g=r(167),_=r(166),N=r(13),v=r(8),y=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e){this.debugProtectionFunctionName=e}},{key:"getNodeStructure",value:function(){return v.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){var e=this.options.target!==f.ObfuscationTarget.Extension?m.DebuggerTemplate():g.DebuggerTemplateNoEval();return l.default(_.DebugProtectionFunctionTemplate(),{debuggerTemplate:e,debugProtectionFunctionName:this.debugProtectionFunctionName})}}]),t}(N.AbstractCustomNode);c.__decorate([p.initializable(),c.__metadata("design:type",String)],y.prototype,"debugProtectionFunctionName",void 0),y=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],y),t.DebugProtectionFunctionNode=y},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionIntervalTemplate=function(){return"\n setInterval(function () {\n {debugProtectionFunctionName}();\n }, 4000);\n "}},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=c.__importDefault(r(18)),f=r(10),p=r(170),m=r(13),g=r(8),_=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e){this.debugProtectionFunctionName=e}},{key:"getNodeStructure",value:function(){return g.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){return l.default(p.DebugProtectionFunctionIntervalTemplate(),{debugProtectionFunctionName:this.debugProtectionFunctionName})}}]),t}(m.AbstractCustomNode);c.__decorate([f.initializable(),c.__metadata("design:type",String)],_.prototype,"debugProtectionFunctionName",void 0),_=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],_),t.DebugProtectionFunctionIntervalNode=_},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionCallTemplate=function(){return"\n (function () {\n {singleNodeCallControllerFunctionName}(this, function () {\n var regExp1 = new RegExp('function *\\\\( *\\\\)');\n var regExp2 = new RegExp('\\\\+\\\\+ *\\(?:_0x(?:[a-f0-9]){4,6}|(?:\\\\b|\\\\d)[a-z0-9]{1,4}(?:\\\\b|\\\\d)\\)', 'i');\n \n var result = {debugProtectionFunctionName}('init');\n \n if (!regExp1.test(result + 'chain') || !regExp2.test(result + 'input')) {\n result('0');\n } else {\n {debugProtectionFunctionName}();\n }\n })();\n })();\n "}},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=c.__importDefault(r(18)),f=r(10),p=r(172),m=r(13),g=r(8),_=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e,t){this.debugProtectionFunctionName=e,this.callsControllerFunctionName=t}},{key:"getNodeStructure",value:function(){return g.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){return l.default(p.DebugProtectionFunctionCallTemplate(),{debugProtectionFunctionName:this.debugProtectionFunctionName,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}}]),t}(m.AbstractCustomNode);c.__decorate([f.initializable(),c.__metadata("design:type",String)],_.prototype,"callsControllerFunctionName",void 0),c.__decorate([f.initializable(),c.__metadata("design:type",String)],_.prototype,"debugProtectionFunctionName",void 0),_=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],_),t.DebugProtectionFunctionCallNode=_},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConsoleOutputDisableExpressionTemplate=function(){return"\n var {consoleLogDisableFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n var func = function () {};\n \n {globalVariableTemplate}\n \n if (!that.console) {\n that.console = (function (func){\n var c = {};\n \n c.log = func;\n c.warn = func;\n c.debug = func;\n c.info = func;\n c.error = func;\n c.exception = func;\n c.trace = func;\n \n return c;\n })(func);\n } else {\n that.console.log = func;\n that.console.warn = func;\n that.console.debug = func;\n that.console.info = func;\n that.console.error = func;\n that.console.exception = func;\n that.console.trace = func;\n }\n });\n \n {consoleLogDisableFunctionName}();\n "}},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=c.__importDefault(r(18)),f=r(20),p=r(174),m=r(45),g=r(10),_=r(13),N=r(8),v=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e){this.callsControllerFunctionName=e}},{key:"getNodeStructure",value:function(){return N.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){var e=this.options.target!==f.ObfuscationTarget.Extension?this.getGlobalVariableTemplate():m.GlobalVariableNoEvalTemplate();return l.default(p.ConsoleOutputDisableExpressionTemplate(),{consoleLogDisableFunctionName:this.identifierNamesGenerator.generate(),globalVariableTemplate:e,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}}]),t}(_.AbstractCustomNode);c.__decorate([g.initializable(),c.__metadata("design:type",String)],v.prototype,"callsControllerFunctionName",void 0),v=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],v),t.ConsoleOutputDisableExpressionNode=v},function(e,t,r){"use strict";var n=r(29),o=r(60),a=r(7),i=r(1),s=r(2),c=r(6),u=r(5);Object.defineProperty(t,"__esModule",{value:!0});var d=r(4),l=r(0),f=r(3),p=r(10),m=r(13),g=r(9),_=r(15),N=r(8),v=function(e){function t(e,r,n){return i(this,t),c(this,(t.__proto__||a(t)).call(this,e,r,n))}return u(t,e),s(t,[{key:"initialize",value:function(e){this.controlFlowStorage=e}},{key:"getNodeStructure",value:function(){var e=o(this.controlFlowStorage.getStorage()).map(function(e){var t=n(e,2),r=t[0],o=t[1].getNode()[0];if(!g.NodeGuards.isExpressionStatementNode(o))throw new Error("Function node for control flow storage object should be passed inside the `ExpressionStatement` node!");return _.Nodes.getPropertyNode(_.Nodes.getIdentifierNode(r),o.expression)}),t=_.Nodes.getVariableDeclarationNode([_.Nodes.getVariableDeclaratorNode(_.Nodes.getIdentifierNode(this.controlFlowStorage.getStorageId()),_.Nodes.getObjectExpressionNode(e))]);return[t=N.NodeUtils.parentize(t)]}}]),t}(m.AbstractCustomNode);d.__decorate([p.initializable(),d.__metadata("design:type",Object)],v.prototype,"controlFlowStorage",void 0),v=d.__decorate([l.injectable(),d.__param(0,l.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d.__param(1,l.inject(f.ServiceIdentifiers.IRandomGenerator)),d.__param(2,l.inject(f.ServiceIdentifiers.IOptions)),d.__metadata("design:paramtypes",[Function,Object,Object])],v),t.ControlFlowStorageNode=v},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=r(10),f=r(13),p=r(15),m=r(8),g=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e){this.expressionArguments=e}},{key:"getNodeStructure",value:function(){for(var e=p.Nodes.getIdentifierNode("callee"),t=[],r=this.expressionArguments.length,n=0;n.5,t=this.randomGenerator.getMathRandom()>.5,r=e?"===":"!==",o=this.randomGenerator.getRandomString(5),a=t?o:this.randomGenerator.getRandomString(5),i=e===t?[this.blockStatementNode,this.deadCodeInjectionRootAstHostNode]:[this.deadCodeInjectionRootAstHostNode,this.blockStatementNode],s=n(i,2),c=s[0],u=s[1],d=m.Nodes.getBlockStatementNode([m.Nodes.getIfStatementNode(m.Nodes.getBinaryExpressionNode(r,m.Nodes.getLiteralNode(o),m.Nodes.getLiteralNode(a)),c,u)]);return g.NodeUtils.parentize(d),[d]}}]),t}(p.AbstractCustomNode);u.__decorate([f.initializable(),u.__metadata("design:type",Object)],_.prototype,"blockStatementNode",void 0),u.__decorate([f.initializable(),u.__metadata("design:type",Object)],_.prototype,"deadCodeInjectionRootAstHostNode",void 0),_=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object])],_),t.BlockStatementDeadCodeInjectionNode=_},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=r(10),f=r(13),p=r(9),m=r(15),g=r(8),_=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e,t,r){this.blockStatementBody=e,this.shuffledKeys=t,this.originalKeysIndexesInShuffledArray=r}},{key:"getNodeStructure",value:function(){var e=this,t=this.randomGenerator.getRandomString(6),r=this.randomGenerator.getRandomString(6),n=m.Nodes.getBlockStatementNode([m.Nodes.getVariableDeclarationNode([m.Nodes.getVariableDeclaratorNode(m.Nodes.getIdentifierNode(t),m.Nodes.getCallExpressionNode(m.Nodes.getMemberExpressionNode(m.Nodes.getLiteralNode(this.originalKeysIndexesInShuffledArray.join("|")),m.Nodes.getIdentifierNode("split")),[m.Nodes.getLiteralNode("|")])),m.Nodes.getVariableDeclaratorNode(m.Nodes.getIdentifierNode(r),m.Nodes.getLiteralNode(0))]),m.Nodes.getWhileStatementNode(m.Nodes.getLiteralNode(!0),m.Nodes.getBlockStatementNode([m.Nodes.getSwitchStatementNode(m.Nodes.getMemberExpressionNode(m.Nodes.getIdentifierNode(t),m.Nodes.getUpdateExpressionNode("++",m.Nodes.getIdentifierNode(r)),!0),this.shuffledKeys.map(function(t,r){var n=e.blockStatementBody[t],o=[n];return p.NodeGuards.isReturnStatementNode(n)||o.push(m.Nodes.getContinueStatement()),m.Nodes.getSwitchCaseNode(m.Nodes.getLiteralNode(String(r)),o)})),m.Nodes.getBreakStatement()]))]);return g.NodeUtils.parentize(n),[n]}}]),t}(f.AbstractCustomNode);c.__decorate([l.initializable(),c.__metadata("design:type",Array)],_.prototype,"blockStatementBody",void 0),c.__decorate([l.initializable(),c.__metadata("design:type",Array)],_.prototype,"originalKeysIndexesInShuffledArray",void 0),c.__decorate([l.initializable(),c.__metadata("design:type",Array)],_.prototype,"shuffledKeys",void 0),_=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],_),t.BlockStatementControlFlowFlatteningNode=_},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableTemplate2=function(){return"\n var getGlobal = function () {\n var globalObject;\n \n try {\n globalObject = Function('return (function() ' + '{}.constructor(\"return this\")( )' + ');')();\n } catch (e) {\n globalObject = window;\n }\n \n return globalObject;\n };\n var that = getGlobal();\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableTemplate1=function(){return"\n var that;\n \n try {\n var getGlobal = Function('return (function() ' + '{}.constructor(\"return this\")( )' + ');');\n \n that = getGlobal();\n } catch (e) {\n that = window;\n }\n "}},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=r(10),f=r(13),p=r(15),m=r(8),g=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e){this.operator=e}},{key:"getNodeStructure",value:function(){var e=p.Nodes.getExpressionStatementNode(p.Nodes.getFunctionExpressionNode([p.Nodes.getIdentifierNode("x"),p.Nodes.getIdentifierNode("y")],p.Nodes.getBlockStatementNode([p.Nodes.getReturnStatementNode(p.Nodes.getBinaryExpressionNode(this.operator,p.Nodes.getIdentifierNode("x"),p.Nodes.getIdentifierNode("y")))])));return m.NodeUtils.parentize(e),[e]}}]),t}(f.AbstractCustomNode);c.__decorate([l.initializable(),c.__metadata("design:type",String)],g.prototype,"operator",void 0),g=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],g),t.BinaryExpressionFunctionNode=g},function(e,t,r){"use strict";var n=r(29),o=r(16),a=r(7),i=r(1),s=r(2),c=r(6),u=r(5);Object.defineProperty(t,"__esModule",{value:!0});var d=r(4),l=r(0),f=r(3),p=r(10),m=r(28),g=r(23),_=r(36),N=r(25),v=function(e){function t(e,r,n,o,s){var u;return i(this,t),(u=c(this,(t.__proto__||a(t)).call(this,n,o,s))).appendEvent=g.ObfuscationEvent.AfterObfuscation,u.customNodeFactory=e,u.stringArrayStorage=r,u}return u(t,e),s(t,[{key:"appendCustomNodes",value:function(e,t){this.stringArrayStorage.getLength()&&(this.appendCustomNodeIfExist(m.CustomNode.StringArrayNode,function(t){N.NodeAppender.prependNode(e,t.getNode())}),this.appendCustomNodeIfExist(m.CustomNode.StringArrayCallsWrapper,function(t){N.NodeAppender.insertNodeAtIndex(e,t.getNode(),1)}),this.appendCustomNodeIfExist(m.CustomNode.StringArrayRotateFunctionNode,function(t){N.NodeAppender.insertNodeAtIndex(e,t.getNode(),1)}))}},{key:"initialize",value:function(){if(this.customNodes=new o,this.options.stringArray){var e,t=this.customNodeFactory(m.CustomNode.StringArrayNode),r=this.customNodeFactory(m.CustomNode.StringArrayCallsWrapper),a=this.customNodeFactory(m.CustomNode.StringArrayRotateFunctionNode),i=this.stringArrayStorage.getStorageId().split("|"),s=n(i,2),c=s[0],u=s[1];e=this.options.rotateStringArray?this.randomGenerator.getRandomInteger(100,500):0,t.initialize(this.stringArrayStorage,c,e),r.initialize(c,u),a.initialize(c,e),this.customNodes.set(m.CustomNode.StringArrayNode,t),this.customNodes.set(m.CustomNode.StringArrayCallsWrapper,r),this.options.rotateStringArray&&this.customNodes.set(m.CustomNode.StringArrayRotateFunctionNode,a)}}}]),t}(_.AbstractCustomNodeGroup);d.__decorate([p.initializable(),d.__metadata("design:type",o)],v.prototype,"customNodes",void 0),v=d.__decorate([l.injectable(),d.__param(0,l.inject(f.ServiceIdentifiers.Factory__ICustomNode)),d.__param(1,l.inject(f.ServiceIdentifiers.TStringArrayStorage)),d.__param(2,l.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d.__param(3,l.inject(f.ServiceIdentifiers.IRandomGenerator)),d.__param(4,l.inject(f.ServiceIdentifiers.IOptions)),d.__metadata("design:paramtypes",[Function,Object,Function,Object,Object])],v),t.StringArrayCustomNodeGroup=v},function(e,t,r){"use strict";var n=r(16),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=r(10),p=r(28),m=r(23),g=r(36),_=r(25),N=function(e){function t(e,r,n,i){var c;return a(this,t),(c=s(this,(t.__proto__||o(t)).call(this,r,n,i))).appendEvent=m.ObfuscationEvent.AfterObfuscation,c.customNodeFactory=e,c}return c(t,e),i(t,[{key:"appendCustomNodes",value:function(e,t){var r=this.getRandomStackTraceIndex(t.length);this.appendCustomNodeIfExist(p.CustomNode.SelfDefendingUnicodeNode,function(n){_.NodeAppender.appendNodeToOptimalBlockScope(t,e,n.getNode(),r)}),this.appendCustomNodeIfExist(p.CustomNode.NodeCallsControllerFunctionNode,function(n){var o;o=t.length?_.NodeAppender.getOptimalBlockScope(t,r,1):e,_.NodeAppender.prependNode(o,n.getNode())})}},{key:"initialize",value:function(){if(this.customNodes=new n,this.options.selfDefending){var e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(p.CustomNode.SelfDefendingUnicodeNode),r=this.customNodeFactory(p.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),r.initialize(this.appendEvent,e),this.customNodes.set(p.CustomNode.SelfDefendingUnicodeNode,t),this.customNodes.set(p.CustomNode.NodeCallsControllerFunctionNode,r)}}}]),t}(g.AbstractCustomNodeGroup);u.__decorate([f.initializable(),u.__metadata("design:type",n)],N.prototype,"customNodes",void 0),N=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__ICustomNode)),u.__param(1,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Function,Object,Object])],N),t.SelfDefendingCustomNodeGroup=N},function(e,t,r){"use strict";var n=r(16),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=r(10),p=r(28),m=r(23),g=r(36),_=r(25),N=function(e){function t(e,r,n,i){var c;return a(this,t),(c=s(this,(t.__proto__||o(t)).call(this,r,n,i))).appendEvent=m.ObfuscationEvent.BeforeObfuscation,c.customNodeFactory=e,c}return c(t,e),i(t,[{key:"appendCustomNodes",value:function(e,t){var r=this.getRandomStackTraceIndex(t.length);this.appendCustomNodeIfExist(p.CustomNode.DomainLockNode,function(n){_.NodeAppender.appendNodeToOptimalBlockScope(t,e,n.getNode(),r)}),this.appendCustomNodeIfExist(p.CustomNode.NodeCallsControllerFunctionNode,function(n){var o;o=t.length?_.NodeAppender.getOptimalBlockScope(t,r,1):e,_.NodeAppender.prependNode(o,n.getNode())})}},{key:"initialize",value:function(){if(this.customNodes=new n,this.options.domainLock.length){var e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(p.CustomNode.DomainLockNode),r=this.customNodeFactory(p.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),r.initialize(this.appendEvent,e),this.customNodes.set(p.CustomNode.DomainLockNode,t),this.customNodes.set(p.CustomNode.NodeCallsControllerFunctionNode,r)}}}]),t}(g.AbstractCustomNodeGroup);u.__decorate([f.initializable(),u.__metadata("design:type",n)],N.prototype,"customNodes",void 0),N=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__ICustomNode)),u.__param(1,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Function,Object,Object])],N),t.DomainLockCustomNodeGroup=N},function(e,t,r){"use strict";var n=r(16),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=r(10),p=r(28),m=r(23),g=r(36),_=r(25),N=function(e){function t(e,r,n,i){var c;return a(this,t),(c=s(this,(t.__proto__||o(t)).call(this,r,n,i))).appendEvent=m.ObfuscationEvent.BeforeObfuscation,c.customNodeFactory=e,c}return c(t,e),i(t,[{key:"appendCustomNodes",value:function(e,t){var r=this,n=this.getRandomStackTraceIndex(t.length);this.appendCustomNodeIfExist(p.CustomNode.DebugProtectionFunctionCallNode,function(r){_.NodeAppender.appendNodeToOptimalBlockScope(t,e,r.getNode(),n)}),this.appendCustomNodeIfExist(p.CustomNode.DebugProtectionFunctionNode,function(t){_.NodeAppender.appendNode(e,t.getNode())}),this.appendCustomNodeIfExist(p.CustomNode.DebugProtectionFunctionIntervalNode,function(t){var n=e.body.length,o=r.randomGenerator.getRandomInteger(0,n);_.NodeAppender.insertNodeAtIndex(e,t.getNode(),o)}),this.appendCustomNodeIfExist(p.CustomNode.NodeCallsControllerFunctionNode,function(r){var o;o=t.length?_.NodeAppender.getOptimalBlockScope(t,n,1):e,_.NodeAppender.prependNode(o,r.getNode())})}},{key:"initialize",value:function(){if(this.customNodes=new n,this.options.debugProtection){var e=this.identifierNamesGenerator.generate(),t=this.identifierNamesGenerator.generate(),r=this.customNodeFactory(p.CustomNode.DebugProtectionFunctionNode),o=this.customNodeFactory(p.CustomNode.DebugProtectionFunctionCallNode),a=this.customNodeFactory(p.CustomNode.DebugProtectionFunctionIntervalNode),i=this.customNodeFactory(p.CustomNode.NodeCallsControllerFunctionNode);r.initialize(e),o.initialize(e,t),a.initialize(e),i.initialize(this.appendEvent,t),this.customNodes.set(p.CustomNode.DebugProtectionFunctionNode,r),this.customNodes.set(p.CustomNode.DebugProtectionFunctionCallNode,o),this.options.debugProtectionInterval&&this.customNodes.set(p.CustomNode.DebugProtectionFunctionIntervalNode,a),this.customNodes.set(p.CustomNode.NodeCallsControllerFunctionNode,i)}}}]),t}(g.AbstractCustomNodeGroup);u.__decorate([f.initializable(),u.__metadata("design:type",n)],N.prototype,"customNodes",void 0),N=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__ICustomNode)),u.__param(1,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Function,Object,Object])],N),t.DebugProtectionCustomNodeGroup=N},function(e,t,r){"use strict";var n=r(16),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=r(10),p=r(28),m=r(23),g=r(36),_=r(25),N=function(e){function t(e,r,n,i){var c;return a(this,t),(c=s(this,(t.__proto__||o(t)).call(this,r,n,i))).appendEvent=m.ObfuscationEvent.BeforeObfuscation,c.customNodeFactory=e,c}return c(t,e),i(t,[{key:"appendCustomNodes",value:function(e,t){var r=this.getRandomStackTraceIndex(t.length);this.appendCustomNodeIfExist(p.CustomNode.ConsoleOutputDisableExpressionNode,function(n){_.NodeAppender.appendNodeToOptimalBlockScope(t,e,n.getNode(),r)}),this.appendCustomNodeIfExist(p.CustomNode.NodeCallsControllerFunctionNode,function(n){var o;o=t.length?_.NodeAppender.getOptimalBlockScope(t,r,1):e,_.NodeAppender.prependNode(o,n.getNode())})}},{key:"initialize",value:function(){if(this.customNodes=new n,this.options.disableConsoleOutput){var e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(p.CustomNode.ConsoleOutputDisableExpressionNode),r=this.customNodeFactory(p.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),r.initialize(this.appendEvent,e),this.customNodes.set(p.CustomNode.ConsoleOutputDisableExpressionNode,t),this.customNodes.set(p.CustomNode.NodeCallsControllerFunctionNode,r)}}}]),t}(g.AbstractCustomNodeGroup);u.__decorate([f.initializable(),u.__metadata("design:type",n)],N.prototype,"customNodes",void 0),N=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__ICustomNode)),u.__param(1,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Function,Object,Object])],N),t.ConsoleOutputCustomNodeGroup=N},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(26),o=r(0),a=r(3),i=r(21),s=r(28),c=r(61),u=r(62),d=r(188),l=r(187),f=r(186),p=r(185),m=r(184),g=r(183),_=r(180),N=r(179),v=r(178),y=r(177),h=r(176),b=r(175),S=r(173),I=r(171),C=r(169),O=r(165),j=r(163),F=r(162),k=r(161),T=r(159),x=r(157),w=r(150),E=r(148),G=r(144),R=r(143);t.customNodesModule=new o.ContainerModule(function(e){e(a.ServiceIdentifiers.ICustomNode).to(b.ConsoleOutputDisableExpressionNode).whenTargetNamed(s.CustomNode.ConsoleOutputDisableExpressionNode),e(a.ServiceIdentifiers.ICustomNode).to(S.DebugProtectionFunctionCallNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionCallNode),e(a.ServiceIdentifiers.ICustomNode).to(I.DebugProtectionFunctionIntervalNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionIntervalNode),e(a.ServiceIdentifiers.ICustomNode).to(C.DebugProtectionFunctionNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionNode),e(a.ServiceIdentifiers.ICustomNode).to(O.DomainLockNode).whenTargetNamed(s.CustomNode.DomainLockNode),e(a.ServiceIdentifiers.ICustomNode).to(k.NodeCallsControllerFunctionNode).whenTargetNamed(s.CustomNode.NodeCallsControllerFunctionNode),e(a.ServiceIdentifiers.ICustomNode).to(T.SelfDefendingUnicodeNode).whenTargetNamed(s.CustomNode.SelfDefendingUnicodeNode),e(a.ServiceIdentifiers.ICustomNode).to(x.StringArrayCallsWrapper).whenTargetNamed(s.CustomNode.StringArrayCallsWrapper),e(a.ServiceIdentifiers.ICustomNode).to(w.StringArrayNode).whenTargetNamed(s.CustomNode.StringArrayNode),e(a.ServiceIdentifiers.ICustomNode).to(E.StringArrayRotateFunctionNode).whenTargetNamed(s.CustomNode.StringArrayRotateFunctionNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(g.BinaryExpressionFunctionNode).whenTargetNamed(i.ControlFlowCustomNode.BinaryExpressionFunctionNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(_.BlockStatementControlFlowFlatteningNode).whenTargetNamed(i.ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(v.CallExpressionControlFlowStorageCallNode).whenTargetNamed(i.ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(y.CallExpressionFunctionNode).whenTargetNamed(i.ControlFlowCustomNode.CallExpressionFunctionNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(h.ControlFlowStorageNode).whenTargetNamed(i.ControlFlowCustomNode.ControlFlowStorageNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(j.ExpressionWithOperatorControlFlowStorageCallNode).whenTargetNamed(i.ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(F.LogicalExpressionFunctionNode).whenTargetNamed(i.ControlFlowCustomNode.LogicalExpressionFunctionNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(R.StringLiteralNode).whenTargetNamed(i.ControlFlowCustomNode.StringLiteralNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(G.StringLiteralControlFlowStorageCallNode).whenTargetNamed(i.ControlFlowCustomNode.StringLiteralControlFlowStorageCallNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(N.BlockStatementDeadCodeInjectionNode).whenTargetNamed(u.DeadCodeInjectionCustomNode.BlockStatementDeadCodeInjectionNode),e(a.ServiceIdentifiers.ICustomNodeGroup).to(d.ConsoleOutputCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.ConsoleOutputCustomNodeGroup),e(a.ServiceIdentifiers.ICustomNodeGroup).to(l.DebugProtectionCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.DebugProtectionCustomNodeGroup),e(a.ServiceIdentifiers.ICustomNodeGroup).to(f.DomainLockCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.DomainLockCustomNodeGroup),e(a.ServiceIdentifiers.ICustomNodeGroup).to(p.SelfDefendingCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.SelfDefendingCustomNodeGroup),e(a.ServiceIdentifiers.ICustomNodeGroup).to(m.StringArrayCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.StringArrayCustomNodeGroup),e(a.ServiceIdentifiers.Factory__ICustomNode).toFactory(n.InversifyContainerFacade.getFactory(a.ServiceIdentifiers.ICustomNode)),e(a.ServiceIdentifiers.Factory__IControlFlowCustomNode).toFactory(n.InversifyContainerFacade.getConstructorFactory(a.ServiceIdentifiers.Newable__ICustomNode,a.ServiceIdentifiers.Factory__IIdentifierNamesGenerator,a.ServiceIdentifiers.IRandomGenerator,a.ServiceIdentifiers.IOptions)),e(a.ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode).toFactory(n.InversifyContainerFacade.getConstructorFactory(a.ServiceIdentifiers.Newable__ICustomNode,a.ServiceIdentifiers.Factory__IIdentifierNamesGenerator,a.ServiceIdentifiers.IRandomGenerator,a.ServiceIdentifiers.IOptions)),e(a.ServiceIdentifiers.Factory__ICustomNodeGroup).toFactory(n.InversifyContainerFacade.getFactory(a.ServiceIdentifiers.ICustomNodeGroup))})},function(e,t,r){"use strict";var n=r(24),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u,d=r(4),l=r(0),f=r(3),p=d.__importStar(r(17)),m=r(12),g=r(14),_=r(9),N=r(15),v=r(8),y=u=function(e){function t(e,r){return a(this,t),s(this,(t.__proto__||o(t)).call(this,e,r))}return c(t,e),i(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case m.TransformationStage.Converting:return{enter:function(e,r){if(r&&_.NodeGuards.isReturnStatementNode(e)&&null===e.argument)return t.fixEsprimaReturnStatementTemplateLiteralNode(e)},leave:function(e,r){if(r&&_.NodeGuards.isTemplateLiteralNode(e))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){var r=e.expressions,n=[];if(e.quasis.forEach(function(e){n.push(N.Nodes.getLiteralNode(e.value.cooked));var t=r.shift();t&&n.push(t)}),n=n.filter(function(e){return!(_.NodeGuards.isLiteralNode(e)&&""===e.value)}),u.isLiteralNodeWithStringValue(n[0])||u.isLiteralNodeWithStringValue(n[1])||n.unshift(N.Nodes.getLiteralNode("")),n.length>1){var o=N.Nodes.getBinaryExpressionNode("+",n.shift(),n.shift());return n.forEach(function(e){o=N.Nodes.getBinaryExpressionNode("+",o,e)}),o}return n[0]}},{key:"fixEsprimaReturnStatementTemplateLiteralNode",value:function(e){var t=v.NodeUtils.getScopeOfNode(e),r=_.NodeGuards.isSwitchCaseNode(t)?t.consequent:t.body,o=r.indexOf(e);if(o===r.length-2){var a=r[o+1];if(a&&_.NodeGuards.isExpressionStatementNode(a)){var i=!1;if(p.traverse(a,{enter:function(e,t){if(_.NodeGuards.isTemplateLiteralNode(e))return i=!0,p.VisitorOption.Break}}),i)return e.argument=a.expression,r.pop(),_.NodeGuards.isSwitchCaseNode(t)?t.consequent=n(r):t.body=n(r),e}}}}],[{key:"isLiteralNodeWithStringValue",value:function(e){return e&&_.NodeGuards.isLiteralNode(e)&&"string"==typeof e.value}}]),t}(g.AbstractNodeTransformer);y=u=d.__decorate([l.injectable(),d.__param(0,l.inject(f.ServiceIdentifiers.IRandomGenerator)),d.__param(1,l.inject(f.ServiceIdentifiers.IOptions)),d.__metadata("design:paramtypes",[Object,Object])],y),t.TemplateLiteralTransformer=y},function(e,t,r){"use strict";var n=r(29),o=r(16),a=r(7),i=r(1),s=r(2),c=r(6),u=r(5);Object.defineProperty(t,"__esModule",{value:!0});var d,l=r(4),f=r(0),p=r(3),m=r(12),g=r(14),_=r(25),N=r(9),v=r(15),y=r(8),h=d=function(e){function t(e,r){var n;return i(this,t),(n=c(this,(t.__proto__||a(t)).call(this,e,r))).cachedScopeNodesMap=new o,n}return u(t,e),s(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case m.TransformationStage.Converting:return{enter:function(e,r){if(t.options.transformObjectKeys&&r&&N.NodeGuards.isObjectExpressionNode(e)&&N.NodeGuards.isVariableDeclaratorNode(r))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){if(!N.NodeGuards.isIdentifierNode(t.id))return e;var r=y.NodeUtils.getScopeOfNode(t);return r&&N.NodeGuards.isNodeHasScope(r)?(this.cachedScopeNodesMap.set(t,r),this.transformObjectExpressionNode(e,t.id,t)):e}},{key:"extractPropertiesToExpressionStatements",value:function(e,t,r){for(var n=e.length,o=[],a=[],i=0;il.hostNodeSearchMinDepth&&t.splice(0,l.hostNodeSearchMinDepth),t.length>l.hostNodeSearchMaxDepth&&(t.length=l.hostNodeSearchMaxDepth),this.randomGenerator.getRandomGenerator().pickone(t))}},{key:"isVisitedFunctionNode",value:function(e){return(b.NodeGuards.isFunctionDeclarationNode(e)||b.NodeGuards.isFunctionExpressionNode(e)||b.NodeGuards.isArrowFunctionExpressionNode(e))&&this.visitedFunctionNodes.has(e)}},{key:"transformFunctionBody",value:function(e,t){var r=this;g.replace(e,{enter:function(e,o){if(e.ignoredNode)return g.VisitorOption.Skip;if(r.isVisitedFunctionNode(e)||!o)return g.VisitorOption.Skip;if(!l.controlFlowReplacersMap.has(e.type))return e;if(r.randomGenerator.getMathRandom()>r.options.controlFlowFlatteningThreshold)return e;var a=l.controlFlowReplacersMap.get(e.type);return void 0===a?e:n({},r.controlFlowReplacerFactory(a).replace(e,o,t),{parentNode:o})}})}}]),t}(h.AbstractNodeTransformer);C.controlFlowReplacersMap=new a([[v.NodeType.BinaryExpression,N.ControlFlowReplacer.BinaryExpressionControlFlowReplacer],[v.NodeType.CallExpression,N.ControlFlowReplacer.CallExpressionControlFlowReplacer],[v.NodeType.LogicalExpression,N.ControlFlowReplacer.LogicalExpressionControlFlowReplacer],[v.NodeType.Literal,N.ControlFlowReplacer.StringLiteralControlFlowReplacer]]),C.hostNodeSearchMinDepth=0,C.hostNodeSearchMaxDepth=2,C=l=f.__decorate([p.injectable(),f.__param(0,p.inject(m.ServiceIdentifiers.Factory__TControlFlowStorage)),f.__param(1,p.inject(m.ServiceIdentifiers.Factory__IControlFlowReplacer)),f.__param(2,p.inject(m.ServiceIdentifiers.Factory__IControlFlowCustomNode)),f.__param(3,p.inject(m.ServiceIdentifiers.IRandomGenerator)),f.__param(4,p.inject(m.ServiceIdentifiers.IOptions)),f.__metadata("design:paramtypes",[Function,Function,Function,Object,Object])],C),t.FunctionControlFlowTransformer=C},function(e,t,r){"use strict";var n=r(30),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u,d=r(4),l=r(0),f=r(3),p=d.__importStar(r(17)),m=r(62),g=r(31),_=r(19),N=r(12),v=r(14),y=r(9),h=r(15),b=r(8),S=u=function(e){function t(e,r,i,c){var u;return a(this,t),(u=s(this,(t.__proto__||o(t)).call(this,i,c))).deadCodeInjectionRootAstHostNodeSet=new n,u.collectedBlockStatements=[],u.collectedBlockStatementsTotalLength=0,u.deadCodeInjectionCustomNodeFactory=e,u.transformersRunner=r,u}return c(t,e),i(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case N.TransformationStage.DeadCodeInjection:return{enter:function(e,r){if(r&&y.NodeGuards.isProgramNode(e))return t.analyzeNode(e,r),e},leave:function(e,r){if(r&&y.NodeGuards.isBlockStatementNode(e))return t.transformNode(e,r)}};case N.TransformationStage.Finalizing:return this.deadCodeInjectionRootAstHostNodeSet.size?{enter:function(e,r){if(r&&t.isDeadCodeInjectionRootAstHostNode(e))return t.restoreNode(e,r)}}:null;default:return null}}},{key:"analyzeNode",value:function(e,t){var r=this;p.traverse(e,{enter:function(e){if(y.NodeGuards.isBlockStatementNode(e)){var t=b.NodeUtils.clone(e);u.isValidCollectedBlockStatementNode(t)&&(b.NodeUtils.parentizeNode(t,t),t=r.transformersRunner.transform(t,u.transformersToRenameBlockScopeIdentifiers,N.TransformationStage.Obfuscating),r.collectedBlockStatements.push(t))}}}),this.collectedBlockStatementsTotalLength=this.collectedBlockStatements.length}},{key:"transformNode",value:function(e,t){if(!this.collectedBlockStatements.length||this.collectedBlockStatementsTotalLengththis.options.deadCodeInjectionThreshold||!u.isValidWrappedBlockStatementNode(e))return e;var r=this.collectedBlockStatements.length-1,n=this.randomGenerator.getRandomInteger(0,r),o=this.collectedBlockStatements.splice(n,1)[0];return o===e?e:this.replaceBlockStatementNode(e,o,t)}},{key:"restoreNode",value:function(e,t){var r=e.body[0];if(!y.NodeGuards.isFunctionDeclarationNode(r))throw new Error("Wrong dead code injection root AST host node. Host node should contain `FunctionDeclaration` node");return r.body}},{key:"isDeadCodeInjectionRootAstHostNode",value:function(e){return y.NodeGuards.isBlockStatementNode(e)&&this.deadCodeInjectionRootAstHostNodeSet.has(e)}},{key:"replaceBlockStatementNode",value:function(e,t,r){var n=h.Nodes.getBlockStatementNode([h.Nodes.getFunctionDeclarationNode(u.deadCodeInjectionRootAstHostNodeName,[],t)]);this.deadCodeInjectionRootAstHostNodeSet.add(n);var o=this.deadCodeInjectionCustomNodeFactory(m.DeadCodeInjectionCustomNode.BlockStatementDeadCodeInjectionNode);o.initialize(e,n);var a=o.getNode()[0];return b.NodeUtils.parentizeNode(a,r),a}}],[{key:"isProhibitedNodeInsideCollectedBlockStatement",value:function(e){return y.NodeGuards.isBreakStatementNode(e)||y.NodeGuards.isContinueStatementNode(e)||y.NodeGuards.isAwaitExpressionNode(e)||y.NodeGuards.isSuperNode(e)}},{key:"isScopeHoistingFunctionDeclaration",value:function(e){if(!y.NodeGuards.isFunctionDeclarationNode(e))return!1;var t=b.NodeUtils.getScopeOfNode(e),r=y.NodeGuards.isSwitchCaseNode(t)?t.consequent:t.body,n=r.indexOf(e);if(0===n)return!1;var o=r.slice(0,n),a=h.Nodes.getBlockStatementNode(o),i=e.id.name,s=!1;return p.traverse(a,{enter:function(e){if(y.NodeGuards.isIdentifierNode(e)&&e.name===i)return s=!0,p.VisitorOption.Break}}),s}},{key:"isValidCollectedBlockStatementNode",value:function(e){if(!e.body.length)return!1;var t=0,r=!0;return p.traverse(e,{enter:function(e){if(y.NodeGuards.isBlockStatementNode(e)&&t++,t>u.maxNestedBlockStatementsCount||u.isProhibitedNodeInsideCollectedBlockStatement(e)||u.isScopeHoistingFunctionDeclaration(e))return r=!1,p.VisitorOption.Break}}),r}},{key:"isValidWrappedBlockStatementNode",value:function(e){if(!e.body.length)return!1;var t=!0;return p.traverse(e,{enter:function(e){if(u.isScopeHoistingFunctionDeclaration(e))return t=!1,p.VisitorOption.Break}}),!!t&&b.NodeUtils.getBlockScopesOfNode(e)[0].type!==_.NodeType.Program}}]),t}(v.AbstractNodeTransformer);S.deadCodeInjectionRootAstHostNodeName="deadCodeInjectionRootAstHostNode",S.maxNestedBlockStatementsCount=4,S.minCollectedBlockStatementsCount=5,S.transformersToRenameBlockScopeIdentifiers=[g.NodeTransformer.CatchClauseTransformer,g.NodeTransformer.ClassDeclarationTransformer,g.NodeTransformer.FunctionDeclarationTransformer,g.NodeTransformer.FunctionTransformer,g.NodeTransformer.LabeledStatementTransformer,g.NodeTransformer.VariableDeclarationTransformer],S=u=d.__decorate([l.injectable(),d.__param(0,l.inject(f.ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode)),d.__param(1,l.inject(f.ServiceIdentifiers.ITransformersRunner)),d.__param(2,l.inject(f.ServiceIdentifiers.IRandomGenerator)),d.__param(3,l.inject(f.ServiceIdentifiers.IOptions)),d.__metadata("design:paramtypes",[Function,Object,Object,Object])],S),t.DeadCodeInjectionTransformer=S},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c,u=r(4),d=r(0),l=r(3),f=r(21),p=r(46),m=r(9),g=c=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"replace",value:function(e,t,r){var n=e.callee;if(!m.NodeGuards.isIdentifierNode(n))return e;var o=String(e.arguments.length),a=this.controlFlowCustomNodeFactory(f.ControlFlowCustomNode.CallExpressionFunctionNode),i=e.arguments;a.initialize(i);var s=this.insertCustomNodeToControlFlowStorage(a,r,o,c.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(r.getStorageId(),s,n,i)}},{key:"getControlFlowStorageCallNode",value:function(e,t,r,n){var o=this.controlFlowCustomNodeFactory(f.ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode);o.initialize(e,t,r,n);var a=o.getNode()[0];if(!a||!m.NodeGuards.isExpressionStatementNode(a))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return a.expression}}]),t}(p.AbstractControlFlowReplacer);g.usingExistingIdentifierChance=.5,g=c=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IControlFlowCustomNode)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object])],g),t.CallExpressionControlFlowReplacer=g},function(e,t){e.exports=require("@babel/runtime/core-js/reflect/has-metadata")},function(e,t){e.exports=require("@babel/runtime/core-js/reflect/define-metadata")},function(e,t){e.exports=require("@babel/runtime/core-js/object/get-own-property-names")},function(e,t){e.exports=require("@babel/runtime/core-js/reflect/get-metadata")},function(e,t){e.exports=require("@babel/runtime/core-js/object/get-own-property-descriptor")},function(e,t){e.exports=require("@babel/runtime/core-js/object/define-property")},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c,u=r(4),d=r(0),l=r(3),f=u.__importStar(r(17)),p=r(21),m=r(12),g=r(14),_=r(9),N=r(8),v=c=function(e){function t(e,r,a,s){var c;return o(this,t),(c=i(this,(t.__proto__||n(t)).call(this,a,s))).controlFlowCustomNodeFactory=e,c.arrayUtils=r,c}return s(t,e),a(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case m.TransformationStage.ControlFlowFlattening:return{leave:function(e,r){if(r&&_.NodeGuards.isBlockStatementNode(e))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){if(this.randomGenerator.getMathRandom()>this.options.controlFlowFlatteningThreshold||!c.canTransformBlockStatementNode(e))return e;var r=e.body,n=this.arrayUtils.arrayRange(r.length),o=this.arrayUtils.arrayShuffle(n),a=n.map(function(e){return o.indexOf(e)}),i=this.controlFlowCustomNodeFactory(p.ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode);i.initialize(r,o,a);var s=i.getNode()[0];return N.NodeUtils.parentizeNode(s,t),s}}],[{key:"blockStatementHasProhibitedStatements",value:function(e){return e.body.some(function(e){var t=_.NodeGuards.isBreakStatementNode(e)||_.NodeGuards.isContinueStatementNode(e),r=_.NodeGuards.isVariableDeclarationNode(e)&&("const"===e.kind||"let"===e.kind),n=_.NodeGuards.isClassDeclarationNode(e);return _.NodeGuards.isFunctionDeclarationNode(e)||t||r||n})}},{key:"canTransformBlockStatementNode",value:function(e){var t=!0;return f.traverse(e,{enter:function(e){if(_.NodeGuards.isWhileStatementNode(e))return f.VisitorOption.Skip;_.NodeGuards.isBlockStatementNode(e)&&c.blockStatementHasProhibitedStatements(e)&&(t=!1)}}),e.body.length<=4&&(t=!1),t}}]),t}(g.AbstractNodeTransformer);v=c=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IControlFlowCustomNode)),u.__param(1,d.inject(l.ServiceIdentifiers.IArrayUtils)),u.__param(2,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object,Object])],v),t.BlockStatementControlFlowTransformer=v},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c,u=r(4),d=r(0),l=r(3),f=r(21),p=r(63),m=c=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"replace",value:function(e,t,r){var n=e.operator,o=this.controlFlowCustomNodeFactory(f.ControlFlowCustomNode.BinaryExpressionFunctionNode);o.initialize(n);var a=this.insertCustomNodeToControlFlowStorage(o,r,n,c.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(r.getStorageId(),a,e.left,e.right)}}]),t}(p.ExpressionWithOperatorControlFlowReplacer);m.usingExistingIdentifierChance=.5,m=c=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IControlFlowCustomNode)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object])],m),t.BinaryExpressionControlFlowReplacer=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(26),o=r(0),a=r(3),i=r(64),s=r(31),c=r(207),u=r(206),d=r(199),l=r(198),f=r(197),p=r(196),m=r(195);t.controlFlowTransformersModule=new o.ContainerModule(function(e){e(a.ServiceIdentifiers.INodeTransformer).to(u.BlockStatementControlFlowTransformer).whenTargetNamed(s.NodeTransformer.BlockStatementControlFlowTransformer),e(a.ServiceIdentifiers.INodeTransformer).to(l.DeadCodeInjectionTransformer).whenTargetNamed(s.NodeTransformer.DeadCodeInjectionTransformer),e(a.ServiceIdentifiers.INodeTransformer).to(f.FunctionControlFlowTransformer).whenTargetNamed(s.NodeTransformer.FunctionControlFlowTransformer),e(a.ServiceIdentifiers.IControlFlowReplacer).to(c.BinaryExpressionControlFlowReplacer).whenTargetNamed(i.ControlFlowReplacer.BinaryExpressionControlFlowReplacer),e(a.ServiceIdentifiers.IControlFlowReplacer).to(d.CallExpressionControlFlowReplacer).whenTargetNamed(i.ControlFlowReplacer.CallExpressionControlFlowReplacer),e(a.ServiceIdentifiers.IControlFlowReplacer).to(p.LogicalExpressionControlFlowReplacer).whenTargetNamed(i.ControlFlowReplacer.LogicalExpressionControlFlowReplacer),e(a.ServiceIdentifiers.IControlFlowReplacer).to(m.StringLiteralControlFlowReplacer).whenTargetNamed(i.ControlFlowReplacer.StringLiteralControlFlowReplacer),e(a.ServiceIdentifiers.Factory__IControlFlowReplacer).toFactory(n.InversifyContainerFacade.getCacheFactory(a.ServiceIdentifiers.IControlFlowReplacer))})},function(e,t,r){"use strict";var n=r(11),o=r(1),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i,s=r(4),c=r(0),u=r(3),d=s.__importStar(r(17)),l=r(67),f=r(9),p=r(8),m=i=function(){function e(t){o(this,e),this.calleeDataExtractorFactory=t}return a(e,[{key:"analyze",value:function(e){return this.analyzeRecursive(e.body)}},{key:"analyzeRecursive",value:function(e){for(var t=this,r=i.getLimitIndex(e.length),n=[],o=e.length,a=function(o){if(o>r)return"break";var a=e[o];d.traverse(a,{enter:function(r){if(f.NodeGuards.isCallExpressionNode(r))return a.parentNode!==p.NodeUtils.getBlockScopesOfNode(r)[0]?d.VisitorOption.Skip:void t.analyzeCallExpressionNode(n,e,r)}})},s=0;sr&&(n=Math.round(r+t*i.limitThreshold))>t&&(n=t),n}}]),e}();m.calleeDataExtractorsList=[l.CalleeDataExtractor.FunctionDeclarationCalleeDataExtractor,l.CalleeDataExtractor.FunctionExpressionCalleeDataExtractor,l.CalleeDataExtractor.ObjectExpressionCalleeDataExtractor],m.limitThresholdActivationLength=25,m.limitThreshold=.002,m=i=s.__decorate([c.injectable(),s.__param(0,c.inject(u.ServiceIdentifiers.Factory__ICalleeDataExtractor)),s.__metadata("design:paramtypes",[Function])],m),t.StackTraceAnalyzer=m},function(e,t,r){"use strict";var n=r(37),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=u.__importStar(r(17)),f=r(48),p=r(9),m=r(8),g=function(e){function t(){return a(this,t),s(this,(t.__proto__||o(t)).apply(this,arguments))}return c(t,e),i(t,[{key:"extract",value:function(e,t){if(!p.NodeGuards.isMemberExpressionNode(t))return null;var r=this.createObjectMembersCallsChain([],t);if(!r.length)return null;var n=r[r.length-1],o=this.getCalleeBlockStatement(m.NodeUtils.getBlockScopesOfNode(e[0])[0],r);return o?{callee:o,name:n}:null}},{key:"createObjectMembersCallsChain",value:function(e,t){if(p.NodeGuards.isIdentifierNode(t.property)&&!1===t.computed)e.unshift(t.property.name);else{if(!p.NodeGuards.isLiteralNode(t.property)||"string"!=typeof t.property.value&&"number"!=typeof t.property.value)return e;e.unshift(t.property.value)}return p.NodeGuards.isMemberExpressionNode(t.object)?this.createObjectMembersCallsChain(e,t.object):(p.NodeGuards.isIdentifierNode(t.object)&&e.unshift(t.object.name),e)}},{key:"getCalleeBlockStatement",value:function(e,t){var r=this,n=t.shift();if(!n)return null;var o=null;return l.traverse(e,{enter:function(e){if(p.NodeGuards.isVariableDeclaratorNode(e)&&p.NodeGuards.isIdentifierNode(e.id)&&e.init&&p.NodeGuards.isObjectExpressionNode(e.init)&&e.id.name===n)return o=r.findCalleeBlockStatement(e.init.properties,t),l.VisitorOption.Break}}),o}},{key:"findCalleeBlockStatement",value:function(e,t){var r=t.shift();if(!r)return null;var o=!0,a=!1,i=void 0;try{for(var s,c=n(e);!(o=(s=c.next()).done);o=!0){var u=s.value,d=p.NodeGuards.isIdentifierNode(u.key)&&u.key.name===r,l=p.NodeGuards.isLiteralNode(u.key)&&Boolean(u.key.value)&&u.key.value===r;if(d||l){if(p.NodeGuards.isObjectExpressionNode(u.value))return this.findCalleeBlockStatement(u.value.properties,t);if(p.NodeGuards.isFunctionExpressionNode(u.value))return u.value.body}}}catch(e){a=!0,i=e}finally{try{o||null==c.return||c.return()}finally{if(a)throw i}}return null}}]),t}(f.AbstractCalleeDataExtractor);g=u.__decorate([d.injectable()],g),t.ObjectExpressionCalleeDataExtractor=g},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=c.__importStar(r(17)),l=r(48),f=r(9),p=r(8),m=function(e){function t(){return o(this,t),i(this,(t.__proto__||n(t)).apply(this,arguments))}return s(t,e),a(t,[{key:"extract",value:function(e,t){var r=null;return f.NodeGuards.isIdentifierNode(t)&&(r=this.getCalleeBlockStatement(p.NodeUtils.getBlockScopesOfNode(e[0])[0],t.name)),f.NodeGuards.isFunctionExpressionNode(t)&&(r=t.body),r?{callee:r,name:t.name||null}:null}},{key:"getCalleeBlockStatement",value:function(e,t){var r=null;return d.traverse(e,{enter:function(e,n){if(f.NodeGuards.isFunctionExpressionNode(e)&&n&&f.NodeGuards.isVariableDeclaratorNode(n)&&f.NodeGuards.isIdentifierNode(n.id)&&n.id.name===t)return r=e.body,d.VisitorOption.Break}}),r}}]),t}(l.AbstractCalleeDataExtractor);m=c.__decorate([u.injectable()],m),t.FunctionExpressionCalleeDataExtractor=m},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=c.__importStar(r(17)),l=r(48),f=r(9),p=r(8),m=function(e){function t(){return o(this,t),i(this,(t.__proto__||n(t)).apply(this,arguments))}return s(t,e),a(t,[{key:"extract",value:function(e,t){if(!f.NodeGuards.isIdentifierNode(t))return null;var r=this.getCalleeBlockStatement(p.NodeUtils.getBlockScopesOfNode(e[0])[0],t.name);return r?{callee:r,name:t.name}:null}},{key:"getCalleeBlockStatement",value:function(e,t){var r=null;return d.traverse(e,{enter:function(e){if(f.NodeGuards.isFunctionDeclarationNode(e)&&e.id.name===t)return r=e.body,d.VisitorOption.Break}}),r}}]),t}(l.AbstractCalleeDataExtractor);m=c.__decorate([u.injectable()],m),t.FunctionDeclarationCalleeDataExtractor=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(26),o=r(0),a=r(3),i=r(67),s=r(212),c=r(211),u=r(210),d=r(209);t.analyzersModule=new o.ContainerModule(function(e){e(a.ServiceIdentifiers.IStackTraceAnalyzer).to(d.StackTraceAnalyzer).inSingletonScope(),e(a.ServiceIdentifiers.ICalleeDataExtractor).to(s.FunctionDeclarationCalleeDataExtractor).whenTargetNamed(i.CalleeDataExtractor.FunctionDeclarationCalleeDataExtractor),e(a.ServiceIdentifiers.ICalleeDataExtractor).to(c.FunctionExpressionCalleeDataExtractor).whenTargetNamed(i.CalleeDataExtractor.FunctionExpressionCalleeDataExtractor),e(a.ServiceIdentifiers.ICalleeDataExtractor).to(u.ObjectExpressionCalleeDataExtractor).whenTargetNamed(i.CalleeDataExtractor.ObjectExpressionCalleeDataExtractor),e(a.ServiceIdentifiers.Factory__ICalleeDataExtractor).toFactory(n.InversifyContainerFacade.getCacheFactory(a.ServiceIdentifiers.ICalleeDataExtractor))})},function(e,t){e.exports=require("reflect-metadata")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(32);e.exports=n.JavaScriptObfuscator}]); +/*! +Copyright (C) 2016-2018 Timofey Kachalov + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +require("source-map-support").install(); + + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 68); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports) { + +module.exports = require("@babel/runtime/helpers/classCallCheck"); + +/***/ }), +/* 1 */ +/***/ (function(module, exports) { + +module.exports = require("inversify"); + +/***/ }), +/* 2 */ +/***/ (function(module, exports) { + +module.exports = require("@babel/runtime/helpers/createClass"); + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var ServiceIdentifiers; + +(function (ServiceIdentifiers) { + ServiceIdentifiers["Factory__ICalleeDataExtractor"] = "Factory"; + ServiceIdentifiers["Factory__IControlFlowCustomNode"] = "Factory"; + ServiceIdentifiers["Factory__IControlFlowReplacer"] = "Factory"; + ServiceIdentifiers["Factory__ICustomNode"] = "Factory"; + ServiceIdentifiers["Factory__ICustomNodeGroup"] = "Factory"; + ServiceIdentifiers["Factory__IDeadCodeInjectionCustomNode"] = "Factory"; + ServiceIdentifiers["Factory__IIdentifierNamesGenerator"] = "Factory"; + ServiceIdentifiers["Factory__IIdentifierObfuscatingReplacer"] = "Factory"; + ServiceIdentifiers["Factory__INodeGuard"] = "Factory"; + ServiceIdentifiers["Factory__INodeTransformer"] = "Factory"; + ServiceIdentifiers["Factory__IObfuscationResult"] = "Factory"; + ServiceIdentifiers["Factory__IObfuscatingReplacer"] = "Factory"; + ServiceIdentifiers["Factory__TControlFlowStorage"] = "Factory"; + ServiceIdentifiers["IArrayUtils"] = "IArrayUtils"; + ServiceIdentifiers["ICalleeDataExtractor"] = "ICalleeDataExtractor"; + ServiceIdentifiers["ICryptUtils"] = "ICryptUtils"; + ServiceIdentifiers["ICustomNode"] = "ICustomNode"; + ServiceIdentifiers["ICustomNodeGroup"] = "ICustomNodeGroup"; + ServiceIdentifiers["IControlFlowReplacer"] = "IControlFlowReplacer"; + ServiceIdentifiers["IEscapeSequenceEncoder"] = "IEscapeSequenceEncoder"; + ServiceIdentifiers["IIdentifierNamesGenerator"] = "IIdentifierNamesGenerator"; + ServiceIdentifiers["IIdentifierObfuscatingReplacer"] = "IIdentifierObfuscatingReplacer"; + ServiceIdentifiers["IJavaScriptObfuscator"] = "IJavaScriptObfuscator"; + ServiceIdentifiers["ILogger"] = "ILogger"; + ServiceIdentifiers["INodeGuard"] = "INodeGuard"; + ServiceIdentifiers["INodeTransformer"] = "INodeTransformer"; + ServiceIdentifiers["IObfuscationEventEmitter"] = "IObfuscationEventEmitter"; + ServiceIdentifiers["IObfuscationResult"] = "IObfuscationResult"; + ServiceIdentifiers["IOptions"] = "IOptions"; + ServiceIdentifiers["IOptionsNormalizer"] = "IOptionsNormalizer"; + ServiceIdentifiers["IObfuscatingReplacer"] = "IObfuscatingReplacer"; + ServiceIdentifiers["IRandomGenerator"] = "IRandomGenerator"; + ServiceIdentifiers["ISourceCode"] = "ISourceCode"; + ServiceIdentifiers["ISourceMapCorrector"] = "ISourceMapCorrector"; + ServiceIdentifiers["IStackTraceAnalyzer"] = "IStackTraceAnalyzer"; + ServiceIdentifiers["ITransformersRunner"] = "ITransformersRunner"; + ServiceIdentifiers["Newable__ICustomNode"] = "Newable"; + ServiceIdentifiers["Newable__TControlFlowStorage"] = "Newable"; + ServiceIdentifiers["TCustomNodeGroupStorage"] = "TCustomNodeGroupStorage"; + ServiceIdentifiers["TInputOptions"] = "TInputOptions"; + ServiceIdentifiers["TStringArrayStorage"] = "TStringArrayStorage"; +})(ServiceIdentifiers = exports.ServiceIdentifiers || (exports.ServiceIdentifiers = {})); + +/***/ }), +/* 4 */ +/***/ (function(module, exports) { + +module.exports = require("tslib"); + +/***/ }), +/* 5 */ +/***/ (function(module, exports) { + +module.exports = require("@babel/runtime/core-js/object/get-prototype-of"); + +/***/ }), +/* 6 */ +/***/ (function(module, exports) { + +module.exports = require("@babel/runtime/helpers/possibleConstructorReturn"); + +/***/ }), +/* 7 */ +/***/ (function(module, exports) { + +module.exports = require("@babel/runtime/helpers/inherits"); + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var NodeType_1 = __webpack_require__(18); + +var NodeGuards = +/*#__PURE__*/ +function () { + function NodeGuards() { + _classCallCheck(this, NodeGuards); + } + + _createClass(NodeGuards, null, [{ + key: "isArrayPatternNode", + value: function isArrayPatternNode(node) { + return node.type === NodeType_1.NodeType.ArrayPattern; + } + }, { + key: "isArrowFunctionExpressionNode", + value: function isArrowFunctionExpressionNode(node) { + return node.type === NodeType_1.NodeType.ArrowFunctionExpression; + } + }, { + key: "isAssignmentPatternNode", + value: function isAssignmentPatternNode(node) { + return node.type === NodeType_1.NodeType.AssignmentPattern; + } + }, { + key: "isAwaitExpressionNode", + value: function isAwaitExpressionNode(node) { + return node.type === NodeType_1.NodeType.AwaitExpression; + } + }, { + key: "isBlockStatementNode", + value: function isBlockStatementNode(node) { + return node.type === NodeType_1.NodeType.BlockStatement; + } + }, { + key: "isBreakStatementNode", + value: function isBreakStatementNode(node) { + return node.type === NodeType_1.NodeType.BreakStatement; + } + }, { + key: "isCallExpressionNode", + value: function isCallExpressionNode(node) { + return node.type === NodeType_1.NodeType.CallExpression; + } + }, { + key: "isCatchClauseNode", + value: function isCatchClauseNode(node) { + return node.type === NodeType_1.NodeType.CatchClause; + } + }, { + key: "isClassDeclarationNode", + value: function isClassDeclarationNode(node) { + return node.type === NodeType_1.NodeType.ClassDeclaration; + } + }, { + key: "isContinueStatementNode", + value: function isContinueStatementNode(node) { + return node.type === NodeType_1.NodeType.ContinueStatement; + } + }, { + key: "isExpressionStatementNode", + value: function isExpressionStatementNode(node) { + return node.type === NodeType_1.NodeType.ExpressionStatement; + } + }, { + key: "isFunctionDeclarationNode", + value: function isFunctionDeclarationNode(node) { + return node.type === NodeType_1.NodeType.FunctionDeclaration; + } + }, { + key: "isFunctionExpressionNode", + value: function isFunctionExpressionNode(node) { + return node.type === NodeType_1.NodeType.FunctionExpression; + } + }, { + key: "isIdentifierNode", + value: function isIdentifierNode(node) { + return node.type === NodeType_1.NodeType.Identifier; + } + }, { + key: "isIfStatementNode", + value: function isIfStatementNode(node) { + return node.type === NodeType_1.NodeType.IfStatement; + } + }, { + key: "isLabelIdentifierNode", + value: function isLabelIdentifierNode(node, parentNode) { + var parentNodeIsLabeledStatementNode = NodeGuards.isLabeledStatementNode(parentNode) && parentNode.label === node; + var parentNodeIsContinueStatementNode = NodeGuards.isContinueStatementNode(parentNode) && parentNode.label === node; + var parentNodeIsBreakStatementNode = NodeGuards.isBreakStatementNode(parentNode) && parentNode.label === node; + return parentNodeIsLabeledStatementNode || parentNodeIsContinueStatementNode || parentNodeIsBreakStatementNode; + } + }, { + key: "isLabeledStatementNode", + value: function isLabeledStatementNode(node) { + return node.type === NodeType_1.NodeType.LabeledStatement; + } + }, { + key: "isLiteralNode", + value: function isLiteralNode(node) { + return node.type === NodeType_1.NodeType.Literal; + } + }, { + key: "isMemberExpressionNode", + value: function isMemberExpressionNode(node) { + return node.type === NodeType_1.NodeType.MemberExpression; + } + }, { + key: "isMethodDefinitionNode", + value: function isMethodDefinitionNode(node) { + return node.type === NodeType_1.NodeType.MethodDefinition; + } + }, { + key: "isNode", + value: function isNode(object) { + return object && !object.type !== undefined; + } + }, { + key: "isNodeHasBlockScope", + value: function isNodeHasBlockScope(node, parentNode) { + return NodeGuards.isProgramNode(node) || NodeGuards.isBlockStatementNode(node) && NodeGuards.nodesWithBlockScope.includes(parentNode.type); + } + }, { + key: "isNodeHasScope", + value: function isNodeHasScope(node) { + return NodeGuards.isProgramNode(node) || NodeGuards.isBlockStatementNode(node) || NodeGuards.isSwitchCaseNode(node); + } + }, { + key: "isNodeWithComments", + value: function isNodeWithComments(node) { + return Boolean(node.leadingComments) || Boolean(node.trailingComments); + } + }, { + key: "isObjectPatternNode", + value: function isObjectPatternNode(node) { + return node.type === NodeType_1.NodeType.ObjectPattern; + } + }, { + key: "isObjectExpressionNode", + value: function isObjectExpressionNode(node) { + return node.type === NodeType_1.NodeType.ObjectExpression; + } + }, { + key: "isProgramNode", + value: function isProgramNode(node) { + return node.type === NodeType_1.NodeType.Program; + } + }, { + key: "isPropertyNode", + value: function isPropertyNode(node) { + return node.type === NodeType_1.NodeType.Property; + } + }, { + key: "isReplaceableIdentifierNode", + value: function isReplaceableIdentifierNode(node, parentNode) { + if (!NodeGuards.isIdentifierNode(node)) { + return false; + } + + var parentNodeIsPropertyNode = NodeGuards.isPropertyNode(parentNode) && !parentNode.computed && parentNode.key === node; + var parentNodeIsMemberExpressionNode = NodeGuards.isMemberExpressionNode(parentNode) && !parentNode.computed && parentNode.property === node; + var parentNodeIsMethodDefinitionNode = NodeGuards.isMethodDefinitionNode(parentNode) && !parentNode.computed; + var isLabelIdentifierNode = NodeGuards.isLabelIdentifierNode(node, parentNode); + return !parentNodeIsPropertyNode && !parentNodeIsMemberExpressionNode && !parentNodeIsMethodDefinitionNode && !isLabelIdentifierNode; + } + }, { + key: "isRestElementNode", + value: function isRestElementNode(node) { + return node.type === NodeType_1.NodeType.RestElement; + } + }, { + key: "isReturnStatementNode", + value: function isReturnStatementNode(node) { + return node.type === NodeType_1.NodeType.ReturnStatement; + } + }, { + key: "isSuperNode", + value: function isSuperNode(node) { + return node.type === NodeType_1.NodeType.Super; + } + }, { + key: "isSwitchCaseNode", + value: function isSwitchCaseNode(node) { + return node.type === NodeType_1.NodeType.SwitchCase; + } + }, { + key: "isTemplateLiteralNode", + value: function isTemplateLiteralNode(node) { + return node.type === NodeType_1.NodeType.TemplateLiteral; + } + }, { + key: "isUnaryExpressionNode", + value: function isUnaryExpressionNode(node) { + return node.type === NodeType_1.NodeType.UnaryExpression; + } + }, { + key: "isUseStrictOperator", + value: function isUseStrictOperator(node) { + return node.type === NodeType_1.NodeType.ExpressionStatement && node.directive === 'use strict'; + } + }, { + key: "isVariableDeclarationNode", + value: function isVariableDeclarationNode(node) { + return node.type === NodeType_1.NodeType.VariableDeclaration; + } + }, { + key: "isVariableDeclaratorNode", + value: function isVariableDeclaratorNode(node) { + return node.type === NodeType_1.NodeType.VariableDeclarator; + } + }, { + key: "isWhileStatementNode", + value: function isWhileStatementNode(node) { + return node.type === NodeType_1.NodeType.WhileStatement; + } + }]); + + return NodeGuards; +}(); + +NodeGuards.nodesWithBlockScope = [NodeType_1.NodeType.ArrowFunctionExpression, NodeType_1.NodeType.FunctionDeclaration, NodeType_1.NodeType.FunctionExpression, NodeType_1.NodeType.MethodDefinition]; +exports.NodeGuards = NodeGuards; + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _typeof = __webpack_require__(50); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var escodegen = __importStar(__webpack_require__(42)); + +var esprima = __importStar(__webpack_require__(51)); + +var estraverse = __importStar(__webpack_require__(17)); + +var NodeGuards_1 = __webpack_require__(8); + +var NodeUtils = +/*#__PURE__*/ +function () { + function NodeUtils() { + _classCallCheck(this, NodeUtils); + } + + _createClass(NodeUtils, null, [{ + key: "addXVerbatimPropertyToLiterals", + value: function addXVerbatimPropertyToLiterals(astTree) { + estraverse.replace(astTree, { + leave: function leave(node) { + if (NodeGuards_1.NodeGuards.isLiteralNode(node)) { + node['x-verbatim-property'] = { + content: node.raw, + precedence: escodegen.Precedence.Primary + }; + } + } + }); + return astTree; + } + }, { + key: "clone", + value: function clone(astTree) { + return NodeUtils.parentize(NodeUtils.cloneRecursive(astTree)); + } + }, { + key: "convertCodeToStructure", + value: function convertCodeToStructure(code) { + var structure = esprima.parseScript(code); + structure = NodeUtils.addXVerbatimPropertyToLiterals(structure); + structure = NodeUtils.parentize(structure); + return structure.body; + } + }, { + key: "convertStructureToCode", + value: function convertStructureToCode(structure) { + return structure.reduce(function (code, node) { + return code + escodegen.generate(node, { + sourceMapWithCode: true + }).code; + }, ''); + } + }, { + key: "getBlockScopesOfNode", + value: function getBlockScopesOfNode(targetNode) { + return NodeUtils.getBlockScopesOfNodeRecursive(targetNode); + } + }, { + key: "getNextSiblingStatementNode", + value: function getNextSiblingStatementNode(node) { + return NodeUtils.getSiblingStatementNodeByOffset(node, 1); + } + }, { + key: "getPreviousSiblingStatementNode", + value: function getPreviousSiblingStatementNode(node) { + return NodeUtils.getSiblingStatementNodeByOffset(node, -1); + } + }, { + key: "getScopeOfNode", + value: function getScopeOfNode(node) { + var parentNode = node.parentNode; + + if (!parentNode) { + throw new ReferenceError('`parentNode` property of given node is `undefined`'); + } + + if (!NodeGuards_1.NodeGuards.isNodeHasScope(parentNode)) { + return NodeUtils.getScopeOfNode(parentNode); + } + + return parentNode; + } + }, { + key: "getUnaryExpressionArgumentNode", + value: function getUnaryExpressionArgumentNode(unaryExpressionNode) { + if (NodeGuards_1.NodeGuards.isUnaryExpressionNode(unaryExpressionNode.argument)) { + return NodeUtils.getUnaryExpressionArgumentNode(unaryExpressionNode.argument); + } + + return unaryExpressionNode.argument; + } + }, { + key: "parentize", + value: function parentize(astTree) { + estraverse.replace(astTree, { + enter: NodeUtils.parentizeNode + }); + return astTree; + } + }, { + key: "parentizeNode", + value: function parentizeNode(node, parentNode) { + node.parentNode = parentNode || node; + node.obfuscatedNode = false; + return node; + } + }, { + key: "cloneRecursive", + value: function cloneRecursive(node) { + if (node === null) { + return node; + } + + var copy = {}; + + for (var property in node) { + if (!node.hasOwnProperty(property) || property === 'parentNode') { + continue; + } + + var value = node[property]; + var clonedValue = void 0; + + if (value === null || value instanceof RegExp) { + clonedValue = value; + } else if (Array.isArray(value)) { + clonedValue = value.map(NodeUtils.cloneRecursive); + } else if (_typeof(value) === 'object') { + clonedValue = NodeUtils.cloneRecursive(value); + } else { + clonedValue = value; + } + + copy[property] = clonedValue; + } + + return copy; + } + }, { + key: "getBlockScopesOfNodeRecursive", + value: function getBlockScopesOfNodeRecursive(node) { + var blockScopes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + var depth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + var parentNode = node.parentNode; + + if (!parentNode) { + throw new ReferenceError('`parentNode` property of given node is `undefined`'); + } + + if (NodeGuards_1.NodeGuards.isBlockStatementNode(node) && parentNode === node) { + blockScopes.push(node); + } + + if (NodeGuards_1.NodeGuards.isProgramNode(node) || depth && NodeGuards_1.NodeGuards.isNodeHasBlockScope(node, parentNode)) { + blockScopes.push(node); + } + + if (node !== parentNode) { + return NodeUtils.getBlockScopesOfNodeRecursive(parentNode, blockScopes, ++depth); + } + + return blockScopes; + } + }, { + key: "getSiblingStatementNodeByOffset", + value: function getSiblingStatementNodeByOffset(node, offset) { + var scopeNode = NodeUtils.getScopeOfNode(node); + var scopeBody = !NodeGuards_1.NodeGuards.isSwitchCaseNode(scopeNode) ? scopeNode.body : scopeNode.consequent; + var indexInScope = scopeBody.indexOf(node); + return scopeBody[indexInScope + offset] || null; + } + }]); + + return NodeUtils; +}(); + +exports.NodeUtils = NodeUtils; + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$assign = __webpack_require__(11); + +var _Object$defineProperty = __webpack_require__(78); + +var _Object$getOwnPropertyDescriptor = __webpack_require__(79); + +var _Reflect$getMetadata = __webpack_require__(80); + +var _Object$getOwnPropertyNames = __webpack_require__(81); + +var _Reflect$defineMetadata = __webpack_require__(82); + +var _Reflect$hasMetadata = __webpack_require__(83); + +var _Set = __webpack_require__(29); + +var _Object$keys = __webpack_require__(38); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var defaultDescriptor = { + configurable: true, + enumerable: true +}; +var initializedTargetMetadataKey = '_initialized'; +var initializablePropertiesSetMetadataKey = '_initializablePropertiesSet'; +var wrappedMethodsSetMetadataKey = '_wrappedMethodsSet'; +var constructorMethodName = 'constructor'; + +function initializable() { + var initializeMethodName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'initialize'; + + var decoratorName = _Object$keys(this)[0]; + + return function (target, propertyKey) { + var initializeMethod = target[initializeMethodName]; + + if (!initializeMethod || typeof initializeMethod !== 'function') { + throw new Error("`".concat(initializeMethodName, "` method with initialization logic not ") + "found. `@".concat(decoratorName, "` decorator requires `").concat(initializeMethodName, "` method")); + } + + initializeTargetMetadata(initializedTargetMetadataKey, false, target); + initializeTargetMetadata(initializablePropertiesSetMetadataKey, new _Set(), target); + initializeTargetMetadata(wrappedMethodsSetMetadataKey, new _Set(), target); + wrapTargetMethodsInInitializedCheck(target, initializeMethodName); + wrapInitializeMethodInInitializeCheck(target, initializeMethodName, propertyKey); + return wrapInitializableProperty(target, propertyKey); + }; +} + +exports.initializable = initializable; + +function initializeTargetMetadata(metadataKey, metadataValue, target) { + var hasInitializedMetadata = _Reflect$hasMetadata(metadataKey, target); + + if (!hasInitializedMetadata) { + _Reflect$defineMetadata(metadataKey, metadataValue, target); + } +} + +function wrapTargetMethodsInInitializedCheck(target, initializeMethodName) { + var ownPropertyNames = _Object$getOwnPropertyNames(target); + + var prohibitedPropertyNames = [initializeMethodName, constructorMethodName]; + ownPropertyNames.forEach(function (propertyName) { + var initializablePropertiesSet = _Reflect$getMetadata(initializablePropertiesSetMetadataKey, target); + + var wrappedMethodsSet = _Reflect$getMetadata(wrappedMethodsSetMetadataKey, target); + + var isProhibitedPropertyName = prohibitedPropertyNames.includes(propertyName) || initializablePropertiesSet.has(propertyName) || wrappedMethodsSet.has(propertyName); + + if (isProhibitedPropertyName) { + return; + } + + var targetProperty = target[propertyName]; + + if (typeof targetProperty !== 'function') { + return; + } + + var methodDescriptor = _Object$getOwnPropertyDescriptor(target, propertyName) || defaultDescriptor; + var originalMethod = methodDescriptor.value; + + _Object$defineProperty(target, propertyName, _Object$assign({}, methodDescriptor, { + value: function value() { + if (!_Reflect$getMetadata(initializedTargetMetadataKey, this)) { + throw new Error("Class should be initialized with `".concat(initializeMethodName, "()` method")); + } + + return originalMethod.apply(this, arguments); + } + })); + + wrappedMethodsSet.add(propertyName); + }); +} + +function wrapInitializeMethodInInitializeCheck(target, initializeMethodName, propertyKey) { + var methodDescriptor = _Object$getOwnPropertyDescriptor(target, initializeMethodName) || defaultDescriptor; + var originalMethod = methodDescriptor.value; + + _Object$defineProperty(target, initializeMethodName, _Object$assign({}, methodDescriptor, { + value: function value() { + _Reflect$defineMetadata(initializedTargetMetadataKey, true, this); + + var result = originalMethod.apply(this, arguments); + + if (this[propertyKey]) {} + + return result; + } + })); +} + +function wrapInitializableProperty(target, propertyKey) { + var initializablePropertiesSet = _Reflect$getMetadata(initializablePropertiesSetMetadataKey, target); + + initializablePropertiesSet.add(propertyKey); + var initializablePropertyMetadataKey = "_".concat(propertyKey); + var propertyDescriptor = _Object$getOwnPropertyDescriptor(target, initializablePropertyMetadataKey) || defaultDescriptor; + + _Object$defineProperty(target, propertyKey, _Object$assign({}, propertyDescriptor, { + get: function get() { + if (this[initializablePropertyMetadataKey] === undefined) { + throw new Error("Property `".concat(propertyKey, "` is not initialized! Initialize it first!")); + } + + return this[initializablePropertyMetadataKey]; + }, + set: function set(newVal) { + this[initializablePropertyMetadataKey] = newVal; + } + })); + + return propertyDescriptor; +} + +/***/ }), +/* 11 */ +/***/ (function(module, exports) { + +module.exports = require("@babel/runtime/core-js/object/assign"); + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var TransformationStage; + +(function (TransformationStage) { + TransformationStage["Preparing"] = "Preparing"; + TransformationStage["DeadCodeInjection"] = "DeadCodeInjection"; + TransformationStage["ControlFlowFlattening"] = "ControlFlowFlattening"; + TransformationStage["Converting"] = "Converting"; + TransformationStage["Obfuscating"] = "Obfuscating"; + TransformationStage["Finalizing"] = "Finalizing"; +})(TransformationStage = exports.TransformationStage || (exports.TransformationStage = {})); + +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var Initializable_1 = __webpack_require__(10); + +var AbstractNodeTransformer = +/*#__PURE__*/ +function () { + function AbstractNodeTransformer(randomGenerator, options) { + _classCallCheck(this, AbstractNodeTransformer); + + this.randomGenerator = randomGenerator; + this.options = options; + } + + _createClass(AbstractNodeTransformer, [{ + key: "initialize", + value: function initialize() { + this.nodeIdentifier = this.randomGenerator.getRandomInteger(0, 10000); + } + }]); + + return AbstractNodeTransformer; +}(); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Number)], AbstractNodeTransformer.prototype, "nodeIdentifier", void 0); + +tslib_1.__decorate([inversify_1.postConstruct(), tslib_1.__metadata("design:type", Function), tslib_1.__metadata("design:paramtypes", []), tslib_1.__metadata("design:returntype", void 0)], AbstractNodeTransformer.prototype, "initialize", null); + +AbstractNodeTransformer = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object])], AbstractNodeTransformer); +exports.AbstractNodeTransformer = AbstractNodeTransformer; + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var GlobalVariableTemplate1_1 = __webpack_require__(101); + +var GlobalVariableTemplate2_1 = __webpack_require__(102); + +var AbstractCustomNode = AbstractCustomNode_1 = +/*#__PURE__*/ +function () { + function AbstractCustomNode(identifierNamesGeneratorFactory, randomGenerator, options) { + _classCallCheck(this, AbstractCustomNode); + + this.cachedNode = null; + this.identifierNamesGenerator = identifierNamesGeneratorFactory(options); + this.randomGenerator = randomGenerator; + this.options = options; + } + + _createClass(AbstractCustomNode, [{ + key: "getNode", + value: function getNode() { + if (!this.cachedNode) { + this.cachedNode = this.getNodeStructure(); + } + + return this.cachedNode; + } + }, { + key: "getGlobalVariableTemplate", + value: function getGlobalVariableTemplate() { + return this.randomGenerator.getRandomGenerator().pickone(AbstractCustomNode_1.globalVariableTemplateFunctions); + } + }]); + + return AbstractCustomNode; +}(); + +AbstractCustomNode.globalVariableTemplateFunctions = [GlobalVariableTemplate1_1.GlobalVariableTemplate1(), GlobalVariableTemplate2_1.GlobalVariableTemplate2()]; +AbstractCustomNode = AbstractCustomNode_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], AbstractCustomNode); +exports.AbstractCustomNode = AbstractCustomNode; +var AbstractCustomNode_1; + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$assign = __webpack_require__(11); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var escodegen = __importStar(__webpack_require__(42)); + +var NodeType_1 = __webpack_require__(18); + +var Nodes = +/*#__PURE__*/ +function () { + function Nodes() { + _classCallCheck(this, Nodes); + } + + _createClass(Nodes, null, [{ + key: "getProgramNode", + value: function getProgramNode() { + var body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + return { + type: NodeType_1.NodeType.Program, + body: body, + sourceType: 'script', + obfuscatedNode: false + }; + } + }, { + key: "getArrayExpressionNode", + value: function getArrayExpressionNode() { + var elements = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + return { + type: NodeType_1.NodeType.ArrayExpression, + elements: elements + }; + } + }, { + key: "getAssignmentExpressionNode", + value: function getAssignmentExpressionNode(operator, left, right) { + return { + type: NodeType_1.NodeType.AssignmentExpression, + operator: operator, + left: left, + right: right, + obfuscatedNode: false + }; + } + }, { + key: "getBinaryExpressionNode", + value: function getBinaryExpressionNode(operator, left, right) { + return { + type: NodeType_1.NodeType.BinaryExpression, + operator: operator, + left: left, + right: right, + obfuscatedNode: false + }; + } + }, { + key: "getBlockStatementNode", + value: function getBlockStatementNode() { + var body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + return { + type: NodeType_1.NodeType.BlockStatement, + body: body, + obfuscatedNode: false + }; + } + }, { + key: "getBreakStatement", + value: function getBreakStatement(label) { + var breakStatementNode = { + type: NodeType_1.NodeType.BreakStatement, + obfuscatedNode: false + }; + + if (label) { + breakStatementNode.label = label; + } + + return breakStatementNode; + } + }, { + key: "getCallExpressionNode", + value: function getCallExpressionNode(callee) { + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + return { + type: NodeType_1.NodeType.CallExpression, + callee: callee, + arguments: args, + obfuscatedNode: false + }; + } + }, { + key: "getContinueStatement", + value: function getContinueStatement(label) { + var continueStatementNode = { + type: NodeType_1.NodeType.ContinueStatement, + obfuscatedNode: false + }; + + if (label) { + continueStatementNode.label = label; + } + + return continueStatementNode; + } + }, { + key: "getExpressionStatementNode", + value: function getExpressionStatementNode(expression) { + return { + type: NodeType_1.NodeType.ExpressionStatement, + expression: expression, + obfuscatedNode: false + }; + } + }, { + key: "getFunctionDeclarationNode", + value: function getFunctionDeclarationNode(functionName, params, body) { + return { + type: NodeType_1.NodeType.FunctionDeclaration, + id: Nodes.getIdentifierNode(functionName), + params: params, + body: body, + generator: false, + obfuscatedNode: false + }; + } + }, { + key: "getFunctionExpressionNode", + value: function getFunctionExpressionNode(params, body) { + return { + type: NodeType_1.NodeType.FunctionExpression, + params: params, + body: body, + generator: false, + obfuscatedNode: false + }; + } + }, { + key: "getIfStatementNode", + value: function getIfStatementNode(test, consequent, alternate) { + return _Object$assign({ + type: NodeType_1.NodeType.IfStatement, + test: test, + consequent: consequent + }, alternate && { + alternate: alternate + }, { + obfuscatedNode: false + }); + } + }, { + key: "getIdentifierNode", + value: function getIdentifierNode(name) { + return { + type: NodeType_1.NodeType.Identifier, + name: name, + obfuscatedNode: false + }; + } + }, { + key: "getLiteralNode", + value: function getLiteralNode(value, raw) { + raw = raw !== undefined ? raw : "'".concat(value, "'"); + return { + type: NodeType_1.NodeType.Literal, + value: value, + raw: raw, + 'x-verbatim-property': { + content: raw, + precedence: escodegen.Precedence.Primary + }, + obfuscatedNode: false + }; + } + }, { + key: "getLogicalExpressionNode", + value: function getLogicalExpressionNode(operator, left, right) { + return { + type: NodeType_1.NodeType.LogicalExpression, + operator: operator, + left: left, + right: right, + obfuscatedNode: false + }; + } + }, { + key: "getMemberExpressionNode", + value: function getMemberExpressionNode(object, property) { + var computed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + return { + type: NodeType_1.NodeType.MemberExpression, + computed: computed, + object: object, + property: property, + obfuscatedNode: false + }; + } + }, { + key: "getMethodDefinitionNode", + value: function getMethodDefinitionNode(key, value, kind, computed) { + return { + type: NodeType_1.NodeType.MethodDefinition, + key: key, + value: value, + kind: kind, + computed: computed, + static: false, + obfuscatedNode: false + }; + } + }, { + key: "getObjectExpressionNode", + value: function getObjectExpressionNode(properties) { + return { + type: NodeType_1.NodeType.ObjectExpression, + properties: properties, + obfuscatedNode: false + }; + } + }, { + key: "getPropertyNode", + value: function getPropertyNode(key, value) { + var computed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + return { + type: NodeType_1.NodeType.Property, + key: key, + value: value, + kind: 'init', + method: false, + shorthand: false, + computed: computed, + obfuscatedNode: false + }; + } + }, { + key: "getUnaryExpressionNode", + value: function getUnaryExpressionNode(operator, argument) { + var prefix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; + return { + type: NodeType_1.NodeType.UnaryExpression, + operator: operator, + argument: argument, + prefix: prefix, + obfuscatedNode: false + }; + } + }, { + key: "getReturnStatementNode", + value: function getReturnStatementNode(argument) { + return { + type: NodeType_1.NodeType.ReturnStatement, + argument: argument, + obfuscatedNode: false + }; + } + }, { + key: "getSwitchStatementNode", + value: function getSwitchStatementNode(discriminant, cases) { + return { + type: NodeType_1.NodeType.SwitchStatement, + discriminant: discriminant, + cases: cases, + obfuscatedNode: false + }; + } + }, { + key: "getSwitchCaseNode", + value: function getSwitchCaseNode(test, consequent) { + return { + type: NodeType_1.NodeType.SwitchCase, + test: test, + consequent: consequent, + obfuscatedNode: false + }; + } + }, { + key: "getUpdateExpressionNode", + value: function getUpdateExpressionNode(operator, argumentExpr) { + return { + type: NodeType_1.NodeType.UpdateExpression, + operator: operator, + argument: argumentExpr, + prefix: false, + obfuscatedNode: false + }; + } + }, { + key: "getVariableDeclarationNode", + value: function getVariableDeclarationNode() { + var declarations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'var'; + return { + type: NodeType_1.NodeType.VariableDeclaration, + declarations: declarations, + kind: kind, + obfuscatedNode: false + }; + } + }, { + key: "getVariableDeclaratorNode", + value: function getVariableDeclaratorNode(id, init) { + return { + type: NodeType_1.NodeType.VariableDeclarator, + id: id, + init: init, + obfuscatedNode: false + }; + } + }, { + key: "getWhileStatementNode", + value: function getWhileStatementNode(test, body) { + return { + type: NodeType_1.NodeType.WhileStatement, + test: test, + body: body, + obfuscatedNode: false + }; + } + }]); + + return Nodes; +}(); + +exports.Nodes = Nodes; + +/***/ }), +/* 16 */ +/***/ (function(module, exports) { + +module.exports = require("@babel/runtime/core-js/map"); + +/***/ }), +/* 17 */ +/***/ (function(module, exports) { + +module.exports = require("estraverse"); + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var NodeType; + +(function (NodeType) { + NodeType["ArrayExpression"] = "ArrayExpression"; + NodeType["ArrayPattern"] = "ArrayPattern"; + NodeType["ArrowFunctionExpression"] = "ArrowFunctionExpression"; + NodeType["AssignmentExpression"] = "AssignmentExpression"; + NodeType["AssignmentPattern"] = "AssignmentPattern"; + NodeType["AwaitExpression"] = "AwaitExpression"; + NodeType["BinaryExpression"] = "BinaryExpression"; + NodeType["BlockStatement"] = "BlockStatement"; + NodeType["BreakStatement"] = "BreakStatement"; + NodeType["CallExpression"] = "CallExpression"; + NodeType["CatchClause"] = "CatchClause"; + NodeType["ClassDeclaration"] = "ClassDeclaration"; + NodeType["ContinueStatement"] = "ContinueStatement"; + NodeType["ExpressionStatement"] = "ExpressionStatement"; + NodeType["FunctionDeclaration"] = "FunctionDeclaration"; + NodeType["FunctionExpression"] = "FunctionExpression"; + NodeType["Identifier"] = "Identifier"; + NodeType["IfStatement"] = "IfStatement"; + NodeType["LabeledStatement"] = "LabeledStatement"; + NodeType["Literal"] = "Literal"; + NodeType["LogicalExpression"] = "LogicalExpression"; + NodeType["MemberExpression"] = "MemberExpression"; + NodeType["MethodDefinition"] = "MethodDefinition"; + NodeType["ObjectExpression"] = "ObjectExpression"; + NodeType["ObjectPattern"] = "ObjectPattern"; + NodeType["Program"] = "Program"; + NodeType["Property"] = "Property"; + NodeType["RestElement"] = "RestElement"; + NodeType["ReturnStatement"] = "ReturnStatement"; + NodeType["Super"] = "Super"; + NodeType["SwitchCase"] = "SwitchCase"; + NodeType["SwitchStatement"] = "SwitchStatement"; + NodeType["TemplateLiteral"] = "TemplateLiteral"; + NodeType["TryStatement"] = "TryStatement"; + NodeType["UnaryExpression"] = "UnaryExpression"; + NodeType["UpdateExpression"] = "UpdateExpression"; + NodeType["VariableDeclaration"] = "VariableDeclaration"; + NodeType["VariableDeclarator"] = "VariableDeclarator"; + NodeType["WhileStatement"] = "WhileStatement"; +})(NodeType = exports.NodeType || (exports.NodeType = {})); + +/***/ }), +/* 19 */ +/***/ (function(module, exports) { + +module.exports = require("string-template"); + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var ControlFlowCustomNode; + +(function (ControlFlowCustomNode) { + ControlFlowCustomNode["BinaryExpressionFunctionNode"] = "BinaryExpressionFunctionNode"; + ControlFlowCustomNode["BlockStatementControlFlowFlatteningNode"] = "BlockStatementControlFlowFlatteningNode"; + ControlFlowCustomNode["CallExpressionControlFlowStorageCallNode"] = "CallExpressionControlFlowStorageCallNode"; + ControlFlowCustomNode["CallExpressionFunctionNode"] = "CallExpressionFunctionNode"; + ControlFlowCustomNode["ControlFlowStorageNode"] = "ControlFlowStorageNode"; + ControlFlowCustomNode["ExpressionWithOperatorControlFlowStorageCallNode"] = "ExpressionWithOperatorControlFlowStorageCallNode"; + ControlFlowCustomNode["LogicalExpressionFunctionNode"] = "LogicalExpressionFunctionNode"; + ControlFlowCustomNode["StringLiteralControlFlowStorageCallNode"] = "StringLiteralControlFlowStorageCallNode"; + ControlFlowCustomNode["StringLiteralNode"] = "StringLiteralNode"; +})(ControlFlowCustomNode = exports.ControlFlowCustomNode || (exports.ControlFlowCustomNode = {})); + +/***/ }), +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var ObfuscationTarget; + +(function (ObfuscationTarget) { + ObfuscationTarget["Browser"] = "browser"; + ObfuscationTarget["Extension"] = "extension"; + ObfuscationTarget["Node"] = "node"; +})(ObfuscationTarget = exports.ObfuscationTarget || (exports.ObfuscationTarget = {})); + +/***/ }), +/* 22 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Map = __webpack_require__(16); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var AnalyzersModule_1 = __webpack_require__(70); + +var ControlFlowTransformersModule_1 = __webpack_require__(75); + +var ConvertingTransformersModule_1 = __webpack_require__(89); + +var CustomNodesModule_1 = __webpack_require__(94); + +var FinalizingTransformersModule_1 = __webpack_require__(141); + +var GeneratorsModule_1 = __webpack_require__(142); + +var NodeTransformersModule_1 = __webpack_require__(145); + +var ObfuscatingTransformersModule_1 = __webpack_require__(146); + +var OptionsModule_1 = __webpack_require__(159); + +var PreparingTransformersModule_1 = __webpack_require__(174); + +var StoragesModule_1 = __webpack_require__(183); + +var UtilsModule_1 = __webpack_require__(188); + +var JavaScriptObfuscator_1 = __webpack_require__(194); + +var Logger_1 = __webpack_require__(65); + +var ObfuscationEventEmitter_1 = __webpack_require__(197); + +var ObfuscationResult_1 = __webpack_require__(199); + +var SourceCode_1 = __webpack_require__(200); + +var SourceMapCorrector_1 = __webpack_require__(201); + +var TransformersRunner_1 = __webpack_require__(202); + +var InversifyContainerFacade = +/*#__PURE__*/ +function () { + function InversifyContainerFacade() { + _classCallCheck(this, InversifyContainerFacade); + + this.container = new inversify_1.Container(); + } + + _createClass(InversifyContainerFacade, [{ + key: "get", + value: function get(serviceIdentifier) { + return this.container.get(serviceIdentifier); + } + }, { + key: "getNamed", + value: function getNamed(serviceIdentifier, named) { + return this.container.getNamed(serviceIdentifier, named); + } + }, { + key: "load", + value: function load(sourceCode, options) { + this.container.bind(ServiceIdentifiers_1.ServiceIdentifiers.ISourceCode).toDynamicValue(function () { + return new SourceCode_1.SourceCode(sourceCode); + }).inSingletonScope(); + this.container.bind(ServiceIdentifiers_1.ServiceIdentifiers.TInputOptions).toDynamicValue(function () { + return options; + }).inSingletonScope(); + this.container.bind(ServiceIdentifiers_1.ServiceIdentifiers.ILogger).to(Logger_1.Logger).inSingletonScope(); + this.container.bind(ServiceIdentifiers_1.ServiceIdentifiers.IJavaScriptObfuscator).to(JavaScriptObfuscator_1.JavaScriptObfuscator).inSingletonScope(); + this.container.bind(ServiceIdentifiers_1.ServiceIdentifiers.ITransformersRunner).to(TransformersRunner_1.TransformersRunner).inSingletonScope(); + this.container.bind(ServiceIdentifiers_1.ServiceIdentifiers.IObfuscationResult).to(ObfuscationResult_1.ObfuscationResult).inSingletonScope(); + this.container.bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IObfuscationResult).toFactory(function (context) { + return function (obfuscatedCode, sourceMap) { + var obfuscationResult = context.container.get(ServiceIdentifiers_1.ServiceIdentifiers.IObfuscationResult); + obfuscationResult.initialize(obfuscatedCode, sourceMap); + return obfuscationResult; + }; + }); + this.container.bind(ServiceIdentifiers_1.ServiceIdentifiers.ISourceMapCorrector).to(SourceMapCorrector_1.SourceMapCorrector).inSingletonScope(); + this.container.bind(ServiceIdentifiers_1.ServiceIdentifiers.IObfuscationEventEmitter).to(ObfuscationEventEmitter_1.ObfuscationEventEmitter).inSingletonScope(); + this.container.load(AnalyzersModule_1.analyzersModule); + this.container.load(ControlFlowTransformersModule_1.controlFlowTransformersModule); + this.container.load(ConvertingTransformersModule_1.convertingTransformersModule); + this.container.load(CustomNodesModule_1.customNodesModule); + this.container.load(FinalizingTransformersModule_1.finalizingTransformersModule); + this.container.load(GeneratorsModule_1.generatorsModule); + this.container.load(NodeTransformersModule_1.nodeTransformersModule); + this.container.load(ObfuscatingTransformersModule_1.obfuscatingTransformersModule); + this.container.load(OptionsModule_1.optionsModule); + this.container.load(PreparingTransformersModule_1.preparingTransformersModule); + this.container.load(StoragesModule_1.storagesModule); + this.container.load(UtilsModule_1.utilsModule); + } + }, { + key: "unload", + value: function unload() { + this.container.unbindAll(); + } + }], [{ + key: "getFactory", + value: function getFactory(serviceIdentifier) { + return function (context) { + return function (bindingName) { + return context.container.getNamed(serviceIdentifier, bindingName); + }; + }; + } + }, { + key: "getCacheFactory", + value: function getCacheFactory(serviceIdentifier) { + return function (context) { + var cache = new _Map(); + return function (bindingName) { + if (cache.has(bindingName)) { + return cache.get(bindingName); + } + + var object = context.container.getNamed(serviceIdentifier, bindingName); + cache.set(bindingName, object); + return object; + }; + }; + } + }, { + key: "getConstructorFactory", + value: function getConstructorFactory(serviceIdentifier) { + for (var _len = arguments.length, dependencies = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + dependencies[_key - 1] = arguments[_key]; + } + + return function (context) { + var cache = new _Map(); + var cachedDependencies = []; + return function (bindingName) { + dependencies.forEach(function (dependency, index) { + if (!cachedDependencies[index]) { + cachedDependencies[index] = context.container.get(dependency); + } + }); + + if (cache.has(bindingName)) { + return new (Function.prototype.bind.apply(cache.get(bindingName), [null].concat(cachedDependencies)))(); + } + + var constructor = context.container.getNamed(serviceIdentifier, bindingName); + cache.set(bindingName, constructor); + return new (Function.prototype.bind.apply(constructor, [null].concat(cachedDependencies)))(); + }; + }; + } + }]); + + return InversifyContainerFacade; +}(); + +exports.InversifyContainerFacade = InversifyContainerFacade; + +/***/ }), +/* 23 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _toConsumableArray = __webpack_require__(24); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var NodeGuards_1 = __webpack_require__(8); + +var NodeAppender = +/*#__PURE__*/ +function () { + function NodeAppender() { + _classCallCheck(this, NodeAppender); + } + + _createClass(NodeAppender, null, [{ + key: "appendNode", + value: function appendNode(scopeNode, scopeStatements) { + scopeStatements = NodeAppender.parentizeScopeStatementsBeforeAppend(scopeNode, scopeStatements); + NodeAppender.setScopeNodeStatements(scopeNode, _toConsumableArray(NodeAppender.getScopeNodeStatements(scopeNode)).concat(_toConsumableArray(scopeStatements))); + } + }, { + key: "appendNodeToOptimalBlockScope", + value: function appendNodeToOptimalBlockScope(blockScopeStackTraceData, blockScopeNode, nodeBodyStatements) { + var index = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + var targetBlockScope; + + if (!blockScopeStackTraceData.length) { + targetBlockScope = blockScopeNode; + } else { + targetBlockScope = NodeAppender.getOptimalBlockScope(blockScopeStackTraceData, index); + } + + NodeAppender.prependNode(targetBlockScope, nodeBodyStatements); + } + }, { + key: "getOptimalBlockScope", + value: function getOptimalBlockScope(blockScopeTraceData, index) { + var deep = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Infinity; + var firstCall = blockScopeTraceData[index]; + + if (deep <= 0) { + throw new Error("Invalid `deep` argument value. Value should be bigger then 0."); + } + + if (deep > 1 && firstCall.stackTrace.length) { + return NodeAppender.getOptimalBlockScope(firstCall.stackTrace, 0, --deep); + } else { + return firstCall.callee; + } + } + }, { + key: "insertNodeAfter", + value: function insertNodeAfter(scopeNode, scopeStatements, targetStatement) { + var indexInScopeStatement = NodeAppender.getScopeNodeStatements(scopeNode).indexOf(targetStatement); + NodeAppender.insertNodeAtIndex(scopeNode, scopeStatements, indexInScopeStatement + 1); + } + }, { + key: "insertNodeAtIndex", + value: function insertNodeAtIndex(scopeNode, scopeStatements, index) { + scopeStatements = NodeAppender.parentizeScopeStatementsBeforeAppend(scopeNode, scopeStatements); + NodeAppender.setScopeNodeStatements(scopeNode, _toConsumableArray(NodeAppender.getScopeNodeStatements(scopeNode).slice(0, index)).concat(_toConsumableArray(scopeStatements), _toConsumableArray(NodeAppender.getScopeNodeStatements(scopeNode).slice(index)))); + } + }, { + key: "prependNode", + value: function prependNode(scopeNode, scopeStatements) { + scopeStatements = NodeAppender.parentizeScopeStatementsBeforeAppend(scopeNode, scopeStatements); + NodeAppender.setScopeNodeStatements(scopeNode, _toConsumableArray(scopeStatements).concat(_toConsumableArray(NodeAppender.getScopeNodeStatements(scopeNode)))); + } + }, { + key: "getScopeNodeStatements", + value: function getScopeNodeStatements(scopeNode) { + if (NodeGuards_1.NodeGuards.isSwitchCaseNode(scopeNode)) { + return scopeNode.consequent; + } + + return scopeNode.body; + } + }, { + key: "parentizeScopeStatementsBeforeAppend", + value: function parentizeScopeStatementsBeforeAppend(scopeNode, scopeStatements) { + scopeStatements.forEach(function (statement) { + statement.parentNode = scopeNode; + }); + return scopeStatements; + } + }, { + key: "setScopeNodeStatements", + value: function setScopeNodeStatements(scopeNode, statements) { + if (NodeGuards_1.NodeGuards.isSwitchCaseNode(scopeNode)) { + scopeNode.consequent = statements; + return; + } + + scopeNode.body = statements; + } + }]); + + return NodeAppender; +}(); + +exports.NodeAppender = NodeAppender; + +/***/ }), +/* 24 */ +/***/ (function(module, exports) { + +module.exports = require("@babel/runtime/helpers/toConsumableArray"); + +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var ObfuscationEvent; + +(function (ObfuscationEvent) { + ObfuscationEvent["AfterObfuscation"] = "afterObfuscation"; + ObfuscationEvent["BeforeObfuscation"] = "beforeObfuscation"; +})(ObfuscationEvent = exports.ObfuscationEvent || (exports.ObfuscationEvent = {})); + +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var IdentifierObfuscatingReplacer; + +(function (IdentifierObfuscatingReplacer) { + IdentifierObfuscatingReplacer["BaseIdentifierObfuscatingReplacer"] = "BaseIdentifierObfuscatingReplacer"; +})(IdentifierObfuscatingReplacer = exports.IdentifierObfuscatingReplacer || (exports.IdentifierObfuscatingReplacer = {})); + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +__webpack_require__(69); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var InversifyContainerFacade_1 = __webpack_require__(22); + +var JavaScriptObfuscatorCLI_1 = __webpack_require__(47); + +var JavaScriptObfuscatorFacade = +/*#__PURE__*/ +function () { + function JavaScriptObfuscatorFacade() { + _classCallCheck(this, JavaScriptObfuscatorFacade); + } + + _createClass(JavaScriptObfuscatorFacade, null, [{ + key: "obfuscate", + value: function obfuscate(sourceCode) { + var inputOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var inversifyContainerFacade = new InversifyContainerFacade_1.InversifyContainerFacade(); + inversifyContainerFacade.load(sourceCode, inputOptions); + var javaScriptObfuscator = inversifyContainerFacade.get(ServiceIdentifiers_1.ServiceIdentifiers.IJavaScriptObfuscator); + var obfuscationResult = javaScriptObfuscator.obfuscate(sourceCode); + inversifyContainerFacade.unload(); + return obfuscationResult; + } + }, { + key: "runCLI", + value: function runCLI(argv) { + var javaScriptObfuscatorCLI = new JavaScriptObfuscatorCLI_1.JavaScriptObfuscatorCLI(argv); + javaScriptObfuscatorCLI.initialize(); + javaScriptObfuscatorCLI.run(); + } + }]); + + return JavaScriptObfuscatorFacade; +}(); + +exports.JavaScriptObfuscator = JavaScriptObfuscatorFacade; + +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var NodeTransformer; + +(function (NodeTransformer) { + NodeTransformer["BlockStatementControlFlowTransformer"] = "BlockStatementControlFlowTransformer"; + NodeTransformer["ClassDeclarationTransformer"] = "ClassDeclarationTransformer"; + NodeTransformer["CommentsTransformer"] = "CommentsTransformer"; + NodeTransformer["CustomNodesTransformer"] = "CustomNodesTransformer"; + NodeTransformer["DeadCodeInjectionTransformer"] = "DeadCodeInjectionTransformer"; + NodeTransformer["EvalCallExpressionTransformer"] = "EvalCallExpressionTransformer"; + NodeTransformer["FunctionControlFlowTransformer"] = "FunctionControlFlowTransformer"; + NodeTransformer["CatchClauseTransformer"] = "CatchClauseTransformer"; + NodeTransformer["FunctionDeclarationTransformer"] = "FunctionDeclarationTransformer"; + NodeTransformer["FunctionTransformer"] = "FunctionTransformer"; + NodeTransformer["LabeledStatementTransformer"] = "LabeledStatementTransformer"; + NodeTransformer["LiteralTransformer"] = "LiteralTransformer"; + NodeTransformer["MemberExpressionTransformer"] = "MemberExpressionTransformer"; + NodeTransformer["MethodDefinitionTransformer"] = "MethodDefinitionTransformer"; + NodeTransformer["ObfuscatingGuardsTransformer"] = "ObfuscatingGuardsTransformer"; + NodeTransformer["ObjectExpressionKeysTransformer"] = "ObjectExpressionKeysTransformer"; + NodeTransformer["ObjectExpressionTransformer"] = "ObjectExpressionTransformer"; + NodeTransformer["ParentificationTransformer"] = "ParentificationTransformer"; + NodeTransformer["TemplateLiteralTransformer"] = "TemplateLiteralTransformer"; + NodeTransformer["VariableDeclarationTransformer"] = "VariableDeclarationTransformer"; +})(NodeTransformer = exports.NodeTransformer || (exports.NodeTransformer = {})); + +/***/ }), +/* 29 */ +/***/ (function(module, exports) { + +module.exports = require("@babel/runtime/core-js/set"); + +/***/ }), +/* 30 */ +/***/ (function(module, exports) { + +module.exports = require("@babel/runtime/helpers/slicedToArray"); + +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var CustomNode; + +(function (CustomNode) { + CustomNode["ConsoleOutputDisableExpressionNode"] = "ConsoleOutputDisableExpressionNode"; + CustomNode["DebugProtectionFunctionCallNode"] = "DebugProtectionFunctionCallNode"; + CustomNode["DebugProtectionFunctionIntervalNode"] = "DebugProtectionFunctionIntervalNode"; + CustomNode["DebugProtectionFunctionNode"] = "DebugProtectionFunctionNode"; + CustomNode["DomainLockNode"] = "DomainLockNode"; + CustomNode["NodeCallsControllerFunctionNode"] = "NodeCallsControllerFunctionNode"; + CustomNode["SelfDefendingUnicodeNode"] = "SelfDefendingUnicodeNode"; + CustomNode["StringArrayCallsWrapper"] = "StringArrayCallsWrapper"; + CustomNode["StringArrayNode"] = "StringArrayNode"; + CustomNode["StringArrayRotateFunctionNode"] = "StringArrayRotateFunctionNode"; +})(CustomNode = exports.CustomNode || (exports.CustomNode = {})); + +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Array$from = __webpack_require__(56); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var JSFuck_1 = __webpack_require__(138); + +var Utils = +/*#__PURE__*/ +function () { + function Utils() { + _classCallCheck(this, Utils); + } + + _createClass(Utils, null, [{ + key: "decToHex", + value: function decToHex(dec) { + var radix = 16; + return dec.toString(radix); + } + }, { + key: "extractDomainFromUrl", + value: function extractDomainFromUrl(url) { + var domain; + + if (url.indexOf('://') > -1 || url.indexOf('//') === 0) { + domain = url.split('/')[2]; + } else { + domain = url.split('/')[0]; + } + + domain = domain.split(':')[0]; + return domain; + } + }, { + key: "isCeilNumber", + value: function isCeilNumber(number) { + return number % 1 === 0; + } + }, { + key: "stringRotate", + value: function stringRotate(string, times) { + if (!string) { + throw new ReferenceError("Cannot rotate empty string."); + } + + for (var i = 0; i < times; i++) { + string = string[string.length - 1] + string.substring(0, string.length - 1); + } + + return string; + } + }, { + key: "stringToJSFuck", + value: function stringToJSFuck(string) { + return _Array$from(string).map(function (character) { + return JSFuck_1.JSFuck[character] || character; + }).join(' + '); + } + }]); + + return Utils; +}(); + +Utils.hexadecimalPrefix = '0x'; +exports.Utils = Utils; + +/***/ }), +/* 33 */ +/***/ (function(module, exports) { + +module.exports = require("@babel/runtime/core-js/get-iterator"); + +/***/ }), +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var AbstractCustomNodeGroup = +/*#__PURE__*/ +function () { + function AbstractCustomNodeGroup(identifierNamesGeneratorFactory, randomGenerator, options) { + _classCallCheck(this, AbstractCustomNodeGroup); + + this.identifierNamesGenerator = identifierNamesGeneratorFactory(options); + this.randomGenerator = randomGenerator; + this.options = options; + } + + _createClass(AbstractCustomNodeGroup, [{ + key: "getAppendEvent", + value: function getAppendEvent() { + return this.appendEvent; + } + }, { + key: "getCustomNodes", + value: function getCustomNodes() { + return this.customNodes; + } + }, { + key: "appendCustomNodeIfExist", + value: function appendCustomNodeIfExist(customNodeName, callback) { + var customNode = this.customNodes.get(customNodeName); + + if (!customNode) { + return; + } + + callback(customNode); + } + }, { + key: "getRandomStackTraceIndex", + value: function getRandomStackTraceIndex(stackTraceLength) { + return this.randomGenerator.getRandomInteger(0, Math.max(0, Math.round(stackTraceLength - 1))); + } + }]); + + return AbstractCustomNodeGroup; +}(); + +AbstractCustomNodeGroup = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], AbstractCustomNodeGroup); +exports.AbstractCustomNodeGroup = AbstractCustomNodeGroup; + +/***/ }), +/* 35 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var IdentifierNamesGenerator; + +(function (IdentifierNamesGenerator) { + IdentifierNamesGenerator["HexadecimalIdentifierNamesGenerator"] = "hexadecimal"; + IdentifierNamesGenerator["MangledIdentifierNamesGenerator"] = "mangled"; +})(IdentifierNamesGenerator = exports.IdentifierNamesGenerator || (exports.IdentifierNamesGenerator = {})); + +/***/ }), +/* 36 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var SourceMapMode; + +(function (SourceMapMode) { + SourceMapMode["Inline"] = "inline"; + SourceMapMode["Separate"] = "separate"; +})(SourceMapMode = exports.SourceMapMode || (exports.SourceMapMode = {})); + +/***/ }), +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var StringArrayEncoding; + +(function (StringArrayEncoding) { + StringArrayEncoding["Base64"] = "base64"; + StringArrayEncoding["Rc4"] = "rc4"; +})(StringArrayEncoding = exports.StringArrayEncoding || (exports.StringArrayEncoding = {})); + +/***/ }), +/* 38 */ +/***/ (function(module, exports) { + +module.exports = require("@babel/runtime/core-js/object/keys"); + +/***/ }), +/* 39 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$freeze = __webpack_require__(57); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var IdentifierNamesGenerator_1 = __webpack_require__(35); + +var ObfuscationTarget_1 = __webpack_require__(21); + +var SourceMapMode_1 = __webpack_require__(36); + +exports.NO_ADDITIONAL_NODES_PRESET = _Object$freeze({ + compact: true, + controlFlowFlattening: false, + controlFlowFlatteningThreshold: 0, + deadCodeInjection: false, + deadCodeInjectionThreshold: 0, + debugProtection: false, + debugProtectionInterval: false, + disableConsoleOutput: false, + domainLock: [], + exclude: [], + identifierNamesGenerator: IdentifierNamesGenerator_1.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator, + identifiersPrefix: '', + log: false, + renameGlobals: false, + reservedNames: [], + rotateStringArray: false, + seed: 0, + selfDefending: false, + sourceMap: false, + sourceMapBaseUrl: '', + sourceMapFileName: '', + sourceMapMode: SourceMapMode_1.SourceMapMode.Separate, + stringArray: false, + stringArrayEncoding: false, + stringArrayThreshold: 0, + target: ObfuscationTarget_1.ObfuscationTarget.Browser, + transformObjectKeys: false, + unicodeEscapeSequence: false +}); + +/***/ }), +/* 40 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _classCallCheck = __webpack_require__(0); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var AbstractObfuscatingReplacer = function AbstractObfuscatingReplacer(options) { + _classCallCheck(this, AbstractObfuscatingReplacer); + + this.options = options; +}; + +AbstractObfuscatingReplacer = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object])], AbstractObfuscatingReplacer); +exports.AbstractObfuscatingReplacer = AbstractObfuscatingReplacer; + +/***/ }), +/* 41 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _classCallCheck = __webpack_require__(0); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var AbstractCalleeDataExtractor = function AbstractCalleeDataExtractor() { + _classCallCheck(this, AbstractCalleeDataExtractor); +}; + +AbstractCalleeDataExtractor = tslib_1.__decorate([inversify_1.injectable()], AbstractCalleeDataExtractor); +exports.AbstractCalleeDataExtractor = AbstractCalleeDataExtractor; + +/***/ }), +/* 42 */ +/***/ (function(module, exports) { + +module.exports = require("escodegen-wallaby"); + +/***/ }), +/* 43 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Map = __webpack_require__(16); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var AbstractControlFlowReplacer = AbstractControlFlowReplacer_1 = +/*#__PURE__*/ +function () { + function AbstractControlFlowReplacer(controlFlowCustomNodeFactory, randomGenerator, options) { + _classCallCheck(this, AbstractControlFlowReplacer); + + this.replacerDataByControlFlowStorageId = new _Map(); + this.controlFlowCustomNodeFactory = controlFlowCustomNodeFactory; + this.randomGenerator = randomGenerator; + this.options = options; + } + + _createClass(AbstractControlFlowReplacer, [{ + key: "insertCustomNodeToControlFlowStorage", + value: function insertCustomNodeToControlFlowStorage(customNode, controlFlowStorage, replacerId, usingExistingIdentifierChance) { + var _this = this; + + var controlFlowStorageId = controlFlowStorage.getStorageId(); + var storageKeysById = AbstractControlFlowReplacer_1.getStorageKeysByIdForCurrentStorage(this.replacerDataByControlFlowStorageId, controlFlowStorageId); + var storageKeysForCurrentId = storageKeysById.get(replacerId); + + if (this.randomGenerator.getMathRandom() < usingExistingIdentifierChance && storageKeysForCurrentId && storageKeysForCurrentId.length) { + return this.randomGenerator.getRandomGenerator().pickone(storageKeysForCurrentId); + } + + var generateStorageKey = function generateStorageKey(length) { + var key = _this.randomGenerator.getRandomString(length); + + if (controlFlowStorage.getStorage().has(key)) { + return generateStorageKey(length); + } + + return key; + }; + + var storageKey = generateStorageKey(5); + storageKeysById.set(replacerId, [storageKey]); + this.replacerDataByControlFlowStorageId.set(controlFlowStorageId, storageKeysById); + controlFlowStorage.set(storageKey, customNode); + return storageKey; + } + }], [{ + key: "getStorageKeysByIdForCurrentStorage", + value: function getStorageKeysByIdForCurrentStorage(identifierDataByControlFlowStorageId, controlFlowStorageId) { + var storageKeysById; + + if (identifierDataByControlFlowStorageId.has(controlFlowStorageId)) { + storageKeysById = identifierDataByControlFlowStorageId.get(controlFlowStorageId); + } else { + storageKeysById = new _Map(); + } + + return storageKeysById; + } + }]); + + return AbstractControlFlowReplacer; +}(); + +AbstractControlFlowReplacer = AbstractControlFlowReplacer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], AbstractControlFlowReplacer); +exports.AbstractControlFlowReplacer = AbstractControlFlowReplacer; +var AbstractControlFlowReplacer_1; + +/***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function GlobalVariableNoEvalTemplate() { + return "\n var that = (typeof window !== 'undefined'\n ? window\n : (typeof process === 'object' &&\n typeof require === 'function' &&\n typeof global === 'object')\n ? global\n : this);\n "; +} + +exports.GlobalVariableNoEvalTemplate = GlobalVariableNoEvalTemplate; + +/***/ }), +/* 45 */ +/***/ (function(module, exports) { + +module.exports = require("@babel/runtime/helpers/get"); + +/***/ }), +/* 46 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$freeze = __webpack_require__(57); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var IdentifierNamesGenerator_1 = __webpack_require__(35); + +var ObfuscationTarget_1 = __webpack_require__(21); + +var SourceMapMode_1 = __webpack_require__(36); + +exports.DEFAULT_PRESET = _Object$freeze({ + compact: true, + config: '', + controlFlowFlattening: false, + controlFlowFlatteningThreshold: 0.75, + deadCodeInjection: false, + deadCodeInjectionThreshold: 0.4, + debugProtection: false, + debugProtectionInterval: false, + disableConsoleOutput: false, + domainLock: [], + exclude: [], + identifierNamesGenerator: IdentifierNamesGenerator_1.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator, + identifiersPrefix: '', + log: false, + renameGlobals: false, + reservedNames: [], + rotateStringArray: true, + seed: 0, + selfDefending: false, + sourceMap: false, + sourceMapBaseUrl: '', + sourceMapFileName: '', + sourceMapMode: SourceMapMode_1.SourceMapMode.Separate, + stringArray: true, + stringArrayEncoding: false, + stringArrayThreshold: 0.75, + target: ObfuscationTarget_1.ObfuscationTarget.Browser, + transformObjectKeys: false, + unicodeEscapeSequence: false +}); + +/***/ }), +/* 47 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$assign = __webpack_require__(11); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var commander = tslib_1.__importStar(__webpack_require__(204)); + +var packageJson = tslib_1.__importStar(__webpack_require__(63)); + +var path = tslib_1.__importStar(__webpack_require__(48)); + +var Initializable_1 = __webpack_require__(10); + +var Default_1 = __webpack_require__(46); + +var ArraySanitizer_1 = __webpack_require__(205); + +var BooleanSanitizer_1 = __webpack_require__(206); + +var IdentifierNamesGeneratorSanitizer_1 = __webpack_require__(207); + +var ObfuscatingTargetSanitizer_1 = __webpack_require__(208); + +var SourceMapModeSanitizer_1 = __webpack_require__(209); + +var StringArrayEncodingSanitizer_1 = __webpack_require__(210); + +var CLIUtils_1 = __webpack_require__(211); + +var JavaScriptObfuscatorFacade_1 = __webpack_require__(27); + +var SourceCodeReader_1 = __webpack_require__(214); + +var JavaScriptObfuscatorCLI = +/*#__PURE__*/ +function () { + function JavaScriptObfuscatorCLI(argv) { + _classCallCheck(this, JavaScriptObfuscatorCLI); + + this.rawArguments = argv; + this.arguments = argv.slice(2); + } + + _createClass(JavaScriptObfuscatorCLI, [{ + key: "initialize", + value: function initialize() { + this.inputPath = path.normalize(this.arguments[0] || ''); + this.commands = new commander.Command(); + this.configureCommands(); + this.configureHelp(); + this.inputCLIOptions = this.commands.opts(); + } + }, { + key: "run", + value: function run() { + var canShowHelp = !this.arguments.length || this.arguments.includes('--help'); + + if (canShowHelp) { + return this.commands.outputHelp(); + } + + var sourceCodeData = new SourceCodeReader_1.SourceCodeReader(this.inputCLIOptions).readSourceCode(this.inputPath); + this.processSourceCodeData(sourceCodeData); + } + }, { + key: "buildOptions", + value: function buildOptions() { + var inputCLIOptions = JavaScriptObfuscatorCLI.filterOptions(this.inputCLIOptions); + var configFilePath = this.inputCLIOptions.config; + var configFileLocation = configFilePath ? path.resolve(configFilePath, '.') : ''; + var configFileOptions = configFileLocation ? CLIUtils_1.CLIUtils.getUserConfig(configFileLocation) : {}; + return _Object$assign({}, Default_1.DEFAULT_PRESET, configFileOptions, inputCLIOptions); + } + }, { + key: "configureCommands", + value: function configureCommands() { + this.commands.usage(' [options]').version(packageJson.version, '-v, --version').option('-o, --output ', 'Output path for obfuscated code').option('--compact ', 'Disable one line output code compacting', BooleanSanitizer_1.BooleanSanitizer).option('--config ', 'Name of js / json config file').option('--control-flow-flattening ', 'Enables control flow flattening', BooleanSanitizer_1.BooleanSanitizer).option('--control-flow-flattening-threshold ', 'The probability that the control flow flattening transformation will be applied to the node', parseFloat).option('--dead-code-injection ', 'Enables dead code injection', BooleanSanitizer_1.BooleanSanitizer).option('--dead-code-injection-threshold ', 'The probability that the dead code injection transformation will be applied to the node', parseFloat).option('--debug-protection ', 'Disable browser Debug panel (can cause DevTools enabled browser freeze)', BooleanSanitizer_1.BooleanSanitizer).option('--debug-protection-interval ', 'Disable browser Debug panel even after page was loaded (can cause DevTools enabled browser freeze)', BooleanSanitizer_1.BooleanSanitizer).option('--disable-console-output ', 'Allow console.log, console.info, console.error and console.warn messages output into browser console', BooleanSanitizer_1.BooleanSanitizer).option('--domain-lock (comma separated, without whitespaces)', 'Blocks the execution of the code in domains that do not match the passed RegExp patterns (comma separated)', ArraySanitizer_1.ArraySanitizer).option('--exclude (comma separated, without whitespaces)', 'A filename or glob which indicates files to exclude from obfuscation', ArraySanitizer_1.ArraySanitizer).option('--identifier-names-generator [hexadecimal, mangled]', 'Sets identifier names generator (Default: hexadecimal)', IdentifierNamesGeneratorSanitizer_1.IdentifierNamesGeneratorSanitizer).option('--identifiers-prefix ', 'Sets prefix for all global identifiers.').option('--log ', 'Enables logging of the information to the console', BooleanSanitizer_1.BooleanSanitizer).option('--reserved-names (comma separated, without whitespaces)', 'Disable obfuscation of variable names, function names and names of function parameters that match the passed RegExp patterns (comma separated)', ArraySanitizer_1.ArraySanitizer).option('--rename-globals ', 'Allows to enable obfuscation of global variable and function names with declaration.', BooleanSanitizer_1.BooleanSanitizer).option('--rotate-string-array ', 'Disable rotation of unicode array values during obfuscation', BooleanSanitizer_1.BooleanSanitizer).option('--seed ', 'Sets seed for random generator. This is useful for creating repeatable results.', parseFloat).option('--self-defending ', 'Disables self-defending for obfuscated code', BooleanSanitizer_1.BooleanSanitizer).option('--source-map ', 'Enables source map generation', BooleanSanitizer_1.BooleanSanitizer).option('--source-map-base-url ', 'Sets base url to the source map import url when `--source-map-mode=separate`').option('--source-map-file-name ', 'Sets file name for output source map when `--source-map-mode=separate`').option('--source-map-mode [inline, separate]', 'Specify source map output mode', SourceMapModeSanitizer_1.SourceMapModeSanitizer).option('--string-array ', 'Disables gathering of all literal strings into an array and replacing every literal string with an array call', BooleanSanitizer_1.BooleanSanitizer).option('--string-array-encoding [true, false, base64, rc4]', 'Encodes all strings in strings array using base64 or rc4 (this option can slow down your code speed', StringArrayEncodingSanitizer_1.StringArrayEncodingSanitizer).option('--string-array-threshold ', 'The probability that the literal string will be inserted into stringArray (Default: 0.8, Min: 0, Max: 1)', parseFloat).option('--target ', 'Allows to set target environment for obfuscated code.', ObfuscatingTargetSanitizer_1.ObfuscationTargetSanitizer).option('--transform-object-keys ', 'Enables transformation of object keys', BooleanSanitizer_1.BooleanSanitizer).option('--unicode-escape-sequence ', 'Allows to enable/disable string conversion to unicode escape sequence', BooleanSanitizer_1.BooleanSanitizer).parse(this.rawArguments); + } + }, { + key: "configureHelp", + value: function configureHelp() { + this.commands.on('--help', function () { + console.log(' Examples:\n'); + console.log(' %> javascript-obfuscator input_file_name.js --compact true --self-defending false'); + console.log(' %> javascript-obfuscator input_file_name.js --output output_file_name.js --compact true --self-defending false'); + console.log(' %> javascript-obfuscator input_directory_name --compact true --self-defending false'); + console.log(''); + }); + } + }, { + key: "processSourceCodeData", + value: function processSourceCodeData(sourceCodeData) { + var _this = this; + + var outputPath = this.inputCLIOptions.output ? path.normalize(this.inputCLIOptions.output) : ''; + + if (!Array.isArray(sourceCodeData)) { + var outputCodePath = outputPath || CLIUtils_1.CLIUtils.getOutputCodePath(this.inputPath); + this.processSourceCode(sourceCodeData, outputCodePath, null); + } else { + sourceCodeData.forEach(function (_ref, index) { + var filePath = _ref.filePath, + content = _ref.content; + var outputCodePath = outputPath ? path.join(outputPath, filePath) : CLIUtils_1.CLIUtils.getOutputCodePath(filePath); + + _this.processSourceCode(content, outputCodePath, index); + }); + } + } + }, { + key: "processSourceCode", + value: function processSourceCode(sourceCode, outputCodePath, sourceCodeIndex) { + var options = this.buildOptions(); + + if (sourceCodeIndex !== null) { + var baseIdentifiersPrefix = this.inputCLIOptions.identifiersPrefix || JavaScriptObfuscatorCLI.baseIdentifiersPrefix; + var identifiersPrefix = "".concat(baseIdentifiersPrefix).concat(sourceCodeIndex); + options = _Object$assign({}, options, { + identifiersPrefix: identifiersPrefix + }); + } + + if (options.sourceMap) { + JavaScriptObfuscatorCLI.processSourceCodeWithSourceMap(sourceCode, outputCodePath, options); + } else { + JavaScriptObfuscatorCLI.processSourceCodeWithoutSourceMap(sourceCode, outputCodePath, options); + } + } + }], [{ + key: "filterOptions", + value: function filterOptions(options) { + var filteredOptions = {}; + + for (var option in options) { + if (!options.hasOwnProperty(option) || options[option] === undefined) { + continue; + } + + filteredOptions[option] = options[option]; + } + + return filteredOptions; + } + }, { + key: "processSourceCodeWithoutSourceMap", + value: function processSourceCodeWithoutSourceMap(sourceCode, outputCodePath, options) { + var obfuscatedCode = JavaScriptObfuscatorFacade_1.JavaScriptObfuscator.obfuscate(sourceCode, options).getObfuscatedCode(); + CLIUtils_1.CLIUtils.writeFile(outputCodePath, obfuscatedCode); + } + }, { + key: "processSourceCodeWithSourceMap", + value: function processSourceCodeWithSourceMap(sourceCode, outputCodePath, options) { + var outputSourceMapPath = CLIUtils_1.CLIUtils.getOutputSourceMapPath(outputCodePath, options.sourceMapFileName || ''); + options = _Object$assign({}, options, { + sourceMapFileName: path.basename(outputSourceMapPath) + }); + var obfuscationResult = JavaScriptObfuscatorFacade_1.JavaScriptObfuscator.obfuscate(sourceCode, options); + CLIUtils_1.CLIUtils.writeFile(outputCodePath, obfuscationResult.getObfuscatedCode()); + + if (options.sourceMapMode === 'separate' && obfuscationResult.getSourceMap()) { + CLIUtils_1.CLIUtils.writeFile(outputSourceMapPath, obfuscationResult.getSourceMap()); + } + } + }]); + + return JavaScriptObfuscatorCLI; +}(); + +JavaScriptObfuscatorCLI.encoding = 'utf8'; +JavaScriptObfuscatorCLI.obfuscatedFilePrefix = '-obfuscated'; +JavaScriptObfuscatorCLI.baseIdentifiersPrefix = 'a'; + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Object)], JavaScriptObfuscatorCLI.prototype, "commands", void 0); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Object)], JavaScriptObfuscatorCLI.prototype, "inputCLIOptions", void 0); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], JavaScriptObfuscatorCLI.prototype, "inputPath", void 0); + +exports.JavaScriptObfuscatorCLI = JavaScriptObfuscatorCLI; + +/***/ }), +/* 48 */ +/***/ (function(module, exports) { + +module.exports = require("path"); + +/***/ }), +/* 49 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var CalleeDataExtractor; + +(function (CalleeDataExtractor) { + CalleeDataExtractor["FunctionDeclarationCalleeDataExtractor"] = "FunctionDeclarationCalleeDataExtractor"; + CalleeDataExtractor["FunctionExpressionCalleeDataExtractor"] = "FunctionExpressionCalleeDataExtractor"; + CalleeDataExtractor["ObjectExpressionCalleeDataExtractor"] = "ObjectExpressionCalleeDataExtractor"; +})(CalleeDataExtractor = exports.CalleeDataExtractor || (exports.CalleeDataExtractor = {})); + +/***/ }), +/* 50 */ +/***/ (function(module, exports) { + +module.exports = require("@babel/runtime/helpers/typeof"); + +/***/ }), +/* 51 */ +/***/ (function(module, exports) { + +module.exports = require("esprima"); + +/***/ }), +/* 52 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var ControlFlowReplacer; + +(function (ControlFlowReplacer) { + ControlFlowReplacer["BinaryExpressionControlFlowReplacer"] = "BinaryExpressionControlFlowReplacer"; + ControlFlowReplacer["CallExpressionControlFlowReplacer"] = "CallExpressionControlFlowReplacer"; + ControlFlowReplacer["LogicalExpressionControlFlowReplacer"] = "LogicalExpressionControlFlowReplacer"; + ControlFlowReplacer["StringLiteralControlFlowReplacer"] = "StringLiteralControlFlowReplacer"; +})(ControlFlowReplacer = exports.ControlFlowReplacer || (exports.ControlFlowReplacer = {})); + +/***/ }), +/* 53 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var ControlFlowCustomNode_1 = __webpack_require__(20); + +var AbstractControlFlowReplacer_1 = __webpack_require__(43); + +var NodeGuards_1 = __webpack_require__(8); + +var ExpressionWithOperatorControlFlowReplacer = +/*#__PURE__*/ +function (_AbstractControlFlowR) { + _inherits(ExpressionWithOperatorControlFlowReplacer, _AbstractControlFlowR); + + function ExpressionWithOperatorControlFlowReplacer(controlFlowCustomNodeFactory, randomGenerator, options) { + _classCallCheck(this, ExpressionWithOperatorControlFlowReplacer); + + return _possibleConstructorReturn(this, (ExpressionWithOperatorControlFlowReplacer.__proto__ || _Object$getPrototypeOf(ExpressionWithOperatorControlFlowReplacer)).call(this, controlFlowCustomNodeFactory, randomGenerator, options)); + } + + _createClass(ExpressionWithOperatorControlFlowReplacer, [{ + key: "getControlFlowStorageCallNode", + value: function getControlFlowStorageCallNode(controlFlowStorageId, storageKey, leftExpression, rightExpression) { + var controlFlowStorageCallCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode); + controlFlowStorageCallCustomNode.initialize(controlFlowStorageId, storageKey, leftExpression, rightExpression); + var statementNode = controlFlowStorageCallCustomNode.getNode()[0]; + + if (!statementNode || !NodeGuards_1.NodeGuards.isExpressionStatementNode(statementNode)) { + throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node"); + } + + return statementNode.expression; + } + }]); + + return ExpressionWithOperatorControlFlowReplacer; +}(AbstractControlFlowReplacer_1.AbstractControlFlowReplacer); + +ExpressionWithOperatorControlFlowReplacer = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], ExpressionWithOperatorControlFlowReplacer); +exports.ExpressionWithOperatorControlFlowReplacer = ExpressionWithOperatorControlFlowReplacer; + +/***/ }), +/* 54 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var DeadCodeInjectionCustomNode; + +(function (DeadCodeInjectionCustomNode) { + DeadCodeInjectionCustomNode["BlockStatementDeadCodeInjectionNode"] = "BlockStatementDeadCodeInjectionNode"; +})(DeadCodeInjectionCustomNode = exports.DeadCodeInjectionCustomNode || (exports.DeadCodeInjectionCustomNode = {})); + +/***/ }), +/* 55 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var CustomNodeGroup; + +(function (CustomNodeGroup) { + CustomNodeGroup["ConsoleOutputCustomNodeGroup"] = "ConsoleOutputCustomNodeGroup"; + CustomNodeGroup["DebugProtectionCustomNodeGroup"] = "DebugProtectionCustomNodeGroup"; + CustomNodeGroup["DomainLockCustomNodeGroup"] = "DomainLockCustomNodeGroup"; + CustomNodeGroup["SelfDefendingCustomNodeGroup"] = "SelfDefendingCustomNodeGroup"; + CustomNodeGroup["StringArrayCustomNodeGroup"] = "StringArrayCustomNodeGroup"; +})(CustomNodeGroup = exports.CustomNodeGroup || (exports.CustomNodeGroup = {})); + +/***/ }), +/* 56 */ +/***/ (function(module, exports) { + +module.exports = require("@babel/runtime/core-js/array/from"); + +/***/ }), +/* 57 */ +/***/ (function(module, exports) { + +module.exports = require("@babel/runtime/core-js/object/freeze"); + +/***/ }), +/* 58 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _classCallCheck = __webpack_require__(0); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var AbstractIdentifierNamesGenerator = function AbstractIdentifierNamesGenerator(randomGenerator, options) { + _classCallCheck(this, AbstractIdentifierNamesGenerator); + + this.randomGenerator = randomGenerator; + this.options = options; +}; + +AbstractIdentifierNamesGenerator = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object])], AbstractIdentifierNamesGenerator); +exports.AbstractIdentifierNamesGenerator = AbstractIdentifierNamesGenerator; + +/***/ }), +/* 59 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var LiteralObfuscatingReplacer; + +(function (LiteralObfuscatingReplacer) { + LiteralObfuscatingReplacer["BooleanLiteralObfuscatingReplacer"] = "BooleanLiteralObfuscatingReplacer"; + LiteralObfuscatingReplacer["NumberLiteralObfuscatingReplacer"] = "NumberLiteralObfuscatingReplacer"; + LiteralObfuscatingReplacer["StringLiteralObfuscatingReplacer"] = "StringLiteralObfuscatingReplacer"; +})(LiteralObfuscatingReplacer = exports.LiteralObfuscatingReplacer || (exports.LiteralObfuscatingReplacer = {})); + +/***/ }), +/* 60 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var ObfuscatingGuard; + +(function (ObfuscatingGuard) { + ObfuscatingGuard["BlackListNodeGuard"] = "BlackListNodeGuard"; + ObfuscatingGuard["ConditionalCommentNodeGuard"] = "ConditionalCommentNodeGuard"; +})(ObfuscatingGuard = exports.ObfuscatingGuard || (exports.ObfuscatingGuard = {})); + +/***/ }), +/* 61 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _toConsumableArray = __webpack_require__(24); + +var _getIterator = __webpack_require__(33); + +var _slicedToArray = __webpack_require__(30); + +var _Map = __webpack_require__(16); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var Initializable_1 = __webpack_require__(10); + +var MapStorage = +/*#__PURE__*/ +function () { + function MapStorage(randomGenerator, options) { + _classCallCheck(this, MapStorage); + + this.randomGenerator = randomGenerator; + this.options = options; + } + + _createClass(MapStorage, [{ + key: "initialize", + value: function initialize() { + this.storage = new _Map(); + this.storageId = this.randomGenerator.getRandomString(6); + } + }, { + key: "get", + value: function get(key) { + var value = this.storage.get(key); + + if (!value) { + throw new Error("No value found in map storage with key `".concat(key, "`")); + } + + return value; + } + }, { + key: "getKeyOf", + value: function getKeyOf(value) { + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = _getIterator(this.storage), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _ref3 = _step.value; + + var _ref2 = _slicedToArray(_ref3, 2); + + var _key = _ref2[0]; + var _storageValue = _ref2[1]; + + if (value === _storageValue) { + return _key; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return null; + } + }, { + key: "getLength", + value: function getLength() { + return this.storage.size; + } + }, { + key: "getStorage", + value: function getStorage() { + return this.storage; + } + }, { + key: "getStorageId", + value: function getStorageId() { + return this.storageId; + } + }, { + key: "mergeWith", + value: function mergeWith(storage) { + var mergeId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + this.storage = new _Map(_toConsumableArray(this.storage).concat(_toConsumableArray(storage.getStorage()))); + + if (mergeId) { + this.storageId = storage.getStorageId(); + } + } + }, { + key: "set", + value: function set(key, value) { + this.storage.set(key, value); + } + }]); + + return MapStorage; +}(); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], MapStorage.prototype, "storageId", void 0); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", _Map)], MapStorage.prototype, "storage", void 0); + +tslib_1.__decorate([inversify_1.postConstruct(), tslib_1.__metadata("design:type", Function), tslib_1.__metadata("design:paramtypes", []), tslib_1.__metadata("design:returntype", void 0)], MapStorage.prototype, "initialize", null); + +MapStorage = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object])], MapStorage); +exports.MapStorage = MapStorage; + +/***/ }), +/* 62 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var md5_1 = tslib_1.__importDefault(__webpack_require__(191)); + +var chance_1 = __webpack_require__(192); + +var Initializable_1 = __webpack_require__(10); + +var RandomGenerator = RandomGenerator_1 = +/*#__PURE__*/ +function () { + function RandomGenerator(sourceCode, options) { + _classCallCheck(this, RandomGenerator); + + this.sourceCode = sourceCode; + this.options = options; + } + + _createClass(RandomGenerator, [{ + key: "initialize", + value: function initialize() { + var _this = this; + + var getRandomInteger = function getRandomInteger(min, max) { + return Math.floor(Math.random() * (max - min + 1) + min); + }; + + var getSeed = function getSeed() { + var md5Hash = md5_1.default(_this.sourceCode.getSourceCode()); + return _this.seed + Number(md5Hash.replace(/\D/g, '')); + }; + + this.seed = this.options.seed !== 0 ? this.options.seed : getRandomInteger(0, 999999999); + this.randomGenerator = new chance_1.Chance(getSeed()); + } + }, { + key: "getMathRandom", + value: function getMathRandom() { + return this.getRandomInteger(0, 99999) / 100000; + } + }, { + key: "getRandomFloat", + value: function getRandomFloat(min, max) { + return this.getRandomGenerator().floating({ + min: min, + max: max, + fixed: 7 + }); + } + }, { + key: "getRandomGenerator", + value: function getRandomGenerator() { + return this.randomGenerator; + } + }, { + key: "getRandomInteger", + value: function getRandomInteger(min, max) { + return this.getRandomGenerator().integer({ + min: min, + max: max + }); + } + }, { + key: "getRandomString", + value: function getRandomString(length) { + var pool = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : RandomGenerator_1.randomGeneratorPool; + return this.getRandomGenerator().string({ + length: length, + pool: pool + }); + } + }, { + key: "getSeed", + value: function getSeed() { + return this.seed; + } + }]); + + return RandomGenerator; +}(); + +RandomGenerator.randomGeneratorPool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Object)], RandomGenerator.prototype, "randomGenerator", void 0); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Number)], RandomGenerator.prototype, "seed", void 0); + +tslib_1.__decorate([inversify_1.postConstruct(), tslib_1.__metadata("design:type", Function), tslib_1.__metadata("design:paramtypes", []), tslib_1.__metadata("design:returntype", void 0)], RandomGenerator.prototype, "initialize", null); + +RandomGenerator = RandomGenerator_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ISourceCode)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object])], RandomGenerator); +exports.RandomGenerator = RandomGenerator; +var RandomGenerator_1; + +/***/ }), +/* 63 */ +/***/ (function(module, exports) { + +module.exports = require("pjson"); + +/***/ }), +/* 64 */ +/***/ (function(module, exports) { + +module.exports = require("chalk"); + +/***/ }), +/* 65 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var chalk_1 = tslib_1.__importDefault(__webpack_require__(64)); + +var LoggingPrefix_1 = __webpack_require__(66); + +var Logger = Logger_1 = +/*#__PURE__*/ +function () { + function Logger(options) { + _classCallCheck(this, Logger); + + this.options = options; + } + + _createClass(Logger, [{ + key: "info", + value: function info(loggingMessage, value) { + if (!this.options.log) { + return; + } + + Logger_1.log(Logger_1.colorInfo, LoggingPrefix_1.LoggingPrefix.Base, loggingMessage, value); + } + }, { + key: "success", + value: function success(loggingMessage, value) { + if (!this.options.log) { + return; + } + + Logger_1.log(Logger_1.colorSuccess, LoggingPrefix_1.LoggingPrefix.Base, loggingMessage, value); + } + }, { + key: "warn", + value: function warn(loggingMessage, value) { + if (!this.options.log) { + return; + } + + Logger_1.log(Logger_1.colorWarn, LoggingPrefix_1.LoggingPrefix.Base, loggingMessage, value); + } + }], [{ + key: "log", + value: function log(loggingLevelColor, loggingPrefix, loggingMessage, value) { + var processedMessage = loggingLevelColor("\n".concat(loggingPrefix, " ").concat(loggingMessage)); + !value ? console.log(processedMessage) : console.log(processedMessage, value); + } + }]); + + return Logger; +}(); + +Logger.colorInfo = chalk_1.default.cyan; +Logger.colorSuccess = chalk_1.default.green; +Logger.colorWarn = chalk_1.default.yellow; +Logger = Logger_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object])], Logger); +exports.Logger = Logger; +var Logger_1; + +/***/ }), +/* 66 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var LoggingPrefix; + +(function (LoggingPrefix) { + LoggingPrefix["Base"] = "[javascript-obfuscator]"; + LoggingPrefix["CLI"] = "[javascript-obfuscator-cli]"; +})(LoggingPrefix = exports.LoggingPrefix || (exports.LoggingPrefix = {})); + +/***/ }), +/* 67 */ +/***/ (function(module, exports) { + +module.exports = require("fs"); + +/***/ }), +/* 68 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var JavaScriptObfuscatorFacade_1 = __webpack_require__(27); + +module.exports = JavaScriptObfuscatorFacade_1.JavaScriptObfuscator; + +/***/ }), +/* 69 */ +/***/ (function(module, exports) { + +module.exports = require("reflect-metadata"); + +/***/ }), +/* 70 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var InversifyContainerFacade_1 = __webpack_require__(22); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var CalleeDataExtractor_1 = __webpack_require__(49); + +var FunctionDeclarationCalleeDataExtractor_1 = __webpack_require__(71); + +var FunctionExpressionCalleeDataExtractor_1 = __webpack_require__(72); + +var ObjectExpressionCalleeDataExtractor_1 = __webpack_require__(73); + +var StackTraceAnalyzer_1 = __webpack_require__(74); + +exports.analyzersModule = new inversify_1.ContainerModule(function (bind) { + bind(ServiceIdentifiers_1.ServiceIdentifiers.IStackTraceAnalyzer).to(StackTraceAnalyzer_1.StackTraceAnalyzer).inSingletonScope(); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICalleeDataExtractor).to(FunctionDeclarationCalleeDataExtractor_1.FunctionDeclarationCalleeDataExtractor).whenTargetNamed(CalleeDataExtractor_1.CalleeDataExtractor.FunctionDeclarationCalleeDataExtractor); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICalleeDataExtractor).to(FunctionExpressionCalleeDataExtractor_1.FunctionExpressionCalleeDataExtractor).whenTargetNamed(CalleeDataExtractor_1.CalleeDataExtractor.FunctionExpressionCalleeDataExtractor); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICalleeDataExtractor).to(ObjectExpressionCalleeDataExtractor_1.ObjectExpressionCalleeDataExtractor).whenTargetNamed(CalleeDataExtractor_1.CalleeDataExtractor.ObjectExpressionCalleeDataExtractor); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICalleeDataExtractor).toFactory(InversifyContainerFacade_1.InversifyContainerFacade.getCacheFactory(ServiceIdentifiers_1.ServiceIdentifiers.ICalleeDataExtractor)); +}); + +/***/ }), +/* 71 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var estraverse = tslib_1.__importStar(__webpack_require__(17)); + +var AbstractCalleeDataExtractor_1 = __webpack_require__(41); + +var NodeGuards_1 = __webpack_require__(8); + +var NodeUtils_1 = __webpack_require__(9); + +var FunctionDeclarationCalleeDataExtractor = +/*#__PURE__*/ +function (_AbstractCalleeDataEx) { + _inherits(FunctionDeclarationCalleeDataExtractor, _AbstractCalleeDataEx); + + function FunctionDeclarationCalleeDataExtractor() { + _classCallCheck(this, FunctionDeclarationCalleeDataExtractor); + + return _possibleConstructorReturn(this, (FunctionDeclarationCalleeDataExtractor.__proto__ || _Object$getPrototypeOf(FunctionDeclarationCalleeDataExtractor)).apply(this, arguments)); + } + + _createClass(FunctionDeclarationCalleeDataExtractor, [{ + key: "extract", + value: function extract(blockScopeBody, callee) { + if (!NodeGuards_1.NodeGuards.isIdentifierNode(callee)) { + return null; + } + + var calleeBlockStatement = this.getCalleeBlockStatement(NodeUtils_1.NodeUtils.getBlockScopesOfNode(blockScopeBody[0])[0], callee.name); + + if (!calleeBlockStatement) { + return null; + } + + return { + callee: calleeBlockStatement, + name: callee.name + }; + } + }, { + key: "getCalleeBlockStatement", + value: function getCalleeBlockStatement(targetNode, name) { + var calleeBlockStatement = null; + estraverse.traverse(targetNode, { + enter: function enter(node) { + if (NodeGuards_1.NodeGuards.isFunctionDeclarationNode(node) && node.id.name === name) { + calleeBlockStatement = node.body; + return estraverse.VisitorOption.Break; + } + } + }); + return calleeBlockStatement; + } + }]); + + return FunctionDeclarationCalleeDataExtractor; +}(AbstractCalleeDataExtractor_1.AbstractCalleeDataExtractor); + +FunctionDeclarationCalleeDataExtractor = tslib_1.__decorate([inversify_1.injectable()], FunctionDeclarationCalleeDataExtractor); +exports.FunctionDeclarationCalleeDataExtractor = FunctionDeclarationCalleeDataExtractor; + +/***/ }), +/* 72 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var estraverse = tslib_1.__importStar(__webpack_require__(17)); + +var AbstractCalleeDataExtractor_1 = __webpack_require__(41); + +var NodeGuards_1 = __webpack_require__(8); + +var NodeUtils_1 = __webpack_require__(9); + +var FunctionExpressionCalleeDataExtractor = +/*#__PURE__*/ +function (_AbstractCalleeDataEx) { + _inherits(FunctionExpressionCalleeDataExtractor, _AbstractCalleeDataEx); + + function FunctionExpressionCalleeDataExtractor() { + _classCallCheck(this, FunctionExpressionCalleeDataExtractor); + + return _possibleConstructorReturn(this, (FunctionExpressionCalleeDataExtractor.__proto__ || _Object$getPrototypeOf(FunctionExpressionCalleeDataExtractor)).apply(this, arguments)); + } + + _createClass(FunctionExpressionCalleeDataExtractor, [{ + key: "extract", + value: function extract(blockScopeBody, callee) { + var calleeBlockStatement = null; + + if (NodeGuards_1.NodeGuards.isIdentifierNode(callee)) { + calleeBlockStatement = this.getCalleeBlockStatement(NodeUtils_1.NodeUtils.getBlockScopesOfNode(blockScopeBody[0])[0], callee.name); + } + + if (NodeGuards_1.NodeGuards.isFunctionExpressionNode(callee)) { + calleeBlockStatement = callee.body; + } + + if (!calleeBlockStatement) { + return null; + } + + return { + callee: calleeBlockStatement, + name: callee.name || null + }; + } + }, { + key: "getCalleeBlockStatement", + value: function getCalleeBlockStatement(targetNode, name) { + var calleeBlockStatement = null; + estraverse.traverse(targetNode, { + enter: function enter(node, parentNode) { + if (NodeGuards_1.NodeGuards.isFunctionExpressionNode(node) && parentNode && NodeGuards_1.NodeGuards.isVariableDeclaratorNode(parentNode) && NodeGuards_1.NodeGuards.isIdentifierNode(parentNode.id) && parentNode.id.name === name) { + calleeBlockStatement = node.body; + return estraverse.VisitorOption.Break; + } + } + }); + return calleeBlockStatement; + } + }]); + + return FunctionExpressionCalleeDataExtractor; +}(AbstractCalleeDataExtractor_1.AbstractCalleeDataExtractor); + +FunctionExpressionCalleeDataExtractor = tslib_1.__decorate([inversify_1.injectable()], FunctionExpressionCalleeDataExtractor); +exports.FunctionExpressionCalleeDataExtractor = FunctionExpressionCalleeDataExtractor; + +/***/ }), +/* 73 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _getIterator = __webpack_require__(33); + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var estraverse = tslib_1.__importStar(__webpack_require__(17)); + +var AbstractCalleeDataExtractor_1 = __webpack_require__(41); + +var NodeGuards_1 = __webpack_require__(8); + +var NodeUtils_1 = __webpack_require__(9); + +var ObjectExpressionCalleeDataExtractor = +/*#__PURE__*/ +function (_AbstractCalleeDataEx) { + _inherits(ObjectExpressionCalleeDataExtractor, _AbstractCalleeDataEx); + + function ObjectExpressionCalleeDataExtractor() { + _classCallCheck(this, ObjectExpressionCalleeDataExtractor); + + return _possibleConstructorReturn(this, (ObjectExpressionCalleeDataExtractor.__proto__ || _Object$getPrototypeOf(ObjectExpressionCalleeDataExtractor)).apply(this, arguments)); + } + + _createClass(ObjectExpressionCalleeDataExtractor, [{ + key: "extract", + value: function extract(blockScopeBody, callee) { + if (!NodeGuards_1.NodeGuards.isMemberExpressionNode(callee)) { + return null; + } + + var objectMembersCallsChain = this.createObjectMembersCallsChain([], callee); + + if (!objectMembersCallsChain.length) { + return null; + } + + var functionExpressionName = objectMembersCallsChain[objectMembersCallsChain.length - 1]; + var calleeBlockStatement = this.getCalleeBlockStatement(NodeUtils_1.NodeUtils.getBlockScopesOfNode(blockScopeBody[0])[0], objectMembersCallsChain); + + if (!calleeBlockStatement) { + return null; + } + + return { + callee: calleeBlockStatement, + name: functionExpressionName + }; + } + }, { + key: "createObjectMembersCallsChain", + value: function createObjectMembersCallsChain(currentChain, memberExpression) { + if (NodeGuards_1.NodeGuards.isIdentifierNode(memberExpression.property) && memberExpression.computed === false) { + currentChain.unshift(memberExpression.property.name); + } else if (NodeGuards_1.NodeGuards.isLiteralNode(memberExpression.property) && (typeof memberExpression.property.value === 'string' || typeof memberExpression.property.value === 'number')) { + currentChain.unshift(memberExpression.property.value); + } else { + return currentChain; + } + + if (NodeGuards_1.NodeGuards.isMemberExpressionNode(memberExpression.object)) { + return this.createObjectMembersCallsChain(currentChain, memberExpression.object); + } else if (NodeGuards_1.NodeGuards.isIdentifierNode(memberExpression.object)) { + currentChain.unshift(memberExpression.object.name); + } + + return currentChain; + } + }, { + key: "getCalleeBlockStatement", + value: function getCalleeBlockStatement(targetNode, objectMembersCallsChain) { + var _this = this; + + var objectName = objectMembersCallsChain.shift(); + + if (!objectName) { + return null; + } + + var calleeBlockStatement = null; + estraverse.traverse(targetNode, { + enter: function enter(node) { + if (NodeGuards_1.NodeGuards.isVariableDeclaratorNode(node) && NodeGuards_1.NodeGuards.isIdentifierNode(node.id) && node.init && NodeGuards_1.NodeGuards.isObjectExpressionNode(node.init) && node.id.name === objectName) { + calleeBlockStatement = _this.findCalleeBlockStatement(node.init.properties, objectMembersCallsChain); + return estraverse.VisitorOption.Break; + } + } + }); + return calleeBlockStatement; + } + }, { + key: "findCalleeBlockStatement", + value: function findCalleeBlockStatement(objectExpressionProperties, objectMembersCallsChain) { + var nextItemInCallsChain = objectMembersCallsChain.shift(); + + if (!nextItemInCallsChain) { + return null; + } + + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = _getIterator(objectExpressionProperties), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _propertyNode = _step.value; + var isTargetPropertyNodeWithIdentifierKey = NodeGuards_1.NodeGuards.isIdentifierNode(_propertyNode.key) && _propertyNode.key.name === nextItemInCallsChain; + var isTargetPropertyNodeWithLiteralKey = NodeGuards_1.NodeGuards.isLiteralNode(_propertyNode.key) && Boolean(_propertyNode.key.value) && _propertyNode.key.value === nextItemInCallsChain; + + if (!isTargetPropertyNodeWithIdentifierKey && !isTargetPropertyNodeWithLiteralKey) { + continue; + } + + if (NodeGuards_1.NodeGuards.isObjectExpressionNode(_propertyNode.value)) { + return this.findCalleeBlockStatement(_propertyNode.value.properties, objectMembersCallsChain); + } + + if (NodeGuards_1.NodeGuards.isFunctionExpressionNode(_propertyNode.value)) { + return _propertyNode.value.body; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return null; + } + }]); + + return ObjectExpressionCalleeDataExtractor; +}(AbstractCalleeDataExtractor_1.AbstractCalleeDataExtractor); + +ObjectExpressionCalleeDataExtractor = tslib_1.__decorate([inversify_1.injectable()], ObjectExpressionCalleeDataExtractor); +exports.ObjectExpressionCalleeDataExtractor = ObjectExpressionCalleeDataExtractor; + +/***/ }), +/* 74 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$assign = __webpack_require__(11); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var estraverse = tslib_1.__importStar(__webpack_require__(17)); + +var CalleeDataExtractor_1 = __webpack_require__(49); + +var NodeGuards_1 = __webpack_require__(8); + +var NodeUtils_1 = __webpack_require__(9); + +var StackTraceAnalyzer = StackTraceAnalyzer_1 = +/*#__PURE__*/ +function () { + function StackTraceAnalyzer(calleeDataExtractorFactory) { + _classCallCheck(this, StackTraceAnalyzer); + + this.calleeDataExtractorFactory = calleeDataExtractorFactory; + } + + _createClass(StackTraceAnalyzer, [{ + key: "analyze", + value: function analyze(astTree) { + return this.analyzeRecursive(astTree.body); + } + }, { + key: "analyzeRecursive", + value: function analyzeRecursive(blockScopeBody) { + var _this = this; + + var limitIndex = StackTraceAnalyzer_1.getLimitIndex(blockScopeBody.length); + var stackTraceData = []; + var blockScopeBodyLength = blockScopeBody.length; + + var _loop = function _loop(index) { + if (index > limitIndex) { + return "break"; + } + + var blockScopeBodyNode = blockScopeBody[index]; + estraverse.traverse(blockScopeBodyNode, { + enter: function enter(node) { + if (!NodeGuards_1.NodeGuards.isCallExpressionNode(node)) { + return; + } + + if (blockScopeBodyNode.parentNode !== NodeUtils_1.NodeUtils.getBlockScopesOfNode(node)[0]) { + return estraverse.VisitorOption.Skip; + } + + _this.analyzeCallExpressionNode(stackTraceData, blockScopeBody, node); + } + }); + }; + + for (var index = 0; index < blockScopeBodyLength; index++) { + var _ret = _loop(index); + + if (_ret === "break") break; + } + + return stackTraceData; + } + }, { + key: "analyzeCallExpressionNode", + value: function analyzeCallExpressionNode(stackTraceData, blockScopeBody, callExpressionNode) { + var _this2 = this; + + StackTraceAnalyzer_1.calleeDataExtractorsList.forEach(function (calleeDataExtractorName) { + var calleeData = _this2.calleeDataExtractorFactory(calleeDataExtractorName).extract(blockScopeBody, callExpressionNode.callee); + + if (!calleeData) { + return; + } + + stackTraceData.push(_Object$assign({}, calleeData, { + stackTrace: _this2.analyzeRecursive(calleeData.callee.body) + })); + }); + } + }], [{ + key: "getLimitIndex", + value: function getLimitIndex(blockScopeBodyLength) { + var lastIndex = blockScopeBodyLength - 1; + var limitThresholdActivationIndex = StackTraceAnalyzer_1.limitThresholdActivationLength - 1; + var limitIndex = lastIndex; + + if (lastIndex > limitThresholdActivationIndex) { + limitIndex = Math.round(limitThresholdActivationIndex + lastIndex * StackTraceAnalyzer_1.limitThreshold); + + if (limitIndex > lastIndex) { + limitIndex = lastIndex; + } + } + + return limitIndex; + } + }]); + + return StackTraceAnalyzer; +}(); + +StackTraceAnalyzer.calleeDataExtractorsList = [CalleeDataExtractor_1.CalleeDataExtractor.FunctionDeclarationCalleeDataExtractor, CalleeDataExtractor_1.CalleeDataExtractor.FunctionExpressionCalleeDataExtractor, CalleeDataExtractor_1.CalleeDataExtractor.ObjectExpressionCalleeDataExtractor]; +StackTraceAnalyzer.limitThresholdActivationLength = 25; +StackTraceAnalyzer.limitThreshold = 0.002; +StackTraceAnalyzer = StackTraceAnalyzer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICalleeDataExtractor)), tslib_1.__metadata("design:paramtypes", [Function])], StackTraceAnalyzer); +exports.StackTraceAnalyzer = StackTraceAnalyzer; +var StackTraceAnalyzer_1; + +/***/ }), +/* 75 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var InversifyContainerFacade_1 = __webpack_require__(22); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var ControlFlowReplacer_1 = __webpack_require__(52); + +var NodeTransformer_1 = __webpack_require__(28); + +var BinaryExpressionControlFlowReplacer_1 = __webpack_require__(76); + +var BlockStatementControlFlowTransformer_1 = __webpack_require__(77); + +var CallExpressionControlFlowReplacer_1 = __webpack_require__(84); + +var DeadCodeInjectionTransformer_1 = __webpack_require__(85); + +var FunctionControlFlowTransformer_1 = __webpack_require__(86); + +var LogicalExpressionControlFlowReplacer_1 = __webpack_require__(87); + +var StringLiteralControlFlowReplacer_1 = __webpack_require__(88); + +exports.controlFlowTransformersModule = new inversify_1.ContainerModule(function (bind) { + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(BlockStatementControlFlowTransformer_1.BlockStatementControlFlowTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.BlockStatementControlFlowTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(DeadCodeInjectionTransformer_1.DeadCodeInjectionTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.DeadCodeInjectionTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(FunctionControlFlowTransformer_1.FunctionControlFlowTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.FunctionControlFlowTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IControlFlowReplacer).to(BinaryExpressionControlFlowReplacer_1.BinaryExpressionControlFlowReplacer).whenTargetNamed(ControlFlowReplacer_1.ControlFlowReplacer.BinaryExpressionControlFlowReplacer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IControlFlowReplacer).to(CallExpressionControlFlowReplacer_1.CallExpressionControlFlowReplacer).whenTargetNamed(ControlFlowReplacer_1.ControlFlowReplacer.CallExpressionControlFlowReplacer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IControlFlowReplacer).to(LogicalExpressionControlFlowReplacer_1.LogicalExpressionControlFlowReplacer).whenTargetNamed(ControlFlowReplacer_1.ControlFlowReplacer.LogicalExpressionControlFlowReplacer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IControlFlowReplacer).to(StringLiteralControlFlowReplacer_1.StringLiteralControlFlowReplacer).whenTargetNamed(ControlFlowReplacer_1.ControlFlowReplacer.StringLiteralControlFlowReplacer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowReplacer).toFactory(InversifyContainerFacade_1.InversifyContainerFacade.getCacheFactory(ServiceIdentifiers_1.ServiceIdentifiers.IControlFlowReplacer)); +}); + +/***/ }), +/* 76 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var ControlFlowCustomNode_1 = __webpack_require__(20); + +var ExpressionWithOperatorControlFlowReplacer_1 = __webpack_require__(53); + +var BinaryExpressionControlFlowReplacer = BinaryExpressionControlFlowReplacer_1 = +/*#__PURE__*/ +function (_ExpressionWithOperat) { + _inherits(BinaryExpressionControlFlowReplacer, _ExpressionWithOperat); + + function BinaryExpressionControlFlowReplacer(controlFlowCustomNodeFactory, randomGenerator, options) { + _classCallCheck(this, BinaryExpressionControlFlowReplacer); + + return _possibleConstructorReturn(this, (BinaryExpressionControlFlowReplacer.__proto__ || _Object$getPrototypeOf(BinaryExpressionControlFlowReplacer)).call(this, controlFlowCustomNodeFactory, randomGenerator, options)); + } + + _createClass(BinaryExpressionControlFlowReplacer, [{ + key: "replace", + value: function replace(binaryExpressionNode, parentNode, controlFlowStorage) { + var replacerId = binaryExpressionNode.operator; + var binaryExpressionFunctionCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.BinaryExpressionFunctionNode); + binaryExpressionFunctionCustomNode.initialize(replacerId); + var storageKey = this.insertCustomNodeToControlFlowStorage(binaryExpressionFunctionCustomNode, controlFlowStorage, replacerId, BinaryExpressionControlFlowReplacer_1.usingExistingIdentifierChance); + return this.getControlFlowStorageCallNode(controlFlowStorage.getStorageId(), storageKey, binaryExpressionNode.left, binaryExpressionNode.right); + } + }]); + + return BinaryExpressionControlFlowReplacer; +}(ExpressionWithOperatorControlFlowReplacer_1.ExpressionWithOperatorControlFlowReplacer); + +BinaryExpressionControlFlowReplacer.usingExistingIdentifierChance = 0.5; +BinaryExpressionControlFlowReplacer = BinaryExpressionControlFlowReplacer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], BinaryExpressionControlFlowReplacer); +exports.BinaryExpressionControlFlowReplacer = BinaryExpressionControlFlowReplacer; +var BinaryExpressionControlFlowReplacer_1; + +/***/ }), +/* 77 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var estraverse = tslib_1.__importStar(__webpack_require__(17)); + +var ControlFlowCustomNode_1 = __webpack_require__(20); + +var TransformationStage_1 = __webpack_require__(12); + +var AbstractNodeTransformer_1 = __webpack_require__(13); + +var NodeGuards_1 = __webpack_require__(8); + +var NodeUtils_1 = __webpack_require__(9); + +var BlockStatementControlFlowTransformer = BlockStatementControlFlowTransformer_1 = +/*#__PURE__*/ +function (_AbstractNodeTransfor) { + _inherits(BlockStatementControlFlowTransformer, _AbstractNodeTransfor); + + function BlockStatementControlFlowTransformer(controlFlowCustomNodeFactory, arrayUtils, randomGenerator, options) { + var _this; + + _classCallCheck(this, BlockStatementControlFlowTransformer); + + _this = _possibleConstructorReturn(this, (BlockStatementControlFlowTransformer.__proto__ || _Object$getPrototypeOf(BlockStatementControlFlowTransformer)).call(this, randomGenerator, options)); + _this.controlFlowCustomNodeFactory = controlFlowCustomNodeFactory; + _this.arrayUtils = arrayUtils; + return _this; + } + + _createClass(BlockStatementControlFlowTransformer, [{ + key: "getVisitor", + value: function getVisitor(transformationStage) { + var _this2 = this; + + switch (transformationStage) { + case TransformationStage_1.TransformationStage.ControlFlowFlattening: + return { + leave: function leave(node, parentNode) { + if (parentNode && NodeGuards_1.NodeGuards.isBlockStatementNode(node)) { + return _this2.transformNode(node, parentNode); + } + } + }; + + default: + return null; + } + } + }, { + key: "transformNode", + value: function transformNode(blockStatementNode, parentNode) { + if (this.randomGenerator.getMathRandom() > this.options.controlFlowFlatteningThreshold || !BlockStatementControlFlowTransformer_1.canTransformBlockStatementNode(blockStatementNode)) { + return blockStatementNode; + } + + var blockStatementBody = blockStatementNode.body; + var originalKeys = this.arrayUtils.arrayRange(blockStatementBody.length); + var shuffledKeys = this.arrayUtils.arrayShuffle(originalKeys); + var originalKeysIndexesInShuffledArray = originalKeys.map(function (key) { + return shuffledKeys.indexOf(key); + }); + var blockStatementControlFlowFlatteningCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode); + blockStatementControlFlowFlatteningCustomNode.initialize(blockStatementBody, shuffledKeys, originalKeysIndexesInShuffledArray); + var newBlockStatementNode = blockStatementControlFlowFlatteningCustomNode.getNode()[0]; + NodeUtils_1.NodeUtils.parentizeNode(newBlockStatementNode, parentNode); + return newBlockStatementNode; + } + }], [{ + key: "blockStatementHasProhibitedStatements", + value: function blockStatementHasProhibitedStatements(blockStatementNode) { + return blockStatementNode.body.some(function (statement) { + var isBreakOrContinueStatement = NodeGuards_1.NodeGuards.isBreakStatementNode(statement) || NodeGuards_1.NodeGuards.isContinueStatementNode(statement); + var isVariableDeclarationWithLetOrConstKind = NodeGuards_1.NodeGuards.isVariableDeclarationNode(statement) && (statement.kind === 'const' || statement.kind === 'let'); + var isClassDeclaration = NodeGuards_1.NodeGuards.isClassDeclarationNode(statement); + return NodeGuards_1.NodeGuards.isFunctionDeclarationNode(statement) || isBreakOrContinueStatement || isVariableDeclarationWithLetOrConstKind || isClassDeclaration; + }); + } + }, { + key: "canTransformBlockStatementNode", + value: function canTransformBlockStatementNode(blockStatementNode) { + var canTransform = true; + estraverse.traverse(blockStatementNode, { + enter: function enter(node) { + if (NodeGuards_1.NodeGuards.isWhileStatementNode(node)) { + return estraverse.VisitorOption.Skip; + } + + if (NodeGuards_1.NodeGuards.isBlockStatementNode(node) && BlockStatementControlFlowTransformer_1.blockStatementHasProhibitedStatements(node)) { + canTransform = false; + } + } + }); + + if (blockStatementNode.body.length <= 4) { + canTransform = false; + } + + return canTransform; + } + }]); + + return BlockStatementControlFlowTransformer; +}(AbstractNodeTransformer_1.AbstractNodeTransformer); + +BlockStatementControlFlowTransformer = BlockStatementControlFlowTransformer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IArrayUtils)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object, Object])], BlockStatementControlFlowTransformer); +exports.BlockStatementControlFlowTransformer = BlockStatementControlFlowTransformer; +var BlockStatementControlFlowTransformer_1; + +/***/ }), +/* 78 */ +/***/ (function(module, exports) { + +module.exports = require("@babel/runtime/core-js/object/define-property"); + +/***/ }), +/* 79 */ +/***/ (function(module, exports) { + +module.exports = require("@babel/runtime/core-js/object/get-own-property-descriptor"); + +/***/ }), +/* 80 */ +/***/ (function(module, exports) { + +module.exports = require("@babel/runtime/core-js/reflect/get-metadata"); + +/***/ }), +/* 81 */ +/***/ (function(module, exports) { + +module.exports = require("@babel/runtime/core-js/object/get-own-property-names"); + +/***/ }), +/* 82 */ +/***/ (function(module, exports) { + +module.exports = require("@babel/runtime/core-js/reflect/define-metadata"); + +/***/ }), +/* 83 */ +/***/ (function(module, exports) { + +module.exports = require("@babel/runtime/core-js/reflect/has-metadata"); + +/***/ }), +/* 84 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var ControlFlowCustomNode_1 = __webpack_require__(20); + +var AbstractControlFlowReplacer_1 = __webpack_require__(43); + +var NodeGuards_1 = __webpack_require__(8); + +var CallExpressionControlFlowReplacer = CallExpressionControlFlowReplacer_1 = +/*#__PURE__*/ +function (_AbstractControlFlowR) { + _inherits(CallExpressionControlFlowReplacer, _AbstractControlFlowR); + + function CallExpressionControlFlowReplacer(controlFlowCustomNodeFactory, randomGenerator, options) { + _classCallCheck(this, CallExpressionControlFlowReplacer); + + return _possibleConstructorReturn(this, (CallExpressionControlFlowReplacer.__proto__ || _Object$getPrototypeOf(CallExpressionControlFlowReplacer)).call(this, controlFlowCustomNodeFactory, randomGenerator, options)); + } + + _createClass(CallExpressionControlFlowReplacer, [{ + key: "replace", + value: function replace(callExpressionNode, parentNode, controlFlowStorage) { + var callee = callExpressionNode.callee; + + if (!NodeGuards_1.NodeGuards.isIdentifierNode(callee)) { + return callExpressionNode; + } + + var replacerId = String(callExpressionNode.arguments.length); + var callExpressionFunctionCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.CallExpressionFunctionNode); + var expressionArguments = callExpressionNode.arguments; + callExpressionFunctionCustomNode.initialize(expressionArguments); + var storageKey = this.insertCustomNodeToControlFlowStorage(callExpressionFunctionCustomNode, controlFlowStorage, replacerId, CallExpressionControlFlowReplacer_1.usingExistingIdentifierChance); + return this.getControlFlowStorageCallNode(controlFlowStorage.getStorageId(), storageKey, callee, expressionArguments); + } + }, { + key: "getControlFlowStorageCallNode", + value: function getControlFlowStorageCallNode(controlFlowStorageId, storageKey, callee, expressionArguments) { + var controlFlowStorageCallCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode); + controlFlowStorageCallCustomNode.initialize(controlFlowStorageId, storageKey, callee, expressionArguments); + var statementNode = controlFlowStorageCallCustomNode.getNode()[0]; + + if (!statementNode || !NodeGuards_1.NodeGuards.isExpressionStatementNode(statementNode)) { + throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node"); + } + + return statementNode.expression; + } + }]); + + return CallExpressionControlFlowReplacer; +}(AbstractControlFlowReplacer_1.AbstractControlFlowReplacer); + +CallExpressionControlFlowReplacer.usingExistingIdentifierChance = 0.5; +CallExpressionControlFlowReplacer = CallExpressionControlFlowReplacer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], CallExpressionControlFlowReplacer); +exports.CallExpressionControlFlowReplacer = CallExpressionControlFlowReplacer; +var CallExpressionControlFlowReplacer_1; + +/***/ }), +/* 85 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Set = __webpack_require__(29); + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var estraverse = tslib_1.__importStar(__webpack_require__(17)); + +var DeadCodeInjectionCustomNode_1 = __webpack_require__(54); + +var NodeTransformer_1 = __webpack_require__(28); + +var NodeType_1 = __webpack_require__(18); + +var TransformationStage_1 = __webpack_require__(12); + +var AbstractNodeTransformer_1 = __webpack_require__(13); + +var NodeGuards_1 = __webpack_require__(8); + +var Nodes_1 = __webpack_require__(15); + +var NodeUtils_1 = __webpack_require__(9); + +var DeadCodeInjectionTransformer = DeadCodeInjectionTransformer_1 = +/*#__PURE__*/ +function (_AbstractNodeTransfor) { + _inherits(DeadCodeInjectionTransformer, _AbstractNodeTransfor); + + function DeadCodeInjectionTransformer(deadCodeInjectionCustomNodeFactory, transformersRunner, randomGenerator, options) { + var _this; + + _classCallCheck(this, DeadCodeInjectionTransformer); + + _this = _possibleConstructorReturn(this, (DeadCodeInjectionTransformer.__proto__ || _Object$getPrototypeOf(DeadCodeInjectionTransformer)).call(this, randomGenerator, options)); + _this.deadCodeInjectionRootAstHostNodeSet = new _Set(); + _this.collectedBlockStatements = []; + _this.collectedBlockStatementsTotalLength = 0; + _this.deadCodeInjectionCustomNodeFactory = deadCodeInjectionCustomNodeFactory; + _this.transformersRunner = transformersRunner; + return _this; + } + + _createClass(DeadCodeInjectionTransformer, [{ + key: "getVisitor", + value: function getVisitor(transformationStage) { + var _this2 = this; + + switch (transformationStage) { + case TransformationStage_1.TransformationStage.DeadCodeInjection: + return { + enter: function enter(node, parentNode) { + if (parentNode && NodeGuards_1.NodeGuards.isProgramNode(node)) { + _this2.analyzeNode(node, parentNode); + + return node; + } + }, + leave: function leave(node, parentNode) { + if (parentNode && NodeGuards_1.NodeGuards.isBlockStatementNode(node)) { + return _this2.transformNode(node, parentNode); + } + } + }; + + case TransformationStage_1.TransformationStage.Finalizing: + if (!this.deadCodeInjectionRootAstHostNodeSet.size) { + return null; + } + + return { + enter: function enter(node, parentNode) { + if (parentNode && _this2.isDeadCodeInjectionRootAstHostNode(node)) { + return _this2.restoreNode(node, parentNode); + } + } + }; + + default: + return null; + } + } + }, { + key: "analyzeNode", + value: function analyzeNode(programNode, parentNode) { + var _this3 = this; + + estraverse.traverse(programNode, { + enter: function enter(node) { + if (!NodeGuards_1.NodeGuards.isBlockStatementNode(node)) { + return; + } + + var clonedBlockStatementNode = NodeUtils_1.NodeUtils.clone(node); + + if (!DeadCodeInjectionTransformer_1.isValidCollectedBlockStatementNode(clonedBlockStatementNode)) { + return; + } + + NodeUtils_1.NodeUtils.parentizeNode(clonedBlockStatementNode, clonedBlockStatementNode); + clonedBlockStatementNode = _this3.transformersRunner.transform(clonedBlockStatementNode, DeadCodeInjectionTransformer_1.transformersToRenameBlockScopeIdentifiers, TransformationStage_1.TransformationStage.Obfuscating); + + _this3.collectedBlockStatements.push(clonedBlockStatementNode); + } + }); + this.collectedBlockStatementsTotalLength = this.collectedBlockStatements.length; + } + }, { + key: "transformNode", + value: function transformNode(blockStatementNode, parentNode) { + var canBreakTraverse = !this.collectedBlockStatements.length || this.collectedBlockStatementsTotalLength < DeadCodeInjectionTransformer_1.minCollectedBlockStatementsCount; + + if (canBreakTraverse) { + return estraverse.VisitorOption.Break; + } + + if (this.randomGenerator.getMathRandom() > this.options.deadCodeInjectionThreshold || !DeadCodeInjectionTransformer_1.isValidWrappedBlockStatementNode(blockStatementNode)) { + return blockStatementNode; + } + + var minInteger = 0; + var maxInteger = this.collectedBlockStatements.length - 1; + var randomIndex = this.randomGenerator.getRandomInteger(minInteger, maxInteger); + var randomBlockStatementNode = this.collectedBlockStatements.splice(randomIndex, 1)[0]; + var isDuplicateBlockStatementNodes = randomBlockStatementNode === blockStatementNode; + + if (isDuplicateBlockStatementNodes) { + return blockStatementNode; + } + + return this.replaceBlockStatementNode(blockStatementNode, randomBlockStatementNode, parentNode); + } + }, { + key: "restoreNode", + value: function restoreNode(deadCodeInjectionRootAstHostNode, parentNode) { + var hostNodeFirstStatement = deadCodeInjectionRootAstHostNode.body[0]; + + if (!NodeGuards_1.NodeGuards.isFunctionDeclarationNode(hostNodeFirstStatement)) { + throw new Error('Wrong dead code injection root AST host node. Host node should contain `FunctionDeclaration` node'); + } + + return hostNodeFirstStatement.body; + } + }, { + key: "isDeadCodeInjectionRootAstHostNode", + value: function isDeadCodeInjectionRootAstHostNode(node) { + return NodeGuards_1.NodeGuards.isBlockStatementNode(node) && this.deadCodeInjectionRootAstHostNodeSet.has(node); + } + }, { + key: "replaceBlockStatementNode", + value: function replaceBlockStatementNode(blockStatementNode, randomBlockStatementNode, parentNode) { + var deadCodeInjectionRootAstHostNode = Nodes_1.Nodes.getBlockStatementNode([Nodes_1.Nodes.getFunctionDeclarationNode(DeadCodeInjectionTransformer_1.deadCodeInjectionRootAstHostNodeName, [], randomBlockStatementNode)]); + this.deadCodeInjectionRootAstHostNodeSet.add(deadCodeInjectionRootAstHostNode); + var blockStatementDeadCodeInjectionCustomNode = this.deadCodeInjectionCustomNodeFactory(DeadCodeInjectionCustomNode_1.DeadCodeInjectionCustomNode.BlockStatementDeadCodeInjectionNode); + blockStatementDeadCodeInjectionCustomNode.initialize(blockStatementNode, deadCodeInjectionRootAstHostNode); + var newBlockStatementNode = blockStatementDeadCodeInjectionCustomNode.getNode()[0]; + NodeUtils_1.NodeUtils.parentizeNode(newBlockStatementNode, parentNode); + return newBlockStatementNode; + } + }], [{ + key: "isProhibitedNodeInsideCollectedBlockStatement", + value: function isProhibitedNodeInsideCollectedBlockStatement(targetNode) { + return NodeGuards_1.NodeGuards.isBreakStatementNode(targetNode) || NodeGuards_1.NodeGuards.isContinueStatementNode(targetNode) || NodeGuards_1.NodeGuards.isAwaitExpressionNode(targetNode) || NodeGuards_1.NodeGuards.isSuperNode(targetNode); + } + }, { + key: "isScopeHoistingFunctionDeclaration", + value: function isScopeHoistingFunctionDeclaration(targetNode) { + if (!NodeGuards_1.NodeGuards.isFunctionDeclarationNode(targetNode)) { + return false; + } + + var scopeNode = NodeUtils_1.NodeUtils.getScopeOfNode(targetNode); + var scopeBody = !NodeGuards_1.NodeGuards.isSwitchCaseNode(scopeNode) ? scopeNode.body : scopeNode.consequent; + var indexInScope = scopeBody.indexOf(targetNode); + + if (indexInScope === 0) { + return false; + } + + var slicedBody = scopeBody.slice(0, indexInScope); + var hostBlockStatementNode = Nodes_1.Nodes.getBlockStatementNode(slicedBody); + var functionDeclarationName = targetNode.id.name; + var isScopeHoistedFunctionDeclaration = false; + estraverse.traverse(hostBlockStatementNode, { + enter: function enter(node) { + if (NodeGuards_1.NodeGuards.isIdentifierNode(node) && node.name === functionDeclarationName) { + isScopeHoistedFunctionDeclaration = true; + return estraverse.VisitorOption.Break; + } + } + }); + return isScopeHoistedFunctionDeclaration; + } + }, { + key: "isValidCollectedBlockStatementNode", + value: function isValidCollectedBlockStatementNode(blockStatementNode) { + if (!blockStatementNode.body.length) { + return false; + } + + var nestedBlockStatementsCount = 0; + var isValidBlockStatementNode = true; + estraverse.traverse(blockStatementNode, { + enter: function enter(node) { + if (NodeGuards_1.NodeGuards.isBlockStatementNode(node)) { + nestedBlockStatementsCount++; + } + + if (nestedBlockStatementsCount > DeadCodeInjectionTransformer_1.maxNestedBlockStatementsCount || DeadCodeInjectionTransformer_1.isProhibitedNodeInsideCollectedBlockStatement(node) || DeadCodeInjectionTransformer_1.isScopeHoistingFunctionDeclaration(node)) { + isValidBlockStatementNode = false; + return estraverse.VisitorOption.Break; + } + } + }); + return isValidBlockStatementNode; + } + }, { + key: "isValidWrappedBlockStatementNode", + value: function isValidWrappedBlockStatementNode(blockStatementNode) { + if (!blockStatementNode.body.length) { + return false; + } + + var isValidBlockStatementNode = true; + estraverse.traverse(blockStatementNode, { + enter: function enter(node) { + if (DeadCodeInjectionTransformer_1.isScopeHoistingFunctionDeclaration(node)) { + isValidBlockStatementNode = false; + return estraverse.VisitorOption.Break; + } + } + }); + + if (!isValidBlockStatementNode) { + return false; + } + + var blockScopeOfBlockStatementNode = NodeUtils_1.NodeUtils.getBlockScopesOfNode(blockStatementNode)[0]; + return blockScopeOfBlockStatementNode.type !== NodeType_1.NodeType.Program; + } + }]); + + return DeadCodeInjectionTransformer; +}(AbstractNodeTransformer_1.AbstractNodeTransformer); + +DeadCodeInjectionTransformer.deadCodeInjectionRootAstHostNodeName = 'deadCodeInjectionRootAstHostNode'; +DeadCodeInjectionTransformer.maxNestedBlockStatementsCount = 4; +DeadCodeInjectionTransformer.minCollectedBlockStatementsCount = 5; +DeadCodeInjectionTransformer.transformersToRenameBlockScopeIdentifiers = [NodeTransformer_1.NodeTransformer.CatchClauseTransformer, NodeTransformer_1.NodeTransformer.ClassDeclarationTransformer, NodeTransformer_1.NodeTransformer.FunctionDeclarationTransformer, NodeTransformer_1.NodeTransformer.FunctionTransformer, NodeTransformer_1.NodeTransformer.LabeledStatementTransformer, NodeTransformer_1.NodeTransformer.VariableDeclarationTransformer]; +DeadCodeInjectionTransformer = DeadCodeInjectionTransformer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ITransformersRunner)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object, Object])], DeadCodeInjectionTransformer); +exports.DeadCodeInjectionTransformer = DeadCodeInjectionTransformer; +var DeadCodeInjectionTransformer_1; + +/***/ }), +/* 86 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$assign = __webpack_require__(11); + +var _Set = __webpack_require__(29); + +var _Map = __webpack_require__(16); + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var estraverse = tslib_1.__importStar(__webpack_require__(17)); + +var ControlFlowCustomNode_1 = __webpack_require__(20); + +var ControlFlowReplacer_1 = __webpack_require__(52); + +var NodeType_1 = __webpack_require__(18); + +var TransformationStage_1 = __webpack_require__(12); + +var AbstractNodeTransformer_1 = __webpack_require__(13); + +var NodeGuards_1 = __webpack_require__(8); + +var NodeAppender_1 = __webpack_require__(23); + +var NodeUtils_1 = __webpack_require__(9); + +var FunctionControlFlowTransformer = FunctionControlFlowTransformer_1 = +/*#__PURE__*/ +function (_AbstractNodeTransfor) { + _inherits(FunctionControlFlowTransformer, _AbstractNodeTransfor); + + function FunctionControlFlowTransformer(controlFlowStorageFactory, controlFlowReplacerFactory, controlFlowCustomNodeFactory, randomGenerator, options) { + var _this; + + _classCallCheck(this, FunctionControlFlowTransformer); + + _this = _possibleConstructorReturn(this, (FunctionControlFlowTransformer.__proto__ || _Object$getPrototypeOf(FunctionControlFlowTransformer)).call(this, randomGenerator, options)); + _this.controlFlowData = new _Map(); + _this.visitedFunctionNodes = new _Set(); + _this.hostNodesWithControlFlowNode = new _Set(); + _this.controlFlowStorageFactory = controlFlowStorageFactory; + _this.controlFlowReplacerFactory = controlFlowReplacerFactory; + _this.controlFlowCustomNodeFactory = controlFlowCustomNodeFactory; + return _this; + } + + _createClass(FunctionControlFlowTransformer, [{ + key: "getVisitor", + value: function getVisitor(transformationStage) { + var _this2 = this; + + switch (transformationStage) { + case TransformationStage_1.TransformationStage.ControlFlowFlattening: + return { + leave: function leave(node, parentNode) { + if (parentNode && (NodeGuards_1.NodeGuards.isFunctionDeclarationNode(node) || NodeGuards_1.NodeGuards.isFunctionExpressionNode(node) || NodeGuards_1.NodeGuards.isArrowFunctionExpressionNode(node))) { + return _this2.transformNode(node, parentNode); + } + } + }; + + default: + return null; + } + } + }, { + key: "transformNode", + value: function transformNode(functionNode, parentNode) { + this.visitedFunctionNodes.add(functionNode); + + if (!NodeGuards_1.NodeGuards.isBlockStatementNode(functionNode.body)) { + return functionNode; + } + + var hostNode = this.getHostNode(functionNode.body); + var controlFlowStorage = this.getControlFlowStorage(hostNode); + this.controlFlowData.set(hostNode, controlFlowStorage); + this.transformFunctionBody(functionNode.body, controlFlowStorage); + + if (!controlFlowStorage.getLength()) { + return functionNode; + } + + var controlFlowStorageCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.ControlFlowStorageNode); + controlFlowStorageCustomNode.initialize(controlFlowStorage); + NodeAppender_1.NodeAppender.prependNode(hostNode, controlFlowStorageCustomNode.getNode()); + this.hostNodesWithControlFlowNode.add(hostNode); + return functionNode; + } + }, { + key: "getControlFlowStorage", + value: function getControlFlowStorage(hostNode) { + var controlFlowStorage = this.controlFlowStorageFactory(); + + if (this.controlFlowData.has(hostNode)) { + if (this.hostNodesWithControlFlowNode.has(hostNode)) { + hostNode.body.shift(); + } + + var hostControlFlowStorage = this.controlFlowData.get(hostNode); + controlFlowStorage.mergeWith(hostControlFlowStorage, true); + } + + return controlFlowStorage; + } + }, { + key: "getHostNode", + value: function getHostNode(functionNodeBody) { + var blockScopesOfNode = NodeUtils_1.NodeUtils.getBlockScopesOfNode(functionNodeBody); + + if (blockScopesOfNode.length === 1) { + return functionNodeBody; + } else { + blockScopesOfNode.pop(); + } + + if (blockScopesOfNode.length > FunctionControlFlowTransformer_1.hostNodeSearchMinDepth) { + blockScopesOfNode.splice(0, FunctionControlFlowTransformer_1.hostNodeSearchMinDepth); + } + + if (blockScopesOfNode.length > FunctionControlFlowTransformer_1.hostNodeSearchMaxDepth) { + blockScopesOfNode.length = FunctionControlFlowTransformer_1.hostNodeSearchMaxDepth; + } + + return this.randomGenerator.getRandomGenerator().pickone(blockScopesOfNode); + } + }, { + key: "isVisitedFunctionNode", + value: function isVisitedFunctionNode(node) { + return (NodeGuards_1.NodeGuards.isFunctionDeclarationNode(node) || NodeGuards_1.NodeGuards.isFunctionExpressionNode(node) || NodeGuards_1.NodeGuards.isArrowFunctionExpressionNode(node)) && this.visitedFunctionNodes.has(node); + } + }, { + key: "transformFunctionBody", + value: function transformFunctionBody(functionNodeBody, controlFlowStorage) { + var _this3 = this; + + estraverse.replace(functionNodeBody, { + enter: function enter(node, parentNode) { + if (node.ignoredNode) { + return estraverse.VisitorOption.Skip; + } + + if (_this3.isVisitedFunctionNode(node) || !parentNode) { + return estraverse.VisitorOption.Skip; + } + + if (!FunctionControlFlowTransformer_1.controlFlowReplacersMap.has(node.type)) { + return node; + } + + if (_this3.randomGenerator.getMathRandom() > _this3.options.controlFlowFlatteningThreshold) { + return node; + } + + var controlFlowReplacerName = FunctionControlFlowTransformer_1.controlFlowReplacersMap.get(node.type); + + if (controlFlowReplacerName === undefined) { + return node; + } + + return _Object$assign({}, _this3.controlFlowReplacerFactory(controlFlowReplacerName).replace(node, parentNode, controlFlowStorage), { + parentNode: parentNode + }); + } + }); + } + }]); + + return FunctionControlFlowTransformer; +}(AbstractNodeTransformer_1.AbstractNodeTransformer); + +FunctionControlFlowTransformer.controlFlowReplacersMap = new _Map([[NodeType_1.NodeType.BinaryExpression, ControlFlowReplacer_1.ControlFlowReplacer.BinaryExpressionControlFlowReplacer], [NodeType_1.NodeType.CallExpression, ControlFlowReplacer_1.ControlFlowReplacer.CallExpressionControlFlowReplacer], [NodeType_1.NodeType.LogicalExpression, ControlFlowReplacer_1.ControlFlowReplacer.LogicalExpressionControlFlowReplacer], [NodeType_1.NodeType.Literal, ControlFlowReplacer_1.ControlFlowReplacer.StringLiteralControlFlowReplacer]]); +FunctionControlFlowTransformer.hostNodeSearchMinDepth = 0; +FunctionControlFlowTransformer.hostNodeSearchMaxDepth = 2; +FunctionControlFlowTransformer = FunctionControlFlowTransformer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__TControlFlowStorage)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowReplacer)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode)), tslib_1.__param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(4, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Function, Function, Object, Object])], FunctionControlFlowTransformer); +exports.FunctionControlFlowTransformer = FunctionControlFlowTransformer; +var FunctionControlFlowTransformer_1; + +/***/ }), +/* 87 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var ControlFlowCustomNode_1 = __webpack_require__(20); + +var ExpressionWithOperatorControlFlowReplacer_1 = __webpack_require__(53); + +var NodeGuards_1 = __webpack_require__(8); + +var NodeUtils_1 = __webpack_require__(9); + +var LogicalExpressionControlFlowReplacer = LogicalExpressionControlFlowReplacer_1 = +/*#__PURE__*/ +function (_ExpressionWithOperat) { + _inherits(LogicalExpressionControlFlowReplacer, _ExpressionWithOperat); + + function LogicalExpressionControlFlowReplacer(controlFlowCustomNodeFactory, randomGenerator, options) { + _classCallCheck(this, LogicalExpressionControlFlowReplacer); + + return _possibleConstructorReturn(this, (LogicalExpressionControlFlowReplacer.__proto__ || _Object$getPrototypeOf(LogicalExpressionControlFlowReplacer)).call(this, controlFlowCustomNodeFactory, randomGenerator, options)); + } + + _createClass(LogicalExpressionControlFlowReplacer, [{ + key: "replace", + value: function replace(logicalExpressionNode, parentNode, controlFlowStorage) { + if (this.checkForProhibitedExpressions(logicalExpressionNode.left, logicalExpressionNode.right)) { + return logicalExpressionNode; + } + + var replacerId = logicalExpressionNode.operator; + var logicalExpressionFunctionCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.LogicalExpressionFunctionNode); + logicalExpressionFunctionCustomNode.initialize(replacerId); + var storageKey = this.insertCustomNodeToControlFlowStorage(logicalExpressionFunctionCustomNode, controlFlowStorage, replacerId, LogicalExpressionControlFlowReplacer_1.usingExistingIdentifierChance); + return this.getControlFlowStorageCallNode(controlFlowStorage.getStorageId(), storageKey, logicalExpressionNode.left, logicalExpressionNode.right); + } + }, { + key: "checkForProhibitedExpressions", + value: function checkForProhibitedExpressions(leftExpression, rightExpression) { + return [leftExpression, rightExpression].some(function (expressionNode) { + var nodeForCheck; + + if (!NodeGuards_1.NodeGuards.isUnaryExpressionNode(expressionNode)) { + nodeForCheck = expressionNode; + } else { + nodeForCheck = NodeUtils_1.NodeUtils.getUnaryExpressionArgumentNode(expressionNode); + } + + return !NodeGuards_1.NodeGuards.isLiteralNode(nodeForCheck) && !NodeGuards_1.NodeGuards.isIdentifierNode(nodeForCheck) && !NodeGuards_1.NodeGuards.isObjectExpressionNode(nodeForCheck) && !NodeGuards_1.NodeGuards.isExpressionStatementNode(nodeForCheck); + }); + } + }]); + + return LogicalExpressionControlFlowReplacer; +}(ExpressionWithOperatorControlFlowReplacer_1.ExpressionWithOperatorControlFlowReplacer); + +LogicalExpressionControlFlowReplacer.usingExistingIdentifierChance = 0.5; +LogicalExpressionControlFlowReplacer = LogicalExpressionControlFlowReplacer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], LogicalExpressionControlFlowReplacer); +exports.LogicalExpressionControlFlowReplacer = LogicalExpressionControlFlowReplacer; +var LogicalExpressionControlFlowReplacer_1; + +/***/ }), +/* 88 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var ControlFlowCustomNode_1 = __webpack_require__(20); + +var AbstractControlFlowReplacer_1 = __webpack_require__(43); + +var NodeGuards_1 = __webpack_require__(8); + +var StringLiteralControlFlowReplacer = StringLiteralControlFlowReplacer_1 = +/*#__PURE__*/ +function (_AbstractControlFlowR) { + _inherits(StringLiteralControlFlowReplacer, _AbstractControlFlowR); + + function StringLiteralControlFlowReplacer(controlFlowCustomNodeFactory, randomGenerator, options) { + _classCallCheck(this, StringLiteralControlFlowReplacer); + + return _possibleConstructorReturn(this, (StringLiteralControlFlowReplacer.__proto__ || _Object$getPrototypeOf(StringLiteralControlFlowReplacer)).call(this, controlFlowCustomNodeFactory, randomGenerator, options)); + } + + _createClass(StringLiteralControlFlowReplacer, [{ + key: "replace", + value: function replace(literalNode, parentNode, controlFlowStorage) { + if (NodeGuards_1.NodeGuards.isPropertyNode(parentNode) && parentNode.key === literalNode) { + return literalNode; + } + + if (typeof literalNode.value !== 'string' || literalNode.value.length < 3) { + return literalNode; + } + + var replacerId = String(literalNode.value); + var literalFunctionCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.StringLiteralNode); + literalFunctionCustomNode.initialize(literalNode.value); + var storageKey = this.insertCustomNodeToControlFlowStorage(literalFunctionCustomNode, controlFlowStorage, replacerId, StringLiteralControlFlowReplacer_1.usingExistingIdentifierChance); + return this.getControlFlowStorageCallNode(controlFlowStorage.getStorageId(), storageKey); + } + }, { + key: "getControlFlowStorageCallNode", + value: function getControlFlowStorageCallNode(controlFlowStorageId, storageKey) { + var controlFlowStorageCallCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.StringLiteralControlFlowStorageCallNode); + controlFlowStorageCallCustomNode.initialize(controlFlowStorageId, storageKey); + var statementNode = controlFlowStorageCallCustomNode.getNode()[0]; + + if (!statementNode || !NodeGuards_1.NodeGuards.isExpressionStatementNode(statementNode)) { + throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node"); + } + + return statementNode.expression; + } + }]); + + return StringLiteralControlFlowReplacer; +}(AbstractControlFlowReplacer_1.AbstractControlFlowReplacer); + +StringLiteralControlFlowReplacer.usingExistingIdentifierChance = 1; +StringLiteralControlFlowReplacer = StringLiteralControlFlowReplacer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], StringLiteralControlFlowReplacer); +exports.StringLiteralControlFlowReplacer = StringLiteralControlFlowReplacer; +var StringLiteralControlFlowReplacer_1; + +/***/ }), +/* 89 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var NodeTransformer_1 = __webpack_require__(28); + +var MemberExpressionTransformer_1 = __webpack_require__(90); + +var MethodDefinitionTransformer_1 = __webpack_require__(91); + +var ObjectExpressionKeysTransformer_1 = __webpack_require__(92); + +var TemplateLiteralTransformer_1 = __webpack_require__(93); + +exports.convertingTransformersModule = new inversify_1.ContainerModule(function (bind) { + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(MemberExpressionTransformer_1.MemberExpressionTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.MemberExpressionTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(MethodDefinitionTransformer_1.MethodDefinitionTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.MethodDefinitionTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(ObjectExpressionKeysTransformer_1.ObjectExpressionKeysTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.ObjectExpressionKeysTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(TemplateLiteralTransformer_1.TemplateLiteralTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.TemplateLiteralTransformer); +}); + +/***/ }), +/* 90 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var NodeType_1 = __webpack_require__(18); + +var TransformationStage_1 = __webpack_require__(12); + +var AbstractNodeTransformer_1 = __webpack_require__(13); + +var NodeGuards_1 = __webpack_require__(8); + +var MemberExpressionTransformer = +/*#__PURE__*/ +function (_AbstractNodeTransfor) { + _inherits(MemberExpressionTransformer, _AbstractNodeTransfor); + + function MemberExpressionTransformer(randomGenerator, options) { + _classCallCheck(this, MemberExpressionTransformer); + + return _possibleConstructorReturn(this, (MemberExpressionTransformer.__proto__ || _Object$getPrototypeOf(MemberExpressionTransformer)).call(this, randomGenerator, options)); + } + + _createClass(MemberExpressionTransformer, [{ + key: "getVisitor", + value: function getVisitor(transformationStage) { + var _this = this; + + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Converting: + return { + enter: function enter(node, parentNode) { + if (parentNode && NodeGuards_1.NodeGuards.isMemberExpressionNode(node)) { + return _this.transformNode(node, parentNode); + } + } + }; + + default: + return null; + } + } + }, { + key: "transformNode", + value: function transformNode(memberExpressionNode, parentNode) { + if (NodeGuards_1.NodeGuards.isIdentifierNode(memberExpressionNode.property)) { + if (memberExpressionNode.computed) { + return memberExpressionNode; + } + + memberExpressionNode.computed = true; + memberExpressionNode.property = { + type: NodeType_1.NodeType.Literal, + value: memberExpressionNode.property.name, + raw: "'".concat(memberExpressionNode.property.name, "'") + }; + } + + return memberExpressionNode; + } + }]); + + return MemberExpressionTransformer; +}(AbstractNodeTransformer_1.AbstractNodeTransformer); + +MemberExpressionTransformer = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object])], MemberExpressionTransformer); +exports.MemberExpressionTransformer = MemberExpressionTransformer; + +/***/ }), +/* 91 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var NodeType_1 = __webpack_require__(18); + +var TransformationStage_1 = __webpack_require__(12); + +var AbstractNodeTransformer_1 = __webpack_require__(13); + +var NodeGuards_1 = __webpack_require__(8); + +var MethodDefinitionTransformer = MethodDefinitionTransformer_1 = +/*#__PURE__*/ +function (_AbstractNodeTransfor) { + _inherits(MethodDefinitionTransformer, _AbstractNodeTransfor); + + function MethodDefinitionTransformer(randomGenerator, options) { + _classCallCheck(this, MethodDefinitionTransformer); + + return _possibleConstructorReturn(this, (MethodDefinitionTransformer.__proto__ || _Object$getPrototypeOf(MethodDefinitionTransformer)).call(this, randomGenerator, options)); + } + + _createClass(MethodDefinitionTransformer, [{ + key: "getVisitor", + value: function getVisitor(transformationStage) { + var _this = this; + + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Converting: + return { + enter: function enter(node, parentNode) { + if (parentNode && NodeGuards_1.NodeGuards.isMethodDefinitionNode(node)) { + return _this.transformNode(node, parentNode); + } + } + }; + + default: + return null; + } + } + }, { + key: "transformNode", + value: function transformNode(methodDefinitionNode, parentNode) { + if (NodeGuards_1.NodeGuards.isIdentifierNode(methodDefinitionNode.key) && !MethodDefinitionTransformer_1.ignoredNames.includes(methodDefinitionNode.key.name) && methodDefinitionNode.computed === false) { + methodDefinitionNode.computed = true; + methodDefinitionNode.key = { + type: NodeType_1.NodeType.Literal, + value: methodDefinitionNode.key.name, + raw: "'".concat(methodDefinitionNode.key.name, "'") + }; + } + + return methodDefinitionNode; + } + }]); + + return MethodDefinitionTransformer; +}(AbstractNodeTransformer_1.AbstractNodeTransformer); + +MethodDefinitionTransformer.ignoredNames = ['constructor']; +MethodDefinitionTransformer = MethodDefinitionTransformer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object])], MethodDefinitionTransformer); +exports.MethodDefinitionTransformer = MethodDefinitionTransformer; +var MethodDefinitionTransformer_1; + +/***/ }), +/* 92 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _slicedToArray = __webpack_require__(30); + +var _Map = __webpack_require__(16); + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var TransformationStage_1 = __webpack_require__(12); + +var AbstractNodeTransformer_1 = __webpack_require__(13); + +var NodeAppender_1 = __webpack_require__(23); + +var NodeGuards_1 = __webpack_require__(8); + +var Nodes_1 = __webpack_require__(15); + +var NodeUtils_1 = __webpack_require__(9); + +var ObjectExpressionKeysTransformer = ObjectExpressionKeysTransformer_1 = +/*#__PURE__*/ +function (_AbstractNodeTransfor) { + _inherits(ObjectExpressionKeysTransformer, _AbstractNodeTransfor); + + function ObjectExpressionKeysTransformer(randomGenerator, options) { + var _this; + + _classCallCheck(this, ObjectExpressionKeysTransformer); + + _this = _possibleConstructorReturn(this, (ObjectExpressionKeysTransformer.__proto__ || _Object$getPrototypeOf(ObjectExpressionKeysTransformer)).call(this, randomGenerator, options)); + _this.cachedScopeNodesMap = new _Map(); + return _this; + } + + _createClass(ObjectExpressionKeysTransformer, [{ + key: "getVisitor", + value: function getVisitor(transformationStage) { + var _this2 = this; + + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Converting: + return { + enter: function enter(node, parentNode) { + if (_this2.options.transformObjectKeys && parentNode && NodeGuards_1.NodeGuards.isObjectExpressionNode(node) && NodeGuards_1.NodeGuards.isVariableDeclaratorNode(parentNode)) { + return _this2.transformNode(node, parentNode); + } + } + }; + + default: + return null; + } + } + }, { + key: "transformNode", + value: function transformNode(objectExpressionNode, variableDeclarator) { + if (!NodeGuards_1.NodeGuards.isIdentifierNode(variableDeclarator.id)) { + return objectExpressionNode; + } + + var scopeNode = NodeUtils_1.NodeUtils.getScopeOfNode(variableDeclarator); + + if (!scopeNode || !NodeGuards_1.NodeGuards.isNodeHasScope(scopeNode)) { + return objectExpressionNode; + } + + this.cachedScopeNodesMap.set(variableDeclarator, scopeNode); + return this.transformObjectExpressionNode(objectExpressionNode, variableDeclarator.id, variableDeclarator); + } + }, { + key: "extractPropertiesToExpressionStatements", + value: function extractPropertiesToExpressionStatements(properties, memberExpressionObject, variableDeclarator) { + var propertiesLength = properties.length; + var expressionStatements = []; + var removablePropertyIds = []; + + for (var i = 0; i < propertiesLength; i++) { + var property = properties[i]; + var propertyValue = property.value; + + if (!ObjectExpressionKeysTransformer_1.isValidPropertyValueNode(propertyValue)) { + continue; + } + + var propertyKeyName = ObjectExpressionKeysTransformer_1.getPropertyNodeKeyName(property); + + if (!propertyKeyName) { + continue; + } + + var shouldCreateLiteralNode = !property.computed || property.computed && NodeGuards_1.NodeGuards.isLiteralNode(property.key); + var memberExpressionProperty = shouldCreateLiteralNode ? Nodes_1.Nodes.getLiteralNode(propertyKeyName) : Nodes_1.Nodes.getIdentifierNode(propertyKeyName); + var memberExpressionNode = Nodes_1.Nodes.getMemberExpressionNode(memberExpressionObject, memberExpressionProperty, true); + var expressionStatementNode = Nodes_1.Nodes.getExpressionStatementNode(Nodes_1.Nodes.getAssignmentExpressionNode('=', memberExpressionNode, propertyValue)); + + if (NodeGuards_1.NodeGuards.isObjectExpressionNode(property.value)) { + this.transformObjectExpressionNode(property.value, memberExpressionNode, variableDeclarator); + } + + expressionStatements.push(expressionStatementNode); + removablePropertyIds.push(i); + } + + return [expressionStatements, removablePropertyIds]; + } + }, { + key: "transformObjectExpressionNode", + value: function transformObjectExpressionNode(objectExpressionNode, memberExpressionObjectNode, variableDeclarator) { + var properties = objectExpressionNode.properties; + + if (!properties.length) { + return objectExpressionNode; + } + + var scopeNode = this.cachedScopeNodesMap.get(variableDeclarator); + + if (!scopeNode) { + return objectExpressionNode; + } + + var _extractPropertiesToE = this.extractPropertiesToExpressionStatements(properties, memberExpressionObjectNode, variableDeclarator), + _extractPropertiesToE2 = _slicedToArray(_extractPropertiesToE, 2), + expressionStatements = _extractPropertiesToE2[0], + removablePropertyIds = _extractPropertiesToE2[1]; + + objectExpressionNode.properties = ObjectExpressionKeysTransformer_1.filterObjectExpressionProperties(properties, removablePropertyIds); + ObjectExpressionKeysTransformer_1.appendExpressionStatements(scopeNode, expressionStatements, variableDeclarator); + return objectExpressionNode; + } + }], [{ + key: "appendExpressionStatements", + value: function appendExpressionStatements(scopeNode, expressionStatements, variableDeclarator) { + var variableDeclaration = variableDeclarator.parentNode; + + if (!variableDeclaration || !NodeGuards_1.NodeGuards.isVariableDeclarationNode(variableDeclaration)) { + throw new Error('Cannot find variable declaration for variable declarator'); + } + + NodeAppender_1.NodeAppender.insertNodeAfter(scopeNode, expressionStatements, variableDeclaration); + } + }, { + key: "filterObjectExpressionProperties", + value: function filterObjectExpressionProperties(properties, removablePropertyIds) { + return properties.filter(function (property, index) { + return !removablePropertyIds.includes(index); + }); + } + }, { + key: "getPropertyNodeKeyName", + value: function getPropertyNodeKeyName(propertyNode) { + var propertyKeyNode = propertyNode.key; + + if (NodeGuards_1.NodeGuards.isLiteralNode(propertyKeyNode) && typeof propertyKeyNode.value === 'string') { + return propertyKeyNode.value; + } else if (NodeGuards_1.NodeGuards.isIdentifierNode(propertyKeyNode)) { + return propertyKeyNode.name; + } + + return null; + } + }, { + key: "isValidPropertyValueNode", + value: function isValidPropertyValueNode(propertyValueNode) { + return !NodeGuards_1.NodeGuards.isObjectPatternNode(propertyValueNode) && !NodeGuards_1.NodeGuards.isArrayPatternNode(propertyValueNode) && !NodeGuards_1.NodeGuards.isAssignmentPatternNode(propertyValueNode) && !NodeGuards_1.NodeGuards.isRestElementNode(propertyValueNode); + } + }]); + + return ObjectExpressionKeysTransformer; +}(AbstractNodeTransformer_1.AbstractNodeTransformer); + +ObjectExpressionKeysTransformer = ObjectExpressionKeysTransformer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object])], ObjectExpressionKeysTransformer); +exports.ObjectExpressionKeysTransformer = ObjectExpressionKeysTransformer; +var ObjectExpressionKeysTransformer_1; + +/***/ }), +/* 93 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _toConsumableArray = __webpack_require__(24); + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var estraverse = tslib_1.__importStar(__webpack_require__(17)); + +var TransformationStage_1 = __webpack_require__(12); + +var AbstractNodeTransformer_1 = __webpack_require__(13); + +var NodeGuards_1 = __webpack_require__(8); + +var Nodes_1 = __webpack_require__(15); + +var NodeUtils_1 = __webpack_require__(9); + +var TemplateLiteralTransformer = TemplateLiteralTransformer_1 = +/*#__PURE__*/ +function (_AbstractNodeTransfor) { + _inherits(TemplateLiteralTransformer, _AbstractNodeTransfor); + + function TemplateLiteralTransformer(randomGenerator, options) { + _classCallCheck(this, TemplateLiteralTransformer); + + return _possibleConstructorReturn(this, (TemplateLiteralTransformer.__proto__ || _Object$getPrototypeOf(TemplateLiteralTransformer)).call(this, randomGenerator, options)); + } + + _createClass(TemplateLiteralTransformer, [{ + key: "getVisitor", + value: function getVisitor(transformationStage) { + var _this = this; + + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Converting: + return { + enter: function enter(node, parentNode) { + if (parentNode && NodeGuards_1.NodeGuards.isReturnStatementNode(node) && node.argument === null) { + return _this.fixEsprimaReturnStatementTemplateLiteralNode(node); + } + }, + leave: function leave(node, parentNode) { + if (parentNode && NodeGuards_1.NodeGuards.isTemplateLiteralNode(node)) { + return _this.transformNode(node, parentNode); + } + } + }; + + default: + return null; + } + } + }, { + key: "transformNode", + value: function transformNode(templateLiteralNode, parentNode) { + var templateLiteralExpressions = templateLiteralNode.expressions; + var nodes = []; + templateLiteralNode.quasis.forEach(function (templateElement) { + nodes.push(Nodes_1.Nodes.getLiteralNode(templateElement.value.cooked)); + var expression = templateLiteralExpressions.shift(); + + if (!expression) { + return; + } + + nodes.push(expression); + }); + nodes = nodes.filter(function (node) { + return !(NodeGuards_1.NodeGuards.isLiteralNode(node) && node.value === ''); + }); + + if (!TemplateLiteralTransformer_1.isLiteralNodeWithStringValue(nodes[0]) && !TemplateLiteralTransformer_1.isLiteralNodeWithStringValue(nodes[1])) { + nodes.unshift(Nodes_1.Nodes.getLiteralNode('')); + } + + if (nodes.length > 1) { + var root = Nodes_1.Nodes.getBinaryExpressionNode('+', nodes.shift(), nodes.shift()); + nodes.forEach(function (node) { + root = Nodes_1.Nodes.getBinaryExpressionNode('+', root, node); + }); + return root; + } + + return nodes[0]; + } + }, { + key: "fixEsprimaReturnStatementTemplateLiteralNode", + value: function fixEsprimaReturnStatementTemplateLiteralNode(returnStatementNode) { + var scopeNode = NodeUtils_1.NodeUtils.getScopeOfNode(returnStatementNode); + var scopeBody = !NodeGuards_1.NodeGuards.isSwitchCaseNode(scopeNode) ? scopeNode.body : scopeNode.consequent; + var indexInScope = scopeBody.indexOf(returnStatementNode); + + if (indexInScope !== scopeBody.length - 2) { + return; + } + + var nextSiblingStatementNode = scopeBody[indexInScope + 1]; + + if (!nextSiblingStatementNode || !NodeGuards_1.NodeGuards.isExpressionStatementNode(nextSiblingStatementNode)) { + return; + } + + var isSiblingStatementHasTemplateLiteralNode = false; + estraverse.traverse(nextSiblingStatementNode, { + enter: function enter(node, parentNode) { + if (!NodeGuards_1.NodeGuards.isTemplateLiteralNode(node)) { + return; + } + + isSiblingStatementHasTemplateLiteralNode = true; + return estraverse.VisitorOption.Break; + } + }); + + if (!isSiblingStatementHasTemplateLiteralNode) { + return; + } + + returnStatementNode.argument = nextSiblingStatementNode.expression; + scopeBody.pop(); + + if (!NodeGuards_1.NodeGuards.isSwitchCaseNode(scopeNode)) { + scopeNode.body = _toConsumableArray(scopeBody); + } else { + scopeNode.consequent = _toConsumableArray(scopeBody); + } + + return returnStatementNode; + } + }], [{ + key: "isLiteralNodeWithStringValue", + value: function isLiteralNodeWithStringValue(node) { + return node && NodeGuards_1.NodeGuards.isLiteralNode(node) && typeof node.value === 'string'; + } + }]); + + return TemplateLiteralTransformer; +}(AbstractNodeTransformer_1.AbstractNodeTransformer); + +TemplateLiteralTransformer = TemplateLiteralTransformer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object])], TemplateLiteralTransformer); +exports.TemplateLiteralTransformer = TemplateLiteralTransformer; +var TemplateLiteralTransformer_1; + +/***/ }), +/* 94 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var InversifyContainerFacade_1 = __webpack_require__(22); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var ControlFlowCustomNode_1 = __webpack_require__(20); + +var CustomNode_1 = __webpack_require__(31); + +var CustomNodeGroup_1 = __webpack_require__(55); + +var DeadCodeInjectionCustomNode_1 = __webpack_require__(54); + +var ConsoleOutputCustomNodeGroup_1 = __webpack_require__(95); + +var DebugProtectionCustomNodeGroup_1 = __webpack_require__(96); + +var DomainLockCustomNodeGroup_1 = __webpack_require__(97); + +var SelfDefendingCustomNodeGroup_1 = __webpack_require__(98); + +var StringArrayCustomNodeGroup_1 = __webpack_require__(99); + +var BinaryExpressionFunctionNode_1 = __webpack_require__(100); + +var BlockStatementControlFlowFlatteningNode_1 = __webpack_require__(103); + +var BlockStatementDeadCodeInjectionNode_1 = __webpack_require__(104); + +var CallExpressionControlFlowStorageCallNode_1 = __webpack_require__(105); + +var CallExpressionFunctionNode_1 = __webpack_require__(106); + +var ControlFlowStorageNode_1 = __webpack_require__(107); + +var ConsoleOutputDisableExpressionNode_1 = __webpack_require__(108); + +var DebugProtectionFunctionCallNode_1 = __webpack_require__(110); + +var DebugProtectionFunctionIntervalNode_1 = __webpack_require__(112); + +var DebugProtectionFunctionNode_1 = __webpack_require__(114); + +var DomainLockNode_1 = __webpack_require__(118); + +var ExpressionWithOperatorControlFlowStorageCallNode_1 = __webpack_require__(120); + +var LogicalExpressionFunctionNode_1 = __webpack_require__(121); + +var NodeCallsControllerFunctionNode_1 = __webpack_require__(122); + +var SelfDefendingUnicodeNode_1 = __webpack_require__(124); + +var StringArrayCallsWrapper_1 = __webpack_require__(126); + +var StringArrayNode_1 = __webpack_require__(133); + +var StringArrayRotateFunctionNode_1 = __webpack_require__(135); + +var StringLiteralControlFlowStorageCallNode_1 = __webpack_require__(139); + +var StringLiteralNode_1 = __webpack_require__(140); + +exports.customNodesModule = new inversify_1.ContainerModule(function (bind) { + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode).to(ConsoleOutputDisableExpressionNode_1.ConsoleOutputDisableExpressionNode).whenTargetNamed(CustomNode_1.CustomNode.ConsoleOutputDisableExpressionNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode).to(DebugProtectionFunctionCallNode_1.DebugProtectionFunctionCallNode).whenTargetNamed(CustomNode_1.CustomNode.DebugProtectionFunctionCallNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode).to(DebugProtectionFunctionIntervalNode_1.DebugProtectionFunctionIntervalNode).whenTargetNamed(CustomNode_1.CustomNode.DebugProtectionFunctionIntervalNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode).to(DebugProtectionFunctionNode_1.DebugProtectionFunctionNode).whenTargetNamed(CustomNode_1.CustomNode.DebugProtectionFunctionNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode).to(DomainLockNode_1.DomainLockNode).whenTargetNamed(CustomNode_1.CustomNode.DomainLockNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode).to(NodeCallsControllerFunctionNode_1.NodeCallsControllerFunctionNode).whenTargetNamed(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode).to(SelfDefendingUnicodeNode_1.SelfDefendingUnicodeNode).whenTargetNamed(CustomNode_1.CustomNode.SelfDefendingUnicodeNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode).to(StringArrayCallsWrapper_1.StringArrayCallsWrapper).whenTargetNamed(CustomNode_1.CustomNode.StringArrayCallsWrapper); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode).to(StringArrayNode_1.StringArrayNode).whenTargetNamed(CustomNode_1.CustomNode.StringArrayNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode).to(StringArrayRotateFunctionNode_1.StringArrayRotateFunctionNode).whenTargetNamed(CustomNode_1.CustomNode.StringArrayRotateFunctionNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode).toConstructor(BinaryExpressionFunctionNode_1.BinaryExpressionFunctionNode).whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.BinaryExpressionFunctionNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode).toConstructor(BlockStatementControlFlowFlatteningNode_1.BlockStatementControlFlowFlatteningNode).whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode).toConstructor(CallExpressionControlFlowStorageCallNode_1.CallExpressionControlFlowStorageCallNode).whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode).toConstructor(CallExpressionFunctionNode_1.CallExpressionFunctionNode).whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.CallExpressionFunctionNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode).toConstructor(ControlFlowStorageNode_1.ControlFlowStorageNode).whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.ControlFlowStorageNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode).toConstructor(ExpressionWithOperatorControlFlowStorageCallNode_1.ExpressionWithOperatorControlFlowStorageCallNode).whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode).toConstructor(LogicalExpressionFunctionNode_1.LogicalExpressionFunctionNode).whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.LogicalExpressionFunctionNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode).toConstructor(StringLiteralNode_1.StringLiteralNode).whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.StringLiteralNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode).toConstructor(StringLiteralControlFlowStorageCallNode_1.StringLiteralControlFlowStorageCallNode).whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.StringLiteralControlFlowStorageCallNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode).toConstructor(BlockStatementDeadCodeInjectionNode_1.BlockStatementDeadCodeInjectionNode).whenTargetNamed(DeadCodeInjectionCustomNode_1.DeadCodeInjectionCustomNode.BlockStatementDeadCodeInjectionNode); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeGroup).to(ConsoleOutputCustomNodeGroup_1.ConsoleOutputCustomNodeGroup).whenTargetNamed(CustomNodeGroup_1.CustomNodeGroup.ConsoleOutputCustomNodeGroup); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeGroup).to(DebugProtectionCustomNodeGroup_1.DebugProtectionCustomNodeGroup).whenTargetNamed(CustomNodeGroup_1.CustomNodeGroup.DebugProtectionCustomNodeGroup); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeGroup).to(DomainLockCustomNodeGroup_1.DomainLockCustomNodeGroup).whenTargetNamed(CustomNodeGroup_1.CustomNodeGroup.DomainLockCustomNodeGroup); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeGroup).to(SelfDefendingCustomNodeGroup_1.SelfDefendingCustomNodeGroup).whenTargetNamed(CustomNodeGroup_1.CustomNodeGroup.SelfDefendingCustomNodeGroup); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeGroup).to(StringArrayCustomNodeGroup_1.StringArrayCustomNodeGroup).whenTargetNamed(CustomNodeGroup_1.CustomNodeGroup.StringArrayCustomNodeGroup); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICustomNode).toFactory(InversifyContainerFacade_1.InversifyContainerFacade.getFactory(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode)); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode).toFactory(InversifyContainerFacade_1.InversifyContainerFacade.getConstructorFactory(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode, ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator, ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator, ServiceIdentifiers_1.ServiceIdentifiers.IOptions)); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode).toFactory(InversifyContainerFacade_1.InversifyContainerFacade.getConstructorFactory(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode, ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator, ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator, ServiceIdentifiers_1.ServiceIdentifiers.IOptions)); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICustomNodeGroup).toFactory(InversifyContainerFacade_1.InversifyContainerFacade.getFactory(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeGroup)); +}); + +/***/ }), +/* 95 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Map = __webpack_require__(16); + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var Initializable_1 = __webpack_require__(10); + +var CustomNode_1 = __webpack_require__(31); + +var ObfuscationEvent_1 = __webpack_require__(25); + +var AbstractCustomNodeGroup_1 = __webpack_require__(34); + +var NodeAppender_1 = __webpack_require__(23); + +var ConsoleOutputCustomNodeGroup = +/*#__PURE__*/ +function (_AbstractCustomNodeGr) { + _inherits(ConsoleOutputCustomNodeGroup, _AbstractCustomNodeGr); + + function ConsoleOutputCustomNodeGroup(customNodeFactory, identifierNamesGeneratorFactory, randomGenerator, options) { + var _this; + + _classCallCheck(this, ConsoleOutputCustomNodeGroup); + + _this = _possibleConstructorReturn(this, (ConsoleOutputCustomNodeGroup.__proto__ || _Object$getPrototypeOf(ConsoleOutputCustomNodeGroup)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); + _this.appendEvent = ObfuscationEvent_1.ObfuscationEvent.BeforeObfuscation; + _this.customNodeFactory = customNodeFactory; + return _this; + } + + _createClass(ConsoleOutputCustomNodeGroup, [{ + key: "appendCustomNodes", + value: function appendCustomNodes(blockScopeNode, stackTraceData) { + var randomStackTraceIndex = this.getRandomStackTraceIndex(stackTraceData.length); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.ConsoleOutputDisableExpressionNode, function (customNode) { + NodeAppender_1.NodeAppender.appendNodeToOptimalBlockScope(stackTraceData, blockScopeNode, customNode.getNode(), randomStackTraceIndex); + }); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode, function (customNode) { + var targetBlockScope; + + if (stackTraceData.length) { + targetBlockScope = NodeAppender_1.NodeAppender.getOptimalBlockScope(stackTraceData, randomStackTraceIndex, 1); + } else { + targetBlockScope = blockScopeNode; + } + + NodeAppender_1.NodeAppender.prependNode(targetBlockScope, customNode.getNode()); + }); + } + }, { + key: "initialize", + value: function initialize() { + this.customNodes = new _Map(); + + if (!this.options.disableConsoleOutput) { + return; + } + + var callsControllerFunctionName = this.identifierNamesGenerator.generate(); + var consoleOutputDisableExpressionNode = this.customNodeFactory(CustomNode_1.CustomNode.ConsoleOutputDisableExpressionNode); + var nodeCallsControllerFunctionNode = this.customNodeFactory(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode); + consoleOutputDisableExpressionNode.initialize(callsControllerFunctionName); + nodeCallsControllerFunctionNode.initialize(this.appendEvent, callsControllerFunctionName); + this.customNodes.set(CustomNode_1.CustomNode.ConsoleOutputDisableExpressionNode, consoleOutputDisableExpressionNode); + this.customNodes.set(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode, nodeCallsControllerFunctionNode); + } + }]); + + return ConsoleOutputCustomNodeGroup; +}(AbstractCustomNodeGroup_1.AbstractCustomNodeGroup); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", _Map)], ConsoleOutputCustomNodeGroup.prototype, "customNodes", void 0); + +ConsoleOutputCustomNodeGroup = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICustomNode)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Function, Object, Object])], ConsoleOutputCustomNodeGroup); +exports.ConsoleOutputCustomNodeGroup = ConsoleOutputCustomNodeGroup; + +/***/ }), +/* 96 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Map = __webpack_require__(16); + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var Initializable_1 = __webpack_require__(10); + +var CustomNode_1 = __webpack_require__(31); + +var ObfuscationEvent_1 = __webpack_require__(25); + +var AbstractCustomNodeGroup_1 = __webpack_require__(34); + +var NodeAppender_1 = __webpack_require__(23); + +var DebugProtectionCustomNodeGroup = +/*#__PURE__*/ +function (_AbstractCustomNodeGr) { + _inherits(DebugProtectionCustomNodeGroup, _AbstractCustomNodeGr); + + function DebugProtectionCustomNodeGroup(customNodeFactory, identifierNamesGeneratorFactory, randomGenerator, options) { + var _this; + + _classCallCheck(this, DebugProtectionCustomNodeGroup); + + _this = _possibleConstructorReturn(this, (DebugProtectionCustomNodeGroup.__proto__ || _Object$getPrototypeOf(DebugProtectionCustomNodeGroup)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); + _this.appendEvent = ObfuscationEvent_1.ObfuscationEvent.BeforeObfuscation; + _this.customNodeFactory = customNodeFactory; + return _this; + } + + _createClass(DebugProtectionCustomNodeGroup, [{ + key: "appendCustomNodes", + value: function appendCustomNodes(blockScopeNode, stackTraceData) { + var _this2 = this; + + var randomStackTraceIndex = this.getRandomStackTraceIndex(stackTraceData.length); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.DebugProtectionFunctionCallNode, function (customNode) { + NodeAppender_1.NodeAppender.appendNodeToOptimalBlockScope(stackTraceData, blockScopeNode, customNode.getNode(), randomStackTraceIndex); + }); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.DebugProtectionFunctionNode, function (customNode) { + NodeAppender_1.NodeAppender.appendNode(blockScopeNode, customNode.getNode()); + }); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.DebugProtectionFunctionIntervalNode, function (customNode) { + var programBodyLength = blockScopeNode.body.length; + + var randomIndex = _this2.randomGenerator.getRandomInteger(0, programBodyLength); + + NodeAppender_1.NodeAppender.insertNodeAtIndex(blockScopeNode, customNode.getNode(), randomIndex); + }); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode, function (customNode) { + var targetBlockScope; + + if (stackTraceData.length) { + targetBlockScope = NodeAppender_1.NodeAppender.getOptimalBlockScope(stackTraceData, randomStackTraceIndex, 1); + } else { + targetBlockScope = blockScopeNode; + } + + NodeAppender_1.NodeAppender.prependNode(targetBlockScope, customNode.getNode()); + }); + } + }, { + key: "initialize", + value: function initialize() { + this.customNodes = new _Map(); + + if (!this.options.debugProtection) { + return; + } + + var debugProtectionFunctionName = this.identifierNamesGenerator.generate(); + var callsControllerFunctionName = this.identifierNamesGenerator.generate(); + var debugProtectionFunctionNode = this.customNodeFactory(CustomNode_1.CustomNode.DebugProtectionFunctionNode); + var debugProtectionFunctionCallNode = this.customNodeFactory(CustomNode_1.CustomNode.DebugProtectionFunctionCallNode); + var debugProtectionFunctionIntervalNode = this.customNodeFactory(CustomNode_1.CustomNode.DebugProtectionFunctionIntervalNode); + var nodeCallsControllerFunctionNode = this.customNodeFactory(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode); + debugProtectionFunctionNode.initialize(debugProtectionFunctionName); + debugProtectionFunctionCallNode.initialize(debugProtectionFunctionName, callsControllerFunctionName); + debugProtectionFunctionIntervalNode.initialize(debugProtectionFunctionName); + nodeCallsControllerFunctionNode.initialize(this.appendEvent, callsControllerFunctionName); + this.customNodes.set(CustomNode_1.CustomNode.DebugProtectionFunctionNode, debugProtectionFunctionNode); + this.customNodes.set(CustomNode_1.CustomNode.DebugProtectionFunctionCallNode, debugProtectionFunctionCallNode); + + if (this.options.debugProtectionInterval) { + this.customNodes.set(CustomNode_1.CustomNode.DebugProtectionFunctionIntervalNode, debugProtectionFunctionIntervalNode); + } + + this.customNodes.set(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode, nodeCallsControllerFunctionNode); + } + }]); + + return DebugProtectionCustomNodeGroup; +}(AbstractCustomNodeGroup_1.AbstractCustomNodeGroup); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", _Map)], DebugProtectionCustomNodeGroup.prototype, "customNodes", void 0); + +DebugProtectionCustomNodeGroup = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICustomNode)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Function, Object, Object])], DebugProtectionCustomNodeGroup); +exports.DebugProtectionCustomNodeGroup = DebugProtectionCustomNodeGroup; + +/***/ }), +/* 97 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Map = __webpack_require__(16); + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var Initializable_1 = __webpack_require__(10); + +var CustomNode_1 = __webpack_require__(31); + +var ObfuscationEvent_1 = __webpack_require__(25); + +var AbstractCustomNodeGroup_1 = __webpack_require__(34); + +var NodeAppender_1 = __webpack_require__(23); + +var DomainLockCustomNodeGroup = +/*#__PURE__*/ +function (_AbstractCustomNodeGr) { + _inherits(DomainLockCustomNodeGroup, _AbstractCustomNodeGr); + + function DomainLockCustomNodeGroup(customNodeFactory, identifierNamesGeneratorFactory, randomGenerator, options) { + var _this; + + _classCallCheck(this, DomainLockCustomNodeGroup); + + _this = _possibleConstructorReturn(this, (DomainLockCustomNodeGroup.__proto__ || _Object$getPrototypeOf(DomainLockCustomNodeGroup)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); + _this.appendEvent = ObfuscationEvent_1.ObfuscationEvent.BeforeObfuscation; + _this.customNodeFactory = customNodeFactory; + return _this; + } + + _createClass(DomainLockCustomNodeGroup, [{ + key: "appendCustomNodes", + value: function appendCustomNodes(blockScopeNode, stackTraceData) { + var randomStackTraceIndex = this.getRandomStackTraceIndex(stackTraceData.length); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.DomainLockNode, function (customNode) { + NodeAppender_1.NodeAppender.appendNodeToOptimalBlockScope(stackTraceData, blockScopeNode, customNode.getNode(), randomStackTraceIndex); + }); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode, function (customNode) { + var targetBlockScope; + + if (stackTraceData.length) { + targetBlockScope = NodeAppender_1.NodeAppender.getOptimalBlockScope(stackTraceData, randomStackTraceIndex, 1); + } else { + targetBlockScope = blockScopeNode; + } + + NodeAppender_1.NodeAppender.prependNode(targetBlockScope, customNode.getNode()); + }); + } + }, { + key: "initialize", + value: function initialize() { + this.customNodes = new _Map(); + + if (!this.options.domainLock.length) { + return; + } + + var callsControllerFunctionName = this.identifierNamesGenerator.generate(); + var domainLockNode = this.customNodeFactory(CustomNode_1.CustomNode.DomainLockNode); + var nodeCallsControllerFunctionNode = this.customNodeFactory(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode); + domainLockNode.initialize(callsControllerFunctionName); + nodeCallsControllerFunctionNode.initialize(this.appendEvent, callsControllerFunctionName); + this.customNodes.set(CustomNode_1.CustomNode.DomainLockNode, domainLockNode); + this.customNodes.set(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode, nodeCallsControllerFunctionNode); + } + }]); + + return DomainLockCustomNodeGroup; +}(AbstractCustomNodeGroup_1.AbstractCustomNodeGroup); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", _Map)], DomainLockCustomNodeGroup.prototype, "customNodes", void 0); + +DomainLockCustomNodeGroup = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICustomNode)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Function, Object, Object])], DomainLockCustomNodeGroup); +exports.DomainLockCustomNodeGroup = DomainLockCustomNodeGroup; + +/***/ }), +/* 98 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Map = __webpack_require__(16); + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var Initializable_1 = __webpack_require__(10); + +var CustomNode_1 = __webpack_require__(31); + +var ObfuscationEvent_1 = __webpack_require__(25); + +var AbstractCustomNodeGroup_1 = __webpack_require__(34); + +var NodeAppender_1 = __webpack_require__(23); + +var SelfDefendingCustomNodeGroup = +/*#__PURE__*/ +function (_AbstractCustomNodeGr) { + _inherits(SelfDefendingCustomNodeGroup, _AbstractCustomNodeGr); + + function SelfDefendingCustomNodeGroup(customNodeFactory, identifierNamesGeneratorFactory, randomGenerator, options) { + var _this; + + _classCallCheck(this, SelfDefendingCustomNodeGroup); + + _this = _possibleConstructorReturn(this, (SelfDefendingCustomNodeGroup.__proto__ || _Object$getPrototypeOf(SelfDefendingCustomNodeGroup)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); + _this.appendEvent = ObfuscationEvent_1.ObfuscationEvent.AfterObfuscation; + _this.customNodeFactory = customNodeFactory; + return _this; + } + + _createClass(SelfDefendingCustomNodeGroup, [{ + key: "appendCustomNodes", + value: function appendCustomNodes(blockScopeNode, stackTraceData) { + var randomStackTraceIndex = this.getRandomStackTraceIndex(stackTraceData.length); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.SelfDefendingUnicodeNode, function (customNode) { + NodeAppender_1.NodeAppender.appendNodeToOptimalBlockScope(stackTraceData, blockScopeNode, customNode.getNode(), randomStackTraceIndex); + }); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode, function (customNode) { + var targetBlockScope; + + if (stackTraceData.length) { + targetBlockScope = NodeAppender_1.NodeAppender.getOptimalBlockScope(stackTraceData, randomStackTraceIndex, 1); + } else { + targetBlockScope = blockScopeNode; + } + + NodeAppender_1.NodeAppender.prependNode(targetBlockScope, customNode.getNode()); + }); + } + }, { + key: "initialize", + value: function initialize() { + this.customNodes = new _Map(); + + if (!this.options.selfDefending) { + return; + } + + var callsControllerFunctionName = this.identifierNamesGenerator.generate(); + var selfDefendingUnicodeNode = this.customNodeFactory(CustomNode_1.CustomNode.SelfDefendingUnicodeNode); + var nodeCallsControllerFunctionNode = this.customNodeFactory(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode); + selfDefendingUnicodeNode.initialize(callsControllerFunctionName); + nodeCallsControllerFunctionNode.initialize(this.appendEvent, callsControllerFunctionName); + this.customNodes.set(CustomNode_1.CustomNode.SelfDefendingUnicodeNode, selfDefendingUnicodeNode); + this.customNodes.set(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode, nodeCallsControllerFunctionNode); + } + }]); + + return SelfDefendingCustomNodeGroup; +}(AbstractCustomNodeGroup_1.AbstractCustomNodeGroup); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", _Map)], SelfDefendingCustomNodeGroup.prototype, "customNodes", void 0); + +SelfDefendingCustomNodeGroup = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICustomNode)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Function, Object, Object])], SelfDefendingCustomNodeGroup); +exports.SelfDefendingCustomNodeGroup = SelfDefendingCustomNodeGroup; + +/***/ }), +/* 99 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _slicedToArray = __webpack_require__(30); + +var _Map = __webpack_require__(16); + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var Initializable_1 = __webpack_require__(10); + +var CustomNode_1 = __webpack_require__(31); + +var ObfuscationEvent_1 = __webpack_require__(25); + +var AbstractCustomNodeGroup_1 = __webpack_require__(34); + +var NodeAppender_1 = __webpack_require__(23); + +var StringArrayCustomNodeGroup = +/*#__PURE__*/ +function (_AbstractCustomNodeGr) { + _inherits(StringArrayCustomNodeGroup, _AbstractCustomNodeGr); + + function StringArrayCustomNodeGroup(customNodeFactory, stringArrayStorage, identifierNamesGeneratorFactory, randomGenerator, options) { + var _this; + + _classCallCheck(this, StringArrayCustomNodeGroup); + + _this = _possibleConstructorReturn(this, (StringArrayCustomNodeGroup.__proto__ || _Object$getPrototypeOf(StringArrayCustomNodeGroup)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); + _this.appendEvent = ObfuscationEvent_1.ObfuscationEvent.AfterObfuscation; + _this.customNodeFactory = customNodeFactory; + _this.stringArrayStorage = stringArrayStorage; + return _this; + } + + _createClass(StringArrayCustomNodeGroup, [{ + key: "appendCustomNodes", + value: function appendCustomNodes(blockScopeNode, stackTraceData) { + if (!this.stringArrayStorage.getLength()) { + return; + } + + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.StringArrayNode, function (customNode) { + NodeAppender_1.NodeAppender.prependNode(blockScopeNode, customNode.getNode()); + }); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.StringArrayCallsWrapper, function (customNode) { + NodeAppender_1.NodeAppender.insertNodeAtIndex(blockScopeNode, customNode.getNode(), 1); + }); + this.appendCustomNodeIfExist(CustomNode_1.CustomNode.StringArrayRotateFunctionNode, function (customNode) { + NodeAppender_1.NodeAppender.insertNodeAtIndex(blockScopeNode, customNode.getNode(), 1); + }); + } + }, { + key: "initialize", + value: function initialize() { + this.customNodes = new _Map(); + + if (!this.options.stringArray) { + return; + } + + var stringArrayNode = this.customNodeFactory(CustomNode_1.CustomNode.StringArrayNode); + var stringArrayCallsWrapper = this.customNodeFactory(CustomNode_1.CustomNode.StringArrayCallsWrapper); + var stringArrayRotateFunctionNode = this.customNodeFactory(CustomNode_1.CustomNode.StringArrayRotateFunctionNode); + var stringArrayStorageId = this.stringArrayStorage.getStorageId(); + + var _stringArrayStorageId = stringArrayStorageId.split('|'), + _stringArrayStorageId2 = _slicedToArray(_stringArrayStorageId, 2), + stringArrayName = _stringArrayStorageId2[0], + stringArrayCallsWrapperName = _stringArrayStorageId2[1]; + + var stringArrayRotateValue; + + if (this.options.rotateStringArray) { + stringArrayRotateValue = this.randomGenerator.getRandomInteger(100, 500); + } else { + stringArrayRotateValue = 0; + } + + stringArrayNode.initialize(this.stringArrayStorage, stringArrayName, stringArrayRotateValue); + stringArrayCallsWrapper.initialize(stringArrayName, stringArrayCallsWrapperName); + stringArrayRotateFunctionNode.initialize(stringArrayName, stringArrayRotateValue); + this.customNodes.set(CustomNode_1.CustomNode.StringArrayNode, stringArrayNode); + this.customNodes.set(CustomNode_1.CustomNode.StringArrayCallsWrapper, stringArrayCallsWrapper); + + if (this.options.rotateStringArray) { + this.customNodes.set(CustomNode_1.CustomNode.StringArrayRotateFunctionNode, stringArrayRotateFunctionNode); + } + } + }]); + + return StringArrayCustomNodeGroup; +}(AbstractCustomNodeGroup_1.AbstractCustomNodeGroup); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", _Map)], StringArrayCustomNodeGroup.prototype, "customNodes", void 0); + +StringArrayCustomNodeGroup = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICustomNode)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.TStringArrayStorage)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(4, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Function, Object, Object])], StringArrayCustomNodeGroup); +exports.StringArrayCustomNodeGroup = StringArrayCustomNodeGroup; + +/***/ }), +/* 100 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var Initializable_1 = __webpack_require__(10); + +var AbstractCustomNode_1 = __webpack_require__(14); + +var Nodes_1 = __webpack_require__(15); + +var NodeUtils_1 = __webpack_require__(9); + +var BinaryExpressionFunctionNode = +/*#__PURE__*/ +function (_AbstractCustomNode_) { + _inherits(BinaryExpressionFunctionNode, _AbstractCustomNode_); + + function BinaryExpressionFunctionNode(identifierNamesGeneratorFactory, randomGenerator, options) { + _classCallCheck(this, BinaryExpressionFunctionNode); + + return _possibleConstructorReturn(this, (BinaryExpressionFunctionNode.__proto__ || _Object$getPrototypeOf(BinaryExpressionFunctionNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); + } + + _createClass(BinaryExpressionFunctionNode, [{ + key: "initialize", + value: function initialize(operator) { + this.operator = operator; + } + }, { + key: "getNodeStructure", + value: function getNodeStructure() { + var structure = Nodes_1.Nodes.getExpressionStatementNode(Nodes_1.Nodes.getFunctionExpressionNode([Nodes_1.Nodes.getIdentifierNode('x'), Nodes_1.Nodes.getIdentifierNode('y')], Nodes_1.Nodes.getBlockStatementNode([Nodes_1.Nodes.getReturnStatementNode(Nodes_1.Nodes.getBinaryExpressionNode(this.operator, Nodes_1.Nodes.getIdentifierNode('x'), Nodes_1.Nodes.getIdentifierNode('y')))]))); + NodeUtils_1.NodeUtils.parentize(structure); + return [structure]; + } + }]); + + return BinaryExpressionFunctionNode; +}(AbstractCustomNode_1.AbstractCustomNode); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], BinaryExpressionFunctionNode.prototype, "operator", void 0); + +BinaryExpressionFunctionNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], BinaryExpressionFunctionNode); +exports.BinaryExpressionFunctionNode = BinaryExpressionFunctionNode; + +/***/ }), +/* 101 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function GlobalVariableTemplate1() { + return "\n var that;\n \n try {\n var getGlobal = Function('return (function() ' + '{}.constructor(\"return this\")( )' + ');');\n \n that = getGlobal();\n } catch (e) {\n that = window;\n }\n "; +} + +exports.GlobalVariableTemplate1 = GlobalVariableTemplate1; + +/***/ }), +/* 102 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function GlobalVariableTemplate2() { + return "\n var getGlobal = function () {\n var globalObject;\n \n try {\n globalObject = Function('return (function() ' + '{}.constructor(\"return this\")( )' + ');')();\n } catch (e) {\n globalObject = window;\n }\n \n return globalObject;\n };\n var that = getGlobal();\n "; +} + +exports.GlobalVariableTemplate2 = GlobalVariableTemplate2; + +/***/ }), +/* 103 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var Initializable_1 = __webpack_require__(10); + +var AbstractCustomNode_1 = __webpack_require__(14); + +var NodeGuards_1 = __webpack_require__(8); + +var Nodes_1 = __webpack_require__(15); + +var NodeUtils_1 = __webpack_require__(9); + +var BlockStatementControlFlowFlatteningNode = +/*#__PURE__*/ +function (_AbstractCustomNode_) { + _inherits(BlockStatementControlFlowFlatteningNode, _AbstractCustomNode_); + + function BlockStatementControlFlowFlatteningNode(identifierNamesGeneratorFactory, randomGenerator, options) { + _classCallCheck(this, BlockStatementControlFlowFlatteningNode); + + return _possibleConstructorReturn(this, (BlockStatementControlFlowFlatteningNode.__proto__ || _Object$getPrototypeOf(BlockStatementControlFlowFlatteningNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); + } + + _createClass(BlockStatementControlFlowFlatteningNode, [{ + key: "initialize", + value: function initialize(blockStatementBody, shuffledKeys, originalKeysIndexesInShuffledArray) { + this.blockStatementBody = blockStatementBody; + this.shuffledKeys = shuffledKeys; + this.originalKeysIndexesInShuffledArray = originalKeysIndexesInShuffledArray; + } + }, { + key: "getNodeStructure", + value: function getNodeStructure() { + var _this = this; + + var controllerIdentifierName = this.randomGenerator.getRandomString(6); + var indexIdentifierName = this.randomGenerator.getRandomString(6); + var structure = Nodes_1.Nodes.getBlockStatementNode([Nodes_1.Nodes.getVariableDeclarationNode([Nodes_1.Nodes.getVariableDeclaratorNode(Nodes_1.Nodes.getIdentifierNode(controllerIdentifierName), Nodes_1.Nodes.getCallExpressionNode(Nodes_1.Nodes.getMemberExpressionNode(Nodes_1.Nodes.getLiteralNode(this.originalKeysIndexesInShuffledArray.join('|')), Nodes_1.Nodes.getIdentifierNode('split')), [Nodes_1.Nodes.getLiteralNode('|')])), Nodes_1.Nodes.getVariableDeclaratorNode(Nodes_1.Nodes.getIdentifierNode(indexIdentifierName), Nodes_1.Nodes.getLiteralNode(0))]), Nodes_1.Nodes.getWhileStatementNode(Nodes_1.Nodes.getLiteralNode(true), Nodes_1.Nodes.getBlockStatementNode([Nodes_1.Nodes.getSwitchStatementNode(Nodes_1.Nodes.getMemberExpressionNode(Nodes_1.Nodes.getIdentifierNode(controllerIdentifierName), Nodes_1.Nodes.getUpdateExpressionNode('++', Nodes_1.Nodes.getIdentifierNode(indexIdentifierName)), true), this.shuffledKeys.map(function (key, index) { + var statement = _this.blockStatementBody[key]; + var consequent = [statement]; + + if (!NodeGuards_1.NodeGuards.isReturnStatementNode(statement)) { + consequent.push(Nodes_1.Nodes.getContinueStatement()); + } + + return Nodes_1.Nodes.getSwitchCaseNode(Nodes_1.Nodes.getLiteralNode(String(index)), consequent); + })), Nodes_1.Nodes.getBreakStatement()]))]); + NodeUtils_1.NodeUtils.parentize(structure); + return [structure]; + } + }]); + + return BlockStatementControlFlowFlatteningNode; +}(AbstractCustomNode_1.AbstractCustomNode); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Array)], BlockStatementControlFlowFlatteningNode.prototype, "blockStatementBody", void 0); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Array)], BlockStatementControlFlowFlatteningNode.prototype, "originalKeysIndexesInShuffledArray", void 0); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Array)], BlockStatementControlFlowFlatteningNode.prototype, "shuffledKeys", void 0); + +BlockStatementControlFlowFlatteningNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], BlockStatementControlFlowFlatteningNode); +exports.BlockStatementControlFlowFlatteningNode = BlockStatementControlFlowFlatteningNode; + +/***/ }), +/* 104 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _slicedToArray = __webpack_require__(30); + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var Initializable_1 = __webpack_require__(10); + +var AbstractCustomNode_1 = __webpack_require__(14); + +var Nodes_1 = __webpack_require__(15); + +var NodeUtils_1 = __webpack_require__(9); + +var BlockStatementDeadCodeInjectionNode = +/*#__PURE__*/ +function (_AbstractCustomNode_) { + _inherits(BlockStatementDeadCodeInjectionNode, _AbstractCustomNode_); + + function BlockStatementDeadCodeInjectionNode(identifierNamesGeneratorFactory, randomGenerator, options) { + _classCallCheck(this, BlockStatementDeadCodeInjectionNode); + + return _possibleConstructorReturn(this, (BlockStatementDeadCodeInjectionNode.__proto__ || _Object$getPrototypeOf(BlockStatementDeadCodeInjectionNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); + } + + _createClass(BlockStatementDeadCodeInjectionNode, [{ + key: "initialize", + value: function initialize(blockStatementNode, deadCodeInjectionRootAstHostNode) { + this.blockStatementNode = blockStatementNode; + this.deadCodeInjectionRootAstHostNode = deadCodeInjectionRootAstHostNode; + } + }, { + key: "getNodeStructure", + value: function getNodeStructure() { + var random1 = this.randomGenerator.getMathRandom() > 0.5; + var random2 = this.randomGenerator.getMathRandom() > 0.5; + var operator = random1 ? '===' : '!=='; + var leftString = this.randomGenerator.getRandomString(5); + var rightString = random2 ? leftString : this.randomGenerator.getRandomString(5); + + var _ref = random1 === random2 ? [this.blockStatementNode, this.deadCodeInjectionRootAstHostNode] : [this.deadCodeInjectionRootAstHostNode, this.blockStatementNode], + _ref2 = _slicedToArray(_ref, 2), + consequent = _ref2[0], + alternate = _ref2[1]; + + var structure = Nodes_1.Nodes.getBlockStatementNode([Nodes_1.Nodes.getIfStatementNode(Nodes_1.Nodes.getBinaryExpressionNode(operator, Nodes_1.Nodes.getLiteralNode(leftString), Nodes_1.Nodes.getLiteralNode(rightString)), consequent, alternate)]); + NodeUtils_1.NodeUtils.parentize(structure); + return [structure]; + } + }]); + + return BlockStatementDeadCodeInjectionNode; +}(AbstractCustomNode_1.AbstractCustomNode); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Object)], BlockStatementDeadCodeInjectionNode.prototype, "blockStatementNode", void 0); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Object)], BlockStatementDeadCodeInjectionNode.prototype, "deadCodeInjectionRootAstHostNode", void 0); + +BlockStatementDeadCodeInjectionNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], BlockStatementDeadCodeInjectionNode); +exports.BlockStatementDeadCodeInjectionNode = BlockStatementDeadCodeInjectionNode; + +/***/ }), +/* 105 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _toConsumableArray = __webpack_require__(24); + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var Initializable_1 = __webpack_require__(10); + +var AbstractCustomNode_1 = __webpack_require__(14); + +var Nodes_1 = __webpack_require__(15); + +var NodeUtils_1 = __webpack_require__(9); + +var CallExpressionControlFlowStorageCallNode = +/*#__PURE__*/ +function (_AbstractCustomNode_) { + _inherits(CallExpressionControlFlowStorageCallNode, _AbstractCustomNode_); + + function CallExpressionControlFlowStorageCallNode(identifierNamesGeneratorFactory, randomGenerator, options) { + _classCallCheck(this, CallExpressionControlFlowStorageCallNode); + + return _possibleConstructorReturn(this, (CallExpressionControlFlowStorageCallNode.__proto__ || _Object$getPrototypeOf(CallExpressionControlFlowStorageCallNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); + } + + _createClass(CallExpressionControlFlowStorageCallNode, [{ + key: "initialize", + value: function initialize(controlFlowStorageName, controlFlowStorageKey, callee, expressionArguments) { + this.controlFlowStorageName = controlFlowStorageName; + this.controlFlowStorageKey = controlFlowStorageKey; + this.callee = callee; + this.expressionArguments = expressionArguments; + } + }, { + key: "getNodeStructure", + value: function getNodeStructure() { + var structure = Nodes_1.Nodes.getExpressionStatementNode(Nodes_1.Nodes.getCallExpressionNode(Nodes_1.Nodes.getMemberExpressionNode(Nodes_1.Nodes.getIdentifierNode(this.controlFlowStorageName), Nodes_1.Nodes.getIdentifierNode(this.controlFlowStorageKey)), [this.callee].concat(_toConsumableArray(this.expressionArguments)))); + NodeUtils_1.NodeUtils.parentize(structure); + return [structure]; + } + }]); + + return CallExpressionControlFlowStorageCallNode; +}(AbstractCustomNode_1.AbstractCustomNode); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Object)], CallExpressionControlFlowStorageCallNode.prototype, "callee", void 0); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], CallExpressionControlFlowStorageCallNode.prototype, "controlFlowStorageKey", void 0); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], CallExpressionControlFlowStorageCallNode.prototype, "controlFlowStorageName", void 0); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Array)], CallExpressionControlFlowStorageCallNode.prototype, "expressionArguments", void 0); + +CallExpressionControlFlowStorageCallNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], CallExpressionControlFlowStorageCallNode); +exports.CallExpressionControlFlowStorageCallNode = CallExpressionControlFlowStorageCallNode; + +/***/ }), +/* 106 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var Initializable_1 = __webpack_require__(10); + +var AbstractCustomNode_1 = __webpack_require__(14); + +var Nodes_1 = __webpack_require__(15); + +var NodeUtils_1 = __webpack_require__(9); + +var CallExpressionFunctionNode = +/*#__PURE__*/ +function (_AbstractCustomNode_) { + _inherits(CallExpressionFunctionNode, _AbstractCustomNode_); + + function CallExpressionFunctionNode(identifierNamesGeneratorFactory, randomGenerator, options) { + _classCallCheck(this, CallExpressionFunctionNode); + + return _possibleConstructorReturn(this, (CallExpressionFunctionNode.__proto__ || _Object$getPrototypeOf(CallExpressionFunctionNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); + } + + _createClass(CallExpressionFunctionNode, [{ + key: "initialize", + value: function initialize(expressionArguments) { + this.expressionArguments = expressionArguments; + } + }, { + key: "getNodeStructure", + value: function getNodeStructure() { + var calleeIdentifier = Nodes_1.Nodes.getIdentifierNode('callee'); + var params = []; + var argumentsLength = this.expressionArguments.length; + + for (var i = 0; i < argumentsLength; i++) { + params.push(Nodes_1.Nodes.getIdentifierNode("param".concat(i + 1))); + } + + var structure = Nodes_1.Nodes.getExpressionStatementNode(Nodes_1.Nodes.getFunctionExpressionNode([calleeIdentifier].concat(params), Nodes_1.Nodes.getBlockStatementNode([Nodes_1.Nodes.getReturnStatementNode(Nodes_1.Nodes.getCallExpressionNode(calleeIdentifier, params))]))); + NodeUtils_1.NodeUtils.parentize(structure); + return [structure]; + } + }]); + + return CallExpressionFunctionNode; +}(AbstractCustomNode_1.AbstractCustomNode); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Array)], CallExpressionFunctionNode.prototype, "expressionArguments", void 0); + +CallExpressionFunctionNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], CallExpressionFunctionNode); +exports.CallExpressionFunctionNode = CallExpressionFunctionNode; + +/***/ }), +/* 107 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _slicedToArray = __webpack_require__(30); + +var _Array$from = __webpack_require__(56); + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var Initializable_1 = __webpack_require__(10); + +var AbstractCustomNode_1 = __webpack_require__(14); + +var NodeGuards_1 = __webpack_require__(8); + +var Nodes_1 = __webpack_require__(15); + +var NodeUtils_1 = __webpack_require__(9); + +var ControlFlowStorageNode = +/*#__PURE__*/ +function (_AbstractCustomNode_) { + _inherits(ControlFlowStorageNode, _AbstractCustomNode_); + + function ControlFlowStorageNode(identifierNamesGeneratorFactory, randomGenerator, options) { + _classCallCheck(this, ControlFlowStorageNode); + + return _possibleConstructorReturn(this, (ControlFlowStorageNode.__proto__ || _Object$getPrototypeOf(ControlFlowStorageNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); + } + + _createClass(ControlFlowStorageNode, [{ + key: "initialize", + value: function initialize(controlFlowStorage) { + this.controlFlowStorage = controlFlowStorage; + } + }, { + key: "getNodeStructure", + value: function getNodeStructure() { + var propertyNodes = _Array$from(this.controlFlowStorage.getStorage()).map(function (_ref) { + var _ref2 = _slicedToArray(_ref, 2), + key = _ref2[0], + value = _ref2[1]; + + var node = value.getNode()[0]; + + if (!NodeGuards_1.NodeGuards.isExpressionStatementNode(node)) { + throw new Error('Function node for control flow storage object should be passed inside the `ExpressionStatement` node!'); + } + + return Nodes_1.Nodes.getPropertyNode(Nodes_1.Nodes.getIdentifierNode(key), node.expression); + }); + + var structure = Nodes_1.Nodes.getVariableDeclarationNode([Nodes_1.Nodes.getVariableDeclaratorNode(Nodes_1.Nodes.getIdentifierNode(this.controlFlowStorage.getStorageId()), Nodes_1.Nodes.getObjectExpressionNode(propertyNodes))]); + structure = NodeUtils_1.NodeUtils.parentize(structure); + return [structure]; + } + }]); + + return ControlFlowStorageNode; +}(AbstractCustomNode_1.AbstractCustomNode); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Object)], ControlFlowStorageNode.prototype, "controlFlowStorage", void 0); + +ControlFlowStorageNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], ControlFlowStorageNode); +exports.ControlFlowStorageNode = ControlFlowStorageNode; + +/***/ }), +/* 108 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var string_template_1 = tslib_1.__importDefault(__webpack_require__(19)); + +var ObfuscationTarget_1 = __webpack_require__(21); + +var ConsoleOutputDisableExpressionTemplate_1 = __webpack_require__(109); + +var GlobalVariableNoEvalTemplate_1 = __webpack_require__(44); + +var Initializable_1 = __webpack_require__(10); + +var AbstractCustomNode_1 = __webpack_require__(14); + +var NodeUtils_1 = __webpack_require__(9); + +var ConsoleOutputDisableExpressionNode = +/*#__PURE__*/ +function (_AbstractCustomNode_) { + _inherits(ConsoleOutputDisableExpressionNode, _AbstractCustomNode_); + + function ConsoleOutputDisableExpressionNode(identifierNamesGeneratorFactory, randomGenerator, options) { + _classCallCheck(this, ConsoleOutputDisableExpressionNode); + + return _possibleConstructorReturn(this, (ConsoleOutputDisableExpressionNode.__proto__ || _Object$getPrototypeOf(ConsoleOutputDisableExpressionNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); + } + + _createClass(ConsoleOutputDisableExpressionNode, [{ + key: "initialize", + value: function initialize(callsControllerFunctionName) { + this.callsControllerFunctionName = callsControllerFunctionName; + } + }, { + key: "getNodeStructure", + value: function getNodeStructure() { + return NodeUtils_1.NodeUtils.convertCodeToStructure(this.getTemplate()); + } + }, { + key: "getTemplate", + value: function getTemplate() { + var globalVariableTemplate = this.options.target !== ObfuscationTarget_1.ObfuscationTarget.Extension ? this.getGlobalVariableTemplate() : GlobalVariableNoEvalTemplate_1.GlobalVariableNoEvalTemplate(); + return string_template_1.default(ConsoleOutputDisableExpressionTemplate_1.ConsoleOutputDisableExpressionTemplate(), { + consoleLogDisableFunctionName: this.identifierNamesGenerator.generate(), + globalVariableTemplate: globalVariableTemplate, + singleNodeCallControllerFunctionName: this.callsControllerFunctionName + }); + } + }]); + + return ConsoleOutputDisableExpressionNode; +}(AbstractCustomNode_1.AbstractCustomNode); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], ConsoleOutputDisableExpressionNode.prototype, "callsControllerFunctionName", void 0); + +ConsoleOutputDisableExpressionNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], ConsoleOutputDisableExpressionNode); +exports.ConsoleOutputDisableExpressionNode = ConsoleOutputDisableExpressionNode; + +/***/ }), +/* 109 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function ConsoleOutputDisableExpressionTemplate() { + return "\n var {consoleLogDisableFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n var func = function () {};\n \n {globalVariableTemplate}\n \n if (!that.console) {\n that.console = (function (func){\n var c = {};\n \n c.log = func;\n c.warn = func;\n c.debug = func;\n c.info = func;\n c.error = func;\n c.exception = func;\n c.trace = func;\n \n return c;\n })(func);\n } else {\n that.console.log = func;\n that.console.warn = func;\n that.console.debug = func;\n that.console.info = func;\n that.console.error = func;\n that.console.exception = func;\n that.console.trace = func;\n }\n });\n \n {consoleLogDisableFunctionName}();\n "; +} + +exports.ConsoleOutputDisableExpressionTemplate = ConsoleOutputDisableExpressionTemplate; + +/***/ }), +/* 110 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var string_template_1 = tslib_1.__importDefault(__webpack_require__(19)); + +var Initializable_1 = __webpack_require__(10); + +var DebugProtectionFunctionCallTemplate_1 = __webpack_require__(111); + +var AbstractCustomNode_1 = __webpack_require__(14); + +var NodeUtils_1 = __webpack_require__(9); + +var DebugProtectionFunctionCallNode = +/*#__PURE__*/ +function (_AbstractCustomNode_) { + _inherits(DebugProtectionFunctionCallNode, _AbstractCustomNode_); + + function DebugProtectionFunctionCallNode(identifierNamesGeneratorFactory, randomGenerator, options) { + _classCallCheck(this, DebugProtectionFunctionCallNode); + + return _possibleConstructorReturn(this, (DebugProtectionFunctionCallNode.__proto__ || _Object$getPrototypeOf(DebugProtectionFunctionCallNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); + } + + _createClass(DebugProtectionFunctionCallNode, [{ + key: "initialize", + value: function initialize(debugProtectionFunctionName, callsControllerFunctionName) { + this.debugProtectionFunctionName = debugProtectionFunctionName; + this.callsControllerFunctionName = callsControllerFunctionName; + } + }, { + key: "getNodeStructure", + value: function getNodeStructure() { + return NodeUtils_1.NodeUtils.convertCodeToStructure(this.getTemplate()); + } + }, { + key: "getTemplate", + value: function getTemplate() { + return string_template_1.default(DebugProtectionFunctionCallTemplate_1.DebugProtectionFunctionCallTemplate(), { + debugProtectionFunctionName: this.debugProtectionFunctionName, + singleNodeCallControllerFunctionName: this.callsControllerFunctionName + }); + } + }]); + + return DebugProtectionFunctionCallNode; +}(AbstractCustomNode_1.AbstractCustomNode); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], DebugProtectionFunctionCallNode.prototype, "callsControllerFunctionName", void 0); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], DebugProtectionFunctionCallNode.prototype, "debugProtectionFunctionName", void 0); + +DebugProtectionFunctionCallNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], DebugProtectionFunctionCallNode); +exports.DebugProtectionFunctionCallNode = DebugProtectionFunctionCallNode; + +/***/ }), +/* 111 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function DebugProtectionFunctionCallTemplate() { + return "\n (function () {\n {singleNodeCallControllerFunctionName}(this, function () {\n var regExp1 = new RegExp('function *\\\\( *\\\\)');\n var regExp2 = new RegExp('\\\\+\\\\+ *\\(?:_0x(?:[a-f0-9]){4,6}|(?:\\\\b|\\\\d)[a-z0-9]{1,4}(?:\\\\b|\\\\d)\\)', 'i');\n \n var result = {debugProtectionFunctionName}('init');\n \n if (!regExp1.test(result + 'chain') || !regExp2.test(result + 'input')) {\n result('0');\n } else {\n {debugProtectionFunctionName}();\n }\n })();\n })();\n "; +} + +exports.DebugProtectionFunctionCallTemplate = DebugProtectionFunctionCallTemplate; + +/***/ }), +/* 112 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var string_template_1 = tslib_1.__importDefault(__webpack_require__(19)); + +var Initializable_1 = __webpack_require__(10); + +var DebugProtectionFunctionIntervalTemplate_1 = __webpack_require__(113); + +var AbstractCustomNode_1 = __webpack_require__(14); + +var NodeUtils_1 = __webpack_require__(9); + +var DebugProtectionFunctionIntervalNode = +/*#__PURE__*/ +function (_AbstractCustomNode_) { + _inherits(DebugProtectionFunctionIntervalNode, _AbstractCustomNode_); + + function DebugProtectionFunctionIntervalNode(identifierNamesGeneratorFactory, randomGenerator, options) { + _classCallCheck(this, DebugProtectionFunctionIntervalNode); + + return _possibleConstructorReturn(this, (DebugProtectionFunctionIntervalNode.__proto__ || _Object$getPrototypeOf(DebugProtectionFunctionIntervalNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); + } + + _createClass(DebugProtectionFunctionIntervalNode, [{ + key: "initialize", + value: function initialize(debugProtectionFunctionName) { + this.debugProtectionFunctionName = debugProtectionFunctionName; + } + }, { + key: "getNodeStructure", + value: function getNodeStructure() { + return NodeUtils_1.NodeUtils.convertCodeToStructure(this.getTemplate()); + } + }, { + key: "getTemplate", + value: function getTemplate() { + return string_template_1.default(DebugProtectionFunctionIntervalTemplate_1.DebugProtectionFunctionIntervalTemplate(), { + debugProtectionFunctionName: this.debugProtectionFunctionName + }); + } + }]); + + return DebugProtectionFunctionIntervalNode; +}(AbstractCustomNode_1.AbstractCustomNode); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], DebugProtectionFunctionIntervalNode.prototype, "debugProtectionFunctionName", void 0); + +DebugProtectionFunctionIntervalNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], DebugProtectionFunctionIntervalNode); +exports.DebugProtectionFunctionIntervalNode = DebugProtectionFunctionIntervalNode; + +/***/ }), +/* 113 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function DebugProtectionFunctionIntervalTemplate() { + return "\n setInterval(function () {\n {debugProtectionFunctionName}();\n }, 4000);\n "; +} + +exports.DebugProtectionFunctionIntervalTemplate = DebugProtectionFunctionIntervalTemplate; + +/***/ }), +/* 114 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var string_template_1 = tslib_1.__importDefault(__webpack_require__(19)); + +var ObfuscationTarget_1 = __webpack_require__(21); + +var Initializable_1 = __webpack_require__(10); + +var DebuggerTemplate_1 = __webpack_require__(115); + +var DebuggerTemplateNoEval_1 = __webpack_require__(116); + +var DebugProtectionFunctionTemplate_1 = __webpack_require__(117); + +var AbstractCustomNode_1 = __webpack_require__(14); + +var NodeUtils_1 = __webpack_require__(9); + +var DebugProtectionFunctionNode = +/*#__PURE__*/ +function (_AbstractCustomNode_) { + _inherits(DebugProtectionFunctionNode, _AbstractCustomNode_); + + function DebugProtectionFunctionNode(identifierNamesGeneratorFactory, randomGenerator, options) { + _classCallCheck(this, DebugProtectionFunctionNode); + + return _possibleConstructorReturn(this, (DebugProtectionFunctionNode.__proto__ || _Object$getPrototypeOf(DebugProtectionFunctionNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); + } + + _createClass(DebugProtectionFunctionNode, [{ + key: "initialize", + value: function initialize(debugProtectionFunctionName) { + this.debugProtectionFunctionName = debugProtectionFunctionName; + } + }, { + key: "getNodeStructure", + value: function getNodeStructure() { + return NodeUtils_1.NodeUtils.convertCodeToStructure(this.getTemplate()); + } + }, { + key: "getTemplate", + value: function getTemplate() { + var debuggerTemplate = this.options.target !== ObfuscationTarget_1.ObfuscationTarget.Extension ? DebuggerTemplate_1.DebuggerTemplate() : DebuggerTemplateNoEval_1.DebuggerTemplateNoEval(); + return string_template_1.default(DebugProtectionFunctionTemplate_1.DebugProtectionFunctionTemplate(), { + debuggerTemplate: debuggerTemplate, + debugProtectionFunctionName: this.debugProtectionFunctionName + }); + } + }]); + + return DebugProtectionFunctionNode; +}(AbstractCustomNode_1.AbstractCustomNode); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], DebugProtectionFunctionNode.prototype, "debugProtectionFunctionName", void 0); + +DebugProtectionFunctionNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], DebugProtectionFunctionNode); +exports.DebugProtectionFunctionNode = DebugProtectionFunctionNode; + +/***/ }), +/* 115 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function DebuggerTemplate() { + return "\n if (typeof counter === 'string') {\n return (function (arg) {}.constructor('while (true) {}').apply('counter'));\n } else {\n if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) {\n (function () {return true;}.constructor('debu' + 'gger').call('action'));\n } else {\n (function () {return false;}.constructor('debu' + 'gger').apply('stateObject'));\n }\n \n }\n "; +} + +exports.DebuggerTemplate = DebuggerTemplate; + +/***/ }), +/* 116 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function DebuggerTemplateNoEval() { + return "\n if (typeof counter === 'string') {\n var func = function () {\n while (true) {}\n };\n \n return func();\n } else {\n if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) {\n debugger;\n } else {\n debugger;\n }\n \n }\n "; +} + +exports.DebuggerTemplateNoEval = DebuggerTemplateNoEval; + +/***/ }), +/* 117 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function DebugProtectionFunctionTemplate() { + return "\n function {debugProtectionFunctionName} (ret) {\n function debuggerProtection (counter) {\n \n {debuggerTemplate}\n \n debuggerProtection(++counter);\n }\n \n try {\n if (ret) {\n return debuggerProtection;\n } else {\n debuggerProtection(0);\n }\n } catch (y) {}\n }\n "; +} + +exports.DebugProtectionFunctionTemplate = DebugProtectionFunctionTemplate; + +/***/ }), +/* 118 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _slicedToArray = __webpack_require__(30); + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var string_template_1 = tslib_1.__importDefault(__webpack_require__(19)); + +var ObfuscationTarget_1 = __webpack_require__(21); + +var Initializable_1 = __webpack_require__(10); + +var DomainLockNodeTemplate_1 = __webpack_require__(119); + +var GlobalVariableNoEvalTemplate_1 = __webpack_require__(44); + +var AbstractCustomNode_1 = __webpack_require__(14); + +var NodeUtils_1 = __webpack_require__(9); + +var DomainLockNode = +/*#__PURE__*/ +function (_AbstractCustomNode_) { + _inherits(DomainLockNode, _AbstractCustomNode_); + + function DomainLockNode(identifierNamesGeneratorFactory, randomGenerator, cryptUtils, options) { + var _this; + + _classCallCheck(this, DomainLockNode); + + _this = _possibleConstructorReturn(this, (DomainLockNode.__proto__ || _Object$getPrototypeOf(DomainLockNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); + _this.cryptUtils = cryptUtils; + return _this; + } + + _createClass(DomainLockNode, [{ + key: "initialize", + value: function initialize(callsControllerFunctionName) { + this.callsControllerFunctionName = callsControllerFunctionName; + } + }, { + key: "getNodeStructure", + value: function getNodeStructure() { + return NodeUtils_1.NodeUtils.convertCodeToStructure(this.getTemplate()); + } + }, { + key: "getTemplate", + value: function getTemplate() { + var domainsString = this.options.domainLock.join(';'); + + var _cryptUtils$hideStrin = this.cryptUtils.hideString(domainsString, domainsString.length * 3), + _cryptUtils$hideStrin2 = _slicedToArray(_cryptUtils$hideStrin, 2), + hiddenDomainsString = _cryptUtils$hideStrin2[0], + diff = _cryptUtils$hideStrin2[1]; + + var globalVariableTemplate = this.options.target !== ObfuscationTarget_1.ObfuscationTarget.Extension ? this.getGlobalVariableTemplate() : GlobalVariableNoEvalTemplate_1.GlobalVariableNoEvalTemplate(); + return string_template_1.default(DomainLockNodeTemplate_1.DomainLockNodeTemplate(), { + domainLockFunctionName: this.identifierNamesGenerator.generate(), + diff: diff, + domains: hiddenDomainsString, + globalVariableTemplate: globalVariableTemplate, + singleNodeCallControllerFunctionName: this.callsControllerFunctionName + }); + } + }]); + + return DomainLockNode; +}(AbstractCustomNode_1.AbstractCustomNode); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], DomainLockNode.prototype, "callsControllerFunctionName", void 0); + +DomainLockNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICryptUtils)), tslib_1.__param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object, Object])], DomainLockNode); +exports.DomainLockNode = DomainLockNode; + +/***/ }), +/* 119 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function DomainLockNodeTemplate() { + return "\n var {domainLockFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n \n {globalVariableTemplate}\n \n var func = function () {\n return {\n key: 'item',\n value: 'attribute',\n getAttribute: function () {\n for (var i = 0; i < 1000; i--) {\n var isPositive = i > 0;\n \n switch (isPositive) {\n case true:\n return this.item + '_' + this.value + '_' + i;\n default:\n this.item + '_' + this.value;\n }\n }\n }()\n };\n };\n \n var regExp = new RegExp(\"[{diff}]\", \"g\");\n var domains = \"{domains}\".replace(regExp, \"\").split(\";\");\n var document;\n var domain;\n \n for (var d in that) {\n if (d.length == 8 && d.charCodeAt(7) == 116 && d.charCodeAt(5) == 101 && d.charCodeAt(3) == 117 && d.charCodeAt(0) == 100) {\n document = d;\n \n break;\n }\n }\n\n for (var d1 in that[document]) {\n if (d1.length == 6 && d1.charCodeAt(5) == 110 && d1.charCodeAt(0) == 100) {\n domain = d1;\n \n break;\n }\n }\n \n if ((!document && !domain) || (!that[document] && !that[document][domain])) {\n return;\n }\n \n var currentDomain = that[document][domain];\n\n var ok = false;\n \n for (var i = 0; i < domains.length; i++) {\n var domain = domains[i];\n var position = currentDomain.length - domain.length;\n var lastIndex = currentDomain.indexOf(domain, position);\n var endsWith = lastIndex !== -1 && lastIndex === position;\n \n if (endsWith) {\n if (currentDomain.length == domain.length || domain.indexOf(\".\") === 0) {\n ok = true;\n }\n \n break;\n }\n }\n \n if (!ok) {\n data;\n } else {\n return;\n }\n \n func();\n });\n\n {domainLockFunctionName}();\n "; +} + +exports.DomainLockNodeTemplate = DomainLockNodeTemplate; + +/***/ }), +/* 120 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var Initializable_1 = __webpack_require__(10); + +var AbstractCustomNode_1 = __webpack_require__(14); + +var Nodes_1 = __webpack_require__(15); + +var NodeUtils_1 = __webpack_require__(9); + +var ExpressionWithOperatorControlFlowStorageCallNode = +/*#__PURE__*/ +function (_AbstractCustomNode_) { + _inherits(ExpressionWithOperatorControlFlowStorageCallNode, _AbstractCustomNode_); + + function ExpressionWithOperatorControlFlowStorageCallNode(identifierNamesGeneratorFactory, randomGenerator, options) { + _classCallCheck(this, ExpressionWithOperatorControlFlowStorageCallNode); + + return _possibleConstructorReturn(this, (ExpressionWithOperatorControlFlowStorageCallNode.__proto__ || _Object$getPrototypeOf(ExpressionWithOperatorControlFlowStorageCallNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); + } + + _createClass(ExpressionWithOperatorControlFlowStorageCallNode, [{ + key: "initialize", + value: function initialize(controlFlowStorageName, controlFlowStorageKey, leftValue, rightValue) { + this.controlFlowStorageName = controlFlowStorageName; + this.controlFlowStorageKey = controlFlowStorageKey; + this.leftValue = leftValue; + this.rightValue = rightValue; + } + }, { + key: "getNodeStructure", + value: function getNodeStructure() { + var structure = Nodes_1.Nodes.getExpressionStatementNode(Nodes_1.Nodes.getCallExpressionNode(Nodes_1.Nodes.getMemberExpressionNode(Nodes_1.Nodes.getIdentifierNode(this.controlFlowStorageName), Nodes_1.Nodes.getIdentifierNode(this.controlFlowStorageKey)), [this.leftValue, this.rightValue])); + NodeUtils_1.NodeUtils.parentize(structure); + return [structure]; + } + }]); + + return ExpressionWithOperatorControlFlowStorageCallNode; +}(AbstractCustomNode_1.AbstractCustomNode); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], ExpressionWithOperatorControlFlowStorageCallNode.prototype, "controlFlowStorageKey", void 0); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], ExpressionWithOperatorControlFlowStorageCallNode.prototype, "controlFlowStorageName", void 0); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Object)], ExpressionWithOperatorControlFlowStorageCallNode.prototype, "leftValue", void 0); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Object)], ExpressionWithOperatorControlFlowStorageCallNode.prototype, "rightValue", void 0); + +ExpressionWithOperatorControlFlowStorageCallNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], ExpressionWithOperatorControlFlowStorageCallNode); +exports.ExpressionWithOperatorControlFlowStorageCallNode = ExpressionWithOperatorControlFlowStorageCallNode; + +/***/ }), +/* 121 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var Initializable_1 = __webpack_require__(10); + +var AbstractCustomNode_1 = __webpack_require__(14); + +var Nodes_1 = __webpack_require__(15); + +var NodeUtils_1 = __webpack_require__(9); + +var LogicalExpressionFunctionNode = +/*#__PURE__*/ +function (_AbstractCustomNode_) { + _inherits(LogicalExpressionFunctionNode, _AbstractCustomNode_); + + function LogicalExpressionFunctionNode(identifierNamesGeneratorFactory, randomGenerator, options) { + _classCallCheck(this, LogicalExpressionFunctionNode); + + return _possibleConstructorReturn(this, (LogicalExpressionFunctionNode.__proto__ || _Object$getPrototypeOf(LogicalExpressionFunctionNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); + } + + _createClass(LogicalExpressionFunctionNode, [{ + key: "initialize", + value: function initialize(operator) { + this.operator = operator; + } + }, { + key: "getNodeStructure", + value: function getNodeStructure() { + var structure = Nodes_1.Nodes.getExpressionStatementNode(Nodes_1.Nodes.getFunctionExpressionNode([Nodes_1.Nodes.getIdentifierNode('x'), Nodes_1.Nodes.getIdentifierNode('y')], Nodes_1.Nodes.getBlockStatementNode([Nodes_1.Nodes.getReturnStatementNode(Nodes_1.Nodes.getLogicalExpressionNode(this.operator, Nodes_1.Nodes.getIdentifierNode('x'), Nodes_1.Nodes.getIdentifierNode('y')))]))); + NodeUtils_1.NodeUtils.parentize(structure); + return [structure]; + } + }]); + + return LogicalExpressionFunctionNode; +}(AbstractCustomNode_1.AbstractCustomNode); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], LogicalExpressionFunctionNode.prototype, "operator", void 0); + +LogicalExpressionFunctionNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], LogicalExpressionFunctionNode); +exports.LogicalExpressionFunctionNode = LogicalExpressionFunctionNode; + +/***/ }), +/* 122 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$assign = __webpack_require__(11); + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var string_template_1 = tslib_1.__importDefault(__webpack_require__(19)); + +var ObfuscationEvent_1 = __webpack_require__(25); + +var Initializable_1 = __webpack_require__(10); + +var SingleNodeCallControllerTemplate_1 = __webpack_require__(123); + +var NoCustomNodes_1 = __webpack_require__(39); + +var AbstractCustomNode_1 = __webpack_require__(14); + +var JavaScriptObfuscatorFacade_1 = __webpack_require__(27); + +var NodeUtils_1 = __webpack_require__(9); + +var NodeCallsControllerFunctionNode = +/*#__PURE__*/ +function (_AbstractCustomNode_) { + _inherits(NodeCallsControllerFunctionNode, _AbstractCustomNode_); + + function NodeCallsControllerFunctionNode(identifierNamesGeneratorFactory, randomGenerator, options) { + _classCallCheck(this, NodeCallsControllerFunctionNode); + + return _possibleConstructorReturn(this, (NodeCallsControllerFunctionNode.__proto__ || _Object$getPrototypeOf(NodeCallsControllerFunctionNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); + } + + _createClass(NodeCallsControllerFunctionNode, [{ + key: "initialize", + value: function initialize(appendEvent, callsControllerFunctionName) { + this.appendEvent = appendEvent; + this.callsControllerFunctionName = callsControllerFunctionName; + } + }, { + key: "getNodeStructure", + value: function getNodeStructure() { + return NodeUtils_1.NodeUtils.convertCodeToStructure(this.getTemplate()); + } + }, { + key: "getTemplate", + value: function getTemplate() { + if (this.appendEvent === ObfuscationEvent_1.ObfuscationEvent.AfterObfuscation) { + return JavaScriptObfuscatorFacade_1.JavaScriptObfuscator.obfuscate(string_template_1.default(SingleNodeCallControllerTemplate_1.SingleNodeCallControllerTemplate(), { + singleNodeCallControllerFunctionName: this.callsControllerFunctionName + }), _Object$assign({}, NoCustomNodes_1.NO_ADDITIONAL_NODES_PRESET, { + identifierNamesGenerator: this.options.identifierNamesGenerator, + seed: this.options.seed + })).getObfuscatedCode(); + } + + return string_template_1.default(SingleNodeCallControllerTemplate_1.SingleNodeCallControllerTemplate(), { + singleNodeCallControllerFunctionName: this.callsControllerFunctionName + }); + } + }]); + + return NodeCallsControllerFunctionNode; +}(AbstractCustomNode_1.AbstractCustomNode); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], NodeCallsControllerFunctionNode.prototype, "callsControllerFunctionName", void 0); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], NodeCallsControllerFunctionNode.prototype, "appendEvent", void 0); + +NodeCallsControllerFunctionNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], NodeCallsControllerFunctionNode); +exports.NodeCallsControllerFunctionNode = NodeCallsControllerFunctionNode; + +/***/ }), +/* 123 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function SingleNodeCallControllerTemplate() { + return "\n var {singleNodeCallControllerFunctionName} = (function(){\n var firstCall = true;\n \n return function (context, fn){\n var rfn = firstCall ? function(){\n if(fn){\n var res = fn.apply(context, arguments);\n fn = null;\n return res;\n }\n } : function(){}\n \n firstCall = false;\n \n return rfn;\n }\n })();\n "; +} + +exports.SingleNodeCallControllerTemplate = SingleNodeCallControllerTemplate; + +/***/ }), +/* 124 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$assign = __webpack_require__(11); + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var string_template_1 = tslib_1.__importDefault(__webpack_require__(19)); + +var Initializable_1 = __webpack_require__(10); + +var NoCustomNodes_1 = __webpack_require__(39); + +var SelfDefendingTemplate_1 = __webpack_require__(125); + +var AbstractCustomNode_1 = __webpack_require__(14); + +var JavaScriptObfuscatorFacade_1 = __webpack_require__(27); + +var NodeUtils_1 = __webpack_require__(9); + +var SelfDefendingUnicodeNode = +/*#__PURE__*/ +function (_AbstractCustomNode_) { + _inherits(SelfDefendingUnicodeNode, _AbstractCustomNode_); + + function SelfDefendingUnicodeNode(identifierNamesGeneratorFactory, randomGenerator, escapeSequenceEncoder, options) { + var _this; + + _classCallCheck(this, SelfDefendingUnicodeNode); + + _this = _possibleConstructorReturn(this, (SelfDefendingUnicodeNode.__proto__ || _Object$getPrototypeOf(SelfDefendingUnicodeNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); + _this.escapeSequenceEncoder = escapeSequenceEncoder; + return _this; + } + + _createClass(SelfDefendingUnicodeNode, [{ + key: "initialize", + value: function initialize(callsControllerFunctionName) { + this.callsControllerFunctionName = callsControllerFunctionName; + } + }, { + key: "getNodeStructure", + value: function getNodeStructure() { + return NodeUtils_1.NodeUtils.convertCodeToStructure(this.getTemplate()); + } + }, { + key: "getTemplate", + value: function getTemplate() { + return JavaScriptObfuscatorFacade_1.JavaScriptObfuscator.obfuscate(string_template_1.default(SelfDefendingTemplate_1.SelfDefendingTemplate(this.escapeSequenceEncoder), { + selfDefendingFunctionName: this.identifierNamesGenerator.generate(), + singleNodeCallControllerFunctionName: this.callsControllerFunctionName + }), _Object$assign({}, NoCustomNodes_1.NO_ADDITIONAL_NODES_PRESET, { + identifierNamesGenerator: this.options.identifierNamesGenerator, + seed: this.options.seed, + unicodeEscapeSequence: true + })).getObfuscatedCode(); + } + }]); + + return SelfDefendingUnicodeNode; +}(AbstractCustomNode_1.AbstractCustomNode); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], SelfDefendingUnicodeNode.prototype, "callsControllerFunctionName", void 0); + +SelfDefendingUnicodeNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IEscapeSequenceEncoder)), tslib_1.__param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object, Object])], SelfDefendingUnicodeNode); +exports.SelfDefendingUnicodeNode = SelfDefendingUnicodeNode; + +/***/ }), +/* 125 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function SelfDefendingTemplate(escapeSequenceEncoder) { + return "\n var {selfDefendingFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n var func1 = function(){return 'dev';},\n func2 = function () {\n return 'window';\n };\n \n var test1 = function () {\n var regExp = new RegExp('".concat(escapeSequenceEncoder.encode("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}", true), "');\n \n return !regExp.test(func1.toString());\n };\n \n var test2 = function () {\n var regExp = new RegExp('").concat(escapeSequenceEncoder.encode("(\\\\[x|u](\\w){2,4})+", true), "');\n \n return regExp.test(func2.toString());\n };\n \n var recursiveFunc1 = function (string) {\n var i = ~-1 >> 1 + 255 % 0;\n \n if (string.indexOf('i' === i)) {\n recursiveFunc2(string)\n }\n };\n \n var recursiveFunc2 = function (string) {\n var i = ~-4 >> 1 + 255 % 0;\n \n if (string.indexOf((true+\"\")[3]) !== i) {\n recursiveFunc1(string)\n }\n };\n \n if (!test1()) {\n if (!test2()) {\n recursiveFunc1('ind\u0435xOf');\n } else {\n recursiveFunc1('indexOf');\n }\n } else {\n recursiveFunc1('ind\u0435xOf');\n }\n })\n \n {selfDefendingFunctionName}();\n "); +} + +exports.SelfDefendingTemplate = SelfDefendingTemplate; + +/***/ }), +/* 126 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$assign = __webpack_require__(11); + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var string_template_1 = tslib_1.__importDefault(__webpack_require__(19)); + +var ObfuscationTarget_1 = __webpack_require__(21); + +var StringArrayEncoding_1 = __webpack_require__(37); + +var Initializable_1 = __webpack_require__(10); + +var NoCustomNodes_1 = __webpack_require__(39); + +var AtobTemplate_1 = __webpack_require__(127); + +var GlobalVariableNoEvalTemplate_1 = __webpack_require__(44); + +var Rc4Template_1 = __webpack_require__(128); + +var SelfDefendingTemplate_1 = __webpack_require__(129); + +var StringArrayBase64DecodeNodeTemplate_1 = __webpack_require__(130); + +var StringArrayCallsWrapperTemplate_1 = __webpack_require__(131); + +var StringArrayRC4DecodeNodeTemplate_1 = __webpack_require__(132); + +var AbstractCustomNode_1 = __webpack_require__(14); + +var JavaScriptObfuscatorFacade_1 = __webpack_require__(27); + +var NodeUtils_1 = __webpack_require__(9); + +var StringArrayCallsWrapper = +/*#__PURE__*/ +function (_AbstractCustomNode_) { + _inherits(StringArrayCallsWrapper, _AbstractCustomNode_); + + function StringArrayCallsWrapper(identifierNamesGeneratorFactory, randomGenerator, escapeSequenceEncoder, options) { + var _this; + + _classCallCheck(this, StringArrayCallsWrapper); + + _this = _possibleConstructorReturn(this, (StringArrayCallsWrapper.__proto__ || _Object$getPrototypeOf(StringArrayCallsWrapper)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); + _this.escapeSequenceEncoder = escapeSequenceEncoder; + return _this; + } + + _createClass(StringArrayCallsWrapper, [{ + key: "initialize", + value: function initialize(stringArrayName, stringArrayCallsWrapperName) { + this.stringArrayName = stringArrayName; + this.stringArrayCallsWrapperName = stringArrayCallsWrapperName; + } + }, { + key: "getNodeStructure", + value: function getNodeStructure() { + return NodeUtils_1.NodeUtils.convertCodeToStructure(this.getTemplate()); + } + }, { + key: "getTemplate", + value: function getTemplate() { + var decodeNodeTemplate = this.getDecodeStringArrayTemplate(); + return JavaScriptObfuscatorFacade_1.JavaScriptObfuscator.obfuscate(string_template_1.default(StringArrayCallsWrapperTemplate_1.StringArrayCallsWrapperTemplate(), { + decodeNodeTemplate: decodeNodeTemplate, + stringArrayCallsWrapperName: this.stringArrayCallsWrapperName, + stringArrayName: this.stringArrayName + }), _Object$assign({}, NoCustomNodes_1.NO_ADDITIONAL_NODES_PRESET, { + identifierNamesGenerator: this.options.identifierNamesGenerator, + seed: this.options.seed + })).getObfuscatedCode(); + } + }, { + key: "getDecodeStringArrayTemplate", + value: function getDecodeStringArrayTemplate() { + var globalVariableTemplate = this.options.target !== ObfuscationTarget_1.ObfuscationTarget.Extension ? this.getGlobalVariableTemplate() : GlobalVariableNoEvalTemplate_1.GlobalVariableNoEvalTemplate(); + var atobPolyfill = string_template_1.default(AtobTemplate_1.AtobTemplate(), { + globalVariableTemplate: globalVariableTemplate + }); + var decodeStringArrayTemplate = ''; + var selfDefendingCode = ''; + + if (this.options.selfDefending) { + selfDefendingCode = string_template_1.default(SelfDefendingTemplate_1.SelfDefendingTemplate(this.randomGenerator, this.escapeSequenceEncoder), { + stringArrayCallsWrapperName: this.stringArrayCallsWrapperName, + stringArrayName: this.stringArrayName + }); + } + + switch (this.options.stringArrayEncoding) { + case StringArrayEncoding_1.StringArrayEncoding.Rc4: + decodeStringArrayTemplate = string_template_1.default(StringArrayRC4DecodeNodeTemplate_1.StringArrayRc4DecodeNodeTemplate(this.randomGenerator), { + atobPolyfill: atobPolyfill, + rc4Polyfill: Rc4Template_1.Rc4Template(), + selfDefendingCode: selfDefendingCode, + stringArrayCallsWrapperName: this.stringArrayCallsWrapperName + }); + break; + + case StringArrayEncoding_1.StringArrayEncoding.Base64: + decodeStringArrayTemplate = string_template_1.default(StringArrayBase64DecodeNodeTemplate_1.StringArrayBase64DecodeNodeTemplate(this.randomGenerator), { + atobPolyfill: atobPolyfill, + selfDefendingCode: selfDefendingCode, + stringArrayCallsWrapperName: this.stringArrayCallsWrapperName + }); + break; + } + + return decodeStringArrayTemplate; + } + }]); + + return StringArrayCallsWrapper; +}(AbstractCustomNode_1.AbstractCustomNode); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], StringArrayCallsWrapper.prototype, "stringArrayName", void 0); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], StringArrayCallsWrapper.prototype, "stringArrayCallsWrapperName", void 0); + +StringArrayCallsWrapper = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IEscapeSequenceEncoder)), tslib_1.__param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object, Object])], StringArrayCallsWrapper); +exports.StringArrayCallsWrapper = StringArrayCallsWrapper; + +/***/ }), +/* 127 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function AtobTemplate() { + return "\n (function () {\n {globalVariableTemplate}\n \n var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\n that.atob || (\n that.atob = function(input) {\n var str = String(input).replace(/=+$/, '');\n for (\n var bc = 0, bs, buffer, idx = 0, output = '';\n buffer = str.charAt(idx++);\n ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,\n bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0\n ) {\n buffer = chars.indexOf(buffer);\n }\n return output;\n });\n })();\n "; +} + +exports.AtobTemplate = AtobTemplate; + +/***/ }), +/* 128 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function Rc4Template() { + return "\n var rc4 = function (str, key) {\n var s = [], j = 0, x, res = '', newStr = '';\n \n str = atob(str);\n \n for (var k = 0, length = str.length; k < length; k++) {\n newStr += '%' + ('00' + str.charCodeAt(k).toString(16)).slice(-2);\n }\n \n str = decodeURIComponent(newStr);\n \t \n\t for (var i = 0; i < 256; i++) {\n s[i] = i;\n }\n \n for (i = 0; i < 256; i++) {\n j = (j + s[i] + key.charCodeAt(i % key.length)) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n }\n \n i = 0;\n j = 0;\n \n for (var y = 0; y < str.length; y++) {\n i = (i + 1) % 256;\n j = (j + s[i]) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n res += String.fromCharCode(str.charCodeAt(y) ^ s[(s[i] + s[j]) % 256]);\n }\n \n return res;\n }\n "; +} + +exports.Rc4Template = Rc4Template; + +/***/ }), +/* 129 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function SelfDefendingTemplate(randomGenerator, escapeSequenceEncoder) { + var identifierLength = 6; + var rc4BytesIdentifier = randomGenerator.getRandomString(identifierLength); + var statesIdentifier = randomGenerator.getRandomString(identifierLength); + var newStateIdentifier = randomGenerator.getRandomString(identifierLength); + var firstStateIdentifier = randomGenerator.getRandomString(identifierLength); + var secondStateIdentifier = randomGenerator.getRandomString(identifierLength); + var checkStateIdentifier = randomGenerator.getRandomString(identifierLength); + var runStateIdentifier = randomGenerator.getRandomString(identifierLength); + var getStateIdentifier = randomGenerator.getRandomString(identifierLength); + var stateResultIdentifier = randomGenerator.getRandomString(identifierLength); + return "\n var StatesClass = function (".concat(rc4BytesIdentifier, ") {\n this.").concat(rc4BytesIdentifier, " = ").concat(rc4BytesIdentifier, ";\n this.").concat(statesIdentifier, " = [1, 0, 0];\n this.").concat(newStateIdentifier, " = function(){return 'newState';};\n this.").concat(firstStateIdentifier, " = '").concat(escapeSequenceEncoder.encode("\\w+ *\\(\\) *{\\w+ *", true), "';\n this.").concat(secondStateIdentifier, " = '").concat(escapeSequenceEncoder.encode("['|\"].+['|\"];? *}", true), "';\n };\n \n StatesClass.prototype.").concat(checkStateIdentifier, " = function () {\n var regExp = new RegExp(this.").concat(firstStateIdentifier, " + this.").concat(secondStateIdentifier, ");\n var expression = regExp.test(this.").concat(newStateIdentifier, ".toString())\n ? --this.").concat(statesIdentifier, "[1]\n : --this.").concat(statesIdentifier, "[0];\n \n return this.").concat(runStateIdentifier, "(expression);\n };\n \n StatesClass.prototype.").concat(runStateIdentifier, " = function (").concat(stateResultIdentifier, ") {\n if (!Boolean(~").concat(stateResultIdentifier, ")) {\n return ").concat(stateResultIdentifier, ";\n }\n \n return this.").concat(getStateIdentifier, "(this.").concat(rc4BytesIdentifier, ");\n };\n\n StatesClass.prototype.").concat(getStateIdentifier, " = function (").concat(rc4BytesIdentifier, ") {\n for (var i = 0, len = this.").concat(statesIdentifier, ".length; i < len; i++) {\n this.").concat(statesIdentifier, ".push(Math.round(Math.random()));\n len = this.").concat(statesIdentifier, ".length;\n }\n \n return ").concat(rc4BytesIdentifier, "(this.").concat(statesIdentifier, "[0]);\n };\n\n new StatesClass({stringArrayCallsWrapperName}).").concat(checkStateIdentifier, "();\n "); +} + +exports.SelfDefendingTemplate = SelfDefendingTemplate; + +/***/ }), +/* 130 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function StringArrayBase64DecodeNodeTemplate(randomGenerator) { + var identifierLength = 6; + var initializedIdentifier = randomGenerator.getRandomString(identifierLength); + var base64DecodeFunctionIdentifier = randomGenerator.getRandomString(identifierLength); + var dataIdentifier = randomGenerator.getRandomString(identifierLength); + return "\n if ({stringArrayCallsWrapperName}.".concat(initializedIdentifier, " === undefined) {\n {atobPolyfill}\n \n {stringArrayCallsWrapperName}.").concat(base64DecodeFunctionIdentifier, " = function (str) {\n var string = atob(str);\n var newStringChars = [];\n \n for (var i = 0, length = string.length; i < length; i++) {\n newStringChars += '%' + ('00' + string.charCodeAt(i).toString(16)).slice(-2);\n }\n \n return decodeURIComponent(newStringChars);\n };\n \n {stringArrayCallsWrapperName}.").concat(dataIdentifier, " = {};\n \n {stringArrayCallsWrapperName}.").concat(initializedIdentifier, " = true;\n }\n \n var cachedValue = {stringArrayCallsWrapperName}.").concat(dataIdentifier, "[index];\n \n if (cachedValue === undefined) {\n {selfDefendingCode}\n \n value = {stringArrayCallsWrapperName}.").concat(base64DecodeFunctionIdentifier, "(value);\n {stringArrayCallsWrapperName}.").concat(dataIdentifier, "[index] = value;\n } else {\n value = cachedValue;\n }\n "); +} + +exports.StringArrayBase64DecodeNodeTemplate = StringArrayBase64DecodeNodeTemplate; + +/***/ }), +/* 131 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function StringArrayCallsWrapperTemplate() { + return "\n var {stringArrayCallsWrapperName} = function (index, key) {\n index = index - 0;\n \n var value = {stringArrayName}[index];\n \n {decodeNodeTemplate}\n \n return value;\n };\n "; +} + +exports.StringArrayCallsWrapperTemplate = StringArrayCallsWrapperTemplate; + +/***/ }), +/* 132 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function StringArrayRc4DecodeNodeTemplate(randomGenerator) { + var identifierLength = 6; + var initializedIdentifier = randomGenerator.getRandomString(identifierLength); + var rc4Identifier = randomGenerator.getRandomString(identifierLength); + var dataIdentifier = randomGenerator.getRandomString(identifierLength); + var onceIdentifier = randomGenerator.getRandomString(identifierLength); + return "\n if ({stringArrayCallsWrapperName}.".concat(initializedIdentifier, " === undefined) {\n {atobPolyfill}\n \n {rc4Polyfill}\n {stringArrayCallsWrapperName}.").concat(rc4Identifier, " = rc4;\n \n {stringArrayCallsWrapperName}.").concat(dataIdentifier, " = {};\n \n {stringArrayCallsWrapperName}.").concat(initializedIdentifier, " = true;\n }\n \n var cachedValue = {stringArrayCallsWrapperName}.").concat(dataIdentifier, "[index];\n\n if (cachedValue === undefined) {\n if ({stringArrayCallsWrapperName}.").concat(onceIdentifier, " === undefined) {\n {selfDefendingCode}\n \n {stringArrayCallsWrapperName}.").concat(onceIdentifier, " = true;\n }\n \n value = {stringArrayCallsWrapperName}.").concat(rc4Identifier, "(value, key);\n {stringArrayCallsWrapperName}.").concat(dataIdentifier, "[index] = value;\n } else {\n value = cachedValue;\n }\n "); +} + +exports.StringArrayRc4DecodeNodeTemplate = StringArrayRc4DecodeNodeTemplate; + +/***/ }), +/* 133 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _get = __webpack_require__(45); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var string_template_1 = tslib_1.__importDefault(__webpack_require__(19)); + +var Initializable_1 = __webpack_require__(10); + +var StringArrayTemplate_1 = __webpack_require__(134); + +var AbstractCustomNode_1 = __webpack_require__(14); + +var NodeUtils_1 = __webpack_require__(9); + +var StringArrayNode = +/*#__PURE__*/ +function (_AbstractCustomNode_) { + _inherits(StringArrayNode, _AbstractCustomNode_); + + function StringArrayNode(identifierNamesGeneratorFactory, randomGenerator, options) { + _classCallCheck(this, StringArrayNode); + + return _possibleConstructorReturn(this, (StringArrayNode.__proto__ || _Object$getPrototypeOf(StringArrayNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); + } + + _createClass(StringArrayNode, [{ + key: "initialize", + value: function initialize(stringArrayStorage, stringArrayName, stringArrayRotateValue) { + this.stringArrayStorage = stringArrayStorage; + this.stringArrayName = stringArrayName; + this.stringArrayRotateValue = stringArrayRotateValue; + } + }, { + key: "getNode", + value: function getNode() { + this.stringArrayStorage.rotateArray(this.stringArrayRotateValue); + return _get(StringArrayNode.prototype.__proto__ || _Object$getPrototypeOf(StringArrayNode.prototype), "getNode", this).call(this); + } + }, { + key: "getNodeStructure", + value: function getNodeStructure() { + return NodeUtils_1.NodeUtils.convertCodeToStructure(this.getTemplate()); + } + }, { + key: "getTemplate", + value: function getTemplate() { + return string_template_1.default(StringArrayTemplate_1.StringArrayTemplate(), { + stringArrayName: this.stringArrayName, + stringArray: this.stringArrayStorage.toString() + }); + } + }]); + + return StringArrayNode; +}(AbstractCustomNode_1.AbstractCustomNode); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Object)], StringArrayNode.prototype, "stringArrayStorage", void 0); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], StringArrayNode.prototype, "stringArrayName", void 0); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Number)], StringArrayNode.prototype, "stringArrayRotateValue", void 0); + +StringArrayNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], StringArrayNode); +exports.StringArrayNode = StringArrayNode; + +/***/ }), +/* 134 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function StringArrayTemplate() { + return "\n var {stringArrayName} = [{stringArray}];\n "; +} + +exports.StringArrayTemplate = StringArrayTemplate; + +/***/ }), +/* 135 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$assign = __webpack_require__(11); + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var string_template_1 = tslib_1.__importDefault(__webpack_require__(19)); + +var Initializable_1 = __webpack_require__(10); + +var NoCustomNodes_1 = __webpack_require__(39); + +var SelfDefendingTemplate_1 = __webpack_require__(136); + +var StringArrayRotateFunctionTemplate_1 = __webpack_require__(137); + +var AbstractCustomNode_1 = __webpack_require__(14); + +var JavaScriptObfuscatorFacade_1 = __webpack_require__(27); + +var NodeUtils_1 = __webpack_require__(9); + +var Utils_1 = __webpack_require__(32); + +var StringArrayRotateFunctionNode = +/*#__PURE__*/ +function (_AbstractCustomNode_) { + _inherits(StringArrayRotateFunctionNode, _AbstractCustomNode_); + + function StringArrayRotateFunctionNode(identifierNamesGeneratorFactory, randomGenerator, escapeSequenceEncoder, options) { + var _this; + + _classCallCheck(this, StringArrayRotateFunctionNode); + + _this = _possibleConstructorReturn(this, (StringArrayRotateFunctionNode.__proto__ || _Object$getPrototypeOf(StringArrayRotateFunctionNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); + _this.escapeSequenceEncoder = escapeSequenceEncoder; + return _this; + } + + _createClass(StringArrayRotateFunctionNode, [{ + key: "initialize", + value: function initialize(stringArrayName, stringArrayRotateValue) { + this.stringArrayName = stringArrayName; + this.stringArrayRotateValue = stringArrayRotateValue; + } + }, { + key: "getNodeStructure", + value: function getNodeStructure() { + return NodeUtils_1.NodeUtils.convertCodeToStructure(this.getTemplate()); + } + }, { + key: "getTemplate", + value: function getTemplate() { + var timesName = this.identifierNamesGenerator.generate(); + var whileFunctionName = this.identifierNamesGenerator.generate(); + var code = ''; + + if (this.options.selfDefending) { + code = string_template_1.default(SelfDefendingTemplate_1.SelfDefendingTemplate(this.escapeSequenceEncoder), { + timesName: timesName, + whileFunctionName: whileFunctionName + }); + } else { + code = "".concat(whileFunctionName, "(++").concat(timesName, ")"); + } + + return JavaScriptObfuscatorFacade_1.JavaScriptObfuscator.obfuscate(string_template_1.default(StringArrayRotateFunctionTemplate_1.StringArrayRotateFunctionTemplate(), { + code: code, + timesName: timesName, + stringArrayName: this.stringArrayName, + stringArrayRotateValue: Utils_1.Utils.decToHex(this.stringArrayRotateValue), + whileFunctionName: whileFunctionName + }), _Object$assign({}, NoCustomNodes_1.NO_ADDITIONAL_NODES_PRESET, { + identifierNamesGenerator: this.options.identifierNamesGenerator, + seed: this.options.seed + })).getObfuscatedCode(); + } + }]); + + return StringArrayRotateFunctionNode; +}(AbstractCustomNode_1.AbstractCustomNode); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], StringArrayRotateFunctionNode.prototype, "stringArrayName", void 0); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Number)], StringArrayRotateFunctionNode.prototype, "stringArrayRotateValue", void 0); + +StringArrayRotateFunctionNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IEscapeSequenceEncoder)), tslib_1.__param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object, Object])], StringArrayRotateFunctionNode); +exports.StringArrayRotateFunctionNode = StringArrayRotateFunctionNode; + +/***/ }), +/* 136 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function SelfDefendingTemplate(escapeSequenceEncoder) { + return "\n var selfDefendingFunc = function () {\n var object = {\n data: {\n key: 'cookie',\n value: 'timeout'\n },\n setCookie: function (options, name, value, document) {\n document = document || {};\n \n var updatedCookie = name + \"=\" + value;\n\n var i = 0;\n \n for (var i = 0, len = options.length; i < len; i++) {\n var propName = options[i];\n \n updatedCookie += \"; \" + propName;\n \n var propValue = options[propName];\n \n options.push(propValue);\n len = options.length;\n \n if (propValue !== true) {\n updatedCookie += \"=\" + propValue;\n }\n }\n\n document['cookie'] = updatedCookie;\n },\n removeCookie: function(){return 'dev';},\n getCookie: function (document, name) {\n document = document || function (value) { return value };\n var matches = document(new RegExp(\n \"(?:^|; )\" + name.replace(/([.$?*|{}()[]\\/+^])/g, '\\$1') + \"=([^;]*)\"\n ));\n \n var func = function (param1, param2) {\n param1(++param2);\n };\n \n func({whileFunctionName}, {timesName});\n \n return matches ? decodeURIComponent(matches[1]) : undefined;\n }\n };\n \n var test1 = function () {\n var regExp = new RegExp('".concat(escapeSequenceEncoder.encode("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}", true), "');\n \n return regExp.test(object.removeCookie.toString());\n };\n \n object['updateCookie'] = test1;\n \n var cookie = '';\n var result = object['updateCookie']();\n \n if (!result) {\n object['setCookie'](['*'], 'counter', 1);\n } else if (result) {\n cookie = object['getCookie'](null, 'counter');\n } else {\n object['removeCookie']();\n }\n };\n \n selfDefendingFunc();\n "); +} + +exports.SelfDefendingTemplate = SelfDefendingTemplate; + +/***/ }), +/* 137 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function StringArrayRotateFunctionTemplate() { + return "\n (function (array, {timesName}) {\n var {whileFunctionName} = function (times) {\n while (--times) {\n array['push'](array['shift']());\n }\n };\n \n {code}\n })({stringArrayName}, 0x{stringArrayRotateValue});\n "; +} + +exports.StringArrayRotateFunctionTemplate = StringArrayRotateFunctionTemplate; + +/***/ }), +/* 138 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var JSFuck; + +(function (JSFuck) { + JSFuck["False"] = "![]"; + JSFuck["True"] = "!![]"; + JSFuck["a"] = "(false+\"\")[1]"; + JSFuck["b"] = "([][\"entries\"]()+\"\")[2]"; + JSFuck["c"] = "([][\"fill\"]+\"\")[3]"; + JSFuck["d"] = "(undefined+\"\")[2]"; + JSFuck["e"] = "(true+\"\")[3]"; + JSFuck["f"] = "(false+\"\")[0]"; + JSFuck["g"] = "(false+[0]+String)[20]"; + JSFuck["h"] = "(+(101))[\"toString\"](21)[1]"; + JSFuck["i"] = "([false]+undefined)[10]"; + JSFuck["j"] = "([][\"entries\"]()+\"\")[3]"; + JSFuck["k"] = "(+(20))[\"toString\"](21)"; + JSFuck["l"] = "(false+\"\")[2]"; + JSFuck["m"] = "(Number+\"\")[11]"; + JSFuck["n"] = "(undefined+\"\")[1]"; + JSFuck["o"] = "(true+[][\"fill\"])[10]"; + JSFuck["p"] = "(+(211))[\"toString\"](31)[1]"; + JSFuck["q"] = "(+(212))[\"toString\"](31)[1]"; + JSFuck["r"] = "(true+\"\")[1]"; + JSFuck["s"] = "(false+\"\")[3]"; + JSFuck["t"] = "(true+\"\")[0]"; + JSFuck["u"] = "(undefined+\"\")[0]"; + JSFuck["v"] = "(+(31))[\"toString\"](32)"; + JSFuck["w"] = "(+(32))[\"toString\"](33)"; + JSFuck["x"] = "(+(101))[\"toString\"](34)[1]"; + JSFuck["y"] = "(NaN+[Infinity])[10]"; + JSFuck["z"] = "(+(35))[\"toString\"](36)"; + JSFuck["A"] = "(+[]+Array)[10]"; + JSFuck["B"] = "(+[]+Boolean)[10]"; + JSFuck["C"] = "Function(\"return escape\")()((\"\")[\"italics\"]())[2]"; + JSFuck["D"] = "Function(\"return escape\")()([][\"fill\"])[\"slice\"](\"-1\")"; + JSFuck["E"] = "(RegExp+\"\")[12]"; + JSFuck["F"] = "(+[]+Function)[10]"; + JSFuck["G"] = "(false+Function(\"return Date\")()())[30]"; + JSFuck["H"] = "'H'"; + JSFuck["I"] = "(Infinity+\"\")[0]"; + JSFuck["J"] = "'J'"; + JSFuck["K"] = "'K'"; + JSFuck["L"] = "'L'"; + JSFuck["M"] = "(true+Function(\"return Date\")()())[30]"; + JSFuck["N"] = "(NaN+\"\")[0]"; + JSFuck["O"] = "(NaN+Function(\"return{}\")())[11]"; + JSFuck["P"] = "'P'"; + JSFuck["Q"] = "'Q'"; + JSFuck["R"] = "(+[]+RegExp)[10]"; + JSFuck["S"] = "(+[]+String)[10]"; + JSFuck["T"] = "(NaN+Function(\"return Date\")()())[30]"; + JSFuck["U"] = "(NaN+Function(\"return{}\")()[\"toString\"][\"call\"]())[11]"; + JSFuck["V"] = "'V'"; + JSFuck["W"] = "'W'"; + JSFuck["X"] = "'X'"; + JSFuck["Y"] = "'Y'"; + JSFuck["Z"] = "'Z'"; +})(JSFuck = exports.JSFuck || (exports.JSFuck = {})); + +/***/ }), +/* 139 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var Initializable_1 = __webpack_require__(10); + +var AbstractCustomNode_1 = __webpack_require__(14); + +var Nodes_1 = __webpack_require__(15); + +var NodeUtils_1 = __webpack_require__(9); + +var StringLiteralControlFlowStorageCallNode = +/*#__PURE__*/ +function (_AbstractCustomNode_) { + _inherits(StringLiteralControlFlowStorageCallNode, _AbstractCustomNode_); + + function StringLiteralControlFlowStorageCallNode(identifierNamesGeneratorFactory, randomGenerator, options) { + _classCallCheck(this, StringLiteralControlFlowStorageCallNode); + + return _possibleConstructorReturn(this, (StringLiteralControlFlowStorageCallNode.__proto__ || _Object$getPrototypeOf(StringLiteralControlFlowStorageCallNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); + } + + _createClass(StringLiteralControlFlowStorageCallNode, [{ + key: "initialize", + value: function initialize(controlFlowStorageName, controlFlowStorageKey) { + this.controlFlowStorageName = controlFlowStorageName; + this.controlFlowStorageKey = controlFlowStorageKey; + } + }, { + key: "getNodeStructure", + value: function getNodeStructure() { + var structure = Nodes_1.Nodes.getExpressionStatementNode(Nodes_1.Nodes.getMemberExpressionNode(Nodes_1.Nodes.getIdentifierNode(this.controlFlowStorageName), Nodes_1.Nodes.getIdentifierNode(this.controlFlowStorageKey))); + NodeUtils_1.NodeUtils.parentize(structure); + return [structure]; + } + }]); + + return StringLiteralControlFlowStorageCallNode; +}(AbstractCustomNode_1.AbstractCustomNode); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], StringLiteralControlFlowStorageCallNode.prototype, "controlFlowStorageKey", void 0); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], StringLiteralControlFlowStorageCallNode.prototype, "controlFlowStorageName", void 0); + +StringLiteralControlFlowStorageCallNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], StringLiteralControlFlowStorageCallNode); +exports.StringLiteralControlFlowStorageCallNode = StringLiteralControlFlowStorageCallNode; + +/***/ }), +/* 140 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var Initializable_1 = __webpack_require__(10); + +var AbstractCustomNode_1 = __webpack_require__(14); + +var Nodes_1 = __webpack_require__(15); + +var StringLiteralNode = +/*#__PURE__*/ +function (_AbstractCustomNode_) { + _inherits(StringLiteralNode, _AbstractCustomNode_); + + function StringLiteralNode(identifierNamesGeneratorFactory, randomGenerator, options) { + _classCallCheck(this, StringLiteralNode); + + return _possibleConstructorReturn(this, (StringLiteralNode.__proto__ || _Object$getPrototypeOf(StringLiteralNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); + } + + _createClass(StringLiteralNode, [{ + key: "initialize", + value: function initialize(literalValue) { + this.literalValue = literalValue; + } + }, { + key: "getNodeStructure", + value: function getNodeStructure() { + var structure = Nodes_1.Nodes.getExpressionStatementNode(Nodes_1.Nodes.getLiteralNode(this.literalValue)); + return [structure]; + } + }]); + + return StringLiteralNode; +}(AbstractCustomNode_1.AbstractCustomNode); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], StringLiteralNode.prototype, "literalValue", void 0); + +StringLiteralNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], StringLiteralNode); +exports.StringLiteralNode = StringLiteralNode; + +/***/ }), +/* 141 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var inversify_1 = __webpack_require__(1); + +exports.finalizingTransformersModule = new inversify_1.ContainerModule(function (bind) {}); + +/***/ }), +/* 142 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var IdentifierNamesGenerator_1 = __webpack_require__(35); + +var HexadecimalIdentifierNamesGenerator_1 = __webpack_require__(143); + +var MangledIdentifierNamesGenerator_1 = __webpack_require__(144); + +exports.generatorsModule = new inversify_1.ContainerModule(function (bind) { + bind(ServiceIdentifiers_1.ServiceIdentifiers.IIdentifierNamesGenerator).to(HexadecimalIdentifierNamesGenerator_1.HexadecimalIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(IdentifierNamesGenerator_1.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IIdentifierNamesGenerator).to(MangledIdentifierNamesGenerator_1.MangledIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(IdentifierNamesGenerator_1.IdentifierNamesGenerator.MangledIdentifierNamesGenerator); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator).toFactory(function (context) { + var cachedIdentifierNamesGenerator = null; + return function (options) { + if (cachedIdentifierNamesGenerator) { + return cachedIdentifierNamesGenerator; + } + + var identifierNamesGenerator; + + switch (options.identifierNamesGenerator) { + case IdentifierNamesGenerator_1.IdentifierNamesGenerator.MangledIdentifierNamesGenerator: + identifierNamesGenerator = context.container.getNamed(ServiceIdentifiers_1.ServiceIdentifiers.IIdentifierNamesGenerator, IdentifierNamesGenerator_1.IdentifierNamesGenerator.MangledIdentifierNamesGenerator); + break; + + case IdentifierNamesGenerator_1.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator: + default: + identifierNamesGenerator = context.container.getNamed(ServiceIdentifiers_1.ServiceIdentifiers.IIdentifierNamesGenerator, IdentifierNamesGenerator_1.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator); + } + + cachedIdentifierNamesGenerator = identifierNamesGenerator; + return identifierNamesGenerator; + }; + }); +}); + +/***/ }), +/* 143 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Set = __webpack_require__(29); + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var AbstractIdentifierNamesGenerator_1 = __webpack_require__(58); + +var Utils_1 = __webpack_require__(32); + +var HexadecimalIdentifierNamesGenerator = HexadecimalIdentifierNamesGenerator_1 = +/*#__PURE__*/ +function (_AbstractIdentifierNa) { + _inherits(HexadecimalIdentifierNamesGenerator, _AbstractIdentifierNa); + + function HexadecimalIdentifierNamesGenerator(randomGenerator, options) { + var _this; + + _classCallCheck(this, HexadecimalIdentifierNamesGenerator); + + _this = _possibleConstructorReturn(this, (HexadecimalIdentifierNamesGenerator.__proto__ || _Object$getPrototypeOf(HexadecimalIdentifierNamesGenerator)).call(this, randomGenerator, options)); + _this.randomVariableNameSet = new _Set(); + return _this; + } + + _createClass(HexadecimalIdentifierNamesGenerator, [{ + key: "generate", + value: function generate() { + var rangeMinInteger = 10000; + var rangeMaxInteger = 99999999; + var randomInteger = this.randomGenerator.getRandomInteger(rangeMinInteger, rangeMaxInteger); + var hexadecimalNumber = Utils_1.Utils.decToHex(randomInteger); + var baseIdentifierName = hexadecimalNumber.substr(0, HexadecimalIdentifierNamesGenerator_1.baseIdentifierNameLength); + var identifierName = "_".concat(Utils_1.Utils.hexadecimalPrefix).concat(baseIdentifierName); + + if (this.randomVariableNameSet.has(identifierName)) { + return this.generate(); + } + + this.randomVariableNameSet.add(identifierName); + return identifierName; + } + }, { + key: "generateWithPrefix", + value: function generateWithPrefix() { + var identifierName = this.generate(); + return "".concat(this.options.identifiersPrefix).concat(identifierName).replace('__', '_'); + } + }]); + + return HexadecimalIdentifierNamesGenerator; +}(AbstractIdentifierNamesGenerator_1.AbstractIdentifierNamesGenerator); + +HexadecimalIdentifierNamesGenerator.baseIdentifierNameLength = 6; +HexadecimalIdentifierNamesGenerator = HexadecimalIdentifierNamesGenerator_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object])], HexadecimalIdentifierNamesGenerator); +exports.HexadecimalIdentifierNamesGenerator = HexadecimalIdentifierNamesGenerator; +var HexadecimalIdentifierNamesGenerator_1; + +/***/ }), +/* 144 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var AbstractIdentifierNamesGenerator_1 = __webpack_require__(58); + +var MangledIdentifierNamesGenerator = MangledIdentifierNamesGenerator_1 = +/*#__PURE__*/ +function (_AbstractIdentifierNa) { + _inherits(MangledIdentifierNamesGenerator, _AbstractIdentifierNa); + + function MangledIdentifierNamesGenerator(randomGenerator, options) { + var _this; + + _classCallCheck(this, MangledIdentifierNamesGenerator); + + _this = _possibleConstructorReturn(this, (MangledIdentifierNamesGenerator.__proto__ || _Object$getPrototypeOf(MangledIdentifierNamesGenerator)).call(this, randomGenerator, options)); + _this.previousMangledName = MangledIdentifierNamesGenerator_1.initMangledNameCharacter; + return _this; + } + + _createClass(MangledIdentifierNamesGenerator, [{ + key: "generate", + value: function generate() { + var identifierName = MangledIdentifierNamesGenerator_1.generateNewMangledName(this.previousMangledName); + this.previousMangledName = identifierName; + return identifierName; + } + }, { + key: "generateWithPrefix", + value: function generateWithPrefix() { + var prefix = this.options.identifiersPrefix ? "".concat(this.options.identifiersPrefix, "_") : ''; + var identifierName = this.generate(); + return "".concat(prefix).concat(identifierName); + } + }], [{ + key: "generateNewMangledName", + value: function generateNewMangledName(previousMangledName) { + var generateNewMangledName = function generateNewMangledName(name) { + var nameSequence = MangledIdentifierNamesGenerator_1.nameSequence; + var nameLength = name.length; + + var zeroSequence = function zeroSequence(num) { + return '0'.repeat(num); + }; + + var index = nameLength - 1; + + do { + var character = name.charAt(index); + var indexInSequence = nameSequence.indexOf(character); + var lastNameSequenceIndex = nameSequence.length - 1; + + if (indexInSequence !== lastNameSequenceIndex) { + var previousNamePart = name.substring(0, index); + var nextCharacter = nameSequence[indexInSequence + 1]; + var zeroSequenceLength = nameLength - (index + 1); + var zeroSequenceCharacters = zeroSequence(zeroSequenceLength); + return previousNamePart + nextCharacter + zeroSequenceCharacters; + } + + --index; + } while (index >= 0); + + return "a".concat(zeroSequence(nameLength)); + }; + + var newMangledName = generateNewMangledName(previousMangledName); + + if (!MangledIdentifierNamesGenerator_1.validateMangledName(newMangledName)) { + newMangledName = MangledIdentifierNamesGenerator_1.generateNewMangledName(newMangledName); + } + + return newMangledName; + } + }, { + key: "validateMangledName", + value: function validateMangledName(mangledName) { + return !MangledIdentifierNamesGenerator_1.reservedNames.includes(mangledName); + } + }]); + + return MangledIdentifierNamesGenerator; +}(AbstractIdentifierNamesGenerator_1.AbstractIdentifierNamesGenerator); + +MangledIdentifierNamesGenerator.initMangledNameCharacter = '9'; +MangledIdentifierNamesGenerator.nameSequence = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split(''); +MangledIdentifierNamesGenerator.reservedNames = ['byte', 'case', 'char', 'do', 'else', 'enum', 'eval', 'for', 'goto', 'if', 'in', 'int', 'let', 'long', 'new', 'null', 'this', 'true', 'try', 'var', 'void', 'with']; +MangledIdentifierNamesGenerator = MangledIdentifierNamesGenerator_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object])], MangledIdentifierNamesGenerator); +exports.MangledIdentifierNamesGenerator = MangledIdentifierNamesGenerator; +var MangledIdentifierNamesGenerator_1; + +/***/ }), +/* 145 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var InversifyContainerFacade_1 = __webpack_require__(22); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +exports.nodeTransformersModule = new inversify_1.ContainerModule(function (bind) { + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__INodeTransformer).toFactory(InversifyContainerFacade_1.InversifyContainerFacade.getCacheFactory(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer)); +}); + +/***/ }), +/* 146 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var InversifyContainerFacade_1 = __webpack_require__(22); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var IdentifierObfuscatingReplacer_1 = __webpack_require__(26); + +var LiteralObfuscatingReplacer_1 = __webpack_require__(59); + +var NodeTransformer_1 = __webpack_require__(28); + +var BaseIdentifierObfuscatingReplacer_1 = __webpack_require__(147); + +var BooleanLiteralObfuscatingReplacer_1 = __webpack_require__(148); + +var CatchClauseTransformer_1 = __webpack_require__(149); + +var ClassDeclarationTransformer_1 = __webpack_require__(150); + +var FunctionDeclarationTransformer_1 = __webpack_require__(151); + +var FunctionTransformer_1 = __webpack_require__(152); + +var LabeledStatementTransformer_1 = __webpack_require__(153); + +var LiteralTransformer_1 = __webpack_require__(154); + +var NumberLiteralObfuscatingReplacer_1 = __webpack_require__(155); + +var ObjectExpressionTransformer_1 = __webpack_require__(156); + +var StringLiteralObfuscatingReplacer_1 = __webpack_require__(157); + +var VariableDeclarationTransformer_1 = __webpack_require__(158); + +exports.obfuscatingTransformersModule = new inversify_1.ContainerModule(function (bind) { + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(CatchClauseTransformer_1.CatchClauseTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.CatchClauseTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(ClassDeclarationTransformer_1.ClassDeclarationTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.ClassDeclarationTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(FunctionDeclarationTransformer_1.FunctionDeclarationTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.FunctionDeclarationTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(FunctionTransformer_1.FunctionTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.FunctionTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(LabeledStatementTransformer_1.LabeledStatementTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.LabeledStatementTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(LiteralTransformer_1.LiteralTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.LiteralTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(ObjectExpressionTransformer_1.ObjectExpressionTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.ObjectExpressionTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(VariableDeclarationTransformer_1.VariableDeclarationTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.VariableDeclarationTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IObfuscatingReplacer).to(BooleanLiteralObfuscatingReplacer_1.BooleanLiteralObfuscatingReplacer).whenTargetNamed(LiteralObfuscatingReplacer_1.LiteralObfuscatingReplacer.BooleanLiteralObfuscatingReplacer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IObfuscatingReplacer).to(NumberLiteralObfuscatingReplacer_1.NumberLiteralObfuscatingReplacer).whenTargetNamed(LiteralObfuscatingReplacer_1.LiteralObfuscatingReplacer.NumberLiteralObfuscatingReplacer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IObfuscatingReplacer).to(StringLiteralObfuscatingReplacer_1.StringLiteralObfuscatingReplacer).whenTargetNamed(LiteralObfuscatingReplacer_1.LiteralObfuscatingReplacer.StringLiteralObfuscatingReplacer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IIdentifierObfuscatingReplacer).to(BaseIdentifierObfuscatingReplacer_1.BaseIdentifierObfuscatingReplacer).whenTargetNamed(IdentifierObfuscatingReplacer_1.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IObfuscatingReplacer).toFactory(InversifyContainerFacade_1.InversifyContainerFacade.getCacheFactory(ServiceIdentifiers_1.ServiceIdentifiers.IObfuscatingReplacer)); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer).toFactory(InversifyContainerFacade_1.InversifyContainerFacade.getCacheFactory(ServiceIdentifiers_1.ServiceIdentifiers.IIdentifierObfuscatingReplacer)); +}); + +/***/ }), +/* 147 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Map = __webpack_require__(16); + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var AbstractObfuscatingReplacer_1 = __webpack_require__(40); + +var Nodes_1 = __webpack_require__(15); + +var BaseIdentifierObfuscatingReplacer = +/*#__PURE__*/ +function (_AbstractObfuscatingR) { + _inherits(BaseIdentifierObfuscatingReplacer, _AbstractObfuscatingR); + + function BaseIdentifierObfuscatingReplacer(identifierNamesGeneratorFactory, options) { + var _this; + + _classCallCheck(this, BaseIdentifierObfuscatingReplacer); + + _this = _possibleConstructorReturn(this, (BaseIdentifierObfuscatingReplacer.__proto__ || _Object$getPrototypeOf(BaseIdentifierObfuscatingReplacer)).call(this, options)); + _this.namesMap = new _Map(); + _this.identifierNamesGenerator = identifierNamesGeneratorFactory(options); + return _this; + } + + _createClass(BaseIdentifierObfuscatingReplacer, [{ + key: "replace", + value: function replace(nodeValue, nodeIdentifier) { + var mapKey = "".concat(nodeValue, "-").concat(String(nodeIdentifier)); + + if (this.namesMap.has(mapKey)) { + nodeValue = this.namesMap.get(mapKey); + } + + return Nodes_1.Nodes.getIdentifierNode(nodeValue); + } + }, { + key: "storeGlobalName", + value: function storeGlobalName(nodeName, nodeIdentifier) { + if (this.isReservedName(nodeName)) { + return; + } + + var identifierName = this.identifierNamesGenerator.generateWithPrefix(); + this.namesMap.set("".concat(nodeName, "-").concat(String(nodeIdentifier)), identifierName); + } + }, { + key: "storeLocalName", + value: function storeLocalName(nodeName, nodeIdentifier) { + if (this.isReservedName(nodeName)) { + return; + } + + var identifierName = this.identifierNamesGenerator.generate(); + this.namesMap.set("".concat(nodeName, "-").concat(String(nodeIdentifier)), identifierName); + } + }, { + key: "isReservedName", + value: function isReservedName(name) { + return this.options.reservedNames.some(function (reservedName) { + return new RegExp(reservedName, 'g').exec(name) !== null; + }); + } + }]); + + return BaseIdentifierObfuscatingReplacer; +}(AbstractObfuscatingReplacer_1.AbstractObfuscatingReplacer); + +BaseIdentifierObfuscatingReplacer = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object])], BaseIdentifierObfuscatingReplacer); +exports.BaseIdentifierObfuscatingReplacer = BaseIdentifierObfuscatingReplacer; + +/***/ }), +/* 148 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var AbstractObfuscatingReplacer_1 = __webpack_require__(40); + +var Nodes_1 = __webpack_require__(15); + +var BooleanLiteralObfuscatingReplacer = BooleanLiteralObfuscatingReplacer_1 = +/*#__PURE__*/ +function (_AbstractObfuscatingR) { + _inherits(BooleanLiteralObfuscatingReplacer, _AbstractObfuscatingR); + + function BooleanLiteralObfuscatingReplacer(options) { + _classCallCheck(this, BooleanLiteralObfuscatingReplacer); + + return _possibleConstructorReturn(this, (BooleanLiteralObfuscatingReplacer.__proto__ || _Object$getPrototypeOf(BooleanLiteralObfuscatingReplacer)).call(this, options)); + } + + _createClass(BooleanLiteralObfuscatingReplacer, [{ + key: "replace", + value: function replace(nodeValue) { + return nodeValue ? BooleanLiteralObfuscatingReplacer_1.getTrueUnaryExpressionNode() : BooleanLiteralObfuscatingReplacer_1.getFalseUnaryExpressionNode(); + } + }], [{ + key: "getTrueUnaryExpressionNode", + value: function getTrueUnaryExpressionNode() { + return Nodes_1.Nodes.getUnaryExpressionNode('!', BooleanLiteralObfuscatingReplacer_1.getFalseUnaryExpressionNode()); + } + }, { + key: "getFalseUnaryExpressionNode", + value: function getFalseUnaryExpressionNode() { + return Nodes_1.Nodes.getUnaryExpressionNode('!', Nodes_1.Nodes.getArrayExpressionNode()); + } + }]); + + return BooleanLiteralObfuscatingReplacer; +}(AbstractObfuscatingReplacer_1.AbstractObfuscatingReplacer); + +BooleanLiteralObfuscatingReplacer = BooleanLiteralObfuscatingReplacer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object])], BooleanLiteralObfuscatingReplacer); +exports.BooleanLiteralObfuscatingReplacer = BooleanLiteralObfuscatingReplacer; +var BooleanLiteralObfuscatingReplacer_1; + +/***/ }), +/* 149 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var estraverse = tslib_1.__importStar(__webpack_require__(17)); + +var IdentifierObfuscatingReplacer_1 = __webpack_require__(26); + +var TransformationStage_1 = __webpack_require__(12); + +var AbstractNodeTransformer_1 = __webpack_require__(13); + +var NodeGuards_1 = __webpack_require__(8); + +var CatchClauseTransformer = +/*#__PURE__*/ +function (_AbstractNodeTransfor) { + _inherits(CatchClauseTransformer, _AbstractNodeTransfor); + + function CatchClauseTransformer(identifierObfuscatingReplacerFactory, randomGenerator, options) { + var _this; + + _classCallCheck(this, CatchClauseTransformer); + + _this = _possibleConstructorReturn(this, (CatchClauseTransformer.__proto__ || _Object$getPrototypeOf(CatchClauseTransformer)).call(this, randomGenerator, options)); + _this.identifierObfuscatingReplacer = identifierObfuscatingReplacerFactory(IdentifierObfuscatingReplacer_1.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer); + return _this; + } + + _createClass(CatchClauseTransformer, [{ + key: "getVisitor", + value: function getVisitor(transformationStage) { + var _this2 = this; + + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Obfuscating: + return { + enter: function enter(node, parentNode) { + if (parentNode && NodeGuards_1.NodeGuards.isCatchClauseNode(node)) { + return _this2.transformNode(node, parentNode); + } + } + }; + + default: + return null; + } + } + }, { + key: "transformNode", + value: function transformNode(catchClauseNode, parentNode) { + var nodeIdentifier = this.nodeIdentifier++; + this.storeCatchClauseParam(catchClauseNode, nodeIdentifier); + this.replaceCatchClauseParam(catchClauseNode, nodeIdentifier); + return catchClauseNode; + } + }, { + key: "storeCatchClauseParam", + value: function storeCatchClauseParam(catchClauseNode, nodeIdentifier) { + if (NodeGuards_1.NodeGuards.isIdentifierNode(catchClauseNode.param)) { + this.identifierObfuscatingReplacer.storeLocalName(catchClauseNode.param.name, nodeIdentifier); + } + } + }, { + key: "replaceCatchClauseParam", + value: function replaceCatchClauseParam(catchClauseNode, nodeIdentifier) { + var _this3 = this; + + estraverse.replace(catchClauseNode, { + enter: function enter(node, parentNode) { + if (parentNode && NodeGuards_1.NodeGuards.isReplaceableIdentifierNode(node, parentNode)) { + var newIdentifier = _this3.identifierObfuscatingReplacer.replace(node.name, nodeIdentifier); + + var newIdentifierName = newIdentifier.name; + + if (node.name !== newIdentifierName) { + node.name = newIdentifierName; + node.obfuscatedNode = true; + } + } + } + }); + } + }]); + + return CatchClauseTransformer; +}(AbstractNodeTransformer_1.AbstractNodeTransformer); + +CatchClauseTransformer = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], CatchClauseTransformer); +exports.CatchClauseTransformer = CatchClauseTransformer; + +/***/ }), +/* 150 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Map = __webpack_require__(16); + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var estraverse = tslib_1.__importStar(__webpack_require__(17)); + +var IdentifierObfuscatingReplacer_1 = __webpack_require__(26); + +var NodeType_1 = __webpack_require__(18); + +var TransformationStage_1 = __webpack_require__(12); + +var AbstractNodeTransformer_1 = __webpack_require__(13); + +var NodeGuards_1 = __webpack_require__(8); + +var NodeUtils_1 = __webpack_require__(9); + +var ClassDeclarationTransformer = +/*#__PURE__*/ +function (_AbstractNodeTransfor) { + _inherits(ClassDeclarationTransformer, _AbstractNodeTransfor); + + function ClassDeclarationTransformer(identifierObfuscatingReplacerFactory, randomGenerator, options) { + var _this; + + _classCallCheck(this, ClassDeclarationTransformer); + + _this = _possibleConstructorReturn(this, (ClassDeclarationTransformer.__proto__ || _Object$getPrototypeOf(ClassDeclarationTransformer)).call(this, randomGenerator, options)); + _this.replaceableIdentifiers = new _Map(); + _this.identifierObfuscatingReplacer = identifierObfuscatingReplacerFactory(IdentifierObfuscatingReplacer_1.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer); + return _this; + } + + _createClass(ClassDeclarationTransformer, [{ + key: "getVisitor", + value: function getVisitor(transformationStage) { + var _this2 = this; + + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Obfuscating: + return { + enter: function enter(node, parentNode) { + if (parentNode && NodeGuards_1.NodeGuards.isClassDeclarationNode(node)) { + return _this2.transformNode(node, parentNode); + } + } + }; + + default: + return null; + } + } + }, { + key: "transformNode", + value: function transformNode(classDeclarationNode, parentNode) { + var nodeIdentifier = this.nodeIdentifier++; + var blockScopeNode = NodeUtils_1.NodeUtils.getBlockScopesOfNode(classDeclarationNode)[0]; + var isGlobalDeclaration = blockScopeNode.type === NodeType_1.NodeType.Program; + + if (!this.options.renameGlobals && isGlobalDeclaration) { + return classDeclarationNode; + } + + this.storeClassName(classDeclarationNode, isGlobalDeclaration, nodeIdentifier); + + if (this.replaceableIdentifiers.has(blockScopeNode)) { + this.replaceScopeCachedIdentifiers(blockScopeNode, nodeIdentifier); + } else { + this.replaceScopeIdentifiers(blockScopeNode, nodeIdentifier); + } + + return classDeclarationNode; + } + }, { + key: "storeClassName", + value: function storeClassName(classDeclarationNode, isGlobalDeclaration, nodeIdentifier) { + if (isGlobalDeclaration) { + this.identifierObfuscatingReplacer.storeGlobalName(classDeclarationNode.id.name, nodeIdentifier); + } else { + this.identifierObfuscatingReplacer.storeLocalName(classDeclarationNode.id.name, nodeIdentifier); + } + } + }, { + key: "replaceScopeCachedIdentifiers", + value: function replaceScopeCachedIdentifiers(blockScopeNode, nodeIdentifier) { + var _this3 = this; + + var cachedReplaceableIdentifiers = this.replaceableIdentifiers.get(blockScopeNode); + cachedReplaceableIdentifiers.forEach(function (replaceableIdentifier) { + var newReplaceableIdentifier = _this3.identifierObfuscatingReplacer.replace(replaceableIdentifier.name, nodeIdentifier); + + replaceableIdentifier.name = newReplaceableIdentifier.name; + }); + } + }, { + key: "replaceScopeIdentifiers", + value: function replaceScopeIdentifiers(blockScopeNode, nodeIdentifier) { + var _this4 = this; + + var storedReplaceableIdentifiers = []; + estraverse.replace(blockScopeNode, { + enter: function enter(node, parentNode) { + if (parentNode && NodeGuards_1.NodeGuards.isReplaceableIdentifierNode(node, parentNode)) { + var newIdentifier = _this4.identifierObfuscatingReplacer.replace(node.name, nodeIdentifier); + + var newIdentifierName = newIdentifier.name; + + if (node.name !== newIdentifierName) { + node.name = newIdentifierName; + } else { + storedReplaceableIdentifiers.push(node); + } + } + } + }); + this.replaceableIdentifiers.set(blockScopeNode, storedReplaceableIdentifiers); + } + }]); + + return ClassDeclarationTransformer; +}(AbstractNodeTransformer_1.AbstractNodeTransformer); + +ClassDeclarationTransformer = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], ClassDeclarationTransformer); +exports.ClassDeclarationTransformer = ClassDeclarationTransformer; + +/***/ }), +/* 151 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Map = __webpack_require__(16); + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var estraverse = tslib_1.__importStar(__webpack_require__(17)); + +var IdentifierObfuscatingReplacer_1 = __webpack_require__(26); + +var NodeType_1 = __webpack_require__(18); + +var TransformationStage_1 = __webpack_require__(12); + +var AbstractNodeTransformer_1 = __webpack_require__(13); + +var NodeGuards_1 = __webpack_require__(8); + +var NodeUtils_1 = __webpack_require__(9); + +var FunctionDeclarationTransformer = +/*#__PURE__*/ +function (_AbstractNodeTransfor) { + _inherits(FunctionDeclarationTransformer, _AbstractNodeTransfor); + + function FunctionDeclarationTransformer(identifierObfuscatingReplacerFactory, randomGenerator, options) { + var _this; + + _classCallCheck(this, FunctionDeclarationTransformer); + + _this = _possibleConstructorReturn(this, (FunctionDeclarationTransformer.__proto__ || _Object$getPrototypeOf(FunctionDeclarationTransformer)).call(this, randomGenerator, options)); + _this.replaceableIdentifiers = new _Map(); + _this.identifierObfuscatingReplacer = identifierObfuscatingReplacerFactory(IdentifierObfuscatingReplacer_1.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer); + return _this; + } + + _createClass(FunctionDeclarationTransformer, [{ + key: "getVisitor", + value: function getVisitor(transformationStage) { + var _this2 = this; + + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Obfuscating: + return { + enter: function enter(node, parentNode) { + if (parentNode && NodeGuards_1.NodeGuards.isFunctionDeclarationNode(node)) { + return _this2.transformNode(node, parentNode); + } + } + }; + + default: + return null; + } + } + }, { + key: "transformNode", + value: function transformNode(functionDeclarationNode, parentNode) { + var nodeIdentifier = this.nodeIdentifier++; + var blockScopeNode = NodeUtils_1.NodeUtils.getBlockScopesOfNode(functionDeclarationNode)[0]; + var isGlobalDeclaration = blockScopeNode.type === NodeType_1.NodeType.Program; + + if (!this.options.renameGlobals && isGlobalDeclaration) { + return functionDeclarationNode; + } + + this.storeFunctionName(functionDeclarationNode, isGlobalDeclaration, nodeIdentifier); + + if (this.replaceableIdentifiers.has(blockScopeNode)) { + this.replaceScopeCachedIdentifiers(functionDeclarationNode, blockScopeNode, nodeIdentifier); + } else { + this.replaceScopeIdentifiers(blockScopeNode, nodeIdentifier); + } + + return functionDeclarationNode; + } + }, { + key: "storeFunctionName", + value: function storeFunctionName(functionDeclarationNode, isGlobalDeclaration, nodeIdentifier) { + if (isGlobalDeclaration) { + this.identifierObfuscatingReplacer.storeGlobalName(functionDeclarationNode.id.name, nodeIdentifier); + } else { + this.identifierObfuscatingReplacer.storeLocalName(functionDeclarationNode.id.name, nodeIdentifier); + } + } + }, { + key: "replaceScopeCachedIdentifiers", + value: function replaceScopeCachedIdentifiers(functionDeclarationNode, blockScopeNode, nodeIdentifier) { + var cachedReplaceableIdentifiersNamesMap = this.replaceableIdentifiers.get(blockScopeNode); + + if (!cachedReplaceableIdentifiersNamesMap) { + return; + } + + var cachedReplaceableIdentifiers = cachedReplaceableIdentifiersNamesMap.get(functionDeclarationNode.id.name); + + if (!cachedReplaceableIdentifiers) { + return; + } + + var cachedReplaceableIdentifierLength = cachedReplaceableIdentifiers.length; + + for (var i = 0; i < cachedReplaceableIdentifierLength; i++) { + var replaceableIdentifier = cachedReplaceableIdentifiers[i]; + var newReplaceableIdentifier = this.identifierObfuscatingReplacer.replace(replaceableIdentifier.name, nodeIdentifier); + replaceableIdentifier.name = newReplaceableIdentifier.name; + } + } + }, { + key: "replaceScopeIdentifiers", + value: function replaceScopeIdentifiers(blockScopeNode, nodeIdentifier) { + var _this3 = this; + + var storedReplaceableIdentifiersNamesMap = new _Map(); + estraverse.replace(blockScopeNode, { + enter: function enter(node, parentNode) { + if (parentNode && NodeGuards_1.NodeGuards.isReplaceableIdentifierNode(node, parentNode)) { + var newIdentifier = _this3.identifierObfuscatingReplacer.replace(node.name, nodeIdentifier); + + var newIdentifierName = newIdentifier.name; + + if (node.name !== newIdentifierName) { + node.name = newIdentifierName; + } else { + var storedReplaceableIdentifiers = storedReplaceableIdentifiersNamesMap.get(node.name) || []; + storedReplaceableIdentifiers.push(node); + storedReplaceableIdentifiersNamesMap.set(node.name, storedReplaceableIdentifiers); + } + } + } + }); + this.replaceableIdentifiers.set(blockScopeNode, storedReplaceableIdentifiersNamesMap); + } + }]); + + return FunctionDeclarationTransformer; +}(AbstractNodeTransformer_1.AbstractNodeTransformer); + +FunctionDeclarationTransformer = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], FunctionDeclarationTransformer); +exports.FunctionDeclarationTransformer = FunctionDeclarationTransformer; + +/***/ }), +/* 152 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Set = __webpack_require__(29); + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var estraverse = tslib_1.__importStar(__webpack_require__(17)); + +var IdentifierObfuscatingReplacer_1 = __webpack_require__(26); + +var TransformationStage_1 = __webpack_require__(12); + +var AbstractNodeTransformer_1 = __webpack_require__(13); + +var NodeGuards_1 = __webpack_require__(8); + +var FunctionTransformer = +/*#__PURE__*/ +function (_AbstractNodeTransfor) { + _inherits(FunctionTransformer, _AbstractNodeTransfor); + + function FunctionTransformer(identifierObfuscatingReplacerFactory, randomGenerator, options) { + var _this; + + _classCallCheck(this, FunctionTransformer); + + _this = _possibleConstructorReturn(this, (FunctionTransformer.__proto__ || _Object$getPrototypeOf(FunctionTransformer)).call(this, randomGenerator, options)); + _this.identifierObfuscatingReplacer = identifierObfuscatingReplacerFactory(IdentifierObfuscatingReplacer_1.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer); + return _this; + } + + _createClass(FunctionTransformer, [{ + key: "getVisitor", + value: function getVisitor(transformationStage) { + var _this2 = this; + + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Obfuscating: + return { + enter: function enter(node, parentNode) { + if (parentNode && (NodeGuards_1.NodeGuards.isFunctionDeclarationNode(node) || NodeGuards_1.NodeGuards.isFunctionExpressionNode(node) || NodeGuards_1.NodeGuards.isArrowFunctionExpressionNode(node))) { + return _this2.transformNode(node, parentNode); + } + } + }; + + default: + return null; + } + } + }, { + key: "transformNode", + value: function transformNode(functionNode, parentNode) { + var nodeIdentifier = this.nodeIdentifier++; + this.storeFunctionParams(functionNode, nodeIdentifier); + this.replaceFunctionParams(functionNode, nodeIdentifier); + return functionNode; + } + }, { + key: "storeFunctionParams", + value: function storeFunctionParams(functionNode, nodeIdentifier) { + var _this3 = this; + + functionNode.params.forEach(function (paramsNode) { + if (NodeGuards_1.NodeGuards.isObjectPatternNode(paramsNode)) { + return estraverse.VisitorOption.Skip; + } + + estraverse.traverse(paramsNode, { + enter: function enter(node) { + if (NodeGuards_1.NodeGuards.isAssignmentPatternNode(node) && NodeGuards_1.NodeGuards.isIdentifierNode(node.left)) { + _this3.identifierObfuscatingReplacer.storeLocalName(node.left.name, nodeIdentifier); + + return estraverse.VisitorOption.Skip; + } + + if (NodeGuards_1.NodeGuards.isIdentifierNode(node)) { + _this3.identifierObfuscatingReplacer.storeLocalName(node.name, nodeIdentifier); + } + } + }); + }); + } + }, { + key: "addIdentifiersToIgnoredIdentifierNamesSet", + value: function addIdentifiersToIgnoredIdentifierNamesSet(properties, ignoredIdentifierNamesSet) { + properties.forEach(function (property) { + if (!NodeGuards_1.NodeGuards.isIdentifierNode(property.key)) { + return; + } + + ignoredIdentifierNamesSet.add(property.key.name); + }); + } + }, { + key: "replaceFunctionParams", + value: function replaceFunctionParams(functionNode, nodeIdentifier) { + var _this4 = this; + + var ignoredIdentifierNamesSet = new _Set(); + var replaceVisitor = { + enter: function enter(node, parentNode) { + if (NodeGuards_1.NodeGuards.isObjectPatternNode(node)) { + _this4.addIdentifiersToIgnoredIdentifierNamesSet(node.properties, ignoredIdentifierNamesSet); + } + + if (parentNode && NodeGuards_1.NodeGuards.isReplaceableIdentifierNode(node, parentNode) && !ignoredIdentifierNamesSet.has(node.name)) { + var newIdentifier = _this4.identifierObfuscatingReplacer.replace(node.name, nodeIdentifier); + + var newIdentifierName = newIdentifier.name; + + if (node.name !== newIdentifierName) { + node.name = newIdentifierName; + node.obfuscatedNode = true; + } + } + } + }; + functionNode.params.forEach(function (paramsNode) { + return estraverse.replace(paramsNode, replaceVisitor); + }); + estraverse.replace(functionNode.body, replaceVisitor); + } + }]); + + return FunctionTransformer; +}(AbstractNodeTransformer_1.AbstractNodeTransformer); + +FunctionTransformer = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], FunctionTransformer); +exports.FunctionTransformer = FunctionTransformer; + +/***/ }), +/* 153 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var estraverse = tslib_1.__importStar(__webpack_require__(17)); + +var IdentifierObfuscatingReplacer_1 = __webpack_require__(26); + +var TransformationStage_1 = __webpack_require__(12); + +var AbstractNodeTransformer_1 = __webpack_require__(13); + +var NodeGuards_1 = __webpack_require__(8); + +var LabeledStatementTransformer = +/*#__PURE__*/ +function (_AbstractNodeTransfor) { + _inherits(LabeledStatementTransformer, _AbstractNodeTransfor); + + function LabeledStatementTransformer(identifierObfuscatingReplacerFactory, randomGenerator, options) { + var _this; + + _classCallCheck(this, LabeledStatementTransformer); + + _this = _possibleConstructorReturn(this, (LabeledStatementTransformer.__proto__ || _Object$getPrototypeOf(LabeledStatementTransformer)).call(this, randomGenerator, options)); + _this.identifierObfuscatingReplacer = identifierObfuscatingReplacerFactory(IdentifierObfuscatingReplacer_1.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer); + return _this; + } + + _createClass(LabeledStatementTransformer, [{ + key: "getVisitor", + value: function getVisitor(transformationStage) { + var _this2 = this; + + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Obfuscating: + return { + enter: function enter(node, parentNode) { + if (parentNode && NodeGuards_1.NodeGuards.isLabeledStatementNode(node)) { + return _this2.transformNode(node, parentNode); + } + } + }; + + default: + return null; + } + } + }, { + key: "transformNode", + value: function transformNode(labeledStatementNode, parentNode) { + var nodeIdentifier = this.nodeIdentifier++; + this.storeLabeledStatementName(labeledStatementNode, nodeIdentifier); + this.replaceLabeledStatementName(labeledStatementNode, nodeIdentifier); + return labeledStatementNode; + } + }, { + key: "storeLabeledStatementName", + value: function storeLabeledStatementName(labeledStatementNode, nodeIdentifier) { + this.identifierObfuscatingReplacer.storeLocalName(labeledStatementNode.label.name, nodeIdentifier); + } + }, { + key: "replaceLabeledStatementName", + value: function replaceLabeledStatementName(labeledStatementNode, nodeIdentifier) { + var _this3 = this; + + estraverse.replace(labeledStatementNode, { + enter: function enter(node, parentNode) { + if (parentNode && NodeGuards_1.NodeGuards.isLabelIdentifierNode(node, parentNode)) { + var newIdentifier = _this3.identifierObfuscatingReplacer.replace(node.name, nodeIdentifier); + + node.name = newIdentifier.name; + } + } + }); + } + }]); + + return LabeledStatementTransformer; +}(AbstractNodeTransformer_1.AbstractNodeTransformer); + +LabeledStatementTransformer = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], LabeledStatementTransformer); +exports.LabeledStatementTransformer = LabeledStatementTransformer; + +/***/ }), +/* 154 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _typeof = __webpack_require__(50); + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var LiteralObfuscatingReplacer_1 = __webpack_require__(59); + +var TransformationStage_1 = __webpack_require__(12); + +var AbstractNodeTransformer_1 = __webpack_require__(13); + +var NodeGuards_1 = __webpack_require__(8); + +var LiteralTransformer = +/*#__PURE__*/ +function (_AbstractNodeTransfor) { + _inherits(LiteralTransformer, _AbstractNodeTransfor); + + function LiteralTransformer(literalObfuscatingReplacerFactory, randomGenerator, options) { + var _this; + + _classCallCheck(this, LiteralTransformer); + + _this = _possibleConstructorReturn(this, (LiteralTransformer.__proto__ || _Object$getPrototypeOf(LiteralTransformer)).call(this, randomGenerator, options)); + _this.literalObfuscatingReplacerFactory = literalObfuscatingReplacerFactory; + return _this; + } + + _createClass(LiteralTransformer, [{ + key: "getVisitor", + value: function getVisitor(transformationStage) { + var _this2 = this; + + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Obfuscating: + return { + enter: function enter(node, parentNode) { + if (parentNode && NodeGuards_1.NodeGuards.isLiteralNode(node) && !node.obfuscatedNode) { + return _this2.transformNode(node, parentNode); + } + } + }; + + default: + return null; + } + } + }, { + key: "transformNode", + value: function transformNode(literalNode, parentNode) { + if (parentNode && NodeGuards_1.NodeGuards.isPropertyNode(parentNode) && parentNode.key === literalNode) { + return literalNode; + } + + switch (_typeof(literalNode.value)) { + case 'boolean': + return this.literalObfuscatingReplacerFactory(LiteralObfuscatingReplacer_1.LiteralObfuscatingReplacer.BooleanLiteralObfuscatingReplacer).replace(literalNode.value); + + case 'number': + return this.literalObfuscatingReplacerFactory(LiteralObfuscatingReplacer_1.LiteralObfuscatingReplacer.NumberLiteralObfuscatingReplacer).replace(literalNode.value); + + case 'string': + return this.literalObfuscatingReplacerFactory(LiteralObfuscatingReplacer_1.LiteralObfuscatingReplacer.StringLiteralObfuscatingReplacer).replace(literalNode.value); + + default: + return literalNode; + } + } + }]); + + return LiteralTransformer; +}(AbstractNodeTransformer_1.AbstractNodeTransformer); + +LiteralTransformer = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IObfuscatingReplacer)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], LiteralTransformer); +exports.LiteralTransformer = LiteralTransformer; + +/***/ }), +/* 155 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Map = __webpack_require__(16); + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var AbstractObfuscatingReplacer_1 = __webpack_require__(40); + +var Nodes_1 = __webpack_require__(15); + +var Utils_1 = __webpack_require__(32); + +var NumberLiteralObfuscatingReplacer = +/*#__PURE__*/ +function (_AbstractObfuscatingR) { + _inherits(NumberLiteralObfuscatingReplacer, _AbstractObfuscatingR); + + function NumberLiteralObfuscatingReplacer(options) { + var _this; + + _classCallCheck(this, NumberLiteralObfuscatingReplacer); + + _this = _possibleConstructorReturn(this, (NumberLiteralObfuscatingReplacer.__proto__ || _Object$getPrototypeOf(NumberLiteralObfuscatingReplacer)).call(this, options)); + _this.numberLiteralCache = new _Map(); + return _this; + } + + _createClass(NumberLiteralObfuscatingReplacer, [{ + key: "replace", + value: function replace(nodeValue) { + var rawValue; + + if (this.numberLiteralCache.has(nodeValue)) { + rawValue = this.numberLiteralCache.get(nodeValue); + } else { + if (!Utils_1.Utils.isCeilNumber(nodeValue)) { + rawValue = String(nodeValue); + } else { + rawValue = "".concat(Utils_1.Utils.hexadecimalPrefix).concat(Utils_1.Utils.decToHex(nodeValue)); + } + + this.numberLiteralCache.set(nodeValue, rawValue); + } + + return Nodes_1.Nodes.getLiteralNode(nodeValue, rawValue); + } + }]); + + return NumberLiteralObfuscatingReplacer; +}(AbstractObfuscatingReplacer_1.AbstractObfuscatingReplacer); + +NumberLiteralObfuscatingReplacer = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object])], NumberLiteralObfuscatingReplacer); +exports.NumberLiteralObfuscatingReplacer = NumberLiteralObfuscatingReplacer; + +/***/ }), +/* 156 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var NodeType_1 = __webpack_require__(18); + +var TransformationStage_1 = __webpack_require__(12); + +var AbstractNodeTransformer_1 = __webpack_require__(13); + +var NodeGuards_1 = __webpack_require__(8); + +var ObjectExpressionTransformer = ObjectExpressionTransformer_1 = +/*#__PURE__*/ +function (_AbstractNodeTransfor) { + _inherits(ObjectExpressionTransformer, _AbstractNodeTransfor); + + function ObjectExpressionTransformer(randomGenerator, options) { + _classCallCheck(this, ObjectExpressionTransformer); + + return _possibleConstructorReturn(this, (ObjectExpressionTransformer.__proto__ || _Object$getPrototypeOf(ObjectExpressionTransformer)).call(this, randomGenerator, options)); + } + + _createClass(ObjectExpressionTransformer, [{ + key: "getVisitor", + value: function getVisitor(transformationStage) { + var _this = this; + + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Obfuscating: + return { + enter: function enter(node, parentNode) { + if (parentNode && NodeGuards_1.NodeGuards.isObjectExpressionNode(node)) { + return _this.transformNode(node, parentNode); + } + } + }; + + default: + return null; + } + } + }, { + key: "transformNode", + value: function transformNode(objectExpressionNode, parentNode) { + objectExpressionNode.properties.forEach(function (property) { + if (property.computed) { + return; + } + + if (property.shorthand) { + property.shorthand = false; + } + + if (NodeGuards_1.NodeGuards.isIdentifierNode(property.key)) { + property.key = ObjectExpressionTransformer_1.transformIdentifierPropertyKey(property.key); + } + }); + return objectExpressionNode; + } + }], [{ + key: "transformIdentifierPropertyKey", + value: function transformIdentifierPropertyKey(node) { + return { + type: NodeType_1.NodeType.Literal, + value: node.name, + raw: "'".concat(node.name, "'") + }; + } + }]); + + return ObjectExpressionTransformer; +}(AbstractNodeTransformer_1.AbstractNodeTransformer); + +ObjectExpressionTransformer = ObjectExpressionTransformer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object])], ObjectExpressionTransformer); +exports.ObjectExpressionTransformer = ObjectExpressionTransformer; +var ObjectExpressionTransformer_1; + +/***/ }), +/* 157 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Map = __webpack_require__(16); + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var StringArrayEncoding_1 = __webpack_require__(37); + +var AbstractObfuscatingReplacer_1 = __webpack_require__(40); + +var Nodes_1 = __webpack_require__(15); + +var Utils_1 = __webpack_require__(32); + +var StringLiteralObfuscatingReplacer = StringLiteralObfuscatingReplacer_1 = +/*#__PURE__*/ +function (_AbstractObfuscatingR) { + _inherits(StringLiteralObfuscatingReplacer, _AbstractObfuscatingR); + + function StringLiteralObfuscatingReplacer(stringArrayStorage, escapeSequenceEncoder, randomGenerator, cryptUtils, options) { + var _this; + + _classCallCheck(this, StringLiteralObfuscatingReplacer); + + _this = _possibleConstructorReturn(this, (StringLiteralObfuscatingReplacer.__proto__ || _Object$getPrototypeOf(StringLiteralObfuscatingReplacer)).call(this, options)); + _this.nodesCache = new _Map(); + _this.stringLiteralHexadecimalIndexCache = new _Map(); + _this.stringArrayStorage = stringArrayStorage; + _this.escapeSequenceEncoder = escapeSequenceEncoder; + _this.randomGenerator = randomGenerator; + _this.cryptUtils = cryptUtils; + _this.rc4Keys = _this.randomGenerator.getRandomGenerator().n(function () { + return _this.randomGenerator.getRandomGenerator().string({ + length: StringLiteralObfuscatingReplacer_1.rc4KeyLength + }); + }, StringLiteralObfuscatingReplacer_1.rc4KeysCount); + return _this; + } + + _createClass(StringLiteralObfuscatingReplacer, [{ + key: "replace", + value: function replace(nodeValue) { + var useStringArray = this.canUseStringArray(nodeValue); + var cacheKey = "".concat(nodeValue, "-").concat(String(useStringArray)); + var useCacheValue = this.nodesCache.has(cacheKey) && this.options.stringArrayEncoding !== StringArrayEncoding_1.StringArrayEncoding.Rc4; + + if (useCacheValue) { + return this.nodesCache.get(cacheKey); + } + + var resultNode = useStringArray ? this.replaceWithStringArrayCallNode(nodeValue) : this.replaceWithLiteralNode(nodeValue); + this.nodesCache.set(cacheKey, resultNode); + return resultNode; + } + }, { + key: "canUseStringArray", + value: function canUseStringArray(nodeValue) { + return this.options.stringArray && nodeValue.length >= StringLiteralObfuscatingReplacer_1.minimumLengthForStringArray && this.randomGenerator.getMathRandom() <= this.options.stringArrayThreshold; + } + }, { + key: "getStringArrayHexadecimalIndex", + value: function getStringArrayHexadecimalIndex(value, stringArrayStorageLength) { + if (this.stringLiteralHexadecimalIndexCache.has(value)) { + return { + fromCache: true, + index: this.stringLiteralHexadecimalIndexCache.get(value) + }; + } + + var hexadecimalRawIndex = Utils_1.Utils.decToHex(stringArrayStorageLength); + var hexadecimalIndex = "".concat(Utils_1.Utils.hexadecimalPrefix).concat(hexadecimalRawIndex); + this.stringLiteralHexadecimalIndexCache.set(value, hexadecimalIndex); + return { + fromCache: false, + index: hexadecimalIndex + }; + } + }, { + key: "getEncodedValue", + value: function getEncodedValue(value) { + var encodedValue; + var key = null; + + switch (this.options.stringArrayEncoding) { + case StringArrayEncoding_1.StringArrayEncoding.Rc4: + key = this.randomGenerator.getRandomGenerator().pickone(this.rc4Keys); + encodedValue = this.cryptUtils.btoa(this.cryptUtils.rc4(value, key)); + break; + + case StringArrayEncoding_1.StringArrayEncoding.Base64: + encodedValue = this.cryptUtils.btoa(value); + break; + + default: + encodedValue = value; + } + + return { + encodedValue: encodedValue, + key: key + }; + } + }, { + key: "replaceWithLiteralNode", + value: function replaceWithLiteralNode(value) { + return Nodes_1.Nodes.getLiteralNode(this.escapeSequenceEncoder.encode(value, this.options.unicodeEscapeSequence)); + } + }, { + key: "replaceWithStringArrayCallNode", + value: function replaceWithStringArrayCallNode(value) { + var _getEncodedValue = this.getEncodedValue(value), + encodedValue = _getEncodedValue.encodedValue, + key = _getEncodedValue.key; + + var escapedValue = this.escapeSequenceEncoder.encode(encodedValue, this.options.unicodeEscapeSequence); + var stringArrayStorageLength = this.stringArrayStorage.getLength(); + var stringArrayStorageCallsWrapperName = this.stringArrayStorage.getStorageId().split('|')[1]; + + var _getStringArrayHexade = this.getStringArrayHexadecimalIndex(escapedValue, stringArrayStorageLength), + fromCache = _getStringArrayHexade.fromCache, + index = _getStringArrayHexade.index; + + if (!fromCache) { + this.stringArrayStorage.set(stringArrayStorageLength, escapedValue); + } + + var callExpressionArgs = [StringLiteralObfuscatingReplacer_1.getHexadecimalLiteralNode(index)]; + + if (key) { + callExpressionArgs.push(StringLiteralObfuscatingReplacer_1.getRc4KeyLiteralNode(this.escapeSequenceEncoder.encode(key, this.options.unicodeEscapeSequence))); + } + + var stringArrayIdentifierNode = Nodes_1.Nodes.getIdentifierNode(stringArrayStorageCallsWrapperName); + stringArrayIdentifierNode.obfuscatedNode = true; + return Nodes_1.Nodes.getCallExpressionNode(stringArrayIdentifierNode, callExpressionArgs); + } + }], [{ + key: "getHexadecimalLiteralNode", + value: function getHexadecimalLiteralNode(hexadecimalIndex) { + var hexadecimalLiteralNode = Nodes_1.Nodes.getLiteralNode(hexadecimalIndex); + hexadecimalLiteralNode.obfuscatedNode = true; + return hexadecimalLiteralNode; + } + }, { + key: "getRc4KeyLiteralNode", + value: function getRc4KeyLiteralNode(literalValue) { + var rc4KeyLiteralNode = Nodes_1.Nodes.getLiteralNode(literalValue); + rc4KeyLiteralNode.obfuscatedNode = true; + return rc4KeyLiteralNode; + } + }]); + + return StringLiteralObfuscatingReplacer; +}(AbstractObfuscatingReplacer_1.AbstractObfuscatingReplacer); + +StringLiteralObfuscatingReplacer.minimumLengthForStringArray = 3; +StringLiteralObfuscatingReplacer.rc4KeyLength = 4; +StringLiteralObfuscatingReplacer.rc4KeysCount = 50; +StringLiteralObfuscatingReplacer = StringLiteralObfuscatingReplacer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.TStringArrayStorage)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IEscapeSequenceEncoder)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICryptUtils)), tslib_1.__param(4, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object, Object, Object, Object])], StringLiteralObfuscatingReplacer); +exports.StringLiteralObfuscatingReplacer = StringLiteralObfuscatingReplacer; +var StringLiteralObfuscatingReplacer_1; + +/***/ }), +/* 158 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Map = __webpack_require__(16); + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var estraverse = tslib_1.__importStar(__webpack_require__(17)); + +var IdentifierObfuscatingReplacer_1 = __webpack_require__(26); + +var NodeType_1 = __webpack_require__(18); + +var TransformationStage_1 = __webpack_require__(12); + +var AbstractNodeTransformer_1 = __webpack_require__(13); + +var NodeGuards_1 = __webpack_require__(8); + +var NodeUtils_1 = __webpack_require__(9); + +var VariableDeclarationTransformer = +/*#__PURE__*/ +function (_AbstractNodeTransfor) { + _inherits(VariableDeclarationTransformer, _AbstractNodeTransfor); + + function VariableDeclarationTransformer(identifierObfuscatingReplacerFactory, randomGenerator, options) { + var _this; + + _classCallCheck(this, VariableDeclarationTransformer); + + _this = _possibleConstructorReturn(this, (VariableDeclarationTransformer.__proto__ || _Object$getPrototypeOf(VariableDeclarationTransformer)).call(this, randomGenerator, options)); + _this.replaceableIdentifiers = new _Map(); + _this.identifierObfuscatingReplacer = identifierObfuscatingReplacerFactory(IdentifierObfuscatingReplacer_1.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer); + return _this; + } + + _createClass(VariableDeclarationTransformer, [{ + key: "getVisitor", + value: function getVisitor(transformationStage) { + var _this2 = this; + + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Obfuscating: + return { + enter: function enter(node, parentNode) { + if (parentNode && NodeGuards_1.NodeGuards.isVariableDeclarationNode(node)) { + return _this2.transformNode(node, parentNode); + } + } + }; + + default: + return null; + } + } + }, { + key: "transformNode", + value: function transformNode(variableDeclarationNode, parentNode) { + var blockScopeNode = NodeUtils_1.NodeUtils.getBlockScopesOfNode(variableDeclarationNode)[0]; + var isGlobalDeclaration = blockScopeNode.type === NodeType_1.NodeType.Program; + + if (!this.options.renameGlobals && isGlobalDeclaration) { + return variableDeclarationNode; + } + + var nodeIdentifier = this.nodeIdentifier++; + var scopeNode = variableDeclarationNode.kind === 'var' ? blockScopeNode : parentNode; + this.storeVariableNames(variableDeclarationNode, isGlobalDeclaration, nodeIdentifier); + + if (this.replaceableIdentifiers.has(scopeNode)) { + this.replaceScopeCachedIdentifiers(variableDeclarationNode, scopeNode, nodeIdentifier); + } else { + this.replaceScopeIdentifiers(scopeNode, nodeIdentifier); + } + + return variableDeclarationNode; + } + }, { + key: "storeVariableNames", + value: function storeVariableNames(variableDeclarationNode, isGlobalDeclaration, nodeIdentifier) { + var _this3 = this; + + this.traverseDeclarationIdentifiers(variableDeclarationNode, function (identifierNode) { + if (isGlobalDeclaration) { + _this3.identifierObfuscatingReplacer.storeGlobalName(identifierNode.name, nodeIdentifier); + } else { + _this3.identifierObfuscatingReplacer.storeLocalName(identifierNode.name, nodeIdentifier); + } + }); + } + }, { + key: "replaceScopeCachedIdentifiers", + value: function replaceScopeCachedIdentifiers(variableDeclarationNode, scopeNode, nodeIdentifier) { + var _this4 = this; + + var cachedReplaceableIdentifiersNamesMap = this.replaceableIdentifiers.get(scopeNode); + + if (!cachedReplaceableIdentifiersNamesMap) { + return; + } + + var identifierNames = []; + this.traverseDeclarationIdentifiers(variableDeclarationNode, function (identifierNode) { + identifierNames.push(identifierNode.name); + }); + identifierNames.forEach(function (identifierName) { + var cachedReplaceableIdentifiers = cachedReplaceableIdentifiersNamesMap.get(identifierName); + + if (!cachedReplaceableIdentifiers) { + return; + } + + var cachedReplaceableIdentifierLength = cachedReplaceableIdentifiers.length; + + for (var i = 0; i < cachedReplaceableIdentifierLength; i++) { + var replaceableIdentifier = cachedReplaceableIdentifiers[i]; + + if (identifierName !== replaceableIdentifier.name) { + continue; + } + + var newReplaceableIdentifier = _this4.identifierObfuscatingReplacer.replace(replaceableIdentifier.name, nodeIdentifier); + + replaceableIdentifier.name = newReplaceableIdentifier.name; + } + }); + } + }, { + key: "replaceScopeIdentifiers", + value: function replaceScopeIdentifiers(blockScopeNode, nodeIdentifier) { + var _this5 = this; + + var storedReplaceableIdentifiersNamesMap = new _Map(); + estraverse.replace(blockScopeNode, { + enter: function enter(node, parentNode) { + if (parentNode && !node.obfuscatedNode && NodeGuards_1.NodeGuards.isReplaceableIdentifierNode(node, parentNode)) { + var newIdentifier = _this5.identifierObfuscatingReplacer.replace(node.name, nodeIdentifier); + + var newIdentifierName = newIdentifier.name; + + if (node.name !== newIdentifierName) { + node.name = newIdentifierName; + } else { + var storedReplaceableIdentifiers = storedReplaceableIdentifiersNamesMap.get(node.name) || []; + storedReplaceableIdentifiers.push(node); + storedReplaceableIdentifiersNamesMap.set(node.name, storedReplaceableIdentifiers); + } + } + } + }); + this.replaceableIdentifiers.set(blockScopeNode, storedReplaceableIdentifiersNamesMap); + } + }, { + key: "traverseDeclarationIdentifiers", + value: function traverseDeclarationIdentifiers(variableDeclarationNode, callback) { + variableDeclarationNode.declarations.forEach(function (declarationNode) { + if (NodeGuards_1.NodeGuards.isObjectPatternNode(declarationNode.id)) { + return estraverse.VisitorOption.Skip; + } + + estraverse.traverse(declarationNode.id, { + enter: function enter(node) { + if (NodeGuards_1.NodeGuards.isIdentifierNode(node)) { + callback(node); + } + } + }); + }); + } + }]); + + return VariableDeclarationTransformer; +}(AbstractNodeTransformer_1.AbstractNodeTransformer); + +VariableDeclarationTransformer = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], VariableDeclarationTransformer); +exports.VariableDeclarationTransformer = VariableDeclarationTransformer; + +/***/ }), +/* 159 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var Options_1 = __webpack_require__(160); + +var OptionsNormalizer_1 = __webpack_require__(163); + +exports.optionsModule = new inversify_1.ContainerModule(function (bind) { + bind(ServiceIdentifiers_1.ServiceIdentifiers.IOptions).to(Options_1.Options).inSingletonScope(); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IOptionsNormalizer).to(OptionsNormalizer_1.OptionsNormalizer).inSingletonScope(); +}); + +/***/ }), +/* 160 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$assign = __webpack_require__(11); + +var _classCallCheck = __webpack_require__(0); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var class_validator_1 = __webpack_require__(161); + +var IdentifierNamesGenerator_1 = __webpack_require__(35); + +var ObfuscationTarget_1 = __webpack_require__(21); + +var SourceMapMode_1 = __webpack_require__(36); + +var StringArrayEncoding_1 = __webpack_require__(37); + +var Default_1 = __webpack_require__(46); + +var ValidationErrorsFormatter_1 = __webpack_require__(162); + +var Options = Options_1 = function Options(inputOptions, optionsNormalizer) { + _classCallCheck(this, Options); + + _Object$assign(this, Default_1.DEFAULT_PRESET, inputOptions); + + var errors = class_validator_1.validateSync(this, Options_1.validatorOptions); + + if (errors.length) { + throw new ReferenceError("Validation failed. errors:\n".concat(ValidationErrorsFormatter_1.ValidationErrorsFormatter.format(errors))); + } + + _Object$assign(this, optionsNormalizer.normalize(this)); +}; + +Options.validatorOptions = { + validationError: { + target: false + } +}; + +tslib_1.__decorate([class_validator_1.IsBoolean(), tslib_1.__metadata("design:type", Boolean)], Options.prototype, "compact", void 0); + +tslib_1.__decorate([class_validator_1.IsBoolean(), tslib_1.__metadata("design:type", Boolean)], Options.prototype, "controlFlowFlattening", void 0); + +tslib_1.__decorate([class_validator_1.IsNumber(), class_validator_1.Min(0), class_validator_1.Max(1), tslib_1.__metadata("design:type", Number)], Options.prototype, "controlFlowFlatteningThreshold", void 0); + +tslib_1.__decorate([class_validator_1.IsBoolean(), tslib_1.__metadata("design:type", Boolean)], Options.prototype, "deadCodeInjection", void 0); + +tslib_1.__decorate([class_validator_1.IsNumber(), tslib_1.__metadata("design:type", Number)], Options.prototype, "deadCodeInjectionThreshold", void 0); + +tslib_1.__decorate([class_validator_1.IsBoolean(), tslib_1.__metadata("design:type", Boolean)], Options.prototype, "debugProtection", void 0); + +tslib_1.__decorate([class_validator_1.IsBoolean(), tslib_1.__metadata("design:type", Boolean)], Options.prototype, "debugProtectionInterval", void 0); + +tslib_1.__decorate([class_validator_1.IsBoolean(), tslib_1.__metadata("design:type", Boolean)], Options.prototype, "disableConsoleOutput", void 0); + +tslib_1.__decorate([class_validator_1.IsArray(), class_validator_1.ArrayUnique(), class_validator_1.IsString({ + each: true +}), tslib_1.__metadata("design:type", Array)], Options.prototype, "domainLock", void 0); + +tslib_1.__decorate([class_validator_1.IsIn([IdentifierNamesGenerator_1.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator, IdentifierNamesGenerator_1.IdentifierNamesGenerator.MangledIdentifierNamesGenerator]), tslib_1.__metadata("design:type", String)], Options.prototype, "identifierNamesGenerator", void 0); + +tslib_1.__decorate([class_validator_1.IsString(), tslib_1.__metadata("design:type", String)], Options.prototype, "identifiersPrefix", void 0); + +tslib_1.__decorate([class_validator_1.IsBoolean(), tslib_1.__metadata("design:type", Boolean)], Options.prototype, "log", void 0); + +tslib_1.__decorate([class_validator_1.IsBoolean(), tslib_1.__metadata("design:type", Boolean)], Options.prototype, "renameGlobals", void 0); + +tslib_1.__decorate([class_validator_1.IsArray(), class_validator_1.ArrayUnique(), class_validator_1.IsString({ + each: true +}), tslib_1.__metadata("design:type", Array)], Options.prototype, "reservedNames", void 0); + +tslib_1.__decorate([class_validator_1.IsBoolean(), tslib_1.__metadata("design:type", Boolean)], Options.prototype, "rotateStringArray", void 0); + +tslib_1.__decorate([class_validator_1.IsNumber(), tslib_1.__metadata("design:type", Number)], Options.prototype, "seed", void 0); + +tslib_1.__decorate([class_validator_1.IsBoolean(), tslib_1.__metadata("design:type", Boolean)], Options.prototype, "selfDefending", void 0); + +tslib_1.__decorate([class_validator_1.IsBoolean(), tslib_1.__metadata("design:type", Boolean)], Options.prototype, "sourceMap", void 0); + +tslib_1.__decorate([class_validator_1.IsString(), class_validator_1.ValidateIf(function (options) { + return Boolean(options.sourceMapBaseUrl); +}), class_validator_1.IsUrl({ + require_protocol: true, + require_tld: false, + require_valid_protocol: true +}), tslib_1.__metadata("design:type", String)], Options.prototype, "sourceMapBaseUrl", void 0); + +tslib_1.__decorate([class_validator_1.IsString(), tslib_1.__metadata("design:type", String)], Options.prototype, "sourceMapFileName", void 0); + +tslib_1.__decorate([class_validator_1.IsIn([SourceMapMode_1.SourceMapMode.Inline, SourceMapMode_1.SourceMapMode.Separate]), tslib_1.__metadata("design:type", String)], Options.prototype, "sourceMapMode", void 0); + +tslib_1.__decorate([class_validator_1.IsBoolean(), tslib_1.__metadata("design:type", Boolean)], Options.prototype, "stringArray", void 0); + +tslib_1.__decorate([class_validator_1.IsIn([true, false, StringArrayEncoding_1.StringArrayEncoding.Base64, StringArrayEncoding_1.StringArrayEncoding.Rc4]), tslib_1.__metadata("design:type", Object)], Options.prototype, "stringArrayEncoding", void 0); + +tslib_1.__decorate([class_validator_1.IsNumber(), class_validator_1.Min(0), class_validator_1.Max(1), tslib_1.__metadata("design:type", Number)], Options.prototype, "stringArrayThreshold", void 0); + +tslib_1.__decorate([class_validator_1.IsIn([ObfuscationTarget_1.ObfuscationTarget.Browser, ObfuscationTarget_1.ObfuscationTarget.Extension, ObfuscationTarget_1.ObfuscationTarget.Node]), tslib_1.__metadata("design:type", String)], Options.prototype, "target", void 0); + +tslib_1.__decorate([class_validator_1.IsBoolean(), tslib_1.__metadata("design:type", Boolean)], Options.prototype, "transformObjectKeys", void 0); + +tslib_1.__decorate([class_validator_1.IsBoolean(), tslib_1.__metadata("design:type", Boolean)], Options.prototype, "unicodeEscapeSequence", void 0); + +Options = Options_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.TInputOptions)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptionsNormalizer)), tslib_1.__metadata("design:paramtypes", [Object, Object])], Options); +exports.Options = Options; +var Options_1; + +/***/ }), +/* 161 */ +/***/ (function(module, exports) { + +module.exports = require("class-validator"); + +/***/ }), +/* 162 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _getIterator = __webpack_require__(33); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var ValidationErrorsFormatter = +/*#__PURE__*/ +function () { + function ValidationErrorsFormatter() { + _classCallCheck(this, ValidationErrorsFormatter); + } + + _createClass(ValidationErrorsFormatter, null, [{ + key: "format", + value: function format(validationErrors) { + var errorsArray = []; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = _getIterator(validationErrors), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _error = _step.value; + errorsArray.push(ValidationErrorsFormatter.formatError(_error)); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return errorsArray.join('\n'); + } + }, { + key: "formatError", + value: function formatError(validationError) { + var constraints = validationError.constraints; + var errorString = "`".concat(validationError.property, "` errors:\n"); + + for (var constraint in constraints) { + if (!constraints.hasOwnProperty(constraint)) { + continue; + } + + errorString += " - ".concat(constraints[constraint], "\n"); + } + + return errorString; + } + }]); + + return ValidationErrorsFormatter; +}(); + +exports.ValidationErrorsFormatter = ValidationErrorsFormatter; + +/***/ }), +/* 163 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _getIterator = __webpack_require__(33); + +var _Object$assign = __webpack_require__(11); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ControlFlowFlatteningThresholdRule_1 = __webpack_require__(164); + +var DeadCodeInjectionRule_1 = __webpack_require__(165); + +var DeadCodeInjectionThresholdRule_1 = __webpack_require__(166); + +var DomainLockRule_1 = __webpack_require__(167); + +var SelfDefendingRule_1 = __webpack_require__(168); + +var SourceMapBaseUrlRule_1 = __webpack_require__(169); + +var SourceMapFileNameRule_1 = __webpack_require__(170); + +var StringArrayRule_1 = __webpack_require__(171); + +var StringArrayEncodingRule_1 = __webpack_require__(172); + +var StringArrayThresholdRule_1 = __webpack_require__(173); + +var OptionsNormalizer = OptionsNormalizer_1 = +/*#__PURE__*/ +function () { + function OptionsNormalizer() { + _classCallCheck(this, OptionsNormalizer); + } + + _createClass(OptionsNormalizer, [{ + key: "normalize", + value: function normalize(options) { + var normalizedOptions = _Object$assign({}, options); + + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = _getIterator(OptionsNormalizer_1.normalizerRules), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _normalizerRule = _step.value; + normalizedOptions = _normalizerRule(normalizedOptions); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return normalizedOptions; + } + }]); + + return OptionsNormalizer; +}(); + +OptionsNormalizer.normalizerRules = [ControlFlowFlatteningThresholdRule_1.ControlFlowFlatteningThresholdRule, DeadCodeInjectionRule_1.DeadCodeInjectionRule, DeadCodeInjectionThresholdRule_1.DeadCodeInjectionThresholdRule, DomainLockRule_1.DomainLockRule, SelfDefendingRule_1.SelfDefendingRule, SourceMapBaseUrlRule_1.SourceMapBaseUrlRule, SourceMapFileNameRule_1.SourceMapFileNameRule, StringArrayRule_1.StringArrayRule, StringArrayEncodingRule_1.StringArrayEncodingRule, StringArrayThresholdRule_1.StringArrayThresholdRule]; +OptionsNormalizer = OptionsNormalizer_1 = tslib_1.__decorate([inversify_1.injectable()], OptionsNormalizer); +exports.OptionsNormalizer = OptionsNormalizer; +var OptionsNormalizer_1; + +/***/ }), +/* 164 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$assign = __webpack_require__(11); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.ControlFlowFlatteningThresholdRule = function (options) { + if (options.controlFlowFlatteningThreshold === 0) { + options = _Object$assign({}, options, { + controlFlowFlattening: false, + controlFlowFlatteningThreshold: 0 + }); + } + + return options; +}; + +/***/ }), +/* 165 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$assign = __webpack_require__(11); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var Default_1 = __webpack_require__(46); + +exports.DeadCodeInjectionRule = function (options) { + if (options.deadCodeInjection) { + options = _Object$assign({}, options, { + deadCodeInjection: true, + stringArray: true + }); + + if (!options.stringArrayThreshold) { + options = _Object$assign({}, options, { + stringArray: true, + stringArrayThreshold: Default_1.DEFAULT_PRESET.stringArrayThreshold + }); + } + } + + return options; +}; + +/***/ }), +/* 166 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$assign = __webpack_require__(11); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.DeadCodeInjectionThresholdRule = function (options) { + if (options.deadCodeInjectionThreshold === 0) { + options = _Object$assign({}, options, { + deadCodeInjection: false, + deadCodeInjectionThreshold: 0 + }); + } + + return options; +}; + +/***/ }), +/* 167 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _getIterator = __webpack_require__(33); + +var _Object$assign = __webpack_require__(11); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var Utils_1 = __webpack_require__(32); + +exports.DomainLockRule = function (options) { + if (options.domainLock.length) { + var normalizedDomains = []; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = _getIterator(options.domainLock), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _domain = _step.value; + normalizedDomains.push(Utils_1.Utils.extractDomainFromUrl(_domain)); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + options = _Object$assign({}, options, { + domainLock: normalizedDomains + }); + } + + return options; +}; + +/***/ }), +/* 168 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$assign = __webpack_require__(11); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.SelfDefendingRule = function (options) { + if (options.selfDefending) { + options = _Object$assign({}, options, { + compact: true, + selfDefending: true + }); + } + + return options; +}; + +/***/ }), +/* 169 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$assign = __webpack_require__(11); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.SourceMapBaseUrlRule = function (options) { + var _options = options, + sourceMapBaseUrl = _options.sourceMapBaseUrl; + + if (!options.sourceMapFileName) { + options = _Object$assign({}, options, { + sourceMapBaseUrl: '' + }); + return options; + } + + if (sourceMapBaseUrl && !sourceMapBaseUrl.endsWith('/')) { + options = _Object$assign({}, options, { + sourceMapBaseUrl: "".concat(sourceMapBaseUrl, "/") + }); + } + + return options; +}; + +/***/ }), +/* 170 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$assign = __webpack_require__(11); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.SourceMapFileNameRule = function (options) { + var _options = options, + sourceMapFileName = _options.sourceMapFileName; + + if (sourceMapFileName) { + sourceMapFileName = sourceMapFileName.replace(/^\/+/, '').split('.')[0]; + options = _Object$assign({}, options, { + sourceMapFileName: "".concat(sourceMapFileName, ".js.map") + }); + } + + return options; +}; + +/***/ }), +/* 171 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$assign = __webpack_require__(11); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.StringArrayRule = function (options) { + if (!options.stringArray) { + options = _Object$assign({}, options, { + rotateStringArray: false, + stringArray: false, + stringArrayEncoding: false, + stringArrayThreshold: 0 + }); + } + + return options; +}; + +/***/ }), +/* 172 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$assign = __webpack_require__(11); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var StringArrayEncoding_1 = __webpack_require__(37); + +exports.StringArrayEncodingRule = function (options) { + if (options.stringArrayEncoding === true) { + options = _Object$assign({}, options, { + stringArrayEncoding: StringArrayEncoding_1.StringArrayEncoding.Base64 + }); + } + + return options; +}; + +/***/ }), +/* 173 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$assign = __webpack_require__(11); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.StringArrayThresholdRule = function (options) { + if (options.stringArrayThreshold === 0) { + options = _Object$assign({}, options, { + rotateStringArray: false, + stringArray: false, + stringArrayEncoding: false, + stringArrayThreshold: 0 + }); + } + + return options; +}; + +/***/ }), +/* 174 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var InversifyContainerFacade_1 = __webpack_require__(22); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var NodeTransformer_1 = __webpack_require__(28); + +var ObfuscatingGuard_1 = __webpack_require__(60); + +var BlackListObfuscatingGuard_1 = __webpack_require__(175); + +var CommentsTransformer_1 = __webpack_require__(176); + +var ConditionalCommentObfuscatingGuard_1 = __webpack_require__(177); + +var CustomNodesTransformer_1 = __webpack_require__(178); + +var EvaCallExpressionTransformer_1 = __webpack_require__(179); + +var ObfuscatingGuardsTransformer_1 = __webpack_require__(181); + +var ParentificationTransformer_1 = __webpack_require__(182); + +exports.preparingTransformersModule = new inversify_1.ContainerModule(function (bind) { + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(CommentsTransformer_1.CommentsTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.CommentsTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(CustomNodesTransformer_1.CustomNodesTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.CustomNodesTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(EvaCallExpressionTransformer_1.EvalCallExpressionTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.EvalCallExpressionTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(ObfuscatingGuardsTransformer_1.ObfuscatingGuardsTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.ObfuscatingGuardsTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(ParentificationTransformer_1.ParentificationTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.ParentificationTransformer); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeGuard).to(BlackListObfuscatingGuard_1.BlackListObfuscatingGuard).inSingletonScope().whenTargetNamed(ObfuscatingGuard_1.ObfuscatingGuard.BlackListNodeGuard); + bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeGuard).to(ConditionalCommentObfuscatingGuard_1.ConditionalCommentObfuscatingGuard).inSingletonScope().whenTargetNamed(ObfuscatingGuard_1.ObfuscatingGuard.ConditionalCommentNodeGuard); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__INodeGuard).toFactory(InversifyContainerFacade_1.InversifyContainerFacade.getCacheFactory(ServiceIdentifiers_1.ServiceIdentifiers.INodeGuard)); +}); + +/***/ }), +/* 175 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var NodeGuards_1 = __webpack_require__(8); + +var BlackListObfuscatingGuard = BlackListObfuscatingGuard_1 = +/*#__PURE__*/ +function () { + function BlackListObfuscatingGuard() { + _classCallCheck(this, BlackListObfuscatingGuard); + + this.blackListGuardsLength = BlackListObfuscatingGuard_1.blackListGuards.length; + } + + _createClass(BlackListObfuscatingGuard, [{ + key: "check", + value: function check(node) { + for (var i = 0; i < this.blackListGuardsLength; i++) { + if (BlackListObfuscatingGuard_1.blackListGuards[i](node)) { + return false; + } + } + + return true; + } + }]); + + return BlackListObfuscatingGuard; +}(); + +BlackListObfuscatingGuard.blackListGuards = [NodeGuards_1.NodeGuards.isUseStrictOperator]; +BlackListObfuscatingGuard = BlackListObfuscatingGuard_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__metadata("design:paramtypes", [])], BlackListObfuscatingGuard); +exports.BlackListObfuscatingGuard = BlackListObfuscatingGuard; +var BlackListObfuscatingGuard_1; + +/***/ }), +/* 176 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var TransformationStage_1 = __webpack_require__(12); + +var AbstractNodeTransformer_1 = __webpack_require__(13); + +var NodeGuards_1 = __webpack_require__(8); + +var CommentsTransformer = CommentsTransformer_1 = +/*#__PURE__*/ +function (_AbstractNodeTransfor) { + _inherits(CommentsTransformer, _AbstractNodeTransfor); + + function CommentsTransformer(randomGenerator, options) { + _classCallCheck(this, CommentsTransformer); + + return _possibleConstructorReturn(this, (CommentsTransformer.__proto__ || _Object$getPrototypeOf(CommentsTransformer)).call(this, randomGenerator, options)); + } + + _createClass(CommentsTransformer, [{ + key: "getVisitor", + value: function getVisitor(transformationStage) { + var _this = this; + + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Preparing: + return { + leave: function leave(node, parentNode) { + if (parentNode && NodeGuards_1.NodeGuards.isNodeWithComments(node)) { + return _this.transformNode(node, parentNode); + } + } + }; + + default: + return null; + } + } + }, { + key: "transformNode", + value: function transformNode(node, parentNode) { + if (node.leadingComments) { + node.leadingComments = this.transformComments(node.leadingComments); + } + + if (node.trailingComments) { + node.trailingComments = this.transformComments(node.trailingComments); + } + + return node; + } + }, { + key: "transformComments", + value: function transformComments(comments) { + return comments.filter(function (comment) { + return CommentsTransformer_1.preservedWords.some(function (availableWord) { + return comment.value.includes(availableWord); + }); + }); + } + }]); + + return CommentsTransformer; +}(AbstractNodeTransformer_1.AbstractNodeTransformer); + +CommentsTransformer.preservedWords = ['@license', '@preserve']; +CommentsTransformer = CommentsTransformer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object])], CommentsTransformer); +exports.CommentsTransformer = CommentsTransformer; +var CommentsTransformer_1; + +/***/ }), +/* 177 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var NodeGuards_1 = __webpack_require__(8); + +var ConditionalCommentObfuscatingGuard = ConditionalCommentObfuscatingGuard_1 = +/*#__PURE__*/ +function () { + function ConditionalCommentObfuscatingGuard() { + _classCallCheck(this, ConditionalCommentObfuscatingGuard); + + this.obfuscationAllowedForCurrentNode = true; + this.obfuscationAllowedForNextNode = null; + } + + _createClass(ConditionalCommentObfuscatingGuard, [{ + key: "check", + value: function check(node) { + if (this.obfuscationAllowedForNextNode) { + this.obfuscationAllowedForCurrentNode = this.obfuscationAllowedForNextNode; + this.obfuscationAllowedForNextNode = null; + } + + if (!NodeGuards_1.NodeGuards.isNodeWithComments(node)) { + return this.obfuscationAllowedForCurrentNode; + } + + var leadingComments = node.leadingComments; + var trailingComments = node.trailingComments; + + if (leadingComments) { + this.obfuscationAllowedForCurrentNode = this.checkComments(leadingComments); + } + + if (trailingComments) { + this.obfuscationAllowedForNextNode = this.checkComments(trailingComments); + } + + return this.obfuscationAllowedForCurrentNode; + } + }, { + key: "checkComments", + value: function checkComments(comments) { + var commentsLength = comments.length; + var obfuscationAllowed = this.obfuscationAllowedForCurrentNode; + + for (var i = 0; i < commentsLength; i++) { + var comment = comments[i]; + + if (ConditionalCommentObfuscatingGuard_1.obfuscationEnableCommentRegExp.test(comment.value)) { + obfuscationAllowed = true; + continue; + } + + if (ConditionalCommentObfuscatingGuard_1.obfuscationDisableCommentRegExp.test(comment.value)) { + obfuscationAllowed = false; + } + } + + return obfuscationAllowed; + } + }]); + + return ConditionalCommentObfuscatingGuard; +}(); + +ConditionalCommentObfuscatingGuard.obfuscationEnableCommentRegExp = new RegExp('javascript-obfuscator *: *enable'); +ConditionalCommentObfuscatingGuard.obfuscationDisableCommentRegExp = new RegExp('javascript-obfuscator *: *disable'); +ConditionalCommentObfuscatingGuard = ConditionalCommentObfuscatingGuard_1 = tslib_1.__decorate([inversify_1.injectable()], ConditionalCommentObfuscatingGuard); +exports.ConditionalCommentObfuscatingGuard = ConditionalCommentObfuscatingGuard; +var ConditionalCommentObfuscatingGuard_1; + +/***/ }), +/* 178 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var ObfuscationEvent_1 = __webpack_require__(25); + +var TransformationStage_1 = __webpack_require__(12); + +var AbstractNodeTransformer_1 = __webpack_require__(13); + +var NodeGuards_1 = __webpack_require__(8); + +var CustomNodesTransformer = +/*#__PURE__*/ +function (_AbstractNodeTransfor) { + _inherits(CustomNodesTransformer, _AbstractNodeTransfor); + + function CustomNodesTransformer(stackTraceAnalyzer, obfuscationEventEmitter, customNodeGroupStorage, randomGenerator, options) { + var _this; + + _classCallCheck(this, CustomNodesTransformer); + + _this = _possibleConstructorReturn(this, (CustomNodesTransformer.__proto__ || _Object$getPrototypeOf(CustomNodesTransformer)).call(this, randomGenerator, options)); + _this.stackTraceData = []; + _this.stackTraceAnalyzer = stackTraceAnalyzer; + _this.obfuscationEventEmitter = obfuscationEventEmitter; + _this.customNodeGroupStorage = customNodeGroupStorage; + return _this; + } + + _createClass(CustomNodesTransformer, [{ + key: "getVisitor", + value: function getVisitor(transformationStage) { + var _this2 = this; + + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Preparing: + return { + leave: function leave(node, parentNode) { + if (NodeGuards_1.NodeGuards.isProgramNode(node)) { + _this2.analyzeNode(node, parentNode); + + _this2.appendCustomNodesBeforeObfuscation(node, parentNode); + + return _this2.transformNode(node, parentNode); + } + } + }; + + case TransformationStage_1.TransformationStage.Finalizing: + return { + leave: function leave(node, parentNode) { + if (NodeGuards_1.NodeGuards.isProgramNode(node)) { + _this2.appendCustomNodesAfterObfuscation(node, parentNode); + } + } + }; + + default: + return null; + } + } + }, { + key: "analyzeNode", + value: function analyzeNode(node, parentNode) { + this.stackTraceData = this.stackTraceAnalyzer.analyze(node); + } + }, { + key: "transformNode", + value: function transformNode(node, parentNode) { + return node; + } + }, { + key: "appendCustomNodesBeforeObfuscation", + value: function appendCustomNodesBeforeObfuscation(node, parentNode) { + var _this3 = this; + + this.customNodeGroupStorage.getStorage().forEach(function (customNodeGroup) { + customNodeGroup.initialize(); + + _this3.obfuscationEventEmitter.once(customNodeGroup.getAppendEvent(), customNodeGroup.appendCustomNodes.bind(customNodeGroup)); + }); + this.obfuscationEventEmitter.emit(ObfuscationEvent_1.ObfuscationEvent.BeforeObfuscation, node, this.stackTraceData); + } + }, { + key: "appendCustomNodesAfterObfuscation", + value: function appendCustomNodesAfterObfuscation(node, parentNode) { + this.obfuscationEventEmitter.emit(ObfuscationEvent_1.ObfuscationEvent.AfterObfuscation, node, this.stackTraceData); + } + }]); + + return CustomNodesTransformer; +}(AbstractNodeTransformer_1.AbstractNodeTransformer); + +CustomNodesTransformer = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IStackTraceAnalyzer)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IObfuscationEventEmitter)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.TCustomNodeGroupStorage)), tslib_1.__param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(4, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object, Object, Object, Object])], CustomNodesTransformer); +exports.CustomNodesTransformer = CustomNodesTransformer; + +/***/ }), +/* 179 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Set = __webpack_require__(29); + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var js_string_escape_1 = tslib_1.__importDefault(__webpack_require__(180)); + +var TransformationStage_1 = __webpack_require__(12); + +var AbstractNodeTransformer_1 = __webpack_require__(13); + +var NodeGuards_1 = __webpack_require__(8); + +var Nodes_1 = __webpack_require__(15); + +var NodeUtils_1 = __webpack_require__(9); + +var EvalCallExpressionTransformer = EvalCallExpressionTransformer_1 = +/*#__PURE__*/ +function (_AbstractNodeTransfor) { + _inherits(EvalCallExpressionTransformer, _AbstractNodeTransfor); + + function EvalCallExpressionTransformer(randomGenerator, options) { + var _this; + + _classCallCheck(this, EvalCallExpressionTransformer); + + _this = _possibleConstructorReturn(this, (EvalCallExpressionTransformer.__proto__ || _Object$getPrototypeOf(EvalCallExpressionTransformer)).call(this, randomGenerator, options)); + _this.evalRootAstHostNodeSet = new _Set(); + return _this; + } + + _createClass(EvalCallExpressionTransformer, [{ + key: "getVisitor", + value: function getVisitor(transformationStage) { + var _this2 = this; + + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Preparing: + return { + enter: function enter(node, parentNode) { + if (parentNode && NodeGuards_1.NodeGuards.isCallExpressionNode(node) && NodeGuards_1.NodeGuards.isIdentifierNode(node.callee) && node.callee.name === 'eval') { + return _this2.transformNode(node, parentNode); + } + } + }; + + case TransformationStage_1.TransformationStage.Finalizing: + if (!this.evalRootAstHostNodeSet.size) { + return null; + } + + return { + leave: function leave(node, parentNode) { + if (parentNode && _this2.isEvalRootAstHostNode(node)) { + return _this2.restoreNode(node, parentNode); + } + } + }; + + default: + return null; + } + } + }, { + key: "transformNode", + value: function transformNode(callExpressionNode, parentNode) { + var callExpressionFirstArgument = callExpressionNode.arguments[0]; + + if (!callExpressionFirstArgument) { + return callExpressionNode; + } + + var evalString = EvalCallExpressionTransformer_1.extractEvalStringFromCallExpressionArgument(callExpressionFirstArgument); + + if (!evalString) { + return callExpressionNode; + } + + var ast; + + try { + ast = NodeUtils_1.NodeUtils.convertCodeToStructure(evalString); + } catch (_a) { + return callExpressionNode; + } + + var evalRootAstHostNode = Nodes_1.Nodes.getFunctionExpressionNode([], Nodes_1.Nodes.getBlockStatementNode(ast)); + this.evalRootAstHostNodeSet.add(evalRootAstHostNode); + return evalRootAstHostNode; + } + }, { + key: "restoreNode", + value: function restoreNode(evalRootAstHostNode, parentNode) { + var targetAst = evalRootAstHostNode.body.body; + var obfuscatedCode = NodeUtils_1.NodeUtils.convertStructureToCode(targetAst); + return Nodes_1.Nodes.getCallExpressionNode(Nodes_1.Nodes.getIdentifierNode('eval'), [Nodes_1.Nodes.getLiteralNode(js_string_escape_1.default(obfuscatedCode))]); + } + }, { + key: "isEvalRootAstHostNode", + value: function isEvalRootAstHostNode(node) { + return NodeGuards_1.NodeGuards.isFunctionExpressionNode(node) && this.evalRootAstHostNodeSet.has(node); + } + }], [{ + key: "extractEvalStringFromCallExpressionArgument", + value: function extractEvalStringFromCallExpressionArgument(node) { + if (NodeGuards_1.NodeGuards.isLiteralNode(node)) { + return EvalCallExpressionTransformer_1.extractEvalStringFromLiteralNode(node); + } + + if (NodeGuards_1.NodeGuards.isTemplateLiteralNode(node)) { + return EvalCallExpressionTransformer_1.extractEvalStringFromTemplateLiteralNode(node); + } + + return null; + } + }, { + key: "extractEvalStringFromLiteralNode", + value: function extractEvalStringFromLiteralNode(node) { + return typeof node.value === 'string' ? node.value : null; + } + }, { + key: "extractEvalStringFromTemplateLiteralNode", + value: function extractEvalStringFromTemplateLiteralNode(node) { + var quasis = node.quasis; + var allowedQuasisLength = 1; + + if (quasis.length !== allowedQuasisLength || node.expressions.length) { + return null; + } + + return quasis[0].value.cooked; + } + }]); + + return EvalCallExpressionTransformer; +}(AbstractNodeTransformer_1.AbstractNodeTransformer); + +EvalCallExpressionTransformer = EvalCallExpressionTransformer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object])], EvalCallExpressionTransformer); +exports.EvalCallExpressionTransformer = EvalCallExpressionTransformer; +var EvalCallExpressionTransformer_1; + +/***/ }), +/* 180 */ +/***/ (function(module, exports) { + +module.exports = require("js-string-escape"); + +/***/ }), +/* 181 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var ObfuscatingGuard_1 = __webpack_require__(60); + +var TransformationStage_1 = __webpack_require__(12); + +var AbstractNodeTransformer_1 = __webpack_require__(13); + +var ObfuscatingGuardsTransformer = ObfuscatingGuardsTransformer_1 = +/*#__PURE__*/ +function (_AbstractNodeTransfor) { + _inherits(ObfuscatingGuardsTransformer, _AbstractNodeTransfor); + + function ObfuscatingGuardsTransformer(obfuscatingGuardFactory, randomGenerator, options) { + var _this; + + _classCallCheck(this, ObfuscatingGuardsTransformer); + + _this = _possibleConstructorReturn(this, (ObfuscatingGuardsTransformer.__proto__ || _Object$getPrototypeOf(ObfuscatingGuardsTransformer)).call(this, randomGenerator, options)); + _this.obfuscatingGuards = ObfuscatingGuardsTransformer_1.obfuscatingGuardsList.map(obfuscatingGuardFactory); + return _this; + } + + _createClass(ObfuscatingGuardsTransformer, [{ + key: "getVisitor", + value: function getVisitor(transformationStage) { + var _this2 = this; + + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Preparing: + return { + enter: function enter(node, parentNode) { + return _this2.transformNode(node, parentNode); + } + }; + + default: + return null; + } + } + }, { + key: "transformNode", + value: function transformNode(node, parentNode) { + var obfuscationAllowed = this.obfuscatingGuards.every(function (nodeGuard) { + return nodeGuard.check(node); + }); + node.ignoredNode = !obfuscationAllowed; + return node; + } + }]); + + return ObfuscatingGuardsTransformer; +}(AbstractNodeTransformer_1.AbstractNodeTransformer); + +ObfuscatingGuardsTransformer.obfuscatingGuardsList = [ObfuscatingGuard_1.ObfuscatingGuard.BlackListNodeGuard, ObfuscatingGuard_1.ObfuscatingGuard.ConditionalCommentNodeGuard]; +ObfuscatingGuardsTransformer = ObfuscatingGuardsTransformer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__INodeGuard)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], ObfuscatingGuardsTransformer); +exports.ObfuscatingGuardsTransformer = ObfuscatingGuardsTransformer; +var ObfuscatingGuardsTransformer_1; + +/***/ }), +/* 182 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var TransformationStage_1 = __webpack_require__(12); + +var AbstractNodeTransformer_1 = __webpack_require__(13); + +var NodeUtils_1 = __webpack_require__(9); + +var ParentificationTransformer = +/*#__PURE__*/ +function (_AbstractNodeTransfor) { + _inherits(ParentificationTransformer, _AbstractNodeTransfor); + + function ParentificationTransformer(randomGenerator, options) { + _classCallCheck(this, ParentificationTransformer); + + return _possibleConstructorReturn(this, (ParentificationTransformer.__proto__ || _Object$getPrototypeOf(ParentificationTransformer)).call(this, randomGenerator, options)); + } + + _createClass(ParentificationTransformer, [{ + key: "getVisitor", + value: function getVisitor(transformationStage) { + var _this = this; + + switch (transformationStage) { + case TransformationStage_1.TransformationStage.Preparing: + return { + enter: function enter(node, parentNode) { + return _this.transformNode(node, parentNode); + } + }; + + default: + return null; + } + } + }, { + key: "transformNode", + value: function transformNode(node, parentNode) { + return NodeUtils_1.NodeUtils.parentizeNode(node, parentNode); + } + }]); + + return ParentificationTransformer; +}(AbstractNodeTransformer_1.AbstractNodeTransformer); + +ParentificationTransformer = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object])], ParentificationTransformer); +exports.ParentificationTransformer = ParentificationTransformer; + +/***/ }), +/* 183 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var ControlFlowStorage_1 = __webpack_require__(184); + +var CustomNodeGroupStorage_1 = __webpack_require__(185); + +var StringArrayStorage_1 = __webpack_require__(186); + +exports.storagesModule = new inversify_1.ContainerModule(function (bind) { + bind(ServiceIdentifiers_1.ServiceIdentifiers.TCustomNodeGroupStorage).to(CustomNodeGroupStorage_1.CustomNodeGroupStorage).inSingletonScope(); + bind(ServiceIdentifiers_1.ServiceIdentifiers.TStringArrayStorage).to(StringArrayStorage_1.StringArrayStorage).inSingletonScope(); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__TControlFlowStorage).toConstructor(ControlFlowStorage_1.ControlFlowStorage); + bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__TControlFlowStorage).toFactory(function (context) { + return function () { + var constructor = context.container.get(ServiceIdentifiers_1.ServiceIdentifiers.Newable__TControlFlowStorage); + var randomGenerator = context.container.get(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator); + var options = context.container.get(ServiceIdentifiers_1.ServiceIdentifiers.IOptions); + var storage = new constructor(randomGenerator, options); + storage.initialize(); + return storage; + }; + }); +}); + +/***/ }), +/* 184 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var MapStorage_1 = __webpack_require__(61); + +var ControlFlowStorage = +/*#__PURE__*/ +function (_MapStorage_1$MapStor) { + _inherits(ControlFlowStorage, _MapStorage_1$MapStor); + + function ControlFlowStorage(randomGenerator, options) { + _classCallCheck(this, ControlFlowStorage); + + return _possibleConstructorReturn(this, (ControlFlowStorage.__proto__ || _Object$getPrototypeOf(ControlFlowStorage)).call(this, randomGenerator, options)); + } + + return ControlFlowStorage; +}(MapStorage_1.MapStorage); + +ControlFlowStorage = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object])], ControlFlowStorage); +exports.ControlFlowStorage = ControlFlowStorage; + +/***/ }), +/* 185 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _get = __webpack_require__(45); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var CustomNodeGroup_1 = __webpack_require__(55); + +var MapStorage_1 = __webpack_require__(61); + +var CustomNodeGroupStorage = CustomNodeGroupStorage_1 = +/*#__PURE__*/ +function (_MapStorage_1$MapStor) { + _inherits(CustomNodeGroupStorage, _MapStorage_1$MapStor); + + function CustomNodeGroupStorage(customNodeGroupFactory, randomGenerator, options) { + var _this; + + _classCallCheck(this, CustomNodeGroupStorage); + + _this = _possibleConstructorReturn(this, (CustomNodeGroupStorage.__proto__ || _Object$getPrototypeOf(CustomNodeGroupStorage)).call(this, randomGenerator, options)); + _this.customNodeGroupFactory = customNodeGroupFactory; + return _this; + } + + _createClass(CustomNodeGroupStorage, [{ + key: "initialize", + value: function initialize() { + var _this2 = this; + + _get(CustomNodeGroupStorage.prototype.__proto__ || _Object$getPrototypeOf(CustomNodeGroupStorage.prototype), "initialize", this).call(this); + + CustomNodeGroupStorage_1.customNodeGroupsList.forEach(function (customNodeGroupName) { + var customNodeGroup = _this2.customNodeGroupFactory(customNodeGroupName); + + if (!customNodeGroup) { + return; + } + + _this2.storage.set(customNodeGroupName, customNodeGroup); + }); + } + }]); + + return CustomNodeGroupStorage; +}(MapStorage_1.MapStorage); + +CustomNodeGroupStorage.customNodeGroupsList = [CustomNodeGroup_1.CustomNodeGroup.ConsoleOutputCustomNodeGroup, CustomNodeGroup_1.CustomNodeGroup.DebugProtectionCustomNodeGroup, CustomNodeGroup_1.CustomNodeGroup.DomainLockCustomNodeGroup, CustomNodeGroup_1.CustomNodeGroup.SelfDefendingCustomNodeGroup, CustomNodeGroup_1.CustomNodeGroup.StringArrayCustomNodeGroup]; + +tslib_1.__decorate([inversify_1.postConstruct(), tslib_1.__metadata("design:type", Function), tslib_1.__metadata("design:paramtypes", []), tslib_1.__metadata("design:returntype", void 0)], CustomNodeGroupStorage.prototype, "initialize", null); + +CustomNodeGroupStorage = CustomNodeGroupStorage_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICustomNodeGroup)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], CustomNodeGroupStorage); +exports.CustomNodeGroupStorage = CustomNodeGroupStorage; +var CustomNodeGroupStorage_1; + +/***/ }), +/* 186 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _get = __webpack_require__(45); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var ArrayStorage_1 = __webpack_require__(187); + +var StringArrayStorage = StringArrayStorage_1 = +/*#__PURE__*/ +function (_ArrayStorage_1$Array) { + _inherits(StringArrayStorage, _ArrayStorage_1$Array); + + function StringArrayStorage(identifierNamesGeneratorFactory, arrayUtils, randomGenerator, options) { + var _this; + + _classCallCheck(this, StringArrayStorage); + + _this = _possibleConstructorReturn(this, (StringArrayStorage.__proto__ || _Object$getPrototypeOf(StringArrayStorage)).call(this, randomGenerator, options)); + _this.identifierNamesGenerator = identifierNamesGeneratorFactory(options); + _this.arrayUtils = arrayUtils; + return _this; + } + + _createClass(StringArrayStorage, [{ + key: "initialize", + value: function initialize() { + _get(StringArrayStorage.prototype.__proto__ || _Object$getPrototypeOf(StringArrayStorage.prototype), "initialize", this).call(this); + + var baseStringArrayName = this.identifierNamesGenerator.generate().slice(0, StringArrayStorage_1.stringArrayNameLength); + var baseStringArrayCallsWrapperName = this.identifierNamesGenerator.generate().slice(0, StringArrayStorage_1.stringArrayNameLength); + var stringArrayName = "".concat(this.options.identifiersPrefix).concat(baseStringArrayName); + var stringArrayCallsWrapperName = "".concat(this.options.identifiersPrefix).concat(baseStringArrayCallsWrapperName); + this.storageId = "".concat(stringArrayName, "|").concat(stringArrayCallsWrapperName); + } + }, { + key: "rotateArray", + value: function rotateArray(rotationValue) { + this.storage = this.arrayUtils.arrayRotate(this.storage, rotationValue); + } + }, { + key: "toString", + value: function toString() { + return this.storage.map(function (value) { + return "'".concat(value, "'"); + }).toString(); + } + }]); + + return StringArrayStorage; +}(ArrayStorage_1.ArrayStorage); + +StringArrayStorage.stringArrayNameLength = 7; + +tslib_1.__decorate([inversify_1.postConstruct(), tslib_1.__metadata("design:type", Function), tslib_1.__metadata("design:paramtypes", []), tslib_1.__metadata("design:returntype", void 0)], StringArrayStorage.prototype, "initialize", null); + +StringArrayStorage = StringArrayStorage_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IArrayUtils)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object, Object])], StringArrayStorage); +exports.StringArrayStorage = StringArrayStorage; +var StringArrayStorage_1; + +/***/ }), +/* 187 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _toConsumableArray = __webpack_require__(24); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var Initializable_1 = __webpack_require__(10); + +var ArrayStorage = +/*#__PURE__*/ +function () { + function ArrayStorage(randomGenerator, options) { + _classCallCheck(this, ArrayStorage); + + this.storageLength = 0; + this.randomGenerator = randomGenerator; + this.options = options; + } + + _createClass(ArrayStorage, [{ + key: "initialize", + value: function initialize() { + this.storage = []; + this.storageId = this.randomGenerator.getRandomString(6); + } + }, { + key: "get", + value: function get(key) { + var value = this.storage[key]; + + if (!value) { + throw new Error("No value found in array storage with key `".concat(key, "`")); + } + + return value; + } + }, { + key: "getKeyOf", + value: function getKeyOf(value) { + var key = this.storage.indexOf(value); + return key >= 0 ? key : null; + } + }, { + key: "getLength", + value: function getLength() { + return this.storageLength; + } + }, { + key: "getStorage", + value: function getStorage() { + return this.storage; + } + }, { + key: "getStorageId", + value: function getStorageId() { + return this.storageId; + } + }, { + key: "mergeWith", + value: function mergeWith(storage) { + var mergeId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + this.storage = _toConsumableArray(this.storage).concat(_toConsumableArray(storage.getStorage())); + + if (mergeId) { + this.storageId = storage.getStorageId(); + } + } + }, { + key: "set", + value: function set(key, value) { + if (key === this.storageLength) { + this.storage.push(value); + } else { + this.storage.splice(key, 0, value); + } + + this.storageLength++; + } + }]); + + return ArrayStorage; +}(); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Array)], ArrayStorage.prototype, "storage", void 0); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], ArrayStorage.prototype, "storageId", void 0); + +tslib_1.__decorate([inversify_1.postConstruct(), tslib_1.__metadata("design:type", Function), tslib_1.__metadata("design:paramtypes", []), tslib_1.__metadata("design:returntype", void 0)], ArrayStorage.prototype, "initialize", null); + +ArrayStorage = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object])], ArrayStorage); +exports.ArrayStorage = ArrayStorage; + +/***/ }), +/* 188 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var ArrayUtils_1 = __webpack_require__(189); + +var CryptUtils_1 = __webpack_require__(190); + +var EscapeSequenceEncoder_1 = __webpack_require__(193); + +var RandomGenerator_1 = __webpack_require__(62); + +exports.utilsModule = new inversify_1.ContainerModule(function (bind) { + bind(ServiceIdentifiers_1.ServiceIdentifiers.IArrayUtils).to(ArrayUtils_1.ArrayUtils).inSingletonScope(); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator).to(RandomGenerator_1.RandomGenerator).inSingletonScope(); + bind(ServiceIdentifiers_1.ServiceIdentifiers.ICryptUtils).to(CryptUtils_1.CryptUtils).inSingletonScope(); + bind(ServiceIdentifiers_1.ServiceIdentifiers.IEscapeSequenceEncoder).to(EscapeSequenceEncoder_1.EscapeSequenceEncoder).inSingletonScope(); +}); + +/***/ }), +/* 189 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _toConsumableArray = __webpack_require__(24); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var ArrayUtils = +/*#__PURE__*/ +function () { + function ArrayUtils(randomGenerator) { + _classCallCheck(this, ArrayUtils); + + this.randomGenerator = randomGenerator; + } + + _createClass(ArrayUtils, [{ + key: "arrayRange", + value: function arrayRange(length) { + var range = []; + + for (var i = 0; i < length; i++) { + range.push(i); + } + + return range; + } + }, { + key: "arrayRotate", + value: function arrayRotate(array, times) { + if (!array.length) { + throw new ReferenceError("Cannot rotate empty array."); + } + + if (times <= 0) { + return array; + } + + var newArray = array; + var temp; + + while (times--) { + temp = newArray.pop(); + newArray.unshift(temp); + } + + return newArray; + } + }, { + key: "arrayShuffle", + value: function arrayShuffle(array) { + var shuffledArray = _toConsumableArray(array); + + for (var i = shuffledArray.length; i; i--) { + var j = Math.floor(this.randomGenerator.getMathRandom() * i); + var _ref = [shuffledArray[j], shuffledArray[i - 1]]; + shuffledArray[i - 1] = _ref[0]; + shuffledArray[j] = _ref[1]; + } + + return shuffledArray; + } + }]); + + return ArrayUtils; +}(); + +ArrayUtils = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__metadata("design:paramtypes", [Object])], ArrayUtils); +exports.ArrayUtils = ArrayUtils; + +/***/ }), +/* 190 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var RandomGenerator_1 = __webpack_require__(62); + +var Utils_1 = __webpack_require__(32); + +var CryptUtils = +/*#__PURE__*/ +function () { + function CryptUtils(randomGenerator) { + _classCallCheck(this, CryptUtils); + + this.randomGenerator = randomGenerator; + } + + _createClass(CryptUtils, [{ + key: "btoa", + value: function btoa(string) { + var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; + var output = ''; + string = encodeURIComponent(string).replace(/%([0-9A-F]{2})/g, function (match, p1) { + return String.fromCharCode(parseInt("".concat(Utils_1.Utils.hexadecimalPrefix).concat(p1))); + }); + + for (var block, charCode, idx = 0, map = chars; string.charAt(idx | 0) || (map = '=', idx % 1); output += map.charAt(63 & block >> 8 - idx % 1 * 8)) { + charCode = string.charCodeAt(idx += 3 / 4); + + if (charCode > 0xFF) { + throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range."); + } + + block = block << 8 | charCode; + } + + return output; + } + }, { + key: "hideString", + value: function hideString(str, length) { + var _this = this; + + var escapeRegExp = function escapeRegExp(s) { + return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); + }; + + var randomMerge = function randomMerge(s1, s2) { + var i1 = -1; + var i2 = -1; + var result = ''; + + while (i1 < s1.length || i2 < s2.length) { + if (_this.randomGenerator.getMathRandom() < 0.5 && i2 < s2.length) { + result += s2.charAt(++i2); + } else { + result += s1.charAt(++i1); + } + } + + return result; + }; + + var randomString = this.randomGenerator.getRandomGenerator().string({ + length: length, + pool: RandomGenerator_1.RandomGenerator.randomGeneratorPool + }); + var randomStringDiff = randomString.replace(new RegExp("[".concat(escapeRegExp(str), "]"), 'g'), ''); + var randomStringDiffArray = randomStringDiff.split(''); + this.randomGenerator.getRandomGenerator().shuffle(randomStringDiffArray); + randomStringDiff = randomStringDiffArray.join(''); + return [randomMerge(str, randomStringDiff), randomStringDiff]; + } + }, { + key: "rc4", + value: function rc4(string, key) { + var s = [], + j = 0, + x, + result = ''; + + for (var i = 0; i < 256; i++) { + s[i] = i; + } + + for (i = 0; i < 256; i++) { + j = (j + s[i] + key.charCodeAt(i % key.length)) % 256; + x = s[i]; + s[i] = s[j]; + s[j] = x; + } + + i = 0; + j = 0; + + for (var y = 0; y < string.length; y++) { + i = (i + 1) % 256; + j = (j + s[i]) % 256; + x = s[i]; + s[i] = s[j]; + s[j] = x; + result += String.fromCharCode(string.charCodeAt(y) ^ s[(s[i] + s[j]) % 256]); + } + + return result; + } + }]); + + return CryptUtils; +}(); + +CryptUtils = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__metadata("design:paramtypes", [Object])], CryptUtils); +exports.CryptUtils = CryptUtils; + +/***/ }), +/* 191 */ +/***/ (function(module, exports) { + +module.exports = require("md5"); + +/***/ }), +/* 192 */ +/***/ (function(module, exports) { + +module.exports = require("chance"); + +/***/ }), +/* 193 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Map = __webpack_require__(16); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var EscapeSequenceEncoder = +/*#__PURE__*/ +function () { + function EscapeSequenceEncoder() { + _classCallCheck(this, EscapeSequenceEncoder); + + this.stringsCache = new _Map(); + } + + _createClass(EscapeSequenceEncoder, [{ + key: "encode", + value: function encode(string, encodeAllSymbols) { + var cacheKey = "".concat(string, "-").concat(String(encodeAllSymbols)); + + if (this.stringsCache.has(cacheKey)) { + return this.stringsCache.get(cacheKey); + } + + var radix = 16; + var replaceRegExp = new RegExp('[\\s\\S]', 'g'); + var escapeSequenceRegExp = new RegExp('[\'\"\\\\\\s]'); + var regExp = new RegExp('[\\x00-\\x7F]'); + var prefix; + var template; + var result = string.replace(replaceRegExp, function (character) { + if (!encodeAllSymbols && !escapeSequenceRegExp.exec(character)) { + return character; + } + + if (regExp.exec(character)) { + prefix = '\\x'; + template = '00'; + } else { + prefix = "\\u"; + template = '0000'; + } + + return "".concat(prefix).concat((template + character.charCodeAt(0).toString(radix)).slice(-template.length)); + }); + this.stringsCache.set(cacheKey, result); + return result; + } + }]); + + return EscapeSequenceEncoder; +}(); + +EscapeSequenceEncoder = tslib_1.__decorate([inversify_1.injectable()], EscapeSequenceEncoder); +exports.EscapeSequenceEncoder = EscapeSequenceEncoder; + +/***/ }), +/* 194 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$assign = __webpack_require__(11); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var escodegen = tslib_1.__importStar(__webpack_require__(42)); + +var packageJson = tslib_1.__importStar(__webpack_require__(63)); + +var LoggingMessage_1 = __webpack_require__(195); + +var NodeTransformer_1 = __webpack_require__(28); + +var TransformationStage_1 = __webpack_require__(12); + +var EsprimaFacade_1 = __webpack_require__(196); + +var NodeGuards_1 = __webpack_require__(8); + +var JavaScriptObfuscator = JavaScriptObfuscator_1 = +/*#__PURE__*/ +function () { + function JavaScriptObfuscator(transformersRunner, sourceMapCorrector, randomGenerator, logger, options) { + _classCallCheck(this, JavaScriptObfuscator); + + this.transformersRunner = transformersRunner; + this.sourceMapCorrector = sourceMapCorrector; + this.randomGenerator = randomGenerator; + this.logger = logger; + this.options = options; + } + + _createClass(JavaScriptObfuscator, [{ + key: "obfuscate", + value: function obfuscate(sourceCode) { + var timeStart = Date.now(); + this.logger.info(LoggingMessage_1.LoggingMessage.Version, packageJson.version); + this.logger.info(LoggingMessage_1.LoggingMessage.ObfuscationStarted); + this.logger.info(LoggingMessage_1.LoggingMessage.RandomGeneratorSeed, this.randomGenerator.getSeed()); + var astTree = this.parseCode(sourceCode); + var obfuscatedAstTree = this.transformAstTree(astTree); + var generatorOutput = this.generateCode(sourceCode, obfuscatedAstTree); + var obfuscationTime = (Date.now() - timeStart) / 1000; + this.logger.success(LoggingMessage_1.LoggingMessage.ObfuscationCompleted, obfuscationTime); + return this.getObfuscationResult(generatorOutput); + } + }, { + key: "parseCode", + value: function parseCode(sourceCode) { + return EsprimaFacade_1.EsprimaFacade.parse(sourceCode, { + attachComment: true, + loc: this.options.sourceMap + }); + } + }, { + key: "transformAstTree", + value: function transformAstTree(astTree) { + var isEmptyAstTree = NodeGuards_1.NodeGuards.isProgramNode(astTree) && !astTree.body.length && !astTree.leadingComments; + + if (isEmptyAstTree) { + this.logger.warn(LoggingMessage_1.LoggingMessage.EmptySourceCode); + return astTree; + } + + astTree = this.runTransformationStage(astTree, TransformationStage_1.TransformationStage.Preparing); + + if (this.options.deadCodeInjection) { + astTree = this.runTransformationStage(astTree, TransformationStage_1.TransformationStage.DeadCodeInjection); + } + + if (this.options.controlFlowFlattening) { + astTree = this.runTransformationStage(astTree, TransformationStage_1.TransformationStage.ControlFlowFlattening); + } + + astTree = this.runTransformationStage(astTree, TransformationStage_1.TransformationStage.Converting); + astTree = this.runTransformationStage(astTree, TransformationStage_1.TransformationStage.Obfuscating); + astTree = this.runTransformationStage(astTree, TransformationStage_1.TransformationStage.Finalizing); + return astTree; + } + }, { + key: "generateCode", + value: function generateCode(sourceCode, astTree) { + var escodegenParams = _Object$assign({}, JavaScriptObfuscator_1.escodegenParams); + + if (this.options.sourceMap) { + escodegenParams.sourceMap = 'sourceMap'; + escodegenParams.sourceContent = sourceCode; + } + + var generatorOutput = escodegen.generate(astTree, _Object$assign({}, escodegenParams, { + format: { + compact: this.options.compact + } + })); + generatorOutput.map = generatorOutput.map ? generatorOutput.map.toString() : ''; + return generatorOutput; + } + }, { + key: "getObfuscationResult", + value: function getObfuscationResult(generatorOutput) { + return this.sourceMapCorrector.correct(generatorOutput.code, generatorOutput.map); + } + }, { + key: "runTransformationStage", + value: function runTransformationStage(astTree, transformationStage) { + this.logger.info(LoggingMessage_1.LoggingMessage.TransformationStage, transformationStage); + return this.transformersRunner.transform(astTree, JavaScriptObfuscator_1.transformersList, transformationStage); + } + }]); + + return JavaScriptObfuscator; +}(); + +JavaScriptObfuscator.escodegenParams = { + comment: true, + verbatim: 'x-verbatim-property', + sourceMapWithCode: true +}; +JavaScriptObfuscator.transformersList = [NodeTransformer_1.NodeTransformer.BlockStatementControlFlowTransformer, NodeTransformer_1.NodeTransformer.ClassDeclarationTransformer, NodeTransformer_1.NodeTransformer.CommentsTransformer, NodeTransformer_1.NodeTransformer.CustomNodesTransformer, NodeTransformer_1.NodeTransformer.DeadCodeInjectionTransformer, NodeTransformer_1.NodeTransformer.EvalCallExpressionTransformer, NodeTransformer_1.NodeTransformer.FunctionControlFlowTransformer, NodeTransformer_1.NodeTransformer.CatchClauseTransformer, NodeTransformer_1.NodeTransformer.FunctionDeclarationTransformer, NodeTransformer_1.NodeTransformer.FunctionTransformer, NodeTransformer_1.NodeTransformer.LabeledStatementTransformer, NodeTransformer_1.NodeTransformer.LiteralTransformer, NodeTransformer_1.NodeTransformer.MemberExpressionTransformer, NodeTransformer_1.NodeTransformer.MethodDefinitionTransformer, NodeTransformer_1.NodeTransformer.ObfuscatingGuardsTransformer, NodeTransformer_1.NodeTransformer.ObjectExpressionKeysTransformer, NodeTransformer_1.NodeTransformer.ObjectExpressionTransformer, NodeTransformer_1.NodeTransformer.ParentificationTransformer, NodeTransformer_1.NodeTransformer.TemplateLiteralTransformer, NodeTransformer_1.NodeTransformer.VariableDeclarationTransformer]; +JavaScriptObfuscator = JavaScriptObfuscator_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ITransformersRunner)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ISourceMapCorrector)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ILogger)), tslib_1.__param(4, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object, Object, Object, Object])], JavaScriptObfuscator); +exports.JavaScriptObfuscator = JavaScriptObfuscator; +var JavaScriptObfuscator_1; + +/***/ }), +/* 195 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var LoggingMessage; + +(function (LoggingMessage) { + LoggingMessage["EmptySourceCode"] = "Empty source code. Obfuscation canceled..."; + LoggingMessage["ObfuscationCompleted"] = "Obfuscation completed. Total time: %s sec."; + LoggingMessage["ObfuscationStarted"] = "Obfuscation started..."; + LoggingMessage["RandomGeneratorSeed"] = "Random generator seed: %s..."; + LoggingMessage["TransformationStage"] = "Transformation stage: %s..."; + LoggingMessage["Version"] = "Version: %s"; +})(LoggingMessage = exports.LoggingMessage || (exports.LoggingMessage = {})); + +/***/ }), +/* 196 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var esprima = tslib_1.__importStar(__webpack_require__(51)); + +var chalk_1 = tslib_1.__importDefault(__webpack_require__(64)); + +var EsprimaFacade = +/*#__PURE__*/ +function () { + function EsprimaFacade() { + _classCallCheck(this, EsprimaFacade); + } + + _createClass(EsprimaFacade, null, [{ + key: "parse", + value: function parse(input, config) { + var lastMeta = null; + + try { + return esprima.parseScript(input, config, function (node, meta) { + return lastMeta = meta; + }); + } catch (_a) {} + + try { + return esprima.parseModule(input, config, function (node, meta) { + return lastMeta = meta; + }); + } catch (error) { + return EsprimaFacade.processParsingError(input, error.message, lastMeta); + } + } + }, { + key: "processParsingError", + value: function processParsingError(sourceCode, errorMessage, meta) { + if (!meta || !meta.start || !meta.end || !meta.start.column || !meta.end.column) { + throw new Error(errorMessage); + } + + var lineNumberMatch = errorMessage.match(/Line *(\d*)/); + + if (!lineNumberMatch) { + throw new Error(errorMessage); + } + + var lineNumber = parseInt(lineNumberMatch[1], 10); + var sourceCodeLines = sourceCode.split(/\r?\n/); + var errorLine = sourceCodeLines[lineNumber - 1]; + + if (!errorLine) { + throw new Error(errorMessage); + } + + var startErrorIndex = Math.max(0, meta.start.column - EsprimaFacade.nearestSymbolsCount); + var endErrorIndex = Math.min(errorLine.length, meta.end.column + EsprimaFacade.nearestSymbolsCount); + var formattedPointer = EsprimaFacade.colorError('>'); + var formattedCodeSlice = "...".concat(errorLine.substring(startErrorIndex, endErrorIndex).replace(/^\s+/, ''), "..."); + throw new Error("".concat(errorMessage, "\n").concat(formattedPointer, " ").concat(formattedCodeSlice)); + } + }]); + + return EsprimaFacade; +}(); + +EsprimaFacade.colorError = chalk_1.default.red; +EsprimaFacade.nearestSymbolsCount = 10; +exports.EsprimaFacade = EsprimaFacade; + +/***/ }), +/* 197 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$getPrototypeOf = __webpack_require__(5); + +var _classCallCheck = __webpack_require__(0); + +var _possibleConstructorReturn = __webpack_require__(6); + +var _inherits = __webpack_require__(7); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var events_1 = __webpack_require__(198); + +inversify_1.decorate(inversify_1.injectable(), events_1.EventEmitter); + +var ObfuscationEventEmitter = +/*#__PURE__*/ +function (_events_1$EventEmitte) { + _inherits(ObfuscationEventEmitter, _events_1$EventEmitte); + + function ObfuscationEventEmitter() { + _classCallCheck(this, ObfuscationEventEmitter); + + return _possibleConstructorReturn(this, (ObfuscationEventEmitter.__proto__ || _Object$getPrototypeOf(ObfuscationEventEmitter)).apply(this, arguments)); + } + + return ObfuscationEventEmitter; +}(events_1.EventEmitter); + +ObfuscationEventEmitter = tslib_1.__decorate([inversify_1.injectable()], ObfuscationEventEmitter); +exports.ObfuscationEventEmitter = ObfuscationEventEmitter; + +/***/ }), +/* 198 */ +/***/ (function(module, exports) { + +module.exports = require("events"); + +/***/ }), +/* 199 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var Initializable_1 = __webpack_require__(10); + +var ObfuscationResult = +/*#__PURE__*/ +function () { + function ObfuscationResult() { + _classCallCheck(this, ObfuscationResult); + } + + _createClass(ObfuscationResult, [{ + key: "initialize", + value: function initialize(obfuscatedCode, sourceMap) { + this.obfuscatedCode = obfuscatedCode; + this.sourceMap = sourceMap; + } + }, { + key: "getObfuscatedCode", + value: function getObfuscatedCode() { + return this.obfuscatedCode; + } + }, { + key: "getSourceMap", + value: function getSourceMap() { + return this.sourceMap; + } + }, { + key: "toString", + value: function toString() { + return this.obfuscatedCode; + } + }]); + + return ObfuscationResult; +}(); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], ObfuscationResult.prototype, "obfuscatedCode", void 0); + +tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], ObfuscationResult.prototype, "sourceMap", void 0); + +ObfuscationResult = tslib_1.__decorate([inversify_1.injectable()], ObfuscationResult); +exports.ObfuscationResult = ObfuscationResult; + +/***/ }), +/* 200 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var SourceCode = +/*#__PURE__*/ +function () { + function SourceCode(sourceCode) { + _classCallCheck(this, SourceCode); + + this.sourceCode = sourceCode; + } + + _createClass(SourceCode, [{ + key: "getSourceCode", + value: function getSourceCode() { + return this.sourceCode; + } + }]); + + return SourceCode; +}(); + +exports.SourceCode = SourceCode; + +/***/ }), +/* 201 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var SourceMapMode_1 = __webpack_require__(36); + +var SourceMapCorrector = +/*#__PURE__*/ +function () { + function SourceMapCorrector(obfuscationResultFactory, cryptUtils, options) { + _classCallCheck(this, SourceMapCorrector); + + this.obfuscationResultFactory = obfuscationResultFactory; + this.cryptUtils = cryptUtils; + this.options = options; + } + + _createClass(SourceMapCorrector, [{ + key: "correct", + value: function correct(obfuscatedCode, sourceMap) { + return this.obfuscationResultFactory(this.correctObfuscatedCode(obfuscatedCode, sourceMap), sourceMap); + } + }, { + key: "correctObfuscatedCode", + value: function correctObfuscatedCode(obfuscatedCode, sourceMap) { + if (!sourceMap) { + return obfuscatedCode; + } + + var sourceMapUrl = this.options.sourceMapBaseUrl + this.options.sourceMapFileName; + var sourceMappingUrl = '//# sourceMappingURL='; + + switch (this.options.sourceMapMode) { + case SourceMapMode_1.SourceMapMode.Inline: + sourceMappingUrl += "data:application/json;base64,".concat(this.cryptUtils.btoa(sourceMap)); + break; + + case SourceMapMode_1.SourceMapMode.Separate: + default: + if (!sourceMapUrl) { + return obfuscatedCode; + } + + sourceMappingUrl += sourceMapUrl; + break; + } + + return "".concat(obfuscatedCode, "\n").concat(sourceMappingUrl); + } + }]); + + return SourceMapCorrector; +}(); + +SourceMapCorrector = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IObfuscationResult)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICryptUtils)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], SourceMapCorrector); +exports.SourceMapCorrector = SourceMapCorrector; + +/***/ }), +/* 202 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var tslib_1 = __webpack_require__(4); + +var inversify_1 = __webpack_require__(1); + +var ServiceIdentifiers_1 = __webpack_require__(3); + +var estraverse = tslib_1.__importStar(__webpack_require__(17)); + +var VisitorDirection_1 = __webpack_require__(203); + +var NodeGuards_1 = __webpack_require__(8); + +var TransformersRunner = +/*#__PURE__*/ +function () { + function TransformersRunner(nodeTransformerFactory) { + _classCallCheck(this, TransformersRunner); + + this.nodeTransformerFactory = nodeTransformerFactory; + } + + _createClass(TransformersRunner, [{ + key: "transform", + value: function transform(astTree, nodeTransformers, transformationStage) { + if (!nodeTransformers.length) { + return astTree; + } + + var enterVisitors = []; + var leaveVisitors = []; + var nodeTransformersLength = nodeTransformers.length; + var visitor; + + for (var i = 0; i < nodeTransformersLength; i++) { + visitor = this.nodeTransformerFactory(nodeTransformers[i]).getVisitor(transformationStage); + + if (!visitor) { + continue; + } + + if (visitor.enter) { + enterVisitors.push({ + enter: visitor.enter + }); + } + + if (visitor.leave) { + leaveVisitors.push({ + leave: visitor.leave + }); + } + } + + if (!enterVisitors.length && !leaveVisitors.length) { + return astTree; + } + + estraverse.replace(astTree, { + enter: this.mergeVisitorsForDirection(enterVisitors, VisitorDirection_1.VisitorDirection.Enter), + leave: this.mergeVisitorsForDirection(leaveVisitors, VisitorDirection_1.VisitorDirection.Leave) + }); + return astTree; + } + }, { + key: "mergeVisitorsForDirection", + value: function mergeVisitorsForDirection(visitors, direction) { + var visitorsLength = visitors.length; + + if (!visitorsLength) { + return function (node, parentNode) { + return node; + }; + } + + return function (node, parentNode) { + if (node.ignoredNode) { + return estraverse.VisitorOption.Skip; + } + + for (var i = 0; i < visitorsLength; i++) { + var visitorFunction = visitors[i][direction]; + + if (!visitorFunction) { + continue; + } + + var visitorResult = visitorFunction(node, parentNode); + + if (!visitorResult || !NodeGuards_1.NodeGuards.isNode(visitorResult)) { + continue; + } + + node = visitorResult; + } + + return node; + }; + } + }]); + + return TransformersRunner; +}(); + +TransformersRunner = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__INodeTransformer)), tslib_1.__metadata("design:paramtypes", [Function])], TransformersRunner); +exports.TransformersRunner = TransformersRunner; + +/***/ }), +/* 203 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var VisitorDirection; + +(function (VisitorDirection) { + VisitorDirection["Enter"] = "enter"; + VisitorDirection["Leave"] = "leave"; +})(VisitorDirection = exports.VisitorDirection || (exports.VisitorDirection = {})); + +/***/ }), +/* 204 */ +/***/ (function(module, exports) { + +module.exports = require("commander"); + +/***/ }), +/* 205 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.ArraySanitizer = function (value) { + if (/,$/.test(value)) { + throw new SyntaxError("Multiple values should be wrapped inside quotes: --option-name 'value1, value2'"); + } + + return value.split(',').map(function (string) { + return string.trim(); + }); +}; + +/***/ }), +/* 206 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.BooleanSanitizer = function (value) { + return value === 'true' || value === '1'; +}; + +/***/ }), +/* 207 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$keys = __webpack_require__(38); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var IdentifierNamesGenerator_1 = __webpack_require__(35); + +exports.IdentifierNamesGeneratorSanitizer = function (value) { + var isCorrectIdentifierNamesGenerator = _Object$keys(IdentifierNamesGenerator_1.IdentifierNamesGenerator).some(function (key) { + return IdentifierNamesGenerator_1.IdentifierNamesGenerator[key] === value; + }); + + if (!isCorrectIdentifierNamesGenerator) { + throw new ReferenceError('Invalid value of `--identifier-names-generator` option'); + } + + return value; +}; + +/***/ }), +/* 208 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$keys = __webpack_require__(38); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var ObfuscationTarget_1 = __webpack_require__(21); + +exports.ObfuscationTargetSanitizer = function (value) { + var isCorrectTarget = _Object$keys(ObfuscationTarget_1.ObfuscationTarget).some(function (key) { + return ObfuscationTarget_1.ObfuscationTarget[key] === value; + }); + + if (!isCorrectTarget) { + throw new ReferenceError('Invalid value of `--target` option'); + } + + return value; +}; + +/***/ }), +/* 209 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Object$keys = __webpack_require__(38); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var SourceMapMode_1 = __webpack_require__(36); + +exports.SourceMapModeSanitizer = function (value) { + var isCorrectSourceMapMode = _Object$keys(SourceMapMode_1.SourceMapMode).some(function (key) { + return SourceMapMode_1.SourceMapMode[key] === value; + }); + + if (!isCorrectSourceMapMode) { + throw new ReferenceError('Invalid value of `--source-map-mode` option'); + } + + return value; +}; + +/***/ }), +/* 210 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var StringArrayEncoding_1 = __webpack_require__(37); + +exports.StringArrayEncodingSanitizer = function (value) { + switch (value) { + case 'true': + case '1': + case StringArrayEncoding_1.StringArrayEncoding.Base64: + return true; + + case StringArrayEncoding_1.StringArrayEncoding.Rc4: + return StringArrayEncoding_1.StringArrayEncoding.Rc4; + + default: + return false; + } +}; + +/***/ }), +/* 211 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var fs = __importStar(__webpack_require__(67)); + +var mkdirp = __importStar(__webpack_require__(212)); + +var path = __importStar(__webpack_require__(48)); + +var JavaScriptObfuscatorCLI_1 = __webpack_require__(47); + +var CLIUtils = +/*#__PURE__*/ +function () { + function CLIUtils() { + _classCallCheck(this, CLIUtils); + } + + _createClass(CLIUtils, null, [{ + key: "getOutputCodePath", + value: function getOutputCodePath(inputPath) { + return path.normalize(inputPath).split('.').map(function (value, index) { + return index === 0 ? "".concat(value).concat(JavaScriptObfuscatorCLI_1.JavaScriptObfuscatorCLI.obfuscatedFilePrefix) : value; + }).join('.'); + } + }, { + key: "getOutputSourceMapPath", + value: function getOutputSourceMapPath(outputCodePath) { + var sourceMapFileName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + + if (sourceMapFileName) { + outputCodePath = "".concat(outputCodePath.substring(0, outputCodePath.lastIndexOf('/')), "/").concat(sourceMapFileName); + } + + if (!/\.js\.map$/.test(outputCodePath)) { + outputCodePath = "".concat(outputCodePath.split('.')[0], ".js.map"); + } else if (/\.js$/.test(outputCodePath)) { + outputCodePath += '.map'; + } + + return outputCodePath; + } + }, { + key: "getUserConfig", + value: function getUserConfig(configPath) { + var config; + + try { + config = !(function webpackMissingModule() { var e = new Error("Cannot find module \".\""); e.code = 'MODULE_NOT_FOUND'; throw e; }()); + } catch (_a) { + try { + config = require(configPath); + } catch (_b) { + throw new ReferenceError('Given config path must be a valid `.js` or `.json` file path'); + } + } + + return config; + } + }, { + key: "writeFile", + value: function writeFile(outputPath, data) { + mkdirp.sync(path.dirname(outputPath)); + fs.writeFileSync(outputPath, data, { + encoding: JavaScriptObfuscatorCLI_1.JavaScriptObfuscatorCLI.encoding + }); + } + }]); + + return CLIUtils; +}(); + +exports.CLIUtils = CLIUtils; + +/***/ }), +/* 212 */ +/***/ (function(module, exports) { + +module.exports = require("mkdirp"); + +/***/ }), +/* 213 */ +/***/ (function(module, exports) { + +function webpackEmptyContext(req) { + throw new Error("Cannot find module '" + req + "'."); +} +webpackEmptyContext.keys = function() { return []; }; +webpackEmptyContext.resolve = webpackEmptyContext; +module.exports = webpackEmptyContext; +webpackEmptyContext.id = 213; + +/***/ }), +/* 214 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _toConsumableArray = __webpack_require__(24); + +var _classCallCheck = __webpack_require__(0); + +var _createClass = __webpack_require__(2); + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var fs = __importStar(__webpack_require__(67)); + +var path = __importStar(__webpack_require__(48)); + +var multimatch_1 = __importDefault(__webpack_require__(215)); + +var LoggingPrefix_1 = __webpack_require__(66); + +var JavaScriptObfuscatorCLI_1 = __webpack_require__(47); + +var Logger_1 = __webpack_require__(65); + +var SourceCodeReader = +/*#__PURE__*/ +function () { + function SourceCodeReader(options) { + _classCallCheck(this, SourceCodeReader); + + this.options = options; + } + + _createClass(SourceCodeReader, [{ + key: "readSourceCode", + value: function readSourceCode(inputPath) { + if (SourceCodeReader.isFilePath(inputPath) && this.isValidFile(inputPath)) { + return this.readFile(inputPath); + } + + if (SourceCodeReader.isDirectoryPath(inputPath) && this.isValidDirectory(inputPath)) { + return this.readDirectoryRecursive(inputPath); + } + + var availableFilePaths = SourceCodeReader.availableInputExtensions.map(function (extension) { + return "`".concat(extension, "`"); + }).join(', '); + throw new ReferenceError("Given input path must be a valid ".concat(availableFilePaths, " file or directory path")); + } + }, { + key: "readDirectoryRecursive", + value: function readDirectoryRecursive(directoryPath) { + var _this = this; + + var fileData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + fs.readdirSync(directoryPath, JavaScriptObfuscatorCLI_1.JavaScriptObfuscatorCLI.encoding).forEach(function (fileName) { + var filePath = "".concat(directoryPath, "/").concat(fileName); + + if (SourceCodeReader.isDirectoryPath(filePath) && _this.isValidDirectory(filePath)) { + fileData.push.apply(fileData, _toConsumableArray(_this.readDirectoryRecursive(filePath))); + } else if (SourceCodeReader.isFilePath(filePath) && _this.isValidFile(filePath)) { + var content = _this.readFile(filePath); + + fileData.push({ + filePath: filePath, + content: content + }); + } + }); + return fileData; + } + }, { + key: "readFile", + value: function readFile(filePath) { + SourceCodeReader.logFilePath(filePath); + return fs.readFileSync(filePath, JavaScriptObfuscatorCLI_1.JavaScriptObfuscatorCLI.encoding); + } + }, { + key: "isValidDirectory", + value: function isValidDirectory(directoryPath) { + return !SourceCodeReader.isExcludedPath(directoryPath, this.options.exclude); + } + }, { + key: "isValidFile", + value: function isValidFile(filePath) { + return SourceCodeReader.availableInputExtensions.includes(path.extname(filePath)) && !filePath.includes(JavaScriptObfuscatorCLI_1.JavaScriptObfuscatorCLI.obfuscatedFilePrefix) && !SourceCodeReader.isExcludedPath(filePath, this.options.exclude); + } + }], [{ + key: "isExcludedPath", + value: function isExcludedPath(filePath) { + var excludePatterns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + + if (!excludePatterns.length) { + return false; + } + + var fileName = path.basename(filePath); + var isExcludedFilePathByGlobPattern = !!multimatch_1.default([filePath], excludePatterns).length; + var isExcludedFilePathByInclusion = excludePatterns.some(function (excludePattern) { + return filePath.includes(excludePattern) || fileName.includes(excludePattern); + }); + return isExcludedFilePathByInclusion || isExcludedFilePathByGlobPattern; + } + }, { + key: "isDirectoryPath", + value: function isDirectoryPath(filePath) { + try { + return fs.statSync(filePath).isDirectory(); + } catch (_a) { + return false; + } + } + }, { + key: "isFilePath", + value: function isFilePath(filePath) { + try { + return fs.statSync(filePath).isFile(); + } catch (_a) { + return false; + } + } + }, { + key: "logFilePath", + value: function logFilePath(filePath) { + var normalizedFilePath = path.normalize(filePath); + Logger_1.Logger.log(Logger_1.Logger.colorInfo, LoggingPrefix_1.LoggingPrefix.CLI, "Obfuscating file: ".concat(normalizedFilePath, "...")); + } + }]); + + return SourceCodeReader; +}(); + +SourceCodeReader.availableInputExtensions = ['.js']; +exports.SourceCodeReader = SourceCodeReader; + +/***/ }), +/* 215 */ +/***/ (function(module, exports) { + +module.exports = require("multimatch"); + +/***/ }) +/******/ ]); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/package.json b/package.json index cf31b462..4fe21722 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "@types/sinon": "4.3.0", "@types/string-template": "1.0.2", "@types/webpack-env": "1.13.5", - "awesome-typescript-loader": "4.0.0-0", + "awesome-typescript-loader": "4.0.0-1", "babel-cli": "7.0.0-beta.3", "babel-loader": "8.0.0-beta.2", "chai": "4.1.2", @@ -76,7 +76,7 @@ "tslint-webpack-plugin": "1.2.0", "typescript": "2.7.2", "webpack": "4.0.1", - "webpack-cli": "^2.0.10", + "webpack-cli": "2.0.10", "webpack-node-externals": "1.6.0" }, "repository": { diff --git a/yarn.lock b/yarn.lock index fa1ed3e5..5f321fdc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -782,9 +782,9 @@ atob@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/atob/-/atob-2.0.3.tgz#19c7a760473774468f20b2d2d03372ad7d4cbf5d" -awesome-typescript-loader@4.0.0-0: - version "4.0.0-0" - resolved "https://registry.yarnpkg.com/awesome-typescript-loader/-/awesome-typescript-loader-4.0.0-0.tgz#fde4fa9490ccd15a503dc0934292188c5b9d09d7" +awesome-typescript-loader@4.0.0-1: + version "4.0.0-1" + resolved "https://registry.yarnpkg.com/awesome-typescript-loader/-/awesome-typescript-loader-4.0.0-1.tgz#356ca19693640f70429c72d527a88adc1d7fbb19" dependencies: chalk "^2.3.1" enhanced-resolve "3.3.0" @@ -2166,8 +2166,8 @@ cross-spawn@^5.0.1: which "^1.2.9" cross-spawn@^6.0.4: - version "6.0.4" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.4.tgz#bbf44ccb30fb8314a08f178b62290c669c36d808" + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" dependencies: nice-try "^1.0.4" path-key "^2.0.1" @@ -3311,7 +3311,11 @@ inquirer@^5.1.0: strip-ansi "^4.0.0" through "^2.3.6" -interpret@^1.0.0, interpret@^1.0.4: +interpret@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.4.tgz#820cdd588b868ffb191a809506d6c9c8f212b1b0" + +interpret@^1.0.4: version "1.1.0" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614" @@ -5204,14 +5208,14 @@ scoped-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/scoped-regex/-/scoped-regex-1.0.0.tgz#a346bb1acd4207ae70bd7c0c7ca9e566b6baddb8" -"semver@2 || 3 || 4 || 5", semver@^5.5.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" - -semver@^5.3.0: +"semver@2 || 3 || 4 || 5", semver@^5.3.0: version "5.4.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" +semver@^5.5.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" + serialize-javascript@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.4.0.tgz#7c958514db6ac2443a8abc062dc9f7886a7f6005" @@ -5401,27 +5405,19 @@ spawn-sync@^1.0.15: concat-stream "^1.4.7" os-shim "^0.1.2" -spdx-correct@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.0.0.tgz#05a5b4d7153a195bc92c3c425b69f3b2a9524c82" +spdx-correct@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" dependencies: - spdx-expression-parse "^3.0.0" - spdx-license-ids "^3.0.0" + spdx-license-ids "^1.0.2" -spdx-exceptions@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz#2c7ae61056c714a5b9b9b2b2af7d311ef5c78fe9" +spdx-expression-parse@~1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz#9bdf2f20e1f40ed447fbe273266191fced51626c" -spdx-expression-parse@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" - dependencies: - spdx-exceptions "^2.1.0" - spdx-license-ids "^3.0.0" - -spdx-license-ids@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz#7a7cd28470cc6d3a1cfe6d66886f6bc430d3ac87" +spdx-license-ids@^1.0.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz#c9df7a3424594ade6bd11900d596696dc06bac57" split-string@^3.0.1, split-string@^3.0.2: version "3.0.2" @@ -6015,11 +6011,11 @@ v8-compile-cache@^1.1.2: resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-1.1.2.tgz#8d32e4f16974654657e676e0e467a348e89b0dc4" validate-npm-package-license@^3.0.1: - version "3.0.3" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz#81643bcbef1bdfecd4623793dc4648948ba98338" + version "3.0.1" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc" dependencies: - spdx-correct "^3.0.0" - spdx-expression-parse "^3.0.0" + spdx-correct "~1.0.0" + spdx-expression-parse "~1.0.0" validator@9.2.0: version "9.2.0" @@ -6083,7 +6079,7 @@ webpack-addons@^1.1.5: dependencies: jscodeshift "^0.4.0" -webpack-cli@^2.0.10: +webpack-cli@2.0.10: version "2.0.10" resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-2.0.10.tgz#09b888fbaa0b4288ba4b94c4462b6f559dfcf51e" dependencies: From d346b95a170104890e92f94392c1cbd841c16206 Mon Sep 17 00:00:00 2001 From: sanex3339 Date: Wed, 7 Mar 2018 22:15:45 +0300 Subject: [PATCH 3/3] Switching on webpack@4 #2 --- dist/index.js | 12887 +----------------------------------------------- package.json | 6 +- yarn.lock | 188 +- 3 files changed, 95 insertions(+), 12986 deletions(-) diff --git a/dist/index.js b/dist/index.js index d90896b5..292da8be 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,12887 +1,2 @@ -/*! -Copyright (C) 2016-2018 Timofey Kachalov - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -require("source-map-support").install(); - - -module.exports = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 68); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports) { - -module.exports = require("@babel/runtime/helpers/classCallCheck"); - -/***/ }), -/* 1 */ -/***/ (function(module, exports) { - -module.exports = require("inversify"); - -/***/ }), -/* 2 */ -/***/ (function(module, exports) { - -module.exports = require("@babel/runtime/helpers/createClass"); - -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var ServiceIdentifiers; - -(function (ServiceIdentifiers) { - ServiceIdentifiers["Factory__ICalleeDataExtractor"] = "Factory"; - ServiceIdentifiers["Factory__IControlFlowCustomNode"] = "Factory"; - ServiceIdentifiers["Factory__IControlFlowReplacer"] = "Factory"; - ServiceIdentifiers["Factory__ICustomNode"] = "Factory"; - ServiceIdentifiers["Factory__ICustomNodeGroup"] = "Factory"; - ServiceIdentifiers["Factory__IDeadCodeInjectionCustomNode"] = "Factory"; - ServiceIdentifiers["Factory__IIdentifierNamesGenerator"] = "Factory"; - ServiceIdentifiers["Factory__IIdentifierObfuscatingReplacer"] = "Factory"; - ServiceIdentifiers["Factory__INodeGuard"] = "Factory"; - ServiceIdentifiers["Factory__INodeTransformer"] = "Factory"; - ServiceIdentifiers["Factory__IObfuscationResult"] = "Factory"; - ServiceIdentifiers["Factory__IObfuscatingReplacer"] = "Factory"; - ServiceIdentifiers["Factory__TControlFlowStorage"] = "Factory"; - ServiceIdentifiers["IArrayUtils"] = "IArrayUtils"; - ServiceIdentifiers["ICalleeDataExtractor"] = "ICalleeDataExtractor"; - ServiceIdentifiers["ICryptUtils"] = "ICryptUtils"; - ServiceIdentifiers["ICustomNode"] = "ICustomNode"; - ServiceIdentifiers["ICustomNodeGroup"] = "ICustomNodeGroup"; - ServiceIdentifiers["IControlFlowReplacer"] = "IControlFlowReplacer"; - ServiceIdentifiers["IEscapeSequenceEncoder"] = "IEscapeSequenceEncoder"; - ServiceIdentifiers["IIdentifierNamesGenerator"] = "IIdentifierNamesGenerator"; - ServiceIdentifiers["IIdentifierObfuscatingReplacer"] = "IIdentifierObfuscatingReplacer"; - ServiceIdentifiers["IJavaScriptObfuscator"] = "IJavaScriptObfuscator"; - ServiceIdentifiers["ILogger"] = "ILogger"; - ServiceIdentifiers["INodeGuard"] = "INodeGuard"; - ServiceIdentifiers["INodeTransformer"] = "INodeTransformer"; - ServiceIdentifiers["IObfuscationEventEmitter"] = "IObfuscationEventEmitter"; - ServiceIdentifiers["IObfuscationResult"] = "IObfuscationResult"; - ServiceIdentifiers["IOptions"] = "IOptions"; - ServiceIdentifiers["IOptionsNormalizer"] = "IOptionsNormalizer"; - ServiceIdentifiers["IObfuscatingReplacer"] = "IObfuscatingReplacer"; - ServiceIdentifiers["IRandomGenerator"] = "IRandomGenerator"; - ServiceIdentifiers["ISourceCode"] = "ISourceCode"; - ServiceIdentifiers["ISourceMapCorrector"] = "ISourceMapCorrector"; - ServiceIdentifiers["IStackTraceAnalyzer"] = "IStackTraceAnalyzer"; - ServiceIdentifiers["ITransformersRunner"] = "ITransformersRunner"; - ServiceIdentifiers["Newable__ICustomNode"] = "Newable"; - ServiceIdentifiers["Newable__TControlFlowStorage"] = "Newable"; - ServiceIdentifiers["TCustomNodeGroupStorage"] = "TCustomNodeGroupStorage"; - ServiceIdentifiers["TInputOptions"] = "TInputOptions"; - ServiceIdentifiers["TStringArrayStorage"] = "TStringArrayStorage"; -})(ServiceIdentifiers = exports.ServiceIdentifiers || (exports.ServiceIdentifiers = {})); - -/***/ }), -/* 4 */ -/***/ (function(module, exports) { - -module.exports = require("tslib"); - -/***/ }), -/* 5 */ -/***/ (function(module, exports) { - -module.exports = require("@babel/runtime/core-js/object/get-prototype-of"); - -/***/ }), -/* 6 */ -/***/ (function(module, exports) { - -module.exports = require("@babel/runtime/helpers/possibleConstructorReturn"); - -/***/ }), -/* 7 */ -/***/ (function(module, exports) { - -module.exports = require("@babel/runtime/helpers/inherits"); - -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var NodeType_1 = __webpack_require__(18); - -var NodeGuards = -/*#__PURE__*/ -function () { - function NodeGuards() { - _classCallCheck(this, NodeGuards); - } - - _createClass(NodeGuards, null, [{ - key: "isArrayPatternNode", - value: function isArrayPatternNode(node) { - return node.type === NodeType_1.NodeType.ArrayPattern; - } - }, { - key: "isArrowFunctionExpressionNode", - value: function isArrowFunctionExpressionNode(node) { - return node.type === NodeType_1.NodeType.ArrowFunctionExpression; - } - }, { - key: "isAssignmentPatternNode", - value: function isAssignmentPatternNode(node) { - return node.type === NodeType_1.NodeType.AssignmentPattern; - } - }, { - key: "isAwaitExpressionNode", - value: function isAwaitExpressionNode(node) { - return node.type === NodeType_1.NodeType.AwaitExpression; - } - }, { - key: "isBlockStatementNode", - value: function isBlockStatementNode(node) { - return node.type === NodeType_1.NodeType.BlockStatement; - } - }, { - key: "isBreakStatementNode", - value: function isBreakStatementNode(node) { - return node.type === NodeType_1.NodeType.BreakStatement; - } - }, { - key: "isCallExpressionNode", - value: function isCallExpressionNode(node) { - return node.type === NodeType_1.NodeType.CallExpression; - } - }, { - key: "isCatchClauseNode", - value: function isCatchClauseNode(node) { - return node.type === NodeType_1.NodeType.CatchClause; - } - }, { - key: "isClassDeclarationNode", - value: function isClassDeclarationNode(node) { - return node.type === NodeType_1.NodeType.ClassDeclaration; - } - }, { - key: "isContinueStatementNode", - value: function isContinueStatementNode(node) { - return node.type === NodeType_1.NodeType.ContinueStatement; - } - }, { - key: "isExpressionStatementNode", - value: function isExpressionStatementNode(node) { - return node.type === NodeType_1.NodeType.ExpressionStatement; - } - }, { - key: "isFunctionDeclarationNode", - value: function isFunctionDeclarationNode(node) { - return node.type === NodeType_1.NodeType.FunctionDeclaration; - } - }, { - key: "isFunctionExpressionNode", - value: function isFunctionExpressionNode(node) { - return node.type === NodeType_1.NodeType.FunctionExpression; - } - }, { - key: "isIdentifierNode", - value: function isIdentifierNode(node) { - return node.type === NodeType_1.NodeType.Identifier; - } - }, { - key: "isIfStatementNode", - value: function isIfStatementNode(node) { - return node.type === NodeType_1.NodeType.IfStatement; - } - }, { - key: "isLabelIdentifierNode", - value: function isLabelIdentifierNode(node, parentNode) { - var parentNodeIsLabeledStatementNode = NodeGuards.isLabeledStatementNode(parentNode) && parentNode.label === node; - var parentNodeIsContinueStatementNode = NodeGuards.isContinueStatementNode(parentNode) && parentNode.label === node; - var parentNodeIsBreakStatementNode = NodeGuards.isBreakStatementNode(parentNode) && parentNode.label === node; - return parentNodeIsLabeledStatementNode || parentNodeIsContinueStatementNode || parentNodeIsBreakStatementNode; - } - }, { - key: "isLabeledStatementNode", - value: function isLabeledStatementNode(node) { - return node.type === NodeType_1.NodeType.LabeledStatement; - } - }, { - key: "isLiteralNode", - value: function isLiteralNode(node) { - return node.type === NodeType_1.NodeType.Literal; - } - }, { - key: "isMemberExpressionNode", - value: function isMemberExpressionNode(node) { - return node.type === NodeType_1.NodeType.MemberExpression; - } - }, { - key: "isMethodDefinitionNode", - value: function isMethodDefinitionNode(node) { - return node.type === NodeType_1.NodeType.MethodDefinition; - } - }, { - key: "isNode", - value: function isNode(object) { - return object && !object.type !== undefined; - } - }, { - key: "isNodeHasBlockScope", - value: function isNodeHasBlockScope(node, parentNode) { - return NodeGuards.isProgramNode(node) || NodeGuards.isBlockStatementNode(node) && NodeGuards.nodesWithBlockScope.includes(parentNode.type); - } - }, { - key: "isNodeHasScope", - value: function isNodeHasScope(node) { - return NodeGuards.isProgramNode(node) || NodeGuards.isBlockStatementNode(node) || NodeGuards.isSwitchCaseNode(node); - } - }, { - key: "isNodeWithComments", - value: function isNodeWithComments(node) { - return Boolean(node.leadingComments) || Boolean(node.trailingComments); - } - }, { - key: "isObjectPatternNode", - value: function isObjectPatternNode(node) { - return node.type === NodeType_1.NodeType.ObjectPattern; - } - }, { - key: "isObjectExpressionNode", - value: function isObjectExpressionNode(node) { - return node.type === NodeType_1.NodeType.ObjectExpression; - } - }, { - key: "isProgramNode", - value: function isProgramNode(node) { - return node.type === NodeType_1.NodeType.Program; - } - }, { - key: "isPropertyNode", - value: function isPropertyNode(node) { - return node.type === NodeType_1.NodeType.Property; - } - }, { - key: "isReplaceableIdentifierNode", - value: function isReplaceableIdentifierNode(node, parentNode) { - if (!NodeGuards.isIdentifierNode(node)) { - return false; - } - - var parentNodeIsPropertyNode = NodeGuards.isPropertyNode(parentNode) && !parentNode.computed && parentNode.key === node; - var parentNodeIsMemberExpressionNode = NodeGuards.isMemberExpressionNode(parentNode) && !parentNode.computed && parentNode.property === node; - var parentNodeIsMethodDefinitionNode = NodeGuards.isMethodDefinitionNode(parentNode) && !parentNode.computed; - var isLabelIdentifierNode = NodeGuards.isLabelIdentifierNode(node, parentNode); - return !parentNodeIsPropertyNode && !parentNodeIsMemberExpressionNode && !parentNodeIsMethodDefinitionNode && !isLabelIdentifierNode; - } - }, { - key: "isRestElementNode", - value: function isRestElementNode(node) { - return node.type === NodeType_1.NodeType.RestElement; - } - }, { - key: "isReturnStatementNode", - value: function isReturnStatementNode(node) { - return node.type === NodeType_1.NodeType.ReturnStatement; - } - }, { - key: "isSuperNode", - value: function isSuperNode(node) { - return node.type === NodeType_1.NodeType.Super; - } - }, { - key: "isSwitchCaseNode", - value: function isSwitchCaseNode(node) { - return node.type === NodeType_1.NodeType.SwitchCase; - } - }, { - key: "isTemplateLiteralNode", - value: function isTemplateLiteralNode(node) { - return node.type === NodeType_1.NodeType.TemplateLiteral; - } - }, { - key: "isUnaryExpressionNode", - value: function isUnaryExpressionNode(node) { - return node.type === NodeType_1.NodeType.UnaryExpression; - } - }, { - key: "isUseStrictOperator", - value: function isUseStrictOperator(node) { - return node.type === NodeType_1.NodeType.ExpressionStatement && node.directive === 'use strict'; - } - }, { - key: "isVariableDeclarationNode", - value: function isVariableDeclarationNode(node) { - return node.type === NodeType_1.NodeType.VariableDeclaration; - } - }, { - key: "isVariableDeclaratorNode", - value: function isVariableDeclaratorNode(node) { - return node.type === NodeType_1.NodeType.VariableDeclarator; - } - }, { - key: "isWhileStatementNode", - value: function isWhileStatementNode(node) { - return node.type === NodeType_1.NodeType.WhileStatement; - } - }]); - - return NodeGuards; -}(); - -NodeGuards.nodesWithBlockScope = [NodeType_1.NodeType.ArrowFunctionExpression, NodeType_1.NodeType.FunctionDeclaration, NodeType_1.NodeType.FunctionExpression, NodeType_1.NodeType.MethodDefinition]; -exports.NodeGuards = NodeGuards; - -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _typeof = __webpack_require__(50); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var escodegen = __importStar(__webpack_require__(42)); - -var esprima = __importStar(__webpack_require__(51)); - -var estraverse = __importStar(__webpack_require__(17)); - -var NodeGuards_1 = __webpack_require__(8); - -var NodeUtils = -/*#__PURE__*/ -function () { - function NodeUtils() { - _classCallCheck(this, NodeUtils); - } - - _createClass(NodeUtils, null, [{ - key: "addXVerbatimPropertyToLiterals", - value: function addXVerbatimPropertyToLiterals(astTree) { - estraverse.replace(astTree, { - leave: function leave(node) { - if (NodeGuards_1.NodeGuards.isLiteralNode(node)) { - node['x-verbatim-property'] = { - content: node.raw, - precedence: escodegen.Precedence.Primary - }; - } - } - }); - return astTree; - } - }, { - key: "clone", - value: function clone(astTree) { - return NodeUtils.parentize(NodeUtils.cloneRecursive(astTree)); - } - }, { - key: "convertCodeToStructure", - value: function convertCodeToStructure(code) { - var structure = esprima.parseScript(code); - structure = NodeUtils.addXVerbatimPropertyToLiterals(structure); - structure = NodeUtils.parentize(structure); - return structure.body; - } - }, { - key: "convertStructureToCode", - value: function convertStructureToCode(structure) { - return structure.reduce(function (code, node) { - return code + escodegen.generate(node, { - sourceMapWithCode: true - }).code; - }, ''); - } - }, { - key: "getBlockScopesOfNode", - value: function getBlockScopesOfNode(targetNode) { - return NodeUtils.getBlockScopesOfNodeRecursive(targetNode); - } - }, { - key: "getNextSiblingStatementNode", - value: function getNextSiblingStatementNode(node) { - return NodeUtils.getSiblingStatementNodeByOffset(node, 1); - } - }, { - key: "getPreviousSiblingStatementNode", - value: function getPreviousSiblingStatementNode(node) { - return NodeUtils.getSiblingStatementNodeByOffset(node, -1); - } - }, { - key: "getScopeOfNode", - value: function getScopeOfNode(node) { - var parentNode = node.parentNode; - - if (!parentNode) { - throw new ReferenceError('`parentNode` property of given node is `undefined`'); - } - - if (!NodeGuards_1.NodeGuards.isNodeHasScope(parentNode)) { - return NodeUtils.getScopeOfNode(parentNode); - } - - return parentNode; - } - }, { - key: "getUnaryExpressionArgumentNode", - value: function getUnaryExpressionArgumentNode(unaryExpressionNode) { - if (NodeGuards_1.NodeGuards.isUnaryExpressionNode(unaryExpressionNode.argument)) { - return NodeUtils.getUnaryExpressionArgumentNode(unaryExpressionNode.argument); - } - - return unaryExpressionNode.argument; - } - }, { - key: "parentize", - value: function parentize(astTree) { - estraverse.replace(astTree, { - enter: NodeUtils.parentizeNode - }); - return astTree; - } - }, { - key: "parentizeNode", - value: function parentizeNode(node, parentNode) { - node.parentNode = parentNode || node; - node.obfuscatedNode = false; - return node; - } - }, { - key: "cloneRecursive", - value: function cloneRecursive(node) { - if (node === null) { - return node; - } - - var copy = {}; - - for (var property in node) { - if (!node.hasOwnProperty(property) || property === 'parentNode') { - continue; - } - - var value = node[property]; - var clonedValue = void 0; - - if (value === null || value instanceof RegExp) { - clonedValue = value; - } else if (Array.isArray(value)) { - clonedValue = value.map(NodeUtils.cloneRecursive); - } else if (_typeof(value) === 'object') { - clonedValue = NodeUtils.cloneRecursive(value); - } else { - clonedValue = value; - } - - copy[property] = clonedValue; - } - - return copy; - } - }, { - key: "getBlockScopesOfNodeRecursive", - value: function getBlockScopesOfNodeRecursive(node) { - var blockScopes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; - var depth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; - var parentNode = node.parentNode; - - if (!parentNode) { - throw new ReferenceError('`parentNode` property of given node is `undefined`'); - } - - if (NodeGuards_1.NodeGuards.isBlockStatementNode(node) && parentNode === node) { - blockScopes.push(node); - } - - if (NodeGuards_1.NodeGuards.isProgramNode(node) || depth && NodeGuards_1.NodeGuards.isNodeHasBlockScope(node, parentNode)) { - blockScopes.push(node); - } - - if (node !== parentNode) { - return NodeUtils.getBlockScopesOfNodeRecursive(parentNode, blockScopes, ++depth); - } - - return blockScopes; - } - }, { - key: "getSiblingStatementNodeByOffset", - value: function getSiblingStatementNodeByOffset(node, offset) { - var scopeNode = NodeUtils.getScopeOfNode(node); - var scopeBody = !NodeGuards_1.NodeGuards.isSwitchCaseNode(scopeNode) ? scopeNode.body : scopeNode.consequent; - var indexInScope = scopeBody.indexOf(node); - return scopeBody[indexInScope + offset] || null; - } - }]); - - return NodeUtils; -}(); - -exports.NodeUtils = NodeUtils; - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$assign = __webpack_require__(11); - -var _Object$defineProperty = __webpack_require__(78); - -var _Object$getOwnPropertyDescriptor = __webpack_require__(79); - -var _Reflect$getMetadata = __webpack_require__(80); - -var _Object$getOwnPropertyNames = __webpack_require__(81); - -var _Reflect$defineMetadata = __webpack_require__(82); - -var _Reflect$hasMetadata = __webpack_require__(83); - -var _Set = __webpack_require__(29); - -var _Object$keys = __webpack_require__(38); - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var defaultDescriptor = { - configurable: true, - enumerable: true -}; -var initializedTargetMetadataKey = '_initialized'; -var initializablePropertiesSetMetadataKey = '_initializablePropertiesSet'; -var wrappedMethodsSetMetadataKey = '_wrappedMethodsSet'; -var constructorMethodName = 'constructor'; - -function initializable() { - var initializeMethodName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'initialize'; - - var decoratorName = _Object$keys(this)[0]; - - return function (target, propertyKey) { - var initializeMethod = target[initializeMethodName]; - - if (!initializeMethod || typeof initializeMethod !== 'function') { - throw new Error("`".concat(initializeMethodName, "` method with initialization logic not ") + "found. `@".concat(decoratorName, "` decorator requires `").concat(initializeMethodName, "` method")); - } - - initializeTargetMetadata(initializedTargetMetadataKey, false, target); - initializeTargetMetadata(initializablePropertiesSetMetadataKey, new _Set(), target); - initializeTargetMetadata(wrappedMethodsSetMetadataKey, new _Set(), target); - wrapTargetMethodsInInitializedCheck(target, initializeMethodName); - wrapInitializeMethodInInitializeCheck(target, initializeMethodName, propertyKey); - return wrapInitializableProperty(target, propertyKey); - }; -} - -exports.initializable = initializable; - -function initializeTargetMetadata(metadataKey, metadataValue, target) { - var hasInitializedMetadata = _Reflect$hasMetadata(metadataKey, target); - - if (!hasInitializedMetadata) { - _Reflect$defineMetadata(metadataKey, metadataValue, target); - } -} - -function wrapTargetMethodsInInitializedCheck(target, initializeMethodName) { - var ownPropertyNames = _Object$getOwnPropertyNames(target); - - var prohibitedPropertyNames = [initializeMethodName, constructorMethodName]; - ownPropertyNames.forEach(function (propertyName) { - var initializablePropertiesSet = _Reflect$getMetadata(initializablePropertiesSetMetadataKey, target); - - var wrappedMethodsSet = _Reflect$getMetadata(wrappedMethodsSetMetadataKey, target); - - var isProhibitedPropertyName = prohibitedPropertyNames.includes(propertyName) || initializablePropertiesSet.has(propertyName) || wrappedMethodsSet.has(propertyName); - - if (isProhibitedPropertyName) { - return; - } - - var targetProperty = target[propertyName]; - - if (typeof targetProperty !== 'function') { - return; - } - - var methodDescriptor = _Object$getOwnPropertyDescriptor(target, propertyName) || defaultDescriptor; - var originalMethod = methodDescriptor.value; - - _Object$defineProperty(target, propertyName, _Object$assign({}, methodDescriptor, { - value: function value() { - if (!_Reflect$getMetadata(initializedTargetMetadataKey, this)) { - throw new Error("Class should be initialized with `".concat(initializeMethodName, "()` method")); - } - - return originalMethod.apply(this, arguments); - } - })); - - wrappedMethodsSet.add(propertyName); - }); -} - -function wrapInitializeMethodInInitializeCheck(target, initializeMethodName, propertyKey) { - var methodDescriptor = _Object$getOwnPropertyDescriptor(target, initializeMethodName) || defaultDescriptor; - var originalMethod = methodDescriptor.value; - - _Object$defineProperty(target, initializeMethodName, _Object$assign({}, methodDescriptor, { - value: function value() { - _Reflect$defineMetadata(initializedTargetMetadataKey, true, this); - - var result = originalMethod.apply(this, arguments); - - if (this[propertyKey]) {} - - return result; - } - })); -} - -function wrapInitializableProperty(target, propertyKey) { - var initializablePropertiesSet = _Reflect$getMetadata(initializablePropertiesSetMetadataKey, target); - - initializablePropertiesSet.add(propertyKey); - var initializablePropertyMetadataKey = "_".concat(propertyKey); - var propertyDescriptor = _Object$getOwnPropertyDescriptor(target, initializablePropertyMetadataKey) || defaultDescriptor; - - _Object$defineProperty(target, propertyKey, _Object$assign({}, propertyDescriptor, { - get: function get() { - if (this[initializablePropertyMetadataKey] === undefined) { - throw new Error("Property `".concat(propertyKey, "` is not initialized! Initialize it first!")); - } - - return this[initializablePropertyMetadataKey]; - }, - set: function set(newVal) { - this[initializablePropertyMetadataKey] = newVal; - } - })); - - return propertyDescriptor; -} - -/***/ }), -/* 11 */ -/***/ (function(module, exports) { - -module.exports = require("@babel/runtime/core-js/object/assign"); - -/***/ }), -/* 12 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var TransformationStage; - -(function (TransformationStage) { - TransformationStage["Preparing"] = "Preparing"; - TransformationStage["DeadCodeInjection"] = "DeadCodeInjection"; - TransformationStage["ControlFlowFlattening"] = "ControlFlowFlattening"; - TransformationStage["Converting"] = "Converting"; - TransformationStage["Obfuscating"] = "Obfuscating"; - TransformationStage["Finalizing"] = "Finalizing"; -})(TransformationStage = exports.TransformationStage || (exports.TransformationStage = {})); - -/***/ }), -/* 13 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var Initializable_1 = __webpack_require__(10); - -var AbstractNodeTransformer = -/*#__PURE__*/ -function () { - function AbstractNodeTransformer(randomGenerator, options) { - _classCallCheck(this, AbstractNodeTransformer); - - this.randomGenerator = randomGenerator; - this.options = options; - } - - _createClass(AbstractNodeTransformer, [{ - key: "initialize", - value: function initialize() { - this.nodeIdentifier = this.randomGenerator.getRandomInteger(0, 10000); - } - }]); - - return AbstractNodeTransformer; -}(); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Number)], AbstractNodeTransformer.prototype, "nodeIdentifier", void 0); - -tslib_1.__decorate([inversify_1.postConstruct(), tslib_1.__metadata("design:type", Function), tslib_1.__metadata("design:paramtypes", []), tslib_1.__metadata("design:returntype", void 0)], AbstractNodeTransformer.prototype, "initialize", null); - -AbstractNodeTransformer = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object])], AbstractNodeTransformer); -exports.AbstractNodeTransformer = AbstractNodeTransformer; - -/***/ }), -/* 14 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var GlobalVariableTemplate1_1 = __webpack_require__(101); - -var GlobalVariableTemplate2_1 = __webpack_require__(102); - -var AbstractCustomNode = AbstractCustomNode_1 = -/*#__PURE__*/ -function () { - function AbstractCustomNode(identifierNamesGeneratorFactory, randomGenerator, options) { - _classCallCheck(this, AbstractCustomNode); - - this.cachedNode = null; - this.identifierNamesGenerator = identifierNamesGeneratorFactory(options); - this.randomGenerator = randomGenerator; - this.options = options; - } - - _createClass(AbstractCustomNode, [{ - key: "getNode", - value: function getNode() { - if (!this.cachedNode) { - this.cachedNode = this.getNodeStructure(); - } - - return this.cachedNode; - } - }, { - key: "getGlobalVariableTemplate", - value: function getGlobalVariableTemplate() { - return this.randomGenerator.getRandomGenerator().pickone(AbstractCustomNode_1.globalVariableTemplateFunctions); - } - }]); - - return AbstractCustomNode; -}(); - -AbstractCustomNode.globalVariableTemplateFunctions = [GlobalVariableTemplate1_1.GlobalVariableTemplate1(), GlobalVariableTemplate2_1.GlobalVariableTemplate2()]; -AbstractCustomNode = AbstractCustomNode_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], AbstractCustomNode); -exports.AbstractCustomNode = AbstractCustomNode; -var AbstractCustomNode_1; - -/***/ }), -/* 15 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$assign = __webpack_require__(11); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var escodegen = __importStar(__webpack_require__(42)); - -var NodeType_1 = __webpack_require__(18); - -var Nodes = -/*#__PURE__*/ -function () { - function Nodes() { - _classCallCheck(this, Nodes); - } - - _createClass(Nodes, null, [{ - key: "getProgramNode", - value: function getProgramNode() { - var body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - return { - type: NodeType_1.NodeType.Program, - body: body, - sourceType: 'script', - obfuscatedNode: false - }; - } - }, { - key: "getArrayExpressionNode", - value: function getArrayExpressionNode() { - var elements = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - return { - type: NodeType_1.NodeType.ArrayExpression, - elements: elements - }; - } - }, { - key: "getAssignmentExpressionNode", - value: function getAssignmentExpressionNode(operator, left, right) { - return { - type: NodeType_1.NodeType.AssignmentExpression, - operator: operator, - left: left, - right: right, - obfuscatedNode: false - }; - } - }, { - key: "getBinaryExpressionNode", - value: function getBinaryExpressionNode(operator, left, right) { - return { - type: NodeType_1.NodeType.BinaryExpression, - operator: operator, - left: left, - right: right, - obfuscatedNode: false - }; - } - }, { - key: "getBlockStatementNode", - value: function getBlockStatementNode() { - var body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - return { - type: NodeType_1.NodeType.BlockStatement, - body: body, - obfuscatedNode: false - }; - } - }, { - key: "getBreakStatement", - value: function getBreakStatement(label) { - var breakStatementNode = { - type: NodeType_1.NodeType.BreakStatement, - obfuscatedNode: false - }; - - if (label) { - breakStatementNode.label = label; - } - - return breakStatementNode; - } - }, { - key: "getCallExpressionNode", - value: function getCallExpressionNode(callee) { - var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; - return { - type: NodeType_1.NodeType.CallExpression, - callee: callee, - arguments: args, - obfuscatedNode: false - }; - } - }, { - key: "getContinueStatement", - value: function getContinueStatement(label) { - var continueStatementNode = { - type: NodeType_1.NodeType.ContinueStatement, - obfuscatedNode: false - }; - - if (label) { - continueStatementNode.label = label; - } - - return continueStatementNode; - } - }, { - key: "getExpressionStatementNode", - value: function getExpressionStatementNode(expression) { - return { - type: NodeType_1.NodeType.ExpressionStatement, - expression: expression, - obfuscatedNode: false - }; - } - }, { - key: "getFunctionDeclarationNode", - value: function getFunctionDeclarationNode(functionName, params, body) { - return { - type: NodeType_1.NodeType.FunctionDeclaration, - id: Nodes.getIdentifierNode(functionName), - params: params, - body: body, - generator: false, - obfuscatedNode: false - }; - } - }, { - key: "getFunctionExpressionNode", - value: function getFunctionExpressionNode(params, body) { - return { - type: NodeType_1.NodeType.FunctionExpression, - params: params, - body: body, - generator: false, - obfuscatedNode: false - }; - } - }, { - key: "getIfStatementNode", - value: function getIfStatementNode(test, consequent, alternate) { - return _Object$assign({ - type: NodeType_1.NodeType.IfStatement, - test: test, - consequent: consequent - }, alternate && { - alternate: alternate - }, { - obfuscatedNode: false - }); - } - }, { - key: "getIdentifierNode", - value: function getIdentifierNode(name) { - return { - type: NodeType_1.NodeType.Identifier, - name: name, - obfuscatedNode: false - }; - } - }, { - key: "getLiteralNode", - value: function getLiteralNode(value, raw) { - raw = raw !== undefined ? raw : "'".concat(value, "'"); - return { - type: NodeType_1.NodeType.Literal, - value: value, - raw: raw, - 'x-verbatim-property': { - content: raw, - precedence: escodegen.Precedence.Primary - }, - obfuscatedNode: false - }; - } - }, { - key: "getLogicalExpressionNode", - value: function getLogicalExpressionNode(operator, left, right) { - return { - type: NodeType_1.NodeType.LogicalExpression, - operator: operator, - left: left, - right: right, - obfuscatedNode: false - }; - } - }, { - key: "getMemberExpressionNode", - value: function getMemberExpressionNode(object, property) { - var computed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - return { - type: NodeType_1.NodeType.MemberExpression, - computed: computed, - object: object, - property: property, - obfuscatedNode: false - }; - } - }, { - key: "getMethodDefinitionNode", - value: function getMethodDefinitionNode(key, value, kind, computed) { - return { - type: NodeType_1.NodeType.MethodDefinition, - key: key, - value: value, - kind: kind, - computed: computed, - static: false, - obfuscatedNode: false - }; - } - }, { - key: "getObjectExpressionNode", - value: function getObjectExpressionNode(properties) { - return { - type: NodeType_1.NodeType.ObjectExpression, - properties: properties, - obfuscatedNode: false - }; - } - }, { - key: "getPropertyNode", - value: function getPropertyNode(key, value) { - var computed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - return { - type: NodeType_1.NodeType.Property, - key: key, - value: value, - kind: 'init', - method: false, - shorthand: false, - computed: computed, - obfuscatedNode: false - }; - } - }, { - key: "getUnaryExpressionNode", - value: function getUnaryExpressionNode(operator, argument) { - var prefix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; - return { - type: NodeType_1.NodeType.UnaryExpression, - operator: operator, - argument: argument, - prefix: prefix, - obfuscatedNode: false - }; - } - }, { - key: "getReturnStatementNode", - value: function getReturnStatementNode(argument) { - return { - type: NodeType_1.NodeType.ReturnStatement, - argument: argument, - obfuscatedNode: false - }; - } - }, { - key: "getSwitchStatementNode", - value: function getSwitchStatementNode(discriminant, cases) { - return { - type: NodeType_1.NodeType.SwitchStatement, - discriminant: discriminant, - cases: cases, - obfuscatedNode: false - }; - } - }, { - key: "getSwitchCaseNode", - value: function getSwitchCaseNode(test, consequent) { - return { - type: NodeType_1.NodeType.SwitchCase, - test: test, - consequent: consequent, - obfuscatedNode: false - }; - } - }, { - key: "getUpdateExpressionNode", - value: function getUpdateExpressionNode(operator, argumentExpr) { - return { - type: NodeType_1.NodeType.UpdateExpression, - operator: operator, - argument: argumentExpr, - prefix: false, - obfuscatedNode: false - }; - } - }, { - key: "getVariableDeclarationNode", - value: function getVariableDeclarationNode() { - var declarations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - var kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'var'; - return { - type: NodeType_1.NodeType.VariableDeclaration, - declarations: declarations, - kind: kind, - obfuscatedNode: false - }; - } - }, { - key: "getVariableDeclaratorNode", - value: function getVariableDeclaratorNode(id, init) { - return { - type: NodeType_1.NodeType.VariableDeclarator, - id: id, - init: init, - obfuscatedNode: false - }; - } - }, { - key: "getWhileStatementNode", - value: function getWhileStatementNode(test, body) { - return { - type: NodeType_1.NodeType.WhileStatement, - test: test, - body: body, - obfuscatedNode: false - }; - } - }]); - - return Nodes; -}(); - -exports.Nodes = Nodes; - -/***/ }), -/* 16 */ -/***/ (function(module, exports) { - -module.exports = require("@babel/runtime/core-js/map"); - -/***/ }), -/* 17 */ -/***/ (function(module, exports) { - -module.exports = require("estraverse"); - -/***/ }), -/* 18 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var NodeType; - -(function (NodeType) { - NodeType["ArrayExpression"] = "ArrayExpression"; - NodeType["ArrayPattern"] = "ArrayPattern"; - NodeType["ArrowFunctionExpression"] = "ArrowFunctionExpression"; - NodeType["AssignmentExpression"] = "AssignmentExpression"; - NodeType["AssignmentPattern"] = "AssignmentPattern"; - NodeType["AwaitExpression"] = "AwaitExpression"; - NodeType["BinaryExpression"] = "BinaryExpression"; - NodeType["BlockStatement"] = "BlockStatement"; - NodeType["BreakStatement"] = "BreakStatement"; - NodeType["CallExpression"] = "CallExpression"; - NodeType["CatchClause"] = "CatchClause"; - NodeType["ClassDeclaration"] = "ClassDeclaration"; - NodeType["ContinueStatement"] = "ContinueStatement"; - NodeType["ExpressionStatement"] = "ExpressionStatement"; - NodeType["FunctionDeclaration"] = "FunctionDeclaration"; - NodeType["FunctionExpression"] = "FunctionExpression"; - NodeType["Identifier"] = "Identifier"; - NodeType["IfStatement"] = "IfStatement"; - NodeType["LabeledStatement"] = "LabeledStatement"; - NodeType["Literal"] = "Literal"; - NodeType["LogicalExpression"] = "LogicalExpression"; - NodeType["MemberExpression"] = "MemberExpression"; - NodeType["MethodDefinition"] = "MethodDefinition"; - NodeType["ObjectExpression"] = "ObjectExpression"; - NodeType["ObjectPattern"] = "ObjectPattern"; - NodeType["Program"] = "Program"; - NodeType["Property"] = "Property"; - NodeType["RestElement"] = "RestElement"; - NodeType["ReturnStatement"] = "ReturnStatement"; - NodeType["Super"] = "Super"; - NodeType["SwitchCase"] = "SwitchCase"; - NodeType["SwitchStatement"] = "SwitchStatement"; - NodeType["TemplateLiteral"] = "TemplateLiteral"; - NodeType["TryStatement"] = "TryStatement"; - NodeType["UnaryExpression"] = "UnaryExpression"; - NodeType["UpdateExpression"] = "UpdateExpression"; - NodeType["VariableDeclaration"] = "VariableDeclaration"; - NodeType["VariableDeclarator"] = "VariableDeclarator"; - NodeType["WhileStatement"] = "WhileStatement"; -})(NodeType = exports.NodeType || (exports.NodeType = {})); - -/***/ }), -/* 19 */ -/***/ (function(module, exports) { - -module.exports = require("string-template"); - -/***/ }), -/* 20 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var ControlFlowCustomNode; - -(function (ControlFlowCustomNode) { - ControlFlowCustomNode["BinaryExpressionFunctionNode"] = "BinaryExpressionFunctionNode"; - ControlFlowCustomNode["BlockStatementControlFlowFlatteningNode"] = "BlockStatementControlFlowFlatteningNode"; - ControlFlowCustomNode["CallExpressionControlFlowStorageCallNode"] = "CallExpressionControlFlowStorageCallNode"; - ControlFlowCustomNode["CallExpressionFunctionNode"] = "CallExpressionFunctionNode"; - ControlFlowCustomNode["ControlFlowStorageNode"] = "ControlFlowStorageNode"; - ControlFlowCustomNode["ExpressionWithOperatorControlFlowStorageCallNode"] = "ExpressionWithOperatorControlFlowStorageCallNode"; - ControlFlowCustomNode["LogicalExpressionFunctionNode"] = "LogicalExpressionFunctionNode"; - ControlFlowCustomNode["StringLiteralControlFlowStorageCallNode"] = "StringLiteralControlFlowStorageCallNode"; - ControlFlowCustomNode["StringLiteralNode"] = "StringLiteralNode"; -})(ControlFlowCustomNode = exports.ControlFlowCustomNode || (exports.ControlFlowCustomNode = {})); - -/***/ }), -/* 21 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var ObfuscationTarget; - -(function (ObfuscationTarget) { - ObfuscationTarget["Browser"] = "browser"; - ObfuscationTarget["Extension"] = "extension"; - ObfuscationTarget["Node"] = "node"; -})(ObfuscationTarget = exports.ObfuscationTarget || (exports.ObfuscationTarget = {})); - -/***/ }), -/* 22 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Map = __webpack_require__(16); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var AnalyzersModule_1 = __webpack_require__(70); - -var ControlFlowTransformersModule_1 = __webpack_require__(75); - -var ConvertingTransformersModule_1 = __webpack_require__(89); - -var CustomNodesModule_1 = __webpack_require__(94); - -var FinalizingTransformersModule_1 = __webpack_require__(141); - -var GeneratorsModule_1 = __webpack_require__(142); - -var NodeTransformersModule_1 = __webpack_require__(145); - -var ObfuscatingTransformersModule_1 = __webpack_require__(146); - -var OptionsModule_1 = __webpack_require__(159); - -var PreparingTransformersModule_1 = __webpack_require__(174); - -var StoragesModule_1 = __webpack_require__(183); - -var UtilsModule_1 = __webpack_require__(188); - -var JavaScriptObfuscator_1 = __webpack_require__(194); - -var Logger_1 = __webpack_require__(65); - -var ObfuscationEventEmitter_1 = __webpack_require__(197); - -var ObfuscationResult_1 = __webpack_require__(199); - -var SourceCode_1 = __webpack_require__(200); - -var SourceMapCorrector_1 = __webpack_require__(201); - -var TransformersRunner_1 = __webpack_require__(202); - -var InversifyContainerFacade = -/*#__PURE__*/ -function () { - function InversifyContainerFacade() { - _classCallCheck(this, InversifyContainerFacade); - - this.container = new inversify_1.Container(); - } - - _createClass(InversifyContainerFacade, [{ - key: "get", - value: function get(serviceIdentifier) { - return this.container.get(serviceIdentifier); - } - }, { - key: "getNamed", - value: function getNamed(serviceIdentifier, named) { - return this.container.getNamed(serviceIdentifier, named); - } - }, { - key: "load", - value: function load(sourceCode, options) { - this.container.bind(ServiceIdentifiers_1.ServiceIdentifiers.ISourceCode).toDynamicValue(function () { - return new SourceCode_1.SourceCode(sourceCode); - }).inSingletonScope(); - this.container.bind(ServiceIdentifiers_1.ServiceIdentifiers.TInputOptions).toDynamicValue(function () { - return options; - }).inSingletonScope(); - this.container.bind(ServiceIdentifiers_1.ServiceIdentifiers.ILogger).to(Logger_1.Logger).inSingletonScope(); - this.container.bind(ServiceIdentifiers_1.ServiceIdentifiers.IJavaScriptObfuscator).to(JavaScriptObfuscator_1.JavaScriptObfuscator).inSingletonScope(); - this.container.bind(ServiceIdentifiers_1.ServiceIdentifiers.ITransformersRunner).to(TransformersRunner_1.TransformersRunner).inSingletonScope(); - this.container.bind(ServiceIdentifiers_1.ServiceIdentifiers.IObfuscationResult).to(ObfuscationResult_1.ObfuscationResult).inSingletonScope(); - this.container.bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IObfuscationResult).toFactory(function (context) { - return function (obfuscatedCode, sourceMap) { - var obfuscationResult = context.container.get(ServiceIdentifiers_1.ServiceIdentifiers.IObfuscationResult); - obfuscationResult.initialize(obfuscatedCode, sourceMap); - return obfuscationResult; - }; - }); - this.container.bind(ServiceIdentifiers_1.ServiceIdentifiers.ISourceMapCorrector).to(SourceMapCorrector_1.SourceMapCorrector).inSingletonScope(); - this.container.bind(ServiceIdentifiers_1.ServiceIdentifiers.IObfuscationEventEmitter).to(ObfuscationEventEmitter_1.ObfuscationEventEmitter).inSingletonScope(); - this.container.load(AnalyzersModule_1.analyzersModule); - this.container.load(ControlFlowTransformersModule_1.controlFlowTransformersModule); - this.container.load(ConvertingTransformersModule_1.convertingTransformersModule); - this.container.load(CustomNodesModule_1.customNodesModule); - this.container.load(FinalizingTransformersModule_1.finalizingTransformersModule); - this.container.load(GeneratorsModule_1.generatorsModule); - this.container.load(NodeTransformersModule_1.nodeTransformersModule); - this.container.load(ObfuscatingTransformersModule_1.obfuscatingTransformersModule); - this.container.load(OptionsModule_1.optionsModule); - this.container.load(PreparingTransformersModule_1.preparingTransformersModule); - this.container.load(StoragesModule_1.storagesModule); - this.container.load(UtilsModule_1.utilsModule); - } - }, { - key: "unload", - value: function unload() { - this.container.unbindAll(); - } - }], [{ - key: "getFactory", - value: function getFactory(serviceIdentifier) { - return function (context) { - return function (bindingName) { - return context.container.getNamed(serviceIdentifier, bindingName); - }; - }; - } - }, { - key: "getCacheFactory", - value: function getCacheFactory(serviceIdentifier) { - return function (context) { - var cache = new _Map(); - return function (bindingName) { - if (cache.has(bindingName)) { - return cache.get(bindingName); - } - - var object = context.container.getNamed(serviceIdentifier, bindingName); - cache.set(bindingName, object); - return object; - }; - }; - } - }, { - key: "getConstructorFactory", - value: function getConstructorFactory(serviceIdentifier) { - for (var _len = arguments.length, dependencies = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - dependencies[_key - 1] = arguments[_key]; - } - - return function (context) { - var cache = new _Map(); - var cachedDependencies = []; - return function (bindingName) { - dependencies.forEach(function (dependency, index) { - if (!cachedDependencies[index]) { - cachedDependencies[index] = context.container.get(dependency); - } - }); - - if (cache.has(bindingName)) { - return new (Function.prototype.bind.apply(cache.get(bindingName), [null].concat(cachedDependencies)))(); - } - - var constructor = context.container.getNamed(serviceIdentifier, bindingName); - cache.set(bindingName, constructor); - return new (Function.prototype.bind.apply(constructor, [null].concat(cachedDependencies)))(); - }; - }; - } - }]); - - return InversifyContainerFacade; -}(); - -exports.InversifyContainerFacade = InversifyContainerFacade; - -/***/ }), -/* 23 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _toConsumableArray = __webpack_require__(24); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var NodeGuards_1 = __webpack_require__(8); - -var NodeAppender = -/*#__PURE__*/ -function () { - function NodeAppender() { - _classCallCheck(this, NodeAppender); - } - - _createClass(NodeAppender, null, [{ - key: "appendNode", - value: function appendNode(scopeNode, scopeStatements) { - scopeStatements = NodeAppender.parentizeScopeStatementsBeforeAppend(scopeNode, scopeStatements); - NodeAppender.setScopeNodeStatements(scopeNode, _toConsumableArray(NodeAppender.getScopeNodeStatements(scopeNode)).concat(_toConsumableArray(scopeStatements))); - } - }, { - key: "appendNodeToOptimalBlockScope", - value: function appendNodeToOptimalBlockScope(blockScopeStackTraceData, blockScopeNode, nodeBodyStatements) { - var index = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; - var targetBlockScope; - - if (!blockScopeStackTraceData.length) { - targetBlockScope = blockScopeNode; - } else { - targetBlockScope = NodeAppender.getOptimalBlockScope(blockScopeStackTraceData, index); - } - - NodeAppender.prependNode(targetBlockScope, nodeBodyStatements); - } - }, { - key: "getOptimalBlockScope", - value: function getOptimalBlockScope(blockScopeTraceData, index) { - var deep = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Infinity; - var firstCall = blockScopeTraceData[index]; - - if (deep <= 0) { - throw new Error("Invalid `deep` argument value. Value should be bigger then 0."); - } - - if (deep > 1 && firstCall.stackTrace.length) { - return NodeAppender.getOptimalBlockScope(firstCall.stackTrace, 0, --deep); - } else { - return firstCall.callee; - } - } - }, { - key: "insertNodeAfter", - value: function insertNodeAfter(scopeNode, scopeStatements, targetStatement) { - var indexInScopeStatement = NodeAppender.getScopeNodeStatements(scopeNode).indexOf(targetStatement); - NodeAppender.insertNodeAtIndex(scopeNode, scopeStatements, indexInScopeStatement + 1); - } - }, { - key: "insertNodeAtIndex", - value: function insertNodeAtIndex(scopeNode, scopeStatements, index) { - scopeStatements = NodeAppender.parentizeScopeStatementsBeforeAppend(scopeNode, scopeStatements); - NodeAppender.setScopeNodeStatements(scopeNode, _toConsumableArray(NodeAppender.getScopeNodeStatements(scopeNode).slice(0, index)).concat(_toConsumableArray(scopeStatements), _toConsumableArray(NodeAppender.getScopeNodeStatements(scopeNode).slice(index)))); - } - }, { - key: "prependNode", - value: function prependNode(scopeNode, scopeStatements) { - scopeStatements = NodeAppender.parentizeScopeStatementsBeforeAppend(scopeNode, scopeStatements); - NodeAppender.setScopeNodeStatements(scopeNode, _toConsumableArray(scopeStatements).concat(_toConsumableArray(NodeAppender.getScopeNodeStatements(scopeNode)))); - } - }, { - key: "getScopeNodeStatements", - value: function getScopeNodeStatements(scopeNode) { - if (NodeGuards_1.NodeGuards.isSwitchCaseNode(scopeNode)) { - return scopeNode.consequent; - } - - return scopeNode.body; - } - }, { - key: "parentizeScopeStatementsBeforeAppend", - value: function parentizeScopeStatementsBeforeAppend(scopeNode, scopeStatements) { - scopeStatements.forEach(function (statement) { - statement.parentNode = scopeNode; - }); - return scopeStatements; - } - }, { - key: "setScopeNodeStatements", - value: function setScopeNodeStatements(scopeNode, statements) { - if (NodeGuards_1.NodeGuards.isSwitchCaseNode(scopeNode)) { - scopeNode.consequent = statements; - return; - } - - scopeNode.body = statements; - } - }]); - - return NodeAppender; -}(); - -exports.NodeAppender = NodeAppender; - -/***/ }), -/* 24 */ -/***/ (function(module, exports) { - -module.exports = require("@babel/runtime/helpers/toConsumableArray"); - -/***/ }), -/* 25 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var ObfuscationEvent; - -(function (ObfuscationEvent) { - ObfuscationEvent["AfterObfuscation"] = "afterObfuscation"; - ObfuscationEvent["BeforeObfuscation"] = "beforeObfuscation"; -})(ObfuscationEvent = exports.ObfuscationEvent || (exports.ObfuscationEvent = {})); - -/***/ }), -/* 26 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var IdentifierObfuscatingReplacer; - -(function (IdentifierObfuscatingReplacer) { - IdentifierObfuscatingReplacer["BaseIdentifierObfuscatingReplacer"] = "BaseIdentifierObfuscatingReplacer"; -})(IdentifierObfuscatingReplacer = exports.IdentifierObfuscatingReplacer || (exports.IdentifierObfuscatingReplacer = {})); - -/***/ }), -/* 27 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -__webpack_require__(69); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var InversifyContainerFacade_1 = __webpack_require__(22); - -var JavaScriptObfuscatorCLI_1 = __webpack_require__(47); - -var JavaScriptObfuscatorFacade = -/*#__PURE__*/ -function () { - function JavaScriptObfuscatorFacade() { - _classCallCheck(this, JavaScriptObfuscatorFacade); - } - - _createClass(JavaScriptObfuscatorFacade, null, [{ - key: "obfuscate", - value: function obfuscate(sourceCode) { - var inputOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var inversifyContainerFacade = new InversifyContainerFacade_1.InversifyContainerFacade(); - inversifyContainerFacade.load(sourceCode, inputOptions); - var javaScriptObfuscator = inversifyContainerFacade.get(ServiceIdentifiers_1.ServiceIdentifiers.IJavaScriptObfuscator); - var obfuscationResult = javaScriptObfuscator.obfuscate(sourceCode); - inversifyContainerFacade.unload(); - return obfuscationResult; - } - }, { - key: "runCLI", - value: function runCLI(argv) { - var javaScriptObfuscatorCLI = new JavaScriptObfuscatorCLI_1.JavaScriptObfuscatorCLI(argv); - javaScriptObfuscatorCLI.initialize(); - javaScriptObfuscatorCLI.run(); - } - }]); - - return JavaScriptObfuscatorFacade; -}(); - -exports.JavaScriptObfuscator = JavaScriptObfuscatorFacade; - -/***/ }), -/* 28 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var NodeTransformer; - -(function (NodeTransformer) { - NodeTransformer["BlockStatementControlFlowTransformer"] = "BlockStatementControlFlowTransformer"; - NodeTransformer["ClassDeclarationTransformer"] = "ClassDeclarationTransformer"; - NodeTransformer["CommentsTransformer"] = "CommentsTransformer"; - NodeTransformer["CustomNodesTransformer"] = "CustomNodesTransformer"; - NodeTransformer["DeadCodeInjectionTransformer"] = "DeadCodeInjectionTransformer"; - NodeTransformer["EvalCallExpressionTransformer"] = "EvalCallExpressionTransformer"; - NodeTransformer["FunctionControlFlowTransformer"] = "FunctionControlFlowTransformer"; - NodeTransformer["CatchClauseTransformer"] = "CatchClauseTransformer"; - NodeTransformer["FunctionDeclarationTransformer"] = "FunctionDeclarationTransformer"; - NodeTransformer["FunctionTransformer"] = "FunctionTransformer"; - NodeTransformer["LabeledStatementTransformer"] = "LabeledStatementTransformer"; - NodeTransformer["LiteralTransformer"] = "LiteralTransformer"; - NodeTransformer["MemberExpressionTransformer"] = "MemberExpressionTransformer"; - NodeTransformer["MethodDefinitionTransformer"] = "MethodDefinitionTransformer"; - NodeTransformer["ObfuscatingGuardsTransformer"] = "ObfuscatingGuardsTransformer"; - NodeTransformer["ObjectExpressionKeysTransformer"] = "ObjectExpressionKeysTransformer"; - NodeTransformer["ObjectExpressionTransformer"] = "ObjectExpressionTransformer"; - NodeTransformer["ParentificationTransformer"] = "ParentificationTransformer"; - NodeTransformer["TemplateLiteralTransformer"] = "TemplateLiteralTransformer"; - NodeTransformer["VariableDeclarationTransformer"] = "VariableDeclarationTransformer"; -})(NodeTransformer = exports.NodeTransformer || (exports.NodeTransformer = {})); - -/***/ }), -/* 29 */ -/***/ (function(module, exports) { - -module.exports = require("@babel/runtime/core-js/set"); - -/***/ }), -/* 30 */ -/***/ (function(module, exports) { - -module.exports = require("@babel/runtime/helpers/slicedToArray"); - -/***/ }), -/* 31 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var CustomNode; - -(function (CustomNode) { - CustomNode["ConsoleOutputDisableExpressionNode"] = "ConsoleOutputDisableExpressionNode"; - CustomNode["DebugProtectionFunctionCallNode"] = "DebugProtectionFunctionCallNode"; - CustomNode["DebugProtectionFunctionIntervalNode"] = "DebugProtectionFunctionIntervalNode"; - CustomNode["DebugProtectionFunctionNode"] = "DebugProtectionFunctionNode"; - CustomNode["DomainLockNode"] = "DomainLockNode"; - CustomNode["NodeCallsControllerFunctionNode"] = "NodeCallsControllerFunctionNode"; - CustomNode["SelfDefendingUnicodeNode"] = "SelfDefendingUnicodeNode"; - CustomNode["StringArrayCallsWrapper"] = "StringArrayCallsWrapper"; - CustomNode["StringArrayNode"] = "StringArrayNode"; - CustomNode["StringArrayRotateFunctionNode"] = "StringArrayRotateFunctionNode"; -})(CustomNode = exports.CustomNode || (exports.CustomNode = {})); - -/***/ }), -/* 32 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Array$from = __webpack_require__(56); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var JSFuck_1 = __webpack_require__(138); - -var Utils = -/*#__PURE__*/ -function () { - function Utils() { - _classCallCheck(this, Utils); - } - - _createClass(Utils, null, [{ - key: "decToHex", - value: function decToHex(dec) { - var radix = 16; - return dec.toString(radix); - } - }, { - key: "extractDomainFromUrl", - value: function extractDomainFromUrl(url) { - var domain; - - if (url.indexOf('://') > -1 || url.indexOf('//') === 0) { - domain = url.split('/')[2]; - } else { - domain = url.split('/')[0]; - } - - domain = domain.split(':')[0]; - return domain; - } - }, { - key: "isCeilNumber", - value: function isCeilNumber(number) { - return number % 1 === 0; - } - }, { - key: "stringRotate", - value: function stringRotate(string, times) { - if (!string) { - throw new ReferenceError("Cannot rotate empty string."); - } - - for (var i = 0; i < times; i++) { - string = string[string.length - 1] + string.substring(0, string.length - 1); - } - - return string; - } - }, { - key: "stringToJSFuck", - value: function stringToJSFuck(string) { - return _Array$from(string).map(function (character) { - return JSFuck_1.JSFuck[character] || character; - }).join(' + '); - } - }]); - - return Utils; -}(); - -Utils.hexadecimalPrefix = '0x'; -exports.Utils = Utils; - -/***/ }), -/* 33 */ -/***/ (function(module, exports) { - -module.exports = require("@babel/runtime/core-js/get-iterator"); - -/***/ }), -/* 34 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var AbstractCustomNodeGroup = -/*#__PURE__*/ -function () { - function AbstractCustomNodeGroup(identifierNamesGeneratorFactory, randomGenerator, options) { - _classCallCheck(this, AbstractCustomNodeGroup); - - this.identifierNamesGenerator = identifierNamesGeneratorFactory(options); - this.randomGenerator = randomGenerator; - this.options = options; - } - - _createClass(AbstractCustomNodeGroup, [{ - key: "getAppendEvent", - value: function getAppendEvent() { - return this.appendEvent; - } - }, { - key: "getCustomNodes", - value: function getCustomNodes() { - return this.customNodes; - } - }, { - key: "appendCustomNodeIfExist", - value: function appendCustomNodeIfExist(customNodeName, callback) { - var customNode = this.customNodes.get(customNodeName); - - if (!customNode) { - return; - } - - callback(customNode); - } - }, { - key: "getRandomStackTraceIndex", - value: function getRandomStackTraceIndex(stackTraceLength) { - return this.randomGenerator.getRandomInteger(0, Math.max(0, Math.round(stackTraceLength - 1))); - } - }]); - - return AbstractCustomNodeGroup; -}(); - -AbstractCustomNodeGroup = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], AbstractCustomNodeGroup); -exports.AbstractCustomNodeGroup = AbstractCustomNodeGroup; - -/***/ }), -/* 35 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var IdentifierNamesGenerator; - -(function (IdentifierNamesGenerator) { - IdentifierNamesGenerator["HexadecimalIdentifierNamesGenerator"] = "hexadecimal"; - IdentifierNamesGenerator["MangledIdentifierNamesGenerator"] = "mangled"; -})(IdentifierNamesGenerator = exports.IdentifierNamesGenerator || (exports.IdentifierNamesGenerator = {})); - -/***/ }), -/* 36 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var SourceMapMode; - -(function (SourceMapMode) { - SourceMapMode["Inline"] = "inline"; - SourceMapMode["Separate"] = "separate"; -})(SourceMapMode = exports.SourceMapMode || (exports.SourceMapMode = {})); - -/***/ }), -/* 37 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var StringArrayEncoding; - -(function (StringArrayEncoding) { - StringArrayEncoding["Base64"] = "base64"; - StringArrayEncoding["Rc4"] = "rc4"; -})(StringArrayEncoding = exports.StringArrayEncoding || (exports.StringArrayEncoding = {})); - -/***/ }), -/* 38 */ -/***/ (function(module, exports) { - -module.exports = require("@babel/runtime/core-js/object/keys"); - -/***/ }), -/* 39 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$freeze = __webpack_require__(57); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var IdentifierNamesGenerator_1 = __webpack_require__(35); - -var ObfuscationTarget_1 = __webpack_require__(21); - -var SourceMapMode_1 = __webpack_require__(36); - -exports.NO_ADDITIONAL_NODES_PRESET = _Object$freeze({ - compact: true, - controlFlowFlattening: false, - controlFlowFlatteningThreshold: 0, - deadCodeInjection: false, - deadCodeInjectionThreshold: 0, - debugProtection: false, - debugProtectionInterval: false, - disableConsoleOutput: false, - domainLock: [], - exclude: [], - identifierNamesGenerator: IdentifierNamesGenerator_1.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator, - identifiersPrefix: '', - log: false, - renameGlobals: false, - reservedNames: [], - rotateStringArray: false, - seed: 0, - selfDefending: false, - sourceMap: false, - sourceMapBaseUrl: '', - sourceMapFileName: '', - sourceMapMode: SourceMapMode_1.SourceMapMode.Separate, - stringArray: false, - stringArrayEncoding: false, - stringArrayThreshold: 0, - target: ObfuscationTarget_1.ObfuscationTarget.Browser, - transformObjectKeys: false, - unicodeEscapeSequence: false -}); - -/***/ }), -/* 40 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _classCallCheck = __webpack_require__(0); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var AbstractObfuscatingReplacer = function AbstractObfuscatingReplacer(options) { - _classCallCheck(this, AbstractObfuscatingReplacer); - - this.options = options; -}; - -AbstractObfuscatingReplacer = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object])], AbstractObfuscatingReplacer); -exports.AbstractObfuscatingReplacer = AbstractObfuscatingReplacer; - -/***/ }), -/* 41 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _classCallCheck = __webpack_require__(0); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var AbstractCalleeDataExtractor = function AbstractCalleeDataExtractor() { - _classCallCheck(this, AbstractCalleeDataExtractor); -}; - -AbstractCalleeDataExtractor = tslib_1.__decorate([inversify_1.injectable()], AbstractCalleeDataExtractor); -exports.AbstractCalleeDataExtractor = AbstractCalleeDataExtractor; - -/***/ }), -/* 42 */ -/***/ (function(module, exports) { - -module.exports = require("escodegen-wallaby"); - -/***/ }), -/* 43 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Map = __webpack_require__(16); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var AbstractControlFlowReplacer = AbstractControlFlowReplacer_1 = -/*#__PURE__*/ -function () { - function AbstractControlFlowReplacer(controlFlowCustomNodeFactory, randomGenerator, options) { - _classCallCheck(this, AbstractControlFlowReplacer); - - this.replacerDataByControlFlowStorageId = new _Map(); - this.controlFlowCustomNodeFactory = controlFlowCustomNodeFactory; - this.randomGenerator = randomGenerator; - this.options = options; - } - - _createClass(AbstractControlFlowReplacer, [{ - key: "insertCustomNodeToControlFlowStorage", - value: function insertCustomNodeToControlFlowStorage(customNode, controlFlowStorage, replacerId, usingExistingIdentifierChance) { - var _this = this; - - var controlFlowStorageId = controlFlowStorage.getStorageId(); - var storageKeysById = AbstractControlFlowReplacer_1.getStorageKeysByIdForCurrentStorage(this.replacerDataByControlFlowStorageId, controlFlowStorageId); - var storageKeysForCurrentId = storageKeysById.get(replacerId); - - if (this.randomGenerator.getMathRandom() < usingExistingIdentifierChance && storageKeysForCurrentId && storageKeysForCurrentId.length) { - return this.randomGenerator.getRandomGenerator().pickone(storageKeysForCurrentId); - } - - var generateStorageKey = function generateStorageKey(length) { - var key = _this.randomGenerator.getRandomString(length); - - if (controlFlowStorage.getStorage().has(key)) { - return generateStorageKey(length); - } - - return key; - }; - - var storageKey = generateStorageKey(5); - storageKeysById.set(replacerId, [storageKey]); - this.replacerDataByControlFlowStorageId.set(controlFlowStorageId, storageKeysById); - controlFlowStorage.set(storageKey, customNode); - return storageKey; - } - }], [{ - key: "getStorageKeysByIdForCurrentStorage", - value: function getStorageKeysByIdForCurrentStorage(identifierDataByControlFlowStorageId, controlFlowStorageId) { - var storageKeysById; - - if (identifierDataByControlFlowStorageId.has(controlFlowStorageId)) { - storageKeysById = identifierDataByControlFlowStorageId.get(controlFlowStorageId); - } else { - storageKeysById = new _Map(); - } - - return storageKeysById; - } - }]); - - return AbstractControlFlowReplacer; -}(); - -AbstractControlFlowReplacer = AbstractControlFlowReplacer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], AbstractControlFlowReplacer); -exports.AbstractControlFlowReplacer = AbstractControlFlowReplacer; -var AbstractControlFlowReplacer_1; - -/***/ }), -/* 44 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -function GlobalVariableNoEvalTemplate() { - return "\n var that = (typeof window !== 'undefined'\n ? window\n : (typeof process === 'object' &&\n typeof require === 'function' &&\n typeof global === 'object')\n ? global\n : this);\n "; -} - -exports.GlobalVariableNoEvalTemplate = GlobalVariableNoEvalTemplate; - -/***/ }), -/* 45 */ -/***/ (function(module, exports) { - -module.exports = require("@babel/runtime/helpers/get"); - -/***/ }), -/* 46 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$freeze = __webpack_require__(57); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var IdentifierNamesGenerator_1 = __webpack_require__(35); - -var ObfuscationTarget_1 = __webpack_require__(21); - -var SourceMapMode_1 = __webpack_require__(36); - -exports.DEFAULT_PRESET = _Object$freeze({ - compact: true, - config: '', - controlFlowFlattening: false, - controlFlowFlatteningThreshold: 0.75, - deadCodeInjection: false, - deadCodeInjectionThreshold: 0.4, - debugProtection: false, - debugProtectionInterval: false, - disableConsoleOutput: false, - domainLock: [], - exclude: [], - identifierNamesGenerator: IdentifierNamesGenerator_1.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator, - identifiersPrefix: '', - log: false, - renameGlobals: false, - reservedNames: [], - rotateStringArray: true, - seed: 0, - selfDefending: false, - sourceMap: false, - sourceMapBaseUrl: '', - sourceMapFileName: '', - sourceMapMode: SourceMapMode_1.SourceMapMode.Separate, - stringArray: true, - stringArrayEncoding: false, - stringArrayThreshold: 0.75, - target: ObfuscationTarget_1.ObfuscationTarget.Browser, - transformObjectKeys: false, - unicodeEscapeSequence: false -}); - -/***/ }), -/* 47 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$assign = __webpack_require__(11); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var commander = tslib_1.__importStar(__webpack_require__(204)); - -var packageJson = tslib_1.__importStar(__webpack_require__(63)); - -var path = tslib_1.__importStar(__webpack_require__(48)); - -var Initializable_1 = __webpack_require__(10); - -var Default_1 = __webpack_require__(46); - -var ArraySanitizer_1 = __webpack_require__(205); - -var BooleanSanitizer_1 = __webpack_require__(206); - -var IdentifierNamesGeneratorSanitizer_1 = __webpack_require__(207); - -var ObfuscatingTargetSanitizer_1 = __webpack_require__(208); - -var SourceMapModeSanitizer_1 = __webpack_require__(209); - -var StringArrayEncodingSanitizer_1 = __webpack_require__(210); - -var CLIUtils_1 = __webpack_require__(211); - -var JavaScriptObfuscatorFacade_1 = __webpack_require__(27); - -var SourceCodeReader_1 = __webpack_require__(214); - -var JavaScriptObfuscatorCLI = -/*#__PURE__*/ -function () { - function JavaScriptObfuscatorCLI(argv) { - _classCallCheck(this, JavaScriptObfuscatorCLI); - - this.rawArguments = argv; - this.arguments = argv.slice(2); - } - - _createClass(JavaScriptObfuscatorCLI, [{ - key: "initialize", - value: function initialize() { - this.inputPath = path.normalize(this.arguments[0] || ''); - this.commands = new commander.Command(); - this.configureCommands(); - this.configureHelp(); - this.inputCLIOptions = this.commands.opts(); - } - }, { - key: "run", - value: function run() { - var canShowHelp = !this.arguments.length || this.arguments.includes('--help'); - - if (canShowHelp) { - return this.commands.outputHelp(); - } - - var sourceCodeData = new SourceCodeReader_1.SourceCodeReader(this.inputCLIOptions).readSourceCode(this.inputPath); - this.processSourceCodeData(sourceCodeData); - } - }, { - key: "buildOptions", - value: function buildOptions() { - var inputCLIOptions = JavaScriptObfuscatorCLI.filterOptions(this.inputCLIOptions); - var configFilePath = this.inputCLIOptions.config; - var configFileLocation = configFilePath ? path.resolve(configFilePath, '.') : ''; - var configFileOptions = configFileLocation ? CLIUtils_1.CLIUtils.getUserConfig(configFileLocation) : {}; - return _Object$assign({}, Default_1.DEFAULT_PRESET, configFileOptions, inputCLIOptions); - } - }, { - key: "configureCommands", - value: function configureCommands() { - this.commands.usage(' [options]').version(packageJson.version, '-v, --version').option('-o, --output ', 'Output path for obfuscated code').option('--compact ', 'Disable one line output code compacting', BooleanSanitizer_1.BooleanSanitizer).option('--config ', 'Name of js / json config file').option('--control-flow-flattening ', 'Enables control flow flattening', BooleanSanitizer_1.BooleanSanitizer).option('--control-flow-flattening-threshold ', 'The probability that the control flow flattening transformation will be applied to the node', parseFloat).option('--dead-code-injection ', 'Enables dead code injection', BooleanSanitizer_1.BooleanSanitizer).option('--dead-code-injection-threshold ', 'The probability that the dead code injection transformation will be applied to the node', parseFloat).option('--debug-protection ', 'Disable browser Debug panel (can cause DevTools enabled browser freeze)', BooleanSanitizer_1.BooleanSanitizer).option('--debug-protection-interval ', 'Disable browser Debug panel even after page was loaded (can cause DevTools enabled browser freeze)', BooleanSanitizer_1.BooleanSanitizer).option('--disable-console-output ', 'Allow console.log, console.info, console.error and console.warn messages output into browser console', BooleanSanitizer_1.BooleanSanitizer).option('--domain-lock (comma separated, without whitespaces)', 'Blocks the execution of the code in domains that do not match the passed RegExp patterns (comma separated)', ArraySanitizer_1.ArraySanitizer).option('--exclude (comma separated, without whitespaces)', 'A filename or glob which indicates files to exclude from obfuscation', ArraySanitizer_1.ArraySanitizer).option('--identifier-names-generator [hexadecimal, mangled]', 'Sets identifier names generator (Default: hexadecimal)', IdentifierNamesGeneratorSanitizer_1.IdentifierNamesGeneratorSanitizer).option('--identifiers-prefix ', 'Sets prefix for all global identifiers.').option('--log ', 'Enables logging of the information to the console', BooleanSanitizer_1.BooleanSanitizer).option('--reserved-names (comma separated, without whitespaces)', 'Disable obfuscation of variable names, function names and names of function parameters that match the passed RegExp patterns (comma separated)', ArraySanitizer_1.ArraySanitizer).option('--rename-globals ', 'Allows to enable obfuscation of global variable and function names with declaration.', BooleanSanitizer_1.BooleanSanitizer).option('--rotate-string-array ', 'Disable rotation of unicode array values during obfuscation', BooleanSanitizer_1.BooleanSanitizer).option('--seed ', 'Sets seed for random generator. This is useful for creating repeatable results.', parseFloat).option('--self-defending ', 'Disables self-defending for obfuscated code', BooleanSanitizer_1.BooleanSanitizer).option('--source-map ', 'Enables source map generation', BooleanSanitizer_1.BooleanSanitizer).option('--source-map-base-url ', 'Sets base url to the source map import url when `--source-map-mode=separate`').option('--source-map-file-name ', 'Sets file name for output source map when `--source-map-mode=separate`').option('--source-map-mode [inline, separate]', 'Specify source map output mode', SourceMapModeSanitizer_1.SourceMapModeSanitizer).option('--string-array ', 'Disables gathering of all literal strings into an array and replacing every literal string with an array call', BooleanSanitizer_1.BooleanSanitizer).option('--string-array-encoding [true, false, base64, rc4]', 'Encodes all strings in strings array using base64 or rc4 (this option can slow down your code speed', StringArrayEncodingSanitizer_1.StringArrayEncodingSanitizer).option('--string-array-threshold ', 'The probability that the literal string will be inserted into stringArray (Default: 0.8, Min: 0, Max: 1)', parseFloat).option('--target ', 'Allows to set target environment for obfuscated code.', ObfuscatingTargetSanitizer_1.ObfuscationTargetSanitizer).option('--transform-object-keys ', 'Enables transformation of object keys', BooleanSanitizer_1.BooleanSanitizer).option('--unicode-escape-sequence ', 'Allows to enable/disable string conversion to unicode escape sequence', BooleanSanitizer_1.BooleanSanitizer).parse(this.rawArguments); - } - }, { - key: "configureHelp", - value: function configureHelp() { - this.commands.on('--help', function () { - console.log(' Examples:\n'); - console.log(' %> javascript-obfuscator input_file_name.js --compact true --self-defending false'); - console.log(' %> javascript-obfuscator input_file_name.js --output output_file_name.js --compact true --self-defending false'); - console.log(' %> javascript-obfuscator input_directory_name --compact true --self-defending false'); - console.log(''); - }); - } - }, { - key: "processSourceCodeData", - value: function processSourceCodeData(sourceCodeData) { - var _this = this; - - var outputPath = this.inputCLIOptions.output ? path.normalize(this.inputCLIOptions.output) : ''; - - if (!Array.isArray(sourceCodeData)) { - var outputCodePath = outputPath || CLIUtils_1.CLIUtils.getOutputCodePath(this.inputPath); - this.processSourceCode(sourceCodeData, outputCodePath, null); - } else { - sourceCodeData.forEach(function (_ref, index) { - var filePath = _ref.filePath, - content = _ref.content; - var outputCodePath = outputPath ? path.join(outputPath, filePath) : CLIUtils_1.CLIUtils.getOutputCodePath(filePath); - - _this.processSourceCode(content, outputCodePath, index); - }); - } - } - }, { - key: "processSourceCode", - value: function processSourceCode(sourceCode, outputCodePath, sourceCodeIndex) { - var options = this.buildOptions(); - - if (sourceCodeIndex !== null) { - var baseIdentifiersPrefix = this.inputCLIOptions.identifiersPrefix || JavaScriptObfuscatorCLI.baseIdentifiersPrefix; - var identifiersPrefix = "".concat(baseIdentifiersPrefix).concat(sourceCodeIndex); - options = _Object$assign({}, options, { - identifiersPrefix: identifiersPrefix - }); - } - - if (options.sourceMap) { - JavaScriptObfuscatorCLI.processSourceCodeWithSourceMap(sourceCode, outputCodePath, options); - } else { - JavaScriptObfuscatorCLI.processSourceCodeWithoutSourceMap(sourceCode, outputCodePath, options); - } - } - }], [{ - key: "filterOptions", - value: function filterOptions(options) { - var filteredOptions = {}; - - for (var option in options) { - if (!options.hasOwnProperty(option) || options[option] === undefined) { - continue; - } - - filteredOptions[option] = options[option]; - } - - return filteredOptions; - } - }, { - key: "processSourceCodeWithoutSourceMap", - value: function processSourceCodeWithoutSourceMap(sourceCode, outputCodePath, options) { - var obfuscatedCode = JavaScriptObfuscatorFacade_1.JavaScriptObfuscator.obfuscate(sourceCode, options).getObfuscatedCode(); - CLIUtils_1.CLIUtils.writeFile(outputCodePath, obfuscatedCode); - } - }, { - key: "processSourceCodeWithSourceMap", - value: function processSourceCodeWithSourceMap(sourceCode, outputCodePath, options) { - var outputSourceMapPath = CLIUtils_1.CLIUtils.getOutputSourceMapPath(outputCodePath, options.sourceMapFileName || ''); - options = _Object$assign({}, options, { - sourceMapFileName: path.basename(outputSourceMapPath) - }); - var obfuscationResult = JavaScriptObfuscatorFacade_1.JavaScriptObfuscator.obfuscate(sourceCode, options); - CLIUtils_1.CLIUtils.writeFile(outputCodePath, obfuscationResult.getObfuscatedCode()); - - if (options.sourceMapMode === 'separate' && obfuscationResult.getSourceMap()) { - CLIUtils_1.CLIUtils.writeFile(outputSourceMapPath, obfuscationResult.getSourceMap()); - } - } - }]); - - return JavaScriptObfuscatorCLI; -}(); - -JavaScriptObfuscatorCLI.encoding = 'utf8'; -JavaScriptObfuscatorCLI.obfuscatedFilePrefix = '-obfuscated'; -JavaScriptObfuscatorCLI.baseIdentifiersPrefix = 'a'; - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Object)], JavaScriptObfuscatorCLI.prototype, "commands", void 0); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Object)], JavaScriptObfuscatorCLI.prototype, "inputCLIOptions", void 0); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], JavaScriptObfuscatorCLI.prototype, "inputPath", void 0); - -exports.JavaScriptObfuscatorCLI = JavaScriptObfuscatorCLI; - -/***/ }), -/* 48 */ -/***/ (function(module, exports) { - -module.exports = require("path"); - -/***/ }), -/* 49 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var CalleeDataExtractor; - -(function (CalleeDataExtractor) { - CalleeDataExtractor["FunctionDeclarationCalleeDataExtractor"] = "FunctionDeclarationCalleeDataExtractor"; - CalleeDataExtractor["FunctionExpressionCalleeDataExtractor"] = "FunctionExpressionCalleeDataExtractor"; - CalleeDataExtractor["ObjectExpressionCalleeDataExtractor"] = "ObjectExpressionCalleeDataExtractor"; -})(CalleeDataExtractor = exports.CalleeDataExtractor || (exports.CalleeDataExtractor = {})); - -/***/ }), -/* 50 */ -/***/ (function(module, exports) { - -module.exports = require("@babel/runtime/helpers/typeof"); - -/***/ }), -/* 51 */ -/***/ (function(module, exports) { - -module.exports = require("esprima"); - -/***/ }), -/* 52 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var ControlFlowReplacer; - -(function (ControlFlowReplacer) { - ControlFlowReplacer["BinaryExpressionControlFlowReplacer"] = "BinaryExpressionControlFlowReplacer"; - ControlFlowReplacer["CallExpressionControlFlowReplacer"] = "CallExpressionControlFlowReplacer"; - ControlFlowReplacer["LogicalExpressionControlFlowReplacer"] = "LogicalExpressionControlFlowReplacer"; - ControlFlowReplacer["StringLiteralControlFlowReplacer"] = "StringLiteralControlFlowReplacer"; -})(ControlFlowReplacer = exports.ControlFlowReplacer || (exports.ControlFlowReplacer = {})); - -/***/ }), -/* 53 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var ControlFlowCustomNode_1 = __webpack_require__(20); - -var AbstractControlFlowReplacer_1 = __webpack_require__(43); - -var NodeGuards_1 = __webpack_require__(8); - -var ExpressionWithOperatorControlFlowReplacer = -/*#__PURE__*/ -function (_AbstractControlFlowR) { - _inherits(ExpressionWithOperatorControlFlowReplacer, _AbstractControlFlowR); - - function ExpressionWithOperatorControlFlowReplacer(controlFlowCustomNodeFactory, randomGenerator, options) { - _classCallCheck(this, ExpressionWithOperatorControlFlowReplacer); - - return _possibleConstructorReturn(this, (ExpressionWithOperatorControlFlowReplacer.__proto__ || _Object$getPrototypeOf(ExpressionWithOperatorControlFlowReplacer)).call(this, controlFlowCustomNodeFactory, randomGenerator, options)); - } - - _createClass(ExpressionWithOperatorControlFlowReplacer, [{ - key: "getControlFlowStorageCallNode", - value: function getControlFlowStorageCallNode(controlFlowStorageId, storageKey, leftExpression, rightExpression) { - var controlFlowStorageCallCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode); - controlFlowStorageCallCustomNode.initialize(controlFlowStorageId, storageKey, leftExpression, rightExpression); - var statementNode = controlFlowStorageCallCustomNode.getNode()[0]; - - if (!statementNode || !NodeGuards_1.NodeGuards.isExpressionStatementNode(statementNode)) { - throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node"); - } - - return statementNode.expression; - } - }]); - - return ExpressionWithOperatorControlFlowReplacer; -}(AbstractControlFlowReplacer_1.AbstractControlFlowReplacer); - -ExpressionWithOperatorControlFlowReplacer = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], ExpressionWithOperatorControlFlowReplacer); -exports.ExpressionWithOperatorControlFlowReplacer = ExpressionWithOperatorControlFlowReplacer; - -/***/ }), -/* 54 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var DeadCodeInjectionCustomNode; - -(function (DeadCodeInjectionCustomNode) { - DeadCodeInjectionCustomNode["BlockStatementDeadCodeInjectionNode"] = "BlockStatementDeadCodeInjectionNode"; -})(DeadCodeInjectionCustomNode = exports.DeadCodeInjectionCustomNode || (exports.DeadCodeInjectionCustomNode = {})); - -/***/ }), -/* 55 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var CustomNodeGroup; - -(function (CustomNodeGroup) { - CustomNodeGroup["ConsoleOutputCustomNodeGroup"] = "ConsoleOutputCustomNodeGroup"; - CustomNodeGroup["DebugProtectionCustomNodeGroup"] = "DebugProtectionCustomNodeGroup"; - CustomNodeGroup["DomainLockCustomNodeGroup"] = "DomainLockCustomNodeGroup"; - CustomNodeGroup["SelfDefendingCustomNodeGroup"] = "SelfDefendingCustomNodeGroup"; - CustomNodeGroup["StringArrayCustomNodeGroup"] = "StringArrayCustomNodeGroup"; -})(CustomNodeGroup = exports.CustomNodeGroup || (exports.CustomNodeGroup = {})); - -/***/ }), -/* 56 */ -/***/ (function(module, exports) { - -module.exports = require("@babel/runtime/core-js/array/from"); - -/***/ }), -/* 57 */ -/***/ (function(module, exports) { - -module.exports = require("@babel/runtime/core-js/object/freeze"); - -/***/ }), -/* 58 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _classCallCheck = __webpack_require__(0); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var AbstractIdentifierNamesGenerator = function AbstractIdentifierNamesGenerator(randomGenerator, options) { - _classCallCheck(this, AbstractIdentifierNamesGenerator); - - this.randomGenerator = randomGenerator; - this.options = options; -}; - -AbstractIdentifierNamesGenerator = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object])], AbstractIdentifierNamesGenerator); -exports.AbstractIdentifierNamesGenerator = AbstractIdentifierNamesGenerator; - -/***/ }), -/* 59 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var LiteralObfuscatingReplacer; - -(function (LiteralObfuscatingReplacer) { - LiteralObfuscatingReplacer["BooleanLiteralObfuscatingReplacer"] = "BooleanLiteralObfuscatingReplacer"; - LiteralObfuscatingReplacer["NumberLiteralObfuscatingReplacer"] = "NumberLiteralObfuscatingReplacer"; - LiteralObfuscatingReplacer["StringLiteralObfuscatingReplacer"] = "StringLiteralObfuscatingReplacer"; -})(LiteralObfuscatingReplacer = exports.LiteralObfuscatingReplacer || (exports.LiteralObfuscatingReplacer = {})); - -/***/ }), -/* 60 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var ObfuscatingGuard; - -(function (ObfuscatingGuard) { - ObfuscatingGuard["BlackListNodeGuard"] = "BlackListNodeGuard"; - ObfuscatingGuard["ConditionalCommentNodeGuard"] = "ConditionalCommentNodeGuard"; -})(ObfuscatingGuard = exports.ObfuscatingGuard || (exports.ObfuscatingGuard = {})); - -/***/ }), -/* 61 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _toConsumableArray = __webpack_require__(24); - -var _getIterator = __webpack_require__(33); - -var _slicedToArray = __webpack_require__(30); - -var _Map = __webpack_require__(16); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var Initializable_1 = __webpack_require__(10); - -var MapStorage = -/*#__PURE__*/ -function () { - function MapStorage(randomGenerator, options) { - _classCallCheck(this, MapStorage); - - this.randomGenerator = randomGenerator; - this.options = options; - } - - _createClass(MapStorage, [{ - key: "initialize", - value: function initialize() { - this.storage = new _Map(); - this.storageId = this.randomGenerator.getRandomString(6); - } - }, { - key: "get", - value: function get(key) { - var value = this.storage.get(key); - - if (!value) { - throw new Error("No value found in map storage with key `".concat(key, "`")); - } - - return value; - } - }, { - key: "getKeyOf", - value: function getKeyOf(value) { - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = _getIterator(this.storage), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var _ref3 = _step.value; - - var _ref2 = _slicedToArray(_ref3, 2); - - var _key = _ref2[0]; - var _storageValue = _ref2[1]; - - if (value === _storageValue) { - return _key; - } - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - - return null; - } - }, { - key: "getLength", - value: function getLength() { - return this.storage.size; - } - }, { - key: "getStorage", - value: function getStorage() { - return this.storage; - } - }, { - key: "getStorageId", - value: function getStorageId() { - return this.storageId; - } - }, { - key: "mergeWith", - value: function mergeWith(storage) { - var mergeId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - this.storage = new _Map(_toConsumableArray(this.storage).concat(_toConsumableArray(storage.getStorage()))); - - if (mergeId) { - this.storageId = storage.getStorageId(); - } - } - }, { - key: "set", - value: function set(key, value) { - this.storage.set(key, value); - } - }]); - - return MapStorage; -}(); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], MapStorage.prototype, "storageId", void 0); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", _Map)], MapStorage.prototype, "storage", void 0); - -tslib_1.__decorate([inversify_1.postConstruct(), tslib_1.__metadata("design:type", Function), tslib_1.__metadata("design:paramtypes", []), tslib_1.__metadata("design:returntype", void 0)], MapStorage.prototype, "initialize", null); - -MapStorage = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object])], MapStorage); -exports.MapStorage = MapStorage; - -/***/ }), -/* 62 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var md5_1 = tslib_1.__importDefault(__webpack_require__(191)); - -var chance_1 = __webpack_require__(192); - -var Initializable_1 = __webpack_require__(10); - -var RandomGenerator = RandomGenerator_1 = -/*#__PURE__*/ -function () { - function RandomGenerator(sourceCode, options) { - _classCallCheck(this, RandomGenerator); - - this.sourceCode = sourceCode; - this.options = options; - } - - _createClass(RandomGenerator, [{ - key: "initialize", - value: function initialize() { - var _this = this; - - var getRandomInteger = function getRandomInteger(min, max) { - return Math.floor(Math.random() * (max - min + 1) + min); - }; - - var getSeed = function getSeed() { - var md5Hash = md5_1.default(_this.sourceCode.getSourceCode()); - return _this.seed + Number(md5Hash.replace(/\D/g, '')); - }; - - this.seed = this.options.seed !== 0 ? this.options.seed : getRandomInteger(0, 999999999); - this.randomGenerator = new chance_1.Chance(getSeed()); - } - }, { - key: "getMathRandom", - value: function getMathRandom() { - return this.getRandomInteger(0, 99999) / 100000; - } - }, { - key: "getRandomFloat", - value: function getRandomFloat(min, max) { - return this.getRandomGenerator().floating({ - min: min, - max: max, - fixed: 7 - }); - } - }, { - key: "getRandomGenerator", - value: function getRandomGenerator() { - return this.randomGenerator; - } - }, { - key: "getRandomInteger", - value: function getRandomInteger(min, max) { - return this.getRandomGenerator().integer({ - min: min, - max: max - }); - } - }, { - key: "getRandomString", - value: function getRandomString(length) { - var pool = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : RandomGenerator_1.randomGeneratorPool; - return this.getRandomGenerator().string({ - length: length, - pool: pool - }); - } - }, { - key: "getSeed", - value: function getSeed() { - return this.seed; - } - }]); - - return RandomGenerator; -}(); - -RandomGenerator.randomGeneratorPool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Object)], RandomGenerator.prototype, "randomGenerator", void 0); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Number)], RandomGenerator.prototype, "seed", void 0); - -tslib_1.__decorate([inversify_1.postConstruct(), tslib_1.__metadata("design:type", Function), tslib_1.__metadata("design:paramtypes", []), tslib_1.__metadata("design:returntype", void 0)], RandomGenerator.prototype, "initialize", null); - -RandomGenerator = RandomGenerator_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ISourceCode)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object])], RandomGenerator); -exports.RandomGenerator = RandomGenerator; -var RandomGenerator_1; - -/***/ }), -/* 63 */ -/***/ (function(module, exports) { - -module.exports = require("pjson"); - -/***/ }), -/* 64 */ -/***/ (function(module, exports) { - -module.exports = require("chalk"); - -/***/ }), -/* 65 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var chalk_1 = tslib_1.__importDefault(__webpack_require__(64)); - -var LoggingPrefix_1 = __webpack_require__(66); - -var Logger = Logger_1 = -/*#__PURE__*/ -function () { - function Logger(options) { - _classCallCheck(this, Logger); - - this.options = options; - } - - _createClass(Logger, [{ - key: "info", - value: function info(loggingMessage, value) { - if (!this.options.log) { - return; - } - - Logger_1.log(Logger_1.colorInfo, LoggingPrefix_1.LoggingPrefix.Base, loggingMessage, value); - } - }, { - key: "success", - value: function success(loggingMessage, value) { - if (!this.options.log) { - return; - } - - Logger_1.log(Logger_1.colorSuccess, LoggingPrefix_1.LoggingPrefix.Base, loggingMessage, value); - } - }, { - key: "warn", - value: function warn(loggingMessage, value) { - if (!this.options.log) { - return; - } - - Logger_1.log(Logger_1.colorWarn, LoggingPrefix_1.LoggingPrefix.Base, loggingMessage, value); - } - }], [{ - key: "log", - value: function log(loggingLevelColor, loggingPrefix, loggingMessage, value) { - var processedMessage = loggingLevelColor("\n".concat(loggingPrefix, " ").concat(loggingMessage)); - !value ? console.log(processedMessage) : console.log(processedMessage, value); - } - }]); - - return Logger; -}(); - -Logger.colorInfo = chalk_1.default.cyan; -Logger.colorSuccess = chalk_1.default.green; -Logger.colorWarn = chalk_1.default.yellow; -Logger = Logger_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object])], Logger); -exports.Logger = Logger; -var Logger_1; - -/***/ }), -/* 66 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var LoggingPrefix; - -(function (LoggingPrefix) { - LoggingPrefix["Base"] = "[javascript-obfuscator]"; - LoggingPrefix["CLI"] = "[javascript-obfuscator-cli]"; -})(LoggingPrefix = exports.LoggingPrefix || (exports.LoggingPrefix = {})); - -/***/ }), -/* 67 */ -/***/ (function(module, exports) { - -module.exports = require("fs"); - -/***/ }), -/* 68 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var JavaScriptObfuscatorFacade_1 = __webpack_require__(27); - -module.exports = JavaScriptObfuscatorFacade_1.JavaScriptObfuscator; - -/***/ }), -/* 69 */ -/***/ (function(module, exports) { - -module.exports = require("reflect-metadata"); - -/***/ }), -/* 70 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var InversifyContainerFacade_1 = __webpack_require__(22); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var CalleeDataExtractor_1 = __webpack_require__(49); - -var FunctionDeclarationCalleeDataExtractor_1 = __webpack_require__(71); - -var FunctionExpressionCalleeDataExtractor_1 = __webpack_require__(72); - -var ObjectExpressionCalleeDataExtractor_1 = __webpack_require__(73); - -var StackTraceAnalyzer_1 = __webpack_require__(74); - -exports.analyzersModule = new inversify_1.ContainerModule(function (bind) { - bind(ServiceIdentifiers_1.ServiceIdentifiers.IStackTraceAnalyzer).to(StackTraceAnalyzer_1.StackTraceAnalyzer).inSingletonScope(); - bind(ServiceIdentifiers_1.ServiceIdentifiers.ICalleeDataExtractor).to(FunctionDeclarationCalleeDataExtractor_1.FunctionDeclarationCalleeDataExtractor).whenTargetNamed(CalleeDataExtractor_1.CalleeDataExtractor.FunctionDeclarationCalleeDataExtractor); - bind(ServiceIdentifiers_1.ServiceIdentifiers.ICalleeDataExtractor).to(FunctionExpressionCalleeDataExtractor_1.FunctionExpressionCalleeDataExtractor).whenTargetNamed(CalleeDataExtractor_1.CalleeDataExtractor.FunctionExpressionCalleeDataExtractor); - bind(ServiceIdentifiers_1.ServiceIdentifiers.ICalleeDataExtractor).to(ObjectExpressionCalleeDataExtractor_1.ObjectExpressionCalleeDataExtractor).whenTargetNamed(CalleeDataExtractor_1.CalleeDataExtractor.ObjectExpressionCalleeDataExtractor); - bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICalleeDataExtractor).toFactory(InversifyContainerFacade_1.InversifyContainerFacade.getCacheFactory(ServiceIdentifiers_1.ServiceIdentifiers.ICalleeDataExtractor)); -}); - -/***/ }), -/* 71 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var estraverse = tslib_1.__importStar(__webpack_require__(17)); - -var AbstractCalleeDataExtractor_1 = __webpack_require__(41); - -var NodeGuards_1 = __webpack_require__(8); - -var NodeUtils_1 = __webpack_require__(9); - -var FunctionDeclarationCalleeDataExtractor = -/*#__PURE__*/ -function (_AbstractCalleeDataEx) { - _inherits(FunctionDeclarationCalleeDataExtractor, _AbstractCalleeDataEx); - - function FunctionDeclarationCalleeDataExtractor() { - _classCallCheck(this, FunctionDeclarationCalleeDataExtractor); - - return _possibleConstructorReturn(this, (FunctionDeclarationCalleeDataExtractor.__proto__ || _Object$getPrototypeOf(FunctionDeclarationCalleeDataExtractor)).apply(this, arguments)); - } - - _createClass(FunctionDeclarationCalleeDataExtractor, [{ - key: "extract", - value: function extract(blockScopeBody, callee) { - if (!NodeGuards_1.NodeGuards.isIdentifierNode(callee)) { - return null; - } - - var calleeBlockStatement = this.getCalleeBlockStatement(NodeUtils_1.NodeUtils.getBlockScopesOfNode(blockScopeBody[0])[0], callee.name); - - if (!calleeBlockStatement) { - return null; - } - - return { - callee: calleeBlockStatement, - name: callee.name - }; - } - }, { - key: "getCalleeBlockStatement", - value: function getCalleeBlockStatement(targetNode, name) { - var calleeBlockStatement = null; - estraverse.traverse(targetNode, { - enter: function enter(node) { - if (NodeGuards_1.NodeGuards.isFunctionDeclarationNode(node) && node.id.name === name) { - calleeBlockStatement = node.body; - return estraverse.VisitorOption.Break; - } - } - }); - return calleeBlockStatement; - } - }]); - - return FunctionDeclarationCalleeDataExtractor; -}(AbstractCalleeDataExtractor_1.AbstractCalleeDataExtractor); - -FunctionDeclarationCalleeDataExtractor = tslib_1.__decorate([inversify_1.injectable()], FunctionDeclarationCalleeDataExtractor); -exports.FunctionDeclarationCalleeDataExtractor = FunctionDeclarationCalleeDataExtractor; - -/***/ }), -/* 72 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var estraverse = tslib_1.__importStar(__webpack_require__(17)); - -var AbstractCalleeDataExtractor_1 = __webpack_require__(41); - -var NodeGuards_1 = __webpack_require__(8); - -var NodeUtils_1 = __webpack_require__(9); - -var FunctionExpressionCalleeDataExtractor = -/*#__PURE__*/ -function (_AbstractCalleeDataEx) { - _inherits(FunctionExpressionCalleeDataExtractor, _AbstractCalleeDataEx); - - function FunctionExpressionCalleeDataExtractor() { - _classCallCheck(this, FunctionExpressionCalleeDataExtractor); - - return _possibleConstructorReturn(this, (FunctionExpressionCalleeDataExtractor.__proto__ || _Object$getPrototypeOf(FunctionExpressionCalleeDataExtractor)).apply(this, arguments)); - } - - _createClass(FunctionExpressionCalleeDataExtractor, [{ - key: "extract", - value: function extract(blockScopeBody, callee) { - var calleeBlockStatement = null; - - if (NodeGuards_1.NodeGuards.isIdentifierNode(callee)) { - calleeBlockStatement = this.getCalleeBlockStatement(NodeUtils_1.NodeUtils.getBlockScopesOfNode(blockScopeBody[0])[0], callee.name); - } - - if (NodeGuards_1.NodeGuards.isFunctionExpressionNode(callee)) { - calleeBlockStatement = callee.body; - } - - if (!calleeBlockStatement) { - return null; - } - - return { - callee: calleeBlockStatement, - name: callee.name || null - }; - } - }, { - key: "getCalleeBlockStatement", - value: function getCalleeBlockStatement(targetNode, name) { - var calleeBlockStatement = null; - estraverse.traverse(targetNode, { - enter: function enter(node, parentNode) { - if (NodeGuards_1.NodeGuards.isFunctionExpressionNode(node) && parentNode && NodeGuards_1.NodeGuards.isVariableDeclaratorNode(parentNode) && NodeGuards_1.NodeGuards.isIdentifierNode(parentNode.id) && parentNode.id.name === name) { - calleeBlockStatement = node.body; - return estraverse.VisitorOption.Break; - } - } - }); - return calleeBlockStatement; - } - }]); - - return FunctionExpressionCalleeDataExtractor; -}(AbstractCalleeDataExtractor_1.AbstractCalleeDataExtractor); - -FunctionExpressionCalleeDataExtractor = tslib_1.__decorate([inversify_1.injectable()], FunctionExpressionCalleeDataExtractor); -exports.FunctionExpressionCalleeDataExtractor = FunctionExpressionCalleeDataExtractor; - -/***/ }), -/* 73 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _getIterator = __webpack_require__(33); - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var estraverse = tslib_1.__importStar(__webpack_require__(17)); - -var AbstractCalleeDataExtractor_1 = __webpack_require__(41); - -var NodeGuards_1 = __webpack_require__(8); - -var NodeUtils_1 = __webpack_require__(9); - -var ObjectExpressionCalleeDataExtractor = -/*#__PURE__*/ -function (_AbstractCalleeDataEx) { - _inherits(ObjectExpressionCalleeDataExtractor, _AbstractCalleeDataEx); - - function ObjectExpressionCalleeDataExtractor() { - _classCallCheck(this, ObjectExpressionCalleeDataExtractor); - - return _possibleConstructorReturn(this, (ObjectExpressionCalleeDataExtractor.__proto__ || _Object$getPrototypeOf(ObjectExpressionCalleeDataExtractor)).apply(this, arguments)); - } - - _createClass(ObjectExpressionCalleeDataExtractor, [{ - key: "extract", - value: function extract(blockScopeBody, callee) { - if (!NodeGuards_1.NodeGuards.isMemberExpressionNode(callee)) { - return null; - } - - var objectMembersCallsChain = this.createObjectMembersCallsChain([], callee); - - if (!objectMembersCallsChain.length) { - return null; - } - - var functionExpressionName = objectMembersCallsChain[objectMembersCallsChain.length - 1]; - var calleeBlockStatement = this.getCalleeBlockStatement(NodeUtils_1.NodeUtils.getBlockScopesOfNode(blockScopeBody[0])[0], objectMembersCallsChain); - - if (!calleeBlockStatement) { - return null; - } - - return { - callee: calleeBlockStatement, - name: functionExpressionName - }; - } - }, { - key: "createObjectMembersCallsChain", - value: function createObjectMembersCallsChain(currentChain, memberExpression) { - if (NodeGuards_1.NodeGuards.isIdentifierNode(memberExpression.property) && memberExpression.computed === false) { - currentChain.unshift(memberExpression.property.name); - } else if (NodeGuards_1.NodeGuards.isLiteralNode(memberExpression.property) && (typeof memberExpression.property.value === 'string' || typeof memberExpression.property.value === 'number')) { - currentChain.unshift(memberExpression.property.value); - } else { - return currentChain; - } - - if (NodeGuards_1.NodeGuards.isMemberExpressionNode(memberExpression.object)) { - return this.createObjectMembersCallsChain(currentChain, memberExpression.object); - } else if (NodeGuards_1.NodeGuards.isIdentifierNode(memberExpression.object)) { - currentChain.unshift(memberExpression.object.name); - } - - return currentChain; - } - }, { - key: "getCalleeBlockStatement", - value: function getCalleeBlockStatement(targetNode, objectMembersCallsChain) { - var _this = this; - - var objectName = objectMembersCallsChain.shift(); - - if (!objectName) { - return null; - } - - var calleeBlockStatement = null; - estraverse.traverse(targetNode, { - enter: function enter(node) { - if (NodeGuards_1.NodeGuards.isVariableDeclaratorNode(node) && NodeGuards_1.NodeGuards.isIdentifierNode(node.id) && node.init && NodeGuards_1.NodeGuards.isObjectExpressionNode(node.init) && node.id.name === objectName) { - calleeBlockStatement = _this.findCalleeBlockStatement(node.init.properties, objectMembersCallsChain); - return estraverse.VisitorOption.Break; - } - } - }); - return calleeBlockStatement; - } - }, { - key: "findCalleeBlockStatement", - value: function findCalleeBlockStatement(objectExpressionProperties, objectMembersCallsChain) { - var nextItemInCallsChain = objectMembersCallsChain.shift(); - - if (!nextItemInCallsChain) { - return null; - } - - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = _getIterator(objectExpressionProperties), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var _propertyNode = _step.value; - var isTargetPropertyNodeWithIdentifierKey = NodeGuards_1.NodeGuards.isIdentifierNode(_propertyNode.key) && _propertyNode.key.name === nextItemInCallsChain; - var isTargetPropertyNodeWithLiteralKey = NodeGuards_1.NodeGuards.isLiteralNode(_propertyNode.key) && Boolean(_propertyNode.key.value) && _propertyNode.key.value === nextItemInCallsChain; - - if (!isTargetPropertyNodeWithIdentifierKey && !isTargetPropertyNodeWithLiteralKey) { - continue; - } - - if (NodeGuards_1.NodeGuards.isObjectExpressionNode(_propertyNode.value)) { - return this.findCalleeBlockStatement(_propertyNode.value.properties, objectMembersCallsChain); - } - - if (NodeGuards_1.NodeGuards.isFunctionExpressionNode(_propertyNode.value)) { - return _propertyNode.value.body; - } - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - - return null; - } - }]); - - return ObjectExpressionCalleeDataExtractor; -}(AbstractCalleeDataExtractor_1.AbstractCalleeDataExtractor); - -ObjectExpressionCalleeDataExtractor = tslib_1.__decorate([inversify_1.injectable()], ObjectExpressionCalleeDataExtractor); -exports.ObjectExpressionCalleeDataExtractor = ObjectExpressionCalleeDataExtractor; - -/***/ }), -/* 74 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$assign = __webpack_require__(11); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var estraverse = tslib_1.__importStar(__webpack_require__(17)); - -var CalleeDataExtractor_1 = __webpack_require__(49); - -var NodeGuards_1 = __webpack_require__(8); - -var NodeUtils_1 = __webpack_require__(9); - -var StackTraceAnalyzer = StackTraceAnalyzer_1 = -/*#__PURE__*/ -function () { - function StackTraceAnalyzer(calleeDataExtractorFactory) { - _classCallCheck(this, StackTraceAnalyzer); - - this.calleeDataExtractorFactory = calleeDataExtractorFactory; - } - - _createClass(StackTraceAnalyzer, [{ - key: "analyze", - value: function analyze(astTree) { - return this.analyzeRecursive(astTree.body); - } - }, { - key: "analyzeRecursive", - value: function analyzeRecursive(blockScopeBody) { - var _this = this; - - var limitIndex = StackTraceAnalyzer_1.getLimitIndex(blockScopeBody.length); - var stackTraceData = []; - var blockScopeBodyLength = blockScopeBody.length; - - var _loop = function _loop(index) { - if (index > limitIndex) { - return "break"; - } - - var blockScopeBodyNode = blockScopeBody[index]; - estraverse.traverse(blockScopeBodyNode, { - enter: function enter(node) { - if (!NodeGuards_1.NodeGuards.isCallExpressionNode(node)) { - return; - } - - if (blockScopeBodyNode.parentNode !== NodeUtils_1.NodeUtils.getBlockScopesOfNode(node)[0]) { - return estraverse.VisitorOption.Skip; - } - - _this.analyzeCallExpressionNode(stackTraceData, blockScopeBody, node); - } - }); - }; - - for (var index = 0; index < blockScopeBodyLength; index++) { - var _ret = _loop(index); - - if (_ret === "break") break; - } - - return stackTraceData; - } - }, { - key: "analyzeCallExpressionNode", - value: function analyzeCallExpressionNode(stackTraceData, blockScopeBody, callExpressionNode) { - var _this2 = this; - - StackTraceAnalyzer_1.calleeDataExtractorsList.forEach(function (calleeDataExtractorName) { - var calleeData = _this2.calleeDataExtractorFactory(calleeDataExtractorName).extract(blockScopeBody, callExpressionNode.callee); - - if (!calleeData) { - return; - } - - stackTraceData.push(_Object$assign({}, calleeData, { - stackTrace: _this2.analyzeRecursive(calleeData.callee.body) - })); - }); - } - }], [{ - key: "getLimitIndex", - value: function getLimitIndex(blockScopeBodyLength) { - var lastIndex = blockScopeBodyLength - 1; - var limitThresholdActivationIndex = StackTraceAnalyzer_1.limitThresholdActivationLength - 1; - var limitIndex = lastIndex; - - if (lastIndex > limitThresholdActivationIndex) { - limitIndex = Math.round(limitThresholdActivationIndex + lastIndex * StackTraceAnalyzer_1.limitThreshold); - - if (limitIndex > lastIndex) { - limitIndex = lastIndex; - } - } - - return limitIndex; - } - }]); - - return StackTraceAnalyzer; -}(); - -StackTraceAnalyzer.calleeDataExtractorsList = [CalleeDataExtractor_1.CalleeDataExtractor.FunctionDeclarationCalleeDataExtractor, CalleeDataExtractor_1.CalleeDataExtractor.FunctionExpressionCalleeDataExtractor, CalleeDataExtractor_1.CalleeDataExtractor.ObjectExpressionCalleeDataExtractor]; -StackTraceAnalyzer.limitThresholdActivationLength = 25; -StackTraceAnalyzer.limitThreshold = 0.002; -StackTraceAnalyzer = StackTraceAnalyzer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICalleeDataExtractor)), tslib_1.__metadata("design:paramtypes", [Function])], StackTraceAnalyzer); -exports.StackTraceAnalyzer = StackTraceAnalyzer; -var StackTraceAnalyzer_1; - -/***/ }), -/* 75 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var InversifyContainerFacade_1 = __webpack_require__(22); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var ControlFlowReplacer_1 = __webpack_require__(52); - -var NodeTransformer_1 = __webpack_require__(28); - -var BinaryExpressionControlFlowReplacer_1 = __webpack_require__(76); - -var BlockStatementControlFlowTransformer_1 = __webpack_require__(77); - -var CallExpressionControlFlowReplacer_1 = __webpack_require__(84); - -var DeadCodeInjectionTransformer_1 = __webpack_require__(85); - -var FunctionControlFlowTransformer_1 = __webpack_require__(86); - -var LogicalExpressionControlFlowReplacer_1 = __webpack_require__(87); - -var StringLiteralControlFlowReplacer_1 = __webpack_require__(88); - -exports.controlFlowTransformersModule = new inversify_1.ContainerModule(function (bind) { - bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(BlockStatementControlFlowTransformer_1.BlockStatementControlFlowTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.BlockStatementControlFlowTransformer); - bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(DeadCodeInjectionTransformer_1.DeadCodeInjectionTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.DeadCodeInjectionTransformer); - bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(FunctionControlFlowTransformer_1.FunctionControlFlowTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.FunctionControlFlowTransformer); - bind(ServiceIdentifiers_1.ServiceIdentifiers.IControlFlowReplacer).to(BinaryExpressionControlFlowReplacer_1.BinaryExpressionControlFlowReplacer).whenTargetNamed(ControlFlowReplacer_1.ControlFlowReplacer.BinaryExpressionControlFlowReplacer); - bind(ServiceIdentifiers_1.ServiceIdentifiers.IControlFlowReplacer).to(CallExpressionControlFlowReplacer_1.CallExpressionControlFlowReplacer).whenTargetNamed(ControlFlowReplacer_1.ControlFlowReplacer.CallExpressionControlFlowReplacer); - bind(ServiceIdentifiers_1.ServiceIdentifiers.IControlFlowReplacer).to(LogicalExpressionControlFlowReplacer_1.LogicalExpressionControlFlowReplacer).whenTargetNamed(ControlFlowReplacer_1.ControlFlowReplacer.LogicalExpressionControlFlowReplacer); - bind(ServiceIdentifiers_1.ServiceIdentifiers.IControlFlowReplacer).to(StringLiteralControlFlowReplacer_1.StringLiteralControlFlowReplacer).whenTargetNamed(ControlFlowReplacer_1.ControlFlowReplacer.StringLiteralControlFlowReplacer); - bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowReplacer).toFactory(InversifyContainerFacade_1.InversifyContainerFacade.getCacheFactory(ServiceIdentifiers_1.ServiceIdentifiers.IControlFlowReplacer)); -}); - -/***/ }), -/* 76 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var ControlFlowCustomNode_1 = __webpack_require__(20); - -var ExpressionWithOperatorControlFlowReplacer_1 = __webpack_require__(53); - -var BinaryExpressionControlFlowReplacer = BinaryExpressionControlFlowReplacer_1 = -/*#__PURE__*/ -function (_ExpressionWithOperat) { - _inherits(BinaryExpressionControlFlowReplacer, _ExpressionWithOperat); - - function BinaryExpressionControlFlowReplacer(controlFlowCustomNodeFactory, randomGenerator, options) { - _classCallCheck(this, BinaryExpressionControlFlowReplacer); - - return _possibleConstructorReturn(this, (BinaryExpressionControlFlowReplacer.__proto__ || _Object$getPrototypeOf(BinaryExpressionControlFlowReplacer)).call(this, controlFlowCustomNodeFactory, randomGenerator, options)); - } - - _createClass(BinaryExpressionControlFlowReplacer, [{ - key: "replace", - value: function replace(binaryExpressionNode, parentNode, controlFlowStorage) { - var replacerId = binaryExpressionNode.operator; - var binaryExpressionFunctionCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.BinaryExpressionFunctionNode); - binaryExpressionFunctionCustomNode.initialize(replacerId); - var storageKey = this.insertCustomNodeToControlFlowStorage(binaryExpressionFunctionCustomNode, controlFlowStorage, replacerId, BinaryExpressionControlFlowReplacer_1.usingExistingIdentifierChance); - return this.getControlFlowStorageCallNode(controlFlowStorage.getStorageId(), storageKey, binaryExpressionNode.left, binaryExpressionNode.right); - } - }]); - - return BinaryExpressionControlFlowReplacer; -}(ExpressionWithOperatorControlFlowReplacer_1.ExpressionWithOperatorControlFlowReplacer); - -BinaryExpressionControlFlowReplacer.usingExistingIdentifierChance = 0.5; -BinaryExpressionControlFlowReplacer = BinaryExpressionControlFlowReplacer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], BinaryExpressionControlFlowReplacer); -exports.BinaryExpressionControlFlowReplacer = BinaryExpressionControlFlowReplacer; -var BinaryExpressionControlFlowReplacer_1; - -/***/ }), -/* 77 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var estraverse = tslib_1.__importStar(__webpack_require__(17)); - -var ControlFlowCustomNode_1 = __webpack_require__(20); - -var TransformationStage_1 = __webpack_require__(12); - -var AbstractNodeTransformer_1 = __webpack_require__(13); - -var NodeGuards_1 = __webpack_require__(8); - -var NodeUtils_1 = __webpack_require__(9); - -var BlockStatementControlFlowTransformer = BlockStatementControlFlowTransformer_1 = -/*#__PURE__*/ -function (_AbstractNodeTransfor) { - _inherits(BlockStatementControlFlowTransformer, _AbstractNodeTransfor); - - function BlockStatementControlFlowTransformer(controlFlowCustomNodeFactory, arrayUtils, randomGenerator, options) { - var _this; - - _classCallCheck(this, BlockStatementControlFlowTransformer); - - _this = _possibleConstructorReturn(this, (BlockStatementControlFlowTransformer.__proto__ || _Object$getPrototypeOf(BlockStatementControlFlowTransformer)).call(this, randomGenerator, options)); - _this.controlFlowCustomNodeFactory = controlFlowCustomNodeFactory; - _this.arrayUtils = arrayUtils; - return _this; - } - - _createClass(BlockStatementControlFlowTransformer, [{ - key: "getVisitor", - value: function getVisitor(transformationStage) { - var _this2 = this; - - switch (transformationStage) { - case TransformationStage_1.TransformationStage.ControlFlowFlattening: - return { - leave: function leave(node, parentNode) { - if (parentNode && NodeGuards_1.NodeGuards.isBlockStatementNode(node)) { - return _this2.transformNode(node, parentNode); - } - } - }; - - default: - return null; - } - } - }, { - key: "transformNode", - value: function transformNode(blockStatementNode, parentNode) { - if (this.randomGenerator.getMathRandom() > this.options.controlFlowFlatteningThreshold || !BlockStatementControlFlowTransformer_1.canTransformBlockStatementNode(blockStatementNode)) { - return blockStatementNode; - } - - var blockStatementBody = blockStatementNode.body; - var originalKeys = this.arrayUtils.arrayRange(blockStatementBody.length); - var shuffledKeys = this.arrayUtils.arrayShuffle(originalKeys); - var originalKeysIndexesInShuffledArray = originalKeys.map(function (key) { - return shuffledKeys.indexOf(key); - }); - var blockStatementControlFlowFlatteningCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode); - blockStatementControlFlowFlatteningCustomNode.initialize(blockStatementBody, shuffledKeys, originalKeysIndexesInShuffledArray); - var newBlockStatementNode = blockStatementControlFlowFlatteningCustomNode.getNode()[0]; - NodeUtils_1.NodeUtils.parentizeNode(newBlockStatementNode, parentNode); - return newBlockStatementNode; - } - }], [{ - key: "blockStatementHasProhibitedStatements", - value: function blockStatementHasProhibitedStatements(blockStatementNode) { - return blockStatementNode.body.some(function (statement) { - var isBreakOrContinueStatement = NodeGuards_1.NodeGuards.isBreakStatementNode(statement) || NodeGuards_1.NodeGuards.isContinueStatementNode(statement); - var isVariableDeclarationWithLetOrConstKind = NodeGuards_1.NodeGuards.isVariableDeclarationNode(statement) && (statement.kind === 'const' || statement.kind === 'let'); - var isClassDeclaration = NodeGuards_1.NodeGuards.isClassDeclarationNode(statement); - return NodeGuards_1.NodeGuards.isFunctionDeclarationNode(statement) || isBreakOrContinueStatement || isVariableDeclarationWithLetOrConstKind || isClassDeclaration; - }); - } - }, { - key: "canTransformBlockStatementNode", - value: function canTransformBlockStatementNode(blockStatementNode) { - var canTransform = true; - estraverse.traverse(blockStatementNode, { - enter: function enter(node) { - if (NodeGuards_1.NodeGuards.isWhileStatementNode(node)) { - return estraverse.VisitorOption.Skip; - } - - if (NodeGuards_1.NodeGuards.isBlockStatementNode(node) && BlockStatementControlFlowTransformer_1.blockStatementHasProhibitedStatements(node)) { - canTransform = false; - } - } - }); - - if (blockStatementNode.body.length <= 4) { - canTransform = false; - } - - return canTransform; - } - }]); - - return BlockStatementControlFlowTransformer; -}(AbstractNodeTransformer_1.AbstractNodeTransformer); - -BlockStatementControlFlowTransformer = BlockStatementControlFlowTransformer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IArrayUtils)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object, Object])], BlockStatementControlFlowTransformer); -exports.BlockStatementControlFlowTransformer = BlockStatementControlFlowTransformer; -var BlockStatementControlFlowTransformer_1; - -/***/ }), -/* 78 */ -/***/ (function(module, exports) { - -module.exports = require("@babel/runtime/core-js/object/define-property"); - -/***/ }), -/* 79 */ -/***/ (function(module, exports) { - -module.exports = require("@babel/runtime/core-js/object/get-own-property-descriptor"); - -/***/ }), -/* 80 */ -/***/ (function(module, exports) { - -module.exports = require("@babel/runtime/core-js/reflect/get-metadata"); - -/***/ }), -/* 81 */ -/***/ (function(module, exports) { - -module.exports = require("@babel/runtime/core-js/object/get-own-property-names"); - -/***/ }), -/* 82 */ -/***/ (function(module, exports) { - -module.exports = require("@babel/runtime/core-js/reflect/define-metadata"); - -/***/ }), -/* 83 */ -/***/ (function(module, exports) { - -module.exports = require("@babel/runtime/core-js/reflect/has-metadata"); - -/***/ }), -/* 84 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var ControlFlowCustomNode_1 = __webpack_require__(20); - -var AbstractControlFlowReplacer_1 = __webpack_require__(43); - -var NodeGuards_1 = __webpack_require__(8); - -var CallExpressionControlFlowReplacer = CallExpressionControlFlowReplacer_1 = -/*#__PURE__*/ -function (_AbstractControlFlowR) { - _inherits(CallExpressionControlFlowReplacer, _AbstractControlFlowR); - - function CallExpressionControlFlowReplacer(controlFlowCustomNodeFactory, randomGenerator, options) { - _classCallCheck(this, CallExpressionControlFlowReplacer); - - return _possibleConstructorReturn(this, (CallExpressionControlFlowReplacer.__proto__ || _Object$getPrototypeOf(CallExpressionControlFlowReplacer)).call(this, controlFlowCustomNodeFactory, randomGenerator, options)); - } - - _createClass(CallExpressionControlFlowReplacer, [{ - key: "replace", - value: function replace(callExpressionNode, parentNode, controlFlowStorage) { - var callee = callExpressionNode.callee; - - if (!NodeGuards_1.NodeGuards.isIdentifierNode(callee)) { - return callExpressionNode; - } - - var replacerId = String(callExpressionNode.arguments.length); - var callExpressionFunctionCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.CallExpressionFunctionNode); - var expressionArguments = callExpressionNode.arguments; - callExpressionFunctionCustomNode.initialize(expressionArguments); - var storageKey = this.insertCustomNodeToControlFlowStorage(callExpressionFunctionCustomNode, controlFlowStorage, replacerId, CallExpressionControlFlowReplacer_1.usingExistingIdentifierChance); - return this.getControlFlowStorageCallNode(controlFlowStorage.getStorageId(), storageKey, callee, expressionArguments); - } - }, { - key: "getControlFlowStorageCallNode", - value: function getControlFlowStorageCallNode(controlFlowStorageId, storageKey, callee, expressionArguments) { - var controlFlowStorageCallCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode); - controlFlowStorageCallCustomNode.initialize(controlFlowStorageId, storageKey, callee, expressionArguments); - var statementNode = controlFlowStorageCallCustomNode.getNode()[0]; - - if (!statementNode || !NodeGuards_1.NodeGuards.isExpressionStatementNode(statementNode)) { - throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node"); - } - - return statementNode.expression; - } - }]); - - return CallExpressionControlFlowReplacer; -}(AbstractControlFlowReplacer_1.AbstractControlFlowReplacer); - -CallExpressionControlFlowReplacer.usingExistingIdentifierChance = 0.5; -CallExpressionControlFlowReplacer = CallExpressionControlFlowReplacer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], CallExpressionControlFlowReplacer); -exports.CallExpressionControlFlowReplacer = CallExpressionControlFlowReplacer; -var CallExpressionControlFlowReplacer_1; - -/***/ }), -/* 85 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Set = __webpack_require__(29); - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var estraverse = tslib_1.__importStar(__webpack_require__(17)); - -var DeadCodeInjectionCustomNode_1 = __webpack_require__(54); - -var NodeTransformer_1 = __webpack_require__(28); - -var NodeType_1 = __webpack_require__(18); - -var TransformationStage_1 = __webpack_require__(12); - -var AbstractNodeTransformer_1 = __webpack_require__(13); - -var NodeGuards_1 = __webpack_require__(8); - -var Nodes_1 = __webpack_require__(15); - -var NodeUtils_1 = __webpack_require__(9); - -var DeadCodeInjectionTransformer = DeadCodeInjectionTransformer_1 = -/*#__PURE__*/ -function (_AbstractNodeTransfor) { - _inherits(DeadCodeInjectionTransformer, _AbstractNodeTransfor); - - function DeadCodeInjectionTransformer(deadCodeInjectionCustomNodeFactory, transformersRunner, randomGenerator, options) { - var _this; - - _classCallCheck(this, DeadCodeInjectionTransformer); - - _this = _possibleConstructorReturn(this, (DeadCodeInjectionTransformer.__proto__ || _Object$getPrototypeOf(DeadCodeInjectionTransformer)).call(this, randomGenerator, options)); - _this.deadCodeInjectionRootAstHostNodeSet = new _Set(); - _this.collectedBlockStatements = []; - _this.collectedBlockStatementsTotalLength = 0; - _this.deadCodeInjectionCustomNodeFactory = deadCodeInjectionCustomNodeFactory; - _this.transformersRunner = transformersRunner; - return _this; - } - - _createClass(DeadCodeInjectionTransformer, [{ - key: "getVisitor", - value: function getVisitor(transformationStage) { - var _this2 = this; - - switch (transformationStage) { - case TransformationStage_1.TransformationStage.DeadCodeInjection: - return { - enter: function enter(node, parentNode) { - if (parentNode && NodeGuards_1.NodeGuards.isProgramNode(node)) { - _this2.analyzeNode(node, parentNode); - - return node; - } - }, - leave: function leave(node, parentNode) { - if (parentNode && NodeGuards_1.NodeGuards.isBlockStatementNode(node)) { - return _this2.transformNode(node, parentNode); - } - } - }; - - case TransformationStage_1.TransformationStage.Finalizing: - if (!this.deadCodeInjectionRootAstHostNodeSet.size) { - return null; - } - - return { - enter: function enter(node, parentNode) { - if (parentNode && _this2.isDeadCodeInjectionRootAstHostNode(node)) { - return _this2.restoreNode(node, parentNode); - } - } - }; - - default: - return null; - } - } - }, { - key: "analyzeNode", - value: function analyzeNode(programNode, parentNode) { - var _this3 = this; - - estraverse.traverse(programNode, { - enter: function enter(node) { - if (!NodeGuards_1.NodeGuards.isBlockStatementNode(node)) { - return; - } - - var clonedBlockStatementNode = NodeUtils_1.NodeUtils.clone(node); - - if (!DeadCodeInjectionTransformer_1.isValidCollectedBlockStatementNode(clonedBlockStatementNode)) { - return; - } - - NodeUtils_1.NodeUtils.parentizeNode(clonedBlockStatementNode, clonedBlockStatementNode); - clonedBlockStatementNode = _this3.transformersRunner.transform(clonedBlockStatementNode, DeadCodeInjectionTransformer_1.transformersToRenameBlockScopeIdentifiers, TransformationStage_1.TransformationStage.Obfuscating); - - _this3.collectedBlockStatements.push(clonedBlockStatementNode); - } - }); - this.collectedBlockStatementsTotalLength = this.collectedBlockStatements.length; - } - }, { - key: "transformNode", - value: function transformNode(blockStatementNode, parentNode) { - var canBreakTraverse = !this.collectedBlockStatements.length || this.collectedBlockStatementsTotalLength < DeadCodeInjectionTransformer_1.minCollectedBlockStatementsCount; - - if (canBreakTraverse) { - return estraverse.VisitorOption.Break; - } - - if (this.randomGenerator.getMathRandom() > this.options.deadCodeInjectionThreshold || !DeadCodeInjectionTransformer_1.isValidWrappedBlockStatementNode(blockStatementNode)) { - return blockStatementNode; - } - - var minInteger = 0; - var maxInteger = this.collectedBlockStatements.length - 1; - var randomIndex = this.randomGenerator.getRandomInteger(minInteger, maxInteger); - var randomBlockStatementNode = this.collectedBlockStatements.splice(randomIndex, 1)[0]; - var isDuplicateBlockStatementNodes = randomBlockStatementNode === blockStatementNode; - - if (isDuplicateBlockStatementNodes) { - return blockStatementNode; - } - - return this.replaceBlockStatementNode(blockStatementNode, randomBlockStatementNode, parentNode); - } - }, { - key: "restoreNode", - value: function restoreNode(deadCodeInjectionRootAstHostNode, parentNode) { - var hostNodeFirstStatement = deadCodeInjectionRootAstHostNode.body[0]; - - if (!NodeGuards_1.NodeGuards.isFunctionDeclarationNode(hostNodeFirstStatement)) { - throw new Error('Wrong dead code injection root AST host node. Host node should contain `FunctionDeclaration` node'); - } - - return hostNodeFirstStatement.body; - } - }, { - key: "isDeadCodeInjectionRootAstHostNode", - value: function isDeadCodeInjectionRootAstHostNode(node) { - return NodeGuards_1.NodeGuards.isBlockStatementNode(node) && this.deadCodeInjectionRootAstHostNodeSet.has(node); - } - }, { - key: "replaceBlockStatementNode", - value: function replaceBlockStatementNode(blockStatementNode, randomBlockStatementNode, parentNode) { - var deadCodeInjectionRootAstHostNode = Nodes_1.Nodes.getBlockStatementNode([Nodes_1.Nodes.getFunctionDeclarationNode(DeadCodeInjectionTransformer_1.deadCodeInjectionRootAstHostNodeName, [], randomBlockStatementNode)]); - this.deadCodeInjectionRootAstHostNodeSet.add(deadCodeInjectionRootAstHostNode); - var blockStatementDeadCodeInjectionCustomNode = this.deadCodeInjectionCustomNodeFactory(DeadCodeInjectionCustomNode_1.DeadCodeInjectionCustomNode.BlockStatementDeadCodeInjectionNode); - blockStatementDeadCodeInjectionCustomNode.initialize(blockStatementNode, deadCodeInjectionRootAstHostNode); - var newBlockStatementNode = blockStatementDeadCodeInjectionCustomNode.getNode()[0]; - NodeUtils_1.NodeUtils.parentizeNode(newBlockStatementNode, parentNode); - return newBlockStatementNode; - } - }], [{ - key: "isProhibitedNodeInsideCollectedBlockStatement", - value: function isProhibitedNodeInsideCollectedBlockStatement(targetNode) { - return NodeGuards_1.NodeGuards.isBreakStatementNode(targetNode) || NodeGuards_1.NodeGuards.isContinueStatementNode(targetNode) || NodeGuards_1.NodeGuards.isAwaitExpressionNode(targetNode) || NodeGuards_1.NodeGuards.isSuperNode(targetNode); - } - }, { - key: "isScopeHoistingFunctionDeclaration", - value: function isScopeHoistingFunctionDeclaration(targetNode) { - if (!NodeGuards_1.NodeGuards.isFunctionDeclarationNode(targetNode)) { - return false; - } - - var scopeNode = NodeUtils_1.NodeUtils.getScopeOfNode(targetNode); - var scopeBody = !NodeGuards_1.NodeGuards.isSwitchCaseNode(scopeNode) ? scopeNode.body : scopeNode.consequent; - var indexInScope = scopeBody.indexOf(targetNode); - - if (indexInScope === 0) { - return false; - } - - var slicedBody = scopeBody.slice(0, indexInScope); - var hostBlockStatementNode = Nodes_1.Nodes.getBlockStatementNode(slicedBody); - var functionDeclarationName = targetNode.id.name; - var isScopeHoistedFunctionDeclaration = false; - estraverse.traverse(hostBlockStatementNode, { - enter: function enter(node) { - if (NodeGuards_1.NodeGuards.isIdentifierNode(node) && node.name === functionDeclarationName) { - isScopeHoistedFunctionDeclaration = true; - return estraverse.VisitorOption.Break; - } - } - }); - return isScopeHoistedFunctionDeclaration; - } - }, { - key: "isValidCollectedBlockStatementNode", - value: function isValidCollectedBlockStatementNode(blockStatementNode) { - if (!blockStatementNode.body.length) { - return false; - } - - var nestedBlockStatementsCount = 0; - var isValidBlockStatementNode = true; - estraverse.traverse(blockStatementNode, { - enter: function enter(node) { - if (NodeGuards_1.NodeGuards.isBlockStatementNode(node)) { - nestedBlockStatementsCount++; - } - - if (nestedBlockStatementsCount > DeadCodeInjectionTransformer_1.maxNestedBlockStatementsCount || DeadCodeInjectionTransformer_1.isProhibitedNodeInsideCollectedBlockStatement(node) || DeadCodeInjectionTransformer_1.isScopeHoistingFunctionDeclaration(node)) { - isValidBlockStatementNode = false; - return estraverse.VisitorOption.Break; - } - } - }); - return isValidBlockStatementNode; - } - }, { - key: "isValidWrappedBlockStatementNode", - value: function isValidWrappedBlockStatementNode(blockStatementNode) { - if (!blockStatementNode.body.length) { - return false; - } - - var isValidBlockStatementNode = true; - estraverse.traverse(blockStatementNode, { - enter: function enter(node) { - if (DeadCodeInjectionTransformer_1.isScopeHoistingFunctionDeclaration(node)) { - isValidBlockStatementNode = false; - return estraverse.VisitorOption.Break; - } - } - }); - - if (!isValidBlockStatementNode) { - return false; - } - - var blockScopeOfBlockStatementNode = NodeUtils_1.NodeUtils.getBlockScopesOfNode(blockStatementNode)[0]; - return blockScopeOfBlockStatementNode.type !== NodeType_1.NodeType.Program; - } - }]); - - return DeadCodeInjectionTransformer; -}(AbstractNodeTransformer_1.AbstractNodeTransformer); - -DeadCodeInjectionTransformer.deadCodeInjectionRootAstHostNodeName = 'deadCodeInjectionRootAstHostNode'; -DeadCodeInjectionTransformer.maxNestedBlockStatementsCount = 4; -DeadCodeInjectionTransformer.minCollectedBlockStatementsCount = 5; -DeadCodeInjectionTransformer.transformersToRenameBlockScopeIdentifiers = [NodeTransformer_1.NodeTransformer.CatchClauseTransformer, NodeTransformer_1.NodeTransformer.ClassDeclarationTransformer, NodeTransformer_1.NodeTransformer.FunctionDeclarationTransformer, NodeTransformer_1.NodeTransformer.FunctionTransformer, NodeTransformer_1.NodeTransformer.LabeledStatementTransformer, NodeTransformer_1.NodeTransformer.VariableDeclarationTransformer]; -DeadCodeInjectionTransformer = DeadCodeInjectionTransformer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ITransformersRunner)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object, Object])], DeadCodeInjectionTransformer); -exports.DeadCodeInjectionTransformer = DeadCodeInjectionTransformer; -var DeadCodeInjectionTransformer_1; - -/***/ }), -/* 86 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$assign = __webpack_require__(11); - -var _Set = __webpack_require__(29); - -var _Map = __webpack_require__(16); - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var estraverse = tslib_1.__importStar(__webpack_require__(17)); - -var ControlFlowCustomNode_1 = __webpack_require__(20); - -var ControlFlowReplacer_1 = __webpack_require__(52); - -var NodeType_1 = __webpack_require__(18); - -var TransformationStage_1 = __webpack_require__(12); - -var AbstractNodeTransformer_1 = __webpack_require__(13); - -var NodeGuards_1 = __webpack_require__(8); - -var NodeAppender_1 = __webpack_require__(23); - -var NodeUtils_1 = __webpack_require__(9); - -var FunctionControlFlowTransformer = FunctionControlFlowTransformer_1 = -/*#__PURE__*/ -function (_AbstractNodeTransfor) { - _inherits(FunctionControlFlowTransformer, _AbstractNodeTransfor); - - function FunctionControlFlowTransformer(controlFlowStorageFactory, controlFlowReplacerFactory, controlFlowCustomNodeFactory, randomGenerator, options) { - var _this; - - _classCallCheck(this, FunctionControlFlowTransformer); - - _this = _possibleConstructorReturn(this, (FunctionControlFlowTransformer.__proto__ || _Object$getPrototypeOf(FunctionControlFlowTransformer)).call(this, randomGenerator, options)); - _this.controlFlowData = new _Map(); - _this.visitedFunctionNodes = new _Set(); - _this.hostNodesWithControlFlowNode = new _Set(); - _this.controlFlowStorageFactory = controlFlowStorageFactory; - _this.controlFlowReplacerFactory = controlFlowReplacerFactory; - _this.controlFlowCustomNodeFactory = controlFlowCustomNodeFactory; - return _this; - } - - _createClass(FunctionControlFlowTransformer, [{ - key: "getVisitor", - value: function getVisitor(transformationStage) { - var _this2 = this; - - switch (transformationStage) { - case TransformationStage_1.TransformationStage.ControlFlowFlattening: - return { - leave: function leave(node, parentNode) { - if (parentNode && (NodeGuards_1.NodeGuards.isFunctionDeclarationNode(node) || NodeGuards_1.NodeGuards.isFunctionExpressionNode(node) || NodeGuards_1.NodeGuards.isArrowFunctionExpressionNode(node))) { - return _this2.transformNode(node, parentNode); - } - } - }; - - default: - return null; - } - } - }, { - key: "transformNode", - value: function transformNode(functionNode, parentNode) { - this.visitedFunctionNodes.add(functionNode); - - if (!NodeGuards_1.NodeGuards.isBlockStatementNode(functionNode.body)) { - return functionNode; - } - - var hostNode = this.getHostNode(functionNode.body); - var controlFlowStorage = this.getControlFlowStorage(hostNode); - this.controlFlowData.set(hostNode, controlFlowStorage); - this.transformFunctionBody(functionNode.body, controlFlowStorage); - - if (!controlFlowStorage.getLength()) { - return functionNode; - } - - var controlFlowStorageCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.ControlFlowStorageNode); - controlFlowStorageCustomNode.initialize(controlFlowStorage); - NodeAppender_1.NodeAppender.prependNode(hostNode, controlFlowStorageCustomNode.getNode()); - this.hostNodesWithControlFlowNode.add(hostNode); - return functionNode; - } - }, { - key: "getControlFlowStorage", - value: function getControlFlowStorage(hostNode) { - var controlFlowStorage = this.controlFlowStorageFactory(); - - if (this.controlFlowData.has(hostNode)) { - if (this.hostNodesWithControlFlowNode.has(hostNode)) { - hostNode.body.shift(); - } - - var hostControlFlowStorage = this.controlFlowData.get(hostNode); - controlFlowStorage.mergeWith(hostControlFlowStorage, true); - } - - return controlFlowStorage; - } - }, { - key: "getHostNode", - value: function getHostNode(functionNodeBody) { - var blockScopesOfNode = NodeUtils_1.NodeUtils.getBlockScopesOfNode(functionNodeBody); - - if (blockScopesOfNode.length === 1) { - return functionNodeBody; - } else { - blockScopesOfNode.pop(); - } - - if (blockScopesOfNode.length > FunctionControlFlowTransformer_1.hostNodeSearchMinDepth) { - blockScopesOfNode.splice(0, FunctionControlFlowTransformer_1.hostNodeSearchMinDepth); - } - - if (blockScopesOfNode.length > FunctionControlFlowTransformer_1.hostNodeSearchMaxDepth) { - blockScopesOfNode.length = FunctionControlFlowTransformer_1.hostNodeSearchMaxDepth; - } - - return this.randomGenerator.getRandomGenerator().pickone(blockScopesOfNode); - } - }, { - key: "isVisitedFunctionNode", - value: function isVisitedFunctionNode(node) { - return (NodeGuards_1.NodeGuards.isFunctionDeclarationNode(node) || NodeGuards_1.NodeGuards.isFunctionExpressionNode(node) || NodeGuards_1.NodeGuards.isArrowFunctionExpressionNode(node)) && this.visitedFunctionNodes.has(node); - } - }, { - key: "transformFunctionBody", - value: function transformFunctionBody(functionNodeBody, controlFlowStorage) { - var _this3 = this; - - estraverse.replace(functionNodeBody, { - enter: function enter(node, parentNode) { - if (node.ignoredNode) { - return estraverse.VisitorOption.Skip; - } - - if (_this3.isVisitedFunctionNode(node) || !parentNode) { - return estraverse.VisitorOption.Skip; - } - - if (!FunctionControlFlowTransformer_1.controlFlowReplacersMap.has(node.type)) { - return node; - } - - if (_this3.randomGenerator.getMathRandom() > _this3.options.controlFlowFlatteningThreshold) { - return node; - } - - var controlFlowReplacerName = FunctionControlFlowTransformer_1.controlFlowReplacersMap.get(node.type); - - if (controlFlowReplacerName === undefined) { - return node; - } - - return _Object$assign({}, _this3.controlFlowReplacerFactory(controlFlowReplacerName).replace(node, parentNode, controlFlowStorage), { - parentNode: parentNode - }); - } - }); - } - }]); - - return FunctionControlFlowTransformer; -}(AbstractNodeTransformer_1.AbstractNodeTransformer); - -FunctionControlFlowTransformer.controlFlowReplacersMap = new _Map([[NodeType_1.NodeType.BinaryExpression, ControlFlowReplacer_1.ControlFlowReplacer.BinaryExpressionControlFlowReplacer], [NodeType_1.NodeType.CallExpression, ControlFlowReplacer_1.ControlFlowReplacer.CallExpressionControlFlowReplacer], [NodeType_1.NodeType.LogicalExpression, ControlFlowReplacer_1.ControlFlowReplacer.LogicalExpressionControlFlowReplacer], [NodeType_1.NodeType.Literal, ControlFlowReplacer_1.ControlFlowReplacer.StringLiteralControlFlowReplacer]]); -FunctionControlFlowTransformer.hostNodeSearchMinDepth = 0; -FunctionControlFlowTransformer.hostNodeSearchMaxDepth = 2; -FunctionControlFlowTransformer = FunctionControlFlowTransformer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__TControlFlowStorage)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowReplacer)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode)), tslib_1.__param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(4, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Function, Function, Object, Object])], FunctionControlFlowTransformer); -exports.FunctionControlFlowTransformer = FunctionControlFlowTransformer; -var FunctionControlFlowTransformer_1; - -/***/ }), -/* 87 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var ControlFlowCustomNode_1 = __webpack_require__(20); - -var ExpressionWithOperatorControlFlowReplacer_1 = __webpack_require__(53); - -var NodeGuards_1 = __webpack_require__(8); - -var NodeUtils_1 = __webpack_require__(9); - -var LogicalExpressionControlFlowReplacer = LogicalExpressionControlFlowReplacer_1 = -/*#__PURE__*/ -function (_ExpressionWithOperat) { - _inherits(LogicalExpressionControlFlowReplacer, _ExpressionWithOperat); - - function LogicalExpressionControlFlowReplacer(controlFlowCustomNodeFactory, randomGenerator, options) { - _classCallCheck(this, LogicalExpressionControlFlowReplacer); - - return _possibleConstructorReturn(this, (LogicalExpressionControlFlowReplacer.__proto__ || _Object$getPrototypeOf(LogicalExpressionControlFlowReplacer)).call(this, controlFlowCustomNodeFactory, randomGenerator, options)); - } - - _createClass(LogicalExpressionControlFlowReplacer, [{ - key: "replace", - value: function replace(logicalExpressionNode, parentNode, controlFlowStorage) { - if (this.checkForProhibitedExpressions(logicalExpressionNode.left, logicalExpressionNode.right)) { - return logicalExpressionNode; - } - - var replacerId = logicalExpressionNode.operator; - var logicalExpressionFunctionCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.LogicalExpressionFunctionNode); - logicalExpressionFunctionCustomNode.initialize(replacerId); - var storageKey = this.insertCustomNodeToControlFlowStorage(logicalExpressionFunctionCustomNode, controlFlowStorage, replacerId, LogicalExpressionControlFlowReplacer_1.usingExistingIdentifierChance); - return this.getControlFlowStorageCallNode(controlFlowStorage.getStorageId(), storageKey, logicalExpressionNode.left, logicalExpressionNode.right); - } - }, { - key: "checkForProhibitedExpressions", - value: function checkForProhibitedExpressions(leftExpression, rightExpression) { - return [leftExpression, rightExpression].some(function (expressionNode) { - var nodeForCheck; - - if (!NodeGuards_1.NodeGuards.isUnaryExpressionNode(expressionNode)) { - nodeForCheck = expressionNode; - } else { - nodeForCheck = NodeUtils_1.NodeUtils.getUnaryExpressionArgumentNode(expressionNode); - } - - return !NodeGuards_1.NodeGuards.isLiteralNode(nodeForCheck) && !NodeGuards_1.NodeGuards.isIdentifierNode(nodeForCheck) && !NodeGuards_1.NodeGuards.isObjectExpressionNode(nodeForCheck) && !NodeGuards_1.NodeGuards.isExpressionStatementNode(nodeForCheck); - }); - } - }]); - - return LogicalExpressionControlFlowReplacer; -}(ExpressionWithOperatorControlFlowReplacer_1.ExpressionWithOperatorControlFlowReplacer); - -LogicalExpressionControlFlowReplacer.usingExistingIdentifierChance = 0.5; -LogicalExpressionControlFlowReplacer = LogicalExpressionControlFlowReplacer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], LogicalExpressionControlFlowReplacer); -exports.LogicalExpressionControlFlowReplacer = LogicalExpressionControlFlowReplacer; -var LogicalExpressionControlFlowReplacer_1; - -/***/ }), -/* 88 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var ControlFlowCustomNode_1 = __webpack_require__(20); - -var AbstractControlFlowReplacer_1 = __webpack_require__(43); - -var NodeGuards_1 = __webpack_require__(8); - -var StringLiteralControlFlowReplacer = StringLiteralControlFlowReplacer_1 = -/*#__PURE__*/ -function (_AbstractControlFlowR) { - _inherits(StringLiteralControlFlowReplacer, _AbstractControlFlowR); - - function StringLiteralControlFlowReplacer(controlFlowCustomNodeFactory, randomGenerator, options) { - _classCallCheck(this, StringLiteralControlFlowReplacer); - - return _possibleConstructorReturn(this, (StringLiteralControlFlowReplacer.__proto__ || _Object$getPrototypeOf(StringLiteralControlFlowReplacer)).call(this, controlFlowCustomNodeFactory, randomGenerator, options)); - } - - _createClass(StringLiteralControlFlowReplacer, [{ - key: "replace", - value: function replace(literalNode, parentNode, controlFlowStorage) { - if (NodeGuards_1.NodeGuards.isPropertyNode(parentNode) && parentNode.key === literalNode) { - return literalNode; - } - - if (typeof literalNode.value !== 'string' || literalNode.value.length < 3) { - return literalNode; - } - - var replacerId = String(literalNode.value); - var literalFunctionCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.StringLiteralNode); - literalFunctionCustomNode.initialize(literalNode.value); - var storageKey = this.insertCustomNodeToControlFlowStorage(literalFunctionCustomNode, controlFlowStorage, replacerId, StringLiteralControlFlowReplacer_1.usingExistingIdentifierChance); - return this.getControlFlowStorageCallNode(controlFlowStorage.getStorageId(), storageKey); - } - }, { - key: "getControlFlowStorageCallNode", - value: function getControlFlowStorageCallNode(controlFlowStorageId, storageKey) { - var controlFlowStorageCallCustomNode = this.controlFlowCustomNodeFactory(ControlFlowCustomNode_1.ControlFlowCustomNode.StringLiteralControlFlowStorageCallNode); - controlFlowStorageCallCustomNode.initialize(controlFlowStorageId, storageKey); - var statementNode = controlFlowStorageCallCustomNode.getNode()[0]; - - if (!statementNode || !NodeGuards_1.NodeGuards.isExpressionStatementNode(statementNode)) { - throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node"); - } - - return statementNode.expression; - } - }]); - - return StringLiteralControlFlowReplacer; -}(AbstractControlFlowReplacer_1.AbstractControlFlowReplacer); - -StringLiteralControlFlowReplacer.usingExistingIdentifierChance = 1; -StringLiteralControlFlowReplacer = StringLiteralControlFlowReplacer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], StringLiteralControlFlowReplacer); -exports.StringLiteralControlFlowReplacer = StringLiteralControlFlowReplacer; -var StringLiteralControlFlowReplacer_1; - -/***/ }), -/* 89 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var NodeTransformer_1 = __webpack_require__(28); - -var MemberExpressionTransformer_1 = __webpack_require__(90); - -var MethodDefinitionTransformer_1 = __webpack_require__(91); - -var ObjectExpressionKeysTransformer_1 = __webpack_require__(92); - -var TemplateLiteralTransformer_1 = __webpack_require__(93); - -exports.convertingTransformersModule = new inversify_1.ContainerModule(function (bind) { - bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(MemberExpressionTransformer_1.MemberExpressionTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.MemberExpressionTransformer); - bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(MethodDefinitionTransformer_1.MethodDefinitionTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.MethodDefinitionTransformer); - bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(ObjectExpressionKeysTransformer_1.ObjectExpressionKeysTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.ObjectExpressionKeysTransformer); - bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(TemplateLiteralTransformer_1.TemplateLiteralTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.TemplateLiteralTransformer); -}); - -/***/ }), -/* 90 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var NodeType_1 = __webpack_require__(18); - -var TransformationStage_1 = __webpack_require__(12); - -var AbstractNodeTransformer_1 = __webpack_require__(13); - -var NodeGuards_1 = __webpack_require__(8); - -var MemberExpressionTransformer = -/*#__PURE__*/ -function (_AbstractNodeTransfor) { - _inherits(MemberExpressionTransformer, _AbstractNodeTransfor); - - function MemberExpressionTransformer(randomGenerator, options) { - _classCallCheck(this, MemberExpressionTransformer); - - return _possibleConstructorReturn(this, (MemberExpressionTransformer.__proto__ || _Object$getPrototypeOf(MemberExpressionTransformer)).call(this, randomGenerator, options)); - } - - _createClass(MemberExpressionTransformer, [{ - key: "getVisitor", - value: function getVisitor(transformationStage) { - var _this = this; - - switch (transformationStage) { - case TransformationStage_1.TransformationStage.Converting: - return { - enter: function enter(node, parentNode) { - if (parentNode && NodeGuards_1.NodeGuards.isMemberExpressionNode(node)) { - return _this.transformNode(node, parentNode); - } - } - }; - - default: - return null; - } - } - }, { - key: "transformNode", - value: function transformNode(memberExpressionNode, parentNode) { - if (NodeGuards_1.NodeGuards.isIdentifierNode(memberExpressionNode.property)) { - if (memberExpressionNode.computed) { - return memberExpressionNode; - } - - memberExpressionNode.computed = true; - memberExpressionNode.property = { - type: NodeType_1.NodeType.Literal, - value: memberExpressionNode.property.name, - raw: "'".concat(memberExpressionNode.property.name, "'") - }; - } - - return memberExpressionNode; - } - }]); - - return MemberExpressionTransformer; -}(AbstractNodeTransformer_1.AbstractNodeTransformer); - -MemberExpressionTransformer = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object])], MemberExpressionTransformer); -exports.MemberExpressionTransformer = MemberExpressionTransformer; - -/***/ }), -/* 91 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var NodeType_1 = __webpack_require__(18); - -var TransformationStage_1 = __webpack_require__(12); - -var AbstractNodeTransformer_1 = __webpack_require__(13); - -var NodeGuards_1 = __webpack_require__(8); - -var MethodDefinitionTransformer = MethodDefinitionTransformer_1 = -/*#__PURE__*/ -function (_AbstractNodeTransfor) { - _inherits(MethodDefinitionTransformer, _AbstractNodeTransfor); - - function MethodDefinitionTransformer(randomGenerator, options) { - _classCallCheck(this, MethodDefinitionTransformer); - - return _possibleConstructorReturn(this, (MethodDefinitionTransformer.__proto__ || _Object$getPrototypeOf(MethodDefinitionTransformer)).call(this, randomGenerator, options)); - } - - _createClass(MethodDefinitionTransformer, [{ - key: "getVisitor", - value: function getVisitor(transformationStage) { - var _this = this; - - switch (transformationStage) { - case TransformationStage_1.TransformationStage.Converting: - return { - enter: function enter(node, parentNode) { - if (parentNode && NodeGuards_1.NodeGuards.isMethodDefinitionNode(node)) { - return _this.transformNode(node, parentNode); - } - } - }; - - default: - return null; - } - } - }, { - key: "transformNode", - value: function transformNode(methodDefinitionNode, parentNode) { - if (NodeGuards_1.NodeGuards.isIdentifierNode(methodDefinitionNode.key) && !MethodDefinitionTransformer_1.ignoredNames.includes(methodDefinitionNode.key.name) && methodDefinitionNode.computed === false) { - methodDefinitionNode.computed = true; - methodDefinitionNode.key = { - type: NodeType_1.NodeType.Literal, - value: methodDefinitionNode.key.name, - raw: "'".concat(methodDefinitionNode.key.name, "'") - }; - } - - return methodDefinitionNode; - } - }]); - - return MethodDefinitionTransformer; -}(AbstractNodeTransformer_1.AbstractNodeTransformer); - -MethodDefinitionTransformer.ignoredNames = ['constructor']; -MethodDefinitionTransformer = MethodDefinitionTransformer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object])], MethodDefinitionTransformer); -exports.MethodDefinitionTransformer = MethodDefinitionTransformer; -var MethodDefinitionTransformer_1; - -/***/ }), -/* 92 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _slicedToArray = __webpack_require__(30); - -var _Map = __webpack_require__(16); - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var TransformationStage_1 = __webpack_require__(12); - -var AbstractNodeTransformer_1 = __webpack_require__(13); - -var NodeAppender_1 = __webpack_require__(23); - -var NodeGuards_1 = __webpack_require__(8); - -var Nodes_1 = __webpack_require__(15); - -var NodeUtils_1 = __webpack_require__(9); - -var ObjectExpressionKeysTransformer = ObjectExpressionKeysTransformer_1 = -/*#__PURE__*/ -function (_AbstractNodeTransfor) { - _inherits(ObjectExpressionKeysTransformer, _AbstractNodeTransfor); - - function ObjectExpressionKeysTransformer(randomGenerator, options) { - var _this; - - _classCallCheck(this, ObjectExpressionKeysTransformer); - - _this = _possibleConstructorReturn(this, (ObjectExpressionKeysTransformer.__proto__ || _Object$getPrototypeOf(ObjectExpressionKeysTransformer)).call(this, randomGenerator, options)); - _this.cachedScopeNodesMap = new _Map(); - return _this; - } - - _createClass(ObjectExpressionKeysTransformer, [{ - key: "getVisitor", - value: function getVisitor(transformationStage) { - var _this2 = this; - - switch (transformationStage) { - case TransformationStage_1.TransformationStage.Converting: - return { - enter: function enter(node, parentNode) { - if (_this2.options.transformObjectKeys && parentNode && NodeGuards_1.NodeGuards.isObjectExpressionNode(node) && NodeGuards_1.NodeGuards.isVariableDeclaratorNode(parentNode)) { - return _this2.transformNode(node, parentNode); - } - } - }; - - default: - return null; - } - } - }, { - key: "transformNode", - value: function transformNode(objectExpressionNode, variableDeclarator) { - if (!NodeGuards_1.NodeGuards.isIdentifierNode(variableDeclarator.id)) { - return objectExpressionNode; - } - - var scopeNode = NodeUtils_1.NodeUtils.getScopeOfNode(variableDeclarator); - - if (!scopeNode || !NodeGuards_1.NodeGuards.isNodeHasScope(scopeNode)) { - return objectExpressionNode; - } - - this.cachedScopeNodesMap.set(variableDeclarator, scopeNode); - return this.transformObjectExpressionNode(objectExpressionNode, variableDeclarator.id, variableDeclarator); - } - }, { - key: "extractPropertiesToExpressionStatements", - value: function extractPropertiesToExpressionStatements(properties, memberExpressionObject, variableDeclarator) { - var propertiesLength = properties.length; - var expressionStatements = []; - var removablePropertyIds = []; - - for (var i = 0; i < propertiesLength; i++) { - var property = properties[i]; - var propertyValue = property.value; - - if (!ObjectExpressionKeysTransformer_1.isValidPropertyValueNode(propertyValue)) { - continue; - } - - var propertyKeyName = ObjectExpressionKeysTransformer_1.getPropertyNodeKeyName(property); - - if (!propertyKeyName) { - continue; - } - - var shouldCreateLiteralNode = !property.computed || property.computed && NodeGuards_1.NodeGuards.isLiteralNode(property.key); - var memberExpressionProperty = shouldCreateLiteralNode ? Nodes_1.Nodes.getLiteralNode(propertyKeyName) : Nodes_1.Nodes.getIdentifierNode(propertyKeyName); - var memberExpressionNode = Nodes_1.Nodes.getMemberExpressionNode(memberExpressionObject, memberExpressionProperty, true); - var expressionStatementNode = Nodes_1.Nodes.getExpressionStatementNode(Nodes_1.Nodes.getAssignmentExpressionNode('=', memberExpressionNode, propertyValue)); - - if (NodeGuards_1.NodeGuards.isObjectExpressionNode(property.value)) { - this.transformObjectExpressionNode(property.value, memberExpressionNode, variableDeclarator); - } - - expressionStatements.push(expressionStatementNode); - removablePropertyIds.push(i); - } - - return [expressionStatements, removablePropertyIds]; - } - }, { - key: "transformObjectExpressionNode", - value: function transformObjectExpressionNode(objectExpressionNode, memberExpressionObjectNode, variableDeclarator) { - var properties = objectExpressionNode.properties; - - if (!properties.length) { - return objectExpressionNode; - } - - var scopeNode = this.cachedScopeNodesMap.get(variableDeclarator); - - if (!scopeNode) { - return objectExpressionNode; - } - - var _extractPropertiesToE = this.extractPropertiesToExpressionStatements(properties, memberExpressionObjectNode, variableDeclarator), - _extractPropertiesToE2 = _slicedToArray(_extractPropertiesToE, 2), - expressionStatements = _extractPropertiesToE2[0], - removablePropertyIds = _extractPropertiesToE2[1]; - - objectExpressionNode.properties = ObjectExpressionKeysTransformer_1.filterObjectExpressionProperties(properties, removablePropertyIds); - ObjectExpressionKeysTransformer_1.appendExpressionStatements(scopeNode, expressionStatements, variableDeclarator); - return objectExpressionNode; - } - }], [{ - key: "appendExpressionStatements", - value: function appendExpressionStatements(scopeNode, expressionStatements, variableDeclarator) { - var variableDeclaration = variableDeclarator.parentNode; - - if (!variableDeclaration || !NodeGuards_1.NodeGuards.isVariableDeclarationNode(variableDeclaration)) { - throw new Error('Cannot find variable declaration for variable declarator'); - } - - NodeAppender_1.NodeAppender.insertNodeAfter(scopeNode, expressionStatements, variableDeclaration); - } - }, { - key: "filterObjectExpressionProperties", - value: function filterObjectExpressionProperties(properties, removablePropertyIds) { - return properties.filter(function (property, index) { - return !removablePropertyIds.includes(index); - }); - } - }, { - key: "getPropertyNodeKeyName", - value: function getPropertyNodeKeyName(propertyNode) { - var propertyKeyNode = propertyNode.key; - - if (NodeGuards_1.NodeGuards.isLiteralNode(propertyKeyNode) && typeof propertyKeyNode.value === 'string') { - return propertyKeyNode.value; - } else if (NodeGuards_1.NodeGuards.isIdentifierNode(propertyKeyNode)) { - return propertyKeyNode.name; - } - - return null; - } - }, { - key: "isValidPropertyValueNode", - value: function isValidPropertyValueNode(propertyValueNode) { - return !NodeGuards_1.NodeGuards.isObjectPatternNode(propertyValueNode) && !NodeGuards_1.NodeGuards.isArrayPatternNode(propertyValueNode) && !NodeGuards_1.NodeGuards.isAssignmentPatternNode(propertyValueNode) && !NodeGuards_1.NodeGuards.isRestElementNode(propertyValueNode); - } - }]); - - return ObjectExpressionKeysTransformer; -}(AbstractNodeTransformer_1.AbstractNodeTransformer); - -ObjectExpressionKeysTransformer = ObjectExpressionKeysTransformer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object])], ObjectExpressionKeysTransformer); -exports.ObjectExpressionKeysTransformer = ObjectExpressionKeysTransformer; -var ObjectExpressionKeysTransformer_1; - -/***/ }), -/* 93 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _toConsumableArray = __webpack_require__(24); - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var estraverse = tslib_1.__importStar(__webpack_require__(17)); - -var TransformationStage_1 = __webpack_require__(12); - -var AbstractNodeTransformer_1 = __webpack_require__(13); - -var NodeGuards_1 = __webpack_require__(8); - -var Nodes_1 = __webpack_require__(15); - -var NodeUtils_1 = __webpack_require__(9); - -var TemplateLiteralTransformer = TemplateLiteralTransformer_1 = -/*#__PURE__*/ -function (_AbstractNodeTransfor) { - _inherits(TemplateLiteralTransformer, _AbstractNodeTransfor); - - function TemplateLiteralTransformer(randomGenerator, options) { - _classCallCheck(this, TemplateLiteralTransformer); - - return _possibleConstructorReturn(this, (TemplateLiteralTransformer.__proto__ || _Object$getPrototypeOf(TemplateLiteralTransformer)).call(this, randomGenerator, options)); - } - - _createClass(TemplateLiteralTransformer, [{ - key: "getVisitor", - value: function getVisitor(transformationStage) { - var _this = this; - - switch (transformationStage) { - case TransformationStage_1.TransformationStage.Converting: - return { - enter: function enter(node, parentNode) { - if (parentNode && NodeGuards_1.NodeGuards.isReturnStatementNode(node) && node.argument === null) { - return _this.fixEsprimaReturnStatementTemplateLiteralNode(node); - } - }, - leave: function leave(node, parentNode) { - if (parentNode && NodeGuards_1.NodeGuards.isTemplateLiteralNode(node)) { - return _this.transformNode(node, parentNode); - } - } - }; - - default: - return null; - } - } - }, { - key: "transformNode", - value: function transformNode(templateLiteralNode, parentNode) { - var templateLiteralExpressions = templateLiteralNode.expressions; - var nodes = []; - templateLiteralNode.quasis.forEach(function (templateElement) { - nodes.push(Nodes_1.Nodes.getLiteralNode(templateElement.value.cooked)); - var expression = templateLiteralExpressions.shift(); - - if (!expression) { - return; - } - - nodes.push(expression); - }); - nodes = nodes.filter(function (node) { - return !(NodeGuards_1.NodeGuards.isLiteralNode(node) && node.value === ''); - }); - - if (!TemplateLiteralTransformer_1.isLiteralNodeWithStringValue(nodes[0]) && !TemplateLiteralTransformer_1.isLiteralNodeWithStringValue(nodes[1])) { - nodes.unshift(Nodes_1.Nodes.getLiteralNode('')); - } - - if (nodes.length > 1) { - var root = Nodes_1.Nodes.getBinaryExpressionNode('+', nodes.shift(), nodes.shift()); - nodes.forEach(function (node) { - root = Nodes_1.Nodes.getBinaryExpressionNode('+', root, node); - }); - return root; - } - - return nodes[0]; - } - }, { - key: "fixEsprimaReturnStatementTemplateLiteralNode", - value: function fixEsprimaReturnStatementTemplateLiteralNode(returnStatementNode) { - var scopeNode = NodeUtils_1.NodeUtils.getScopeOfNode(returnStatementNode); - var scopeBody = !NodeGuards_1.NodeGuards.isSwitchCaseNode(scopeNode) ? scopeNode.body : scopeNode.consequent; - var indexInScope = scopeBody.indexOf(returnStatementNode); - - if (indexInScope !== scopeBody.length - 2) { - return; - } - - var nextSiblingStatementNode = scopeBody[indexInScope + 1]; - - if (!nextSiblingStatementNode || !NodeGuards_1.NodeGuards.isExpressionStatementNode(nextSiblingStatementNode)) { - return; - } - - var isSiblingStatementHasTemplateLiteralNode = false; - estraverse.traverse(nextSiblingStatementNode, { - enter: function enter(node, parentNode) { - if (!NodeGuards_1.NodeGuards.isTemplateLiteralNode(node)) { - return; - } - - isSiblingStatementHasTemplateLiteralNode = true; - return estraverse.VisitorOption.Break; - } - }); - - if (!isSiblingStatementHasTemplateLiteralNode) { - return; - } - - returnStatementNode.argument = nextSiblingStatementNode.expression; - scopeBody.pop(); - - if (!NodeGuards_1.NodeGuards.isSwitchCaseNode(scopeNode)) { - scopeNode.body = _toConsumableArray(scopeBody); - } else { - scopeNode.consequent = _toConsumableArray(scopeBody); - } - - return returnStatementNode; - } - }], [{ - key: "isLiteralNodeWithStringValue", - value: function isLiteralNodeWithStringValue(node) { - return node && NodeGuards_1.NodeGuards.isLiteralNode(node) && typeof node.value === 'string'; - } - }]); - - return TemplateLiteralTransformer; -}(AbstractNodeTransformer_1.AbstractNodeTransformer); - -TemplateLiteralTransformer = TemplateLiteralTransformer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object])], TemplateLiteralTransformer); -exports.TemplateLiteralTransformer = TemplateLiteralTransformer; -var TemplateLiteralTransformer_1; - -/***/ }), -/* 94 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var InversifyContainerFacade_1 = __webpack_require__(22); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var ControlFlowCustomNode_1 = __webpack_require__(20); - -var CustomNode_1 = __webpack_require__(31); - -var CustomNodeGroup_1 = __webpack_require__(55); - -var DeadCodeInjectionCustomNode_1 = __webpack_require__(54); - -var ConsoleOutputCustomNodeGroup_1 = __webpack_require__(95); - -var DebugProtectionCustomNodeGroup_1 = __webpack_require__(96); - -var DomainLockCustomNodeGroup_1 = __webpack_require__(97); - -var SelfDefendingCustomNodeGroup_1 = __webpack_require__(98); - -var StringArrayCustomNodeGroup_1 = __webpack_require__(99); - -var BinaryExpressionFunctionNode_1 = __webpack_require__(100); - -var BlockStatementControlFlowFlatteningNode_1 = __webpack_require__(103); - -var BlockStatementDeadCodeInjectionNode_1 = __webpack_require__(104); - -var CallExpressionControlFlowStorageCallNode_1 = __webpack_require__(105); - -var CallExpressionFunctionNode_1 = __webpack_require__(106); - -var ControlFlowStorageNode_1 = __webpack_require__(107); - -var ConsoleOutputDisableExpressionNode_1 = __webpack_require__(108); - -var DebugProtectionFunctionCallNode_1 = __webpack_require__(110); - -var DebugProtectionFunctionIntervalNode_1 = __webpack_require__(112); - -var DebugProtectionFunctionNode_1 = __webpack_require__(114); - -var DomainLockNode_1 = __webpack_require__(118); - -var ExpressionWithOperatorControlFlowStorageCallNode_1 = __webpack_require__(120); - -var LogicalExpressionFunctionNode_1 = __webpack_require__(121); - -var NodeCallsControllerFunctionNode_1 = __webpack_require__(122); - -var SelfDefendingUnicodeNode_1 = __webpack_require__(124); - -var StringArrayCallsWrapper_1 = __webpack_require__(126); - -var StringArrayNode_1 = __webpack_require__(133); - -var StringArrayRotateFunctionNode_1 = __webpack_require__(135); - -var StringLiteralControlFlowStorageCallNode_1 = __webpack_require__(139); - -var StringLiteralNode_1 = __webpack_require__(140); - -exports.customNodesModule = new inversify_1.ContainerModule(function (bind) { - bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode).to(ConsoleOutputDisableExpressionNode_1.ConsoleOutputDisableExpressionNode).whenTargetNamed(CustomNode_1.CustomNode.ConsoleOutputDisableExpressionNode); - bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode).to(DebugProtectionFunctionCallNode_1.DebugProtectionFunctionCallNode).whenTargetNamed(CustomNode_1.CustomNode.DebugProtectionFunctionCallNode); - bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode).to(DebugProtectionFunctionIntervalNode_1.DebugProtectionFunctionIntervalNode).whenTargetNamed(CustomNode_1.CustomNode.DebugProtectionFunctionIntervalNode); - bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode).to(DebugProtectionFunctionNode_1.DebugProtectionFunctionNode).whenTargetNamed(CustomNode_1.CustomNode.DebugProtectionFunctionNode); - bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode).to(DomainLockNode_1.DomainLockNode).whenTargetNamed(CustomNode_1.CustomNode.DomainLockNode); - bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode).to(NodeCallsControllerFunctionNode_1.NodeCallsControllerFunctionNode).whenTargetNamed(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode); - bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode).to(SelfDefendingUnicodeNode_1.SelfDefendingUnicodeNode).whenTargetNamed(CustomNode_1.CustomNode.SelfDefendingUnicodeNode); - bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode).to(StringArrayCallsWrapper_1.StringArrayCallsWrapper).whenTargetNamed(CustomNode_1.CustomNode.StringArrayCallsWrapper); - bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode).to(StringArrayNode_1.StringArrayNode).whenTargetNamed(CustomNode_1.CustomNode.StringArrayNode); - bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode).to(StringArrayRotateFunctionNode_1.StringArrayRotateFunctionNode).whenTargetNamed(CustomNode_1.CustomNode.StringArrayRotateFunctionNode); - bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode).toConstructor(BinaryExpressionFunctionNode_1.BinaryExpressionFunctionNode).whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.BinaryExpressionFunctionNode); - bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode).toConstructor(BlockStatementControlFlowFlatteningNode_1.BlockStatementControlFlowFlatteningNode).whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode); - bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode).toConstructor(CallExpressionControlFlowStorageCallNode_1.CallExpressionControlFlowStorageCallNode).whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode); - bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode).toConstructor(CallExpressionFunctionNode_1.CallExpressionFunctionNode).whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.CallExpressionFunctionNode); - bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode).toConstructor(ControlFlowStorageNode_1.ControlFlowStorageNode).whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.ControlFlowStorageNode); - bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode).toConstructor(ExpressionWithOperatorControlFlowStorageCallNode_1.ExpressionWithOperatorControlFlowStorageCallNode).whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode); - bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode).toConstructor(LogicalExpressionFunctionNode_1.LogicalExpressionFunctionNode).whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.LogicalExpressionFunctionNode); - bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode).toConstructor(StringLiteralNode_1.StringLiteralNode).whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.StringLiteralNode); - bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode).toConstructor(StringLiteralControlFlowStorageCallNode_1.StringLiteralControlFlowStorageCallNode).whenTargetNamed(ControlFlowCustomNode_1.ControlFlowCustomNode.StringLiteralControlFlowStorageCallNode); - bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode).toConstructor(BlockStatementDeadCodeInjectionNode_1.BlockStatementDeadCodeInjectionNode).whenTargetNamed(DeadCodeInjectionCustomNode_1.DeadCodeInjectionCustomNode.BlockStatementDeadCodeInjectionNode); - bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeGroup).to(ConsoleOutputCustomNodeGroup_1.ConsoleOutputCustomNodeGroup).whenTargetNamed(CustomNodeGroup_1.CustomNodeGroup.ConsoleOutputCustomNodeGroup); - bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeGroup).to(DebugProtectionCustomNodeGroup_1.DebugProtectionCustomNodeGroup).whenTargetNamed(CustomNodeGroup_1.CustomNodeGroup.DebugProtectionCustomNodeGroup); - bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeGroup).to(DomainLockCustomNodeGroup_1.DomainLockCustomNodeGroup).whenTargetNamed(CustomNodeGroup_1.CustomNodeGroup.DomainLockCustomNodeGroup); - bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeGroup).to(SelfDefendingCustomNodeGroup_1.SelfDefendingCustomNodeGroup).whenTargetNamed(CustomNodeGroup_1.CustomNodeGroup.SelfDefendingCustomNodeGroup); - bind(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeGroup).to(StringArrayCustomNodeGroup_1.StringArrayCustomNodeGroup).whenTargetNamed(CustomNodeGroup_1.CustomNodeGroup.StringArrayCustomNodeGroup); - bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICustomNode).toFactory(InversifyContainerFacade_1.InversifyContainerFacade.getFactory(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNode)); - bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IControlFlowCustomNode).toFactory(InversifyContainerFacade_1.InversifyContainerFacade.getConstructorFactory(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode, ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator, ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator, ServiceIdentifiers_1.ServiceIdentifiers.IOptions)); - bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode).toFactory(InversifyContainerFacade_1.InversifyContainerFacade.getConstructorFactory(ServiceIdentifiers_1.ServiceIdentifiers.Newable__ICustomNode, ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator, ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator, ServiceIdentifiers_1.ServiceIdentifiers.IOptions)); - bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICustomNodeGroup).toFactory(InversifyContainerFacade_1.InversifyContainerFacade.getFactory(ServiceIdentifiers_1.ServiceIdentifiers.ICustomNodeGroup)); -}); - -/***/ }), -/* 95 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Map = __webpack_require__(16); - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var Initializable_1 = __webpack_require__(10); - -var CustomNode_1 = __webpack_require__(31); - -var ObfuscationEvent_1 = __webpack_require__(25); - -var AbstractCustomNodeGroup_1 = __webpack_require__(34); - -var NodeAppender_1 = __webpack_require__(23); - -var ConsoleOutputCustomNodeGroup = -/*#__PURE__*/ -function (_AbstractCustomNodeGr) { - _inherits(ConsoleOutputCustomNodeGroup, _AbstractCustomNodeGr); - - function ConsoleOutputCustomNodeGroup(customNodeFactory, identifierNamesGeneratorFactory, randomGenerator, options) { - var _this; - - _classCallCheck(this, ConsoleOutputCustomNodeGroup); - - _this = _possibleConstructorReturn(this, (ConsoleOutputCustomNodeGroup.__proto__ || _Object$getPrototypeOf(ConsoleOutputCustomNodeGroup)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); - _this.appendEvent = ObfuscationEvent_1.ObfuscationEvent.BeforeObfuscation; - _this.customNodeFactory = customNodeFactory; - return _this; - } - - _createClass(ConsoleOutputCustomNodeGroup, [{ - key: "appendCustomNodes", - value: function appendCustomNodes(blockScopeNode, stackTraceData) { - var randomStackTraceIndex = this.getRandomStackTraceIndex(stackTraceData.length); - this.appendCustomNodeIfExist(CustomNode_1.CustomNode.ConsoleOutputDisableExpressionNode, function (customNode) { - NodeAppender_1.NodeAppender.appendNodeToOptimalBlockScope(stackTraceData, blockScopeNode, customNode.getNode(), randomStackTraceIndex); - }); - this.appendCustomNodeIfExist(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode, function (customNode) { - var targetBlockScope; - - if (stackTraceData.length) { - targetBlockScope = NodeAppender_1.NodeAppender.getOptimalBlockScope(stackTraceData, randomStackTraceIndex, 1); - } else { - targetBlockScope = blockScopeNode; - } - - NodeAppender_1.NodeAppender.prependNode(targetBlockScope, customNode.getNode()); - }); - } - }, { - key: "initialize", - value: function initialize() { - this.customNodes = new _Map(); - - if (!this.options.disableConsoleOutput) { - return; - } - - var callsControllerFunctionName = this.identifierNamesGenerator.generate(); - var consoleOutputDisableExpressionNode = this.customNodeFactory(CustomNode_1.CustomNode.ConsoleOutputDisableExpressionNode); - var nodeCallsControllerFunctionNode = this.customNodeFactory(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode); - consoleOutputDisableExpressionNode.initialize(callsControllerFunctionName); - nodeCallsControllerFunctionNode.initialize(this.appendEvent, callsControllerFunctionName); - this.customNodes.set(CustomNode_1.CustomNode.ConsoleOutputDisableExpressionNode, consoleOutputDisableExpressionNode); - this.customNodes.set(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode, nodeCallsControllerFunctionNode); - } - }]); - - return ConsoleOutputCustomNodeGroup; -}(AbstractCustomNodeGroup_1.AbstractCustomNodeGroup); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", _Map)], ConsoleOutputCustomNodeGroup.prototype, "customNodes", void 0); - -ConsoleOutputCustomNodeGroup = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICustomNode)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Function, Object, Object])], ConsoleOutputCustomNodeGroup); -exports.ConsoleOutputCustomNodeGroup = ConsoleOutputCustomNodeGroup; - -/***/ }), -/* 96 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Map = __webpack_require__(16); - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var Initializable_1 = __webpack_require__(10); - -var CustomNode_1 = __webpack_require__(31); - -var ObfuscationEvent_1 = __webpack_require__(25); - -var AbstractCustomNodeGroup_1 = __webpack_require__(34); - -var NodeAppender_1 = __webpack_require__(23); - -var DebugProtectionCustomNodeGroup = -/*#__PURE__*/ -function (_AbstractCustomNodeGr) { - _inherits(DebugProtectionCustomNodeGroup, _AbstractCustomNodeGr); - - function DebugProtectionCustomNodeGroup(customNodeFactory, identifierNamesGeneratorFactory, randomGenerator, options) { - var _this; - - _classCallCheck(this, DebugProtectionCustomNodeGroup); - - _this = _possibleConstructorReturn(this, (DebugProtectionCustomNodeGroup.__proto__ || _Object$getPrototypeOf(DebugProtectionCustomNodeGroup)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); - _this.appendEvent = ObfuscationEvent_1.ObfuscationEvent.BeforeObfuscation; - _this.customNodeFactory = customNodeFactory; - return _this; - } - - _createClass(DebugProtectionCustomNodeGroup, [{ - key: "appendCustomNodes", - value: function appendCustomNodes(blockScopeNode, stackTraceData) { - var _this2 = this; - - var randomStackTraceIndex = this.getRandomStackTraceIndex(stackTraceData.length); - this.appendCustomNodeIfExist(CustomNode_1.CustomNode.DebugProtectionFunctionCallNode, function (customNode) { - NodeAppender_1.NodeAppender.appendNodeToOptimalBlockScope(stackTraceData, blockScopeNode, customNode.getNode(), randomStackTraceIndex); - }); - this.appendCustomNodeIfExist(CustomNode_1.CustomNode.DebugProtectionFunctionNode, function (customNode) { - NodeAppender_1.NodeAppender.appendNode(blockScopeNode, customNode.getNode()); - }); - this.appendCustomNodeIfExist(CustomNode_1.CustomNode.DebugProtectionFunctionIntervalNode, function (customNode) { - var programBodyLength = blockScopeNode.body.length; - - var randomIndex = _this2.randomGenerator.getRandomInteger(0, programBodyLength); - - NodeAppender_1.NodeAppender.insertNodeAtIndex(blockScopeNode, customNode.getNode(), randomIndex); - }); - this.appendCustomNodeIfExist(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode, function (customNode) { - var targetBlockScope; - - if (stackTraceData.length) { - targetBlockScope = NodeAppender_1.NodeAppender.getOptimalBlockScope(stackTraceData, randomStackTraceIndex, 1); - } else { - targetBlockScope = blockScopeNode; - } - - NodeAppender_1.NodeAppender.prependNode(targetBlockScope, customNode.getNode()); - }); - } - }, { - key: "initialize", - value: function initialize() { - this.customNodes = new _Map(); - - if (!this.options.debugProtection) { - return; - } - - var debugProtectionFunctionName = this.identifierNamesGenerator.generate(); - var callsControllerFunctionName = this.identifierNamesGenerator.generate(); - var debugProtectionFunctionNode = this.customNodeFactory(CustomNode_1.CustomNode.DebugProtectionFunctionNode); - var debugProtectionFunctionCallNode = this.customNodeFactory(CustomNode_1.CustomNode.DebugProtectionFunctionCallNode); - var debugProtectionFunctionIntervalNode = this.customNodeFactory(CustomNode_1.CustomNode.DebugProtectionFunctionIntervalNode); - var nodeCallsControllerFunctionNode = this.customNodeFactory(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode); - debugProtectionFunctionNode.initialize(debugProtectionFunctionName); - debugProtectionFunctionCallNode.initialize(debugProtectionFunctionName, callsControllerFunctionName); - debugProtectionFunctionIntervalNode.initialize(debugProtectionFunctionName); - nodeCallsControllerFunctionNode.initialize(this.appendEvent, callsControllerFunctionName); - this.customNodes.set(CustomNode_1.CustomNode.DebugProtectionFunctionNode, debugProtectionFunctionNode); - this.customNodes.set(CustomNode_1.CustomNode.DebugProtectionFunctionCallNode, debugProtectionFunctionCallNode); - - if (this.options.debugProtectionInterval) { - this.customNodes.set(CustomNode_1.CustomNode.DebugProtectionFunctionIntervalNode, debugProtectionFunctionIntervalNode); - } - - this.customNodes.set(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode, nodeCallsControllerFunctionNode); - } - }]); - - return DebugProtectionCustomNodeGroup; -}(AbstractCustomNodeGroup_1.AbstractCustomNodeGroup); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", _Map)], DebugProtectionCustomNodeGroup.prototype, "customNodes", void 0); - -DebugProtectionCustomNodeGroup = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICustomNode)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Function, Object, Object])], DebugProtectionCustomNodeGroup); -exports.DebugProtectionCustomNodeGroup = DebugProtectionCustomNodeGroup; - -/***/ }), -/* 97 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Map = __webpack_require__(16); - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var Initializable_1 = __webpack_require__(10); - -var CustomNode_1 = __webpack_require__(31); - -var ObfuscationEvent_1 = __webpack_require__(25); - -var AbstractCustomNodeGroup_1 = __webpack_require__(34); - -var NodeAppender_1 = __webpack_require__(23); - -var DomainLockCustomNodeGroup = -/*#__PURE__*/ -function (_AbstractCustomNodeGr) { - _inherits(DomainLockCustomNodeGroup, _AbstractCustomNodeGr); - - function DomainLockCustomNodeGroup(customNodeFactory, identifierNamesGeneratorFactory, randomGenerator, options) { - var _this; - - _classCallCheck(this, DomainLockCustomNodeGroup); - - _this = _possibleConstructorReturn(this, (DomainLockCustomNodeGroup.__proto__ || _Object$getPrototypeOf(DomainLockCustomNodeGroup)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); - _this.appendEvent = ObfuscationEvent_1.ObfuscationEvent.BeforeObfuscation; - _this.customNodeFactory = customNodeFactory; - return _this; - } - - _createClass(DomainLockCustomNodeGroup, [{ - key: "appendCustomNodes", - value: function appendCustomNodes(blockScopeNode, stackTraceData) { - var randomStackTraceIndex = this.getRandomStackTraceIndex(stackTraceData.length); - this.appendCustomNodeIfExist(CustomNode_1.CustomNode.DomainLockNode, function (customNode) { - NodeAppender_1.NodeAppender.appendNodeToOptimalBlockScope(stackTraceData, blockScopeNode, customNode.getNode(), randomStackTraceIndex); - }); - this.appendCustomNodeIfExist(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode, function (customNode) { - var targetBlockScope; - - if (stackTraceData.length) { - targetBlockScope = NodeAppender_1.NodeAppender.getOptimalBlockScope(stackTraceData, randomStackTraceIndex, 1); - } else { - targetBlockScope = blockScopeNode; - } - - NodeAppender_1.NodeAppender.prependNode(targetBlockScope, customNode.getNode()); - }); - } - }, { - key: "initialize", - value: function initialize() { - this.customNodes = new _Map(); - - if (!this.options.domainLock.length) { - return; - } - - var callsControllerFunctionName = this.identifierNamesGenerator.generate(); - var domainLockNode = this.customNodeFactory(CustomNode_1.CustomNode.DomainLockNode); - var nodeCallsControllerFunctionNode = this.customNodeFactory(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode); - domainLockNode.initialize(callsControllerFunctionName); - nodeCallsControllerFunctionNode.initialize(this.appendEvent, callsControllerFunctionName); - this.customNodes.set(CustomNode_1.CustomNode.DomainLockNode, domainLockNode); - this.customNodes.set(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode, nodeCallsControllerFunctionNode); - } - }]); - - return DomainLockCustomNodeGroup; -}(AbstractCustomNodeGroup_1.AbstractCustomNodeGroup); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", _Map)], DomainLockCustomNodeGroup.prototype, "customNodes", void 0); - -DomainLockCustomNodeGroup = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICustomNode)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Function, Object, Object])], DomainLockCustomNodeGroup); -exports.DomainLockCustomNodeGroup = DomainLockCustomNodeGroup; - -/***/ }), -/* 98 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Map = __webpack_require__(16); - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var Initializable_1 = __webpack_require__(10); - -var CustomNode_1 = __webpack_require__(31); - -var ObfuscationEvent_1 = __webpack_require__(25); - -var AbstractCustomNodeGroup_1 = __webpack_require__(34); - -var NodeAppender_1 = __webpack_require__(23); - -var SelfDefendingCustomNodeGroup = -/*#__PURE__*/ -function (_AbstractCustomNodeGr) { - _inherits(SelfDefendingCustomNodeGroup, _AbstractCustomNodeGr); - - function SelfDefendingCustomNodeGroup(customNodeFactory, identifierNamesGeneratorFactory, randomGenerator, options) { - var _this; - - _classCallCheck(this, SelfDefendingCustomNodeGroup); - - _this = _possibleConstructorReturn(this, (SelfDefendingCustomNodeGroup.__proto__ || _Object$getPrototypeOf(SelfDefendingCustomNodeGroup)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); - _this.appendEvent = ObfuscationEvent_1.ObfuscationEvent.AfterObfuscation; - _this.customNodeFactory = customNodeFactory; - return _this; - } - - _createClass(SelfDefendingCustomNodeGroup, [{ - key: "appendCustomNodes", - value: function appendCustomNodes(blockScopeNode, stackTraceData) { - var randomStackTraceIndex = this.getRandomStackTraceIndex(stackTraceData.length); - this.appendCustomNodeIfExist(CustomNode_1.CustomNode.SelfDefendingUnicodeNode, function (customNode) { - NodeAppender_1.NodeAppender.appendNodeToOptimalBlockScope(stackTraceData, blockScopeNode, customNode.getNode(), randomStackTraceIndex); - }); - this.appendCustomNodeIfExist(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode, function (customNode) { - var targetBlockScope; - - if (stackTraceData.length) { - targetBlockScope = NodeAppender_1.NodeAppender.getOptimalBlockScope(stackTraceData, randomStackTraceIndex, 1); - } else { - targetBlockScope = blockScopeNode; - } - - NodeAppender_1.NodeAppender.prependNode(targetBlockScope, customNode.getNode()); - }); - } - }, { - key: "initialize", - value: function initialize() { - this.customNodes = new _Map(); - - if (!this.options.selfDefending) { - return; - } - - var callsControllerFunctionName = this.identifierNamesGenerator.generate(); - var selfDefendingUnicodeNode = this.customNodeFactory(CustomNode_1.CustomNode.SelfDefendingUnicodeNode); - var nodeCallsControllerFunctionNode = this.customNodeFactory(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode); - selfDefendingUnicodeNode.initialize(callsControllerFunctionName); - nodeCallsControllerFunctionNode.initialize(this.appendEvent, callsControllerFunctionName); - this.customNodes.set(CustomNode_1.CustomNode.SelfDefendingUnicodeNode, selfDefendingUnicodeNode); - this.customNodes.set(CustomNode_1.CustomNode.NodeCallsControllerFunctionNode, nodeCallsControllerFunctionNode); - } - }]); - - return SelfDefendingCustomNodeGroup; -}(AbstractCustomNodeGroup_1.AbstractCustomNodeGroup); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", _Map)], SelfDefendingCustomNodeGroup.prototype, "customNodes", void 0); - -SelfDefendingCustomNodeGroup = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICustomNode)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Function, Object, Object])], SelfDefendingCustomNodeGroup); -exports.SelfDefendingCustomNodeGroup = SelfDefendingCustomNodeGroup; - -/***/ }), -/* 99 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _slicedToArray = __webpack_require__(30); - -var _Map = __webpack_require__(16); - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var Initializable_1 = __webpack_require__(10); - -var CustomNode_1 = __webpack_require__(31); - -var ObfuscationEvent_1 = __webpack_require__(25); - -var AbstractCustomNodeGroup_1 = __webpack_require__(34); - -var NodeAppender_1 = __webpack_require__(23); - -var StringArrayCustomNodeGroup = -/*#__PURE__*/ -function (_AbstractCustomNodeGr) { - _inherits(StringArrayCustomNodeGroup, _AbstractCustomNodeGr); - - function StringArrayCustomNodeGroup(customNodeFactory, stringArrayStorage, identifierNamesGeneratorFactory, randomGenerator, options) { - var _this; - - _classCallCheck(this, StringArrayCustomNodeGroup); - - _this = _possibleConstructorReturn(this, (StringArrayCustomNodeGroup.__proto__ || _Object$getPrototypeOf(StringArrayCustomNodeGroup)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); - _this.appendEvent = ObfuscationEvent_1.ObfuscationEvent.AfterObfuscation; - _this.customNodeFactory = customNodeFactory; - _this.stringArrayStorage = stringArrayStorage; - return _this; - } - - _createClass(StringArrayCustomNodeGroup, [{ - key: "appendCustomNodes", - value: function appendCustomNodes(blockScopeNode, stackTraceData) { - if (!this.stringArrayStorage.getLength()) { - return; - } - - this.appendCustomNodeIfExist(CustomNode_1.CustomNode.StringArrayNode, function (customNode) { - NodeAppender_1.NodeAppender.prependNode(blockScopeNode, customNode.getNode()); - }); - this.appendCustomNodeIfExist(CustomNode_1.CustomNode.StringArrayCallsWrapper, function (customNode) { - NodeAppender_1.NodeAppender.insertNodeAtIndex(blockScopeNode, customNode.getNode(), 1); - }); - this.appendCustomNodeIfExist(CustomNode_1.CustomNode.StringArrayRotateFunctionNode, function (customNode) { - NodeAppender_1.NodeAppender.insertNodeAtIndex(blockScopeNode, customNode.getNode(), 1); - }); - } - }, { - key: "initialize", - value: function initialize() { - this.customNodes = new _Map(); - - if (!this.options.stringArray) { - return; - } - - var stringArrayNode = this.customNodeFactory(CustomNode_1.CustomNode.StringArrayNode); - var stringArrayCallsWrapper = this.customNodeFactory(CustomNode_1.CustomNode.StringArrayCallsWrapper); - var stringArrayRotateFunctionNode = this.customNodeFactory(CustomNode_1.CustomNode.StringArrayRotateFunctionNode); - var stringArrayStorageId = this.stringArrayStorage.getStorageId(); - - var _stringArrayStorageId = stringArrayStorageId.split('|'), - _stringArrayStorageId2 = _slicedToArray(_stringArrayStorageId, 2), - stringArrayName = _stringArrayStorageId2[0], - stringArrayCallsWrapperName = _stringArrayStorageId2[1]; - - var stringArrayRotateValue; - - if (this.options.rotateStringArray) { - stringArrayRotateValue = this.randomGenerator.getRandomInteger(100, 500); - } else { - stringArrayRotateValue = 0; - } - - stringArrayNode.initialize(this.stringArrayStorage, stringArrayName, stringArrayRotateValue); - stringArrayCallsWrapper.initialize(stringArrayName, stringArrayCallsWrapperName); - stringArrayRotateFunctionNode.initialize(stringArrayName, stringArrayRotateValue); - this.customNodes.set(CustomNode_1.CustomNode.StringArrayNode, stringArrayNode); - this.customNodes.set(CustomNode_1.CustomNode.StringArrayCallsWrapper, stringArrayCallsWrapper); - - if (this.options.rotateStringArray) { - this.customNodes.set(CustomNode_1.CustomNode.StringArrayRotateFunctionNode, stringArrayRotateFunctionNode); - } - } - }]); - - return StringArrayCustomNodeGroup; -}(AbstractCustomNodeGroup_1.AbstractCustomNodeGroup); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", _Map)], StringArrayCustomNodeGroup.prototype, "customNodes", void 0); - -StringArrayCustomNodeGroup = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICustomNode)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.TStringArrayStorage)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(4, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Function, Object, Object])], StringArrayCustomNodeGroup); -exports.StringArrayCustomNodeGroup = StringArrayCustomNodeGroup; - -/***/ }), -/* 100 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var Initializable_1 = __webpack_require__(10); - -var AbstractCustomNode_1 = __webpack_require__(14); - -var Nodes_1 = __webpack_require__(15); - -var NodeUtils_1 = __webpack_require__(9); - -var BinaryExpressionFunctionNode = -/*#__PURE__*/ -function (_AbstractCustomNode_) { - _inherits(BinaryExpressionFunctionNode, _AbstractCustomNode_); - - function BinaryExpressionFunctionNode(identifierNamesGeneratorFactory, randomGenerator, options) { - _classCallCheck(this, BinaryExpressionFunctionNode); - - return _possibleConstructorReturn(this, (BinaryExpressionFunctionNode.__proto__ || _Object$getPrototypeOf(BinaryExpressionFunctionNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); - } - - _createClass(BinaryExpressionFunctionNode, [{ - key: "initialize", - value: function initialize(operator) { - this.operator = operator; - } - }, { - key: "getNodeStructure", - value: function getNodeStructure() { - var structure = Nodes_1.Nodes.getExpressionStatementNode(Nodes_1.Nodes.getFunctionExpressionNode([Nodes_1.Nodes.getIdentifierNode('x'), Nodes_1.Nodes.getIdentifierNode('y')], Nodes_1.Nodes.getBlockStatementNode([Nodes_1.Nodes.getReturnStatementNode(Nodes_1.Nodes.getBinaryExpressionNode(this.operator, Nodes_1.Nodes.getIdentifierNode('x'), Nodes_1.Nodes.getIdentifierNode('y')))]))); - NodeUtils_1.NodeUtils.parentize(structure); - return [structure]; - } - }]); - - return BinaryExpressionFunctionNode; -}(AbstractCustomNode_1.AbstractCustomNode); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], BinaryExpressionFunctionNode.prototype, "operator", void 0); - -BinaryExpressionFunctionNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], BinaryExpressionFunctionNode); -exports.BinaryExpressionFunctionNode = BinaryExpressionFunctionNode; - -/***/ }), -/* 101 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -function GlobalVariableTemplate1() { - return "\n var that;\n \n try {\n var getGlobal = Function('return (function() ' + '{}.constructor(\"return this\")( )' + ');');\n \n that = getGlobal();\n } catch (e) {\n that = window;\n }\n "; -} - -exports.GlobalVariableTemplate1 = GlobalVariableTemplate1; - -/***/ }), -/* 102 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -function GlobalVariableTemplate2() { - return "\n var getGlobal = function () {\n var globalObject;\n \n try {\n globalObject = Function('return (function() ' + '{}.constructor(\"return this\")( )' + ');')();\n } catch (e) {\n globalObject = window;\n }\n \n return globalObject;\n };\n var that = getGlobal();\n "; -} - -exports.GlobalVariableTemplate2 = GlobalVariableTemplate2; - -/***/ }), -/* 103 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var Initializable_1 = __webpack_require__(10); - -var AbstractCustomNode_1 = __webpack_require__(14); - -var NodeGuards_1 = __webpack_require__(8); - -var Nodes_1 = __webpack_require__(15); - -var NodeUtils_1 = __webpack_require__(9); - -var BlockStatementControlFlowFlatteningNode = -/*#__PURE__*/ -function (_AbstractCustomNode_) { - _inherits(BlockStatementControlFlowFlatteningNode, _AbstractCustomNode_); - - function BlockStatementControlFlowFlatteningNode(identifierNamesGeneratorFactory, randomGenerator, options) { - _classCallCheck(this, BlockStatementControlFlowFlatteningNode); - - return _possibleConstructorReturn(this, (BlockStatementControlFlowFlatteningNode.__proto__ || _Object$getPrototypeOf(BlockStatementControlFlowFlatteningNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); - } - - _createClass(BlockStatementControlFlowFlatteningNode, [{ - key: "initialize", - value: function initialize(blockStatementBody, shuffledKeys, originalKeysIndexesInShuffledArray) { - this.blockStatementBody = blockStatementBody; - this.shuffledKeys = shuffledKeys; - this.originalKeysIndexesInShuffledArray = originalKeysIndexesInShuffledArray; - } - }, { - key: "getNodeStructure", - value: function getNodeStructure() { - var _this = this; - - var controllerIdentifierName = this.randomGenerator.getRandomString(6); - var indexIdentifierName = this.randomGenerator.getRandomString(6); - var structure = Nodes_1.Nodes.getBlockStatementNode([Nodes_1.Nodes.getVariableDeclarationNode([Nodes_1.Nodes.getVariableDeclaratorNode(Nodes_1.Nodes.getIdentifierNode(controllerIdentifierName), Nodes_1.Nodes.getCallExpressionNode(Nodes_1.Nodes.getMemberExpressionNode(Nodes_1.Nodes.getLiteralNode(this.originalKeysIndexesInShuffledArray.join('|')), Nodes_1.Nodes.getIdentifierNode('split')), [Nodes_1.Nodes.getLiteralNode('|')])), Nodes_1.Nodes.getVariableDeclaratorNode(Nodes_1.Nodes.getIdentifierNode(indexIdentifierName), Nodes_1.Nodes.getLiteralNode(0))]), Nodes_1.Nodes.getWhileStatementNode(Nodes_1.Nodes.getLiteralNode(true), Nodes_1.Nodes.getBlockStatementNode([Nodes_1.Nodes.getSwitchStatementNode(Nodes_1.Nodes.getMemberExpressionNode(Nodes_1.Nodes.getIdentifierNode(controllerIdentifierName), Nodes_1.Nodes.getUpdateExpressionNode('++', Nodes_1.Nodes.getIdentifierNode(indexIdentifierName)), true), this.shuffledKeys.map(function (key, index) { - var statement = _this.blockStatementBody[key]; - var consequent = [statement]; - - if (!NodeGuards_1.NodeGuards.isReturnStatementNode(statement)) { - consequent.push(Nodes_1.Nodes.getContinueStatement()); - } - - return Nodes_1.Nodes.getSwitchCaseNode(Nodes_1.Nodes.getLiteralNode(String(index)), consequent); - })), Nodes_1.Nodes.getBreakStatement()]))]); - NodeUtils_1.NodeUtils.parentize(structure); - return [structure]; - } - }]); - - return BlockStatementControlFlowFlatteningNode; -}(AbstractCustomNode_1.AbstractCustomNode); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Array)], BlockStatementControlFlowFlatteningNode.prototype, "blockStatementBody", void 0); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Array)], BlockStatementControlFlowFlatteningNode.prototype, "originalKeysIndexesInShuffledArray", void 0); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Array)], BlockStatementControlFlowFlatteningNode.prototype, "shuffledKeys", void 0); - -BlockStatementControlFlowFlatteningNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], BlockStatementControlFlowFlatteningNode); -exports.BlockStatementControlFlowFlatteningNode = BlockStatementControlFlowFlatteningNode; - -/***/ }), -/* 104 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _slicedToArray = __webpack_require__(30); - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var Initializable_1 = __webpack_require__(10); - -var AbstractCustomNode_1 = __webpack_require__(14); - -var Nodes_1 = __webpack_require__(15); - -var NodeUtils_1 = __webpack_require__(9); - -var BlockStatementDeadCodeInjectionNode = -/*#__PURE__*/ -function (_AbstractCustomNode_) { - _inherits(BlockStatementDeadCodeInjectionNode, _AbstractCustomNode_); - - function BlockStatementDeadCodeInjectionNode(identifierNamesGeneratorFactory, randomGenerator, options) { - _classCallCheck(this, BlockStatementDeadCodeInjectionNode); - - return _possibleConstructorReturn(this, (BlockStatementDeadCodeInjectionNode.__proto__ || _Object$getPrototypeOf(BlockStatementDeadCodeInjectionNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); - } - - _createClass(BlockStatementDeadCodeInjectionNode, [{ - key: "initialize", - value: function initialize(blockStatementNode, deadCodeInjectionRootAstHostNode) { - this.blockStatementNode = blockStatementNode; - this.deadCodeInjectionRootAstHostNode = deadCodeInjectionRootAstHostNode; - } - }, { - key: "getNodeStructure", - value: function getNodeStructure() { - var random1 = this.randomGenerator.getMathRandom() > 0.5; - var random2 = this.randomGenerator.getMathRandom() > 0.5; - var operator = random1 ? '===' : '!=='; - var leftString = this.randomGenerator.getRandomString(5); - var rightString = random2 ? leftString : this.randomGenerator.getRandomString(5); - - var _ref = random1 === random2 ? [this.blockStatementNode, this.deadCodeInjectionRootAstHostNode] : [this.deadCodeInjectionRootAstHostNode, this.blockStatementNode], - _ref2 = _slicedToArray(_ref, 2), - consequent = _ref2[0], - alternate = _ref2[1]; - - var structure = Nodes_1.Nodes.getBlockStatementNode([Nodes_1.Nodes.getIfStatementNode(Nodes_1.Nodes.getBinaryExpressionNode(operator, Nodes_1.Nodes.getLiteralNode(leftString), Nodes_1.Nodes.getLiteralNode(rightString)), consequent, alternate)]); - NodeUtils_1.NodeUtils.parentize(structure); - return [structure]; - } - }]); - - return BlockStatementDeadCodeInjectionNode; -}(AbstractCustomNode_1.AbstractCustomNode); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Object)], BlockStatementDeadCodeInjectionNode.prototype, "blockStatementNode", void 0); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Object)], BlockStatementDeadCodeInjectionNode.prototype, "deadCodeInjectionRootAstHostNode", void 0); - -BlockStatementDeadCodeInjectionNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], BlockStatementDeadCodeInjectionNode); -exports.BlockStatementDeadCodeInjectionNode = BlockStatementDeadCodeInjectionNode; - -/***/ }), -/* 105 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _toConsumableArray = __webpack_require__(24); - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var Initializable_1 = __webpack_require__(10); - -var AbstractCustomNode_1 = __webpack_require__(14); - -var Nodes_1 = __webpack_require__(15); - -var NodeUtils_1 = __webpack_require__(9); - -var CallExpressionControlFlowStorageCallNode = -/*#__PURE__*/ -function (_AbstractCustomNode_) { - _inherits(CallExpressionControlFlowStorageCallNode, _AbstractCustomNode_); - - function CallExpressionControlFlowStorageCallNode(identifierNamesGeneratorFactory, randomGenerator, options) { - _classCallCheck(this, CallExpressionControlFlowStorageCallNode); - - return _possibleConstructorReturn(this, (CallExpressionControlFlowStorageCallNode.__proto__ || _Object$getPrototypeOf(CallExpressionControlFlowStorageCallNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); - } - - _createClass(CallExpressionControlFlowStorageCallNode, [{ - key: "initialize", - value: function initialize(controlFlowStorageName, controlFlowStorageKey, callee, expressionArguments) { - this.controlFlowStorageName = controlFlowStorageName; - this.controlFlowStorageKey = controlFlowStorageKey; - this.callee = callee; - this.expressionArguments = expressionArguments; - } - }, { - key: "getNodeStructure", - value: function getNodeStructure() { - var structure = Nodes_1.Nodes.getExpressionStatementNode(Nodes_1.Nodes.getCallExpressionNode(Nodes_1.Nodes.getMemberExpressionNode(Nodes_1.Nodes.getIdentifierNode(this.controlFlowStorageName), Nodes_1.Nodes.getIdentifierNode(this.controlFlowStorageKey)), [this.callee].concat(_toConsumableArray(this.expressionArguments)))); - NodeUtils_1.NodeUtils.parentize(structure); - return [structure]; - } - }]); - - return CallExpressionControlFlowStorageCallNode; -}(AbstractCustomNode_1.AbstractCustomNode); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Object)], CallExpressionControlFlowStorageCallNode.prototype, "callee", void 0); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], CallExpressionControlFlowStorageCallNode.prototype, "controlFlowStorageKey", void 0); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], CallExpressionControlFlowStorageCallNode.prototype, "controlFlowStorageName", void 0); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Array)], CallExpressionControlFlowStorageCallNode.prototype, "expressionArguments", void 0); - -CallExpressionControlFlowStorageCallNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], CallExpressionControlFlowStorageCallNode); -exports.CallExpressionControlFlowStorageCallNode = CallExpressionControlFlowStorageCallNode; - -/***/ }), -/* 106 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var Initializable_1 = __webpack_require__(10); - -var AbstractCustomNode_1 = __webpack_require__(14); - -var Nodes_1 = __webpack_require__(15); - -var NodeUtils_1 = __webpack_require__(9); - -var CallExpressionFunctionNode = -/*#__PURE__*/ -function (_AbstractCustomNode_) { - _inherits(CallExpressionFunctionNode, _AbstractCustomNode_); - - function CallExpressionFunctionNode(identifierNamesGeneratorFactory, randomGenerator, options) { - _classCallCheck(this, CallExpressionFunctionNode); - - return _possibleConstructorReturn(this, (CallExpressionFunctionNode.__proto__ || _Object$getPrototypeOf(CallExpressionFunctionNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); - } - - _createClass(CallExpressionFunctionNode, [{ - key: "initialize", - value: function initialize(expressionArguments) { - this.expressionArguments = expressionArguments; - } - }, { - key: "getNodeStructure", - value: function getNodeStructure() { - var calleeIdentifier = Nodes_1.Nodes.getIdentifierNode('callee'); - var params = []; - var argumentsLength = this.expressionArguments.length; - - for (var i = 0; i < argumentsLength; i++) { - params.push(Nodes_1.Nodes.getIdentifierNode("param".concat(i + 1))); - } - - var structure = Nodes_1.Nodes.getExpressionStatementNode(Nodes_1.Nodes.getFunctionExpressionNode([calleeIdentifier].concat(params), Nodes_1.Nodes.getBlockStatementNode([Nodes_1.Nodes.getReturnStatementNode(Nodes_1.Nodes.getCallExpressionNode(calleeIdentifier, params))]))); - NodeUtils_1.NodeUtils.parentize(structure); - return [structure]; - } - }]); - - return CallExpressionFunctionNode; -}(AbstractCustomNode_1.AbstractCustomNode); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Array)], CallExpressionFunctionNode.prototype, "expressionArguments", void 0); - -CallExpressionFunctionNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], CallExpressionFunctionNode); -exports.CallExpressionFunctionNode = CallExpressionFunctionNode; - -/***/ }), -/* 107 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _slicedToArray = __webpack_require__(30); - -var _Array$from = __webpack_require__(56); - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var Initializable_1 = __webpack_require__(10); - -var AbstractCustomNode_1 = __webpack_require__(14); - -var NodeGuards_1 = __webpack_require__(8); - -var Nodes_1 = __webpack_require__(15); - -var NodeUtils_1 = __webpack_require__(9); - -var ControlFlowStorageNode = -/*#__PURE__*/ -function (_AbstractCustomNode_) { - _inherits(ControlFlowStorageNode, _AbstractCustomNode_); - - function ControlFlowStorageNode(identifierNamesGeneratorFactory, randomGenerator, options) { - _classCallCheck(this, ControlFlowStorageNode); - - return _possibleConstructorReturn(this, (ControlFlowStorageNode.__proto__ || _Object$getPrototypeOf(ControlFlowStorageNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); - } - - _createClass(ControlFlowStorageNode, [{ - key: "initialize", - value: function initialize(controlFlowStorage) { - this.controlFlowStorage = controlFlowStorage; - } - }, { - key: "getNodeStructure", - value: function getNodeStructure() { - var propertyNodes = _Array$from(this.controlFlowStorage.getStorage()).map(function (_ref) { - var _ref2 = _slicedToArray(_ref, 2), - key = _ref2[0], - value = _ref2[1]; - - var node = value.getNode()[0]; - - if (!NodeGuards_1.NodeGuards.isExpressionStatementNode(node)) { - throw new Error('Function node for control flow storage object should be passed inside the `ExpressionStatement` node!'); - } - - return Nodes_1.Nodes.getPropertyNode(Nodes_1.Nodes.getIdentifierNode(key), node.expression); - }); - - var structure = Nodes_1.Nodes.getVariableDeclarationNode([Nodes_1.Nodes.getVariableDeclaratorNode(Nodes_1.Nodes.getIdentifierNode(this.controlFlowStorage.getStorageId()), Nodes_1.Nodes.getObjectExpressionNode(propertyNodes))]); - structure = NodeUtils_1.NodeUtils.parentize(structure); - return [structure]; - } - }]); - - return ControlFlowStorageNode; -}(AbstractCustomNode_1.AbstractCustomNode); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Object)], ControlFlowStorageNode.prototype, "controlFlowStorage", void 0); - -ControlFlowStorageNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], ControlFlowStorageNode); -exports.ControlFlowStorageNode = ControlFlowStorageNode; - -/***/ }), -/* 108 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var string_template_1 = tslib_1.__importDefault(__webpack_require__(19)); - -var ObfuscationTarget_1 = __webpack_require__(21); - -var ConsoleOutputDisableExpressionTemplate_1 = __webpack_require__(109); - -var GlobalVariableNoEvalTemplate_1 = __webpack_require__(44); - -var Initializable_1 = __webpack_require__(10); - -var AbstractCustomNode_1 = __webpack_require__(14); - -var NodeUtils_1 = __webpack_require__(9); - -var ConsoleOutputDisableExpressionNode = -/*#__PURE__*/ -function (_AbstractCustomNode_) { - _inherits(ConsoleOutputDisableExpressionNode, _AbstractCustomNode_); - - function ConsoleOutputDisableExpressionNode(identifierNamesGeneratorFactory, randomGenerator, options) { - _classCallCheck(this, ConsoleOutputDisableExpressionNode); - - return _possibleConstructorReturn(this, (ConsoleOutputDisableExpressionNode.__proto__ || _Object$getPrototypeOf(ConsoleOutputDisableExpressionNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); - } - - _createClass(ConsoleOutputDisableExpressionNode, [{ - key: "initialize", - value: function initialize(callsControllerFunctionName) { - this.callsControllerFunctionName = callsControllerFunctionName; - } - }, { - key: "getNodeStructure", - value: function getNodeStructure() { - return NodeUtils_1.NodeUtils.convertCodeToStructure(this.getTemplate()); - } - }, { - key: "getTemplate", - value: function getTemplate() { - var globalVariableTemplate = this.options.target !== ObfuscationTarget_1.ObfuscationTarget.Extension ? this.getGlobalVariableTemplate() : GlobalVariableNoEvalTemplate_1.GlobalVariableNoEvalTemplate(); - return string_template_1.default(ConsoleOutputDisableExpressionTemplate_1.ConsoleOutputDisableExpressionTemplate(), { - consoleLogDisableFunctionName: this.identifierNamesGenerator.generate(), - globalVariableTemplate: globalVariableTemplate, - singleNodeCallControllerFunctionName: this.callsControllerFunctionName - }); - } - }]); - - return ConsoleOutputDisableExpressionNode; -}(AbstractCustomNode_1.AbstractCustomNode); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], ConsoleOutputDisableExpressionNode.prototype, "callsControllerFunctionName", void 0); - -ConsoleOutputDisableExpressionNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], ConsoleOutputDisableExpressionNode); -exports.ConsoleOutputDisableExpressionNode = ConsoleOutputDisableExpressionNode; - -/***/ }), -/* 109 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -function ConsoleOutputDisableExpressionTemplate() { - return "\n var {consoleLogDisableFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n var func = function () {};\n \n {globalVariableTemplate}\n \n if (!that.console) {\n that.console = (function (func){\n var c = {};\n \n c.log = func;\n c.warn = func;\n c.debug = func;\n c.info = func;\n c.error = func;\n c.exception = func;\n c.trace = func;\n \n return c;\n })(func);\n } else {\n that.console.log = func;\n that.console.warn = func;\n that.console.debug = func;\n that.console.info = func;\n that.console.error = func;\n that.console.exception = func;\n that.console.trace = func;\n }\n });\n \n {consoleLogDisableFunctionName}();\n "; -} - -exports.ConsoleOutputDisableExpressionTemplate = ConsoleOutputDisableExpressionTemplate; - -/***/ }), -/* 110 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var string_template_1 = tslib_1.__importDefault(__webpack_require__(19)); - -var Initializable_1 = __webpack_require__(10); - -var DebugProtectionFunctionCallTemplate_1 = __webpack_require__(111); - -var AbstractCustomNode_1 = __webpack_require__(14); - -var NodeUtils_1 = __webpack_require__(9); - -var DebugProtectionFunctionCallNode = -/*#__PURE__*/ -function (_AbstractCustomNode_) { - _inherits(DebugProtectionFunctionCallNode, _AbstractCustomNode_); - - function DebugProtectionFunctionCallNode(identifierNamesGeneratorFactory, randomGenerator, options) { - _classCallCheck(this, DebugProtectionFunctionCallNode); - - return _possibleConstructorReturn(this, (DebugProtectionFunctionCallNode.__proto__ || _Object$getPrototypeOf(DebugProtectionFunctionCallNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); - } - - _createClass(DebugProtectionFunctionCallNode, [{ - key: "initialize", - value: function initialize(debugProtectionFunctionName, callsControllerFunctionName) { - this.debugProtectionFunctionName = debugProtectionFunctionName; - this.callsControllerFunctionName = callsControllerFunctionName; - } - }, { - key: "getNodeStructure", - value: function getNodeStructure() { - return NodeUtils_1.NodeUtils.convertCodeToStructure(this.getTemplate()); - } - }, { - key: "getTemplate", - value: function getTemplate() { - return string_template_1.default(DebugProtectionFunctionCallTemplate_1.DebugProtectionFunctionCallTemplate(), { - debugProtectionFunctionName: this.debugProtectionFunctionName, - singleNodeCallControllerFunctionName: this.callsControllerFunctionName - }); - } - }]); - - return DebugProtectionFunctionCallNode; -}(AbstractCustomNode_1.AbstractCustomNode); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], DebugProtectionFunctionCallNode.prototype, "callsControllerFunctionName", void 0); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], DebugProtectionFunctionCallNode.prototype, "debugProtectionFunctionName", void 0); - -DebugProtectionFunctionCallNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], DebugProtectionFunctionCallNode); -exports.DebugProtectionFunctionCallNode = DebugProtectionFunctionCallNode; - -/***/ }), -/* 111 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -function DebugProtectionFunctionCallTemplate() { - return "\n (function () {\n {singleNodeCallControllerFunctionName}(this, function () {\n var regExp1 = new RegExp('function *\\\\( *\\\\)');\n var regExp2 = new RegExp('\\\\+\\\\+ *\\(?:_0x(?:[a-f0-9]){4,6}|(?:\\\\b|\\\\d)[a-z0-9]{1,4}(?:\\\\b|\\\\d)\\)', 'i');\n \n var result = {debugProtectionFunctionName}('init');\n \n if (!regExp1.test(result + 'chain') || !regExp2.test(result + 'input')) {\n result('0');\n } else {\n {debugProtectionFunctionName}();\n }\n })();\n })();\n "; -} - -exports.DebugProtectionFunctionCallTemplate = DebugProtectionFunctionCallTemplate; - -/***/ }), -/* 112 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var string_template_1 = tslib_1.__importDefault(__webpack_require__(19)); - -var Initializable_1 = __webpack_require__(10); - -var DebugProtectionFunctionIntervalTemplate_1 = __webpack_require__(113); - -var AbstractCustomNode_1 = __webpack_require__(14); - -var NodeUtils_1 = __webpack_require__(9); - -var DebugProtectionFunctionIntervalNode = -/*#__PURE__*/ -function (_AbstractCustomNode_) { - _inherits(DebugProtectionFunctionIntervalNode, _AbstractCustomNode_); - - function DebugProtectionFunctionIntervalNode(identifierNamesGeneratorFactory, randomGenerator, options) { - _classCallCheck(this, DebugProtectionFunctionIntervalNode); - - return _possibleConstructorReturn(this, (DebugProtectionFunctionIntervalNode.__proto__ || _Object$getPrototypeOf(DebugProtectionFunctionIntervalNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); - } - - _createClass(DebugProtectionFunctionIntervalNode, [{ - key: "initialize", - value: function initialize(debugProtectionFunctionName) { - this.debugProtectionFunctionName = debugProtectionFunctionName; - } - }, { - key: "getNodeStructure", - value: function getNodeStructure() { - return NodeUtils_1.NodeUtils.convertCodeToStructure(this.getTemplate()); - } - }, { - key: "getTemplate", - value: function getTemplate() { - return string_template_1.default(DebugProtectionFunctionIntervalTemplate_1.DebugProtectionFunctionIntervalTemplate(), { - debugProtectionFunctionName: this.debugProtectionFunctionName - }); - } - }]); - - return DebugProtectionFunctionIntervalNode; -}(AbstractCustomNode_1.AbstractCustomNode); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], DebugProtectionFunctionIntervalNode.prototype, "debugProtectionFunctionName", void 0); - -DebugProtectionFunctionIntervalNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], DebugProtectionFunctionIntervalNode); -exports.DebugProtectionFunctionIntervalNode = DebugProtectionFunctionIntervalNode; - -/***/ }), -/* 113 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -function DebugProtectionFunctionIntervalTemplate() { - return "\n setInterval(function () {\n {debugProtectionFunctionName}();\n }, 4000);\n "; -} - -exports.DebugProtectionFunctionIntervalTemplate = DebugProtectionFunctionIntervalTemplate; - -/***/ }), -/* 114 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var string_template_1 = tslib_1.__importDefault(__webpack_require__(19)); - -var ObfuscationTarget_1 = __webpack_require__(21); - -var Initializable_1 = __webpack_require__(10); - -var DebuggerTemplate_1 = __webpack_require__(115); - -var DebuggerTemplateNoEval_1 = __webpack_require__(116); - -var DebugProtectionFunctionTemplate_1 = __webpack_require__(117); - -var AbstractCustomNode_1 = __webpack_require__(14); - -var NodeUtils_1 = __webpack_require__(9); - -var DebugProtectionFunctionNode = -/*#__PURE__*/ -function (_AbstractCustomNode_) { - _inherits(DebugProtectionFunctionNode, _AbstractCustomNode_); - - function DebugProtectionFunctionNode(identifierNamesGeneratorFactory, randomGenerator, options) { - _classCallCheck(this, DebugProtectionFunctionNode); - - return _possibleConstructorReturn(this, (DebugProtectionFunctionNode.__proto__ || _Object$getPrototypeOf(DebugProtectionFunctionNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); - } - - _createClass(DebugProtectionFunctionNode, [{ - key: "initialize", - value: function initialize(debugProtectionFunctionName) { - this.debugProtectionFunctionName = debugProtectionFunctionName; - } - }, { - key: "getNodeStructure", - value: function getNodeStructure() { - return NodeUtils_1.NodeUtils.convertCodeToStructure(this.getTemplate()); - } - }, { - key: "getTemplate", - value: function getTemplate() { - var debuggerTemplate = this.options.target !== ObfuscationTarget_1.ObfuscationTarget.Extension ? DebuggerTemplate_1.DebuggerTemplate() : DebuggerTemplateNoEval_1.DebuggerTemplateNoEval(); - return string_template_1.default(DebugProtectionFunctionTemplate_1.DebugProtectionFunctionTemplate(), { - debuggerTemplate: debuggerTemplate, - debugProtectionFunctionName: this.debugProtectionFunctionName - }); - } - }]); - - return DebugProtectionFunctionNode; -}(AbstractCustomNode_1.AbstractCustomNode); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], DebugProtectionFunctionNode.prototype, "debugProtectionFunctionName", void 0); - -DebugProtectionFunctionNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], DebugProtectionFunctionNode); -exports.DebugProtectionFunctionNode = DebugProtectionFunctionNode; - -/***/ }), -/* 115 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -function DebuggerTemplate() { - return "\n if (typeof counter === 'string') {\n return (function (arg) {}.constructor('while (true) {}').apply('counter'));\n } else {\n if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) {\n (function () {return true;}.constructor('debu' + 'gger').call('action'));\n } else {\n (function () {return false;}.constructor('debu' + 'gger').apply('stateObject'));\n }\n \n }\n "; -} - -exports.DebuggerTemplate = DebuggerTemplate; - -/***/ }), -/* 116 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -function DebuggerTemplateNoEval() { - return "\n if (typeof counter === 'string') {\n var func = function () {\n while (true) {}\n };\n \n return func();\n } else {\n if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) {\n debugger;\n } else {\n debugger;\n }\n \n }\n "; -} - -exports.DebuggerTemplateNoEval = DebuggerTemplateNoEval; - -/***/ }), -/* 117 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -function DebugProtectionFunctionTemplate() { - return "\n function {debugProtectionFunctionName} (ret) {\n function debuggerProtection (counter) {\n \n {debuggerTemplate}\n \n debuggerProtection(++counter);\n }\n \n try {\n if (ret) {\n return debuggerProtection;\n } else {\n debuggerProtection(0);\n }\n } catch (y) {}\n }\n "; -} - -exports.DebugProtectionFunctionTemplate = DebugProtectionFunctionTemplate; - -/***/ }), -/* 118 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _slicedToArray = __webpack_require__(30); - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var string_template_1 = tslib_1.__importDefault(__webpack_require__(19)); - -var ObfuscationTarget_1 = __webpack_require__(21); - -var Initializable_1 = __webpack_require__(10); - -var DomainLockNodeTemplate_1 = __webpack_require__(119); - -var GlobalVariableNoEvalTemplate_1 = __webpack_require__(44); - -var AbstractCustomNode_1 = __webpack_require__(14); - -var NodeUtils_1 = __webpack_require__(9); - -var DomainLockNode = -/*#__PURE__*/ -function (_AbstractCustomNode_) { - _inherits(DomainLockNode, _AbstractCustomNode_); - - function DomainLockNode(identifierNamesGeneratorFactory, randomGenerator, cryptUtils, options) { - var _this; - - _classCallCheck(this, DomainLockNode); - - _this = _possibleConstructorReturn(this, (DomainLockNode.__proto__ || _Object$getPrototypeOf(DomainLockNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); - _this.cryptUtils = cryptUtils; - return _this; - } - - _createClass(DomainLockNode, [{ - key: "initialize", - value: function initialize(callsControllerFunctionName) { - this.callsControllerFunctionName = callsControllerFunctionName; - } - }, { - key: "getNodeStructure", - value: function getNodeStructure() { - return NodeUtils_1.NodeUtils.convertCodeToStructure(this.getTemplate()); - } - }, { - key: "getTemplate", - value: function getTemplate() { - var domainsString = this.options.domainLock.join(';'); - - var _cryptUtils$hideStrin = this.cryptUtils.hideString(domainsString, domainsString.length * 3), - _cryptUtils$hideStrin2 = _slicedToArray(_cryptUtils$hideStrin, 2), - hiddenDomainsString = _cryptUtils$hideStrin2[0], - diff = _cryptUtils$hideStrin2[1]; - - var globalVariableTemplate = this.options.target !== ObfuscationTarget_1.ObfuscationTarget.Extension ? this.getGlobalVariableTemplate() : GlobalVariableNoEvalTemplate_1.GlobalVariableNoEvalTemplate(); - return string_template_1.default(DomainLockNodeTemplate_1.DomainLockNodeTemplate(), { - domainLockFunctionName: this.identifierNamesGenerator.generate(), - diff: diff, - domains: hiddenDomainsString, - globalVariableTemplate: globalVariableTemplate, - singleNodeCallControllerFunctionName: this.callsControllerFunctionName - }); - } - }]); - - return DomainLockNode; -}(AbstractCustomNode_1.AbstractCustomNode); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], DomainLockNode.prototype, "callsControllerFunctionName", void 0); - -DomainLockNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICryptUtils)), tslib_1.__param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object, Object])], DomainLockNode); -exports.DomainLockNode = DomainLockNode; - -/***/ }), -/* 119 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -function DomainLockNodeTemplate() { - return "\n var {domainLockFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n \n {globalVariableTemplate}\n \n var func = function () {\n return {\n key: 'item',\n value: 'attribute',\n getAttribute: function () {\n for (var i = 0; i < 1000; i--) {\n var isPositive = i > 0;\n \n switch (isPositive) {\n case true:\n return this.item + '_' + this.value + '_' + i;\n default:\n this.item + '_' + this.value;\n }\n }\n }()\n };\n };\n \n var regExp = new RegExp(\"[{diff}]\", \"g\");\n var domains = \"{domains}\".replace(regExp, \"\").split(\";\");\n var document;\n var domain;\n \n for (var d in that) {\n if (d.length == 8 && d.charCodeAt(7) == 116 && d.charCodeAt(5) == 101 && d.charCodeAt(3) == 117 && d.charCodeAt(0) == 100) {\n document = d;\n \n break;\n }\n }\n\n for (var d1 in that[document]) {\n if (d1.length == 6 && d1.charCodeAt(5) == 110 && d1.charCodeAt(0) == 100) {\n domain = d1;\n \n break;\n }\n }\n \n if ((!document && !domain) || (!that[document] && !that[document][domain])) {\n return;\n }\n \n var currentDomain = that[document][domain];\n\n var ok = false;\n \n for (var i = 0; i < domains.length; i++) {\n var domain = domains[i];\n var position = currentDomain.length - domain.length;\n var lastIndex = currentDomain.indexOf(domain, position);\n var endsWith = lastIndex !== -1 && lastIndex === position;\n \n if (endsWith) {\n if (currentDomain.length == domain.length || domain.indexOf(\".\") === 0) {\n ok = true;\n }\n \n break;\n }\n }\n \n if (!ok) {\n data;\n } else {\n return;\n }\n \n func();\n });\n\n {domainLockFunctionName}();\n "; -} - -exports.DomainLockNodeTemplate = DomainLockNodeTemplate; - -/***/ }), -/* 120 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var Initializable_1 = __webpack_require__(10); - -var AbstractCustomNode_1 = __webpack_require__(14); - -var Nodes_1 = __webpack_require__(15); - -var NodeUtils_1 = __webpack_require__(9); - -var ExpressionWithOperatorControlFlowStorageCallNode = -/*#__PURE__*/ -function (_AbstractCustomNode_) { - _inherits(ExpressionWithOperatorControlFlowStorageCallNode, _AbstractCustomNode_); - - function ExpressionWithOperatorControlFlowStorageCallNode(identifierNamesGeneratorFactory, randomGenerator, options) { - _classCallCheck(this, ExpressionWithOperatorControlFlowStorageCallNode); - - return _possibleConstructorReturn(this, (ExpressionWithOperatorControlFlowStorageCallNode.__proto__ || _Object$getPrototypeOf(ExpressionWithOperatorControlFlowStorageCallNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); - } - - _createClass(ExpressionWithOperatorControlFlowStorageCallNode, [{ - key: "initialize", - value: function initialize(controlFlowStorageName, controlFlowStorageKey, leftValue, rightValue) { - this.controlFlowStorageName = controlFlowStorageName; - this.controlFlowStorageKey = controlFlowStorageKey; - this.leftValue = leftValue; - this.rightValue = rightValue; - } - }, { - key: "getNodeStructure", - value: function getNodeStructure() { - var structure = Nodes_1.Nodes.getExpressionStatementNode(Nodes_1.Nodes.getCallExpressionNode(Nodes_1.Nodes.getMemberExpressionNode(Nodes_1.Nodes.getIdentifierNode(this.controlFlowStorageName), Nodes_1.Nodes.getIdentifierNode(this.controlFlowStorageKey)), [this.leftValue, this.rightValue])); - NodeUtils_1.NodeUtils.parentize(structure); - return [structure]; - } - }]); - - return ExpressionWithOperatorControlFlowStorageCallNode; -}(AbstractCustomNode_1.AbstractCustomNode); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], ExpressionWithOperatorControlFlowStorageCallNode.prototype, "controlFlowStorageKey", void 0); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], ExpressionWithOperatorControlFlowStorageCallNode.prototype, "controlFlowStorageName", void 0); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Object)], ExpressionWithOperatorControlFlowStorageCallNode.prototype, "leftValue", void 0); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Object)], ExpressionWithOperatorControlFlowStorageCallNode.prototype, "rightValue", void 0); - -ExpressionWithOperatorControlFlowStorageCallNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], ExpressionWithOperatorControlFlowStorageCallNode); -exports.ExpressionWithOperatorControlFlowStorageCallNode = ExpressionWithOperatorControlFlowStorageCallNode; - -/***/ }), -/* 121 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var Initializable_1 = __webpack_require__(10); - -var AbstractCustomNode_1 = __webpack_require__(14); - -var Nodes_1 = __webpack_require__(15); - -var NodeUtils_1 = __webpack_require__(9); - -var LogicalExpressionFunctionNode = -/*#__PURE__*/ -function (_AbstractCustomNode_) { - _inherits(LogicalExpressionFunctionNode, _AbstractCustomNode_); - - function LogicalExpressionFunctionNode(identifierNamesGeneratorFactory, randomGenerator, options) { - _classCallCheck(this, LogicalExpressionFunctionNode); - - return _possibleConstructorReturn(this, (LogicalExpressionFunctionNode.__proto__ || _Object$getPrototypeOf(LogicalExpressionFunctionNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); - } - - _createClass(LogicalExpressionFunctionNode, [{ - key: "initialize", - value: function initialize(operator) { - this.operator = operator; - } - }, { - key: "getNodeStructure", - value: function getNodeStructure() { - var structure = Nodes_1.Nodes.getExpressionStatementNode(Nodes_1.Nodes.getFunctionExpressionNode([Nodes_1.Nodes.getIdentifierNode('x'), Nodes_1.Nodes.getIdentifierNode('y')], Nodes_1.Nodes.getBlockStatementNode([Nodes_1.Nodes.getReturnStatementNode(Nodes_1.Nodes.getLogicalExpressionNode(this.operator, Nodes_1.Nodes.getIdentifierNode('x'), Nodes_1.Nodes.getIdentifierNode('y')))]))); - NodeUtils_1.NodeUtils.parentize(structure); - return [structure]; - } - }]); - - return LogicalExpressionFunctionNode; -}(AbstractCustomNode_1.AbstractCustomNode); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], LogicalExpressionFunctionNode.prototype, "operator", void 0); - -LogicalExpressionFunctionNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], LogicalExpressionFunctionNode); -exports.LogicalExpressionFunctionNode = LogicalExpressionFunctionNode; - -/***/ }), -/* 122 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$assign = __webpack_require__(11); - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var string_template_1 = tslib_1.__importDefault(__webpack_require__(19)); - -var ObfuscationEvent_1 = __webpack_require__(25); - -var Initializable_1 = __webpack_require__(10); - -var SingleNodeCallControllerTemplate_1 = __webpack_require__(123); - -var NoCustomNodes_1 = __webpack_require__(39); - -var AbstractCustomNode_1 = __webpack_require__(14); - -var JavaScriptObfuscatorFacade_1 = __webpack_require__(27); - -var NodeUtils_1 = __webpack_require__(9); - -var NodeCallsControllerFunctionNode = -/*#__PURE__*/ -function (_AbstractCustomNode_) { - _inherits(NodeCallsControllerFunctionNode, _AbstractCustomNode_); - - function NodeCallsControllerFunctionNode(identifierNamesGeneratorFactory, randomGenerator, options) { - _classCallCheck(this, NodeCallsControllerFunctionNode); - - return _possibleConstructorReturn(this, (NodeCallsControllerFunctionNode.__proto__ || _Object$getPrototypeOf(NodeCallsControllerFunctionNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); - } - - _createClass(NodeCallsControllerFunctionNode, [{ - key: "initialize", - value: function initialize(appendEvent, callsControllerFunctionName) { - this.appendEvent = appendEvent; - this.callsControllerFunctionName = callsControllerFunctionName; - } - }, { - key: "getNodeStructure", - value: function getNodeStructure() { - return NodeUtils_1.NodeUtils.convertCodeToStructure(this.getTemplate()); - } - }, { - key: "getTemplate", - value: function getTemplate() { - if (this.appendEvent === ObfuscationEvent_1.ObfuscationEvent.AfterObfuscation) { - return JavaScriptObfuscatorFacade_1.JavaScriptObfuscator.obfuscate(string_template_1.default(SingleNodeCallControllerTemplate_1.SingleNodeCallControllerTemplate(), { - singleNodeCallControllerFunctionName: this.callsControllerFunctionName - }), _Object$assign({}, NoCustomNodes_1.NO_ADDITIONAL_NODES_PRESET, { - identifierNamesGenerator: this.options.identifierNamesGenerator, - seed: this.options.seed - })).getObfuscatedCode(); - } - - return string_template_1.default(SingleNodeCallControllerTemplate_1.SingleNodeCallControllerTemplate(), { - singleNodeCallControllerFunctionName: this.callsControllerFunctionName - }); - } - }]); - - return NodeCallsControllerFunctionNode; -}(AbstractCustomNode_1.AbstractCustomNode); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], NodeCallsControllerFunctionNode.prototype, "callsControllerFunctionName", void 0); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], NodeCallsControllerFunctionNode.prototype, "appendEvent", void 0); - -NodeCallsControllerFunctionNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], NodeCallsControllerFunctionNode); -exports.NodeCallsControllerFunctionNode = NodeCallsControllerFunctionNode; - -/***/ }), -/* 123 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -function SingleNodeCallControllerTemplate() { - return "\n var {singleNodeCallControllerFunctionName} = (function(){\n var firstCall = true;\n \n return function (context, fn){\n var rfn = firstCall ? function(){\n if(fn){\n var res = fn.apply(context, arguments);\n fn = null;\n return res;\n }\n } : function(){}\n \n firstCall = false;\n \n return rfn;\n }\n })();\n "; -} - -exports.SingleNodeCallControllerTemplate = SingleNodeCallControllerTemplate; - -/***/ }), -/* 124 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$assign = __webpack_require__(11); - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var string_template_1 = tslib_1.__importDefault(__webpack_require__(19)); - -var Initializable_1 = __webpack_require__(10); - -var NoCustomNodes_1 = __webpack_require__(39); - -var SelfDefendingTemplate_1 = __webpack_require__(125); - -var AbstractCustomNode_1 = __webpack_require__(14); - -var JavaScriptObfuscatorFacade_1 = __webpack_require__(27); - -var NodeUtils_1 = __webpack_require__(9); - -var SelfDefendingUnicodeNode = -/*#__PURE__*/ -function (_AbstractCustomNode_) { - _inherits(SelfDefendingUnicodeNode, _AbstractCustomNode_); - - function SelfDefendingUnicodeNode(identifierNamesGeneratorFactory, randomGenerator, escapeSequenceEncoder, options) { - var _this; - - _classCallCheck(this, SelfDefendingUnicodeNode); - - _this = _possibleConstructorReturn(this, (SelfDefendingUnicodeNode.__proto__ || _Object$getPrototypeOf(SelfDefendingUnicodeNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); - _this.escapeSequenceEncoder = escapeSequenceEncoder; - return _this; - } - - _createClass(SelfDefendingUnicodeNode, [{ - key: "initialize", - value: function initialize(callsControllerFunctionName) { - this.callsControllerFunctionName = callsControllerFunctionName; - } - }, { - key: "getNodeStructure", - value: function getNodeStructure() { - return NodeUtils_1.NodeUtils.convertCodeToStructure(this.getTemplate()); - } - }, { - key: "getTemplate", - value: function getTemplate() { - return JavaScriptObfuscatorFacade_1.JavaScriptObfuscator.obfuscate(string_template_1.default(SelfDefendingTemplate_1.SelfDefendingTemplate(this.escapeSequenceEncoder), { - selfDefendingFunctionName: this.identifierNamesGenerator.generate(), - singleNodeCallControllerFunctionName: this.callsControllerFunctionName - }), _Object$assign({}, NoCustomNodes_1.NO_ADDITIONAL_NODES_PRESET, { - identifierNamesGenerator: this.options.identifierNamesGenerator, - seed: this.options.seed, - unicodeEscapeSequence: true - })).getObfuscatedCode(); - } - }]); - - return SelfDefendingUnicodeNode; -}(AbstractCustomNode_1.AbstractCustomNode); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], SelfDefendingUnicodeNode.prototype, "callsControllerFunctionName", void 0); - -SelfDefendingUnicodeNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IEscapeSequenceEncoder)), tslib_1.__param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object, Object])], SelfDefendingUnicodeNode); -exports.SelfDefendingUnicodeNode = SelfDefendingUnicodeNode; - -/***/ }), -/* 125 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -function SelfDefendingTemplate(escapeSequenceEncoder) { - return "\n var {selfDefendingFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n var func1 = function(){return 'dev';},\n func2 = function () {\n return 'window';\n };\n \n var test1 = function () {\n var regExp = new RegExp('".concat(escapeSequenceEncoder.encode("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}", true), "');\n \n return !regExp.test(func1.toString());\n };\n \n var test2 = function () {\n var regExp = new RegExp('").concat(escapeSequenceEncoder.encode("(\\\\[x|u](\\w){2,4})+", true), "');\n \n return regExp.test(func2.toString());\n };\n \n var recursiveFunc1 = function (string) {\n var i = ~-1 >> 1 + 255 % 0;\n \n if (string.indexOf('i' === i)) {\n recursiveFunc2(string)\n }\n };\n \n var recursiveFunc2 = function (string) {\n var i = ~-4 >> 1 + 255 % 0;\n \n if (string.indexOf((true+\"\")[3]) !== i) {\n recursiveFunc1(string)\n }\n };\n \n if (!test1()) {\n if (!test2()) {\n recursiveFunc1('ind\u0435xOf');\n } else {\n recursiveFunc1('indexOf');\n }\n } else {\n recursiveFunc1('ind\u0435xOf');\n }\n })\n \n {selfDefendingFunctionName}();\n "); -} - -exports.SelfDefendingTemplate = SelfDefendingTemplate; - -/***/ }), -/* 126 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$assign = __webpack_require__(11); - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var string_template_1 = tslib_1.__importDefault(__webpack_require__(19)); - -var ObfuscationTarget_1 = __webpack_require__(21); - -var StringArrayEncoding_1 = __webpack_require__(37); - -var Initializable_1 = __webpack_require__(10); - -var NoCustomNodes_1 = __webpack_require__(39); - -var AtobTemplate_1 = __webpack_require__(127); - -var GlobalVariableNoEvalTemplate_1 = __webpack_require__(44); - -var Rc4Template_1 = __webpack_require__(128); - -var SelfDefendingTemplate_1 = __webpack_require__(129); - -var StringArrayBase64DecodeNodeTemplate_1 = __webpack_require__(130); - -var StringArrayCallsWrapperTemplate_1 = __webpack_require__(131); - -var StringArrayRC4DecodeNodeTemplate_1 = __webpack_require__(132); - -var AbstractCustomNode_1 = __webpack_require__(14); - -var JavaScriptObfuscatorFacade_1 = __webpack_require__(27); - -var NodeUtils_1 = __webpack_require__(9); - -var StringArrayCallsWrapper = -/*#__PURE__*/ -function (_AbstractCustomNode_) { - _inherits(StringArrayCallsWrapper, _AbstractCustomNode_); - - function StringArrayCallsWrapper(identifierNamesGeneratorFactory, randomGenerator, escapeSequenceEncoder, options) { - var _this; - - _classCallCheck(this, StringArrayCallsWrapper); - - _this = _possibleConstructorReturn(this, (StringArrayCallsWrapper.__proto__ || _Object$getPrototypeOf(StringArrayCallsWrapper)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); - _this.escapeSequenceEncoder = escapeSequenceEncoder; - return _this; - } - - _createClass(StringArrayCallsWrapper, [{ - key: "initialize", - value: function initialize(stringArrayName, stringArrayCallsWrapperName) { - this.stringArrayName = stringArrayName; - this.stringArrayCallsWrapperName = stringArrayCallsWrapperName; - } - }, { - key: "getNodeStructure", - value: function getNodeStructure() { - return NodeUtils_1.NodeUtils.convertCodeToStructure(this.getTemplate()); - } - }, { - key: "getTemplate", - value: function getTemplate() { - var decodeNodeTemplate = this.getDecodeStringArrayTemplate(); - return JavaScriptObfuscatorFacade_1.JavaScriptObfuscator.obfuscate(string_template_1.default(StringArrayCallsWrapperTemplate_1.StringArrayCallsWrapperTemplate(), { - decodeNodeTemplate: decodeNodeTemplate, - stringArrayCallsWrapperName: this.stringArrayCallsWrapperName, - stringArrayName: this.stringArrayName - }), _Object$assign({}, NoCustomNodes_1.NO_ADDITIONAL_NODES_PRESET, { - identifierNamesGenerator: this.options.identifierNamesGenerator, - seed: this.options.seed - })).getObfuscatedCode(); - } - }, { - key: "getDecodeStringArrayTemplate", - value: function getDecodeStringArrayTemplate() { - var globalVariableTemplate = this.options.target !== ObfuscationTarget_1.ObfuscationTarget.Extension ? this.getGlobalVariableTemplate() : GlobalVariableNoEvalTemplate_1.GlobalVariableNoEvalTemplate(); - var atobPolyfill = string_template_1.default(AtobTemplate_1.AtobTemplate(), { - globalVariableTemplate: globalVariableTemplate - }); - var decodeStringArrayTemplate = ''; - var selfDefendingCode = ''; - - if (this.options.selfDefending) { - selfDefendingCode = string_template_1.default(SelfDefendingTemplate_1.SelfDefendingTemplate(this.randomGenerator, this.escapeSequenceEncoder), { - stringArrayCallsWrapperName: this.stringArrayCallsWrapperName, - stringArrayName: this.stringArrayName - }); - } - - switch (this.options.stringArrayEncoding) { - case StringArrayEncoding_1.StringArrayEncoding.Rc4: - decodeStringArrayTemplate = string_template_1.default(StringArrayRC4DecodeNodeTemplate_1.StringArrayRc4DecodeNodeTemplate(this.randomGenerator), { - atobPolyfill: atobPolyfill, - rc4Polyfill: Rc4Template_1.Rc4Template(), - selfDefendingCode: selfDefendingCode, - stringArrayCallsWrapperName: this.stringArrayCallsWrapperName - }); - break; - - case StringArrayEncoding_1.StringArrayEncoding.Base64: - decodeStringArrayTemplate = string_template_1.default(StringArrayBase64DecodeNodeTemplate_1.StringArrayBase64DecodeNodeTemplate(this.randomGenerator), { - atobPolyfill: atobPolyfill, - selfDefendingCode: selfDefendingCode, - stringArrayCallsWrapperName: this.stringArrayCallsWrapperName - }); - break; - } - - return decodeStringArrayTemplate; - } - }]); - - return StringArrayCallsWrapper; -}(AbstractCustomNode_1.AbstractCustomNode); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], StringArrayCallsWrapper.prototype, "stringArrayName", void 0); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], StringArrayCallsWrapper.prototype, "stringArrayCallsWrapperName", void 0); - -StringArrayCallsWrapper = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IEscapeSequenceEncoder)), tslib_1.__param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object, Object])], StringArrayCallsWrapper); -exports.StringArrayCallsWrapper = StringArrayCallsWrapper; - -/***/ }), -/* 127 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -function AtobTemplate() { - return "\n (function () {\n {globalVariableTemplate}\n \n var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\n that.atob || (\n that.atob = function(input) {\n var str = String(input).replace(/=+$/, '');\n for (\n var bc = 0, bs, buffer, idx = 0, output = '';\n buffer = str.charAt(idx++);\n ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,\n bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0\n ) {\n buffer = chars.indexOf(buffer);\n }\n return output;\n });\n })();\n "; -} - -exports.AtobTemplate = AtobTemplate; - -/***/ }), -/* 128 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -function Rc4Template() { - return "\n var rc4 = function (str, key) {\n var s = [], j = 0, x, res = '', newStr = '';\n \n str = atob(str);\n \n for (var k = 0, length = str.length; k < length; k++) {\n newStr += '%' + ('00' + str.charCodeAt(k).toString(16)).slice(-2);\n }\n \n str = decodeURIComponent(newStr);\n \t \n\t for (var i = 0; i < 256; i++) {\n s[i] = i;\n }\n \n for (i = 0; i < 256; i++) {\n j = (j + s[i] + key.charCodeAt(i % key.length)) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n }\n \n i = 0;\n j = 0;\n \n for (var y = 0; y < str.length; y++) {\n i = (i + 1) % 256;\n j = (j + s[i]) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n res += String.fromCharCode(str.charCodeAt(y) ^ s[(s[i] + s[j]) % 256]);\n }\n \n return res;\n }\n "; -} - -exports.Rc4Template = Rc4Template; - -/***/ }), -/* 129 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -function SelfDefendingTemplate(randomGenerator, escapeSequenceEncoder) { - var identifierLength = 6; - var rc4BytesIdentifier = randomGenerator.getRandomString(identifierLength); - var statesIdentifier = randomGenerator.getRandomString(identifierLength); - var newStateIdentifier = randomGenerator.getRandomString(identifierLength); - var firstStateIdentifier = randomGenerator.getRandomString(identifierLength); - var secondStateIdentifier = randomGenerator.getRandomString(identifierLength); - var checkStateIdentifier = randomGenerator.getRandomString(identifierLength); - var runStateIdentifier = randomGenerator.getRandomString(identifierLength); - var getStateIdentifier = randomGenerator.getRandomString(identifierLength); - var stateResultIdentifier = randomGenerator.getRandomString(identifierLength); - return "\n var StatesClass = function (".concat(rc4BytesIdentifier, ") {\n this.").concat(rc4BytesIdentifier, " = ").concat(rc4BytesIdentifier, ";\n this.").concat(statesIdentifier, " = [1, 0, 0];\n this.").concat(newStateIdentifier, " = function(){return 'newState';};\n this.").concat(firstStateIdentifier, " = '").concat(escapeSequenceEncoder.encode("\\w+ *\\(\\) *{\\w+ *", true), "';\n this.").concat(secondStateIdentifier, " = '").concat(escapeSequenceEncoder.encode("['|\"].+['|\"];? *}", true), "';\n };\n \n StatesClass.prototype.").concat(checkStateIdentifier, " = function () {\n var regExp = new RegExp(this.").concat(firstStateIdentifier, " + this.").concat(secondStateIdentifier, ");\n var expression = regExp.test(this.").concat(newStateIdentifier, ".toString())\n ? --this.").concat(statesIdentifier, "[1]\n : --this.").concat(statesIdentifier, "[0];\n \n return this.").concat(runStateIdentifier, "(expression);\n };\n \n StatesClass.prototype.").concat(runStateIdentifier, " = function (").concat(stateResultIdentifier, ") {\n if (!Boolean(~").concat(stateResultIdentifier, ")) {\n return ").concat(stateResultIdentifier, ";\n }\n \n return this.").concat(getStateIdentifier, "(this.").concat(rc4BytesIdentifier, ");\n };\n\n StatesClass.prototype.").concat(getStateIdentifier, " = function (").concat(rc4BytesIdentifier, ") {\n for (var i = 0, len = this.").concat(statesIdentifier, ".length; i < len; i++) {\n this.").concat(statesIdentifier, ".push(Math.round(Math.random()));\n len = this.").concat(statesIdentifier, ".length;\n }\n \n return ").concat(rc4BytesIdentifier, "(this.").concat(statesIdentifier, "[0]);\n };\n\n new StatesClass({stringArrayCallsWrapperName}).").concat(checkStateIdentifier, "();\n "); -} - -exports.SelfDefendingTemplate = SelfDefendingTemplate; - -/***/ }), -/* 130 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -function StringArrayBase64DecodeNodeTemplate(randomGenerator) { - var identifierLength = 6; - var initializedIdentifier = randomGenerator.getRandomString(identifierLength); - var base64DecodeFunctionIdentifier = randomGenerator.getRandomString(identifierLength); - var dataIdentifier = randomGenerator.getRandomString(identifierLength); - return "\n if ({stringArrayCallsWrapperName}.".concat(initializedIdentifier, " === undefined) {\n {atobPolyfill}\n \n {stringArrayCallsWrapperName}.").concat(base64DecodeFunctionIdentifier, " = function (str) {\n var string = atob(str);\n var newStringChars = [];\n \n for (var i = 0, length = string.length; i < length; i++) {\n newStringChars += '%' + ('00' + string.charCodeAt(i).toString(16)).slice(-2);\n }\n \n return decodeURIComponent(newStringChars);\n };\n \n {stringArrayCallsWrapperName}.").concat(dataIdentifier, " = {};\n \n {stringArrayCallsWrapperName}.").concat(initializedIdentifier, " = true;\n }\n \n var cachedValue = {stringArrayCallsWrapperName}.").concat(dataIdentifier, "[index];\n \n if (cachedValue === undefined) {\n {selfDefendingCode}\n \n value = {stringArrayCallsWrapperName}.").concat(base64DecodeFunctionIdentifier, "(value);\n {stringArrayCallsWrapperName}.").concat(dataIdentifier, "[index] = value;\n } else {\n value = cachedValue;\n }\n "); -} - -exports.StringArrayBase64DecodeNodeTemplate = StringArrayBase64DecodeNodeTemplate; - -/***/ }), -/* 131 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -function StringArrayCallsWrapperTemplate() { - return "\n var {stringArrayCallsWrapperName} = function (index, key) {\n index = index - 0;\n \n var value = {stringArrayName}[index];\n \n {decodeNodeTemplate}\n \n return value;\n };\n "; -} - -exports.StringArrayCallsWrapperTemplate = StringArrayCallsWrapperTemplate; - -/***/ }), -/* 132 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -function StringArrayRc4DecodeNodeTemplate(randomGenerator) { - var identifierLength = 6; - var initializedIdentifier = randomGenerator.getRandomString(identifierLength); - var rc4Identifier = randomGenerator.getRandomString(identifierLength); - var dataIdentifier = randomGenerator.getRandomString(identifierLength); - var onceIdentifier = randomGenerator.getRandomString(identifierLength); - return "\n if ({stringArrayCallsWrapperName}.".concat(initializedIdentifier, " === undefined) {\n {atobPolyfill}\n \n {rc4Polyfill}\n {stringArrayCallsWrapperName}.").concat(rc4Identifier, " = rc4;\n \n {stringArrayCallsWrapperName}.").concat(dataIdentifier, " = {};\n \n {stringArrayCallsWrapperName}.").concat(initializedIdentifier, " = true;\n }\n \n var cachedValue = {stringArrayCallsWrapperName}.").concat(dataIdentifier, "[index];\n\n if (cachedValue === undefined) {\n if ({stringArrayCallsWrapperName}.").concat(onceIdentifier, " === undefined) {\n {selfDefendingCode}\n \n {stringArrayCallsWrapperName}.").concat(onceIdentifier, " = true;\n }\n \n value = {stringArrayCallsWrapperName}.").concat(rc4Identifier, "(value, key);\n {stringArrayCallsWrapperName}.").concat(dataIdentifier, "[index] = value;\n } else {\n value = cachedValue;\n }\n "); -} - -exports.StringArrayRc4DecodeNodeTemplate = StringArrayRc4DecodeNodeTemplate; - -/***/ }), -/* 133 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _get = __webpack_require__(45); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var string_template_1 = tslib_1.__importDefault(__webpack_require__(19)); - -var Initializable_1 = __webpack_require__(10); - -var StringArrayTemplate_1 = __webpack_require__(134); - -var AbstractCustomNode_1 = __webpack_require__(14); - -var NodeUtils_1 = __webpack_require__(9); - -var StringArrayNode = -/*#__PURE__*/ -function (_AbstractCustomNode_) { - _inherits(StringArrayNode, _AbstractCustomNode_); - - function StringArrayNode(identifierNamesGeneratorFactory, randomGenerator, options) { - _classCallCheck(this, StringArrayNode); - - return _possibleConstructorReturn(this, (StringArrayNode.__proto__ || _Object$getPrototypeOf(StringArrayNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); - } - - _createClass(StringArrayNode, [{ - key: "initialize", - value: function initialize(stringArrayStorage, stringArrayName, stringArrayRotateValue) { - this.stringArrayStorage = stringArrayStorage; - this.stringArrayName = stringArrayName; - this.stringArrayRotateValue = stringArrayRotateValue; - } - }, { - key: "getNode", - value: function getNode() { - this.stringArrayStorage.rotateArray(this.stringArrayRotateValue); - return _get(StringArrayNode.prototype.__proto__ || _Object$getPrototypeOf(StringArrayNode.prototype), "getNode", this).call(this); - } - }, { - key: "getNodeStructure", - value: function getNodeStructure() { - return NodeUtils_1.NodeUtils.convertCodeToStructure(this.getTemplate()); - } - }, { - key: "getTemplate", - value: function getTemplate() { - return string_template_1.default(StringArrayTemplate_1.StringArrayTemplate(), { - stringArrayName: this.stringArrayName, - stringArray: this.stringArrayStorage.toString() - }); - } - }]); - - return StringArrayNode; -}(AbstractCustomNode_1.AbstractCustomNode); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Object)], StringArrayNode.prototype, "stringArrayStorage", void 0); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], StringArrayNode.prototype, "stringArrayName", void 0); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Number)], StringArrayNode.prototype, "stringArrayRotateValue", void 0); - -StringArrayNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], StringArrayNode); -exports.StringArrayNode = StringArrayNode; - -/***/ }), -/* 134 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -function StringArrayTemplate() { - return "\n var {stringArrayName} = [{stringArray}];\n "; -} - -exports.StringArrayTemplate = StringArrayTemplate; - -/***/ }), -/* 135 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$assign = __webpack_require__(11); - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var string_template_1 = tslib_1.__importDefault(__webpack_require__(19)); - -var Initializable_1 = __webpack_require__(10); - -var NoCustomNodes_1 = __webpack_require__(39); - -var SelfDefendingTemplate_1 = __webpack_require__(136); - -var StringArrayRotateFunctionTemplate_1 = __webpack_require__(137); - -var AbstractCustomNode_1 = __webpack_require__(14); - -var JavaScriptObfuscatorFacade_1 = __webpack_require__(27); - -var NodeUtils_1 = __webpack_require__(9); - -var Utils_1 = __webpack_require__(32); - -var StringArrayRotateFunctionNode = -/*#__PURE__*/ -function (_AbstractCustomNode_) { - _inherits(StringArrayRotateFunctionNode, _AbstractCustomNode_); - - function StringArrayRotateFunctionNode(identifierNamesGeneratorFactory, randomGenerator, escapeSequenceEncoder, options) { - var _this; - - _classCallCheck(this, StringArrayRotateFunctionNode); - - _this = _possibleConstructorReturn(this, (StringArrayRotateFunctionNode.__proto__ || _Object$getPrototypeOf(StringArrayRotateFunctionNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); - _this.escapeSequenceEncoder = escapeSequenceEncoder; - return _this; - } - - _createClass(StringArrayRotateFunctionNode, [{ - key: "initialize", - value: function initialize(stringArrayName, stringArrayRotateValue) { - this.stringArrayName = stringArrayName; - this.stringArrayRotateValue = stringArrayRotateValue; - } - }, { - key: "getNodeStructure", - value: function getNodeStructure() { - return NodeUtils_1.NodeUtils.convertCodeToStructure(this.getTemplate()); - } - }, { - key: "getTemplate", - value: function getTemplate() { - var timesName = this.identifierNamesGenerator.generate(); - var whileFunctionName = this.identifierNamesGenerator.generate(); - var code = ''; - - if (this.options.selfDefending) { - code = string_template_1.default(SelfDefendingTemplate_1.SelfDefendingTemplate(this.escapeSequenceEncoder), { - timesName: timesName, - whileFunctionName: whileFunctionName - }); - } else { - code = "".concat(whileFunctionName, "(++").concat(timesName, ")"); - } - - return JavaScriptObfuscatorFacade_1.JavaScriptObfuscator.obfuscate(string_template_1.default(StringArrayRotateFunctionTemplate_1.StringArrayRotateFunctionTemplate(), { - code: code, - timesName: timesName, - stringArrayName: this.stringArrayName, - stringArrayRotateValue: Utils_1.Utils.decToHex(this.stringArrayRotateValue), - whileFunctionName: whileFunctionName - }), _Object$assign({}, NoCustomNodes_1.NO_ADDITIONAL_NODES_PRESET, { - identifierNamesGenerator: this.options.identifierNamesGenerator, - seed: this.options.seed - })).getObfuscatedCode(); - } - }]); - - return StringArrayRotateFunctionNode; -}(AbstractCustomNode_1.AbstractCustomNode); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], StringArrayRotateFunctionNode.prototype, "stringArrayName", void 0); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Number)], StringArrayRotateFunctionNode.prototype, "stringArrayRotateValue", void 0); - -StringArrayRotateFunctionNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IEscapeSequenceEncoder)), tslib_1.__param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object, Object])], StringArrayRotateFunctionNode); -exports.StringArrayRotateFunctionNode = StringArrayRotateFunctionNode; - -/***/ }), -/* 136 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -function SelfDefendingTemplate(escapeSequenceEncoder) { - return "\n var selfDefendingFunc = function () {\n var object = {\n data: {\n key: 'cookie',\n value: 'timeout'\n },\n setCookie: function (options, name, value, document) {\n document = document || {};\n \n var updatedCookie = name + \"=\" + value;\n\n var i = 0;\n \n for (var i = 0, len = options.length; i < len; i++) {\n var propName = options[i];\n \n updatedCookie += \"; \" + propName;\n \n var propValue = options[propName];\n \n options.push(propValue);\n len = options.length;\n \n if (propValue !== true) {\n updatedCookie += \"=\" + propValue;\n }\n }\n\n document['cookie'] = updatedCookie;\n },\n removeCookie: function(){return 'dev';},\n getCookie: function (document, name) {\n document = document || function (value) { return value };\n var matches = document(new RegExp(\n \"(?:^|; )\" + name.replace(/([.$?*|{}()[]\\/+^])/g, '\\$1') + \"=([^;]*)\"\n ));\n \n var func = function (param1, param2) {\n param1(++param2);\n };\n \n func({whileFunctionName}, {timesName});\n \n return matches ? decodeURIComponent(matches[1]) : undefined;\n }\n };\n \n var test1 = function () {\n var regExp = new RegExp('".concat(escapeSequenceEncoder.encode("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}", true), "');\n \n return regExp.test(object.removeCookie.toString());\n };\n \n object['updateCookie'] = test1;\n \n var cookie = '';\n var result = object['updateCookie']();\n \n if (!result) {\n object['setCookie'](['*'], 'counter', 1);\n } else if (result) {\n cookie = object['getCookie'](null, 'counter');\n } else {\n object['removeCookie']();\n }\n };\n \n selfDefendingFunc();\n "); -} - -exports.SelfDefendingTemplate = SelfDefendingTemplate; - -/***/ }), -/* 137 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -function StringArrayRotateFunctionTemplate() { - return "\n (function (array, {timesName}) {\n var {whileFunctionName} = function (times) {\n while (--times) {\n array['push'](array['shift']());\n }\n };\n \n {code}\n })({stringArrayName}, 0x{stringArrayRotateValue});\n "; -} - -exports.StringArrayRotateFunctionTemplate = StringArrayRotateFunctionTemplate; - -/***/ }), -/* 138 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var JSFuck; - -(function (JSFuck) { - JSFuck["False"] = "![]"; - JSFuck["True"] = "!![]"; - JSFuck["a"] = "(false+\"\")[1]"; - JSFuck["b"] = "([][\"entries\"]()+\"\")[2]"; - JSFuck["c"] = "([][\"fill\"]+\"\")[3]"; - JSFuck["d"] = "(undefined+\"\")[2]"; - JSFuck["e"] = "(true+\"\")[3]"; - JSFuck["f"] = "(false+\"\")[0]"; - JSFuck["g"] = "(false+[0]+String)[20]"; - JSFuck["h"] = "(+(101))[\"toString\"](21)[1]"; - JSFuck["i"] = "([false]+undefined)[10]"; - JSFuck["j"] = "([][\"entries\"]()+\"\")[3]"; - JSFuck["k"] = "(+(20))[\"toString\"](21)"; - JSFuck["l"] = "(false+\"\")[2]"; - JSFuck["m"] = "(Number+\"\")[11]"; - JSFuck["n"] = "(undefined+\"\")[1]"; - JSFuck["o"] = "(true+[][\"fill\"])[10]"; - JSFuck["p"] = "(+(211))[\"toString\"](31)[1]"; - JSFuck["q"] = "(+(212))[\"toString\"](31)[1]"; - JSFuck["r"] = "(true+\"\")[1]"; - JSFuck["s"] = "(false+\"\")[3]"; - JSFuck["t"] = "(true+\"\")[0]"; - JSFuck["u"] = "(undefined+\"\")[0]"; - JSFuck["v"] = "(+(31))[\"toString\"](32)"; - JSFuck["w"] = "(+(32))[\"toString\"](33)"; - JSFuck["x"] = "(+(101))[\"toString\"](34)[1]"; - JSFuck["y"] = "(NaN+[Infinity])[10]"; - JSFuck["z"] = "(+(35))[\"toString\"](36)"; - JSFuck["A"] = "(+[]+Array)[10]"; - JSFuck["B"] = "(+[]+Boolean)[10]"; - JSFuck["C"] = "Function(\"return escape\")()((\"\")[\"italics\"]())[2]"; - JSFuck["D"] = "Function(\"return escape\")()([][\"fill\"])[\"slice\"](\"-1\")"; - JSFuck["E"] = "(RegExp+\"\")[12]"; - JSFuck["F"] = "(+[]+Function)[10]"; - JSFuck["G"] = "(false+Function(\"return Date\")()())[30]"; - JSFuck["H"] = "'H'"; - JSFuck["I"] = "(Infinity+\"\")[0]"; - JSFuck["J"] = "'J'"; - JSFuck["K"] = "'K'"; - JSFuck["L"] = "'L'"; - JSFuck["M"] = "(true+Function(\"return Date\")()())[30]"; - JSFuck["N"] = "(NaN+\"\")[0]"; - JSFuck["O"] = "(NaN+Function(\"return{}\")())[11]"; - JSFuck["P"] = "'P'"; - JSFuck["Q"] = "'Q'"; - JSFuck["R"] = "(+[]+RegExp)[10]"; - JSFuck["S"] = "(+[]+String)[10]"; - JSFuck["T"] = "(NaN+Function(\"return Date\")()())[30]"; - JSFuck["U"] = "(NaN+Function(\"return{}\")()[\"toString\"][\"call\"]())[11]"; - JSFuck["V"] = "'V'"; - JSFuck["W"] = "'W'"; - JSFuck["X"] = "'X'"; - JSFuck["Y"] = "'Y'"; - JSFuck["Z"] = "'Z'"; -})(JSFuck = exports.JSFuck || (exports.JSFuck = {})); - -/***/ }), -/* 139 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var Initializable_1 = __webpack_require__(10); - -var AbstractCustomNode_1 = __webpack_require__(14); - -var Nodes_1 = __webpack_require__(15); - -var NodeUtils_1 = __webpack_require__(9); - -var StringLiteralControlFlowStorageCallNode = -/*#__PURE__*/ -function (_AbstractCustomNode_) { - _inherits(StringLiteralControlFlowStorageCallNode, _AbstractCustomNode_); - - function StringLiteralControlFlowStorageCallNode(identifierNamesGeneratorFactory, randomGenerator, options) { - _classCallCheck(this, StringLiteralControlFlowStorageCallNode); - - return _possibleConstructorReturn(this, (StringLiteralControlFlowStorageCallNode.__proto__ || _Object$getPrototypeOf(StringLiteralControlFlowStorageCallNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); - } - - _createClass(StringLiteralControlFlowStorageCallNode, [{ - key: "initialize", - value: function initialize(controlFlowStorageName, controlFlowStorageKey) { - this.controlFlowStorageName = controlFlowStorageName; - this.controlFlowStorageKey = controlFlowStorageKey; - } - }, { - key: "getNodeStructure", - value: function getNodeStructure() { - var structure = Nodes_1.Nodes.getExpressionStatementNode(Nodes_1.Nodes.getMemberExpressionNode(Nodes_1.Nodes.getIdentifierNode(this.controlFlowStorageName), Nodes_1.Nodes.getIdentifierNode(this.controlFlowStorageKey))); - NodeUtils_1.NodeUtils.parentize(structure); - return [structure]; - } - }]); - - return StringLiteralControlFlowStorageCallNode; -}(AbstractCustomNode_1.AbstractCustomNode); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], StringLiteralControlFlowStorageCallNode.prototype, "controlFlowStorageKey", void 0); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], StringLiteralControlFlowStorageCallNode.prototype, "controlFlowStorageName", void 0); - -StringLiteralControlFlowStorageCallNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], StringLiteralControlFlowStorageCallNode); -exports.StringLiteralControlFlowStorageCallNode = StringLiteralControlFlowStorageCallNode; - -/***/ }), -/* 140 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var Initializable_1 = __webpack_require__(10); - -var AbstractCustomNode_1 = __webpack_require__(14); - -var Nodes_1 = __webpack_require__(15); - -var StringLiteralNode = -/*#__PURE__*/ -function (_AbstractCustomNode_) { - _inherits(StringLiteralNode, _AbstractCustomNode_); - - function StringLiteralNode(identifierNamesGeneratorFactory, randomGenerator, options) { - _classCallCheck(this, StringLiteralNode); - - return _possibleConstructorReturn(this, (StringLiteralNode.__proto__ || _Object$getPrototypeOf(StringLiteralNode)).call(this, identifierNamesGeneratorFactory, randomGenerator, options)); - } - - _createClass(StringLiteralNode, [{ - key: "initialize", - value: function initialize(literalValue) { - this.literalValue = literalValue; - } - }, { - key: "getNodeStructure", - value: function getNodeStructure() { - var structure = Nodes_1.Nodes.getExpressionStatementNode(Nodes_1.Nodes.getLiteralNode(this.literalValue)); - return [structure]; - } - }]); - - return StringLiteralNode; -}(AbstractCustomNode_1.AbstractCustomNode); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], StringLiteralNode.prototype, "literalValue", void 0); - -StringLiteralNode = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], StringLiteralNode); -exports.StringLiteralNode = StringLiteralNode; - -/***/ }), -/* 141 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var inversify_1 = __webpack_require__(1); - -exports.finalizingTransformersModule = new inversify_1.ContainerModule(function (bind) {}); - -/***/ }), -/* 142 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var IdentifierNamesGenerator_1 = __webpack_require__(35); - -var HexadecimalIdentifierNamesGenerator_1 = __webpack_require__(143); - -var MangledIdentifierNamesGenerator_1 = __webpack_require__(144); - -exports.generatorsModule = new inversify_1.ContainerModule(function (bind) { - bind(ServiceIdentifiers_1.ServiceIdentifiers.IIdentifierNamesGenerator).to(HexadecimalIdentifierNamesGenerator_1.HexadecimalIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(IdentifierNamesGenerator_1.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator); - bind(ServiceIdentifiers_1.ServiceIdentifiers.IIdentifierNamesGenerator).to(MangledIdentifierNamesGenerator_1.MangledIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(IdentifierNamesGenerator_1.IdentifierNamesGenerator.MangledIdentifierNamesGenerator); - bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator).toFactory(function (context) { - var cachedIdentifierNamesGenerator = null; - return function (options) { - if (cachedIdentifierNamesGenerator) { - return cachedIdentifierNamesGenerator; - } - - var identifierNamesGenerator; - - switch (options.identifierNamesGenerator) { - case IdentifierNamesGenerator_1.IdentifierNamesGenerator.MangledIdentifierNamesGenerator: - identifierNamesGenerator = context.container.getNamed(ServiceIdentifiers_1.ServiceIdentifiers.IIdentifierNamesGenerator, IdentifierNamesGenerator_1.IdentifierNamesGenerator.MangledIdentifierNamesGenerator); - break; - - case IdentifierNamesGenerator_1.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator: - default: - identifierNamesGenerator = context.container.getNamed(ServiceIdentifiers_1.ServiceIdentifiers.IIdentifierNamesGenerator, IdentifierNamesGenerator_1.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator); - } - - cachedIdentifierNamesGenerator = identifierNamesGenerator; - return identifierNamesGenerator; - }; - }); -}); - -/***/ }), -/* 143 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Set = __webpack_require__(29); - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var AbstractIdentifierNamesGenerator_1 = __webpack_require__(58); - -var Utils_1 = __webpack_require__(32); - -var HexadecimalIdentifierNamesGenerator = HexadecimalIdentifierNamesGenerator_1 = -/*#__PURE__*/ -function (_AbstractIdentifierNa) { - _inherits(HexadecimalIdentifierNamesGenerator, _AbstractIdentifierNa); - - function HexadecimalIdentifierNamesGenerator(randomGenerator, options) { - var _this; - - _classCallCheck(this, HexadecimalIdentifierNamesGenerator); - - _this = _possibleConstructorReturn(this, (HexadecimalIdentifierNamesGenerator.__proto__ || _Object$getPrototypeOf(HexadecimalIdentifierNamesGenerator)).call(this, randomGenerator, options)); - _this.randomVariableNameSet = new _Set(); - return _this; - } - - _createClass(HexadecimalIdentifierNamesGenerator, [{ - key: "generate", - value: function generate() { - var rangeMinInteger = 10000; - var rangeMaxInteger = 99999999; - var randomInteger = this.randomGenerator.getRandomInteger(rangeMinInteger, rangeMaxInteger); - var hexadecimalNumber = Utils_1.Utils.decToHex(randomInteger); - var baseIdentifierName = hexadecimalNumber.substr(0, HexadecimalIdentifierNamesGenerator_1.baseIdentifierNameLength); - var identifierName = "_".concat(Utils_1.Utils.hexadecimalPrefix).concat(baseIdentifierName); - - if (this.randomVariableNameSet.has(identifierName)) { - return this.generate(); - } - - this.randomVariableNameSet.add(identifierName); - return identifierName; - } - }, { - key: "generateWithPrefix", - value: function generateWithPrefix() { - var identifierName = this.generate(); - return "".concat(this.options.identifiersPrefix).concat(identifierName).replace('__', '_'); - } - }]); - - return HexadecimalIdentifierNamesGenerator; -}(AbstractIdentifierNamesGenerator_1.AbstractIdentifierNamesGenerator); - -HexadecimalIdentifierNamesGenerator.baseIdentifierNameLength = 6; -HexadecimalIdentifierNamesGenerator = HexadecimalIdentifierNamesGenerator_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object])], HexadecimalIdentifierNamesGenerator); -exports.HexadecimalIdentifierNamesGenerator = HexadecimalIdentifierNamesGenerator; -var HexadecimalIdentifierNamesGenerator_1; - -/***/ }), -/* 144 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var AbstractIdentifierNamesGenerator_1 = __webpack_require__(58); - -var MangledIdentifierNamesGenerator = MangledIdentifierNamesGenerator_1 = -/*#__PURE__*/ -function (_AbstractIdentifierNa) { - _inherits(MangledIdentifierNamesGenerator, _AbstractIdentifierNa); - - function MangledIdentifierNamesGenerator(randomGenerator, options) { - var _this; - - _classCallCheck(this, MangledIdentifierNamesGenerator); - - _this = _possibleConstructorReturn(this, (MangledIdentifierNamesGenerator.__proto__ || _Object$getPrototypeOf(MangledIdentifierNamesGenerator)).call(this, randomGenerator, options)); - _this.previousMangledName = MangledIdentifierNamesGenerator_1.initMangledNameCharacter; - return _this; - } - - _createClass(MangledIdentifierNamesGenerator, [{ - key: "generate", - value: function generate() { - var identifierName = MangledIdentifierNamesGenerator_1.generateNewMangledName(this.previousMangledName); - this.previousMangledName = identifierName; - return identifierName; - } - }, { - key: "generateWithPrefix", - value: function generateWithPrefix() { - var prefix = this.options.identifiersPrefix ? "".concat(this.options.identifiersPrefix, "_") : ''; - var identifierName = this.generate(); - return "".concat(prefix).concat(identifierName); - } - }], [{ - key: "generateNewMangledName", - value: function generateNewMangledName(previousMangledName) { - var generateNewMangledName = function generateNewMangledName(name) { - var nameSequence = MangledIdentifierNamesGenerator_1.nameSequence; - var nameLength = name.length; - - var zeroSequence = function zeroSequence(num) { - return '0'.repeat(num); - }; - - var index = nameLength - 1; - - do { - var character = name.charAt(index); - var indexInSequence = nameSequence.indexOf(character); - var lastNameSequenceIndex = nameSequence.length - 1; - - if (indexInSequence !== lastNameSequenceIndex) { - var previousNamePart = name.substring(0, index); - var nextCharacter = nameSequence[indexInSequence + 1]; - var zeroSequenceLength = nameLength - (index + 1); - var zeroSequenceCharacters = zeroSequence(zeroSequenceLength); - return previousNamePart + nextCharacter + zeroSequenceCharacters; - } - - --index; - } while (index >= 0); - - return "a".concat(zeroSequence(nameLength)); - }; - - var newMangledName = generateNewMangledName(previousMangledName); - - if (!MangledIdentifierNamesGenerator_1.validateMangledName(newMangledName)) { - newMangledName = MangledIdentifierNamesGenerator_1.generateNewMangledName(newMangledName); - } - - return newMangledName; - } - }, { - key: "validateMangledName", - value: function validateMangledName(mangledName) { - return !MangledIdentifierNamesGenerator_1.reservedNames.includes(mangledName); - } - }]); - - return MangledIdentifierNamesGenerator; -}(AbstractIdentifierNamesGenerator_1.AbstractIdentifierNamesGenerator); - -MangledIdentifierNamesGenerator.initMangledNameCharacter = '9'; -MangledIdentifierNamesGenerator.nameSequence = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split(''); -MangledIdentifierNamesGenerator.reservedNames = ['byte', 'case', 'char', 'do', 'else', 'enum', 'eval', 'for', 'goto', 'if', 'in', 'int', 'let', 'long', 'new', 'null', 'this', 'true', 'try', 'var', 'void', 'with']; -MangledIdentifierNamesGenerator = MangledIdentifierNamesGenerator_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object])], MangledIdentifierNamesGenerator); -exports.MangledIdentifierNamesGenerator = MangledIdentifierNamesGenerator; -var MangledIdentifierNamesGenerator_1; - -/***/ }), -/* 145 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var InversifyContainerFacade_1 = __webpack_require__(22); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -exports.nodeTransformersModule = new inversify_1.ContainerModule(function (bind) { - bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__INodeTransformer).toFactory(InversifyContainerFacade_1.InversifyContainerFacade.getCacheFactory(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer)); -}); - -/***/ }), -/* 146 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var InversifyContainerFacade_1 = __webpack_require__(22); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var IdentifierObfuscatingReplacer_1 = __webpack_require__(26); - -var LiteralObfuscatingReplacer_1 = __webpack_require__(59); - -var NodeTransformer_1 = __webpack_require__(28); - -var BaseIdentifierObfuscatingReplacer_1 = __webpack_require__(147); - -var BooleanLiteralObfuscatingReplacer_1 = __webpack_require__(148); - -var CatchClauseTransformer_1 = __webpack_require__(149); - -var ClassDeclarationTransformer_1 = __webpack_require__(150); - -var FunctionDeclarationTransformer_1 = __webpack_require__(151); - -var FunctionTransformer_1 = __webpack_require__(152); - -var LabeledStatementTransformer_1 = __webpack_require__(153); - -var LiteralTransformer_1 = __webpack_require__(154); - -var NumberLiteralObfuscatingReplacer_1 = __webpack_require__(155); - -var ObjectExpressionTransformer_1 = __webpack_require__(156); - -var StringLiteralObfuscatingReplacer_1 = __webpack_require__(157); - -var VariableDeclarationTransformer_1 = __webpack_require__(158); - -exports.obfuscatingTransformersModule = new inversify_1.ContainerModule(function (bind) { - bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(CatchClauseTransformer_1.CatchClauseTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.CatchClauseTransformer); - bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(ClassDeclarationTransformer_1.ClassDeclarationTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.ClassDeclarationTransformer); - bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(FunctionDeclarationTransformer_1.FunctionDeclarationTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.FunctionDeclarationTransformer); - bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(FunctionTransformer_1.FunctionTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.FunctionTransformer); - bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(LabeledStatementTransformer_1.LabeledStatementTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.LabeledStatementTransformer); - bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(LiteralTransformer_1.LiteralTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.LiteralTransformer); - bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(ObjectExpressionTransformer_1.ObjectExpressionTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.ObjectExpressionTransformer); - bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(VariableDeclarationTransformer_1.VariableDeclarationTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.VariableDeclarationTransformer); - bind(ServiceIdentifiers_1.ServiceIdentifiers.IObfuscatingReplacer).to(BooleanLiteralObfuscatingReplacer_1.BooleanLiteralObfuscatingReplacer).whenTargetNamed(LiteralObfuscatingReplacer_1.LiteralObfuscatingReplacer.BooleanLiteralObfuscatingReplacer); - bind(ServiceIdentifiers_1.ServiceIdentifiers.IObfuscatingReplacer).to(NumberLiteralObfuscatingReplacer_1.NumberLiteralObfuscatingReplacer).whenTargetNamed(LiteralObfuscatingReplacer_1.LiteralObfuscatingReplacer.NumberLiteralObfuscatingReplacer); - bind(ServiceIdentifiers_1.ServiceIdentifiers.IObfuscatingReplacer).to(StringLiteralObfuscatingReplacer_1.StringLiteralObfuscatingReplacer).whenTargetNamed(LiteralObfuscatingReplacer_1.LiteralObfuscatingReplacer.StringLiteralObfuscatingReplacer); - bind(ServiceIdentifiers_1.ServiceIdentifiers.IIdentifierObfuscatingReplacer).to(BaseIdentifierObfuscatingReplacer_1.BaseIdentifierObfuscatingReplacer).whenTargetNamed(IdentifierObfuscatingReplacer_1.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer); - bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IObfuscatingReplacer).toFactory(InversifyContainerFacade_1.InversifyContainerFacade.getCacheFactory(ServiceIdentifiers_1.ServiceIdentifiers.IObfuscatingReplacer)); - bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer).toFactory(InversifyContainerFacade_1.InversifyContainerFacade.getCacheFactory(ServiceIdentifiers_1.ServiceIdentifiers.IIdentifierObfuscatingReplacer)); -}); - -/***/ }), -/* 147 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Map = __webpack_require__(16); - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var AbstractObfuscatingReplacer_1 = __webpack_require__(40); - -var Nodes_1 = __webpack_require__(15); - -var BaseIdentifierObfuscatingReplacer = -/*#__PURE__*/ -function (_AbstractObfuscatingR) { - _inherits(BaseIdentifierObfuscatingReplacer, _AbstractObfuscatingR); - - function BaseIdentifierObfuscatingReplacer(identifierNamesGeneratorFactory, options) { - var _this; - - _classCallCheck(this, BaseIdentifierObfuscatingReplacer); - - _this = _possibleConstructorReturn(this, (BaseIdentifierObfuscatingReplacer.__proto__ || _Object$getPrototypeOf(BaseIdentifierObfuscatingReplacer)).call(this, options)); - _this.namesMap = new _Map(); - _this.identifierNamesGenerator = identifierNamesGeneratorFactory(options); - return _this; - } - - _createClass(BaseIdentifierObfuscatingReplacer, [{ - key: "replace", - value: function replace(nodeValue, nodeIdentifier) { - var mapKey = "".concat(nodeValue, "-").concat(String(nodeIdentifier)); - - if (this.namesMap.has(mapKey)) { - nodeValue = this.namesMap.get(mapKey); - } - - return Nodes_1.Nodes.getIdentifierNode(nodeValue); - } - }, { - key: "storeGlobalName", - value: function storeGlobalName(nodeName, nodeIdentifier) { - if (this.isReservedName(nodeName)) { - return; - } - - var identifierName = this.identifierNamesGenerator.generateWithPrefix(); - this.namesMap.set("".concat(nodeName, "-").concat(String(nodeIdentifier)), identifierName); - } - }, { - key: "storeLocalName", - value: function storeLocalName(nodeName, nodeIdentifier) { - if (this.isReservedName(nodeName)) { - return; - } - - var identifierName = this.identifierNamesGenerator.generate(); - this.namesMap.set("".concat(nodeName, "-").concat(String(nodeIdentifier)), identifierName); - } - }, { - key: "isReservedName", - value: function isReservedName(name) { - return this.options.reservedNames.some(function (reservedName) { - return new RegExp(reservedName, 'g').exec(name) !== null; - }); - } - }]); - - return BaseIdentifierObfuscatingReplacer; -}(AbstractObfuscatingReplacer_1.AbstractObfuscatingReplacer); - -BaseIdentifierObfuscatingReplacer = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object])], BaseIdentifierObfuscatingReplacer); -exports.BaseIdentifierObfuscatingReplacer = BaseIdentifierObfuscatingReplacer; - -/***/ }), -/* 148 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var AbstractObfuscatingReplacer_1 = __webpack_require__(40); - -var Nodes_1 = __webpack_require__(15); - -var BooleanLiteralObfuscatingReplacer = BooleanLiteralObfuscatingReplacer_1 = -/*#__PURE__*/ -function (_AbstractObfuscatingR) { - _inherits(BooleanLiteralObfuscatingReplacer, _AbstractObfuscatingR); - - function BooleanLiteralObfuscatingReplacer(options) { - _classCallCheck(this, BooleanLiteralObfuscatingReplacer); - - return _possibleConstructorReturn(this, (BooleanLiteralObfuscatingReplacer.__proto__ || _Object$getPrototypeOf(BooleanLiteralObfuscatingReplacer)).call(this, options)); - } - - _createClass(BooleanLiteralObfuscatingReplacer, [{ - key: "replace", - value: function replace(nodeValue) { - return nodeValue ? BooleanLiteralObfuscatingReplacer_1.getTrueUnaryExpressionNode() : BooleanLiteralObfuscatingReplacer_1.getFalseUnaryExpressionNode(); - } - }], [{ - key: "getTrueUnaryExpressionNode", - value: function getTrueUnaryExpressionNode() { - return Nodes_1.Nodes.getUnaryExpressionNode('!', BooleanLiteralObfuscatingReplacer_1.getFalseUnaryExpressionNode()); - } - }, { - key: "getFalseUnaryExpressionNode", - value: function getFalseUnaryExpressionNode() { - return Nodes_1.Nodes.getUnaryExpressionNode('!', Nodes_1.Nodes.getArrayExpressionNode()); - } - }]); - - return BooleanLiteralObfuscatingReplacer; -}(AbstractObfuscatingReplacer_1.AbstractObfuscatingReplacer); - -BooleanLiteralObfuscatingReplacer = BooleanLiteralObfuscatingReplacer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object])], BooleanLiteralObfuscatingReplacer); -exports.BooleanLiteralObfuscatingReplacer = BooleanLiteralObfuscatingReplacer; -var BooleanLiteralObfuscatingReplacer_1; - -/***/ }), -/* 149 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var estraverse = tslib_1.__importStar(__webpack_require__(17)); - -var IdentifierObfuscatingReplacer_1 = __webpack_require__(26); - -var TransformationStage_1 = __webpack_require__(12); - -var AbstractNodeTransformer_1 = __webpack_require__(13); - -var NodeGuards_1 = __webpack_require__(8); - -var CatchClauseTransformer = -/*#__PURE__*/ -function (_AbstractNodeTransfor) { - _inherits(CatchClauseTransformer, _AbstractNodeTransfor); - - function CatchClauseTransformer(identifierObfuscatingReplacerFactory, randomGenerator, options) { - var _this; - - _classCallCheck(this, CatchClauseTransformer); - - _this = _possibleConstructorReturn(this, (CatchClauseTransformer.__proto__ || _Object$getPrototypeOf(CatchClauseTransformer)).call(this, randomGenerator, options)); - _this.identifierObfuscatingReplacer = identifierObfuscatingReplacerFactory(IdentifierObfuscatingReplacer_1.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer); - return _this; - } - - _createClass(CatchClauseTransformer, [{ - key: "getVisitor", - value: function getVisitor(transformationStage) { - var _this2 = this; - - switch (transformationStage) { - case TransformationStage_1.TransformationStage.Obfuscating: - return { - enter: function enter(node, parentNode) { - if (parentNode && NodeGuards_1.NodeGuards.isCatchClauseNode(node)) { - return _this2.transformNode(node, parentNode); - } - } - }; - - default: - return null; - } - } - }, { - key: "transformNode", - value: function transformNode(catchClauseNode, parentNode) { - var nodeIdentifier = this.nodeIdentifier++; - this.storeCatchClauseParam(catchClauseNode, nodeIdentifier); - this.replaceCatchClauseParam(catchClauseNode, nodeIdentifier); - return catchClauseNode; - } - }, { - key: "storeCatchClauseParam", - value: function storeCatchClauseParam(catchClauseNode, nodeIdentifier) { - if (NodeGuards_1.NodeGuards.isIdentifierNode(catchClauseNode.param)) { - this.identifierObfuscatingReplacer.storeLocalName(catchClauseNode.param.name, nodeIdentifier); - } - } - }, { - key: "replaceCatchClauseParam", - value: function replaceCatchClauseParam(catchClauseNode, nodeIdentifier) { - var _this3 = this; - - estraverse.replace(catchClauseNode, { - enter: function enter(node, parentNode) { - if (parentNode && NodeGuards_1.NodeGuards.isReplaceableIdentifierNode(node, parentNode)) { - var newIdentifier = _this3.identifierObfuscatingReplacer.replace(node.name, nodeIdentifier); - - var newIdentifierName = newIdentifier.name; - - if (node.name !== newIdentifierName) { - node.name = newIdentifierName; - node.obfuscatedNode = true; - } - } - } - }); - } - }]); - - return CatchClauseTransformer; -}(AbstractNodeTransformer_1.AbstractNodeTransformer); - -CatchClauseTransformer = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], CatchClauseTransformer); -exports.CatchClauseTransformer = CatchClauseTransformer; - -/***/ }), -/* 150 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Map = __webpack_require__(16); - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var estraverse = tslib_1.__importStar(__webpack_require__(17)); - -var IdentifierObfuscatingReplacer_1 = __webpack_require__(26); - -var NodeType_1 = __webpack_require__(18); - -var TransformationStage_1 = __webpack_require__(12); - -var AbstractNodeTransformer_1 = __webpack_require__(13); - -var NodeGuards_1 = __webpack_require__(8); - -var NodeUtils_1 = __webpack_require__(9); - -var ClassDeclarationTransformer = -/*#__PURE__*/ -function (_AbstractNodeTransfor) { - _inherits(ClassDeclarationTransformer, _AbstractNodeTransfor); - - function ClassDeclarationTransformer(identifierObfuscatingReplacerFactory, randomGenerator, options) { - var _this; - - _classCallCheck(this, ClassDeclarationTransformer); - - _this = _possibleConstructorReturn(this, (ClassDeclarationTransformer.__proto__ || _Object$getPrototypeOf(ClassDeclarationTransformer)).call(this, randomGenerator, options)); - _this.replaceableIdentifiers = new _Map(); - _this.identifierObfuscatingReplacer = identifierObfuscatingReplacerFactory(IdentifierObfuscatingReplacer_1.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer); - return _this; - } - - _createClass(ClassDeclarationTransformer, [{ - key: "getVisitor", - value: function getVisitor(transformationStage) { - var _this2 = this; - - switch (transformationStage) { - case TransformationStage_1.TransformationStage.Obfuscating: - return { - enter: function enter(node, parentNode) { - if (parentNode && NodeGuards_1.NodeGuards.isClassDeclarationNode(node)) { - return _this2.transformNode(node, parentNode); - } - } - }; - - default: - return null; - } - } - }, { - key: "transformNode", - value: function transformNode(classDeclarationNode, parentNode) { - var nodeIdentifier = this.nodeIdentifier++; - var blockScopeNode = NodeUtils_1.NodeUtils.getBlockScopesOfNode(classDeclarationNode)[0]; - var isGlobalDeclaration = blockScopeNode.type === NodeType_1.NodeType.Program; - - if (!this.options.renameGlobals && isGlobalDeclaration) { - return classDeclarationNode; - } - - this.storeClassName(classDeclarationNode, isGlobalDeclaration, nodeIdentifier); - - if (this.replaceableIdentifiers.has(blockScopeNode)) { - this.replaceScopeCachedIdentifiers(blockScopeNode, nodeIdentifier); - } else { - this.replaceScopeIdentifiers(blockScopeNode, nodeIdentifier); - } - - return classDeclarationNode; - } - }, { - key: "storeClassName", - value: function storeClassName(classDeclarationNode, isGlobalDeclaration, nodeIdentifier) { - if (isGlobalDeclaration) { - this.identifierObfuscatingReplacer.storeGlobalName(classDeclarationNode.id.name, nodeIdentifier); - } else { - this.identifierObfuscatingReplacer.storeLocalName(classDeclarationNode.id.name, nodeIdentifier); - } - } - }, { - key: "replaceScopeCachedIdentifiers", - value: function replaceScopeCachedIdentifiers(blockScopeNode, nodeIdentifier) { - var _this3 = this; - - var cachedReplaceableIdentifiers = this.replaceableIdentifiers.get(blockScopeNode); - cachedReplaceableIdentifiers.forEach(function (replaceableIdentifier) { - var newReplaceableIdentifier = _this3.identifierObfuscatingReplacer.replace(replaceableIdentifier.name, nodeIdentifier); - - replaceableIdentifier.name = newReplaceableIdentifier.name; - }); - } - }, { - key: "replaceScopeIdentifiers", - value: function replaceScopeIdentifiers(blockScopeNode, nodeIdentifier) { - var _this4 = this; - - var storedReplaceableIdentifiers = []; - estraverse.replace(blockScopeNode, { - enter: function enter(node, parentNode) { - if (parentNode && NodeGuards_1.NodeGuards.isReplaceableIdentifierNode(node, parentNode)) { - var newIdentifier = _this4.identifierObfuscatingReplacer.replace(node.name, nodeIdentifier); - - var newIdentifierName = newIdentifier.name; - - if (node.name !== newIdentifierName) { - node.name = newIdentifierName; - } else { - storedReplaceableIdentifiers.push(node); - } - } - } - }); - this.replaceableIdentifiers.set(blockScopeNode, storedReplaceableIdentifiers); - } - }]); - - return ClassDeclarationTransformer; -}(AbstractNodeTransformer_1.AbstractNodeTransformer); - -ClassDeclarationTransformer = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], ClassDeclarationTransformer); -exports.ClassDeclarationTransformer = ClassDeclarationTransformer; - -/***/ }), -/* 151 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Map = __webpack_require__(16); - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var estraverse = tslib_1.__importStar(__webpack_require__(17)); - -var IdentifierObfuscatingReplacer_1 = __webpack_require__(26); - -var NodeType_1 = __webpack_require__(18); - -var TransformationStage_1 = __webpack_require__(12); - -var AbstractNodeTransformer_1 = __webpack_require__(13); - -var NodeGuards_1 = __webpack_require__(8); - -var NodeUtils_1 = __webpack_require__(9); - -var FunctionDeclarationTransformer = -/*#__PURE__*/ -function (_AbstractNodeTransfor) { - _inherits(FunctionDeclarationTransformer, _AbstractNodeTransfor); - - function FunctionDeclarationTransformer(identifierObfuscatingReplacerFactory, randomGenerator, options) { - var _this; - - _classCallCheck(this, FunctionDeclarationTransformer); - - _this = _possibleConstructorReturn(this, (FunctionDeclarationTransformer.__proto__ || _Object$getPrototypeOf(FunctionDeclarationTransformer)).call(this, randomGenerator, options)); - _this.replaceableIdentifiers = new _Map(); - _this.identifierObfuscatingReplacer = identifierObfuscatingReplacerFactory(IdentifierObfuscatingReplacer_1.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer); - return _this; - } - - _createClass(FunctionDeclarationTransformer, [{ - key: "getVisitor", - value: function getVisitor(transformationStage) { - var _this2 = this; - - switch (transformationStage) { - case TransformationStage_1.TransformationStage.Obfuscating: - return { - enter: function enter(node, parentNode) { - if (parentNode && NodeGuards_1.NodeGuards.isFunctionDeclarationNode(node)) { - return _this2.transformNode(node, parentNode); - } - } - }; - - default: - return null; - } - } - }, { - key: "transformNode", - value: function transformNode(functionDeclarationNode, parentNode) { - var nodeIdentifier = this.nodeIdentifier++; - var blockScopeNode = NodeUtils_1.NodeUtils.getBlockScopesOfNode(functionDeclarationNode)[0]; - var isGlobalDeclaration = blockScopeNode.type === NodeType_1.NodeType.Program; - - if (!this.options.renameGlobals && isGlobalDeclaration) { - return functionDeclarationNode; - } - - this.storeFunctionName(functionDeclarationNode, isGlobalDeclaration, nodeIdentifier); - - if (this.replaceableIdentifiers.has(blockScopeNode)) { - this.replaceScopeCachedIdentifiers(functionDeclarationNode, blockScopeNode, nodeIdentifier); - } else { - this.replaceScopeIdentifiers(blockScopeNode, nodeIdentifier); - } - - return functionDeclarationNode; - } - }, { - key: "storeFunctionName", - value: function storeFunctionName(functionDeclarationNode, isGlobalDeclaration, nodeIdentifier) { - if (isGlobalDeclaration) { - this.identifierObfuscatingReplacer.storeGlobalName(functionDeclarationNode.id.name, nodeIdentifier); - } else { - this.identifierObfuscatingReplacer.storeLocalName(functionDeclarationNode.id.name, nodeIdentifier); - } - } - }, { - key: "replaceScopeCachedIdentifiers", - value: function replaceScopeCachedIdentifiers(functionDeclarationNode, blockScopeNode, nodeIdentifier) { - var cachedReplaceableIdentifiersNamesMap = this.replaceableIdentifiers.get(blockScopeNode); - - if (!cachedReplaceableIdentifiersNamesMap) { - return; - } - - var cachedReplaceableIdentifiers = cachedReplaceableIdentifiersNamesMap.get(functionDeclarationNode.id.name); - - if (!cachedReplaceableIdentifiers) { - return; - } - - var cachedReplaceableIdentifierLength = cachedReplaceableIdentifiers.length; - - for (var i = 0; i < cachedReplaceableIdentifierLength; i++) { - var replaceableIdentifier = cachedReplaceableIdentifiers[i]; - var newReplaceableIdentifier = this.identifierObfuscatingReplacer.replace(replaceableIdentifier.name, nodeIdentifier); - replaceableIdentifier.name = newReplaceableIdentifier.name; - } - } - }, { - key: "replaceScopeIdentifiers", - value: function replaceScopeIdentifiers(blockScopeNode, nodeIdentifier) { - var _this3 = this; - - var storedReplaceableIdentifiersNamesMap = new _Map(); - estraverse.replace(blockScopeNode, { - enter: function enter(node, parentNode) { - if (parentNode && NodeGuards_1.NodeGuards.isReplaceableIdentifierNode(node, parentNode)) { - var newIdentifier = _this3.identifierObfuscatingReplacer.replace(node.name, nodeIdentifier); - - var newIdentifierName = newIdentifier.name; - - if (node.name !== newIdentifierName) { - node.name = newIdentifierName; - } else { - var storedReplaceableIdentifiers = storedReplaceableIdentifiersNamesMap.get(node.name) || []; - storedReplaceableIdentifiers.push(node); - storedReplaceableIdentifiersNamesMap.set(node.name, storedReplaceableIdentifiers); - } - } - } - }); - this.replaceableIdentifiers.set(blockScopeNode, storedReplaceableIdentifiersNamesMap); - } - }]); - - return FunctionDeclarationTransformer; -}(AbstractNodeTransformer_1.AbstractNodeTransformer); - -FunctionDeclarationTransformer = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], FunctionDeclarationTransformer); -exports.FunctionDeclarationTransformer = FunctionDeclarationTransformer; - -/***/ }), -/* 152 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Set = __webpack_require__(29); - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var estraverse = tslib_1.__importStar(__webpack_require__(17)); - -var IdentifierObfuscatingReplacer_1 = __webpack_require__(26); - -var TransformationStage_1 = __webpack_require__(12); - -var AbstractNodeTransformer_1 = __webpack_require__(13); - -var NodeGuards_1 = __webpack_require__(8); - -var FunctionTransformer = -/*#__PURE__*/ -function (_AbstractNodeTransfor) { - _inherits(FunctionTransformer, _AbstractNodeTransfor); - - function FunctionTransformer(identifierObfuscatingReplacerFactory, randomGenerator, options) { - var _this; - - _classCallCheck(this, FunctionTransformer); - - _this = _possibleConstructorReturn(this, (FunctionTransformer.__proto__ || _Object$getPrototypeOf(FunctionTransformer)).call(this, randomGenerator, options)); - _this.identifierObfuscatingReplacer = identifierObfuscatingReplacerFactory(IdentifierObfuscatingReplacer_1.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer); - return _this; - } - - _createClass(FunctionTransformer, [{ - key: "getVisitor", - value: function getVisitor(transformationStage) { - var _this2 = this; - - switch (transformationStage) { - case TransformationStage_1.TransformationStage.Obfuscating: - return { - enter: function enter(node, parentNode) { - if (parentNode && (NodeGuards_1.NodeGuards.isFunctionDeclarationNode(node) || NodeGuards_1.NodeGuards.isFunctionExpressionNode(node) || NodeGuards_1.NodeGuards.isArrowFunctionExpressionNode(node))) { - return _this2.transformNode(node, parentNode); - } - } - }; - - default: - return null; - } - } - }, { - key: "transformNode", - value: function transformNode(functionNode, parentNode) { - var nodeIdentifier = this.nodeIdentifier++; - this.storeFunctionParams(functionNode, nodeIdentifier); - this.replaceFunctionParams(functionNode, nodeIdentifier); - return functionNode; - } - }, { - key: "storeFunctionParams", - value: function storeFunctionParams(functionNode, nodeIdentifier) { - var _this3 = this; - - functionNode.params.forEach(function (paramsNode) { - if (NodeGuards_1.NodeGuards.isObjectPatternNode(paramsNode)) { - return estraverse.VisitorOption.Skip; - } - - estraverse.traverse(paramsNode, { - enter: function enter(node) { - if (NodeGuards_1.NodeGuards.isAssignmentPatternNode(node) && NodeGuards_1.NodeGuards.isIdentifierNode(node.left)) { - _this3.identifierObfuscatingReplacer.storeLocalName(node.left.name, nodeIdentifier); - - return estraverse.VisitorOption.Skip; - } - - if (NodeGuards_1.NodeGuards.isIdentifierNode(node)) { - _this3.identifierObfuscatingReplacer.storeLocalName(node.name, nodeIdentifier); - } - } - }); - }); - } - }, { - key: "addIdentifiersToIgnoredIdentifierNamesSet", - value: function addIdentifiersToIgnoredIdentifierNamesSet(properties, ignoredIdentifierNamesSet) { - properties.forEach(function (property) { - if (!NodeGuards_1.NodeGuards.isIdentifierNode(property.key)) { - return; - } - - ignoredIdentifierNamesSet.add(property.key.name); - }); - } - }, { - key: "replaceFunctionParams", - value: function replaceFunctionParams(functionNode, nodeIdentifier) { - var _this4 = this; - - var ignoredIdentifierNamesSet = new _Set(); - var replaceVisitor = { - enter: function enter(node, parentNode) { - if (NodeGuards_1.NodeGuards.isObjectPatternNode(node)) { - _this4.addIdentifiersToIgnoredIdentifierNamesSet(node.properties, ignoredIdentifierNamesSet); - } - - if (parentNode && NodeGuards_1.NodeGuards.isReplaceableIdentifierNode(node, parentNode) && !ignoredIdentifierNamesSet.has(node.name)) { - var newIdentifier = _this4.identifierObfuscatingReplacer.replace(node.name, nodeIdentifier); - - var newIdentifierName = newIdentifier.name; - - if (node.name !== newIdentifierName) { - node.name = newIdentifierName; - node.obfuscatedNode = true; - } - } - } - }; - functionNode.params.forEach(function (paramsNode) { - return estraverse.replace(paramsNode, replaceVisitor); - }); - estraverse.replace(functionNode.body, replaceVisitor); - } - }]); - - return FunctionTransformer; -}(AbstractNodeTransformer_1.AbstractNodeTransformer); - -FunctionTransformer = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], FunctionTransformer); -exports.FunctionTransformer = FunctionTransformer; - -/***/ }), -/* 153 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var estraverse = tslib_1.__importStar(__webpack_require__(17)); - -var IdentifierObfuscatingReplacer_1 = __webpack_require__(26); - -var TransformationStage_1 = __webpack_require__(12); - -var AbstractNodeTransformer_1 = __webpack_require__(13); - -var NodeGuards_1 = __webpack_require__(8); - -var LabeledStatementTransformer = -/*#__PURE__*/ -function (_AbstractNodeTransfor) { - _inherits(LabeledStatementTransformer, _AbstractNodeTransfor); - - function LabeledStatementTransformer(identifierObfuscatingReplacerFactory, randomGenerator, options) { - var _this; - - _classCallCheck(this, LabeledStatementTransformer); - - _this = _possibleConstructorReturn(this, (LabeledStatementTransformer.__proto__ || _Object$getPrototypeOf(LabeledStatementTransformer)).call(this, randomGenerator, options)); - _this.identifierObfuscatingReplacer = identifierObfuscatingReplacerFactory(IdentifierObfuscatingReplacer_1.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer); - return _this; - } - - _createClass(LabeledStatementTransformer, [{ - key: "getVisitor", - value: function getVisitor(transformationStage) { - var _this2 = this; - - switch (transformationStage) { - case TransformationStage_1.TransformationStage.Obfuscating: - return { - enter: function enter(node, parentNode) { - if (parentNode && NodeGuards_1.NodeGuards.isLabeledStatementNode(node)) { - return _this2.transformNode(node, parentNode); - } - } - }; - - default: - return null; - } - } - }, { - key: "transformNode", - value: function transformNode(labeledStatementNode, parentNode) { - var nodeIdentifier = this.nodeIdentifier++; - this.storeLabeledStatementName(labeledStatementNode, nodeIdentifier); - this.replaceLabeledStatementName(labeledStatementNode, nodeIdentifier); - return labeledStatementNode; - } - }, { - key: "storeLabeledStatementName", - value: function storeLabeledStatementName(labeledStatementNode, nodeIdentifier) { - this.identifierObfuscatingReplacer.storeLocalName(labeledStatementNode.label.name, nodeIdentifier); - } - }, { - key: "replaceLabeledStatementName", - value: function replaceLabeledStatementName(labeledStatementNode, nodeIdentifier) { - var _this3 = this; - - estraverse.replace(labeledStatementNode, { - enter: function enter(node, parentNode) { - if (parentNode && NodeGuards_1.NodeGuards.isLabelIdentifierNode(node, parentNode)) { - var newIdentifier = _this3.identifierObfuscatingReplacer.replace(node.name, nodeIdentifier); - - node.name = newIdentifier.name; - } - } - }); - } - }]); - - return LabeledStatementTransformer; -}(AbstractNodeTransformer_1.AbstractNodeTransformer); - -LabeledStatementTransformer = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], LabeledStatementTransformer); -exports.LabeledStatementTransformer = LabeledStatementTransformer; - -/***/ }), -/* 154 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _typeof = __webpack_require__(50); - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var LiteralObfuscatingReplacer_1 = __webpack_require__(59); - -var TransformationStage_1 = __webpack_require__(12); - -var AbstractNodeTransformer_1 = __webpack_require__(13); - -var NodeGuards_1 = __webpack_require__(8); - -var LiteralTransformer = -/*#__PURE__*/ -function (_AbstractNodeTransfor) { - _inherits(LiteralTransformer, _AbstractNodeTransfor); - - function LiteralTransformer(literalObfuscatingReplacerFactory, randomGenerator, options) { - var _this; - - _classCallCheck(this, LiteralTransformer); - - _this = _possibleConstructorReturn(this, (LiteralTransformer.__proto__ || _Object$getPrototypeOf(LiteralTransformer)).call(this, randomGenerator, options)); - _this.literalObfuscatingReplacerFactory = literalObfuscatingReplacerFactory; - return _this; - } - - _createClass(LiteralTransformer, [{ - key: "getVisitor", - value: function getVisitor(transformationStage) { - var _this2 = this; - - switch (transformationStage) { - case TransformationStage_1.TransformationStage.Obfuscating: - return { - enter: function enter(node, parentNode) { - if (parentNode && NodeGuards_1.NodeGuards.isLiteralNode(node) && !node.obfuscatedNode) { - return _this2.transformNode(node, parentNode); - } - } - }; - - default: - return null; - } - } - }, { - key: "transformNode", - value: function transformNode(literalNode, parentNode) { - if (parentNode && NodeGuards_1.NodeGuards.isPropertyNode(parentNode) && parentNode.key === literalNode) { - return literalNode; - } - - switch (_typeof(literalNode.value)) { - case 'boolean': - return this.literalObfuscatingReplacerFactory(LiteralObfuscatingReplacer_1.LiteralObfuscatingReplacer.BooleanLiteralObfuscatingReplacer).replace(literalNode.value); - - case 'number': - return this.literalObfuscatingReplacerFactory(LiteralObfuscatingReplacer_1.LiteralObfuscatingReplacer.NumberLiteralObfuscatingReplacer).replace(literalNode.value); - - case 'string': - return this.literalObfuscatingReplacerFactory(LiteralObfuscatingReplacer_1.LiteralObfuscatingReplacer.StringLiteralObfuscatingReplacer).replace(literalNode.value); - - default: - return literalNode; - } - } - }]); - - return LiteralTransformer; -}(AbstractNodeTransformer_1.AbstractNodeTransformer); - -LiteralTransformer = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IObfuscatingReplacer)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], LiteralTransformer); -exports.LiteralTransformer = LiteralTransformer; - -/***/ }), -/* 155 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Map = __webpack_require__(16); - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var AbstractObfuscatingReplacer_1 = __webpack_require__(40); - -var Nodes_1 = __webpack_require__(15); - -var Utils_1 = __webpack_require__(32); - -var NumberLiteralObfuscatingReplacer = -/*#__PURE__*/ -function (_AbstractObfuscatingR) { - _inherits(NumberLiteralObfuscatingReplacer, _AbstractObfuscatingR); - - function NumberLiteralObfuscatingReplacer(options) { - var _this; - - _classCallCheck(this, NumberLiteralObfuscatingReplacer); - - _this = _possibleConstructorReturn(this, (NumberLiteralObfuscatingReplacer.__proto__ || _Object$getPrototypeOf(NumberLiteralObfuscatingReplacer)).call(this, options)); - _this.numberLiteralCache = new _Map(); - return _this; - } - - _createClass(NumberLiteralObfuscatingReplacer, [{ - key: "replace", - value: function replace(nodeValue) { - var rawValue; - - if (this.numberLiteralCache.has(nodeValue)) { - rawValue = this.numberLiteralCache.get(nodeValue); - } else { - if (!Utils_1.Utils.isCeilNumber(nodeValue)) { - rawValue = String(nodeValue); - } else { - rawValue = "".concat(Utils_1.Utils.hexadecimalPrefix).concat(Utils_1.Utils.decToHex(nodeValue)); - } - - this.numberLiteralCache.set(nodeValue, rawValue); - } - - return Nodes_1.Nodes.getLiteralNode(nodeValue, rawValue); - } - }]); - - return NumberLiteralObfuscatingReplacer; -}(AbstractObfuscatingReplacer_1.AbstractObfuscatingReplacer); - -NumberLiteralObfuscatingReplacer = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object])], NumberLiteralObfuscatingReplacer); -exports.NumberLiteralObfuscatingReplacer = NumberLiteralObfuscatingReplacer; - -/***/ }), -/* 156 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var NodeType_1 = __webpack_require__(18); - -var TransformationStage_1 = __webpack_require__(12); - -var AbstractNodeTransformer_1 = __webpack_require__(13); - -var NodeGuards_1 = __webpack_require__(8); - -var ObjectExpressionTransformer = ObjectExpressionTransformer_1 = -/*#__PURE__*/ -function (_AbstractNodeTransfor) { - _inherits(ObjectExpressionTransformer, _AbstractNodeTransfor); - - function ObjectExpressionTransformer(randomGenerator, options) { - _classCallCheck(this, ObjectExpressionTransformer); - - return _possibleConstructorReturn(this, (ObjectExpressionTransformer.__proto__ || _Object$getPrototypeOf(ObjectExpressionTransformer)).call(this, randomGenerator, options)); - } - - _createClass(ObjectExpressionTransformer, [{ - key: "getVisitor", - value: function getVisitor(transformationStage) { - var _this = this; - - switch (transformationStage) { - case TransformationStage_1.TransformationStage.Obfuscating: - return { - enter: function enter(node, parentNode) { - if (parentNode && NodeGuards_1.NodeGuards.isObjectExpressionNode(node)) { - return _this.transformNode(node, parentNode); - } - } - }; - - default: - return null; - } - } - }, { - key: "transformNode", - value: function transformNode(objectExpressionNode, parentNode) { - objectExpressionNode.properties.forEach(function (property) { - if (property.computed) { - return; - } - - if (property.shorthand) { - property.shorthand = false; - } - - if (NodeGuards_1.NodeGuards.isIdentifierNode(property.key)) { - property.key = ObjectExpressionTransformer_1.transformIdentifierPropertyKey(property.key); - } - }); - return objectExpressionNode; - } - }], [{ - key: "transformIdentifierPropertyKey", - value: function transformIdentifierPropertyKey(node) { - return { - type: NodeType_1.NodeType.Literal, - value: node.name, - raw: "'".concat(node.name, "'") - }; - } - }]); - - return ObjectExpressionTransformer; -}(AbstractNodeTransformer_1.AbstractNodeTransformer); - -ObjectExpressionTransformer = ObjectExpressionTransformer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object])], ObjectExpressionTransformer); -exports.ObjectExpressionTransformer = ObjectExpressionTransformer; -var ObjectExpressionTransformer_1; - -/***/ }), -/* 157 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Map = __webpack_require__(16); - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var StringArrayEncoding_1 = __webpack_require__(37); - -var AbstractObfuscatingReplacer_1 = __webpack_require__(40); - -var Nodes_1 = __webpack_require__(15); - -var Utils_1 = __webpack_require__(32); - -var StringLiteralObfuscatingReplacer = StringLiteralObfuscatingReplacer_1 = -/*#__PURE__*/ -function (_AbstractObfuscatingR) { - _inherits(StringLiteralObfuscatingReplacer, _AbstractObfuscatingR); - - function StringLiteralObfuscatingReplacer(stringArrayStorage, escapeSequenceEncoder, randomGenerator, cryptUtils, options) { - var _this; - - _classCallCheck(this, StringLiteralObfuscatingReplacer); - - _this = _possibleConstructorReturn(this, (StringLiteralObfuscatingReplacer.__proto__ || _Object$getPrototypeOf(StringLiteralObfuscatingReplacer)).call(this, options)); - _this.nodesCache = new _Map(); - _this.stringLiteralHexadecimalIndexCache = new _Map(); - _this.stringArrayStorage = stringArrayStorage; - _this.escapeSequenceEncoder = escapeSequenceEncoder; - _this.randomGenerator = randomGenerator; - _this.cryptUtils = cryptUtils; - _this.rc4Keys = _this.randomGenerator.getRandomGenerator().n(function () { - return _this.randomGenerator.getRandomGenerator().string({ - length: StringLiteralObfuscatingReplacer_1.rc4KeyLength - }); - }, StringLiteralObfuscatingReplacer_1.rc4KeysCount); - return _this; - } - - _createClass(StringLiteralObfuscatingReplacer, [{ - key: "replace", - value: function replace(nodeValue) { - var useStringArray = this.canUseStringArray(nodeValue); - var cacheKey = "".concat(nodeValue, "-").concat(String(useStringArray)); - var useCacheValue = this.nodesCache.has(cacheKey) && this.options.stringArrayEncoding !== StringArrayEncoding_1.StringArrayEncoding.Rc4; - - if (useCacheValue) { - return this.nodesCache.get(cacheKey); - } - - var resultNode = useStringArray ? this.replaceWithStringArrayCallNode(nodeValue) : this.replaceWithLiteralNode(nodeValue); - this.nodesCache.set(cacheKey, resultNode); - return resultNode; - } - }, { - key: "canUseStringArray", - value: function canUseStringArray(nodeValue) { - return this.options.stringArray && nodeValue.length >= StringLiteralObfuscatingReplacer_1.minimumLengthForStringArray && this.randomGenerator.getMathRandom() <= this.options.stringArrayThreshold; - } - }, { - key: "getStringArrayHexadecimalIndex", - value: function getStringArrayHexadecimalIndex(value, stringArrayStorageLength) { - if (this.stringLiteralHexadecimalIndexCache.has(value)) { - return { - fromCache: true, - index: this.stringLiteralHexadecimalIndexCache.get(value) - }; - } - - var hexadecimalRawIndex = Utils_1.Utils.decToHex(stringArrayStorageLength); - var hexadecimalIndex = "".concat(Utils_1.Utils.hexadecimalPrefix).concat(hexadecimalRawIndex); - this.stringLiteralHexadecimalIndexCache.set(value, hexadecimalIndex); - return { - fromCache: false, - index: hexadecimalIndex - }; - } - }, { - key: "getEncodedValue", - value: function getEncodedValue(value) { - var encodedValue; - var key = null; - - switch (this.options.stringArrayEncoding) { - case StringArrayEncoding_1.StringArrayEncoding.Rc4: - key = this.randomGenerator.getRandomGenerator().pickone(this.rc4Keys); - encodedValue = this.cryptUtils.btoa(this.cryptUtils.rc4(value, key)); - break; - - case StringArrayEncoding_1.StringArrayEncoding.Base64: - encodedValue = this.cryptUtils.btoa(value); - break; - - default: - encodedValue = value; - } - - return { - encodedValue: encodedValue, - key: key - }; - } - }, { - key: "replaceWithLiteralNode", - value: function replaceWithLiteralNode(value) { - return Nodes_1.Nodes.getLiteralNode(this.escapeSequenceEncoder.encode(value, this.options.unicodeEscapeSequence)); - } - }, { - key: "replaceWithStringArrayCallNode", - value: function replaceWithStringArrayCallNode(value) { - var _getEncodedValue = this.getEncodedValue(value), - encodedValue = _getEncodedValue.encodedValue, - key = _getEncodedValue.key; - - var escapedValue = this.escapeSequenceEncoder.encode(encodedValue, this.options.unicodeEscapeSequence); - var stringArrayStorageLength = this.stringArrayStorage.getLength(); - var stringArrayStorageCallsWrapperName = this.stringArrayStorage.getStorageId().split('|')[1]; - - var _getStringArrayHexade = this.getStringArrayHexadecimalIndex(escapedValue, stringArrayStorageLength), - fromCache = _getStringArrayHexade.fromCache, - index = _getStringArrayHexade.index; - - if (!fromCache) { - this.stringArrayStorage.set(stringArrayStorageLength, escapedValue); - } - - var callExpressionArgs = [StringLiteralObfuscatingReplacer_1.getHexadecimalLiteralNode(index)]; - - if (key) { - callExpressionArgs.push(StringLiteralObfuscatingReplacer_1.getRc4KeyLiteralNode(this.escapeSequenceEncoder.encode(key, this.options.unicodeEscapeSequence))); - } - - var stringArrayIdentifierNode = Nodes_1.Nodes.getIdentifierNode(stringArrayStorageCallsWrapperName); - stringArrayIdentifierNode.obfuscatedNode = true; - return Nodes_1.Nodes.getCallExpressionNode(stringArrayIdentifierNode, callExpressionArgs); - } - }], [{ - key: "getHexadecimalLiteralNode", - value: function getHexadecimalLiteralNode(hexadecimalIndex) { - var hexadecimalLiteralNode = Nodes_1.Nodes.getLiteralNode(hexadecimalIndex); - hexadecimalLiteralNode.obfuscatedNode = true; - return hexadecimalLiteralNode; - } - }, { - key: "getRc4KeyLiteralNode", - value: function getRc4KeyLiteralNode(literalValue) { - var rc4KeyLiteralNode = Nodes_1.Nodes.getLiteralNode(literalValue); - rc4KeyLiteralNode.obfuscatedNode = true; - return rc4KeyLiteralNode; - } - }]); - - return StringLiteralObfuscatingReplacer; -}(AbstractObfuscatingReplacer_1.AbstractObfuscatingReplacer); - -StringLiteralObfuscatingReplacer.minimumLengthForStringArray = 3; -StringLiteralObfuscatingReplacer.rc4KeyLength = 4; -StringLiteralObfuscatingReplacer.rc4KeysCount = 50; -StringLiteralObfuscatingReplacer = StringLiteralObfuscatingReplacer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.TStringArrayStorage)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IEscapeSequenceEncoder)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICryptUtils)), tslib_1.__param(4, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object, Object, Object, Object])], StringLiteralObfuscatingReplacer); -exports.StringLiteralObfuscatingReplacer = StringLiteralObfuscatingReplacer; -var StringLiteralObfuscatingReplacer_1; - -/***/ }), -/* 158 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Map = __webpack_require__(16); - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var estraverse = tslib_1.__importStar(__webpack_require__(17)); - -var IdentifierObfuscatingReplacer_1 = __webpack_require__(26); - -var NodeType_1 = __webpack_require__(18); - -var TransformationStage_1 = __webpack_require__(12); - -var AbstractNodeTransformer_1 = __webpack_require__(13); - -var NodeGuards_1 = __webpack_require__(8); - -var NodeUtils_1 = __webpack_require__(9); - -var VariableDeclarationTransformer = -/*#__PURE__*/ -function (_AbstractNodeTransfor) { - _inherits(VariableDeclarationTransformer, _AbstractNodeTransfor); - - function VariableDeclarationTransformer(identifierObfuscatingReplacerFactory, randomGenerator, options) { - var _this; - - _classCallCheck(this, VariableDeclarationTransformer); - - _this = _possibleConstructorReturn(this, (VariableDeclarationTransformer.__proto__ || _Object$getPrototypeOf(VariableDeclarationTransformer)).call(this, randomGenerator, options)); - _this.replaceableIdentifiers = new _Map(); - _this.identifierObfuscatingReplacer = identifierObfuscatingReplacerFactory(IdentifierObfuscatingReplacer_1.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer); - return _this; - } - - _createClass(VariableDeclarationTransformer, [{ - key: "getVisitor", - value: function getVisitor(transformationStage) { - var _this2 = this; - - switch (transformationStage) { - case TransformationStage_1.TransformationStage.Obfuscating: - return { - enter: function enter(node, parentNode) { - if (parentNode && NodeGuards_1.NodeGuards.isVariableDeclarationNode(node)) { - return _this2.transformNode(node, parentNode); - } - } - }; - - default: - return null; - } - } - }, { - key: "transformNode", - value: function transformNode(variableDeclarationNode, parentNode) { - var blockScopeNode = NodeUtils_1.NodeUtils.getBlockScopesOfNode(variableDeclarationNode)[0]; - var isGlobalDeclaration = blockScopeNode.type === NodeType_1.NodeType.Program; - - if (!this.options.renameGlobals && isGlobalDeclaration) { - return variableDeclarationNode; - } - - var nodeIdentifier = this.nodeIdentifier++; - var scopeNode = variableDeclarationNode.kind === 'var' ? blockScopeNode : parentNode; - this.storeVariableNames(variableDeclarationNode, isGlobalDeclaration, nodeIdentifier); - - if (this.replaceableIdentifiers.has(scopeNode)) { - this.replaceScopeCachedIdentifiers(variableDeclarationNode, scopeNode, nodeIdentifier); - } else { - this.replaceScopeIdentifiers(scopeNode, nodeIdentifier); - } - - return variableDeclarationNode; - } - }, { - key: "storeVariableNames", - value: function storeVariableNames(variableDeclarationNode, isGlobalDeclaration, nodeIdentifier) { - var _this3 = this; - - this.traverseDeclarationIdentifiers(variableDeclarationNode, function (identifierNode) { - if (isGlobalDeclaration) { - _this3.identifierObfuscatingReplacer.storeGlobalName(identifierNode.name, nodeIdentifier); - } else { - _this3.identifierObfuscatingReplacer.storeLocalName(identifierNode.name, nodeIdentifier); - } - }); - } - }, { - key: "replaceScopeCachedIdentifiers", - value: function replaceScopeCachedIdentifiers(variableDeclarationNode, scopeNode, nodeIdentifier) { - var _this4 = this; - - var cachedReplaceableIdentifiersNamesMap = this.replaceableIdentifiers.get(scopeNode); - - if (!cachedReplaceableIdentifiersNamesMap) { - return; - } - - var identifierNames = []; - this.traverseDeclarationIdentifiers(variableDeclarationNode, function (identifierNode) { - identifierNames.push(identifierNode.name); - }); - identifierNames.forEach(function (identifierName) { - var cachedReplaceableIdentifiers = cachedReplaceableIdentifiersNamesMap.get(identifierName); - - if (!cachedReplaceableIdentifiers) { - return; - } - - var cachedReplaceableIdentifierLength = cachedReplaceableIdentifiers.length; - - for (var i = 0; i < cachedReplaceableIdentifierLength; i++) { - var replaceableIdentifier = cachedReplaceableIdentifiers[i]; - - if (identifierName !== replaceableIdentifier.name) { - continue; - } - - var newReplaceableIdentifier = _this4.identifierObfuscatingReplacer.replace(replaceableIdentifier.name, nodeIdentifier); - - replaceableIdentifier.name = newReplaceableIdentifier.name; - } - }); - } - }, { - key: "replaceScopeIdentifiers", - value: function replaceScopeIdentifiers(blockScopeNode, nodeIdentifier) { - var _this5 = this; - - var storedReplaceableIdentifiersNamesMap = new _Map(); - estraverse.replace(blockScopeNode, { - enter: function enter(node, parentNode) { - if (parentNode && !node.obfuscatedNode && NodeGuards_1.NodeGuards.isReplaceableIdentifierNode(node, parentNode)) { - var newIdentifier = _this5.identifierObfuscatingReplacer.replace(node.name, nodeIdentifier); - - var newIdentifierName = newIdentifier.name; - - if (node.name !== newIdentifierName) { - node.name = newIdentifierName; - } else { - var storedReplaceableIdentifiers = storedReplaceableIdentifiersNamesMap.get(node.name) || []; - storedReplaceableIdentifiers.push(node); - storedReplaceableIdentifiersNamesMap.set(node.name, storedReplaceableIdentifiers); - } - } - } - }); - this.replaceableIdentifiers.set(blockScopeNode, storedReplaceableIdentifiersNamesMap); - } - }, { - key: "traverseDeclarationIdentifiers", - value: function traverseDeclarationIdentifiers(variableDeclarationNode, callback) { - variableDeclarationNode.declarations.forEach(function (declarationNode) { - if (NodeGuards_1.NodeGuards.isObjectPatternNode(declarationNode.id)) { - return estraverse.VisitorOption.Skip; - } - - estraverse.traverse(declarationNode.id, { - enter: function enter(node) { - if (NodeGuards_1.NodeGuards.isIdentifierNode(node)) { - callback(node); - } - } - }); - }); - } - }]); - - return VariableDeclarationTransformer; -}(AbstractNodeTransformer_1.AbstractNodeTransformer); - -VariableDeclarationTransformer = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], VariableDeclarationTransformer); -exports.VariableDeclarationTransformer = VariableDeclarationTransformer; - -/***/ }), -/* 159 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var Options_1 = __webpack_require__(160); - -var OptionsNormalizer_1 = __webpack_require__(163); - -exports.optionsModule = new inversify_1.ContainerModule(function (bind) { - bind(ServiceIdentifiers_1.ServiceIdentifiers.IOptions).to(Options_1.Options).inSingletonScope(); - bind(ServiceIdentifiers_1.ServiceIdentifiers.IOptionsNormalizer).to(OptionsNormalizer_1.OptionsNormalizer).inSingletonScope(); -}); - -/***/ }), -/* 160 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$assign = __webpack_require__(11); - -var _classCallCheck = __webpack_require__(0); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var class_validator_1 = __webpack_require__(161); - -var IdentifierNamesGenerator_1 = __webpack_require__(35); - -var ObfuscationTarget_1 = __webpack_require__(21); - -var SourceMapMode_1 = __webpack_require__(36); - -var StringArrayEncoding_1 = __webpack_require__(37); - -var Default_1 = __webpack_require__(46); - -var ValidationErrorsFormatter_1 = __webpack_require__(162); - -var Options = Options_1 = function Options(inputOptions, optionsNormalizer) { - _classCallCheck(this, Options); - - _Object$assign(this, Default_1.DEFAULT_PRESET, inputOptions); - - var errors = class_validator_1.validateSync(this, Options_1.validatorOptions); - - if (errors.length) { - throw new ReferenceError("Validation failed. errors:\n".concat(ValidationErrorsFormatter_1.ValidationErrorsFormatter.format(errors))); - } - - _Object$assign(this, optionsNormalizer.normalize(this)); -}; - -Options.validatorOptions = { - validationError: { - target: false - } -}; - -tslib_1.__decorate([class_validator_1.IsBoolean(), tslib_1.__metadata("design:type", Boolean)], Options.prototype, "compact", void 0); - -tslib_1.__decorate([class_validator_1.IsBoolean(), tslib_1.__metadata("design:type", Boolean)], Options.prototype, "controlFlowFlattening", void 0); - -tslib_1.__decorate([class_validator_1.IsNumber(), class_validator_1.Min(0), class_validator_1.Max(1), tslib_1.__metadata("design:type", Number)], Options.prototype, "controlFlowFlatteningThreshold", void 0); - -tslib_1.__decorate([class_validator_1.IsBoolean(), tslib_1.__metadata("design:type", Boolean)], Options.prototype, "deadCodeInjection", void 0); - -tslib_1.__decorate([class_validator_1.IsNumber(), tslib_1.__metadata("design:type", Number)], Options.prototype, "deadCodeInjectionThreshold", void 0); - -tslib_1.__decorate([class_validator_1.IsBoolean(), tslib_1.__metadata("design:type", Boolean)], Options.prototype, "debugProtection", void 0); - -tslib_1.__decorate([class_validator_1.IsBoolean(), tslib_1.__metadata("design:type", Boolean)], Options.prototype, "debugProtectionInterval", void 0); - -tslib_1.__decorate([class_validator_1.IsBoolean(), tslib_1.__metadata("design:type", Boolean)], Options.prototype, "disableConsoleOutput", void 0); - -tslib_1.__decorate([class_validator_1.IsArray(), class_validator_1.ArrayUnique(), class_validator_1.IsString({ - each: true -}), tslib_1.__metadata("design:type", Array)], Options.prototype, "domainLock", void 0); - -tslib_1.__decorate([class_validator_1.IsIn([IdentifierNamesGenerator_1.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator, IdentifierNamesGenerator_1.IdentifierNamesGenerator.MangledIdentifierNamesGenerator]), tslib_1.__metadata("design:type", String)], Options.prototype, "identifierNamesGenerator", void 0); - -tslib_1.__decorate([class_validator_1.IsString(), tslib_1.__metadata("design:type", String)], Options.prototype, "identifiersPrefix", void 0); - -tslib_1.__decorate([class_validator_1.IsBoolean(), tslib_1.__metadata("design:type", Boolean)], Options.prototype, "log", void 0); - -tslib_1.__decorate([class_validator_1.IsBoolean(), tslib_1.__metadata("design:type", Boolean)], Options.prototype, "renameGlobals", void 0); - -tslib_1.__decorate([class_validator_1.IsArray(), class_validator_1.ArrayUnique(), class_validator_1.IsString({ - each: true -}), tslib_1.__metadata("design:type", Array)], Options.prototype, "reservedNames", void 0); - -tslib_1.__decorate([class_validator_1.IsBoolean(), tslib_1.__metadata("design:type", Boolean)], Options.prototype, "rotateStringArray", void 0); - -tslib_1.__decorate([class_validator_1.IsNumber(), tslib_1.__metadata("design:type", Number)], Options.prototype, "seed", void 0); - -tslib_1.__decorate([class_validator_1.IsBoolean(), tslib_1.__metadata("design:type", Boolean)], Options.prototype, "selfDefending", void 0); - -tslib_1.__decorate([class_validator_1.IsBoolean(), tslib_1.__metadata("design:type", Boolean)], Options.prototype, "sourceMap", void 0); - -tslib_1.__decorate([class_validator_1.IsString(), class_validator_1.ValidateIf(function (options) { - return Boolean(options.sourceMapBaseUrl); -}), class_validator_1.IsUrl({ - require_protocol: true, - require_tld: false, - require_valid_protocol: true -}), tslib_1.__metadata("design:type", String)], Options.prototype, "sourceMapBaseUrl", void 0); - -tslib_1.__decorate([class_validator_1.IsString(), tslib_1.__metadata("design:type", String)], Options.prototype, "sourceMapFileName", void 0); - -tslib_1.__decorate([class_validator_1.IsIn([SourceMapMode_1.SourceMapMode.Inline, SourceMapMode_1.SourceMapMode.Separate]), tslib_1.__metadata("design:type", String)], Options.prototype, "sourceMapMode", void 0); - -tslib_1.__decorate([class_validator_1.IsBoolean(), tslib_1.__metadata("design:type", Boolean)], Options.prototype, "stringArray", void 0); - -tslib_1.__decorate([class_validator_1.IsIn([true, false, StringArrayEncoding_1.StringArrayEncoding.Base64, StringArrayEncoding_1.StringArrayEncoding.Rc4]), tslib_1.__metadata("design:type", Object)], Options.prototype, "stringArrayEncoding", void 0); - -tslib_1.__decorate([class_validator_1.IsNumber(), class_validator_1.Min(0), class_validator_1.Max(1), tslib_1.__metadata("design:type", Number)], Options.prototype, "stringArrayThreshold", void 0); - -tslib_1.__decorate([class_validator_1.IsIn([ObfuscationTarget_1.ObfuscationTarget.Browser, ObfuscationTarget_1.ObfuscationTarget.Extension, ObfuscationTarget_1.ObfuscationTarget.Node]), tslib_1.__metadata("design:type", String)], Options.prototype, "target", void 0); - -tslib_1.__decorate([class_validator_1.IsBoolean(), tslib_1.__metadata("design:type", Boolean)], Options.prototype, "transformObjectKeys", void 0); - -tslib_1.__decorate([class_validator_1.IsBoolean(), tslib_1.__metadata("design:type", Boolean)], Options.prototype, "unicodeEscapeSequence", void 0); - -Options = Options_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.TInputOptions)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptionsNormalizer)), tslib_1.__metadata("design:paramtypes", [Object, Object])], Options); -exports.Options = Options; -var Options_1; - -/***/ }), -/* 161 */ -/***/ (function(module, exports) { - -module.exports = require("class-validator"); - -/***/ }), -/* 162 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _getIterator = __webpack_require__(33); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var ValidationErrorsFormatter = -/*#__PURE__*/ -function () { - function ValidationErrorsFormatter() { - _classCallCheck(this, ValidationErrorsFormatter); - } - - _createClass(ValidationErrorsFormatter, null, [{ - key: "format", - value: function format(validationErrors) { - var errorsArray = []; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = _getIterator(validationErrors), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var _error = _step.value; - errorsArray.push(ValidationErrorsFormatter.formatError(_error)); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - - return errorsArray.join('\n'); - } - }, { - key: "formatError", - value: function formatError(validationError) { - var constraints = validationError.constraints; - var errorString = "`".concat(validationError.property, "` errors:\n"); - - for (var constraint in constraints) { - if (!constraints.hasOwnProperty(constraint)) { - continue; - } - - errorString += " - ".concat(constraints[constraint], "\n"); - } - - return errorString; - } - }]); - - return ValidationErrorsFormatter; -}(); - -exports.ValidationErrorsFormatter = ValidationErrorsFormatter; - -/***/ }), -/* 163 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _getIterator = __webpack_require__(33); - -var _Object$assign = __webpack_require__(11); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ControlFlowFlatteningThresholdRule_1 = __webpack_require__(164); - -var DeadCodeInjectionRule_1 = __webpack_require__(165); - -var DeadCodeInjectionThresholdRule_1 = __webpack_require__(166); - -var DomainLockRule_1 = __webpack_require__(167); - -var SelfDefendingRule_1 = __webpack_require__(168); - -var SourceMapBaseUrlRule_1 = __webpack_require__(169); - -var SourceMapFileNameRule_1 = __webpack_require__(170); - -var StringArrayRule_1 = __webpack_require__(171); - -var StringArrayEncodingRule_1 = __webpack_require__(172); - -var StringArrayThresholdRule_1 = __webpack_require__(173); - -var OptionsNormalizer = OptionsNormalizer_1 = -/*#__PURE__*/ -function () { - function OptionsNormalizer() { - _classCallCheck(this, OptionsNormalizer); - } - - _createClass(OptionsNormalizer, [{ - key: "normalize", - value: function normalize(options) { - var normalizedOptions = _Object$assign({}, options); - - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = _getIterator(OptionsNormalizer_1.normalizerRules), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var _normalizerRule = _step.value; - normalizedOptions = _normalizerRule(normalizedOptions); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - - return normalizedOptions; - } - }]); - - return OptionsNormalizer; -}(); - -OptionsNormalizer.normalizerRules = [ControlFlowFlatteningThresholdRule_1.ControlFlowFlatteningThresholdRule, DeadCodeInjectionRule_1.DeadCodeInjectionRule, DeadCodeInjectionThresholdRule_1.DeadCodeInjectionThresholdRule, DomainLockRule_1.DomainLockRule, SelfDefendingRule_1.SelfDefendingRule, SourceMapBaseUrlRule_1.SourceMapBaseUrlRule, SourceMapFileNameRule_1.SourceMapFileNameRule, StringArrayRule_1.StringArrayRule, StringArrayEncodingRule_1.StringArrayEncodingRule, StringArrayThresholdRule_1.StringArrayThresholdRule]; -OptionsNormalizer = OptionsNormalizer_1 = tslib_1.__decorate([inversify_1.injectable()], OptionsNormalizer); -exports.OptionsNormalizer = OptionsNormalizer; -var OptionsNormalizer_1; - -/***/ }), -/* 164 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$assign = __webpack_require__(11); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.ControlFlowFlatteningThresholdRule = function (options) { - if (options.controlFlowFlatteningThreshold === 0) { - options = _Object$assign({}, options, { - controlFlowFlattening: false, - controlFlowFlatteningThreshold: 0 - }); - } - - return options; -}; - -/***/ }), -/* 165 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$assign = __webpack_require__(11); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var Default_1 = __webpack_require__(46); - -exports.DeadCodeInjectionRule = function (options) { - if (options.deadCodeInjection) { - options = _Object$assign({}, options, { - deadCodeInjection: true, - stringArray: true - }); - - if (!options.stringArrayThreshold) { - options = _Object$assign({}, options, { - stringArray: true, - stringArrayThreshold: Default_1.DEFAULT_PRESET.stringArrayThreshold - }); - } - } - - return options; -}; - -/***/ }), -/* 166 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$assign = __webpack_require__(11); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.DeadCodeInjectionThresholdRule = function (options) { - if (options.deadCodeInjectionThreshold === 0) { - options = _Object$assign({}, options, { - deadCodeInjection: false, - deadCodeInjectionThreshold: 0 - }); - } - - return options; -}; - -/***/ }), -/* 167 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _getIterator = __webpack_require__(33); - -var _Object$assign = __webpack_require__(11); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var Utils_1 = __webpack_require__(32); - -exports.DomainLockRule = function (options) { - if (options.domainLock.length) { - var normalizedDomains = []; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = _getIterator(options.domainLock), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var _domain = _step.value; - normalizedDomains.push(Utils_1.Utils.extractDomainFromUrl(_domain)); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - - options = _Object$assign({}, options, { - domainLock: normalizedDomains - }); - } - - return options; -}; - -/***/ }), -/* 168 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$assign = __webpack_require__(11); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.SelfDefendingRule = function (options) { - if (options.selfDefending) { - options = _Object$assign({}, options, { - compact: true, - selfDefending: true - }); - } - - return options; -}; - -/***/ }), -/* 169 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$assign = __webpack_require__(11); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.SourceMapBaseUrlRule = function (options) { - var _options = options, - sourceMapBaseUrl = _options.sourceMapBaseUrl; - - if (!options.sourceMapFileName) { - options = _Object$assign({}, options, { - sourceMapBaseUrl: '' - }); - return options; - } - - if (sourceMapBaseUrl && !sourceMapBaseUrl.endsWith('/')) { - options = _Object$assign({}, options, { - sourceMapBaseUrl: "".concat(sourceMapBaseUrl, "/") - }); - } - - return options; -}; - -/***/ }), -/* 170 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$assign = __webpack_require__(11); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.SourceMapFileNameRule = function (options) { - var _options = options, - sourceMapFileName = _options.sourceMapFileName; - - if (sourceMapFileName) { - sourceMapFileName = sourceMapFileName.replace(/^\/+/, '').split('.')[0]; - options = _Object$assign({}, options, { - sourceMapFileName: "".concat(sourceMapFileName, ".js.map") - }); - } - - return options; -}; - -/***/ }), -/* 171 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$assign = __webpack_require__(11); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.StringArrayRule = function (options) { - if (!options.stringArray) { - options = _Object$assign({}, options, { - rotateStringArray: false, - stringArray: false, - stringArrayEncoding: false, - stringArrayThreshold: 0 - }); - } - - return options; -}; - -/***/ }), -/* 172 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$assign = __webpack_require__(11); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var StringArrayEncoding_1 = __webpack_require__(37); - -exports.StringArrayEncodingRule = function (options) { - if (options.stringArrayEncoding === true) { - options = _Object$assign({}, options, { - stringArrayEncoding: StringArrayEncoding_1.StringArrayEncoding.Base64 - }); - } - - return options; -}; - -/***/ }), -/* 173 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$assign = __webpack_require__(11); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.StringArrayThresholdRule = function (options) { - if (options.stringArrayThreshold === 0) { - options = _Object$assign({}, options, { - rotateStringArray: false, - stringArray: false, - stringArrayEncoding: false, - stringArrayThreshold: 0 - }); - } - - return options; -}; - -/***/ }), -/* 174 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var InversifyContainerFacade_1 = __webpack_require__(22); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var NodeTransformer_1 = __webpack_require__(28); - -var ObfuscatingGuard_1 = __webpack_require__(60); - -var BlackListObfuscatingGuard_1 = __webpack_require__(175); - -var CommentsTransformer_1 = __webpack_require__(176); - -var ConditionalCommentObfuscatingGuard_1 = __webpack_require__(177); - -var CustomNodesTransformer_1 = __webpack_require__(178); - -var EvaCallExpressionTransformer_1 = __webpack_require__(179); - -var ObfuscatingGuardsTransformer_1 = __webpack_require__(181); - -var ParentificationTransformer_1 = __webpack_require__(182); - -exports.preparingTransformersModule = new inversify_1.ContainerModule(function (bind) { - bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(CommentsTransformer_1.CommentsTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.CommentsTransformer); - bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(CustomNodesTransformer_1.CustomNodesTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.CustomNodesTransformer); - bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(EvaCallExpressionTransformer_1.EvalCallExpressionTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.EvalCallExpressionTransformer); - bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(ObfuscatingGuardsTransformer_1.ObfuscatingGuardsTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.ObfuscatingGuardsTransformer); - bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeTransformer).to(ParentificationTransformer_1.ParentificationTransformer).whenTargetNamed(NodeTransformer_1.NodeTransformer.ParentificationTransformer); - bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeGuard).to(BlackListObfuscatingGuard_1.BlackListObfuscatingGuard).inSingletonScope().whenTargetNamed(ObfuscatingGuard_1.ObfuscatingGuard.BlackListNodeGuard); - bind(ServiceIdentifiers_1.ServiceIdentifiers.INodeGuard).to(ConditionalCommentObfuscatingGuard_1.ConditionalCommentObfuscatingGuard).inSingletonScope().whenTargetNamed(ObfuscatingGuard_1.ObfuscatingGuard.ConditionalCommentNodeGuard); - bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__INodeGuard).toFactory(InversifyContainerFacade_1.InversifyContainerFacade.getCacheFactory(ServiceIdentifiers_1.ServiceIdentifiers.INodeGuard)); -}); - -/***/ }), -/* 175 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var NodeGuards_1 = __webpack_require__(8); - -var BlackListObfuscatingGuard = BlackListObfuscatingGuard_1 = -/*#__PURE__*/ -function () { - function BlackListObfuscatingGuard() { - _classCallCheck(this, BlackListObfuscatingGuard); - - this.blackListGuardsLength = BlackListObfuscatingGuard_1.blackListGuards.length; - } - - _createClass(BlackListObfuscatingGuard, [{ - key: "check", - value: function check(node) { - for (var i = 0; i < this.blackListGuardsLength; i++) { - if (BlackListObfuscatingGuard_1.blackListGuards[i](node)) { - return false; - } - } - - return true; - } - }]); - - return BlackListObfuscatingGuard; -}(); - -BlackListObfuscatingGuard.blackListGuards = [NodeGuards_1.NodeGuards.isUseStrictOperator]; -BlackListObfuscatingGuard = BlackListObfuscatingGuard_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__metadata("design:paramtypes", [])], BlackListObfuscatingGuard); -exports.BlackListObfuscatingGuard = BlackListObfuscatingGuard; -var BlackListObfuscatingGuard_1; - -/***/ }), -/* 176 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var TransformationStage_1 = __webpack_require__(12); - -var AbstractNodeTransformer_1 = __webpack_require__(13); - -var NodeGuards_1 = __webpack_require__(8); - -var CommentsTransformer = CommentsTransformer_1 = -/*#__PURE__*/ -function (_AbstractNodeTransfor) { - _inherits(CommentsTransformer, _AbstractNodeTransfor); - - function CommentsTransformer(randomGenerator, options) { - _classCallCheck(this, CommentsTransformer); - - return _possibleConstructorReturn(this, (CommentsTransformer.__proto__ || _Object$getPrototypeOf(CommentsTransformer)).call(this, randomGenerator, options)); - } - - _createClass(CommentsTransformer, [{ - key: "getVisitor", - value: function getVisitor(transformationStage) { - var _this = this; - - switch (transformationStage) { - case TransformationStage_1.TransformationStage.Preparing: - return { - leave: function leave(node, parentNode) { - if (parentNode && NodeGuards_1.NodeGuards.isNodeWithComments(node)) { - return _this.transformNode(node, parentNode); - } - } - }; - - default: - return null; - } - } - }, { - key: "transformNode", - value: function transformNode(node, parentNode) { - if (node.leadingComments) { - node.leadingComments = this.transformComments(node.leadingComments); - } - - if (node.trailingComments) { - node.trailingComments = this.transformComments(node.trailingComments); - } - - return node; - } - }, { - key: "transformComments", - value: function transformComments(comments) { - return comments.filter(function (comment) { - return CommentsTransformer_1.preservedWords.some(function (availableWord) { - return comment.value.includes(availableWord); - }); - }); - } - }]); - - return CommentsTransformer; -}(AbstractNodeTransformer_1.AbstractNodeTransformer); - -CommentsTransformer.preservedWords = ['@license', '@preserve']; -CommentsTransformer = CommentsTransformer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object])], CommentsTransformer); -exports.CommentsTransformer = CommentsTransformer; -var CommentsTransformer_1; - -/***/ }), -/* 177 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var NodeGuards_1 = __webpack_require__(8); - -var ConditionalCommentObfuscatingGuard = ConditionalCommentObfuscatingGuard_1 = -/*#__PURE__*/ -function () { - function ConditionalCommentObfuscatingGuard() { - _classCallCheck(this, ConditionalCommentObfuscatingGuard); - - this.obfuscationAllowedForCurrentNode = true; - this.obfuscationAllowedForNextNode = null; - } - - _createClass(ConditionalCommentObfuscatingGuard, [{ - key: "check", - value: function check(node) { - if (this.obfuscationAllowedForNextNode) { - this.obfuscationAllowedForCurrentNode = this.obfuscationAllowedForNextNode; - this.obfuscationAllowedForNextNode = null; - } - - if (!NodeGuards_1.NodeGuards.isNodeWithComments(node)) { - return this.obfuscationAllowedForCurrentNode; - } - - var leadingComments = node.leadingComments; - var trailingComments = node.trailingComments; - - if (leadingComments) { - this.obfuscationAllowedForCurrentNode = this.checkComments(leadingComments); - } - - if (trailingComments) { - this.obfuscationAllowedForNextNode = this.checkComments(trailingComments); - } - - return this.obfuscationAllowedForCurrentNode; - } - }, { - key: "checkComments", - value: function checkComments(comments) { - var commentsLength = comments.length; - var obfuscationAllowed = this.obfuscationAllowedForCurrentNode; - - for (var i = 0; i < commentsLength; i++) { - var comment = comments[i]; - - if (ConditionalCommentObfuscatingGuard_1.obfuscationEnableCommentRegExp.test(comment.value)) { - obfuscationAllowed = true; - continue; - } - - if (ConditionalCommentObfuscatingGuard_1.obfuscationDisableCommentRegExp.test(comment.value)) { - obfuscationAllowed = false; - } - } - - return obfuscationAllowed; - } - }]); - - return ConditionalCommentObfuscatingGuard; -}(); - -ConditionalCommentObfuscatingGuard.obfuscationEnableCommentRegExp = new RegExp('javascript-obfuscator *: *enable'); -ConditionalCommentObfuscatingGuard.obfuscationDisableCommentRegExp = new RegExp('javascript-obfuscator *: *disable'); -ConditionalCommentObfuscatingGuard = ConditionalCommentObfuscatingGuard_1 = tslib_1.__decorate([inversify_1.injectable()], ConditionalCommentObfuscatingGuard); -exports.ConditionalCommentObfuscatingGuard = ConditionalCommentObfuscatingGuard; -var ConditionalCommentObfuscatingGuard_1; - -/***/ }), -/* 178 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var ObfuscationEvent_1 = __webpack_require__(25); - -var TransformationStage_1 = __webpack_require__(12); - -var AbstractNodeTransformer_1 = __webpack_require__(13); - -var NodeGuards_1 = __webpack_require__(8); - -var CustomNodesTransformer = -/*#__PURE__*/ -function (_AbstractNodeTransfor) { - _inherits(CustomNodesTransformer, _AbstractNodeTransfor); - - function CustomNodesTransformer(stackTraceAnalyzer, obfuscationEventEmitter, customNodeGroupStorage, randomGenerator, options) { - var _this; - - _classCallCheck(this, CustomNodesTransformer); - - _this = _possibleConstructorReturn(this, (CustomNodesTransformer.__proto__ || _Object$getPrototypeOf(CustomNodesTransformer)).call(this, randomGenerator, options)); - _this.stackTraceData = []; - _this.stackTraceAnalyzer = stackTraceAnalyzer; - _this.obfuscationEventEmitter = obfuscationEventEmitter; - _this.customNodeGroupStorage = customNodeGroupStorage; - return _this; - } - - _createClass(CustomNodesTransformer, [{ - key: "getVisitor", - value: function getVisitor(transformationStage) { - var _this2 = this; - - switch (transformationStage) { - case TransformationStage_1.TransformationStage.Preparing: - return { - leave: function leave(node, parentNode) { - if (NodeGuards_1.NodeGuards.isProgramNode(node)) { - _this2.analyzeNode(node, parentNode); - - _this2.appendCustomNodesBeforeObfuscation(node, parentNode); - - return _this2.transformNode(node, parentNode); - } - } - }; - - case TransformationStage_1.TransformationStage.Finalizing: - return { - leave: function leave(node, parentNode) { - if (NodeGuards_1.NodeGuards.isProgramNode(node)) { - _this2.appendCustomNodesAfterObfuscation(node, parentNode); - } - } - }; - - default: - return null; - } - } - }, { - key: "analyzeNode", - value: function analyzeNode(node, parentNode) { - this.stackTraceData = this.stackTraceAnalyzer.analyze(node); - } - }, { - key: "transformNode", - value: function transformNode(node, parentNode) { - return node; - } - }, { - key: "appendCustomNodesBeforeObfuscation", - value: function appendCustomNodesBeforeObfuscation(node, parentNode) { - var _this3 = this; - - this.customNodeGroupStorage.getStorage().forEach(function (customNodeGroup) { - customNodeGroup.initialize(); - - _this3.obfuscationEventEmitter.once(customNodeGroup.getAppendEvent(), customNodeGroup.appendCustomNodes.bind(customNodeGroup)); - }); - this.obfuscationEventEmitter.emit(ObfuscationEvent_1.ObfuscationEvent.BeforeObfuscation, node, this.stackTraceData); - } - }, { - key: "appendCustomNodesAfterObfuscation", - value: function appendCustomNodesAfterObfuscation(node, parentNode) { - this.obfuscationEventEmitter.emit(ObfuscationEvent_1.ObfuscationEvent.AfterObfuscation, node, this.stackTraceData); - } - }]); - - return CustomNodesTransformer; -}(AbstractNodeTransformer_1.AbstractNodeTransformer); - -CustomNodesTransformer = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IStackTraceAnalyzer)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IObfuscationEventEmitter)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.TCustomNodeGroupStorage)), tslib_1.__param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(4, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object, Object, Object, Object])], CustomNodesTransformer); -exports.CustomNodesTransformer = CustomNodesTransformer; - -/***/ }), -/* 179 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Set = __webpack_require__(29); - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var js_string_escape_1 = tslib_1.__importDefault(__webpack_require__(180)); - -var TransformationStage_1 = __webpack_require__(12); - -var AbstractNodeTransformer_1 = __webpack_require__(13); - -var NodeGuards_1 = __webpack_require__(8); - -var Nodes_1 = __webpack_require__(15); - -var NodeUtils_1 = __webpack_require__(9); - -var EvalCallExpressionTransformer = EvalCallExpressionTransformer_1 = -/*#__PURE__*/ -function (_AbstractNodeTransfor) { - _inherits(EvalCallExpressionTransformer, _AbstractNodeTransfor); - - function EvalCallExpressionTransformer(randomGenerator, options) { - var _this; - - _classCallCheck(this, EvalCallExpressionTransformer); - - _this = _possibleConstructorReturn(this, (EvalCallExpressionTransformer.__proto__ || _Object$getPrototypeOf(EvalCallExpressionTransformer)).call(this, randomGenerator, options)); - _this.evalRootAstHostNodeSet = new _Set(); - return _this; - } - - _createClass(EvalCallExpressionTransformer, [{ - key: "getVisitor", - value: function getVisitor(transformationStage) { - var _this2 = this; - - switch (transformationStage) { - case TransformationStage_1.TransformationStage.Preparing: - return { - enter: function enter(node, parentNode) { - if (parentNode && NodeGuards_1.NodeGuards.isCallExpressionNode(node) && NodeGuards_1.NodeGuards.isIdentifierNode(node.callee) && node.callee.name === 'eval') { - return _this2.transformNode(node, parentNode); - } - } - }; - - case TransformationStage_1.TransformationStage.Finalizing: - if (!this.evalRootAstHostNodeSet.size) { - return null; - } - - return { - leave: function leave(node, parentNode) { - if (parentNode && _this2.isEvalRootAstHostNode(node)) { - return _this2.restoreNode(node, parentNode); - } - } - }; - - default: - return null; - } - } - }, { - key: "transformNode", - value: function transformNode(callExpressionNode, parentNode) { - var callExpressionFirstArgument = callExpressionNode.arguments[0]; - - if (!callExpressionFirstArgument) { - return callExpressionNode; - } - - var evalString = EvalCallExpressionTransformer_1.extractEvalStringFromCallExpressionArgument(callExpressionFirstArgument); - - if (!evalString) { - return callExpressionNode; - } - - var ast; - - try { - ast = NodeUtils_1.NodeUtils.convertCodeToStructure(evalString); - } catch (_a) { - return callExpressionNode; - } - - var evalRootAstHostNode = Nodes_1.Nodes.getFunctionExpressionNode([], Nodes_1.Nodes.getBlockStatementNode(ast)); - this.evalRootAstHostNodeSet.add(evalRootAstHostNode); - return evalRootAstHostNode; - } - }, { - key: "restoreNode", - value: function restoreNode(evalRootAstHostNode, parentNode) { - var targetAst = evalRootAstHostNode.body.body; - var obfuscatedCode = NodeUtils_1.NodeUtils.convertStructureToCode(targetAst); - return Nodes_1.Nodes.getCallExpressionNode(Nodes_1.Nodes.getIdentifierNode('eval'), [Nodes_1.Nodes.getLiteralNode(js_string_escape_1.default(obfuscatedCode))]); - } - }, { - key: "isEvalRootAstHostNode", - value: function isEvalRootAstHostNode(node) { - return NodeGuards_1.NodeGuards.isFunctionExpressionNode(node) && this.evalRootAstHostNodeSet.has(node); - } - }], [{ - key: "extractEvalStringFromCallExpressionArgument", - value: function extractEvalStringFromCallExpressionArgument(node) { - if (NodeGuards_1.NodeGuards.isLiteralNode(node)) { - return EvalCallExpressionTransformer_1.extractEvalStringFromLiteralNode(node); - } - - if (NodeGuards_1.NodeGuards.isTemplateLiteralNode(node)) { - return EvalCallExpressionTransformer_1.extractEvalStringFromTemplateLiteralNode(node); - } - - return null; - } - }, { - key: "extractEvalStringFromLiteralNode", - value: function extractEvalStringFromLiteralNode(node) { - return typeof node.value === 'string' ? node.value : null; - } - }, { - key: "extractEvalStringFromTemplateLiteralNode", - value: function extractEvalStringFromTemplateLiteralNode(node) { - var quasis = node.quasis; - var allowedQuasisLength = 1; - - if (quasis.length !== allowedQuasisLength || node.expressions.length) { - return null; - } - - return quasis[0].value.cooked; - } - }]); - - return EvalCallExpressionTransformer; -}(AbstractNodeTransformer_1.AbstractNodeTransformer); - -EvalCallExpressionTransformer = EvalCallExpressionTransformer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object])], EvalCallExpressionTransformer); -exports.EvalCallExpressionTransformer = EvalCallExpressionTransformer; -var EvalCallExpressionTransformer_1; - -/***/ }), -/* 180 */ -/***/ (function(module, exports) { - -module.exports = require("js-string-escape"); - -/***/ }), -/* 181 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var ObfuscatingGuard_1 = __webpack_require__(60); - -var TransformationStage_1 = __webpack_require__(12); - -var AbstractNodeTransformer_1 = __webpack_require__(13); - -var ObfuscatingGuardsTransformer = ObfuscatingGuardsTransformer_1 = -/*#__PURE__*/ -function (_AbstractNodeTransfor) { - _inherits(ObfuscatingGuardsTransformer, _AbstractNodeTransfor); - - function ObfuscatingGuardsTransformer(obfuscatingGuardFactory, randomGenerator, options) { - var _this; - - _classCallCheck(this, ObfuscatingGuardsTransformer); - - _this = _possibleConstructorReturn(this, (ObfuscatingGuardsTransformer.__proto__ || _Object$getPrototypeOf(ObfuscatingGuardsTransformer)).call(this, randomGenerator, options)); - _this.obfuscatingGuards = ObfuscatingGuardsTransformer_1.obfuscatingGuardsList.map(obfuscatingGuardFactory); - return _this; - } - - _createClass(ObfuscatingGuardsTransformer, [{ - key: "getVisitor", - value: function getVisitor(transformationStage) { - var _this2 = this; - - switch (transformationStage) { - case TransformationStage_1.TransformationStage.Preparing: - return { - enter: function enter(node, parentNode) { - return _this2.transformNode(node, parentNode); - } - }; - - default: - return null; - } - } - }, { - key: "transformNode", - value: function transformNode(node, parentNode) { - var obfuscationAllowed = this.obfuscatingGuards.every(function (nodeGuard) { - return nodeGuard.check(node); - }); - node.ignoredNode = !obfuscationAllowed; - return node; - } - }]); - - return ObfuscatingGuardsTransformer; -}(AbstractNodeTransformer_1.AbstractNodeTransformer); - -ObfuscatingGuardsTransformer.obfuscatingGuardsList = [ObfuscatingGuard_1.ObfuscatingGuard.BlackListNodeGuard, ObfuscatingGuard_1.ObfuscatingGuard.ConditionalCommentNodeGuard]; -ObfuscatingGuardsTransformer = ObfuscatingGuardsTransformer_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__INodeGuard)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], ObfuscatingGuardsTransformer); -exports.ObfuscatingGuardsTransformer = ObfuscatingGuardsTransformer; -var ObfuscatingGuardsTransformer_1; - -/***/ }), -/* 182 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var TransformationStage_1 = __webpack_require__(12); - -var AbstractNodeTransformer_1 = __webpack_require__(13); - -var NodeUtils_1 = __webpack_require__(9); - -var ParentificationTransformer = -/*#__PURE__*/ -function (_AbstractNodeTransfor) { - _inherits(ParentificationTransformer, _AbstractNodeTransfor); - - function ParentificationTransformer(randomGenerator, options) { - _classCallCheck(this, ParentificationTransformer); - - return _possibleConstructorReturn(this, (ParentificationTransformer.__proto__ || _Object$getPrototypeOf(ParentificationTransformer)).call(this, randomGenerator, options)); - } - - _createClass(ParentificationTransformer, [{ - key: "getVisitor", - value: function getVisitor(transformationStage) { - var _this = this; - - switch (transformationStage) { - case TransformationStage_1.TransformationStage.Preparing: - return { - enter: function enter(node, parentNode) { - return _this.transformNode(node, parentNode); - } - }; - - default: - return null; - } - } - }, { - key: "transformNode", - value: function transformNode(node, parentNode) { - return NodeUtils_1.NodeUtils.parentizeNode(node, parentNode); - } - }]); - - return ParentificationTransformer; -}(AbstractNodeTransformer_1.AbstractNodeTransformer); - -ParentificationTransformer = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object])], ParentificationTransformer); -exports.ParentificationTransformer = ParentificationTransformer; - -/***/ }), -/* 183 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var ControlFlowStorage_1 = __webpack_require__(184); - -var CustomNodeGroupStorage_1 = __webpack_require__(185); - -var StringArrayStorage_1 = __webpack_require__(186); - -exports.storagesModule = new inversify_1.ContainerModule(function (bind) { - bind(ServiceIdentifiers_1.ServiceIdentifiers.TCustomNodeGroupStorage).to(CustomNodeGroupStorage_1.CustomNodeGroupStorage).inSingletonScope(); - bind(ServiceIdentifiers_1.ServiceIdentifiers.TStringArrayStorage).to(StringArrayStorage_1.StringArrayStorage).inSingletonScope(); - bind(ServiceIdentifiers_1.ServiceIdentifiers.Newable__TControlFlowStorage).toConstructor(ControlFlowStorage_1.ControlFlowStorage); - bind(ServiceIdentifiers_1.ServiceIdentifiers.Factory__TControlFlowStorage).toFactory(function (context) { - return function () { - var constructor = context.container.get(ServiceIdentifiers_1.ServiceIdentifiers.Newable__TControlFlowStorage); - var randomGenerator = context.container.get(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator); - var options = context.container.get(ServiceIdentifiers_1.ServiceIdentifiers.IOptions); - var storage = new constructor(randomGenerator, options); - storage.initialize(); - return storage; - }; - }); -}); - -/***/ }), -/* 184 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var MapStorage_1 = __webpack_require__(61); - -var ControlFlowStorage = -/*#__PURE__*/ -function (_MapStorage_1$MapStor) { - _inherits(ControlFlowStorage, _MapStorage_1$MapStor); - - function ControlFlowStorage(randomGenerator, options) { - _classCallCheck(this, ControlFlowStorage); - - return _possibleConstructorReturn(this, (ControlFlowStorage.__proto__ || _Object$getPrototypeOf(ControlFlowStorage)).call(this, randomGenerator, options)); - } - - return ControlFlowStorage; -}(MapStorage_1.MapStorage); - -ControlFlowStorage = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object])], ControlFlowStorage); -exports.ControlFlowStorage = ControlFlowStorage; - -/***/ }), -/* 185 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _get = __webpack_require__(45); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var CustomNodeGroup_1 = __webpack_require__(55); - -var MapStorage_1 = __webpack_require__(61); - -var CustomNodeGroupStorage = CustomNodeGroupStorage_1 = -/*#__PURE__*/ -function (_MapStorage_1$MapStor) { - _inherits(CustomNodeGroupStorage, _MapStorage_1$MapStor); - - function CustomNodeGroupStorage(customNodeGroupFactory, randomGenerator, options) { - var _this; - - _classCallCheck(this, CustomNodeGroupStorage); - - _this = _possibleConstructorReturn(this, (CustomNodeGroupStorage.__proto__ || _Object$getPrototypeOf(CustomNodeGroupStorage)).call(this, randomGenerator, options)); - _this.customNodeGroupFactory = customNodeGroupFactory; - return _this; - } - - _createClass(CustomNodeGroupStorage, [{ - key: "initialize", - value: function initialize() { - var _this2 = this; - - _get(CustomNodeGroupStorage.prototype.__proto__ || _Object$getPrototypeOf(CustomNodeGroupStorage.prototype), "initialize", this).call(this); - - CustomNodeGroupStorage_1.customNodeGroupsList.forEach(function (customNodeGroupName) { - var customNodeGroup = _this2.customNodeGroupFactory(customNodeGroupName); - - if (!customNodeGroup) { - return; - } - - _this2.storage.set(customNodeGroupName, customNodeGroup); - }); - } - }]); - - return CustomNodeGroupStorage; -}(MapStorage_1.MapStorage); - -CustomNodeGroupStorage.customNodeGroupsList = [CustomNodeGroup_1.CustomNodeGroup.ConsoleOutputCustomNodeGroup, CustomNodeGroup_1.CustomNodeGroup.DebugProtectionCustomNodeGroup, CustomNodeGroup_1.CustomNodeGroup.DomainLockCustomNodeGroup, CustomNodeGroup_1.CustomNodeGroup.SelfDefendingCustomNodeGroup, CustomNodeGroup_1.CustomNodeGroup.StringArrayCustomNodeGroup]; - -tslib_1.__decorate([inversify_1.postConstruct(), tslib_1.__metadata("design:type", Function), tslib_1.__metadata("design:paramtypes", []), tslib_1.__metadata("design:returntype", void 0)], CustomNodeGroupStorage.prototype, "initialize", null); - -CustomNodeGroupStorage = CustomNodeGroupStorage_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__ICustomNodeGroup)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], CustomNodeGroupStorage); -exports.CustomNodeGroupStorage = CustomNodeGroupStorage; -var CustomNodeGroupStorage_1; - -/***/ }), -/* 186 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _get = __webpack_require__(45); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var ArrayStorage_1 = __webpack_require__(187); - -var StringArrayStorage = StringArrayStorage_1 = -/*#__PURE__*/ -function (_ArrayStorage_1$Array) { - _inherits(StringArrayStorage, _ArrayStorage_1$Array); - - function StringArrayStorage(identifierNamesGeneratorFactory, arrayUtils, randomGenerator, options) { - var _this; - - _classCallCheck(this, StringArrayStorage); - - _this = _possibleConstructorReturn(this, (StringArrayStorage.__proto__ || _Object$getPrototypeOf(StringArrayStorage)).call(this, randomGenerator, options)); - _this.identifierNamesGenerator = identifierNamesGeneratorFactory(options); - _this.arrayUtils = arrayUtils; - return _this; - } - - _createClass(StringArrayStorage, [{ - key: "initialize", - value: function initialize() { - _get(StringArrayStorage.prototype.__proto__ || _Object$getPrototypeOf(StringArrayStorage.prototype), "initialize", this).call(this); - - var baseStringArrayName = this.identifierNamesGenerator.generate().slice(0, StringArrayStorage_1.stringArrayNameLength); - var baseStringArrayCallsWrapperName = this.identifierNamesGenerator.generate().slice(0, StringArrayStorage_1.stringArrayNameLength); - var stringArrayName = "".concat(this.options.identifiersPrefix).concat(baseStringArrayName); - var stringArrayCallsWrapperName = "".concat(this.options.identifiersPrefix).concat(baseStringArrayCallsWrapperName); - this.storageId = "".concat(stringArrayName, "|").concat(stringArrayCallsWrapperName); - } - }, { - key: "rotateArray", - value: function rotateArray(rotationValue) { - this.storage = this.arrayUtils.arrayRotate(this.storage, rotationValue); - } - }, { - key: "toString", - value: function toString() { - return this.storage.map(function (value) { - return "'".concat(value, "'"); - }).toString(); - } - }]); - - return StringArrayStorage; -}(ArrayStorage_1.ArrayStorage); - -StringArrayStorage.stringArrayNameLength = 7; - -tslib_1.__decorate([inversify_1.postConstruct(), tslib_1.__metadata("design:type", Function), tslib_1.__metadata("design:paramtypes", []), tslib_1.__metadata("design:returntype", void 0)], StringArrayStorage.prototype, "initialize", null); - -StringArrayStorage = StringArrayStorage_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IArrayUtils)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object, Object])], StringArrayStorage); -exports.StringArrayStorage = StringArrayStorage; -var StringArrayStorage_1; - -/***/ }), -/* 187 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _toConsumableArray = __webpack_require__(24); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var Initializable_1 = __webpack_require__(10); - -var ArrayStorage = -/*#__PURE__*/ -function () { - function ArrayStorage(randomGenerator, options) { - _classCallCheck(this, ArrayStorage); - - this.storageLength = 0; - this.randomGenerator = randomGenerator; - this.options = options; - } - - _createClass(ArrayStorage, [{ - key: "initialize", - value: function initialize() { - this.storage = []; - this.storageId = this.randomGenerator.getRandomString(6); - } - }, { - key: "get", - value: function get(key) { - var value = this.storage[key]; - - if (!value) { - throw new Error("No value found in array storage with key `".concat(key, "`")); - } - - return value; - } - }, { - key: "getKeyOf", - value: function getKeyOf(value) { - var key = this.storage.indexOf(value); - return key >= 0 ? key : null; - } - }, { - key: "getLength", - value: function getLength() { - return this.storageLength; - } - }, { - key: "getStorage", - value: function getStorage() { - return this.storage; - } - }, { - key: "getStorageId", - value: function getStorageId() { - return this.storageId; - } - }, { - key: "mergeWith", - value: function mergeWith(storage) { - var mergeId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - this.storage = _toConsumableArray(this.storage).concat(_toConsumableArray(storage.getStorage())); - - if (mergeId) { - this.storageId = storage.getStorageId(); - } - } - }, { - key: "set", - value: function set(key, value) { - if (key === this.storageLength) { - this.storage.push(value); - } else { - this.storage.splice(key, 0, value); - } - - this.storageLength++; - } - }]); - - return ArrayStorage; -}(); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", Array)], ArrayStorage.prototype, "storage", void 0); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], ArrayStorage.prototype, "storageId", void 0); - -tslib_1.__decorate([inversify_1.postConstruct(), tslib_1.__metadata("design:type", Function), tslib_1.__metadata("design:paramtypes", []), tslib_1.__metadata("design:returntype", void 0)], ArrayStorage.prototype, "initialize", null); - -ArrayStorage = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object])], ArrayStorage); -exports.ArrayStorage = ArrayStorage; - -/***/ }), -/* 188 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var ArrayUtils_1 = __webpack_require__(189); - -var CryptUtils_1 = __webpack_require__(190); - -var EscapeSequenceEncoder_1 = __webpack_require__(193); - -var RandomGenerator_1 = __webpack_require__(62); - -exports.utilsModule = new inversify_1.ContainerModule(function (bind) { - bind(ServiceIdentifiers_1.ServiceIdentifiers.IArrayUtils).to(ArrayUtils_1.ArrayUtils).inSingletonScope(); - bind(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator).to(RandomGenerator_1.RandomGenerator).inSingletonScope(); - bind(ServiceIdentifiers_1.ServiceIdentifiers.ICryptUtils).to(CryptUtils_1.CryptUtils).inSingletonScope(); - bind(ServiceIdentifiers_1.ServiceIdentifiers.IEscapeSequenceEncoder).to(EscapeSequenceEncoder_1.EscapeSequenceEncoder).inSingletonScope(); -}); - -/***/ }), -/* 189 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _toConsumableArray = __webpack_require__(24); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var ArrayUtils = -/*#__PURE__*/ -function () { - function ArrayUtils(randomGenerator) { - _classCallCheck(this, ArrayUtils); - - this.randomGenerator = randomGenerator; - } - - _createClass(ArrayUtils, [{ - key: "arrayRange", - value: function arrayRange(length) { - var range = []; - - for (var i = 0; i < length; i++) { - range.push(i); - } - - return range; - } - }, { - key: "arrayRotate", - value: function arrayRotate(array, times) { - if (!array.length) { - throw new ReferenceError("Cannot rotate empty array."); - } - - if (times <= 0) { - return array; - } - - var newArray = array; - var temp; - - while (times--) { - temp = newArray.pop(); - newArray.unshift(temp); - } - - return newArray; - } - }, { - key: "arrayShuffle", - value: function arrayShuffle(array) { - var shuffledArray = _toConsumableArray(array); - - for (var i = shuffledArray.length; i; i--) { - var j = Math.floor(this.randomGenerator.getMathRandom() * i); - var _ref = [shuffledArray[j], shuffledArray[i - 1]]; - shuffledArray[i - 1] = _ref[0]; - shuffledArray[j] = _ref[1]; - } - - return shuffledArray; - } - }]); - - return ArrayUtils; -}(); - -ArrayUtils = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__metadata("design:paramtypes", [Object])], ArrayUtils); -exports.ArrayUtils = ArrayUtils; - -/***/ }), -/* 190 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var RandomGenerator_1 = __webpack_require__(62); - -var Utils_1 = __webpack_require__(32); - -var CryptUtils = -/*#__PURE__*/ -function () { - function CryptUtils(randomGenerator) { - _classCallCheck(this, CryptUtils); - - this.randomGenerator = randomGenerator; - } - - _createClass(CryptUtils, [{ - key: "btoa", - value: function btoa(string) { - var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; - var output = ''; - string = encodeURIComponent(string).replace(/%([0-9A-F]{2})/g, function (match, p1) { - return String.fromCharCode(parseInt("".concat(Utils_1.Utils.hexadecimalPrefix).concat(p1))); - }); - - for (var block, charCode, idx = 0, map = chars; string.charAt(idx | 0) || (map = '=', idx % 1); output += map.charAt(63 & block >> 8 - idx % 1 * 8)) { - charCode = string.charCodeAt(idx += 3 / 4); - - if (charCode > 0xFF) { - throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range."); - } - - block = block << 8 | charCode; - } - - return output; - } - }, { - key: "hideString", - value: function hideString(str, length) { - var _this = this; - - var escapeRegExp = function escapeRegExp(s) { - return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); - }; - - var randomMerge = function randomMerge(s1, s2) { - var i1 = -1; - var i2 = -1; - var result = ''; - - while (i1 < s1.length || i2 < s2.length) { - if (_this.randomGenerator.getMathRandom() < 0.5 && i2 < s2.length) { - result += s2.charAt(++i2); - } else { - result += s1.charAt(++i1); - } - } - - return result; - }; - - var randomString = this.randomGenerator.getRandomGenerator().string({ - length: length, - pool: RandomGenerator_1.RandomGenerator.randomGeneratorPool - }); - var randomStringDiff = randomString.replace(new RegExp("[".concat(escapeRegExp(str), "]"), 'g'), ''); - var randomStringDiffArray = randomStringDiff.split(''); - this.randomGenerator.getRandomGenerator().shuffle(randomStringDiffArray); - randomStringDiff = randomStringDiffArray.join(''); - return [randomMerge(str, randomStringDiff), randomStringDiff]; - } - }, { - key: "rc4", - value: function rc4(string, key) { - var s = [], - j = 0, - x, - result = ''; - - for (var i = 0; i < 256; i++) { - s[i] = i; - } - - for (i = 0; i < 256; i++) { - j = (j + s[i] + key.charCodeAt(i % key.length)) % 256; - x = s[i]; - s[i] = s[j]; - s[j] = x; - } - - i = 0; - j = 0; - - for (var y = 0; y < string.length; y++) { - i = (i + 1) % 256; - j = (j + s[i]) % 256; - x = s[i]; - s[i] = s[j]; - s[j] = x; - result += String.fromCharCode(string.charCodeAt(y) ^ s[(s[i] + s[j]) % 256]); - } - - return result; - } - }]); - - return CryptUtils; -}(); - -CryptUtils = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__metadata("design:paramtypes", [Object])], CryptUtils); -exports.CryptUtils = CryptUtils; - -/***/ }), -/* 191 */ -/***/ (function(module, exports) { - -module.exports = require("md5"); - -/***/ }), -/* 192 */ -/***/ (function(module, exports) { - -module.exports = require("chance"); - -/***/ }), -/* 193 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Map = __webpack_require__(16); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var EscapeSequenceEncoder = -/*#__PURE__*/ -function () { - function EscapeSequenceEncoder() { - _classCallCheck(this, EscapeSequenceEncoder); - - this.stringsCache = new _Map(); - } - - _createClass(EscapeSequenceEncoder, [{ - key: "encode", - value: function encode(string, encodeAllSymbols) { - var cacheKey = "".concat(string, "-").concat(String(encodeAllSymbols)); - - if (this.stringsCache.has(cacheKey)) { - return this.stringsCache.get(cacheKey); - } - - var radix = 16; - var replaceRegExp = new RegExp('[\\s\\S]', 'g'); - var escapeSequenceRegExp = new RegExp('[\'\"\\\\\\s]'); - var regExp = new RegExp('[\\x00-\\x7F]'); - var prefix; - var template; - var result = string.replace(replaceRegExp, function (character) { - if (!encodeAllSymbols && !escapeSequenceRegExp.exec(character)) { - return character; - } - - if (regExp.exec(character)) { - prefix = '\\x'; - template = '00'; - } else { - prefix = "\\u"; - template = '0000'; - } - - return "".concat(prefix).concat((template + character.charCodeAt(0).toString(radix)).slice(-template.length)); - }); - this.stringsCache.set(cacheKey, result); - return result; - } - }]); - - return EscapeSequenceEncoder; -}(); - -EscapeSequenceEncoder = tslib_1.__decorate([inversify_1.injectable()], EscapeSequenceEncoder); -exports.EscapeSequenceEncoder = EscapeSequenceEncoder; - -/***/ }), -/* 194 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$assign = __webpack_require__(11); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var escodegen = tslib_1.__importStar(__webpack_require__(42)); - -var packageJson = tslib_1.__importStar(__webpack_require__(63)); - -var LoggingMessage_1 = __webpack_require__(195); - -var NodeTransformer_1 = __webpack_require__(28); - -var TransformationStage_1 = __webpack_require__(12); - -var EsprimaFacade_1 = __webpack_require__(196); - -var NodeGuards_1 = __webpack_require__(8); - -var JavaScriptObfuscator = JavaScriptObfuscator_1 = -/*#__PURE__*/ -function () { - function JavaScriptObfuscator(transformersRunner, sourceMapCorrector, randomGenerator, logger, options) { - _classCallCheck(this, JavaScriptObfuscator); - - this.transformersRunner = transformersRunner; - this.sourceMapCorrector = sourceMapCorrector; - this.randomGenerator = randomGenerator; - this.logger = logger; - this.options = options; - } - - _createClass(JavaScriptObfuscator, [{ - key: "obfuscate", - value: function obfuscate(sourceCode) { - var timeStart = Date.now(); - this.logger.info(LoggingMessage_1.LoggingMessage.Version, packageJson.version); - this.logger.info(LoggingMessage_1.LoggingMessage.ObfuscationStarted); - this.logger.info(LoggingMessage_1.LoggingMessage.RandomGeneratorSeed, this.randomGenerator.getSeed()); - var astTree = this.parseCode(sourceCode); - var obfuscatedAstTree = this.transformAstTree(astTree); - var generatorOutput = this.generateCode(sourceCode, obfuscatedAstTree); - var obfuscationTime = (Date.now() - timeStart) / 1000; - this.logger.success(LoggingMessage_1.LoggingMessage.ObfuscationCompleted, obfuscationTime); - return this.getObfuscationResult(generatorOutput); - } - }, { - key: "parseCode", - value: function parseCode(sourceCode) { - return EsprimaFacade_1.EsprimaFacade.parse(sourceCode, { - attachComment: true, - loc: this.options.sourceMap - }); - } - }, { - key: "transformAstTree", - value: function transformAstTree(astTree) { - var isEmptyAstTree = NodeGuards_1.NodeGuards.isProgramNode(astTree) && !astTree.body.length && !astTree.leadingComments; - - if (isEmptyAstTree) { - this.logger.warn(LoggingMessage_1.LoggingMessage.EmptySourceCode); - return astTree; - } - - astTree = this.runTransformationStage(astTree, TransformationStage_1.TransformationStage.Preparing); - - if (this.options.deadCodeInjection) { - astTree = this.runTransformationStage(astTree, TransformationStage_1.TransformationStage.DeadCodeInjection); - } - - if (this.options.controlFlowFlattening) { - astTree = this.runTransformationStage(astTree, TransformationStage_1.TransformationStage.ControlFlowFlattening); - } - - astTree = this.runTransformationStage(astTree, TransformationStage_1.TransformationStage.Converting); - astTree = this.runTransformationStage(astTree, TransformationStage_1.TransformationStage.Obfuscating); - astTree = this.runTransformationStage(astTree, TransformationStage_1.TransformationStage.Finalizing); - return astTree; - } - }, { - key: "generateCode", - value: function generateCode(sourceCode, astTree) { - var escodegenParams = _Object$assign({}, JavaScriptObfuscator_1.escodegenParams); - - if (this.options.sourceMap) { - escodegenParams.sourceMap = 'sourceMap'; - escodegenParams.sourceContent = sourceCode; - } - - var generatorOutput = escodegen.generate(astTree, _Object$assign({}, escodegenParams, { - format: { - compact: this.options.compact - } - })); - generatorOutput.map = generatorOutput.map ? generatorOutput.map.toString() : ''; - return generatorOutput; - } - }, { - key: "getObfuscationResult", - value: function getObfuscationResult(generatorOutput) { - return this.sourceMapCorrector.correct(generatorOutput.code, generatorOutput.map); - } - }, { - key: "runTransformationStage", - value: function runTransformationStage(astTree, transformationStage) { - this.logger.info(LoggingMessage_1.LoggingMessage.TransformationStage, transformationStage); - return this.transformersRunner.transform(astTree, JavaScriptObfuscator_1.transformersList, transformationStage); - } - }]); - - return JavaScriptObfuscator; -}(); - -JavaScriptObfuscator.escodegenParams = { - comment: true, - verbatim: 'x-verbatim-property', - sourceMapWithCode: true -}; -JavaScriptObfuscator.transformersList = [NodeTransformer_1.NodeTransformer.BlockStatementControlFlowTransformer, NodeTransformer_1.NodeTransformer.ClassDeclarationTransformer, NodeTransformer_1.NodeTransformer.CommentsTransformer, NodeTransformer_1.NodeTransformer.CustomNodesTransformer, NodeTransformer_1.NodeTransformer.DeadCodeInjectionTransformer, NodeTransformer_1.NodeTransformer.EvalCallExpressionTransformer, NodeTransformer_1.NodeTransformer.FunctionControlFlowTransformer, NodeTransformer_1.NodeTransformer.CatchClauseTransformer, NodeTransformer_1.NodeTransformer.FunctionDeclarationTransformer, NodeTransformer_1.NodeTransformer.FunctionTransformer, NodeTransformer_1.NodeTransformer.LabeledStatementTransformer, NodeTransformer_1.NodeTransformer.LiteralTransformer, NodeTransformer_1.NodeTransformer.MemberExpressionTransformer, NodeTransformer_1.NodeTransformer.MethodDefinitionTransformer, NodeTransformer_1.NodeTransformer.ObfuscatingGuardsTransformer, NodeTransformer_1.NodeTransformer.ObjectExpressionKeysTransformer, NodeTransformer_1.NodeTransformer.ObjectExpressionTransformer, NodeTransformer_1.NodeTransformer.ParentificationTransformer, NodeTransformer_1.NodeTransformer.TemplateLiteralTransformer, NodeTransformer_1.NodeTransformer.VariableDeclarationTransformer]; -JavaScriptObfuscator = JavaScriptObfuscator_1 = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ITransformersRunner)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ISourceMapCorrector)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IRandomGenerator)), tslib_1.__param(3, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ILogger)), tslib_1.__param(4, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Object, Object, Object, Object, Object])], JavaScriptObfuscator); -exports.JavaScriptObfuscator = JavaScriptObfuscator; -var JavaScriptObfuscator_1; - -/***/ }), -/* 195 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var LoggingMessage; - -(function (LoggingMessage) { - LoggingMessage["EmptySourceCode"] = "Empty source code. Obfuscation canceled..."; - LoggingMessage["ObfuscationCompleted"] = "Obfuscation completed. Total time: %s sec."; - LoggingMessage["ObfuscationStarted"] = "Obfuscation started..."; - LoggingMessage["RandomGeneratorSeed"] = "Random generator seed: %s..."; - LoggingMessage["TransformationStage"] = "Transformation stage: %s..."; - LoggingMessage["Version"] = "Version: %s"; -})(LoggingMessage = exports.LoggingMessage || (exports.LoggingMessage = {})); - -/***/ }), -/* 196 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var esprima = tslib_1.__importStar(__webpack_require__(51)); - -var chalk_1 = tslib_1.__importDefault(__webpack_require__(64)); - -var EsprimaFacade = -/*#__PURE__*/ -function () { - function EsprimaFacade() { - _classCallCheck(this, EsprimaFacade); - } - - _createClass(EsprimaFacade, null, [{ - key: "parse", - value: function parse(input, config) { - var lastMeta = null; - - try { - return esprima.parseScript(input, config, function (node, meta) { - return lastMeta = meta; - }); - } catch (_a) {} - - try { - return esprima.parseModule(input, config, function (node, meta) { - return lastMeta = meta; - }); - } catch (error) { - return EsprimaFacade.processParsingError(input, error.message, lastMeta); - } - } - }, { - key: "processParsingError", - value: function processParsingError(sourceCode, errorMessage, meta) { - if (!meta || !meta.start || !meta.end || !meta.start.column || !meta.end.column) { - throw new Error(errorMessage); - } - - var lineNumberMatch = errorMessage.match(/Line *(\d*)/); - - if (!lineNumberMatch) { - throw new Error(errorMessage); - } - - var lineNumber = parseInt(lineNumberMatch[1], 10); - var sourceCodeLines = sourceCode.split(/\r?\n/); - var errorLine = sourceCodeLines[lineNumber - 1]; - - if (!errorLine) { - throw new Error(errorMessage); - } - - var startErrorIndex = Math.max(0, meta.start.column - EsprimaFacade.nearestSymbolsCount); - var endErrorIndex = Math.min(errorLine.length, meta.end.column + EsprimaFacade.nearestSymbolsCount); - var formattedPointer = EsprimaFacade.colorError('>'); - var formattedCodeSlice = "...".concat(errorLine.substring(startErrorIndex, endErrorIndex).replace(/^\s+/, ''), "..."); - throw new Error("".concat(errorMessage, "\n").concat(formattedPointer, " ").concat(formattedCodeSlice)); - } - }]); - - return EsprimaFacade; -}(); - -EsprimaFacade.colorError = chalk_1.default.red; -EsprimaFacade.nearestSymbolsCount = 10; -exports.EsprimaFacade = EsprimaFacade; - -/***/ }), -/* 197 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$getPrototypeOf = __webpack_require__(5); - -var _classCallCheck = __webpack_require__(0); - -var _possibleConstructorReturn = __webpack_require__(6); - -var _inherits = __webpack_require__(7); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var events_1 = __webpack_require__(198); - -inversify_1.decorate(inversify_1.injectable(), events_1.EventEmitter); - -var ObfuscationEventEmitter = -/*#__PURE__*/ -function (_events_1$EventEmitte) { - _inherits(ObfuscationEventEmitter, _events_1$EventEmitte); - - function ObfuscationEventEmitter() { - _classCallCheck(this, ObfuscationEventEmitter); - - return _possibleConstructorReturn(this, (ObfuscationEventEmitter.__proto__ || _Object$getPrototypeOf(ObfuscationEventEmitter)).apply(this, arguments)); - } - - return ObfuscationEventEmitter; -}(events_1.EventEmitter); - -ObfuscationEventEmitter = tslib_1.__decorate([inversify_1.injectable()], ObfuscationEventEmitter); -exports.ObfuscationEventEmitter = ObfuscationEventEmitter; - -/***/ }), -/* 198 */ -/***/ (function(module, exports) { - -module.exports = require("events"); - -/***/ }), -/* 199 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var Initializable_1 = __webpack_require__(10); - -var ObfuscationResult = -/*#__PURE__*/ -function () { - function ObfuscationResult() { - _classCallCheck(this, ObfuscationResult); - } - - _createClass(ObfuscationResult, [{ - key: "initialize", - value: function initialize(obfuscatedCode, sourceMap) { - this.obfuscatedCode = obfuscatedCode; - this.sourceMap = sourceMap; - } - }, { - key: "getObfuscatedCode", - value: function getObfuscatedCode() { - return this.obfuscatedCode; - } - }, { - key: "getSourceMap", - value: function getSourceMap() { - return this.sourceMap; - } - }, { - key: "toString", - value: function toString() { - return this.obfuscatedCode; - } - }]); - - return ObfuscationResult; -}(); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], ObfuscationResult.prototype, "obfuscatedCode", void 0); - -tslib_1.__decorate([Initializable_1.initializable(), tslib_1.__metadata("design:type", String)], ObfuscationResult.prototype, "sourceMap", void 0); - -ObfuscationResult = tslib_1.__decorate([inversify_1.injectable()], ObfuscationResult); -exports.ObfuscationResult = ObfuscationResult; - -/***/ }), -/* 200 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var SourceCode = -/*#__PURE__*/ -function () { - function SourceCode(sourceCode) { - _classCallCheck(this, SourceCode); - - this.sourceCode = sourceCode; - } - - _createClass(SourceCode, [{ - key: "getSourceCode", - value: function getSourceCode() { - return this.sourceCode; - } - }]); - - return SourceCode; -}(); - -exports.SourceCode = SourceCode; - -/***/ }), -/* 201 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var SourceMapMode_1 = __webpack_require__(36); - -var SourceMapCorrector = -/*#__PURE__*/ -function () { - function SourceMapCorrector(obfuscationResultFactory, cryptUtils, options) { - _classCallCheck(this, SourceMapCorrector); - - this.obfuscationResultFactory = obfuscationResultFactory; - this.cryptUtils = cryptUtils; - this.options = options; - } - - _createClass(SourceMapCorrector, [{ - key: "correct", - value: function correct(obfuscatedCode, sourceMap) { - return this.obfuscationResultFactory(this.correctObfuscatedCode(obfuscatedCode, sourceMap), sourceMap); - } - }, { - key: "correctObfuscatedCode", - value: function correctObfuscatedCode(obfuscatedCode, sourceMap) { - if (!sourceMap) { - return obfuscatedCode; - } - - var sourceMapUrl = this.options.sourceMapBaseUrl + this.options.sourceMapFileName; - var sourceMappingUrl = '//# sourceMappingURL='; - - switch (this.options.sourceMapMode) { - case SourceMapMode_1.SourceMapMode.Inline: - sourceMappingUrl += "data:application/json;base64,".concat(this.cryptUtils.btoa(sourceMap)); - break; - - case SourceMapMode_1.SourceMapMode.Separate: - default: - if (!sourceMapUrl) { - return obfuscatedCode; - } - - sourceMappingUrl += sourceMapUrl; - break; - } - - return "".concat(obfuscatedCode, "\n").concat(sourceMappingUrl); - } - }]); - - return SourceMapCorrector; -}(); - -SourceMapCorrector = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__IObfuscationResult)), tslib_1.__param(1, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.ICryptUtils)), tslib_1.__param(2, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.IOptions)), tslib_1.__metadata("design:paramtypes", [Function, Object, Object])], SourceMapCorrector); -exports.SourceMapCorrector = SourceMapCorrector; - -/***/ }), -/* 202 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var tslib_1 = __webpack_require__(4); - -var inversify_1 = __webpack_require__(1); - -var ServiceIdentifiers_1 = __webpack_require__(3); - -var estraverse = tslib_1.__importStar(__webpack_require__(17)); - -var VisitorDirection_1 = __webpack_require__(203); - -var NodeGuards_1 = __webpack_require__(8); - -var TransformersRunner = -/*#__PURE__*/ -function () { - function TransformersRunner(nodeTransformerFactory) { - _classCallCheck(this, TransformersRunner); - - this.nodeTransformerFactory = nodeTransformerFactory; - } - - _createClass(TransformersRunner, [{ - key: "transform", - value: function transform(astTree, nodeTransformers, transformationStage) { - if (!nodeTransformers.length) { - return astTree; - } - - var enterVisitors = []; - var leaveVisitors = []; - var nodeTransformersLength = nodeTransformers.length; - var visitor; - - for (var i = 0; i < nodeTransformersLength; i++) { - visitor = this.nodeTransformerFactory(nodeTransformers[i]).getVisitor(transformationStage); - - if (!visitor) { - continue; - } - - if (visitor.enter) { - enterVisitors.push({ - enter: visitor.enter - }); - } - - if (visitor.leave) { - leaveVisitors.push({ - leave: visitor.leave - }); - } - } - - if (!enterVisitors.length && !leaveVisitors.length) { - return astTree; - } - - estraverse.replace(astTree, { - enter: this.mergeVisitorsForDirection(enterVisitors, VisitorDirection_1.VisitorDirection.Enter), - leave: this.mergeVisitorsForDirection(leaveVisitors, VisitorDirection_1.VisitorDirection.Leave) - }); - return astTree; - } - }, { - key: "mergeVisitorsForDirection", - value: function mergeVisitorsForDirection(visitors, direction) { - var visitorsLength = visitors.length; - - if (!visitorsLength) { - return function (node, parentNode) { - return node; - }; - } - - return function (node, parentNode) { - if (node.ignoredNode) { - return estraverse.VisitorOption.Skip; - } - - for (var i = 0; i < visitorsLength; i++) { - var visitorFunction = visitors[i][direction]; - - if (!visitorFunction) { - continue; - } - - var visitorResult = visitorFunction(node, parentNode); - - if (!visitorResult || !NodeGuards_1.NodeGuards.isNode(visitorResult)) { - continue; - } - - node = visitorResult; - } - - return node; - }; - } - }]); - - return TransformersRunner; -}(); - -TransformersRunner = tslib_1.__decorate([inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(ServiceIdentifiers_1.ServiceIdentifiers.Factory__INodeTransformer)), tslib_1.__metadata("design:paramtypes", [Function])], TransformersRunner); -exports.TransformersRunner = TransformersRunner; - -/***/ }), -/* 203 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var VisitorDirection; - -(function (VisitorDirection) { - VisitorDirection["Enter"] = "enter"; - VisitorDirection["Leave"] = "leave"; -})(VisitorDirection = exports.VisitorDirection || (exports.VisitorDirection = {})); - -/***/ }), -/* 204 */ -/***/ (function(module, exports) { - -module.exports = require("commander"); - -/***/ }), -/* 205 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.ArraySanitizer = function (value) { - if (/,$/.test(value)) { - throw new SyntaxError("Multiple values should be wrapped inside quotes: --option-name 'value1, value2'"); - } - - return value.split(',').map(function (string) { - return string.trim(); - }); -}; - -/***/ }), -/* 206 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.BooleanSanitizer = function (value) { - return value === 'true' || value === '1'; -}; - -/***/ }), -/* 207 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$keys = __webpack_require__(38); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var IdentifierNamesGenerator_1 = __webpack_require__(35); - -exports.IdentifierNamesGeneratorSanitizer = function (value) { - var isCorrectIdentifierNamesGenerator = _Object$keys(IdentifierNamesGenerator_1.IdentifierNamesGenerator).some(function (key) { - return IdentifierNamesGenerator_1.IdentifierNamesGenerator[key] === value; - }); - - if (!isCorrectIdentifierNamesGenerator) { - throw new ReferenceError('Invalid value of `--identifier-names-generator` option'); - } - - return value; -}; - -/***/ }), -/* 208 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$keys = __webpack_require__(38); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var ObfuscationTarget_1 = __webpack_require__(21); - -exports.ObfuscationTargetSanitizer = function (value) { - var isCorrectTarget = _Object$keys(ObfuscationTarget_1.ObfuscationTarget).some(function (key) { - return ObfuscationTarget_1.ObfuscationTarget[key] === value; - }); - - if (!isCorrectTarget) { - throw new ReferenceError('Invalid value of `--target` option'); - } - - return value; -}; - -/***/ }), -/* 209 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _Object$keys = __webpack_require__(38); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var SourceMapMode_1 = __webpack_require__(36); - -exports.SourceMapModeSanitizer = function (value) { - var isCorrectSourceMapMode = _Object$keys(SourceMapMode_1.SourceMapMode).some(function (key) { - return SourceMapMode_1.SourceMapMode[key] === value; - }); - - if (!isCorrectSourceMapMode) { - throw new ReferenceError('Invalid value of `--source-map-mode` option'); - } - - return value; -}; - -/***/ }), -/* 210 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var StringArrayEncoding_1 = __webpack_require__(37); - -exports.StringArrayEncodingSanitizer = function (value) { - switch (value) { - case 'true': - case '1': - case StringArrayEncoding_1.StringArrayEncoding.Base64: - return true; - - case StringArrayEncoding_1.StringArrayEncoding.Rc4: - return StringArrayEncoding_1.StringArrayEncoding.Rc4; - - default: - return false; - } -}; - -/***/ }), -/* 211 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var fs = __importStar(__webpack_require__(67)); - -var mkdirp = __importStar(__webpack_require__(212)); - -var path = __importStar(__webpack_require__(48)); - -var JavaScriptObfuscatorCLI_1 = __webpack_require__(47); - -var CLIUtils = -/*#__PURE__*/ -function () { - function CLIUtils() { - _classCallCheck(this, CLIUtils); - } - - _createClass(CLIUtils, null, [{ - key: "getOutputCodePath", - value: function getOutputCodePath(inputPath) { - return path.normalize(inputPath).split('.').map(function (value, index) { - return index === 0 ? "".concat(value).concat(JavaScriptObfuscatorCLI_1.JavaScriptObfuscatorCLI.obfuscatedFilePrefix) : value; - }).join('.'); - } - }, { - key: "getOutputSourceMapPath", - value: function getOutputSourceMapPath(outputCodePath) { - var sourceMapFileName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; - - if (sourceMapFileName) { - outputCodePath = "".concat(outputCodePath.substring(0, outputCodePath.lastIndexOf('/')), "/").concat(sourceMapFileName); - } - - if (!/\.js\.map$/.test(outputCodePath)) { - outputCodePath = "".concat(outputCodePath.split('.')[0], ".js.map"); - } else if (/\.js$/.test(outputCodePath)) { - outputCodePath += '.map'; - } - - return outputCodePath; - } - }, { - key: "getUserConfig", - value: function getUserConfig(configPath) { - var config; - - try { - config = !(function webpackMissingModule() { var e = new Error("Cannot find module \".\""); e.code = 'MODULE_NOT_FOUND'; throw e; }()); - } catch (_a) { - try { - config = require(configPath); - } catch (_b) { - throw new ReferenceError('Given config path must be a valid `.js` or `.json` file path'); - } - } - - return config; - } - }, { - key: "writeFile", - value: function writeFile(outputPath, data) { - mkdirp.sync(path.dirname(outputPath)); - fs.writeFileSync(outputPath, data, { - encoding: JavaScriptObfuscatorCLI_1.JavaScriptObfuscatorCLI.encoding - }); - } - }]); - - return CLIUtils; -}(); - -exports.CLIUtils = CLIUtils; - -/***/ }), -/* 212 */ -/***/ (function(module, exports) { - -module.exports = require("mkdirp"); - -/***/ }), -/* 213 */ -/***/ (function(module, exports) { - -function webpackEmptyContext(req) { - throw new Error("Cannot find module '" + req + "'."); -} -webpackEmptyContext.keys = function() { return []; }; -webpackEmptyContext.resolve = webpackEmptyContext; -module.exports = webpackEmptyContext; -webpackEmptyContext.id = 213; - -/***/ }), -/* 214 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _toConsumableArray = __webpack_require__(24); - -var _classCallCheck = __webpack_require__(0); - -var _createClass = __webpack_require__(2); - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var fs = __importStar(__webpack_require__(67)); - -var path = __importStar(__webpack_require__(48)); - -var multimatch_1 = __importDefault(__webpack_require__(215)); - -var LoggingPrefix_1 = __webpack_require__(66); - -var JavaScriptObfuscatorCLI_1 = __webpack_require__(47); - -var Logger_1 = __webpack_require__(65); - -var SourceCodeReader = -/*#__PURE__*/ -function () { - function SourceCodeReader(options) { - _classCallCheck(this, SourceCodeReader); - - this.options = options; - } - - _createClass(SourceCodeReader, [{ - key: "readSourceCode", - value: function readSourceCode(inputPath) { - if (SourceCodeReader.isFilePath(inputPath) && this.isValidFile(inputPath)) { - return this.readFile(inputPath); - } - - if (SourceCodeReader.isDirectoryPath(inputPath) && this.isValidDirectory(inputPath)) { - return this.readDirectoryRecursive(inputPath); - } - - var availableFilePaths = SourceCodeReader.availableInputExtensions.map(function (extension) { - return "`".concat(extension, "`"); - }).join(', '); - throw new ReferenceError("Given input path must be a valid ".concat(availableFilePaths, " file or directory path")); - } - }, { - key: "readDirectoryRecursive", - value: function readDirectoryRecursive(directoryPath) { - var _this = this; - - var fileData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; - fs.readdirSync(directoryPath, JavaScriptObfuscatorCLI_1.JavaScriptObfuscatorCLI.encoding).forEach(function (fileName) { - var filePath = "".concat(directoryPath, "/").concat(fileName); - - if (SourceCodeReader.isDirectoryPath(filePath) && _this.isValidDirectory(filePath)) { - fileData.push.apply(fileData, _toConsumableArray(_this.readDirectoryRecursive(filePath))); - } else if (SourceCodeReader.isFilePath(filePath) && _this.isValidFile(filePath)) { - var content = _this.readFile(filePath); - - fileData.push({ - filePath: filePath, - content: content - }); - } - }); - return fileData; - } - }, { - key: "readFile", - value: function readFile(filePath) { - SourceCodeReader.logFilePath(filePath); - return fs.readFileSync(filePath, JavaScriptObfuscatorCLI_1.JavaScriptObfuscatorCLI.encoding); - } - }, { - key: "isValidDirectory", - value: function isValidDirectory(directoryPath) { - return !SourceCodeReader.isExcludedPath(directoryPath, this.options.exclude); - } - }, { - key: "isValidFile", - value: function isValidFile(filePath) { - return SourceCodeReader.availableInputExtensions.includes(path.extname(filePath)) && !filePath.includes(JavaScriptObfuscatorCLI_1.JavaScriptObfuscatorCLI.obfuscatedFilePrefix) && !SourceCodeReader.isExcludedPath(filePath, this.options.exclude); - } - }], [{ - key: "isExcludedPath", - value: function isExcludedPath(filePath) { - var excludePatterns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; - - if (!excludePatterns.length) { - return false; - } - - var fileName = path.basename(filePath); - var isExcludedFilePathByGlobPattern = !!multimatch_1.default([filePath], excludePatterns).length; - var isExcludedFilePathByInclusion = excludePatterns.some(function (excludePattern) { - return filePath.includes(excludePattern) || fileName.includes(excludePattern); - }); - return isExcludedFilePathByInclusion || isExcludedFilePathByGlobPattern; - } - }, { - key: "isDirectoryPath", - value: function isDirectoryPath(filePath) { - try { - return fs.statSync(filePath).isDirectory(); - } catch (_a) { - return false; - } - } - }, { - key: "isFilePath", - value: function isFilePath(filePath) { - try { - return fs.statSync(filePath).isFile(); - } catch (_a) { - return false; - } - } - }, { - key: "logFilePath", - value: function logFilePath(filePath) { - var normalizedFilePath = path.normalize(filePath); - Logger_1.Logger.log(Logger_1.Logger.colorInfo, LoggingPrefix_1.LoggingPrefix.CLI, "Obfuscating file: ".concat(normalizedFilePath, "...")); - } - }]); - - return SourceCodeReader; -}(); - -SourceCodeReader.availableInputExtensions = ['.js']; -exports.SourceCodeReader = SourceCodeReader; - -/***/ }), -/* 215 */ -/***/ (function(module, exports) { - -module.exports = require("multimatch"); - -/***/ }) -/******/ ]); +require("source-map-support").install(),module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r.w={},r(r.s=215)}([function(e,t){e.exports=require("inversify")},function(e,t){e.exports=require("@babel/runtime/helpers/classCallCheck")},function(e,t){e.exports=require("@babel/runtime/helpers/createClass")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Factory__ICalleeDataExtractor="Factory",e.Factory__IControlFlowCustomNode="Factory",e.Factory__IControlFlowReplacer="Factory",e.Factory__ICustomNode="Factory",e.Factory__ICustomNodeGroup="Factory",e.Factory__IDeadCodeInjectionCustomNode="Factory",e.Factory__IIdentifierNamesGenerator="Factory",e.Factory__IIdentifierObfuscatingReplacer="Factory",e.Factory__INodeGuard="Factory",e.Factory__INodeTransformer="Factory",e.Factory__IObfuscationResult="Factory",e.Factory__IObfuscatingReplacer="Factory",e.Factory__TControlFlowStorage="Factory",e.IArrayUtils="IArrayUtils",e.ICalleeDataExtractor="ICalleeDataExtractor",e.ICryptUtils="ICryptUtils",e.ICustomNode="ICustomNode",e.ICustomNodeGroup="ICustomNodeGroup",e.IControlFlowReplacer="IControlFlowReplacer",e.IEscapeSequenceEncoder="IEscapeSequenceEncoder",e.IIdentifierNamesGenerator="IIdentifierNamesGenerator",e.IIdentifierObfuscatingReplacer="IIdentifierObfuscatingReplacer",e.IJavaScriptObfuscator="IJavaScriptObfuscator",e.ILogger="ILogger",e.INodeGuard="INodeGuard",e.INodeTransformer="INodeTransformer",e.IObfuscationEventEmitter="IObfuscationEventEmitter",e.IObfuscationResult="IObfuscationResult",e.IOptions="IOptions",e.IOptionsNormalizer="IOptionsNormalizer",e.IObfuscatingReplacer="IObfuscatingReplacer",e.IRandomGenerator="IRandomGenerator",e.ISourceCode="ISourceCode",e.ISourceMapCorrector="ISourceMapCorrector",e.IStackTraceAnalyzer="IStackTraceAnalyzer",e.ITransformersRunner="ITransformersRunner",e.Newable__ICustomNode="Newable",e.Newable__TControlFlowStorage="Newable",e.TCustomNodeGroupStorage="TCustomNodeGroupStorage",e.TInputOptions="TInputOptions",e.TStringArrayStorage="TStringArrayStorage"}(t.ServiceIdentifiers||(t.ServiceIdentifiers={}))},function(e,t){e.exports=require("tslib")},function(e,t){e.exports=require("@babel/runtime/helpers/inherits")},function(e,t){e.exports=require("@babel/runtime/helpers/possibleConstructorReturn")},function(e,t){e.exports=require("@babel/runtime/core-js/object/get-prototype-of")},function(e,t,r){"use strict";var n=r(66),o=r(1),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i=__importStar(r(47)),s=__importStar(r(65)),c=__importStar(r(17)),u=r(9),d=function(){function e(){o(this,e)}return a(e,null,[{key:"addXVerbatimPropertyToLiterals",value:function(e){return c.replace(e,{leave:function(e){u.NodeGuards.isLiteralNode(e)&&(e["x-verbatim-property"]={content:e.raw,precedence:i.Precedence.Primary})}}),e}},{key:"clone",value:function(t){return e.parentize(e.cloneRecursive(t))}},{key:"convertCodeToStructure",value:function(t){var r=s.parseScript(t);return r=e.addXVerbatimPropertyToLiterals(r),(r=e.parentize(r)).body}},{key:"convertStructureToCode",value:function(e){return e.reduce(function(e,t){return e+i.generate(t,{sourceMapWithCode:!0}).code},"")}},{key:"getBlockScopesOfNode",value:function(t){return e.getBlockScopesOfNodeRecursive(t)}},{key:"getNextSiblingStatementNode",value:function(t){return e.getSiblingStatementNodeByOffset(t,1)}},{key:"getPreviousSiblingStatementNode",value:function(t){return e.getSiblingStatementNodeByOffset(t,-1)}},{key:"getScopeOfNode",value:function(t){var r=t.parentNode;if(!r)throw new ReferenceError("`parentNode` property of given node is `undefined`");return u.NodeGuards.isNodeHasScope(r)?r:e.getScopeOfNode(r)}},{key:"getUnaryExpressionArgumentNode",value:function(t){return u.NodeGuards.isUnaryExpressionNode(t.argument)?e.getUnaryExpressionArgumentNode(t.argument):t.argument}},{key:"parentize",value:function(t){return c.replace(t,{enter:e.parentizeNode}),t}},{key:"parentizeNode",value:function(e,t){return e.parentNode=t||e,e.obfuscatedNode=!1,e}},{key:"cloneRecursive",value:function(t){if(null===t)return t;var r={};for(var o in t)if(t.hasOwnProperty(o)&&"parentNode"!==o){var a=t[o],i=void 0;i=null===a||a instanceof RegExp?a:Array.isArray(a)?a.map(e.cloneRecursive):"object"===n(a)?e.cloneRecursive(a):a,r[o]=i}return r}},{key:"getBlockScopesOfNodeRecursive",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=t.parentNode;if(!o)throw new ReferenceError("`parentNode` property of given node is `undefined`");return u.NodeGuards.isBlockStatementNode(t)&&o===t&&r.push(t),(u.NodeGuards.isProgramNode(t)||n&&u.NodeGuards.isNodeHasBlockScope(t,o))&&r.push(t),t!==o?e.getBlockScopesOfNodeRecursive(o,r,++n):r}},{key:"getSiblingStatementNodeByOffset",value:function(t,r){var n=e.getScopeOfNode(t),o=u.NodeGuards.isSwitchCaseNode(n)?n.consequent:n.body;return o[o.indexOf(t)+r]||null}}]),e}();t.NodeUtils=d},function(e,t,r){"use strict";var n=r(1),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a=r(19),i=function(){function e(){n(this,e)}return o(e,null,[{key:"isArrayPatternNode",value:function(e){return e.type===a.NodeType.ArrayPattern}},{key:"isArrowFunctionExpressionNode",value:function(e){return e.type===a.NodeType.ArrowFunctionExpression}},{key:"isAssignmentPatternNode",value:function(e){return e.type===a.NodeType.AssignmentPattern}},{key:"isAwaitExpressionNode",value:function(e){return e.type===a.NodeType.AwaitExpression}},{key:"isBlockStatementNode",value:function(e){return e.type===a.NodeType.BlockStatement}},{key:"isBreakStatementNode",value:function(e){return e.type===a.NodeType.BreakStatement}},{key:"isCallExpressionNode",value:function(e){return e.type===a.NodeType.CallExpression}},{key:"isCatchClauseNode",value:function(e){return e.type===a.NodeType.CatchClause}},{key:"isClassDeclarationNode",value:function(e){return e.type===a.NodeType.ClassDeclaration}},{key:"isContinueStatementNode",value:function(e){return e.type===a.NodeType.ContinueStatement}},{key:"isExpressionStatementNode",value:function(e){return e.type===a.NodeType.ExpressionStatement}},{key:"isFunctionDeclarationNode",value:function(e){return e.type===a.NodeType.FunctionDeclaration}},{key:"isFunctionExpressionNode",value:function(e){return e.type===a.NodeType.FunctionExpression}},{key:"isIdentifierNode",value:function(e){return e.type===a.NodeType.Identifier}},{key:"isIfStatementNode",value:function(e){return e.type===a.NodeType.IfStatement}},{key:"isLabelIdentifierNode",value:function(t,r){var n=e.isLabeledStatementNode(r)&&r.label===t,o=e.isContinueStatementNode(r)&&r.label===t,a=e.isBreakStatementNode(r)&&r.label===t;return n||o||a}},{key:"isLabeledStatementNode",value:function(e){return e.type===a.NodeType.LabeledStatement}},{key:"isLiteralNode",value:function(e){return e.type===a.NodeType.Literal}},{key:"isMemberExpressionNode",value:function(e){return e.type===a.NodeType.MemberExpression}},{key:"isMethodDefinitionNode",value:function(e){return e.type===a.NodeType.MethodDefinition}},{key:"isNode",value:function(e){return e&&void 0!==!e.type}},{key:"isNodeHasBlockScope",value:function(t,r){return e.isProgramNode(t)||e.isBlockStatementNode(t)&&e.nodesWithBlockScope.includes(r.type)}},{key:"isNodeHasScope",value:function(t){return e.isProgramNode(t)||e.isBlockStatementNode(t)||e.isSwitchCaseNode(t)}},{key:"isNodeWithComments",value:function(e){return Boolean(e.leadingComments)||Boolean(e.trailingComments)}},{key:"isObjectPatternNode",value:function(e){return e.type===a.NodeType.ObjectPattern}},{key:"isObjectExpressionNode",value:function(e){return e.type===a.NodeType.ObjectExpression}},{key:"isProgramNode",value:function(e){return e.type===a.NodeType.Program}},{key:"isPropertyNode",value:function(e){return e.type===a.NodeType.Property}},{key:"isReplaceableIdentifierNode",value:function(t,r){if(!e.isIdentifierNode(t))return!1;var n=e.isPropertyNode(r)&&!r.computed&&r.key===t,o=e.isMemberExpressionNode(r)&&!r.computed&&r.property===t,a=e.isMethodDefinitionNode(r)&&!r.computed,i=e.isLabelIdentifierNode(t,r);return!(n||o||a||i)}},{key:"isRestElementNode",value:function(e){return e.type===a.NodeType.RestElement}},{key:"isReturnStatementNode",value:function(e){return e.type===a.NodeType.ReturnStatement}},{key:"isSuperNode",value:function(e){return e.type===a.NodeType.Super}},{key:"isSwitchCaseNode",value:function(e){return e.type===a.NodeType.SwitchCase}},{key:"isTemplateLiteralNode",value:function(e){return e.type===a.NodeType.TemplateLiteral}},{key:"isUnaryExpressionNode",value:function(e){return e.type===a.NodeType.UnaryExpression}},{key:"isUseStrictOperator",value:function(e){return e.type===a.NodeType.ExpressionStatement&&"use strict"===e.directive}},{key:"isVariableDeclarationNode",value:function(e){return e.type===a.NodeType.VariableDeclaration}},{key:"isVariableDeclaratorNode",value:function(e){return e.type===a.NodeType.VariableDeclarator}},{key:"isWhileStatementNode",value:function(e){return e.type===a.NodeType.WhileStatement}}]),e}();i.nodesWithBlockScope=[a.NodeType.ArrowFunctionExpression,a.NodeType.FunctionDeclaration,a.NodeType.FunctionExpression,a.NodeType.MethodDefinition],t.NodeGuards=i},function(e,t,r){"use strict";var n=r(11),o=r(205),a=r(204),i=r(203),s=r(202),c=r(201),u=r(200),d=r(30),l=r(40);Object.defineProperty(t,"__esModule",{value:!0});var f={configurable:!0,enumerable:!0},p="_initialized",m="_initializablePropertiesSet",g="_wrappedMethodsSet",_="constructor";function N(e,t,r){u(e,r)||c(e,t,r)}t.initializable=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"initialize",t=l(this)[0];return function(r,u){var l=r[e];if(!l||"function"!=typeof l)throw new Error("`".concat(e,"` method with initialization logic not ")+"found. `@".concat(t,"` decorator requires `").concat(e,"` method"));return N(p,!1,r),N(m,new d,r),N(g,new d,r),function(e,t){var r=s(e),c=[t,_];r.forEach(function(r){var s=i(m,e),u=i(g,e),d=c.includes(r)||s.has(r)||u.has(r);if(!d){var l=e[r];if("function"==typeof l){var _=a(e,r)||f,N=_.value;o(e,r,n({},_,{value:function(){if(!i(p,this))throw new Error("Class should be initialized with `".concat(t,"()` method"));return N.apply(this,arguments)}})),u.add(r)}}})}(r,e),function(e,t,r){var i=a(e,t)||f,s=i.value;o(e,t,n({},i,{value:function(){c(p,!0,this);var e=s.apply(this,arguments);return this[r],e}}))}(r,e,u),function(e,t){i(m,e).add(t);var r="_".concat(t),s=a(e,r)||f;return o(e,t,n({},s,{get:function(){if(void 0===this[r])throw new Error("Property `".concat(t,"` is not initialized! Initialize it first!"));return this[r]},set:function(e){this[r]=e}})),s}(r,u)}}},function(e,t){e.exports=require("@babel/runtime/core-js/object/assign")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Preparing="Preparing",e.DeadCodeInjection="DeadCodeInjection",e.ControlFlowFlattening="ControlFlowFlattening",e.Converting="Converting",e.Obfuscating="Obfuscating",e.Finalizing="Finalizing"}(t.TransformationStage||(t.TransformationStage={}))},function(e,t,r){"use strict";var n=r(1),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a,i=r(4),s=r(0),c=r(3),u=r(182),d=r(181),l=a=function(){function e(t,r,o){n(this,e),this.cachedNode=null,this.identifierNamesGenerator=t(o),this.randomGenerator=r,this.options=o}return o(e,[{key:"getNode",value:function(){return this.cachedNode||(this.cachedNode=this.getNodeStructure()),this.cachedNode}},{key:"getGlobalVariableTemplate",value:function(){return this.randomGenerator.getRandomGenerator().pickone(a.globalVariableTemplateFunctions)}}]),e}();l.globalVariableTemplateFunctions=[u.GlobalVariableTemplate1(),d.GlobalVariableTemplate2()],l=a=i.__decorate([s.injectable(),i.__param(0,s.inject(c.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),i.__param(1,s.inject(c.ServiceIdentifiers.IRandomGenerator)),i.__param(2,s.inject(c.ServiceIdentifiers.IOptions)),i.__metadata("design:paramtypes",[Function,Object,Object])],l),t.AbstractCustomNode=l},function(e,t,r){"use strict";var n=r(1),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a=r(4),i=r(0),s=r(3),c=r(10),u=function(){function e(t,r){n(this,e),this.randomGenerator=t,this.options=r}return o(e,[{key:"initialize",value:function(){this.nodeIdentifier=this.randomGenerator.getRandomInteger(0,1e4)}}]),e}();a.__decorate([c.initializable(),a.__metadata("design:type",Number)],u.prototype,"nodeIdentifier",void 0),a.__decorate([i.postConstruct(),a.__metadata("design:type",Function),a.__metadata("design:paramtypes",[]),a.__metadata("design:returntype",void 0)],u.prototype,"initialize",null),u=a.__decorate([i.injectable(),a.__param(0,i.inject(s.ServiceIdentifiers.IRandomGenerator)),a.__param(1,i.inject(s.ServiceIdentifiers.IOptions)),a.__metadata("design:paramtypes",[Object,Object])],u),t.AbstractNodeTransformer=u},function(e,t,r){"use strict";var n=r(11),o=r(1),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i=__importStar(r(47)),s=r(19),c=function(){function e(){o(this,e)}return a(e,null,[{key:"getProgramNode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:s.NodeType.Program,body:e,sourceType:"script",obfuscatedNode:!1}}},{key:"getArrayExpressionNode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:s.NodeType.ArrayExpression,elements:e}}},{key:"getAssignmentExpressionNode",value:function(e,t,r){return{type:s.NodeType.AssignmentExpression,operator:e,left:t,right:r,obfuscatedNode:!1}}},{key:"getBinaryExpressionNode",value:function(e,t,r){return{type:s.NodeType.BinaryExpression,operator:e,left:t,right:r,obfuscatedNode:!1}}},{key:"getBlockStatementNode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:s.NodeType.BlockStatement,body:e,obfuscatedNode:!1}}},{key:"getBreakStatement",value:function(e){var t={type:s.NodeType.BreakStatement,obfuscatedNode:!1};return e&&(t.label=e),t}},{key:"getCallExpressionNode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return{type:s.NodeType.CallExpression,callee:e,arguments:t,obfuscatedNode:!1}}},{key:"getContinueStatement",value:function(e){var t={type:s.NodeType.ContinueStatement,obfuscatedNode:!1};return e&&(t.label=e),t}},{key:"getExpressionStatementNode",value:function(e){return{type:s.NodeType.ExpressionStatement,expression:e,obfuscatedNode:!1}}},{key:"getFunctionDeclarationNode",value:function(t,r,n){return{type:s.NodeType.FunctionDeclaration,id:e.getIdentifierNode(t),params:r,body:n,generator:!1,obfuscatedNode:!1}}},{key:"getFunctionExpressionNode",value:function(e,t){return{type:s.NodeType.FunctionExpression,params:e,body:t,generator:!1,obfuscatedNode:!1}}},{key:"getIfStatementNode",value:function(e,t,r){return n({type:s.NodeType.IfStatement,test:e,consequent:t},r&&{alternate:r},{obfuscatedNode:!1})}},{key:"getIdentifierNode",value:function(e){return{type:s.NodeType.Identifier,name:e,obfuscatedNode:!1}}},{key:"getLiteralNode",value:function(e,t){return t=void 0!==t?t:"'".concat(e,"'"),{type:s.NodeType.Literal,value:e,raw:t,"x-verbatim-property":{content:t,precedence:i.Precedence.Primary},obfuscatedNode:!1}}},{key:"getLogicalExpressionNode",value:function(e,t,r){return{type:s.NodeType.LogicalExpression,operator:e,left:t,right:r,obfuscatedNode:!1}}},{key:"getMemberExpressionNode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:s.NodeType.MemberExpression,computed:r,object:e,property:t,obfuscatedNode:!1}}},{key:"getMethodDefinitionNode",value:function(e,t,r,n){return{type:s.NodeType.MethodDefinition,key:e,value:t,kind:r,computed:n,static:!1,obfuscatedNode:!1}}},{key:"getObjectExpressionNode",value:function(e){return{type:s.NodeType.ObjectExpression,properties:e,obfuscatedNode:!1}}},{key:"getPropertyNode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:s.NodeType.Property,key:e,value:t,kind:"init",method:!1,shorthand:!1,computed:r,obfuscatedNode:!1}}},{key:"getUnaryExpressionNode",value:function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return{type:s.NodeType.UnaryExpression,operator:e,argument:t,prefix:r,obfuscatedNode:!1}}},{key:"getReturnStatementNode",value:function(e){return{type:s.NodeType.ReturnStatement,argument:e,obfuscatedNode:!1}}},{key:"getSwitchStatementNode",value:function(e,t){return{type:s.NodeType.SwitchStatement,discriminant:e,cases:t,obfuscatedNode:!1}}},{key:"getSwitchCaseNode",value:function(e,t){return{type:s.NodeType.SwitchCase,test:e,consequent:t,obfuscatedNode:!1}}},{key:"getUpdateExpressionNode",value:function(e,t){return{type:s.NodeType.UpdateExpression,operator:e,argument:t,prefix:!1,obfuscatedNode:!1}}},{key:"getVariableDeclarationNode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"var";return{type:s.NodeType.VariableDeclaration,declarations:e,kind:t,obfuscatedNode:!1}}},{key:"getVariableDeclaratorNode",value:function(e,t){return{type:s.NodeType.VariableDeclarator,id:e,init:t,obfuscatedNode:!1}}},{key:"getWhileStatementNode",value:function(e,t){return{type:s.NodeType.WhileStatement,test:e,body:t,obfuscatedNode:!1}}}]),e}();t.Nodes=c},function(e,t){e.exports=require("@babel/runtime/core-js/map")},function(e,t){e.exports=require("estraverse")},function(e,t){e.exports=require("string-template")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ArrayExpression="ArrayExpression",e.ArrayPattern="ArrayPattern",e.ArrowFunctionExpression="ArrowFunctionExpression",e.AssignmentExpression="AssignmentExpression",e.AssignmentPattern="AssignmentPattern",e.AwaitExpression="AwaitExpression",e.BinaryExpression="BinaryExpression",e.BlockStatement="BlockStatement",e.BreakStatement="BreakStatement",e.CallExpression="CallExpression",e.CatchClause="CatchClause",e.ClassDeclaration="ClassDeclaration",e.ContinueStatement="ContinueStatement",e.ExpressionStatement="ExpressionStatement",e.FunctionDeclaration="FunctionDeclaration",e.FunctionExpression="FunctionExpression",e.Identifier="Identifier",e.IfStatement="IfStatement",e.LabeledStatement="LabeledStatement",e.Literal="Literal",e.LogicalExpression="LogicalExpression",e.MemberExpression="MemberExpression",e.MethodDefinition="MethodDefinition",e.ObjectExpression="ObjectExpression",e.ObjectPattern="ObjectPattern",e.Program="Program",e.Property="Property",e.RestElement="RestElement",e.ReturnStatement="ReturnStatement",e.Super="Super",e.SwitchCase="SwitchCase",e.SwitchStatement="SwitchStatement",e.TemplateLiteral="TemplateLiteral",e.TryStatement="TryStatement",e.UnaryExpression="UnaryExpression",e.UpdateExpression="UpdateExpression",e.VariableDeclaration="VariableDeclaration",e.VariableDeclarator="VariableDeclarator",e.WhileStatement="WhileStatement"}(t.NodeType||(t.NodeType={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Browser="browser",e.Extension="extension",e.Node="node"}(t.ObfuscationTarget||(t.ObfuscationTarget={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BinaryExpressionFunctionNode="BinaryExpressionFunctionNode",e.BlockStatementControlFlowFlatteningNode="BlockStatementControlFlowFlatteningNode",e.CallExpressionControlFlowStorageCallNode="CallExpressionControlFlowStorageCallNode",e.CallExpressionFunctionNode="CallExpressionFunctionNode",e.ControlFlowStorageNode="ControlFlowStorageNode",e.ExpressionWithOperatorControlFlowStorageCallNode="ExpressionWithOperatorControlFlowStorageCallNode",e.LogicalExpressionFunctionNode="LogicalExpressionFunctionNode",e.StringLiteralControlFlowStorageCallNode="StringLiteralControlFlowStorageCallNode",e.StringLiteralNode="StringLiteralNode"}(t.ControlFlowCustomNode||(t.ControlFlowCustomNode={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BaseIdentifierObfuscatingReplacer="BaseIdentifierObfuscatingReplacer"}(t.IdentifierObfuscatingReplacer||(t.IdentifierObfuscatingReplacer={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.AfterObfuscation="afterObfuscation",e.BeforeObfuscation="beforeObfuscation"}(t.ObfuscationEvent||(t.ObfuscationEvent={}))},function(e,t){e.exports=require("@babel/runtime/helpers/toConsumableArray")},function(e,t,r){"use strict";var n=r(24),o=r(1),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i=r(9),s=function(){function e(){o(this,e)}return a(e,null,[{key:"appendNode",value:function(t,r){r=e.parentizeScopeStatementsBeforeAppend(t,r),e.setScopeNodeStatements(t,n(e.getScopeNodeStatements(t)).concat(n(r)))}},{key:"appendNodeToOptimalBlockScope",value:function(t,r,n){var o,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;o=t.length?e.getOptimalBlockScope(t,a):r,e.prependNode(o,n)}},{key:"getOptimalBlockScope",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,o=t[r];if(n<=0)throw new Error("Invalid `deep` argument value. Value should be bigger then 0.");return n>1&&o.stackTrace.length?e.getOptimalBlockScope(o.stackTrace,0,--n):o.callee}},{key:"insertNodeAfter",value:function(t,r,n){var o=e.getScopeNodeStatements(t).indexOf(n);e.insertNodeAtIndex(t,r,o+1)}},{key:"insertNodeAtIndex",value:function(t,r,o){r=e.parentizeScopeStatementsBeforeAppend(t,r),e.setScopeNodeStatements(t,n(e.getScopeNodeStatements(t).slice(0,o)).concat(n(r),n(e.getScopeNodeStatements(t).slice(o))))}},{key:"prependNode",value:function(t,r){r=e.parentizeScopeStatementsBeforeAppend(t,r),e.setScopeNodeStatements(t,n(r).concat(n(e.getScopeNodeStatements(t))))}},{key:"getScopeNodeStatements",value:function(e){return i.NodeGuards.isSwitchCaseNode(e)?e.consequent:e.body}},{key:"parentizeScopeStatementsBeforeAppend",value:function(e,t){return t.forEach(function(t){t.parentNode=e}),t}},{key:"setScopeNodeStatements",value:function(e,t){i.NodeGuards.isSwitchCaseNode(e)?e.consequent=t:e.body=t}}]),e}();t.NodeAppender=s},function(e,t,r){"use strict";var n=r(16),o=r(1),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),s=r(3),c=r(213),u=r(208),d=r(194),l=r(189),f=r(142),p=r(141),m=r(138),g=r(137),_=r(124),N=r(109),v=r(100),y=r(95),h=r(89),b=r(51),S=r(86),I=r(84),C=r(83),O=r(82),j=r(81),F=function(){function e(){o(this,e),this.container=new i.Container}return a(e,[{key:"get",value:function(e){return this.container.get(e)}},{key:"getNamed",value:function(e,t){return this.container.getNamed(e,t)}},{key:"load",value:function(e,t){this.container.bind(s.ServiceIdentifiers.ISourceCode).toDynamicValue(function(){return new C.SourceCode(e)}).inSingletonScope(),this.container.bind(s.ServiceIdentifiers.TInputOptions).toDynamicValue(function(){return t}).inSingletonScope(),this.container.bind(s.ServiceIdentifiers.ILogger).to(b.Logger).inSingletonScope(),this.container.bind(s.ServiceIdentifiers.IJavaScriptObfuscator).to(h.JavaScriptObfuscator).inSingletonScope(),this.container.bind(s.ServiceIdentifiers.ITransformersRunner).to(j.TransformersRunner).inSingletonScope(),this.container.bind(s.ServiceIdentifiers.IObfuscationResult).to(I.ObfuscationResult).inSingletonScope(),this.container.bind(s.ServiceIdentifiers.Factory__IObfuscationResult).toFactory(function(e){return function(t,r){var n=e.container.get(s.ServiceIdentifiers.IObfuscationResult);return n.initialize(t,r),n}}),this.container.bind(s.ServiceIdentifiers.ISourceMapCorrector).to(O.SourceMapCorrector).inSingletonScope(),this.container.bind(s.ServiceIdentifiers.IObfuscationEventEmitter).to(S.ObfuscationEventEmitter).inSingletonScope(),this.container.load(c.analyzersModule),this.container.load(u.controlFlowTransformersModule),this.container.load(d.convertingTransformersModule),this.container.load(l.customNodesModule),this.container.load(f.finalizingTransformersModule),this.container.load(p.generatorsModule),this.container.load(m.nodeTransformersModule),this.container.load(g.obfuscatingTransformersModule),this.container.load(_.optionsModule),this.container.load(N.preparingTransformersModule),this.container.load(v.storagesModule),this.container.load(y.utilsModule)}},{key:"unload",value:function(){this.container.unbindAll()}}],[{key:"getFactory",value:function(e){return function(t){return function(r){return t.container.getNamed(e,r)}}}},{key:"getCacheFactory",value:function(e){return function(t){var r=new n;return function(n){if(r.has(n))return r.get(n);var o=t.container.getNamed(e,n);return r.set(n,o),o}}}},{key:"getConstructorFactory",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o-1||0===e.indexOf("//")?e.split("/")[2]:e.split("/")[0]).split(":")[0]}},{key:"isCeilNumber",value:function(e){return e%1==0}},{key:"stringRotate",value:function(e,t){if(!e)throw new ReferenceError("Cannot rotate empty string.");for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{},r=new i.InversifyContainerFacade;r.load(e,t);var n=r.get(a.ServiceIdentifiers.IJavaScriptObfuscator).obfuscate(e);return r.unload(),n}},{key:"runCLI",value:function(e){var t=new s.JavaScriptObfuscatorCLI(e);t.initialize(),t.run()}}]),e}();t.JavaScriptObfuscator=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Base64="base64",e.Rc4="rc4"}(t.StringArrayEncoding||(t.StringArrayEncoding={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Inline="inline",e.Separate="separate"}(t.SourceMapMode||(t.SourceMapMode={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.HexadecimalIdentifierNamesGenerator="hexadecimal",e.MangledIdentifierNamesGenerator="mangled"}(t.IdentifierNamesGenerator||(t.IdentifierNamesGenerator={}))},function(e,t,r){"use strict";var n=r(1),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a=r(4),i=r(0),s=r(3),c=function(){function e(t,r,o){n(this,e),this.identifierNamesGenerator=t(o),this.randomGenerator=r,this.options=o}return o(e,[{key:"getAppendEvent",value:function(){return this.appendEvent}},{key:"getCustomNodes",value:function(){return this.customNodes}},{key:"appendCustomNodeIfExist",value:function(e,t){var r=this.customNodes.get(e);r&&t(r)}},{key:"getRandomStackTraceIndex",value:function(e){return this.randomGenerator.getRandomInteger(0,Math.max(0,Math.round(e-1)))}}]),e}();c=a.__decorate([i.injectable(),a.__param(0,i.inject(s.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),a.__param(1,i.inject(s.ServiceIdentifiers.IRandomGenerator)),a.__param(2,i.inject(s.ServiceIdentifiers.IOptions)),a.__metadata("design:paramtypes",[Function,Object,Object])],c),t.AbstractCustomNodeGroup=c},function(e,t){e.exports=require("@babel/runtime/core-js/get-iterator")},function(e,t,r){"use strict";var n=r(1);Object.defineProperty(t,"__esModule",{value:!0});var o=r(4),a=r(0),i=r(3),s=function e(t){n(this,e),this.options=t};s=o.__decorate([a.injectable(),o.__param(0,a.inject(i.ServiceIdentifiers.IOptions)),o.__metadata("design:paramtypes",[Object])],s),t.AbstractObfuscatingReplacer=s},function(e,t,r){"use strict";var n=r(59);Object.defineProperty(t,"__esModule",{value:!0});var o=r(35),a=r(20),i=r(34);t.NO_ADDITIONAL_NODES_PRESET=n({compact:!0,controlFlowFlattening:!1,controlFlowFlatteningThreshold:0,deadCodeInjection:!1,deadCodeInjectionThreshold:0,debugProtection:!1,debugProtectionInterval:!1,disableConsoleOutput:!1,domainLock:[],exclude:[],identifierNamesGenerator:o.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,identifiersPrefix:"",log:!1,renameGlobals:!1,reservedNames:[],rotateStringArray:!1,seed:0,selfDefending:!1,sourceMap:!1,sourceMapBaseUrl:"",sourceMapFileName:"",sourceMapMode:i.SourceMapMode.Separate,stringArray:!1,stringArrayEncoding:!1,stringArrayThreshold:0,target:a.ObfuscationTarget.Browser,transformObjectKeys:!1,unicodeEscapeSequence:!1})},function(e,t){e.exports=require("@babel/runtime/core-js/object/keys")},function(e,t){e.exports=require("path")},function(e,t,r){"use strict";var n=r(11),o=r(1),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i=r(4),s=i.__importStar(r(79)),c=i.__importStar(r(53)),u=i.__importStar(r(41)),d=r(10),l=r(43),f=r(78),p=r(77),m=r(76),g=r(75),_=r(74),N=r(73),v=r(72),y=r(32),h=r(69),b=function(){function e(t){o(this,e),this.rawArguments=t,this.arguments=t.slice(2)}return a(e,[{key:"initialize",value:function(){this.inputPath=u.normalize(this.arguments[0]||""),this.commands=new s.Command,this.configureCommands(),this.configureHelp(),this.inputCLIOptions=this.commands.opts()}},{key:"run",value:function(){if(!this.arguments.length||this.arguments.includes("--help"))return this.commands.outputHelp();var e=new h.SourceCodeReader(this.inputCLIOptions).readSourceCode(this.inputPath);this.processSourceCodeData(e)}},{key:"buildOptions",value:function(){var t=e.filterOptions(this.inputCLIOptions),r=this.inputCLIOptions.config,o=r?u.resolve(r,"."):"",a=o?v.CLIUtils.getUserConfig(o):{};return n({},l.DEFAULT_PRESET,a,t)}},{key:"configureCommands",value:function(){this.commands.usage(" [options]").version(c.version,"-v, --version").option("-o, --output ","Output path for obfuscated code").option("--compact ","Disable one line output code compacting",p.BooleanSanitizer).option("--config ","Name of js / json config file").option("--control-flow-flattening ","Enables control flow flattening",p.BooleanSanitizer).option("--control-flow-flattening-threshold ","The probability that the control flow flattening transformation will be applied to the node",parseFloat).option("--dead-code-injection ","Enables dead code injection",p.BooleanSanitizer).option("--dead-code-injection-threshold ","The probability that the dead code injection transformation will be applied to the node",parseFloat).option("--debug-protection ","Disable browser Debug panel (can cause DevTools enabled browser freeze)",p.BooleanSanitizer).option("--debug-protection-interval ","Disable browser Debug panel even after page was loaded (can cause DevTools enabled browser freeze)",p.BooleanSanitizer).option("--disable-console-output ","Allow console.log, console.info, console.error and console.warn messages output into browser console",p.BooleanSanitizer).option("--domain-lock (comma separated, without whitespaces)","Blocks the execution of the code in domains that do not match the passed RegExp patterns (comma separated)",f.ArraySanitizer).option("--exclude (comma separated, without whitespaces)","A filename or glob which indicates files to exclude from obfuscation",f.ArraySanitizer).option("--identifier-names-generator [hexadecimal, mangled]","Sets identifier names generator (Default: hexadecimal)",m.IdentifierNamesGeneratorSanitizer).option("--identifiers-prefix ","Sets prefix for all global identifiers.").option("--log ","Enables logging of the information to the console",p.BooleanSanitizer).option("--reserved-names (comma separated, without whitespaces)","Disable obfuscation of variable names, function names and names of function parameters that match the passed RegExp patterns (comma separated)",f.ArraySanitizer).option("--rename-globals ","Allows to enable obfuscation of global variable and function names with declaration.",p.BooleanSanitizer).option("--rotate-string-array ","Disable rotation of unicode array values during obfuscation",p.BooleanSanitizer).option("--seed ","Sets seed for random generator. This is useful for creating repeatable results.",parseFloat).option("--self-defending ","Disables self-defending for obfuscated code",p.BooleanSanitizer).option("--source-map ","Enables source map generation",p.BooleanSanitizer).option("--source-map-base-url ","Sets base url to the source map import url when `--source-map-mode=separate`").option("--source-map-file-name ","Sets file name for output source map when `--source-map-mode=separate`").option("--source-map-mode [inline, separate]","Specify source map output mode",_.SourceMapModeSanitizer).option("--string-array ","Disables gathering of all literal strings into an array and replacing every literal string with an array call",p.BooleanSanitizer).option("--string-array-encoding [true, false, base64, rc4]","Encodes all strings in strings array using base64 or rc4 (this option can slow down your code speed",N.StringArrayEncodingSanitizer).option("--string-array-threshold ","The probability that the literal string will be inserted into stringArray (Default: 0.8, Min: 0, Max: 1)",parseFloat).option("--target ","Allows to set target environment for obfuscated code.",g.ObfuscationTargetSanitizer).option("--transform-object-keys ","Enables transformation of object keys",p.BooleanSanitizer).option("--unicode-escape-sequence ","Allows to enable/disable string conversion to unicode escape sequence",p.BooleanSanitizer).parse(this.rawArguments)}},{key:"configureHelp",value:function(){this.commands.on("--help",function(){console.log(" Examples:\n"),console.log(" %> javascript-obfuscator input_file_name.js --compact true --self-defending false"),console.log(" %> javascript-obfuscator input_file_name.js --output output_file_name.js --compact true --self-defending false"),console.log(" %> javascript-obfuscator input_directory_name --compact true --self-defending false"),console.log("")})}},{key:"processSourceCodeData",value:function(e){var t=this,r=this.inputCLIOptions.output?u.normalize(this.inputCLIOptions.output):"";if(Array.isArray(e))e.forEach(function(e,n){var o=e.filePath,a=e.content,i=r?u.join(r,o):v.CLIUtils.getOutputCodePath(o);t.processSourceCode(a,i,n)});else{var n=r||v.CLIUtils.getOutputCodePath(this.inputPath);this.processSourceCode(e,n,null)}}},{key:"processSourceCode",value:function(t,r,o){var a=this.buildOptions();if(null!==o){var i=this.inputCLIOptions.identifiersPrefix||e.baseIdentifiersPrefix,s="".concat(i).concat(o);a=n({},a,{identifiersPrefix:s})}a.sourceMap?e.processSourceCodeWithSourceMap(t,r,a):e.processSourceCodeWithoutSourceMap(t,r,a)}}],[{key:"filterOptions",value:function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&void 0!==e[r]&&(t[r]=e[r]);return t}},{key:"processSourceCodeWithoutSourceMap",value:function(e,t,r){var n=y.JavaScriptObfuscator.obfuscate(e,r).getObfuscatedCode();v.CLIUtils.writeFile(t,n)}},{key:"processSourceCodeWithSourceMap",value:function(e,t,r){var o=v.CLIUtils.getOutputSourceMapPath(t,r.sourceMapFileName||"");r=n({},r,{sourceMapFileName:u.basename(o)});var a=y.JavaScriptObfuscator.obfuscate(e,r);v.CLIUtils.writeFile(t,a.getObfuscatedCode()),"separate"===r.sourceMapMode&&a.getSourceMap()&&v.CLIUtils.writeFile(o,a.getSourceMap())}}]),e}();b.encoding="utf8",b.obfuscatedFilePrefix="-obfuscated",b.baseIdentifiersPrefix="a",i.__decorate([d.initializable(),i.__metadata("design:type",Object)],b.prototype,"commands",void 0),i.__decorate([d.initializable(),i.__metadata("design:type",Object)],b.prototype,"inputCLIOptions",void 0),i.__decorate([d.initializable(),i.__metadata("design:type",String)],b.prototype,"inputPath",void 0),t.JavaScriptObfuscatorCLI=b},function(e,t,r){"use strict";var n=r(59);Object.defineProperty(t,"__esModule",{value:!0});var o=r(35),a=r(20),i=r(34);t.DEFAULT_PRESET=n({compact:!0,config:"",controlFlowFlattening:!1,controlFlowFlatteningThreshold:.75,deadCodeInjection:!1,deadCodeInjectionThreshold:.4,debugProtection:!1,debugProtectionInterval:!1,disableConsoleOutput:!1,domainLock:[],exclude:[],identifierNamesGenerator:o.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator,identifiersPrefix:"",log:!1,renameGlobals:!1,reservedNames:[],rotateStringArray:!0,seed:0,selfDefending:!1,sourceMap:!1,sourceMapBaseUrl:"",sourceMapFileName:"",sourceMapMode:i.SourceMapMode.Separate,stringArray:!0,stringArrayEncoding:!1,stringArrayThreshold:.75,target:a.ObfuscationTarget.Browser,transformObjectKeys:!1,unicodeEscapeSequence:!1})},function(e,t){e.exports=require("@babel/runtime/helpers/get")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableNoEvalTemplate=function(){return"\n var that = (typeof window !== 'undefined'\n ? window\n : (typeof process === 'object' &&\n typeof require === 'function' &&\n typeof global === 'object')\n ? global\n : this);\n "}},function(e,t,r){"use strict";var n=r(16),o=r(1),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i,s=r(4),c=r(0),u=r(3),d=i=function(){function e(t,r,a){o(this,e),this.replacerDataByControlFlowStorageId=new n,this.controlFlowCustomNodeFactory=t,this.randomGenerator=r,this.options=a}return a(e,[{key:"insertCustomNodeToControlFlowStorage",value:function(e,t,r,n){var o=this,a=t.getStorageId(),s=i.getStorageKeysByIdForCurrentStorage(this.replacerDataByControlFlowStorageId,a),c=s.get(r);if(this.randomGenerator.getMathRandom()1&&void 0!==arguments[1]?arguments[1]:a.randomGeneratorPool;return this.getRandomGenerator().string({length:e,pool:t})}},{key:"getSeed",value:function(){return this.seed}}]),e}();f.randomGeneratorPool="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",i.__decorate([l.initializable(),i.__metadata("design:type",Object)],f.prototype,"randomGenerator",void 0),i.__decorate([l.initializable(),i.__metadata("design:type",Number)],f.prototype,"seed",void 0),i.__decorate([s.postConstruct(),i.__metadata("design:type",Function),i.__metadata("design:paramtypes",[]),i.__metadata("design:returntype",void 0)],f.prototype,"initialize",null),f=a=i.__decorate([s.injectable(),i.__param(0,s.inject(c.ServiceIdentifiers.ISourceCode)),i.__param(1,s.inject(c.ServiceIdentifiers.IOptions)),i.__metadata("design:paramtypes",[Object,Object])],f),t.RandomGenerator=f},function(e,t,r){"use strict";var n=r(24),o=r(37),a=r(29),i=r(16),s=r(1),c=r(2);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=r(10),p=function(){function e(t,r){s(this,e),this.randomGenerator=t,this.options=r}return c(e,[{key:"initialize",value:function(){this.storage=new i,this.storageId=this.randomGenerator.getRandomString(6)}},{key:"get",value:function(e){var t=this.storage.get(e);if(!t)throw new Error("No value found in map storage with key `".concat(e,"`"));return t}},{key:"getKeyOf",value:function(e){var t=!0,r=!1,n=void 0;try{for(var i,s=o(this.storage);!(t=(i=s.next()).done);t=!0){var c=i.value,u=a(c,2),d=u[0];if(e===u[1])return d}}catch(e){r=!0,n=e}finally{try{t||null==s.return||s.return()}finally{if(r)throw n}}return null}},{key:"getLength",value:function(){return this.storage.size}},{key:"getStorage",value:function(){return this.storage}},{key:"getStorageId",value:function(){return this.storageId}},{key:"mergeWith",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.storage=new i(n(this.storage).concat(n(e.getStorage()))),t&&(this.storageId=e.getStorageId())}},{key:"set",value:function(e,t){this.storage.set(e,t)}}]),e}();u.__decorate([f.initializable(),u.__metadata("design:type",String)],p.prototype,"storageId",void 0),u.__decorate([f.initializable(),u.__metadata("design:type",i)],p.prototype,"storage",void 0),u.__decorate([d.postConstruct(),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[]),u.__metadata("design:returntype",void 0)],p.prototype,"initialize",null),p=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Object,Object])],p),t.MapStorage=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BlackListNodeGuard="BlackListNodeGuard",e.ConditionalCommentNodeGuard="ConditionalCommentNodeGuard"}(t.ObfuscatingGuard||(t.ObfuscatingGuard={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BooleanLiteralObfuscatingReplacer="BooleanLiteralObfuscatingReplacer",e.NumberLiteralObfuscatingReplacer="NumberLiteralObfuscatingReplacer",e.StringLiteralObfuscatingReplacer="StringLiteralObfuscatingReplacer"}(t.LiteralObfuscatingReplacer||(t.LiteralObfuscatingReplacer={}))},function(e,t,r){"use strict";var n=r(1);Object.defineProperty(t,"__esModule",{value:!0});var o=r(4),a=r(0),i=r(3),s=function e(t,r){n(this,e),this.randomGenerator=t,this.options=r};s=o.__decorate([a.injectable(),o.__param(0,a.inject(i.ServiceIdentifiers.IRandomGenerator)),o.__param(1,a.inject(i.ServiceIdentifiers.IOptions)),o.__metadata("design:paramtypes",[Object,Object])],s),t.AbstractIdentifierNamesGenerator=s},function(e,t){e.exports=require("@babel/runtime/core-js/object/freeze")},function(e,t){e.exports=require("@babel/runtime/core-js/array/from")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ConsoleOutputCustomNodeGroup="ConsoleOutputCustomNodeGroup",e.DebugProtectionCustomNodeGroup="DebugProtectionCustomNodeGroup",e.DomainLockCustomNodeGroup="DomainLockCustomNodeGroup",e.SelfDefendingCustomNodeGroup="SelfDefendingCustomNodeGroup",e.StringArrayCustomNodeGroup="StringArrayCustomNodeGroup"}(t.CustomNodeGroup||(t.CustomNodeGroup={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BlockStatementDeadCodeInjectionNode="BlockStatementDeadCodeInjectionNode"}(t.DeadCodeInjectionCustomNode||(t.DeadCodeInjectionCustomNode={}))},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=r(21),f=r(46),p=r(9),m=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"getControlFlowStorageCallNode",value:function(e,t,r,n){var o=this.controlFlowCustomNodeFactory(l.ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode);o.initialize(e,t,r,n);var a=o.getNode()[0];if(!a||!p.NodeGuards.isExpressionStatementNode(a))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return a.expression}}]),t}(f.AbstractControlFlowReplacer);m=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IControlFlowCustomNode)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],m),t.ExpressionWithOperatorControlFlowReplacer=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.BinaryExpressionControlFlowReplacer="BinaryExpressionControlFlowReplacer",e.CallExpressionControlFlowReplacer="CallExpressionControlFlowReplacer",e.LogicalExpressionControlFlowReplacer="LogicalExpressionControlFlowReplacer",e.StringLiteralControlFlowReplacer="StringLiteralControlFlowReplacer"}(t.ControlFlowReplacer||(t.ControlFlowReplacer={}))},function(e,t){e.exports=require("esprima")},function(e,t){e.exports=require("@babel/runtime/helpers/typeof")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.FunctionDeclarationCalleeDataExtractor="FunctionDeclarationCalleeDataExtractor",e.FunctionExpressionCalleeDataExtractor="FunctionExpressionCalleeDataExtractor",e.ObjectExpressionCalleeDataExtractor="ObjectExpressionCalleeDataExtractor"}(t.CalleeDataExtractor||(t.CalleeDataExtractor={}))},function(e,t){e.exports=require("multimatch")},function(e,t,r){"use strict";var n=r(24),o=r(1),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i=__importStar(r(49)),s=__importStar(r(41)),c=__importDefault(r(68)),u=r(50),d=r(42),l=r(51),f=function(){function e(t){o(this,e),this.options=t}return a(e,[{key:"readSourceCode",value:function(t){if(e.isFilePath(t)&&this.isValidFile(t))return this.readFile(t);if(e.isDirectoryPath(t)&&this.isValidDirectory(t))return this.readDirectoryRecursive(t);var r=e.availableInputExtensions.map(function(e){return"`".concat(e,"`")}).join(", ");throw new ReferenceError("Given input path must be a valid ".concat(r," file or directory path"))}},{key:"readDirectoryRecursive",value:function(t){var r=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return i.readdirSync(t,d.JavaScriptObfuscatorCLI.encoding).forEach(function(a){var i="".concat(t,"/").concat(a);if(e.isDirectoryPath(i)&&r.isValidDirectory(i))o.push.apply(o,n(r.readDirectoryRecursive(i)));else if(e.isFilePath(i)&&r.isValidFile(i)){var s=r.readFile(i);o.push({filePath:i,content:s})}}),o}},{key:"readFile",value:function(t){return e.logFilePath(t),i.readFileSync(t,d.JavaScriptObfuscatorCLI.encoding)}},{key:"isValidDirectory",value:function(t){return!e.isExcludedPath(t,this.options.exclude)}},{key:"isValidFile",value:function(t){return e.availableInputExtensions.includes(s.extname(t))&&!t.includes(d.JavaScriptObfuscatorCLI.obfuscatedFilePrefix)&&!e.isExcludedPath(t,this.options.exclude)}}],[{key:"isExcludedPath",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!t.length)return!1;var r=s.basename(e),n=!!c.default([e],t).length;return t.some(function(t){return e.includes(t)||r.includes(t)})||n}},{key:"isDirectoryPath",value:function(e){try{return i.statSync(e).isDirectory()}catch(e){return!1}}},{key:"isFilePath",value:function(e){try{return i.statSync(e).isFile()}catch(e){return!1}}},{key:"logFilePath",value:function(e){var t=s.normalize(e);l.Logger.log(l.Logger.colorInfo,u.LoggingPrefix.CLI,"Obfuscating file: ".concat(t,"..."))}}]),e}();f.availableInputExtensions=[".js"],t.SourceCodeReader=f},function(e,t){function r(e){var t=new Error('Cannot find module "'+e+'".');throw t.code="MODULE_NOT_FOUND",t}r.keys=function(){return[]},r.resolve=r,e.exports=r,r.id=70},function(e,t){e.exports=require("mkdirp")},function(e,t,r){"use strict";var n=r(1),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a=__importStar(r(49)),i=__importStar(r(71)),s=__importStar(r(41)),c=r(42),u=function(){function e(){n(this,e)}return o(e,null,[{key:"getOutputCodePath",value:function(e){return s.normalize(e).split(".").map(function(e,t){return 0===t?"".concat(e).concat(c.JavaScriptObfuscatorCLI.obfuscatedFilePrefix):e}).join(".")}},{key:"getOutputSourceMapPath",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return t&&(e="".concat(e.substring(0,e.lastIndexOf("/")),"/").concat(t)),/\.js\.map$/.test(e)?/\.js$/.test(e)&&(e+=".map"):e="".concat(e.split(".")[0],".js.map"),e}},{key:"getUserConfig",value:function(e){var t;try{t=r(70)(e)}catch(r){try{t=require(e)}catch(e){throw new ReferenceError("Given config path must be a valid `.js` or `.json` file path")}}return t}},{key:"writeFile",value:function(e,t){i.sync(s.dirname(e)),a.writeFileSync(e,t,{encoding:c.JavaScriptObfuscatorCLI.encoding})}}]),e}();t.CLIUtils=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(33);t.StringArrayEncodingSanitizer=function(e){switch(e){case"true":case"1":case n.StringArrayEncoding.Base64:return!0;case n.StringArrayEncoding.Rc4:return n.StringArrayEncoding.Rc4;default:return!1}}},function(e,t,r){"use strict";var n=r(40);Object.defineProperty(t,"__esModule",{value:!0});var o=r(34);t.SourceMapModeSanitizer=function(e){if(!n(o.SourceMapMode).some(function(t){return o.SourceMapMode[t]===e}))throw new ReferenceError("Invalid value of `--source-map-mode` option");return e}},function(e,t,r){"use strict";var n=r(40);Object.defineProperty(t,"__esModule",{value:!0});var o=r(20);t.ObfuscationTargetSanitizer=function(e){if(!n(o.ObfuscationTarget).some(function(t){return o.ObfuscationTarget[t]===e}))throw new ReferenceError("Invalid value of `--target` option");return e}},function(e,t,r){"use strict";var n=r(40);Object.defineProperty(t,"__esModule",{value:!0});var o=r(35);t.IdentifierNamesGeneratorSanitizer=function(e){if(!n(o.IdentifierNamesGenerator).some(function(t){return o.IdentifierNamesGenerator[t]===e}))throw new ReferenceError("Invalid value of `--identifier-names-generator` option");return e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanSanitizer=function(e){return"true"===e||"1"===e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArraySanitizer=function(e){if(/,$/.test(e))throw new SyntaxError("Multiple values should be wrapped inside quotes: --option-name 'value1, value2'");return e.split(",").map(function(e){return e.trim()})}},function(e,t){e.exports=require("commander")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Enter="enter",e.Leave="leave"}(t.VisitorDirection||(t.VisitorDirection={}))},function(e,t,r){"use strict";var n=r(1),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a=r(4),i=r(0),s=r(3),c=a.__importStar(r(17)),u=r(80),d=r(9),l=function(){function e(t){n(this,e),this.nodeTransformerFactory=t}return o(e,[{key:"transform",value:function(e,t,r){if(!t.length)return e;for(var n,o=[],a=[],i=t.length,s=0;s"),d="...".concat(i.substring(s,c).replace(/^\s+/,""),"...");throw new Error("".concat(r,"\n").concat(u," ").concat(d))}}]),e}();c.colorError=s.default.red,c.nearestSymbolsCount=10,t.EsprimaFacade=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.EmptySourceCode="Empty source code. Obfuscation canceled...",e.ObfuscationCompleted="Obfuscation completed. Total time: %s sec.",e.ObfuscationStarted="Obfuscation started...",e.RandomGeneratorSeed="Random generator seed: %s...",e.TransformationStage="Transformation stage: %s...",e.Version="Version: %s"}(t.LoggingMessage||(t.LoggingMessage={}))},function(e,t,r){"use strict";var n=r(11),o=r(1),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i,s=r(4),c=r(0),u=r(3),d=s.__importStar(r(47)),l=s.__importStar(r(53)),f=r(88),p=r(31),m=r(12),g=r(87),_=r(9),N=i=function(){function e(t,r,n,a,i){o(this,e),this.transformersRunner=t,this.sourceMapCorrector=r,this.randomGenerator=n,this.logger=a,this.options=i}return a(e,[{key:"obfuscate",value:function(e){var t=Date.now();this.logger.info(f.LoggingMessage.Version,l.version),this.logger.info(f.LoggingMessage.ObfuscationStarted),this.logger.info(f.LoggingMessage.RandomGeneratorSeed,this.randomGenerator.getSeed());var r=this.parseCode(e),n=this.transformAstTree(r),o=this.generateCode(e,n),a=(Date.now()-t)/1e3;return this.logger.success(f.LoggingMessage.ObfuscationCompleted,a),this.getObfuscationResult(o)}},{key:"parseCode",value:function(e){return g.EsprimaFacade.parse(e,{attachComment:!0,loc:this.options.sourceMap})}},{key:"transformAstTree",value:function(e){return!_.NodeGuards.isProgramNode(e)||e.body.length||e.leadingComments?(e=this.runTransformationStage(e,m.TransformationStage.Preparing),this.options.deadCodeInjection&&(e=this.runTransformationStage(e,m.TransformationStage.DeadCodeInjection)),this.options.controlFlowFlattening&&(e=this.runTransformationStage(e,m.TransformationStage.ControlFlowFlattening)),e=this.runTransformationStage(e,m.TransformationStage.Converting),e=this.runTransformationStage(e,m.TransformationStage.Obfuscating),e=this.runTransformationStage(e,m.TransformationStage.Finalizing)):(this.logger.warn(f.LoggingMessage.EmptySourceCode),e)}},{key:"generateCode",value:function(e,t){var r=n({},i.escodegenParams);this.options.sourceMap&&(r.sourceMap="sourceMap",r.sourceContent=e);var o=d.generate(t,n({},r,{format:{compact:this.options.compact}}));return o.map=o.map?o.map.toString():"",o}},{key:"getObfuscationResult",value:function(e){return this.sourceMapCorrector.correct(e.code,e.map)}},{key:"runTransformationStage",value:function(e,t){return this.logger.info(f.LoggingMessage.TransformationStage,t),this.transformersRunner.transform(e,i.transformersList,t)}}]),e}();N.escodegenParams={comment:!0,verbatim:"x-verbatim-property",sourceMapWithCode:!0},N.transformersList=[p.NodeTransformer.BlockStatementControlFlowTransformer,p.NodeTransformer.ClassDeclarationTransformer,p.NodeTransformer.CommentsTransformer,p.NodeTransformer.CustomNodesTransformer,p.NodeTransformer.DeadCodeInjectionTransformer,p.NodeTransformer.EvalCallExpressionTransformer,p.NodeTransformer.FunctionControlFlowTransformer,p.NodeTransformer.CatchClauseTransformer,p.NodeTransformer.FunctionDeclarationTransformer,p.NodeTransformer.FunctionTransformer,p.NodeTransformer.LabeledStatementTransformer,p.NodeTransformer.LiteralTransformer,p.NodeTransformer.MemberExpressionTransformer,p.NodeTransformer.MethodDefinitionTransformer,p.NodeTransformer.ObfuscatingGuardsTransformer,p.NodeTransformer.ObjectExpressionKeysTransformer,p.NodeTransformer.ObjectExpressionTransformer,p.NodeTransformer.ParentificationTransformer,p.NodeTransformer.TemplateLiteralTransformer,p.NodeTransformer.VariableDeclarationTransformer],N=i=s.__decorate([c.injectable(),s.__param(0,c.inject(u.ServiceIdentifiers.ITransformersRunner)),s.__param(1,c.inject(u.ServiceIdentifiers.ISourceMapCorrector)),s.__param(2,c.inject(u.ServiceIdentifiers.IRandomGenerator)),s.__param(3,c.inject(u.ServiceIdentifiers.ILogger)),s.__param(4,c.inject(u.ServiceIdentifiers.IOptions)),s.__metadata("design:paramtypes",[Object,Object,Object,Object,Object])],N),t.JavaScriptObfuscator=N},function(e,t,r){"use strict";var n=r(16),o=r(1),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i=r(4),s=r(0),c=function(){function e(){o(this,e),this.stringsCache=new n}return a(e,[{key:"encode",value:function(e,t){var r="".concat(e,"-").concat(String(t));if(this.stringsCache.has(r))return this.stringsCache.get(r);var n,o,a=new RegExp("[\\s\\S]","g"),i=new RegExp("['\"\\\\\\s]"),s=new RegExp("[\\x00-\\x7F]"),c=e.replace(a,function(e){return t||i.exec(e)?(s.exec(e)?(n="\\x",o="00"):(n="\\u",o="0000"),"".concat(n).concat((o+e.charCodeAt(0).toString(16)).slice(-o.length))):e});return this.stringsCache.set(r,c),c}}]),e}();c=i.__decorate([s.injectable()],c),t.EscapeSequenceEncoder=c},function(e,t){e.exports=require("chance")},function(e,t){e.exports=require("md5")},function(e,t,r){"use strict";var n=r(1),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a=r(4),i=r(0),s=r(3),c=r(54),u=r(27),d=function(){function e(t){n(this,e),this.randomGenerator=t}return o(e,[{key:"btoa",value:function(e){var t="";e=encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode(parseInt("".concat(u.Utils.hexadecimalPrefix).concat(t)))});for(var r,n,o=0,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e.charAt(0|o)||(a="=",o%1);t+=a.charAt(63&r>>8-o%1*8)){if((n=e.charCodeAt(o+=.75))>255)throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");r=r<<8|n}return t}},{key:"hideString",value:function(e,t){var r=this,n=this.randomGenerator.getRandomGenerator().string({length:t,pool:c.RandomGenerator.randomGeneratorPool}).replace(new RegExp("[".concat(e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"]"),"g"),""),o=n.split("");return this.randomGenerator.getRandomGenerator().shuffle(o),[function(e,t){for(var n=-1,o=-1,a="";n=0?t:null}},{key:"getLength",value:function(){return this.storageLength}},{key:"getStorage",value:function(){return this.storage}},{key:"getStorageId",value:function(){return this.storageId}},{key:"mergeWith",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.storage=n(this.storage).concat(n(e.getStorage())),t&&(this.storageId=e.getStorageId())}},{key:"set",value:function(e,t){e===this.storageLength?this.storage.push(t):this.storage.splice(e,0,t),this.storageLength++}}]),e}();i.__decorate([u.initializable(),i.__metadata("design:type",Array)],d.prototype,"storage",void 0),i.__decorate([u.initializable(),i.__metadata("design:type",String)],d.prototype,"storageId",void 0),i.__decorate([s.postConstruct(),i.__metadata("design:type",Function),i.__metadata("design:paramtypes",[]),i.__metadata("design:returntype",void 0)],d.prototype,"initialize",null),d=i.__decorate([s.injectable(),i.__param(0,s.inject(c.ServiceIdentifiers.IRandomGenerator)),i.__param(1,s.inject(c.ServiceIdentifiers.IOptions)),i.__metadata("design:paramtypes",[Object,Object])],d),t.ArrayStorage=d},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(44),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u,d=r(4),l=r(0),f=r(3),p=r(96),m=u=function(e){function t(e,r,a,s){var c;return o(this,t),(c=i(this,(t.__proto__||n(t)).call(this,a,s))).identifierNamesGenerator=e(s),c.arrayUtils=r,c}return c(t,e),a(t,[{key:"initialize",value:function(){s(t.prototype.__proto__||n(t.prototype),"initialize",this).call(this);var e=this.identifierNamesGenerator.generate().slice(0,u.stringArrayNameLength),r=this.identifierNamesGenerator.generate().slice(0,u.stringArrayNameLength),o="".concat(this.options.identifiersPrefix).concat(e),a="".concat(this.options.identifiersPrefix).concat(r);this.storageId="".concat(o,"|").concat(a)}},{key:"rotateArray",value:function(e){this.storage=this.arrayUtils.arrayRotate(this.storage,e)}},{key:"toString",value:function(){return this.storage.map(function(e){return"'".concat(e,"'")}).toString()}}]),t}(p.ArrayStorage);m.stringArrayNameLength=7,d.__decorate([l.postConstruct(),d.__metadata("design:type",Function),d.__metadata("design:paramtypes",[]),d.__metadata("design:returntype",void 0)],m.prototype,"initialize",null),m=u=d.__decorate([l.injectable(),d.__param(0,l.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d.__param(1,l.inject(f.ServiceIdentifiers.IArrayUtils)),d.__param(2,l.inject(f.ServiceIdentifiers.IRandomGenerator)),d.__param(3,l.inject(f.ServiceIdentifiers.IOptions)),d.__metadata("design:paramtypes",[Function,Object,Object,Object])],m),t.StringArrayStorage=m},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(44),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u,d=r(4),l=r(0),f=r(3),p=r(61),m=r(55),g=u=function(e){function t(e,r,a){var s;return o(this,t),(s=i(this,(t.__proto__||n(t)).call(this,r,a))).customNodeGroupFactory=e,s}return c(t,e),a(t,[{key:"initialize",value:function(){var e=this;s(t.prototype.__proto__||n(t.prototype),"initialize",this).call(this),u.customNodeGroupsList.forEach(function(t){var r=e.customNodeGroupFactory(t);r&&e.storage.set(t,r)})}}]),t}(m.MapStorage);g.customNodeGroupsList=[p.CustomNodeGroup.ConsoleOutputCustomNodeGroup,p.CustomNodeGroup.DebugProtectionCustomNodeGroup,p.CustomNodeGroup.DomainLockCustomNodeGroup,p.CustomNodeGroup.SelfDefendingCustomNodeGroup,p.CustomNodeGroup.StringArrayCustomNodeGroup],d.__decorate([l.postConstruct(),d.__metadata("design:type",Function),d.__metadata("design:paramtypes",[]),d.__metadata("design:returntype",void 0)],g.prototype,"initialize",null),g=u=d.__decorate([l.injectable(),d.__param(0,l.inject(f.ServiceIdentifiers.Factory__ICustomNodeGroup)),d.__param(1,l.inject(f.ServiceIdentifiers.IRandomGenerator)),d.__param(2,l.inject(f.ServiceIdentifiers.IOptions)),d.__metadata("design:paramtypes",[Function,Object,Object])],g),t.CustomNodeGroupStorage=g},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(6),i=r(5);Object.defineProperty(t,"__esModule",{value:!0});var s=r(4),c=r(0),u=r(3),d=function(e){function t(e,r){return o(this,t),a(this,(t.__proto__||n(t)).call(this,e,r))}return i(t,e),t}(r(55).MapStorage);d=s.__decorate([c.injectable(),s.__param(0,c.inject(u.ServiceIdentifiers.IRandomGenerator)),s.__param(1,c.inject(u.ServiceIdentifiers.IOptions)),s.__metadata("design:paramtypes",[Object,Object])],d),t.ControlFlowStorage=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),o=r(3),a=r(99),i=r(98),s=r(97);t.storagesModule=new n.ContainerModule(function(e){e(o.ServiceIdentifiers.TCustomNodeGroupStorage).to(i.CustomNodeGroupStorage).inSingletonScope(),e(o.ServiceIdentifiers.TStringArrayStorage).to(s.StringArrayStorage).inSingletonScope(),e(o.ServiceIdentifiers.Newable__TControlFlowStorage).toConstructor(a.ControlFlowStorage),e(o.ServiceIdentifiers.Factory__TControlFlowStorage).toFactory(function(e){return function(){var t=new(e.container.get(o.ServiceIdentifiers.Newable__TControlFlowStorage))(e.container.get(o.ServiceIdentifiers.IRandomGenerator),e.container.get(o.ServiceIdentifiers.IOptions));return t.initialize(),t}})})},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=r(12),f=r(14),p=r(8),m=function(e){function t(e,r){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r))}return s(t,e),a(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case l.TransformationStage.Preparing:return{enter:function(e,r){return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){return p.NodeUtils.parentizeNode(e,t)}}]),t}(f.AbstractNodeTransformer);m=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Object,Object])],m),t.ParentificationTransformer=m},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c,u=r(4),d=r(0),l=r(3),f=r(56),p=r(12),m=r(14),g=c=function(e){function t(e,r,a){var s;return o(this,t),(s=i(this,(t.__proto__||n(t)).call(this,r,a))).obfuscatingGuards=c.obfuscatingGuardsList.map(e),s}return s(t,e),a(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case p.TransformationStage.Preparing:return{enter:function(e,r){return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){var r=this.obfuscatingGuards.every(function(t){return t.check(e)});return e.ignoredNode=!r,e}}]),t}(m.AbstractNodeTransformer);g.obfuscatingGuardsList=[f.ObfuscatingGuard.BlackListNodeGuard,f.ObfuscatingGuard.ConditionalCommentNodeGuard],g=c=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__INodeGuard)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object])],g),t.ObfuscatingGuardsTransformer=g},function(e,t){e.exports=require("js-string-escape")},function(e,t,r){"use strict";var n=r(30),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u,d=r(4),l=r(0),f=r(3),p=d.__importDefault(r(103)),m=r(12),g=r(14),_=r(9),N=r(15),v=r(8),y=u=function(e){function t(e,r){var i;return a(this,t),(i=s(this,(t.__proto__||o(t)).call(this,e,r))).evalRootAstHostNodeSet=new n,i}return c(t,e),i(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case m.TransformationStage.Preparing:return{enter:function(e,r){if(r&&_.NodeGuards.isCallExpressionNode(e)&&_.NodeGuards.isIdentifierNode(e.callee)&&"eval"===e.callee.name)return t.transformNode(e,r)}};case m.TransformationStage.Finalizing:return this.evalRootAstHostNodeSet.size?{leave:function(e,r){if(r&&t.isEvalRootAstHostNode(e))return t.restoreNode(e,r)}}:null;default:return null}}},{key:"transformNode",value:function(e,t){var r=e.arguments[0];if(!r)return e;var n,o=u.extractEvalStringFromCallExpressionArgument(r);if(!o)return e;try{n=v.NodeUtils.convertCodeToStructure(o)}catch(t){return e}var a=N.Nodes.getFunctionExpressionNode([],N.Nodes.getBlockStatementNode(n));return this.evalRootAstHostNodeSet.add(a),a}},{key:"restoreNode",value:function(e,t){var r=e.body.body,n=v.NodeUtils.convertStructureToCode(r);return N.Nodes.getCallExpressionNode(N.Nodes.getIdentifierNode("eval"),[N.Nodes.getLiteralNode(p.default(n))])}},{key:"isEvalRootAstHostNode",value:function(e){return _.NodeGuards.isFunctionExpressionNode(e)&&this.evalRootAstHostNodeSet.has(e)}}],[{key:"extractEvalStringFromCallExpressionArgument",value:function(e){return _.NodeGuards.isLiteralNode(e)?u.extractEvalStringFromLiteralNode(e):_.NodeGuards.isTemplateLiteralNode(e)?u.extractEvalStringFromTemplateLiteralNode(e):null}},{key:"extractEvalStringFromLiteralNode",value:function(e){return"string"==typeof e.value?e.value:null}},{key:"extractEvalStringFromTemplateLiteralNode",value:function(e){var t=e.quasis;return 1!==t.length||e.expressions.length?null:t[0].value.cooked}}]),t}(g.AbstractNodeTransformer);y=u=d.__decorate([l.injectable(),d.__param(0,l.inject(f.ServiceIdentifiers.IRandomGenerator)),d.__param(1,l.inject(f.ServiceIdentifiers.IOptions)),d.__metadata("design:paramtypes",[Object,Object])],y),t.EvalCallExpressionTransformer=y},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=r(23),f=r(12),p=r(14),m=r(9),g=function(e){function t(e,r,a,s,c){var u;return o(this,t),(u=i(this,(t.__proto__||n(t)).call(this,s,c))).stackTraceData=[],u.stackTraceAnalyzer=e,u.obfuscationEventEmitter=r,u.customNodeGroupStorage=a,u}return s(t,e),a(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case f.TransformationStage.Preparing:return{leave:function(e,r){if(m.NodeGuards.isProgramNode(e))return t.analyzeNode(e,r),t.appendCustomNodesBeforeObfuscation(e,r),t.transformNode(e,r)}};case f.TransformationStage.Finalizing:return{leave:function(e,r){m.NodeGuards.isProgramNode(e)&&t.appendCustomNodesAfterObfuscation(e,r)}};default:return null}}},{key:"analyzeNode",value:function(e,t){this.stackTraceData=this.stackTraceAnalyzer.analyze(e)}},{key:"transformNode",value:function(e,t){return e}},{key:"appendCustomNodesBeforeObfuscation",value:function(e,t){var r=this;this.customNodeGroupStorage.getStorage().forEach(function(e){e.initialize(),r.obfuscationEventEmitter.once(e.getAppendEvent(),e.appendCustomNodes.bind(e))}),this.obfuscationEventEmitter.emit(l.ObfuscationEvent.BeforeObfuscation,e,this.stackTraceData)}},{key:"appendCustomNodesAfterObfuscation",value:function(e,t){this.obfuscationEventEmitter.emit(l.ObfuscationEvent.AfterObfuscation,e,this.stackTraceData)}}]),t}(p.AbstractNodeTransformer);g=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.IStackTraceAnalyzer)),c.__param(1,u.inject(d.ServiceIdentifiers.IObfuscationEventEmitter)),c.__param(2,u.inject(d.ServiceIdentifiers.TCustomNodeGroupStorage)),c.__param(3,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(4,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Object,Object,Object,Object,Object])],g),t.CustomNodesTransformer=g},function(e,t,r){"use strict";var n=r(1),o=r(2);Object.defineProperty(t,"__esModule",{value:!0});var a,i=r(4),s=r(0),c=r(9),u=a=function(){function e(){n(this,e),this.obfuscationAllowedForCurrentNode=!0,this.obfuscationAllowedForNextNode=null}return o(e,[{key:"check",value:function(e){if(this.obfuscationAllowedForNextNode&&(this.obfuscationAllowedForCurrentNode=this.obfuscationAllowedForNextNode,this.obfuscationAllowedForNextNode=null),!c.NodeGuards.isNodeWithComments(e))return this.obfuscationAllowedForCurrentNode;var t=e.leadingComments,r=e.trailingComments;return t&&(this.obfuscationAllowedForCurrentNode=this.checkComments(t)),r&&(this.obfuscationAllowedForNextNode=this.checkComments(r)),this.obfuscationAllowedForCurrentNode}},{key:"checkComments",value:function(e){for(var t=e.length,r=this.obfuscationAllowedForCurrentNode,n=0;n=u.minimumLengthForStringArray&&this.randomGenerator.getMathRandom()<=this.options.stringArrayThreshold}},{key:"getStringArrayHexadecimalIndex",value:function(e,t){if(this.stringLiteralHexadecimalIndexCache.has(e))return{fromCache:!0,index:this.stringLiteralHexadecimalIndexCache.get(e)};var r=_.Utils.decToHex(t),n="".concat(_.Utils.hexadecimalPrefix).concat(r);return this.stringLiteralHexadecimalIndexCache.set(e,n),{fromCache:!1,index:n}}},{key:"getEncodedValue",value:function(e){var t,r=null;switch(this.options.stringArrayEncoding){case p.StringArrayEncoding.Rc4:r=this.randomGenerator.getRandomGenerator().pickone(this.rc4Keys),t=this.cryptUtils.btoa(this.cryptUtils.rc4(e,r));break;case p.StringArrayEncoding.Base64:t=this.cryptUtils.btoa(e);break;default:t=e}return{encodedValue:t,key:r}}},{key:"replaceWithLiteralNode",value:function(e){return g.Nodes.getLiteralNode(this.escapeSequenceEncoder.encode(e,this.options.unicodeEscapeSequence))}},{key:"replaceWithStringArrayCallNode",value:function(e){var t=this.getEncodedValue(e),r=t.encodedValue,n=t.key,o=this.escapeSequenceEncoder.encode(r,this.options.unicodeEscapeSequence),a=this.stringArrayStorage.getLength(),i=this.stringArrayStorage.getStorageId().split("|")[1],s=this.getStringArrayHexadecimalIndex(o,a),c=s.fromCache,d=s.index;c||this.stringArrayStorage.set(a,o);var l=[u.getHexadecimalLiteralNode(d)];n&&l.push(u.getRc4KeyLiteralNode(this.escapeSequenceEncoder.encode(n,this.options.unicodeEscapeSequence)));var f=g.Nodes.getIdentifierNode(i);return f.obfuscatedNode=!0,g.Nodes.getCallExpressionNode(f,l)}}],[{key:"getHexadecimalLiteralNode",value:function(e){var t=g.Nodes.getLiteralNode(e);return t.obfuscatedNode=!0,t}},{key:"getRc4KeyLiteralNode",value:function(e){var t=g.Nodes.getLiteralNode(e);return t.obfuscatedNode=!0,t}}]),t}(m.AbstractObfuscatingReplacer);N.minimumLengthForStringArray=3,N.rc4KeyLength=4,N.rc4KeysCount=50,N=u=d.__decorate([l.injectable(),d.__param(0,l.inject(f.ServiceIdentifiers.TStringArrayStorage)),d.__param(1,l.inject(f.ServiceIdentifiers.IEscapeSequenceEncoder)),d.__param(2,l.inject(f.ServiceIdentifiers.IRandomGenerator)),d.__param(3,l.inject(f.ServiceIdentifiers.ICryptUtils)),d.__param(4,l.inject(f.ServiceIdentifiers.IOptions)),d.__metadata("design:paramtypes",[Object,Object,Object,Object,Object])],N),t.StringLiteralObfuscatingReplacer=N},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c,u=r(4),d=r(0),l=r(3),f=r(19),p=r(12),m=r(14),g=r(9),_=c=function(e){function t(e,r){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r))}return s(t,e),a(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case p.TransformationStage.Obfuscating:return{enter:function(e,r){if(r&&g.NodeGuards.isObjectExpressionNode(e))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){return e.properties.forEach(function(e){e.computed||(e.shorthand&&(e.shorthand=!1),g.NodeGuards.isIdentifierNode(e.key)&&(e.key=c.transformIdentifierPropertyKey(e.key)))}),e}}],[{key:"transformIdentifierPropertyKey",value:function(e){return{type:f.NodeType.Literal,value:e.name,raw:"'".concat(e.name,"'")}}}]),t}(m.AbstractNodeTransformer);_=c=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Object,Object])],_),t.ObjectExpressionTransformer=_},function(e,t,r){"use strict";var n=r(16),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=r(38),p=r(15),m=r(27),g=function(e){function t(e){var r;return a(this,t),(r=s(this,(t.__proto__||o(t)).call(this,e))).numberLiteralCache=new n,r}return c(t,e),i(t,[{key:"replace",value:function(e){var t;return this.numberLiteralCache.has(e)?t=this.numberLiteralCache.get(e):(t=m.Utils.isCeilNumber(e)?"".concat(m.Utils.hexadecimalPrefix).concat(m.Utils.decToHex(e)):String(e),this.numberLiteralCache.set(e,t)),p.Nodes.getLiteralNode(e,t)}}]),t}(f.AbstractObfuscatingReplacer);g=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Object])],g),t.NumberLiteralObfuscatingReplacer=g},function(e,t,r){"use strict";var n=r(66),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=r(57),p=r(12),m=r(14),g=r(9),_=function(e){function t(e,r,n){var i;return a(this,t),(i=s(this,(t.__proto__||o(t)).call(this,r,n))).literalObfuscatingReplacerFactory=e,i}return c(t,e),i(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case p.TransformationStage.Obfuscating:return{enter:function(e,r){if(r&&g.NodeGuards.isLiteralNode(e)&&!e.obfuscatedNode)return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){if(t&&g.NodeGuards.isPropertyNode(t)&&t.key===e)return e;switch(n(e.value)){case"boolean":return this.literalObfuscatingReplacerFactory(f.LiteralObfuscatingReplacer.BooleanLiteralObfuscatingReplacer).replace(e.value);case"number":return this.literalObfuscatingReplacerFactory(f.LiteralObfuscatingReplacer.NumberLiteralObfuscatingReplacer).replace(e.value);case"string":return this.literalObfuscatingReplacerFactory(f.LiteralObfuscatingReplacer.StringLiteralObfuscatingReplacer).replace(e.value);default:return e}}}]),t}(m.AbstractNodeTransformer);_=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IObfuscatingReplacer)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object])],_),t.LiteralTransformer=_},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=c.__importStar(r(17)),f=r(22),p=r(12),m=r(14),g=r(9),_=function(e){function t(e,r,a){var s;return o(this,t),(s=i(this,(t.__proto__||n(t)).call(this,r,a))).identifierObfuscatingReplacer=e(f.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),s}return s(t,e),a(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case p.TransformationStage.Obfuscating:return{enter:function(e,r){if(r&&g.NodeGuards.isLabeledStatementNode(e))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){var r=this.nodeIdentifier++;return this.storeLabeledStatementName(e,r),this.replaceLabeledStatementName(e,r),e}},{key:"storeLabeledStatementName",value:function(e,t){this.identifierObfuscatingReplacer.storeLocalName(e.label.name,t)}},{key:"replaceLabeledStatementName",value:function(e,t){var r=this;l.replace(e,{enter:function(e,n){if(n&&g.NodeGuards.isLabelIdentifierNode(e,n)){var o=r.identifierObfuscatingReplacer.replace(e.name,t);e.name=o.name}}})}}]),t}(m.AbstractNodeTransformer);_=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],_),t.LabeledStatementTransformer=_},function(e,t,r){"use strict";var n=r(30),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=u.__importStar(r(17)),p=r(22),m=r(12),g=r(14),_=r(9),N=function(e){function t(e,r,n){var i;return a(this,t),(i=s(this,(t.__proto__||o(t)).call(this,r,n))).identifierObfuscatingReplacer=e(p.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),i}return c(t,e),i(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case m.TransformationStage.Obfuscating:return{enter:function(e,r){if(r&&(_.NodeGuards.isFunctionDeclarationNode(e)||_.NodeGuards.isFunctionExpressionNode(e)||_.NodeGuards.isArrowFunctionExpressionNode(e)))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){var r=this.nodeIdentifier++;return this.storeFunctionParams(e,r),this.replaceFunctionParams(e,r),e}},{key:"storeFunctionParams",value:function(e,t){var r=this;e.params.forEach(function(e){if(_.NodeGuards.isObjectPatternNode(e))return f.VisitorOption.Skip;f.traverse(e,{enter:function(e){if(_.NodeGuards.isAssignmentPatternNode(e)&&_.NodeGuards.isIdentifierNode(e.left))return r.identifierObfuscatingReplacer.storeLocalName(e.left.name,t),f.VisitorOption.Skip;_.NodeGuards.isIdentifierNode(e)&&r.identifierObfuscatingReplacer.storeLocalName(e.name,t)}})})}},{key:"addIdentifiersToIgnoredIdentifierNamesSet",value:function(e,t){e.forEach(function(e){_.NodeGuards.isIdentifierNode(e.key)&&t.add(e.key.name)})}},{key:"replaceFunctionParams",value:function(e,t){var r=this,o=new n,a={enter:function(e,n){if(_.NodeGuards.isObjectPatternNode(e)&&r.addIdentifiersToIgnoredIdentifierNamesSet(e.properties,o),n&&_.NodeGuards.isReplaceableIdentifierNode(e,n)&&!o.has(e.name)){var a=r.identifierObfuscatingReplacer.replace(e.name,t).name;e.name!==a&&(e.name=a,e.obfuscatedNode=!0)}}};e.params.forEach(function(e){return f.replace(e,a)}),f.replace(e.body,a)}}]),t}(g.AbstractNodeTransformer);N=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierObfuscatingReplacer)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object])],N),t.FunctionTransformer=N},function(e,t,r){"use strict";var n=r(16),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=u.__importStar(r(17)),p=r(22),m=r(19),g=r(12),_=r(14),N=r(9),v=r(8),y=function(e){function t(e,r,i){var c;return a(this,t),(c=s(this,(t.__proto__||o(t)).call(this,r,i))).replaceableIdentifiers=new n,c.identifierObfuscatingReplacer=e(p.IdentifierObfuscatingReplacer.BaseIdentifierObfuscatingReplacer),c}return c(t,e),i(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case g.TransformationStage.Obfuscating:return{enter:function(e,r){if(r&&N.NodeGuards.isFunctionDeclarationNode(e))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){var r=this.nodeIdentifier++,n=v.NodeUtils.getBlockScopesOfNode(e)[0],o=n.type===m.NodeType.Program;return!this.options.renameGlobals&&o?e:(this.storeFunctionName(e,o,r),this.replaceableIdentifiers.has(n)?this.replaceScopeCachedIdentifiers(e,n,r):this.replaceScopeIdentifiers(n,r),e)}},{key:"storeFunctionName",value:function(e,t,r){t?this.identifierObfuscatingReplacer.storeGlobalName(e.id.name,r):this.identifierObfuscatingReplacer.storeLocalName(e.id.name,r)}},{key:"replaceScopeCachedIdentifiers",value:function(e,t,r){var n=this.replaceableIdentifiers.get(t);if(n){var o=n.get(e.id.name);if(o)for(var a=o.length,i=0;i=0);return"a".concat(n(r))},r=t(e);return c.validateMangledName(r)||(r=c.generateNewMangledName(r)),r}},{key:"validateMangledName",value:function(e){return!c.reservedNames.includes(e)}}]),t}(f.AbstractIdentifierNamesGenerator);p.initMangledNameCharacter="9",p.nameSequence="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),p.reservedNames=["byte","case","char","do","else","enum","eval","for","goto","if","in","int","let","long","new","null","this","true","try","var","void","with"],p=c=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Object,Object])],p),t.MangledIdentifierNamesGenerator=p},function(e,t,r){"use strict";var n=r(30),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u,d=r(4),l=r(0),f=r(3),p=r(58),m=r(27),g=u=function(e){function t(e,r){var i;return a(this,t),(i=s(this,(t.__proto__||o(t)).call(this,e,r))).randomVariableNameSet=new n,i}return c(t,e),i(t,[{key:"generate",value:function(){var e=this.randomGenerator.getRandomInteger(1e4,99999999),t=m.Utils.decToHex(e).substr(0,u.baseIdentifierNameLength),r="_".concat(m.Utils.hexadecimalPrefix).concat(t);return this.randomVariableNameSet.has(r)?this.generate():(this.randomVariableNameSet.add(r),r)}},{key:"generateWithPrefix",value:function(){var e=this.generate();return"".concat(this.options.identifiersPrefix).concat(e).replace("__","_")}}]),t}(p.AbstractIdentifierNamesGenerator);g.baseIdentifierNameLength=6,g=u=d.__decorate([l.injectable(),d.__param(0,l.inject(f.ServiceIdentifiers.IRandomGenerator)),d.__param(1,l.inject(f.ServiceIdentifiers.IOptions)),d.__metadata("design:paramtypes",[Object,Object])],g),t.HexadecimalIdentifierNamesGenerator=g},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),o=r(3),a=r(35),i=r(140),s=r(139);t.generatorsModule=new n.ContainerModule(function(e){e(o.ServiceIdentifiers.IIdentifierNamesGenerator).to(i.HexadecimalIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(a.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator),e(o.ServiceIdentifiers.IIdentifierNamesGenerator).to(s.MangledIdentifierNamesGenerator).inSingletonScope().whenTargetNamed(a.IdentifierNamesGenerator.MangledIdentifierNamesGenerator),e(o.ServiceIdentifiers.Factory__IIdentifierNamesGenerator).toFactory(function(e){var t=null;return function(r){if(t)return t;var n;switch(r.identifierNamesGenerator){case a.IdentifierNamesGenerator.MangledIdentifierNamesGenerator:n=e.container.getNamed(o.ServiceIdentifiers.IIdentifierNamesGenerator,a.IdentifierNamesGenerator.MangledIdentifierNamesGenerator);break;case a.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator:default:n=e.container.getNamed(o.ServiceIdentifiers.IIdentifierNamesGenerator,a.IdentifierNamesGenerator.HexadecimalIdentifierNamesGenerator)}return t=n,n}})})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);t.finalizingTransformersModule=new n.ContainerModule(function(e){})},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=r(10),f=r(13),p=r(15),m=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e){this.literalValue=e}},{key:"getNodeStructure",value:function(){return[p.Nodes.getExpressionStatementNode(p.Nodes.getLiteralNode(this.literalValue))]}}]),t}(f.AbstractCustomNode);c.__decorate([l.initializable(),c.__metadata("design:type",String)],m.prototype,"literalValue",void 0),m=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],m),t.StringLiteralNode=m},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=r(10),f=r(13),p=r(15),m=r(8),g=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e,t){this.controlFlowStorageName=e,this.controlFlowStorageKey=t}},{key:"getNodeStructure",value:function(){var e=p.Nodes.getExpressionStatementNode(p.Nodes.getMemberExpressionNode(p.Nodes.getIdentifierNode(this.controlFlowStorageName),p.Nodes.getIdentifierNode(this.controlFlowStorageKey)));return m.NodeUtils.parentize(e),[e]}}]),t}(f.AbstractCustomNode);c.__decorate([l.initializable(),c.__metadata("design:type",String)],g.prototype,"controlFlowStorageKey",void 0),c.__decorate([l.initializable(),c.__metadata("design:type",String)],g.prototype,"controlFlowStorageName",void 0),g=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],g),t.StringLiteralControlFlowStorageCallNode=g},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.False="![]",e.True="!![]",e.a='(false+"")[1]',e.b='([]["entries"]()+"")[2]',e.c='([]["fill"]+"")[3]',e.d='(undefined+"")[2]',e.e='(true+"")[3]',e.f='(false+"")[0]',e.g="(false+[0]+String)[20]",e.h='(+(101))["toString"](21)[1]',e.i="([false]+undefined)[10]",e.j='([]["entries"]()+"")[3]',e.k='(+(20))["toString"](21)',e.l='(false+"")[2]',e.m='(Number+"")[11]',e.n='(undefined+"")[1]',e.o='(true+[]["fill"])[10]',e.p='(+(211))["toString"](31)[1]',e.q='(+(212))["toString"](31)[1]',e.r='(true+"")[1]',e.s='(false+"")[3]',e.t='(true+"")[0]',e.u='(undefined+"")[0]',e.v='(+(31))["toString"](32)',e.w='(+(32))["toString"](33)',e.x='(+(101))["toString"](34)[1]',e.y="(NaN+[Infinity])[10]",e.z='(+(35))["toString"](36)',e.A="(+[]+Array)[10]",e.B="(+[]+Boolean)[10]",e.C='Function("return escape")()(("")["italics"]())[2]',e.D='Function("return escape")()([]["fill"])["slice"]("-1")',e.E='(RegExp+"")[12]',e.F="(+[]+Function)[10]",e.G='(false+Function("return Date")()())[30]',e.H="'H'",e.I='(Infinity+"")[0]',e.J="'J'",e.K="'K'",e.L="'L'",e.M='(true+Function("return Date")()())[30]',e.N='(NaN+"")[0]',e.O='(NaN+Function("return{}")())[11]',e.P="'P'",e.Q="'Q'",e.R="(+[]+RegExp)[10]",e.S="(+[]+String)[10]",e.T='(NaN+Function("return Date")()())[30]',e.U='(NaN+Function("return{}")()["toString"]["call"]())[11]',e.V="'V'",e.W="'W'",e.X="'X'",e.Y="'Y'",e.Z="'Z'"}(t.JSFuck||(t.JSFuck={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRotateFunctionTemplate=function(){return"\n (function (array, {timesName}) {\n var {whileFunctionName} = function (times) {\n while (--times) {\n array['push'](array['shift']());\n }\n };\n \n {code}\n })({stringArrayName}, 0x{stringArrayRotateValue});\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e){return"\n var selfDefendingFunc = function () {\n var object = {\n data: {\n key: 'cookie',\n value: 'timeout'\n },\n setCookie: function (options, name, value, document) {\n document = document || {};\n \n var updatedCookie = name + \"=\" + value;\n\n var i = 0;\n \n for (var i = 0, len = options.length; i < len; i++) {\n var propName = options[i];\n \n updatedCookie += \"; \" + propName;\n \n var propValue = options[propName];\n \n options.push(propValue);\n len = options.length;\n \n if (propValue !== true) {\n updatedCookie += \"=\" + propValue;\n }\n }\n\n document['cookie'] = updatedCookie;\n },\n removeCookie: function(){return 'dev';},\n getCookie: function (document, name) {\n document = document || function (value) { return value };\n var matches = document(new RegExp(\n \"(?:^|; )\" + name.replace(/([.$?*|{}()[]\\/+^])/g, '\\$1') + \"=([^;]*)\"\n ));\n \n var func = function (param1, param2) {\n param1(++param2);\n };\n \n func({whileFunctionName}, {timesName});\n \n return matches ? decodeURIComponent(matches[1]) : undefined;\n }\n };\n \n var test1 = function () {\n var regExp = new RegExp('".concat(e.encode("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}",!0),"');\n \n return regExp.test(object.removeCookie.toString());\n };\n \n object['updateCookie'] = test1;\n \n var cookie = '';\n var result = object['updateCookie']();\n \n if (!result) {\n object['setCookie'](['*'], 'counter', 1);\n } else if (result) {\n cookie = object['getCookie'](null, 'counter');\n } else {\n object['removeCookie']();\n }\n };\n \n selfDefendingFunc();\n ")}},function(e,t,r){"use strict";var n=r(11),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=u.__importDefault(r(18)),p=r(10),m=r(39),g=r(147),_=r(146),N=r(13),v=r(32),y=r(8),h=r(27),b=function(e){function t(e,r,n,i){var c;return a(this,t),(c=s(this,(t.__proto__||o(t)).call(this,e,r,i))).escapeSequenceEncoder=n,c}return c(t,e),i(t,[{key:"initialize",value:function(e,t){this.stringArrayName=e,this.stringArrayRotateValue=t}},{key:"getNodeStructure",value:function(){return y.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){var e=this.identifierNamesGenerator.generate(),t=this.identifierNamesGenerator.generate(),r="";return r=this.options.selfDefending?f.default(g.SelfDefendingTemplate(this.escapeSequenceEncoder),{timesName:e,whileFunctionName:t}):"".concat(t,"(++").concat(e,")"),v.JavaScriptObfuscator.obfuscate(f.default(_.StringArrayRotateFunctionTemplate(),{code:r,timesName:e,stringArrayName:this.stringArrayName,stringArrayRotateValue:h.Utils.decToHex(this.stringArrayRotateValue),whileFunctionName:t}),n({},m.NO_ADDITIONAL_NODES_PRESET,{identifierNamesGenerator:this.options.identifierNamesGenerator,seed:this.options.seed})).getObfuscatedCode()}}]),t}(N.AbstractCustomNode);u.__decorate([p.initializable(),u.__metadata("design:type",String)],b.prototype,"stringArrayName",void 0),u.__decorate([p.initializable(),u.__metadata("design:type",Number)],b.prototype,"stringArrayRotateValue",void 0),b=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IEscapeSequenceEncoder)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object,Object])],b),t.StringArrayRotateFunctionNode=b},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayTemplate=function(){return"\n var {stringArrayName} = [{stringArray}];\n "}},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(44),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=u.__importDefault(r(18)),p=r(10),m=r(149),g=r(13),_=r(8),N=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return c(t,e),a(t,[{key:"initialize",value:function(e,t,r){this.stringArrayStorage=e,this.stringArrayName=t,this.stringArrayRotateValue=r}},{key:"getNode",value:function(){return this.stringArrayStorage.rotateArray(this.stringArrayRotateValue),s(t.prototype.__proto__||n(t.prototype),"getNode",this).call(this)}},{key:"getNodeStructure",value:function(){return _.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){return f.default(m.StringArrayTemplate(),{stringArrayName:this.stringArrayName,stringArray:this.stringArrayStorage.toString()})}}]),t}(g.AbstractCustomNode);u.__decorate([p.initializable(),u.__metadata("design:type",Object)],N.prototype,"stringArrayStorage",void 0),u.__decorate([p.initializable(),u.__metadata("design:type",String)],N.prototype,"stringArrayName",void 0),u.__decorate([p.initializable(),u.__metadata("design:type",Number)],N.prototype,"stringArrayRotateValue",void 0),N=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object])],N),t.StringArrayNode=N},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayRc4DecodeNodeTemplate=function(e){var t=e.getRandomString(6),r=e.getRandomString(6),n=e.getRandomString(6),o=e.getRandomString(6);return"\n if ({stringArrayCallsWrapperName}.".concat(t," === undefined) {\n {atobPolyfill}\n \n {rc4Polyfill}\n {stringArrayCallsWrapperName}.").concat(r," = rc4;\n \n {stringArrayCallsWrapperName}.").concat(n," = {};\n \n {stringArrayCallsWrapperName}.").concat(t," = true;\n }\n \n var cachedValue = {stringArrayCallsWrapperName}.").concat(n,"[index];\n\n if (cachedValue === undefined) {\n if ({stringArrayCallsWrapperName}.").concat(o," === undefined) {\n {selfDefendingCode}\n \n {stringArrayCallsWrapperName}.").concat(o," = true;\n }\n \n value = {stringArrayCallsWrapperName}.").concat(r,"(value, key);\n {stringArrayCallsWrapperName}.").concat(n,"[index] = value;\n } else {\n value = cachedValue;\n }\n ")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayCallsWrapperTemplate=function(){return"\n var {stringArrayCallsWrapperName} = function (index, key) {\n index = index - 0;\n \n var value = {stringArrayName}[index];\n \n {decodeNodeTemplate}\n \n return value;\n };\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringArrayBase64DecodeNodeTemplate=function(e){var t=e.getRandomString(6),r=e.getRandomString(6),n=e.getRandomString(6);return"\n if ({stringArrayCallsWrapperName}.".concat(t," === undefined) {\n {atobPolyfill}\n \n {stringArrayCallsWrapperName}.").concat(r," = function (str) {\n var string = atob(str);\n var newStringChars = [];\n \n for (var i = 0, length = string.length; i < length; i++) {\n newStringChars += '%' + ('00' + string.charCodeAt(i).toString(16)).slice(-2);\n }\n \n return decodeURIComponent(newStringChars);\n };\n \n {stringArrayCallsWrapperName}.").concat(n," = {};\n \n {stringArrayCallsWrapperName}.").concat(t," = true;\n }\n \n var cachedValue = {stringArrayCallsWrapperName}.").concat(n,"[index];\n \n if (cachedValue === undefined) {\n {selfDefendingCode}\n \n value = {stringArrayCallsWrapperName}.").concat(r,"(value);\n {stringArrayCallsWrapperName}.").concat(n,"[index] = value;\n } else {\n value = cachedValue;\n }\n ")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e,t){var r=e.getRandomString(6),n=e.getRandomString(6),o=e.getRandomString(6),a=e.getRandomString(6),i=e.getRandomString(6),s=e.getRandomString(6),c=e.getRandomString(6),u=e.getRandomString(6),d=e.getRandomString(6);return"\n var StatesClass = function (".concat(r,") {\n this.").concat(r," = ").concat(r,";\n this.").concat(n," = [1, 0, 0];\n this.").concat(o," = function(){return 'newState';};\n this.").concat(a," = '").concat(t.encode("\\w+ *\\(\\) *{\\w+ *",!0),"';\n this.").concat(i," = '").concat(t.encode("['|\"].+['|\"];? *}",!0),"';\n };\n \n StatesClass.prototype.").concat(s," = function () {\n var regExp = new RegExp(this.").concat(a," + this.").concat(i,");\n var expression = regExp.test(this.").concat(o,".toString())\n ? --this.").concat(n,"[1]\n : --this.").concat(n,"[0];\n \n return this.").concat(c,"(expression);\n };\n \n StatesClass.prototype.").concat(c," = function (").concat(d,") {\n if (!Boolean(~").concat(d,")) {\n return ").concat(d,";\n }\n \n return this.").concat(u,"(this.").concat(r,");\n };\n\n StatesClass.prototype.").concat(u," = function (").concat(r,") {\n for (var i = 0, len = this.").concat(n,".length; i < len; i++) {\n this.").concat(n,".push(Math.round(Math.random()));\n len = this.").concat(n,".length;\n }\n \n return ").concat(r,"(this.").concat(n,"[0]);\n };\n\n new StatesClass({stringArrayCallsWrapperName}).").concat(s,"();\n ")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Rc4Template=function(){return"\n var rc4 = function (str, key) {\n var s = [], j = 0, x, res = '', newStr = '';\n \n str = atob(str);\n \n for (var k = 0, length = str.length; k < length; k++) {\n newStr += '%' + ('00' + str.charCodeAt(k).toString(16)).slice(-2);\n }\n \n str = decodeURIComponent(newStr);\n \t \n\t for (var i = 0; i < 256; i++) {\n s[i] = i;\n }\n \n for (i = 0; i < 256; i++) {\n j = (j + s[i] + key.charCodeAt(i % key.length)) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n }\n \n i = 0;\n j = 0;\n \n for (var y = 0; y < str.length; y++) {\n i = (i + 1) % 256;\n j = (j + s[i]) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n res += String.fromCharCode(str.charCodeAt(y) ^ s[(s[i] + s[j]) % 256]);\n }\n \n return res;\n }\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AtobTemplate=function(){return"\n (function () {\n {globalVariableTemplate}\n \n var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\n that.atob || (\n that.atob = function(input) {\n var str = String(input).replace(/=+$/, '');\n for (\n var bc = 0, bs, buffer, idx = 0, output = '';\n buffer = str.charAt(idx++);\n ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,\n bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0\n ) {\n buffer = chars.indexOf(buffer);\n }\n return output;\n });\n })();\n "}},function(e,t,r){"use strict";var n=r(11),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=u.__importDefault(r(18)),p=r(20),m=r(33),g=r(10),_=r(39),N=r(156),v=r(45),y=r(155),h=r(154),b=r(153),S=r(152),I=r(151),C=r(13),O=r(32),j=r(8),F=function(e){function t(e,r,n,i){var c;return a(this,t),(c=s(this,(t.__proto__||o(t)).call(this,e,r,i))).escapeSequenceEncoder=n,c}return c(t,e),i(t,[{key:"initialize",value:function(e,t){this.stringArrayName=e,this.stringArrayCallsWrapperName=t}},{key:"getNodeStructure",value:function(){return j.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){var e=this.getDecodeStringArrayTemplate();return O.JavaScriptObfuscator.obfuscate(f.default(S.StringArrayCallsWrapperTemplate(),{decodeNodeTemplate:e,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName,stringArrayName:this.stringArrayName}),n({},_.NO_ADDITIONAL_NODES_PRESET,{identifierNamesGenerator:this.options.identifierNamesGenerator,seed:this.options.seed})).getObfuscatedCode()}},{key:"getDecodeStringArrayTemplate",value:function(){var e=this.options.target!==p.ObfuscationTarget.Extension?this.getGlobalVariableTemplate():v.GlobalVariableNoEvalTemplate(),t=f.default(N.AtobTemplate(),{globalVariableTemplate:e}),r="",n="";switch(this.options.selfDefending&&(n=f.default(h.SelfDefendingTemplate(this.randomGenerator,this.escapeSequenceEncoder),{stringArrayCallsWrapperName:this.stringArrayCallsWrapperName,stringArrayName:this.stringArrayName})),this.options.stringArrayEncoding){case m.StringArrayEncoding.Rc4:r=f.default(I.StringArrayRc4DecodeNodeTemplate(this.randomGenerator),{atobPolyfill:t,rc4Polyfill:y.Rc4Template(),selfDefendingCode:n,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName});break;case m.StringArrayEncoding.Base64:r=f.default(b.StringArrayBase64DecodeNodeTemplate(this.randomGenerator),{atobPolyfill:t,selfDefendingCode:n,stringArrayCallsWrapperName:this.stringArrayCallsWrapperName})}return r}}]),t}(C.AbstractCustomNode);u.__decorate([g.initializable(),u.__metadata("design:type",String)],F.prototype,"stringArrayName",void 0),u.__decorate([g.initializable(),u.__metadata("design:type",String)],F.prototype,"stringArrayCallsWrapperName",void 0),F=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IEscapeSequenceEncoder)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object,Object])],F),t.StringArrayCallsWrapper=F},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelfDefendingTemplate=function(e){return"\n var {selfDefendingFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n var func1 = function(){return 'dev';},\n func2 = function () {\n return 'window';\n };\n \n var test1 = function () {\n var regExp = new RegExp('".concat(e.encode("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}",!0),"');\n \n return !regExp.test(func1.toString());\n };\n \n var test2 = function () {\n var regExp = new RegExp('").concat(e.encode("(\\\\[x|u](\\w){2,4})+",!0),"');\n \n return regExp.test(func2.toString());\n };\n \n var recursiveFunc1 = function (string) {\n var i = ~-1 >> 1 + 255 % 0;\n \n if (string.indexOf('i' === i)) {\n recursiveFunc2(string)\n }\n };\n \n var recursiveFunc2 = function (string) {\n var i = ~-4 >> 1 + 255 % 0;\n \n if (string.indexOf((true+\"\")[3]) !== i) {\n recursiveFunc1(string)\n }\n };\n \n if (!test1()) {\n if (!test2()) {\n recursiveFunc1('indеxOf');\n } else {\n recursiveFunc1('indexOf');\n }\n } else {\n recursiveFunc1('indеxOf');\n }\n })\n \n {selfDefendingFunctionName}();\n ")}},function(e,t,r){"use strict";var n=r(11),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=u.__importDefault(r(18)),p=r(10),m=r(39),g=r(158),_=r(13),N=r(32),v=r(8),y=function(e){function t(e,r,n,i){var c;return a(this,t),(c=s(this,(t.__proto__||o(t)).call(this,e,r,i))).escapeSequenceEncoder=n,c}return c(t,e),i(t,[{key:"initialize",value:function(e){this.callsControllerFunctionName=e}},{key:"getNodeStructure",value:function(){return v.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){return N.JavaScriptObfuscator.obfuscate(f.default(g.SelfDefendingTemplate(this.escapeSequenceEncoder),{selfDefendingFunctionName:this.identifierNamesGenerator.generate(),singleNodeCallControllerFunctionName:this.callsControllerFunctionName}),n({},m.NO_ADDITIONAL_NODES_PRESET,{identifierNamesGenerator:this.options.identifierNamesGenerator,seed:this.options.seed,unicodeEscapeSequence:!0})).getObfuscatedCode()}}]),t}(_.AbstractCustomNode);u.__decorate([p.initializable(),u.__metadata("design:type",String)],y.prototype,"callsControllerFunctionName",void 0),y=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IEscapeSequenceEncoder)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object,Object])],y),t.SelfDefendingUnicodeNode=y},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SingleNodeCallControllerTemplate=function(){return"\n var {singleNodeCallControllerFunctionName} = (function(){\n var firstCall = true;\n \n return function (context, fn){\n var rfn = firstCall ? function(){\n if(fn){\n var res = fn.apply(context, arguments);\n fn = null;\n return res;\n }\n } : function(){}\n \n firstCall = false;\n \n return rfn;\n }\n })();\n "}},function(e,t,r){"use strict";var n=r(11),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=u.__importDefault(r(18)),p=r(23),m=r(10),g=r(160),_=r(39),N=r(13),v=r(32),y=r(8),h=function(e){function t(e,r,n){return a(this,t),s(this,(t.__proto__||o(t)).call(this,e,r,n))}return c(t,e),i(t,[{key:"initialize",value:function(e,t){this.appendEvent=e,this.callsControllerFunctionName=t}},{key:"getNodeStructure",value:function(){return y.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){return this.appendEvent===p.ObfuscationEvent.AfterObfuscation?v.JavaScriptObfuscator.obfuscate(f.default(g.SingleNodeCallControllerTemplate(),{singleNodeCallControllerFunctionName:this.callsControllerFunctionName}),n({},_.NO_ADDITIONAL_NODES_PRESET,{identifierNamesGenerator:this.options.identifierNamesGenerator,seed:this.options.seed})).getObfuscatedCode():f.default(g.SingleNodeCallControllerTemplate(),{singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}}]),t}(N.AbstractCustomNode);u.__decorate([m.initializable(),u.__metadata("design:type",String)],h.prototype,"callsControllerFunctionName",void 0),u.__decorate([m.initializable(),u.__metadata("design:type",String)],h.prototype,"appendEvent",void 0),h=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object])],h),t.NodeCallsControllerFunctionNode=h},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=r(10),f=r(13),p=r(15),m=r(8),g=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e){this.operator=e}},{key:"getNodeStructure",value:function(){var e=p.Nodes.getExpressionStatementNode(p.Nodes.getFunctionExpressionNode([p.Nodes.getIdentifierNode("x"),p.Nodes.getIdentifierNode("y")],p.Nodes.getBlockStatementNode([p.Nodes.getReturnStatementNode(p.Nodes.getLogicalExpressionNode(this.operator,p.Nodes.getIdentifierNode("x"),p.Nodes.getIdentifierNode("y")))])));return m.NodeUtils.parentize(e),[e]}}]),t}(f.AbstractCustomNode);c.__decorate([l.initializable(),c.__metadata("design:type",String)],g.prototype,"operator",void 0),g=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],g),t.LogicalExpressionFunctionNode=g},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=r(10),f=r(13),p=r(15),m=r(8),g=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e,t,r,n){this.controlFlowStorageName=e,this.controlFlowStorageKey=t,this.leftValue=r,this.rightValue=n}},{key:"getNodeStructure",value:function(){var e=p.Nodes.getExpressionStatementNode(p.Nodes.getCallExpressionNode(p.Nodes.getMemberExpressionNode(p.Nodes.getIdentifierNode(this.controlFlowStorageName),p.Nodes.getIdentifierNode(this.controlFlowStorageKey)),[this.leftValue,this.rightValue]));return m.NodeUtils.parentize(e),[e]}}]),t}(f.AbstractCustomNode);c.__decorate([l.initializable(),c.__metadata("design:type",String)],g.prototype,"controlFlowStorageKey",void 0),c.__decorate([l.initializable(),c.__metadata("design:type",String)],g.prototype,"controlFlowStorageName",void 0),c.__decorate([l.initializable(),c.__metadata("design:type",Object)],g.prototype,"leftValue",void 0),c.__decorate([l.initializable(),c.__metadata("design:type",Object)],g.prototype,"rightValue",void 0),g=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],g),t.ExpressionWithOperatorControlFlowStorageCallNode=g},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DomainLockNodeTemplate=function(){return'\n var {domainLockFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n \n {globalVariableTemplate}\n \n var func = function () {\n return {\n key: \'item\',\n value: \'attribute\',\n getAttribute: function () {\n for (var i = 0; i < 1000; i--) {\n var isPositive = i > 0;\n \n switch (isPositive) {\n case true:\n return this.item + \'_\' + this.value + \'_\' + i;\n default:\n this.item + \'_\' + this.value;\n }\n }\n }()\n };\n };\n \n var regExp = new RegExp("[{diff}]", "g");\n var domains = "{domains}".replace(regExp, "").split(";");\n var document;\n var domain;\n \n for (var d in that) {\n if (d.length == 8 && d.charCodeAt(7) == 116 && d.charCodeAt(5) == 101 && d.charCodeAt(3) == 117 && d.charCodeAt(0) == 100) {\n document = d;\n \n break;\n }\n }\n\n for (var d1 in that[document]) {\n if (d1.length == 6 && d1.charCodeAt(5) == 110 && d1.charCodeAt(0) == 100) {\n domain = d1;\n \n break;\n }\n }\n \n if ((!document && !domain) || (!that[document] && !that[document][domain])) {\n return;\n }\n \n var currentDomain = that[document][domain];\n\n var ok = false;\n \n for (var i = 0; i < domains.length; i++) {\n var domain = domains[i];\n var position = currentDomain.length - domain.length;\n var lastIndex = currentDomain.indexOf(domain, position);\n var endsWith = lastIndex !== -1 && lastIndex === position;\n \n if (endsWith) {\n if (currentDomain.length == domain.length || domain.indexOf(".") === 0) {\n ok = true;\n }\n \n break;\n }\n }\n \n if (!ok) {\n data;\n } else {\n return;\n }\n \n func();\n });\n\n {domainLockFunctionName}();\n '}},function(e,t,r){"use strict";var n=r(29),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=u.__importDefault(r(18)),p=r(20),m=r(10),g=r(164),_=r(45),N=r(13),v=r(8),y=function(e){function t(e,r,n,i){var c;return a(this,t),(c=s(this,(t.__proto__||o(t)).call(this,e,r,i))).cryptUtils=n,c}return c(t,e),i(t,[{key:"initialize",value:function(e){this.callsControllerFunctionName=e}},{key:"getNodeStructure",value:function(){return v.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){var e=this.options.domainLock.join(";"),t=this.cryptUtils.hideString(e,3*e.length),r=n(t,2),o=r[0],a=r[1],i=this.options.target!==p.ObfuscationTarget.Extension?this.getGlobalVariableTemplate():_.GlobalVariableNoEvalTemplate();return f.default(g.DomainLockNodeTemplate(),{domainLockFunctionName:this.identifierNamesGenerator.generate(),diff:a,domains:o,globalVariableTemplate:i,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}}]),t}(N.AbstractCustomNode);u.__decorate([m.initializable(),u.__metadata("design:type",String)],y.prototype,"callsControllerFunctionName",void 0),y=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.ICryptUtils)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object,Object])],y),t.DomainLockNode=y},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionTemplate=function(){return"\n function {debugProtectionFunctionName} (ret) {\n function debuggerProtection (counter) {\n \n {debuggerTemplate}\n \n debuggerProtection(++counter);\n }\n \n try {\n if (ret) {\n return debuggerProtection;\n } else {\n debuggerProtection(0);\n }\n } catch (y) {}\n }\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerTemplateNoEval=function(){return"\n if (typeof counter === 'string') {\n var func = function () {\n while (true) {}\n };\n \n return func();\n } else {\n if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) {\n debugger;\n } else {\n debugger;\n }\n \n }\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggerTemplate=function(){return"\n if (typeof counter === 'string') {\n return (function (arg) {}.constructor('while (true) {}').apply('counter'));\n } else {\n if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) {\n (function () {return true;}.constructor('debu' + 'gger').call('action'));\n } else {\n (function () {return false;}.constructor('debu' + 'gger').apply('stateObject'));\n }\n \n }\n "}},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=c.__importDefault(r(18)),f=r(20),p=r(10),m=r(168),g=r(167),_=r(166),N=r(13),v=r(8),y=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e){this.debugProtectionFunctionName=e}},{key:"getNodeStructure",value:function(){return v.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){var e=this.options.target!==f.ObfuscationTarget.Extension?m.DebuggerTemplate():g.DebuggerTemplateNoEval();return l.default(_.DebugProtectionFunctionTemplate(),{debuggerTemplate:e,debugProtectionFunctionName:this.debugProtectionFunctionName})}}]),t}(N.AbstractCustomNode);c.__decorate([p.initializable(),c.__metadata("design:type",String)],y.prototype,"debugProtectionFunctionName",void 0),y=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],y),t.DebugProtectionFunctionNode=y},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionIntervalTemplate=function(){return"\n setInterval(function () {\n {debugProtectionFunctionName}();\n }, 4000);\n "}},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=c.__importDefault(r(18)),f=r(10),p=r(170),m=r(13),g=r(8),_=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e){this.debugProtectionFunctionName=e}},{key:"getNodeStructure",value:function(){return g.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){return l.default(p.DebugProtectionFunctionIntervalTemplate(),{debugProtectionFunctionName:this.debugProtectionFunctionName})}}]),t}(m.AbstractCustomNode);c.__decorate([f.initializable(),c.__metadata("design:type",String)],_.prototype,"debugProtectionFunctionName",void 0),_=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],_),t.DebugProtectionFunctionIntervalNode=_},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProtectionFunctionCallTemplate=function(){return"\n (function () {\n {singleNodeCallControllerFunctionName}(this, function () {\n var regExp1 = new RegExp('function *\\\\( *\\\\)');\n var regExp2 = new RegExp('\\\\+\\\\+ *\\(?:_0x(?:[a-f0-9]){4,6}|(?:\\\\b|\\\\d)[a-z0-9]{1,4}(?:\\\\b|\\\\d)\\)', 'i');\n \n var result = {debugProtectionFunctionName}('init');\n \n if (!regExp1.test(result + 'chain') || !regExp2.test(result + 'input')) {\n result('0');\n } else {\n {debugProtectionFunctionName}();\n }\n })();\n })();\n "}},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=c.__importDefault(r(18)),f=r(10),p=r(172),m=r(13),g=r(8),_=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e,t){this.debugProtectionFunctionName=e,this.callsControllerFunctionName=t}},{key:"getNodeStructure",value:function(){return g.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){return l.default(p.DebugProtectionFunctionCallTemplate(),{debugProtectionFunctionName:this.debugProtectionFunctionName,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}}]),t}(m.AbstractCustomNode);c.__decorate([f.initializable(),c.__metadata("design:type",String)],_.prototype,"callsControllerFunctionName",void 0),c.__decorate([f.initializable(),c.__metadata("design:type",String)],_.prototype,"debugProtectionFunctionName",void 0),_=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],_),t.DebugProtectionFunctionCallNode=_},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConsoleOutputDisableExpressionTemplate=function(){return"\n var {consoleLogDisableFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n var func = function () {};\n \n {globalVariableTemplate}\n \n if (!that.console) {\n that.console = (function (func){\n var c = {};\n \n c.log = func;\n c.warn = func;\n c.debug = func;\n c.info = func;\n c.error = func;\n c.exception = func;\n c.trace = func;\n \n return c;\n })(func);\n } else {\n that.console.log = func;\n that.console.warn = func;\n that.console.debug = func;\n that.console.info = func;\n that.console.error = func;\n that.console.exception = func;\n that.console.trace = func;\n }\n });\n \n {consoleLogDisableFunctionName}();\n "}},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=c.__importDefault(r(18)),f=r(20),p=r(174),m=r(45),g=r(10),_=r(13),N=r(8),v=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e){this.callsControllerFunctionName=e}},{key:"getNodeStructure",value:function(){return N.NodeUtils.convertCodeToStructure(this.getTemplate())}},{key:"getTemplate",value:function(){var e=this.options.target!==f.ObfuscationTarget.Extension?this.getGlobalVariableTemplate():m.GlobalVariableNoEvalTemplate();return l.default(p.ConsoleOutputDisableExpressionTemplate(),{consoleLogDisableFunctionName:this.identifierNamesGenerator.generate(),globalVariableTemplate:e,singleNodeCallControllerFunctionName:this.callsControllerFunctionName})}}]),t}(_.AbstractCustomNode);c.__decorate([g.initializable(),c.__metadata("design:type",String)],v.prototype,"callsControllerFunctionName",void 0),v=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],v),t.ConsoleOutputDisableExpressionNode=v},function(e,t,r){"use strict";var n=r(29),o=r(60),a=r(7),i=r(1),s=r(2),c=r(6),u=r(5);Object.defineProperty(t,"__esModule",{value:!0});var d=r(4),l=r(0),f=r(3),p=r(10),m=r(13),g=r(9),_=r(15),N=r(8),v=function(e){function t(e,r,n){return i(this,t),c(this,(t.__proto__||a(t)).call(this,e,r,n))}return u(t,e),s(t,[{key:"initialize",value:function(e){this.controlFlowStorage=e}},{key:"getNodeStructure",value:function(){var e=o(this.controlFlowStorage.getStorage()).map(function(e){var t=n(e,2),r=t[0],o=t[1].getNode()[0];if(!g.NodeGuards.isExpressionStatementNode(o))throw new Error("Function node for control flow storage object should be passed inside the `ExpressionStatement` node!");return _.Nodes.getPropertyNode(_.Nodes.getIdentifierNode(r),o.expression)}),t=_.Nodes.getVariableDeclarationNode([_.Nodes.getVariableDeclaratorNode(_.Nodes.getIdentifierNode(this.controlFlowStorage.getStorageId()),_.Nodes.getObjectExpressionNode(e))]);return[t=N.NodeUtils.parentize(t)]}}]),t}(m.AbstractCustomNode);d.__decorate([p.initializable(),d.__metadata("design:type",Object)],v.prototype,"controlFlowStorage",void 0),v=d.__decorate([l.injectable(),d.__param(0,l.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d.__param(1,l.inject(f.ServiceIdentifiers.IRandomGenerator)),d.__param(2,l.inject(f.ServiceIdentifiers.IOptions)),d.__metadata("design:paramtypes",[Function,Object,Object])],v),t.ControlFlowStorageNode=v},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=r(10),f=r(13),p=r(15),m=r(8),g=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e){this.expressionArguments=e}},{key:"getNodeStructure",value:function(){for(var e=p.Nodes.getIdentifierNode("callee"),t=[],r=this.expressionArguments.length,n=0;n.5,t=this.randomGenerator.getMathRandom()>.5,r=e?"===":"!==",o=this.randomGenerator.getRandomString(5),a=t?o:this.randomGenerator.getRandomString(5),i=e===t?[this.blockStatementNode,this.deadCodeInjectionRootAstHostNode]:[this.deadCodeInjectionRootAstHostNode,this.blockStatementNode],s=n(i,2),c=s[0],u=s[1],d=m.Nodes.getBlockStatementNode([m.Nodes.getIfStatementNode(m.Nodes.getBinaryExpressionNode(r,m.Nodes.getLiteralNode(o),m.Nodes.getLiteralNode(a)),c,u)]);return g.NodeUtils.parentize(d),[d]}}]),t}(p.AbstractCustomNode);u.__decorate([f.initializable(),u.__metadata("design:type",Object)],_.prototype,"blockStatementNode",void 0),u.__decorate([f.initializable(),u.__metadata("design:type",Object)],_.prototype,"deadCodeInjectionRootAstHostNode",void 0),_=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object])],_),t.BlockStatementDeadCodeInjectionNode=_},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=r(10),f=r(13),p=r(9),m=r(15),g=r(8),_=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e,t,r){this.blockStatementBody=e,this.shuffledKeys=t,this.originalKeysIndexesInShuffledArray=r}},{key:"getNodeStructure",value:function(){var e=this,t=this.randomGenerator.getRandomString(6),r=this.randomGenerator.getRandomString(6),n=m.Nodes.getBlockStatementNode([m.Nodes.getVariableDeclarationNode([m.Nodes.getVariableDeclaratorNode(m.Nodes.getIdentifierNode(t),m.Nodes.getCallExpressionNode(m.Nodes.getMemberExpressionNode(m.Nodes.getLiteralNode(this.originalKeysIndexesInShuffledArray.join("|")),m.Nodes.getIdentifierNode("split")),[m.Nodes.getLiteralNode("|")])),m.Nodes.getVariableDeclaratorNode(m.Nodes.getIdentifierNode(r),m.Nodes.getLiteralNode(0))]),m.Nodes.getWhileStatementNode(m.Nodes.getLiteralNode(!0),m.Nodes.getBlockStatementNode([m.Nodes.getSwitchStatementNode(m.Nodes.getMemberExpressionNode(m.Nodes.getIdentifierNode(t),m.Nodes.getUpdateExpressionNode("++",m.Nodes.getIdentifierNode(r)),!0),this.shuffledKeys.map(function(t,r){var n=e.blockStatementBody[t],o=[n];return p.NodeGuards.isReturnStatementNode(n)||o.push(m.Nodes.getContinueStatement()),m.Nodes.getSwitchCaseNode(m.Nodes.getLiteralNode(String(r)),o)})),m.Nodes.getBreakStatement()]))]);return g.NodeUtils.parentize(n),[n]}}]),t}(f.AbstractCustomNode);c.__decorate([l.initializable(),c.__metadata("design:type",Array)],_.prototype,"blockStatementBody",void 0),c.__decorate([l.initializable(),c.__metadata("design:type",Array)],_.prototype,"originalKeysIndexesInShuffledArray",void 0),c.__decorate([l.initializable(),c.__metadata("design:type",Array)],_.prototype,"shuffledKeys",void 0),_=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],_),t.BlockStatementControlFlowFlatteningNode=_},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableTemplate2=function(){return"\n var getGlobal = function () {\n var globalObject;\n \n try {\n globalObject = Function('return (function() ' + '{}.constructor(\"return this\")( )' + ');')();\n } catch (e) {\n globalObject = window;\n }\n \n return globalObject;\n };\n var that = getGlobal();\n "}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalVariableTemplate1=function(){return"\n var that;\n \n try {\n var getGlobal = Function('return (function() ' + '{}.constructor(\"return this\")( )' + ');');\n \n that = getGlobal();\n } catch (e) {\n that = window;\n }\n "}},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=r(3),l=r(10),f=r(13),p=r(15),m=r(8),g=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"initialize",value:function(e){this.operator=e}},{key:"getNodeStructure",value:function(){var e=p.Nodes.getExpressionStatementNode(p.Nodes.getFunctionExpressionNode([p.Nodes.getIdentifierNode("x"),p.Nodes.getIdentifierNode("y")],p.Nodes.getBlockStatementNode([p.Nodes.getReturnStatementNode(p.Nodes.getBinaryExpressionNode(this.operator,p.Nodes.getIdentifierNode("x"),p.Nodes.getIdentifierNode("y")))])));return m.NodeUtils.parentize(e),[e]}}]),t}(f.AbstractCustomNode);c.__decorate([l.initializable(),c.__metadata("design:type",String)],g.prototype,"operator",void 0),g=c.__decorate([u.injectable(),c.__param(0,u.inject(d.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),c.__param(1,u.inject(d.ServiceIdentifiers.IRandomGenerator)),c.__param(2,u.inject(d.ServiceIdentifiers.IOptions)),c.__metadata("design:paramtypes",[Function,Object,Object])],g),t.BinaryExpressionFunctionNode=g},function(e,t,r){"use strict";var n=r(29),o=r(16),a=r(7),i=r(1),s=r(2),c=r(6),u=r(5);Object.defineProperty(t,"__esModule",{value:!0});var d=r(4),l=r(0),f=r(3),p=r(10),m=r(28),g=r(23),_=r(36),N=r(25),v=function(e){function t(e,r,n,o,s){var u;return i(this,t),(u=c(this,(t.__proto__||a(t)).call(this,n,o,s))).appendEvent=g.ObfuscationEvent.AfterObfuscation,u.customNodeFactory=e,u.stringArrayStorage=r,u}return u(t,e),s(t,[{key:"appendCustomNodes",value:function(e,t){this.stringArrayStorage.getLength()&&(this.appendCustomNodeIfExist(m.CustomNode.StringArrayNode,function(t){N.NodeAppender.prependNode(e,t.getNode())}),this.appendCustomNodeIfExist(m.CustomNode.StringArrayCallsWrapper,function(t){N.NodeAppender.insertNodeAtIndex(e,t.getNode(),1)}),this.appendCustomNodeIfExist(m.CustomNode.StringArrayRotateFunctionNode,function(t){N.NodeAppender.insertNodeAtIndex(e,t.getNode(),1)}))}},{key:"initialize",value:function(){if(this.customNodes=new o,this.options.stringArray){var e,t=this.customNodeFactory(m.CustomNode.StringArrayNode),r=this.customNodeFactory(m.CustomNode.StringArrayCallsWrapper),a=this.customNodeFactory(m.CustomNode.StringArrayRotateFunctionNode),i=this.stringArrayStorage.getStorageId().split("|"),s=n(i,2),c=s[0],u=s[1];e=this.options.rotateStringArray?this.randomGenerator.getRandomInteger(100,500):0,t.initialize(this.stringArrayStorage,c,e),r.initialize(c,u),a.initialize(c,e),this.customNodes.set(m.CustomNode.StringArrayNode,t),this.customNodes.set(m.CustomNode.StringArrayCallsWrapper,r),this.options.rotateStringArray&&this.customNodes.set(m.CustomNode.StringArrayRotateFunctionNode,a)}}}]),t}(_.AbstractCustomNodeGroup);d.__decorate([p.initializable(),d.__metadata("design:type",o)],v.prototype,"customNodes",void 0),v=d.__decorate([l.injectable(),d.__param(0,l.inject(f.ServiceIdentifiers.Factory__ICustomNode)),d.__param(1,l.inject(f.ServiceIdentifiers.TStringArrayStorage)),d.__param(2,l.inject(f.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),d.__param(3,l.inject(f.ServiceIdentifiers.IRandomGenerator)),d.__param(4,l.inject(f.ServiceIdentifiers.IOptions)),d.__metadata("design:paramtypes",[Function,Object,Function,Object,Object])],v),t.StringArrayCustomNodeGroup=v},function(e,t,r){"use strict";var n=r(16),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=r(10),p=r(28),m=r(23),g=r(36),_=r(25),N=function(e){function t(e,r,n,i){var c;return a(this,t),(c=s(this,(t.__proto__||o(t)).call(this,r,n,i))).appendEvent=m.ObfuscationEvent.AfterObfuscation,c.customNodeFactory=e,c}return c(t,e),i(t,[{key:"appendCustomNodes",value:function(e,t){var r=this.getRandomStackTraceIndex(t.length);this.appendCustomNodeIfExist(p.CustomNode.SelfDefendingUnicodeNode,function(n){_.NodeAppender.appendNodeToOptimalBlockScope(t,e,n.getNode(),r)}),this.appendCustomNodeIfExist(p.CustomNode.NodeCallsControllerFunctionNode,function(n){var o;o=t.length?_.NodeAppender.getOptimalBlockScope(t,r,1):e,_.NodeAppender.prependNode(o,n.getNode())})}},{key:"initialize",value:function(){if(this.customNodes=new n,this.options.selfDefending){var e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(p.CustomNode.SelfDefendingUnicodeNode),r=this.customNodeFactory(p.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),r.initialize(this.appendEvent,e),this.customNodes.set(p.CustomNode.SelfDefendingUnicodeNode,t),this.customNodes.set(p.CustomNode.NodeCallsControllerFunctionNode,r)}}}]),t}(g.AbstractCustomNodeGroup);u.__decorate([f.initializable(),u.__metadata("design:type",n)],N.prototype,"customNodes",void 0),N=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__ICustomNode)),u.__param(1,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Function,Object,Object])],N),t.SelfDefendingCustomNodeGroup=N},function(e,t,r){"use strict";var n=r(16),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=r(10),p=r(28),m=r(23),g=r(36),_=r(25),N=function(e){function t(e,r,n,i){var c;return a(this,t),(c=s(this,(t.__proto__||o(t)).call(this,r,n,i))).appendEvent=m.ObfuscationEvent.BeforeObfuscation,c.customNodeFactory=e,c}return c(t,e),i(t,[{key:"appendCustomNodes",value:function(e,t){var r=this.getRandomStackTraceIndex(t.length);this.appendCustomNodeIfExist(p.CustomNode.DomainLockNode,function(n){_.NodeAppender.appendNodeToOptimalBlockScope(t,e,n.getNode(),r)}),this.appendCustomNodeIfExist(p.CustomNode.NodeCallsControllerFunctionNode,function(n){var o;o=t.length?_.NodeAppender.getOptimalBlockScope(t,r,1):e,_.NodeAppender.prependNode(o,n.getNode())})}},{key:"initialize",value:function(){if(this.customNodes=new n,this.options.domainLock.length){var e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(p.CustomNode.DomainLockNode),r=this.customNodeFactory(p.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),r.initialize(this.appendEvent,e),this.customNodes.set(p.CustomNode.DomainLockNode,t),this.customNodes.set(p.CustomNode.NodeCallsControllerFunctionNode,r)}}}]),t}(g.AbstractCustomNodeGroup);u.__decorate([f.initializable(),u.__metadata("design:type",n)],N.prototype,"customNodes",void 0),N=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__ICustomNode)),u.__param(1,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Function,Object,Object])],N),t.DomainLockCustomNodeGroup=N},function(e,t,r){"use strict";var n=r(16),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=r(10),p=r(28),m=r(23),g=r(36),_=r(25),N=function(e){function t(e,r,n,i){var c;return a(this,t),(c=s(this,(t.__proto__||o(t)).call(this,r,n,i))).appendEvent=m.ObfuscationEvent.BeforeObfuscation,c.customNodeFactory=e,c}return c(t,e),i(t,[{key:"appendCustomNodes",value:function(e,t){var r=this,n=this.getRandomStackTraceIndex(t.length);this.appendCustomNodeIfExist(p.CustomNode.DebugProtectionFunctionCallNode,function(r){_.NodeAppender.appendNodeToOptimalBlockScope(t,e,r.getNode(),n)}),this.appendCustomNodeIfExist(p.CustomNode.DebugProtectionFunctionNode,function(t){_.NodeAppender.appendNode(e,t.getNode())}),this.appendCustomNodeIfExist(p.CustomNode.DebugProtectionFunctionIntervalNode,function(t){var n=e.body.length,o=r.randomGenerator.getRandomInteger(0,n);_.NodeAppender.insertNodeAtIndex(e,t.getNode(),o)}),this.appendCustomNodeIfExist(p.CustomNode.NodeCallsControllerFunctionNode,function(r){var o;o=t.length?_.NodeAppender.getOptimalBlockScope(t,n,1):e,_.NodeAppender.prependNode(o,r.getNode())})}},{key:"initialize",value:function(){if(this.customNodes=new n,this.options.debugProtection){var e=this.identifierNamesGenerator.generate(),t=this.identifierNamesGenerator.generate(),r=this.customNodeFactory(p.CustomNode.DebugProtectionFunctionNode),o=this.customNodeFactory(p.CustomNode.DebugProtectionFunctionCallNode),a=this.customNodeFactory(p.CustomNode.DebugProtectionFunctionIntervalNode),i=this.customNodeFactory(p.CustomNode.NodeCallsControllerFunctionNode);r.initialize(e),o.initialize(e,t),a.initialize(e),i.initialize(this.appendEvent,t),this.customNodes.set(p.CustomNode.DebugProtectionFunctionNode,r),this.customNodes.set(p.CustomNode.DebugProtectionFunctionCallNode,o),this.options.debugProtectionInterval&&this.customNodes.set(p.CustomNode.DebugProtectionFunctionIntervalNode,a),this.customNodes.set(p.CustomNode.NodeCallsControllerFunctionNode,i)}}}]),t}(g.AbstractCustomNodeGroup);u.__decorate([f.initializable(),u.__metadata("design:type",n)],N.prototype,"customNodes",void 0),N=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__ICustomNode)),u.__param(1,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Function,Object,Object])],N),t.DebugProtectionCustomNodeGroup=N},function(e,t,r){"use strict";var n=r(16),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=r(3),f=r(10),p=r(28),m=r(23),g=r(36),_=r(25),N=function(e){function t(e,r,n,i){var c;return a(this,t),(c=s(this,(t.__proto__||o(t)).call(this,r,n,i))).appendEvent=m.ObfuscationEvent.BeforeObfuscation,c.customNodeFactory=e,c}return c(t,e),i(t,[{key:"appendCustomNodes",value:function(e,t){var r=this.getRandomStackTraceIndex(t.length);this.appendCustomNodeIfExist(p.CustomNode.ConsoleOutputDisableExpressionNode,function(n){_.NodeAppender.appendNodeToOptimalBlockScope(t,e,n.getNode(),r)}),this.appendCustomNodeIfExist(p.CustomNode.NodeCallsControllerFunctionNode,function(n){var o;o=t.length?_.NodeAppender.getOptimalBlockScope(t,r,1):e,_.NodeAppender.prependNode(o,n.getNode())})}},{key:"initialize",value:function(){if(this.customNodes=new n,this.options.disableConsoleOutput){var e=this.identifierNamesGenerator.generate(),t=this.customNodeFactory(p.CustomNode.ConsoleOutputDisableExpressionNode),r=this.customNodeFactory(p.CustomNode.NodeCallsControllerFunctionNode);t.initialize(e),r.initialize(this.appendEvent,e),this.customNodes.set(p.CustomNode.ConsoleOutputDisableExpressionNode,t),this.customNodes.set(p.CustomNode.NodeCallsControllerFunctionNode,r)}}}]),t}(g.AbstractCustomNodeGroup);u.__decorate([f.initializable(),u.__metadata("design:type",n)],N.prototype,"customNodes",void 0),N=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__ICustomNode)),u.__param(1,d.inject(l.ServiceIdentifiers.Factory__IIdentifierNamesGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Function,Object,Object])],N),t.ConsoleOutputCustomNodeGroup=N},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(26),o=r(0),a=r(3),i=r(21),s=r(28),c=r(61),u=r(62),d=r(188),l=r(187),f=r(186),p=r(185),m=r(184),g=r(183),_=r(180),N=r(179),v=r(178),y=r(177),h=r(176),b=r(175),S=r(173),I=r(171),C=r(169),O=r(165),j=r(163),F=r(162),k=r(161),T=r(159),x=r(157),w=r(150),E=r(148),G=r(144),R=r(143);t.customNodesModule=new o.ContainerModule(function(e){e(a.ServiceIdentifiers.ICustomNode).to(b.ConsoleOutputDisableExpressionNode).whenTargetNamed(s.CustomNode.ConsoleOutputDisableExpressionNode),e(a.ServiceIdentifiers.ICustomNode).to(S.DebugProtectionFunctionCallNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionCallNode),e(a.ServiceIdentifiers.ICustomNode).to(I.DebugProtectionFunctionIntervalNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionIntervalNode),e(a.ServiceIdentifiers.ICustomNode).to(C.DebugProtectionFunctionNode).whenTargetNamed(s.CustomNode.DebugProtectionFunctionNode),e(a.ServiceIdentifiers.ICustomNode).to(O.DomainLockNode).whenTargetNamed(s.CustomNode.DomainLockNode),e(a.ServiceIdentifiers.ICustomNode).to(k.NodeCallsControllerFunctionNode).whenTargetNamed(s.CustomNode.NodeCallsControllerFunctionNode),e(a.ServiceIdentifiers.ICustomNode).to(T.SelfDefendingUnicodeNode).whenTargetNamed(s.CustomNode.SelfDefendingUnicodeNode),e(a.ServiceIdentifiers.ICustomNode).to(x.StringArrayCallsWrapper).whenTargetNamed(s.CustomNode.StringArrayCallsWrapper),e(a.ServiceIdentifiers.ICustomNode).to(w.StringArrayNode).whenTargetNamed(s.CustomNode.StringArrayNode),e(a.ServiceIdentifiers.ICustomNode).to(E.StringArrayRotateFunctionNode).whenTargetNamed(s.CustomNode.StringArrayRotateFunctionNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(g.BinaryExpressionFunctionNode).whenTargetNamed(i.ControlFlowCustomNode.BinaryExpressionFunctionNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(_.BlockStatementControlFlowFlatteningNode).whenTargetNamed(i.ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(v.CallExpressionControlFlowStorageCallNode).whenTargetNamed(i.ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(y.CallExpressionFunctionNode).whenTargetNamed(i.ControlFlowCustomNode.CallExpressionFunctionNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(h.ControlFlowStorageNode).whenTargetNamed(i.ControlFlowCustomNode.ControlFlowStorageNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(j.ExpressionWithOperatorControlFlowStorageCallNode).whenTargetNamed(i.ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(F.LogicalExpressionFunctionNode).whenTargetNamed(i.ControlFlowCustomNode.LogicalExpressionFunctionNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(R.StringLiteralNode).whenTargetNamed(i.ControlFlowCustomNode.StringLiteralNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(G.StringLiteralControlFlowStorageCallNode).whenTargetNamed(i.ControlFlowCustomNode.StringLiteralControlFlowStorageCallNode),e(a.ServiceIdentifiers.Newable__ICustomNode).toConstructor(N.BlockStatementDeadCodeInjectionNode).whenTargetNamed(u.DeadCodeInjectionCustomNode.BlockStatementDeadCodeInjectionNode),e(a.ServiceIdentifiers.ICustomNodeGroup).to(d.ConsoleOutputCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.ConsoleOutputCustomNodeGroup),e(a.ServiceIdentifiers.ICustomNodeGroup).to(l.DebugProtectionCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.DebugProtectionCustomNodeGroup),e(a.ServiceIdentifiers.ICustomNodeGroup).to(f.DomainLockCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.DomainLockCustomNodeGroup),e(a.ServiceIdentifiers.ICustomNodeGroup).to(p.SelfDefendingCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.SelfDefendingCustomNodeGroup),e(a.ServiceIdentifiers.ICustomNodeGroup).to(m.StringArrayCustomNodeGroup).whenTargetNamed(c.CustomNodeGroup.StringArrayCustomNodeGroup),e(a.ServiceIdentifiers.Factory__ICustomNode).toFactory(n.InversifyContainerFacade.getFactory(a.ServiceIdentifiers.ICustomNode)),e(a.ServiceIdentifiers.Factory__IControlFlowCustomNode).toFactory(n.InversifyContainerFacade.getConstructorFactory(a.ServiceIdentifiers.Newable__ICustomNode,a.ServiceIdentifiers.Factory__IIdentifierNamesGenerator,a.ServiceIdentifiers.IRandomGenerator,a.ServiceIdentifiers.IOptions)),e(a.ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode).toFactory(n.InversifyContainerFacade.getConstructorFactory(a.ServiceIdentifiers.Newable__ICustomNode,a.ServiceIdentifiers.Factory__IIdentifierNamesGenerator,a.ServiceIdentifiers.IRandomGenerator,a.ServiceIdentifiers.IOptions)),e(a.ServiceIdentifiers.Factory__ICustomNodeGroup).toFactory(n.InversifyContainerFacade.getFactory(a.ServiceIdentifiers.ICustomNodeGroup))})},function(e,t,r){"use strict";var n=r(24),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u,d=r(4),l=r(0),f=r(3),p=d.__importStar(r(17)),m=r(12),g=r(14),_=r(9),N=r(15),v=r(8),y=u=function(e){function t(e,r){return a(this,t),s(this,(t.__proto__||o(t)).call(this,e,r))}return c(t,e),i(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case m.TransformationStage.Converting:return{enter:function(e,r){if(r&&_.NodeGuards.isReturnStatementNode(e)&&null===e.argument)return t.fixEsprimaReturnStatementTemplateLiteralNode(e)},leave:function(e,r){if(r&&_.NodeGuards.isTemplateLiteralNode(e))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){var r=e.expressions,n=[];if(e.quasis.forEach(function(e){n.push(N.Nodes.getLiteralNode(e.value.cooked));var t=r.shift();t&&n.push(t)}),n=n.filter(function(e){return!(_.NodeGuards.isLiteralNode(e)&&""===e.value)}),u.isLiteralNodeWithStringValue(n[0])||u.isLiteralNodeWithStringValue(n[1])||n.unshift(N.Nodes.getLiteralNode("")),n.length>1){var o=N.Nodes.getBinaryExpressionNode("+",n.shift(),n.shift());return n.forEach(function(e){o=N.Nodes.getBinaryExpressionNode("+",o,e)}),o}return n[0]}},{key:"fixEsprimaReturnStatementTemplateLiteralNode",value:function(e){var t=v.NodeUtils.getScopeOfNode(e),r=_.NodeGuards.isSwitchCaseNode(t)?t.consequent:t.body,o=r.indexOf(e);if(o===r.length-2){var a=r[o+1];if(a&&_.NodeGuards.isExpressionStatementNode(a)){var i=!1;if(p.traverse(a,{enter:function(e,t){if(_.NodeGuards.isTemplateLiteralNode(e))return i=!0,p.VisitorOption.Break}}),i)return e.argument=a.expression,r.pop(),_.NodeGuards.isSwitchCaseNode(t)?t.consequent=n(r):t.body=n(r),e}}}}],[{key:"isLiteralNodeWithStringValue",value:function(e){return e&&_.NodeGuards.isLiteralNode(e)&&"string"==typeof e.value}}]),t}(g.AbstractNodeTransformer);y=u=d.__decorate([l.injectable(),d.__param(0,l.inject(f.ServiceIdentifiers.IRandomGenerator)),d.__param(1,l.inject(f.ServiceIdentifiers.IOptions)),d.__metadata("design:paramtypes",[Object,Object])],y),t.TemplateLiteralTransformer=y},function(e,t,r){"use strict";var n=r(29),o=r(16),a=r(7),i=r(1),s=r(2),c=r(6),u=r(5);Object.defineProperty(t,"__esModule",{value:!0});var d,l=r(4),f=r(0),p=r(3),m=r(12),g=r(14),_=r(25),N=r(9),v=r(15),y=r(8),h=d=function(e){function t(e,r){var n;return i(this,t),(n=c(this,(t.__proto__||a(t)).call(this,e,r))).cachedScopeNodesMap=new o,n}return u(t,e),s(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case m.TransformationStage.Converting:return{enter:function(e,r){if(t.options.transformObjectKeys&&r&&N.NodeGuards.isObjectExpressionNode(e)&&N.NodeGuards.isVariableDeclaratorNode(r))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){if(!N.NodeGuards.isIdentifierNode(t.id))return e;var r=y.NodeUtils.getScopeOfNode(t);return r&&N.NodeGuards.isNodeHasScope(r)?(this.cachedScopeNodesMap.set(t,r),this.transformObjectExpressionNode(e,t.id,t)):e}},{key:"extractPropertiesToExpressionStatements",value:function(e,t,r){for(var n=e.length,o=[],a=[],i=0;il.hostNodeSearchMinDepth&&t.splice(0,l.hostNodeSearchMinDepth),t.length>l.hostNodeSearchMaxDepth&&(t.length=l.hostNodeSearchMaxDepth),this.randomGenerator.getRandomGenerator().pickone(t))}},{key:"isVisitedFunctionNode",value:function(e){return(b.NodeGuards.isFunctionDeclarationNode(e)||b.NodeGuards.isFunctionExpressionNode(e)||b.NodeGuards.isArrowFunctionExpressionNode(e))&&this.visitedFunctionNodes.has(e)}},{key:"transformFunctionBody",value:function(e,t){var r=this;g.replace(e,{enter:function(e,o){if(e.ignoredNode)return g.VisitorOption.Skip;if(r.isVisitedFunctionNode(e)||!o)return g.VisitorOption.Skip;if(!l.controlFlowReplacersMap.has(e.type))return e;if(r.randomGenerator.getMathRandom()>r.options.controlFlowFlatteningThreshold)return e;var a=l.controlFlowReplacersMap.get(e.type);return void 0===a?e:n({},r.controlFlowReplacerFactory(a).replace(e,o,t),{parentNode:o})}})}}]),t}(h.AbstractNodeTransformer);C.controlFlowReplacersMap=new a([[v.NodeType.BinaryExpression,N.ControlFlowReplacer.BinaryExpressionControlFlowReplacer],[v.NodeType.CallExpression,N.ControlFlowReplacer.CallExpressionControlFlowReplacer],[v.NodeType.LogicalExpression,N.ControlFlowReplacer.LogicalExpressionControlFlowReplacer],[v.NodeType.Literal,N.ControlFlowReplacer.StringLiteralControlFlowReplacer]]),C.hostNodeSearchMinDepth=0,C.hostNodeSearchMaxDepth=2,C=l=f.__decorate([p.injectable(),f.__param(0,p.inject(m.ServiceIdentifiers.Factory__TControlFlowStorage)),f.__param(1,p.inject(m.ServiceIdentifiers.Factory__IControlFlowReplacer)),f.__param(2,p.inject(m.ServiceIdentifiers.Factory__IControlFlowCustomNode)),f.__param(3,p.inject(m.ServiceIdentifiers.IRandomGenerator)),f.__param(4,p.inject(m.ServiceIdentifiers.IOptions)),f.__metadata("design:paramtypes",[Function,Function,Function,Object,Object])],C),t.FunctionControlFlowTransformer=C},function(e,t,r){"use strict";var n=r(30),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u,d=r(4),l=r(0),f=r(3),p=d.__importStar(r(17)),m=r(62),g=r(31),_=r(19),N=r(12),v=r(14),y=r(9),h=r(15),b=r(8),S=u=function(e){function t(e,r,i,c){var u;return a(this,t),(u=s(this,(t.__proto__||o(t)).call(this,i,c))).deadCodeInjectionRootAstHostNodeSet=new n,u.collectedBlockStatements=[],u.collectedBlockStatementsTotalLength=0,u.deadCodeInjectionCustomNodeFactory=e,u.transformersRunner=r,u}return c(t,e),i(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case N.TransformationStage.DeadCodeInjection:return{enter:function(e,r){if(r&&y.NodeGuards.isProgramNode(e))return t.analyzeNode(e,r),e},leave:function(e,r){if(r&&y.NodeGuards.isBlockStatementNode(e))return t.transformNode(e,r)}};case N.TransformationStage.Finalizing:return this.deadCodeInjectionRootAstHostNodeSet.size?{enter:function(e,r){if(r&&t.isDeadCodeInjectionRootAstHostNode(e))return t.restoreNode(e,r)}}:null;default:return null}}},{key:"analyzeNode",value:function(e,t){var r=this;p.traverse(e,{enter:function(e){if(y.NodeGuards.isBlockStatementNode(e)){var t=b.NodeUtils.clone(e);u.isValidCollectedBlockStatementNode(t)&&(b.NodeUtils.parentizeNode(t,t),t=r.transformersRunner.transform(t,u.transformersToRenameBlockScopeIdentifiers,N.TransformationStage.Obfuscating),r.collectedBlockStatements.push(t))}}}),this.collectedBlockStatementsTotalLength=this.collectedBlockStatements.length}},{key:"transformNode",value:function(e,t){if(!this.collectedBlockStatements.length||this.collectedBlockStatementsTotalLengththis.options.deadCodeInjectionThreshold||!u.isValidWrappedBlockStatementNode(e))return e;var r=this.collectedBlockStatements.length-1,n=this.randomGenerator.getRandomInteger(0,r),o=this.collectedBlockStatements.splice(n,1)[0];return o===e?e:this.replaceBlockStatementNode(e,o,t)}},{key:"restoreNode",value:function(e,t){var r=e.body[0];if(!y.NodeGuards.isFunctionDeclarationNode(r))throw new Error("Wrong dead code injection root AST host node. Host node should contain `FunctionDeclaration` node");return r.body}},{key:"isDeadCodeInjectionRootAstHostNode",value:function(e){return y.NodeGuards.isBlockStatementNode(e)&&this.deadCodeInjectionRootAstHostNodeSet.has(e)}},{key:"replaceBlockStatementNode",value:function(e,t,r){var n=h.Nodes.getBlockStatementNode([h.Nodes.getFunctionDeclarationNode(u.deadCodeInjectionRootAstHostNodeName,[],t)]);this.deadCodeInjectionRootAstHostNodeSet.add(n);var o=this.deadCodeInjectionCustomNodeFactory(m.DeadCodeInjectionCustomNode.BlockStatementDeadCodeInjectionNode);o.initialize(e,n);var a=o.getNode()[0];return b.NodeUtils.parentizeNode(a,r),a}}],[{key:"isProhibitedNodeInsideCollectedBlockStatement",value:function(e){return y.NodeGuards.isBreakStatementNode(e)||y.NodeGuards.isContinueStatementNode(e)||y.NodeGuards.isAwaitExpressionNode(e)||y.NodeGuards.isSuperNode(e)}},{key:"isScopeHoistingFunctionDeclaration",value:function(e){if(!y.NodeGuards.isFunctionDeclarationNode(e))return!1;var t=b.NodeUtils.getScopeOfNode(e),r=y.NodeGuards.isSwitchCaseNode(t)?t.consequent:t.body,n=r.indexOf(e);if(0===n)return!1;var o=r.slice(0,n),a=h.Nodes.getBlockStatementNode(o),i=e.id.name,s=!1;return p.traverse(a,{enter:function(e){if(y.NodeGuards.isIdentifierNode(e)&&e.name===i)return s=!0,p.VisitorOption.Break}}),s}},{key:"isValidCollectedBlockStatementNode",value:function(e){if(!e.body.length)return!1;var t=0,r=!0;return p.traverse(e,{enter:function(e){if(y.NodeGuards.isBlockStatementNode(e)&&t++,t>u.maxNestedBlockStatementsCount||u.isProhibitedNodeInsideCollectedBlockStatement(e)||u.isScopeHoistingFunctionDeclaration(e))return r=!1,p.VisitorOption.Break}}),r}},{key:"isValidWrappedBlockStatementNode",value:function(e){if(!e.body.length)return!1;var t=!0;return p.traverse(e,{enter:function(e){if(u.isScopeHoistingFunctionDeclaration(e))return t=!1,p.VisitorOption.Break}}),!!t&&b.NodeUtils.getBlockScopesOfNode(e)[0].type!==_.NodeType.Program}}]),t}(v.AbstractNodeTransformer);S.deadCodeInjectionRootAstHostNodeName="deadCodeInjectionRootAstHostNode",S.maxNestedBlockStatementsCount=4,S.minCollectedBlockStatementsCount=5,S.transformersToRenameBlockScopeIdentifiers=[g.NodeTransformer.CatchClauseTransformer,g.NodeTransformer.ClassDeclarationTransformer,g.NodeTransformer.FunctionDeclarationTransformer,g.NodeTransformer.FunctionTransformer,g.NodeTransformer.LabeledStatementTransformer,g.NodeTransformer.VariableDeclarationTransformer],S=u=d.__decorate([l.injectable(),d.__param(0,l.inject(f.ServiceIdentifiers.Factory__IDeadCodeInjectionCustomNode)),d.__param(1,l.inject(f.ServiceIdentifiers.ITransformersRunner)),d.__param(2,l.inject(f.ServiceIdentifiers.IRandomGenerator)),d.__param(3,l.inject(f.ServiceIdentifiers.IOptions)),d.__metadata("design:paramtypes",[Function,Object,Object,Object])],S),t.DeadCodeInjectionTransformer=S},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c,u=r(4),d=r(0),l=r(3),f=r(21),p=r(46),m=r(9),g=c=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"replace",value:function(e,t,r){var n=e.callee;if(!m.NodeGuards.isIdentifierNode(n))return e;var o=String(e.arguments.length),a=this.controlFlowCustomNodeFactory(f.ControlFlowCustomNode.CallExpressionFunctionNode),i=e.arguments;a.initialize(i);var s=this.insertCustomNodeToControlFlowStorage(a,r,o,c.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(r.getStorageId(),s,n,i)}},{key:"getControlFlowStorageCallNode",value:function(e,t,r,n){var o=this.controlFlowCustomNodeFactory(f.ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode);o.initialize(e,t,r,n);var a=o.getNode()[0];if(!a||!m.NodeGuards.isExpressionStatementNode(a))throw new Error("`controlFlowStorageCallCustomNode.getNode()[0]` should returns array with `ExpressionStatement` node");return a.expression}}]),t}(p.AbstractControlFlowReplacer);g.usingExistingIdentifierChance=.5,g=c=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IControlFlowCustomNode)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object])],g),t.CallExpressionControlFlowReplacer=g},function(e,t){e.exports=require("@babel/runtime/core-js/reflect/has-metadata")},function(e,t){e.exports=require("@babel/runtime/core-js/reflect/define-metadata")},function(e,t){e.exports=require("@babel/runtime/core-js/object/get-own-property-names")},function(e,t){e.exports=require("@babel/runtime/core-js/reflect/get-metadata")},function(e,t){e.exports=require("@babel/runtime/core-js/object/get-own-property-descriptor")},function(e,t){e.exports=require("@babel/runtime/core-js/object/define-property")},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c,u=r(4),d=r(0),l=r(3),f=u.__importStar(r(17)),p=r(21),m=r(12),g=r(14),_=r(9),N=r(8),v=c=function(e){function t(e,r,a,s){var c;return o(this,t),(c=i(this,(t.__proto__||n(t)).call(this,a,s))).controlFlowCustomNodeFactory=e,c.arrayUtils=r,c}return s(t,e),a(t,[{key:"getVisitor",value:function(e){var t=this;switch(e){case m.TransformationStage.ControlFlowFlattening:return{leave:function(e,r){if(r&&_.NodeGuards.isBlockStatementNode(e))return t.transformNode(e,r)}};default:return null}}},{key:"transformNode",value:function(e,t){if(this.randomGenerator.getMathRandom()>this.options.controlFlowFlatteningThreshold||!c.canTransformBlockStatementNode(e))return e;var r=e.body,n=this.arrayUtils.arrayRange(r.length),o=this.arrayUtils.arrayShuffle(n),a=n.map(function(e){return o.indexOf(e)}),i=this.controlFlowCustomNodeFactory(p.ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode);i.initialize(r,o,a);var s=i.getNode()[0];return N.NodeUtils.parentizeNode(s,t),s}}],[{key:"blockStatementHasProhibitedStatements",value:function(e){return e.body.some(function(e){var t=_.NodeGuards.isBreakStatementNode(e)||_.NodeGuards.isContinueStatementNode(e),r=_.NodeGuards.isVariableDeclarationNode(e)&&("const"===e.kind||"let"===e.kind),n=_.NodeGuards.isClassDeclarationNode(e);return _.NodeGuards.isFunctionDeclarationNode(e)||t||r||n})}},{key:"canTransformBlockStatementNode",value:function(e){var t=!0;return f.traverse(e,{enter:function(e){if(_.NodeGuards.isWhileStatementNode(e))return f.VisitorOption.Skip;_.NodeGuards.isBlockStatementNode(e)&&c.blockStatementHasProhibitedStatements(e)&&(t=!1)}}),e.body.length<=4&&(t=!1),t}}]),t}(g.AbstractNodeTransformer);v=c=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IControlFlowCustomNode)),u.__param(1,d.inject(l.ServiceIdentifiers.IArrayUtils)),u.__param(2,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(3,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object,Object])],v),t.BlockStatementControlFlowTransformer=v},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c,u=r(4),d=r(0),l=r(3),f=r(21),p=r(63),m=c=function(e){function t(e,r,a){return o(this,t),i(this,(t.__proto__||n(t)).call(this,e,r,a))}return s(t,e),a(t,[{key:"replace",value:function(e,t,r){var n=e.operator,o=this.controlFlowCustomNodeFactory(f.ControlFlowCustomNode.BinaryExpressionFunctionNode);o.initialize(n);var a=this.insertCustomNodeToControlFlowStorage(o,r,n,c.usingExistingIdentifierChance);return this.getControlFlowStorageCallNode(r.getStorageId(),a,e.left,e.right)}}]),t}(p.ExpressionWithOperatorControlFlowReplacer);m.usingExistingIdentifierChance=.5,m=c=u.__decorate([d.injectable(),u.__param(0,d.inject(l.ServiceIdentifiers.Factory__IControlFlowCustomNode)),u.__param(1,d.inject(l.ServiceIdentifiers.IRandomGenerator)),u.__param(2,d.inject(l.ServiceIdentifiers.IOptions)),u.__metadata("design:paramtypes",[Function,Object,Object])],m),t.BinaryExpressionControlFlowReplacer=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(26),o=r(0),a=r(3),i=r(64),s=r(31),c=r(207),u=r(206),d=r(199),l=r(198),f=r(197),p=r(196),m=r(195);t.controlFlowTransformersModule=new o.ContainerModule(function(e){e(a.ServiceIdentifiers.INodeTransformer).to(u.BlockStatementControlFlowTransformer).whenTargetNamed(s.NodeTransformer.BlockStatementControlFlowTransformer),e(a.ServiceIdentifiers.INodeTransformer).to(l.DeadCodeInjectionTransformer).whenTargetNamed(s.NodeTransformer.DeadCodeInjectionTransformer),e(a.ServiceIdentifiers.INodeTransformer).to(f.FunctionControlFlowTransformer).whenTargetNamed(s.NodeTransformer.FunctionControlFlowTransformer),e(a.ServiceIdentifiers.IControlFlowReplacer).to(c.BinaryExpressionControlFlowReplacer).whenTargetNamed(i.ControlFlowReplacer.BinaryExpressionControlFlowReplacer),e(a.ServiceIdentifiers.IControlFlowReplacer).to(d.CallExpressionControlFlowReplacer).whenTargetNamed(i.ControlFlowReplacer.CallExpressionControlFlowReplacer),e(a.ServiceIdentifiers.IControlFlowReplacer).to(p.LogicalExpressionControlFlowReplacer).whenTargetNamed(i.ControlFlowReplacer.LogicalExpressionControlFlowReplacer),e(a.ServiceIdentifiers.IControlFlowReplacer).to(m.StringLiteralControlFlowReplacer).whenTargetNamed(i.ControlFlowReplacer.StringLiteralControlFlowReplacer),e(a.ServiceIdentifiers.Factory__IControlFlowReplacer).toFactory(n.InversifyContainerFacade.getCacheFactory(a.ServiceIdentifiers.IControlFlowReplacer))})},function(e,t,r){"use strict";var n=r(11),o=r(1),a=r(2);Object.defineProperty(t,"__esModule",{value:!0});var i,s=r(4),c=r(0),u=r(3),d=s.__importStar(r(17)),l=r(67),f=r(9),p=r(8),m=i=function(){function e(t){o(this,e),this.calleeDataExtractorFactory=t}return a(e,[{key:"analyze",value:function(e){return this.analyzeRecursive(e.body)}},{key:"analyzeRecursive",value:function(e){for(var t=this,r=i.getLimitIndex(e.length),n=[],o=e.length,a=function(o){if(o>r)return"break";var a=e[o];d.traverse(a,{enter:function(r){if(f.NodeGuards.isCallExpressionNode(r))return a.parentNode!==p.NodeUtils.getBlockScopesOfNode(r)[0]?d.VisitorOption.Skip:void t.analyzeCallExpressionNode(n,e,r)}})},s=0;sr&&(n=Math.round(r+t*i.limitThreshold))>t&&(n=t),n}}]),e}();m.calleeDataExtractorsList=[l.CalleeDataExtractor.FunctionDeclarationCalleeDataExtractor,l.CalleeDataExtractor.FunctionExpressionCalleeDataExtractor,l.CalleeDataExtractor.ObjectExpressionCalleeDataExtractor],m.limitThresholdActivationLength=25,m.limitThreshold=.002,m=i=s.__decorate([c.injectable(),s.__param(0,c.inject(u.ServiceIdentifiers.Factory__ICalleeDataExtractor)),s.__metadata("design:paramtypes",[Function])],m),t.StackTraceAnalyzer=m},function(e,t,r){"use strict";var n=r(37),o=r(7),a=r(1),i=r(2),s=r(6),c=r(5);Object.defineProperty(t,"__esModule",{value:!0});var u=r(4),d=r(0),l=u.__importStar(r(17)),f=r(48),p=r(9),m=r(8),g=function(e){function t(){return a(this,t),s(this,(t.__proto__||o(t)).apply(this,arguments))}return c(t,e),i(t,[{key:"extract",value:function(e,t){if(!p.NodeGuards.isMemberExpressionNode(t))return null;var r=this.createObjectMembersCallsChain([],t);if(!r.length)return null;var n=r[r.length-1],o=this.getCalleeBlockStatement(m.NodeUtils.getBlockScopesOfNode(e[0])[0],r);return o?{callee:o,name:n}:null}},{key:"createObjectMembersCallsChain",value:function(e,t){if(p.NodeGuards.isIdentifierNode(t.property)&&!1===t.computed)e.unshift(t.property.name);else{if(!p.NodeGuards.isLiteralNode(t.property)||"string"!=typeof t.property.value&&"number"!=typeof t.property.value)return e;e.unshift(t.property.value)}return p.NodeGuards.isMemberExpressionNode(t.object)?this.createObjectMembersCallsChain(e,t.object):(p.NodeGuards.isIdentifierNode(t.object)&&e.unshift(t.object.name),e)}},{key:"getCalleeBlockStatement",value:function(e,t){var r=this,n=t.shift();if(!n)return null;var o=null;return l.traverse(e,{enter:function(e){if(p.NodeGuards.isVariableDeclaratorNode(e)&&p.NodeGuards.isIdentifierNode(e.id)&&e.init&&p.NodeGuards.isObjectExpressionNode(e.init)&&e.id.name===n)return o=r.findCalleeBlockStatement(e.init.properties,t),l.VisitorOption.Break}}),o}},{key:"findCalleeBlockStatement",value:function(e,t){var r=t.shift();if(!r)return null;var o=!0,a=!1,i=void 0;try{for(var s,c=n(e);!(o=(s=c.next()).done);o=!0){var u=s.value,d=p.NodeGuards.isIdentifierNode(u.key)&&u.key.name===r,l=p.NodeGuards.isLiteralNode(u.key)&&Boolean(u.key.value)&&u.key.value===r;if(d||l){if(p.NodeGuards.isObjectExpressionNode(u.value))return this.findCalleeBlockStatement(u.value.properties,t);if(p.NodeGuards.isFunctionExpressionNode(u.value))return u.value.body}}}catch(e){a=!0,i=e}finally{try{o||null==c.return||c.return()}finally{if(a)throw i}}return null}}]),t}(f.AbstractCalleeDataExtractor);g=u.__decorate([d.injectable()],g),t.ObjectExpressionCalleeDataExtractor=g},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=c.__importStar(r(17)),l=r(48),f=r(9),p=r(8),m=function(e){function t(){return o(this,t),i(this,(t.__proto__||n(t)).apply(this,arguments))}return s(t,e),a(t,[{key:"extract",value:function(e,t){var r=null;return f.NodeGuards.isIdentifierNode(t)&&(r=this.getCalleeBlockStatement(p.NodeUtils.getBlockScopesOfNode(e[0])[0],t.name)),f.NodeGuards.isFunctionExpressionNode(t)&&(r=t.body),r?{callee:r,name:t.name||null}:null}},{key:"getCalleeBlockStatement",value:function(e,t){var r=null;return d.traverse(e,{enter:function(e,n){if(f.NodeGuards.isFunctionExpressionNode(e)&&n&&f.NodeGuards.isVariableDeclaratorNode(n)&&f.NodeGuards.isIdentifierNode(n.id)&&n.id.name===t)return r=e.body,d.VisitorOption.Break}}),r}}]),t}(l.AbstractCalleeDataExtractor);m=c.__decorate([u.injectable()],m),t.FunctionExpressionCalleeDataExtractor=m},function(e,t,r){"use strict";var n=r(7),o=r(1),a=r(2),i=r(6),s=r(5);Object.defineProperty(t,"__esModule",{value:!0});var c=r(4),u=r(0),d=c.__importStar(r(17)),l=r(48),f=r(9),p=r(8),m=function(e){function t(){return o(this,t),i(this,(t.__proto__||n(t)).apply(this,arguments))}return s(t,e),a(t,[{key:"extract",value:function(e,t){if(!f.NodeGuards.isIdentifierNode(t))return null;var r=this.getCalleeBlockStatement(p.NodeUtils.getBlockScopesOfNode(e[0])[0],t.name);return r?{callee:r,name:t.name}:null}},{key:"getCalleeBlockStatement",value:function(e,t){var r=null;return d.traverse(e,{enter:function(e){if(f.NodeGuards.isFunctionDeclarationNode(e)&&e.id.name===t)return r=e.body,d.VisitorOption.Break}}),r}}]),t}(l.AbstractCalleeDataExtractor);m=c.__decorate([u.injectable()],m),t.FunctionDeclarationCalleeDataExtractor=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(26),o=r(0),a=r(3),i=r(67),s=r(212),c=r(211),u=r(210),d=r(209);t.analyzersModule=new o.ContainerModule(function(e){e(a.ServiceIdentifiers.IStackTraceAnalyzer).to(d.StackTraceAnalyzer).inSingletonScope(),e(a.ServiceIdentifiers.ICalleeDataExtractor).to(s.FunctionDeclarationCalleeDataExtractor).whenTargetNamed(i.CalleeDataExtractor.FunctionDeclarationCalleeDataExtractor),e(a.ServiceIdentifiers.ICalleeDataExtractor).to(c.FunctionExpressionCalleeDataExtractor).whenTargetNamed(i.CalleeDataExtractor.FunctionExpressionCalleeDataExtractor),e(a.ServiceIdentifiers.ICalleeDataExtractor).to(u.ObjectExpressionCalleeDataExtractor).whenTargetNamed(i.CalleeDataExtractor.ObjectExpressionCalleeDataExtractor),e(a.ServiceIdentifiers.Factory__ICalleeDataExtractor).toFactory(n.InversifyContainerFacade.getCacheFactory(a.ServiceIdentifiers.ICalleeDataExtractor))})},function(e,t){e.exports=require("reflect-metadata")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(32);e.exports=n.JavaScriptObfuscator}]); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/package.json b/package.json index 4fe21722..fc04f904 100644 --- a/package.json +++ b/package.json @@ -58,13 +58,13 @@ "@types/sinon": "4.3.0", "@types/string-template": "1.0.2", "@types/webpack-env": "1.13.5", - "awesome-typescript-loader": "4.0.0-1", + "awesome-typescript-loader": "5.0.0-0", "babel-cli": "7.0.0-beta.3", "babel-loader": "8.0.0-beta.2", "chai": "4.1.2", "coveralls": "3.0.0", "istanbul": "1.1.0-alpha.1", - "mocha": "5.0.1", + "mocha": "5.0.4", "pre-commit": "1.2.2", "rimraf": "2.6.2", "sinon": "4.4.2", @@ -75,7 +75,7 @@ "tslint-language-service": "0.9.8", "tslint-webpack-plugin": "1.2.0", "typescript": "2.7.2", - "webpack": "4.0.1", + "webpack": "4.1.1", "webpack-cli": "2.0.10", "webpack-node-externals": "1.6.0" }, diff --git a/yarn.lock b/yarn.lock index 5f321fdc..839ca4e2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -641,6 +641,13 @@ anymatch@^1.3.0: micromatch "^2.1.5" normalize-path "^2.0.0" +anymatch@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" + dependencies: + micromatch "^3.1.4" + normalize-path "^2.1.1" + append-transform@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-0.4.0.tgz#d76ebf8ca94d276e247a36bad44a4b74ab611991" @@ -768,7 +775,7 @@ async@^2.0.0: dependencies: lodash "^4.14.0" -async@^2.1.2, async@^2.1.4: +async@^2.1.4: version "2.5.0" resolved "https://registry.yarnpkg.com/async/-/async-2.5.0.tgz#843190fd6b7357a0b9e1c956edddd5ec8462b54d" dependencies: @@ -782,15 +789,15 @@ atob@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/atob/-/atob-2.0.3.tgz#19c7a760473774468f20b2d2d03372ad7d4cbf5d" -awesome-typescript-loader@4.0.0-1: - version "4.0.0-1" - resolved "https://registry.yarnpkg.com/awesome-typescript-loader/-/awesome-typescript-loader-4.0.0-1.tgz#356ca19693640f70429c72d527a88adc1d7fbb19" +awesome-typescript-loader@5.0.0-0: + version "5.0.0-0" + resolved "https://registry.yarnpkg.com/awesome-typescript-loader/-/awesome-typescript-loader-5.0.0-0.tgz#1330750fe603d54a5f0e25429185baed0e48f9f2" dependencies: chalk "^2.3.1" - enhanced-resolve "3.3.0" + enhanced-resolve "^4.0.0" loader-utils "^1.1.0" - lodash "^4.17.4" - micromatch "^3.0.3" + lodash "^4.17.5" + micromatch "^3.1.9" mkdirp "^0.5.1" source-map-support "^0.5.3" @@ -1640,9 +1647,9 @@ brorand@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" -browser-stdout@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" +browser-stdout@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" browserify-aes@^1.0.0, browserify-aes@^1.0.4: version "1.1.1" @@ -1859,7 +1866,7 @@ check-error@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" -chokidar@^1.6.1, chokidar@^1.7.0: +chokidar@^1.6.1: version "1.7.0" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" dependencies: @@ -1874,6 +1881,24 @@ chokidar@^1.6.1, chokidar@^1.7.0: optionalDependencies: fsevents "^1.0.0" +chokidar@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.2.tgz#4dc65139eeb2714977735b6a35d06e97b494dfd7" + dependencies: + anymatch "^2.0.0" + async-each "^1.0.0" + braces "^2.3.0" + glob-parent "^3.1.0" + inherits "^2.0.1" + is-binary-path "^1.0.0" + is-glob "^4.0.0" + normalize-path "^2.1.1" + path-is-absolute "^1.0.0" + readdirp "^2.0.0" + upath "^1.0.0" + optionalDependencies: + fsevents "^1.0.0" + chownr@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.0.1.tgz#e2a75042a9551908bebd25b8523d5f9769d79181" @@ -2321,14 +2346,18 @@ detect-libc@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.2.tgz#71ad5d204bf17a6a6ca8f450c61454066ef461e1" -diff@3.3.1, diff@^3.1.0, diff@^3.2.0: - version "3.3.1" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.1.tgz#aa8567a6eed03c531fc89d3f711cd0e5259dec75" +diff@3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" diff@^2.1.2: version "2.2.3" resolved "https://registry.yarnpkg.com/diff/-/diff-2.2.3.tgz#60eafd0d28ee906e4e8ff0a52c1229521033bf99" +diff@^3.1.0, diff@^3.2.0: + version "3.3.1" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.1.tgz#aa8567a6eed03c531fc89d3f711cd0e5259dec75" + diff@^3.3.0, diff@^3.3.1: version "3.4.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.4.0.tgz#b1d85507daf3964828de54b37d0d73ba67dda56c" @@ -2419,15 +2448,6 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0: dependencies: once "^1.4.0" -enhanced-resolve@3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-3.3.0.tgz#950964ecc7f0332a42321b673b38dc8ff15535b3" - dependencies: - graceful-fs "^4.1.2" - memory-fs "^0.4.0" - object-assign "^4.0.1" - tapable "^0.2.5" - enhanced-resolve@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.0.0.tgz#e34a6eaa790f62fccd71d93959f56b2b432db10a" @@ -2622,19 +2642,6 @@ extglob@^0.3.1: dependencies: is-extglob "^1.0.0" -extglob@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.2.tgz#3290f46208db1b2e8eb8be0c94ed9e6ad80edbe2" - dependencies: - array-unique "^0.3.2" - define-property "^1.0.0" - expand-brackets "^2.1.4" - extend-shallow "^2.0.1" - fragment-cache "^0.2.1" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - extglob@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" @@ -2888,6 +2895,13 @@ glob-parent@^2.0.0: dependencies: is-glob "^2.0.0" +glob-parent@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" + dependencies: + is-glob "^3.1.0" + path-dirname "^1.0.0" + glob@7.1.2, glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" @@ -3438,6 +3452,10 @@ is-extglob@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" +is-extglob@^2.1.0, is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + is-finite@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" @@ -3460,6 +3478,18 @@ is-glob@^2.0.0, is-glob@^2.0.1: dependencies: is-extglob "^1.0.0" +is-glob@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" + dependencies: + is-extglob "^2.1.0" + +is-glob@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.0.tgz#9521c76845cc2610a85203ddf080a958c2ffabc0" + dependencies: + is-extglob "^2.1.1" + is-number@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" @@ -3486,12 +3516,6 @@ is-observable@^0.2.0: dependencies: symbol-observable "^0.2.2" -is-odd@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-odd/-/is-odd-1.0.0.tgz#3b8a932eb028b3775c39bb09e91767accdb69088" - dependencies: - is-number "^3.0.0" - is-odd@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-odd/-/is-odd-2.0.0.tgz#7646624671fd7ea558ccd9a2795182f2958f1b24" @@ -3779,7 +3803,7 @@ kind-of@^4.0.0: dependencies: is-buffer "^1.1.5" -kind-of@^5.0.0, kind-of@^5.0.2: +kind-of@^5.0.0: version "5.1.0" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" @@ -4047,25 +4071,7 @@ micromatch@^2.1.5, micromatch@^2.3.11, micromatch@^2.3.7: parse-glob "^3.0.4" regex-cache "^0.4.2" -micromatch@^3.0.3: - version "3.1.4" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.4.tgz#bb812e741a41f982c854e42b421a7eac458796f4" - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - braces "^2.3.0" - define-property "^1.0.0" - extend-shallow "^2.0.1" - extglob "^2.0.2" - fragment-cache "^0.2.1" - kind-of "^6.0.0" - nanomatch "^1.2.5" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -micromatch@^3.1.8: +micromatch@^3.1.4, micromatch@^3.1.8, micromatch@^3.1.9: version "3.1.9" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.9.tgz#15dc93175ae39e52e93087847096effc73efcf89" dependencies: @@ -4168,14 +4174,14 @@ mkdirp@0.5.1, mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdi dependencies: minimist "0.0.8" -mocha@5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.0.1.tgz#759b62c836b0732382a62b6b1fb245ec1bc943ac" +mocha@5.0.4: + version "5.0.4" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.0.4.tgz#6b7aa328472da1088e69d47e75925fd3a3bb63c6" dependencies: - browser-stdout "1.3.0" + browser-stdout "1.3.1" commander "2.11.0" debug "3.1.0" - diff "3.3.1" + diff "3.5.0" escape-string-regexp "1.0.5" glob "7.1.2" growl "1.10.3" @@ -4219,22 +4225,6 @@ nan@^2.3.0: version "2.7.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.7.0.tgz#d95bf721ec877e08db276ed3fc6eb78f9083ad46" -nanomatch@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.5.tgz#5c9ab02475c76676275731b0bf0a7395c624a9c4" - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - define-property "^1.0.0" - extend-shallow "^2.0.1" - fragment-cache "^0.2.1" - is-odd "^1.0.0" - kind-of "^5.0.2" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - nanomatch@^1.2.9: version "1.2.9" resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.9.tgz#879f7150cb2dab7a471259066c104eee6e0fa7c2" @@ -4358,7 +4348,7 @@ normalize-package-data@^2.3.2: semver "2 || 3 || 4 || 5" validate-npm-package-license "^3.0.1" -normalize-path@^2.0.0, normalize-path@^2.0.1: +normalize-path@^2.0.0, normalize-path@^2.0.1, normalize-path@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" dependencies: @@ -4627,6 +4617,10 @@ path-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a" +path-dirname@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" + path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" @@ -5620,10 +5614,6 @@ symbol-observable@^0.2.2: version "0.2.4" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-0.2.4.tgz#95a83db26186d6af7e7a18dbd9760a2f86d08f40" -tapable@^0.2.5: - version "0.2.8" - resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.2.8.tgz#99372a5c999bf2df160afc0d74bed4f47948cd22" - tapable@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.0.0.tgz#cbb639d9002eed9c6b5975eb20598d7936f1f9f2" @@ -5953,6 +5943,10 @@ untildify@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/untildify/-/untildify-3.0.2.tgz#7f1f302055b3fea0f3e81dc78eb36766cb65e3f1" +upath@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/upath/-/upath-1.0.4.tgz#ee2321ba0a786c50973db043a50b7bcba822361d" + urix@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" @@ -6065,13 +6059,13 @@ vm-browserify@0.0.4: dependencies: indexof "0.0.1" -watchpack@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.4.0.tgz#4a1472bcbb952bd0a9bb4036801f954dfb39faac" +watchpack@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.5.0.tgz#231e783af830a22f8966f65c4c4bacc814072eed" dependencies: - async "^2.1.2" - chokidar "^1.7.0" + chokidar "^2.0.2" graceful-fs "^4.1.2" + neo-async "^2.5.0" webpack-addons@^1.1.5: version "1.1.5" @@ -6131,9 +6125,9 @@ webpack-sources@^1.1.0: source-list-map "^2.0.0" source-map "~0.6.1" -webpack@4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.0.1.tgz#768d708beeca4c5f77f6c2d38a240fb6ff50ba5d" +webpack@4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.1.1.tgz#44e4d6a869dd36fdfc0b227f9bd865a4bccfd81c" dependencies: acorn "^5.0.0" acorn-dynamic-import "^3.0.0" @@ -6152,7 +6146,7 @@ webpack@4.0.1: schema-utils "^0.4.2" tapable "^1.0.0" uglifyjs-webpack-plugin "^1.1.1" - watchpack "^1.4.0" + watchpack "^1.5.0" webpack-sources "^1.0.1" which-module@^2.0.0: