{"version":3,"file":"core/require.js","sources":["core/require.js"],"sourcesContent":["/** vim: et:ts=4:sw=4:sts=4\r\n * @license RequireJS 2.3.6 Copyright jQuery Foundation and other contributors.\r\n * Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE\r\n */\r\n//Not using strict: uneven strict support in browsers, #392, and causes\r\n//problems with requirejs.exec()/transpiler plugins that may not be strict.\r\n/*jslint regexp: true, nomen: true, sloppy: true */\r\n/*global window, navigator, document, importScripts, setTimeout, opera */\r\n\r\nvar requirejs, require, define;\r\n(function (global, setTimeout) {\r\n var req, s, head, baseElement, dataMain, src,\r\n interactiveScript, currentlyAddingScript, mainScript, subPath,\r\n version = '2.3.6',\r\n commentRegExp = /\\/\\*[\\s\\S]*?\\*\\/|([^:\"'=]|^)\\/\\/.*$/mg,\r\n cjsRequireRegExp = /[^.]\\s*require\\s*\\(\\s*[\"']([^'\"\\s]+)[\"']\\s*\\)/g,\r\n jsSuffixRegExp = /\\.js$/,\r\n currDirRegExp = /^\\.\\//,\r\n op = Object.prototype,\r\n ostring = op.toString,\r\n hasOwn = op.hasOwnProperty,\r\n isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document),\r\n isWebWorker = !isBrowser && typeof importScripts !== 'undefined',\r\n //PS3 indicates loaded and complete, but need to wait for complete\r\n //specifically. Sequence is 'loading', 'loaded', execution,\r\n // then 'complete'. The UA check is unfortunate, but not sure how\r\n //to feature test w/o causing perf issues.\r\n readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ?\r\n /^complete$/ : /^(complete|loaded)$/,\r\n defContextName = '_',\r\n //Oh the tragedy, detecting opera. See the usage of isOpera for reason.\r\n isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]',\r\n contexts = {},\r\n cfg = {},\r\n globalDefQueue = [],\r\n useInteractive = false;\r\n\r\n //Could match something like ')//comment', do not lose the prefix to comment.\r\n function commentReplace(match, singlePrefix) {\r\n return singlePrefix || '';\r\n }\r\n\r\n function isFunction(it) {\r\n return ostring.call(it) === '[object Function]';\r\n }\r\n\r\n function isArray(it) {\r\n return ostring.call(it) === '[object Array]';\r\n }\r\n\r\n /**\r\n * Helper function for iterating over an array. If the func returns\r\n * a true value, it will break out of the loop.\r\n */\r\n function each(ary, func) {\r\n if (ary) {\r\n var i;\r\n for (i = 0; i < ary.length; i += 1) {\r\n if (ary[i] && func(ary[i], i, ary)) {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Helper function for iterating over an array backwards. If the func\r\n * returns a true value, it will break out of the loop.\r\n */\r\n function eachReverse(ary, func) {\r\n if (ary) {\r\n var i;\r\n for (i = ary.length - 1; i > -1; i -= 1) {\r\n if (ary[i] && func(ary[i], i, ary)) {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n function hasProp(obj, prop) {\r\n return hasOwn.call(obj, prop);\r\n }\r\n\r\n function getOwn(obj, prop) {\r\n return hasProp(obj, prop) && obj[prop];\r\n }\r\n\r\n /**\r\n * Cycles over properties in an object and calls a function for each\r\n * property value. If the function returns a truthy value, then the\r\n * iteration is stopped.\r\n */\r\n function eachProp(obj, func) {\r\n var prop;\r\n for (prop in obj) {\r\n if (hasProp(obj, prop)) {\r\n if (func(obj[prop], prop)) {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Simple function to mix in properties from source into target,\r\n * but only if target does not already have a property of the same name.\r\n */\r\n function mixin(target, source, force, deepStringMixin) {\r\n if (source) {\r\n eachProp(source, function (value, prop) {\r\n if (force || !hasProp(target, prop)) {\r\n if (deepStringMixin && typeof value === 'object' && value &&\r\n !isArray(value) && !isFunction(value) &&\r\n !(value instanceof RegExp)) {\r\n\r\n if (!target[prop]) {\r\n target[prop] = {};\r\n }\r\n mixin(target[prop], value, force, deepStringMixin);\r\n } else {\r\n target[prop] = value;\r\n }\r\n }\r\n });\r\n }\r\n return target;\r\n }\r\n\r\n //Similar to Function.prototype.bind, but the 'this' object is specified\r\n //first, since it is easier to read/figure out what 'this' will be.\r\n function bind(obj, fn) {\r\n return function () {\r\n return fn.apply(obj, arguments);\r\n };\r\n }\r\n\r\n function scripts() {\r\n return document.getElementsByTagName('script');\r\n }\r\n\r\n function defaultOnError(err) {\r\n throw err;\r\n }\r\n\r\n //Allow getting a global that is expressed in\r\n //dot notation, like 'a.b.c'.\r\n function getGlobal(value) {\r\n if (!value) {\r\n return value;\r\n }\r\n var g = global;\r\n each(value.split('.'), function (part) {\r\n g = g[part];\r\n });\r\n return g;\r\n }\r\n\r\n /**\r\n * Constructs an error with a pointer to an URL with more information.\r\n * @param {String} id the error ID that maps to an ID on a web page.\r\n * @param {String} message human readable error.\r\n * @param {Error} [err] the original error, if there is one.\r\n *\r\n * @returns {Error}\r\n */\r\n function makeError(id, msg, err, requireModules) {\r\n var e = new Error(msg + '\\nhttps://requirejs.org/docs/errors.html#' + id);\r\n e.requireType = id;\r\n e.requireModules = requireModules;\r\n if (err) {\r\n e.originalError = err;\r\n }\r\n return e;\r\n }\r\n\r\n if (typeof define !== 'undefined') {\r\n //If a define is already in play via another AMD loader,\r\n //do not overwrite.\r\n return;\r\n }\r\n\r\n if (typeof requirejs !== 'undefined') {\r\n if (isFunction(requirejs)) {\r\n //Do not overwrite an existing requirejs instance.\r\n return;\r\n }\r\n cfg = requirejs;\r\n requirejs = undefined;\r\n }\r\n\r\n //Allow for a require config object\r\n if (typeof require !== 'undefined' && !isFunction(require)) {\r\n //assume it is a config object.\r\n cfg = require;\r\n require = undefined;\r\n }\r\n\r\n function newContext(contextName) {\r\n var inCheckLoaded, Module, context, handlers,\r\n checkLoadedTimeoutId,\r\n config = {\r\n //Defaults. Do not set a default for map\r\n //config to speed up normalize(), which\r\n //will run faster if there is no default.\r\n waitSeconds: 7,\r\n baseUrl: './',\r\n paths: {},\r\n bundles: {},\r\n pkgs: {},\r\n shim: {},\r\n config: {}\r\n },\r\n registry = {},\r\n //registry of just enabled modules, to speed\r\n //cycle breaking code when lots of modules\r\n //are registered, but not activated.\r\n enabledRegistry = {},\r\n undefEvents = {},\r\n defQueue = [],\r\n defined = {},\r\n urlFetched = {},\r\n bundlesMap = {},\r\n requireCounter = 1,\r\n unnormalizedCounter = 1;\r\n\r\n /**\r\n * Trims the . and .. from an array of path segments.\r\n * It will keep a leading path segment if a .. will become\r\n * the first path segment, to help with module name lookups,\r\n * which act like paths, but can be remapped. But the end result,\r\n * all paths that use this function should look normalized.\r\n * NOTE: this method MODIFIES the input array.\r\n * @param {Array} ary the array of path segments.\r\n */\r\n function trimDots(ary) {\r\n var i, part;\r\n for (i = 0; i < ary.length; i++) {\r\n part = ary[i];\r\n if (part === '.') {\r\n ary.splice(i, 1);\r\n i -= 1;\r\n } else if (part === '..') {\r\n // If at the start, or previous value is still ..,\r\n // keep them so that when converted to a path it may\r\n // still work when converted to a path, even though\r\n // as an ID it is less than ideal. In larger point\r\n // releases, may be better to just kick out an error.\r\n if (i === 0 || (i === 1 && ary[2] === '..') || ary[i - 1] === '..') {\r\n continue;\r\n } else if (i > 0) {\r\n ary.splice(i - 1, 2);\r\n i -= 2;\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Given a relative module name, like ./something, normalize it to\r\n * a real name that can be mapped to a path.\r\n * @param {String} name the relative name\r\n * @param {String} baseName a real name that the name arg is relative\r\n * to.\r\n * @param {Boolean} applyMap apply the map config to the value. Should\r\n * only be done if this normalization is for a dependency ID.\r\n * @returns {String} normalized name\r\n */\r\n function normalize(name, baseName, applyMap) {\r\n var pkgMain, mapValue, nameParts, i, j, nameSegment, lastIndex,\r\n foundMap, foundI, foundStarMap, starI, normalizedBaseParts,\r\n baseParts = (baseName && baseName.split('/')),\r\n map = config.map,\r\n starMap = map && map['*'];\r\n\r\n //Adjust any relative paths.\r\n if (name) {\r\n name = name.split('/');\r\n lastIndex = name.length - 1;\r\n\r\n // If wanting node ID compatibility, strip .js from end\r\n // of IDs. Have to do this here, and not in nameToUrl\r\n // because node allows either .js or non .js to map\r\n // to same file.\r\n if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {\r\n name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');\r\n }\r\n\r\n // Starts with a '.' so need the baseName\r\n if (name[0].charAt(0) === '.' && baseParts) {\r\n //Convert baseName to array, and lop off the last part,\r\n //so that . matches that 'directory' and not name of the baseName's\r\n //module. For instance, baseName of 'one/two/three', maps to\r\n //'one/two/three.js', but we want the directory, 'one/two' for\r\n //this normalization.\r\n normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);\r\n name = normalizedBaseParts.concat(name);\r\n }\r\n\r\n trimDots(name);\r\n name = name.join('/');\r\n }\r\n\r\n //Apply map config if available.\r\n if (applyMap && map && (baseParts || starMap)) {\r\n nameParts = name.split('/');\r\n\r\n outerLoop: for (i = nameParts.length; i > 0; i -= 1) {\r\n nameSegment = nameParts.slice(0, i).join('/');\r\n\r\n if (baseParts) {\r\n //Find the longest baseName segment match in the config.\r\n //So, do joins on the biggest to smallest lengths of baseParts.\r\n for (j = baseParts.length; j > 0; j -= 1) {\r\n mapValue = getOwn(map, baseParts.slice(0, j).join('/'));\r\n\r\n //baseName segment has config, find if it has one for\r\n //this name.\r\n if (mapValue) {\r\n mapValue = getOwn(mapValue, nameSegment);\r\n if (mapValue) {\r\n //Match, update name to the new value.\r\n foundMap = mapValue;\r\n foundI = i;\r\n break outerLoop;\r\n }\r\n }\r\n }\r\n }\r\n\r\n //Check for a star map match, but just hold on to it,\r\n //if there is a shorter segment match later in a matching\r\n //config, then favor over this star map.\r\n if (!foundStarMap && starMap && getOwn(starMap, nameSegment)) {\r\n foundStarMap = getOwn(starMap, nameSegment);\r\n starI = i;\r\n }\r\n }\r\n\r\n if (!foundMap && foundStarMap) {\r\n foundMap = foundStarMap;\r\n foundI = starI;\r\n }\r\n\r\n if (foundMap) {\r\n nameParts.splice(0, foundI, foundMap);\r\n name = nameParts.join('/');\r\n }\r\n }\r\n\r\n // If the name points to a package's name, use\r\n // the package main instead.\r\n pkgMain = getOwn(config.pkgs, name);\r\n\r\n return pkgMain ? pkgMain : name;\r\n }\r\n\r\n function removeScript(name) {\r\n if (isBrowser) {\r\n each(scripts(), function (scriptNode) {\r\n if (scriptNode.getAttribute('data-requiremodule') === name &&\r\n scriptNode.getAttribute('data-requirecontext') === context.contextName) {\r\n scriptNode.parentNode.removeChild(scriptNode);\r\n return true;\r\n }\r\n });\r\n }\r\n }\r\n\r\n function hasPathFallback(id) {\r\n var pathConfig = getOwn(config.paths, id);\r\n if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) {\r\n //Pop off the first array value, since it failed, and\r\n //retry\r\n pathConfig.shift();\r\n context.require.undef(id);\r\n\r\n //Custom require that does not do map translation, since\r\n //ID is \"absolute\", already mapped/resolved.\r\n context.makeRequire(null, {\r\n skipMap: true\r\n })([id]);\r\n\r\n return true;\r\n }\r\n }\r\n\r\n //Turns a plugin!resource to [plugin, resource]\r\n //with the plugin being undefined if the name\r\n //did not have a plugin prefix.\r\n function splitPrefix(name) {\r\n var prefix,\r\n index = name ? name.indexOf('!') : -1;\r\n if (index > -1) {\r\n prefix = name.substring(0, index);\r\n name = name.substring(index + 1, name.length);\r\n }\r\n return [prefix, name];\r\n }\r\n\r\n /**\r\n * Creates a module mapping that includes plugin prefix, module\r\n * name, and path. If parentModuleMap is provided it will\r\n * also normalize the name via require.normalize()\r\n *\r\n * @param {String} name the module name\r\n * @param {String} [parentModuleMap] parent module map\r\n * for the module name, used to resolve relative names.\r\n * @param {Boolean} isNormalized: is the ID already normalized.\r\n * This is true if this call is done for a define() module ID.\r\n * @param {Boolean} applyMap: apply the map config to the ID.\r\n * Should only be true if this map is for a dependency.\r\n *\r\n * @returns {Object}\r\n */\r\n function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) {\r\n var url, pluginModule, suffix, nameParts,\r\n prefix = null,\r\n parentName = parentModuleMap ? parentModuleMap.name : null,\r\n originalName = name,\r\n isDefine = true,\r\n normalizedName = '';\r\n\r\n //If no name, then it means it is a require call, generate an\r\n //internal name.\r\n if (!name) {\r\n isDefine = false;\r\n name = '_@r' + (requireCounter += 1);\r\n }\r\n\r\n nameParts = splitPrefix(name);\r\n prefix = nameParts[0];\r\n name = nameParts[1];\r\n\r\n if (prefix) {\r\n prefix = normalize(prefix, parentName, applyMap);\r\n pluginModule = getOwn(defined, prefix);\r\n }\r\n\r\n //Account for relative paths if there is a base name.\r\n if (name) {\r\n if (prefix) {\r\n if (isNormalized) {\r\n normalizedName = name;\r\n } else if (pluginModule && pluginModule.normalize) {\r\n //Plugin is loaded, use its normalize method.\r\n normalizedName = pluginModule.normalize(name, function (name) {\r\n return normalize(name, parentName, applyMap);\r\n });\r\n } else {\r\n // If nested plugin references, then do not try to\r\n // normalize, as it will not normalize correctly. This\r\n // places a restriction on resourceIds, and the longer\r\n // term solution is not to normalize until plugins are\r\n // loaded and all normalizations to allow for async\r\n // loading of a loader plugin. But for now, fixes the\r\n // common uses. Details in #1131\r\n normalizedName = name.indexOf('!') === -1 ?\r\n normalize(name, parentName, applyMap) :\r\n name;\r\n }\r\n } else {\r\n //A regular module.\r\n normalizedName = normalize(name, parentName, applyMap);\r\n\r\n //Normalized name may be a plugin ID due to map config\r\n //application in normalize. The map config values must\r\n //already be normalized, so do not need to redo that part.\r\n nameParts = splitPrefix(normalizedName);\r\n prefix = nameParts[0];\r\n normalizedName = nameParts[1];\r\n isNormalized = true;\r\n\r\n url = context.nameToUrl(normalizedName);\r\n }\r\n }\r\n\r\n //If the id is a plugin id that cannot be determined if it needs\r\n //normalization, stamp it with a unique ID so two matching relative\r\n //ids that may conflict can be separate.\r\n suffix = prefix && !pluginModule && !isNormalized ?\r\n '_unnormalized' + (unnormalizedCounter += 1) :\r\n '';\r\n\r\n return {\r\n prefix: prefix,\r\n name: normalizedName,\r\n parentMap: parentModuleMap,\r\n unnormalized: !!suffix,\r\n url: url,\r\n originalName: originalName,\r\n isDefine: isDefine,\r\n id: (prefix ?\r\n prefix + '!' + normalizedName :\r\n normalizedName) + suffix\r\n };\r\n }\r\n\r\n function getModule(depMap) {\r\n var id = depMap.id,\r\n mod = getOwn(registry, id);\r\n\r\n if (!mod) {\r\n mod = registry[id] = new context.Module(depMap);\r\n }\r\n\r\n return mod;\r\n }\r\n\r\n function on(depMap, name, fn) {\r\n var id = depMap.id,\r\n mod = getOwn(registry, id);\r\n\r\n if (hasProp(defined, id) &&\r\n (!mod || mod.defineEmitComplete)) {\r\n if (name === 'defined') {\r\n fn(defined[id]);\r\n }\r\n } else {\r\n mod = getModule(depMap);\r\n if (mod.error && name === 'error') {\r\n fn(mod.error);\r\n } else {\r\n mod.on(name, fn);\r\n }\r\n }\r\n }\r\n\r\n function onError(err, errback) {\r\n var ids = err.requireModules,\r\n notified = false;\r\n\r\n if (errback) {\r\n errback(err);\r\n } else {\r\n each(ids, function (id) {\r\n var mod = getOwn(registry, id);\r\n if (mod) {\r\n //Set error on module, so it skips timeout checks.\r\n mod.error = err;\r\n if (mod.events.error) {\r\n notified = true;\r\n mod.emit('error', err);\r\n }\r\n }\r\n });\r\n\r\n if (!notified) {\r\n req.onError(err);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Internal method to transfer globalQueue items to this context's\r\n * defQueue.\r\n */\r\n function takeGlobalQueue() {\r\n //Push all the globalDefQueue items into the context's defQueue\r\n if (globalDefQueue.length) {\r\n each(globalDefQueue, function(queueItem) {\r\n var id = queueItem[0];\r\n if (typeof id === 'string') {\r\n context.defQueueMap[id] = true;\r\n }\r\n defQueue.push(queueItem);\r\n });\r\n globalDefQueue = [];\r\n }\r\n }\r\n\r\n handlers = {\r\n 'require': function (mod) {\r\n if (mod.require) {\r\n return mod.require;\r\n } else {\r\n return (mod.require = context.makeRequire(mod.map));\r\n }\r\n },\r\n 'exports': function (mod) {\r\n mod.usingExports = true;\r\n if (mod.map.isDefine) {\r\n if (mod.exports) {\r\n return (defined[mod.map.id] = mod.exports);\r\n } else {\r\n return (mod.exports = defined[mod.map.id] = {});\r\n }\r\n }\r\n },\r\n 'module': function (mod) {\r\n if (mod.module) {\r\n return mod.module;\r\n } else {\r\n return (mod.module = {\r\n id: mod.map.id,\r\n uri: mod.map.url,\r\n config: function () {\r\n return getOwn(config.config, mod.map.id) || {};\r\n },\r\n exports: mod.exports || (mod.exports = {})\r\n });\r\n }\r\n }\r\n };\r\n\r\n function cleanRegistry(id) {\r\n //Clean up machinery used for waiting modules.\r\n delete registry[id];\r\n delete enabledRegistry[id];\r\n }\r\n\r\n function breakCycle(mod, traced, processed) {\r\n var id = mod.map.id;\r\n\r\n if (mod.error) {\r\n mod.emit('error', mod.error);\r\n } else {\r\n traced[id] = true;\r\n each(mod.depMaps, function (depMap, i) {\r\n var depId = depMap.id,\r\n dep = getOwn(registry, depId);\r\n\r\n //Only force things that have not completed\r\n //being defined, so still in the registry,\r\n //and only if it has not been matched up\r\n //in the module already.\r\n if (dep && !mod.depMatched[i] && !processed[depId]) {\r\n if (getOwn(traced, depId)) {\r\n mod.defineDep(i, defined[depId]);\r\n mod.check(); //pass false?\r\n } else {\r\n breakCycle(dep, traced, processed);\r\n }\r\n }\r\n });\r\n processed[id] = true;\r\n }\r\n }\r\n\r\n function checkLoaded() {\r\n var err, usingPathFallback,\r\n waitInterval = config.waitSeconds * 1000,\r\n //It is possible to disable the wait interval by using waitSeconds of 0.\r\n expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(),\r\n noLoads = [],\r\n reqCalls = [],\r\n stillLoading = false,\r\n needCycleCheck = true;\r\n\r\n //Do not bother if this call was a result of a cycle break.\r\n if (inCheckLoaded) {\r\n return;\r\n }\r\n\r\n inCheckLoaded = true;\r\n\r\n //Figure out the state of all the modules.\r\n eachProp(enabledRegistry, function (mod) {\r\n var map = mod.map,\r\n modId = map.id;\r\n\r\n //Skip things that are not enabled or in error state.\r\n if (!mod.enabled) {\r\n return;\r\n }\r\n\r\n if (!map.isDefine) {\r\n reqCalls.push(mod);\r\n }\r\n\r\n if (!mod.error) {\r\n //If the module should be executed, and it has not\r\n //been inited and time is up, remember it.\r\n if (!mod.inited && expired) {\r\n if (hasPathFallback(modId)) {\r\n usingPathFallback = true;\r\n stillLoading = true;\r\n } else {\r\n noLoads.push(modId);\r\n removeScript(modId);\r\n }\r\n } else if (!mod.inited && mod.fetched && map.isDefine) {\r\n stillLoading = true;\r\n if (!map.prefix) {\r\n //No reason to keep looking for unfinished\r\n //loading. If the only stillLoading is a\r\n //plugin resource though, keep going,\r\n //because it may be that a plugin resource\r\n //is waiting on a non-plugin cycle.\r\n return (needCycleCheck = false);\r\n }\r\n }\r\n }\r\n });\r\n\r\n if (expired && noLoads.length) {\r\n //If wait time expired, throw error of unloaded modules.\r\n err = makeError('timeout', 'Load timeout for modules: ' + noLoads, null, noLoads);\r\n err.contextName = context.contextName;\r\n return onError(err);\r\n }\r\n\r\n //Not expired, check for a cycle.\r\n if (needCycleCheck) {\r\n each(reqCalls, function (mod) {\r\n breakCycle(mod, {}, {});\r\n });\r\n }\r\n\r\n //If still waiting on loads, and the waiting load is something\r\n //other than a plugin resource, or there are still outstanding\r\n //scripts, then just try back later.\r\n if ((!expired || usingPathFallback) && stillLoading) {\r\n //Something is still waiting to load. Wait for it, but only\r\n //if a timeout is not already in effect.\r\n if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) {\r\n checkLoadedTimeoutId = setTimeout(function () {\r\n checkLoadedTimeoutId = 0;\r\n checkLoaded();\r\n }, 50);\r\n }\r\n }\r\n\r\n inCheckLoaded = false;\r\n }\r\n\r\n Module = function (map) {\r\n this.events = getOwn(undefEvents, map.id) || {};\r\n this.map = map;\r\n this.shim = getOwn(config.shim, map.id);\r\n this.depExports = [];\r\n this.depMaps = [];\r\n this.depMatched = [];\r\n this.pluginMaps = {};\r\n this.depCount = 0;\r\n\r\n /* this.exports this.factory\r\n this.depMaps = [],\r\n this.enabled, this.fetched\r\n */\r\n };\r\n\r\n Module.prototype = {\r\n init: function (depMaps, factory, errback, options) {\r\n options = options || {};\r\n\r\n //Do not do more inits if already done. Can happen if there\r\n //are multiple define calls for the same module. That is not\r\n //a normal, common case, but it is also not unexpected.\r\n if (this.inited) {\r\n return;\r\n }\r\n\r\n this.factory = factory;\r\n\r\n if (errback) {\r\n //Register for errors on this module.\r\n this.on('error', errback);\r\n } else if (this.events.error) {\r\n //If no errback already, but there are error listeners\r\n //on this module, set up an errback to pass to the deps.\r\n errback = bind(this, function (err) {\r\n this.emit('error', err);\r\n });\r\n }\r\n\r\n //Do a copy of the dependency array, so that\r\n //source inputs are not modified. For example\r\n //\"shim\" deps are passed in here directly, and\r\n //doing a direct modification of the depMaps array\r\n //would affect that config.\r\n this.depMaps = depMaps && depMaps.slice(0);\r\n\r\n this.errback = errback;\r\n\r\n //Indicate this module has be initialized\r\n this.inited = true;\r\n\r\n this.ignore = options.ignore;\r\n\r\n //Could have option to init this module in enabled mode,\r\n //or could have been previously marked as enabled. However,\r\n //the dependencies are not known until init is called. So\r\n //if enabled previously, now trigger dependencies as enabled.\r\n if (options.enabled || this.enabled) {\r\n //Enable this module and dependencies.\r\n //Will call this.check()\r\n this.enable();\r\n } else {\r\n this.check();\r\n }\r\n },\r\n\r\n defineDep: function (i, depExports) {\r\n //Because of cycles, defined callback for a given\r\n //export can be called more than once.\r\n if (!this.depMatched[i]) {\r\n this.depMatched[i] = true;\r\n this.depCount -= 1;\r\n this.depExports[i] = depExports;\r\n }\r\n },\r\n\r\n fetch: function () {\r\n if (this.fetched) {\r\n return;\r\n }\r\n this.fetched = true;\r\n\r\n context.startTime = (new Date()).getTime();\r\n\r\n var map = this.map;\r\n\r\n //If the manager is for a plugin managed resource,\r\n //ask the plugin to load it now.\r\n if (this.shim) {\r\n context.makeRequire(this.map, {\r\n enableBuildCallback: true\r\n })(this.shim.deps || [], bind(this, function () {\r\n return map.prefix ? this.callPlugin() : this.load();\r\n }));\r\n } else {\r\n //Regular dependency.\r\n return map.prefix ? this.callPlugin() : this.load();\r\n }\r\n },\r\n\r\n load: function () {\r\n var url = this.map.url;\r\n\r\n //Regular dependency.\r\n if (!urlFetched[url]) {\r\n urlFetched[url] = true;\r\n context.load(this.map.id, url);\r\n }\r\n },\r\n\r\n /**\r\n * Checks if the module is ready to define itself, and if so,\r\n * define it.\r\n */\r\n check: function () {\r\n if (!this.enabled || this.enabling) {\r\n return;\r\n }\r\n\r\n var err, cjsModule,\r\n id = this.map.id,\r\n depExports = this.depExports,\r\n exports = this.exports,\r\n factory = this.factory;\r\n\r\n if (!this.inited) {\r\n // Only fetch if not already in the defQueue.\r\n if (!hasProp(context.defQueueMap, id)) {\r\n this.fetch();\r\n }\r\n } else if (this.error) {\r\n this.emit('error', this.error);\r\n } else if (!this.defining) {\r\n //The factory could trigger another require call\r\n //that would result in checking this module to\r\n //define itself again. If already in the process\r\n //of doing that, skip this work.\r\n this.defining = true;\r\n\r\n if (this.depCount < 1 && !this.defined) {\r\n if (isFunction(factory)) {\r\n //If there is an error listener, favor passing\r\n //to that instead of throwing an error. However,\r\n //only do it for define()'d modules. require\r\n //errbacks should not be called for failures in\r\n //their callbacks (#699). However if a global\r\n //onError is set, use that.\r\n if ((this.events.error && this.map.isDefine) ||\r\n req.onError !== defaultOnError) {\r\n try {\r\n exports = context.execCb(id, factory, depExports, exports);\r\n } catch (e) {\r\n err = e;\r\n }\r\n } else {\r\n exports = context.execCb(id, factory, depExports, exports);\r\n }\r\n\r\n // Favor return value over exports. If node/cjs in play,\r\n // then will not have a return value anyway. Favor\r\n // module.exports assignment over exports object.\r\n if (this.map.isDefine && exports === undefined) {\r\n cjsModule = this.module;\r\n if (cjsModule) {\r\n exports = cjsModule.exports;\r\n } else if (this.usingExports) {\r\n //exports already set the defined value.\r\n exports = this.exports;\r\n }\r\n }\r\n\r\n if (err) {\r\n err.requireMap = this.map;\r\n err.requireModules = this.map.isDefine ? [this.map.id] : null;\r\n err.requireType = this.map.isDefine ? 'define' : 'require';\r\n return onError((this.error = err));\r\n }\r\n\r\n } else {\r\n //Just a literal value\r\n exports = factory;\r\n }\r\n\r\n this.exports = exports;\r\n\r\n if (this.map.isDefine && !this.ignore) {\r\n defined[id] = exports;\r\n\r\n if (req.onResourceLoad) {\r\n var resLoadMaps = [];\r\n each(this.depMaps, function (depMap) {\r\n resLoadMaps.push(depMap.normalizedMap || depMap);\r\n });\r\n req.onResourceLoad(context, this.map, resLoadMaps);\r\n }\r\n }\r\n\r\n //Clean up\r\n cleanRegistry(id);\r\n\r\n this.defined = true;\r\n }\r\n\r\n //Finished the define stage. Allow calling check again\r\n //to allow define notifications below in the case of a\r\n //cycle.\r\n this.defining = false;\r\n\r\n if (this.defined && !this.defineEmitted) {\r\n this.defineEmitted = true;\r\n this.emit('defined', this.exports);\r\n this.defineEmitComplete = true;\r\n }\r\n\r\n }\r\n },\r\n\r\n callPlugin: function () {\r\n var map = this.map,\r\n id = map.id,\r\n //Map already normalized the prefix.\r\n pluginMap = makeModuleMap(map.prefix);\r\n\r\n //Mark this as a dependency for this plugin, so it\r\n //can be traced for cycles.\r\n this.depMaps.push(pluginMap);\r\n\r\n on(pluginMap, 'defined', bind(this, function (plugin) {\r\n var load, normalizedMap, normalizedMod,\r\n bundleId = getOwn(bundlesMap, this.map.id),\r\n name = this.map.name,\r\n parentName = this.map.parentMap ? this.map.parentMap.name : null,\r\n localRequire = context.makeRequire(map.parentMap, {\r\n enableBuildCallback: true\r\n });\r\n\r\n //If current map is not normalized, wait for that\r\n //normalized name to load instead of continuing.\r\n if (this.map.unnormalized) {\r\n //Normalize the ID if the plugin allows it.\r\n if (plugin.normalize) {\r\n name = plugin.normalize(name, function (name) {\r\n return normalize(name, parentName, true);\r\n }) || '';\r\n }\r\n\r\n //prefix and name should already be normalized, no need\r\n //for applying map config again either.\r\n normalizedMap = makeModuleMap(map.prefix + '!' + name,\r\n this.map.parentMap,\r\n true);\r\n on(normalizedMap,\r\n 'defined', bind(this, function (value) {\r\n this.map.normalizedMap = normalizedMap;\r\n this.init([], function () { return value; }, null, {\r\n enabled: true,\r\n ignore: true\r\n });\r\n }));\r\n\r\n normalizedMod = getOwn(registry, normalizedMap.id);\r\n if (normalizedMod) {\r\n //Mark this as a dependency for this plugin, so it\r\n //can be traced for cycles.\r\n this.depMaps.push(normalizedMap);\r\n\r\n if (this.events.error) {\r\n normalizedMod.on('error', bind(this, function (err) {\r\n this.emit('error', err);\r\n }));\r\n }\r\n normalizedMod.enable();\r\n }\r\n\r\n return;\r\n }\r\n\r\n //If a paths config, then just load that file instead to\r\n //resolve the plugin, as it is built into that paths layer.\r\n if (bundleId) {\r\n this.map.url = context.nameToUrl(bundleId);\r\n this.load();\r\n return;\r\n }\r\n\r\n load = bind(this, function (value) {\r\n this.init([], function () { return value; }, null, {\r\n enabled: true\r\n });\r\n });\r\n\r\n load.error = bind(this, function (err) {\r\n this.inited = true;\r\n this.error = err;\r\n err.requireModules = [id];\r\n\r\n //Remove temp unnormalized modules for this module,\r\n //since they will never be resolved otherwise now.\r\n eachProp(registry, function (mod) {\r\n if (mod.map.id.indexOf(id + '_unnormalized') === 0) {\r\n cleanRegistry(mod.map.id);\r\n }\r\n });\r\n\r\n onError(err);\r\n });\r\n\r\n //Allow plugins to load other code without having to know the\r\n //context or how to 'complete' the load.\r\n load.fromText = bind(this, function (text, textAlt) {\r\n /*jslint evil: true */\r\n var moduleName = map.name,\r\n moduleMap = makeModuleMap(moduleName),\r\n hasInteractive = useInteractive;\r\n\r\n //As of 2.1.0, support just passing the text, to reinforce\r\n //fromText only being called once per resource. Still\r\n //support old style of passing moduleName but discard\r\n //that moduleName in favor of the internal ref.\r\n if (textAlt) {\r\n text = textAlt;\r\n }\r\n\r\n //Turn off interactive script matching for IE for any define\r\n //calls in the text, then turn it back on at the end.\r\n if (hasInteractive) {\r\n useInteractive = false;\r\n }\r\n\r\n //Prime the system by creating a module instance for\r\n //it.\r\n getModule(moduleMap);\r\n\r\n //Transfer any config to this other module.\r\n if (hasProp(config.config, id)) {\r\n config.config[moduleName] = config.config[id];\r\n }\r\n\r\n try {\r\n req.exec(text);\r\n } catch (e) {\r\n return onError(makeError('fromtexteval',\r\n 'fromText eval for ' + id +\r\n ' failed: ' + e,\r\n e,\r\n [id]));\r\n }\r\n\r\n if (hasInteractive) {\r\n useInteractive = true;\r\n }\r\n\r\n //Mark this as a dependency for the plugin\r\n //resource\r\n this.depMaps.push(moduleMap);\r\n\r\n //Support anonymous modules.\r\n context.completeLoad(moduleName);\r\n\r\n //Bind the value of that module to the value for this\r\n //resource ID.\r\n localRequire([moduleName], load);\r\n });\r\n\r\n //Use parentName here since the plugin's name is not reliable,\r\n //could be some weird string with no path that actually wants to\r\n //reference the parentName's path.\r\n plugin.load(map.name, localRequire, load, config);\r\n }));\r\n\r\n context.enable(pluginMap, this);\r\n this.pluginMaps[pluginMap.id] = pluginMap;\r\n },\r\n\r\n enable: function () {\r\n enabledRegistry[this.map.id] = this;\r\n this.enabled = true;\r\n\r\n //Set flag mentioning that the module is enabling,\r\n //so that immediate calls to the defined callbacks\r\n //for dependencies do not trigger inadvertent load\r\n //with the depCount still being zero.\r\n this.enabling = true;\r\n\r\n //Enable each dependency\r\n each(this.depMaps, bind(this, function (depMap, i) {\r\n var id, mod, handler;\r\n\r\n if (typeof depMap === 'string') {\r\n //Dependency needs to be converted to a depMap\r\n //and wired up to this module.\r\n depMap = makeModuleMap(depMap,\r\n (this.map.isDefine ? this.map : this.map.parentMap),\r\n false,\r\n !this.skipMap);\r\n this.depMaps[i] = depMap;\r\n\r\n handler = getOwn(handlers, depMap.id);\r\n\r\n if (handler) {\r\n this.depExports[i] = handler(this);\r\n return;\r\n }\r\n\r\n this.depCount += 1;\r\n\r\n on(depMap, 'defined', bind(this, function (depExports) {\r\n if (this.undefed) {\r\n return;\r\n }\r\n this.defineDep(i, depExports);\r\n this.check();\r\n }));\r\n\r\n if (this.errback) {\r\n on(depMap, 'error', bind(this, this.errback));\r\n } else if (this.events.error) {\r\n // No direct errback on this module, but something\r\n // else is listening for errors, so be sure to\r\n // propagate the error correctly.\r\n on(depMap, 'error', bind(this, function(err) {\r\n this.emit('error', err);\r\n }));\r\n }\r\n }\r\n\r\n id = depMap.id;\r\n mod = registry[id];\r\n\r\n //Skip special modules like 'require', 'exports', 'module'\r\n //Also, don't call enable if it is already enabled,\r\n //important in circular dependency cases.\r\n if (!hasProp(handlers, id) && mod && !mod.enabled) {\r\n context.enable(depMap, this);\r\n }\r\n }));\r\n\r\n //Enable each plugin that is used in\r\n //a dependency\r\n eachProp(this.pluginMaps, bind(this, function (pluginMap) {\r\n var mod = getOwn(registry, pluginMap.id);\r\n if (mod && !mod.enabled) {\r\n context.enable(pluginMap, this);\r\n }\r\n }));\r\n\r\n this.enabling = false;\r\n\r\n this.check();\r\n },\r\n\r\n on: function (name, cb) {\r\n var cbs = this.events[name];\r\n if (!cbs) {\r\n cbs = this.events[name] = [];\r\n }\r\n cbs.push(cb);\r\n },\r\n\r\n emit: function (name, evt) {\r\n each(this.events[name], function (cb) {\r\n cb(evt);\r\n });\r\n if (name === 'error') {\r\n //Now that the error handler was triggered, remove\r\n //the listeners, since this broken Module instance\r\n //can stay around for a while in the registry.\r\n delete this.events[name];\r\n }\r\n }\r\n };\r\n\r\n function callGetModule(args) {\r\n //Skip modules already defined.\r\n if (!hasProp(defined, args[0])) {\r\n getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]);\r\n }\r\n }\r\n\r\n function removeListener(node, func, name, ieName) {\r\n //Favor detachEvent because of IE9\r\n //issue, see attachEvent/addEventListener comment elsewhere\r\n //in this file.\r\n if (node.detachEvent && !isOpera) {\r\n //Probably IE. If not it will throw an error, which will be\r\n //useful to know.\r\n if (ieName) {\r\n node.detachEvent(ieName, func);\r\n }\r\n } else {\r\n node.removeEventListener(name, func, false);\r\n }\r\n }\r\n\r\n /**\r\n * Given an event from a script node, get the requirejs info from it,\r\n * and then removes the event listeners on the node.\r\n * @param {Event} evt\r\n * @returns {Object}\r\n */\r\n function getScriptData(evt) {\r\n //Using currentTarget instead of target for Firefox 2.0's sake. Not\r\n //all old browsers will be supported, but this one was easy enough\r\n //to support and still makes sense.\r\n var node = evt.currentTarget || evt.srcElement;\r\n\r\n //Remove the listeners once here.\r\n removeListener(node, context.onScriptLoad, 'load', 'onreadystatechange');\r\n removeListener(node, context.onScriptError, 'error');\r\n\r\n return {\r\n node: node,\r\n id: node && node.getAttribute('data-requiremodule')\r\n };\r\n }\r\n\r\n function intakeDefines() {\r\n var args;\r\n\r\n //Any defined modules in the global queue, intake them now.\r\n takeGlobalQueue();\r\n\r\n //Make sure any remaining defQueue items get properly processed.\r\n while (defQueue.length) {\r\n args = defQueue.shift();\r\n if (args[0] === null) {\r\n return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' +\r\n args[args.length - 1]));\r\n } else {\r\n //args are id, deps, factory. Should be normalized by the\r\n //define() function.\r\n callGetModule(args);\r\n }\r\n }\r\n context.defQueueMap = {};\r\n }\r\n\r\n context = {\r\n config: config,\r\n contextName: contextName,\r\n registry: registry,\r\n defined: defined,\r\n urlFetched: urlFetched,\r\n defQueue: defQueue,\r\n defQueueMap: {},\r\n Module: Module,\r\n makeModuleMap: makeModuleMap,\r\n nextTick: req.nextTick,\r\n onError: onError,\r\n\r\n /**\r\n * Set a configuration for the context.\r\n * @param {Object} cfg config object to integrate.\r\n */\r\n configure: function (cfg) {\r\n //Make sure the baseUrl ends in a slash.\r\n if (cfg.baseUrl) {\r\n if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== '/') {\r\n cfg.baseUrl += '/';\r\n }\r\n }\r\n\r\n // Convert old style urlArgs string to a function.\r\n if (typeof cfg.urlArgs === 'string') {\r\n var urlArgs = cfg.urlArgs;\r\n cfg.urlArgs = function(id, url) {\r\n return (url.indexOf('?') === -1 ? '?' : '&') + urlArgs;\r\n };\r\n }\r\n\r\n //Save off the paths since they require special processing,\r\n //they are additive.\r\n var shim = config.shim,\r\n objs = {\r\n paths: true,\r\n bundles: true,\r\n config: true,\r\n map: true\r\n };\r\n\r\n eachProp(cfg, function (value, prop) {\r\n if (objs[prop]) {\r\n if (!config[prop]) {\r\n config[prop] = {};\r\n }\r\n mixin(config[prop], value, true, true);\r\n } else {\r\n config[prop] = value;\r\n }\r\n });\r\n\r\n //Reverse map the bundles\r\n if (cfg.bundles) {\r\n eachProp(cfg.bundles, function (value, prop) {\r\n each(value, function (v) {\r\n if (v !== prop) {\r\n bundlesMap[v] = prop;\r\n }\r\n });\r\n });\r\n }\r\n\r\n //Merge shim\r\n if (cfg.shim) {\r\n eachProp(cfg.shim, function (value, id) {\r\n //Normalize the structure\r\n if (isArray(value)) {\r\n value = {\r\n deps: value\r\n };\r\n }\r\n if ((value.exports || value.init) && !value.exportsFn) {\r\n value.exportsFn = context.makeShimExports(value);\r\n }\r\n shim[id] = value;\r\n });\r\n config.shim = shim;\r\n }\r\n\r\n //Adjust packages if necessary.\r\n if (cfg.packages) {\r\n each(cfg.packages, function (pkgObj) {\r\n var location, name;\r\n\r\n pkgObj = typeof pkgObj === 'string' ? {name: pkgObj} : pkgObj;\r\n\r\n name = pkgObj.name;\r\n location = pkgObj.location;\r\n if (location) {\r\n config.paths[name] = pkgObj.location;\r\n }\r\n\r\n //Save pointer to main module ID for pkg name.\r\n //Remove leading dot in main, so main paths are normalized,\r\n //and remove any trailing .js, since different package\r\n //envs have different conventions: some use a module name,\r\n //some use a file name.\r\n config.pkgs[name] = pkgObj.name + '/' + (pkgObj.main || 'main')\r\n .replace(currDirRegExp, '')\r\n .replace(jsSuffixRegExp, '');\r\n });\r\n }\r\n\r\n //If there are any \"waiting to execute\" modules in the registry,\r\n //update the maps for them, since their info, like URLs to load,\r\n //may have changed.\r\n eachProp(registry, function (mod, id) {\r\n //If module already has init called, since it is too\r\n //late to modify them, and ignore unnormalized ones\r\n //since they are transient.\r\n if (!mod.inited && !mod.map.unnormalized) {\r\n mod.map = makeModuleMap(id, null, true);\r\n }\r\n });\r\n\r\n //If a deps array or a config callback is specified, then call\r\n //require with those args. This is useful when require is defined as a\r\n //config object before require.js is loaded.\r\n if (cfg.deps || cfg.callback) {\r\n context.require(cfg.deps || [], cfg.callback);\r\n }\r\n },\r\n\r\n makeShimExports: function (value) {\r\n function fn() {\r\n var ret;\r\n if (value.init) {\r\n ret = value.init.apply(global, arguments);\r\n }\r\n return ret || (value.exports && getGlobal(value.exports));\r\n }\r\n return fn;\r\n },\r\n\r\n makeRequire: function (relMap, options) {\r\n options = options || {};\r\n\r\n function localRequire(deps, callback, errback) {\r\n var id, map, requireMod;\r\n\r\n if (options.enableBuildCallback && callback && isFunction(callback)) {\r\n callback.__requireJsBuild = true;\r\n }\r\n\r\n if (typeof deps === 'string') {\r\n if (isFunction(callback)) {\r\n //Invalid call\r\n return onError(makeError('requireargs', 'Invalid require call'), errback);\r\n }\r\n\r\n //If require|exports|module are requested, get the\r\n //value for them from the special handlers. Caveat:\r\n //this only works while module is being defined.\r\n if (relMap && hasProp(handlers, deps)) {\r\n return handlers[deps](registry[relMap.id]);\r\n }\r\n\r\n //Synchronous access to one module. If require.get is\r\n //available (as in the Node adapter), prefer that.\r\n if (req.get) {\r\n return req.get(context, deps, relMap, localRequire);\r\n }\r\n\r\n //Normalize module name, if it contains . or ..\r\n map = makeModuleMap(deps, relMap, false, true);\r\n id = map.id;\r\n\r\n if (!hasProp(defined, id)) {\r\n return onError(makeError('notloaded', 'Module name \"' +\r\n id +\r\n '\" has not been loaded yet for context: ' +\r\n contextName +\r\n (relMap ? '' : '. Use require([])')));\r\n }\r\n return defined[id];\r\n }\r\n\r\n //Grab defines waiting in the global queue.\r\n intakeDefines();\r\n\r\n //Mark all the dependencies as needing to be loaded.\r\n context.nextTick(function () {\r\n //Some defines could have been added since the\r\n //require call, collect them.\r\n intakeDefines();\r\n\r\n requireMod = getModule(makeModuleMap(null, relMap));\r\n\r\n //Store if map config should be applied to this require\r\n //call for dependencies.\r\n requireMod.skipMap = options.skipMap;\r\n\r\n requireMod.init(deps, callback, errback, {\r\n enabled: true\r\n });\r\n\r\n checkLoaded();\r\n });\r\n\r\n return localRequire;\r\n }\r\n\r\n mixin(localRequire, {\r\n isBrowser: isBrowser,\r\n\r\n /**\r\n * Converts a module name + .extension into an URL path.\r\n * *Requires* the use of a module name. It does not support using\r\n * plain URLs like nameToUrl.\r\n */\r\n toUrl: function (moduleNamePlusExt) {\r\n var ext,\r\n index = moduleNamePlusExt.lastIndexOf('.'),\r\n segment = moduleNamePlusExt.split('/')[0],\r\n isRelative = segment === '.' || segment === '..';\r\n\r\n //Have a file extension alias, and it is not the\r\n //dots from a relative path.\r\n if (index !== -1 && (!isRelative || index > 1)) {\r\n ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length);\r\n moduleNamePlusExt = moduleNamePlusExt.substring(0, index);\r\n }\r\n\r\n return context.nameToUrl(normalize(moduleNamePlusExt,\r\n relMap && relMap.id, true), ext, true);\r\n },\r\n\r\n defined: function (id) {\r\n return hasProp(defined, makeModuleMap(id, relMap, false, true).id);\r\n },\r\n\r\n specified: function (id) {\r\n id = makeModuleMap(id, relMap, false, true).id;\r\n return hasProp(defined, id) || hasProp(registry, id);\r\n }\r\n });\r\n\r\n //Only allow undef on top level require calls\r\n if (!relMap) {\r\n localRequire.undef = function (id) {\r\n //Bind any waiting define() calls to this context,\r\n //fix for #408\r\n takeGlobalQueue();\r\n\r\n var map = makeModuleMap(id, relMap, true),\r\n mod = getOwn(registry, id);\r\n\r\n mod.undefed = true;\r\n removeScript(id);\r\n\r\n delete defined[id];\r\n delete urlFetched[map.url];\r\n delete undefEvents[id];\r\n\r\n //Clean queued defines too. Go backwards\r\n //in array so that the splices do not\r\n //mess up the iteration.\r\n eachReverse(defQueue, function(args, i) {\r\n if (args[0] === id) {\r\n defQueue.splice(i, 1);\r\n }\r\n });\r\n delete context.defQueueMap[id];\r\n\r\n if (mod) {\r\n //Hold on to listeners in case the\r\n //module will be attempted to be reloaded\r\n //using a different config.\r\n if (mod.events.defined) {\r\n undefEvents[id] = mod.events;\r\n }\r\n\r\n cleanRegistry(id);\r\n }\r\n };\r\n }\r\n\r\n return localRequire;\r\n },\r\n\r\n /**\r\n * Called to enable a module if it is still in the registry\r\n * awaiting enablement. A second arg, parent, the parent module,\r\n * is passed in for context, when this method is overridden by\r\n * the optimizer. Not shown here to keep code compact.\r\n */\r\n enable: function (depMap) {\r\n var mod = getOwn(registry, depMap.id);\r\n if (mod) {\r\n getModule(depMap).enable();\r\n }\r\n },\r\n\r\n /**\r\n * Internal method used by environment adapters to complete a load event.\r\n * A load event could be a script load or just a load pass from a synchronous\r\n * load call.\r\n * @param {String} moduleName the name of the module to potentially complete.\r\n */\r\n completeLoad: function (moduleName) {\r\n var found, args, mod,\r\n shim = getOwn(config.shim, moduleName) || {},\r\n shExports = shim.exports;\r\n\r\n takeGlobalQueue();\r\n\r\n while (defQueue.length) {\r\n args = defQueue.shift();\r\n if (args[0] === null) {\r\n args[0] = moduleName;\r\n //If already found an anonymous module and bound it\r\n //to this name, then this is some other anon module\r\n //waiting for its completeLoad to fire.\r\n if (found) {\r\n break;\r\n }\r\n found = true;\r\n } else if (args[0] === moduleName) {\r\n //Found matching define call for this script!\r\n found = true;\r\n }\r\n\r\n callGetModule(args);\r\n }\r\n context.defQueueMap = {};\r\n\r\n //Do this after the cycle of callGetModule in case the result\r\n //of those calls/init calls changes the registry.\r\n mod = getOwn(registry, moduleName);\r\n\r\n if (!found && !hasProp(defined, moduleName) && mod && !mod.inited) {\r\n if (config.enforceDefine && (!shExports || !getGlobal(shExports))) {\r\n if (hasPathFallback(moduleName)) {\r\n return;\r\n } else {\r\n return onError(makeError('nodefine',\r\n 'No define call for ' + moduleName,\r\n null,\r\n [moduleName]));\r\n }\r\n } else {\r\n //A script that does not call define(), so just simulate\r\n //the call for it.\r\n callGetModule([moduleName, (shim.deps || []), shim.exportsFn]);\r\n }\r\n }\r\n\r\n checkLoaded();\r\n },\r\n\r\n /**\r\n * Converts a module name to a file path. Supports cases where\r\n * moduleName may actually be just an URL.\r\n * Note that it **does not** call normalize on the moduleName,\r\n * it is assumed to have already been normalized. This is an\r\n * internal API, not a public one. Use toUrl for the public API.\r\n */\r\n nameToUrl: function (moduleName, ext, skipExt) {\r\n var paths, syms, i, parentModule, url,\r\n parentPath, bundleId,\r\n pkgMain = getOwn(config.pkgs, moduleName);\r\n\r\n if (pkgMain) {\r\n moduleName = pkgMain;\r\n }\r\n\r\n bundleId = getOwn(bundlesMap, moduleName);\r\n\r\n if (bundleId) {\r\n return context.nameToUrl(bundleId, ext, skipExt);\r\n }\r\n\r\n //If a colon is in the URL, it indicates a protocol is used and it is just\r\n //an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?)\r\n //or ends with .js, then assume the user meant to use an url and not a module id.\r\n //The slash is important for protocol-less URLs as well as full paths.\r\n if (req.jsExtRegExp.test(moduleName)) {\r\n //Just a plain path, not module name lookup, so just return it.\r\n //Add extension if it is included. This is a bit wonky, only non-.js things pass\r\n //an extension, this method probably needs to be reworked.\r\n url = moduleName + (ext || '');\r\n } else {\r\n //A module that needs to be converted to a path.\r\n paths = config.paths;\r\n\r\n syms = moduleName.split('/');\r\n //For each module name segment, see if there is a path\r\n //registered for it. Start with most specific name\r\n //and work up from it.\r\n for (i = syms.length; i > 0; i -= 1) {\r\n parentModule = syms.slice(0, i).join('/');\r\n\r\n parentPath = getOwn(paths, parentModule);\r\n if (parentPath) {\r\n //If an array, it means there are a few choices,\r\n //Choose the one that is desired\r\n if (isArray(parentPath)) {\r\n parentPath = parentPath[0];\r\n }\r\n syms.splice(0, i, parentPath);\r\n break;\r\n }\r\n }\r\n\r\n //Join the path parts together, then figure out if baseUrl is needed.\r\n url = syms.join('/');\r\n url += (ext || (/^data\\:|^blob\\:|\\?/.test(url) || skipExt ? '' : '.js'));\r\n url = (url.charAt(0) === '/' || url.match(/^[\\w\\+\\.\\-]+:/) ? '' : config.baseUrl) + url;\r\n }\r\n\r\n return config.urlArgs && !/^blob\\:/.test(url) ?\r\n url + config.urlArgs(moduleName, url) : url;\r\n },\r\n\r\n //Delegates to req.load. Broken out as a separate function to\r\n //allow overriding in the optimizer.\r\n load: function (id, url) {\r\n req.load(context, id, url);\r\n },\r\n\r\n /**\r\n * Executes a module callback function. Broken out as a separate function\r\n * solely to allow the build system to sequence the files in the built\r\n * layer in the right sequence.\r\n *\r\n * @private\r\n */\r\n execCb: function (name, callback, args, exports) {\r\n return callback.apply(exports, args);\r\n },\r\n\r\n /**\r\n * callback for script loads, used to check status of loading.\r\n *\r\n * @param {Event} evt the event from the browser for the script\r\n * that was loaded.\r\n */\r\n onScriptLoad: function (evt) {\r\n //Using currentTarget instead of target for Firefox 2.0's sake. Not\r\n //all old browsers will be supported, but this one was easy enough\r\n //to support and still makes sense.\r\n if (evt.type === 'load' ||\r\n (readyRegExp.test((evt.currentTarget || evt.srcElement).readyState))) {\r\n //Reset interactive script so a script node is not held onto for\r\n //to long.\r\n interactiveScript = null;\r\n\r\n //Pull out the name of the module and the context.\r\n var data = getScriptData(evt);\r\n context.completeLoad(data.id);\r\n }\r\n },\r\n\r\n /**\r\n * Callback for script errors.\r\n */\r\n onScriptError: function (evt) {\r\n var data = getScriptData(evt);\r\n if (!hasPathFallback(data.id)) {\r\n var parents = [];\r\n eachProp(registry, function(value, key) {\r\n if (key.indexOf('_@r') !== 0) {\r\n each(value.depMaps, function(depMap) {\r\n if (depMap.id === data.id) {\r\n parents.push(key);\r\n return true;\r\n }\r\n });\r\n }\r\n });\r\n return onError(makeError('scripterror', 'Script error for \"' + data.id +\r\n (parents.length ?\r\n '\", needed by: ' + parents.join(', ') :\r\n '\"'), evt, [data.id]));\r\n }\r\n }\r\n };\r\n\r\n context.require = context.makeRequire();\r\n return context;\r\n }\r\n\r\n /**\r\n * Main entry point.\r\n *\r\n * If the only argument to require is a string, then the module that\r\n * is represented by that string is fetched for the appropriate context.\r\n *\r\n * If the first argument is an array, then it will be treated as an array\r\n * of dependency string names to fetch. An optional function callback can\r\n * be specified to execute when all of those dependencies are available.\r\n *\r\n * Make a local req variable to help Caja compliance (it assumes things\r\n * on a require that are not standardized), and to give a short\r\n * name for minification/local scope use.\r\n */\r\n req = requirejs = function (deps, callback, errback, optional) {\r\n\r\n //Find the right context, use default\r\n var context, config,\r\n contextName = defContextName;\r\n\r\n // Determine if have config object in the call.\r\n if (!isArray(deps) && typeof deps !== 'string') {\r\n // deps is a config object\r\n config = deps;\r\n if (isArray(callback)) {\r\n // Adjust args if there are dependencies\r\n deps = callback;\r\n callback = errback;\r\n errback = optional;\r\n } else {\r\n deps = [];\r\n }\r\n }\r\n\r\n if (config && config.context) {\r\n contextName = config.context;\r\n }\r\n\r\n context = getOwn(contexts, contextName);\r\n if (!context) {\r\n context = contexts[contextName] = req.s.newContext(contextName);\r\n }\r\n\r\n if (config) {\r\n context.configure(config);\r\n }\r\n\r\n return context.require(deps, callback, errback);\r\n };\r\n\r\n /**\r\n * Support require.config() to make it easier to cooperate with other\r\n * AMD loaders on globally agreed names.\r\n */\r\n req.config = function (config) {\r\n return req(config);\r\n };\r\n\r\n /**\r\n * Execute something after the current tick\r\n * of the event loop. Override for other envs\r\n * that have a better solution than setTimeout.\r\n * @param {Function} fn function to execute later.\r\n */\r\n req.nextTick = typeof setTimeout !== 'undefined' ? function (fn) {\r\n setTimeout(fn, 4);\r\n } : function (fn) { fn(); };\r\n\r\n /**\r\n * Export require as a global, but only if it does not already exist.\r\n */\r\n if (!require) {\r\n require = req;\r\n }\r\n\r\n req.version = version;\r\n\r\n //Used to filter out dependencies that are already paths.\r\n req.jsExtRegExp = /^\\/|:|\\?|\\.js$/;\r\n req.isBrowser = isBrowser;\r\n s = req.s = {\r\n contexts: contexts,\r\n newContext: newContext\r\n };\r\n\r\n //Create default context.\r\n req({});\r\n\r\n //Exports some context-sensitive methods on global require.\r\n each([\r\n 'toUrl',\r\n 'undef',\r\n 'defined',\r\n 'specified'\r\n ], function (prop) {\r\n //Reference from contexts instead of early binding to default context,\r\n //so that during builds, the latest instance of the default context\r\n //with its config gets used.\r\n req[prop] = function () {\r\n var ctx = contexts[defContextName];\r\n return ctx.require[prop].apply(ctx, arguments);\r\n };\r\n });\r\n\r\n if (isBrowser) {\r\n head = s.head = document.getElementsByTagName('head')[0];\r\n //If BASE tag is in play, using appendChild is a problem for IE6.\r\n //When that browser dies, this can be removed. Details in this jQuery bug:\r\n //http://dev.jquery.com/ticket/2709\r\n baseElement = document.getElementsByTagName('base')[0];\r\n if (baseElement) {\r\n head = s.head = baseElement.parentNode;\r\n }\r\n }\r\n\r\n /**\r\n * Any errors that require explicitly generates will be passed to this\r\n * function. Intercept/override it if you want custom error handling.\r\n * @param {Error} err the error object.\r\n */\r\n req.onError = defaultOnError;\r\n\r\n /**\r\n * Creates the node for the load command. Only used in browser envs.\r\n */\r\n req.createNode = function (config, moduleName, url) {\r\n var node = config.xhtml ?\r\n document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') :\r\n document.createElement('script');\r\n node.type = config.scriptType || 'text/javascript';\r\n node.charset = 'utf-8';\r\n node.async = true;\r\n return node;\r\n };\r\n\r\n /**\r\n * Does the request to load a module for the browser case.\r\n * Make this a separate function to allow other environments\r\n * to override it.\r\n *\r\n * @param {Object} context the require context to find state.\r\n * @param {String} moduleName the name of the module.\r\n * @param {Object} url the URL to the module.\r\n */\r\n req.load = function (context, moduleName, url) {\r\n var config = (context && context.config) || {},\r\n node;\r\n if (isBrowser) {\r\n //In the browser so use a script tag\r\n node = req.createNode(config, moduleName, url);\r\n\r\n node.setAttribute('data-requirecontext', context.contextName);\r\n node.setAttribute('data-requiremodule', moduleName);\r\n\r\n //Set up load listener. Test attachEvent first because IE9 has\r\n //a subtle issue in its addEventListener and script onload firings\r\n //that do not match the behavior of all other browsers with\r\n //addEventListener support, which fire the onload event for a\r\n //script right after the script execution. See:\r\n //https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution\r\n //UNFORTUNATELY Opera implements attachEvent but does not follow the script\r\n //script execution mode.\r\n if (node.attachEvent &&\r\n //Check if node.attachEvent is artificially added by custom script or\r\n //natively supported by browser\r\n //read https://github.com/requirejs/requirejs/issues/187\r\n //if we can NOT find [native code] then it must NOT natively supported.\r\n //in IE8, node.attachEvent does not have toString()\r\n //Note the test for \"[native code\" with no closing brace, see:\r\n //https://github.com/requirejs/requirejs/issues/273\r\n !(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code') < 0) &&\r\n !isOpera) {\r\n //Probably IE. IE (at least 6-8) do not fire\r\n //script onload right after executing the script, so\r\n //we cannot tie the anonymous define call to a name.\r\n //However, IE reports the script as being in 'interactive'\r\n //readyState at the time of the define call.\r\n useInteractive = true;\r\n\r\n node.attachEvent('onreadystatechange', context.onScriptLoad);\r\n //It would be great to add an error handler here to catch\r\n //404s in IE9+. However, onreadystatechange will fire before\r\n //the error handler, so that does not help. If addEventListener\r\n //is used, then IE will fire error before load, but we cannot\r\n //use that pathway given the connect.microsoft.com issue\r\n //mentioned above about not doing the 'script execute,\r\n //then fire the script load event listener before execute\r\n //next script' that other browsers do.\r\n //Best hope: IE10 fixes the issues,\r\n //and then destroys all installs of IE 6-9.\r\n //node.attachEvent('onerror', context.onScriptError);\r\n } else {\r\n node.addEventListener('load', context.onScriptLoad, false);\r\n node.addEventListener('error', context.onScriptError, false);\r\n }\r\n node.src = url;\r\n\r\n //Calling onNodeCreated after all properties on the node have been\r\n //set, but before it is placed in the DOM.\r\n if (config.onNodeCreated) {\r\n config.onNodeCreated(node, config, moduleName, url);\r\n }\r\n\r\n //For some cache cases in IE 6-8, the script executes before the end\r\n //of the appendChild execution, so to tie an anonymous define\r\n //call to the module name (which is stored on the node), hold on\r\n //to a reference to this node, but clear after the DOM insertion.\r\n currentlyAddingScript = node;\r\n if (baseElement) {\r\n head.insertBefore(node, baseElement);\r\n } else {\r\n head.appendChild(node);\r\n }\r\n currentlyAddingScript = null;\r\n\r\n return node;\r\n } else if (isWebWorker) {\r\n try {\r\n //In a web worker, use importScripts. This is not a very\r\n //efficient use of importScripts, importScripts will block until\r\n //its script is downloaded and evaluated. However, if web workers\r\n //are in play, the expectation is that a build has been done so\r\n //that only one script needs to be loaded anyway. This may need\r\n //to be reevaluated if other use cases become common.\r\n\r\n // Post a task to the event loop to work around a bug in WebKit\r\n // where the worker gets garbage-collected after calling\r\n // importScripts(): https://webkit.org/b/153317\r\n setTimeout(function() {}, 0);\r\n importScripts(url);\r\n\r\n //Account for anonymous modules\r\n context.completeLoad(moduleName);\r\n } catch (e) {\r\n context.onError(makeError('importscripts',\r\n 'importScripts failed for ' +\r\n moduleName + ' at ' + url,\r\n e,\r\n [moduleName]));\r\n }\r\n }\r\n };\r\n\r\n function getInteractiveScript() {\r\n if (interactiveScript && interactiveScript.readyState === 'interactive') {\r\n return interactiveScript;\r\n }\r\n\r\n eachReverse(scripts(), function (script) {\r\n if (script.readyState === 'interactive') {\r\n return (interactiveScript = script);\r\n }\r\n });\r\n return interactiveScript;\r\n }\r\n\r\n //Look for a data-main script attribute, which could also adjust the baseUrl.\r\n if (isBrowser && !cfg.skipDataMain) {\r\n //Figure out baseUrl. Get it from the script tag with require.js in it.\r\n eachReverse(scripts(), function (script) {\r\n //Set the 'head' where we can append children by\r\n //using the script's parent.\r\n if (!head) {\r\n head = script.parentNode;\r\n }\r\n\r\n //Look for a data-main attribute to set main script for the page\r\n //to load. If it is there, the path to data main becomes the\r\n //baseUrl, if it is not already set.\r\n dataMain = script.getAttribute('data-main');\r\n if (dataMain) {\r\n //Preserve dataMain in case it is a path (i.e. contains '?')\r\n mainScript = dataMain;\r\n\r\n //Set final baseUrl if there is not already an explicit one,\r\n //but only do so if the data-main value is not a loader plugin\r\n //module ID.\r\n if (!cfg.baseUrl && mainScript.indexOf('!') === -1) {\r\n //Pull off the directory of data-main for use as the\r\n //baseUrl.\r\n src = mainScript.split('/');\r\n mainScript = src.pop();\r\n subPath = src.length ? src.join('/') + '/' : './';\r\n\r\n cfg.baseUrl = subPath;\r\n }\r\n\r\n //Strip off any trailing .js since mainScript is now\r\n //like a module name.\r\n mainScript = mainScript.replace(jsSuffixRegExp, '');\r\n\r\n //If mainScript is still a path, fall back to dataMain\r\n if (req.jsExtRegExp.test(mainScript)) {\r\n mainScript = dataMain;\r\n }\r\n\r\n //Put the data-main script in the files to load.\r\n cfg.deps = cfg.deps ? cfg.deps.concat(mainScript) : [mainScript];\r\n\r\n return true;\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * The function that handles definitions of modules. Differs from\r\n * require() in that a string for the module should be the first argument,\r\n * and the function to execute after dependencies are loaded should\r\n * return a value to define the module corresponding to the first argument's\r\n * name.\r\n */\r\n define = function (name, deps, callback) {\r\n var node, context;\r\n\r\n //Allow for anonymous modules\r\n if (typeof name !== 'string') {\r\n //Adjust args appropriately\r\n callback = deps;\r\n deps = name;\r\n name = null;\r\n }\r\n\r\n //This module may not have dependencies\r\n if (!isArray(deps)) {\r\n callback = deps;\r\n deps = null;\r\n }\r\n\r\n //If no name, and callback is a function, then figure out if it a\r\n //CommonJS thing with dependencies.\r\n if (!deps && isFunction(callback)) {\r\n deps = [];\r\n //Remove comments from the callback string,\r\n //look for require calls, and pull them into the dependencies,\r\n //but only if there are function args.\r\n if (callback.length) {\r\n callback\r\n .toString()\r\n .replace(commentRegExp, commentReplace)\r\n .replace(cjsRequireRegExp, function (match, dep) {\r\n deps.push(dep);\r\n });\r\n\r\n //May be a CommonJS thing even without require calls, but still\r\n //could use exports, and module. Avoid doing exports and module\r\n //work though if it just needs require.\r\n //REQUIRES the function to expect the CommonJS variables in the\r\n //order listed below.\r\n deps = (callback.length === 1 ? ['require'] : ['require', 'exports', 'module']).concat(deps);\r\n }\r\n }\r\n\r\n //If in IE 6-8 and hit an anonymous define() call, do the interactive\r\n //work.\r\n if (useInteractive) {\r\n node = currentlyAddingScript || getInteractiveScript();\r\n if (node) {\r\n if (!name) {\r\n name = node.getAttribute('data-requiremodule');\r\n }\r\n context = contexts[node.getAttribute('data-requirecontext')];\r\n }\r\n }\r\n\r\n //Always save off evaluating the def call until the script onload handler.\r\n //This allows multiple modules to be in a file without prematurely\r\n //tracing dependencies, and allows for anonymous module support,\r\n //where the module name is not known until the script onload event\r\n //occurs. If no context, use the global queue, and get it processed\r\n //in the onscript load callback.\r\n if (context) {\r\n context.defQueue.push([name, deps, callback]);\r\n context.defQueueMap[name] = true;\r\n } else {\r\n globalDefQueue.push([name, deps, callback]);\r\n }\r\n };\r\n\r\n define.amd = {\r\n jQuery: true\r\n };\r\n\r\n /**\r\n * Executes the text. Normally just uses eval, but can be modified\r\n * to use a better, environment-specific call. Only used for transpiling\r\n * loader plugins, not for plain JS modules.\r\n * @param {String} text the text to execute/evaluate.\r\n */\r\n req.exec = function (text) {\r\n /*jslint evil: true */\r\n return eval(text);\r\n };\r\n\r\n //Set up with config info.\r\n req(cfg);\r\n}(this, (typeof setTimeout === 'undefined' ? undefined : setTimeout)));\r\n"],"names":["requirejs","require","define","global","setTimeout","req","s","head","baseElement","dataMain","src","interactiveScript","currentlyAddingScript","mainScript","subPath","version","commentRegExp","cjsRequireRegExp","jsSuffixRegExp","currDirRegExp","op","Object","prototype","ostring","toString","hasOwn","hasOwnProperty","isBrowser","window","navigator","document","isWebWorker","importScripts","readyRegExp","platform","defContextName","isOpera","opera","contexts","cfg","globalDefQueue","useInteractive","commentReplace","match","singlePrefix","isFunction","it","call","isArray","each","ary","func","i","length","eachReverse","hasProp","obj","prop","getOwn","eachProp","mixin","target","source","force","deepStringMixin","value","RegExp","bind","fn","apply","arguments","scripts","getElementsByTagName","defaultOnError","err","getGlobal","g","split","part","makeError","id","msg","requireModules","e","Error","requireType","originalError","undefined","deps","callback","errback","optional","config","contextName","context","newContext","configure","nextTick","jsExtRegExp","ctx","parentNode","onError","createNode","moduleName","url","node","xhtml","createElementNS","createElement","type","scriptType","charset","async","load","setAttribute","attachEvent","indexOf","addEventListener","onScriptLoad","onScriptError","onNodeCreated","insertBefore","appendChild","completeLoad","skipDataMain","script","getAttribute","baseUrl","pop","join","replace","test","concat","name","dep","push","getInteractiveScript","defQueue","defQueueMap","amd","jQuery","exec","text","eval","inCheckLoaded","Module","handlers","checkLoadedTimeoutId","waitSeconds","paths","bundles","pkgs","shim","registry","enabledRegistry","undefEvents","defined","urlFetched","bundlesMap","requireCounter","unnormalizedCounter","normalize","baseName","applyMap","mapValue","nameParts","j","nameSegment","foundMap","foundI","foundStarMap","starI","baseParts","map","starMap","lastIndex","nodeIdCompat","trimDots","charAt","slice","splice","outerLoop","removeScript","scriptNode","removeChild","hasPathFallback","pathConfig","shift","undef","makeRequire","skipMap","splitPrefix","prefix","index","substring","makeModuleMap","parentModuleMap","isNormalized","pluginModule","parentName","originalName","isDefine","normalizedName","nameToUrl","parentMap","unnormalized","suffix","getModule","depMap","on","mod","defineEmitComplete","error","ids","notified","events","emit","takeGlobalQueue","queueItem","cleanRegistry","checkLoaded","usingPathFallback","waitInterval","expired","startTime","Date","getTime","noLoads","reqCalls","stillLoading","needCycleCheck","modId","enabled","inited","fetched","breakCycle","traced","processed","depMaps","depId","depMatched","defineDep","check","callGetModule","args","init","removeListener","ieName","detachEvent","removeEventListener","getScriptData","evt","currentTarget","srcElement","intakeDefines","exports","usingExports","module","uri","this","depExports","pluginMaps","depCount","factory","options","ignore","enable","fetch","callPlugin","enableBuildCallback","enabling","resLoadMaps","defining","execCb","cjsModule","requireMap","onResourceLoad","normalizedMap","defineEmitted","pluginMap","plugin","bundleId","localRequire","normalizedMod","fromText","textAlt","moduleMap","hasInteractive","handler","undefed","cb","urlArgs","objs","v","exportsFn","makeShimExports","packages","pkgObj","location","main","ret","relMap","requireMod","__requireJsBuild","get","toUrl","moduleNamePlusExt","ext","lastIndexOf","segment","specified","found","shExports","enforceDefine","skipExt","syms","parentPath","pkgMain","readyState","data","parents","key"],"mappings":"AASA,IAAIA,UAAWC,QAASC,OACxB,CAAC,SAAUC,OAAQC,YACf,IAAIC,IAAKC,EAAGC,KAAMC,YAAaC,SAAUC,IACrCC,kBAAmBC,sBAAuBC,WAAYC,QACtDC,QAAU,QACVC,cAAgB,wCAChBC,iBAAmB,iDACnBC,eAAiB,QACjBC,cAAgB,QAChBC,GAAKC,OAAOC,UACZC,QAAUH,GAAGI,SACbC,OAAS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