").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cc=a.document.documentElement;function dc(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dc(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cc;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cc})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dc(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=La(k.pixelPosition,function(a,c){return c?(c=Ja(a,b),Ha.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ec=a.jQuery,fc=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fc),b&&a.jQuery===m&&(a.jQuery=ec),m},typeof b===K&&(a.jQuery=a.$=m),m});
//# sourceMappingURL=jquery.min.map
// End Bundle: _jquery
// Start Bundle: _requirejs
/** vim: et:ts=4:sw=4:sts=4
* @license RequireJS 2.3.3 Copyright jQuery Foundation and other contributors.
* Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE
*/
//Not using strict: uneven strict support in browsers, #392, and causes
//problems with requirejs.exec()/transpiler plugins that may not be strict.
/*jslint regexp: true, nomen: true, sloppy: true */
/*global window, navigator, document, importScripts, setTimeout, opera */
var requirejs, require, define;
(function (global, setTimeout) {
var req, s, head, baseElement, dataMain, src,
interactiveScript, currentlyAddingScript, mainScript, subPath,
version = '2.3.3',
commentRegExp = /\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/mg,
cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
jsSuffixRegExp = /\.js$/,
currDirRegExp = /^\.\//,
op = Object.prototype,
ostring = op.toString,
hasOwn = op.hasOwnProperty,
isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document),
isWebWorker = !isBrowser && typeof importScripts !== 'undefined',
//PS3 indicates loaded and complete, but need to wait for complete
//specifically. Sequence is 'loading', 'loaded', execution,
// then 'complete'. The UA check is unfortunate, but not sure how
//to feature test w/o causing perf issues.
readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ?
/^complete$/ : /^(complete|loaded)$/,
defContextName = '_',
//Oh the tragedy, detecting opera. See the usage of isOpera for reason.
isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]',
contexts = {},
cfg = {},
globalDefQueue = [],
useInteractive = false;
//Could match something like ')//comment', do not lose the prefix to comment.
function commentReplace(match, singlePrefix) {
return singlePrefix || '';
}
function isFunction(it) {
return ostring.call(it) === '[object Function]';
}
function isArray(it) {
return ostring.call(it) === '[object Array]';
}
/**
* Helper function for iterating over an array. If the func returns
* a true value, it will break out of the loop.
*/
function each(ary, func) {
if (ary) {
var i;
for (i = 0; i < ary.length; i += 1) {
if (ary[i] && func(ary[i], i, ary)) {
break;
}
}
}
}
/**
* Helper function for iterating over an array backwards. If the func
* returns a true value, it will break out of the loop.
*/
function eachReverse(ary, func) {
if (ary) {
var i;
for (i = ary.length - 1; i > -1; i -= 1) {
if (ary[i] && func(ary[i], i, ary)) {
break;
}
}
}
}
function hasProp(obj, prop) {
return hasOwn.call(obj, prop);
}
function getOwn(obj, prop) {
return hasProp(obj, prop) && obj[prop];
}
/**
* Cycles over properties in an object and calls a function for each
* property value. If the function returns a truthy value, then the
* iteration is stopped.
*/
function eachProp(obj, func) {
var prop;
for (prop in obj) {
if (hasProp(obj, prop)) {
if (func(obj[prop], prop)) {
break;
}
}
}
}
/**
* Simple function to mix in properties from source into target,
* but only if target does not already have a property of the same name.
*/
function mixin(target, source, force, deepStringMixin) {
if (source) {
eachProp(source, function (value, prop) {
if (force || !hasProp(target, prop)) {
if (deepStringMixin && typeof value === 'object' && value &&
!isArray(value) && !isFunction(value) &&
!(value instanceof RegExp)) {
if (!target[prop]) {
target[prop] = {};
}
mixin(target[prop], value, force, deepStringMixin);
} else {
target[prop] = value;
}
}
});
}
return target;
}
//Similar to Function.prototype.bind, but the 'this' object is specified
//first, since it is easier to read/figure out what 'this' will be.
function bind(obj, fn) {
return function () {
return fn.apply(obj, arguments);
};
}
function scripts() {
return document.getElementsByTagName('script');
}
function defaultOnError(err) {
throw err;
}
//Allow getting a global that is expressed in
//dot notation, like 'a.b.c'.
function getGlobal(value) {
if (!value) {
return value;
}
var g = global;
each(value.split('.'), function (part) {
g = g[part];
});
return g;
}
/**
* Constructs an error with a pointer to an URL with more information.
* @param {String} id the error ID that maps to an ID on a web page.
* @param {String} message human readable error.
* @param {Error} [err] the original error, if there is one.
*
* @returns {Error}
*/
function makeError(id, msg, err, requireModules) {
var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);
e.requireType = id;
e.requireModules = requireModules;
if (err) {
e.originalError = err;
}
return e;
}
if (typeof define !== 'undefined') {
//If a define is already in play via another AMD loader,
//do not overwrite.
return;
}
if (typeof requirejs !== 'undefined') {
if (isFunction(requirejs)) {
//Do not overwrite an existing requirejs instance.
return;
}
cfg = requirejs;
requirejs = undefined;
}
//Allow for a require config object
if (typeof require !== 'undefined' && !isFunction(require)) {
//assume it is a config object.
cfg = require;
require = undefined;
}
function newContext(contextName) {
var inCheckLoaded, Module, context, handlers,
checkLoadedTimeoutId,
config = {
//Defaults. Do not set a default for map
//config to speed up normalize(), which
//will run faster if there is no default.
waitSeconds: 7,
baseUrl: './',
paths: {},
bundles: {},
pkgs: {},
shim: {},
config: {}
},
registry = {},
//registry of just enabled modules, to speed
//cycle breaking code when lots of modules
//are registered, but not activated.
enabledRegistry = {},
undefEvents = {},
defQueue = [],
defined = {},
urlFetched = {},
bundlesMap = {},
requireCounter = 1,
unnormalizedCounter = 1;
/**
* Trims the . and .. from an array of path segments.
* It will keep a leading path segment if a .. will become
* the first path segment, to help with module name lookups,
* which act like paths, but can be remapped. But the end result,
* all paths that use this function should look normalized.
* NOTE: this method MODIFIES the input array.
* @param {Array} ary the array of path segments.
*/
function trimDots(ary) {
var i, part;
for (i = 0; i < ary.length; i++) {
part = ary[i];
if (part === '.') {
ary.splice(i, 1);
i -= 1;
} else if (part === '..') {
// If at the start, or previous value is still ..,
// keep them so that when converted to a path it may
// still work when converted to a path, even though
// as an ID it is less than ideal. In larger point
// releases, may be better to just kick out an error.
if (i === 0 || (i === 1 && ary[2] === '..') || ary[i - 1] === '..') {
continue;
} else if (i > 0) {
ary.splice(i - 1, 2);
i -= 2;
}
}
}
}
/**
* Given a relative module name, like ./something, normalize it to
* a real name that can be mapped to a path.
* @param {String} name the relative name
* @param {String} baseName a real name that the name arg is relative
* to.
* @param {Boolean} applyMap apply the map config to the value. Should
* only be done if this normalization is for a dependency ID.
* @returns {String} normalized name
*/
function normalize(name, baseName, applyMap) {
var pkgMain, mapValue, nameParts, i, j, nameSegment, lastIndex,
foundMap, foundI, foundStarMap, starI, normalizedBaseParts,
baseParts = (baseName && baseName.split('/')),
map = config.map,
starMap = map && map['*'];
//Adjust any relative paths.
if (name) {
name = name.split('/');
lastIndex = name.length - 1;
// If wanting node ID compatibility, strip .js from end
// of IDs. Have to do this here, and not in nameToUrl
// because node allows either .js or non .js to map
// to same file.
if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
}
// Starts with a '.' so need the baseName
if (name[0].charAt(0) === '.' && baseParts) {
//Convert baseName to array, and lop off the last part,
//so that . matches that 'directory' and not name of the baseName's
//module. For instance, baseName of 'one/two/three', maps to
//'one/two/three.js', but we want the directory, 'one/two' for
//this normalization.
normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
name = normalizedBaseParts.concat(name);
}
trimDots(name);
name = name.join('/');
}
//Apply map config if available.
if (applyMap && map && (baseParts || starMap)) {
nameParts = name.split('/');
outerLoop: for (i = nameParts.length; i > 0; i -= 1) {
nameSegment = nameParts.slice(0, i).join('/');
if (baseParts) {
//Find the longest baseName segment match in the config.
//So, do joins on the biggest to smallest lengths of baseParts.
for (j = baseParts.length; j > 0; j -= 1) {
mapValue = getOwn(map, baseParts.slice(0, j).join('/'));
//baseName segment has config, find if it has one for
//this name.
if (mapValue) {
mapValue = getOwn(mapValue, nameSegment);
if (mapValue) {
//Match, update name to the new value.
foundMap = mapValue;
foundI = i;
break outerLoop;
}
}
}
}
//Check for a star map match, but just hold on to it,
//if there is a shorter segment match later in a matching
//config, then favor over this star map.
if (!foundStarMap && starMap && getOwn(starMap, nameSegment)) {
foundStarMap = getOwn(starMap, nameSegment);
starI = i;
}
}
if (!foundMap && foundStarMap) {
foundMap = foundStarMap;
foundI = starI;
}
if (foundMap) {
nameParts.splice(0, foundI, foundMap);
name = nameParts.join('/');
}
}
// If the name points to a package's name, use
// the package main instead.
pkgMain = getOwn(config.pkgs, name);
return pkgMain ? pkgMain : name;
}
function removeScript(name) {
if (isBrowser) {
each(scripts(), function (scriptNode) {
if (scriptNode.getAttribute('data-requiremodule') === name &&
scriptNode.getAttribute('data-requirecontext') === context.contextName) {
scriptNode.parentNode.removeChild(scriptNode);
return true;
}
});
}
}
function hasPathFallback(id) {
var pathConfig = getOwn(config.paths, id);
if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) {
//Pop off the first array value, since it failed, and
//retry
pathConfig.shift();
context.require.undef(id);
//Custom require that does not do map translation, since
//ID is "absolute", already mapped/resolved.
context.makeRequire(null, {
skipMap: true
})([id]);
return true;
}
}
//Turns a plugin!resource to [plugin, resource]
//with the plugin being undefined if the name
//did not have a plugin prefix.
function splitPrefix(name) {
var prefix,
index = name ? name.indexOf('!') : -1;
if (index > -1) {
prefix = name.substring(0, index);
name = name.substring(index + 1, name.length);
}
return [prefix, name];
}
/**
* Creates a module mapping that includes plugin prefix, module
* name, and path. If parentModuleMap is provided it will
* also normalize the name via require.normalize()
*
* @param {String} name the module name
* @param {String} [parentModuleMap] parent module map
* for the module name, used to resolve relative names.
* @param {Boolean} isNormalized: is the ID already normalized.
* This is true if this call is done for a define() module ID.
* @param {Boolean} applyMap: apply the map config to the ID.
* Should only be true if this map is for a dependency.
*
* @returns {Object}
*/
function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) {
var url, pluginModule, suffix, nameParts,
prefix = null,
parentName = parentModuleMap ? parentModuleMap.name : null,
originalName = name,
isDefine = true,
normalizedName = '';
//If no name, then it means it is a require call, generate an
//internal name.
if (!name) {
isDefine = false;
name = '_@r' + (requireCounter += 1);
}
nameParts = splitPrefix(name);
prefix = nameParts[0];
name = nameParts[1];
if (prefix) {
prefix = normalize(prefix, parentName, applyMap);
pluginModule = getOwn(defined, prefix);
}
//Account for relative paths if there is a base name.
if (name) {
if (prefix) {
if (isNormalized) {
normalizedName = name;
} else if (pluginModule && pluginModule.normalize) {
//Plugin is loaded, use its normalize method.
normalizedName = pluginModule.normalize(name, function (name) {
return normalize(name, parentName, applyMap);
});
} else {
// If nested plugin references, then do not try to
// normalize, as it will not normalize correctly. This
// places a restriction on resourceIds, and the longer
// term solution is not to normalize until plugins are
// loaded and all normalizations to allow for async
// loading of a loader plugin. But for now, fixes the
// common uses. Details in #1131
normalizedName = name.indexOf('!') === -1 ?
normalize(name, parentName, applyMap) :
name;
}
} else {
//A regular module.
normalizedName = normalize(name, parentName, applyMap);
//Normalized name may be a plugin ID due to map config
//application in normalize. The map config values must
//already be normalized, so do not need to redo that part.
nameParts = splitPrefix(normalizedName);
prefix = nameParts[0];
normalizedName = nameParts[1];
isNormalized = true;
url = context.nameToUrl(normalizedName);
}
}
//If the id is a plugin id that cannot be determined if it needs
//normalization, stamp it with a unique ID so two matching relative
//ids that may conflict can be separate.
suffix = prefix && !pluginModule && !isNormalized ?
'_unnormalized' + (unnormalizedCounter += 1) :
'';
return {
prefix: prefix,
name: normalizedName,
parentMap: parentModuleMap,
unnormalized: !!suffix,
url: url,
originalName: originalName,
isDefine: isDefine,
id: (prefix ?
prefix + '!' + normalizedName :
normalizedName) + suffix
};
}
function getModule(depMap) {
var id = depMap.id,
mod = getOwn(registry, id);
if (!mod) {
mod = registry[id] = new context.Module(depMap);
}
return mod;
}
function on(depMap, name, fn) {
var id = depMap.id,
mod = getOwn(registry, id);
if (hasProp(defined, id) &&
(!mod || mod.defineEmitComplete)) {
if (name === 'defined') {
fn(defined[id]);
}
} else {
mod = getModule(depMap);
if (mod.error && name === 'error') {
fn(mod.error);
} else {
mod.on(name, fn);
}
}
}
function onError(err, errback) {
var ids = err.requireModules,
notified = false;
if (errback) {
errback(err);
} else {
each(ids, function (id) {
var mod = getOwn(registry, id);
if (mod) {
//Set error on module, so it skips timeout checks.
mod.error = err;
if (mod.events.error) {
notified = true;
mod.emit('error', err);
}
}
});
if (!notified) {
req.onError(err);
}
}
}
/**
* Internal method to transfer globalQueue items to this context's
* defQueue.
*/
function takeGlobalQueue() {
//Push all the globalDefQueue items into the context's defQueue
if (globalDefQueue.length) {
each(globalDefQueue, function(queueItem) {
var id = queueItem[0];
if (typeof id === 'string') {
context.defQueueMap[id] = true;
}
defQueue.push(queueItem);
});
globalDefQueue = [];
}
}
handlers = {
'require': function (mod) {
if (mod.require) {
return mod.require;
} else {
return (mod.require = context.makeRequire(mod.map));
}
},
'exports': function (mod) {
mod.usingExports = true;
if (mod.map.isDefine) {
if (mod.exports) {
return (defined[mod.map.id] = mod.exports);
} else {
return (mod.exports = defined[mod.map.id] = {});
}
}
},
'module': function (mod) {
if (mod.module) {
return mod.module;
} else {
return (mod.module = {
id: mod.map.id,
uri: mod.map.url,
config: function () {
return getOwn(config.config, mod.map.id) || {};
},
exports: mod.exports || (mod.exports = {})
});
}
}
};
function cleanRegistry(id) {
//Clean up machinery used for waiting modules.
delete registry[id];
delete enabledRegistry[id];
}
function breakCycle(mod, traced, processed) {
var id = mod.map.id;
if (mod.error) {
mod.emit('error', mod.error);
} else {
traced[id] = true;
each(mod.depMaps, function (depMap, i) {
var depId = depMap.id,
dep = getOwn(registry, depId);
//Only force things that have not completed
//being defined, so still in the registry,
//and only if it has not been matched up
//in the module already.
if (dep && !mod.depMatched[i] && !processed[depId]) {
if (getOwn(traced, depId)) {
mod.defineDep(i, defined[depId]);
mod.check(); //pass false?
} else {
breakCycle(dep, traced, processed);
}
}
});
processed[id] = true;
}
}
function checkLoaded() {
var err, usingPathFallback,
waitInterval = config.waitSeconds * 1000,
//It is possible to disable the wait interval by using waitSeconds of 0.
expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(),
noLoads = [],
reqCalls = [],
stillLoading = false,
needCycleCheck = true;
//Do not bother if this call was a result of a cycle break.
if (inCheckLoaded) {
return;
}
inCheckLoaded = true;
//Figure out the state of all the modules.
eachProp(enabledRegistry, function (mod) {
var map = mod.map,
modId = map.id;
//Skip things that are not enabled or in error state.
if (!mod.enabled) {
return;
}
if (!map.isDefine) {
reqCalls.push(mod);
}
if (!mod.error) {
//If the module should be executed, and it has not
//been inited and time is up, remember it.
if (!mod.inited && expired) {
if (hasPathFallback(modId)) {
usingPathFallback = true;
stillLoading = true;
} else {
noLoads.push(modId);
removeScript(modId);
}
} else if (!mod.inited && mod.fetched && map.isDefine) {
stillLoading = true;
if (!map.prefix) {
//No reason to keep looking for unfinished
//loading. If the only stillLoading is a
//plugin resource though, keep going,
//because it may be that a plugin resource
//is waiting on a non-plugin cycle.
return (needCycleCheck = false);
}
}
}
});
if (expired && noLoads.length) {
//If wait time expired, throw error of unloaded modules.
err = makeError('timeout', 'Load timeout for modules: ' + noLoads, null, noLoads);
err.contextName = context.contextName;
return onError(err);
}
//Not expired, check for a cycle.
if (needCycleCheck) {
each(reqCalls, function (mod) {
breakCycle(mod, {}, {});
});
}
//If still waiting on loads, and the waiting load is something
//other than a plugin resource, or there are still outstanding
//scripts, then just try back later.
if ((!expired || usingPathFallback) && stillLoading) {
//Something is still waiting to load. Wait for it, but only
//if a timeout is not already in effect.
if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) {
checkLoadedTimeoutId = setTimeout(function () {
checkLoadedTimeoutId = 0;
checkLoaded();
}, 50);
}
}
inCheckLoaded = false;
}
Module = function (map) {
this.events = getOwn(undefEvents, map.id) || {};
this.map = map;
this.shim = getOwn(config.shim, map.id);
this.depExports = [];
this.depMaps = [];
this.depMatched = [];
this.pluginMaps = {};
this.depCount = 0;
/* this.exports this.factory
this.depMaps = [],
this.enabled, this.fetched
*/
};
Module.prototype = {
init: function (depMaps, factory, errback, options) {
options = options || {};
//Do not do more inits if already done. Can happen if there
//are multiple define calls for the same module. That is not
//a normal, common case, but it is also not unexpected.
if (this.inited) {
return;
}
this.factory = factory;
if (errback) {
//Register for errors on this module.
this.on('error', errback);
} else if (this.events.error) {
//If no errback already, but there are error listeners
//on this module, set up an errback to pass to the deps.
errback = bind(this, function (err) {
this.emit('error', err);
});
}
//Do a copy of the dependency array, so that
//source inputs are not modified. For example
//"shim" deps are passed in here directly, and
//doing a direct modification of the depMaps array
//would affect that config.
this.depMaps = depMaps && depMaps.slice(0);
this.errback = errback;
//Indicate this module has be initialized
this.inited = true;
this.ignore = options.ignore;
//Could have option to init this module in enabled mode,
//or could have been previously marked as enabled. However,
//the dependencies are not known until init is called. So
//if enabled previously, now trigger dependencies as enabled.
if (options.enabled || this.enabled) {
//Enable this module and dependencies.
//Will call this.check()
this.enable();
} else {
this.check();
}
},
defineDep: function (i, depExports) {
//Because of cycles, defined callback for a given
//export can be called more than once.
if (!this.depMatched[i]) {
this.depMatched[i] = true;
this.depCount -= 1;
this.depExports[i] = depExports;
}
},
fetch: function () {
if (this.fetched) {
return;
}
this.fetched = true;
context.startTime = (new Date()).getTime();
var map = this.map;
//If the manager is for a plugin managed resource,
//ask the plugin to load it now.
if (this.shim) {
context.makeRequire(this.map, {
enableBuildCallback: true
})(this.shim.deps || [], bind(this, function () {
return map.prefix ? this.callPlugin() : this.load();
}));
} else {
//Regular dependency.
return map.prefix ? this.callPlugin() : this.load();
}
},
load: function () {
var url = this.map.url;
//Regular dependency.
if (!urlFetched[url]) {
urlFetched[url] = true;
context.load(this.map.id, url);
}
},
/**
* Checks if the module is ready to define itself, and if so,
* define it.
*/
check: function () {
if (!this.enabled || this.enabling) {
return;
}
var err, cjsModule,
id = this.map.id,
depExports = this.depExports,
exports = this.exports,
factory = this.factory;
if (!this.inited) {
// Only fetch if not already in the defQueue.
if (!hasProp(context.defQueueMap, id)) {
this.fetch();
}
} else if (this.error) {
this.emit('error', this.error);
} else if (!this.defining) {
//The factory could trigger another require call
//that would result in checking this module to
//define itself again. If already in the process
//of doing that, skip this work.
this.defining = true;
if (this.depCount < 1 && !this.defined) {
if (isFunction(factory)) {
//If there is an error listener, favor passing
//to that instead of throwing an error. However,
//only do it for define()'d modules. require
//errbacks should not be called for failures in
//their callbacks (#699). However if a global
//onError is set, use that.
if ((this.events.error && this.map.isDefine) ||
req.onError !== defaultOnError) {
try {
exports = context.execCb(id, factory, depExports, exports);
} catch (e) {
err = e;
}
} else {
exports = context.execCb(id, factory, depExports, exports);
}
// Favor return value over exports. If node/cjs in play,
// then will not have a return value anyway. Favor
// module.exports assignment over exports object.
if (this.map.isDefine && exports === undefined) {
cjsModule = this.module;
if (cjsModule) {
exports = cjsModule.exports;
} else if (this.usingExports) {
//exports already set the defined value.
exports = this.exports;
}
}
if (err) {
err.requireMap = this.map;
err.requireModules = this.map.isDefine ? [this.map.id] : null;
err.requireType = this.map.isDefine ? 'define' : 'require';
return onError((this.error = err));
}
} else {
//Just a literal value
exports = factory;
}
this.exports = exports;
if (this.map.isDefine && !this.ignore) {
defined[id] = exports;
if (req.onResourceLoad) {
var resLoadMaps = [];
each(this.depMaps, function (depMap) {
resLoadMaps.push(depMap.normalizedMap || depMap);
});
req.onResourceLoad(context, this.map, resLoadMaps);
}
}
//Clean up
cleanRegistry(id);
this.defined = true;
}
//Finished the define stage. Allow calling check again
//to allow define notifications below in the case of a
//cycle.
this.defining = false;
if (this.defined && !this.defineEmitted) {
this.defineEmitted = true;
this.emit('defined', this.exports);
this.defineEmitComplete = true;
}
}
},
callPlugin: function () {
var map = this.map,
id = map.id,
//Map already normalized the prefix.
pluginMap = makeModuleMap(map.prefix);
//Mark this as a dependency for this plugin, so it
//can be traced for cycles.
this.depMaps.push(pluginMap);
on(pluginMap, 'defined', bind(this, function (plugin) {
var load, normalizedMap, normalizedMod,
bundleId = getOwn(bundlesMap, this.map.id),
name = this.map.name,
parentName = this.map.parentMap ? this.map.parentMap.name : null,
localRequire = context.makeRequire(map.parentMap, {
enableBuildCallback: true
});
//If current map is not normalized, wait for that
//normalized name to load instead of continuing.
if (this.map.unnormalized) {
//Normalize the ID if the plugin allows it.
if (plugin.normalize) {
name = plugin.normalize(name, function (name) {
return normalize(name, parentName, true);
}) || '';
}
//prefix and name should already be normalized, no need
//for applying map config again either.
normalizedMap = makeModuleMap(map.prefix + '!' + name,
this.map.parentMap,
true);
on(normalizedMap,
'defined', bind(this, function (value) {
this.map.normalizedMap = normalizedMap;
this.init([], function () { return value; }, null, {
enabled: true,
ignore: true
});
}));
normalizedMod = getOwn(registry, normalizedMap.id);
if (normalizedMod) {
//Mark this as a dependency for this plugin, so it
//can be traced for cycles.
this.depMaps.push(normalizedMap);
if (this.events.error) {
normalizedMod.on('error', bind(this, function (err) {
this.emit('error', err);
}));
}
normalizedMod.enable();
}
return;
}
//If a paths config, then just load that file instead to
//resolve the plugin, as it is built into that paths layer.
if (bundleId) {
this.map.url = context.nameToUrl(bundleId);
this.load();
return;
}
load = bind(this, function (value) {
this.init([], function () { return value; }, null, {
enabled: true
});
});
load.error = bind(this, function (err) {
this.inited = true;
this.error = err;
err.requireModules = [id];
//Remove temp unnormalized modules for this module,
//since they will never be resolved otherwise now.
eachProp(registry, function (mod) {
if (mod.map.id.indexOf(id + '_unnormalized') === 0) {
cleanRegistry(mod.map.id);
}
});
onError(err);
});
//Allow plugins to load other code without having to know the
//context or how to 'complete' the load.
load.fromText = bind(this, function (text, textAlt) {
/*jslint evil: true */
var moduleName = map.name,
moduleMap = makeModuleMap(moduleName),
hasInteractive = useInteractive;
//As of 2.1.0, support just passing the text, to reinforce
//fromText only being called once per resource. Still
//support old style of passing moduleName but discard
//that moduleName in favor of the internal ref.
if (textAlt) {
text = textAlt;
}
//Turn off interactive script matching for IE for any define
//calls in the text, then turn it back on at the end.
if (hasInteractive) {
useInteractive = false;
}
//Prime the system by creating a module instance for
//it.
getModule(moduleMap);
//Transfer any config to this other module.
if (hasProp(config.config, id)) {
config.config[moduleName] = config.config[id];
}
try {
req.exec(text);
} catch (e) {
return onError(makeError('fromtexteval',
'fromText eval for ' + id +
' failed: ' + e,
e,
[id]));
}
if (hasInteractive) {
useInteractive = true;
}
//Mark this as a dependency for the plugin
//resource
this.depMaps.push(moduleMap);
//Support anonymous modules.
context.completeLoad(moduleName);
//Bind the value of that module to the value for this
//resource ID.
localRequire([moduleName], load);
});
//Use parentName here since the plugin's name is not reliable,
//could be some weird string with no path that actually wants to
//reference the parentName's path.
plugin.load(map.name, localRequire, load, config);
}));
context.enable(pluginMap, this);
this.pluginMaps[pluginMap.id] = pluginMap;
},
enable: function () {
enabledRegistry[this.map.id] = this;
this.enabled = true;
//Set flag mentioning that the module is enabling,
//so that immediate calls to the defined callbacks
//for dependencies do not trigger inadvertent load
//with the depCount still being zero.
this.enabling = true;
//Enable each dependency
each(this.depMaps, bind(this, function (depMap, i) {
var id, mod, handler;
if (typeof depMap === 'string') {
//Dependency needs to be converted to a depMap
//and wired up to this module.
depMap = makeModuleMap(depMap,
(this.map.isDefine ? this.map : this.map.parentMap),
false,
!this.skipMap);
this.depMaps[i] = depMap;
handler = getOwn(handlers, depMap.id);
if (handler) {
this.depExports[i] = handler(this);
return;
}
this.depCount += 1;
on(depMap, 'defined', bind(this, function (depExports) {
if (this.undefed) {
return;
}
this.defineDep(i, depExports);
this.check();
}));
if (this.errback) {
on(depMap, 'error', bind(this, this.errback));
} else if (this.events.error) {
// No direct errback on this module, but something
// else is listening for errors, so be sure to
// propagate the error correctly.
on(depMap, 'error', bind(this, function(err) {
this.emit('error', err);
}));
}
}
id = depMap.id;
mod = registry[id];
//Skip special modules like 'require', 'exports', 'module'
//Also, don't call enable if it is already enabled,
//important in circular dependency cases.
if (!hasProp(handlers, id) && mod && !mod.enabled) {
context.enable(depMap, this);
}
}));
//Enable each plugin that is used in
//a dependency
eachProp(this.pluginMaps, bind(this, function (pluginMap) {
var mod = getOwn(registry, pluginMap.id);
if (mod && !mod.enabled) {
context.enable(pluginMap, this);
}
}));
this.enabling = false;
this.check();
},
on: function (name, cb) {
var cbs = this.events[name];
if (!cbs) {
cbs = this.events[name] = [];
}
cbs.push(cb);
},
emit: function (name, evt) {
each(this.events[name], function (cb) {
cb(evt);
});
if (name === 'error') {
//Now that the error handler was triggered, remove
//the listeners, since this broken Module instance
//can stay around for a while in the registry.
delete this.events[name];
}
}
};
function callGetModule(args) {
//Skip modules already defined.
if (!hasProp(defined, args[0])) {
getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]);
}
}
function removeListener(node, func, name, ieName) {
//Favor detachEvent because of IE9
//issue, see attachEvent/addEventListener comment elsewhere
//in this file.
if (node.detachEvent && !isOpera) {
//Probably IE. If not it will throw an error, which will be
//useful to know.
if (ieName) {
node.detachEvent(ieName, func);
}
} else {
node.removeEventListener(name, func, false);
}
}
/**
* Given an event from a script node, get the requirejs info from it,
* and then removes the event listeners on the node.
* @param {Event} evt
* @returns {Object}
*/
function getScriptData(evt) {
//Using currentTarget instead of target for Firefox 2.0's sake. Not
//all old browsers will be supported, but this one was easy enough
//to support and still makes sense.
var node = evt.currentTarget || evt.srcElement;
//Remove the listeners once here.
removeListener(node, context.onScriptLoad, 'load', 'onreadystatechange');
removeListener(node, context.onScriptError, 'error');
return {
node: node,
id: node && node.getAttribute('data-requiremodule')
};
}
function intakeDefines() {
var args;
//Any defined modules in the global queue, intake them now.
takeGlobalQueue();
//Make sure any remaining defQueue items get properly processed.
while (defQueue.length) {
args = defQueue.shift();
if (args[0] === null) {
return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' +
args[args.length - 1]));
} else {
//args are id, deps, factory. Should be normalized by the
//define() function.
callGetModule(args);
}
}
context.defQueueMap = {};
}
context = {
config: config,
contextName: contextName,
registry: registry,
defined: defined,
urlFetched: urlFetched,
defQueue: defQueue,
defQueueMap: {},
Module: Module,
makeModuleMap: makeModuleMap,
nextTick: req.nextTick,
onError: onError,
/**
* Set a configuration for the context.
* @param {Object} cfg config object to integrate.
*/
configure: function (cfg) {
//Make sure the baseUrl ends in a slash.
if (cfg.baseUrl) {
if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== '/') {
cfg.baseUrl += '/';
}
}
// Convert old style urlArgs string to a function.
if (typeof cfg.urlArgs === 'string') {
var urlArgs = cfg.urlArgs;
cfg.urlArgs = function(id, url) {
return (url.indexOf('?') === -1 ? '?' : '&') + urlArgs;
};
}
//Save off the paths since they require special processing,
//they are additive.
var shim = config.shim,
objs = {
paths: true,
bundles: true,
config: true,
map: true
};
eachProp(cfg, function (value, prop) {
if (objs[prop]) {
if (!config[prop]) {
config[prop] = {};
}
mixin(config[prop], value, true, true);
} else {
config[prop] = value;
}
});
//Reverse map the bundles
if (cfg.bundles) {
eachProp(cfg.bundles, function (value, prop) {
each(value, function (v) {
if (v !== prop) {
bundlesMap[v] = prop;
}
});
});
}
//Merge shim
if (cfg.shim) {
eachProp(cfg.shim, function (value, id) {
//Normalize the structure
if (isArray(value)) {
value = {
deps: value
};
}
if ((value.exports || value.init) && !value.exportsFn) {
value.exportsFn = context.makeShimExports(value);
}
shim[id] = value;
});
config.shim = shim;
}
//Adjust packages if necessary.
if (cfg.packages) {
each(cfg.packages, function (pkgObj) {
var location, name;
pkgObj = typeof pkgObj === 'string' ? {name: pkgObj} : pkgObj;
name = pkgObj.name;
location = pkgObj.location;
if (location) {
config.paths[name] = pkgObj.location;
}
//Save pointer to main module ID for pkg name.
//Remove leading dot in main, so main paths are normalized,
//and remove any trailing .js, since different package
//envs have different conventions: some use a module name,
//some use a file name.
config.pkgs[name] = pkgObj.name + '/' + (pkgObj.main || 'main')
.replace(currDirRegExp, '')
.replace(jsSuffixRegExp, '');
});
}
//If there are any "waiting to execute" modules in the registry,
//update the maps for them, since their info, like URLs to load,
//may have changed.
eachProp(registry, function (mod, id) {
//If module already has init called, since it is too
//late to modify them, and ignore unnormalized ones
//since they are transient.
if (!mod.inited && !mod.map.unnormalized) {
mod.map = makeModuleMap(id, null, true);
}
});
//If a deps array or a config callback is specified, then call
//require with those args. This is useful when require is defined as a
//config object before require.js is loaded.
if (cfg.deps || cfg.callback) {
context.require(cfg.deps || [], cfg.callback);
}
},
makeShimExports: function (value) {
function fn() {
var ret;
if (value.init) {
ret = value.init.apply(global, arguments);
}
return ret || (value.exports && getGlobal(value.exports));
}
return fn;
},
makeRequire: function (relMap, options) {
options = options || {};
function localRequire(deps, callback, errback) {
var id, map, requireMod;
if (options.enableBuildCallback && callback && isFunction(callback)) {
callback.__requireJsBuild = true;
}
if (typeof deps === 'string') {
if (isFunction(callback)) {
//Invalid call
return onError(makeError('requireargs', 'Invalid require call'), errback);
}
//If require|exports|module are requested, get the
//value for them from the special handlers. Caveat:
//this only works while module is being defined.
if (relMap && hasProp(handlers, deps)) {
return handlers[deps](registry[relMap.id]);
}
//Synchronous access to one module. If require.get is
//available (as in the Node adapter), prefer that.
if (req.get) {
return req.get(context, deps, relMap, localRequire);
}
//Normalize module name, if it contains . or ..
map = makeModuleMap(deps, relMap, false, true);
id = map.id;
if (!hasProp(defined, id)) {
return onError(makeError('notloaded', 'Module name "' +
id +
'" has not been loaded yet for context: ' +
contextName +
(relMap ? '' : '. Use require([])')));
}
return defined[id];
}
//Grab defines waiting in the global queue.
intakeDefines();
//Mark all the dependencies as needing to be loaded.
context.nextTick(function () {
//Some defines could have been added since the
//require call, collect them.
intakeDefines();
requireMod = getModule(makeModuleMap(null, relMap));
//Store if map config should be applied to this require
//call for dependencies.
requireMod.skipMap = options.skipMap;
requireMod.init(deps, callback, errback, {
enabled: true
});
checkLoaded();
});
return localRequire;
}
mixin(localRequire, {
isBrowser: isBrowser,
/**
* Converts a module name + .extension into an URL path.
* *Requires* the use of a module name. It does not support using
* plain URLs like nameToUrl.
*/
toUrl: function (moduleNamePlusExt) {
var ext,
index = moduleNamePlusExt.lastIndexOf('.'),
segment = moduleNamePlusExt.split('/')[0],
isRelative = segment === '.' || segment === '..';
//Have a file extension alias, and it is not the
//dots from a relative path.
if (index !== -1 && (!isRelative || index > 1)) {
ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length);
moduleNamePlusExt = moduleNamePlusExt.substring(0, index);
}
return context.nameToUrl(normalize(moduleNamePlusExt,
relMap && relMap.id, true), ext, true);
},
defined: function (id) {
return hasProp(defined, makeModuleMap(id, relMap, false, true).id);
},
specified: function (id) {
id = makeModuleMap(id, relMap, false, true).id;
return hasProp(defined, id) || hasProp(registry, id);
}
});
//Only allow undef on top level require calls
if (!relMap) {
localRequire.undef = function (id) {
//Bind any waiting define() calls to this context,
//fix for #408
takeGlobalQueue();
var map = makeModuleMap(id, relMap, true),
mod = getOwn(registry, id);
mod.undefed = true;
removeScript(id);
delete defined[id];
delete urlFetched[map.url];
delete undefEvents[id];
//Clean queued defines too. Go backwards
//in array so that the splices do not
//mess up the iteration.
eachReverse(defQueue, function(args, i) {
if (args[0] === id) {
defQueue.splice(i, 1);
}
});
delete context.defQueueMap[id];
if (mod) {
//Hold on to listeners in case the
//module will be attempted to be reloaded
//using a different config.
if (mod.events.defined) {
undefEvents[id] = mod.events;
}
cleanRegistry(id);
}
};
}
return localRequire;
},
/**
* Called to enable a module if it is still in the registry
* awaiting enablement. A second arg, parent, the parent module,
* is passed in for context, when this method is overridden by
* the optimizer. Not shown here to keep code compact.
*/
enable: function (depMap) {
var mod = getOwn(registry, depMap.id);
if (mod) {
getModule(depMap).enable();
}
},
/**
* Internal method used by environment adapters to complete a load event.
* A load event could be a script load or just a load pass from a synchronous
* load call.
* @param {String} moduleName the name of the module to potentially complete.
*/
completeLoad: function (moduleName) {
var found, args, mod,
shim = getOwn(config.shim, moduleName) || {},
shExports = shim.exports;
takeGlobalQueue();
while (defQueue.length) {
args = defQueue.shift();
if (args[0] === null) {
args[0] = moduleName;
//If already found an anonymous module and bound it
//to this name, then this is some other anon module
//waiting for its completeLoad to fire.
if (found) {
break;
}
found = true;
} else if (args[0] === moduleName) {
//Found matching define call for this script!
found = true;
}
callGetModule(args);
}
context.defQueueMap = {};
//Do this after the cycle of callGetModule in case the result
//of those calls/init calls changes the registry.
mod = getOwn(registry, moduleName);
if (!found && !hasProp(defined, moduleName) && mod && !mod.inited) {
if (config.enforceDefine && (!shExports || !getGlobal(shExports))) {
if (hasPathFallback(moduleName)) {
return;
} else {
return onError(makeError('nodefine',
'No define call for ' + moduleName,
null,
[moduleName]));
}
} else {
//A script that does not call define(), so just simulate
//the call for it.
callGetModule([moduleName, (shim.deps || []), shim.exportsFn]);
}
}
checkLoaded();
},
/**
* Converts a module name to a file path. Supports cases where
* moduleName may actually be just an URL.
* Note that it **does not** call normalize on the moduleName,
* it is assumed to have already been normalized. This is an
* internal API, not a public one. Use toUrl for the public API.
*/
nameToUrl: function (moduleName, ext, skipExt) {
var paths, syms, i, parentModule, url,
parentPath, bundleId,
pkgMain = getOwn(config.pkgs, moduleName);
if (pkgMain) {
moduleName = pkgMain;
}
bundleId = getOwn(bundlesMap, moduleName);
if (bundleId) {
return context.nameToUrl(bundleId, ext, skipExt);
}
//If a colon is in the URL, it indicates a protocol is used and it is just
//an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?)
//or ends with .js, then assume the user meant to use an url and not a module id.
//The slash is important for protocol-less URLs as well as full paths.
if (req.jsExtRegExp.test(moduleName)) {
//Just a plain path, not module name lookup, so just return it.
//Add extension if it is included. This is a bit wonky, only non-.js things pass
//an extension, this method probably needs to be reworked.
url = moduleName + (ext || '');
} else {
//A module that needs to be converted to a path.
paths = config.paths;
syms = moduleName.split('/');
//For each module name segment, see if there is a path
//registered for it. Start with most specific name
//and work up from it.
for (i = syms.length; i > 0; i -= 1) {
parentModule = syms.slice(0, i).join('/');
parentPath = getOwn(paths, parentModule);
if (parentPath) {
//If an array, it means there are a few choices,
//Choose the one that is desired
if (isArray(parentPath)) {
parentPath = parentPath[0];
}
syms.splice(0, i, parentPath);
break;
}
}
//Join the path parts together, then figure out if baseUrl is needed.
url = syms.join('/');
url += (ext || (/^data\:|^blob\:|\?/.test(url) || skipExt ? '' : '.js'));
url = (url.charAt(0) === '/' || url.match(/^[\w\+\.\-]+:/) ? '' : config.baseUrl) + url;
}
return config.urlArgs && !/^blob\:/.test(url) ?
url + config.urlArgs(moduleName, url) : url;
},
//Delegates to req.load. Broken out as a separate function to
//allow overriding in the optimizer.
load: function (id, url) {
req.load(context, id, url);
},
/**
* Executes a module callback function. Broken out as a separate function
* solely to allow the build system to sequence the files in the built
* layer in the right sequence.
*
* @private
*/
execCb: function (name, callback, args, exports) {
return callback.apply(exports, args);
},
/**
* callback for script loads, used to check status of loading.
*
* @param {Event} evt the event from the browser for the script
* that was loaded.
*/
onScriptLoad: function (evt) {
//Using currentTarget instead of target for Firefox 2.0's sake. Not
//all old browsers will be supported, but this one was easy enough
//to support and still makes sense.
if (evt.type === 'load' ||
(readyRegExp.test((evt.currentTarget || evt.srcElement).readyState))) {
//Reset interactive script so a script node is not held onto for
//to long.
interactiveScript = null;
//Pull out the name of the module and the context.
var data = getScriptData(evt);
context.completeLoad(data.id);
}
},
/**
* Callback for script errors.
*/
onScriptError: function (evt) {
var data = getScriptData(evt);
if (!hasPathFallback(data.id)) {
var parents = [];
eachProp(registry, function(value, key) {
if (key.indexOf('_@r') !== 0) {
each(value.depMaps, function(depMap) {
if (depMap.id === data.id) {
parents.push(key);
return true;
}
});
}
});
return onError(makeError('scripterror', 'Script error for "' + data.id +
(parents.length ?
'", needed by: ' + parents.join(', ') :
'"'), evt, [data.id]));
}
}
};
context.require = context.makeRequire();
return context;
}
/**
* Main entry point.
*
* If the only argument to require is a string, then the module that
* is represented by that string is fetched for the appropriate context.
*
* If the first argument is an array, then it will be treated as an array
* of dependency string names to fetch. An optional function callback can
* be specified to execute when all of those dependencies are available.
*
* Make a local req variable to help Caja compliance (it assumes things
* on a require that are not standardized), and to give a short
* name for minification/local scope use.
*/
req = requirejs = function (deps, callback, errback, optional) {
//Find the right context, use default
var context, config,
contextName = defContextName;
// Determine if have config object in the call.
if (!isArray(deps) && typeof deps !== 'string') {
// deps is a config object
config = deps;
if (isArray(callback)) {
// Adjust args if there are dependencies
deps = callback;
callback = errback;
errback = optional;
} else {
deps = [];
}
}
if (config && config.context) {
contextName = config.context;
}
context = getOwn(contexts, contextName);
if (!context) {
context = contexts[contextName] = req.s.newContext(contextName);
}
if (config) {
context.configure(config);
}
return context.require(deps, callback, errback);
};
/**
* Support require.config() to make it easier to cooperate with other
* AMD loaders on globally agreed names.
*/
req.config = function (config) {
return req(config);
};
/**
* Execute something after the current tick
* of the event loop. Override for other envs
* that have a better solution than setTimeout.
* @param {Function} fn function to execute later.
*/
req.nextTick = typeof setTimeout !== 'undefined' ? function (fn) {
setTimeout(fn, 4);
} : function (fn) { fn(); };
/**
* Export require as a global, but only if it does not already exist.
*/
if (!require) {
require = req;
}
req.version = version;
//Used to filter out dependencies that are already paths.
req.jsExtRegExp = /^\/|:|\?|\.js$/;
req.isBrowser = isBrowser;
s = req.s = {
contexts: contexts,
newContext: newContext
};
//Create default context.
req({});
//Exports some context-sensitive methods on global require.
each([
'toUrl',
'undef',
'defined',
'specified'
], function (prop) {
//Reference from contexts instead of early binding to default context,
//so that during builds, the latest instance of the default context
//with its config gets used.
req[prop] = function () {
var ctx = contexts[defContextName];
return ctx.require[prop].apply(ctx, arguments);
};
});
if (isBrowser) {
head = s.head = document.getElementsByTagName('head')[0];
//If BASE tag is in play, using appendChild is a problem for IE6.
//When that browser dies, this can be removed. Details in this jQuery bug:
//http://dev.jquery.com/ticket/2709
baseElement = document.getElementsByTagName('base')[0];
if (baseElement) {
head = s.head = baseElement.parentNode;
}
}
/**
* Any errors that require explicitly generates will be passed to this
* function. Intercept/override it if you want custom error handling.
* @param {Error} err the error object.
*/
req.onError = defaultOnError;
/**
* Creates the node for the load command. Only used in browser envs.
*/
req.createNode = function (config, moduleName, url) {
var node = config.xhtml ?
document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') :
document.createElement('script');
node.type = config.scriptType || 'text/javascript';
node.charset = 'utf-8';
node.async = true;
return node;
};
/**
* Does the request to load a module for the browser case.
* Make this a separate function to allow other environments
* to override it.
*
* @param {Object} context the require context to find state.
* @param {String} moduleName the name of the module.
* @param {Object} url the URL to the module.
*/
req.load = function (context, moduleName, url) {
var config = (context && context.config) || {},
node;
if (isBrowser) {
//In the browser so use a script tag
node = req.createNode(config, moduleName, url);
node.setAttribute('data-requirecontext', context.contextName);
node.setAttribute('data-requiremodule', moduleName);
//Set up load listener. Test attachEvent first because IE9 has
//a subtle issue in its addEventListener and script onload firings
//that do not match the behavior of all other browsers with
//addEventListener support, which fire the onload event for a
//script right after the script execution. See:
//https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution
//UNFORTUNATELY Opera implements attachEvent but does not follow the script
//script execution mode.
if (node.attachEvent &&
//Check if node.attachEvent is artificially added by custom script or
//natively supported by browser
//read https://github.com/requirejs/requirejs/issues/187
//if we can NOT find [native code] then it must NOT natively supported.
//in IE8, node.attachEvent does not have toString()
//Note the test for "[native code" with no closing brace, see:
//https://github.com/requirejs/requirejs/issues/273
!(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code') < 0) &&
!isOpera) {
//Probably IE. IE (at least 6-8) do not fire
//script onload right after executing the script, so
//we cannot tie the anonymous define call to a name.
//However, IE reports the script as being in 'interactive'
//readyState at the time of the define call.
useInteractive = true;
node.attachEvent('onreadystatechange', context.onScriptLoad);
//It would be great to add an error handler here to catch
//404s in IE9+. However, onreadystatechange will fire before
//the error handler, so that does not help. If addEventListener
//is used, then IE will fire error before load, but we cannot
//use that pathway given the connect.microsoft.com issue
//mentioned above about not doing the 'script execute,
//then fire the script load event listener before execute
//next script' that other browsers do.
//Best hope: IE10 fixes the issues,
//and then destroys all installs of IE 6-9.
//node.attachEvent('onerror', context.onScriptError);
} else {
node.addEventListener('load', context.onScriptLoad, false);
node.addEventListener('error', context.onScriptError, false);
}
node.src = url;
//Calling onNodeCreated after all properties on the node have been
//set, but before it is placed in the DOM.
if (config.onNodeCreated) {
config.onNodeCreated(node, config, moduleName, url);
}
//For some cache cases in IE 6-8, the script executes before the end
//of the appendChild execution, so to tie an anonymous define
//call to the module name (which is stored on the node), hold on
//to a reference to this node, but clear after the DOM insertion.
currentlyAddingScript = node;
if (baseElement) {
head.insertBefore(node, baseElement);
} else {
head.appendChild(node);
}
currentlyAddingScript = null;
return node;
} else if (isWebWorker) {
try {
//In a web worker, use importScripts. This is not a very
//efficient use of importScripts, importScripts will block until
//its script is downloaded and evaluated. However, if web workers
//are in play, the expectation is that a build has been done so
//that only one script needs to be loaded anyway. This may need
//to be reevaluated if other use cases become common.
// Post a task to the event loop to work around a bug in WebKit
// where the worker gets garbage-collected after calling
// importScripts(): https://webkit.org/b/153317
setTimeout(function() {}, 0);
importScripts(url);
//Account for anonymous modules
context.completeLoad(moduleName);
} catch (e) {
context.onError(makeError('importscripts',
'importScripts failed for ' +
moduleName + ' at ' + url,
e,
[moduleName]));
}
}
};
function getInteractiveScript() {
if (interactiveScript && interactiveScript.readyState === 'interactive') {
return interactiveScript;
}
eachReverse(scripts(), function (script) {
if (script.readyState === 'interactive') {
return (interactiveScript = script);
}
});
return interactiveScript;
}
//Look for a data-main script attribute, which could also adjust the baseUrl.
if (isBrowser && !cfg.skipDataMain) {
//Figure out baseUrl. Get it from the script tag with require.js in it.
eachReverse(scripts(), function (script) {
//Set the 'head' where we can append children by
//using the script's parent.
if (!head) {
head = script.parentNode;
}
//Look for a data-main attribute to set main script for the page
//to load. If it is there, the path to data main becomes the
//baseUrl, if it is not already set.
dataMain = script.getAttribute('data-main');
if (dataMain) {
//Preserve dataMain in case it is a path (i.e. contains '?')
mainScript = dataMain;
//Set final baseUrl if there is not already an explicit one,
//but only do so if the data-main value is not a loader plugin
//module ID.
if (!cfg.baseUrl && mainScript.indexOf('!') === -1) {
//Pull off the directory of data-main for use as the
//baseUrl.
src = mainScript.split('/');
mainScript = src.pop();
subPath = src.length ? src.join('/') + '/' : './';
cfg.baseUrl = subPath;
}
//Strip off any trailing .js since mainScript is now
//like a module name.
mainScript = mainScript.replace(jsSuffixRegExp, '');
//If mainScript is still a path, fall back to dataMain
if (req.jsExtRegExp.test(mainScript)) {
mainScript = dataMain;
}
//Put the data-main script in the files to load.
cfg.deps = cfg.deps ? cfg.deps.concat(mainScript) : [mainScript];
return true;
}
});
}
/**
* The function that handles definitions of modules. Differs from
* require() in that a string for the module should be the first argument,
* and the function to execute after dependencies are loaded should
* return a value to define the module corresponding to the first argument's
* name.
*/
define = function (name, deps, callback) {
var node, context;
//Allow for anonymous modules
if (typeof name !== 'string') {
//Adjust args appropriately
callback = deps;
deps = name;
name = null;
}
//This module may not have dependencies
if (!isArray(deps)) {
callback = deps;
deps = null;
}
//If no name, and callback is a function, then figure out if it a
//CommonJS thing with dependencies.
if (!deps && isFunction(callback)) {
deps = [];
//Remove comments from the callback string,
//look for require calls, and pull them into the dependencies,
//but only if there are function args.
if (callback.length) {
callback
.toString()
.replace(commentRegExp, commentReplace)
.replace(cjsRequireRegExp, function (match, dep) {
deps.push(dep);
});
//May be a CommonJS thing even without require calls, but still
//could use exports, and module. Avoid doing exports and module
//work though if it just needs require.
//REQUIRES the function to expect the CommonJS variables in the
//order listed below.
deps = (callback.length === 1 ? ['require'] : ['require', 'exports', 'module']).concat(deps);
}
}
//If in IE 6-8 and hit an anonymous define() call, do the interactive
//work.
if (useInteractive) {
node = currentlyAddingScript || getInteractiveScript();
if (node) {
if (!name) {
name = node.getAttribute('data-requiremodule');
}
context = contexts[node.getAttribute('data-requirecontext')];
}
}
//Always save off evaluating the def call until the script onload handler.
//This allows multiple modules to be in a file without prematurely
//tracing dependencies, and allows for anonymous module support,
//where the module name is not known until the script onload event
//occurs. If no context, use the global queue, and get it processed
//in the onscript load callback.
if (context) {
context.defQueue.push([name, deps, callback]);
context.defQueueMap[name] = true;
} else {
globalDefQueue.push([name, deps, callback]);
}
};
define.amd = {
jQuery: true
};
/**
* Executes the text. Normally just uses eval, but can be modified
* to use a better, environment-specific call. Only used for transpiling
* loader plugins, not for plain JS modules.
* @param {String} text the text to execute/evaluate.
*/
req.exec = function (text) {
/*jslint evil: true */
return eval(text);
};
//Set up with config info.
req(cfg);
}(this, (typeof setTimeout === 'undefined' ? undefined : setTimeout)));
// End Bundle: _requirejs
// Start Bundle: _configjs
requirejs.config({
baseUrl: PORTAL_URL,
paths: {
"jquery.cookie": "++plone++static/components/jquery.cookie/jquery.cookie",
"tinymce-compat3x": "++plone++static/components/tinymce-builded/js/tinymce/plugins/compat3x/plugin",
"fbigov-theme-url": "++theme++fbigov.theme",
"expect": "++plone++static/components/expect/index",
"documentviewer": "++resource++dv.resources/javascripts/build.min",
"tinymce-insertdatetime": "++plone++static/components/tinymce-builded/js/tinymce/plugins/insertdatetime/plugin",
"tinymce-charmap": "++plone++static/components/tinymce-builded/js/tinymce/plugins/charmap/plugin",
"mockup-patterns-preventdoublesubmit": "++resource++mockup/preventdoublesubmit/pattern",
"mockup-patterns-querystring": "++plone++castle/patterns/querystring",
"jquery": "++plone++static/components/jquery/dist/jquery.min",
"mockup-patterns-contentloader": "++resource++mockup/contentloader/pattern",
"mockup-patterns-tinymce-logged-out": "++plone++castle/patterns/tinymce/anonymouspattern",
"mockup-patterns-tinymce-url": "++plone++castle/patterns/tinymce",
"tinymce-template": "++plone++static/components/tinymce-builded/js/tinymce/plugins/template/plugin",
"mockup-patterns-texteditor": "++resource++mockup/texteditor/pattern",
"jquery.form": "++plone++static/components/jquery-form/jquery.form",
"mockup-patterns-thememapper": "++resource++mockup/thememapper/pattern",
"tinymce-save": "++plone++static/components/tinymce-builded/js/tinymce/plugins/save/plugin",
"castle-components-manage-archives": "++plone++castle/components/manage-archives",
"tinymce-fullpage": "++plone++static/components/tinymce-builded/js/tinymce/plugins/fullpage/plugin",
"translate": "++resource++mockupjs/i18n-wrapper",
"mockup-patterns-structure-url": "++resource++mockup/structure",
"resource-plone-app-event-event-js": "++resource++plone.app.event/event",
"tinymce-colorpicker": "++plone++static/components/tinymce-builded/js/tinymce/plugins/colorpicker/plugin",
"tinymce-paste": "++plone++static/components/tinymce-builded/js/tinymce/plugins/paste/plugin",
"castle-quality-check": "++plone++castle-advantage/components/quality-check",
"pat-jquery-ext": "++plone++static/components/patternslib/src/core/jquery-ext",
"mockup-utils": "++resource++mockupjs/utils",
"mosaic": "++plone++mosaic/js/mosaic.pattern",
"mockup-patterns-pickadate": "++resource++mockup/pickadate/pattern",
"mockup-i18n": "++resource++mockupjs/i18n",
"tinymce-autosave": "++plone++static/components/tinymce-builded/js/tinymce/plugins/autosave/plugin",
"mockup-patterns-upload": "++resource++mockup/upload/pattern",
"bootstrap-alert": "++plone++static/components/bootstrap/js/alert",
"contentspattern": "++resource++fbigovct/contentspattern",
"mockup-patterns-formunloadalert": "++resource++mockup/formunloadalert/pattern",
"backbone": "++plone++static/components/backbone/backbone",
"tinymce": "++plone++static/components/tinymce-builded/js/tinymce/tinymce",
"tinymce-lists": "++plone++static/components/tinymce-builded/js/tinymce/plugins/lists/plugin",
"add-content-modal": "++plone++castle/components/add-content-modal",
"jquery.recurrenceinput": "++plone++static/components/jquery.recurrenceinput.js/src/jquery.recurrenceinput",
"sinon": "++plone++static/components/sinonjs/sinon",
"ace-theme-monokai": "++plone++static/components/ace-builds/src/theme-monokai",
"tinymce-code": "++plone++static/components/tinymce-builded/js/tinymce/plugins/code/plugin",
"tinymce-advlist": "++plone++static/components/tinymce-builded/js/tinymce/plugins/advlist/plugin",
"tinymce-textpattern": "++plone++static/components/tinymce-builded/js/tinymce/plugins/textpattern/plugin",
"fbigov-theme": "++theme++fbigov.theme/js/public",
"mockup-patterns-filemanager": "++resource++mockup/filemanager/pattern",
"mockup-patterns-markspeciallinks": "++resource++mockup/markspeciallinks/pattern",
"mockup-patterns-autotoc": "++resource++mockup/autotoc/pattern",
"tinymce-visualchars": "++plone++static/components/tinymce-builded/js/tinymce/plugins/visualchars/plugin",
"thememapper": "++resource++plone.app.theming/thememapper",
"tinymce-legacyoutput": "++plone++static/components/tinymce-builded/js/tinymce/plugins/legacyoutput/plugin",
"castle-components-usersgroups": "++plone++castle/components/usersgroups",
"plone-patterns-portletmanager": "++resource++manage-portlets",
"mockup-patterns-formautofocus": "++resource++mockup/formautofocus/pattern",
"plone-logged-in": "++plone++castle/plone-logged-in",
"mockup-patterns-structure": "++plone++castle/patterns/structure",
"underscore": "++plone++static/components/underscore/underscore",
"mockup-patterns-textareamimetypeselector": "++resource++mockup/textareamimetypeselector/pattern",
"moment": "++plone++static/components/moment/min/moment-with-locales.min",
"layouts-editor": "++plone++mosaic/js/layouts-editor",
"castle-components-search": "++plone++castle/components/search",
"resource-plone-app-jquerytools-dateinput-js": "++plone++static/components/jquery.recurrenceinput.js/lib/jquery.tools.dateinput",
"plone-patterns-toolbar": "++plone++static/patterns/toolbar/src/toolbar",
"mockup-patterns-base": "++resource++mockup/base/pattern",
"marked": "++plone++static/components/marked/lib/marked",
"mockup-ui-url": "++resource++mockupjs/ui",
"tinymce-modern-theme": "++plone++static/components/tinymce-builded/js/tinymce/themes/modern/theme",
"tinymce-spellchecker": "++plone++static/components/tinymce-builded/js/tinymce/plugins/spellchecker/plugin",
"mosaic-url": "++plone++mosaic/js",
"tinymce-visualblocks": "++plone++static/components/tinymce-builded/js/tinymce/plugins/visualblocks/plugin",
"mockup-patterns-tinymce-logged-out-url": "++plone++castle/patterns/tinymce",
"mockup-router": "++resource++mockupjs/router",
"jqtree-contextmenu": "++plone++static/components/cs-jqtree-contextmenu/src/jqTreeContextMenu",
"jqtree": "++plone++static/components/jqtree/tree.jquery",
"mockup-patterns-filemanager-url": "++resource++mockup/filemanager",
"tinymce-autoresize": "++plone++static/components/tinymce-builded/js/tinymce/plugins/autoresize/plugin",
"picker.time": "++plone++static/components/pickadate/lib/picker.time",
"resource-plone-app-jquerytools-js": "++plone++static/components/jquery.recurrenceinput.js/lib/jquery.tools.overlay",
"castle-components-audit": "++plone++castle/components/audit",
"text": "++plone++static/components/requirejs-text/text",
"pat-mockup-parser": "++plone++static/components/patternslib/src/core/mockup-parser",
"jquery.event.drag": "++resource++mockuplib/jquery.event.drag",
"tinymce-pagebreak": "++plone++static/components/tinymce-builded/js/tinymce/plugins/pagebreak/plugin",
"ace-mode-javascript": "++plone++static/components/ace-builds/src/mode-javascript",
"faqwidget": "++resource++fbigovct/toc/faqwidget",
"dropzone": "++plone++static/components/dropzone/dist/dropzone-amd-module",
"react": "++plone++static/components/react/react",
"tinymce-textcolor": "++plone++static/components/tinymce-builded/js/tinymce/plugins/textcolor/plugin",
"tinymce-fullscreen": "++plone++static/components/tinymce-builded/js/tinymce/plugins/fullscreen/plugin",
"tinymce-anchor": "++plone++static/components/tinymce-builded/js/tinymce/plugins/anchor/plugin",
"tinymce-emoticons": "++plone++static/components/tinymce-builded/js/tinymce/plugins/emoticons/plugin",
"pat-base": "++plone++static/components/patternslib/src/core/base",
"bootstrap-transition": "++plone++static/components/bootstrap/js/transition",
"pat-compat": "++plone++static/components/patternslib/src/core/compat",
"mockup-patterns-modal": "++resource++mockup/modal/pattern",
"tinymce-media": "++plone++static/components/tinymce-builded/js/tinymce/plugins/media/plugin",
"castle-components-review-archives": "++plone++castle/components/review-archives",
"tinymce-link": "++plone++static/components/tinymce-builded/js/tinymce/plugins/link/plugin",
"tinymce-directionality": "++plone++static/components/tinymce-builded/js/tinymce/plugins/directionality/plugin",
"ippauwidget": "++resource++fbigovct/edit-person-ippau",
"castle-components-tag-manager": "++plone++castle/components/tag-manager",
"tinymce-tabfocus": "++plone++static/components/tinymce-builded/js/tinymce/plugins/tabfocus/plugin",
"less": "++plone++static/components/less/dist/less",
"ace-mode-text": "++plone++static/components/ace-builds/src/mode-text",
"pat-utils": "++plone++static/components/patternslib/src/core/utils",
"castle-url": "++plone++castle",
"mockup-patterns-resourceregistry": "++resource++mockup/resourceregistry/pattern",
"mockup-patterns-tree": "++resource++mockup/tree/pattern",
"castle-components-history": "++plone++castle/components/history",
"tinymce-table": "++plone++static/components/tinymce-builded/js/tinymce/plugins/table/plugin",
"mockup-patterns-thememapper-url": "++resource++mockup/thememapper",
"bootstrap-collapse": "++plone++static/components/bootstrap/js/collapse",
"async": "++plone++castle/libs/requirejs-plugins/src/async",
"tinymce-image": "++plone++static/components/tinymce-builded/js/tinymce/plugins/image/plugin",
"castle-dashboard-statistics": "++plone++castle/components/dashboard-statistics",
"js-shortcuts": "++plone++static/components/js-shortcuts/js-shortcuts",
"mockup-patterns-inlinevalidation": "++resource++mockup/inlinevalidation/pattern",
"tinymce-nonbreaking": "++plone++static/components/tinymce-builded/js/tinymce/plugins/nonbreaking/plugin",
"JSXTransformer": "++plone++static/components/react/JSXTransformer",
"tinymce-bbcode": "++plone++static/components/tinymce-builded/js/tinymce/plugins/bbcode/plugin",
"mockup-patterns-upload-url": "++resource++mockup/upload",
"castle-advantage-url": "++plone++castle-advantage",
"jquery.event.drop": "++resource++mockuplib/jquery.event.drop",
"tinymce-searchreplace": "++plone++static/components/tinymce-builded/js/tinymce/plugins/searchreplace/plugin",
"select2": "++plone++static/components/select2/select2",
"ace-mode-css": "++plone++static/components/ace-builds/src/mode-css",
"tinymce-hr": "++plone++static/components/tinymce-builded/js/tinymce/plugins/hr/plugin",
"tinymce-importcss": "++plone++static/components/tinymce-builded/js/tinymce/plugins/importcss/plugin",
"bootstrap-dropdown": "++plone++static/components/bootstrap/js/dropdown",
"documentviewer-toc": "++resource++fbigovct/toc/docviewer",
"mockup-patterns-relateditems": "++plone++castle/patterns/relateditems",
"mockup-patterns-select2": "++resource++mockup/select2/pattern",
"mockup-patterns-toggle": "++resource++mockup/toggle/pattern",
"castle-advantage-logged-in": "++plone++castle-advantage/logged-in",
"castle-advantage-public": "++plone++castle-advantage/public",
"castle-dashboard-welcome": "++plone++castle/components/dashboard-welcome",
"tinymce-print": "++plone++static/components/tinymce-builded/js/tinymce/plugins/print/plugin",
"bootstrap-tooltip": "++plone++static/components/bootstrap/js/tooltip",
"resource-plone-app-discussion-javascripts-comments": "++resource++plone.app.discussion.javascripts/comments",
"picker.date": "++plone++static/components/pickadate/lib/picker.date",
"mosaic-base-url": "++plone++mosaic/js",
"logging": "++plone++static/components/logging/src/logging",
"mockup-patterns-moment": "++resource++mockup/moment/pattern",
"tinymce-autolink": "++plone++static/components/tinymce-builded/js/tinymce/plugins/autolink/plugin",
"mockup-patterns-backdrop": "++resource++mockup/backdrop/pattern",
"xlswidget": "++resource++fbigovct/toc/xlswidget",
"tinymce-noneditable": "++plone++static/components/tinymce-builded/js/tinymce/plugins/noneditable/plugin",
"ace": "++plone++static/components/ace-builds/src/ace",
"plone": "++plone++castle/plone",
"mockup-patterns-resourceregistry-url": "++resource++mockup/resourceregistry",
"mockup-patterns-recurrence": "++resource++mockup/recurrence/pattern",
"jquery.tmpl": "++plone++static/components/jquery.recurrenceinput.js/lib/jquery.tmpl",
"mockup-patterns-tooltip": "++resource++mockup/tooltip/pattern",
"mockup-patterns-livesearch": "++resource++mockup/livesearch/pattern",
"tinymce-preview": "++plone++static/components/tinymce-builded/js/tinymce/plugins/preview/plugin",
"tinymce-contextmenu": "++plone++static/components/tinymce-builded/js/tinymce/plugins/contextmenu/plugin",
"jquery-highlightsearchterms": "jquery.highlightsearchterms",
"rjs": "++plone++static/components/r.js/dist/r",
"mockup-patterns-cookietrigger": "++resource++mockup/cookietrigger/pattern",
"tinymce-wordcount": "++plone++static/components/tinymce-builded/js/tinymce/plugins/wordcount/plugin",
"mockup-patterns-sortable": "++resource++mockup/sortable/pattern",
"mockup-patterns-tinymce": "++plone++castle/patterns/tinymce/pattern",
"pat-logger": "++plone++static/components/patternslib/src/core/logger",
"pat-registry": "++plone++static/components/patternslib/src/core/registry",
"castle-components-slide": "++plone++castle/components/slide",
"resourceregistry": "++plone++static/resourceregistry",
"picker": "++plone++static/components/pickadate/lib/picker",
"backbone.paginator": "++plone++static/components/backbone.paginator/lib/backbone.paginator"
},
shim: {
"jquery.cookie": {
deps: ["jquery"]
},
"jquery.recurrenceinput": {
deps: ["jquery", "resource-plone-app-jquerytools-js", "resource-plone-app-jquerytools-dateinput-js", "jquery.tmpl"]
},
"jquery.event.drag": {
deps: ["jquery"]
},
"bootstrap-alert": {
deps: ["jquery"]
},
"tinymce-pagebreak": {
deps: ["tinymce"]
},
"tinymce-hr": {
deps: ["tinymce"]
},
"tinymce-importcss": {
deps: ["tinymce"]
},
"tinymce-autosave": {
deps: ["tinymce"]
},
"tinymce-compat3x": {
deps: ["tinymce"]
},
"tinymce-searchreplace": {
deps: ["tinymce"]
},
"tinymce-advlist": {
deps: ["tinymce"]
},
"expect": {
exports: "window.expect"
},
"tinymce-preview": {
deps: ["tinymce"]
},
"picker.date": {
deps: ["picker"]
},
"tinymce-fullscreen": {
deps: ["tinymce"]
},
"tinymce": {
exports: "window.tinyMCE",
init: function () { this.tinyMCE.DOM.events.domLoaded = true; return this.tinyMCE; }
},
"tinymce-charmap": {
deps: ["tinymce"]
},
"bootstrap-dropdown": {
deps: ["jquery"]
},
"tinymce-anchor": {
deps: ["tinymce"]
},
"tinymce-emoticons": {
deps: ["tinymce"]
},
"bootstrap-transition": {
exports: "window.jQuery.support.transition",
deps: ["jquery"]
},
"tinymce-print": {
deps: ["tinymce"]
},
"tinymce-spellchecker": {
deps: ["tinymce"]
},
"tinymce-visualblocks": {
deps: ["tinymce"]
},
"tinymce-visualchars": {
deps: ["tinymce"]
},
"tinymce-media": {
deps: ["tinymce"]
},
"sinon": {
exports: "window.sinon"
},
"castle-components-usersgroups": {
deps: ["plone-logged-in"]
},
"bootstrap-tooltip": {
deps: ["jquery"]
},
"castle-components-review-archives": {
deps: ["plone-logged-in"]
},
"tinymce-link": {
deps: ["tinymce"]
},
"tinymce-template": {
deps: ["tinymce"]
},
"tinymce-paste": {
deps: ["tinymce"]
},
"tinymce-directionality": {
deps: ["tinymce"]
},
"tinymce-autolink": {
deps: ["tinymce"]
},
"castle-components-tag-manager": {
deps: ["plone-logged-in"]
},
"castle-components-manage-archives": {
deps: ["plone-logged-in"]
},
"tinymce-tabfocus": {
deps: ["tinymce"]
},
"tinymce-fullpage": {
deps: ["tinymce"]
},
"tinymce-code": {
deps: ["tinymce"]
},
"castle-components-search": {
deps: ["plone"]
},
"tinymce-save": {
deps: ["tinymce"]
},
"tinymce-legacyoutput": {
deps: ["tinymce"]
},
"jquery.tmpl": {
deps: ["jquery"]
},
"resource-plone-app-jquerytools-dateinput-js": {
deps: ["jquery"]
},
"tinymce-colorpicker": {
deps: ["tinymce"]
},
"castle-components-history": {
deps: ["plone-logged-in"]
},
"bootstrap-collapse": {
exports: "window.jQuery.fn.collapse.Constructor",
deps: ["jquery"]
},
"tinymce-image": {
deps: ["tinymce"]
},
"tinymce-insertdatetime": {
deps: ["tinymce"]
},
"tinymce-modern-theme": {
deps: ["tinymce"]
},
"tinymce-contextmenu": {
deps: ["tinymce"]
},
"js-shortcuts": {
deps: ["jquery"]
},
"tinymce-noneditable": {
deps: ["tinymce"]
},
"tinymce-nonbreaking": {
deps: ["tinymce"]
},
"JSXTransformer": {
exports: "window.JSXTransformer"
},
"tinymce-bbcode": {
deps: ["tinymce"]
},
"tinymce-textcolor": {
deps: ["tinymce"]
},
"tinymce-table": {
deps: ["tinymce"]
},
"tinymce-wordcount": {
deps: ["tinymce"]
},
"tinymce-textpattern": {
deps: ["tinymce"]
},
"backbone.paginator": {
exports: "window.Backbone.Paginator",
deps: ["backbone"]
},
"jqtree-contextmenu": {
deps: ["jqtree"]
},
"tinymce-lists": {
deps: ["tinymce"]
},
"jqtree": {
deps: ["jquery"]
},
"picker.time": {
deps: ["picker"]
},
"underscore": {
exports: "window._"
},
"castle-components-slide": {
deps: ["plone-logged-in"]
},
"backbone": {
exports: "window.Backbone",
deps: ["underscore", "jquery"]
},
"tinymce-autoresize": {
deps: ["tinymce"]
},
"jquery.event.drop": {
exports: "$.drop",
deps: ["jquery"]
},
"resource-plone-app-jquerytools-js": {
deps: ["jquery"]
},
"castle-components-audit": {
deps: ["plone-logged-in"]
}
},
optimize: 'uglify',
wrapShim: true
});
// End Bundle: _configjs
// Start Bundle: plone
!function(){function t(l,u){return function(t){var e=arguments.length;if(!(e<2||null==t))for(var n=1;n
":">",'"':""","'":"'","`":"`"}),d=g.invert(a),N=(g.escape=P(a),g.unescape=P(d),g.result=function(t,e,n){e=null==t?void 0:t[e];return g.isFunction(e=void 0===e?n:e)?e.call(t):e},0),A=(g.uniqueId=function(t){var e=++N+"";return t?t+e:e},g.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},/(.)^/),H={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},R=/\\|'|\r|\n|\u2028|\u2029/g;g.template=function(a,t,e){t=g.defaults({},t=!t&&e?e:t,g.templateSettings);var e=RegExp([(t.escape||A).source,(t.interpolate||A).source,(t.evaluate||A).source].join("|")+"|$","g"),s=0,r="__p+='";a.replace(e,function(t,e,n,i,o){return r+=a.slice(s,o).replace(R,O),s=o+t.length,e?r+="'+\n((__t=("+e+"))==null?'':_.escape(__t))+\n'":n?r+="'+\n((__t=("+n+"))==null?'':__t)+\n'":i&&(r+="';\n"+i+"\n__p+='"),t}),r+="';\n",r="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+(r=t.variable?r:"with(obj||{}){\n"+r+"}\n")+"return __p;\n";try{var n=new Function(t.variable||"obj","_",r)}catch(t){throw t.source=r,t}function i(t){return n.call(this,t,g)}e=t.variable||"obj";return i.source="function("+e+"){\n"+r+"}",i},g.chain=function(t){t=g(t);return t._chain=!0,t};g.mixin=function(n){g.each(g.functions(n),function(t){var e=g[t]=n[t];g.prototype[t]=function(){var t=[this._wrapped];return r.apply(t,arguments),Y(this,e.apply(g,t))}})},g.mixin(g),g.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var n=o[e];g.prototype[e]=function(){var t=this._wrapped;return n.apply(t,arguments),"shift"!==e&&"splice"!==e||0!==t.length||delete t[0],Y(this,t)}}),g.each(["concat","join","slice"],function(t){var e=o[t];g.prototype[t]=function(){return Y(this,e.apply(this._wrapped,arguments))}}),g.prototype.value=function(){return this._wrapped},g.prototype.valueOf=g.prototype.toJSON=g.prototype.value,g.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return g})}.call(this),function(){Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");function e(){return i.apply(this instanceof o&&t?this:t,n.concat(Array.prototype.slice.call(arguments)))}var n=Array.prototype.slice.call(arguments,1),i=this,o=function(){};return o.prototype=this.prototype,e.prototype=new o,e});var n,i={DEBUG:10,INFO:20,WARN:30,ERROR:40,FATAL:50};function t(){}function e(){}function a(t,e){this._loggers={},this.name=t||"",this._parent=e||null,e||(this._enabled=!0,this._level=i.WARN)}function o(t){n=t}t.prototype={output:function(t,e,n){void 0!==window.console&&void 0!==console.log&&(t&&n.unshift(t+":"),t=n.join(" "),console.info,e<=i.DEBUG?(t="[DEBUG] "+t,console.log(t)):e<=i.INFO?console.info(t):e<=i.WARN?console.warn(t):console.error(t))}},e.prototype={output:function(t,e,n){t&&n.unshift(t+":"),(e<=i.DEBUG?(n.unshift("[DEBUG]"),console.log):e<=i.INFO?console.info:e<=i.WARN?console.warn:console.error).apply(console,n)}},a.prototype={getLogger:function(t){for(var e=t.split("."),n=this,i=this.name?[this.name]:[];e.length;){var o=e.shift();i.push(o),o in n._loggers||(n._loggers[o]=new a(i.join("."),n)),n=n._loggers[o]}return n},_getFlag:function(t){var e=this;for(t="_"+t;null!==e;){if(void 0!==e[t])return e[t];e=e._parent}return null},setEnabled:function(t){this._enabled=!!t},isEnabled:function(){this._getFlag("enabled")},setLevel:function(t){"number"==typeof t?this._level=t:"string"==typeof t&&(t=t.toUpperCase())in i&&(this._level=i[t])},getLevel:function(){return this._getFlag("level")},log:function(t,e){!e.length||!this._getFlag("enabled")||t>>0;if("function"!=typeof t)throw new TypeError(t+" is not a function");for(1n||t.top>e)},removeWildcardClass:function(t,e){var o;-1===e.indexOf("*")?t.removeClass(e):(o=(o=e.replace(/[\-\[\]{}()+?.,\\\^$|#\s]/g,"\\$&")).replace(/[*]/g,".*"),o=new RegExp("^"+o+"$"),t.filter("[class]").each(function(){for(var t=a(this),e=t.attr("class").split(/\s+/),n=[],i=0;i>>0;if("function"!=typeof t)throw new TypeError;for(var i=arguments[1],o=0;o>>0;if("function"!=typeof t)throw new TypeError;for(var i,o=[],a=arguments[1],s=0;s>>0;if("[object Function]"!=={}.toString.call(t))throw new TypeError(t+" is not a function");for(e&&(n=e),i=0;i>>0;if(0!=n){var i=0;if(0>>0;if(0!=n)for(var i=n,o=(1>>0;if("[object Function]"!=={}.toString.call(t))throw new TypeError(t+" is not a function");for(e&&(n=e),i=new Array(r),o=0;o>0;if("function"!=typeof t)throw new TypeError("First argument is not callable");if(arguments.length<2){if(0==i)throw new TypeError("Array length is 0 and no second argument");e=this[0],n=1}else e=arguments[1];for(;n>>0;if("function"!=typeof t)throw new TypeError;if(0==n&&1===arguments.length)throw new TypeError;var i,o=n-1;if(2<=arguments.length)i=arguments[1];else for(;;){if(o in this){i=this[o--];break}if(--o<0)throw new TypeError}for(;0<=o;)o in e&&(i=t.call(void 0,i,e[o],o,e)),o--;return i}),Array.prototype.some||(Array.prototype.some=function(t){"use strict";if(null===this)throw new TypeError;var e=Object(this),n=e.length>>>0;if("function"!=typeof t)throw new TypeError;for(var i=arguments[1],o=0;oa-e.height()/2&&e.scrollTop(n-(e.height()-t.height())/2)})},l.fn.setPositionAbsolute=function(a,s,r){return this.each(function(){var t=l(this),e=l(this).width(),n=a.offset(),i=a.width(),o=a.height(),i=n.left+i-e+r,n=n.top+o+s;t.css({"z-index":1,position:"absolute",marginLeft:0,marginTop:0,left:i+"px",top:n+"px",width:e}),t.remove().appendTo("body").show()})},l.fn.positionAncestor=function(o){var a=0,s=0;return this.each(function(){var t,e,n,i=l(this).closest(o);if(i.length&&"static"!==i.css("position"))return t=(e=l(this)).offset().left-parseInt(e.css("marginLeft"),10),e=e.offset().top-parseInt(e.css("marginTop"),10),n=i.offset().left+parseInt(i.css("borderLeftWidth"),10),i=i.offset().top+parseInt(i.css("borderTopWidth"),10),a=t-n,s=e-i,!1}),{left:a,top:s}},String.prototype.startsWith=function(t){return null!==this.match("^"+t)},String.prototype.endsWith=function(t){return null!==this.match(t+"$")},l.simplePlaceholder={placeholder_class:null,hide_placeholder:function(){var t=l(this);t.val()===t.attr("placeholder")&&t.val("").removeClass(l.simplePlaceholder.placeholder_class)},show_placeholder:function(){var t=l(this);""===t.val()&&t.val(t.attr("placeholder")).addClass(l.simplePlaceholder.placeholder_class)},prevent_placeholder_submit:function(){return l(this).find(".simple-placeholder").each(function(){var t=l(this);t.val()===t.attr("placeholder")&&t.val("")}),!0}},l.fn.simplePlaceholder=function(t){var e;return void 0===document.createElement("input").placeholder&&(e={placeholder_class:"placeholding"},t&&l.extend(e,t),l.simplePlaceholder.placeholder_class=e.placeholder_class,this.each(function(){var t=l(this);t.focus(l.simplePlaceholder.hide_placeholder),t.blur(l.simplePlaceholder.show_placeholder),""===t.val()&&(t.val(t.attr("placeholder")),t.addClass(l.simplePlaceholder.placeholder_class)),t.addClass("simple-placeholder"),l(this.form).submit(l.simplePlaceholder.prevent_placeholder_submit)})),this},l.fn.findInclusive=function(t){return this.find("*").addBack().filter(t)},l.fn.slideIn=function(t,e,n){return this.animate({width:"show"},t,e,n)},l.fn.slideOut=function(t,e,n){return this.animate({width:"hide"},t,e,n)},l.expr[":"].Contains=function(t,e,n){return 0<=l(t).text().toUpperCase().indexOf(n[3].toUpperCase())},l.fn.scopedFind=function(t){return t.startsWith("#")?l(t):this.find(t)}}),define("pat-registry",["jquery","underscore","pat-logger","pat-utils","pat-compat","pat-jquery-ext"],function(o,a,s,i){for(var t,r=s.getLogger("registry"),e=/patterns-disable=([^&]+)/g,n=/patterns-dont-catch/g,l=!1,u={};null!==(t=e.exec(window.location.search));)u[t[1]]=!0,r.info("Pattern disabled via url config:",t[1]);for(;null!==(t=n.exec(window.location.search));)l=!0,r.info("I will not catch init exceptions");var c={patterns:{},initialized:!1,init:function(){o(document).ready(function(){r.info("loaded: "+Object.keys(c.patterns).sort().join(", ")),c.scan(document.body),c.initialized=!0,r.info("finished initial scan.")})},clear:function(){this.patterns={}},transformPattern:function(e,t){if(u[e])r.debug("Skipping disabled pattern:",e);else{var n=c.patterns[e];if(n.transform)try{n.transform(o(t))}catch(t){if(l)throw t;r.error("Transform error for pattern"+e,t)}}},initPattern:function(t,e,n){var e=o(e),i=c.patterns[t];if(i.init&&(plog=s.getLogger("pat."+t),e.is(i.trigger))){plog.debug("Initialising:",e);try{i.init(e,null,n),plog.debug("done.")}catch(t){if(l)throw t;plog.error("Caught error:",t)}}},orderPatterns:function(t){return a.contains(t,"validation")&&a.contains(t,"inject")&&(t.splice(t.indexOf("validation"),1),t.unshift("validation")),t},scan:function(t,n,i){var e=[];(n=this.orderPatterns(n||Object.keys(c.patterns))).forEach(a.partial(this.transformPattern,a,t)),n=a.each(n,function(t){t=c.patterns[t];t.trigger&&e.unshift(t.trigger)}),o(t).findInclusive(e.join(",")).filter(function(){return 0===o(this).parents("pre").length}).filter(":not(.cant-touch-this)").toArray().reduceRight(function(t,e){n.forEach(a.partial(this.initPattern,a,e,i))}.bind(this),null),o("body").addClass("patterns-loaded")},register:function(t,e){var n;return(e=e||t.name)?c.patterns[e]?(r.error("Already have a pattern called: "+e),!1):((c.patterns[e]=t).jquery_plugin&&(n=("pat-"+e).replace(/-([a-zA-Z])/g,function(t,e){return e.toUpperCase()}),o.fn[n]=i.jqueryPlugin(t),o.fn[n.replace(/^pat/,"pattern")]=o.fn[n]),r.debug("Registered pattern:",e,t),c.initialized&&c.scan(document.body,[e]),!0):(r.error("Pattern lacks a name:",t),!1)}};return o(document).on("patterns-injected.patterns",function(t,e,n,i){3!==i.nodeType&&8!==i&&(c.scan(i,null,{type:"injection",element:n}),o(i).trigger("patterns-injected-scanned"))}),c}),define("pat-mockup-parser",["jquery"],function(s){"use strict";return{getOptions:function t(e,n,i){i=i||{},0===e.length||s.nodeName(e[0],"body")||(i=t(e.parent(),n,i));var o,a={};return 0!==e.length&&(a=e.data("pat-"+n))&&"string"==typeof a&&(o={},s.each(a.split(";"),function(t,e){(e=e.split(":")).reverse();var n=(n=e.pop()).replace(/^\s+|\s+$/g,"");e.reverse();e=(e=e.join(":")).replace(/^\s+|\s+$/g,"");o[n]=e}),a=o),s.extend(!0,{},i,a)}}}),define("pat-base",["jquery","pat-registry","pat-mockup-parser","pat-logger"],function(o,s,r,l){"use strict";function a(t,e,n){var i=this.prototype.name,o=l.getLogger("pat."+i),a=t.data("pattern-"+i);if(void 0===a&&s.patterns[i]){try{e="mockup"===this.prototype.parser?r.getOptions(t,i,e):e,a=new s.patterns[i](t,e,n)}catch(t){o.error("Failed while initializing '"+i+"' pattern.",t)}t.data("pattern-"+i,a)}return a}function u(t,e,n){this.$el=t,this.options=o.extend(!0,{},this.defaults||{},e||{}),this.init(t,e,n),this.emit("init")}var c=l.getLogger("Patternslib Base");return u.prototype={constructor:u,on:function(t,e){this.$el.on(t+"."+this.name+".patterns",e)},emit:function(t,e){this.$el.trigger(t+"."+this.name+".patterns",e=void 0===e?[]:e)}},u.extend=function(t){var e,n=this;if(!t)throw new Error("Pattern configuration properties required when calling Base.extend");(e=t.hasOwnProperty("constructor")?t.constructor:function(){n.apply(this,arguments)}).extend=u.extend,e.init=a,e.jquery_plugin=!0,e.trigger=t.trigger;function i(){this.constructor=e}return i.prototype=n.prototype,e.prototype=new i,o.extend(!0,e.prototype,t),e.__super__=n.prototype,t.name?t.trigger?s.register(e,t.name):c.warn("The pattern '"+t.name+"' does not have a trigger attribute, it will not be registered."):c.warn("This pattern without a name attribute will not be registered!"),e},u}),define("mockup-patterns-backdrop",["jquery","pat-base"],function(t,e){"use strict";return e.extend({name:"backdrop",trigger:".pat-backdrop",parser:"mockup",defaults:{zIndex:null,opacity:.8,className:"plone-backdrop",classActiveName:"plone-backdrop-active",closeOnEsc:!0,closeOnClick:!0},init:function(){var n=this;n.$backdrop=t("> ."+n.options.className,n.$el),0===n.$backdrop.size()&&(n.$backdrop=t("").hide().appendTo(n.$el).addClass(n.options.className),null!==n.options.zIndex)&&n.$backdrop.css("z-index",n.options.zIndex),!0===n.options.closeOnEsc&&t(document).on("keydown",function(t,e){n.$el.is("."+n.options.classActiveName)&&27===t.keyCode&&n.hide()}),!0===n.options.closeOnClick&&n.$backdrop.on("click",function(){n.$el.is("."+n.options.classActiveName)&&n.hide()})},show:function(){var t=this;t.$el.hasClass(t.options.classActiveName)||(t.emit("show"),t.$backdrop.css("opacity","0").show(),t.$el.addClass(t.options.classActiveName),t.$backdrop.animate({opacity:t.options.opacity},500),t.emit("shown"))},hide:function(){var t=this;t.$el.hasClass(t.options.classActiveName)&&(t.emit("hide"),t.$backdrop.animate({opacity:"0"},500).hide(),t.$el.removeClass(t.options.classActiveName),t.emit("hidden"))}})}),function(i,o){var t;"function"==typeof define&&define.amd?define("backbone",["underscore","jquery","exports"],function(t,e,n){i.Backbone=o(i,n,t,e)}):"undefined"!=typeof exports?(t=require("underscore"),o(i,exports,t)):i.Backbone=o(i,{},i._,i.jQuery||i.Zepto||i.ender||i.$)}(this,function(t,s,w,e){var n=t.Backbone,i=[],o=i.slice,a=(s.VERSION="1.1.2",s.$=e,s.noConflict=function(){return t.Backbone=n,this},s.emulateHTTP=!1,s.emulateJSON=!1,s.Events={on:function(t,e,n){return d(this,"on",t,[e,n])&&e&&(this._events||(this._events={}),(this._events[t]||(this._events[t]=[])).push({callback:e,context:n,ctx:n||this})),this},once:function(t,e,n){var i,o;return d(this,"once",t,[e,n])&&e?(i=this,(o=w.once(function(){i.off(t,o),e.apply(this,arguments)}))._callback=e,this.on(t,o,n)):this},off:function(t,e,n){var i,o,a,s,r,l,u,c;if(this._events&&d(this,"off",t,[e,n]))if(t||e||n){for(r=0,l=(s=t?[t]:w.keys(this._events)).length;r").attr(t),this.setElement(t,!1))}}),s.sync=function(t,e,n){var i,o=f[t],a=(w.defaults(n=n||{},{emulateHTTP:s.emulateHTTP,emulateJSON:s.emulateJSON}),{type:o,dataType:"json"}),t=(n.url||(a.url=w.result(e,"url")||C()),null!=n.data||!e||"create"!==t&&"update"!==t&&"patch"!==t||(a.contentType="application/json",a.data=JSON.stringify(n.attrs||e.toJSON(n))),n.emulateJSON&&(a.contentType="application/x-www-form-urlencoded",a.data=a.data?{model:a.data}:{}),!n.emulateHTTP||"PUT"!==o&&"DELETE"!==o&&"PATCH"!==o||(a.type="POST",n.emulateJSON&&(a.data._method=o),i=n.beforeSend,n.beforeSend=function(t){if(t.setRequestHeader("X-HTTP-Method-Override",o),i)return i.apply(this,arguments)}),"GET"===a.type||n.emulateJSON||(a.processData=!1),"PATCH"===a.type&&m&&(a.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")}),n.xhr=s.ajax(w.extend(a,n)));return e.trigger("request",e,t,n),t},!("undefined"==typeof window||!window.ActiveXObject||window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent)),f={create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"},e=(s.ajax=function(){return s.$.ajax.apply(s.$,arguments)},s.Router=function(t){(t=t||{}).routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)}),g=/\((.*?)\)/g,_=/(\(\?)?:\w+/g,v=/\*\w+/g,y=/[\-{}\[\]+?.,\\\^$|#\s]/g,b=(w.extend(e.prototype,a,{initialize:function(){},route:function(e,n,i){w.isRegExp(e)||(e=this._routeToRegExp(e)),w.isFunction(n)&&(i=n,n=""),i=i||this[n];var o=this;return s.history.route(e,function(t){t=o._extractParameters(e,t);o.execute(i,t),o.trigger.apply(o,["route:"+n].concat(t)),o.trigger("route",n,t),s.history.trigger("route",o,n,t)}),this},execute:function(t,e){t&&t.apply(this,e)},navigate:function(t,e){return s.history.navigate(t,e),this},_bindRoutes:function(){if(this.routes){this.routes=w.result(this,"routes");for(var t,e=w.keys(this.routes);null!=(t=e.pop());)this.route(t,this.routes[t])}},_routeToRegExp:function(t){return t=t.replace(y,"\\$&").replace(g,"(?:$1)?").replace(_,function(t,e){return e?t:"([^/?]+)"}).replace(v,"([^?]*?)"),new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var n=t.exec(e).slice(1);return w.map(n,function(t,e){return e===n.length-1?t||null:t?decodeURIComponent(t):null})}}),s.History=function(){this.handlers=[],w.bindAll(this,"checkUrl"),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)}),L=/^[#\/]|\s+$/g,k=/^\/+|\/+$/g,D=/msie [\w.]+/,S=/\/$/,x=/#.*$/,C=(b.started=!1,w.extend(b.prototype,a,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root},getHash:function(t){t=(t||this).location.href.match(/#(.*)$/);return t?t[1]:""},getFragment:function(t,e){return null==t&&(this._hasPushState||!this._wantsHashChange||e?(t=decodeURI(this.location.pathname+this.location.search),e=this.root.replace(S,""),t.indexOf(e)||(t=t.slice(e.length))):t=this.getHash()),t.replace(L,"")},start:function(t){if(b.started)throw new Error("Backbone.history has already been started");b.started=!0,this.options=w.extend({root:"/"},this.options,t),this.root=this.options.root,this._wantsHashChange=!1!==this.options.hashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var t=this.getFragment(),e=document.documentMode,e=D.exec(navigator.userAgent.toLowerCase())&&(!e||e<=7),n=(this.root=("/"+this.root+"/").replace(k,"/"),e&&this._wantsHashChange&&(n=s.$(' ")).eq(0).html()},QueryHelper:function(t){var r=this;return r.options=l.extend({},{pattern:null,vocabularyUrl:null,searchParam:"SearchableText",pathOperator:"plone.app.querystring.operation.string.path",attributes:["UID","Title","Description","getURL","portal_type"],batchSize:10,baseCriteria:[],sort_on:"is_folderish",sort_order:"reverse",pathDepth:1},t),r.pattern=r.options.pattern,void 0!==r.pattern&&null!==r.pattern||(r.pattern={browsing:!1,basePath:"/"}),r.options.url&&!r.options.vocabularyUrl?r.options.vocabularyUrl=r.options.url:r.pattern.vocabularyUrl&&(r.options.vocabularyUrl=r.pattern.vocabularyUrl),r.valid=Boolean(r.options.vocabularyUrl),r.getBatch=function(t){return{page:t||1,size:r.options.batchSize}},r.getCurrentPath=function(){var t=r.pattern,e=r.currentPath||t.currentPath,e=e="function"==typeof e?e():e;return e=e||t.basePath||t.options.basePath||"/"},r.getCriterias=function(t,e){var n=[];return(e=l.extend({},{useBaseCriteria:!0,additionalCriterias:[]},e=void 0===e?{}:e)).useBaseCriteria&&(n=r.options.baseCriteria.slice(0)),t&&n.push({i:r.options.searchParam,o:"plone.app.querystring.operation.string.contains",v:t+="*"}),e.searchPath?n.push({i:"path",o:r.options.pathOperator,v:e.searchPath+"::"+r.options.pathDepth}):r.pattern.browsing&&n.push({i:"path",o:r.options.pathOperator,v:r.getCurrentPath()+"::"+r.options.pathDepth}),n=n.concat(e.additionalCriterias)},r.getQueryData=function(t,e){t={query:JSON.stringify({criteria:r.getCriterias(t),sort_on:r.options.sort_on,sort_order:r.options.sort_order}),attributes:JSON.stringify(r.options.attributes)};return e&&(t.batch=JSON.stringify(r.getBatch(e))),t},r.getUrl=function(){var t=r.options.vocabularyUrl;return-1===t.indexOf("?")?t+="?":t+="&",t+l.param(r.getQueryData())},r.selectAjax=function(){return{url:r.options.vocabularyUrl,dataType:"JSON",quietMillis:100,data:function(t,e){return r.getQueryData(t,e)},results:function(t,e){e=10*e input[type="submit"]',content:"#content",automaticallyAddButtonActions:!0,loadLinksWithinModal:!0,prependContent:".portalMessage",templateOptions:{className:"plone-modal fade",classDialog:"plone-modal-dialog",classModal:"plone-modal-content",classHeaderName:"plone-modal-header",classBodyName:"plone-modal-body",classFooterName:"plone-modal-footer",classWrapperName:"plone-modal-wrapper",classWrapperInnerName:"modal-wrapper-inner",classActiveName:"in",classPrependName:"",classContentName:"",template:'