{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/loader/resolvable-promise.js","webpack:///./src/loader/module.js","webpack:///./src/loader/config.js","webpack:///./src/loader/dependency-resolver.js","webpack:///./src/loader/logger.js","webpack:///./src/loader/url-builder.js","webpack:///./src/loader/script-loader.js","webpack:///./src/loader/loader.js","webpack:///./src/loader/bootstrap.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","ResolvablePromise","Error","_assertNotFulfilled","resolvablePromise","fulfilled","capture","promise","Promise","resolve","reject","_resolve","_reject","assign","rejected","rejection","undefined","resolution","resolved","error","jest","Module","this","_name","_dependencies","_factory","_implementation","_map","_state","_define","_fetch","_implement","dependencies","factory","implementation","map","esModule","configurable","writable","fetch","define","implement","Config","cfg","_modules","_maps","_paths","_config","maps","paths","_parse","moduleName","moduleProperties","entries","forEach","mappings","moduleNames","values","getModule","mappedName","_mapModule","dependencyName","dependencyModule","defaultValue","contextMap","_mapMatches","keys","length","match","_mapExactMatch","_mapPartialMatch","_mapWildcardMatch","alias","aliasValue","exactMatch","indexOf","substring","explainResolutions","showWarnings","waitTimeout","basePath","resolvePath","combine","url","urlMaxLength","logLevel","defaultURLParams","DependencyResolver","config","_cachedResolutions","modulesParam","encodeURIComponent","options","body","method","then","response","text","JSON","parse","levelPriority","off","warn","info","debug","prefix","Logger","_applies","args","console","log","configPriority","URLBuilder","bufferURL","modulesURL","result","charAt","path","_getModulePath","push","_getURLWithParams","concat","_generateBufferURLs","urls","urlResult","item","lastIndexOf","queryString","join","ScriptLoader","document","_document","_log","_urlBuilder","_injectedScripts","urlBuilder","promises","build","_loadScript","all","getModules","script","createElement","src","async","onload","onreadystatechange","readyState","onerror","head","appendChild","Loader","window","__CONFIG__","_dependencyResolver","_scriptLoader","_requireCallId","packageJson","version","defined","exportedValue","success","failure","resolvedModuleNames","unregisteredModuleNames","rejectTimeout","moduleLoader","requireCallId","lastArg","successGiven","penultimateArg","failureGiven","slice","Array","isArray","captureStackError","stack","split","line","missingModules","_interceptHandler","timeoutRejected","_throwOnLegacyProtocolResolutionErrors","_logServerMessages","errors","resolutionErrors","addMappings","configMap","addPaths","pathMap","resolvedModules","_getUnregisteredModuleNames","moduleMap","moduleFlags","addModule","_setRejectTimeout","loadModules","_waitForModuleDefinitions","clearTimeout","_setModuleImplementations","implementations","_getModuleImplementations","err","handler","type","filter","warnings","setTimeout","implemented","dep","substr","moduleImpl","dependencyImplementations","dependency","_createLocalRequire","getDependency","localRequire","rest","require","toUrl","amd","namespace","exposeGlobal","loader"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAA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AAKuJ,QAAL,QAAI,CAASvK,GAAT,OAAwBsK,IAGnC,IAAM3J,EAAmB0B,EAAO+H,cAC/BvP,EAAOQ,KACP2E,GAGD,IACEW,KACC,mBAAoBA,GAEtB,MAAM,IAAI5D,MACT,WACCiD,EACA,0CACAnF,EAAOQ,MAIV,OAAOsF,EAAiB5B,gBAU1B,OANAsL,EAAaG,MAAQ,SAACxK,GAGrB,OAFmB,EAAKkF,YAAYI,MAAM,CAACtF,IAEzB,GAAGgC,KAGfqI,I,gDASkBhK,GAGzB,OAFelC,KAAKyB,QAGlB6F,WAAWpF,GACXrB,KAAI,SAACnE,GAAD,OAAYA,EAAOkE,uB,gCAI3BqH,EAAO1J,UAAU2C,OAAOoL,IAAM,GCjxB9B,IAAMjL,EAAM6G,OAAOC,YAAc,GAC3BoE,EAAqC,iBAAlBlL,EAAIkL,UAAyBlL,EAAIkL,eAAY7M,EAChE8M,OAAoC9M,IAArB2B,EAAImL,cAAoCnL,EAAImL,aAC3DC,EAAS,IAAIxE,EAAO5G,GAE1B,GAAIkL,EAAW,CACd,IAAMvO,EAAKkK,OAAOqE,GAAarE,OAAOqE,GAAa,GACnDvO,EAAGiK,OAASwE,EACZvE,OAAOqE,GAAavO,OAGpBkK,OAAOD,OAASwE,EAGbD,IACHtE,OAAOD,OAASwE,EAChBvE,OAAOkE,QAAUnE,EAAO1J,UAAU6N,QAAQjO,KAAKsO,GAC/CvE,OAAOhH,OAAS+G,EAAO1J,UAAU2C,OAAO/C,KAAKsO,GAC7CvE,OAAOhH,OAAOoL,IAAM","file":"loader.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n","/**\n * SPDX-FileCopyrightText: © 2014 Liferay, Inc. \n * SPDX-License-Identifier: LGPL-3.0-or-later\n */\n\n/**\n * A Promise with resolve() and reject() methods so that it can be fulfilled\n * asynchronously from outside instead of the callback.\n *\n * Because Promise cannot be extended in the usual way, we need to do some\n * magic to define this class.\n */\nexport default class ResolvablePromise {\n\n\t/**\n\t * Don't construct ResolvablePromise objects directly: rely on\n\t * ResolvablePromise.new() instead.\n\t */\n\tconstructor() {\n\t\tthrow new Error(\n\t\t\t\"Don't construct ResolvablePromise objects directly: \" +\n\t\t\t\t'rely on ResolvablePromise.new() instead'\n\t\t);\n\t}\n}\n\nResolvablePromise.new = () => {\n\tconst capture = {};\n\n\tconst promise = new Promise((resolve, reject) => {\n\t\tcapture._resolve = resolve;\n\t\tcapture._reject = reject;\n\t});\n\n\tObject.assign(promise, capture, {\n\t\tfulfilled: false,\n\t\trejected: false,\n\t\trejection: undefined,\n\t\tresolution: undefined,\n\t\tresolved: false,\n\t});\n\n\tpromise.resolve = (value) => resolve(promise, value);\n\tpromise.reject = (error) => reject(promise, error);\n\n\t// This is to avoid UnhandledPromiseRejectionWarning errors during the tests\n\n\tif (typeof jest !== 'undefined') {\n\t\tpromise.catch(() => {});\n\t}\n\n\treturn promise;\n};\n\n/**\n * Resolve the promise\n * @param {ResolvablePromise} resolvablePromise\n * @param {*} value\n */\nfunction resolve(resolvablePromise, value) {\n\t_assertNotFulfilled(resolvablePromise);\n\n\tresolvablePromise.fulfilled = true;\n\tresolvablePromise.resolved = true;\n\tresolvablePromise.resolution = value;\n\n\tresolvablePromise._resolve(value);\n}\n\n/**\n * Reject the Promise\n * @param {ResolvablePromise} resolvablePromise\n * @param {Error} error\n */\nfunction reject(resolvablePromise, error) {\n\t_assertNotFulfilled(resolvablePromise);\n\n\tresolvablePromise.fulfilled = true;\n\tresolvablePromise.rejected = true;\n\tresolvablePromise.rejection = error;\n\n\tresolvablePromise._reject(error);\n}\n\n/**\n * Throws if Promise is already fulfilled\n * @param {ResolvablePromise} resolvablePromise\n */\nfunction _assertNotFulfilled(resolvablePromise) {\n\tif (resolvablePromise.fulfilled) {\n\t\tthrow new Error('Promise already fulfilled');\n\t}\n}\n","/**\n * SPDX-FileCopyrightText: © 2014 Liferay, Inc. \n * SPDX-License-Identifier: LGPL-3.0-or-later\n */\n\nimport ResolvablePromise from './resolvable-promise';\n\n/**\n * A module descriptor\n */\nexport default class Module {\n\n\t/**\n\t * @param {string} name name of module\n\t */\n\tconstructor(name) {\n\t\tthis._name = name;\n\t\tthis._dependencies = undefined;\n\t\tthis._factory = undefined;\n\t\tthis._implementation = {};\n\n\t\tthis._map = undefined;\n\n\t\tthis._state = {\n\t\t\t_define: ResolvablePromise.new(),\n\t\t\t_fetch: ResolvablePromise.new(),\n\t\t\t_implement: ResolvablePromise.new(),\n\t\t};\n\t}\n\n\t/**\n\t * Name of module\n\t */\n\tget name() {\n\t\treturn this._name;\n\t}\n\n\t/**\n\t * Dependencies of module\n\t */\n\tget dependencies() {\n\t\treturn this._dependencies;\n\t}\n\n\t/**\n\t * AMD factory function\n\t */\n\tget factory() {\n\t\treturn this._factory;\n\t}\n\n\t/**\n\t * Result of factory invocation (module.exports)\n\t */\n\tget implementation() {\n\t\treturn this._implementation;\n\t}\n\n\t/**\n\t * Local module mappings for module\n\t */\n\tget map() {\n\t\treturn this._map;\n\t}\n\n\t/**\n\t * Flag informing that this module's implementation needs to have __esModule\n\t * property defined as true even before it is implemented.\n\t *\n\t * This is necessary for cyclic dependencies to work for ES6+ modules.\n\t */\n\tget esModule() {\n\t\treturn this._implementation.__esModule;\n\t}\n\n\t/**\n\t * Get the fetch promise which is fulfilled when the script containing the\n\t * module definition has been loaded/failed.\n\t *\n\t * Note that a module may be defined even if it is not yet fetched because\n\t * define() gets called while the script is being loaded.\n\t * @return {ResolvablePromise}\n\t */\n\tget fetch() {\n\t\treturn this._state._fetch;\n\t}\n\n\t/**\n\t * Shorthand for this.fetch.resolved\n\t */\n\tget fetched() {\n\t\treturn this.fetch.resolved;\n\t}\n\n\t/**\n\t * Get the define promise which if fulfilled when the script had been\n\t * registered by the AMD define() function.\n\t *\n\t * Note that definition does not imply implementation.\n\t *\n\t * Also note that a module may be defined even if it is not yet fetched\n\t * because define() gets called while the script is being loaded.\n\t * @return {ResolvablePromise}\n\t */\n\tget define() {\n\t\treturn this._state._define;\n\t}\n\n\t/**\n\t * Shorthand for this.define.resolved\n\t */\n\tget defined() {\n\t\treturn this.define.resolved;\n\t}\n\n\t/**\n\t * Get the implement promise which if fulfilled when the module has been\n\t * defined and its AMD factory function has been invoked successfully.\n\t */\n\tget implement() {\n\t\treturn this._state._implement;\n\t}\n\n\t/**\n\t * Shorthand for this.implement.resolved\n\t */\n\tget implemented() {\n\t\treturn this.implement.resolved;\n\t}\n\n\t/**\n\t * Name of module\n\t * @param {string} name\n\t */\n\tset name(name) {\n\t\tthrow new Error(`Name of module ${this.name} is read-only`);\n\t}\n\n\t/**\n\t * Dependencies of module\n\t * @param {Array} dependencies\n\t */\n\tset dependencies(dependencies) {\n\t\tif (this._dependencies) {\n\t\t\tthrow new Error(`Dependencies of module ${this.name} already set`);\n\t\t}\n\n\t\tthis._dependencies = dependencies;\n\t}\n\n\t/**\n\t * AMD factory function\n\t * @param {function} factory\n\t */\n\tset factory(factory) {\n\t\tif (this._factory) {\n\t\t\tthrow new Error(`Factory of module ${this.name} already set`);\n\t\t}\n\n\t\tthis._factory = factory;\n\t}\n\n\t/**\n\t * Result of factory invocation (module.exports)\n\t * @param {*} implementation\n\t */\n\tset implementation(implementation) {\n\t\tthis._implementation = implementation;\n\t}\n\n\t/**\n\t * Local module mappings for module\n\t * @param {object} map\n\t */\n\tset map(map) {\n\t\tif (this._map) {\n\t\t\tthrow new Error(\n\t\t\t\t`Local module map of module ${this.name} already set`\n\t\t\t);\n\t\t}\n\n\t\tthis._map = map;\n\t}\n\n\t/**\n\t * Flag informing that this module's implementation needs to have __esModule\n\t * property defined as true even before it is implemented.\n\t *\n\t * This is necessary for cyclic dependencies to work for ES6+ modules.\n\t *\n\t * @param {boolean} esModule\n\t */\n\tset esModule(esModule) {\n\t\tObject.defineProperty(this._implementation, '__esModule', {\n\t\t\tconfigurable: true,\n\t\t\tvalue: esModule,\n\t\t\twritable: true,\n\t\t});\n\t}\n}\n","/**\n * SPDX-FileCopyrightText: © 2014 Liferay, Inc. \n * SPDX-License-Identifier: LGPL-3.0-or-later\n */\n\nimport Module from './module';\n\n/**\n *\n */\nexport default class Config {\n\n\t/**\n\t * Creates an instance of Configuration class\n\t * @constructor\n\t * @param {object=} cfg configuration properties\n\t */\n\tconstructor(cfg = {}) {\n\t\tthis._modules = {};\n\t\tthis._maps = {};\n\t\tthis._paths = {};\n\n\t\tthis._config = {maps: {}, paths: {}};\n\t\tthis._parse(cfg, 'defaultURLParams', {});\n\t\tthis._parse(cfg, 'explainResolutions', false);\n\t\tthis._parse(cfg, 'showWarnings', false);\n\t\tthis._parse(cfg, 'waitTimeout', 7000);\n\t\tthis._parse(cfg, 'basePath', '/');\n\t\tthis._parse(cfg, 'resolvePath', '/o/js_resolve_modules');\n\t\tthis._parse(cfg, 'combine', false);\n\t\tthis._parse(cfg, 'url', '');\n\t\tthis._parse(cfg, 'urlMaxLength', 2000);\n\t\tthis._parse(cfg, 'logLevel', 'error');\n\t}\n\n\t/**\n\t * Whether to explain how require() calls are resolved\n\t */\n\tget explainResolutions() {\n\t\treturn this._config.explainResolutions;\n\t}\n\n\t/**\n\t * Whether to show development warnings\n\t */\n\tget showWarnings() {\n\t\treturn this._config.showWarnings;\n\t}\n\n\t/**\n\t * Time to wait for module script requests to load (in milliseconds)\n\t */\n\tget waitTimeout() {\n\t\treturn this._config.waitTimeout;\n\t}\n\n\t/**\n\t * The base path from where modules must be retrieved\n\t */\n\tget basePath() {\n\t\treturn this._config.basePath;\n\t}\n\n\t/**\n\t * The path to use when calling the server to resolve module dependencies\n\t */\n\tget resolvePath() {\n\t\treturn this._config.resolvePath;\n\t}\n\n\t/**\n\t * Whether to combine module requests into combo URLs\n\t */\n\tget combine() {\n\t\treturn this._config.combine;\n\t}\n\n\t/**\n\t * The URL of the server\n\t */\n\tget url() {\n\t\treturn this._config.url;\n\t}\n\n\t/**\n\t * The maximum length of a combo URL. If URL is larger than that it is split\n\t * in as many requests as needed.\n\t */\n\tget urlMaxLength() {\n\t\treturn this._config.urlMaxLength;\n\t}\n\n\tget logLevel() {\n\t\treturn this._config.logLevel;\n\t}\n\n\t/**\n\t * Default parameters to add to the module request URLs\n\t */\n\tget defaultURLParams() {\n\t\treturn this._config.defaultURLParams;\n\t}\n\n\t/**\n\t * An object with registered module paths\n\t */\n\tget paths() {\n\t\treturn this._paths;\n\t}\n\n\t/**\n\t * Adds a module to the configuration with default field values if it\n\t * doesn't exist. Otherwise, throws an exception.\n\t * @param {string} moduleName\n\t * @param {object} moduleProperties initial properties to set on module in\n\t * \t\t\t\t\t\t\t\t\taddition to its name\n\t * @return {Object} the module\n\t */\n\taddModule(moduleName, moduleProperties = {}) {\n\t\tif (this._modules[moduleName]) {\n\t\t\tthrow new Error(`Module is already registered: ${moduleName}`);\n\t\t}\n\n\t\tconst module = new Module(moduleName);\n\n\t\tObject.entries(moduleProperties).forEach(([key, value]) => {\n\t\t\tmodule[key] = value;\n\t\t});\n\n\t\tthis._modules[moduleName] = module;\n\n\t\treturn module;\n\t}\n\n\t/**\n\t * Add mappings to the current configuration\n\t * @param {object} mappings an object with one or more mappings\n\t */\n\taddMappings(mappings) {\n\t\tObject.assign(this._maps, mappings);\n\t}\n\n\t/**\n\t * Add path mappings to the current configuration\n\t * @param {object} paths an object with one or more path mappings\n\t */\n\taddPaths(paths) {\n\t\tObject.assign(this._paths, paths);\n\t}\n\n\t/**\n\t * Returns array with all registered modules or the requested subset of\n\t * them.\n\t * @param {?Array} moduleNames optional list of module names to retrieve\n\t * @return {Array}\n\t */\n\tgetModules(moduleNames = undefined) {\n\t\tif (moduleNames === undefined) {\n\t\t\treturn Object.values(this._modules);\n\t\t}\n\n\t\treturn moduleNames.map((moduleName) => this.getModule(moduleName));\n\t}\n\n\t/**\n\t * Returns the registered module for the moduleName.\n\t * @param {string} moduleName the module name\n\t * @return {Object} the registed module object\n\t */\n\tgetModule(moduleName) {\n\t\tlet module = this._modules[moduleName];\n\n\t\tif (!module) {\n\t\t\tconst mappedName = this._mapModule(moduleName);\n\n\t\t\tmodule = this._modules[mappedName];\n\t\t}\n\n\t\treturn module;\n\t}\n\n\t/**\n\t * Returns the registered module for the dependency of moduleName.\n\t * @param {string} moduleName the module name\n\t * @param {string} dependencyName the dependencyName name\n\t * @return {Object} the registed module object\n\t */\n\tgetDependency(moduleName, dependencyName) {\n\t\tconst module = this.getModule(moduleName);\n\n\t\tlet dependencyModule = this._modules[dependencyName];\n\n\t\tif (!dependencyModule) {\n\t\t\tconst mappedName = this._mapModule(dependencyName, module.map);\n\n\t\t\tdependencyModule = this._modules[mappedName];\n\t\t}\n\n\t\treturn dependencyModule;\n\t}\n\n\t/**\n\t * Parse a configuration property to store it in _config.\n\t * @param {object} cfg\n\t * @param {string} property\n\t * @param {*} defaultValue\n\t */\n\t_parse(cfg, property, defaultValue) {\n\t\tthis._config[property] = Object.prototype.hasOwnProperty.call(\n\t\t\tcfg,\n\t\t\tproperty\n\t\t)\n\t\t\t? cfg[property]\n\t\t\t: defaultValue;\n\t}\n\n\t/**\n\t * Maps module names to their aliases. Example:\n\t * __CONFIG__.maps = {\n\t * liferay: 'liferay@1.0.0'\n\t * }\n\t *\n\t * When someone does require('liferay/html/js/ac.es',...),\n\t * if the module 'liferay/html/js/ac.es' is not defined,\n\t * then a corresponding alias will be searched. If found, the name will be\n\t * replaced, so it will look like user did\n\t * require('liferay@1.0.0/html/js/ac.es',...).\n\t *\n\t * Additionally, modules can define a custom map to alias module names just\n\t * in the context of that module loading operation. When present, the\n\t * contextual module mapping will take precedence over the general one.\n\t * @param {string} moduleName The module which have to be mapped\n\t * @param {?object} contextMap Contextual module mapping information\n\t * relevant to the current load operation\n\t * @return {array} The mapped module\n\t */\n\t_mapModule(moduleName, contextMap) {\n\t\tif (contextMap) {\n\t\t\tmoduleName = this._mapMatches(moduleName, contextMap);\n\t\t}\n\n\t\tif (Object.keys(this._maps).length > 0) {\n\t\t\tmoduleName = this._mapMatches(moduleName, this._maps);\n\t\t}\n\n\t\treturn moduleName;\n\t}\n\n\t/**\n\t * Creates a function that transforms module names based on a provided\n\t * set of mappings.\n\t * @param {string} moduleName module name\n\t * @param {object} maps Mapping information.\n\t * @return {function} The generated mapper function\n\t */\n\t_mapMatches(moduleName, maps) {\n\t\tlet match = maps[moduleName];\n\n\t\tif (match) {\n\t\t\tif (typeof match === 'object') {\n\t\t\t\treturn match.value;\n\t\t\t}\n\n\t\t\treturn match;\n\t\t}\n\n\t\tmatch = this._mapExactMatch(moduleName, maps);\n\n\t\t// Apply partial mapping only if exactMatch hasn't been\n\t\t// already applied for this mapping\n\n\t\tif (!match) {\n\t\t\tmatch = this._mapPartialMatch(moduleName, maps);\n\t\t}\n\n\t\t// Apply * mapping only if neither exactMatch nor\n\t\t// partialMatch have been already applied for this mapping\n\n\t\tif (!match) {\n\t\t\tmatch = this._mapWildcardMatch(moduleName, maps);\n\t\t}\n\n\t\treturn match || moduleName;\n\t}\n\n\t/**\n\t * Transforms a module name using the exactMatch mappings\n\t * in a provided mapping object.\n\t * @param {string} module The module which have to be mapped.\n\t * @param {object} maps Mapping information.\n\t * @return {object} An object with a boolean `matched` field and a string\n\t * \t\t\t\t\t`result` field containing the mapped module name\n\t */\n\t_mapExactMatch(module, maps) {\n\t\tfor (const alias in maps) {\n\t\t\tif (Object.prototype.hasOwnProperty.call(maps, alias)) {\n\t\t\t\tconst aliasValue = maps[alias];\n\n\t\t\t\tif (aliasValue.value && aliasValue.exactMatch) {\n\t\t\t\t\tif (module === alias) {\n\t\t\t\t\t\treturn aliasValue.value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Transforms a module name using the partial mappings\n\t * in a provided mapping object.\n\t * @param {string} module The module which have to be mapped.\n\t * @param {object} maps Mapping information.\n\t * @return {object} An object with a boolean `matched` field and a string\n\t * \t\t\t\t\t`result` field containing the mapped module name\n\t */\n\t_mapPartialMatch(module, maps) {\n\t\tfor (const alias in maps) {\n\t\t\tif (Object.prototype.hasOwnProperty.call(maps, alias)) {\n\t\t\t\tlet aliasValue = maps[alias];\n\n\t\t\t\tif (!aliasValue.exactMatch) {\n\t\t\t\t\tif (aliasValue.value) {\n\t\t\t\t\t\taliasValue = aliasValue.value;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (module === alias || module.indexOf(alias + '/') === 0) {\n\t\t\t\t\t\treturn aliasValue + module.substring(alias.length);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Transforms a module name using the wildcard mapping in a provided mapping\n\t * object.\n\t * @param {string} module The module which have to be mapped.\n\t * @param {object} maps Mapping information.\n\t * @return {object} An object with a boolean `matched` field and a string\n\t * \t\t\t\t\t`result` field containing the mapped module name\n\t */\n\t_mapWildcardMatch(module, maps) {\n\t\tif (typeof maps['*'] === 'function') {\n\t\t\treturn maps['*'](module);\n\t\t}\n\t}\n}\n","/**\n * SPDX-FileCopyrightText: © 2014 Liferay, Inc. \n * SPDX-License-Identifier: LGPL-3.0-or-later\n */\n\n/**\n * A class that calls the server to resolve module dependencies.\n */\nexport default class DependencyResolver {\n\n\t/**\n\t * Creates an instance of DependencyResolver class\n\t * @constructor\n\t * @param {Config} config\n\t */\n\tconstructor(config) {\n\t\tthis._config = config;\n\n\t\tthis._cachedResolutions = {};\n\t}\n\n\t/**\n\t * Resolves modules dependencies\n\t * @param {array} modules list of modules which dependencies should be\n\t * \t\t\t\t\t\tresolved\n\t * @return {array} list of module names, representing module dependencies\n\t * \t\t\t\t(module name itself is being returned too)\n\t */\n\tresolve(modules) {\n\t\tif (modules === undefined || modules.length == 0) {\n\t\t\tthrow new Error(`Argument 'modules' cannot be undefined or empty`);\n\t\t}\n\n\t\tconst config = this._config;\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst resolution = this._cachedResolutions[modules];\n\n\t\t\tif (resolution) {\n\t\t\t\tresolve(resolution);\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst modulesParam = `modules=${encodeURIComponent(modules)}`;\n\t\t\tlet url = `${config.resolvePath}?${modulesParam}`;\n\t\t\tlet options = {};\n\n\t\t\tif (url.length > config.urlMaxLength) {\n\t\t\t\turl = config.resolvePath;\n\t\t\t\toptions = {\n\t\t\t\t\tbody: modulesParam,\n\t\t\t\t\tmethod: 'POST',\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tfetch(url, options)\n\t\t\t\t.then((response) => response.text())\n\t\t\t\t.then((text) => {\n\t\t\t\t\tconst resolution = JSON.parse(text);\n\t\t\t\t\tthis._cachedResolutions[modules] = resolution;\n\t\t\t\t\tresolve(resolution);\n\t\t\t\t})\n\t\t\t\t.catch(reject);\n\t\t});\n\t}\n}\n","/**\n * SPDX-FileCopyrightText: © 2014 Liferay, Inc. \n * SPDX-License-Identifier: LGPL-3.0-or-later\n */\n\nconst levelPriority = {\n\t/* eslint-disable sort-keys */\n\n\toff: 0, // shows nothing\n\terror: 1, // shows user errors\n\twarn: 2, // shows warnings about loader's internal state\n\tinfo: 3, // shows info messages about loader's internal state\n\tdebug: 4, // shows debug messages about loader's internal state\n\n\t/* eslint-enable sort-keys */\n};\nconst prefix = 'liferay-amd-loader |';\n\n/* eslint-disable no-console */\n\nexport default class Logger {\n\tconstructor(config) {\n\t\tthis._config = config;\n\t}\n\n\terror(...args) {\n\t\tif (!this._applies('error')) {\n\t\t\treturn;\n\t\t}\n\n\t\tconsole.error(prefix, ...args);\n\t}\n\n\twarn(...args) {\n\t\tif (!this._applies('warn')) {\n\t\t\treturn;\n\t\t}\n\n\t\tconsole.warn(prefix, ...args);\n\t}\n\n\tinfo(...args) {\n\t\tif (!this._applies('info')) {\n\t\t\treturn;\n\t\t}\n\n\t\tconsole.info(prefix, ...args);\n\t}\n\n\tdebug(...args) {\n\t\tif (!this._applies('debug')) {\n\t\t\treturn;\n\t\t}\n\n\t\tconsole.debug(prefix, ...args);\n\t}\n\n\tresolution(...args) {\n\t\tif (!this._config.explainResolutions) {\n\t\t\treturn;\n\t\t}\n\n\t\tconsole.log(prefix, ...args);\n\t}\n\n\t_applies(logLevel) {\n\t\tconst configPriority = levelPriority[this._config.logLevel];\n\t\tconst logPriority = levelPriority[logLevel];\n\n\t\treturn logPriority <= configPriority;\n\t}\n}\n","/**\n * SPDX-FileCopyrightText: © 2014 Liferay, Inc. \n * SPDX-License-Identifier: LGPL-3.0-or-later\n */\n\n/**\n *\n */\nexport default class URLBuilder {\n\n\t/**\n\t * Creates an instance of URLBuilder class\n\t * @constructor\n\t * @param {Config} config\n\t */\n\tconstructor(config) {\n\t\tthis._config = config;\n\t}\n\n\t/**\n\t * Returns a list of URLs from provided list of modules.\n\t * @param {array} moduleNames list of modules for which URLs should be\n\t * \t\t\t\t\t\t\t\tcreated\n\t * @return {array} list of URLs\n\t */\n\tbuild(moduleNames) {\n\t\tconst config = this._config;\n\n\t\tconst bufferURL = [];\n\t\tconst modulesURL = [];\n\t\tlet result = [];\n\n\t\tlet basePath = config.basePath;\n\n\t\tif (basePath.length && basePath.charAt(basePath.length - 1) !== '/') {\n\t\t\tbasePath += '/';\n\t\t}\n\n\t\tmoduleNames.forEach((moduleName) => {\n\t\t\tconst module = config.getModule(moduleName);\n\t\t\tconst path = this._getModulePath(module);\n\n\t\t\tif (config.combine) {\n\t\t\t\tbufferURL.push(path);\n\t\t\t\tmodulesURL.push(module.name);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tresult.push({\n\t\t\t\t\tmodules: [module.name],\n\t\t\t\t\turl: this._getURLWithParams(config.url + basePath + path),\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\t// Add to the result all modules, which have to be combined.\n\n\t\tif (bufferURL.length) {\n\t\t\tresult = result.concat(\n\t\t\t\tthis._generateBufferURLs(modulesURL, bufferURL, {\n\t\t\t\t\tbasePath,\n\t\t\t\t\turl: config.url,\n\t\t\t\t\turlMaxLength: config.urlMaxLength,\n\t\t\t\t})\n\t\t\t);\n\t\t\tbufferURL.length = 0;\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Generate the appropriate set of URLs based on the list of\n\t * required modules and the maximum allowed URL length\n\t * @param {Array} modules Array of module names\n\t * @param {Array} urls Array of module URLs\n\t * @param {Object} config Configuration object containing URL, basePath and\n\t * \t\t\t\t\t\turlMaxLength\n\t * @return {Array} Resulting array of {modules, url} objects\n\t */\n\t_generateBufferURLs(modules, urls, config) {\n\t\tconst basePath = config.basePath;\n\t\tconst result = [];\n\t\tconst urlMaxLength = config.urlMaxLength;\n\n\t\tlet urlResult = {\n\t\t\tmodules: [modules[0]],\n\t\t\turl: config.url + basePath + urls[0],\n\t\t};\n\n\t\tfor (let i = 1; i < urls.length; i++) {\n\t\t\tconst module = modules[i];\n\t\t\tconst path = urls[i];\n\n\t\t\tif (\n\t\t\t\turlResult.url.length + basePath.length + path.length + 1 <\n\t\t\t\turlMaxLength\n\t\t\t) {\n\t\t\t\turlResult.modules.push(module);\n\t\t\t\turlResult.url += '&' + basePath + path;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tresult.push(urlResult);\n\n\t\t\t\turlResult = {\n\t\t\t\t\tmodules: [module],\n\t\t\t\t\turl: config.url + basePath + path,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\turlResult.url = this._getURLWithParams(urlResult.url);\n\n\t\tresult.push(urlResult);\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Returns the path for a module. If module has property path, it will be\n\t * returned directly. Otherwise, the name of module will be used and\n\t * extension .js will be added to module name if omitted.\n\t * @param {object} module The module which path should be returned.\n\t * @return {string} Module path.\n\t */\n\t_getModulePath(module) {\n\t\tconst paths = this._config.paths;\n\n\t\tlet path = module.name;\n\n\t\tObject.keys(paths).forEach((item) => {\n\t\t\tif (path === item || path.indexOf(item + '/') === 0) {\n\t\t\t\tpath = paths[item] + path.substring(item.length);\n\t\t\t}\n\t\t});\n\n\t\tif (path.lastIndexOf('.js') !== path.length - 3) {\n\t\t\tpath += '.js';\n\t\t}\n\n\t\treturn path;\n\t}\n\n\t/**\n\t * Returns an url with parameters defined in config.defaultURLParams. If\n\t * config.defaultURLParams is not defined or is an empty map, the url will\n\t * be returned unmodified.\n\t * @param {string} url The url to be returned with parameters.\n\t * @return {string} url The url with parameters.\n\t */\n\t_getURLWithParams(url) {\n\t\tconst config = this._config;\n\n\t\tconst defaultURLParams = config.defaultURLParams || {};\n\n\t\tconst keys = Object.keys(defaultURLParams);\n\n\t\tif (!keys.length) {\n\t\t\treturn url;\n\t\t}\n\n\t\tconst queryString = keys\n\t\t\t.map((key) => {\n\t\t\t\treturn key + '=' + defaultURLParams[key];\n\t\t\t})\n\t\t\t.join('&');\n\n\t\treturn url + (url.indexOf('?') > -1 ? '&' : '?') + queryString;\n\t}\n}\n","/**\n * SPDX-FileCopyrightText: © 2014 Liferay, Inc. \n * SPDX-License-Identifier: LGPL-3.0-or-later\n */\n\nimport URLBuilder from './url-builder';\n\n/**\n * A class responsible for loading the script resources that contain modules\n * from the server.\n */\nexport default class ScriptLoader {\n\n\t/**\n\t * @param {object} document DOM document object to use\n\t * @param {Config} config\n\t * @param {Logger} log\n\t */\n\tconstructor(document, config, log) {\n\t\tthis._document = document;\n\t\tthis._config = config;\n\t\tthis._log = log;\n\n\t\tthis._urlBuilder = new URLBuilder(config);\n\n\t\tthis._injectedScripts = {};\n\t}\n\n\t/**\n\t * Loads list of modules\n\t * @param {Array} moduleNames List of modules to be loaded.\n\t * @return {Promise} Promise which will be resolved as soon as all modules\n\t * \t\t\t\t\t\thave been loaded.\n\t */\n\tloadModules(moduleNames) {\n\t\tconst urlBuilder = this._urlBuilder;\n\n\t\tif (moduleNames.length == 0) {\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\tconst modulesURLs = urlBuilder.build(moduleNames);\n\n\t\tconst promises = modulesURLs.map((modulesURL) =>\n\t\t\tthis._loadScript(modulesURL)\n\t\t);\n\n\t\treturn Promise.all(promises);\n\t}\n\n\t/**\n\t * Places a script element on the page and waits for it to load.\n\t * @param {object} modulesURL an object with two properties:\n\t * \t\t\t\t\t- modules: list of the modules which should be loaded\n\t * \t\t\t\t\t- url: the URL from which the modules should be loaded\n\t * @return {Promise} a Promise which will be resolved as soon as the script\n\t * \t\t\t\t\t\tis loaded\n\t */\n\t_loadScript(modulesURL) {\n\t\tconst config = this._config;\n\t\tconst modules = config.getModules(modulesURL.modules);\n\n\t\tlet script = this._injectedScripts[modulesURL.url];\n\n\t\tif (!script) {\n\t\t\tscript = this._document.createElement('script');\n\n\t\t\tscript.src = modulesURL.url;\n\t\t\tscript.async = false;\n\n\t\t\tscript.onload = script.onreadystatechange = () => {\n\t\t\t\tif (\n\t\t\t\t\tthis.readyState &&\n\t\t\t\t\tthis.readyState !== 'complete' &&\n\t\t\t\t\tthis.readyState !== 'load'\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tscript.onload = script.onreadystatechange = null;\n\t\t\t\tscript.onerror = null;\n\n\t\t\t\tmodules.forEach((module) => {\n\t\t\t\t\tif (module.fetch.fulfilled) {\n\t\t\t\t\t\tthis._log.warn(\n\t\t\t\t\t\t\t`Module '${module.name}' is being fetched from\\n`,\n\t\t\t\t\t\t\tscript.src,\n\t\t\t\t\t\t\t'but was already fetched from\\n',\n\t\t\t\t\t\t\tmodule.fetch.resolved\n\t\t\t\t\t\t\t\t? module.fetch.resolution.src\n\t\t\t\t\t\t\t\t: module.fetch.rejection.script.src\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tmodule.fetch.resolve(script);\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tscript.onerror = () => {\n\t\t\t\tscript.onload = script.onreadystatechange = null;\n\t\t\t\tscript.onerror = null;\n\n\t\t\t\tconst error = Object.assign(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t`Unable to load script from URL ${modulesURL.url}`\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tmodules: modulesURL.modules,\n\t\t\t\t\t\tscript,\n\t\t\t\t\t\turl: modulesURL.url,\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\tmodules.forEach((module) => module.fetch.reject(error));\n\t\t\t};\n\n\t\t\tthis._injectedScripts[modulesURL.url] = script;\n\t\t\tthis._document.head.appendChild(script);\n\t\t}\n\n\t\treturn Promise.all(modules.map((module) => module.fetch));\n\t}\n}\n","/**\n * SPDX-FileCopyrightText: © 2014 Liferay, Inc. \n * SPDX-License-Identifier: LGPL-3.0-or-later\n */\n\nimport packageJson from '../../package.json';\nimport Config from './config';\nimport DependencyResolver from './dependency-resolver';\nimport Logger from './logger';\nimport ScriptLoader from './script-loader';\nimport URLBuilder from './url-builder';\n\n/**\n *\n */\nexport default class Loader {\n\n\t/**\n\t * Creates an instance of Loader class.\n\t * @namespace Loader\n\t * @constructor\n\t * @param {object=} config Configuration options (defaults to\n\t * \t\t\t\t\t\t\twindow.__CONFIG__)\n\t * @param {object} document DOM document object to use (defaults to\n\t * \t\t\t\t\t\t\t\twindow.document)\n\t */\n\tconstructor(config = null, document = null) {\n\t\tthis._config = new Config(config || window.__CONFIG__);\n\n\t\tthis._log = new Logger(this._config);\n\n\t\tthis._dependencyResolver = new DependencyResolver(this._config);\n\t\tthis._urlBuilder = new URLBuilder(this._config);\n\t\tthis._scriptLoader = new ScriptLoader(\n\t\t\tdocument || window.document,\n\t\t\tthis._config,\n\t\t\tthis._log\n\t\t);\n\n\t\tthis._requireCallId = 0;\n\t}\n\n\t/**\n\t * Get loader version\n\t * @return {String} the version number as specified in package.json\n\t */\n\tversion() {\n\t\treturn packageJson.version;\n\t}\n\n\t/**\n\t * Defines a module in the system and fires\n\t * @param {string} name the name of the module\n\t * @param {array} dependencies list of module dependencies\n\t * @param {function} factory the AMD factory function of the module\n\t */\n\tdefine(...args) {\n\t\tconst config = this._config;\n\n\t\tconst name = args[0];\n\n\t\tlet module = config.getModule(name);\n\n\t\tif (module && module.defined) {\n\t\t\tthis._log.warn(\n\t\t\t\t`Module '${name}' is being redefined. Only the first`,\n\t\t\t\t'definition will be used'\n\t\t\t);\n\n\t\t\treturn;\n\t\t}\n\n\t\tlet dependencies = args[1];\n\t\tlet factory = args[2];\n\n\t\t// Acccount for call polymorphism\n\n\t\tif (args.length == 2) {\n\t\t\tfactory = dependencies;\n\t\t\tdependencies = ['require', 'exports', 'module'];\n\t\t}\n\n\t\t// Normalize factory argument\n\n\t\tif (typeof factory !== 'function') {\n\t\t\tconst exportedValue = factory;\n\n\t\t\tfactory = () => exportedValue;\n\t\t}\n\n\t\t// Do the things\n\n\t\tmodule = config.getModule(name);\n\n\t\tif (!module) {\n\t\t\tthrow new Error(\n\t\t\t\t`Trying to define a module that was not registered: ${name}\\n` +\n\t\t\t\t\t'This usually means that someone is calling define() ' +\n\t\t\t\t\t'for a module that has not been previously required.'\n\t\t\t);\n\t\t}\n\n\t\tif (module.defined) {\n\t\t\tthrow new Error(\n\t\t\t\t`Trying to define a module more than once: ${name}\\n` +\n\t\t\t\t\t'This usually means that someone is calling define() ' +\n\t\t\t\t\t'more than once for the same module, which can lead to ' +\n\t\t\t\t\t'unexpected results.'\n\t\t\t);\n\t\t}\n\n\t\tthis._log.resolution('Defining', module.name);\n\n\t\tmodule.factory = factory;\n\t\tmodule.dependencies = dependencies;\n\n\t\tmodule.define.resolve(args);\n\t}\n\n\t/**\n\t * Requires list of modules. If a module is not yet registered, it will be\n\t * ignored and its implementation in the provided success callback will be\n\t * left undefined.\n\t * @param {array|string[]} modules Modules can be specified as an array of\n\t * \t\t\t\t\t\t\t\t\tstrings or provided as multiple string\n\t * \t\t\t\t\t\t\t\t\tparameters.\n\t * @param {function} success Callback, which will be invoked in case of\n\t * \t\t\t\t\t\t\t\tsuccess. The provided parameters will be\n\t * \t\t\t\t\t\t\t\timplementations of all required modules.\n\t * @param {function} failure Callback, which will be invoked in case of\n\t * \t\t\t\t\t\t\t\tfailure. One parameter with information\n\t * \t\t\t\t\t\t\t\tabout the error will be provided.\n\t */\n\trequire(...args) {\n\t\tconst moduleLoader = this._scriptLoader;\n\t\tconst config = this._config;\n\t\tconst requireCallId = this._requireCallId++;\n\n\t\tlet moduleNames;\n\t\tlet success;\n\t\tlet failure;\n\n\t\t// Account for call polymorphism\n\n\t\tif (args.length == 1) {\n\t\t\tmoduleNames = args[0];\n\t\t\tsuccess = undefined;\n\t\t\tfailure = undefined;\n\t\t}\n\t\telse if (args.length == 2) {\n\t\t\tconst lastArg = args[args.length - 1];\n\n\t\t\tif (typeof lastArg === 'function') {\n\t\t\t\tmoduleNames = args[0];\n\t\t\t\tsuccess = lastArg;\n\t\t\t\tfailure = undefined;\n\t\t\t}\n\t\t\telse if (lastArg == null) {\n\t\t\t\tmoduleNames = args[0];\n\t\t\t\tsuccess = undefined;\n\t\t\t\tfailure = undefined;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tmoduleNames = args;\n\t\t\t\tsuccess = undefined;\n\t\t\t\tfailure = undefined;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tconst lastArg = args[args.length - 1];\n\t\t\tlet successGiven = false;\n\n\t\t\tif (typeof lastArg === 'function' || lastArg == null) {\n\t\t\t\tsuccessGiven = true;\n\t\t\t}\n\n\t\t\tif (!successGiven) {\n\t\t\t\tmoduleNames = args;\n\t\t\t\tsuccess = undefined;\n\t\t\t\tfailure = undefined;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconst penultimateArg = args[args.length - 2];\n\t\t\t\tlet failureGiven = false;\n\n\t\t\t\tif (\n\t\t\t\t\ttypeof penultimateArg === 'function' ||\n\t\t\t\t\tpenultimateArg == null\n\t\t\t\t) {\n\t\t\t\t\tfailureGiven = true;\n\t\t\t\t}\n\n\t\t\t\tif (!failureGiven) {\n\t\t\t\t\tmoduleNames = args.slice(0, args.length - 1);\n\t\t\t\t\tsuccess = lastArg;\n\t\t\t\t\tfailure = undefined;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmoduleNames = args.slice(0, args.length - 2);\n\t\t\t\t\tsuccess = penultimateArg;\n\t\t\t\t\tfailure = lastArg;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Flatten moduleNames argument if necessary\n\n\t\tif (typeof moduleNames === 'string') {\n\t\t\tmoduleNames = [moduleNames];\n\t\t}\n\t\telse if (moduleNames.length == 1 && Array.isArray(moduleNames[0])) {\n\t\t\tmoduleNames = [].concat(...moduleNames);\n\t\t}\n\n\t\t// Provide default value for success\n\n\t\tif (success === undefined) {\n\t\t\tsuccess = () => {};\n\t\t}\n\n\t\t// Provide default value for failure\n\n\t\tif (failure === undefined) {\n\t\t\tconst captureStackError = new Error('');\n\n\t\t\tfailure = (error) => {\n\t\t\t\tlet stack = '(n/a)';\n\n\t\t\t\tif (captureStackError.stack) {\n\t\t\t\t\tstack = captureStackError.stack\n\t\t\t\t\t\t.split('\\n')\n\t\t\t\t\t\t.map((line) => ` ${line}`)\n\t\t\t\t\t\t.join('\\n');\n\n\t\t\t\t\tstack = `\\n${stack}`;\n\t\t\t\t}\n\n\t\t\t\tthis._log.error(\n\t\t\t\t\t'\\n',\n\t\t\t\t\t'A require() call has failed but no failure handler was',\n\t\t\t\t\t'provided.\\n',\n\t\t\t\t\t'Note that even if the call stack of this error trace',\n\t\t\t\t\t'looks like coming from the Liferay AMD Loader, it is not',\n\t\t\t\t\t'an error in the Loader what has caused it, but an error',\n\t\t\t\t\t'caused by the require() call.\\n',\n\t\t\t\t\t'The reason why the Loader is in the stack trace is',\n\t\t\t\t\t\"because it is printing the error so that it doesn't get\",\n\t\t\t\t\t'lost.\\n',\n\t\t\t\t\t'However, we recommend providing a failure handler in all',\n\t\t\t\t\t'require() calls to be able to recover from errors better',\n\t\t\t\t\t'and to avoid the appearance of this message.\\n',\n\t\t\t\t\t'\\n',\n\t\t\t\t\t'Some information about the require() call follows:\\n',\n\t\t\t\t\t' · Require call id:',\n\t\t\t\t\trequireCallId,\n\t\t\t\t\t'\\n',\n\t\t\t\t\t' · Required modules:',\n\t\t\t\t\tmoduleNames,\n\t\t\t\t\t'\\n',\n\t\t\t\t\t' · Missing modules:',\n\t\t\t\t\terror.missingModules ? error.missingModules : '(n/a)',\n\t\t\t\t\t'\\n',\n\t\t\t\t\t' · Stack trace of the require() call:',\n\t\t\t\t\t`${stack}`,\n\t\t\t\t\t'\\n',\n\t\t\t\t\terror\n\t\t\t\t);\n\t\t\t};\n\t\t}\n\n\t\t// Intercept handlers to explain resolutions\n\n\t\tsuccess = this._interceptHandler(success, 'success', requireCallId);\n\t\tfailure = this._interceptHandler(failure, 'failure', requireCallId);\n\n\t\t// Global closure variables\n\n\t\tlet resolvedModuleNames;\n\t\tlet unregisteredModuleNames;\n\t\tlet rejectTimeout;\n\t\tlet timeoutRejected = false;\n\n\t\t// Do the things (note that each then() block contains a synchronous\n\t\t// block of code, that means that between then() blocks may be\n\t\t// interrupted by any parallel call)\n\n\t\tthis._dependencyResolver\n\t\t\t.resolve(moduleNames)\n\t\t\t.then((resolution) => {\n\n\t\t\t\t// Show extra information when explainResolutions is active\n\n\t\t\t\tthis._log.resolution(\n\t\t\t\t\t'Require call',\n\t\t\t\t\trequireCallId,\n\t\t\t\t\t'resolved modules',\n\t\t\t\t\tmoduleNames,\n\t\t\t\t\t'to',\n\t\t\t\t\tresolution\n\t\t\t\t);\n\n\t\t\t\t// In case we are calling an older server, act upon errors\n\n\t\t\t\tthis._throwOnLegacyProtocolResolutionErrors(resolution);\n\n\t\t\t\t// Show server warnings/errors\n\n\t\t\t\tthis._logServerMessages(moduleNames, resolution);\n\n\t\t\t\t// Fail resolution on server errors\n\n\t\t\t\tif (resolution.errors && resolution.errors.length > 1) {\n\t\t\t\t\tthrow Object.assign(\n\t\t\t\t\t\tnew Error(\n\t\t\t\t\t\t\t'The server generated some errors while ' +\n\t\t\t\t\t\t\t\t'resolving modules'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{resolutionErrors: resolution.errors}\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Merge global maps from resolution into config\n\n\t\t\t\tconfig.addMappings(resolution.configMap);\n\n\t\t\t\t// Merge global paths from resolution into config\n\n\t\t\t\tconfig.addPaths(resolution.pathMap);\n\n\t\t\t\t// Store resolved module names\n\n\t\t\t\tresolvedModuleNames = resolution.resolvedModules;\n\n\t\t\t\t// Grab unregistered module names (some of the resolved modules\n\t\t\t\t// may have been registered by a parallel require() call, so we\n\t\t\t\t// are not responsible for loading them).\n\n\t\t\t\tunregisteredModuleNames = this._getUnregisteredModuleNames(\n\t\t\t\t\tresolvedModuleNames\n\t\t\t\t);\n\n\t\t\t\t// Register the modules\n\n\t\t\t\tunregisteredModuleNames.forEach((moduleName) => {\n\t\t\t\t\tconst moduleProperties = {\n\t\t\t\t\t\tmap: resolution.moduleMap[moduleName],\n\t\t\t\t\t};\n\n\t\t\t\t\tlet moduleFlags = resolution.moduleFlags\n\t\t\t\t\t\t? resolution.moduleFlags[moduleName]\n\t\t\t\t\t\t: {};\n\n\t\t\t\t\tmoduleFlags = moduleFlags || {};\n\n\t\t\t\t\tif (moduleFlags.esModule) {\n\t\t\t\t\t\tmoduleProperties.esModule = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tconfig.addModule(moduleName, moduleProperties);\n\t\t\t\t});\n\n\t\t\t\t// Prepare load timeout\n\n\t\t\t\trejectTimeout = this._setRejectTimeout(\n\t\t\t\t\tmoduleNames,\n\t\t\t\t\tresolution,\n\t\t\t\t\t(...args) => {\n\t\t\t\t\t\ttimeoutRejected = true;\n\t\t\t\t\t\tfailure(...args);\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\t// Load the modules we are responsible for\n\n\t\t\t\tthis._log.resolution(\n\t\t\t\t\t'Fetching',\n\t\t\t\t\tunregisteredModuleNames,\n\t\t\t\t\t'from require call',\n\t\t\t\t\trequireCallId\n\t\t\t\t);\n\n\t\t\t\treturn moduleLoader.loadModules(unregisteredModuleNames);\n\t\t\t})\n\t\t\t.then(() => {\n\n\t\t\t\t// If reject timeout was hit don't do anything else\n\n\t\t\t\tif (timeoutRejected) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Wait for all unregistered modules to be defined\n\n\t\t\t\treturn this._waitForModuleDefinitions(resolvedModuleNames);\n\t\t\t})\n\t\t\t.then(() => {\n\n\t\t\t\t// If reject timeout was hit don't do anything else\n\n\t\t\t\tif (timeoutRejected) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Everything went well so we can clear the timeout\n\n\t\t\t\tclearTimeout(rejectTimeout);\n\n\t\t\t\t// Set the implementations of all needed modules. Note that we\n\t\t\t\t// set the implementation of modules not loaded by this\n\t\t\t\t// require() call but it is necessary in case the require()\n\t\t\t\t// call that loaded them aborted because of an error in the\n\t\t\t\t// implementation of some module.\n\n\t\t\t\tthis._setModuleImplementations(\n\t\t\t\t\trequireCallId,\n\t\t\t\t\tresolvedModuleNames\n\t\t\t\t);\n\n\t\t\t\t// Now get all needed modules implementations\n\n\t\t\t\tconst implementations = this._getModuleImplementations(\n\t\t\t\t\tmoduleNames\n\t\t\t\t);\n\n\t\t\t\t// And invoke the sucess handler\n\n\t\t\t\tsuccess(...implementations);\n\t\t\t})\n\t\t\t.catch((err) => {\n\n\t\t\t\t// If reject timeout was hit don't do anything else\n\n\t\t\t\tif (timeoutRejected) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (rejectTimeout) {\n\t\t\t\t\tclearTimeout(rejectTimeout);\n\t\t\t\t}\n\n\t\t\t\tfailure(err);\n\t\t\t});\n\t}\n\n\t/**\n\t * Intercept a require success or failure handler to show information to\n\t * explain resolutions.\n\t * @param {function} handler\n\t * @param {string} type\n\t * @param {number} requireCallId\n\t */\n\t_interceptHandler(handler, type, requireCallId) {\n\t\treturn (...args) => {\n\t\t\tthis._log.resolution(\n\t\t\t\t'Invoking',\n\t\t\t\ttype,\n\t\t\t\t'handler for',\n\t\t\t\t'require call',\n\t\t\t\trequireCallId\n\t\t\t);\n\n\t\t\ttry {\n\t\t\t\thandler(...args);\n\t\t\t}\n\t\t\tcatch (err) {\n\t\t\t\tthis._log.error(\n\t\t\t\t\t'\\n',\n\t\t\t\t\t'A require() call',\n\t\t\t\t\ttype,\n\t\t\t\t\t'handler has thrown an error.\\n',\n\t\t\t\t\t'Note that even if the call stack of this error trace',\n\t\t\t\t\t'looks like coming from the Liferay AMD Loader, it is not',\n\t\t\t\t\t'an error in the Loader what has caused it, but an error',\n\t\t\t\t\t\"in the handler's code.\\n\",\n\t\t\t\t\t'The reason why the Loader is in the stack trace is',\n\t\t\t\t\t'because it is printing the error on behalf of the handler',\n\t\t\t\t\t\"so that it doesn't get lost.\\n\",\n\t\t\t\t\t'However, we recommend wrapping all handler code inside a',\n\t\t\t\t\t'try/catch to be able to recover from errors better and to',\n\t\t\t\t\t'avoid the appearance of this message.\\n',\n\t\t\t\t\t'\\n',\n\t\t\t\t\terr\n\t\t\t\t);\n\t\t\t}\n\t\t};\n\t}\n\n\t/**\n\t * Filters a list of modules and returns only those which are not yet\n\t * registered.\n\t * @param {array} moduleNames list of module names to be tested\n\t * @return {array} list of modules matching the specified filter\n\t */\n\t_getUnregisteredModuleNames(moduleNames) {\n\t\tconst config = this._config;\n\n\t\treturn moduleNames.filter(\n\t\t\t(moduleName) => !config.getModule(moduleName)\n\t\t);\n\t}\n\n\t/**\n\t * Traverse a resolved dependencies array looking for server sent errors and\n\t * throw an Error if any is found.\n\t * @param {array} moduleNames list of module names to be tested\n\t * @param {object} resolution the resolution object\n\t */\n\t_logServerMessages(moduleNames, resolution) {\n\t\tif (resolution.errors && resolution.errors.length > 0) {\n\t\t\tthis._log.error(\n\t\t\t\t'Errors returned from server for require(',\n\t\t\t\tmoduleNames,\n\t\t\t\t'):',\n\t\t\t\tresolution.errors\n\t\t\t);\n\t\t}\n\n\t\tif (resolution.warnings && resolution.warnings.length > 0) {\n\t\t\tthis._log.warn(\n\t\t\t\t'Warnings returned from server for require(',\n\t\t\t\tmoduleNames,\n\t\t\t\t'):',\n\t\t\t\tresolution.warnings\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Set a timeout (only if allowed by configuration) to reject a Promise if\n\t * a certain set of modules has not been successfully loaded.\n\t * @param {Array} modules the modules to be loaded\n\t * @param {object} resolution the resolution object associated to the\n\t * \t\t\t\t\t\t\t\tmodules\n\t * @param {function} reject the promise reject function\n\t * @return {int} a timeout id or undefined if configuration disabled timeout\n\t */\n\t_setRejectTimeout(modules, resolution, reject) {\n\t\tconst config = this._config;\n\n\t\tif (config.waitTimeout === 0) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn setTimeout(() => {\n\t\t\tconst resolvedModuleNames = resolution.resolvedModules;\n\n\t\t\tconst missingModules = resolvedModuleNames.filter((moduleName) => {\n\t\t\t\tconst module = config.getModule(moduleName);\n\n\t\t\t\treturn !module || !module.implemented;\n\t\t\t});\n\n\t\t\tconst error = Object.assign(\n\t\t\t\tnew Error('Load timeout for modules: ' + modules),\n\t\t\t\t{\n\t\t\t\t\tmissingModules,\n\t\t\t\t\tmodules,\n\t\t\t\t\tresolution,\n\t\t\t\t}\n\t\t\t);\n\n\t\t\treject(error);\n\t\t}, config.waitTimeout);\n\t}\n\n\t/**\n\t * Traverse a resolved dependencies array looking for server sent errors and\n\t * throw an Error if any is found.\n\t *\n\t * @deprecated\n\t * This method exists to account for old servers' responses in new loaders.\n\t * Old servers used to send resolution errors in the `resolvedModules` field\n\t * marking them with the ':ERROR:' prefix (because of historical reasons).\n\t *\n\t * @param {object} resolution the resolution object\n\t * @throws {Error} if a resolution error is found\n\t */\n\t_throwOnLegacyProtocolResolutionErrors(resolution) {\n\t\tconst resolutionErrors = resolution.resolvedModules\n\t\t\t.filter((dep) => dep.indexOf(':ERROR:') === 0)\n\t\t\t.map((dep) => dep.substr(7));\n\n\t\tif (resolutionErrors.length > 0) {\n\t\t\tthrow Object.assign(\n\t\t\t\tnew Error(\n\t\t\t\t\t'The following problems where detected while ' +\n\t\t\t\t\t\t'resolving modules:\\n' +\n\t\t\t\t\t\tresolutionErrors\n\t\t\t\t\t\t\t.map((line) => ` · ${line}`)\n\t\t\t\t\t\t\t.join('\\n')\n\t\t\t\t),\n\t\t\t\t{resolutionErrors}\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Resolves a Promise as soon as all provided modules are defined.\n\t * @param {array} moduleNames list of module names for which to wait\n\t * @return {Promise}\n\t */\n\t_waitForModuleDefinitions(moduleNames) {\n\t\tconst config = this._config;\n\n\t\treturn Promise.all(\n\t\t\tconfig.getModules(moduleNames).map((module) => module.define)\n\t\t);\n\t}\n\n\t/**\n\t * Resolves a Promise as soon as all provided modules are implemented.\n\t * @param {array} moduleNames list of module names for which to wait\n\t * @return {Promise}\n\t */\n\t_waitForModuleImplementations(moduleNames) {\n\t\tconst config = this._config;\n\n\t\treturn Promise.all(\n\t\t\tconfig.getModules(moduleNames).map((module) => module.implement)\n\t\t);\n\t}\n\n\t/**\n\t * Invokes the implementation method of modules passing the implementations\n\t * of its dependencies.\n\t * @throws {Error} as soon as any factory fails\n\t * @param {number} requireCallId\n\t * @param {array} moduleNames list of modules to invoke\n\t */\n\t_setModuleImplementations(requireCallId, moduleNames) {\n\t\tconst config = this._config;\n\n\t\tconfig.getModules(moduleNames).forEach((module) => {\n\n\t\t\t// Skip already implemented modules\n\n\t\t\tif (module.implemented) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Fail for already rejected implementations\n\n\t\t\tif (module.implement.rejected) {\n\t\t\t\tthrow module.implement.rejection;\n\t\t\t}\n\n\t\t\t// Show info about resolution\n\n\t\t\tthis._log.resolution(\n\t\t\t\t'Implementing',\n\t\t\t\tmodule.name,\n\t\t\t\t'from require call',\n\t\t\t\trequireCallId\n\t\t\t);\n\n\t\t\ttry {\n\n\t\t\t\t// Prepare CommonJS module implementation object\n\n\t\t\t\tconst moduleImpl = {\n\t\t\t\t\tget exports() {\n\t\t\t\t\t\treturn module.implementation;\n\t\t\t\t\t},\n\t\t\t\t\tset exports(exports) {\n\t\t\t\t\t\tmodule.implementation = exports;\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\t// Prepare arguments for the AMD factory function\n\n\t\t\t\tconst dependencyImplementations = module.dependencies.map(\n\t\t\t\t\t(dependency) => {\n\t\t\t\t\t\tif (dependency === 'exports') {\n\t\t\t\t\t\t\treturn moduleImpl.exports;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (dependency === 'module') {\n\t\t\t\t\t\t\treturn moduleImpl;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (dependency === 'require') {\n\t\t\t\t\t\t\treturn this._createLocalRequire(module);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tconst dependencyModule = config.getDependency(\n\t\t\t\t\t\t\t\tmodule.name,\n\t\t\t\t\t\t\t\tdependency\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tif (!dependencyModule) {\n\t\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t\t`Unsatisfied dependency: ${dependency} ` +\n\t\t\t\t\t\t\t\t\t\t`found in module ${module.name}`\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t!dependencyModule.implementation &&\n\t\t\t\t\t\t\t\t!dependencyModule.implemented\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t\t'Module \"' +\n\t\t\t\t\t\t\t\t\t\tdependencyModule.name +\n\t\t\t\t\t\t\t\t\t\t'\" has not been loaded yet for context: ' +\n\t\t\t\t\t\t\t\t\t\tmodule.name\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn dependencyModule.implementation;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\t// Invoke AMD factory function\n\n\t\t\t\tconst result = module.factory(...dependencyImplementations);\n\n\t\t\t\t// Resolve the implementation\n\n\t\t\t\tif (result !== undefined) {\n\t\t\t\t\tmodule.implementation = result;\n\t\t\t\t}\n\n\t\t\t\tmodule.implement.resolve(module.implementation);\n\t\t\t}\n\t\t\tcatch (err) {\n\t\t\t\tif (!module.implement.fulfilled) {\n\t\t\t\t\tmodule.implement.reject(err);\n\t\t\t\t}\n\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Create a function implementing the local require method of the AMD\n\t * specification.\n\t * @param {Object} module a module descriptor\n\t * @return {function} the local require implementation for the given module\n\t */\n\t_createLocalRequire(module) {\n\t\tconst config = this._config;\n\n\t\tconst localRequire = (moduleName, ...rest) => {\n\t\t\tif (rest.length > 0) {\n\t\t\t\treturn this.require(moduleName, ...rest);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconst dependencyModule = config.getDependency(\n\t\t\t\t\tmodule.name,\n\t\t\t\t\tmoduleName\n\t\t\t\t);\n\n\t\t\t\tif (\n\t\t\t\t\t!dependencyModule ||\n\t\t\t\t\t!('implementation' in dependencyModule)\n\t\t\t\t) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t'Module \"' +\n\t\t\t\t\t\t\tmoduleName +\n\t\t\t\t\t\t\t'\" has not been loaded yet for context: ' +\n\t\t\t\t\t\t\tmodule.name\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn dependencyModule.implementation;\n\t\t\t}\n\t\t};\n\n\t\tlocalRequire.toUrl = (moduleName) => {\n\t\t\tconst moduleURLs = this._urlBuilder.build([moduleName]);\n\n\t\t\treturn moduleURLs[0].url;\n\t\t};\n\n\t\treturn localRequire;\n\t}\n\n\t/**\n\t * Retrieves module implementations to an array.\n\t * @param {array} moduleNames list of modules, which implementations\n\t * \t\t\t\t\twill be collected\n\t * @return {array} list of modules implementations.\n\t */\n\t_getModuleImplementations(moduleNames) {\n\t\tconst config = this._config;\n\n\t\treturn config\n\t\t\t.getModules(moduleNames)\n\t\t\t.map((module) => module.implementation);\n\t}\n}\n\nLoader.prototype.define.amd = {};\n","/**\n * SPDX-FileCopyrightText: © 2014 Liferay, Inc. \n * SPDX-License-Identifier: LGPL-3.0-or-later\n */\n\nimport Loader from './loader';\n\nconst cfg = window.__CONFIG__ || {};\nconst namespace = typeof cfg.namespace === 'string' ? cfg.namespace : undefined;\nconst exposeGlobal = cfg.exposeGlobal === undefined ? true : cfg.exposeGlobal;\nconst loader = new Loader(cfg);\n\nif (namespace) {\n\tconst ns = window[namespace] ? window[namespace] : {};\n\tns.Loader = loader;\n\twindow[namespace] = ns;\n}\nelse {\n\twindow.Loader = loader;\n}\n\nif (exposeGlobal) {\n\twindow.Loader = loader;\n\twindow.require = Loader.prototype.require.bind(loader);\n\twindow.define = Loader.prototype.define.bind(loader);\n\twindow.define.amd = {};\n}\n"],"sourceRoot":""}