index.js 254 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050
  1. /*
  2. Copyright (C) 2016 Timofey Kachalov <[email protected]>
  3. Redistribution and use in source and binary forms, with or without
  4. modification, are permitted provided that the following conditions are met:
  5. * Redistributions of source code must retain the above copyright
  6. notice, this list of conditions and the following disclaimer.
  7. * Redistributions in binary form must reproduce the above copyright
  8. notice, this list of conditions and the following disclaimer in the
  9. documentation and/or other materials provided with the distribution.
  10. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  11. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  12. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  13. ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  14. DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  15. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  16. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  17. ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  18. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  19. THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  20. */
  21. require("source-map-support").install();
  22. module.exports =
  23. /******/ (function(modules) { // webpackBootstrap
  24. /******/ // The module cache
  25. /******/ var installedModules = {};
  26. /******/
  27. /******/ // The require function
  28. /******/ function __webpack_require__(moduleId) {
  29. /******/
  30. /******/ // Check if module is in cache
  31. /******/ if(installedModules[moduleId])
  32. /******/ return installedModules[moduleId].exports;
  33. /******/
  34. /******/ // Create a new module (and put it into the cache)
  35. /******/ var module = installedModules[moduleId] = {
  36. /******/ i: moduleId,
  37. /******/ l: false,
  38. /******/ exports: {}
  39. /******/ };
  40. /******/
  41. /******/ // Execute the module function
  42. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  43. /******/
  44. /******/ // Flag the module as loaded
  45. /******/ module.l = true;
  46. /******/
  47. /******/ // Return the exports of the module
  48. /******/ return module.exports;
  49. /******/ }
  50. /******/
  51. /******/
  52. /******/ // expose the modules object (__webpack_modules__)
  53. /******/ __webpack_require__.m = modules;
  54. /******/
  55. /******/ // expose the module cache
  56. /******/ __webpack_require__.c = installedModules;
  57. /******/
  58. /******/ // identity function for calling harmory imports with the correct context
  59. /******/ __webpack_require__.i = function(value) { return value; };
  60. /******/
  61. /******/ // define getter function for harmory exports
  62. /******/ __webpack_require__.d = function(exports, name, getter) {
  63. /******/ Object.defineProperty(exports, name, {
  64. /******/ configurable: false,
  65. /******/ enumerable: true,
  66. /******/ get: getter
  67. /******/ });
  68. /******/ };
  69. /******/
  70. /******/ // getDefaultExport function for compatibility with non-harmony modules
  71. /******/ __webpack_require__.n = function(module) {
  72. /******/ var getter = module && module.__esModule ?
  73. /******/ function getDefault() { return module['default']; } :
  74. /******/ function getModuleExports() { return module; };
  75. /******/ __webpack_require__.d(getter, 'a', getter);
  76. /******/ return getter;
  77. /******/ };
  78. /******/
  79. /******/ // Object.prototype.hasOwnProperty.call
  80. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  81. /******/
  82. /******/ // __webpack_public_path__
  83. /******/ __webpack_require__.p = "";
  84. /******/
  85. /******/ // Load entry module and return exports
  86. /******/ return __webpack_require__(__webpack_require__.s = 102);
  87. /******/ })
  88. /************************************************************************/
  89. /******/ ([
  90. /* 0 */
  91. /***/ function(module, exports, __webpack_require__) {
  92. "use strict";
  93. "use strict";
  94. var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; })();
  95. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  96. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  97. var chance_1 = __webpack_require__(24);
  98. var JSFuck_1 = __webpack_require__(21);
  99. var isEqual = __webpack_require__(99);
  100. var Utils = function () {
  101. function Utils() {
  102. _classCallCheck(this, Utils);
  103. }
  104. _createClass(Utils, null, [{
  105. key: 'arrayContains',
  106. value: function arrayContains(array, searchElement) {
  107. return array.indexOf(searchElement) >= 0;
  108. }
  109. }, {
  110. key: 'arrayRotate',
  111. value: function arrayRotate(array, times) {
  112. if (!array.length) {
  113. throw new ReferenceError('Cannot rotate empty array.');
  114. }
  115. if (times <= 0) {
  116. return array;
  117. }
  118. var newArray = array,
  119. temp = void 0;
  120. while (times--) {
  121. temp = newArray.pop();
  122. newArray.unshift(temp);
  123. }
  124. return newArray;
  125. }
  126. }, {
  127. key: 'btoa',
  128. value: function btoa(string) {
  129. var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  130. var output = '';
  131. string = encodeURIComponent(string).replace(/%([0-9A-F]{2})/g, function (match, p1) {
  132. return String.fromCharCode(parseInt('0x' + p1));
  133. });
  134. for (var block, charCode, idx = 0, map = chars; string.charAt(idx | 0) || (map = '=', idx % 1); output += map.charAt(63 & block >> 8 - idx % 1 * 8)) {
  135. charCode = string.charCodeAt(idx += 3 / 4);
  136. if (charCode > 0xFF) {
  137. throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");
  138. }
  139. block = block << 8 | charCode;
  140. }
  141. return output;
  142. }
  143. }, {
  144. key: 'decToHex',
  145. value: function decToHex(dec) {
  146. var radix = 16;
  147. return Number(dec).toString(radix);
  148. }
  149. }, {
  150. key: 'extractDomainFromUrl',
  151. value: function extractDomainFromUrl(url) {
  152. var domain = void 0;
  153. if (url.indexOf('://') > -1 || url.indexOf('//') === 0) {
  154. domain = url.split('/')[2];
  155. } else {
  156. domain = url.split('/')[0];
  157. }
  158. domain = domain.split(':')[0];
  159. return domain;
  160. }
  161. }, {
  162. key: 'getRandomFloat',
  163. value: function getRandomFloat(min, max) {
  164. return Utils.getRandomGenerator().floating({
  165. min: min,
  166. max: max,
  167. fixed: 7
  168. });
  169. }
  170. }, {
  171. key: 'getRandomGenerator',
  172. value: function getRandomGenerator() {
  173. var randomGenerator = Utils.randomGenerator;
  174. if (!randomGenerator) {
  175. throw new Error('`randomGenerator` static property is undefined');
  176. }
  177. return Utils.randomGenerator;
  178. }
  179. }, {
  180. key: 'getRandomInteger',
  181. value: function getRandomInteger(min, max) {
  182. return Utils.getRandomGenerator().integer({
  183. min: min,
  184. max: max
  185. });
  186. }
  187. }, {
  188. key: 'getRandomVariableName',
  189. value: function getRandomVariableName() {
  190. var length = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 6;
  191. var rangeMinInteger = 10000,
  192. rangeMaxInteger = 99999999,
  193. prefix = '_0x';
  194. return '' + prefix + Utils.decToHex(Utils.getRandomInteger(rangeMinInteger, rangeMaxInteger)).substr(0, length);
  195. }
  196. }, {
  197. key: 'hideString',
  198. value: function hideString(str, length) {
  199. var escapeRegExp = function escapeRegExp(s) {
  200. return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
  201. };
  202. var randomMerge = function randomMerge(s1, s2) {
  203. var i1 = -1,
  204. i2 = -1,
  205. result = '';
  206. while (i1 < s1.length || i2 < s2.length) {
  207. if (Utils.getRandomFloat(0, 1) < 0.5 && i2 < s2.length) {
  208. result += s2.charAt(++i2);
  209. } else {
  210. result += s1.charAt(++i1);
  211. }
  212. }
  213. return result;
  214. };
  215. var randomString = Utils.randomGenerator.string({
  216. length: length,
  217. pool: Utils.randomGeneratorPool
  218. });
  219. var randomStringDiff = randomString.replace(new RegExp('[' + escapeRegExp(str) + ']', 'g'), '');
  220. var randomStringDiffArray = randomStringDiff.split('');
  221. Utils.randomGenerator.shuffle(randomStringDiffArray);
  222. randomStringDiff = randomStringDiffArray.join('');
  223. return [randomMerge(str, randomStringDiff), randomStringDiff];
  224. }
  225. }, {
  226. key: 'isInteger',
  227. value: function isInteger(number) {
  228. return number % 1 === 0;
  229. }
  230. }, {
  231. key: 'mapGetFirstKeyOf',
  232. value: function mapGetFirstKeyOf(map, value) {
  233. var _iteratorNormalCompletion = true;
  234. var _didIteratorError = false;
  235. var _iteratorError = undefined;
  236. try {
  237. for (var _iterator = map[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
  238. var _step$value = _slicedToArray(_step.value, 2),
  239. key = _step$value[0],
  240. storageValue = _step$value[1];
  241. if (isEqual(value, storageValue)) {
  242. return key;
  243. }
  244. }
  245. } catch (err) {
  246. _didIteratorError = true;
  247. _iteratorError = err;
  248. } finally {
  249. try {
  250. if (!_iteratorNormalCompletion && _iterator.return) {
  251. _iterator.return();
  252. }
  253. } finally {
  254. if (_didIteratorError) {
  255. throw _iteratorError;
  256. }
  257. }
  258. }
  259. return null;
  260. }
  261. }, {
  262. key: 'rc4',
  263. value: function rc4(string, key) {
  264. var s = [],
  265. j = 0,
  266. x = void 0,
  267. result = '';
  268. for (var i = 0; i < 256; i++) {
  269. s[i] = i;
  270. }
  271. for (i = 0; i < 256; i++) {
  272. j = (j + s[i] + key.charCodeAt(i % key.length)) % 256;
  273. x = s[i];
  274. s[i] = s[j];
  275. s[j] = x;
  276. }
  277. i = 0;
  278. j = 0;
  279. for (var y = 0; y < string.length; y++) {
  280. i = (i + 1) % 256;
  281. j = (j + s[i]) % 256;
  282. x = s[i];
  283. s[i] = s[j];
  284. s[j] = x;
  285. result += String.fromCharCode(string.charCodeAt(y) ^ s[(s[i] + s[j]) % 256]);
  286. }
  287. return result;
  288. }
  289. }, {
  290. key: 'setRandomGenerator',
  291. value: function setRandomGenerator(randomGenerator) {
  292. Utils.randomGenerator = randomGenerator;
  293. }
  294. }, {
  295. key: 'strEnumify',
  296. value: function strEnumify(obj) {
  297. return obj;
  298. }
  299. }, {
  300. key: 'stringToJSFuck',
  301. value: function stringToJSFuck(string) {
  302. return Array.from(string).map(function (character) {
  303. return JSFuck_1.JSFuck[character] || character;
  304. }).join(' + ');
  305. }
  306. }, {
  307. key: 'stringToUnicodeEscapeSequence',
  308. value: function stringToUnicodeEscapeSequence(string) {
  309. var radix = 16;
  310. var prefix = void 0,
  311. regexp = new RegExp('[\x00-\x7F]'),
  312. template = void 0;
  313. return '' + string.replace(/[\s\S]/g, function (escape) {
  314. if (regexp.test(escape)) {
  315. prefix = '\\x';
  316. template = '0'.repeat(2);
  317. } else {
  318. prefix = '\\u';
  319. template = '0'.repeat(4);
  320. }
  321. return '' + prefix + (template + escape.charCodeAt(0).toString(radix)).slice(-template.length);
  322. });
  323. }
  324. }]);
  325. return Utils;
  326. }();
  327. Utils.randomGeneratorPool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
  328. Utils.randomGenerator = new chance_1.Chance();
  329. exports.Utils = Utils;
  330. /***/ },
  331. /* 1 */
  332. /***/ function(module, exports) {
  333. "use strict";
  334. "use strict";
  335. (function (AppendState) {
  336. AppendState[AppendState["AfterObfuscation"] = 0] = "AfterObfuscation";
  337. AppendState[AppendState["BeforeObfuscation"] = 1] = "BeforeObfuscation";
  338. })(exports.AppendState || (exports.AppendState = {}));
  339. var AppendState = exports.AppendState;
  340. /***/ },
  341. /* 2 */
  342. /***/ function(module, exports, __webpack_require__) {
  343. "use strict";
  344. "use strict";
  345. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  346. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  347. var NodeType_1 = __webpack_require__(7);
  348. var Node = function () {
  349. function Node() {
  350. _classCallCheck(this, Node);
  351. }
  352. _createClass(Node, null, [{
  353. key: 'getProgramNode',
  354. value: function getProgramNode(bodyNode) {
  355. return {
  356. 'type': NodeType_1.NodeType.Program,
  357. 'body': bodyNode,
  358. 'sourceType': 'script',
  359. 'obfuscated': false
  360. };
  361. }
  362. }, {
  363. key: 'isArrowFunctionExpressionNode',
  364. value: function isArrowFunctionExpressionNode(node) {
  365. return node.type === NodeType_1.NodeType.ArrowFunctionExpression;
  366. }
  367. }, {
  368. key: 'isBlockStatementNode',
  369. value: function isBlockStatementNode(node) {
  370. return node.type === NodeType_1.NodeType.BlockStatement;
  371. }
  372. }, {
  373. key: 'isBreakStatementNode',
  374. value: function isBreakStatementNode(node) {
  375. return node.type === NodeType_1.NodeType.BreakStatement;
  376. }
  377. }, {
  378. key: 'isCallExpressionNode',
  379. value: function isCallExpressionNode(node) {
  380. return node.type === NodeType_1.NodeType.CallExpression;
  381. }
  382. }, {
  383. key: 'isContinueStatementNode',
  384. value: function isContinueStatementNode(node) {
  385. return node.type === NodeType_1.NodeType.ContinueStatement;
  386. }
  387. }, {
  388. key: 'isExpressionStatementNode',
  389. value: function isExpressionStatementNode(node) {
  390. return node.type === NodeType_1.NodeType.ExpressionStatement;
  391. }
  392. }, {
  393. key: 'isFunctionDeclarationNode',
  394. value: function isFunctionDeclarationNode(node) {
  395. return node.type === NodeType_1.NodeType.FunctionDeclaration;
  396. }
  397. }, {
  398. key: 'isFunctionExpressionNode',
  399. value: function isFunctionExpressionNode(node) {
  400. return node.type === NodeType_1.NodeType.FunctionExpression;
  401. }
  402. }, {
  403. key: 'isIdentifierNode',
  404. value: function isIdentifierNode(node) {
  405. return node.type === NodeType_1.NodeType.Identifier;
  406. }
  407. }, {
  408. key: 'isLabelIdentifierNode',
  409. value: function isLabelIdentifierNode(node, parentNode) {
  410. var parentNodeIsLabeledStatementNode = Node.isLabeledStatementNode(parentNode) && parentNode.label === node;
  411. var parentNodeIsContinueStatementNode = Node.isContinueStatementNode(parentNode) && parentNode.label === node;
  412. var parentNodeIsBreakStatementNode = Node.isBreakStatementNode(parentNode) && parentNode.label === node;
  413. return parentNodeIsLabeledStatementNode || parentNodeIsContinueStatementNode || parentNodeIsBreakStatementNode;
  414. }
  415. }, {
  416. key: 'isLabeledStatementNode',
  417. value: function isLabeledStatementNode(node) {
  418. return node.type === NodeType_1.NodeType.LabeledStatement;
  419. }
  420. }, {
  421. key: 'isLiteralNode',
  422. value: function isLiteralNode(node) {
  423. return node.type === NodeType_1.NodeType.Literal;
  424. }
  425. }, {
  426. key: 'isMemberExpressionNode',
  427. value: function isMemberExpressionNode(node) {
  428. return node.type === NodeType_1.NodeType.MemberExpression;
  429. }
  430. }, {
  431. key: 'isObjectExpressionNode',
  432. value: function isObjectExpressionNode(node) {
  433. return node.type === NodeType_1.NodeType.ObjectExpression;
  434. }
  435. }, {
  436. key: 'isProgramNode',
  437. value: function isProgramNode(node) {
  438. return node.type === NodeType_1.NodeType.Program;
  439. }
  440. }, {
  441. key: 'isPropertyNode',
  442. value: function isPropertyNode(node) {
  443. return node.type === NodeType_1.NodeType.Property;
  444. }
  445. }, {
  446. key: 'isReplaceableIdentifierNode',
  447. value: function isReplaceableIdentifierNode(node, parentNode) {
  448. if (!Node.isIdentifierNode(node)) {
  449. return false;
  450. }
  451. var parentNodeIsPropertyNode = Node.isPropertyNode(parentNode) && parentNode.key === node;
  452. var parentNodeIsMemberExpressionNode = Node.isMemberExpressionNode(parentNode) && parentNode.computed === false && parentNode.property === node;
  453. return !parentNodeIsPropertyNode && !parentNodeIsMemberExpressionNode && !Node.isLabelIdentifierNode(node, parentNode);
  454. }
  455. }, {
  456. key: 'isVariableDeclarationNode',
  457. value: function isVariableDeclarationNode(node) {
  458. return node.type === NodeType_1.NodeType.VariableDeclaration;
  459. }
  460. }, {
  461. key: 'isVariableDeclaratorNode',
  462. value: function isVariableDeclaratorNode(node) {
  463. return node.type === NodeType_1.NodeType.VariableDeclarator;
  464. }
  465. }, {
  466. key: 'isNodeHasBlockStatement',
  467. value: function isNodeHasBlockStatement(node) {
  468. return node.hasOwnProperty('body') && Array.isArray(node.body);
  469. }
  470. }]);
  471. return Node;
  472. }();
  473. exports.Node = Node;
  474. /***/ },
  475. /* 3 */
  476. /***/ function(module, exports, __webpack_require__) {
  477. "use strict";
  478. "use strict";
  479. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  480. function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
  481. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  482. var Utils_1 = __webpack_require__(0);
  483. var NodeAppender = function () {
  484. function NodeAppender() {
  485. _classCallCheck(this, NodeAppender);
  486. }
  487. _createClass(NodeAppender, null, [{
  488. key: 'appendNode',
  489. value: function appendNode(blockScopeNode, nodeBodyStatements) {
  490. if (!NodeAppender.validateBodyStatements(nodeBodyStatements)) {
  491. nodeBodyStatements = [];
  492. }
  493. nodeBodyStatements = NodeAppender.parentizeBodyStatementsBeforeAppend(blockScopeNode, nodeBodyStatements);
  494. blockScopeNode.body = [].concat(_toConsumableArray(blockScopeNode.body), _toConsumableArray(nodeBodyStatements));
  495. }
  496. }, {
  497. key: 'appendNodeToOptimalBlockScope',
  498. value: function appendNodeToOptimalBlockScope(blockScopeStackTraceData, blockScopeNode, nodeBodyStatements) {
  499. var index = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  500. var targetBlockScope = void 0;
  501. if (!blockScopeStackTraceData.length) {
  502. targetBlockScope = blockScopeNode;
  503. } else {
  504. targetBlockScope = NodeAppender.getOptimalBlockScope(blockScopeStackTraceData, index);
  505. }
  506. NodeAppender.prependNode(targetBlockScope, nodeBodyStatements);
  507. }
  508. }, {
  509. key: 'getOptimalBlockScope',
  510. value: function getOptimalBlockScope(blockScopeTraceData, index) {
  511. var deep = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Infinity;
  512. var firstCall = blockScopeTraceData[index];
  513. if (deep <= 0) {
  514. throw new Error('Invalid `deep` argument value. Value should be bigger then 0.');
  515. }
  516. if (deep > 1 && firstCall.stackTrace.length) {
  517. return NodeAppender.getOptimalBlockScope(firstCall.stackTrace, 0, --deep);
  518. } else {
  519. return firstCall.callee;
  520. }
  521. }
  522. }, {
  523. key: 'getRandomStackTraceIndex',
  524. value: function getRandomStackTraceIndex(stackTraceRootLength) {
  525. return Utils_1.Utils.getRandomInteger(0, Math.max(0, Math.round(stackTraceRootLength - 1)));
  526. }
  527. }, {
  528. key: 'insertNodeAtIndex',
  529. value: function insertNodeAtIndex(blockScopeNode, nodeBodyStatements, index) {
  530. if (!NodeAppender.validateBodyStatements(nodeBodyStatements)) {
  531. nodeBodyStatements = [];
  532. }
  533. nodeBodyStatements = NodeAppender.parentizeBodyStatementsBeforeAppend(blockScopeNode, nodeBodyStatements);
  534. blockScopeNode.body = [].concat(_toConsumableArray(blockScopeNode.body.slice(0, index)), _toConsumableArray(nodeBodyStatements), _toConsumableArray(blockScopeNode.body.slice(index)));
  535. }
  536. }, {
  537. key: 'prependNode',
  538. value: function prependNode(blockScopeNode, nodeBodyStatements) {
  539. if (!NodeAppender.validateBodyStatements(nodeBodyStatements)) {
  540. nodeBodyStatements = [];
  541. }
  542. nodeBodyStatements = NodeAppender.parentizeBodyStatementsBeforeAppend(blockScopeNode, nodeBodyStatements);
  543. blockScopeNode.body = [].concat(_toConsumableArray(nodeBodyStatements), _toConsumableArray(blockScopeNode.body));
  544. }
  545. }, {
  546. key: 'parentizeBodyStatementsBeforeAppend',
  547. value: function parentizeBodyStatementsBeforeAppend(blockScopeNode, nodeBodyStatements) {
  548. var _iteratorNormalCompletion = true;
  549. var _didIteratorError = false;
  550. var _iteratorError = undefined;
  551. try {
  552. for (var _iterator = nodeBodyStatements[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
  553. var statement = _step.value;
  554. statement.parentNode = blockScopeNode;
  555. }
  556. } catch (err) {
  557. _didIteratorError = true;
  558. _iteratorError = err;
  559. } finally {
  560. try {
  561. if (!_iteratorNormalCompletion && _iterator.return) {
  562. _iterator.return();
  563. }
  564. } finally {
  565. if (_didIteratorError) {
  566. throw _iteratorError;
  567. }
  568. }
  569. }
  570. return nodeBodyStatements;
  571. }
  572. }, {
  573. key: 'validateBodyStatements',
  574. value: function validateBodyStatements(nodeBodyStatements) {
  575. return nodeBodyStatements.every(function (statementNode) {
  576. return !!statementNode && statementNode.hasOwnProperty('type');
  577. });
  578. }
  579. }]);
  580. return NodeAppender;
  581. }();
  582. exports.NodeAppender = NodeAppender;
  583. /***/ },
  584. /* 4 */
  585. /***/ function(module, exports) {
  586. module.exports = require("estraverse");
  587. /***/ },
  588. /* 5 */
  589. /***/ function(module, exports, __webpack_require__) {
  590. "use strict";
  591. "use strict";
  592. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  593. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  594. var NodeUtils_1 = __webpack_require__(8);
  595. var AbstractCustomNode = function () {
  596. function AbstractCustomNode(options) {
  597. _classCallCheck(this, AbstractCustomNode);
  598. this.options = options;
  599. }
  600. _createClass(AbstractCustomNode, [{
  601. key: "getAppendState",
  602. value: function getAppendState() {
  603. return this.appendState;
  604. }
  605. }, {
  606. key: "getNode",
  607. value: function getNode() {
  608. return this.getNodeStructure();
  609. }
  610. }, {
  611. key: "setAppendState",
  612. value: function setAppendState(appendState) {
  613. this.appendState = appendState;
  614. }
  615. }, {
  616. key: "getNodeStructure",
  617. value: function getNodeStructure() {
  618. return NodeUtils_1.NodeUtils.convertCodeToStructure(this.getCode());
  619. }
  620. }]);
  621. return AbstractCustomNode;
  622. }();
  623. exports.AbstractCustomNode = AbstractCustomNode;
  624. /***/ },
  625. /* 6 */
  626. /***/ function(module, exports) {
  627. module.exports = require("string-template");
  628. /***/ },
  629. /* 7 */
  630. /***/ function(module, exports, __webpack_require__) {
  631. "use strict";
  632. "use strict";
  633. var Utils_1 = __webpack_require__(0);
  634. exports.NodeType = Utils_1.Utils.strEnumify({
  635. ArrayExpression: 'ArrayExpression',
  636. ArrowFunctionExpression: 'ArrowFunctionExpression',
  637. AssignmentExpression: 'AssignmentExpression',
  638. BinaryExpression: 'BinaryExpression',
  639. BlockStatement: 'BlockStatement',
  640. BreakStatement: 'BreakStatement',
  641. CallExpression: 'CallExpression',
  642. CatchClause: 'CatchClause',
  643. ClassDeclaration: 'ClassDeclaration',
  644. ContinueStatement: 'ContinueStatement',
  645. ExpressionStatement: 'ExpressionStatement',
  646. FunctionDeclaration: 'FunctionDeclaration',
  647. FunctionExpression: 'FunctionExpression',
  648. Identifier: 'Identifier',
  649. IfStatement: 'IfStatement',
  650. LabeledStatement: 'LabeledStatement',
  651. Literal: 'Literal',
  652. LogicalExpression: 'LogicalExpression',
  653. MemberExpression: 'MemberExpression',
  654. MethodDefinition: 'MethodDefinition',
  655. ObjectExpression: 'ObjectExpression',
  656. Program: 'Program',
  657. Property: 'Property',
  658. ReturnStatement: 'ReturnStatement',
  659. TryStatement: 'TryStatement',
  660. UnaryExpression: 'UnaryExpression',
  661. UpdateExpression: 'UpdateExpression',
  662. VariableDeclaration: 'VariableDeclaration',
  663. VariableDeclarator: 'VariableDeclarator',
  664. WhileStatement: 'WhileStatement'
  665. });
  666. /***/ },
  667. /* 8 */
  668. /***/ function(module, exports, __webpack_require__) {
  669. "use strict";
  670. "use strict";
  671. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  672. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  673. var escodegen = __webpack_require__(11);
  674. var esprima = __webpack_require__(25);
  675. var estraverse = __webpack_require__(4);
  676. var NodeType_1 = __webpack_require__(7);
  677. var Node_1 = __webpack_require__(2);
  678. var Utils_1 = __webpack_require__(0);
  679. var NodeUtils = function () {
  680. function NodeUtils() {
  681. _classCallCheck(this, NodeUtils);
  682. }
  683. _createClass(NodeUtils, null, [{
  684. key: 'addXVerbatimPropertyToLiterals',
  685. value: function addXVerbatimPropertyToLiterals(node) {
  686. NodeUtils.typedReplace(node, NodeType_1.NodeType.Literal, {
  687. leave: function leave(node) {
  688. node['x-verbatim-property'] = {
  689. content: node.raw,
  690. precedence: escodegen.Precedence.Primary
  691. };
  692. }
  693. });
  694. }
  695. }, {
  696. key: 'convertCodeToStructure',
  697. value: function convertCodeToStructure(code) {
  698. var structure = esprima.parse(code);
  699. NodeUtils.addXVerbatimPropertyToLiterals(structure);
  700. NodeUtils.parentize(structure);
  701. return structure.body;
  702. }
  703. }, {
  704. key: 'getBlockStatementNodeByIndex',
  705. value: function getBlockStatementNodeByIndex(node) {
  706. var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  707. if (Node_1.Node.isNodeHasBlockStatement(node)) {
  708. if (node.body[index] === undefined) {
  709. throw new ReferenceError('Wrong index `' + index + '`. Block-statement body length is `' + node.body.length + '`');
  710. }
  711. return node.body[index];
  712. }
  713. throw new TypeError('The specified node have no a block-statement');
  714. }
  715. }, {
  716. key: 'getBlockScopeOfNode',
  717. value: function getBlockScopeOfNode(node) {
  718. var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  719. var parentNode = node.parentNode;
  720. if (!parentNode) {
  721. throw new ReferenceError('`parentNode` property of given node is `undefined`');
  722. }
  723. if (Node_1.Node.isBlockStatementNode(parentNode)) {
  724. if (!parentNode.parentNode) {
  725. throw new ReferenceError('`parentNode` property of `parentNode` of given node is `undefined`');
  726. }
  727. if (!Utils_1.Utils.arrayContains(NodeUtils.nodesWithBlockScope, parentNode.parentNode.type)) {
  728. return NodeUtils.getBlockScopeOfNode(parentNode, depth);
  729. } else if (depth > 0) {
  730. return NodeUtils.getBlockScopeOfNode(parentNode, --depth);
  731. }
  732. return parentNode;
  733. }
  734. if (Node_1.Node.isProgramNode(parentNode)) {
  735. return parentNode;
  736. }
  737. return NodeUtils.getBlockScopeOfNode(parentNode);
  738. }
  739. }, {
  740. key: 'getNodeBlockScopeDepth',
  741. value: function getNodeBlockScopeDepth(node) {
  742. var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  743. var parentNode = node.parentNode;
  744. if (!parentNode) {
  745. throw new ReferenceError('`parentNode` property of given node is `undefined`');
  746. }
  747. if (Node_1.Node.isProgramNode(parentNode)) {
  748. return depth;
  749. }
  750. if (Node_1.Node.isBlockStatementNode(node)) {
  751. return NodeUtils.getNodeBlockScopeDepth(parentNode, ++depth);
  752. }
  753. return NodeUtils.getNodeBlockScopeDepth(parentNode, depth);
  754. }
  755. }, {
  756. key: 'parentize',
  757. value: function parentize(node) {
  758. var isRootNode = true;
  759. estraverse.replace(node, {
  760. enter: function enter(node, parentNode) {
  761. var value = void 0;
  762. if (isRootNode) {
  763. if (node.type === NodeType_1.NodeType.Program) {
  764. value = node;
  765. } else {
  766. value = Node_1.Node.getProgramNode([node]);
  767. value.parentNode = value;
  768. }
  769. isRootNode = false;
  770. } else {
  771. value = parentNode || node;
  772. }
  773. node.parentNode = value;
  774. node.obfuscated = false;
  775. }
  776. });
  777. }
  778. }, {
  779. key: 'typedReplace',
  780. value: function typedReplace(node, nodeType, visitor) {
  781. NodeUtils.typedTraverse(node, nodeType, visitor, 'replace');
  782. }
  783. }, {
  784. key: 'typedTraverse',
  785. value: function typedTraverse(node, nodeType, visitor) {
  786. var traverseType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'traverse';
  787. estraverse[traverseType](node, {
  788. enter: function enter(node, parentNode) {
  789. if (node.type === nodeType && visitor.enter) {
  790. visitor.enter(node, parentNode);
  791. }
  792. },
  793. leave: function leave(node, parentNode) {
  794. if (node.type === nodeType && visitor.leave) {
  795. visitor.leave(node, parentNode);
  796. }
  797. }
  798. });
  799. }
  800. }]);
  801. return NodeUtils;
  802. }();
  803. NodeUtils.nodesWithBlockScope = [NodeType_1.NodeType.ArrowFunctionExpression, NodeType_1.NodeType.FunctionDeclaration, NodeType_1.NodeType.FunctionExpression, NodeType_1.NodeType.MethodDefinition, NodeType_1.NodeType.Program];
  804. exports.NodeUtils = NodeUtils;
  805. /***/ },
  806. /* 9 */
  807. /***/ function(module, exports) {
  808. "use strict";
  809. "use strict";
  810. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  811. var AbstractNodeTransformer = function AbstractNodeTransformer(nodes, options) {
  812. _classCallCheck(this, AbstractNodeTransformer);
  813. this.nodes = nodes;
  814. this.options = options;
  815. };
  816. exports.AbstractNodeTransformer = AbstractNodeTransformer;
  817. /***/ },
  818. /* 10 */
  819. /***/ function(module, exports, __webpack_require__) {
  820. "use strict";
  821. "use strict";
  822. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  823. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  824. var JavaScriptObfuscatorCLI_1 = __webpack_require__(32);
  825. var JavaScriptObfuscatorInternal_1 = __webpack_require__(28);
  826. var JavaScriptObfuscator = function () {
  827. function JavaScriptObfuscator() {
  828. _classCallCheck(this, JavaScriptObfuscator);
  829. }
  830. _createClass(JavaScriptObfuscator, null, [{
  831. key: 'obfuscate',
  832. value: function obfuscate(sourceCode) {
  833. var obfuscatorOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  834. var javaScriptObfuscator = new JavaScriptObfuscatorInternal_1.JavaScriptObfuscatorInternal(sourceCode, obfuscatorOptions);
  835. javaScriptObfuscator.obfuscate();
  836. return javaScriptObfuscator.getObfuscationResult();
  837. }
  838. }, {
  839. key: 'runCLI',
  840. value: function runCLI(argv) {
  841. new JavaScriptObfuscatorCLI_1.JavaScriptObfuscatorCLI(argv).run();
  842. }
  843. }]);
  844. return JavaScriptObfuscator;
  845. }();
  846. exports.JavaScriptObfuscator = JavaScriptObfuscator;
  847. /***/ },
  848. /* 11 */
  849. /***/ function(module, exports) {
  850. module.exports = require("escodegen");
  851. /***/ },
  852. /* 12 */
  853. /***/ function(module, exports, __webpack_require__) {
  854. "use strict";
  855. "use strict";
  856. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  857. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  858. var AppendState_1 = __webpack_require__(1);
  859. var AbstractNodesGroup = function () {
  860. function AbstractNodesGroup(stackTraceData, options) {
  861. _classCallCheck(this, AbstractNodesGroup);
  862. this.appendState = AppendState_1.AppendState.BeforeObfuscation;
  863. this.stackTraceData = stackTraceData;
  864. this.options = options;
  865. }
  866. _createClass(AbstractNodesGroup, [{
  867. key: "syncCustomNodesWithNodesGroup",
  868. value: function syncCustomNodesWithNodesGroup(customNodes) {
  869. var _this = this;
  870. customNodes.forEach(function (node) {
  871. node.setAppendState(_this.appendState);
  872. });
  873. return customNodes;
  874. }
  875. }]);
  876. return AbstractNodesGroup;
  877. }();
  878. exports.AbstractNodesGroup = AbstractNodesGroup;
  879. /***/ },
  880. /* 13 */
  881. /***/ function(module, exports, __webpack_require__) {
  882. "use strict";
  883. "use strict";
  884. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  885. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  886. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  887. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  888. var AbstractReplacer_1 = __webpack_require__(15);
  889. var Utils_1 = __webpack_require__(0);
  890. var IdentifierReplacer = function (_AbstractReplacer_1$A) {
  891. _inherits(IdentifierReplacer, _AbstractReplacer_1$A);
  892. function IdentifierReplacer() {
  893. _classCallCheck(this, IdentifierReplacer);
  894. var _this = _possibleConstructorReturn(this, (IdentifierReplacer.__proto__ || Object.getPrototypeOf(IdentifierReplacer)).apply(this, arguments));
  895. _this.namesMap = new Map();
  896. return _this;
  897. }
  898. _createClass(IdentifierReplacer, [{
  899. key: 'replace',
  900. value: function replace(nodeValue) {
  901. var obfuscatedIdentifierName = this.namesMap.get(nodeValue);
  902. if (!obfuscatedIdentifierName) {
  903. return nodeValue;
  904. }
  905. return obfuscatedIdentifierName;
  906. }
  907. }, {
  908. key: 'storeNames',
  909. value: function storeNames(nodeName) {
  910. if (!this.isReservedName(nodeName)) {
  911. this.namesMap.set(nodeName, Utils_1.Utils.getRandomVariableName());
  912. }
  913. }
  914. }, {
  915. key: 'isReservedName',
  916. value: function isReservedName(name) {
  917. return this.options.reservedNames.some(function (reservedName) {
  918. return new RegExp(reservedName, 'g').test(name);
  919. });
  920. }
  921. }]);
  922. return IdentifierReplacer;
  923. }(AbstractReplacer_1.AbstractReplacer);
  924. exports.IdentifierReplacer = IdentifierReplacer;
  925. /***/ },
  926. /* 14 */
  927. /***/ function(module, exports) {
  928. "use strict";
  929. "use strict";
  930. exports.SourceMapMode = {
  931. Inline: 'inline',
  932. Separate: 'separate'
  933. };
  934. /***/ },
  935. /* 15 */
  936. /***/ function(module, exports) {
  937. "use strict";
  938. "use strict";
  939. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  940. var AbstractReplacer = function AbstractReplacer(nodes, options) {
  941. _classCallCheck(this, AbstractReplacer);
  942. this.nodes = nodes;
  943. this.options = options;
  944. };
  945. exports.AbstractReplacer = AbstractReplacer;
  946. /***/ },
  947. /* 16 */
  948. /***/ function(module, exports, __webpack_require__) {
  949. "use strict";
  950. "use strict";
  951. var SourceMapMode_1 = __webpack_require__(14);
  952. exports.NO_CUSTOM_NODES_PRESET = Object.freeze({
  953. compact: true,
  954. controlFlowFlattening: false,
  955. debugProtection: false,
  956. debugProtectionInterval: false,
  957. disableConsoleOutput: false,
  958. domainLock: [],
  959. reservedNames: [],
  960. rotateStringArray: false,
  961. seed: 0,
  962. selfDefending: false,
  963. sourceMap: false,
  964. sourceMapBaseUrl: '',
  965. sourceMapFileName: '',
  966. sourceMapMode: SourceMapMode_1.SourceMapMode.Separate,
  967. stringArray: false,
  968. stringArrayEncoding: false,
  969. stringArrayThreshold: 0,
  970. unicodeEscapeSequence: true
  971. });
  972. /***/ },
  973. /* 17 */
  974. /***/ function(module, exports, __webpack_require__) {
  975. "use strict";
  976. "use strict";
  977. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  978. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  979. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  980. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  981. var format = __webpack_require__(6);
  982. var AppendState_1 = __webpack_require__(1);
  983. var SingleNodeCallControllerTemplate_1 = __webpack_require__(77);
  984. var NoCustomNodesPreset_1 = __webpack_require__(16);
  985. var AbstractCustomNode_1 = __webpack_require__(5);
  986. var JavaScriptObfuscator_1 = __webpack_require__(10);
  987. var NodeAppender_1 = __webpack_require__(3);
  988. var NodeCallsControllerFunctionNode = function (_AbstractCustomNode_) {
  989. _inherits(NodeCallsControllerFunctionNode, _AbstractCustomNode_);
  990. function NodeCallsControllerFunctionNode(stackTraceData, callsControllerFunctionName, randomStackTraceIndex, options) {
  991. _classCallCheck(this, NodeCallsControllerFunctionNode);
  992. var _this = _possibleConstructorReturn(this, (NodeCallsControllerFunctionNode.__proto__ || Object.getPrototypeOf(NodeCallsControllerFunctionNode)).call(this, options));
  993. _this.appendState = AppendState_1.AppendState.BeforeObfuscation;
  994. _this.stackTraceData = stackTraceData;
  995. _this.callsControllerFunctionName = callsControllerFunctionName;
  996. _this.randomStackTraceIndex = randomStackTraceIndex;
  997. return _this;
  998. }
  999. _createClass(NodeCallsControllerFunctionNode, [{
  1000. key: 'appendNode',
  1001. value: function appendNode(blockScopeNode) {
  1002. var targetBlockScope = void 0;
  1003. if (this.stackTraceData.length) {
  1004. targetBlockScope = NodeAppender_1.NodeAppender.getOptimalBlockScope(this.stackTraceData, this.randomStackTraceIndex, 1);
  1005. } else {
  1006. targetBlockScope = blockScopeNode;
  1007. }
  1008. NodeAppender_1.NodeAppender.prependNode(targetBlockScope, this.getNode());
  1009. }
  1010. }, {
  1011. key: 'getCode',
  1012. value: function getCode() {
  1013. if (this.appendState === AppendState_1.AppendState.AfterObfuscation) {
  1014. return JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(format(SingleNodeCallControllerTemplate_1.SingleNodeCallControllerTemplate(), {
  1015. singleNodeCallControllerFunctionName: this.callsControllerFunctionName
  1016. }), Object.assign({}, NoCustomNodesPreset_1.NO_CUSTOM_NODES_PRESET, {
  1017. seed: this.options.seed
  1018. })).getObfuscatedCode();
  1019. }
  1020. return format(SingleNodeCallControllerTemplate_1.SingleNodeCallControllerTemplate(), {
  1021. singleNodeCallControllerFunctionName: this.callsControllerFunctionName
  1022. });
  1023. }
  1024. }]);
  1025. return NodeCallsControllerFunctionNode;
  1026. }(AbstractCustomNode_1.AbstractCustomNode);
  1027. exports.NodeCallsControllerFunctionNode = NodeCallsControllerFunctionNode;
  1028. /***/ },
  1029. /* 18 */
  1030. /***/ function(module, exports) {
  1031. "use strict";
  1032. "use strict";
  1033. exports.StringArrayEncoding = {
  1034. base64: 'base64',
  1035. rc4: 'rc4'
  1036. };
  1037. /***/ },
  1038. /* 19 */
  1039. /***/ function(module, exports, __webpack_require__) {
  1040. "use strict";
  1041. "use strict";
  1042. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  1043. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1044. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1045. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  1046. var StringArrayEncoding_1 = __webpack_require__(18);
  1047. var AbstractReplacer_1 = __webpack_require__(15);
  1048. var NumberLiteralReplacer_1 = __webpack_require__(22);
  1049. var Utils_1 = __webpack_require__(0);
  1050. var StringLiteralReplacer = function (_AbstractReplacer_1$A) {
  1051. _inherits(StringLiteralReplacer, _AbstractReplacer_1$A);
  1052. function StringLiteralReplacer() {
  1053. _classCallCheck(this, StringLiteralReplacer);
  1054. return _possibleConstructorReturn(this, (StringLiteralReplacer.__proto__ || Object.getPrototypeOf(StringLiteralReplacer)).apply(this, arguments));
  1055. }
  1056. _createClass(StringLiteralReplacer, [{
  1057. key: 'replace',
  1058. value: function replace(nodeValue) {
  1059. var replaceWithStringArrayFlag = nodeValue.length >= StringLiteralReplacer.minimumLengthForStringArray && Utils_1.Utils.getRandomFloat(0, 1) <= this.options.stringArrayThreshold;
  1060. if (this.options.stringArray && replaceWithStringArrayFlag) {
  1061. return this.replaceStringLiteralWithStringArrayCall(nodeValue);
  1062. }
  1063. return '\'' + Utils_1.Utils.stringToUnicodeEscapeSequence(nodeValue) + '\'';
  1064. }
  1065. }, {
  1066. key: 'replaceStringLiteralWithStringArrayCall',
  1067. value: function replaceStringLiteralWithStringArrayCall(value) {
  1068. var stringArrayNode = this.nodes.get('stringArrayNode');
  1069. if (!stringArrayNode) {
  1070. throw new ReferenceError('`stringArrayNode` node is not found in Map with custom nodes.');
  1071. }
  1072. var rc4Key = '';
  1073. switch (this.options.stringArrayEncoding) {
  1074. case StringArrayEncoding_1.StringArrayEncoding.base64:
  1075. value = Utils_1.Utils.btoa(value);
  1076. break;
  1077. case StringArrayEncoding_1.StringArrayEncoding.rc4:
  1078. rc4Key = Utils_1.Utils.getRandomGenerator().pickone(StringLiteralReplacer.rc4Keys);
  1079. value = Utils_1.Utils.btoa(Utils_1.Utils.rc4(value, rc4Key));
  1080. break;
  1081. }
  1082. if (this.options.unicodeEscapeSequence) {
  1083. value = Utils_1.Utils.stringToUnicodeEscapeSequence(value);
  1084. }
  1085. var stringArray = stringArrayNode.getNodeData(),
  1086. indexOfExistingValue = stringArray.getKeyOf(value),
  1087. indexOfValue = void 0,
  1088. hexadecimalIndex = void 0;
  1089. if (indexOfExistingValue >= 0) {
  1090. indexOfValue = indexOfExistingValue;
  1091. } else {
  1092. indexOfValue = stringArray.getLength();
  1093. stringArray.set(null, value);
  1094. }
  1095. hexadecimalIndex = new NumberLiteralReplacer_1.NumberLiteralReplacer(this.nodes, this.options).replace(indexOfValue);
  1096. var stringArrayCallsWrapper = this.nodes.get('stringArrayCallsWrapper');
  1097. if (!stringArrayCallsWrapper) {
  1098. throw new ReferenceError('`stringArrayCallsWrapper` node is not found in Map with custom node.');
  1099. }
  1100. if (this.options.stringArrayEncoding === StringArrayEncoding_1.StringArrayEncoding.rc4) {
  1101. return stringArrayCallsWrapper.getNodeIdentifier() + '(\'' + hexadecimalIndex + '\', \'' + Utils_1.Utils.stringToUnicodeEscapeSequence(rc4Key) + '\')';
  1102. }
  1103. return stringArrayCallsWrapper.getNodeIdentifier() + '(\'' + hexadecimalIndex + '\')';
  1104. }
  1105. }]);
  1106. return StringLiteralReplacer;
  1107. }(AbstractReplacer_1.AbstractReplacer);
  1108. StringLiteralReplacer.minimumLengthForStringArray = 3;
  1109. StringLiteralReplacer.rc4Keys = Utils_1.Utils.getRandomGenerator().n(function () {
  1110. return Utils_1.Utils.getRandomGenerator().string({ length: 4 });
  1111. }, 50);
  1112. exports.StringLiteralReplacer = StringLiteralReplacer;
  1113. /***/ },
  1114. /* 20 */
  1115. /***/ function(module, exports) {
  1116. "use strict";
  1117. "use strict";
  1118. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  1119. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1120. var ObfuscationResult = function () {
  1121. function ObfuscationResult(obfuscatedCode, sourceMap) {
  1122. _classCallCheck(this, ObfuscationResult);
  1123. this.obfuscatedCode = obfuscatedCode;
  1124. this.sourceMap = sourceMap;
  1125. }
  1126. _createClass(ObfuscationResult, [{
  1127. key: "getObfuscatedCode",
  1128. value: function getObfuscatedCode() {
  1129. return this.obfuscatedCode;
  1130. }
  1131. }, {
  1132. key: "getSourceMap",
  1133. value: function getSourceMap() {
  1134. return this.sourceMap;
  1135. }
  1136. }, {
  1137. key: "toString",
  1138. value: function toString() {
  1139. return this.obfuscatedCode;
  1140. }
  1141. }]);
  1142. return ObfuscationResult;
  1143. }();
  1144. exports.ObfuscationResult = ObfuscationResult;
  1145. /***/ },
  1146. /* 21 */
  1147. /***/ function(module, exports) {
  1148. "use strict";
  1149. "use strict";
  1150. exports.JSFuck = {
  1151. False: '![]',
  1152. True: '!![]',
  1153. a: '(false+"")[1]',
  1154. b: '([]["entries"]()+"")[2]',
  1155. c: '([]["fill"]+"")[3]',
  1156. d: '(undefined+"")[2]',
  1157. e: '(true+"")[3]',
  1158. f: '(false+"")[0]',
  1159. g: '(false+[0]+String)[20]',
  1160. h: '(+(101))["toString"](21)[1]',
  1161. i: '([false]+undefined)[10]',
  1162. j: '([]["entries"]()+"")[3]',
  1163. k: '(+(20))["toString"](21)',
  1164. l: '(false+"")[2]',
  1165. m: '(Number+"")[11]',
  1166. n: '(undefined+"")[1]',
  1167. o: '(true+[]["fill"])[10]',
  1168. p: '(+(211))["toString"](31)[1]',
  1169. q: '(+(212))["toString"](31)[1]',
  1170. r: '(true+"")[1]',
  1171. s: '(false+"")[3]',
  1172. t: '(true+"")[0]',
  1173. u: '(undefined+"")[0]',
  1174. v: '(+(31))["toString"](32)',
  1175. w: '(+(32))["toString"](33)',
  1176. x: '(+(101))["toString"](34)[1]',
  1177. y: '(NaN+[Infinity])[10]',
  1178. z: '(+(35))["toString"](36)',
  1179. A: '(+[]+Array)[10]',
  1180. B: '(+[]+Boolean)[10]',
  1181. C: 'Function("return escape")()(("")["italics"]())[2]',
  1182. D: 'Function("return escape")()([]["fill"])["slice"]("-1")',
  1183. E: '(RegExp+"")[12]',
  1184. F: '(+[]+Function)[10]',
  1185. G: '(false+Function("return Date")()())[30]',
  1186. H: '\'H\'',
  1187. I: '(Infinity+"")[0]',
  1188. J: '\'J\'',
  1189. K: '\'K\'',
  1190. L: '\'L\'',
  1191. M: '(true+Function("return Date")()())[30]',
  1192. N: '(NaN+"")[0]',
  1193. O: '(NaN+Function("return{}")())[11]',
  1194. P: '\'P\'',
  1195. Q: '\'Q\'',
  1196. R: '(+[]+RegExp)[10]',
  1197. S: '(+[]+String)[10]',
  1198. T: '(NaN+Function("return Date")()())[30]',
  1199. U: '(NaN+Function("return{}")()["toString"]["call"]())[11]',
  1200. V: '\'V\'',
  1201. W: '\'W\'',
  1202. X: '\'X\'',
  1203. Y: '\'Y\'',
  1204. Z: '\'Z\''
  1205. };
  1206. /***/ },
  1207. /* 22 */
  1208. /***/ function(module, exports, __webpack_require__) {
  1209. "use strict";
  1210. "use strict";
  1211. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  1212. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1213. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1214. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  1215. var AbstractReplacer_1 = __webpack_require__(15);
  1216. var Utils_1 = __webpack_require__(0);
  1217. var NumberLiteralReplacer = function (_AbstractReplacer_1$A) {
  1218. _inherits(NumberLiteralReplacer, _AbstractReplacer_1$A);
  1219. function NumberLiteralReplacer() {
  1220. _classCallCheck(this, NumberLiteralReplacer);
  1221. return _possibleConstructorReturn(this, (NumberLiteralReplacer.__proto__ || Object.getPrototypeOf(NumberLiteralReplacer)).apply(this, arguments));
  1222. }
  1223. _createClass(NumberLiteralReplacer, [{
  1224. key: 'replace',
  1225. value: function replace(nodeValue) {
  1226. var prefix = '0x';
  1227. if (!Utils_1.Utils.isInteger(nodeValue)) {
  1228. return String(nodeValue);
  1229. }
  1230. return '' + prefix + Utils_1.Utils.decToHex(nodeValue);
  1231. }
  1232. }]);
  1233. return NumberLiteralReplacer;
  1234. }(AbstractReplacer_1.AbstractReplacer);
  1235. exports.NumberLiteralReplacer = NumberLiteralReplacer;
  1236. /***/ },
  1237. /* 23 */
  1238. /***/ function(module, exports, __webpack_require__) {
  1239. "use strict";
  1240. "use strict";
  1241. var SourceMapMode_1 = __webpack_require__(14);
  1242. exports.DEFAULT_PRESET = Object.freeze({
  1243. compact: true,
  1244. controlFlowFlattening: false,
  1245. debugProtection: false,
  1246. debugProtectionInterval: false,
  1247. disableConsoleOutput: true,
  1248. domainLock: [],
  1249. reservedNames: [],
  1250. rotateStringArray: true,
  1251. seed: 0,
  1252. selfDefending: true,
  1253. sourceMap: false,
  1254. sourceMapBaseUrl: '',
  1255. sourceMapFileName: '',
  1256. sourceMapMode: SourceMapMode_1.SourceMapMode.Separate,
  1257. stringArray: true,
  1258. stringArrayEncoding: false,
  1259. stringArrayThreshold: 0.8,
  1260. unicodeEscapeSequence: true
  1261. });
  1262. /***/ },
  1263. /* 24 */
  1264. /***/ function(module, exports) {
  1265. module.exports = require("chance");
  1266. /***/ },
  1267. /* 25 */
  1268. /***/ function(module, exports) {
  1269. module.exports = require("esprima");
  1270. /***/ },
  1271. /* 26 */
  1272. /***/ function(module, exports) {
  1273. module.exports = require("path");
  1274. /***/ },
  1275. /* 27 */
  1276. /***/ function(module, exports) {
  1277. module.exports = require("babel-polyfill");
  1278. /***/ },
  1279. /* 28 */
  1280. /***/ function(module, exports, __webpack_require__) {
  1281. "use strict";
  1282. "use strict";
  1283. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  1284. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1285. var esprima = __webpack_require__(25);
  1286. var escodegen = __webpack_require__(11);
  1287. var chance_1 = __webpack_require__(24);
  1288. var ObfuscationResult_1 = __webpack_require__(20);
  1289. var Obfuscator_1 = __webpack_require__(29);
  1290. var Options_1 = __webpack_require__(63);
  1291. var SourceMapCorrector_1 = __webpack_require__(30);
  1292. var Utils_1 = __webpack_require__(0);
  1293. var JavaScriptObfuscatorInternal = function () {
  1294. function JavaScriptObfuscatorInternal(sourceCode) {
  1295. var obfuscatorOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  1296. _classCallCheck(this, JavaScriptObfuscatorInternal);
  1297. this.sourceCode = sourceCode;
  1298. this.options = new Options_1.Options(obfuscatorOptions);
  1299. }
  1300. _createClass(JavaScriptObfuscatorInternal, [{
  1301. key: 'getObfuscationResult',
  1302. value: function getObfuscationResult() {
  1303. return new SourceMapCorrector_1.SourceMapCorrector(new ObfuscationResult_1.ObfuscationResult(this.generatorOutput.code, this.generatorOutput.map), this.options.sourceMapBaseUrl + this.options.sourceMapFileName, this.options.sourceMapMode).correct();
  1304. }
  1305. }, {
  1306. key: 'obfuscate',
  1307. value: function obfuscate() {
  1308. var astTree = esprima.parse(this.sourceCode, {
  1309. loc: true
  1310. });
  1311. if (this.options.seed !== 0) {
  1312. Utils_1.Utils.setRandomGenerator(new chance_1.Chance(this.options.seed));
  1313. }
  1314. astTree = new Obfuscator_1.Obfuscator(this.options).obfuscateNode(astTree);
  1315. this.generatorOutput = JavaScriptObfuscatorInternal.generateCode(this.sourceCode, astTree, this.options);
  1316. }
  1317. }], [{
  1318. key: 'generateCode',
  1319. value: function generateCode(sourceCode, astTree, options) {
  1320. var escodegenParams = Object.assign({}, JavaScriptObfuscatorInternal.escodegenParams);
  1321. if (options.sourceMap) {
  1322. escodegenParams.sourceMap = 'sourceMap';
  1323. escodegenParams.sourceContent = sourceCode;
  1324. }
  1325. escodegenParams.format = {
  1326. compact: options.compact
  1327. };
  1328. var generatorOutput = escodegen.generate(astTree, escodegenParams);
  1329. generatorOutput.map = generatorOutput.map ? generatorOutput.map.toString() : '';
  1330. return generatorOutput;
  1331. }
  1332. }]);
  1333. return JavaScriptObfuscatorInternal;
  1334. }();
  1335. JavaScriptObfuscatorInternal.escodegenParams = {
  1336. verbatim: 'x-verbatim-property',
  1337. sourceMapWithCode: true
  1338. };
  1339. exports.JavaScriptObfuscatorInternal = JavaScriptObfuscatorInternal;
  1340. /***/ },
  1341. /* 29 */
  1342. /***/ function(module, exports, __webpack_require__) {
  1343. "use strict";
  1344. "use strict";
  1345. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  1346. function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
  1347. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1348. var estraverse = __webpack_require__(4);
  1349. var AppendState_1 = __webpack_require__(1);
  1350. var NodeType_1 = __webpack_require__(7);
  1351. var CatchClauseObfuscator_1 = __webpack_require__(53);
  1352. var ConsoleOutputNodesGroup_1 = __webpack_require__(45);
  1353. var DebugProtectionNodesGroup_1 = __webpack_require__(46);
  1354. var DomainLockNodesGroup_1 = __webpack_require__(47);
  1355. var FunctionDeclarationObfuscator_1 = __webpack_require__(54);
  1356. var FunctionObfuscator_1 = __webpack_require__(55);
  1357. var LabeledStatementObfuscator_1 = __webpack_require__(56);
  1358. var LiteralObfuscator_1 = __webpack_require__(57);
  1359. var MemberExpressionObfuscator_1 = __webpack_require__(58);
  1360. var MethodDefinitionObfuscator_1 = __webpack_require__(59);
  1361. var Node_1 = __webpack_require__(2);
  1362. var NodeUtils_1 = __webpack_require__(8);
  1363. var ObjectExpressionObfuscator_1 = __webpack_require__(60);
  1364. var SelfDefendingNodesGroup_1 = __webpack_require__(48);
  1365. var StackTraceAnalyzer_1 = __webpack_require__(66);
  1366. var StringArrayNodesGroup_1 = __webpack_require__(49);
  1367. var VariableDeclarationObfuscator_1 = __webpack_require__(61);
  1368. var FunctionControlFlowTransformer_1 = __webpack_require__(50);
  1369. var Obfuscator = function () {
  1370. function Obfuscator(options) {
  1371. _classCallCheck(this, Obfuscator);
  1372. this.customNodes = new Map();
  1373. this.options = options;
  1374. }
  1375. _createClass(Obfuscator, [{
  1376. key: 'obfuscateNode',
  1377. value: function obfuscateNode(node) {
  1378. if (Node_1.Node.isProgramNode(node) && !node.body.length) {
  1379. return node;
  1380. }
  1381. NodeUtils_1.NodeUtils.parentize(node);
  1382. var stackTraceData = new StackTraceAnalyzer_1.StackTraceAnalyzer(node.body).analyze();
  1383. this.initializeCustomNodes(stackTraceData);
  1384. this.beforeObfuscation(node);
  1385. this.obfuscate(node);
  1386. this.afterObfuscation(node);
  1387. return node;
  1388. }
  1389. }, {
  1390. key: 'afterObfuscation',
  1391. value: function afterObfuscation(astTree) {
  1392. this.customNodes.forEach(function (node) {
  1393. if (node.getAppendState() === AppendState_1.AppendState.AfterObfuscation) {
  1394. node.appendNode(astTree);
  1395. }
  1396. });
  1397. }
  1398. }, {
  1399. key: 'beforeObfuscation',
  1400. value: function beforeObfuscation(astTree) {
  1401. this.customNodes.forEach(function (node) {
  1402. if (node.getAppendState() === AppendState_1.AppendState.BeforeObfuscation) {
  1403. node.appendNode(astTree);
  1404. }
  1405. });
  1406. }
  1407. }, {
  1408. key: 'initializeCustomNodes',
  1409. value: function initializeCustomNodes(stackTraceData) {
  1410. var _this = this;
  1411. var customNodes = [];
  1412. Obfuscator.nodeGroups.forEach(function (nodeGroupConstructor) {
  1413. var nodeGroupNodes = new nodeGroupConstructor(stackTraceData, _this.options).getNodes();
  1414. if (!nodeGroupNodes) {
  1415. return;
  1416. }
  1417. customNodes.push.apply(customNodes, _toConsumableArray(nodeGroupNodes));
  1418. });
  1419. this.customNodes = new Map(customNodes);
  1420. }
  1421. }, {
  1422. key: 'initializeNodeControlFlowChangers',
  1423. value: function initializeNodeControlFlowChangers(node, parentNode) {
  1424. this.initializeNodeTransformers(node, parentNode, Obfuscator.nodeControlFlowChangers);
  1425. }
  1426. }, {
  1427. key: 'initializeNodeObfuscators',
  1428. value: function initializeNodeObfuscators(node, parentNode) {
  1429. this.initializeNodeTransformers(node, parentNode, Obfuscator.nodeObfuscators);
  1430. }
  1431. }, {
  1432. key: 'initializeNodeTransformers',
  1433. value: function initializeNodeTransformers(node, parentNode, nodeTransformersMap) {
  1434. var _this2 = this;
  1435. var nodeTransformers = nodeTransformersMap.get(node.type);
  1436. if (!nodeTransformers) {
  1437. return;
  1438. }
  1439. nodeTransformers.forEach(function (transformer) {
  1440. new transformer(_this2.customNodes, _this2.options).transformNode(node, parentNode);
  1441. });
  1442. }
  1443. }, {
  1444. key: 'obfuscate',
  1445. value: function obfuscate(node) {
  1446. var _this3 = this;
  1447. if (this.options.controlFlowFlattening) {
  1448. estraverse.traverse(node, {
  1449. leave: function leave(node, parentNode) {
  1450. _this3.initializeNodeControlFlowChangers(node, parentNode);
  1451. }
  1452. });
  1453. }
  1454. estraverse.traverse(node, {
  1455. enter: function enter(node, parentNode) {
  1456. _this3.initializeNodeObfuscators(node, parentNode);
  1457. }
  1458. });
  1459. }
  1460. }]);
  1461. return Obfuscator;
  1462. }();
  1463. Obfuscator.nodeControlFlowChangers = new Map([[NodeType_1.NodeType.FunctionDeclaration, [FunctionControlFlowTransformer_1.FunctionControlFlowTransformer]], [NodeType_1.NodeType.FunctionExpression, [FunctionControlFlowTransformer_1.FunctionControlFlowTransformer]]]);
  1464. Obfuscator.nodeGroups = [DomainLockNodesGroup_1.DomainLockNodesGroup, SelfDefendingNodesGroup_1.SelfDefendingNodesGroup, ConsoleOutputNodesGroup_1.ConsoleOutputNodesGroup, DebugProtectionNodesGroup_1.DebugProtectionNodesGroup, StringArrayNodesGroup_1.StringArrayNodesGroup];
  1465. Obfuscator.nodeObfuscators = new Map([[NodeType_1.NodeType.ArrowFunctionExpression, [FunctionObfuscator_1.FunctionObfuscator]], [NodeType_1.NodeType.ClassDeclaration, [FunctionDeclarationObfuscator_1.FunctionDeclarationObfuscator]], [NodeType_1.NodeType.CatchClause, [CatchClauseObfuscator_1.CatchClauseObfuscator]], [NodeType_1.NodeType.FunctionDeclaration, [FunctionDeclarationObfuscator_1.FunctionDeclarationObfuscator, FunctionObfuscator_1.FunctionObfuscator]], [NodeType_1.NodeType.FunctionExpression, [FunctionObfuscator_1.FunctionObfuscator]], [NodeType_1.NodeType.MemberExpression, [MemberExpressionObfuscator_1.MemberExpressionObfuscator]], [NodeType_1.NodeType.MethodDefinition, [MethodDefinitionObfuscator_1.MethodDefinitionObfuscator]], [NodeType_1.NodeType.ObjectExpression, [ObjectExpressionObfuscator_1.ObjectExpressionObfuscator]], [NodeType_1.NodeType.VariableDeclaration, [VariableDeclarationObfuscator_1.VariableDeclarationObfuscator]], [NodeType_1.NodeType.LabeledStatement, [LabeledStatementObfuscator_1.LabeledStatementObfuscator]], [NodeType_1.NodeType.Literal, [LiteralObfuscator_1.LiteralObfuscator]]]);
  1466. exports.Obfuscator = Obfuscator;
  1467. /***/ },
  1468. /* 30 */
  1469. /***/ function(module, exports, __webpack_require__) {
  1470. "use strict";
  1471. "use strict";
  1472. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  1473. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1474. var SourceMapMode_1 = __webpack_require__(14);
  1475. var ObfuscationResult_1 = __webpack_require__(20);
  1476. var Utils_1 = __webpack_require__(0);
  1477. var SourceMapCorrector = function () {
  1478. function SourceMapCorrector(obfuscationResult, sourceMapUrl, sourceMapMode) {
  1479. _classCallCheck(this, SourceMapCorrector);
  1480. this.obfuscatedCode = obfuscationResult.getObfuscatedCode();
  1481. this.sourceMap = obfuscationResult.getSourceMap();
  1482. this.sourceMapUrl = sourceMapUrl;
  1483. this.sourceMapMode = sourceMapMode;
  1484. }
  1485. _createClass(SourceMapCorrector, [{
  1486. key: 'correct',
  1487. value: function correct() {
  1488. return new ObfuscationResult_1.ObfuscationResult(this.correctObfuscatedCode(), this.sourceMap);
  1489. }
  1490. }, {
  1491. key: 'correctObfuscatedCode',
  1492. value: function correctObfuscatedCode() {
  1493. if (!this.sourceMap) {
  1494. return this.obfuscatedCode;
  1495. }
  1496. var sourceMappingUrl = '//# sourceMappingURL=';
  1497. switch (this.sourceMapMode) {
  1498. case SourceMapMode_1.SourceMapMode.Inline:
  1499. sourceMappingUrl += 'data:application/json;base64,' + Utils_1.Utils.btoa(this.sourceMap);
  1500. break;
  1501. case SourceMapMode_1.SourceMapMode.Separate:
  1502. default:
  1503. if (!this.sourceMapUrl) {
  1504. return this.obfuscatedCode;
  1505. }
  1506. sourceMappingUrl += this.sourceMapUrl;
  1507. break;
  1508. }
  1509. return this.obfuscatedCode + '\n' + sourceMappingUrl;
  1510. }
  1511. }]);
  1512. return SourceMapCorrector;
  1513. }();
  1514. exports.SourceMapCorrector = SourceMapCorrector;
  1515. /***/ },
  1516. /* 31 */
  1517. /***/ function(module, exports, __webpack_require__) {
  1518. "use strict";
  1519. "use strict";
  1520. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  1521. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1522. var fs = __webpack_require__(98);
  1523. var mkdirp = __webpack_require__(100);
  1524. var path = __webpack_require__(26);
  1525. var Utils_1 = __webpack_require__(0);
  1526. var CLIUtils = function () {
  1527. function CLIUtils() {
  1528. _classCallCheck(this, CLIUtils);
  1529. }
  1530. _createClass(CLIUtils, null, [{
  1531. key: 'getOutputCodePath',
  1532. value: function getOutputCodePath(outputPath, inputPath) {
  1533. if (outputPath) {
  1534. return outputPath;
  1535. }
  1536. return inputPath.split('.').map(function (value, index) {
  1537. return index === 0 ? value + '-obfuscated' : value;
  1538. }).join('.');
  1539. }
  1540. }, {
  1541. key: 'getOutputSourceMapPath',
  1542. value: function getOutputSourceMapPath(outputCodePath) {
  1543. var sourceMapFileName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  1544. if (sourceMapFileName) {
  1545. outputCodePath = outputCodePath.substr(0, outputCodePath.lastIndexOf('/')) + '/' + sourceMapFileName;
  1546. }
  1547. if (!/\.js\.map$/.test(outputCodePath)) {
  1548. outputCodePath = outputCodePath.split('.')[0] + '.js.map';
  1549. } else if (/\.js$/.test(outputCodePath)) {
  1550. outputCodePath += '.map';
  1551. }
  1552. return outputCodePath;
  1553. }
  1554. }, {
  1555. key: 'getPackageConfig',
  1556. value: function getPackageConfig() {
  1557. return JSON.parse(fs.readFileSync(path.join(path.dirname(fs.realpathSync(process.argv[1])), '../package.json'), CLIUtils.encoding));
  1558. }
  1559. }, {
  1560. key: 'isFilePath',
  1561. value: function isFilePath(filePath) {
  1562. try {
  1563. return fs.statSync(filePath).isFile();
  1564. } catch (e) {
  1565. return false;
  1566. }
  1567. }
  1568. }, {
  1569. key: 'readFile',
  1570. value: function readFile(inputPath) {
  1571. return fs.readFileSync(inputPath, CLIUtils.encoding);
  1572. }
  1573. }, {
  1574. key: 'validateInputPath',
  1575. value: function validateInputPath(inputPath) {
  1576. if (!CLIUtils.isFilePath(inputPath)) {
  1577. throw new ReferenceError('Given input path must be a valid file path');
  1578. }
  1579. if (!Utils_1.Utils.arrayContains(CLIUtils.availableInputExtensions, path.extname(inputPath))) {
  1580. throw new ReferenceError('Input file must have .js extension');
  1581. }
  1582. }
  1583. }, {
  1584. key: 'writeFile',
  1585. value: function writeFile(outputPath, data) {
  1586. mkdirp.sync(path.dirname(outputPath));
  1587. fs.writeFileSync(outputPath, data, {
  1588. encoding: CLIUtils.encoding
  1589. });
  1590. }
  1591. }]);
  1592. return CLIUtils;
  1593. }();
  1594. CLIUtils.availableInputExtensions = ['.js'];
  1595. CLIUtils.encoding = 'utf8';
  1596. exports.CLIUtils = CLIUtils;
  1597. /***/ },
  1598. /* 32 */
  1599. /***/ function(module, exports, __webpack_require__) {
  1600. "use strict";
  1601. "use strict";
  1602. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  1603. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1604. var commander = __webpack_require__(97);
  1605. var path = __webpack_require__(26);
  1606. var SourceMapMode_1 = __webpack_require__(14);
  1607. var StringArrayEncoding_1 = __webpack_require__(18);
  1608. var DefaultPreset_1 = __webpack_require__(23);
  1609. var CLIUtils_1 = __webpack_require__(31);
  1610. var JavaScriptObfuscator_1 = __webpack_require__(10);
  1611. var Utils_1 = __webpack_require__(0);
  1612. var JavaScriptObfuscatorCLI = function () {
  1613. function JavaScriptObfuscatorCLI(argv) {
  1614. _classCallCheck(this, JavaScriptObfuscatorCLI);
  1615. this.data = '';
  1616. this.rawArguments = argv;
  1617. this.arguments = this.rawArguments.slice(2);
  1618. }
  1619. _createClass(JavaScriptObfuscatorCLI, [{
  1620. key: 'run',
  1621. value: function run() {
  1622. this.configureCommands();
  1623. if (!this.arguments.length || Utils_1.Utils.arrayContains(this.arguments, '--help')) {
  1624. this.commands.outputHelp();
  1625. return;
  1626. }
  1627. this.inputPath = this.arguments[0];
  1628. CLIUtils_1.CLIUtils.validateInputPath(this.inputPath);
  1629. this.getData();
  1630. this.processData();
  1631. }
  1632. }, {
  1633. key: 'buildOptions',
  1634. value: function buildOptions() {
  1635. var obfuscatorOptions = {},
  1636. availableOptions = Object.keys(DefaultPreset_1.DEFAULT_PRESET);
  1637. for (var option in this.commands) {
  1638. if (!this.commands.hasOwnProperty(option)) {
  1639. continue;
  1640. }
  1641. if (!Utils_1.Utils.arrayContains(availableOptions, option)) {
  1642. continue;
  1643. }
  1644. obfuscatorOptions[option] = this.commands[option];
  1645. }
  1646. return Object.assign({}, DefaultPreset_1.DEFAULT_PRESET, obfuscatorOptions);
  1647. }
  1648. }, {
  1649. key: 'configureCommands',
  1650. value: function configureCommands() {
  1651. this.commands = new commander.Command().version(JavaScriptObfuscatorCLI.getBuildVersion(), '-v, --version').usage('<inputPath> [options]').option('-o, --output <path>', 'Output path for obfuscated code').option('--compact <boolean>', 'Disable one line output code compacting', JavaScriptObfuscatorCLI.parseBoolean).option('--controlFlowFlattening <boolean>', 'Enables control flow flattening', JavaScriptObfuscatorCLI.parseBoolean).option('--debugProtection <boolean>', 'Disable browser Debug panel (can cause DevTools enabled browser freeze)', JavaScriptObfuscatorCLI.parseBoolean).option('--debugProtectionInterval <boolean>', 'Disable browser Debug panel even after page was loaded (can cause DevTools enabled browser freeze)', JavaScriptObfuscatorCLI.parseBoolean).option('--disableConsoleOutput <boolean>', 'Allow console.log, console.info, console.error and console.warn messages output into browser console', JavaScriptObfuscatorCLI.parseBoolean).option('--domainLock <list>', 'Blocks the execution of the code in domains that do not match the passed RegExp patterns (comma separated)', function (val) {
  1652. return val.split(',');
  1653. }).option('--reservedNames <list>', 'Disable obfuscation of variable names, function names and names of function parameters that match the passed RegExp patterns (comma separated)', function (val) {
  1654. return val.split(',');
  1655. }).option('--rotateStringArray <boolean>', 'Disable rotation of unicode array values during obfuscation', JavaScriptObfuscatorCLI.parseBoolean).option('--seed <number>', 'Sets seed for random generator. This is useful for creating repeatable results.', parseFloat).option('--selfDefending <boolean>', 'Disables self-defending for obfuscated code', JavaScriptObfuscatorCLI.parseBoolean).option('--sourceMap <boolean>', 'Enables source map generation', JavaScriptObfuscatorCLI.parseBoolean).option('--sourceMapBaseUrl <string>', 'Sets base url to the source map import url when `--sourceMapMode=separate`').option('--sourceMapFileName <string>', 'Sets file name for output source map when `--sourceMapMode=separate`').option('--sourceMapMode <string> [inline, separate]', 'Specify source map output mode', JavaScriptObfuscatorCLI.parseSourceMapMode).option('--stringArray <boolean>', 'Disables gathering of all literal strings into an array and replacing every literal string with an array call', JavaScriptObfuscatorCLI.parseBoolean).option('--stringArrayEncoding <boolean|string> [true, false, base64, rc4]', 'Encodes all strings in strings array using base64 or rc4 (this option can slow down your code speed', JavaScriptObfuscatorCLI.parseStringArrayEncoding).option('--stringArrayThreshold <number>', 'The probability that the literal string will be inserted into stringArray (Default: 0.8, Min: 0, Max: 1)', parseFloat).option('--unicodeEscapeSequence <boolean>', 'Allows to enable/disable string conversion to unicode escape sequence', JavaScriptObfuscatorCLI.parseBoolean).parse(this.rawArguments);
  1656. this.commands.on('--help', function () {
  1657. console.log(' Examples:\n');
  1658. console.log(' %> javascript-obfuscator in.js --compact true --selfDefending false');
  1659. console.log(' %> javascript-obfuscator in.js --output out.js --compact true --selfDefending false');
  1660. console.log('');
  1661. });
  1662. }
  1663. }, {
  1664. key: 'getData',
  1665. value: function getData() {
  1666. this.data = CLIUtils_1.CLIUtils.readFile(this.inputPath);
  1667. }
  1668. }, {
  1669. key: 'processData',
  1670. value: function processData() {
  1671. var options = this.buildOptions(),
  1672. outputCodePath = CLIUtils_1.CLIUtils.getOutputCodePath(this.commands.output, this.inputPath);
  1673. if (options.sourceMap) {
  1674. this.processDataWithSourceMap(outputCodePath, options);
  1675. } else {
  1676. this.processDataWithoutSourceMap(outputCodePath, options);
  1677. }
  1678. }
  1679. }, {
  1680. key: 'processDataWithoutSourceMap',
  1681. value: function processDataWithoutSourceMap(outputCodePath, options) {
  1682. var obfuscatedCode = JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(this.data, options).getObfuscatedCode();
  1683. CLIUtils_1.CLIUtils.writeFile(outputCodePath, obfuscatedCode);
  1684. }
  1685. }, {
  1686. key: 'processDataWithSourceMap',
  1687. value: function processDataWithSourceMap(outputCodePath, options) {
  1688. var outputSourceMapPath = CLIUtils_1.CLIUtils.getOutputSourceMapPath(outputCodePath, options.sourceMapFileName || '');
  1689. options.sourceMapFileName = path.basename(outputSourceMapPath);
  1690. var obfuscationResult = JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(this.data, options);
  1691. CLIUtils_1.CLIUtils.writeFile(outputCodePath, obfuscationResult.getObfuscatedCode());
  1692. if (options.sourceMapMode === 'separate' && obfuscationResult.getSourceMap()) {
  1693. CLIUtils_1.CLIUtils.writeFile(outputSourceMapPath, obfuscationResult.getSourceMap());
  1694. }
  1695. }
  1696. }], [{
  1697. key: 'getBuildVersion',
  1698. value: function getBuildVersion() {
  1699. return CLIUtils_1.CLIUtils.getPackageConfig().version;
  1700. }
  1701. }, {
  1702. key: 'parseBoolean',
  1703. value: function parseBoolean(value) {
  1704. return value === 'true' || value === '1';
  1705. }
  1706. }, {
  1707. key: 'parseSourceMapMode',
  1708. value: function parseSourceMapMode(value) {
  1709. var availableMode = Object.keys(SourceMapMode_1.SourceMapMode).some(function (key) {
  1710. return SourceMapMode_1.SourceMapMode[key] === value;
  1711. });
  1712. if (!availableMode) {
  1713. throw new ReferenceError('Invalid value of `--sourceMapMode` option');
  1714. }
  1715. return value;
  1716. }
  1717. }, {
  1718. key: 'parseStringArrayEncoding',
  1719. value: function parseStringArrayEncoding(value) {
  1720. switch (value) {
  1721. case 'true':
  1722. case '1':
  1723. case StringArrayEncoding_1.StringArrayEncoding.base64:
  1724. return true;
  1725. case StringArrayEncoding_1.StringArrayEncoding.rc4:
  1726. return StringArrayEncoding_1.StringArrayEncoding.rc4;
  1727. default:
  1728. return false;
  1729. }
  1730. }
  1731. }]);
  1732. return JavaScriptObfuscatorCLI;
  1733. }();
  1734. exports.JavaScriptObfuscatorCLI = JavaScriptObfuscatorCLI;
  1735. /***/ },
  1736. /* 33 */
  1737. /***/ function(module, exports, __webpack_require__) {
  1738. "use strict";
  1739. "use strict";
  1740. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  1741. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1742. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1743. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  1744. var format = __webpack_require__(6);
  1745. var AppendState_1 = __webpack_require__(1);
  1746. var ConsoleOutputDisableExpressionTemplate_1 = __webpack_require__(78);
  1747. var AbstractCustomNode_1 = __webpack_require__(5);
  1748. var NodeAppender_1 = __webpack_require__(3);
  1749. var Utils_1 = __webpack_require__(0);
  1750. var ConsoleOutputDisableExpressionNode = function (_AbstractCustomNode_) {
  1751. _inherits(ConsoleOutputDisableExpressionNode, _AbstractCustomNode_);
  1752. function ConsoleOutputDisableExpressionNode(stackTraceData, callsControllerFunctionName, randomStackTraceIndex, options) {
  1753. _classCallCheck(this, ConsoleOutputDisableExpressionNode);
  1754. var _this = _possibleConstructorReturn(this, (ConsoleOutputDisableExpressionNode.__proto__ || Object.getPrototypeOf(ConsoleOutputDisableExpressionNode)).call(this, options));
  1755. _this.appendState = AppendState_1.AppendState.BeforeObfuscation;
  1756. _this.stackTraceData = stackTraceData;
  1757. _this.callsControllerFunctionName = callsControllerFunctionName;
  1758. _this.randomStackTraceIndex = randomStackTraceIndex;
  1759. return _this;
  1760. }
  1761. _createClass(ConsoleOutputDisableExpressionNode, [{
  1762. key: 'appendNode',
  1763. value: function appendNode(blockScopeNode) {
  1764. NodeAppender_1.NodeAppender.appendNodeToOptimalBlockScope(this.stackTraceData, blockScopeNode, this.getNode(), this.randomStackTraceIndex);
  1765. }
  1766. }, {
  1767. key: 'getCode',
  1768. value: function getCode() {
  1769. return format(ConsoleOutputDisableExpressionTemplate_1.ConsoleOutputDisableExpressionTemplate(), {
  1770. consoleLogDisableFunctionName: Utils_1.Utils.getRandomVariableName(),
  1771. singleNodeCallControllerFunctionName: this.callsControllerFunctionName
  1772. });
  1773. }
  1774. }]);
  1775. return ConsoleOutputDisableExpressionNode;
  1776. }(AbstractCustomNode_1.AbstractCustomNode);
  1777. exports.ConsoleOutputDisableExpressionNode = ConsoleOutputDisableExpressionNode;
  1778. /***/ },
  1779. /* 34 */
  1780. /***/ function(module, exports, __webpack_require__) {
  1781. "use strict";
  1782. "use strict";
  1783. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  1784. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1785. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1786. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  1787. var format = __webpack_require__(6);
  1788. var AppendState_1 = __webpack_require__(1);
  1789. var BinaryExpressionFunctionTemplate_1 = __webpack_require__(79);
  1790. var AbstractCustomNode_1 = __webpack_require__(5);
  1791. var Utils_1 = __webpack_require__(0);
  1792. var BinaryExpressionFunctionNode = function (_AbstractCustomNode_) {
  1793. _inherits(BinaryExpressionFunctionNode, _AbstractCustomNode_);
  1794. function BinaryExpressionFunctionNode(operator, options) {
  1795. _classCallCheck(this, BinaryExpressionFunctionNode);
  1796. var _this = _possibleConstructorReturn(this, (BinaryExpressionFunctionNode.__proto__ || Object.getPrototypeOf(BinaryExpressionFunctionNode)).call(this, options));
  1797. _this.appendState = AppendState_1.AppendState.BeforeObfuscation;
  1798. _this.operator = operator;
  1799. return _this;
  1800. }
  1801. _createClass(BinaryExpressionFunctionNode, [{
  1802. key: 'appendNode',
  1803. value: function appendNode(blockScopeNode) {}
  1804. }, {
  1805. key: 'getCode',
  1806. value: function getCode() {
  1807. return format(BinaryExpressionFunctionTemplate_1.BinaryExpressionFunctionTemplate(), {
  1808. functionName: Utils_1.Utils.getRandomVariableName(1),
  1809. operator: this.operator
  1810. });
  1811. }
  1812. }]);
  1813. return BinaryExpressionFunctionNode;
  1814. }(AbstractCustomNode_1.AbstractCustomNode);
  1815. exports.BinaryExpressionFunctionNode = BinaryExpressionFunctionNode;
  1816. /***/ },
  1817. /* 35 */
  1818. /***/ function(module, exports, __webpack_require__) {
  1819. "use strict";
  1820. "use strict";
  1821. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  1822. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1823. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1824. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  1825. var format = __webpack_require__(6);
  1826. var AppendState_1 = __webpack_require__(1);
  1827. var ControlFlowStorageCallTemplate_1 = __webpack_require__(80);
  1828. var AbstractCustomNode_1 = __webpack_require__(5);
  1829. var NodeAppender_1 = __webpack_require__(3);
  1830. var ControlFlowStorageCallNode = function (_AbstractCustomNode_) {
  1831. _inherits(ControlFlowStorageCallNode, _AbstractCustomNode_);
  1832. function ControlFlowStorageCallNode(controlFlowStorageName, controlFlowStorageKey, leftValue, rightValue, options) {
  1833. _classCallCheck(this, ControlFlowStorageCallNode);
  1834. var _this = _possibleConstructorReturn(this, (ControlFlowStorageCallNode.__proto__ || Object.getPrototypeOf(ControlFlowStorageCallNode)).call(this, options));
  1835. _this.appendState = AppendState_1.AppendState.AfterObfuscation;
  1836. _this.controlFlowStorageName = controlFlowStorageName;
  1837. _this.controlFlowStorageKey = controlFlowStorageKey;
  1838. _this.leftValue = leftValue;
  1839. _this.rightValue = rightValue;
  1840. return _this;
  1841. }
  1842. _createClass(ControlFlowStorageCallNode, [{
  1843. key: 'appendNode',
  1844. value: function appendNode(blockScopeNode) {
  1845. NodeAppender_1.NodeAppender.prependNode(blockScopeNode, this.getNode());
  1846. }
  1847. }, {
  1848. key: 'getCode',
  1849. value: function getCode() {
  1850. return format(ControlFlowStorageCallTemplate_1.ControlFlowStorageCallTemplate(), {
  1851. controlFlowStorageKey: this.controlFlowStorageKey,
  1852. controlFlowStorageName: this.controlFlowStorageName,
  1853. leftValue: this.leftValue,
  1854. rightValue: this.rightValue
  1855. });
  1856. }
  1857. }]);
  1858. return ControlFlowStorageCallNode;
  1859. }(AbstractCustomNode_1.AbstractCustomNode);
  1860. exports.ControlFlowStorageCallNode = ControlFlowStorageCallNode;
  1861. /***/ },
  1862. /* 36 */
  1863. /***/ function(module, exports, __webpack_require__) {
  1864. "use strict";
  1865. "use strict";
  1866. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  1867. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1868. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1869. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  1870. var format = __webpack_require__(6);
  1871. var AppendState_1 = __webpack_require__(1);
  1872. var ControlFlowStorageTemplate_1 = __webpack_require__(81);
  1873. var AbstractCustomNode_1 = __webpack_require__(5);
  1874. var NodeAppender_1 = __webpack_require__(3);
  1875. var ControlFlowStorageNode = function (_AbstractCustomNode_) {
  1876. _inherits(ControlFlowStorageNode, _AbstractCustomNode_);
  1877. function ControlFlowStorageNode(controlFlowStorage, controlFlowStorageName, options) {
  1878. _classCallCheck(this, ControlFlowStorageNode);
  1879. var _this = _possibleConstructorReturn(this, (ControlFlowStorageNode.__proto__ || Object.getPrototypeOf(ControlFlowStorageNode)).call(this, options));
  1880. _this.appendState = AppendState_1.AppendState.AfterObfuscation;
  1881. _this.controlFlowStorage = controlFlowStorage;
  1882. _this.controlFlowStorageName = controlFlowStorageName;
  1883. return _this;
  1884. }
  1885. _createClass(ControlFlowStorageNode, [{
  1886. key: 'appendNode',
  1887. value: function appendNode(blockScopeNode) {
  1888. NodeAppender_1.NodeAppender.prependNode(blockScopeNode, this.getNode());
  1889. }
  1890. }, {
  1891. key: 'getCode',
  1892. value: function getCode() {
  1893. return format(ControlFlowStorageTemplate_1.ControlFlowStorageTemplate(), {
  1894. controlFlowStorage: this.controlFlowStorage.toString(),
  1895. controlFlowStorageName: this.controlFlowStorageName
  1896. });
  1897. }
  1898. }]);
  1899. return ControlFlowStorageNode;
  1900. }(AbstractCustomNode_1.AbstractCustomNode);
  1901. exports.ControlFlowStorageNode = ControlFlowStorageNode;
  1902. /***/ },
  1903. /* 37 */
  1904. /***/ function(module, exports, __webpack_require__) {
  1905. "use strict";
  1906. "use strict";
  1907. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  1908. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1909. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1910. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  1911. var format = __webpack_require__(6);
  1912. var AppendState_1 = __webpack_require__(1);
  1913. var DebufProtectionFunctionCallTemplate_1 = __webpack_require__(82);
  1914. var AbstractCustomNode_1 = __webpack_require__(5);
  1915. var NodeAppender_1 = __webpack_require__(3);
  1916. var DebugProtectionFunctionCallNode = function (_AbstractCustomNode_) {
  1917. _inherits(DebugProtectionFunctionCallNode, _AbstractCustomNode_);
  1918. function DebugProtectionFunctionCallNode(debugProtectionFunctionName, options) {
  1919. _classCallCheck(this, DebugProtectionFunctionCallNode);
  1920. var _this = _possibleConstructorReturn(this, (DebugProtectionFunctionCallNode.__proto__ || Object.getPrototypeOf(DebugProtectionFunctionCallNode)).call(this, options));
  1921. _this.appendState = AppendState_1.AppendState.BeforeObfuscation;
  1922. _this.debugProtectionFunctionName = debugProtectionFunctionName;
  1923. return _this;
  1924. }
  1925. _createClass(DebugProtectionFunctionCallNode, [{
  1926. key: 'appendNode',
  1927. value: function appendNode(blockScopeNode) {
  1928. NodeAppender_1.NodeAppender.appendNode(blockScopeNode, this.getNode());
  1929. }
  1930. }, {
  1931. key: 'getCode',
  1932. value: function getCode() {
  1933. return format(DebufProtectionFunctionCallTemplate_1.DebugProtectionFunctionCallTemplate(), {
  1934. debugProtectionFunctionName: this.debugProtectionFunctionName
  1935. });
  1936. }
  1937. }]);
  1938. return DebugProtectionFunctionCallNode;
  1939. }(AbstractCustomNode_1.AbstractCustomNode);
  1940. exports.DebugProtectionFunctionCallNode = DebugProtectionFunctionCallNode;
  1941. /***/ },
  1942. /* 38 */
  1943. /***/ function(module, exports, __webpack_require__) {
  1944. "use strict";
  1945. "use strict";
  1946. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  1947. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1948. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1949. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  1950. var format = __webpack_require__(6);
  1951. var AppendState_1 = __webpack_require__(1);
  1952. var DebugProtectionFunctionIntervalTemplate_1 = __webpack_require__(83);
  1953. var AbstractCustomNode_1 = __webpack_require__(5);
  1954. var NodeAppender_1 = __webpack_require__(3);
  1955. var DebugProtectionFunctionIntervalNode = function (_AbstractCustomNode_) {
  1956. _inherits(DebugProtectionFunctionIntervalNode, _AbstractCustomNode_);
  1957. function DebugProtectionFunctionIntervalNode(debugProtectionFunctionName, options) {
  1958. _classCallCheck(this, DebugProtectionFunctionIntervalNode);
  1959. var _this = _possibleConstructorReturn(this, (DebugProtectionFunctionIntervalNode.__proto__ || Object.getPrototypeOf(DebugProtectionFunctionIntervalNode)).call(this, options));
  1960. _this.appendState = AppendState_1.AppendState.BeforeObfuscation;
  1961. _this.debugProtectionFunctionName = debugProtectionFunctionName;
  1962. return _this;
  1963. }
  1964. _createClass(DebugProtectionFunctionIntervalNode, [{
  1965. key: 'appendNode',
  1966. value: function appendNode(blockScopeNode) {
  1967. NodeAppender_1.NodeAppender.appendNode(blockScopeNode, this.getNode());
  1968. }
  1969. }, {
  1970. key: 'getCode',
  1971. value: function getCode() {
  1972. return format(DebugProtectionFunctionIntervalTemplate_1.DebugProtectionFunctionIntervalTemplate(), {
  1973. debugProtectionFunctionName: this.debugProtectionFunctionName
  1974. });
  1975. }
  1976. }]);
  1977. return DebugProtectionFunctionIntervalNode;
  1978. }(AbstractCustomNode_1.AbstractCustomNode);
  1979. exports.DebugProtectionFunctionIntervalNode = DebugProtectionFunctionIntervalNode;
  1980. /***/ },
  1981. /* 39 */
  1982. /***/ function(module, exports, __webpack_require__) {
  1983. "use strict";
  1984. "use strict";
  1985. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  1986. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1987. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1988. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  1989. var format = __webpack_require__(6);
  1990. var AppendState_1 = __webpack_require__(1);
  1991. var DebugProtectionFunctionTemplate_1 = __webpack_require__(84);
  1992. var AbstractCustomNode_1 = __webpack_require__(5);
  1993. var NodeAppender_1 = __webpack_require__(3);
  1994. var Utils_1 = __webpack_require__(0);
  1995. var DebugProtectionFunctionNode = function (_AbstractCustomNode_) {
  1996. _inherits(DebugProtectionFunctionNode, _AbstractCustomNode_);
  1997. function DebugProtectionFunctionNode(debugProtectionFunctionName, options) {
  1998. _classCallCheck(this, DebugProtectionFunctionNode);
  1999. var _this = _possibleConstructorReturn(this, (DebugProtectionFunctionNode.__proto__ || Object.getPrototypeOf(DebugProtectionFunctionNode)).call(this, options));
  2000. _this.appendState = AppendState_1.AppendState.BeforeObfuscation;
  2001. _this.debugProtectionFunctionName = debugProtectionFunctionName;
  2002. return _this;
  2003. }
  2004. _createClass(DebugProtectionFunctionNode, [{
  2005. key: 'appendNode',
  2006. value: function appendNode(blockScopeNode) {
  2007. var programBodyLength = blockScopeNode.body.length,
  2008. randomIndex = Utils_1.Utils.getRandomInteger(0, programBodyLength);
  2009. NodeAppender_1.NodeAppender.insertNodeAtIndex(blockScopeNode, this.getNode(), randomIndex);
  2010. }
  2011. }, {
  2012. key: 'getCode',
  2013. value: function getCode() {
  2014. return format(DebugProtectionFunctionTemplate_1.DebugProtectionFunctionTemplate(), {
  2015. debugProtectionFunctionName: this.debugProtectionFunctionName
  2016. });
  2017. }
  2018. }]);
  2019. return DebugProtectionFunctionNode;
  2020. }(AbstractCustomNode_1.AbstractCustomNode);
  2021. exports.DebugProtectionFunctionNode = DebugProtectionFunctionNode;
  2022. /***/ },
  2023. /* 40 */
  2024. /***/ function(module, exports, __webpack_require__) {
  2025. "use strict";
  2026. "use strict";
  2027. var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; })();
  2028. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  2029. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2030. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  2031. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  2032. var format = __webpack_require__(6);
  2033. var AppendState_1 = __webpack_require__(1);
  2034. var DomainLockNodeTemplate_1 = __webpack_require__(85);
  2035. var AbstractCustomNode_1 = __webpack_require__(5);
  2036. var NodeAppender_1 = __webpack_require__(3);
  2037. var Utils_1 = __webpack_require__(0);
  2038. var DomainLockNode = function (_AbstractCustomNode_) {
  2039. _inherits(DomainLockNode, _AbstractCustomNode_);
  2040. function DomainLockNode(stackTraceData, callsControllerFunctionName, randomStackTraceIndex, options) {
  2041. _classCallCheck(this, DomainLockNode);
  2042. var _this = _possibleConstructorReturn(this, (DomainLockNode.__proto__ || Object.getPrototypeOf(DomainLockNode)).call(this, options));
  2043. _this.appendState = AppendState_1.AppendState.BeforeObfuscation;
  2044. _this.stackTraceData = stackTraceData;
  2045. _this.callsControllerFunctionName = callsControllerFunctionName;
  2046. _this.randomStackTraceIndex = randomStackTraceIndex;
  2047. return _this;
  2048. }
  2049. _createClass(DomainLockNode, [{
  2050. key: 'appendNode',
  2051. value: function appendNode(blockScopeNode) {
  2052. NodeAppender_1.NodeAppender.appendNodeToOptimalBlockScope(this.stackTraceData, blockScopeNode, this.getNode(), this.randomStackTraceIndex);
  2053. }
  2054. }, {
  2055. key: 'getCode',
  2056. value: function getCode() {
  2057. var domainsString = this.options.domainLock.join(';'),
  2058. _Utils_1$Utils$hideSt = Utils_1.Utils.hideString(domainsString, domainsString.length * 3),
  2059. _Utils_1$Utils$hideSt2 = _slicedToArray(_Utils_1$Utils$hideSt, 2),
  2060. hiddenDomainsString = _Utils_1$Utils$hideSt2[0],
  2061. diff = _Utils_1$Utils$hideSt2[1];
  2062. return format(DomainLockNodeTemplate_1.DomainLockNodeTemplate(), {
  2063. domainLockFunctionName: Utils_1.Utils.getRandomVariableName(),
  2064. diff: diff,
  2065. domains: hiddenDomainsString,
  2066. singleNodeCallControllerFunctionName: this.callsControllerFunctionName
  2067. });
  2068. }
  2069. }]);
  2070. return DomainLockNode;
  2071. }(AbstractCustomNode_1.AbstractCustomNode);
  2072. exports.DomainLockNode = DomainLockNode;
  2073. /***/ },
  2074. /* 41 */
  2075. /***/ function(module, exports, __webpack_require__) {
  2076. "use strict";
  2077. "use strict";
  2078. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  2079. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2080. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  2081. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  2082. var format = __webpack_require__(6);
  2083. var AppendState_1 = __webpack_require__(1);
  2084. var NoCustomNodesPreset_1 = __webpack_require__(16);
  2085. var SelfDefendingTemplate_1 = __webpack_require__(86);
  2086. var AbstractCustomNode_1 = __webpack_require__(5);
  2087. var NodeAppender_1 = __webpack_require__(3);
  2088. var JavaScriptObfuscator_1 = __webpack_require__(10);
  2089. var Utils_1 = __webpack_require__(0);
  2090. var SelfDefendingUnicodeNode = function (_AbstractCustomNode_) {
  2091. _inherits(SelfDefendingUnicodeNode, _AbstractCustomNode_);
  2092. function SelfDefendingUnicodeNode(stackTraceData, callsControllerFunctionName, randomStackTraceIndex, options) {
  2093. _classCallCheck(this, SelfDefendingUnicodeNode);
  2094. var _this = _possibleConstructorReturn(this, (SelfDefendingUnicodeNode.__proto__ || Object.getPrototypeOf(SelfDefendingUnicodeNode)).call(this, options));
  2095. _this.appendState = AppendState_1.AppendState.AfterObfuscation;
  2096. _this.stackTraceData = stackTraceData;
  2097. _this.callsControllerFunctionName = callsControllerFunctionName;
  2098. _this.randomStackTraceIndex = randomStackTraceIndex;
  2099. return _this;
  2100. }
  2101. _createClass(SelfDefendingUnicodeNode, [{
  2102. key: 'appendNode',
  2103. value: function appendNode(blockScopeNode) {
  2104. NodeAppender_1.NodeAppender.appendNodeToOptimalBlockScope(this.stackTraceData, blockScopeNode, this.getNode(), this.randomStackTraceIndex);
  2105. }
  2106. }, {
  2107. key: 'getCode',
  2108. value: function getCode() {
  2109. return JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(format(SelfDefendingTemplate_1.SelfDefendingTemplate(), {
  2110. selfDefendingFunctionName: Utils_1.Utils.getRandomVariableName(),
  2111. singleNodeCallControllerFunctionName: this.callsControllerFunctionName
  2112. }), Object.assign({}, NoCustomNodesPreset_1.NO_CUSTOM_NODES_PRESET, {
  2113. seed: this.options.seed
  2114. })).getObfuscatedCode();
  2115. }
  2116. }]);
  2117. return SelfDefendingUnicodeNode;
  2118. }(AbstractCustomNode_1.AbstractCustomNode);
  2119. exports.SelfDefendingUnicodeNode = SelfDefendingUnicodeNode;
  2120. /***/ },
  2121. /* 42 */
  2122. /***/ function(module, exports, __webpack_require__) {
  2123. "use strict";
  2124. "use strict";
  2125. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  2126. var _get = (function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } });
  2127. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2128. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  2129. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  2130. var format = __webpack_require__(6);
  2131. var AppendState_1 = __webpack_require__(1);
  2132. var StringArrayEncoding_1 = __webpack_require__(18);
  2133. var NoCustomNodesPreset_1 = __webpack_require__(16);
  2134. var AtobTemplate_1 = __webpack_require__(75);
  2135. var Rc4Template_1 = __webpack_require__(76);
  2136. var SelfDefendingTemplate_1 = __webpack_require__(87);
  2137. var StringArrayBase64DecodeNodeTemplate_1 = __webpack_require__(88);
  2138. var StringArrayCallsWrapperTemplate_1 = __webpack_require__(89);
  2139. var StringArrayRC4DecodeNodeTemplate_1 = __webpack_require__(90);
  2140. var AbstractCustomNode_1 = __webpack_require__(5);
  2141. var JavaScriptObfuscator_1 = __webpack_require__(10);
  2142. var NodeAppender_1 = __webpack_require__(3);
  2143. var StringArrayCallsWrapper = function (_AbstractCustomNode_) {
  2144. _inherits(StringArrayCallsWrapper, _AbstractCustomNode_);
  2145. function StringArrayCallsWrapper(stringArrayCallsWrapperName, stringArrayName, stringArray, options) {
  2146. _classCallCheck(this, StringArrayCallsWrapper);
  2147. var _this = _possibleConstructorReturn(this, (StringArrayCallsWrapper.__proto__ || Object.getPrototypeOf(StringArrayCallsWrapper)).call(this, options));
  2148. _this.appendState = AppendState_1.AppendState.AfterObfuscation;
  2149. _this.stringArrayCallsWrapperName = stringArrayCallsWrapperName;
  2150. _this.stringArrayName = stringArrayName;
  2151. _this.stringArray = stringArray;
  2152. return _this;
  2153. }
  2154. _createClass(StringArrayCallsWrapper, [{
  2155. key: 'appendNode',
  2156. value: function appendNode(blockScopeNode) {
  2157. if (!this.stringArray.getLength()) {
  2158. return;
  2159. }
  2160. NodeAppender_1.NodeAppender.insertNodeAtIndex(blockScopeNode, this.getNode(), 1);
  2161. }
  2162. }, {
  2163. key: 'getCode',
  2164. value: function getCode() {
  2165. var decodeNodeTemplate = this.getDecodeStringArrayTemplate();
  2166. return JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(format(StringArrayCallsWrapperTemplate_1.StringArrayCallsWrapperTemplate(), {
  2167. decodeNodeTemplate: decodeNodeTemplate,
  2168. stringArrayCallsWrapperName: this.stringArrayCallsWrapperName,
  2169. stringArrayName: this.stringArrayName
  2170. }), Object.assign({}, NoCustomNodesPreset_1.NO_CUSTOM_NODES_PRESET, {
  2171. seed: this.options.seed
  2172. })).getObfuscatedCode();
  2173. }
  2174. }, {
  2175. key: 'getNodeIdentifier',
  2176. value: function getNodeIdentifier() {
  2177. return this.stringArrayCallsWrapperName;
  2178. }
  2179. }, {
  2180. key: 'getNode',
  2181. value: function getNode() {
  2182. return _get(StringArrayCallsWrapper.prototype.__proto__ || Object.getPrototypeOf(StringArrayCallsWrapper.prototype), 'getNode', this).call(this);
  2183. }
  2184. }, {
  2185. key: 'getDecodeStringArrayTemplate',
  2186. value: function getDecodeStringArrayTemplate() {
  2187. var decodeStringArrayTemplate = '',
  2188. selfDefendingCode = '';
  2189. if (this.options.selfDefending) {
  2190. selfDefendingCode = format(SelfDefendingTemplate_1.SelfDefendingTemplate(), {
  2191. stringArrayCallsWrapperName: this.stringArrayCallsWrapperName,
  2192. stringArrayName: this.stringArrayName
  2193. });
  2194. }
  2195. switch (this.options.stringArrayEncoding) {
  2196. case StringArrayEncoding_1.StringArrayEncoding.base64:
  2197. decodeStringArrayTemplate = format(StringArrayBase64DecodeNodeTemplate_1.StringArrayBase64DecodeNodeTemplate(), {
  2198. atobPolyfill: AtobTemplate_1.AtobTemplate(),
  2199. selfDefendingCode: selfDefendingCode,
  2200. stringArrayCallsWrapperName: this.stringArrayCallsWrapperName
  2201. });
  2202. break;
  2203. case StringArrayEncoding_1.StringArrayEncoding.rc4:
  2204. decodeStringArrayTemplate = format(StringArrayRC4DecodeNodeTemplate_1.StringArrayRc4DecodeNodeTemplate(), {
  2205. atobPolyfill: AtobTemplate_1.AtobTemplate(),
  2206. rc4Polyfill: Rc4Template_1.Rc4Template(),
  2207. selfDefendingCode: selfDefendingCode,
  2208. stringArrayCallsWrapperName: this.stringArrayCallsWrapperName
  2209. });
  2210. break;
  2211. }
  2212. return decodeStringArrayTemplate;
  2213. }
  2214. }]);
  2215. return StringArrayCallsWrapper;
  2216. }(AbstractCustomNode_1.AbstractCustomNode);
  2217. exports.StringArrayCallsWrapper = StringArrayCallsWrapper;
  2218. /***/ },
  2219. /* 43 */
  2220. /***/ function(module, exports, __webpack_require__) {
  2221. "use strict";
  2222. "use strict";
  2223. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  2224. var _get = (function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } });
  2225. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2226. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  2227. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  2228. var format = __webpack_require__(6);
  2229. var AppendState_1 = __webpack_require__(1);
  2230. var StringArrayTemplate_1 = __webpack_require__(91);
  2231. var AbstractCustomNode_1 = __webpack_require__(5);
  2232. var NodeAppender_1 = __webpack_require__(3);
  2233. var StringArrayNode = function (_AbstractCustomNode_) {
  2234. _inherits(StringArrayNode, _AbstractCustomNode_);
  2235. function StringArrayNode(stringArray, stringArrayName) {
  2236. var stringArrayRotateValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  2237. var options = arguments[3];
  2238. _classCallCheck(this, StringArrayNode);
  2239. var _this = _possibleConstructorReturn(this, (StringArrayNode.__proto__ || Object.getPrototypeOf(StringArrayNode)).call(this, options));
  2240. _this.appendState = AppendState_1.AppendState.AfterObfuscation;
  2241. _this.stringArray = stringArray;
  2242. _this.stringArrayName = stringArrayName;
  2243. _this.stringArrayRotateValue = stringArrayRotateValue;
  2244. return _this;
  2245. }
  2246. _createClass(StringArrayNode, [{
  2247. key: 'appendNode',
  2248. value: function appendNode(blockScopeNode) {
  2249. if (!this.stringArray.getLength()) {
  2250. return;
  2251. }
  2252. NodeAppender_1.NodeAppender.prependNode(blockScopeNode, this.getNode());
  2253. }
  2254. }, {
  2255. key: 'getCode',
  2256. value: function getCode() {
  2257. return format(StringArrayTemplate_1.StringArrayTemplate(), {
  2258. stringArrayName: this.stringArrayName,
  2259. stringArray: this.stringArray.toString()
  2260. });
  2261. }
  2262. }, {
  2263. key: 'getNodeData',
  2264. value: function getNodeData() {
  2265. return this.stringArray;
  2266. }
  2267. }, {
  2268. key: 'getNode',
  2269. value: function getNode() {
  2270. this.stringArray.rotateArray(this.stringArrayRotateValue);
  2271. return _get(StringArrayNode.prototype.__proto__ || Object.getPrototypeOf(StringArrayNode.prototype), 'getNode', this).call(this);
  2272. }
  2273. }]);
  2274. return StringArrayNode;
  2275. }(AbstractCustomNode_1.AbstractCustomNode);
  2276. StringArrayNode.ARRAY_RANDOM_LENGTH = 4;
  2277. exports.StringArrayNode = StringArrayNode;
  2278. /***/ },
  2279. /* 44 */
  2280. /***/ function(module, exports, __webpack_require__) {
  2281. "use strict";
  2282. "use strict";
  2283. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  2284. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2285. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  2286. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  2287. var format = __webpack_require__(6);
  2288. var AppendState_1 = __webpack_require__(1);
  2289. var NoCustomNodesPreset_1 = __webpack_require__(16);
  2290. var SelfDefendingTemplate_1 = __webpack_require__(92);
  2291. var StringArrayRotateFunctionTemplate_1 = __webpack_require__(93);
  2292. var AbstractCustomNode_1 = __webpack_require__(5);
  2293. var JavaScriptObfuscator_1 = __webpack_require__(10);
  2294. var NodeAppender_1 = __webpack_require__(3);
  2295. var Utils_1 = __webpack_require__(0);
  2296. var StringArrayRotateFunctionNode = function (_AbstractCustomNode_) {
  2297. _inherits(StringArrayRotateFunctionNode, _AbstractCustomNode_);
  2298. function StringArrayRotateFunctionNode(stringArrayName, stringArray, stringArrayRotateValue, options) {
  2299. _classCallCheck(this, StringArrayRotateFunctionNode);
  2300. var _this = _possibleConstructorReturn(this, (StringArrayRotateFunctionNode.__proto__ || Object.getPrototypeOf(StringArrayRotateFunctionNode)).call(this, options));
  2301. _this.appendState = AppendState_1.AppendState.AfterObfuscation;
  2302. _this.stringArrayName = stringArrayName;
  2303. _this.stringArray = stringArray;
  2304. _this.stringArrayRotateValue = stringArrayRotateValue;
  2305. return _this;
  2306. }
  2307. _createClass(StringArrayRotateFunctionNode, [{
  2308. key: 'appendNode',
  2309. value: function appendNode(blockScopeNode) {
  2310. if (!this.stringArray.getLength()) {
  2311. return;
  2312. }
  2313. NodeAppender_1.NodeAppender.insertNodeAtIndex(blockScopeNode, this.getNode(), 1);
  2314. }
  2315. }, {
  2316. key: 'getCode',
  2317. value: function getCode() {
  2318. var code = '',
  2319. timesName = Utils_1.Utils.getRandomVariableName(),
  2320. whileFunctionName = Utils_1.Utils.getRandomVariableName();
  2321. if (this.options.selfDefending) {
  2322. code = format(SelfDefendingTemplate_1.SelfDefendingTemplate(), {
  2323. timesName: timesName,
  2324. whileFunctionName: whileFunctionName
  2325. });
  2326. } else {
  2327. code = whileFunctionName + '(++' + timesName + ')';
  2328. }
  2329. return JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(format(StringArrayRotateFunctionTemplate_1.StringArrayRotateFunctionTemplate(), {
  2330. code: code,
  2331. timesName: timesName,
  2332. stringArrayName: this.stringArrayName,
  2333. stringArrayRotateValue: Utils_1.Utils.decToHex(this.stringArrayRotateValue),
  2334. whileFunctionName: whileFunctionName
  2335. }), Object.assign({}, NoCustomNodesPreset_1.NO_CUSTOM_NODES_PRESET, {
  2336. seed: this.options.seed
  2337. })).getObfuscatedCode();
  2338. }
  2339. }]);
  2340. return StringArrayRotateFunctionNode;
  2341. }(AbstractCustomNode_1.AbstractCustomNode);
  2342. exports.StringArrayRotateFunctionNode = StringArrayRotateFunctionNode;
  2343. /***/ },
  2344. /* 45 */
  2345. /***/ function(module, exports, __webpack_require__) {
  2346. "use strict";
  2347. "use strict";
  2348. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  2349. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2350. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  2351. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  2352. var ConsoleOutputDisableExpressionNode_1 = __webpack_require__(33);
  2353. var NodeCallsControllerFunctionNode_1 = __webpack_require__(17);
  2354. var AbstractNodesGroup_1 = __webpack_require__(12);
  2355. var NodeAppender_1 = __webpack_require__(3);
  2356. var Utils_1 = __webpack_require__(0);
  2357. var ConsoleOutputNodesGroup = function (_AbstractNodesGroup_) {
  2358. _inherits(ConsoleOutputNodesGroup, _AbstractNodesGroup_);
  2359. function ConsoleOutputNodesGroup() {
  2360. _classCallCheck(this, ConsoleOutputNodesGroup);
  2361. return _possibleConstructorReturn(this, (ConsoleOutputNodesGroup.__proto__ || Object.getPrototypeOf(ConsoleOutputNodesGroup)).apply(this, arguments));
  2362. }
  2363. _createClass(ConsoleOutputNodesGroup, [{
  2364. key: 'getNodes',
  2365. value: function getNodes() {
  2366. if (!this.options.disableConsoleOutput) {
  2367. return;
  2368. }
  2369. var callsControllerFunctionName = Utils_1.Utils.getRandomVariableName();
  2370. var randomStackTraceIndex = NodeAppender_1.NodeAppender.getRandomStackTraceIndex(this.stackTraceData.length);
  2371. return this.syncCustomNodesWithNodesGroup(new Map([['consoleOutputDisableExpressionNode', new ConsoleOutputDisableExpressionNode_1.ConsoleOutputDisableExpressionNode(this.stackTraceData, callsControllerFunctionName, randomStackTraceIndex, this.options)], ['ConsoleOutputNodeCallsControllerFunctionNode', new NodeCallsControllerFunctionNode_1.NodeCallsControllerFunctionNode(this.stackTraceData, callsControllerFunctionName, randomStackTraceIndex, this.options)]]));
  2372. }
  2373. }]);
  2374. return ConsoleOutputNodesGroup;
  2375. }(AbstractNodesGroup_1.AbstractNodesGroup);
  2376. exports.ConsoleOutputNodesGroup = ConsoleOutputNodesGroup;
  2377. /***/ },
  2378. /* 46 */
  2379. /***/ function(module, exports, __webpack_require__) {
  2380. "use strict";
  2381. "use strict";
  2382. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  2383. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2384. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  2385. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  2386. var DebugProtectionFunctionCallNode_1 = __webpack_require__(37);
  2387. var DebugProtectionFunctionIntervalNode_1 = __webpack_require__(38);
  2388. var DebugProtectionFunctionNode_1 = __webpack_require__(39);
  2389. var AbstractNodesGroup_1 = __webpack_require__(12);
  2390. var Utils_1 = __webpack_require__(0);
  2391. var DebugProtectionNodesGroup = function (_AbstractNodesGroup_) {
  2392. _inherits(DebugProtectionNodesGroup, _AbstractNodesGroup_);
  2393. function DebugProtectionNodesGroup() {
  2394. _classCallCheck(this, DebugProtectionNodesGroup);
  2395. return _possibleConstructorReturn(this, (DebugProtectionNodesGroup.__proto__ || Object.getPrototypeOf(DebugProtectionNodesGroup)).apply(this, arguments));
  2396. }
  2397. _createClass(DebugProtectionNodesGroup, [{
  2398. key: 'getNodes',
  2399. value: function getNodes() {
  2400. if (!this.options.debugProtection) {
  2401. return;
  2402. }
  2403. var debugProtectionFunctionName = Utils_1.Utils.getRandomVariableName();
  2404. var customNodes = new Map([['debugProtectionFunctionNode', new DebugProtectionFunctionNode_1.DebugProtectionFunctionNode(debugProtectionFunctionName, this.options)], ['debugProtectionFunctionCallNode', new DebugProtectionFunctionCallNode_1.DebugProtectionFunctionCallNode(debugProtectionFunctionName, this.options)]]);
  2405. if (this.options.debugProtectionInterval) {
  2406. customNodes.set('debugProtectionFunctionIntervalNode', new DebugProtectionFunctionIntervalNode_1.DebugProtectionFunctionIntervalNode(debugProtectionFunctionName, this.options));
  2407. }
  2408. return this.syncCustomNodesWithNodesGroup(customNodes);
  2409. }
  2410. }]);
  2411. return DebugProtectionNodesGroup;
  2412. }(AbstractNodesGroup_1.AbstractNodesGroup);
  2413. exports.DebugProtectionNodesGroup = DebugProtectionNodesGroup;
  2414. /***/ },
  2415. /* 47 */
  2416. /***/ function(module, exports, __webpack_require__) {
  2417. "use strict";
  2418. "use strict";
  2419. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  2420. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2421. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  2422. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  2423. var DomainLockNode_1 = __webpack_require__(40);
  2424. var NodeCallsControllerFunctionNode_1 = __webpack_require__(17);
  2425. var AbstractNodesGroup_1 = __webpack_require__(12);
  2426. var NodeAppender_1 = __webpack_require__(3);
  2427. var Utils_1 = __webpack_require__(0);
  2428. var DomainLockNodesGroup = function (_AbstractNodesGroup_) {
  2429. _inherits(DomainLockNodesGroup, _AbstractNodesGroup_);
  2430. function DomainLockNodesGroup() {
  2431. _classCallCheck(this, DomainLockNodesGroup);
  2432. return _possibleConstructorReturn(this, (DomainLockNodesGroup.__proto__ || Object.getPrototypeOf(DomainLockNodesGroup)).apply(this, arguments));
  2433. }
  2434. _createClass(DomainLockNodesGroup, [{
  2435. key: 'getNodes',
  2436. value: function getNodes() {
  2437. if (!this.options.domainLock.length) {
  2438. return;
  2439. }
  2440. var callsControllerFunctionName = Utils_1.Utils.getRandomVariableName();
  2441. var randomStackTraceIndex = NodeAppender_1.NodeAppender.getRandomStackTraceIndex(this.stackTraceData.length);
  2442. return this.syncCustomNodesWithNodesGroup(new Map([['DomainLockNode', new DomainLockNode_1.DomainLockNode(this.stackTraceData, callsControllerFunctionName, randomStackTraceIndex, this.options)], ['DomainLockNodeCallsControllerFunctionNode', new NodeCallsControllerFunctionNode_1.NodeCallsControllerFunctionNode(this.stackTraceData, callsControllerFunctionName, randomStackTraceIndex, this.options)]]));
  2443. }
  2444. }]);
  2445. return DomainLockNodesGroup;
  2446. }(AbstractNodesGroup_1.AbstractNodesGroup);
  2447. exports.DomainLockNodesGroup = DomainLockNodesGroup;
  2448. /***/ },
  2449. /* 48 */
  2450. /***/ function(module, exports, __webpack_require__) {
  2451. "use strict";
  2452. "use strict";
  2453. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  2454. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2455. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  2456. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  2457. var AppendState_1 = __webpack_require__(1);
  2458. var NodeCallsControllerFunctionNode_1 = __webpack_require__(17);
  2459. var SelfDefendingUnicodeNode_1 = __webpack_require__(41);
  2460. var AbstractNodesGroup_1 = __webpack_require__(12);
  2461. var NodeAppender_1 = __webpack_require__(3);
  2462. var Utils_1 = __webpack_require__(0);
  2463. var SelfDefendingNodesGroup = function (_AbstractNodesGroup_) {
  2464. _inherits(SelfDefendingNodesGroup, _AbstractNodesGroup_);
  2465. function SelfDefendingNodesGroup() {
  2466. _classCallCheck(this, SelfDefendingNodesGroup);
  2467. var _this = _possibleConstructorReturn(this, (SelfDefendingNodesGroup.__proto__ || Object.getPrototypeOf(SelfDefendingNodesGroup)).apply(this, arguments));
  2468. _this.appendState = AppendState_1.AppendState.AfterObfuscation;
  2469. return _this;
  2470. }
  2471. _createClass(SelfDefendingNodesGroup, [{
  2472. key: 'getNodes',
  2473. value: function getNodes() {
  2474. if (!this.options.selfDefending) {
  2475. return;
  2476. }
  2477. var callsControllerFunctionName = Utils_1.Utils.getRandomVariableName();
  2478. var randomStackTraceIndex = NodeAppender_1.NodeAppender.getRandomStackTraceIndex(this.stackTraceData.length);
  2479. return this.syncCustomNodesWithNodesGroup(new Map([['selfDefendingUnicodeNode', new SelfDefendingUnicodeNode_1.SelfDefendingUnicodeNode(this.stackTraceData, callsControllerFunctionName, randomStackTraceIndex, this.options)], ['SelfDefendingNodeCallsControllerFunctionNode', new NodeCallsControllerFunctionNode_1.NodeCallsControllerFunctionNode(this.stackTraceData, callsControllerFunctionName, randomStackTraceIndex, this.options)]]));
  2480. }
  2481. }]);
  2482. return SelfDefendingNodesGroup;
  2483. }(AbstractNodesGroup_1.AbstractNodesGroup);
  2484. exports.SelfDefendingNodesGroup = SelfDefendingNodesGroup;
  2485. /***/ },
  2486. /* 49 */
  2487. /***/ function(module, exports, __webpack_require__) {
  2488. "use strict";
  2489. "use strict";
  2490. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  2491. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2492. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  2493. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  2494. var AppendState_1 = __webpack_require__(1);
  2495. var StringArrayCallsWrapper_1 = __webpack_require__(42);
  2496. var StringArrayNode_1 = __webpack_require__(43);
  2497. var StringArrayRotateFunctionNode_1 = __webpack_require__(44);
  2498. var AbstractNodesGroup_1 = __webpack_require__(12);
  2499. var StringArrayStorage_1 = __webpack_require__(74);
  2500. var Utils_1 = __webpack_require__(0);
  2501. var StringArrayNodesGroup = function (_AbstractNodesGroup_) {
  2502. _inherits(StringArrayNodesGroup, _AbstractNodesGroup_);
  2503. function StringArrayNodesGroup() {
  2504. _classCallCheck(this, StringArrayNodesGroup);
  2505. var _this = _possibleConstructorReturn(this, (StringArrayNodesGroup.__proto__ || Object.getPrototypeOf(StringArrayNodesGroup)).apply(this, arguments));
  2506. _this.appendState = AppendState_1.AppendState.AfterObfuscation;
  2507. _this.stringArrayName = Utils_1.Utils.getRandomVariableName(StringArrayNode_1.StringArrayNode.ARRAY_RANDOM_LENGTH);
  2508. _this.stringArrayCallsWrapper = Utils_1.Utils.getRandomVariableName(StringArrayNode_1.StringArrayNode.ARRAY_RANDOM_LENGTH);
  2509. return _this;
  2510. }
  2511. _createClass(StringArrayNodesGroup, [{
  2512. key: 'getNodes',
  2513. value: function getNodes() {
  2514. if (!this.options.stringArray) {
  2515. return;
  2516. }
  2517. if (this.options.rotateStringArray) {
  2518. this.stringArrayRotateValue = Utils_1.Utils.getRandomInteger(100, 500);
  2519. } else {
  2520. this.stringArrayRotateValue = 0;
  2521. }
  2522. var stringArray = new StringArrayStorage_1.StringArrayStorage();
  2523. var stringArrayNode = new StringArrayNode_1.StringArrayNode(stringArray, this.stringArrayName, this.stringArrayRotateValue, this.options);
  2524. var customNodes = new Map([['stringArrayNode', stringArrayNode], ['stringArrayCallsWrapper', new StringArrayCallsWrapper_1.StringArrayCallsWrapper(this.stringArrayCallsWrapper, this.stringArrayName, stringArray, this.options)]]);
  2525. if (this.options.rotateStringArray) {
  2526. customNodes.set('stringArrayRotateFunctionNode', new StringArrayRotateFunctionNode_1.StringArrayRotateFunctionNode(this.stringArrayName, stringArray, this.stringArrayRotateValue, this.options));
  2527. }
  2528. return this.syncCustomNodesWithNodesGroup(customNodes);
  2529. }
  2530. }]);
  2531. return StringArrayNodesGroup;
  2532. }(AbstractNodesGroup_1.AbstractNodesGroup);
  2533. exports.StringArrayNodesGroup = StringArrayNodesGroup;
  2534. /***/ },
  2535. /* 50 */
  2536. /***/ function(module, exports, __webpack_require__) {
  2537. "use strict";
  2538. "use strict";
  2539. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  2540. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2541. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  2542. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  2543. var estraverse = __webpack_require__(4);
  2544. var NodeType_1 = __webpack_require__(7);
  2545. var AbstractNodeTransformer_1 = __webpack_require__(9);
  2546. var BinaryExpressionControlFlowReplacer_1 = __webpack_require__(52);
  2547. var ControlFlowStorage_1 = __webpack_require__(73);
  2548. var ControlFlowStorageNode_1 = __webpack_require__(36);
  2549. var Node_1 = __webpack_require__(2);
  2550. var NodeAppender_1 = __webpack_require__(3);
  2551. var Utils_1 = __webpack_require__(0);
  2552. var NodeUtils_1 = __webpack_require__(8);
  2553. var FunctionControlFlowTransformer = function (_AbstractNodeTransfor) {
  2554. _inherits(FunctionControlFlowTransformer, _AbstractNodeTransfor);
  2555. function FunctionControlFlowTransformer(nodes, options) {
  2556. _classCallCheck(this, FunctionControlFlowTransformer);
  2557. return _possibleConstructorReturn(this, (FunctionControlFlowTransformer.__proto__ || Object.getPrototypeOf(FunctionControlFlowTransformer)).call(this, nodes, options));
  2558. }
  2559. _createClass(FunctionControlFlowTransformer, [{
  2560. key: 'transformNode',
  2561. value: function transformNode(functionNode) {
  2562. this.changeFunctionBodyControlFlow(functionNode);
  2563. }
  2564. }, {
  2565. key: 'changeFunctionBodyControlFlow',
  2566. value: function changeFunctionBodyControlFlow(functionNode) {
  2567. var _this2 = this;
  2568. if (Node_1.Node.isArrowFunctionExpressionNode(functionNode)) {
  2569. return;
  2570. }
  2571. var controlFlowStorage = new ControlFlowStorage_1.ControlFlowStorage();
  2572. var controlFlowStorageCustomNodeName = Utils_1.Utils.getRandomVariableName(6);
  2573. console.log(NodeUtils_1.NodeUtils.getNodeBlockScopeDepth(functionNode.body));
  2574. estraverse.replace(functionNode.body, {
  2575. enter: function enter(node, parentNode) {
  2576. var controlFlowReplacer = FunctionControlFlowTransformer.controlFlowReplacers.get(node.type);
  2577. if (!controlFlowReplacer) {
  2578. return;
  2579. }
  2580. var controlFlowStorageCallCustomNode = new controlFlowReplacer(_this2.nodes, _this2.options).replace(node, parentNode, controlFlowStorage, controlFlowStorageCustomNodeName);
  2581. if (!controlFlowStorageCallCustomNode) {
  2582. return;
  2583. }
  2584. var statementNode = controlFlowStorageCallCustomNode.getNode()[0];
  2585. if (!statementNode || !Node_1.Node.isExpressionStatementNode(statementNode)) {
  2586. throw new Error('`controlFlowStorageCallCustomNode.getNode()` should returns array with `ExpressionStatement` node');
  2587. }
  2588. return statementNode.expression;
  2589. }
  2590. });
  2591. var controlFlowStorageCustomNode = new ControlFlowStorageNode_1.ControlFlowStorageNode(controlFlowStorage, controlFlowStorageCustomNodeName, this.options);
  2592. NodeAppender_1.NodeAppender.prependNode(functionNode.body, controlFlowStorageCustomNode.getNode());
  2593. }
  2594. }]);
  2595. return FunctionControlFlowTransformer;
  2596. }(AbstractNodeTransformer_1.AbstractNodeTransformer);
  2597. FunctionControlFlowTransformer.controlFlowReplacers = new Map([[NodeType_1.NodeType.BinaryExpression, BinaryExpressionControlFlowReplacer_1.BinaryExpressionControlFlowReplacer]]);
  2598. exports.FunctionControlFlowTransformer = FunctionControlFlowTransformer;
  2599. /***/ },
  2600. /* 51 */
  2601. /***/ function(module, exports, __webpack_require__) {
  2602. "use strict";
  2603. "use strict";
  2604. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  2605. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2606. var Utils_1 = __webpack_require__(0);
  2607. var AbstractControlFlowReplacer = function () {
  2608. function AbstractControlFlowReplacer(nodes, options) {
  2609. _classCallCheck(this, AbstractControlFlowReplacer);
  2610. this.nodes = nodes;
  2611. this.options = options;
  2612. }
  2613. _createClass(AbstractControlFlowReplacer, null, [{
  2614. key: "getStorageKey",
  2615. value: function getStorageKey() {
  2616. return Utils_1.Utils.getRandomGenerator().string({
  2617. length: 3,
  2618. pool: Utils_1.Utils.randomGeneratorPool
  2619. });
  2620. }
  2621. }]);
  2622. return AbstractControlFlowReplacer;
  2623. }();
  2624. exports.AbstractControlFlowReplacer = AbstractControlFlowReplacer;
  2625. /***/ },
  2626. /* 52 */
  2627. /***/ function(module, exports, __webpack_require__) {
  2628. "use strict";
  2629. "use strict";
  2630. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  2631. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2632. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  2633. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  2634. var escodegen = __webpack_require__(11);
  2635. var AbstractControlFlowReplacer_1 = __webpack_require__(51);
  2636. var BinaryExpressionFunctionNode_1 = __webpack_require__(34);
  2637. var ControlFlowStorageCallNode_1 = __webpack_require__(35);
  2638. var BinaryExpressionControlFlowReplacer = function (_AbstractControlFlowR) {
  2639. _inherits(BinaryExpressionControlFlowReplacer, _AbstractControlFlowR);
  2640. function BinaryExpressionControlFlowReplacer() {
  2641. _classCallCheck(this, BinaryExpressionControlFlowReplacer);
  2642. return _possibleConstructorReturn(this, (BinaryExpressionControlFlowReplacer.__proto__ || Object.getPrototypeOf(BinaryExpressionControlFlowReplacer)).apply(this, arguments));
  2643. }
  2644. _createClass(BinaryExpressionControlFlowReplacer, [{
  2645. key: 'replace',
  2646. value: function replace(binaryExpressionNode, parentNode, controlFlowStorage, controlFlowStorageCustomNodeName) {
  2647. var key = AbstractControlFlowReplacer_1.AbstractControlFlowReplacer.getStorageKey();
  2648. controlFlowStorage.set(key, new BinaryExpressionFunctionNode_1.BinaryExpressionFunctionNode(binaryExpressionNode.operator, this.options));
  2649. return new ControlFlowStorageCallNode_1.ControlFlowStorageCallNode(controlFlowStorageCustomNodeName, key, BinaryExpressionControlFlowReplacer.getExpressionValue(binaryExpressionNode.left), BinaryExpressionControlFlowReplacer.getExpressionValue(binaryExpressionNode.right), this.options);
  2650. }
  2651. }], [{
  2652. key: 'getExpressionValue',
  2653. value: function getExpressionValue(expressionNode) {
  2654. return escodegen.generate(expressionNode, {
  2655. sourceMapWithCode: true
  2656. }).code;
  2657. }
  2658. }]);
  2659. return BinaryExpressionControlFlowReplacer;
  2660. }(AbstractControlFlowReplacer_1.AbstractControlFlowReplacer);
  2661. exports.BinaryExpressionControlFlowReplacer = BinaryExpressionControlFlowReplacer;
  2662. /***/ },
  2663. /* 53 */
  2664. /***/ function(module, exports, __webpack_require__) {
  2665. "use strict";
  2666. "use strict";
  2667. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  2668. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2669. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  2670. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  2671. var estraverse = __webpack_require__(4);
  2672. var NodeType_1 = __webpack_require__(7);
  2673. var AbstractNodeTransformer_1 = __webpack_require__(9);
  2674. var IdentifierReplacer_1 = __webpack_require__(13);
  2675. var Node_1 = __webpack_require__(2);
  2676. var NodeUtils_1 = __webpack_require__(8);
  2677. var CatchClauseObfuscator = function (_AbstractNodeTransfor) {
  2678. _inherits(CatchClauseObfuscator, _AbstractNodeTransfor);
  2679. function CatchClauseObfuscator(nodes, options) {
  2680. _classCallCheck(this, CatchClauseObfuscator);
  2681. var _this = _possibleConstructorReturn(this, (CatchClauseObfuscator.__proto__ || Object.getPrototypeOf(CatchClauseObfuscator)).call(this, nodes, options));
  2682. _this.identifierReplacer = new IdentifierReplacer_1.IdentifierReplacer(_this.nodes, _this.options);
  2683. return _this;
  2684. }
  2685. _createClass(CatchClauseObfuscator, [{
  2686. key: 'transformNode',
  2687. value: function transformNode(catchClauseNode) {
  2688. this.storeCatchClauseParam(catchClauseNode);
  2689. this.replaceCatchClauseParam(catchClauseNode);
  2690. }
  2691. }, {
  2692. key: 'storeCatchClauseParam',
  2693. value: function storeCatchClauseParam(catchClauseNode) {
  2694. var _this2 = this;
  2695. NodeUtils_1.NodeUtils.typedReplace(catchClauseNode.param, NodeType_1.NodeType.Identifier, {
  2696. enter: function enter(node) {
  2697. return _this2.identifierReplacer.storeNames(node.name);
  2698. }
  2699. });
  2700. }
  2701. }, {
  2702. key: 'replaceCatchClauseParam',
  2703. value: function replaceCatchClauseParam(catchClauseNode) {
  2704. var _this3 = this;
  2705. estraverse.replace(catchClauseNode, {
  2706. enter: function enter(node, parentNode) {
  2707. if (Node_1.Node.isReplaceableIdentifierNode(node, parentNode)) {
  2708. node.name = _this3.identifierReplacer.replace(node.name);
  2709. }
  2710. }
  2711. });
  2712. }
  2713. }]);
  2714. return CatchClauseObfuscator;
  2715. }(AbstractNodeTransformer_1.AbstractNodeTransformer);
  2716. exports.CatchClauseObfuscator = CatchClauseObfuscator;
  2717. /***/ },
  2718. /* 54 */
  2719. /***/ function(module, exports, __webpack_require__) {
  2720. "use strict";
  2721. "use strict";
  2722. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  2723. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2724. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  2725. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  2726. var estraverse = __webpack_require__(4);
  2727. var NodeType_1 = __webpack_require__(7);
  2728. var AbstractNodeTransformer_1 = __webpack_require__(9);
  2729. var IdentifierReplacer_1 = __webpack_require__(13);
  2730. var Node_1 = __webpack_require__(2);
  2731. var NodeUtils_1 = __webpack_require__(8);
  2732. var FunctionDeclarationObfuscator = function (_AbstractNodeTransfor) {
  2733. _inherits(FunctionDeclarationObfuscator, _AbstractNodeTransfor);
  2734. function FunctionDeclarationObfuscator(nodes, options) {
  2735. _classCallCheck(this, FunctionDeclarationObfuscator);
  2736. var _this = _possibleConstructorReturn(this, (FunctionDeclarationObfuscator.__proto__ || Object.getPrototypeOf(FunctionDeclarationObfuscator)).call(this, nodes, options));
  2737. _this.identifierReplacer = new IdentifierReplacer_1.IdentifierReplacer(_this.nodes, _this.options);
  2738. return _this;
  2739. }
  2740. _createClass(FunctionDeclarationObfuscator, [{
  2741. key: 'transformNode',
  2742. value: function transformNode(functionDeclarationNode, parentNode) {
  2743. var blockScopeOfFunctionDeclarationNode = NodeUtils_1.NodeUtils.getBlockScopeOfNode(functionDeclarationNode);
  2744. if (blockScopeOfFunctionDeclarationNode.type === NodeType_1.NodeType.Program) {
  2745. return;
  2746. }
  2747. this.storeFunctionName(functionDeclarationNode);
  2748. this.replaceFunctionName(blockScopeOfFunctionDeclarationNode);
  2749. }
  2750. }, {
  2751. key: 'storeFunctionName',
  2752. value: function storeFunctionName(functionDeclarationNode) {
  2753. var _this2 = this;
  2754. NodeUtils_1.NodeUtils.typedReplace(functionDeclarationNode.id, NodeType_1.NodeType.Identifier, {
  2755. enter: function enter(node) {
  2756. return _this2.identifierReplacer.storeNames(node.name);
  2757. }
  2758. });
  2759. }
  2760. }, {
  2761. key: 'replaceFunctionName',
  2762. value: function replaceFunctionName(scopeNode) {
  2763. var _this3 = this;
  2764. estraverse.replace(scopeNode, {
  2765. enter: function enter(node, parentNode) {
  2766. if (Node_1.Node.isReplaceableIdentifierNode(node, parentNode)) {
  2767. node.name = _this3.identifierReplacer.replace(node.name);
  2768. }
  2769. }
  2770. });
  2771. }
  2772. }]);
  2773. return FunctionDeclarationObfuscator;
  2774. }(AbstractNodeTransformer_1.AbstractNodeTransformer);
  2775. exports.FunctionDeclarationObfuscator = FunctionDeclarationObfuscator;
  2776. /***/ },
  2777. /* 55 */
  2778. /***/ function(module, exports, __webpack_require__) {
  2779. "use strict";
  2780. "use strict";
  2781. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  2782. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2783. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  2784. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  2785. var estraverse = __webpack_require__(4);
  2786. var NodeType_1 = __webpack_require__(7);
  2787. var AbstractNodeTransformer_1 = __webpack_require__(9);
  2788. var IdentifierReplacer_1 = __webpack_require__(13);
  2789. var Node_1 = __webpack_require__(2);
  2790. var NodeUtils_1 = __webpack_require__(8);
  2791. var FunctionObfuscator = function (_AbstractNodeTransfor) {
  2792. _inherits(FunctionObfuscator, _AbstractNodeTransfor);
  2793. function FunctionObfuscator(nodes, options) {
  2794. _classCallCheck(this, FunctionObfuscator);
  2795. var _this = _possibleConstructorReturn(this, (FunctionObfuscator.__proto__ || Object.getPrototypeOf(FunctionObfuscator)).call(this, nodes, options));
  2796. _this.identifierReplacer = new IdentifierReplacer_1.IdentifierReplacer(_this.nodes, _this.options);
  2797. return _this;
  2798. }
  2799. _createClass(FunctionObfuscator, [{
  2800. key: 'transformNode',
  2801. value: function transformNode(functionNode) {
  2802. this.storeFunctionParams(functionNode);
  2803. this.replaceFunctionParams(functionNode);
  2804. }
  2805. }, {
  2806. key: 'storeFunctionParams',
  2807. value: function storeFunctionParams(functionNode) {
  2808. var _this2 = this;
  2809. functionNode.params.forEach(function (paramsNode) {
  2810. NodeUtils_1.NodeUtils.typedReplace(paramsNode, NodeType_1.NodeType.Identifier, {
  2811. enter: function enter(node) {
  2812. return _this2.identifierReplacer.storeNames(node.name);
  2813. }
  2814. });
  2815. });
  2816. }
  2817. }, {
  2818. key: 'replaceFunctionParams',
  2819. value: function replaceFunctionParams(functionNode) {
  2820. var _this3 = this;
  2821. var replaceVisitor = {
  2822. enter: function enter(node, parentNode) {
  2823. if (Node_1.Node.isReplaceableIdentifierNode(node, parentNode)) {
  2824. var newNodeName = _this3.identifierReplacer.replace(node.name);
  2825. if (node.name !== newNodeName) {
  2826. node.name = newNodeName;
  2827. node.obfuscated = true;
  2828. }
  2829. }
  2830. }
  2831. };
  2832. functionNode.params.forEach(function (paramsNode) {
  2833. estraverse.replace(paramsNode, replaceVisitor);
  2834. });
  2835. estraverse.replace(functionNode.body, replaceVisitor);
  2836. }
  2837. }]);
  2838. return FunctionObfuscator;
  2839. }(AbstractNodeTransformer_1.AbstractNodeTransformer);
  2840. exports.FunctionObfuscator = FunctionObfuscator;
  2841. /***/ },
  2842. /* 56 */
  2843. /***/ function(module, exports, __webpack_require__) {
  2844. "use strict";
  2845. "use strict";
  2846. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  2847. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2848. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  2849. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  2850. var estraverse = __webpack_require__(4);
  2851. var NodeType_1 = __webpack_require__(7);
  2852. var AbstractNodeTransformer_1 = __webpack_require__(9);
  2853. var IdentifierReplacer_1 = __webpack_require__(13);
  2854. var Node_1 = __webpack_require__(2);
  2855. var NodeUtils_1 = __webpack_require__(8);
  2856. var LabeledStatementObfuscator = function (_AbstractNodeTransfor) {
  2857. _inherits(LabeledStatementObfuscator, _AbstractNodeTransfor);
  2858. function LabeledStatementObfuscator(nodes, options) {
  2859. _classCallCheck(this, LabeledStatementObfuscator);
  2860. var _this = _possibleConstructorReturn(this, (LabeledStatementObfuscator.__proto__ || Object.getPrototypeOf(LabeledStatementObfuscator)).call(this, nodes, options));
  2861. _this.identifierReplacer = new IdentifierReplacer_1.IdentifierReplacer(_this.nodes, _this.options);
  2862. return _this;
  2863. }
  2864. _createClass(LabeledStatementObfuscator, [{
  2865. key: 'transformNode',
  2866. value: function transformNode(labeledStatementNode) {
  2867. this.storeLabeledStatementName(labeledStatementNode);
  2868. this.replaceLabeledStatementName(labeledStatementNode);
  2869. }
  2870. }, {
  2871. key: 'storeLabeledStatementName',
  2872. value: function storeLabeledStatementName(labeledStatementNode) {
  2873. var _this2 = this;
  2874. NodeUtils_1.NodeUtils.typedReplace(labeledStatementNode.label, NodeType_1.NodeType.Identifier, {
  2875. enter: function enter(node) {
  2876. return _this2.identifierReplacer.storeNames(node.name);
  2877. }
  2878. });
  2879. }
  2880. }, {
  2881. key: 'replaceLabeledStatementName',
  2882. value: function replaceLabeledStatementName(labeledStatementNode) {
  2883. var _this3 = this;
  2884. estraverse.replace(labeledStatementNode, {
  2885. enter: function enter(node, parentNode) {
  2886. if (Node_1.Node.isLabelIdentifierNode(node, parentNode)) {
  2887. node.name = _this3.identifierReplacer.replace(node.name);
  2888. }
  2889. }
  2890. });
  2891. }
  2892. }]);
  2893. return LabeledStatementObfuscator;
  2894. }(AbstractNodeTransformer_1.AbstractNodeTransformer);
  2895. exports.LabeledStatementObfuscator = LabeledStatementObfuscator;
  2896. /***/ },
  2897. /* 57 */
  2898. /***/ function(module, exports, __webpack_require__) {
  2899. "use strict";
  2900. "use strict";
  2901. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  2902. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  2903. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2904. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  2905. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  2906. var escodegen = __webpack_require__(11);
  2907. var AbstractNodeTransformer_1 = __webpack_require__(9);
  2908. var BooleanLiteralReplacer_1 = __webpack_require__(62);
  2909. var Node_1 = __webpack_require__(2);
  2910. var NumberLiteralReplacer_1 = __webpack_require__(22);
  2911. var StringLiteralReplacer_1 = __webpack_require__(19);
  2912. var LiteralObfuscator = function (_AbstractNodeTransfor) {
  2913. _inherits(LiteralObfuscator, _AbstractNodeTransfor);
  2914. function LiteralObfuscator() {
  2915. _classCallCheck(this, LiteralObfuscator);
  2916. return _possibleConstructorReturn(this, (LiteralObfuscator.__proto__ || Object.getPrototypeOf(LiteralObfuscator)).apply(this, arguments));
  2917. }
  2918. _createClass(LiteralObfuscator, [{
  2919. key: 'transformNode',
  2920. value: function transformNode(literalNode, parentNode) {
  2921. if (Node_1.Node.isPropertyNode(parentNode) && parentNode.key === literalNode) {
  2922. return;
  2923. }
  2924. var content = void 0;
  2925. switch (_typeof(literalNode.value)) {
  2926. case 'boolean':
  2927. content = new BooleanLiteralReplacer_1.BooleanLiteralReplacer(this.nodes, this.options).replace(literalNode.value);
  2928. break;
  2929. case 'number':
  2930. content = new NumberLiteralReplacer_1.NumberLiteralReplacer(this.nodes, this.options).replace(literalNode.value);
  2931. break;
  2932. case 'string':
  2933. content = new StringLiteralReplacer_1.StringLiteralReplacer(this.nodes, this.options).replace(literalNode.value);
  2934. break;
  2935. default:
  2936. return;
  2937. }
  2938. literalNode['x-verbatim-property'] = {
  2939. content: content,
  2940. precedence: escodegen.Precedence.Primary
  2941. };
  2942. }
  2943. }]);
  2944. return LiteralObfuscator;
  2945. }(AbstractNodeTransformer_1.AbstractNodeTransformer);
  2946. exports.LiteralObfuscator = LiteralObfuscator;
  2947. /***/ },
  2948. /* 58 */
  2949. /***/ function(module, exports, __webpack_require__) {
  2950. "use strict";
  2951. "use strict";
  2952. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  2953. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2954. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  2955. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  2956. var escodegen = __webpack_require__(11);
  2957. var estraverse = __webpack_require__(4);
  2958. var NodeType_1 = __webpack_require__(7);
  2959. var AbstractNodeTransformer_1 = __webpack_require__(9);
  2960. var Node_1 = __webpack_require__(2);
  2961. var StringLiteralReplacer_1 = __webpack_require__(19);
  2962. var MemberExpressionObfuscator = function (_AbstractNodeTransfor) {
  2963. _inherits(MemberExpressionObfuscator, _AbstractNodeTransfor);
  2964. function MemberExpressionObfuscator() {
  2965. _classCallCheck(this, MemberExpressionObfuscator);
  2966. return _possibleConstructorReturn(this, (MemberExpressionObfuscator.__proto__ || Object.getPrototypeOf(MemberExpressionObfuscator)).apply(this, arguments));
  2967. }
  2968. _createClass(MemberExpressionObfuscator, [{
  2969. key: 'transformNode',
  2970. value: function transformNode(memberExpressionNode) {
  2971. var _this2 = this;
  2972. estraverse.replace(memberExpressionNode.property, {
  2973. enter: function enter(node, parentNode) {
  2974. if (Node_1.Node.isLiteralNode(node)) {
  2975. _this2.obfuscateLiteralProperty(node);
  2976. return;
  2977. }
  2978. if (Node_1.Node.isIdentifierNode(node)) {
  2979. if (memberExpressionNode.computed) {
  2980. return;
  2981. }
  2982. memberExpressionNode.computed = true;
  2983. _this2.obfuscateIdentifierProperty(node);
  2984. }
  2985. }
  2986. });
  2987. }
  2988. }, {
  2989. key: 'obfuscateIdentifierProperty',
  2990. value: function obfuscateIdentifierProperty(node) {
  2991. var nodeValue = node.name,
  2992. literalNode = {
  2993. raw: '\'' + nodeValue + '\'',
  2994. 'x-verbatim-property': {
  2995. content: new StringLiteralReplacer_1.StringLiteralReplacer(this.nodes, this.options).replace(nodeValue),
  2996. precedence: escodegen.Precedence.Primary
  2997. },
  2998. type: NodeType_1.NodeType.Literal,
  2999. value: nodeValue
  3000. };
  3001. delete node.name;
  3002. Object.assign(node, literalNode);
  3003. }
  3004. }, {
  3005. key: 'obfuscateLiteralProperty',
  3006. value: function obfuscateLiteralProperty(node) {
  3007. if (typeof node.value === 'string' && !node['x-verbatim-property']) {
  3008. node['x-verbatim-property'] = {
  3009. content: new StringLiteralReplacer_1.StringLiteralReplacer(this.nodes, this.options).replace(node.value),
  3010. precedence: escodegen.Precedence.Primary
  3011. };
  3012. }
  3013. }
  3014. }]);
  3015. return MemberExpressionObfuscator;
  3016. }(AbstractNodeTransformer_1.AbstractNodeTransformer);
  3017. exports.MemberExpressionObfuscator = MemberExpressionObfuscator;
  3018. /***/ },
  3019. /* 59 */
  3020. /***/ function(module, exports, __webpack_require__) {
  3021. "use strict";
  3022. "use strict";
  3023. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  3024. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3025. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  3026. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  3027. var estraverse = __webpack_require__(4);
  3028. var AbstractNodeTransformer_1 = __webpack_require__(9);
  3029. var Node_1 = __webpack_require__(2);
  3030. var Utils_1 = __webpack_require__(0);
  3031. var StringLiteralReplacer_1 = __webpack_require__(19);
  3032. var MethodDefinitionObfuscator = function (_AbstractNodeTransfor) {
  3033. _inherits(MethodDefinitionObfuscator, _AbstractNodeTransfor);
  3034. function MethodDefinitionObfuscator() {
  3035. _classCallCheck(this, MethodDefinitionObfuscator);
  3036. return _possibleConstructorReturn(this, (MethodDefinitionObfuscator.__proto__ || Object.getPrototypeOf(MethodDefinitionObfuscator)).apply(this, arguments));
  3037. }
  3038. _createClass(MethodDefinitionObfuscator, [{
  3039. key: 'transformNode',
  3040. value: function transformNode(methodDefinitionNode, parentNode) {
  3041. this.replaceMethodName(methodDefinitionNode);
  3042. }
  3043. }, {
  3044. key: 'replaceMethodName',
  3045. value: function replaceMethodName(methodDefinitionNode) {
  3046. var _this2 = this;
  3047. estraverse.replace(methodDefinitionNode.key, {
  3048. enter: function enter(node) {
  3049. if (Node_1.Node.isIdentifierNode(node) && !Utils_1.Utils.arrayContains(MethodDefinitionObfuscator.ignoredNames, node.name) && methodDefinitionNode.computed === false) {
  3050. methodDefinitionNode.computed = true;
  3051. node.name = new StringLiteralReplacer_1.StringLiteralReplacer(_this2.nodes, _this2.options).replace(node.name);
  3052. return;
  3053. }
  3054. return estraverse.VisitorOption.Skip;
  3055. }
  3056. });
  3057. }
  3058. }]);
  3059. return MethodDefinitionObfuscator;
  3060. }(AbstractNodeTransformer_1.AbstractNodeTransformer);
  3061. MethodDefinitionObfuscator.ignoredNames = ['constructor'];
  3062. exports.MethodDefinitionObfuscator = MethodDefinitionObfuscator;
  3063. /***/ },
  3064. /* 60 */
  3065. /***/ function(module, exports, __webpack_require__) {
  3066. "use strict";
  3067. "use strict";
  3068. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  3069. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3070. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  3071. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  3072. var escodegen = __webpack_require__(11);
  3073. var estraverse = __webpack_require__(4);
  3074. var NodeType_1 = __webpack_require__(7);
  3075. var AbstractNodeTransformer_1 = __webpack_require__(9);
  3076. var Node_1 = __webpack_require__(2);
  3077. var Utils_1 = __webpack_require__(0);
  3078. var ObjectExpressionObfuscator = function (_AbstractNodeTransfor) {
  3079. _inherits(ObjectExpressionObfuscator, _AbstractNodeTransfor);
  3080. function ObjectExpressionObfuscator() {
  3081. _classCallCheck(this, ObjectExpressionObfuscator);
  3082. return _possibleConstructorReturn(this, (ObjectExpressionObfuscator.__proto__ || Object.getPrototypeOf(ObjectExpressionObfuscator)).apply(this, arguments));
  3083. }
  3084. _createClass(ObjectExpressionObfuscator, [{
  3085. key: 'transformNode',
  3086. value: function transformNode(objectExpressionNode) {
  3087. var _this2 = this;
  3088. objectExpressionNode.properties.forEach(function (property) {
  3089. if (property.shorthand) {
  3090. property.shorthand = false;
  3091. }
  3092. estraverse.replace(property.key, {
  3093. enter: function enter(node, parentNode) {
  3094. if (Node_1.Node.isLiteralNode(node)) {
  3095. _this2.obfuscateLiteralPropertyKey(node);
  3096. return;
  3097. }
  3098. if (Node_1.Node.isIdentifierNode(node)) {
  3099. _this2.obfuscateIdentifierPropertyKey(node);
  3100. }
  3101. }
  3102. });
  3103. });
  3104. }
  3105. }, {
  3106. key: 'obfuscateLiteralPropertyKey',
  3107. value: function obfuscateLiteralPropertyKey(node) {
  3108. if (typeof node.value === 'string' && !node['x-verbatim-property']) {
  3109. node['x-verbatim-property'] = {
  3110. content: '\'' + Utils_1.Utils.stringToUnicodeEscapeSequence(node.value) + '\'',
  3111. precedence: escodegen.Precedence.Primary
  3112. };
  3113. }
  3114. }
  3115. }, {
  3116. key: 'obfuscateIdentifierPropertyKey',
  3117. value: function obfuscateIdentifierPropertyKey(node) {
  3118. var nodeValue = node.name,
  3119. literalNode = {
  3120. raw: '\'' + nodeValue + '\'',
  3121. 'x-verbatim-property': {
  3122. content: '\'' + Utils_1.Utils.stringToUnicodeEscapeSequence(nodeValue) + '\'',
  3123. precedence: escodegen.Precedence.Primary
  3124. },
  3125. type: NodeType_1.NodeType.Literal,
  3126. value: nodeValue
  3127. };
  3128. delete node.name;
  3129. Object.assign(node, literalNode);
  3130. }
  3131. }]);
  3132. return ObjectExpressionObfuscator;
  3133. }(AbstractNodeTransformer_1.AbstractNodeTransformer);
  3134. exports.ObjectExpressionObfuscator = ObjectExpressionObfuscator;
  3135. /***/ },
  3136. /* 61 */
  3137. /***/ function(module, exports, __webpack_require__) {
  3138. "use strict";
  3139. "use strict";
  3140. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  3141. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3142. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  3143. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  3144. var estraverse = __webpack_require__(4);
  3145. var NodeType_1 = __webpack_require__(7);
  3146. var AbstractNodeTransformer_1 = __webpack_require__(9);
  3147. var IdentifierReplacer_1 = __webpack_require__(13);
  3148. var Node_1 = __webpack_require__(2);
  3149. var NodeUtils_1 = __webpack_require__(8);
  3150. var VariableDeclarationObfuscator = function (_AbstractNodeTransfor) {
  3151. _inherits(VariableDeclarationObfuscator, _AbstractNodeTransfor);
  3152. function VariableDeclarationObfuscator(nodes, options) {
  3153. _classCallCheck(this, VariableDeclarationObfuscator);
  3154. var _this = _possibleConstructorReturn(this, (VariableDeclarationObfuscator.__proto__ || Object.getPrototypeOf(VariableDeclarationObfuscator)).call(this, nodes, options));
  3155. _this.identifierReplacer = new IdentifierReplacer_1.IdentifierReplacer(_this.nodes, _this.options);
  3156. return _this;
  3157. }
  3158. _createClass(VariableDeclarationObfuscator, [{
  3159. key: 'transformNode',
  3160. value: function transformNode(variableDeclarationNode, parentNode) {
  3161. var blockScopeOfVariableDeclarationNode = NodeUtils_1.NodeUtils.getBlockScopeOfNode(variableDeclarationNode);
  3162. if (blockScopeOfVariableDeclarationNode.type === NodeType_1.NodeType.Program) {
  3163. return;
  3164. }
  3165. var scopeNode = variableDeclarationNode.kind === 'var' ? blockScopeOfVariableDeclarationNode : parentNode;
  3166. this.storeVariableNames(variableDeclarationNode);
  3167. this.replaceVariableNames(scopeNode);
  3168. }
  3169. }, {
  3170. key: 'storeVariableNames',
  3171. value: function storeVariableNames(variableDeclarationNode) {
  3172. var _this2 = this;
  3173. variableDeclarationNode.declarations.forEach(function (declarationNode) {
  3174. NodeUtils_1.NodeUtils.typedReplace(declarationNode.id, NodeType_1.NodeType.Identifier, {
  3175. enter: function enter(node) {
  3176. return _this2.identifierReplacer.storeNames(node.name);
  3177. }
  3178. });
  3179. });
  3180. }
  3181. }, {
  3182. key: 'replaceVariableNames',
  3183. value: function replaceVariableNames(scopeNode) {
  3184. var _this3 = this;
  3185. estraverse.replace(scopeNode, {
  3186. enter: function enter(node, parentNode) {
  3187. if (!node.obfuscated && Node_1.Node.isReplaceableIdentifierNode(node, parentNode)) {
  3188. node.name = _this3.identifierReplacer.replace(node.name);
  3189. }
  3190. }
  3191. });
  3192. }
  3193. }]);
  3194. return VariableDeclarationObfuscator;
  3195. }(AbstractNodeTransformer_1.AbstractNodeTransformer);
  3196. exports.VariableDeclarationObfuscator = VariableDeclarationObfuscator;
  3197. /***/ },
  3198. /* 62 */
  3199. /***/ function(module, exports, __webpack_require__) {
  3200. "use strict";
  3201. "use strict";
  3202. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  3203. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3204. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  3205. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  3206. var JSFuck_1 = __webpack_require__(21);
  3207. var AbstractReplacer_1 = __webpack_require__(15);
  3208. var BooleanLiteralReplacer = function (_AbstractReplacer_1$A) {
  3209. _inherits(BooleanLiteralReplacer, _AbstractReplacer_1$A);
  3210. function BooleanLiteralReplacer() {
  3211. _classCallCheck(this, BooleanLiteralReplacer);
  3212. return _possibleConstructorReturn(this, (BooleanLiteralReplacer.__proto__ || Object.getPrototypeOf(BooleanLiteralReplacer)).apply(this, arguments));
  3213. }
  3214. _createClass(BooleanLiteralReplacer, [{
  3215. key: 'replace',
  3216. value: function replace(nodeValue) {
  3217. return nodeValue ? JSFuck_1.JSFuck.True : JSFuck_1.JSFuck.False;
  3218. }
  3219. }]);
  3220. return BooleanLiteralReplacer;
  3221. }(AbstractReplacer_1.AbstractReplacer);
  3222. exports.BooleanLiteralReplacer = BooleanLiteralReplacer;
  3223. /***/ },
  3224. /* 63 */
  3225. /***/ function(module, exports, __webpack_require__) {
  3226. "use strict";
  3227. "use strict";
  3228. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  3229. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3230. var __decorate = undefined && undefined.__decorate || function (decorators, target, key, desc) {
  3231. var c = arguments.length,
  3232. r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
  3233. d;
  3234. if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {
  3235. if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  3236. }return c > 3 && r && Object.defineProperty(target, key, r), r;
  3237. };
  3238. var __metadata = undefined && undefined.__metadata || function (k, v) {
  3239. if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
  3240. };
  3241. var class_validator_1 = __webpack_require__(96);
  3242. var TSourceMapMode_1 = __webpack_require__(94);
  3243. var TStringArrayEncoding_1 = __webpack_require__(95);
  3244. var DefaultPreset_1 = __webpack_require__(23);
  3245. var OptionsNormalizer_1 = __webpack_require__(64);
  3246. var ValidationErrorsFormatter_1 = __webpack_require__(65);
  3247. var Options = function Options(obfuscatorOptions) {
  3248. _classCallCheck(this, Options);
  3249. Object.assign(this, DefaultPreset_1.DEFAULT_PRESET, obfuscatorOptions);
  3250. var errors = class_validator_1.validateSync(this, Options.validatorOptions);
  3251. if (errors.length) {
  3252. throw new ReferenceError("Validation failed. errors:\n" + ValidationErrorsFormatter_1.ValidationErrorsFormatter.format(errors));
  3253. }
  3254. Object.assign(this, OptionsNormalizer_1.OptionsNormalizer.normalizeOptions(this));
  3255. };
  3256. Options.validatorOptions = {
  3257. validationError: {
  3258. target: false
  3259. }
  3260. };
  3261. __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "compact", void 0);
  3262. __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "controlFlowFlattening", void 0);
  3263. __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "debugProtection", void 0);
  3264. __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "debugProtectionInterval", void 0);
  3265. __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "disableConsoleOutput", void 0);
  3266. __decorate([class_validator_1.IsArray(), class_validator_1.ArrayUnique(), class_validator_1.IsString({
  3267. each: true
  3268. }), __metadata('design:type', Array)], Options.prototype, "domainLock", void 0);
  3269. __decorate([class_validator_1.IsArray(), class_validator_1.ArrayUnique(), class_validator_1.IsString({
  3270. each: true
  3271. }), __metadata('design:type', Array)], Options.prototype, "reservedNames", void 0);
  3272. __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "rotateStringArray", void 0);
  3273. __decorate([class_validator_1.IsNumber(), __metadata('design:type', Number)], Options.prototype, "seed", void 0);
  3274. __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "selfDefending", void 0);
  3275. __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "sourceMap", void 0);
  3276. __decorate([class_validator_1.IsString(), class_validator_1.ValidateIf(function (options) {
  3277. return Boolean(options.sourceMapBaseUrl);
  3278. }), class_validator_1.IsUrl({
  3279. require_protocol: true,
  3280. require_valid_protocol: true
  3281. }), __metadata('design:type', String)], Options.prototype, "sourceMapBaseUrl", void 0);
  3282. __decorate([class_validator_1.IsString(), __metadata('design:type', String)], Options.prototype, "sourceMapFileName", void 0);
  3283. __decorate([class_validator_1.IsIn(['inline', 'separate']), __metadata('design:type', typeof (_a = typeof TSourceMapMode_1.TSourceMapMode !== 'undefined' && TSourceMapMode_1.TSourceMapMode) === 'function' && _a || Object)], Options.prototype, "sourceMapMode", void 0);
  3284. __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "stringArray", void 0);
  3285. __decorate([class_validator_1.IsIn([true, false, 'base64', 'rc4']), __metadata('design:type', typeof (_b = typeof TStringArrayEncoding_1.TStringArrayEncoding !== 'undefined' && TStringArrayEncoding_1.TStringArrayEncoding) === 'function' && _b || Object)], Options.prototype, "stringArrayEncoding", void 0);
  3286. __decorate([class_validator_1.IsNumber(), class_validator_1.Min(0), class_validator_1.Max(1), __metadata('design:type', Number)], Options.prototype, "stringArrayThreshold", void 0);
  3287. __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "unicodeEscapeSequence", void 0);
  3288. exports.Options = Options;
  3289. var _a, _b;
  3290. /***/ },
  3291. /* 64 */
  3292. /***/ function(module, exports, __webpack_require__) {
  3293. "use strict";
  3294. "use strict";
  3295. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  3296. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3297. var Utils_1 = __webpack_require__(0);
  3298. var OptionsNormalizer = function () {
  3299. function OptionsNormalizer() {
  3300. _classCallCheck(this, OptionsNormalizer);
  3301. }
  3302. _createClass(OptionsNormalizer, null, [{
  3303. key: 'normalizeOptions',
  3304. value: function normalizeOptions(options) {
  3305. var normalizedOptions = Object.assign({}, options);
  3306. var _iteratorNormalCompletion = true;
  3307. var _didIteratorError = false;
  3308. var _iteratorError = undefined;
  3309. try {
  3310. for (var _iterator = OptionsNormalizer.normalizerRules[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
  3311. var normalizerRule = _step.value;
  3312. normalizedOptions = normalizerRule(normalizedOptions);
  3313. }
  3314. } catch (err) {
  3315. _didIteratorError = true;
  3316. _iteratorError = err;
  3317. } finally {
  3318. try {
  3319. if (!_iteratorNormalCompletion && _iterator.return) {
  3320. _iterator.return();
  3321. }
  3322. } finally {
  3323. if (_didIteratorError) {
  3324. throw _iteratorError;
  3325. }
  3326. }
  3327. }
  3328. return normalizedOptions;
  3329. }
  3330. }, {
  3331. key: 'domainLockRule',
  3332. value: function domainLockRule(options) {
  3333. if (options.domainLock.length) {
  3334. var normalizedDomains = [];
  3335. var _iteratorNormalCompletion2 = true;
  3336. var _didIteratorError2 = false;
  3337. var _iteratorError2 = undefined;
  3338. try {
  3339. for (var _iterator2 = options.domainLock[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
  3340. var domain = _step2.value;
  3341. normalizedDomains.push(Utils_1.Utils.extractDomainFromUrl(domain));
  3342. }
  3343. } catch (err) {
  3344. _didIteratorError2 = true;
  3345. _iteratorError2 = err;
  3346. } finally {
  3347. try {
  3348. if (!_iteratorNormalCompletion2 && _iterator2.return) {
  3349. _iterator2.return();
  3350. }
  3351. } finally {
  3352. if (_didIteratorError2) {
  3353. throw _iteratorError2;
  3354. }
  3355. }
  3356. }
  3357. Object.assign(options, {
  3358. domainLock: normalizedDomains
  3359. });
  3360. }
  3361. return options;
  3362. }
  3363. }, {
  3364. key: 'selfDefendingRule',
  3365. value: function selfDefendingRule(options) {
  3366. if (options.selfDefending) {
  3367. Object.assign(options, OptionsNormalizer.SELF_DEFENDING_OPTIONS);
  3368. }
  3369. return options;
  3370. }
  3371. }, {
  3372. key: 'sourceMapBaseUrlRule',
  3373. value: function sourceMapBaseUrlRule(options) {
  3374. var sourceMapBaseUrl = options.sourceMapBaseUrl;
  3375. if (!options.sourceMapFileName) {
  3376. Object.assign(options, {
  3377. sourceMapBaseUrl: ''
  3378. });
  3379. return options;
  3380. }
  3381. if (sourceMapBaseUrl && !sourceMapBaseUrl.endsWith('/')) {
  3382. Object.assign(options, {
  3383. sourceMapBaseUrl: sourceMapBaseUrl + '/'
  3384. });
  3385. }
  3386. return options;
  3387. }
  3388. }, {
  3389. key: 'sourceMapFileNameRule',
  3390. value: function sourceMapFileNameRule(options) {
  3391. var sourceMapFileName = options.sourceMapFileName;
  3392. if (sourceMapFileName) {
  3393. sourceMapFileName = sourceMapFileName.replace(/^\/+/, '').split('.')[0];
  3394. Object.assign(options, {
  3395. sourceMapFileName: sourceMapFileName + '.js.map'
  3396. });
  3397. }
  3398. return options;
  3399. }
  3400. }, {
  3401. key: 'stringArrayRule',
  3402. value: function stringArrayRule(options) {
  3403. if (!options.stringArray) {
  3404. Object.assign(options, OptionsNormalizer.DISABLED_UNICODE_ARRAY_OPTIONS);
  3405. }
  3406. return options;
  3407. }
  3408. }, {
  3409. key: 'stringArrayEncodingRule',
  3410. value: function stringArrayEncodingRule(options) {
  3411. if (options.stringArrayEncoding === true) {
  3412. Object.assign(options, OptionsNormalizer.UNICODE_ARRAY_ENCODING_OPTIONS);
  3413. }
  3414. return options;
  3415. }
  3416. }, {
  3417. key: 'stringArrayThresholdRule',
  3418. value: function stringArrayThresholdRule(options) {
  3419. if (options.stringArrayThreshold === 0) {
  3420. Object.assign(options, OptionsNormalizer.DISABLED_UNICODE_ARRAY_OPTIONS);
  3421. }
  3422. return options;
  3423. }
  3424. }]);
  3425. return OptionsNormalizer;
  3426. }();
  3427. OptionsNormalizer.DISABLED_UNICODE_ARRAY_OPTIONS = {
  3428. rotateStringArray: false,
  3429. stringArray: false,
  3430. stringArrayEncoding: false,
  3431. stringArrayThreshold: 0
  3432. };
  3433. OptionsNormalizer.SELF_DEFENDING_OPTIONS = {
  3434. compact: true,
  3435. selfDefending: true
  3436. };
  3437. OptionsNormalizer.UNICODE_ARRAY_ENCODING_OPTIONS = {
  3438. stringArrayEncoding: 'base64'
  3439. };
  3440. OptionsNormalizer.normalizerRules = [OptionsNormalizer.domainLockRule, OptionsNormalizer.selfDefendingRule, OptionsNormalizer.sourceMapBaseUrlRule, OptionsNormalizer.sourceMapFileNameRule, OptionsNormalizer.stringArrayRule, OptionsNormalizer.stringArrayEncodingRule, OptionsNormalizer.stringArrayThresholdRule];
  3441. exports.OptionsNormalizer = OptionsNormalizer;
  3442. /***/ },
  3443. /* 65 */
  3444. /***/ function(module, exports) {
  3445. "use strict";
  3446. "use strict";
  3447. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  3448. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3449. var ValidationErrorsFormatter = function () {
  3450. function ValidationErrorsFormatter() {
  3451. _classCallCheck(this, ValidationErrorsFormatter);
  3452. }
  3453. _createClass(ValidationErrorsFormatter, null, [{
  3454. key: "format",
  3455. value: function format(validationErrors) {
  3456. var errorsArray = [];
  3457. var _iteratorNormalCompletion = true;
  3458. var _didIteratorError = false;
  3459. var _iteratorError = undefined;
  3460. try {
  3461. for (var _iterator = validationErrors[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
  3462. var error = _step.value;
  3463. errorsArray.push(ValidationErrorsFormatter.formatError(error));
  3464. }
  3465. } catch (err) {
  3466. _didIteratorError = true;
  3467. _iteratorError = err;
  3468. } finally {
  3469. try {
  3470. if (!_iteratorNormalCompletion && _iterator.return) {
  3471. _iterator.return();
  3472. }
  3473. } finally {
  3474. if (_didIteratorError) {
  3475. throw _iteratorError;
  3476. }
  3477. }
  3478. }
  3479. return errorsArray.join('\n');
  3480. }
  3481. }, {
  3482. key: "formatError",
  3483. value: function formatError(validationError) {
  3484. var errorString = "`" + validationError.property + "` errors:\n",
  3485. constraints = validationError.constraints;
  3486. for (var constraint in constraints) {
  3487. if (!constraints.hasOwnProperty(constraint)) {
  3488. continue;
  3489. }
  3490. errorString += " - " + constraints[constraint] + "\n";
  3491. }
  3492. return errorString;
  3493. }
  3494. }]);
  3495. return ValidationErrorsFormatter;
  3496. }();
  3497. exports.ValidationErrorsFormatter = ValidationErrorsFormatter;
  3498. /***/ },
  3499. /* 66 */
  3500. /***/ function(module, exports, __webpack_require__) {
  3501. "use strict";
  3502. "use strict";
  3503. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  3504. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3505. var estraverse = __webpack_require__(4);
  3506. var NodeType_1 = __webpack_require__(7);
  3507. var FunctionDeclarationCalleeDataExtractor_1 = __webpack_require__(67);
  3508. var FunctionExpressionCalleeDataExtractor_1 = __webpack_require__(68);
  3509. var ObjectExpressionCalleeDataExtractor_1 = __webpack_require__(69);
  3510. var Node_1 = __webpack_require__(2);
  3511. var NodeUtils_1 = __webpack_require__(8);
  3512. var StackTraceAnalyzer = function () {
  3513. function StackTraceAnalyzer(blockScopeBody) {
  3514. _classCallCheck(this, StackTraceAnalyzer);
  3515. this.calleeDataExtractors = new Map([[NodeType_1.NodeType.FunctionDeclaration, FunctionDeclarationCalleeDataExtractor_1.FunctionDeclarationCalleeDataExtractor], [NodeType_1.NodeType.FunctionExpression, FunctionExpressionCalleeDataExtractor_1.FunctionExpressionCalleeDataExtractor], [NodeType_1.NodeType.ObjectExpression, ObjectExpressionCalleeDataExtractor_1.ObjectExpressionCalleeDataExtractor]]);
  3516. this.blockScopeBody = blockScopeBody;
  3517. }
  3518. _createClass(StackTraceAnalyzer, [{
  3519. key: 'analyze',
  3520. value: function analyze() {
  3521. return this.analyzeRecursive(this.blockScopeBody);
  3522. }
  3523. }, {
  3524. key: 'analyzeRecursive',
  3525. value: function analyzeRecursive(blockScopeBody) {
  3526. var _this = this;
  3527. var limitIndex = StackTraceAnalyzer.getLimitIndex(blockScopeBody.length);
  3528. var stackTraceData = [];
  3529. var _loop = function _loop(index, blockScopeBodyLength) {
  3530. var rootNode = blockScopeBody[index];
  3531. if (index > limitIndex) {
  3532. return 'break';
  3533. }
  3534. estraverse.traverse(rootNode, {
  3535. enter: function enter(node) {
  3536. if (!Node_1.Node.isCallExpressionNode(node) || rootNode.parentNode !== NodeUtils_1.NodeUtils.getBlockScopeOfNode(node)) {
  3537. return;
  3538. }
  3539. _this.calleeDataExtractors.forEach(function (calleeDataExtractor) {
  3540. var calleeData = new calleeDataExtractor(blockScopeBody, node.callee).extract();
  3541. if (!calleeData) {
  3542. return;
  3543. }
  3544. stackTraceData.push(Object.assign({}, calleeData, {
  3545. stackTrace: _this.analyzeRecursive(calleeData.callee.body)
  3546. }));
  3547. });
  3548. }
  3549. });
  3550. };
  3551. for (var index = 0, blockScopeBodyLength = blockScopeBody.length; index < blockScopeBodyLength; index++) {
  3552. var _ret = _loop(index, blockScopeBodyLength);
  3553. if (_ret === 'break') break;
  3554. }
  3555. return stackTraceData;
  3556. }
  3557. }], [{
  3558. key: 'getLimitIndex',
  3559. value: function getLimitIndex(blockScopeBodyLength) {
  3560. var lastIndex = blockScopeBodyLength - 1;
  3561. var limitThresholdActivationIndex = StackTraceAnalyzer.limitThresholdActivationLength - 1;
  3562. var limitIndex = lastIndex;
  3563. if (lastIndex > limitThresholdActivationIndex) {
  3564. limitIndex = Math.round(limitThresholdActivationIndex + lastIndex * StackTraceAnalyzer.limitThreshold);
  3565. if (limitIndex > lastIndex) {
  3566. limitIndex = lastIndex;
  3567. }
  3568. }
  3569. return limitIndex;
  3570. }
  3571. }]);
  3572. return StackTraceAnalyzer;
  3573. }();
  3574. StackTraceAnalyzer.limitThresholdActivationLength = 25;
  3575. StackTraceAnalyzer.limitThreshold = 0.002;
  3576. exports.StackTraceAnalyzer = StackTraceAnalyzer;
  3577. /***/ },
  3578. /* 67 */
  3579. /***/ function(module, exports, __webpack_require__) {
  3580. "use strict";
  3581. "use strict";
  3582. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  3583. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3584. var estraverse = __webpack_require__(4);
  3585. var Node_1 = __webpack_require__(2);
  3586. var NodeUtils_1 = __webpack_require__(8);
  3587. var FunctionDeclarationCalleeDataExtractor = function () {
  3588. function FunctionDeclarationCalleeDataExtractor(blockScopeBody, callee) {
  3589. _classCallCheck(this, FunctionDeclarationCalleeDataExtractor);
  3590. this.blockScopeBody = blockScopeBody;
  3591. this.callee = callee;
  3592. }
  3593. _createClass(FunctionDeclarationCalleeDataExtractor, [{
  3594. key: 'extract',
  3595. value: function extract() {
  3596. var calleeBlockStatement = null;
  3597. if (Node_1.Node.isIdentifierNode(this.callee)) {
  3598. calleeBlockStatement = this.getCalleeBlockStatement(NodeUtils_1.NodeUtils.getBlockScopeOfNode(this.blockScopeBody[0]), this.callee.name);
  3599. }
  3600. if (!calleeBlockStatement) {
  3601. return null;
  3602. }
  3603. return {
  3604. callee: calleeBlockStatement,
  3605. name: this.callee.name
  3606. };
  3607. }
  3608. }, {
  3609. key: 'getCalleeBlockStatement',
  3610. value: function getCalleeBlockStatement(node, name) {
  3611. var calleeBlockStatement = null;
  3612. estraverse.traverse(node, {
  3613. enter: function enter(node) {
  3614. if (Node_1.Node.isFunctionDeclarationNode(node) && node.id.name === name) {
  3615. calleeBlockStatement = node.body;
  3616. return estraverse.VisitorOption.Break;
  3617. }
  3618. }
  3619. });
  3620. return calleeBlockStatement;
  3621. }
  3622. }]);
  3623. return FunctionDeclarationCalleeDataExtractor;
  3624. }();
  3625. exports.FunctionDeclarationCalleeDataExtractor = FunctionDeclarationCalleeDataExtractor;
  3626. /***/ },
  3627. /* 68 */
  3628. /***/ function(module, exports, __webpack_require__) {
  3629. "use strict";
  3630. "use strict";
  3631. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  3632. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3633. var estraverse = __webpack_require__(4);
  3634. var Node_1 = __webpack_require__(2);
  3635. var NodeUtils_1 = __webpack_require__(8);
  3636. var FunctionExpressionCalleeDataExtractor = function () {
  3637. function FunctionExpressionCalleeDataExtractor(blockScopeBody, callee) {
  3638. _classCallCheck(this, FunctionExpressionCalleeDataExtractor);
  3639. this.blockScopeBody = blockScopeBody;
  3640. this.callee = callee;
  3641. }
  3642. _createClass(FunctionExpressionCalleeDataExtractor, [{
  3643. key: 'extract',
  3644. value: function extract() {
  3645. var calleeBlockStatement = null;
  3646. if (Node_1.Node.isIdentifierNode(this.callee)) {
  3647. calleeBlockStatement = this.getCalleeBlockStatement(NodeUtils_1.NodeUtils.getBlockScopeOfNode(this.blockScopeBody[0]), this.callee.name);
  3648. }
  3649. if (Node_1.Node.isFunctionExpressionNode(this.callee)) {
  3650. calleeBlockStatement = this.callee.body;
  3651. }
  3652. if (!calleeBlockStatement) {
  3653. return null;
  3654. }
  3655. return {
  3656. callee: calleeBlockStatement,
  3657. name: this.callee.name || null
  3658. };
  3659. }
  3660. }, {
  3661. key: 'getCalleeBlockStatement',
  3662. value: function getCalleeBlockStatement(node, name) {
  3663. var calleeBlockStatement = null;
  3664. estraverse.traverse(node, {
  3665. enter: function enter(node, parentNode) {
  3666. if (Node_1.Node.isFunctionExpressionNode(node) && Node_1.Node.isVariableDeclaratorNode(parentNode) && Node_1.Node.isIdentifierNode(parentNode.id) && parentNode.id.name === name) {
  3667. calleeBlockStatement = node.body;
  3668. return estraverse.VisitorOption.Break;
  3669. }
  3670. }
  3671. });
  3672. return calleeBlockStatement;
  3673. }
  3674. }]);
  3675. return FunctionExpressionCalleeDataExtractor;
  3676. }();
  3677. exports.FunctionExpressionCalleeDataExtractor = FunctionExpressionCalleeDataExtractor;
  3678. /***/ },
  3679. /* 69 */
  3680. /***/ function(module, exports, __webpack_require__) {
  3681. "use strict";
  3682. "use strict";
  3683. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  3684. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3685. var estraverse = __webpack_require__(4);
  3686. var Node_1 = __webpack_require__(2);
  3687. var NodeUtils_1 = __webpack_require__(8);
  3688. var ObjectExpressionCalleeDataExtractor = function () {
  3689. function ObjectExpressionCalleeDataExtractor(blockScopeBody, callee) {
  3690. _classCallCheck(this, ObjectExpressionCalleeDataExtractor);
  3691. this.blockScopeBody = blockScopeBody;
  3692. this.callee = callee;
  3693. }
  3694. _createClass(ObjectExpressionCalleeDataExtractor, [{
  3695. key: 'extract',
  3696. value: function extract() {
  3697. var calleeBlockStatement = null,
  3698. functionExpressionName = null;
  3699. if (Node_1.Node.isMemberExpressionNode(this.callee)) {
  3700. var objectMembersCallsChain = this.createObjectMembersCallsChain([], this.callee);
  3701. if (!objectMembersCallsChain.length) {
  3702. return null;
  3703. }
  3704. functionExpressionName = objectMembersCallsChain[objectMembersCallsChain.length - 1];
  3705. calleeBlockStatement = this.getCalleeBlockStatement(NodeUtils_1.NodeUtils.getBlockScopeOfNode(this.blockScopeBody[0]), objectMembersCallsChain);
  3706. }
  3707. if (!calleeBlockStatement) {
  3708. return null;
  3709. }
  3710. return {
  3711. callee: calleeBlockStatement,
  3712. name: functionExpressionName
  3713. };
  3714. }
  3715. }, {
  3716. key: 'createObjectMembersCallsChain',
  3717. value: function createObjectMembersCallsChain(currentChain, memberExpression) {
  3718. if (Node_1.Node.isIdentifierNode(memberExpression.property) && memberExpression.computed === false) {
  3719. currentChain.unshift(memberExpression.property.name);
  3720. } else if (Node_1.Node.isLiteralNode(memberExpression.property) && (typeof memberExpression.property.value === 'string' || typeof memberExpression.property.value === 'number')) {
  3721. currentChain.unshift(memberExpression.property.value);
  3722. } else {
  3723. return currentChain;
  3724. }
  3725. if (Node_1.Node.isMemberExpressionNode(memberExpression.object)) {
  3726. return this.createObjectMembersCallsChain(currentChain, memberExpression.object);
  3727. } else if (Node_1.Node.isIdentifierNode(memberExpression.object)) {
  3728. currentChain.unshift(memberExpression.object.name);
  3729. }
  3730. return currentChain;
  3731. }
  3732. }, {
  3733. key: 'getCalleeBlockStatement',
  3734. value: function getCalleeBlockStatement(node, objectMembersCallsChain) {
  3735. var _this = this;
  3736. var objectName = objectMembersCallsChain.shift();
  3737. if (!objectName) {
  3738. return null;
  3739. }
  3740. var calleeBlockStatement = null;
  3741. estraverse.traverse(node, {
  3742. enter: function enter(node, parentNode) {
  3743. if (Node_1.Node.isVariableDeclaratorNode(node) && Node_1.Node.isIdentifierNode(node.id) && node.init && Node_1.Node.isObjectExpressionNode(node.init) && node.id.name === objectName) {
  3744. calleeBlockStatement = _this.findCalleeBlockStatement(node.init.properties, objectMembersCallsChain);
  3745. return estraverse.VisitorOption.Break;
  3746. }
  3747. }
  3748. });
  3749. return calleeBlockStatement;
  3750. }
  3751. }, {
  3752. key: 'findCalleeBlockStatement',
  3753. value: function findCalleeBlockStatement(objectExpressionProperties, objectMembersCallsChain) {
  3754. var nextItemInCallsChain = objectMembersCallsChain.shift();
  3755. if (!nextItemInCallsChain) {
  3756. return null;
  3757. }
  3758. var _iteratorNormalCompletion = true;
  3759. var _didIteratorError = false;
  3760. var _iteratorError = undefined;
  3761. try {
  3762. for (var _iterator = objectExpressionProperties[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
  3763. var propertyNode = _step.value;
  3764. var isTargetPropertyNodeWithIdentifierKey = Node_1.Node.isIdentifierNode(propertyNode.key) && propertyNode.key.name === nextItemInCallsChain;
  3765. var isTargetPropertyNodeWithLiteralKey = Node_1.Node.isLiteralNode(propertyNode.key) && Boolean(propertyNode.key.value) && propertyNode.key.value === nextItemInCallsChain;
  3766. if (!isTargetPropertyNodeWithIdentifierKey && !isTargetPropertyNodeWithLiteralKey) {
  3767. continue;
  3768. }
  3769. if (Node_1.Node.isObjectExpressionNode(propertyNode.value)) {
  3770. return this.findCalleeBlockStatement(propertyNode.value.properties, objectMembersCallsChain);
  3771. }
  3772. if (Node_1.Node.isFunctionExpressionNode(propertyNode.value)) {
  3773. return propertyNode.value.body;
  3774. }
  3775. }
  3776. } catch (err) {
  3777. _didIteratorError = true;
  3778. _iteratorError = err;
  3779. } finally {
  3780. try {
  3781. if (!_iteratorNormalCompletion && _iterator.return) {
  3782. _iterator.return();
  3783. }
  3784. } finally {
  3785. if (_didIteratorError) {
  3786. throw _iteratorError;
  3787. }
  3788. }
  3789. }
  3790. return null;
  3791. }
  3792. }]);
  3793. return ObjectExpressionCalleeDataExtractor;
  3794. }();
  3795. exports.ObjectExpressionCalleeDataExtractor = ObjectExpressionCalleeDataExtractor;
  3796. /***/ },
  3797. /* 70 */,
  3798. /* 71 */
  3799. /***/ function(module, exports) {
  3800. "use strict";
  3801. "use strict";
  3802. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  3803. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3804. var ArrayStorage = function () {
  3805. function ArrayStorage() {
  3806. _classCallCheck(this, ArrayStorage);
  3807. this.storage = [];
  3808. }
  3809. _createClass(ArrayStorage, [{
  3810. key: "get",
  3811. value: function get(key) {
  3812. var value = this.storage[key];
  3813. if (!value) {
  3814. throw new Error("No value found in array storage with key `" + key + "`");
  3815. }
  3816. return value;
  3817. }
  3818. }, {
  3819. key: "getKeyOf",
  3820. value: function getKeyOf(value) {
  3821. return this.storage.indexOf(value);
  3822. }
  3823. }, {
  3824. key: "getLength",
  3825. value: function getLength() {
  3826. return this.storage.length;
  3827. }
  3828. }, {
  3829. key: "getStorage",
  3830. value: function getStorage() {
  3831. return this.storage;
  3832. }
  3833. }, {
  3834. key: "set",
  3835. value: function set(key, value) {
  3836. this.storage.push(value);
  3837. }
  3838. }]);
  3839. return ArrayStorage;
  3840. }();
  3841. exports.ArrayStorage = ArrayStorage;
  3842. /***/ },
  3843. /* 72 */
  3844. /***/ function(module, exports, __webpack_require__) {
  3845. "use strict";
  3846. "use strict";
  3847. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  3848. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3849. var Utils_1 = __webpack_require__(0);
  3850. var MapStorage = function () {
  3851. function MapStorage() {
  3852. _classCallCheck(this, MapStorage);
  3853. this.storage = new Map();
  3854. }
  3855. _createClass(MapStorage, [{
  3856. key: "get",
  3857. value: function get(key) {
  3858. var value = this.storage.get(key);
  3859. if (!value) {
  3860. throw new Error("No value found in map storage with key `" + key + "`");
  3861. }
  3862. return value;
  3863. }
  3864. }, {
  3865. key: "getKeyOf",
  3866. value: function getKeyOf(value) {
  3867. return Utils_1.Utils.mapGetFirstKeyOf(this.storage, value);
  3868. }
  3869. }, {
  3870. key: "getLength",
  3871. value: function getLength() {
  3872. return Array.from(this.storage).length;
  3873. }
  3874. }, {
  3875. key: "getStorage",
  3876. value: function getStorage() {
  3877. return this.storage;
  3878. }
  3879. }, {
  3880. key: "set",
  3881. value: function set(key, value) {
  3882. this.storage.set(key, value);
  3883. }
  3884. }]);
  3885. return MapStorage;
  3886. }();
  3887. exports.MapStorage = MapStorage;
  3888. /***/ },
  3889. /* 73 */
  3890. /***/ function(module, exports, __webpack_require__) {
  3891. "use strict";
  3892. "use strict";
  3893. var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; })();
  3894. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  3895. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3896. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  3897. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  3898. var MapStorage_1 = __webpack_require__(72);
  3899. var ControlFlowStorage = function (_MapStorage_1$MapStor) {
  3900. _inherits(ControlFlowStorage, _MapStorage_1$MapStor);
  3901. function ControlFlowStorage() {
  3902. _classCallCheck(this, ControlFlowStorage);
  3903. return _possibleConstructorReturn(this, (ControlFlowStorage.__proto__ || Object.getPrototypeOf(ControlFlowStorage)).apply(this, arguments));
  3904. }
  3905. _createClass(ControlFlowStorage, [{
  3906. key: 'toString',
  3907. value: function toString() {
  3908. return Array.from(this.storage).reduce(function (controlFlowStorageItems, _ref) {
  3909. var _ref2 = _slicedToArray(_ref, 2),
  3910. key = _ref2[0],
  3911. value = _ref2[1];
  3912. controlFlowStorageItems.push(key + ': ' + value.getCode());
  3913. return controlFlowStorageItems;
  3914. }, []).join(',');
  3915. }
  3916. }]);
  3917. return ControlFlowStorage;
  3918. }(MapStorage_1.MapStorage);
  3919. exports.ControlFlowStorage = ControlFlowStorage;
  3920. /***/ },
  3921. /* 74 */
  3922. /***/ function(module, exports, __webpack_require__) {
  3923. "use strict";
  3924. "use strict";
  3925. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  3926. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3927. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  3928. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  3929. var ArrayStorage_1 = __webpack_require__(71);
  3930. var Utils_1 = __webpack_require__(0);
  3931. var StringArrayStorage = function (_ArrayStorage_1$Array) {
  3932. _inherits(StringArrayStorage, _ArrayStorage_1$Array);
  3933. function StringArrayStorage() {
  3934. _classCallCheck(this, StringArrayStorage);
  3935. return _possibleConstructorReturn(this, (StringArrayStorage.__proto__ || Object.getPrototypeOf(StringArrayStorage)).apply(this, arguments));
  3936. }
  3937. _createClass(StringArrayStorage, [{
  3938. key: 'rotateArray',
  3939. value: function rotateArray(rotationValue) {
  3940. this.storage = Utils_1.Utils.arrayRotate(this.storage, rotationValue);
  3941. }
  3942. }, {
  3943. key: 'toString',
  3944. value: function toString() {
  3945. return this.storage.map(function (value) {
  3946. return '\'' + value + '\'';
  3947. }).toString();
  3948. }
  3949. }]);
  3950. return StringArrayStorage;
  3951. }(ArrayStorage_1.ArrayStorage);
  3952. exports.StringArrayStorage = StringArrayStorage;
  3953. /***/ },
  3954. /* 75 */
  3955. /***/ function(module, exports) {
  3956. "use strict";
  3957. "use strict";
  3958. function AtobTemplate() {
  3959. return "\n (function () {\n var getGlobal = Function('return (function () ' + '{}.constructor(\"return this\")()' + ');');\n\n var object = getGlobal();\n var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\n object.atob || (\n object.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 ";
  3960. }
  3961. exports.AtobTemplate = AtobTemplate;
  3962. /***/ },
  3963. /* 76 */
  3964. /***/ function(module, exports) {
  3965. "use strict";
  3966. "use strict";
  3967. function Rc4Template() {
  3968. 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 ";
  3969. }
  3970. exports.Rc4Template = Rc4Template;
  3971. /***/ },
  3972. /* 77 */
  3973. /***/ function(module, exports) {
  3974. "use strict";
  3975. "use strict";
  3976. function SingleNodeCallControllerTemplate() {
  3977. return "\n var {singleNodeCallControllerFunctionName} = (function(){\n var firstCall = true;\n \n return function (context, fn){\t\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 ";
  3978. }
  3979. exports.SingleNodeCallControllerTemplate = SingleNodeCallControllerTemplate;
  3980. /***/ },
  3981. /* 78 */
  3982. /***/ function(module, exports) {
  3983. "use strict";
  3984. "use strict";
  3985. function ConsoleOutputDisableExpressionTemplate() {
  3986. return "\n var {consoleLogDisableFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n var getGlobal = Function('return (function() ' + '{}.constructor(\"return this\")( )' + ');');\n \n var func = function () {};\n var that = getGlobal();\n \n that.console.log = func; \n that.console.error = func;\n that.console.warn = func;\n that.console.info = func;\n });\n \n {consoleLogDisableFunctionName}();\n ";
  3987. }
  3988. exports.ConsoleOutputDisableExpressionTemplate = ConsoleOutputDisableExpressionTemplate;
  3989. /***/ },
  3990. /* 79 */
  3991. /***/ function(module, exports) {
  3992. "use strict";
  3993. "use strict";
  3994. function BinaryExpressionFunctionTemplate() {
  3995. return "\n function {functionName} (x, y) {\n return x {operator} y;\n }\n ";
  3996. }
  3997. exports.BinaryExpressionFunctionTemplate = BinaryExpressionFunctionTemplate;
  3998. /***/ },
  3999. /* 80 */
  4000. /***/ function(module, exports) {
  4001. "use strict";
  4002. "use strict";
  4003. function ControlFlowStorageCallTemplate() {
  4004. return '{controlFlowStorageName}.{controlFlowStorageKey}({leftValue}, {rightValue})';
  4005. }
  4006. exports.ControlFlowStorageCallTemplate = ControlFlowStorageCallTemplate;
  4007. /***/ },
  4008. /* 81 */
  4009. /***/ function(module, exports) {
  4010. "use strict";
  4011. "use strict";
  4012. function ControlFlowStorageTemplate() {
  4013. return "\n var {controlFlowStorageName} = { {controlFlowStorage} };\n ";
  4014. }
  4015. exports.ControlFlowStorageTemplate = ControlFlowStorageTemplate;
  4016. /***/ },
  4017. /* 82 */
  4018. /***/ function(module, exports) {
  4019. "use strict";
  4020. "use strict";
  4021. function DebugProtectionFunctionCallTemplate() {
  4022. return "{debugProtectionFunctionName}();";
  4023. }
  4024. exports.DebugProtectionFunctionCallTemplate = DebugProtectionFunctionCallTemplate;
  4025. /***/ },
  4026. /* 83 */
  4027. /***/ function(module, exports) {
  4028. "use strict";
  4029. "use strict";
  4030. function DebugProtectionFunctionIntervalTemplate() {
  4031. return "\n setInterval(function () {\n {debugProtectionFunctionName}();\n }, 4000);\n ";
  4032. }
  4033. exports.DebugProtectionFunctionIntervalTemplate = DebugProtectionFunctionIntervalTemplate;
  4034. /***/ },
  4035. /* 84 */
  4036. /***/ function(module, exports) {
  4037. "use strict";
  4038. "use strict";
  4039. function DebugProtectionFunctionTemplate() {
  4040. return "\n var {debugProtectionFunctionName} = function () {\n function debuggerProtection (counter) {\n if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) {\n (function () {}.constructor('debugger')());\n } else {\n (function () {}.constructor('debugger')());\n }\n \n debuggerProtection(++counter);\n }\n \n try {\n debuggerProtection(0);\n } catch (y) {}\n };\n ";
  4041. }
  4042. exports.DebugProtectionFunctionTemplate = DebugProtectionFunctionTemplate;
  4043. /***/ },
  4044. /* 85 */
  4045. /***/ function(module, exports) {
  4046. "use strict";
  4047. "use strict";
  4048. function DomainLockNodeTemplate() {
  4049. return "\n var {domainLockFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n var getGlobal = Function('return (function () ' + '{}.constructor(\"return this\")()' + ');');\n\n var func = function () { \n return {\n key: 'item',\n value: 'attribute',\n getAttribute: function () {\n getGlobal()['eval']('while(true){}')();\n }()\n };\n };\n \n var regExp = new RegExp(\"[{diff}]\", \"g\");\n var domains = \"{domains}\".replace(regExp, \"\").split(\";\");\n var eval = [][\"forEach\"][\"constructor\"];\n var windowObject = eval(\"return this\")();\n var document;\n var domain;\n \n for (var d in windowObject) {\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 windowObject[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) || (!windowObject[document] && !windowObject[document][domain])) {\n return;\n }\n \n var currentDomain = windowObject[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 ";
  4050. }
  4051. exports.DomainLockNodeTemplate = DomainLockNodeTemplate;
  4052. /***/ },
  4053. /* 86 */
  4054. /***/ function(module, exports, __webpack_require__) {
  4055. "use strict";
  4056. "use strict";
  4057. var Utils_1 = __webpack_require__(0);
  4058. function SelfDefendingTemplate() {
  4059. 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('" + Utils_1.Utils.stringToUnicodeEscapeSequence("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}") + "');\n \n return !regExp.test(func1.toString());\n };\n \n var test2 = function () {\n var regExp = new RegExp('" + Utils_1.Utils.stringToUnicodeEscapeSequence("(\\\\[x|u](\\w){2,4})+") + "');\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 ";
  4060. }
  4061. exports.SelfDefendingTemplate = SelfDefendingTemplate;
  4062. /***/ },
  4063. /* 87 */
  4064. /***/ function(module, exports, __webpack_require__) {
  4065. "use strict";
  4066. "use strict";
  4067. var Utils_1 = __webpack_require__(0);
  4068. function SelfDefendingTemplate() {
  4069. return "\n var StatesClass = function (rc4Bytes) {\n this.rc4Bytes = rc4Bytes;\n this.states = [1, 0, 0];\n this.newState = function(){return 'newState';};\n this.firstState = '" + Utils_1.Utils.stringToUnicodeEscapeSequence("\\w+ *\\(\\) *{\\w+ *") + "';\n this.secondState = '" + Utils_1.Utils.stringToUnicodeEscapeSequence("['|\"].+['|\"];? *}") + "';\n };\n \n StatesClass.prototype.checkState = function () {\n var regExp = new RegExp(this.firstState + this.secondState);\n\n return this.runState(regExp.test(this.newState.toString()) ? --this.states[1] : --this.states[0]);\n };\n \n StatesClass.prototype.runState = function (stateResult) {\n if (!Boolean(~stateResult)) {\n return stateResult;\n }\n \n return this.getState(this.rc4Bytes);\n };\n\n StatesClass.prototype.getState = function (rc4Bytes) {\n for (var i = 0, len = this.states.length; i < len; i++) {\n this.states.push(Math.round(Math.random()));\n len = this.states.length;\n }\n \n return rc4Bytes(this.states[0]);\n };\n\n new StatesClass({stringArrayCallsWrapperName}).checkState();\n ";
  4070. }
  4071. exports.SelfDefendingTemplate = SelfDefendingTemplate;
  4072. /***/ },
  4073. /* 88 */
  4074. /***/ function(module, exports) {
  4075. "use strict";
  4076. "use strict";
  4077. function StringArrayBase64DecodeNodeTemplate() {
  4078. return " \n if (!{stringArrayCallsWrapperName}.atobPolyfillAppended) {\n {atobPolyfill}\n \n {stringArrayCallsWrapperName}.atobPolyfillAppended = true;\n }\n \n if (!{stringArrayCallsWrapperName}.base64DecodeUnicode) { \n {stringArrayCallsWrapperName}.base64DecodeUnicode = 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 \n if (!{stringArrayCallsWrapperName}.data) {\n {stringArrayCallsWrapperName}.data = {};\n }\n \n if (!{stringArrayCallsWrapperName}.data[index]) {\n {selfDefendingCode}\n \n value = {stringArrayCallsWrapperName}.base64DecodeUnicode(value);\n {stringArrayCallsWrapperName}.data[index] = value;\n } else {\n value = {stringArrayCallsWrapperName}.data[index];\n } \n ";
  4079. }
  4080. exports.StringArrayBase64DecodeNodeTemplate = StringArrayBase64DecodeNodeTemplate;
  4081. /***/ },
  4082. /* 89 */
  4083. /***/ function(module, exports) {
  4084. "use strict";
  4085. "use strict";
  4086. function StringArrayCallsWrapperTemplate() {
  4087. return "\n var {stringArrayCallsWrapperName} = function (index, key) {\n var index = parseInt(index, 0x10);\n var value = {stringArrayName}[index];\n \n {decodeNodeTemplate}\n \n return value;\n };\n ";
  4088. }
  4089. exports.StringArrayCallsWrapperTemplate = StringArrayCallsWrapperTemplate;
  4090. /***/ },
  4091. /* 90 */
  4092. /***/ function(module, exports) {
  4093. "use strict";
  4094. "use strict";
  4095. function StringArrayRc4DecodeNodeTemplate() {
  4096. return "\n if (!{stringArrayCallsWrapperName}.atobPolyfillAppended) { \n {atobPolyfill}\n \n {stringArrayCallsWrapperName}.atobPolyfillAppended = true;\n }\n \n if (!{stringArrayCallsWrapperName}.rc4) { \n {rc4Polyfill}\n \n {stringArrayCallsWrapperName}.rc4 = rc4;\n }\n \n if (!{stringArrayCallsWrapperName}.data) {\n {stringArrayCallsWrapperName}.data = {};\n }\n\n if ({stringArrayCallsWrapperName}.data[index] === undefined) {\n if (!{stringArrayCallsWrapperName}.once) {\n {selfDefendingCode}\n \n {stringArrayCallsWrapperName}.once = true;\n }\n \n value = {stringArrayCallsWrapperName}.rc4(value, key);\n {stringArrayCallsWrapperName}.data[index] = value;\n } else {\n value = {stringArrayCallsWrapperName}.data[index];\n }\n ";
  4097. }
  4098. exports.StringArrayRc4DecodeNodeTemplate = StringArrayRc4DecodeNodeTemplate;
  4099. /***/ },
  4100. /* 91 */
  4101. /***/ function(module, exports) {
  4102. "use strict";
  4103. "use strict";
  4104. function StringArrayTemplate() {
  4105. return "\n var {stringArrayName} = [{stringArray}];\n ";
  4106. }
  4107. exports.StringArrayTemplate = StringArrayTemplate;
  4108. /***/ },
  4109. /* 92 */
  4110. /***/ function(module, exports, __webpack_require__) {
  4111. "use strict";
  4112. "use strict";
  4113. var Utils_1 = __webpack_require__(0);
  4114. function SelfDefendingTemplate() {
  4115. 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('" + Utils_1.Utils.stringToUnicodeEscapeSequence("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}") + "');\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 ";
  4116. }
  4117. exports.SelfDefendingTemplate = SelfDefendingTemplate;
  4118. /***/ },
  4119. /* 93 */
  4120. /***/ function(module, exports) {
  4121. "use strict";
  4122. "use strict";
  4123. function StringArrayRotateFunctionTemplate() {
  4124. 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 ";
  4125. }
  4126. exports.StringArrayRotateFunctionTemplate = StringArrayRotateFunctionTemplate;
  4127. /***/ },
  4128. /* 94 */
  4129. /***/ function(module, exports) {
  4130. "use strict";
  4131. "use strict";
  4132. /***/ },
  4133. /* 95 */
  4134. /***/ function(module, exports) {
  4135. "use strict";
  4136. "use strict";
  4137. /***/ },
  4138. /* 96 */
  4139. /***/ function(module, exports) {
  4140. module.exports = require("class-validator");
  4141. /***/ },
  4142. /* 97 */
  4143. /***/ function(module, exports) {
  4144. module.exports = require("commander");
  4145. /***/ },
  4146. /* 98 */
  4147. /***/ function(module, exports) {
  4148. module.exports = require("fs");
  4149. /***/ },
  4150. /* 99 */
  4151. /***/ function(module, exports) {
  4152. module.exports = require("is-equal");
  4153. /***/ },
  4154. /* 100 */
  4155. /***/ function(module, exports) {
  4156. module.exports = require("mkdirp");
  4157. /***/ },
  4158. /* 101 */,
  4159. /* 102 */
  4160. /***/ function(module, exports, __webpack_require__) {
  4161. "use strict";
  4162. "use strict";
  4163. var JavaScriptObfuscator_1 = __webpack_require__(10);
  4164. if (!global._babelPolyfill) {
  4165. __webpack_require__(27);
  4166. }
  4167. module.exports = JavaScriptObfuscator_1.JavaScriptObfuscator;
  4168. /***/ }
  4169. /******/ ]);
  4170. //# sourceMappingURL=index.js.map